MCPcopy Create free account
hub / github.com/pingdotgg/t3code / parseOpenCodeModelSlug

Function parseOpenCodeModelSlug

apps/server/src/provider/opencodeRuntime.ts:163–180  ·  view source on GitHub ↗
(
  slug: string | null | undefined,
)

Source from the content-addressed store, hash-verified

161}
162
163export function parseOpenCodeModelSlug(
164 slug: string | null | undefined,
165): ParsedOpenCodeModelSlug | null {
166 if (typeof slug !== "string") {
167 return null;
168 }
169
170 const trimmed = slug.trim();
171 const separator = trimmed.indexOf("/");
172 if (separator <= 0 || separator === trimmed.length - 1) {
173 return null;
174 }
175
176 return {
177 providerID: trimmed.slice(0, separator),
178 modelID: trimmed.slice(separator + 1),
179 };
180}
181
182export function openCodeQuestionId(
183 index: number,

Callers 1

makeOpenCodeAdapterFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected