MCPcopy Index your code
hub / github.com/github/copilot-sdk / generate

Function generate

scripts/codegen/go.ts:4457–4478  ·  view source on GitHub ↗
(sessionSchemaPath?: string, apiSchemaPath?: string)

Source from the content-addressed store, hash-verified

4455}
4456
4457async function generate(sessionSchemaPath?: string, apiSchemaPath?: string): Promise<void> {
4458 let apiSchemaForSharing: ApiSchema | undefined;
4459 try {
4460 const resolvedApiPath = apiSchemaPath ?? (await getApiSchemaPath());
4461 apiSchemaForSharing = fixNullableRequiredRefsInApiSchema(cloneSchemaForCodegen((await loadSchemaJson(resolvedApiPath)) as ApiSchema));
4462 } catch (err) {
4463 if ((err as NodeJS.ErrnoException).code !== "ENOENT" || apiSchemaPath) {
4464 throw err;
4465 }
4466 }
4467
4468 await generateSessionEvents(sessionSchemaPath, apiSchemaForSharing);
4469 try {
4470 await generateRpc(apiSchemaPath);
4471 } catch (err) {
4472 if ((err as NodeJS.ErrnoException).code === "ENOENT" && !apiSchemaPath) {
4473 console.log("Go: skipping RPC (api.schema.json not found)");
4474 } else {
4475 throw err;
4476 }
4477 }
4478}
4479
4480const __filename = fileURLToPath(import.meta.url);
4481

Callers 1

go.tsFile · 0.70

Calls 7

cloneSchemaForCodegenFunction · 0.85
loadSchemaJsonFunction · 0.85
getApiSchemaPathFunction · 0.70
generateSessionEventsFunction · 0.70
generateRpcFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…