openlore 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -2
- package/dist/cli/commands/analyze.js +36 -23
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +18 -1
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/export/index.d.ts +10 -0
- package/dist/cli/export/index.d.ts.map +1 -0
- package/dist/cli/export/index.js +27 -0
- package/dist/cli/export/index.js.map +1 -0
- package/dist/cli/export/scip.d.ts +22 -0
- package/dist/cli/export/scip.d.ts.map +1 -0
- package/dist/cli/export/scip.js +95 -0
- package/dist/cli/export/scip.js.map +1 -0
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/manifest/detect/events.d.ts +31 -0
- package/dist/cli/manifest/detect/events.d.ts.map +1 -0
- package/dist/cli/manifest/detect/events.js +22 -0
- package/dist/cli/manifest/detect/events.js.map +1 -0
- package/dist/cli/manifest/detect/http-routes.d.ts +22 -0
- package/dist/cli/manifest/detect/http-routes.d.ts.map +1 -0
- package/dist/cli/manifest/detect/http-routes.js +18 -0
- package/dist/cli/manifest/detect/http-routes.js.map +1 -0
- package/dist/cli/manifest/detect/public-symbols.d.ts +46 -0
- package/dist/cli/manifest/detect/public-symbols.d.ts.map +1 -0
- package/dist/cli/manifest/detect/public-symbols.js +144 -0
- package/dist/cli/manifest/detect/public-symbols.js.map +1 -0
- package/dist/cli/manifest/emit.d.ts +103 -0
- package/dist/cli/manifest/emit.d.ts.map +1 -0
- package/dist/cli/manifest/emit.js +272 -0
- package/dist/cli/manifest/emit.js.map +1 -0
- package/dist/cli/manifest/index.d.ts +11 -0
- package/dist/cli/manifest/index.d.ts.map +1 -0
- package/dist/cli/manifest/index.js +31 -0
- package/dist/cli/manifest/index.js.map +1 -0
- package/dist/cli/manifest/schema-validator.d.ts +18 -0
- package/dist/cli/manifest/schema-validator.d.ts.map +1 -0
- package/dist/cli/manifest/schema-validator.js +77 -0
- package/dist/cli/manifest/schema-validator.js.map +1 -0
- package/dist/cli/manifest/validate.d.ts +15 -0
- package/dist/cli/manifest/validate.d.ts.map +1 -0
- package/dist/cli/manifest/validate.js +51 -0
- package/dist/cli/manifest/validate.js.map +1 -0
- package/dist/core/analyzer/artifact-generator.d.ts.map +1 -1
- package/dist/core/analyzer/artifact-generator.js +37 -3
- package/dist/core/analyzer/artifact-generator.js.map +1 -1
- package/dist/core/analyzer/call-graph.d.ts +9 -2
- package/dist/core/analyzer/call-graph.d.ts.map +1 -1
- package/dist/core/analyzer/call-graph.js +534 -1
- package/dist/core/analyzer/call-graph.js.map +1 -1
- package/dist/core/analyzer/embedding-service.d.ts +2 -0
- package/dist/core/analyzer/embedding-service.d.ts.map +1 -1
- package/dist/core/analyzer/embedding-service.js +4 -0
- package/dist/core/analyzer/embedding-service.js.map +1 -1
- package/dist/core/analyzer/fixtures/regression/sample.d.ts +9 -0
- package/dist/core/analyzer/fixtures/regression/sample.d.ts.map +1 -0
- package/dist/core/analyzer/fixtures/regression/sample.js +26 -0
- package/dist/core/analyzer/fixtures/regression/sample.js.map +1 -0
- package/dist/core/analyzer/iac/ansible.d.ts +18 -0
- package/dist/core/analyzer/iac/ansible.d.ts.map +1 -0
- package/dist/core/analyzer/iac/ansible.js +219 -0
- package/dist/core/analyzer/iac/ansible.js.map +1 -0
- package/dist/core/analyzer/iac/cdk.d.ts +26 -0
- package/dist/core/analyzer/iac/cdk.d.ts.map +1 -0
- package/dist/core/analyzer/iac/cdk.js +204 -0
- package/dist/core/analyzer/iac/cdk.js.map +1 -0
- package/dist/core/analyzer/iac/classify-yaml.d.ts +20 -0
- package/dist/core/analyzer/iac/classify-yaml.d.ts.map +1 -0
- package/dist/core/analyzer/iac/classify-yaml.js +81 -0
- package/dist/core/analyzer/iac/classify-yaml.js.map +1 -0
- package/dist/core/analyzer/iac/cloudformation.d.ts +15 -0
- package/dist/core/analyzer/iac/cloudformation.d.ts.map +1 -0
- package/dist/core/analyzer/iac/cloudformation.js +189 -0
- package/dist/core/analyzer/iac/cloudformation.js.map +1 -0
- package/dist/core/analyzer/iac/helm.d.ts +20 -0
- package/dist/core/analyzer/iac/helm.d.ts.map +1 -0
- package/dist/core/analyzer/iac/helm.js +229 -0
- package/dist/core/analyzer/iac/helm.js.map +1 -0
- package/dist/core/analyzer/iac/index.d.ts +23 -0
- package/dist/core/analyzer/iac/index.d.ts.map +1 -0
- package/dist/core/analyzer/iac/index.js +40 -0
- package/dist/core/analyzer/iac/index.js.map +1 -0
- package/dist/core/analyzer/iac/kubernetes.d.ts +14 -0
- package/dist/core/analyzer/iac/kubernetes.d.ts.map +1 -0
- package/dist/core/analyzer/iac/kubernetes.js +226 -0
- package/dist/core/analyzer/iac/kubernetes.js.map +1 -0
- package/dist/core/analyzer/iac/project.d.ts +16 -0
- package/dist/core/analyzer/iac/project.d.ts.map +1 -0
- package/dist/core/analyzer/iac/project.js +97 -0
- package/dist/core/analyzer/iac/project.js.map +1 -0
- package/dist/core/analyzer/iac/pulumi.d.ts +21 -0
- package/dist/core/analyzer/iac/pulumi.d.ts.map +1 -0
- package/dist/core/analyzer/iac/pulumi.js +190 -0
- package/dist/core/analyzer/iac/pulumi.js.map +1 -0
- package/dist/core/analyzer/iac/terraform.d.ts +19 -0
- package/dist/core/analyzer/iac/terraform.d.ts.map +1 -0
- package/dist/core/analyzer/iac/terraform.js +546 -0
- package/dist/core/analyzer/iac/terraform.js.map +1 -0
- package/dist/core/analyzer/iac/types.d.ts +67 -0
- package/dist/core/analyzer/iac/types.d.ts.map +1 -0
- package/dist/core/analyzer/iac/types.js +39 -0
- package/dist/core/analyzer/iac/types.js.map +1 -0
- package/dist/core/analyzer/signature-extractor.d.ts +6 -0
- package/dist/core/analyzer/signature-extractor.d.ts.map +1 -1
- package/dist/core/analyzer/signature-extractor.js +112 -2
- package/dist/core/analyzer/signature-extractor.js.map +1 -1
- package/dist/core/analyzer/spec-vector-index.d.ts +9 -2
- package/dist/core/analyzer/spec-vector-index.d.ts.map +1 -1
- package/dist/core/analyzer/spec-vector-index.js +111 -10
- package/dist/core/analyzer/spec-vector-index.js.map +1 -1
- package/dist/core/analyzer/vector-index.d.ts +33 -1
- package/dist/core/analyzer/vector-index.d.ts.map +1 -1
- package/dist/core/analyzer/vector-index.js +99 -10
- package/dist/core/analyzer/vector-index.js.map +1 -1
- package/dist/core/scip/index.d.ts +51 -0
- package/dist/core/scip/index.d.ts.map +1 -0
- package/dist/core/scip/index.js +210 -0
- package/dist/core/scip/index.js.map +1 -0
- package/dist/core/scip/moniker.d.ts +48 -0
- package/dist/core/scip/moniker.d.ts.map +1 -0
- package/dist/core/scip/moniker.js +109 -0
- package/dist/core/scip/moniker.js.map +1 -0
- package/dist/core/scip/schema.d.ts +34 -0
- package/dist/core/scip/schema.d.ts.map +1 -0
- package/dist/core/scip/schema.js +48 -0
- package/dist/core/scip/schema.js.map +1 -0
- package/dist/core/scip/vendor/scip.proto +910 -0
- package/dist/core/services/edge-store.d.ts +6 -0
- package/dist/core/services/edge-store.d.ts.map +1 -1
- package/dist/core/services/edge-store.js +8 -0
- package/dist/core/services/edge-store.js.map +1 -1
- package/dist/core/services/mcp-handlers/graph.d.ts.map +1 -1
- package/dist/core/services/mcp-handlers/graph.js +12 -0
- package/dist/core/services/mcp-handlers/graph.js.map +1 -1
- package/dist/core/services/mcp-handlers/orient.js +2 -2
- package/dist/core/services/mcp-handlers/orient.js.map +1 -1
- package/dist/core/services/mcp-handlers/semantic.d.ts.map +1 -1
- package/dist/core/services/mcp-handlers/semantic.js +23 -30
- package/dist/core/services/mcp-handlers/semantic.js.map +1 -1
- package/dist/core/services/mcp-watcher.d.ts.map +1 -1
- package/dist/core/services/mcp-watcher.js +14 -10
- package/dist/core/services/mcp-watcher.js.map +1 -1
- package/package.json +12 -1
- package/schemas/openlore-manifest-v1.json +191 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derivation of SCIP symbol monikers and language tags from OpenLore graph
|
|
3
|
+
* nodes.
|
|
4
|
+
*
|
|
5
|
+
* SCIP symbols are formatted strings, not structured objects, per the grammar
|
|
6
|
+
* documented at https://github.com/sourcegraph/scip/blob/main/docs/scip.md.
|
|
7
|
+
* We emit global symbols of the form:
|
|
8
|
+
*
|
|
9
|
+
* <scheme> ' ' <manager> ' ' <package-name> ' ' <version> <descriptors>
|
|
10
|
+
*
|
|
11
|
+
* where descriptors are `<repo-rel-path>/` (namespace) followed by
|
|
12
|
+
* `<qualified-name>(<arity>).` (method). Example:
|
|
13
|
+
*
|
|
14
|
+
* openlore npm openlore 2.0.2 `src/core/scip/index.ts`/exportScip(1).
|
|
15
|
+
*
|
|
16
|
+
* Identifiers containing characters outside the SCIP "simple identifier" set
|
|
17
|
+
* are backtick-escaped (with embedded backticks doubled).
|
|
18
|
+
*/
|
|
19
|
+
import type { FunctionNode } from '../analyzer/call-graph.js';
|
|
20
|
+
/** Package coordinates that fill the SCIP `<package>` slot of every symbol. */
|
|
21
|
+
export interface PackageInfo {
|
|
22
|
+
manager: string;
|
|
23
|
+
name: string;
|
|
24
|
+
version: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Map an OpenLore language tag (see signature-extractor.ts) to the SCIP
|
|
28
|
+
* `Language` enum name used as `Document.language`. Returns `''` for languages
|
|
29
|
+
* SCIP has no value for (the caller records these for the export summary).
|
|
30
|
+
*/
|
|
31
|
+
export declare function scipLanguageName(openloreLanguage: string): string;
|
|
32
|
+
/** Fully-qualified name within a file: `Class.method` or bare `function`. */
|
|
33
|
+
export declare function qualifiedName(node: FunctionNode): string;
|
|
34
|
+
/**
|
|
35
|
+
* Best-effort parameter count from a node's declaration `signature`. Counts
|
|
36
|
+
* top-level comma-separated parameters inside the first parenthesized group.
|
|
37
|
+
* Returns `undefined` when no signature is available (the analyzer does not
|
|
38
|
+
* persist arity directly — TODO(spec-04-followup): arity in analyzer).
|
|
39
|
+
*/
|
|
40
|
+
export declare function arityOf(node: FunctionNode): number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Build the SCIP symbol moniker string for a function node.
|
|
43
|
+
*
|
|
44
|
+
* `repoRelPath` must be the document's relative path (POSIX separators), the
|
|
45
|
+
* same value used for the node's `Document.relative_path`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function symbolMoniker(node: FunctionNode, repoRelPath: string, pkg: PackageInfo): string;
|
|
48
|
+
//# sourceMappingURL=moniker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moniker.d.ts","sourceRoot":"","sources":["../../../src/core/scip/moniker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAcD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAsBjE;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAoB9D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAM/F"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derivation of SCIP symbol monikers and language tags from OpenLore graph
|
|
3
|
+
* nodes.
|
|
4
|
+
*
|
|
5
|
+
* SCIP symbols are formatted strings, not structured objects, per the grammar
|
|
6
|
+
* documented at https://github.com/sourcegraph/scip/blob/main/docs/scip.md.
|
|
7
|
+
* We emit global symbols of the form:
|
|
8
|
+
*
|
|
9
|
+
* <scheme> ' ' <manager> ' ' <package-name> ' ' <version> <descriptors>
|
|
10
|
+
*
|
|
11
|
+
* where descriptors are `<repo-rel-path>/` (namespace) followed by
|
|
12
|
+
* `<qualified-name>(<arity>).` (method). Example:
|
|
13
|
+
*
|
|
14
|
+
* openlore npm openlore 2.0.2 `src/core/scip/index.ts`/exportScip(1).
|
|
15
|
+
*
|
|
16
|
+
* Identifiers containing characters outside the SCIP "simple identifier" set
|
|
17
|
+
* are backtick-escaped (with embedded backticks doubled).
|
|
18
|
+
*/
|
|
19
|
+
const SCHEME = 'openlore';
|
|
20
|
+
/** A simple identifier needs no escaping iff it matches this set entirely. */
|
|
21
|
+
const SIMPLE_IDENTIFIER = /^[A-Za-z0-9\-+$_]+$/;
|
|
22
|
+
/** Escape a name for use as a SCIP descriptor identifier. */
|
|
23
|
+
function escapeName(name) {
|
|
24
|
+
if (SIMPLE_IDENTIFIER.test(name))
|
|
25
|
+
return name;
|
|
26
|
+
// Escaped identifier: wrap in backticks, double any embedded backticks.
|
|
27
|
+
return '`' + name.replace(/`/g, '``') + '`';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Map an OpenLore language tag (see signature-extractor.ts) to the SCIP
|
|
31
|
+
* `Language` enum name used as `Document.language`. Returns `''` for languages
|
|
32
|
+
* SCIP has no value for (the caller records these for the export summary).
|
|
33
|
+
*/
|
|
34
|
+
export function scipLanguageName(openloreLanguage) {
|
|
35
|
+
switch (openloreLanguage) {
|
|
36
|
+
case 'Python':
|
|
37
|
+
case 'TypeScript':
|
|
38
|
+
case 'JavaScript':
|
|
39
|
+
case 'Go':
|
|
40
|
+
case 'Rust':
|
|
41
|
+
case 'Ruby':
|
|
42
|
+
case 'Java':
|
|
43
|
+
case 'Kotlin':
|
|
44
|
+
case 'PHP':
|
|
45
|
+
case 'Swift':
|
|
46
|
+
case 'C':
|
|
47
|
+
return openloreLanguage;
|
|
48
|
+
case 'C++':
|
|
49
|
+
return 'CPP';
|
|
50
|
+
case 'C#':
|
|
51
|
+
return 'CSharp';
|
|
52
|
+
default:
|
|
53
|
+
// 'unknown' and anything SCIP lacks an enum value for.
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Fully-qualified name within a file: `Class.method` or bare `function`. */
|
|
58
|
+
export function qualifiedName(node) {
|
|
59
|
+
return node.className ? `${node.className}.${node.name}` : node.name;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Best-effort parameter count from a node's declaration `signature`. Counts
|
|
63
|
+
* top-level comma-separated parameters inside the first parenthesized group.
|
|
64
|
+
* Returns `undefined` when no signature is available (the analyzer does not
|
|
65
|
+
* persist arity directly — TODO(spec-04-followup): arity in analyzer).
|
|
66
|
+
*/
|
|
67
|
+
export function arityOf(node) {
|
|
68
|
+
const sig = node.signature;
|
|
69
|
+
if (!sig)
|
|
70
|
+
return undefined;
|
|
71
|
+
const open = sig.indexOf('(');
|
|
72
|
+
if (open === -1)
|
|
73
|
+
return undefined;
|
|
74
|
+
// Walk to the matching close paren, counting top-level commas.
|
|
75
|
+
let depth = 0;
|
|
76
|
+
let commas = 0;
|
|
77
|
+
let sawContent = false;
|
|
78
|
+
for (let i = open; i < sig.length; i++) {
|
|
79
|
+
const ch = sig[i];
|
|
80
|
+
if (ch === '(' || ch === '[' || ch === '{' || ch === '<')
|
|
81
|
+
depth++;
|
|
82
|
+
else if (ch === ')' || ch === ']' || ch === '}' || ch === '>') {
|
|
83
|
+
depth--;
|
|
84
|
+
if (depth === 0)
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
else if (ch === ',' && depth === 1)
|
|
88
|
+
commas++;
|
|
89
|
+
else if (depth === 1 && !/\s/.test(ch))
|
|
90
|
+
sawContent = true;
|
|
91
|
+
}
|
|
92
|
+
if (!sawContent)
|
|
93
|
+
return 0;
|
|
94
|
+
return commas + 1;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Build the SCIP symbol moniker string for a function node.
|
|
98
|
+
*
|
|
99
|
+
* `repoRelPath` must be the document's relative path (POSIX separators), the
|
|
100
|
+
* same value used for the node's `Document.relative_path`.
|
|
101
|
+
*/
|
|
102
|
+
export function symbolMoniker(node, repoRelPath, pkg) {
|
|
103
|
+
const namespace = `${escapeName(repoRelPath)}/`;
|
|
104
|
+
const arity = arityOf(node);
|
|
105
|
+
const disambiguator = arity === undefined ? '' : String(arity);
|
|
106
|
+
const method = `${escapeName(qualifiedName(node))}(${disambiguator}).`;
|
|
107
|
+
return `${SCHEME} ${pkg.manager} ${pkg.name} ${pkg.version} ${namespace}${method}`;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=moniker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moniker.js","sourceRoot":"","sources":["../../../src/core/scip/moniker.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the vendored SCIP protobuf schema and exposes the `scip.Index` type.
|
|
3
|
+
*
|
|
4
|
+
* The schema is vendored verbatim at `vendor/scip.proto` (pinned — see the
|
|
5
|
+
* header comment in that file). We parse it at runtime with protobufjs (pure
|
|
6
|
+
* JS, no native build) rather than committing a generated `pb.js`, which keeps
|
|
7
|
+
* the vendored artifact human-readable and trivially re-fetchable.
|
|
8
|
+
*/
|
|
9
|
+
import protobuf from 'protobufjs';
|
|
10
|
+
/** Absolute path to the vendored proto, resolved relative to this module. */
|
|
11
|
+
export declare function scipProtoPath(): string;
|
|
12
|
+
/** Parse the vendored proto and return the protobufjs Root. */
|
|
13
|
+
export declare function loadScipRoot(): protobuf.Root;
|
|
14
|
+
/** The `scip.Index` message type, used to verify + serialize an index payload. */
|
|
15
|
+
export declare function scipIndexType(): protobuf.Type;
|
|
16
|
+
/**
|
|
17
|
+
* SCIP `SymbolRole` bitset values we use. Mirrors the enum in scip.proto.
|
|
18
|
+
* Kept as a const object (not an import) because the proto enums are not
|
|
19
|
+
* surfaced as TS values by protobufjs's runtime parse.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SymbolRole: {
|
|
22
|
+
readonly Definition: 1;
|
|
23
|
+
readonly ReadAccess: 8;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* SCIP `TextEncoding.UTF8`. The index declares source files are UTF-8 on disk.
|
|
27
|
+
*/
|
|
28
|
+
export declare const TextEncoding_UTF8 = 1;
|
|
29
|
+
/**
|
|
30
|
+
* SCIP `SymbolInformation.Kind.Function`. Every node we export is a
|
|
31
|
+
* function/method, so we tag them uniformly.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SymbolKind_Function = 17;
|
|
34
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/scip/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,QAAQ,MAAM,YAAY,CAAC;AAKlC,6EAA6E;AAC7E,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,IAAI,QAAQ,CAAC,IAAI,CAK5C;AAED,kFAAkF;AAClF,wBAAgB,aAAa,IAAI,QAAQ,CAAC,IAAI,CAE7C;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the vendored SCIP protobuf schema and exposes the `scip.Index` type.
|
|
3
|
+
*
|
|
4
|
+
* The schema is vendored verbatim at `vendor/scip.proto` (pinned — see the
|
|
5
|
+
* header comment in that file). We parse it at runtime with protobufjs (pure
|
|
6
|
+
* JS, no native build) rather than committing a generated `pb.js`, which keeps
|
|
7
|
+
* the vendored artifact human-readable and trivially re-fetchable.
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import protobuf from 'protobufjs';
|
|
12
|
+
/** Resolved once and memoized — parsing the proto is cheap but not free. */
|
|
13
|
+
let cachedRoot;
|
|
14
|
+
/** Absolute path to the vendored proto, resolved relative to this module. */
|
|
15
|
+
export function scipProtoPath() {
|
|
16
|
+
return fileURLToPath(new URL('./vendor/scip.proto', import.meta.url));
|
|
17
|
+
}
|
|
18
|
+
/** Parse the vendored proto and return the protobufjs Root. */
|
|
19
|
+
export function loadScipRoot() {
|
|
20
|
+
if (cachedRoot)
|
|
21
|
+
return cachedRoot;
|
|
22
|
+
const protoText = readFileSync(scipProtoPath(), 'utf-8');
|
|
23
|
+
cachedRoot = protobuf.parse(protoText, { keepCase: true }).root;
|
|
24
|
+
return cachedRoot;
|
|
25
|
+
}
|
|
26
|
+
/** The `scip.Index` message type, used to verify + serialize an index payload. */
|
|
27
|
+
export function scipIndexType() {
|
|
28
|
+
return loadScipRoot().lookupType('scip.Index');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* SCIP `SymbolRole` bitset values we use. Mirrors the enum in scip.proto.
|
|
32
|
+
* Kept as a const object (not an import) because the proto enums are not
|
|
33
|
+
* surfaced as TS values by protobufjs's runtime parse.
|
|
34
|
+
*/
|
|
35
|
+
export const SymbolRole = {
|
|
36
|
+
Definition: 0x1,
|
|
37
|
+
ReadAccess: 0x8,
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* SCIP `TextEncoding.UTF8`. The index declares source files are UTF-8 on disk.
|
|
41
|
+
*/
|
|
42
|
+
export const TextEncoding_UTF8 = 1;
|
|
43
|
+
/**
|
|
44
|
+
* SCIP `SymbolInformation.Kind.Function`. Every node we export is a
|
|
45
|
+
* function/method, so we tag them uniformly.
|
|
46
|
+
*/
|
|
47
|
+
export const SymbolKind_Function = 17;
|
|
48
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/scip/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,4EAA4E;AAC5E,IAAI,UAAqC,CAAC;AAE1C,6EAA6E;AAC7E,MAAM,UAAU,aAAa;IAC3B,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACxE,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,YAAY;IAC1B,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAClC,MAAM,SAAS,GAAG,YAAY,CAAC,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IAChE,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,aAAa;IAC3B,OAAO,YAAY,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,UAAU,EAAE,GAAG;IACf,UAAU,EAAE,GAAG;CACP,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC"}
|