homegraph 1.5.4 → 1.5.5
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/CHANGELOG.md +19 -0
- package/README.md +4 -1
- package/dist/arkui/migrate-semantics.d.ts +8 -0
- package/dist/arkui/migrate-semantics.d.ts.map +1 -1
- package/dist/arkui/migrate-semantics.js +24 -1
- package/dist/arkui/migrate-semantics.js.map +1 -1
- package/dist/arkui/migrate-snapshot.d.ts.map +1 -1
- package/dist/arkui/migrate-snapshot.js +11 -4
- package/dist/arkui/migrate-snapshot.js.map +1 -1
- package/dist/mcp/engine.d.ts.map +1 -1
- package/dist/mcp/engine.js +2 -14
- package/dist/mcp/engine.js.map +1 -1
- package/dist/mcp/explore-repeat-guard.d.ts.map +1 -1
- package/dist/mcp/explore-repeat-guard.js +37 -0
- package/dist/mcp/explore-repeat-guard.js.map +1 -1
- package/dist/mcp/memory-budget.d.ts +9 -22
- package/dist/mcp/memory-budget.d.ts.map +1 -1
- package/dist/mcp/memory-budget.js +9 -59
- package/dist/mcp/memory-budget.js.map +1 -1
- package/dist/mcp/server-instructions.d.ts +2 -2
- package/dist/mcp/server-instructions.d.ts.map +1 -1
- package/dist/mcp/server-instructions.js +4 -0
- package/dist/mcp/server-instructions.js.map +1 -1
- package/dist/mcp/tools.d.ts +44 -3
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +1314 -78
- package/dist/mcp/tools.js.map +1 -1
- package/dist/search/query-utils.d.ts +10 -0
- package/dist/search/query-utils.d.ts.map +1 -1
- package/dist/search/query-utils.js +58 -5
- package/dist/search/query-utils.js.map +1 -1
- package/dist/upgrade/index.d.ts +23 -12
- package/dist/upgrade/index.d.ts.map +1 -1
- package/dist/upgrade/index.js +42 -48
- package/dist/upgrade/index.js.map +1 -1
- package/dist/upgrade/update-check.d.ts +4 -4
- package/dist/upgrade/update-check.d.ts.map +1 -1
- package/dist/upgrade/update-check.js +6 -5
- package/dist/upgrade/update-check.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Catch-up sync skip policy for the HomeGraph MCP / daemon process.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* path can quietly grow without bound.
|
|
5
|
+
* Process RSS soft ceilings were removed (spec 0015): Windows Working Set and
|
|
6
|
+
* macOS resident_size are not comparable, and RSS gates falsely Partial'd tools
|
|
7
|
+
* on large indexes. Growth is still bounded by SQLite `mmap_size = 0`, small
|
|
8
|
+
* page cache, and default query-pool concurrency of 1.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
10
|
+
* Catch-up sync may still skip for explicit env or large on-disk indexes —
|
|
11
|
+
* re-parsing a dirty multi-hundred-MB tree remains expensive regardless of RSS.
|
|
12
12
|
*/
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
@@ -44,61 +44,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
44
44
|
};
|
|
45
45
|
})();
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.resolveMaxRssMb = resolveMaxRssMb;
|
|
48
|
-
exports.getProcessRssMb = getProcessRssMb;
|
|
49
|
-
exports.isOverRssBudget = isOverRssBudget;
|
|
50
|
-
exports.isNearRssBudget = isNearRssBudget;
|
|
51
|
-
exports.rssBudgetPartialText = rssBudgetPartialText;
|
|
52
|
-
exports.rssBudgetPartialResult = rssBudgetPartialResult;
|
|
53
47
|
exports.shouldSkipCatchUpSync = shouldSkipCatchUpSync;
|
|
54
48
|
const fs = __importStar(require("fs"));
|
|
55
|
-
const DEFAULT_MAX_RSS_MB = 1024;
|
|
56
|
-
const MIN_MAX_RSS_MB = 256;
|
|
57
|
-
const MAX_MAX_RSS_MB = 4096;
|
|
58
49
|
/** Index files at/above this size skip MCP catch-up sync unless forced. */
|
|
59
50
|
const LARGE_INDEX_SKIP_CATCHUP_BYTES = 64 * 1024 * 1024;
|
|
60
|
-
function resolveMaxRssMb() {
|
|
61
|
-
const raw = process.env.HOMEGRAPH_MAX_RSS_MB;
|
|
62
|
-
if (raw === undefined || raw === '')
|
|
63
|
-
return DEFAULT_MAX_RSS_MB;
|
|
64
|
-
const n = Number(raw);
|
|
65
|
-
if (!Number.isFinite(n) || n <= 0)
|
|
66
|
-
return DEFAULT_MAX_RSS_MB;
|
|
67
|
-
return Math.min(MAX_MAX_RSS_MB, Math.max(MIN_MAX_RSS_MB, Math.floor(n)));
|
|
68
|
-
}
|
|
69
|
-
function getProcessRssMb() {
|
|
70
|
-
try {
|
|
71
|
-
return process.memoryUsage().rss / (1024 * 1024);
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return 0;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function isOverRssBudget(maxMb = resolveMaxRssMb()) {
|
|
78
|
-
return getProcessRssMb() >= maxMb;
|
|
79
|
-
}
|
|
80
|
-
/** Soft tripwire — stop growing (catch-up etc.) before the hard tool refusal. */
|
|
81
|
-
function isNearRssBudget(maxMb = resolveMaxRssMb()) {
|
|
82
|
-
return getProcessRssMb() >= maxMb * 0.7;
|
|
83
|
-
}
|
|
84
|
-
function rssBudgetPartialText(context) {
|
|
85
|
-
const max = resolveMaxRssMb();
|
|
86
|
-
const now = Math.round(getProcessRssMb());
|
|
87
|
-
const where = context ? ` (${context})` : '';
|
|
88
|
-
return (`⚠️ **Partial result** — HomeGraph hit its process memory budget ` +
|
|
89
|
-
`(~${now}MB RSS, limit ${max}MB)${where}. This is NOT an error. ` +
|
|
90
|
-
`Retry ONE tighter \`homegraph_explore\` / \`homegraph_callers\` with a concrete ` +
|
|
91
|
-
`symbol name — do not fan out dozens of caller lookups, and do not grep the same symbols.`);
|
|
92
|
-
}
|
|
93
|
-
function rssBudgetPartialResult(context) {
|
|
94
|
-
return {
|
|
95
|
-
content: [{ type: 'text', text: rssBudgetPartialText(context) }],
|
|
96
|
-
isError: false,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
51
|
/**
|
|
100
|
-
* MCP catch-up sync re-scans + may re-parse dirty files
|
|
101
|
-
*
|
|
52
|
+
* MCP catch-up sync re-scans + may re-parse dirty files. Skip unless explicitly
|
|
53
|
+
* forced when the operator opts out or the on-disk index is large.
|
|
102
54
|
*/
|
|
103
55
|
function shouldSkipCatchUpSync(dbPath) {
|
|
104
56
|
const force = process.env.HOMEGRAPH_FORCE_CATCHUP_SYNC;
|
|
@@ -107,8 +59,6 @@ function shouldSkipCatchUpSync(dbPath) {
|
|
|
107
59
|
const skip = process.env.HOMEGRAPH_SKIP_CATCHUP_SYNC;
|
|
108
60
|
if (skip === '1' || skip === 'true' || skip === 'yes')
|
|
109
61
|
return true;
|
|
110
|
-
if (isNearRssBudget())
|
|
111
|
-
return true;
|
|
112
62
|
if (!dbPath)
|
|
113
63
|
return false;
|
|
114
64
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-budget.js","sourceRoot":"","sources":["../../src/mcp/memory-budget.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWH,
|
|
1
|
+
{"version":3,"file":"memory-budget.js","sourceRoot":"","sources":["../../src/mcp/memory-budget.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWH,sDAYC;AArBD,uCAAyB;AAEzB,2EAA2E;AAC3E,MAAM,8BAA8B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,MAAiC;IACrE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IACvD,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACvE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;IACrD,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACnE,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,8BAA8B;YAAE,OAAO,IAAI,CAAC;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,sCAAsC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* Keep this short: long essays are low-salience and rarely change tool choice.
|
|
8
8
|
* Prefer concrete habits (query shape, which tool, when to stop).
|
|
9
9
|
*/
|
|
10
|
-
export declare const SERVER_INSTRUCTIONS = "# HomeGraph \u2014 structural locator for THIS repo\n\nLocal symbol graph (defs / calls / imports / files). Use it to **coarse-locate** in-repo symbols (`file:line` + short source), then answer. Not general Q&A, not SDK docs.\n\n## Call first (do not Grep/Glob/Read first)\n\nWill you **explain or edit in-repo code**? \u2192 `homegraph_explore` **once** with the user task as `query` (Chinese OK; add English Type / `Type.member` / `@kit` / `@ohos` tokens when you know them).\n\nAlready know **one** exact symbol? Prefer smaller tools: `homegraph_callers` / `homegraph_callees` / `homegraph_node`. Spelling unknown \u2192 `homegraph_search` last.\n\n**Must explore-first:** how/mechanism wiring, named Type / `.member`, in-repo `@kit`/`@ohos` **usages**, deps/cycles, NAPI / `.d.ts` wrap sites, pre-edit orientation.\n\nArkUI V1\u2194V2 / state-decorator migration on a named component \u2192 `homegraph_arkui_migrate` once (not explore stitching).\n\n## How to write `query`\n\n- Put **concrete anchors** in the bag: `FooManager`, `BarEvent`, `Type.member`, `feature/foo`, `@kit.X`.\n- Map Chinese entities to English symbol stems when you can (`\u8BBE\u7F6E`\u2192`Setting`, `\u65B0\u5EFA`\u2192`New`) \u2014 search/explore cluster `Entity` / `EntityManager` / `EntityViewModel`.\n- Keep **intent words** with the Type (`\u6765\u6E90` / `\u5206\u53D1` / `\u4F9D\u8D56` / `NAPI` / `\u9A71\u52A8`) \u2014 bare Type alone may drop survey routing.\n- Multi-app monorepo: pass `projectPath` to the app root; ignore sibling-app paths as noise.\n\n## After one explore\n\n- Returned line-numbered source = **already Read** for those symbols \u2014 do not re-Grep/Read/node the **same** symbols.\n- **Coarse locate / ANSWER NOW** \u2192 answer/edit from anchors; do not verify with a Grep storm.\n- **Partial locator** \u2192 **ONE** tighter follow-up with the named **Next anchor** only \u2014 never a paraphrase or a different Type (server refuses). After Partial: **no** `homegraph_callers`/`callees`; at most **one** `homegraph_node`. A **second** Partial \u2192 stop HomeGraph; ONE narrow Grep then answer \u2014 never a repo-wide glob/Read storm.\n- Busy/deadline \u2192 retry **once** tighter; then answer from anchors (narrow Grep OK for residuals).\n\nPrefer smallest tool when the name is known: callers/callees/node \u226A explore \u226A search. Prefer **one** Type-wide inventory explore over fanning `homegraph_callers` per method. Session fuse: **\u22642** `homegraph_explore` per project; after Partial follow-ups must name the **Next anchor**; **\u22641** `homegraph_node` after Partial \u2014 further calls are refused.\n\n## Do not call HomeGraph\n\nRuntime Skip is a short blacklist (everything else is served if you call):\n\n- Topic \u2192 file list with no Type/file basename\n- Literal / layout copy hunts with no Type/file/`@kit`/`@ohos`\n- Pure existence / concept-compare with no graph anchors\n- Official website/docs only \u00B7 scaffold empty project \u00B7 git/blame/diff \u00B7 media/binary inventories\n\n`@kit` / OHOS **API usage in this repo** \u2192 explore (not Skip). Feature **catalogs** of an SDK \u2192 SDK docs, not HomeGraph.\n\nIf a tool returns **Skip HomeGraph**, stop \u2014 do not retry `homegraph_*`.\n\n## Tips\n\n- Empty callers/callees = **edges not indexed**, not \u201Cmissing symbol\u201D \u2014 use the definition anchor; narrow Grep for registration if needed.\n- **Staleness banner** \u2014 Read only listed edited files.\n- **Not indexed** \u2014 use built-ins; user runs `homegraph init` (you do not).\n";
|
|
11
|
-
export declare const SERVER_INSTRUCTIONS_NO_ROOT_INDEX = "# HomeGraph \u2014 per-project (pass projectPath)\n\nPass `projectPath` to a folder that has `.homegraph/`.\n\n**Call first:** explain/edit in-repo code \u2192 `homegraph_explore` with task keywords (no Grep-first). Named Type / `Type.member` / usages / deps / NAPI / `@kit` \u2192 explore.\n\n**Skip:** topic file-lists, concept compares, literal hunts, git history, media. No index \u2192 Read/Grep/Glob; user runs `homegraph init`.\n\n**Query habit:** Chinese OK; add English Type/`@kit` tokens when known. Explore = coarse locate. Partial \u2192 one tighter follow-up with a concrete name from the list. ONE narrow Grep OK for residual unindexed wiring \u2014 not a Grep storm.\n";
|
|
10
|
+
export declare const SERVER_INSTRUCTIONS = "# HomeGraph \u2014 structural locator for THIS repo\n\nLocal symbol graph (defs / calls / imports / files). Use it to **coarse-locate** in-repo symbols (`file:line` + short source), then answer. Not general Q&A, not SDK docs.\n\n## Call first (do not Grep/Glob/Read first)\n\nWill you **explain or edit in-repo code**? \u2192 `homegraph_explore` **once** with the user task as `query` (Chinese OK; add English Type / `Type.member` / `@kit` / `@ohos` tokens when you know them).\n\nAlready know **one** exact symbol? Prefer smaller tools: `homegraph_callers` / `homegraph_callees` / `homegraph_node`. Spelling unknown \u2192 `homegraph_search` last.\n\nFor a narrow inventory, call `homegraph_usages` (where-used), `homegraph_modules` (named module deps/cycles), or `homegraph_native` (NAPI exports). Existing clients may keep calling `homegraph_explore`: high-confidence shapes route to the same bounded handlers.\n\n**Must explore-first:** how/mechanism wiring, named Type / `.member`, in-repo `@kit`/`@ohos` **usages**, deps/cycles, NAPI / `.d.ts` wrap sites, pre-edit orientation.\n\nArkUI V1\u2194V2 / state-decorator migration on a named component \u2192 `homegraph_arkui_migrate` once (not explore stitching).\n\n## How to write `query`\n\n- Put **concrete anchors** in the bag: `FooManager`, `BarEvent`, `Type.member`, `feature/foo`, `@kit.X`.\n- Map Chinese entities to English symbol stems when you can (`\u8BBE\u7F6E`\u2192`Setting`, `\u65B0\u5EFA`\u2192`New`) \u2014 search/explore cluster `Entity` / `EntityManager` / `EntityViewModel`.\n- Keep **intent words** with the Type (`\u6765\u6E90` / `\u5206\u53D1` / `\u4F9D\u8D56` / `NAPI` / `\u9A71\u52A8`) \u2014 bare Type alone may drop survey routing.\n- Multi-app monorepo: pass `projectPath` to the app root; ignore sibling-app paths as noise.\n\n## After one explore\n\n- Returned line-numbered source = **already Read** for those symbols \u2014 do not re-Grep/Read/node the **same** symbols.\n- **Coarse locate / ANSWER NOW** \u2192 answer/edit from anchors; do not verify with a Grep storm.\n- **Partial locator** \u2192 **ONE** tighter follow-up with the named **Next anchor** only \u2014 never a paraphrase or a different Type (server refuses). After Partial: **no** `homegraph_callers`/`callees`; at most **one** `homegraph_node`. A **second** Partial \u2192 stop HomeGraph; ONE narrow Grep then answer \u2014 never a repo-wide glob/Read storm.\n- Busy/deadline \u2192 retry **once** tighter; then answer from anchors (narrow Grep OK for residuals).\n\nPrefer smallest tool when the name is known: callers/callees/node \u226A explore \u226A search. Prefer **one** Type-wide inventory explore over fanning `homegraph_callers` per method. Session fuse: **\u22642** `homegraph_explore` per project; after Partial follow-ups must name the **Next anchor**; **\u22641** `homegraph_node` after Partial \u2014 further calls are refused.\n\n## Do not call HomeGraph\n\nRuntime Skip is a short blacklist (everything else is served if you call):\n\n- Topic \u2192 file list with no Type/file basename\n- Literal / layout copy hunts with no Type/file/`@kit`/`@ohos`\n- Pure existence / concept-compare with no graph anchors\n- Official website/docs only \u00B7 scaffold empty project \u00B7 git/blame/diff \u00B7 media/binary inventories\n\n`@kit` / OHOS **API usage in this repo** \u2192 explore (not Skip). Feature **catalogs** of an SDK \u2192 SDK docs, not HomeGraph.\n\nIf a tool returns **Skip HomeGraph**, stop \u2014 do not retry `homegraph_*`.\n\n## Tips\n\n- Empty callers/callees = **edges not indexed**, not \u201Cmissing symbol\u201D \u2014 use the definition anchor; narrow Grep for registration if needed.\n- **Staleness banner** \u2014 Read only listed edited files.\n- **Not indexed** \u2014 use built-ins; user runs `homegraph init` (you do not).\n";
|
|
11
|
+
export declare const SERVER_INSTRUCTIONS_NO_ROOT_INDEX = "# HomeGraph \u2014 per-project (pass projectPath)\n\nPass `projectPath` to a folder that has `.homegraph/`.\n\n**Call first:** explain/edit in-repo code \u2192 `homegraph_explore` with task keywords (no Grep-first). Named Type / `Type.member` / usages / deps / NAPI / `@kit` \u2192 explore.\n\nNarrow inventories may call `homegraph_usages`, `homegraph_modules`, or `homegraph_native` directly; pass the same `projectPath`.\n\n**Skip:** topic file-lists, concept compares, literal hunts, git history, media. No index \u2192 Read/Grep/Glob; user runs `homegraph init`.\n\n**Query habit:** Chinese OK; add English Type/`@kit` tokens when known. Explore = coarse locate. Partial \u2192 one tighter follow-up with a concrete name from the list. ONE narrow Grep OK for residual unindexed wiring \u2014 not a Grep storm.\n";
|
|
12
12
|
//# sourceMappingURL=server-instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB,ovHAkD/B,CAAC;AAEF,eAAO,MAAM,iCAAiC,qzBAW7C,CAAC"}
|
|
@@ -20,6 +20,8 @@ Will you **explain or edit in-repo code**? → \`homegraph_explore\` **once** wi
|
|
|
20
20
|
|
|
21
21
|
Already know **one** exact symbol? Prefer smaller tools: \`homegraph_callers\` / \`homegraph_callees\` / \`homegraph_node\`. Spelling unknown → \`homegraph_search\` last.
|
|
22
22
|
|
|
23
|
+
For a narrow inventory, call \`homegraph_usages\` (where-used), \`homegraph_modules\` (named module deps/cycles), or \`homegraph_native\` (NAPI exports). Existing clients may keep calling \`homegraph_explore\`: high-confidence shapes route to the same bounded handlers.
|
|
24
|
+
|
|
23
25
|
**Must explore-first:** how/mechanism wiring, named Type / \`.member\`, in-repo \`@kit\`/\`@ohos\` **usages**, deps/cycles, NAPI / \`.d.ts\` wrap sites, pre-edit orientation.
|
|
24
26
|
|
|
25
27
|
ArkUI V1↔V2 / state-decorator migration on a named component → \`homegraph_arkui_migrate\` once (not explore stitching).
|
|
@@ -65,6 +67,8 @@ Pass \`projectPath\` to a folder that has \`.homegraph/\`.
|
|
|
65
67
|
|
|
66
68
|
**Call first:** explain/edit in-repo code → \`homegraph_explore\` with task keywords (no Grep-first). Named Type / \`Type.member\` / usages / deps / NAPI / \`@kit\` → explore.
|
|
67
69
|
|
|
70
|
+
Narrow inventories may call \`homegraph_usages\`, \`homegraph_modules\`, or \`homegraph_native\` directly; pass the same \`projectPath\`.
|
|
71
|
+
|
|
68
72
|
**Skip:** topic file-lists, concept compares, literal hunts, git history, media. No index → Read/Grep/Glob; user runs \`homegraph init\`.
|
|
69
73
|
|
|
70
74
|
**Query habit:** Chinese OK; add English Type/\`@kit\` tokens when known. Explore = coarse locate. Partial → one tighter follow-up with a concrete name from the list. ONE narrow Grep OK for residual unindexed wiring — not a Grep storm.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEU,QAAA,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDlC,CAAC;AAEW,QAAA,iCAAiC,GAAG;;;;;;;;;;;CAWhD,CAAC"}
|
package/dist/mcp/tools.d.ts
CHANGED
|
@@ -226,12 +226,30 @@ export declare const tools: ToolDefinition[];
|
|
|
226
226
|
* note in a description only adds once `cg` is loaded; the schemas are static).
|
|
227
227
|
*/
|
|
228
228
|
export declare function getStaticTools(): ToolDefinition[];
|
|
229
|
+
/** Identifier-shaped tokens from a bare symbol bag. */
|
|
230
|
+
export declare function extractBareUsageSymbols(query: string): string[];
|
|
229
231
|
/**
|
|
230
|
-
*
|
|
232
|
+
* True only for a short bag of ALL_CAPS constants. Type/method bags remain on
|
|
233
|
+
* explore-flow because routing those to usages would discard call paths.
|
|
234
|
+
*/
|
|
235
|
+
export declare function queryAsBareSymbolInventory(query: string): boolean;
|
|
236
|
+
/** True only for a positive instruction to stop and answer, not "do not/before ANSWER NOW". */
|
|
237
|
+
export declare function hasPositiveAnswerNowDirective(text: string): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Drop stop-searching directives from an output that also declares itself partial.
|
|
231
240
|
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
241
|
+
* Section builders each append their own footer and cannot see their siblings, so
|
|
242
|
+
* one output can carry both `**Partial locator**` ("these are anchors, keep
|
|
243
|
+
* looking") and `**ANSWER NOW**` ("stop, do not Grep"). Measured on a 54-question
|
|
244
|
+
* run: 21 such outputs across 17 of 48 questions. Whichever the agent obeys, the
|
|
245
|
+
* other was wrong — it either answers from an inventory the tool just called
|
|
246
|
+
* incomplete, or it keeps searching against an explicit prohibition.
|
|
247
|
+
*
|
|
248
|
+
* Partial wins: an under-informed agent that keeps looking recovers, while one
|
|
249
|
+
* that stops on a partial answer cannot. Negated mentions (`do **not** ANSWER
|
|
250
|
+
* NOW`) are the correct pairing and are preserved.
|
|
234
251
|
*/
|
|
252
|
+
export declare function reconcilePartialAnswerNow(text: string): string;
|
|
235
253
|
export declare class ToolHandler {
|
|
236
254
|
private cg;
|
|
237
255
|
private projectCache;
|
|
@@ -559,7 +577,10 @@ export declare class ToolHandler {
|
|
|
559
577
|
/**
|
|
560
578
|
* Multi-module / circular dependency survey — lean cycle list, not an import flood.
|
|
561
579
|
*/
|
|
580
|
+
private extractFocusedModuleNames;
|
|
562
581
|
private buildModuleDependencySurveySection;
|
|
582
|
+
/** Bounded manifest-only dependency graph for modules named in the query. */
|
|
583
|
+
private buildFocusedModuleManifestSection;
|
|
563
584
|
/**
|
|
564
585
|
* Path-module / named-Type NAPI export surface — not a 50-file domain dump.
|
|
565
586
|
*/
|
|
@@ -589,6 +610,16 @@ export declare class ToolHandler {
|
|
|
589
610
|
* Main-thread fast path for inventory surveys — skips the worker queue.
|
|
590
611
|
*/
|
|
591
612
|
private tryFastPathResult;
|
|
613
|
+
/** Conservative compatibility router: ambiguous mechanism queries stay broad. */
|
|
614
|
+
private specializedExploreRouteForQuery;
|
|
615
|
+
/** Run exactly one bounded survey family and expose the selected route. */
|
|
616
|
+
private runSpecializedExploreRoute;
|
|
617
|
+
/** Usage sites for a bare symbol bag, including non-call textual references. */
|
|
618
|
+
private buildBareSymbolUsageSection;
|
|
619
|
+
private trySpecializedExploreRoute;
|
|
620
|
+
private handleSpecializedUsages;
|
|
621
|
+
private handleSpecializedModules;
|
|
622
|
+
private handleSpecializedNative;
|
|
592
623
|
/**
|
|
593
624
|
* Fast inventory-only explore — skips findRelevantContext for survey/caller/dependency queries.
|
|
594
625
|
*/
|
|
@@ -615,6 +646,16 @@ export declare class ToolHandler {
|
|
|
615
646
|
* and caps to 1–2 defining files (avoids the ~24K related-file dump).
|
|
616
647
|
*/
|
|
617
648
|
private tryCompactLocalSymbolExplore;
|
|
649
|
+
/**
|
|
650
|
+
* When a lifecycle Type only exists as SDK `.d.ts`, extract state enums +
|
|
651
|
+
* callback registrations from the stub so agents stop grep-storming in-repo.
|
|
652
|
+
*/
|
|
653
|
+
private buildSdkStubLifecycleSection;
|
|
654
|
+
/**
|
|
655
|
+
* Pages sharing a container component + how they inject differentiated
|
|
656
|
+
* ViewModel / LocalStorage state into the shared shell.
|
|
657
|
+
*/
|
|
658
|
+
private buildContainerCompositionSection;
|
|
618
659
|
/**
|
|
619
660
|
* Hover / pointer-handler inventory — onHover / Hover* symbols + short snippets.
|
|
620
661
|
* Used when the agent asks about hover effects without naming a Type yet.
|
package/dist/mcp/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiB9C,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,cAAc,UAAU,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAE9F;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiB9C,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,cAAc,UAAU,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAE9F;AAQD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAmB3C,OAAO,EAGL,mBAAmB,EAGnB,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAqDjC;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAE7C,8EAA8E;AAC9E,qBAAa,yBAA0B,SAAQ,KAAK;CAAG;AAEvD;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AAgK9C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA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