@gaunt-sloth/core 2.0.0-beta.1 → 2.0.0-beta.2

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 (90) hide show
  1. package/LICENSE +6 -6
  2. package/dist/config/loader.d.ts +13 -0
  3. package/dist/config/loader.js +55 -11
  4. package/dist/config/loader.js.map +1 -1
  5. package/dist/config/schema.d.ts +10 -0
  6. package/dist/config/schema.js +46 -24
  7. package/dist/config/schema.js.map +1 -1
  8. package/dist/config/shell-policy.d.ts +142 -1
  9. package/dist/config/shell-policy.js +114 -7
  10. package/dist/config/shell-policy.js.map +1 -1
  11. package/dist/config/types.d.ts +19 -0
  12. package/dist/config/types.js.map +1 -1
  13. package/dist/constants.d.ts +10 -0
  14. package/dist/constants.js +10 -0
  15. package/dist/constants.js.map +1 -1
  16. package/dist/core/GthAbstractAgent.d.ts +31 -0
  17. package/dist/core/GthAbstractAgent.js +159 -4
  18. package/dist/core/GthAbstractAgent.js.map +1 -1
  19. package/dist/core/GthAgentRunner.d.ts +314 -18
  20. package/dist/core/GthAgentRunner.js +1032 -101
  21. package/dist/core/GthAgentRunner.js.map +1 -1
  22. package/dist/core/approvals/approvalRequest.d.ts +247 -0
  23. package/dist/core/approvals/approvalRequest.js +315 -0
  24. package/dist/core/approvals/approvalRequest.js.map +1 -0
  25. package/dist/core/approvals/grants.d.ts +165 -9
  26. package/dist/core/approvals/grants.js +702 -57
  27. package/dist/core/approvals/grants.js.map +1 -1
  28. package/dist/core/plainToolIndication.d.ts +11 -1
  29. package/dist/core/plainToolIndication.js +25 -10
  30. package/dist/core/plainToolIndication.js.map +1 -1
  31. package/dist/core/shell/abstention.d.ts +1 -1
  32. package/dist/core/shell/abstention.js +65 -11
  33. package/dist/core/shell/abstention.js.map +1 -1
  34. package/dist/core/shell/alignment.d.ts +491 -0
  35. package/dist/core/shell/alignment.js +687 -0
  36. package/dist/core/shell/alignment.js.map +1 -0
  37. package/dist/core/shell/approvalCapture.d.ts +53 -41
  38. package/dist/core/shell/approvalCapture.js +0 -42
  39. package/dist/core/shell/approvalCapture.js.map +1 -1
  40. package/dist/core/shell/approvalStop.d.ts +121 -3
  41. package/dist/core/shell/approvalStop.js +153 -90
  42. package/dist/core/shell/approvalStop.js.map +1 -1
  43. package/dist/core/shell/hardline.d.ts +26 -4
  44. package/dist/core/shell/hardline.js +321 -16
  45. package/dist/core/shell/hardline.js.map +1 -1
  46. package/dist/core/shell/negotiation.d.ts +352 -63
  47. package/dist/core/shell/negotiation.js +295 -123
  48. package/dist/core/shell/negotiation.js.map +1 -1
  49. package/dist/core/shell/openWorld.d.ts +135 -0
  50. package/dist/core/shell/openWorld.js +572 -35
  51. package/dist/core/shell/openWorld.js.map +1 -1
  52. package/dist/core/shell/provenance.d.ts +91 -0
  53. package/dist/core/shell/provenance.js +136 -0
  54. package/dist/core/shell/provenance.js.map +1 -0
  55. package/dist/core/shell/rater.d.ts +394 -163
  56. package/dist/core/shell/rater.js +536 -238
  57. package/dist/core/shell/rater.js.map +1 -1
  58. package/dist/core/shell/raterHealth.d.ts +101 -0
  59. package/dist/core/shell/raterHealth.js +121 -0
  60. package/dist/core/shell/raterHealth.js.map +1 -0
  61. package/dist/core/shell/raterModel.d.ts +17 -8
  62. package/dist/core/shell/raterModel.js +11 -8
  63. package/dist/core/shell/raterModel.js.map +1 -1
  64. package/dist/core/shell/rejection.d.ts +20 -5
  65. package/dist/core/shell/rejection.js +18 -4
  66. package/dist/core/shell/rejection.js.map +1 -1
  67. package/dist/core/toolDisplay.d.ts +42 -0
  68. package/dist/core/toolDisplay.js +31 -0
  69. package/dist/core/toolDisplay.js.map +1 -1
  70. package/dist/core/types.d.ts +134 -16
  71. package/dist/core/types.js.map +1 -1
  72. package/dist/providers/configurationPassthrough.d.ts +36 -6
  73. package/dist/providers/configurationPassthrough.js +40 -28
  74. package/dist/providers/configurationPassthrough.js.map +1 -1
  75. package/dist/providers/openrouter.js +36 -6
  76. package/dist/providers/openrouter.js.map +1 -1
  77. package/dist/providers/vertexai.js +21 -0
  78. package/dist/providers/vertexai.js.map +1 -1
  79. package/dist/utils/binaryOutputUtils.js +103 -21
  80. package/dist/utils/binaryOutputUtils.js.map +1 -1
  81. package/dist/utils/fileUtils.d.ts +7 -1
  82. package/dist/utils/fileUtils.js +17 -3
  83. package/dist/utils/fileUtils.js.map +1 -1
  84. package/dist/utils/globalConfigUtils.d.ts +5 -2
  85. package/dist/utils/globalConfigUtils.js +14 -3
  86. package/dist/utils/globalConfigUtils.js.map +1 -1
  87. package/dist/utils/vertexaiUtils.js +61 -3
  88. package/dist/utils/vertexaiUtils.js.map +1 -1
  89. package/package.json +4 -4
  90. package/schema/gsloth-config.schema.json +34 -0
@@ -1 +1 @@
1
- {"version":3,"file":"toolDisplay.js","sourceRoot":"","sources":["../../src/core/toolDisplay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAEhD,gGAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,kEAAkE;AAClE,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,yFAAyF;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC;AAE5B;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AAkErD,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,UAAU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,CAAC;YACV,IAAI,EAAE,GAAG,QAAQ,MAAM,MAAM,aAAa,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG;YACpE,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAA2B,EAC3B,OAAO,GAAsB,iBAAiB,EAAE;IAEhD,OAAO,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;+EAE+E;AAE/E,MAAM,aAAa,GAAqC;IACtD,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,UAAU;CACpB,CAAC;AACF,MAAM,UAAU,GAAG,SAAS,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAqB,EAAE,MAAe;IACvE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAC9B,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,UAAU,EAAE,CAAC;AACjE,CAAC"}
@@ -34,6 +34,7 @@ import type { BaseCheckpointSaver } from '@langchain/langgraph';
34
34
  export type { DeclaredToolAnnotations } from '#src/core/approvals/annotations.js';
35
35
  export type { ApprovalSubject, McpToolApprovalSubject, ShellApprovalSubject, ToolApprovalSubject, } from '#src/core/approvals/matcher.js';
36
36
  export type { RaterNegotiationRound, RaterOutcome, ShellSafetyVerdict, } from '#src/core/shell/rater.js';
37
+ export type { AlignmentDecision, AlignmentDecisionKind } from '#src/core/shell/alignment.js';
37
38
  export type Message = BaseMessage;
38
39
  export type StatusUpdateCallback = (level: StatusLevel, message: string) => void;
39
40
  /**
@@ -156,6 +157,21 @@ export type AgentStreamEvent = {
156
157
  * producers that predate the field.
157
158
  */
158
159
  isError?: boolean;
160
+ /**
161
+ * [[TUI-C69]] §5.4 — **this result is the auto-rater asking the agent to narrow the call,
162
+ * not a tool that failed.** A round-1 rejection is the middle of a working negotiation, and
163
+ * on the happy path the very next round succeeds.
164
+ *
165
+ * **Additive, and {@link isError} stays true beside it.** The error status is the real
166
+ * LangChain signal and three readers grade on it — the model, which must know the call did
167
+ * not run; `gth eval`'s `must_error` tool-result assertions; and the ACP bridge's
168
+ * `failed` status. Clearing it to fix the rendering would quietly rewrite all three. This
169
+ * field is display-only: it says how to TONE the row, never what happened to the call.
170
+ *
171
+ * Set from the gate's own decision, threaded on the call's id — never from the result text,
172
+ * because legitimate output may begin with "Error handling…".
173
+ */
174
+ raterClarification?: boolean;
159
175
  };
160
176
  /**
161
177
  * The minimal structural surface of a compiled LangGraph agent that the shared agent
@@ -186,6 +202,23 @@ export interface GthCompiledGraph {
186
202
  export interface PendingToolInterrupt {
187
203
  name: string;
188
204
  args: Record<string, unknown>;
205
+ /**
206
+ * [[TUI-C69]] §5.4 — **the LangChain `tool_call` id this interrupt is holding**, so a decision
207
+ * about the call can be attributed to the call on screen.
208
+ *
209
+ * LangChain's HITL `ActionRequest` is `{ name, args, description }` and carries no id, so the
210
+ * suspended-state reader recovers it from the AI message the requests were built from: the
211
+ * same `getState` snapshot that holds `tasks[].interrupts` also holds `values.messages`, whose
212
+ * last `AIMessage` carries the very `tool_calls` the middleware filtered. Matched back by name
213
+ * and arguments within that one message, in order, so it is the call's own id rather than a
214
+ * correlation.
215
+ *
216
+ * **It is a display attribution, never a decision input.** Nothing about whether a call is
217
+ * allowed may read it: the gate decides on the command and the subject, and an id is neither.
218
+ * Optional because the recovery is defensive at every step — an unexpected state shape yields an
219
+ * interrupt with no id, and every consumer of the id treats its absence as "attribute nothing".
220
+ */
221
+ id?: string;
189
222
  /**
190
223
  * [[TUI-C67]] — **what kind of call this is, as the gate itself decided it** (§3.1/§4.7.5): a
191
224
  * `shell` subject carrying the command, a `tool` subject, or an `mcpTool` subject carrying the
@@ -302,13 +335,16 @@ export interface PendingToolInterrupt {
302
335
  * [[EXT-29]] §5.3 — **how many attempts the agent actually made**, counted since a human was last
303
336
  * involved rather than since the last approved call.
304
337
  *
305
- * It is a separate number from `negotiationRounds.length` because an approved call clears the
306
- * transcript, and a surface reading the array's length reports only the attempts that happened
307
- * after the last one. On the escalation this was measured from, the agent proposed the same
308
- * command five times, was refused every time, and the human was shown three — the two calls it
309
- * made in between were `git stash` and `git status`, both approved, both erasing the rounds
310
- * before them. Persistence is the single most decision-relevant fact this block carries, so
311
- * under-reporting it by nearly half is not a cosmetic count.
338
+ * Persistence is the single most decision-relevant fact this block carries, and it is measured
339
+ * against a real under-report: on the escalation this comes from, the agent proposed the same
340
+ * command five times, was refused every time, and the human was shown three, because the two
341
+ * approved calls it made in between (`git stash`, `git status`) each erased the rounds before
342
+ * them. [[EXT-108]] removed that erasure, so the array and this count are now the same set as
343
+ * they leave the state machine.
344
+ *
345
+ * It stays a separate number for the reason that survives: both values are handed over whole and
346
+ * the renderer is what slices for the screen, so sending both is what lets it number the rounds it
347
+ * prints by their true attempt number instead of from one.
312
348
  *
313
349
  * Present exactly when {@link negotiationRounds} is, and never smaller than its length.
314
350
  */
@@ -330,14 +366,25 @@ export type ToolApprovalScope = 'once' | 'session' | 'always';
330
366
  * - `session` — additionally record a **deny** entry for this call, in the one entry grammar, for
331
367
  * the life of this runner instance. The matcher consults it before anything else, so the next
332
368
  * identical call is refused without reaching a person at all.
369
+ * - `always` — additionally persist that entry to the project store
370
+ * ({@link ToolApprovalScope}'s mirror: `.gsloth/.gsloth-settings/shell-denylist.json`) so the
371
+ * refusal survives a restart. This is what every escalation menu's *always reject* control sends.
372
+ *
373
+ * **The two scopes stay different types even now that they list the same three values.** They are
374
+ * different questions with different bounds — a `reject` has no `catastrophic` clamp and no
375
+ * unresolvable-command exclusion, since refusing more is safe in every direction — and collapsing
376
+ * them would let a future value added for one side become answerable on the other by accident.
333
377
  *
334
- * **There is deliberately no `always`.** An `approve` can persist because there is a project store
335
- * to persist it to; there is no persisted deny store, and inventing one is a decision about a file
336
- * users will have to live with rather than a rendering choice. So the scopes here are the ones the
337
- * gate can actually honour, and a control that promised more would be §6's own failure mode — an
338
- * affordance offered and then quietly refused.
378
+ * **A caller may still ask for `session`**, and the runner honours it rather than upgrading it: the
379
+ * lifetime that lands is reported back through the `/approvals` display, so a refusal held only for
380
+ * this session is never shown as a saved one. It is also where an `always` refusal lands when the
381
+ * project file cannot be opened. **That is NOT merely "a re-prompt next session":** the refusal is
382
+ * held for this run only, the unreadable file is left as it is, and next session nothing in it
383
+ * applies — so the same call is left to the rest of the gate, which may refuse it under another
384
+ * rule, prompt for it, or run it without asking (`bypass`, or a matching saved allow). The user is
385
+ * told at load time; see `PersistedApprovalGrants`.
339
386
  */
340
- export type ToolRejectScope = 'once' | 'session';
387
+ export type ToolRejectScope = 'once' | 'session' | 'always';
341
388
  /**
342
389
  * A consumer-supplied decision on a {@link PendingToolInterrupt}: approve runs the tool,
343
390
  * reject feeds the model a tool-rejected message (with the optional reason).
@@ -346,9 +393,8 @@ export type ToolRejectScope = 'once' | 'session';
346
393
  * `{ type: 'approve' }` or `{ type: 'reject' }` still type-checks and behaves as the single-shot
347
394
  * decision that persists nothing).
348
395
  *
349
- * The two scopes are **different types on purpose**. Sharing {@link ToolApprovalScope} would let a
350
- * surface send `{ type: 'reject', scope: 'always' }`, which type-checks, promises a persistence
351
- * nothing implements, and degrades to a session refusal with no diagnostic.
396
+ * The two scopes are **different types on purpose** see {@link ToolRejectScope} for why they stay
397
+ * apart now that they carry the same three values.
352
398
  */
353
399
  export type ToolApprovalDecision = {
354
400
  type: 'approve';
@@ -365,6 +411,53 @@ export type ToolApprovalDecision = {
365
411
  * silently hang or auto-approve.
366
412
  */
367
413
  export type ToolApprovalCallback = (pending: PendingToolInterrupt) => Promise<ToolApprovalDecision> | ToolApprovalDecision;
414
+ /**
415
+ * [[EXT-150]] — **the lifetime an answer at the approval prompt actually GOT.**
416
+ *
417
+ * A third type beside {@link ToolApprovalScope} and {@link ToolRejectScope}, carrying the same three
418
+ * values, for exactly the reason those two are already kept apart: it answers a different question.
419
+ * The other two are what a surface ASKS FOR; this is what the runner LANDED. `always` here means
420
+ * the entry reached the project file — never merely that a control promising a file was pressed.
421
+ */
422
+ export type ApprovalLifetime = 'once' | 'session' | 'always';
423
+ /**
424
+ * [[EXT-150]] — **what a human's answer at the approval prompt actually did**, reported to the
425
+ * surface that asked once the runner has recorded it.
426
+ *
427
+ * It exists because a surface cannot work this out for itself and must not guess. The scope it sent
428
+ * is a request: [[EXT-149]] makes `always` degrade to `session` whenever the write did not reach
429
+ * disk — a checkout nothing can write, a settings directory that is gone, a file [[EXT-144]] refuses
430
+ * to rewrite — and that is decided inside the runner AFTER the {@link ToolApprovalCallback} has
431
+ * already returned. Without this, a surface confirming *saved to this project* is describing the key
432
+ * that was pressed, and core's own ERROR naming the unwritten file then contradicts it on screen.
433
+ *
434
+ * **Correlated by the `pending` object itself**, which is the very interrupt the callback was
435
+ * handed, rather than by arrival order. The runner drains one interrupt at a time, but the surfaces
436
+ * that consume this queue approvals, so a pairing that assumed *the outcome belongs to the oldest
437
+ * unanswered request* would be a claim about the runner's loop held in the surface — and the cost of
438
+ * its being wrong is one call's persistence confirmed on another call's dialog.
439
+ */
440
+ export interface ApprovalOutcome {
441
+ /** The interrupt this answers — the same object {@link ToolApprovalCallback} received. */
442
+ pending: PendingToolInterrupt;
443
+ /** What the human answered. */
444
+ decision: 'approve' | 'reject';
445
+ /** The lifetime the answer landed with — `always` only when it reached the project file. */
446
+ lifetime: ApprovalLifetime;
447
+ }
448
+ /**
449
+ * [[EXT-150]] — callback the {@link GthAgentRunner} invokes once per human-answered approval, after
450
+ * it has recorded the answer, so a surface can render what HAPPENED rather than what was asked for.
451
+ *
452
+ * Separate from {@link ToolApprovalCallback} because it is a separate question asked at a separate
453
+ * moment, the same reason {@link AttackHaltCallback} is its own seam: the approval callback is
454
+ * consulted *before* anything is recorded and cannot see the outcome of its own answer.
455
+ *
456
+ * Wiring it is optional and its absence is safe in the only direction that matters — a surface that
457
+ * never wires it learns nothing, which is where every surface already was. It may not be used to
458
+ * decide anything: by the time it fires the decision is made and the record is written.
459
+ */
460
+ export type ApprovalOutcomeCallback = (outcome: ApprovalOutcome) => void;
368
461
  /**
369
462
  * [[TUI-C68]] §6.1 — what the **attack banner** is about: the command whose own structure the
370
463
  * rater called hostile, and the rater's explanation of what it saw. Both are untrusted text and a
@@ -445,6 +538,31 @@ export interface GthAgentInterface {
445
538
  * approve/reject confirmation loop.
446
539
  */
447
540
  getPendingToolInterrupts?(runConfig: RunnableConfig): Promise<PendingToolInterrupt[]>;
541
+ /**
542
+ * [[TUI-C69]] §5.4 — **name the tool calls the auto-rater bounced back for clarification**, so
543
+ * both display paths can tone those rows as a negotiation round rather than as a failed tool.
544
+ *
545
+ * Called by {@link GthAgentRunner} with the id of a call it has just refused BACK TO THE MODEL
546
+ * under §5 — never for a human's "no", a deny entry or the §8 floor, which are refusals rather
547
+ * than rounds of an argument. The agent holds the ids only until the results carrying them have
548
+ * been rendered — {@link clearRaterClarifications} is what makes that true — and a run that never
549
+ * negotiates never calls this.
550
+ *
551
+ * Optional: an agent that renders nothing simply omits it, and every row keeps today's tone.
552
+ */
553
+ noteRaterClarification?(toolCallId: string): void;
554
+ /**
555
+ * [[TUI-C69]] §5.4 — **drop the ids {@link noteRaterClarification} collected**, at the top of
556
+ * every turn and on `/clear`.
557
+ *
558
+ * The runner owns the *when* because it owns the turn; the agent owns the set because it owns the
559
+ * rendering. Without this the ids live as long as the process, and a later call reusing one would
560
+ * be drawn as a negotiation round it had no part in.
561
+ *
562
+ * Optional and fail-soft, like its sibling: an agent that never notes anything need not implement
563
+ * it.
564
+ */
565
+ clearRaterClarifications?(): void;
448
566
  /**
449
567
  * EXT-58 (spec §4.4) — the names of the tools registered with the graph at `init`. The runner
450
568
  * intersects them with the built-in summaries table to tell the rater which already-granted
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAmDA;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,+CAAS,CAAA;IACT,6CAAQ,CAAA;IACR,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,+CAAS,CAAA;IACT,iDAAU,CAAA;AACZ,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAuDA;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,+CAAS,CAAA;IACT,6CAAQ,CAAA;IACR,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,+CAAS,CAAA;IACT,iDAAU,CAAA;AACZ,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB"}
@@ -76,21 +76,51 @@ export interface UnusedConfigurationWarning {
76
76
  }
77
77
  export declare function warnUnusedConfiguration({ provider, configuration, consumedPaths, reason, guidance, }: UnusedConfigurationWarning): void;
78
78
  /**
79
- * Warn when a `configuration` path the factory DOES consume silently beats a top-level field of the
80
- * `llm` block that sets the same thing.
79
+ * Warn when one honoured location of the `llm` block silently beats another that sets the same
80
+ * thing.
81
81
  *
82
82
  * Neither value is unusable here and neither location is wrong, so this is not a case for
83
83
  * {@link warnUnusedConfiguration}: both are honoured surfaces, and the only defect is that one wins
84
84
  * without saying so. The user's config then reads as two settings and behaves as one.
85
85
  *
86
+ * **The two paths are arbitrary, and they have to be**, because the precedence in this block is not
87
+ * one direction. For `baseURL` the `configuration` value beats the top-level field; for the
88
+ * OpenRouter attribution headers the top-level `siteUrl`/`siteName` beat the header inside the
89
+ * block, and the losing path is a nested one that shares no name with the winner. A helper that
90
+ * took a single `field` and hardcoded which side of it wins could only ever announce the first of
91
+ * those, which is how the second stayed silent.
92
+ *
86
93
  * Values are never printed — a base URL can carry credentials — so the message names the two paths
87
94
  * and which of them takes effect.
88
95
  *
89
- * @param appliedValue The value the factory actually applied. Pass the result of the SAME expression
90
- * that decides it, never a second copy of the test, for the reason given on
91
- * {@link warnUnappliedConfigurationPath}.
96
+ * **Named fields, and the reason the names are not the whole guard.** `ignoredPath`/`appliedPath`
97
+ * are two strings and `ignoredValue`/`appliedValue` two `unknown`s, so a transposition type-checks
98
+ * either way round; the rendered message still contains both paths and only their ROLES are
99
+ * swapped, which no `toContain` on either path can see. What catches it is in
100
+ * `configurationPassthrough.spec.ts`: the paths are pinned IN THEIR SLOTS in the rendered sentence,
101
+ * and the values by the discriminating pair around the empty-value guard below (an empty LOSER is
102
+ * silent, an empty WINNER is not).
92
103
  */
93
- export declare function warnConfigurationOverridesTopLevelField(provider: string, field: string, topLevelValue: unknown, appliedValue: unknown): void;
104
+ export interface ShadowedFieldWarning {
105
+ /** The gth provider namespace, printed to the user (`openrouter`, …). */
106
+ provider: string;
107
+ /**
108
+ * The path whose value is NOT used, relative to the `llm` block and printed with an `llm.`
109
+ * prefix — `baseURL`, or `configuration.defaultHeaders.HTTP-Referer`.
110
+ */
111
+ ignoredPath: string;
112
+ /** The path whose value IS used, in the same form. */
113
+ appliedPath: string;
114
+ /** The value at {@link ignoredPath}, as the user wrote it. Never printed. */
115
+ ignoredValue: unknown;
116
+ /**
117
+ * The value the factory actually applied. Pass the result of the SAME expression that decides it,
118
+ * never a second copy of the test, for the reason given on {@link warnUnappliedConfigurationPath}.
119
+ * Never printed.
120
+ */
121
+ appliedValue: unknown;
122
+ }
123
+ export declare function warnShadowedField({ provider, ignoredPath, appliedPath, ignoredValue, appliedValue, }: ShadowedFieldWarning): void;
94
124
  /**
95
125
  * Warn when a path the factory DECLARES it consumes is present in the user's block but was not in
96
126
  * fact applied — the empty string or `null` a factory's own guard skips.
@@ -19,14 +19,41 @@ import { displayWarning } from '#src/utils/consoleUtils.js';
19
19
  * than it reads. This is the one place that turns that silence into a message, so a second native
20
20
  * provider does not have to reinvent it.
21
21
  *
22
- * **Scope: paths INSIDE a `configuration` block, and nothing else.** A top-level key of the `llm`
23
- * block that the chosen provider does not read — `llm.defaultHeaders` on `xai`, say — is the same
24
- * silently-ignored-key defect, and this module does not cover it: the loose schema accepts it, no
25
- * factory reads it, and nothing is printed. Guidance that sends a setting "to the top level" is
26
- * therefore only safe for a field that provider actually has, which is why every `guidance` here
27
- * names the replacement rather than a direction.
28
- *
29
22
  * Use it from a native-client factory only, and pass the paths that factory genuinely consumes.
23
+ *
24
+ * **Scope: an `llm` setting that goes nowhere because of WHERE it was written.** Two shapes of that,
25
+ * needing two messages because the reason differs:
26
+ *
27
+ * - a path inside a `configuration` block the provider cannot use — {@link warnUnusedConfiguration},
28
+ * with {@link warnUnappliedConfigurationPath} for a path the factory declares it reads and then
29
+ * skips as empty;
30
+ * - two honoured locations that set the same thing, one of which silently wins —
31
+ * {@link warnShadowedField}.
32
+ *
33
+ * **A top-level `llm` field the provider class does not read at all — `llm.defaultHeaders` on `xai`
34
+ * — is the same silently-ignored-key defect and is still NOT covered here.** It cannot be, without
35
+ * naming providers: `llmConfigSchema` is a `z.looseObject` and every factory spreads the whole block
36
+ * into its class on purpose, which is how OpenRouter's `provider`, `models` and `route` work with no
37
+ * schema entry each. One mechanism, two opposite meanings.
38
+ *
39
+ * **Measuring it — build the class with and without the field, and see whether anything moved —
40
+ * was built and reverted, because it CANNOT work on all providers and cannot tell that it can't.**
41
+ * `ChatGoogle` (so `google-genai` and `vertexai`) copies every field it is given, read or not, into
42
+ * the same bag, and consumes it later at request-build time. Measured on a plain google config: a
43
+ * canary key no provider could read moves `params.<key>`, `apiClient.params.<key>`,
44
+ * `lc_kwargs.<key>` and their nested twins — and `temperature`, which that model genuinely uses,
45
+ * moves exactly those same five paths under its own name. A used field and an ignored one are
46
+ * structurally identical, so the probe answered "temperature and topK reach nothing" for a working
47
+ * config with none of its own refusal gates firing. Nor does a positive control rescue it:
48
+ * `ChatGoogle` DOES hoist `model` to a top-level property while not hoisting `temperature`, so
49
+ * "this class hoists what it reads" is false of the very class that needs it. Only a per-provider
50
+ * list of consumable names would close the gap, which is the enumeration this codebase avoids.
51
+ * See [[CFG-46]] for the full measurement. Until a provider-independent signal exists, silence is
52
+ * the safer half of the trade — a false warning on a working field teaches users to ignore the
53
+ * message, and the fields it would hit are the ones the docs recommend.
54
+ *
55
+ * Guidance that sends a setting "to the top level" therefore has to name a field that provider
56
+ * genuinely has, which is why every `guidance` here names the replacement rather than a direction.
30
57
  */
31
58
  /** A `configuration` sub-object is a plain record; anything else cannot carry consumable settings. */
32
59
  function isPlainRecord(value) {
@@ -95,32 +122,17 @@ export function warnUnusedConfiguration({ provider, configuration, consumedPaths
95
122
  displayWarning(`Ignoring ${unused.map((path) => `llm.configuration.${path}`).join(', ')} — ` +
96
123
  `the "${provider}" provider ${reason}. ${guidance}`);
97
124
  }
98
- /**
99
- * Warn when a `configuration` path the factory DOES consume silently beats a top-level field of the
100
- * `llm` block that sets the same thing.
101
- *
102
- * Neither value is unusable here and neither location is wrong, so this is not a case for
103
- * {@link warnUnusedConfiguration}: both are honoured surfaces, and the only defect is that one wins
104
- * without saying so. The user's config then reads as two settings and behaves as one.
105
- *
106
- * Values are never printed — a base URL can carry credentials — so the message names the two paths
107
- * and which of them takes effect.
108
- *
109
- * @param appliedValue The value the factory actually applied. Pass the result of the SAME expression
110
- * that decides it, never a second copy of the test, for the reason given on
111
- * {@link warnUnappliedConfigurationPath}.
112
- */
113
- export function warnConfigurationOverridesTopLevelField(provider, field, topLevelValue, appliedValue) {
114
- // Nothing to lose: no top-level field set, or the block's value was not applied over it.
115
- if (topLevelValue === undefined || topLevelValue === null || topLevelValue === '')
125
+ export function warnShadowedField({ provider, ignoredPath, appliedPath, ignoredValue, appliedValue, }) {
126
+ // Nothing to lose: the losing location is unset, or carries no usable value of its own.
127
+ if (ignoredValue === undefined || ignoredValue === null || ignoredValue === '')
116
128
  return;
117
129
  if (appliedValue === undefined || appliedValue === null)
118
130
  return;
119
- // The same endpoint written twice is redundant, not a conflict, and warning on it would train
131
+ // The same setting written twice is redundant, not a conflict, and warning on it would train
120
132
  // users to ignore the message.
121
- if (topLevelValue === appliedValue)
133
+ if (ignoredValue === appliedValue)
122
134
  return;
123
- displayWarning(`Ignoring llm.${field} — the "${provider}" provider also has llm.configuration.${field} set, ` +
135
+ displayWarning(`Ignoring llm.${ignoredPath} — the "${provider}" provider also has llm.${appliedPath} set, ` +
124
136
  `and that one takes precedence. Set only one of the two so the "llm" block reads the way it ` +
125
137
  `behaves.`);
126
138
  }
@@ -1 +1 @@
1
- {"version":3,"file":"configurationPassthrough.js","sourceRoot":"","sources":["../../src/providers/configurationPassthrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,sGAAsG;AACtG,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,aAAsB,EACtB,aAAgC;IAEhC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC;QAAE,OAAO,EAAE,CAAC;IAC7C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACzD,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,SAAS;QAC1C,MAAM,eAAe,GAAG,aAAa;aAClC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;aAC5C,G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E,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;QAC3E,QAAQ,QAAQ,cAAc,MAAM,KAAK,QAAQ,EAAE,CACtD,CAAC;AACJ,CAAC;AAgDD,MAAM,UAAU,iBAAiB,CAAC,EAChC,QAAQ,EACR,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,GACS;IACrB,wFAAwF;IACxF,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,EAAE;QAAE,OAAO;IACvF,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI;QAAE,OAAO;IAChE,6FAA6F;IAC7F,+BAA+B;IAC/B,IAAI,YAAY,KAAK,YAAY;QAAE,OAAO;IAC1C,cAAc,CACZ,gBAAgB,WAAW,WAAW,QAAQ,2BAA2B,WAAW,QAAQ;QAC1F,6FAA6F;QAC7F,UAAU,CACb,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAgB,EAChB,aAAsB,EACtB,IAAY,EACZ,OAAgB,EAChB,QAAgB;IAEhB,IAAI,OAAO;QAAE,OAAO;IACpB,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,aAAa,CAAC;QAAE,OAAO;IACtE,cAAc,CACZ,8BAA8B,IAAI,yBAAyB,QAAQ,4BAA4B;QAC7F,uCAAuC,QAAQ,EAAE,CACpD,CAAC;AACJ,CAAC"}
@@ -2,7 +2,7 @@ import { displayWarning } from '#src/utils/consoleUtils.js';
2
2
  import { env } from '#src/utils/systemUtils.js';
3
3
  import { writeConfigFileWithMessages } from '#src/utils/fileUtils.js';
4
4
  import { buildInitConfigContent, getCuratedFallbackModel } from '#src/providers/modelDiscovery.js';
5
- import { NATIVE_CLIENT_REASON, warnConfigurationOverridesTopLevelField, warnUnappliedConfigurationPath, warnUnusedConfiguration, } from '#src/providers/configurationPassthrough.js';
5
+ import { NATIVE_CLIENT_REASON, warnShadowedField, warnUnappliedConfigurationPath, warnUnusedConfiguration, } from '#src/providers/configurationPassthrough.js';
6
6
  /**
7
7
  * The OpenRouter attribution headers, and the native `ChatOpenRouter` field each one is set from.
8
8
  * Declared once because they are read in two places that MUST agree: the `siteUrl`/`siteName`
@@ -76,11 +76,41 @@ export async function processJsonConfig(llmConfig) {
76
76
  // below — and the block's value is spread after it, so it wins. Both are honoured surfaces, so
77
77
  // the defect is only the silence: say which one takes effect rather than dropping the other
78
78
  // without a word.
79
- warnConfigurationOverridesTopLevelField('openrouter', 'baseURL', restConfig.baseURL, baseURLOverride.baseURL);
80
- const resolvedSiteUrl = siteUrl ??
81
- configObj?.defaultHeaders?.[ATTRIBUTION_HEADERS.siteUrl] ??
82
- 'https://gauntsloth.app/';
83
- const resolvedSiteName = siteName ?? configObj?.defaultHeaders?.[ATTRIBUTION_HEADERS.siteName] ?? 'Gaunt Sloth';
79
+ warnShadowedField({
80
+ provider: 'openrouter',
81
+ ignoredPath: 'baseURL',
82
+ appliedPath: 'configuration.baseURL',
83
+ ignoredValue: restConfig.baseURL,
84
+ appliedValue: baseURLOverride.baseURL,
85
+ });
86
+ // The attribution headers run the OTHER way: the block feeds `siteUrl`/`siteName` only as a
87
+ // FALLBACK, so a top-level value beats it. Both directions are honoured surfaces and both are
88
+ // announced; the precedence itself is left exactly as it is, because a user relying on either
89
+ // order should not have their config change meaning under them. What ends here is the silence —
90
+ // the block's `baseURL` beating the top-level field was already announced while this, the
91
+ // opposite direction, was not, and a rule you can only observe in one direction is not one a
92
+ // user can reason from.
93
+ const blockSiteUrl = configObj?.defaultHeaders?.[ATTRIBUTION_HEADERS.siteUrl];
94
+ const blockSiteName = configObj?.defaultHeaders?.[ATTRIBUTION_HEADERS.siteName];
95
+ const resolvedSiteUrl = siteUrl ?? blockSiteUrl ?? 'https://gauntsloth.app/';
96
+ const resolvedSiteName = siteName ?? blockSiteName ?? 'Gaunt Sloth';
97
+ // `appliedValue` is the resolved expression itself, not a re-test of it: when only the block is
98
+ // set the two are the same value and the guard's equality check keeps it silent, which is what
99
+ // makes one call cover "top level wins" without also firing on "the block was used".
100
+ warnShadowedField({
101
+ provider: 'openrouter',
102
+ ignoredPath: `configuration.defaultHeaders.${ATTRIBUTION_HEADERS.siteUrl}`,
103
+ appliedPath: 'siteUrl',
104
+ ignoredValue: blockSiteUrl,
105
+ appliedValue: resolvedSiteUrl,
106
+ });
107
+ warnShadowedField({
108
+ provider: 'openrouter',
109
+ ignoredPath: `configuration.defaultHeaders.${ATTRIBUTION_HEADERS.siteName}`,
110
+ appliedPath: 'siteName',
111
+ ignoredValue: blockSiteName,
112
+ appliedValue: resolvedSiteName,
113
+ });
84
114
  return new ChatOpenRouter({
85
115
  ...restConfig,
86
116
  apiKey: openRouterApiKey,
@@ -1 +1 @@
1
- {"version":3,"file":"openrouter.js","sourceRoot":"","sources":["../../src/providers/openrouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAOhD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACnG,OAAO,EACL,oBAAoB,EACpB,uCAAuC,EACvC,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,4CAA4C,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAW,CAAC;AAEtF;;;GAGG;AACH,MAAM,4BAA4B,GAAG;IACnC,SAAS;IACT,kBAAkB,mBAAmB,CAAC,OAAO,EAAE;IAC/C,kBAAkB,mBAAmB,CAAC,QAAQ,EAAE;CACxC,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qCAAqC;AACrC,MAAM,CAAC,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31
31
  ...llmConfig,
32
32
  model: llmConfig.model || getCuratedFallbackModel('vertexai'),
33
33
  vertexai: true,
34
+ // CFG-58 — pick the provider from the config, not from whatever key happens to be exported.
35
+ // `@langchain/google` ranks an ambient `GOOGLE_API_KEY` ABOVE service-account credentials and
36
+ // ADC (its documented order), and `NodeApiClient.fetch` sets the api-key header ahead of both
37
+ // branches. So an AI Studio key exported for a `google-genai` profile silently turns a
38
+ // `vertexai` session into a Vertex EXPRESS session: express auth header, and an express URL
39
+ // with no project or location. The user configured Vertex; only the environment disagreed.
40
+ //
41
+ // An EMPTY STRING is what demotes it, and none of the near-misses do:
42
+ // - `googleAuthOptions` alone does NOT work. The client builds `GoogleAuth` from it and then
43
+ // never reaches that branch, because the api-key check comes first.
44
+ // - `undefined` / `null` do NOT work either. The lookup is `params.apiKey ?? env`, and `??`
45
+ // treats both as absent, so the ambient key flows straight back in.
46
+ // - Unsetting the variable is not ours to do: this process also runs other providers, other
47
+ // tools and spawned children.
48
+ // An empty string is not nullish, so the env lookup is skipped; it is falsy, so the constructor
49
+ // still builds ADC and `fetch` still takes the ADC branch. The library models this state
50
+ // itself — its own `hasApiKey()` is `typeof apiKey === 'string' && apiKey !== ''`.
51
+ //
52
+ // A key the user actually WROTE still wins, and must: an `apiKey` on the `llm` block is how
53
+ // Vertex express mode is requested on purpose. Only the ambient environment is demoted.
54
+ apiKey: llmConfig.apiKey || '',
34
55
  };
35
56
  delete configFields.type;
36
57
  delete configFields.apiKeyEnvironmentVariable;
@@ -1 +1 @@
1
- {"version":3,"file":"vertexai.js","sourceRoot":"","sources":["../../src/providers/vertexai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAI5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACnG,OAAO,EAAE,8BA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