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

Function collectInternalSymbols

scripts/codegen/utils.ts:644–667  ·  view source on GitHub ↗
(schema: JSONSchema7)

Source from the content-addressed store, hash-verified

642 * also picked up.
643 */
644export function collectInternalSymbols(schema: JSONSchema7): {
645 typeNames: Set<string>;
646 fieldsByType: Map<string, Set<string>>;
647} {
648 const typeNames = new Set<string>();
649 const fieldsByType = new Map<string, Set<string>>();
650 const { definitions, $defs } = collectDefinitionCollections(schema as Record<string, unknown>);
651 const allDefs: Record<string, JSONSchema7Definition> = { ...definitions, ...$defs };
652 for (const [name, def] of Object.entries(allDefs)) {
653 if (!def || typeof def !== "object") continue;
654 const d = def as Record<string, unknown>;
655 if (d.visibility === "internal") typeNames.add(name);
656 const props = d.properties;
657 if (props && typeof props === "object" && !Array.isArray(props)) {
658 for (const [propName, propSchema] of Object.entries(props as Record<string, unknown>)) {
659 if (propSchema && typeof propSchema === "object" && (propSchema as Record<string, unknown>).visibility === "internal") {
660 if (!fieldsByType.has(name)) fieldsByType.set(name, new Set());
661 fieldsByType.get(name)!.add(propName);
662 }
663 }
664 }
665 }
666 return { typeNames, fieldsByType };
667}
668
669/**
670 * Post-process a Python module so that types marked `visibility: "internal"`

Callers 1

generateSessionEventsFunction · 0.85

Calls 4

addMethod · 0.45
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…