@colbymchenry/codegraph-darwin-x64 0.9.7 → 0.9.9
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/lib/dist/bin/codegraph.js +19 -56
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/context/index.d.ts +9 -0
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +95 -6
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/context/markers.d.ts +19 -0
- package/lib/dist/context/markers.d.ts.map +1 -0
- package/lib/dist/context/markers.js +22 -0
- package/lib/dist/context/markers.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +10 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +13 -0
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +17 -2
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +26 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +140 -20
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/index.d.ts +9 -2
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +17 -2
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +3 -2
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +12 -38
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/index.d.ts +7 -4
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +46 -39
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts +35 -0
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +223 -0
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +1 -1
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +18 -19
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/session.d.ts +10 -0
- package/lib/dist/mcp/session.d.ts.map +1 -1
- package/lib/dist/mcp/session.js +7 -5
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +49 -52
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +922 -908
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts +2 -2
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +239 -2
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/search/query-utils.d.ts +18 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -1
- package/lib/dist/search/query-utils.js +30 -0
- package/lib/dist/search/query-utils.js.map +1 -1
- package/lib/dist/types.d.ts +8 -0
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
|
@@ -97,6 +97,32 @@ export declare class TreeSitterExtractor {
|
|
|
97
97
|
* Extracts each declarator as a 'field' kind node inside the owning class.
|
|
98
98
|
*/
|
|
99
99
|
private extractField;
|
|
100
|
+
/**
|
|
101
|
+
* Extract function-valued properties of an object literal as named function
|
|
102
|
+
* nodes (named by their property key). Shared by the two object-of-functions
|
|
103
|
+
* shapes in extractVariable: the object as a direct const value, and the
|
|
104
|
+
* object returned by a store-initializer call. Handles both `key: () => {}` /
|
|
105
|
+
* `key: function() {}` pairs and method shorthand `key() {}`.
|
|
106
|
+
*/
|
|
107
|
+
private extractObjectLiteralFunctions;
|
|
108
|
+
/** Property-key text with surrounding quotes stripped (`'foo'` → `foo`). */
|
|
109
|
+
private objectKeyName;
|
|
110
|
+
/**
|
|
111
|
+
* Given a `call_expression` initializer (`create((set, get) => ({...}))`),
|
|
112
|
+
* find the object literal RETURNED by a function argument — descending through
|
|
113
|
+
* nested call_expression arguments so middleware wrappers are unwrapped
|
|
114
|
+
* (`create(persist((set, get) => ({...}), {...}))`, devtools, immer,
|
|
115
|
+
* subscribeWithSelector). Returns null when no such object is found — the
|
|
116
|
+
* common case for ordinary call initializers — so this stays cheap and silent
|
|
117
|
+
* rather than guessing. Keyed purely on AST shape; no library names.
|
|
118
|
+
*/
|
|
119
|
+
private findInitializerReturnedObject;
|
|
120
|
+
/**
|
|
121
|
+
* The object literal a function expression returns — either the `=> ({...})`
|
|
122
|
+
* arrow form (a parenthesized_expression wrapping an object) or a
|
|
123
|
+
* `=> { return {...} }` block. Returns null for any other body shape.
|
|
124
|
+
*/
|
|
125
|
+
private functionReturnedObject;
|
|
100
126
|
/**
|
|
101
127
|
* Extract a variable declaration (const, let, var, etc.)
|
|
102
128
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-sitter.d.ts","sourceRoot":"","sources":["../../src/extraction/tree-sitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,QAAQ,EAIR,gBAAgB,EAGjB,MAAM,UAAU,CAAC;AAgBlB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAgGvD;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,SAAS,C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BAAgB;CAmBzB;AAGD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,QAAQ,EACnB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,gBAAgB,CAmElB"}
|
|
@@ -1042,6 +1042,114 @@ class TreeSitterExtractor {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Extract function-valued properties of an object literal as named function
|
|
1047
|
+
* nodes (named by their property key). Shared by the two object-of-functions
|
|
1048
|
+
* shapes in extractVariable: the object as a direct const value, and the
|
|
1049
|
+
* object returned by a store-initializer call. Handles both `key: () => {}` /
|
|
1050
|
+
* `key: function() {}` pairs and method shorthand `key() {}`.
|
|
1051
|
+
*/
|
|
1052
|
+
extractObjectLiteralFunctions(obj) {
|
|
1053
|
+
for (let i = 0; i < obj.namedChildCount; i++) {
|
|
1054
|
+
const member = obj.namedChild(i);
|
|
1055
|
+
if (!member)
|
|
1056
|
+
continue;
|
|
1057
|
+
if (member.type === 'pair') {
|
|
1058
|
+
const key = (0, tree_sitter_helpers_1.getChildByField)(member, 'key');
|
|
1059
|
+
const value = (0, tree_sitter_helpers_1.getChildByField)(member, 'value');
|
|
1060
|
+
if (key && value && (value.type === 'arrow_function' || value.type === 'function_expression')) {
|
|
1061
|
+
this.extractFunction(value, this.objectKeyName(key));
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
else if (member.type === 'method_definition') {
|
|
1065
|
+
// Method shorthand: `{ fetchUser() {...} }`. extractMethod deliberately
|
|
1066
|
+
// skips object-literal methods, so route through extractFunction with an
|
|
1067
|
+
// explicit name (method_definition exposes a `body` field, so resolveBody
|
|
1068
|
+
// falls through to it and the node spans the full method).
|
|
1069
|
+
const key = (0, tree_sitter_helpers_1.getChildByField)(member, 'name');
|
|
1070
|
+
if (key)
|
|
1071
|
+
this.extractFunction(member, this.objectKeyName(key));
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
/** Property-key text with surrounding quotes stripped (`'foo'` → `foo`). */
|
|
1076
|
+
objectKeyName(key) {
|
|
1077
|
+
return (0, tree_sitter_helpers_1.getNodeText)(key, this.source).replace(/^['"`]|['"`]$/g, '');
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* Given a `call_expression` initializer (`create((set, get) => ({...}))`),
|
|
1081
|
+
* find the object literal RETURNED by a function argument — descending through
|
|
1082
|
+
* nested call_expression arguments so middleware wrappers are unwrapped
|
|
1083
|
+
* (`create(persist((set, get) => ({...}), {...}))`, devtools, immer,
|
|
1084
|
+
* subscribeWithSelector). Returns null when no such object is found — the
|
|
1085
|
+
* common case for ordinary call initializers — so this stays cheap and silent
|
|
1086
|
+
* rather than guessing. Keyed purely on AST shape; no library names.
|
|
1087
|
+
*/
|
|
1088
|
+
findInitializerReturnedObject(callNode, depth = 0) {
|
|
1089
|
+
if (depth > 4)
|
|
1090
|
+
return null;
|
|
1091
|
+
const args = (0, tree_sitter_helpers_1.getChildByField)(callNode, 'arguments');
|
|
1092
|
+
if (!args)
|
|
1093
|
+
return null;
|
|
1094
|
+
for (let i = 0; i < args.namedChildCount; i++) {
|
|
1095
|
+
const arg = args.namedChild(i);
|
|
1096
|
+
if (!arg)
|
|
1097
|
+
continue;
|
|
1098
|
+
if (arg.type === 'arrow_function' || arg.type === 'function_expression') {
|
|
1099
|
+
const obj = this.functionReturnedObject(arg);
|
|
1100
|
+
if (obj)
|
|
1101
|
+
return obj;
|
|
1102
|
+
}
|
|
1103
|
+
else if (arg.type === 'call_expression') {
|
|
1104
|
+
const obj = this.findInitializerReturnedObject(arg, depth + 1);
|
|
1105
|
+
if (obj)
|
|
1106
|
+
return obj;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
return null;
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* The object literal a function expression returns — either the `=> ({...})`
|
|
1113
|
+
* arrow form (a parenthesized_expression wrapping an object) or a
|
|
1114
|
+
* `=> { return {...} }` block. Returns null for any other body shape.
|
|
1115
|
+
*/
|
|
1116
|
+
functionReturnedObject(fnNode) {
|
|
1117
|
+
const body = (0, tree_sitter_helpers_1.getChildByField)(fnNode, 'body');
|
|
1118
|
+
if (!body)
|
|
1119
|
+
return null;
|
|
1120
|
+
const asObject = (n) => {
|
|
1121
|
+
if (!n)
|
|
1122
|
+
return null;
|
|
1123
|
+
if (n.type === 'object' || n.type === 'object_expression')
|
|
1124
|
+
return n;
|
|
1125
|
+
if (n.type === 'parenthesized_expression') {
|
|
1126
|
+
for (let i = 0; i < n.namedChildCount; i++) {
|
|
1127
|
+
const inner = asObject(n.namedChild(i));
|
|
1128
|
+
if (inner)
|
|
1129
|
+
return inner;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
return null;
|
|
1133
|
+
};
|
|
1134
|
+
// `(set, get) => ({...})` — body is the (parenthesized) object directly.
|
|
1135
|
+
const direct = asObject(body);
|
|
1136
|
+
if (direct)
|
|
1137
|
+
return direct;
|
|
1138
|
+
// `(set, get) => { return {...} }` — scan top-level return statements.
|
|
1139
|
+
if (body.type === 'statement_block') {
|
|
1140
|
+
for (let i = 0; i < body.namedChildCount; i++) {
|
|
1141
|
+
const stmt = body.namedChild(i);
|
|
1142
|
+
if (stmt?.type !== 'return_statement')
|
|
1143
|
+
continue;
|
|
1144
|
+
for (let j = 0; j < stmt.namedChildCount; j++) {
|
|
1145
|
+
const obj = asObject(stmt.namedChild(j));
|
|
1146
|
+
if (obj)
|
|
1147
|
+
return obj;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
return null;
|
|
1152
|
+
}
|
|
1045
1153
|
/**
|
|
1046
1154
|
* Extract a variable declaration (const, let, var, etc.)
|
|
1047
1155
|
*
|
|
@@ -1093,29 +1201,41 @@ class TreeSitterExtractor {
|
|
|
1093
1201
|
if (varNode) {
|
|
1094
1202
|
this.extractVariableTypeAnnotation(child, varNode.id);
|
|
1095
1203
|
}
|
|
1204
|
+
// Exported const object-of-functions — extract each function-valued
|
|
1205
|
+
// property as a function named by its key + walk its body so its
|
|
1206
|
+
// calls are captured. Two shapes, both keyed on AST shape (not on any
|
|
1207
|
+
// library name):
|
|
1208
|
+
// `export const actions = { default: async () => {} }` — object is
|
|
1209
|
+
// the DIRECT value (SvelteKit form actions / handler maps / route
|
|
1210
|
+
// tables).
|
|
1211
|
+
// `export const useStore = create((set, get) => ({ fetchUser:
|
|
1212
|
+
// async () => {} }))` — object is RETURNED by an initializer call,
|
|
1213
|
+
// possibly through middleware wrappers (persist/devtools/immer).
|
|
1214
|
+
// Covers Zustand/Redux/Pinia/MobX stores generically. Without
|
|
1215
|
+
// this, store actions exist only as object-literal properties —
|
|
1216
|
+
// never nodes — so `node`/`callers` on `fetchUser` return "not
|
|
1217
|
+
// found" and the agent Reads the store to reconstruct the flow.
|
|
1218
|
+
// Scoped to EXPORTED consts to exclude inline-object noise
|
|
1219
|
+
// (`ctx.set({...})`) the object-method skip deliberately avoids.
|
|
1220
|
+
const objectOfFns = valueNode && (valueNode.type === 'object' || valueNode.type === 'object_expression')
|
|
1221
|
+
? valueNode
|
|
1222
|
+
: valueNode?.type === 'call_expression'
|
|
1223
|
+
? this.findInitializerReturnedObject(valueNode)
|
|
1224
|
+
: null;
|
|
1225
|
+
const extractObjectMethods = isExported && !!objectOfFns;
|
|
1226
|
+
// Visit the initializer body for calls — EXCEPT object literals (their
|
|
1227
|
+
// function-valued properties are extracted below) and the store-factory
|
|
1228
|
+
// call whose returned object we extract method-by-method below (walking
|
|
1229
|
+
// the whole call would re-visit those method arrows and mis-attribute
|
|
1230
|
+
// their inner calls to the file/module scope).
|
|
1096
1231
|
if (valueNode &&
|
|
1097
1232
|
valueNode.type !== 'object' &&
|
|
1098
|
-
valueNode.type !== 'object_expression'
|
|
1233
|
+
valueNode.type !== 'object_expression' &&
|
|
1234
|
+
!(extractObjectMethods && valueNode.type === 'call_expression')) {
|
|
1099
1235
|
this.visitFunctionBody(valueNode, '');
|
|
1100
1236
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
// / route tables). Extract each function-valued property as a function
|
|
1104
|
-
// named by its key + walk its body so its calls (e.g. api.post) are
|
|
1105
|
-
// captured. Scoped to EXPORTED consts to exclude the inline-object
|
|
1106
|
-
// noise (`ctx.set({...})`) the object-method skip deliberately avoids.
|
|
1107
|
-
if (isExported && valueNode &&
|
|
1108
|
-
(valueNode.type === 'object' || valueNode.type === 'object_expression')) {
|
|
1109
|
-
for (let j = 0; j < valueNode.namedChildCount; j++) {
|
|
1110
|
-
const pair = valueNode.namedChild(j);
|
|
1111
|
-
if (pair?.type !== 'pair')
|
|
1112
|
-
continue;
|
|
1113
|
-
const v = (0, tree_sitter_helpers_1.getChildByField)(pair, 'value');
|
|
1114
|
-
const k = (0, tree_sitter_helpers_1.getChildByField)(pair, 'key');
|
|
1115
|
-
if (k && v && (v.type === 'arrow_function' || v.type === 'function_expression')) {
|
|
1116
|
-
this.extractFunction(v, (0, tree_sitter_helpers_1.getNodeText)(k, this.source).replace(/^['"`]|['"`]$/g, ''));
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1237
|
+
if (extractObjectMethods && objectOfFns) {
|
|
1238
|
+
this.extractObjectLiteralFunctions(objectOfFns);
|
|
1119
1239
|
}
|
|
1120
1240
|
}
|
|
1121
1241
|
}
|
|
@@ -2918,7 +3038,7 @@ function extractFromSource(filePath, source, language, frameworkNames) {
|
|
|
2918
3038
|
const extractor = new mybatis_extractor_1.MyBatisExtractor(filePath, source);
|
|
2919
3039
|
result = extractor.extract();
|
|
2920
3040
|
}
|
|
2921
|
-
else if (
|
|
3041
|
+
else if ((0, grammars_1.isFileLevelOnlyLanguage)(detectedLanguage)) {
|
|
2922
3042
|
// No symbol extraction at this stage — files are tracked at the file-record
|
|
2923
3043
|
// level only. Framework extractors (Drupal routing yml, Spring `@Value`
|
|
2924
3044
|
// resolution against application.yml/application.properties) run later and
|