@nexrall/code-core 1.4.63 → 1.4.65

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.
Files changed (45) hide show
  1. package/dist/agent/agentRegistry.d.ts +14 -3
  2. package/dist/agent/agentRegistry.d.ts.map +1 -1
  3. package/dist/agent/agentRegistry.js +136 -6
  4. package/dist/agent/agentTypes.d.ts +51 -1
  5. package/dist/agent/agentTypes.d.ts.map +1 -1
  6. package/dist/agent/agentTypes.js +194 -11
  7. package/dist/agent/backgroundAgents.d.ts +66 -0
  8. package/dist/agent/backgroundAgents.d.ts.map +1 -0
  9. package/dist/agent/backgroundAgents.js +145 -0
  10. package/dist/agent/loop.d.ts +43 -6
  11. package/dist/agent/loop.d.ts.map +1 -1
  12. package/dist/agent/loop.js +942 -259
  13. package/dist/agent/modelCatalogue.d.ts +15 -0
  14. package/dist/agent/modelCatalogue.d.ts.map +1 -1
  15. package/dist/agent/modelCatalogue.js +46 -0
  16. package/dist/agent/readDedupe.d.ts +15 -0
  17. package/dist/agent/readDedupe.d.ts.map +1 -0
  18. package/dist/agent/readDedupe.js +146 -0
  19. package/dist/agent/toolPrefetch.d.ts +44 -0
  20. package/dist/agent/toolPrefetch.d.ts.map +1 -0
  21. package/dist/agent/toolPrefetch.js +101 -0
  22. package/dist/agent/trust.d.ts +0 -5
  23. package/dist/agent/trust.d.ts.map +1 -1
  24. package/dist/agent/trust.js +41 -0
  25. package/dist/api/client.d.ts +14 -0
  26. package/dist/api/client.d.ts.map +1 -1
  27. package/dist/api/client.js +88 -8
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +1 -0
  31. package/dist/permissions/modePolicy.d.ts +10 -0
  32. package/dist/permissions/modePolicy.d.ts.map +1 -1
  33. package/dist/permissions/modePolicy.js +11 -0
  34. package/dist/tools/executor.d.ts +36 -0
  35. package/dist/tools/executor.d.ts.map +1 -1
  36. package/dist/tools/executor.js +408 -85
  37. package/dist/tools/tsLangService.d.ts.map +1 -1
  38. package/dist/tools/tsLangService.js +107 -21
  39. package/dist/types.d.ts +99 -5
  40. package/dist/types.d.ts.map +1 -1
  41. package/dist/types.js +12 -1
  42. package/dist/util/miniYaml.d.ts +10 -0
  43. package/dist/util/miniYaml.d.ts.map +1 -0
  44. package/dist/util/miniYaml.js +149 -0
  45. package/package.json +8 -17
@@ -64,4 +64,19 @@ export declare function liveCostMultiplierFor(id: string | undefined, fallback:
64
64
  export declare function liveSelectableModelIds(): string[] | null;
65
65
  /** Test-only: reset the module-level cache between test cases. */
66
66
  export declare function _resetModelCatalogueCacheForTests(): void;
67
+ /**
68
+ * `model: cheapest` — Claude Code's Explore-on-Haiku idea, without leaving the
69
+ * provider the user chose. Resolves to the lowest-costMultiplier AVAILABLE model
70
+ * of the parent session's vendor (Opus → Sonnet, GPT-6 Sol → GPT-6 Luna, …), never
71
+ * a pricier one. Returns the parent model unchanged when the catalogue is not
72
+ * loaded or does not know it — inheriting is always a safe fallback; guessing a
73
+ * model on another provider (the bug that made explorer bill Anthropic for
74
+ * DeepSeek sessions) is not.
75
+ */
76
+ export declare const CHEAPEST_MODEL_ALIAS = "cheapest";
77
+ export declare function cheapestSameVendorModel(parentModel: string | undefined): string | undefined;
78
+ /** Resolve a sub-agent's `model:` against its parent's: undefined/inherit → parent, cheapest → see above. */
79
+ export declare function resolveSubAgentModel(agentModel: string | undefined, parentModel: string | undefined): string | undefined;
80
+ /** Test hook: install a catalogue without a network fetch. */
81
+ export declare function _setModelCatalogueForTest(models: CodeModelInfo[] | null): void;
67
82
  //# sourceMappingURL=modelCatalogue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modelCatalogue.d.ts","sourceRoot":"","sources":["../../src/agent/modelCatalogue.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAiBlE;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,IAAI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gB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAExE;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG9G;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,GAAG,IAAI,CAExD;AAED,kEAAkE;AAClE,wBAAgB,iCAAiC,IAAI,IAAI,CAGxD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAO/C,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAW3F;AAED,6GAA6G;AAC7G,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIxH;AAED,8DAA8D;AAC9D,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,GAAG,IAAI,CAE9E"}
@@ -47,6 +47,7 @@
47
47
  // added mid-session is vanishingly rare and would need a restart to use
48
48
  // safely anyway, since the picker itself is also static per-render).
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.CHEAPEST_MODEL_ALIAS = void 0;
50
51
  exports.getModelCatalogue = getModelCatalogue;
51
52
  exports.getCachedModelCatalogue = getCachedModelCatalogue;
52
53
  exports.liveContextWindowFor = liveContextWindowFor;
@@ -59,6 +60,9 @@ exports.liveLabelFor = liveLabelFor;
59
60
  exports.liveCostMultiplierFor = liveCostMultiplierFor;
60
61
  exports.liveSelectableModelIds = liveSelectableModelIds;
61
62
  exports._resetModelCatalogueCacheForTests = _resetModelCatalogueCacheForTests;
63
+ exports.cheapestSameVendorModel = cheapestSameVendorModel;
64
+ exports.resolveSubAgentModel = resolveSubAgentModel;
65
+ exports._setModelCatalogueForTest = _setModelCatalogueForTest;
62
66
  const client_1 = require("../api/client");
63
67
  /** How long a successful fetch is trusted before a caller should re-fetch. */
64
68
  const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes — matches backend's own getPricing() TTL
@@ -180,4 +184,46 @@ function _resetModelCatalogueCacheForTests() {
180
184
  _state = null;
181
185
  _inFlight = null;
182
186
  }
187
+ /**
188
+ * `model: cheapest` — Claude Code's Explore-on-Haiku idea, without leaving the
189
+ * provider the user chose. Resolves to the lowest-costMultiplier AVAILABLE model
190
+ * of the parent session's vendor (Opus → Sonnet, GPT-6 Sol → GPT-6 Luna, …), never
191
+ * a pricier one. Returns the parent model unchanged when the catalogue is not
192
+ * loaded or does not know it — inheriting is always a safe fallback; guessing a
193
+ * model on another provider (the bug that made explorer bill Anthropic for
194
+ * DeepSeek sessions) is not.
195
+ */
196
+ exports.CHEAPEST_MODEL_ALIAS = 'cheapest';
197
+ // Legacy tier aliases the backend still resolves (see agentTypes.ts VALID_MODELS).
198
+ const LEGACY_ALIAS_IDS = {
199
+ turbo: 'claude-sonnet-5-5', fast: 'claude-sonnet-5-5', pro: 'claude-opus-5-5', ultra: 'claude-fable-5-1',
200
+ };
201
+ function cheapestSameVendorModel(parentModel) {
202
+ if (!_state || !parentModel)
203
+ return parentModel;
204
+ const parent = findModel(parentModel) ?? findModel(LEGACY_ALIAS_IDS[parentModel]);
205
+ if (!parent)
206
+ return parentModel;
207
+ const parentCost = parent.costMultiplier ?? Infinity;
208
+ let best = parent;
209
+ for (const m of _state.models) {
210
+ if (m.vendor !== parent.vendor || m.available === false || typeof m.costMultiplier !== 'number')
211
+ continue;
212
+ if (m.costMultiplier < (best.costMultiplier ?? Infinity) && m.costMultiplier <= parentCost)
213
+ best = m;
214
+ }
215
+ return best === parent ? parentModel : best.id;
216
+ }
217
+ /** Resolve a sub-agent's `model:` against its parent's: undefined/inherit → parent, cheapest → see above. */
218
+ function resolveSubAgentModel(agentModel, parentModel) {
219
+ if (!agentModel || agentModel === 'inherit')
220
+ return parentModel;
221
+ if (agentModel === exports.CHEAPEST_MODEL_ALIAS)
222
+ return cheapestSameVendorModel(parentModel);
223
+ return agentModel;
224
+ }
225
+ /** Test hook: install a catalogue without a network fetch. */
226
+ function _setModelCatalogueForTest(models) {
227
+ _state = models ? { models, defaultModel: models[0]?.id ?? '', fetchedAt: Date.now() } : null;
228
+ }
183
229
  //# sourceMappingURL=modelCatalogue.js.map
@@ -0,0 +1,15 @@
1
+ import type { Message } from '../types';
2
+ export declare class ReadDedupe {
3
+ private readonly workDir?;
4
+ private readonly records;
5
+ constructor(workDir?: string | undefined);
6
+ private resolve;
7
+ private key;
8
+ /** The stub to return instead of re-reading, or null to read normally. */
9
+ check(input: Record<string, unknown>, messages: Message[]): string | null;
10
+ /** Remember a successful full read. Call only with a real (non-stub) read_file output. */
11
+ record(input: Record<string, unknown>, toolUseId: string): void;
12
+ /** Forget every recorded range of these absolute paths (a write tool touched them). */
13
+ invalidate(absPaths: string[]): void;
14
+ }
15
+ //# sourceMappingURL=readDedupe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readDedupe.d.ts","sourceRoot":"","sources":["../../src/agent/readDedupe.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMxC,qBAAa,UAAU;IAGT,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAFrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;gBAE5B,OAAO,CAAC,EAAE,MAAM,YAAA;IAE7C,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,GAAG;IAQX,0EAA0E;IAC1E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,IAAI;IAezE,0FAA0F;IAC1F,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAS/D,uFAAuF;IACvF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;CAOrC"}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ // read_file de-duplication — Claude Code's "file unchanged since last read" stub.
3
+ //
4
+ // Agents re-read the same file constantly (before an edit, after a test run, while
5
+ // re-checking a plan). Each re-read re-sent up to 25K tokens that were ALREADY in the
6
+ // conversation, and every later request then carried both copies. When the file has not
7
+ // changed and the earlier result is still intact in the history, a one-line stub
8
+ // pointing at it is equivalent for the model and costs ~40 tokens.
9
+ //
10
+ // Safety is the whole design: the stub is only correct if the model can still SEE the
11
+ // earlier content. So a hit requires ALL of:
12
+ // • same resolved path, offset and limit as a previous successful read in THIS run
13
+ // (one instance per runAgentLoop — a sub-agent starts with a fresh context and a
14
+ // fresh instance, so it never gets pointed at its parent's reads);
15
+ // • the file's mtime and size are unchanged since that read, and no write tool has
16
+ // touched the path since (explicit invalidation — mtime alone can miss a same-ms edit);
17
+ // • that read's tool_result is still in the live message array, unpruned — compaction,
18
+ // pruneOldToolResults or a rewind all remove or stub it, which turns the hit off.
19
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ var desc = Object.getOwnPropertyDescriptor(m, k);
22
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23
+ desc = { enumerable: true, get: function() { return m[k]; } };
24
+ }
25
+ Object.defineProperty(o, k2, desc);
26
+ }) : (function(o, m, k, k2) {
27
+ if (k2 === undefined) k2 = k;
28
+ o[k2] = m[k];
29
+ }));
30
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
31
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
32
+ }) : function(o, v) {
33
+ o["default"] = v;
34
+ });
35
+ var __importStar = (this && this.__importStar) || (function () {
36
+ var ownKeys = function(o) {
37
+ ownKeys = Object.getOwnPropertyNames || function (o) {
38
+ var ar = [];
39
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40
+ return ar;
41
+ };
42
+ return ownKeys(o);
43
+ };
44
+ return function (mod) {
45
+ if (mod && mod.__esModule) return mod;
46
+ var result = {};
47
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
48
+ __setModuleDefault(result, mod);
49
+ return result;
50
+ };
51
+ })();
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.ReadDedupe = void 0;
54
+ const fs = __importStar(require("fs"));
55
+ const path = __importStar(require("path"));
56
+ const PRUNED_TAIL = 'pruned to conserve context. Re-run the tool if you need the full result.]';
57
+ class ReadDedupe {
58
+ constructor(workDir) {
59
+ this.workDir = workDir;
60
+ this.records = new Map();
61
+ }
62
+ resolve(p) {
63
+ if (typeof p !== 'string' || !p)
64
+ return null;
65
+ const expanded = p.startsWith('~/') ? path.join(process.env.HOME ?? '', p.slice(2)) : p;
66
+ return this.workDir ? path.resolve(this.workDir, expanded) : path.resolve(expanded);
67
+ }
68
+ key(input) {
69
+ const abs = this.resolve(input.path);
70
+ if (!abs)
71
+ return null;
72
+ const offset = typeof input.offset === 'number' ? Math.max(0, Math.floor(input.offset)) : 0;
73
+ const limit = typeof input.limit === 'number' ? Math.max(1, Math.floor(input.limit)) : 0;
74
+ return { key: `${abs}\0${offset}\0${limit}`, abs };
75
+ }
76
+ /** The stub to return instead of re-reading, or null to read normally. */
77
+ check(input, messages) {
78
+ const k = this.key(input);
79
+ if (!k)
80
+ return null;
81
+ const rec = this.records.get(k.key);
82
+ if (!rec)
83
+ return null;
84
+ let st;
85
+ try {
86
+ st = fs.statSync(k.abs);
87
+ }
88
+ catch {
89
+ this.records.delete(k.key);
90
+ return null;
91
+ }
92
+ if (st.mtimeMs !== rec.mtimeMs || st.size !== rec.size) {
93
+ this.records.delete(k.key);
94
+ return null;
95
+ }
96
+ if (!resultStillIntact(messages, rec.toolUseId)) {
97
+ this.records.delete(k.key);
98
+ return null;
99
+ }
100
+ return (`File unchanged since your last read_file of it (same range). The content in that earlier ` +
101
+ `tool result is still current — refer to it instead of re-reading.`);
102
+ }
103
+ /** Remember a successful full read. Call only with a real (non-stub) read_file output. */
104
+ record(input, toolUseId) {
105
+ const k = this.key(input);
106
+ if (!k)
107
+ return;
108
+ try {
109
+ const st = fs.statSync(k.abs);
110
+ this.records.set(k.key, { toolUseId, mtimeMs: st.mtimeMs, size: st.size });
111
+ }
112
+ catch { /* unreadable now — nothing to remember */ }
113
+ }
114
+ /** Forget every recorded range of these absolute paths (a write tool touched them). */
115
+ invalidate(absPaths) {
116
+ if (!absPaths.length || !this.records.size)
117
+ return;
118
+ const set = new Set(absPaths);
119
+ for (const key of [...this.records.keys()]) {
120
+ if (set.has(key.slice(0, key.indexOf('\0'))))
121
+ this.records.delete(key);
122
+ }
123
+ }
124
+ }
125
+ exports.ReadDedupe = ReadDedupe;
126
+ function resultStillIntact(messages, toolUseId) {
127
+ for (let i = messages.length - 1; i >= 0; i--) {
128
+ const m = messages[i];
129
+ if (m.role !== 'user' || !Array.isArray(m.content))
130
+ continue;
131
+ for (const b of m.content) {
132
+ if (b?.type !== 'tool_result' || b.tool_use_id !== toolUseId)
133
+ continue;
134
+ if (b.is_error)
135
+ return false;
136
+ const text = typeof b.content === 'string'
137
+ ? b.content
138
+ : Array.isArray(b.content)
139
+ ? b.content.map((c) => c.text ?? '').join('')
140
+ : '';
141
+ return text.startsWith('[File:') && !text.trimEnd().endsWith(PRUNED_TAIL);
142
+ }
143
+ }
144
+ return false;
145
+ }
146
+ //# sourceMappingURL=readDedupe.js.map
@@ -0,0 +1,44 @@
1
+ import type { ToolResult } from '../types';
2
+ /**
3
+ * Streaming tool prefetch — start read-only tools while the model is still
4
+ * generating the rest of its message.
5
+ *
6
+ * Before: every tool waited for the WHOLE assistant message (all later tool calls,
7
+ * any trailing text, and the backend's post-message billing write) before the first
8
+ * one started. The backend now announces each tool_use block the moment it is
9
+ * complete (SSE `tool_use_ready`); for tools that only READ the filesystem we start
10
+ * executing immediately and hold the result.
11
+ *
12
+ * Safety model — the prefetched result is only a cache, never a bypass:
13
+ * • Dispatch still happens from the completed message and still goes through every
14
+ * gate (plan mode, worktree isolation, permission, PreToolUse hooks, read dedupe).
15
+ * A refused call simply drops its prefetched result; reading had no side effect.
16
+ * • Reused only for the identical call (same id, same name, same input).
17
+ * • Only pure reads are prefetched, and only reused when nothing else in the same
18
+ * message can change the filesystem (see isPrefetchSafeMessage) — otherwise the
19
+ * early read could observe state from BEFORE a write the model ordered first.
20
+ */
21
+ /** Built-in tools that only read the filesystem — safe to run before approval. */
22
+ export declare const PREFETCHABLE_TOOLS: ReadonlySet<string>;
23
+ /** True when no tool in this message can mutate the workspace. */
24
+ export declare function isPrefetchSafeMessage(toolNames: readonly string[]): boolean;
25
+ /** Kill switch: NEXRALL_TOOL_PREFETCH=0 restores the old wait-for-message timing. */
26
+ export declare function toolPrefetchEnabled(): boolean;
27
+ type Runner = (name: string, input: Record<string, unknown>) => Promise<ToolResult>;
28
+ export declare class ToolPrefetcher {
29
+ private readonly run;
30
+ private readonly entries;
31
+ constructor(run: Runner);
32
+ /** Start `name` early if it is a pure read. Idempotent per id. */
33
+ start(id: string, name: string, input: Record<string, unknown>): boolean;
34
+ /**
35
+ * The prefetched result for exactly this call, or null. Always removes the entry,
36
+ * so a result is handed out at most once.
37
+ */
38
+ take(id: string, name: string, input: Record<string, unknown>): Promise<ToolResult> | null;
39
+ /** Drop everything (stream restarted — the ids it announced will never be dispatched). */
40
+ clear(): void;
41
+ get size(): number;
42
+ }
43
+ export {};
44
+ //# sourceMappingURL=toolPrefetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolPrefetch.d.ts","sourceRoot":"","sources":["../../src/agent/toolPrefetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AAEH,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAKjD,CAAC;AAiBH,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE3E;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AASD,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEpF,qBAAa,cAAc;IAGb,OAAO,CAAC,QAAQ,CAAC,GAAG;IAFhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkF;gBAE7E,GAAG,EAAE,MAAM;IAExC,kEAAkE;IAClE,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IAWxE;;;OAGG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI;IAQ1F,0FAA0F;IAC1F,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolPrefetcher = exports.PREFETCHABLE_TOOLS = void 0;
4
+ exports.isPrefetchSafeMessage = isPrefetchSafeMessage;
5
+ exports.toolPrefetchEnabled = toolPrefetchEnabled;
6
+ /**
7
+ * Streaming tool prefetch — start read-only tools while the model is still
8
+ * generating the rest of its message.
9
+ *
10
+ * Before: every tool waited for the WHOLE assistant message (all later tool calls,
11
+ * any trailing text, and the backend's post-message billing write) before the first
12
+ * one started. The backend now announces each tool_use block the moment it is
13
+ * complete (SSE `tool_use_ready`); for tools that only READ the filesystem we start
14
+ * executing immediately and hold the result.
15
+ *
16
+ * Safety model — the prefetched result is only a cache, never a bypass:
17
+ * • Dispatch still happens from the completed message and still goes through every
18
+ * gate (plan mode, worktree isolation, permission, PreToolUse hooks, read dedupe).
19
+ * A refused call simply drops its prefetched result; reading had no side effect.
20
+ * • Reused only for the identical call (same id, same name, same input).
21
+ * • Only pure reads are prefetched, and only reused when nothing else in the same
22
+ * message can change the filesystem (see isPrefetchSafeMessage) — otherwise the
23
+ * early read could observe state from BEFORE a write the model ordered first.
24
+ */
25
+ /** Built-in tools that only read the filesystem — safe to run before approval. */
26
+ exports.PREFETCHABLE_TOOLS = new Set([
27
+ 'read_file',
28
+ 'list_directory',
29
+ 'glob',
30
+ 'search_files',
31
+ ]);
32
+ /**
33
+ * Tools that may share a message with a prefetched read without invalidating it:
34
+ * they cannot change files in the workspace.
35
+ */
36
+ const NON_MUTATING_COMPANIONS = new Set([
37
+ ...exports.PREFETCHABLE_TOOLS,
38
+ 'notebook_read',
39
+ 'todo_write', 'todo_read',
40
+ 'memory_read',
41
+ 'use_skill',
42
+ 'fetch_url', 'web_search',
43
+ 'get_diagnostics', 'go_to_definition', 'find_references',
44
+ 'get_symbols', 'get_workspace_symbols', 'get_hover',
45
+ ]);
46
+ /** True when no tool in this message can mutate the workspace. */
47
+ function isPrefetchSafeMessage(toolNames) {
48
+ return toolNames.every((n) => NON_MUTATING_COMPANIONS.has(n));
49
+ }
50
+ /** Kill switch: NEXRALL_TOOL_PREFETCH=0 restores the old wait-for-message timing. */
51
+ function toolPrefetchEnabled() {
52
+ return process.env.NEXRALL_TOOL_PREFETCH !== '0';
53
+ }
54
+ function stableKey(value) {
55
+ if (value === null || typeof value !== 'object')
56
+ return JSON.stringify(value) ?? 'undefined';
57
+ if (Array.isArray(value))
58
+ return `[${value.map(stableKey).join(',')}]`;
59
+ const obj = value;
60
+ return `{${Object.keys(obj).sort().map((k) => `${JSON.stringify(k)}:${stableKey(obj[k])}`).join(',')}}`;
61
+ }
62
+ class ToolPrefetcher {
63
+ constructor(run) {
64
+ this.run = run;
65
+ this.entries = new Map();
66
+ }
67
+ /** Start `name` early if it is a pure read. Idempotent per id. */
68
+ start(id, name, input) {
69
+ if (!id || !exports.PREFETCHABLE_TOOLS.has(name) || this.entries.has(id))
70
+ return false;
71
+ // Never rejects: an unobserved rejection (the call may be refused later and never
72
+ // awaited) would otherwise surface as an unhandled rejection.
73
+ const promise = Promise.resolve()
74
+ .then(() => this.run(name, input))
75
+ .catch((err) => ({ error: `Tool execution failed: ${err?.message ?? String(err)}` }));
76
+ this.entries.set(id, { name, key: stableKey(input), promise });
77
+ return true;
78
+ }
79
+ /**
80
+ * The prefetched result for exactly this call, or null. Always removes the entry,
81
+ * so a result is handed out at most once.
82
+ */
83
+ take(id, name, input) {
84
+ const e = this.entries.get(id);
85
+ if (!e)
86
+ return null;
87
+ this.entries.delete(id);
88
+ if (e.name !== name || e.key !== stableKey(input))
89
+ return null;
90
+ return e.promise;
91
+ }
92
+ /** Drop everything (stream restarted — the ids it announced will never be dispatched). */
93
+ clear() {
94
+ this.entries.clear();
95
+ }
96
+ get size() {
97
+ return this.entries.size;
98
+ }
99
+ }
100
+ exports.ToolPrefetcher = ToolPrefetcher;
101
+ //# sourceMappingURL=toolPrefetch.js.map
@@ -1,7 +1,2 @@
1
- /**
2
- * Which trust-sensitive files actually exist in `dir`, so a confirmation
3
- * prompt can tell the user what THIS folder will do rather than describing
4
- * risks in the abstract. Ordered most- to least-dangerous.
5
- */
6
1
  export declare function detectTrustSignals(dir: string): string[];
7
2
  //# sourceMappingURL=trust.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../../src/agent/trust.ts"],"names":[],"mappings":"AAqDA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAkExD"}
1
+ {"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../../src/agent/trust.ts"],"names":[],"mappings":"AAiFA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAyExD"}
@@ -90,6 +90,40 @@ function declaresPluginSources(dir) {
90
90
  * prompt can tell the user what THIS folder will do rather than describing
91
91
  * risks in the abstract. Ordered most- to least-dangerous.
92
92
  */
93
+ /** Agent definitions under .nexrall/agents that declare `hooks:` (they run shell commands). */
94
+ function agentFilesWithHooks(dir) {
95
+ const root = path.join(dir, '.nexrall', 'agents');
96
+ const found = [];
97
+ const walk = (d, depth) => {
98
+ if (depth > 4 || found.length > 20)
99
+ return;
100
+ let entries;
101
+ try {
102
+ entries = fs.readdirSync(d, { withFileTypes: true });
103
+ }
104
+ catch {
105
+ return;
106
+ }
107
+ for (const e of entries) {
108
+ const full = path.join(d, e.name);
109
+ if (e.isDirectory()) {
110
+ walk(full, depth + 1);
111
+ continue;
112
+ }
113
+ if (!e.name.endsWith('.md'))
114
+ continue;
115
+ try {
116
+ const head = fs.readFileSync(full, 'utf-8').slice(0, 64 * 1024);
117
+ const fm = head.replace(/^\uFEFF/, '').match(/^---\r?\n([\s\S]*?)\r?\n---/);
118
+ if (fm && /^hooks\s*:/im.test(fm[1]))
119
+ found.push(path.relative(dir, full).replace(/\\/g, '/'));
120
+ }
121
+ catch { /* unreadable — not a signal */ }
122
+ }
123
+ };
124
+ walk(root, 0);
125
+ return found;
126
+ }
93
127
  function detectTrustSignals(dir) {
94
128
  const signals = [];
95
129
  const exists = (...p) => {
@@ -137,6 +171,13 @@ function detectTrustSignals(dir) {
137
171
  bits.push('runs hooks (shell commands) automatically around tool calls');
138
172
  signals.push(bits.join(', '));
139
173
  }
174
+ // Agent definitions can carry their own hooks (Claude Code's agent-scoped `hooks:`),
175
+ // which run shell commands around that agent's tool calls — same risk as settings hooks.
176
+ const hookedAgents = agentFilesWithHooks(dir);
177
+ if (hookedAgents.length) {
178
+ const shown = hookedAgents.slice(0, 3).join(', ') + (hookedAgents.length > 3 ? ` (+${hookedAgents.length - 3} more)` : '');
179
+ signals.push(`${shown} — agent definition(s) that run hooks (shell commands) around their tool calls`);
180
+ }
140
181
  // Then things that steer the agent's behaviour.
141
182
  if (exists('nexrall.md')) {
142
183
  signals.push('nexrall.md — project instructions added to the agent\u2019s prompt');
@@ -81,6 +81,12 @@ export interface StreamChatOptions {
81
81
  * Undefined means "main agent" (may browse).
82
82
  */
83
83
  canBrowseWeb?: boolean;
84
+ /**
85
+ * When set, the backend sends ONLY these builtin tool schemas (sub-agents with an
86
+ * allowlist). Absent = every builtin. Older backends ignore it — the permission gate
87
+ * still enforces the allowlist either way; this only trims what is sent.
88
+ */
89
+ toolAllowlist?: string[];
84
90
  /**
85
91
  * Opt in to restarting a turn that died AFTER partial output was rendered.
86
92
  *
@@ -99,6 +105,14 @@ export interface StreamChatOptions {
99
105
  */
100
106
  allowRestartAfterRender?: boolean;
101
107
  }
108
+ /**
109
+ * Whether a tool_use round may return as soon as message_complete + usage arrive,
110
+ * instead of waiting for the trailing `done` (which the backend only sends after its
111
+ * billing DB write). NEXRALL_EARLY_TOOL_RESOLVE=0 restores the old wait.
112
+ */
113
+ export declare function earlyToolResolveEnabled(): boolean;
114
+ /** NEXRALL_GZIP_REQUESTS=0 sends chat bodies uncompressed. */
115
+ export declare function gzipRequestsEnabled(): boolean;
102
116
  export declare function streamChat(messages: Message[], options: StreamChatOptions, onEvent: (e: SSEEvent) => void): Promise<Message>;
103
117
  /**
104
118
  * Ask the server to stop generating a turn.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":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