@nexrall/code-core 1.4.50 → 1.4.55

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.
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Audit trail — a tamper-*visible* record of every tool call an agent makes.
3
+ *
4
+ * WHY THIS EXISTS
5
+ *
6
+ * Regulated buyers (finance first, but the same applies to healthcare/legal) do
7
+ * not reject agents for being unintelligent — they reject them for being
8
+ * UNAUDITABLE. The single most common finance-side audit finding in 2026 is an
9
+ * AI touching business data through a service account with no record of which
10
+ * HUMAN initiated the work, which fails SOX's individual-attribution standard.
11
+ * The remedy auditors name is "dual attribution": log the machine identity AND
12
+ * the authenticated human, together, per action.
13
+ *
14
+ * So this module records, for every tool call: what ran, who (agent) ran it, on
15
+ * whose behalf (human, supplied by the host), what the arguments were, and what
16
+ * came back — including calls that were BLOCKED and never executed, which is
17
+ * exactly what a security reviewer wants to see.
18
+ *
19
+ * WHAT IT DELIBERATELY IS NOT
20
+ *
21
+ * It does not make the agent correct, and it is not a data lake: outputs are
22
+ * truncated to a summary. It proves what happened; domain correctness is the
23
+ * job of skills/sub-agent definitions, not of this file.
24
+ *
25
+ * See docs/NEXRALL_AUDIT_TRAIL_LAYER.md (in the Nexrall repo) for the full
26
+ * design, including why the recording point is the loop's per-round result
27
+ * iteration rather than the onToolUse/onToolResult callbacks (short version:
28
+ * those are re-emitted upward by sub-agents, so auditing them double-counts
29
+ * every nested call, at a rate that varies with depth).
30
+ */
31
+ /** How the tool call ended. `blocked` = refused before execution. */
32
+ export type AuditOutcome = 'ok' | 'error' | 'blocked';
33
+ /**
34
+ * One immutable line of the trail.
35
+ *
36
+ * Field names are stable: downstream consumers (SIEM pipelines, auditor
37
+ * exports) key off them, so treat renames as breaking changes.
38
+ */
39
+ export interface AuditRecord {
40
+ /** ISO-8601 UTC. */
41
+ ts: string;
42
+ /** Stable per top-level run; inherited by sub-agents so a tree shares one id. */
43
+ sessionId: string;
44
+ /**
45
+ * The authenticated HUMAN, supplied by the host application.
46
+ *
47
+ * Never inferred here: core only holds a bearer token, and a token is a
48
+ * secret that must not be written to a log. Absent when the host supplied
49
+ * none — deliberately NOT defaulted to "system", because a fabricated
50
+ * attribution is worse than a visibly missing one.
51
+ */
52
+ userId?: string;
53
+ /** Agent identity: 'root' for the main agent, 'sub_N' for a sub-agent. */
54
+ actor: string;
55
+ /** 0 = main agent, 1+ = sub-agent nesting depth. */
56
+ depth: number;
57
+ /** Sub-agent type name, when this run is a typed sub-agent. */
58
+ agentType?: string;
59
+ model?: string;
60
+ tool: string;
61
+ /** Full arguments — this is what lets an auditor trace a number back to its source. */
62
+ input: unknown;
63
+ ok: boolean;
64
+ outcome: AuditOutcome;
65
+ error?: string;
66
+ /** Truncated: the trail records that output existed and its shape, not a copy of it. */
67
+ outputSummary?: string;
68
+ exitCode?: number;
69
+ workDir: string;
70
+ }
71
+ /**
72
+ * Where records go. The core ships one reference implementation (JSONL); every
73
+ * other destination (SIEM, customer database, hosted service) is the host's
74
+ * choice, which keeps transport and retention policy out of the agent loop.
75
+ *
76
+ * May be sync or async. It is never awaited on the tool path — see recordAudit.
77
+ */
78
+ export interface AuditSink {
79
+ record(entry: AuditRecord): void | Promise<void>;
80
+ }
81
+ /** Host-side configuration. Absent from options => auditing is entirely off. */
82
+ export interface AuditConfig {
83
+ sink: AuditSink;
84
+ /** The authenticated human this run acts for. See AuditRecord.userId. */
85
+ userId?: string;
86
+ /** Stable id for the run. Generated when omitted. */
87
+ sessionId?: string;
88
+ /**
89
+ * Last chance to mask or drop a record before it reaches the sink. Return
90
+ * null to drop it entirely.
91
+ *
92
+ * Never applied by default: silently rewriting an audit record is itself an
93
+ * audit problem, so the policy belongs with the host that knows its own data.
94
+ */
95
+ redact?: (entry: AuditRecord) => AuditRecord | null;
96
+ }
97
+ /** Output is summarised, not archived — keeps the trail a trail. */
98
+ export declare const AUDIT_OUTPUT_LIMIT = 2000;
99
+ /**
100
+ * Classify an outcome.
101
+ *
102
+ * A blocked call is NOT the same as a failed one, and collapsing the two would
103
+ * hide the security-relevant half of the trail: "the agent tried to write to
104
+ * production and was refused" must not read as "a tool errored".
105
+ *
106
+ * Detection is by the loop's own refusal messages. If those strings change, a
107
+ * blocked call degrades to `error` — still recorded, still visibly not-ok, so
108
+ * the failure mode is a less precise label rather than a missing entry.
109
+ */
110
+ export declare function classifyOutcome(ok: boolean, error: string | undefined): AuditOutcome;
111
+ export interface AuditContext {
112
+ config: AuditConfig;
113
+ sessionId: string;
114
+ actor: string;
115
+ depth: number;
116
+ agentType?: string;
117
+ model?: string;
118
+ workDir: string;
119
+ }
120
+ /**
121
+ * Build + emit one record. Fire-and-forget by design.
122
+ *
123
+ * An audit trail is a compliance artefact, not a correctness dependency: a full
124
+ * disk, a wedged SIEM or a buggy custom sink must not kill a run that is
125
+ * halfway through real work. So every sink failure — sync throw or rejected
126
+ * promise — is swallowed here, and the sink is never awaited (the tool round is
127
+ * on the latency-critical path; the Desktop app targets a ~0 ms local loop).
128
+ *
129
+ * The stricter "fail closed" policy (abort the run when the trail cannot be
130
+ * written) is a real requirement in some deployments but changes the loop's
131
+ * failure semantics, so it is intentionally not bolted on here.
132
+ */
133
+ export declare function recordAudit(ctx: AuditContext, tool: string, input: unknown, ok: boolean, output: string | undefined, error: string | undefined, exitCode: number | undefined): void;
134
+ /**
135
+ * Append-only JSONL sink — the reference implementation.
136
+ *
137
+ * One JSON object per line, appended with `fs.appendFileSync`. Chosen over a
138
+ * buffered writer because an audit line that is still sitting in a buffer when
139
+ * the process is killed is an audit line that does not exist; appending each
140
+ * record keeps the on-disk trail consistent with what actually ran. Writes are
141
+ * small and the call site never awaits, so this does not sit on the latency path.
142
+ *
143
+ * Not a tamper-EVIDENCE claim: it makes no cryptographic guarantee. Deployments
144
+ * needing that should point this at WORM storage or supply their own sink.
145
+ * Created with mode 0600 — a trail can contain business-sensitive arguments.
146
+ */
147
+ export declare function createJsonlAuditSink(filePath: string): AuditSink;
148
+ /** In-memory sink — for tests and for hosts that forward records themselves. */
149
+ export declare function createMemoryAuditSink(): AuditSink & {
150
+ records: AuditRecord[];
151
+ };
152
+ /** Stable-enough id without pulling in a uuid dependency. */
153
+ export declare function newAuditSessionId(): string;
154
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/agent/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD;AAED,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAA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makes.
4
+ *
5
+ * WHY THIS EXISTS
6
+ *
7
+ * Regulated buyers (finance first, but the same applies to healthcare/legal) do
8
+ * not reject agents for being unintelligent — they reject them for being
9
+ * UNAUDITABLE. The single most common finance-side audit finding in 2026 is an
10
+ * AI touching business data through a service account with no record of which
11
+ * HUMAN initiated the work, which fails SOX's individual-attribution standard.
12
+ * The remedy auditors name is "dual attribution": log the machine identity AND
13
+ * the authenticated human, together, per action.
14
+ *
15
+ * So this module records, for every tool call: what ran, who (agent) ran it, on
16
+ * whose behalf (human, supplied by the host), what the arguments were, and what
17
+ * came back — including calls that were BLOCKED and never executed, which is
18
+ * exactly what a security reviewer wants to see.
19
+ *
20
+ * WHAT IT DELIBERATELY IS NOT
21
+ *
22
+ * It does not make the agent correct, and it is not a data lake: outputs are
23
+ * truncated to a summary. It proves what happened; domain correctness is the
24
+ * job of skills/sub-agent definitions, not of this file.
25
+ *
26
+ * See docs/NEXRALL_AUDIT_TRAIL_LAYER.md (in the Nexrall repo) for the full
27
+ * design, including why the recording point is the loop's per-round result
28
+ * iteration rather than the onToolUse/onToolResult callbacks (short version:
29
+ * those are re-emitted upward by sub-agents, so auditing them double-counts
30
+ * every nested call, at a rate that varies with depth).
31
+ */
32
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
33
+ if (k2 === undefined) k2 = k;
34
+ var desc = Object.getOwnPropertyDescriptor(m, k);
35
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
36
+ desc = { enumerable: true, get: function() { return m[k]; } };
37
+ }
38
+ Object.defineProperty(o, k2, desc);
39
+ }) : (function(o, m, k, k2) {
40
+ if (k2 === undefined) k2 = k;
41
+ o[k2] = m[k];
42
+ }));
43
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
44
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
45
+ }) : function(o, v) {
46
+ o["default"] = v;
47
+ });
48
+ var __importStar = (this && this.__importStar) || (function () {
49
+ var ownKeys = function(o) {
50
+ ownKeys = Object.getOwnPropertyNames || function (o) {
51
+ var ar = [];
52
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
53
+ return ar;
54
+ };
55
+ return ownKeys(o);
56
+ };
57
+ return function (mod) {
58
+ if (mod && mod.__esModule) return mod;
59
+ var result = {};
60
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
61
+ __setModuleDefault(result, mod);
62
+ return result;
63
+ };
64
+ })();
65
+ Object.defineProperty(exports, "__esModule", { value: true });
66
+ exports.AUDIT_OUTPUT_LIMIT = void 0;
67
+ exports.classifyOutcome = classifyOutcome;
68
+ exports.recordAudit = recordAudit;
69
+ exports.createJsonlAuditSink = createJsonlAuditSink;
70
+ exports.createMemoryAuditSink = createMemoryAuditSink;
71
+ exports.newAuditSessionId = newAuditSessionId;
72
+ const fs = __importStar(require("fs"));
73
+ const path = __importStar(require("path"));
74
+ /** Output is summarised, not archived — keeps the trail a trail. */
75
+ exports.AUDIT_OUTPUT_LIMIT = 2000;
76
+ function summarise(output) {
77
+ if (output === undefined || output === '')
78
+ return undefined;
79
+ if (output.length <= exports.AUDIT_OUTPUT_LIMIT)
80
+ return output;
81
+ return `${output.slice(0, exports.AUDIT_OUTPUT_LIMIT)}\n… [truncated ${output.length - exports.AUDIT_OUTPUT_LIMIT} chars]`;
82
+ }
83
+ /**
84
+ * Classify an outcome.
85
+ *
86
+ * A blocked call is NOT the same as a failed one, and collapsing the two would
87
+ * hide the security-relevant half of the trail: "the agent tried to write to
88
+ * production and was refused" must not read as "a tool errored".
89
+ *
90
+ * Detection is by the loop's own refusal messages. If those strings change, a
91
+ * blocked call degrades to `error` — still recorded, still visibly not-ok, so
92
+ * the failure mode is a less precise label rather than a missing entry.
93
+ */
94
+ function classifyOutcome(ok, error) {
95
+ if (ok)
96
+ return 'ok';
97
+ const e = error ?? '';
98
+ const blocked = e.startsWith('Permission denied') ||
99
+ e.includes('not allowed to use') || // ToolNotAllowedError
100
+ e.includes('Blocked by PreToolUse hook') ||
101
+ e.includes('read-only') || // plan mode refusals
102
+ e.includes('plan mode') ||
103
+ e.includes('Plan mode') ||
104
+ e.includes('was CUT OFF'); // truncated tool call, refused unexecuted
105
+ return blocked ? 'blocked' : 'error';
106
+ }
107
+ /**
108
+ * Build + emit one record. Fire-and-forget by design.
109
+ *
110
+ * An audit trail is a compliance artefact, not a correctness dependency: a full
111
+ * disk, a wedged SIEM or a buggy custom sink must not kill a run that is
112
+ * halfway through real work. So every sink failure — sync throw or rejected
113
+ * promise — is swallowed here, and the sink is never awaited (the tool round is
114
+ * on the latency-critical path; the Desktop app targets a ~0 ms local loop).
115
+ *
116
+ * The stricter "fail closed" policy (abort the run when the trail cannot be
117
+ * written) is a real requirement in some deployments but changes the loop's
118
+ * failure semantics, so it is intentionally not bolted on here.
119
+ */
120
+ function recordAudit(ctx, tool, input, ok, output, error, exitCode) {
121
+ try {
122
+ const base = {
123
+ ts: new Date().toISOString(),
124
+ sessionId: ctx.sessionId,
125
+ actor: ctx.actor,
126
+ depth: ctx.depth,
127
+ tool,
128
+ input,
129
+ ok,
130
+ outcome: classifyOutcome(ok, error),
131
+ workDir: ctx.workDir,
132
+ };
133
+ // Optional fields assigned conditionally so a record never carries
134
+ // `"userId": undefined` noise into JSONL.
135
+ if (ctx.config.userId !== undefined)
136
+ base.userId = ctx.config.userId;
137
+ if (ctx.agentType !== undefined)
138
+ base.agentType = ctx.agentType;
139
+ if (ctx.model !== undefined)
140
+ base.model = ctx.model;
141
+ if (error !== undefined)
142
+ base.error = error;
143
+ if (exitCode !== undefined)
144
+ base.exitCode = exitCode;
145
+ const summary = summarise(output);
146
+ if (summary !== undefined)
147
+ base.outputSummary = summary;
148
+ const entry = ctx.config.redact ? ctx.config.redact(base) : base;
149
+ if (entry === null)
150
+ return;
151
+ const maybe = ctx.config.sink.record(entry);
152
+ if (maybe && typeof maybe.catch === 'function') {
153
+ void maybe.catch(() => { });
154
+ }
155
+ }
156
+ catch {
157
+ // Never propagate. See the doc comment above.
158
+ }
159
+ }
160
+ /**
161
+ * Append-only JSONL sink — the reference implementation.
162
+ *
163
+ * One JSON object per line, appended with `fs.appendFileSync`. Chosen over a
164
+ * buffered writer because an audit line that is still sitting in a buffer when
165
+ * the process is killed is an audit line that does not exist; appending each
166
+ * record keeps the on-disk trail consistent with what actually ran. Writes are
167
+ * small and the call site never awaits, so this does not sit on the latency path.
168
+ *
169
+ * Not a tamper-EVIDENCE claim: it makes no cryptographic guarantee. Deployments
170
+ * needing that should point this at WORM storage or supply their own sink.
171
+ * Created with mode 0600 — a trail can contain business-sensitive arguments.
172
+ */
173
+ function createJsonlAuditSink(filePath) {
174
+ let ensured = false;
175
+ return {
176
+ record(entry) {
177
+ if (!ensured) {
178
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
179
+ ensured = true;
180
+ }
181
+ fs.appendFileSync(filePath, `${JSON.stringify(entry)}\n`, { mode: 0o600 });
182
+ },
183
+ };
184
+ }
185
+ /** In-memory sink — for tests and for hosts that forward records themselves. */
186
+ function createMemoryAuditSink() {
187
+ const records = [];
188
+ return {
189
+ records,
190
+ record(entry) {
191
+ records.push(entry);
192
+ },
193
+ };
194
+ }
195
+ /** Stable-enough id without pulling in a uuid dependency. */
196
+ function newAuditSessionId() {
197
+ return `sess_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
198
+ }
199
+ //# sourceMappingURL=audit.js.map
@@ -264,11 +264,22 @@ export declare function lastToolResults(messages: Message[], count: number, maxC
264
264
  /**
265
265
  * Context window (tokens) for a model alias or real model id.
266
266
  *
267
- * The fallback is deliberately the SMALLEST window in the table rather than the
268
- * largest. An unknown model is most likely a newly added one this client build
269
- * predates, and guessing high is the failure that cannot be recovered from: the
270
- * turn hits a provider 400 with no chance to compact. Guessing low only costs
271
- * an earlier, lossy compaction annoying, not broken.
267
+ * Checks the LIVE catalogue (GET /api/code/models, modelCatalogue.ts) first
268
+ * populated once per process by whichever client fetched it (CLI at session
269
+ * start, VS Code via _postModelCatalogue, desktop via its main-process
270
+ * fetch) falling back to this hard-coded table when no live data exists yet
271
+ * (offline, older backend, or the catalogue simply hasn't been fetched by
272
+ * this call site). This is what lets a model added to the backend registry
273
+ * (services/providers/modelRegistry.js) get the CORRECT context window here
274
+ * even before this table is updated by hand for a new nexrall-code release —
275
+ * exactly the class of bug GPT-5.6's 922K-vs-1.05M mismatch was (see
276
+ * modelRegistry.js's own comment on that row).
277
+ *
278
+ * The static-table fallback is deliberately the SMALLEST window in the table
279
+ * rather than the largest. An unknown model is most likely a newly added one
280
+ * this client build predates, and guessing high is the failure that cannot be
281
+ * recovered from: the turn hits a provider 400 with no chance to compact.
282
+ * Guessing low only costs an earlier, lossy compaction — annoying, not broken.
272
283
  */
273
284
  export declare function contextWindowFor(model?: string): number;
274
285
  /** Auto-prune / auto-compact thresholds as fractions of the context window — for UI display (e.g. `/context`). */
@@ -1 +1 @@
1
- {"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/agent/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAKP,UAAU,EACV,gBAAgB,EAChB,UAAU,EACX,MAAM,UAAU,CAAC;AAIlB,OAAO,EAA8D,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMjI,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AA0K7B;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC9C,MAAM,CAKR;AAED,+CAA+C;AAC/C,eAAO,MAAM,YAAY;;;CAAsC,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,uBAAuB,C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,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAE/D;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,EAAE;IACJ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,GACA,OAAO,CAAC,OAAO,CAAC,CAkFlB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,UAAU,CAAC,CAyBrB;AAID,wBAAsB,YAAY,CAChC,eAAe,EAAE,OAAO,EAAE,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CA0iCpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAqCtE"}
@@ -87,8 +87,10 @@ const index_1 = require("../plugins/index");
87
87
  const testIntegrity_1 = require("./testIntegrity");
88
88
  const flaky_1 = require("./flaky");
89
89
  const claimEvidence_1 = require("./claimEvidence");
90
+ const audit_1 = require("./audit");
90
91
  const memory_1 = require("./memory");
91
92
  const safeSlice_1 = require("../util/safeSlice");
93
+ const modelCatalogue_1 = require("./modelCatalogue");
92
94
  const fs = __importStar(require("fs"));
93
95
  const path = __importStar(require("path"));
94
96
  const child_process_1 = require("child_process");
@@ -808,6 +810,8 @@ function humanDescription(name, input) {
808
810
  return `Browser: type "${String(input.text ?? '').slice(0, 40)}"`;
809
811
  if (action === 'snapshot')
810
812
  return 'Browser: read page';
813
+ if (action === 'read_text')
814
+ return 'Browser: read page text';
811
815
  return `Browser: ${action || '(unknown action)'}`;
812
816
  }
813
817
  default:
@@ -1448,6 +1452,12 @@ started) {
1448
1452
  // takes the opposite direction on purpose (inherited, because it RESTRICTS); identity
1449
1453
  // must not be inherited, capability must.
1450
1454
  _agentMemory: agent && memoryScope ? { agentName: agent.name, scope: memoryScope } : undefined,
1455
+ // Assigned unconditionally for the same reason as _agentMemory above: a
1456
+ // conditional spread would leave the PARENT's type name in place, so an
1457
+ // untyped (general-purpose) child would be recorded in the audit trail
1458
+ // under its parent's agent type — a wrong attribution, which is worse in a
1459
+ // compliance record than an absent one.
1460
+ _agentTypeName: agent?.name,
1451
1461
  // The same set `gatedPermission` enforces above, so prompt and permission agree
1452
1462
  // by construction instead of by two people remembering to update both.
1453
1463
  _allowedTools: allowed ?? undefined,
@@ -1631,6 +1641,16 @@ const MODEL_CONTEXT_TOKENS = {
1631
1641
  'gpt-5.4-mini': 272000,
1632
1642
  'gpt-4.1': 1047576,
1633
1643
  'gpt-4o-mini': 128000,
1644
+ // GPT-5.6 family: MEASURED 2026-09-03 via a 400 (same technique as
1645
+ // gpt-5.4's 922_000 above) — and it is the EXACT SAME 922,000-token
1646
+ // ceiling on all three sizes. This CONTRADICTS the publicly documented
1647
+ // figure (openai.com/index/gpt-5-6 + OpenRouter's model card both
1648
+ // advertise 1,050,000) — see backend services/providers/modelRegistry.js's
1649
+ // own comment on these rows for the measured 400 body. Guessing 1.05M here
1650
+ // would fire auto-compaction ~12% past the real wall.
1651
+ 'gpt-5.6-sol': 922000,
1652
+ 'gpt-5.6-terra': 922000,
1653
+ 'gpt-5.6-luna': 922000,
1634
1654
  // DeepSeek, by real model id (documented — see backend/services/providers/
1635
1655
  // modelRegistry.js's own TODO(unverified-by-400): DeepSeek accepts an
1636
1656
  // oversized max_completion_tokens without rejecting it, so there was no 400
@@ -1639,18 +1659,38 @@ const MODEL_CONTEXT_TOKENS = {
1639
1659
  'deepseek-v4-flash': 1048576,
1640
1660
  // Qwen (DashScope), by real model id (documented max input, same caveat).
1641
1661
  'qwen3.7-max': 991800,
1662
+ // Z.ai (GLM), by real model id. contextWindow is documented (Z.ai/
1663
+ // Cloudflare Workers AI model cards, both list 1,048,576) rather than
1664
+ // measured — a ~400K-token request was ACCEPTED (200), not rejected, so
1665
+ // there was no 400 to read a real ceiling out of. maxOutputTokens IS
1666
+ // measured: `max_tokens: 999999` was rejected with the ceiling in the
1667
+ // error body (backend services/providers/modelRegistry.js's glm-5.3 row
1668
+ // has the full verification notes).
1669
+ 'glm-5.3': 1048576,
1642
1670
  };
1643
1671
  /**
1644
1672
  * Context window (tokens) for a model alias or real model id.
1645
1673
  *
1646
- * The fallback is deliberately the SMALLEST window in the table rather than the
1647
- * largest. An unknown model is most likely a newly added one this client build
1648
- * predates, and guessing high is the failure that cannot be recovered from: the
1649
- * turn hits a provider 400 with no chance to compact. Guessing low only costs
1650
- * an earlier, lossy compaction annoying, not broken.
1674
+ * Checks the LIVE catalogue (GET /api/code/models, modelCatalogue.ts) first
1675
+ * populated once per process by whichever client fetched it (CLI at session
1676
+ * start, VS Code via _postModelCatalogue, desktop via its main-process
1677
+ * fetch) falling back to this hard-coded table when no live data exists yet
1678
+ * (offline, older backend, or the catalogue simply hasn't been fetched by
1679
+ * this call site). This is what lets a model added to the backend registry
1680
+ * (services/providers/modelRegistry.js) get the CORRECT context window here
1681
+ * even before this table is updated by hand for a new nexrall-code release —
1682
+ * exactly the class of bug GPT-5.6's 922K-vs-1.05M mismatch was (see
1683
+ * modelRegistry.js's own comment on that row).
1684
+ *
1685
+ * The static-table fallback is deliberately the SMALLEST window in the table
1686
+ * rather than the largest. An unknown model is most likely a newly added one
1687
+ * this client build predates, and guessing high is the failure that cannot be
1688
+ * recovered from: the turn hits a provider 400 with no chance to compact.
1689
+ * Guessing low only costs an earlier, lossy compaction — annoying, not broken.
1651
1690
  */
1652
1691
  function contextWindowFor(model) {
1653
- return MODEL_CONTEXT_TOKENS[model ?? 'turbo'] ?? 128000;
1692
+ const fallback = MODEL_CONTEXT_TOKENS[model ?? 'turbo'] ?? 128000;
1693
+ return (0, modelCatalogue_1.liveContextWindowFor)(model, fallback);
1654
1694
  }
1655
1695
  // ── Compaction thresholds (cost control) ─────────────────────────────────────
1656
1696
  // Two independent triggers, deliberately at DIFFERENT levels:
@@ -2284,7 +2324,9 @@ async function compactMessagesForResume(messages, opts) {
2284
2324
  const settings = (0, rules_1.loadSettings)(opts.workDir);
2285
2325
  if (!resolveAutoCompact(undefined, settings.raw))
2286
2326
  return false;
2287
- const contextWindow = MODEL_CONTEXT_TOKENS[opts.model ?? 'turbo'] ?? 1000000;
2327
+ // Live catalogue first (see contextWindowFor's doc comment above for why),
2328
+ // same fallback chain this call site always used otherwise.
2329
+ const contextWindow = (0, modelCatalogue_1.liveContextWindowFor)(opts.model, MODEL_CONTEXT_TOKENS[opts.model ?? 'turbo'] ?? 1000000);
2288
2330
  let bodyBytes = estimateBodyBytes(messages);
2289
2331
  let tokenGuess = estimateTokensRough(messages);
2290
2332
  // Prune fires at the EARLY threshold (mirrors the in-loop guard); summarisation
@@ -2403,6 +2445,36 @@ async function runAgentLoop(initialMessages, options) {
2403
2445
  const hooks = loadHooks(options.workDir);
2404
2446
  const depth = options._depth ?? 0;
2405
2447
  const agentScope = options._agentScope ?? 'root';
2448
+ // ── Audit trail (opt-in) ────────────────────────────────────────────────────
2449
+ //
2450
+ // Undefined for every caller that hasn't opted in, which is what keeps this
2451
+ // change behaviour-neutral: `auditCtx` stays undefined and the one emit site
2452
+ // below is skipped entirely.
2453
+ //
2454
+ // The session id is resolved ONCE here and, when the host didn't supply one,
2455
+ // pushed down to sub-agents through `auditOptions` (below) rather than left to
2456
+ // each nested loop to generate its own. Otherwise every sub-agent would open a
2457
+ // NEW session id and the trail would no longer show that a delegated write and
2458
+ // the user request that caused it belong to the same run — which is precisely
2459
+ // the chain of custody the trail exists to prove.
2460
+ const auditCfg = options.audit
2461
+ ? (options.audit.sessionId ? options.audit : { ...options.audit, sessionId: (0, audit_1.newAuditSessionId)() })
2462
+ : undefined;
2463
+ const auditCtx = auditCfg
2464
+ ? {
2465
+ config: auditCfg,
2466
+ sessionId: auditCfg.sessionId,
2467
+ actor: agentScope,
2468
+ depth,
2469
+ agentType: options._agentTypeName,
2470
+ model,
2471
+ workDir: options.workDir,
2472
+ }
2473
+ : undefined;
2474
+ // Sub-agents must inherit the RESOLVED config (with the session id filled in).
2475
+ // Copied, never mutated in place: `options` belongs to the caller, and this
2476
+ // loop runs concurrently with sibling sub-agents sharing that object.
2477
+ const auditOptions = auditCfg && auditCfg !== options.audit ? { ...options, audit: auditCfg } : options;
2406
2478
  // Settings are read before the agent catalogue because a `deny` rule can
2407
2479
  // switch a sub-agent off, and an agent that may not run must not be
2408
2480
  // advertised (see below).
@@ -2447,7 +2519,9 @@ async function runAgentLoop(initialMessages, options) {
2447
2519
  const autoContinue = resolveAutoContinue(options.autoContinue, settings.raw);
2448
2520
  const autoCompact = resolveAutoCompact(options.autoCompact, settings.raw);
2449
2521
  const verifyNudgeOn = resolveVerificationNudge(settings.raw);
2450
- const contextWindow = MODEL_CONTEXT_TOKENS[model] ?? 200000;
2522
+ // Live catalogue first (see contextWindowFor's doc comment above for why),
2523
+ // same fallback chain this call site always used otherwise.
2524
+ const contextWindow = (0, modelCatalogue_1.liveContextWindowFor)(model, MODEL_CONTEXT_TOKENS[model] ?? 200000);
2451
2525
  // Live prompt-size estimate, updated from usage events after every stream.
2452
2526
  let lastPromptTokens = 0;
2453
2527
  let compacting = false; // re-entrancy guard — compaction itself calls streamChat
@@ -3105,7 +3179,7 @@ async function runAgentLoop(initialMessages, options) {
3105
3179
  // depth 0) needs its own limiter. Extracted into dispatchSubAgent so
3106
3180
  // `@nexrall/agent`'s delegate()/spawn() drive the SAME path instead of
3107
3181
  // reimplementing depth/budget/concurrency enforcement a second time.
3108
- result = await dispatchSubAgent(input, options, agentTypes);
3182
+ result = await dispatchSubAgent(input, auditOptions, agentTypes);
3109
3183
  }
3110
3184
  else {
3111
3185
  const pre = runToolHooks(hooks.PreToolUse, 'PreToolUse', name, input, options.workDir);
@@ -3210,6 +3284,15 @@ async function runAgentLoop(initialMessages, options) {
3210
3284
  // exitCode lets the ledger tell a PASSED verification from a FAILED one
3211
3285
  // (a `npm test` that exits non-zero is not an `error`, but it IS a fail).
3212
3286
  ledgerRecord(ledger, block.name, block.input, ok, rawOutput ?? result.output, result.exitCode);
3287
+ // Audit emission rides alongside the ledger because THIS is the one place
3288
+ // every tool call of this loop passes exactly once, whatever happened to it:
3289
+ // executed, errored, permission-denied, plan-mode-refused, hook-blocked or
3290
+ // refused as a truncated call. Auditing onToolUse/onToolResult instead would
3291
+ // have double-counted every nested call, since runSubTask re-emits a child's
3292
+ // tool events through the parent's callbacks (see audit.ts's header).
3293
+ if (auditCtx) {
3294
+ (0, audit_1.recordAudit)(auditCtx, block.name, block.input, ok, result.output, result.error, result.exitCode);
3295
+ }
3213
3296
  if (!ok)
3214
3297
  continue; // failed calls don't count either way
3215
3298
  if (exports.WRITE_TOOL_NAMES.has(block.name))
@@ -0,0 +1,67 @@
1
+ import { type CodeModelInfo } from '../api/client';
2
+ /**
3
+ * Fetch (or return the cached) live model catalogue.
4
+ *
5
+ * Returns null on ANY failure (offline, older backend without the route,
6
+ * auth not ready) — callers MUST treat null as "use your static fallback",
7
+ * never as an error to surface to the user. A coding agent that refuses to
8
+ * start because a model-picker enrichment call failed would be a strictly
9
+ * worse product than one with a slightly stale menu.
10
+ *
11
+ * @param opts.force bypass the TTL and re-fetch even if a cached result
12
+ * exists — used by callers that know the cache might be stale (e.g. after
13
+ * reconnecting from an offline state).
14
+ */
15
+ export declare function getModelCatalogue(opts?: {
16
+ force?: boolean;
17
+ }): Promise<{
18
+ models: CodeModelInfo[];
19
+ defaultModel: string;
20
+ } | null>;
21
+ /** Synchronous read of whatever is currently cached, with NO fetch triggered. */
22
+ export declare function getCachedModelCatalogue(): {
23
+ models: CodeModelInfo[];
24
+ defaultModel: string;
25
+ } | null;
26
+ /**
27
+ * Live context window for `id`, or `fallback` when the catalogue has not
28
+ * been fetched yet or does not know this model.
29
+ */
30
+ export declare function liveContextWindowFor(id: string | undefined, fallback: number): number;
31
+ /** Live max-output-tokens for `id`, or `fallback`. */
32
+ export declare function liveMaxOutputTokensFor(id: string | undefined, fallback: number): number;
33
+ /**
34
+ * Live vision-support for `id`, or `fallback` when unknown. Callers pass
35
+ * their own static-table answer as `fallback` so a cache miss degrades to
36
+ * today's behaviour rather than a hardcoded guess.
37
+ */
38
+ export declare function liveSupportsImageInput(id: string | undefined, fallback: boolean): boolean;
39
+ /** Live PDF (native document-block) support for `id`, or `fallback`. */
40
+ export declare function liveSupportsPdfInput(id: string | undefined, fallback: boolean): boolean;
41
+ /** Live reasoning-effort style string for `id` (backend's raw value), or undefined. */
42
+ export declare function liveReasoningEffortStyle(id: string | undefined): string | undefined;
43
+ /**
44
+ * Live vendor label for `id` (e.g. 'Anthropic', 'OpenAI', 'DeepSeek'), or
45
+ * undefined when unknown. Needed alongside liveReasoningEffortStyle because
46
+ * the backend reports reasoningEffortStyle 'none' for EVERY Anthropic model
47
+ * (Claude has no `reasoning_effort` field at all — its lever is a separate
48
+ * mechanism), so callers that maintain a distinct "Anthropic" effort style
49
+ * locally must branch on vendor, not just the style string, to tell "this is
50
+ * Anthropic" apart from "this model genuinely has no effort concept"
51
+ * (gpt-4.1, gpt-4o-mini). Mirrors vscode/webview/main.js's applyModelCatalogue,
52
+ * which makes the identical vendor-based exception.
53
+ */
54
+ export declare function liveVendorFor(id: string | undefined): string | undefined;
55
+ /** Live display label for `id`, or `fallback` (typically the id itself). */
56
+ export declare function liveLabelFor(id: string | undefined, fallback: string): string;
57
+ /** Live relative cost multiplier for `id`, or `fallback` when unknown. */
58
+ export declare function liveCostMultiplierFor(id: string | undefined, fallback: number | undefined): number | undefined;
59
+ /**
60
+ * The list of selectable model ids the live catalogue offers, or null when
61
+ * no catalogue has been fetched yet — callers fall back to their own static
62
+ * SELECTABLE_MODELS list in that case.
63
+ */
64
+ export declare function liveSelectableModelIds(): string[] | null;
65
+ /** Test-only: reset the module-level cache between test cases. */
66
+ export declare function _resetModelCatalogueCacheForTests(): void;
67
+ //# sourceMappingURL=modelCatalogue.d.ts.map
@@ -0,0 +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,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7B,OAAO,CAAC;IAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAuBnE;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,IAAI;IAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAElG;AAOD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErF;AAED,sDAAsD;AACtD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAGzF;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAGvF;AAED,uFAAuF;AACvF,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEnF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,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"}
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ // ---------------------------------------------------------------------------
3
+ // Live model catalogue cache — ONE fetch, ONE cache, shared by CLI/VS
4
+ // Code/Desktop, all backed by GET /api/code/models (services/codeModels.js on
5
+ // the backend, itself sourced from services/providers/modelRegistry.js).
6
+ // ---------------------------------------------------------------------------
7
+ //
8
+ // WHY THIS FILE EXISTS
9
+ //
10
+ // Before this, "which models exist, what do they cost, do they support
11
+ // vision/PDF, what's their context window, what reasoning-effort style do
12
+ // they use" was answered by up to 8 separate hand-maintained tables spread
13
+ // across 4 packages (cli/chat.ts: MODEL_LABELS/SELECTABLE_MODELS/
14
+ // MODEL_COST_MULTIPLIER/NO_VISION_MODELS/NO_PDF_MODELS/MODEL_EFFORT_STYLE;
15
+ // vscode/ChatPanel.ts + webview/main.js: copies of most of the same;
16
+ // desktop/shared/modelCatalogue.ts + renderer/main.js: another copy, with the
17
+ // renderer's being a SECOND hand-copy of the first because esbuild does not
18
+ // bundle TS into that plain-JS file). Adding GLM-5.3 (2026-08-30) required
19
+ // editing 3 files by hand; adding GPT-5.6 (2026-09-03) required editing 7.
20
+ // A model added to the backend registry without also touching this repo
21
+ // simply never appears in the menu, and — the sharper failure mode —
22
+ // vision/PDF gating (NO_VISION_MODELS/NO_PDF_MODELS) could silently disagree
23
+ // with what the backend actually supports, since nothing enforced they track
24
+ // the SAME set as modelRegistry.js's supportsImageInput.
25
+ //
26
+ // This module is the fix: fetch the catalogue ONCE per process (TTL-cached,
27
+ // not re-fetched every turn), and expose lookup functions every call site can
28
+ // use INSTEAD OF a hand-maintained table. Every call site still needs a
29
+ // static fallback for offline/older-backend use — that is a deliberate,
30
+ // permanent feature of this design, not a gap: a coding agent must still
31
+ // work with no network. But the fallback should be the EXCEPTION path, not
32
+ // the only path, and it should never need to be edited when the fact it
33
+ // approximates has already been added on the backend.
34
+ //
35
+ // WHO CALLS THIS
36
+ //
37
+ // - CLI (chat.ts): fetches once at session start, before the model picker
38
+ // is ever shown.
39
+ // - VS Code (ChatPanel.ts): already fetched via getCodeModels() for its
40
+ // menu rebuild (_postModelCatalogue) — now ALSO feeds this cache so the
41
+ // same data drives vision/PDF gating, not just the menu's HTML.
42
+ // - Desktop (main process): fetches once, forwards the result to the
43
+ // renderer over IPC the same way ChatPanel.ts forwards it to its webview.
44
+ //
45
+ // This module does NOT talk to the network itself for freshness beyond the
46
+ // TTL — callers control WHEN to fetch (session start is enough; a model
47
+ // added mid-session is vanishingly rare and would need a restart to use
48
+ // safely anyway, since the picker itself is also static per-render).
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.getModelCatalogue = getModelCatalogue;
51
+ exports.getCachedModelCatalogue = getCachedModelCatalogue;
52
+ exports.liveContextWindowFor = liveContextWindowFor;
53
+ exports.liveMaxOutputTokensFor = liveMaxOutputTokensFor;
54
+ exports.liveSupportsImageInput = liveSupportsImageInput;
55
+ exports.liveSupportsPdfInput = liveSupportsPdfInput;
56
+ exports.liveReasoningEffortStyle = liveReasoningEffortStyle;
57
+ exports.liveVendorFor = liveVendorFor;
58
+ exports.liveLabelFor = liveLabelFor;
59
+ exports.liveCostMultiplierFor = liveCostMultiplierFor;
60
+ exports.liveSelectableModelIds = liveSelectableModelIds;
61
+ exports._resetModelCatalogueCacheForTests = _resetModelCatalogueCacheForTests;
62
+ const client_1 = require("../api/client");
63
+ /** How long a successful fetch is trusted before a caller should re-fetch. */
64
+ const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes — matches backend's own getPricing() TTL
65
+ let _state = null;
66
+ // Coalesce concurrent callers into ONE in-flight fetch rather than one each —
67
+ // several call sites (CLI startup, a background re-check) could race on
68
+ // process boot otherwise, each paying the round-trip independently.
69
+ let _inFlight = null;
70
+ /**
71
+ * Fetch (or return the cached) live model catalogue.
72
+ *
73
+ * Returns null on ANY failure (offline, older backend without the route,
74
+ * auth not ready) — callers MUST treat null as "use your static fallback",
75
+ * never as an error to surface to the user. A coding agent that refuses to
76
+ * start because a model-picker enrichment call failed would be a strictly
77
+ * worse product than one with a slightly stale menu.
78
+ *
79
+ * @param opts.force bypass the TTL and re-fetch even if a cached result
80
+ * exists — used by callers that know the cache might be stale (e.g. after
81
+ * reconnecting from an offline state).
82
+ */
83
+ async function getModelCatalogue(opts = {}) {
84
+ const fresh = _state && Date.now() - _state.fetchedAt < CACHE_TTL_MS;
85
+ if (fresh && !opts.force)
86
+ return _state;
87
+ if (_inFlight)
88
+ return _inFlight;
89
+ _inFlight = (async () => {
90
+ try {
91
+ const { models, defaultModel } = await (0, client_1.getCodeModels)();
92
+ if (!models.length)
93
+ return _state; // empty response — keep any existing cache rather than blanking it
94
+ const next = { models, defaultModel, fetchedAt: Date.now() };
95
+ _state = next;
96
+ return next;
97
+ }
98
+ catch {
99
+ // Network/auth failure: keep serving the last good cache if one
100
+ // exists (better a slightly stale menu than none), else null.
101
+ return _state;
102
+ }
103
+ finally {
104
+ _inFlight = null;
105
+ }
106
+ })();
107
+ return _inFlight;
108
+ }
109
+ /** Synchronous read of whatever is currently cached, with NO fetch triggered. */
110
+ function getCachedModelCatalogue() {
111
+ return _state;
112
+ }
113
+ function findModel(id) {
114
+ if (!id || !_state)
115
+ return undefined;
116
+ return _state.models.find((m) => m.id === id);
117
+ }
118
+ /**
119
+ * Live context window for `id`, or `fallback` when the catalogue has not
120
+ * been fetched yet or does not know this model.
121
+ */
122
+ function liveContextWindowFor(id, fallback) {
123
+ return findModel(id)?.contextWindow ?? fallback;
124
+ }
125
+ /** Live max-output-tokens for `id`, or `fallback`. */
126
+ function liveMaxOutputTokensFor(id, fallback) {
127
+ return findModel(id)?.maxOutputTokens ?? fallback;
128
+ }
129
+ /**
130
+ * Live vision-support for `id`, or `fallback` when unknown. Callers pass
131
+ * their own static-table answer as `fallback` so a cache miss degrades to
132
+ * today's behaviour rather than a hardcoded guess.
133
+ */
134
+ function liveSupportsImageInput(id, fallback) {
135
+ const m = findModel(id);
136
+ return m ? m.supportsImageInput : fallback;
137
+ }
138
+ /** Live PDF (native document-block) support for `id`, or `fallback`. */
139
+ function liveSupportsPdfInput(id, fallback) {
140
+ const m = findModel(id);
141
+ return m ? m.supportsPdfInput : fallback;
142
+ }
143
+ /** Live reasoning-effort style string for `id` (backend's raw value), or undefined. */
144
+ function liveReasoningEffortStyle(id) {
145
+ return findModel(id)?.reasoningEffortStyle;
146
+ }
147
+ /**
148
+ * Live vendor label for `id` (e.g. 'Anthropic', 'OpenAI', 'DeepSeek'), or
149
+ * undefined when unknown. Needed alongside liveReasoningEffortStyle because
150
+ * the backend reports reasoningEffortStyle 'none' for EVERY Anthropic model
151
+ * (Claude has no `reasoning_effort` field at all — its lever is a separate
152
+ * mechanism), so callers that maintain a distinct "Anthropic" effort style
153
+ * locally must branch on vendor, not just the style string, to tell "this is
154
+ * Anthropic" apart from "this model genuinely has no effort concept"
155
+ * (gpt-4.1, gpt-4o-mini). Mirrors vscode/webview/main.js's applyModelCatalogue,
156
+ * which makes the identical vendor-based exception.
157
+ */
158
+ function liveVendorFor(id) {
159
+ return findModel(id)?.vendor;
160
+ }
161
+ /** Live display label for `id`, or `fallback` (typically the id itself). */
162
+ function liveLabelFor(id, fallback) {
163
+ return findModel(id)?.label ?? fallback;
164
+ }
165
+ /** Live relative cost multiplier for `id`, or `fallback` when unknown. */
166
+ function liveCostMultiplierFor(id, fallback) {
167
+ const m = findModel(id);
168
+ return m && typeof m.costMultiplier === 'number' ? m.costMultiplier : fallback;
169
+ }
170
+ /**
171
+ * The list of selectable model ids the live catalogue offers, or null when
172
+ * no catalogue has been fetched yet — callers fall back to their own static
173
+ * SELECTABLE_MODELS list in that case.
174
+ */
175
+ function liveSelectableModelIds() {
176
+ return _state ? _state.models.filter((m) => m.available !== false).map((m) => m.id) : null;
177
+ }
178
+ /** Test-only: reset the module-level cache between test cases. */
179
+ function _resetModelCatalogueCacheForTests() {
180
+ _state = null;
181
+ _inFlight = null;
182
+ }
183
+ //# sourceMappingURL=modelCatalogue.js.map
@@ -131,6 +131,26 @@ export interface DescribeAttachmentResult {
131
131
  }
132
132
  export declare function describeAttachment(kind: 'image' | 'pdf', data: string, mediaType?: string, name?: string): Promise<DescribeAttachmentResult>;
133
133
  export declare function getBalance(): Promise<number>;
134
+ export interface CodeModelInfo {
135
+ id: string;
136
+ label: string;
137
+ vendor: string;
138
+ blurb: string;
139
+ costMultiplier?: number;
140
+ contextWindow: number;
141
+ maxOutputTokens: number;
142
+ supportsImageInput: boolean;
143
+ supportsPdfInput: boolean;
144
+ supportsWebSearch: boolean;
145
+ /** One of modelRegistry.js's REASONING_EFFORT_STYLE values, or absent for 'none'. */
146
+ reasoningEffortStyle?: string;
147
+ /** False when this deployment has no credential configured for the model's provider. */
148
+ available: boolean;
149
+ }
150
+ export declare function getCodeModels(): Promise<{
151
+ models: CodeModelInfo[];
152
+ defaultModel: string;
153
+ }>;
134
154
  export interface UsageDailyDay {
135
155
  date: string;
136
156
  total: number;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EA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MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAqB3D"}
@@ -10,6 +10,7 @@ exports.cancelTurn = cancelTurn;
10
10
  exports.revokeRefreshToken = revokeRefreshToken;
11
11
  exports.describeAttachment = describeAttachment;
12
12
  exports.getBalance = getBalance;
13
+ exports.getCodeModels = getCodeModels;
13
14
  exports.getUsageDaily = getUsageDaily;
14
15
  exports.exchangeVscodeCode = exchangeVscodeCode;
15
16
  exports.login = login;
@@ -1546,6 +1547,28 @@ async function getBalance() {
1546
1547
  const data = (await response.json());
1547
1548
  return typeof data.balance === 'number' ? data.balance : 0;
1548
1549
  }
1550
+ async function getCodeModels() {
1551
+ const fetchOnce = () => (0, node_fetch_1.default)(`${exports.API_BASE}/api/code/models`, { method: 'GET', headers: authHeaders() });
1552
+ let response = await fetchOnce();
1553
+ if (response.status === 401 || response.status === 403) {
1554
+ const body = await response.text().catch(() => '');
1555
+ if (isExpiredTokenResponse(response.status, body) && await refreshAccessToken()) {
1556
+ response = await fetchOnce();
1557
+ }
1558
+ else {
1559
+ throw new Error(`API error ${response.status}: ${body}`);
1560
+ }
1561
+ }
1562
+ if (!response.ok) {
1563
+ const errText = await response.text();
1564
+ throw new Error(`API error ${response.status}: ${errText}`);
1565
+ }
1566
+ const data = (await response.json());
1567
+ return {
1568
+ models: Array.isArray(data.models) ? data.models : [],
1569
+ defaultModel: typeof data.defaultModel === 'string' ? data.defaultModel : 'claude-sonnet-5',
1570
+ };
1571
+ }
1549
1572
  /**
1550
1573
  * Day-by-day spend breakdown, same endpoint the web app's Settings > Usage
1551
1574
  * chart reads (backend/routes/user.js's /usage-daily). Used by Nexrall Work's
package/dist/index.d.ts CHANGED
@@ -3,12 +3,14 @@ export * from './auth/index';
3
3
  export * from './api/client';
4
4
  export * from './tools/executor';
5
5
  export * from './agent/loop';
6
+ export * from './agent/modelCatalogue';
6
7
  export * from './agent/testIntegrity';
7
8
  export * from './agent/editCompleteness';
8
9
  export * from './agent/securityLint';
9
10
  export * from './agent/crossFile';
10
11
  export * from './agent/flaky';
11
12
  export * from './agent/claimEvidence';
13
+ export * from './agent/audit';
12
14
  export * from './agent/memory';
13
15
  export * from './agent/skills';
14
16
  export * from './mcp/client';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -19,12 +19,14 @@ __exportStar(require("./auth/index"), exports);
19
19
  __exportStar(require("./api/client"), exports);
20
20
  __exportStar(require("./tools/executor"), exports);
21
21
  __exportStar(require("./agent/loop"), exports);
22
+ __exportStar(require("./agent/modelCatalogue"), exports);
22
23
  __exportStar(require("./agent/testIntegrity"), exports);
23
24
  __exportStar(require("./agent/editCompleteness"), exports);
24
25
  __exportStar(require("./agent/securityLint"), exports);
25
26
  __exportStar(require("./agent/crossFile"), exports);
26
27
  __exportStar(require("./agent/flaky"), exports);
27
28
  __exportStar(require("./agent/claimEvidence"), exports);
29
+ __exportStar(require("./agent/audit"), exports);
28
30
  __exportStar(require("./agent/memory"), exports);
29
31
  __exportStar(require("./agent/skills"), exports);
30
32
  __exportStar(require("./mcp/client"), exports);
package/dist/types.d.ts CHANGED
@@ -435,6 +435,34 @@ export interface AgentLoopOptions {
435
435
  _extraAgentTypes?: import('./agent/agentTypes').AgentType[];
436
436
  /** As `_extraAgentTypes`, for `@nexrall/agent`'s `registerSkills()`. */
437
437
  _extraSkills?: import('./agent/skills').Skill[];
438
+ /**
439
+ * Internal: the sub-agent TYPE name this run is executing as (e.g. 'reviewer'),
440
+ * or undefined for the main agent.
441
+ *
442
+ * Carried for the audit trail: `_agentScope` identifies the run instance
443
+ * ('sub_3'), which is meaningless to an auditor on its own — "which agent did
444
+ * this" has to name the definition that granted the capability, not just the
445
+ * slot number it happened to run in.
446
+ */
447
+ _agentTypeName?: string;
448
+ /**
449
+ * Opt-in tool-call audit trail (compliance/regulated deployments).
450
+ *
451
+ * Absent — which is every existing caller — means auditing is entirely off and
452
+ * the loop behaves exactly as before: the added code is one `if` that is false.
453
+ * Supplied, it records every tool call this run makes, INCLUDING calls that were
454
+ * refused and never executed, to the host-provided sink.
455
+ *
456
+ * Lives at this level rather than in the SDK or the Desktop app on purpose: all
457
+ * of them (CLI, VS Code, SDK, Desktop) funnel through this one loop, and a
458
+ * guarantee implemented once per client is a guarantee that drifts apart per
459
+ * client — which for an audit trail means one entry path silently logging
460
+ * nothing. Sub-agents inherit it through the options spread in runSubTask, so a
461
+ * delegated call is recorded by the sub-agent's own loop, exactly once.
462
+ *
463
+ * See docs/NEXRALL_AUDIT_TRAIL_LAYER.md.
464
+ */
465
+ audit?: import('./agent/audit').AuditConfig;
438
466
  }
439
467
  /**
440
468
  * Thrown by `runAgentLoop` when a turn cannot continue (stream died, upstream
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAA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AO,EAAE,CAAC;IAC7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAOzF;AAED,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,cAAc,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CAG7D"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexrall/code-core",
3
- "version": "1.4.50",
4
- "description": "Core agent loop, tools, and extension primitives for Nexrall Code embed an AI coding agent in any Node.js application.",
3
+ "version": "1.4.55",
4
+ "description": "Core agent loop, tools, and extension primitives for Nexrall Code \u2014 embed an AI coding agent in any Node.js application.",
5
5
  "license": "MIT",
6
6
  "author": "Nexrall <support@nexrall.com> (https://nexrall.com)",
7
7
  "homepage": "https://github.com/nexrall/nexrall-code#readme",