@ashlr/hub 3.8.0 → 3.9.1

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 (153) hide show
  1. package/CHANGELOG.md +214 -0
  2. package/dist/build-identity.json +2 -2
  3. package/dist/cli/resource-profile.js +95 -21
  4. package/dist/cli/resource-profile.js.map +1 -1
  5. package/dist/core/resources/claude-account-usage.d.ts +19 -0
  6. package/dist/core/resources/claude-account-usage.js +22 -1
  7. package/dist/core/resources/claude-account-usage.js.map +1 -1
  8. package/dist/core/resources/native-profile.d.ts +56 -0
  9. package/dist/core/resources/native-profile.js +368 -6
  10. package/dist/core/resources/native-profile.js.map +1 -1
  11. package/dist/core/run/model-catalog.js +8 -1
  12. package/dist/core/run/model-catalog.js.map +1 -1
  13. package/dist/core/universe/builtins/preparation/manifest.json +1 -1
  14. package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +9 -2
  15. package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +8 -1
  16. package/dist/core/verse/accounts.d.ts +6 -5
  17. package/dist/core/verse/accounts.js +9 -8
  18. package/dist/core/verse/accounts.js.map +1 -1
  19. package/dist/core/verse/adapters/claude.d.ts +49 -2
  20. package/dist/core/verse/adapters/claude.js +317 -56
  21. package/dist/core/verse/adapters/claude.js.map +1 -1
  22. package/dist/core/verse/adapters/codex.d.ts +81 -5
  23. package/dist/core/verse/adapters/codex.js +409 -47
  24. package/dist/core/verse/adapters/codex.js.map +1 -1
  25. package/dist/core/verse/adapters/grok.d.ts +13 -1
  26. package/dist/core/verse/adapters/grok.js +28 -2
  27. package/dist/core/verse/adapters/grok.js.map +1 -1
  28. package/dist/core/verse/adapters/index.d.ts +32 -0
  29. package/dist/core/verse/adapters/index.js +2 -0
  30. package/dist/core/verse/adapters/index.js.map +1 -1
  31. package/dist/core/verse/codex-rollout.d.ts +284 -0
  32. package/dist/core/verse/codex-rollout.js +786 -0
  33. package/dist/core/verse/codex-rollout.js.map +1 -0
  34. package/dist/core/verse/context-fit.d.ts +63 -0
  35. package/dist/core/verse/context-fit.js +355 -0
  36. package/dist/core/verse/context-fit.js.map +1 -0
  37. package/dist/core/verse/context-math.d.ts +215 -0
  38. package/dist/core/verse/context-math.js +365 -0
  39. package/dist/core/verse/context-math.js.map +1 -0
  40. package/dist/core/verse/local-models.d.ts +137 -1
  41. package/dist/core/verse/local-models.js +209 -5
  42. package/dist/core/verse/local-models.js.map +1 -1
  43. package/dist/core/verse/model-windows.d.ts +217 -0
  44. package/dist/core/verse/model-windows.js +616 -0
  45. package/dist/core/verse/model-windows.js.map +1 -0
  46. package/dist/core/verse/preferences.d.ts +123 -0
  47. package/dist/core/verse/preferences.js +403 -0
  48. package/dist/core/verse/preferences.js.map +1 -0
  49. package/dist/core/verse/project-memory.d.ts +112 -0
  50. package/dist/core/verse/project-memory.js +295 -0
  51. package/dist/core/verse/project-memory.js.map +1 -0
  52. package/dist/core/verse/seats.d.ts +106 -4
  53. package/dist/core/verse/seats.js +291 -89
  54. package/dist/core/verse/seats.js.map +1 -1
  55. package/dist/core/verse/session-engine.d.ts +76 -2
  56. package/dist/core/verse/session-engine.js +684 -63
  57. package/dist/core/verse/session-engine.js.map +1 -1
  58. package/dist/core/verse/session-handoff.d.ts +94 -0
  59. package/dist/core/verse/session-handoff.js +551 -0
  60. package/dist/core/verse/session-handoff.js.map +1 -0
  61. package/dist/core/verse/session-search.d.ts +63 -0
  62. package/dist/core/verse/session-search.js +213 -0
  63. package/dist/core/verse/session-search.js.map +1 -0
  64. package/dist/core/verse/session-store.d.ts +16 -2
  65. package/dist/core/verse/session-store.js +80 -6
  66. package/dist/core/verse/session-store.js.map +1 -1
  67. package/dist/core/verse/types.d.ts +333 -1
  68. package/dist/core/verse/types.js +54 -2
  69. package/dist/core/verse/types.js.map +1 -1
  70. package/dist/core/verse/verse-api.d.ts +40 -5
  71. package/dist/core/verse/verse-api.js +724 -25
  72. package/dist/core/verse/verse-api.js.map +1 -1
  73. package/dist/core/web/api.d.ts +14 -4
  74. package/dist/core/web/api.js +26 -11
  75. package/dist/core/web/api.js.map +1 -1
  76. package/dist/core/web/public/next/assets/{App-BsbJFA2j.js → App-D2P1AJiD.js} +5 -5
  77. package/dist/core/web/public/next/assets/{App-BsbJFA2j.js.map → App-D2P1AJiD.js.map} +1 -1
  78. package/dist/core/web/public/next/assets/{ApprovalsSection-2CCSoBTJ.js → ApprovalsSection-Dq66NMfx.js} +2 -2
  79. package/dist/core/web/public/next/assets/{ApprovalsSection-2CCSoBTJ.js.map → ApprovalsSection-Dq66NMfx.js.map} +1 -1
  80. package/dist/core/web/public/next/assets/AutonomySection-DyxpeR5I.js +2 -0
  81. package/dist/core/web/public/next/assets/{AutonomySection-yeNNUPur.js.map → AutonomySection-DyxpeR5I.js.map} +1 -1
  82. package/dist/core/web/public/next/assets/ChatSection-BpOBOUvg.css +1 -0
  83. package/dist/core/web/public/next/assets/ChatSection-bzwFdbdw.js +84 -0
  84. package/dist/core/web/public/next/assets/ChatSection-bzwFdbdw.js.map +1 -0
  85. package/dist/core/web/public/next/assets/ConfirmDialog-DkR0z5_a.js +2 -0
  86. package/dist/core/web/public/next/assets/ConfirmDialog-DkR0z5_a.js.map +1 -0
  87. package/dist/core/web/public/next/assets/{Dialog-nK15L1M0.js → Dialog-CIjlQZqc.js} +2 -2
  88. package/dist/core/web/public/next/assets/{Dialog-nK15L1M0.js.map → Dialog-CIjlQZqc.js.map} +1 -1
  89. package/dist/core/web/public/next/assets/{DiffViewer-D369eZe8.js → DiffViewer-BjQZAm5L.js} +2 -2
  90. package/dist/core/web/public/next/assets/{DiffViewer-D369eZe8.js.map → DiffViewer-BjQZAm5L.js.map} +1 -1
  91. package/dist/core/web/public/next/assets/{McpSection-DVgiSYG1.js → McpSection-D2FySMy3.js} +2 -2
  92. package/dist/core/web/public/next/assets/{McpSection-DVgiSYG1.js.map → McpSection-D2FySMy3.js.map} +1 -1
  93. package/dist/core/web/public/next/assets/{MutationTokenDialog-B9I4PAcp.js → MutationTokenDialog-QBPrD1UE.js} +2 -2
  94. package/dist/core/web/public/next/assets/{MutationTokenDialog-B9I4PAcp.js.map → MutationTokenDialog-QBPrD1UE.js.map} +1 -1
  95. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-z6tJj3s9.js → ResourcePoolConsoleApp-Dzq9Ufq_.js} +4 -4
  96. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-z6tJj3s9.js.map → ResourcePoolConsoleApp-Dzq9Ufq_.js.map} +1 -1
  97. package/dist/core/web/public/next/assets/{RouteErrorBoundary-OSajL45F.js → RouteErrorBoundary-Chd-wt6w.js} +2 -2
  98. package/dist/core/web/public/next/assets/{RouteErrorBoundary-OSajL45F.js.map → RouteErrorBoundary-Chd-wt6w.js.map} +1 -1
  99. package/dist/core/web/public/next/assets/{Meter-CLcr-4wS.css → Segmented-8cf0Fypn.css} +1 -1
  100. package/dist/core/web/public/next/assets/{Meter-Cmo1pLbk.js → Segmented-DhGh7Y1s.js} +2 -2
  101. package/dist/core/web/public/next/assets/Segmented-DhGh7Y1s.js.map +1 -0
  102. package/dist/core/web/public/next/assets/SettingsSection-Bqimu_Mg.js +2 -0
  103. package/dist/core/web/public/next/assets/{SettingsSection-B3YH2Npi.js.map → SettingsSection-Bqimu_Mg.js.map} +1 -1
  104. package/dist/core/web/public/next/assets/UniverseConsoleApp-DzAyrE-A.js +2 -0
  105. package/dist/core/web/public/next/assets/{UniverseConsoleApp-wEKIzl1M.js.map → UniverseConsoleApp-DzAyrE-A.js.map} +1 -1
  106. package/dist/core/web/public/next/assets/{UniverseView-CQVpJqqI.js → UniverseView-BGl3DRV7.js} +2 -2
  107. package/dist/core/web/public/next/assets/{UniverseView-CQVpJqqI.js.map → UniverseView-BGl3DRV7.js.map} +1 -1
  108. package/dist/core/web/public/next/assets/UsageSection-PaaJ1L90.js +2 -0
  109. package/dist/core/web/public/next/assets/UsageSection-PaaJ1L90.js.map +1 -0
  110. package/dist/core/web/public/next/assets/VerseConsoleApp-DYH7ottg.js +3 -0
  111. package/dist/core/web/public/next/assets/VerseConsoleApp-DYH7ottg.js.map +1 -0
  112. package/dist/core/web/public/next/assets/VerseConsoleApp-DsdKQoTH.css +1 -0
  113. package/dist/core/web/public/next/assets/{charts-BopViIha.js → charts-CnMDT08S.js} +2 -2
  114. package/dist/core/web/public/next/assets/{charts-BopViIha.js.map → charts-CnMDT08S.js.map} +1 -1
  115. package/dist/core/web/public/next/assets/context-model-DTvb2uZy.js +2 -0
  116. package/dist/core/web/public/next/assets/context-model-DTvb2uZy.js.map +1 -0
  117. package/dist/core/web/public/next/assets/global-F2K14nNo.js +2 -0
  118. package/dist/core/web/public/next/assets/global-F2K14nNo.js.map +1 -0
  119. package/dist/core/web/public/next/assets/{icons-L06pQH6j.js → icons-B2fa40k6.js} +2 -2
  120. package/dist/core/web/public/next/assets/{icons-L06pQH6j.js.map → icons-B2fa40k6.js.map} +1 -1
  121. package/dist/core/web/public/next/assets/{index-CXgVQHek.js → index-DO9a5IaB.js} +3 -3
  122. package/dist/core/web/public/next/assets/{index-CXgVQHek.js.map → index-DO9a5IaB.js.map} +1 -1
  123. package/dist/core/web/public/next/assets/{queries-D3sSlan1.js → queries-BdSsWYSu.js} +2 -2
  124. package/dist/core/web/public/next/assets/{queries-D3sSlan1.js.map → queries-BdSsWYSu.js.map} +1 -1
  125. package/dist/core/web/public/next/assets/use-guarded-action-BrlIU0jJ.js +2 -0
  126. package/dist/core/web/public/next/assets/{use-guarded-action-BxfJ9E-n.js.map → use-guarded-action-BrlIU0jJ.js.map} +1 -1
  127. package/dist/core/web/public/next/assets/verse-model-GWqHIjMG.js +2 -0
  128. package/dist/core/web/public/next/assets/verse-model-GWqHIjMG.js.map +1 -0
  129. package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js → workspace-model-4yzB--1h.js} +2 -2
  130. package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js.map → workspace-model-4yzB--1h.js.map} +1 -1
  131. package/dist/core/web/public/next/index.html +1 -1
  132. package/dist/release-dependency-inventory.json +1 -1
  133. package/docs/README.md +1 -0
  134. package/package.json +1 -1
  135. package/dist/core/web/public/next/assets/AutonomySection-yeNNUPur.js +0 -2
  136. package/dist/core/web/public/next/assets/ChatSection-BfnLe5dT.css +0 -1
  137. package/dist/core/web/public/next/assets/ChatSection-DwDDnCZQ.js +0 -80
  138. package/dist/core/web/public/next/assets/ChatSection-DwDDnCZQ.js.map +0 -1
  139. package/dist/core/web/public/next/assets/ConfirmDialog-C363ty_c.js +0 -2
  140. package/dist/core/web/public/next/assets/ConfirmDialog-C363ty_c.js.map +0 -1
  141. package/dist/core/web/public/next/assets/Meter-Cmo1pLbk.js.map +0 -1
  142. package/dist/core/web/public/next/assets/SettingsSection-B3YH2Npi.js +0 -2
  143. package/dist/core/web/public/next/assets/UniverseConsoleApp-wEKIzl1M.js +0 -2
  144. package/dist/core/web/public/next/assets/UsageSection-dToBThXe.js +0 -2
  145. package/dist/core/web/public/next/assets/UsageSection-dToBThXe.js.map +0 -1
  146. package/dist/core/web/public/next/assets/VerseConsoleApp-CMkCizvL.css +0 -1
  147. package/dist/core/web/public/next/assets/VerseConsoleApp-DHU32JCQ.js +0 -3
  148. package/dist/core/web/public/next/assets/VerseConsoleApp-DHU32JCQ.js.map +0 -1
  149. package/dist/core/web/public/next/assets/global-DMWakEhP.js +0 -2
  150. package/dist/core/web/public/next/assets/global-DMWakEhP.js.map +0 -1
  151. package/dist/core/web/public/next/assets/use-guarded-action-BxfJ9E-n.js +0 -2
  152. package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js +0 -2
  153. package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -339,6 +339,220 @@ superseded, not a setup procedure. Use [runtime activation authority](docs/RUNTI
339
339
  and the [current architecture boundary](docs/ARCHITECTURE.md#legacy-fleet-activation-boundary).
340
340
  Neither the historical record nor a successful test activates a resident fleet.
341
341
 
342
+ ## [3.9.1] — 2026-09-24 UTC — Claude usage stays visible after a re-pin
343
+
344
+ - **The Claude usage meter went blind on any seat re-pinned to Claude Code
345
+ 2.1.280** — the seat Opus 5.5 needs. The usage probe accepted exactly one
346
+ build (2.1.257) and failed closed on every other, so the one seat nearest
347
+ its weekly limit showed no percentages at all. It now accepts a list of
348
+ VERIFIED builds (`CLAUDE_USAGE_VERIFIED_VERSIONS`: 2.1.257, 2.1.280). 2.1.280
349
+ was verified the same two ways the original pin was: the binary defines
350
+ `/usage` as a local, non-interactive command, and a live `-p /usage` run
351
+ reported `num_turns: 0`, `total_cost_usd: 0` and parsed to the five-hour,
352
+ weekly and weekly-Fable windows. Any other build still fails closed — an
353
+ unverified build could route the slash command to a model.
354
+
355
+ ## [3.9.0] — 2026-09-24 UTC — the context meter tells the truth, and long sessions have somewhere to go
356
+
357
+ The Verse context meter was wrong on every engine, in a different way each time,
358
+ and a session that was filling up had nowhere to go but a cold new chat. The
359
+ numbers below were read from the pinned CLI binaries, each seat's own model
360
+ catalog and every September Codex rollout on this machine; no paid model was
361
+ prompted to produce them. `docs/VERSE-CONTEXT.md` is the new authority for all of it.
362
+
363
+ ### Behaviour change: new Claude chats compact at ≈367k, existing ones keep ≈967k
364
+
365
+ - **New Claude chats on a 1M model start in Standard** and compact at ≈367k
366
+ (`--autocompact 400000`), not near 967k as every Claude chat did before.
367
+ Expansive — the old full window — is one click away, and can be a seat's default.
368
+ - **Chats created before 3.9 keep the window they ran with.** A Claude chat with
369
+ no recorded mode is marked **Expansive** the first time 3.9 loads it and runs
370
+ with `--autocompact auto`, exactly as before, so upgrading compacts nothing and
371
+ spends nothing. Codex, Grok, local and 200k-Claude chats from before 3.9 stay
372
+ Standard, which is what they already ran at.
373
+ - **Switching a chat to Standard above ≈367k compacts it on the next turn.** The
374
+ CLI then summarizes the whole context — on a paid seat that spends usage — and
375
+ early turns survive only as that summary. The same holds for a Codex chat
376
+ switched back from Expansive above 244.8k. Switching to Expansive is always
377
+ free. The mode menu warns before you switch.
378
+
379
+ ### Windows read from the CLIs, not assumed
380
+
381
+ - **Claude.** Six of the eight models run a **1M** window and compact near
382
+ 967k; Verse showed 200k for all of them, so a Fable session went red at 180k
383
+ and then sat at 100 % while it grew to 967k — hiding exactly the range where
384
+ every turn is most expensive. Each model now carries its real window, and the
385
+ window the CLI reports at runtime (`result.modelUsage`) wins, which also
386
+ catches the CLI dropping a session to 200k when long-context credit runs out.
387
+ - **"Opus 5.5" was running Opus 5.** Verse offered `claude-opus-5.5`; Claude
388
+ Code's id parser rejects the dotted suffix and falls back to a substring match
389
+ on `claude-opus-5`. The real id is `claude-opus-5-5`, which needs Claude Code
390
+ 2.1.280 — and the claude-a seat is pinned to 2.1.257. Opus 5.5 is now listed on
391
+ that seat **disabled, with the reason** and the fix
392
+ (`ashlr resources profile repin`, new in this release — below), rather than
393
+ silently running a different model. Old sessions keep their recorded id, but
394
+ their turns now ask for the real model, so on a seat that cannot run it the
395
+ turn is refused up front (409 `VERSE_MODEL_UNAVAILABLE`, with the reason)
396
+ instead of starting a CLI that would reject the id. A client that still sends
397
+ `claude-opus-5.5` when creating a chat gets `claude-opus-5-5`.
398
+ - **Codex.** The CLI measures against 95 % of the window — 258,400, reported by
399
+ every one of 151,715 rollout readings — and compacts near 244,800. Occupancy was
400
+ the turn's *summed* input — a median 28.8× the real last-call prompt across 260
401
+ recent turns — so the meter sat red on almost every turn. It now comes from the
402
+ seat's own rollout — the last call's `last_token_usage.total_tokens`, the
403
+ figure Codex itself compacts against, and the window the rollout reports —
404
+ read every 2 s during a turn; until that is readable the figure is marked `≤`. The rollout also fixes per-turn usage: on `exec resume`,
405
+ Codex's reported usage is the whole thread's running total, which Verse would
406
+ have added again every turn (no Verse codex chat had run yet, so no stored
407
+ total is wrong). Models come from each seat's own catalog, so hidden slugs are
408
+ no longer offered.
409
+ - **Grok** is 500k compacting at 400k, not 256k — the meter read twice the real
410
+ fill. Labels come from the catalog ("Grok 4.7 Fast"), and only its `.info`
411
+ entries are read: the same file carries a per-model `api_key` field. Like
412
+ Claude, the window Grok reports at runtime wins.
413
+ - **Local.** Claude Code assumes 200k for a model it does not know, so a local
414
+ seat never compacted before a 64k runner overflowed. Verse now tells it the
415
+ real window (`CLAUDE_CODE_MAX_CONTEXT_TOKENS`), resolves that window from what
416
+ the runner actually serves (llama-server's per-slot window on that lane,
417
+ Ollama's own server default for unpinned tags — preferred over whatever
418
+ context a resident runner was loaded with, since another app may have loaded
419
+ it at 8k), and parses `-ctx64k` tags, which the old suffix pattern missed.
420
+ Before every local turn the chat's stored window is refreshed from live
421
+ discovery, so the window the CLI is told and the one the meter shows are the
422
+ same, current number. Tags under a 56k window are listed disabled with the
423
+ reason: after Claude Code's 33k reserve and its ~15k base prompt they would
424
+ compact on every turn. The fleet's model catalog no longer
425
+ tags the 64k local coder `long-context` (a capability defined as ≥ 100k), which
426
+ had routed long-context work to a model that would overflow.
427
+ - Readings are stored **unclamped**: an overflow is information, and the old
428
+ clamp erased it on disk.
429
+
430
+ ### Compaction you can see
431
+
432
+ Native compactions become persisted `compaction` events — Claude and Grok from
433
+ `compact_boundary`, Codex from its rollout, sized from the readings just before
434
+ and after it — with a transcript divider ("Auto-compacted 967k → 19k in 1m 58s")
435
+ and a per-session count. The meter draws the whole window with a tick at the
436
+ compaction point and warns at 80 % / 95 % of **that point**. The old fixed
437
+ 70 / 90 % of the window turned red only after Grok and Codex had already
438
+ compacted.
439
+
440
+ **Compact now** — in the chip beside the meter on every Claude and local session
441
+ (a "Context" chip where the model has no second mode), and in the handoff banner — sends `/compact` as an ordinary turn,
442
+ through the same gate as every turn, and the divider reads "Compacted on
443
+ request". It was verified headless on a local seat, where it is free but slow
444
+ (about 2½ minutes for a 15k context on a 27B model). **On a paid seat it spends
445
+ usage**: the CLI reads the whole context to write its summary.
446
+
447
+ ### Standard and expansive context
448
+
449
+ A new chat on any Claude 1M model now compacts at ≈367k by default
450
+ (`--autocompact 400000`) instead of ≈967k (chats from before 3.9 keep ≈967k —
451
+ above). Each turn re-sends the whole conversation, and long-context
452
+ recall degrades with length on every published benchmark, so a session held
453
+ near 900k re-reads about 2.3× what one held under 400k does. **Expansive** mode
454
+ restores the full window — and on GPT-6 / GPT-5.6 raises Codex to its 872k
455
+ catalog maximum, passing `model_context_window` and
456
+ `model_auto_compact_token_limit` together (one without the other breaks Codex's
457
+ compaction). The mode is per session, applies from the next turn, can be a
458
+ seat's default, and exists only where it is real. Verse may suggest it; it never
459
+ switches it on. The menu's cost note is the ratio of the two compaction points
460
+ (≈2.6× on Claude, ≈3.2× on Codex). On Codex every Expansive surface also says
461
+ that GPT-5.6 requests above 272k reportedly count about 2× against plan limits
462
+ (one secondary source; GPT-6 Astra reportedly exempt) — if that holds, a turn
463
+ near the expansive limit counts nearer 6× a standard one.
464
+
465
+ ### Continue in a fresh chat
466
+
467
+ A banner appears when a session nears its compaction point, has compacted twice,
468
+ or has sat idle past the prompt cache's lifetime with a large context. It builds
469
+ a handoff note from the session's own log — goal, latest asks, state, files,
470
+ commands, errors, `git diff --stat` per root — with no model call, lets you edit
471
+ it and pick any seat (a Claude chat can continue on Codex), creates the new
472
+ session for free and leaves the note in its composer. Nothing is sent until you
473
+ press send.
474
+
475
+ ### Shared memory, fit, search, efficiency
476
+
477
+ - **Project memory:** one private directory per project under
478
+ `~/.ashlr/verse/memory/`, shared by every seat, with a fixed instruction block
479
+ that stays byte-identical across turns so the prompt cache survives. On by
480
+ default, per-project opt-out, editable from the Resources panel. Claude and
481
+ local seats get the directory with `--add-dir` and the block with
482
+ `--append-system-prompt`; Codex through `-c` overrides (a writable root and
483
+ `developer_instructions`), since `exec resume` takes no `--add-dir`. Grok, whose
484
+ CLI can be granted nothing beyond its working directory, gets a read-only
485
+ snapshot through `--rules`. **It is not free on a paid seat:** the block (up
486
+ to 6 KB) rides in the system prompt of every turn of every new session —
487
+ cached after the first turn, but cached tokens still count — and it asks the
488
+ agent to read and update `MEMORY.md`, which is extra tool calls and output.
489
+ Turn it off per project, or for every project, in the Resources panel.
490
+ The editor shows the sanitized copy the API serves and says so; a save that
491
+ would write `[REDACTED]` placeholders over real values is refused.
492
+ - **Context fit:** per-model verdicts — fits, tight, needs expansive, or split —
493
+ for a folder or workspace, from `git ls-files` sizes, plus each engine's base
494
+ prompt (local 15k, measured; Claude 25k, Codex 15k, Grok 20k, estimated), so
495
+ a handoff note fits the 64k local seat while a whole repository shows split.
496
+ - **Session search** across past chats from the sidebar: a bounded keyword scan
497
+ of Verse's own session store (newest 200 sessions, 20 MB of message text), with
498
+ no index and no embeddings.
499
+ - **Efficiency:** cache-hit ratio, context per turn, compactions and an
500
+ idle-cache warning, computed in the browser.
501
+
502
+ Memory aside, all of it is deterministic and spends nothing: the handoff
503
+ preview, context fit, search and the efficiency stats make no model call. The
504
+ only model calls remain the turns you send, through the same local-only-gated
505
+ chokepoint as before.
506
+
507
+ ### Re-pin a seat to a newer CLI
508
+
509
+ `ashlr resources profile repin --directory <profile> --executable <binary>`
510
+ points an existing prepared native profile at another CLI binary — the fix the
511
+ claude-a seat's note names for Opus 5.5. It changes only the pinned executable
512
+ (the launcher's one `const profile=` line and `profile.json`) and refuses a
513
+ profile that is not unmodified `prepare` output. `--dry-run` checks everything
514
+ and writes nothing. A real repin first saves `launcher.mjs`, `profile.json` and
515
+ `command.json` as `.prev` files — one rollback set; restoring all three restores
516
+ the old pin. Re-running an interrupted repin finishes it, repinning to the
517
+ current binary reports `unchanged`, and failures say whether the profile
518
+ changed. It does not check sign-in: run `ashlr resources launcher check`
519
+ afterwards. The command ships in the built CLI, so it needs `npm run build` in a
520
+ source checkout.
521
+
522
+ ### For API clients
523
+
524
+ - New routes under `/api/verse`: `POST /sessions/:id/context-mode`,
525
+ `POST /sessions/:id/handoff-preview`, `GET`/`POST /preferences`,
526
+ `GET /context-fit`, `GET /search`, `GET`/`POST /memory`. None starts a model
527
+ call. `handoff-preview` is a POST because it runs `git`, so like every POST it
528
+ answers 404 on a read-only server.
529
+ - `POST /sessions` is now strict: an unknown key is a 400, and `workspaceName` is
530
+ refused (the server fills it from `workspaceId`). New sessions always carry
531
+ `memoryEnabled`, `false` when memory is off for the project.
532
+ - The new GETs reject unknown or duplicated query parameters; `context-fit`
533
+ takes `extraRoots` repeated once per root, because a comma is legal in a path.
534
+ - `POST /memory` content is capped at 64 KiB; that route alone accepts a body
535
+ of up to 2 × 64 KiB + 8 KiB so a full-size file survives JSON escaping. It
536
+ answers 409 `VERSE_MEMORY_REDACTED` when the content holds more `[REDACTED]`
537
+ placeholders than the file on disk, and `GET`/`POST /memory` responses carry
538
+ `contentSanitized: true` whenever the content sent is not the file's bytes.
539
+ - New sessions always record `contextMode` (`'standard'` included); an absent
540
+ key marks a pre-3.9 record (resolved as above).
541
+ - New persisted events `compaction` and `context`; `context` may carry
542
+ `contextWindowSource` (absent = `runtime`), so a catalog budget written after
543
+ a mode switch is not shown as a measurement. `VERSE_HANDOFF_SUMMARY_REQUEST`
544
+ (`types.ts`) is the fixed "summarize first" turn. The full additive contract
545
+ is in `docs/VERSE-CONTRACT-V1.md`.
546
+
547
+ ### Hygiene
548
+
549
+ - `eslint.config.js` ignores `.claude/**`. Agent worktrees there produced about
550
+ 98k lint errors, which made `npm run lint` — and so `prepublishOnly` — fail on
551
+ this machine.
552
+ - Two release-truth test pins that asserted superseded facts (npm provenance,
553
+ removed on purpose in `e24a7dae`, and the pre-rewrite desktop README) now
554
+ assert the current policy.
555
+
342
556
  ## [3.8.0] — 2026-09-23 UTC — local-only actually prevents spend
343
557
 
344
558
  Two gates that make a promise the UI was already making. Both landed after the
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "3.8.0",
4
- "revision": "a3a44cbbc5599bdb369c3cba1d7fcd53a45fa854",
3
+ "packageVersion": "3.9.1",
4
+ "revision": "97a9566089cb152145ab6dade6fe83f5820085f2",
5
5
  "dirty": false,
6
6
  "provenance": "git"
7
7
  }
@@ -1,13 +1,27 @@
1
1
  import { isAbsolute, parse as parsePath, resolve } from 'node:path';
2
2
  const USAGE = `usage: ashlr resources profile prepare --provider codex|claude|grok
3
3
  --directory NEW_ABS --executable ABS [--json]
4
+ ashlr resources profile repin --directory EXISTING_ABS --executable ABS
5
+ [--dry-run] [--json]
4
6
 
5
- Creates one new private profile under an existing owned mode-0700 parent.
7
+ prepare creates one new private profile under an existing owned mode-0700 parent.
6
8
  Writes a standalone launcher, command.json, preparation manifest and empty native
7
9
  state directories. Existing targets are never overwritten, repaired or reused.
8
10
  On failure, a partially prepared directory may remain; inspect it rather than
9
11
  deleting account state automatically. No parent directories are created.
10
12
 
13
+ repin points one existing prepared profile at a different native executable,
14
+ for example a newer CLI version that a model requires. It rewrites only the
15
+ executable locator in launcher.mjs and profile.json (command.json names node and
16
+ the launcher, never the native executable, so its bytes do not change), keeps
17
+ the provider, native state and sign-in untouched, and first copies the three
18
+ files to launcher.mjs.prev, profile.json.prev and command.json.prev. Every file
19
+ must still be prepare's unmodified output; a hand-edited profile is refused.
20
+ Rerunning the same repin after an interruption finishes it; repinning to the
21
+ current executable writes nothing. Sessions already running keep the binary
22
+ they started with; the next launch through the profile uses the new one.
23
+ --dry-run validates everything and reports the change without writing.
24
+
11
25
  No executable is launched, credentials read/copied, account signed in, provider
12
26
  contacted, pool enrolled or resident service installed. The returned login argv
13
27
  is a separate interactive native action, not something this command executes.
@@ -16,12 +30,17 @@ environment; they are operator-owned code, not a sandbox or billing attestation.
16
30
  Node with process.execve support and a supported POSIX platform are required.
17
31
  --executable must name a canonical regular executable file, not an install symlink.
18
32
  Output includes private local paths, never authentication material.
19
- Exit codes: 0 prepared (authentication not checked), 1 preparation unavailable,
20
- 2 invalid arguments. Grok preparation supports separate native login/metadata;
21
- it does not enable a Grok task-generation adapter.
33
+ Exit codes: 0 prepared, repinned or already pinned (authentication not checked),
34
+ 1 preparation or repin unavailable, 2 invalid arguments. Grok preparation
35
+ supports separate native login/metadata; it does not enable a Grok
36
+ task-generation adapter.
22
37
  `;
23
38
  class UsageError extends Error {
24
39
  }
40
+ /** A repin failure whose message is fixed, path-free text saying whether the profile changed. */
41
+ class RepinFailure extends Error {
42
+ }
43
+ const REPIN_UNAVAILABLE = 'Native profile repin unavailable; inspect the profile before retrying';
25
44
  function parse(args) {
26
45
  if (args.length > 12 || args.some((arg) => typeof arg !== 'string' || Buffer.byteLength(arg) > 4096 ||
27
46
  [...arg].some((char) => char.charCodeAt(0) < 32 || char.charCodeAt(0) >= 127 && char.charCodeAt(0) <= 159)) ||
@@ -29,10 +48,14 @@ function parse(args) {
29
48
  throw new UsageError('Invalid profile arguments');
30
49
  if (args.length === 1 && ['--help', '-h'].includes(args[0]))
31
50
  return { help: true };
32
- if (args[0] !== 'prepare')
33
- throw new UsageError('Expected prepare subcommand');
51
+ const subcommand = args[0];
52
+ if (subcommand !== 'prepare' && subcommand !== 'repin')
53
+ throw new UsageError('Expected prepare or repin subcommand');
54
+ // repin reads the provider from the existing profile and never changes it.
55
+ const valued = subcommand === 'prepare' ? ['--provider', '--directory', '--executable'] : ['--directory', '--executable'];
34
56
  const values = new Map();
35
57
  let json = false;
58
+ let dryRun = false;
36
59
  for (let i = 1; i < args.length; i++) {
37
60
  const flag = args[i];
38
61
  if (flag === '--json') {
@@ -41,16 +64,21 @@ function parse(args) {
41
64
  json = true;
42
65
  continue;
43
66
  }
44
- if (!['--provider', '--directory', '--executable'].includes(flag) || values.has(flag))
67
+ if (flag === '--dry-run' && subcommand === 'repin') {
68
+ if (dryRun)
69
+ throw new UsageError('Duplicate profile option');
70
+ dryRun = true;
71
+ continue;
72
+ }
73
+ if (flag === '--provider' && subcommand === 'repin')
74
+ throw new UsageError('repin keeps the profile provider; --provider is not accepted');
75
+ if (!valued.includes(flag) || values.has(flag))
45
76
  throw new UsageError('Unknown or duplicate profile option');
46
77
  const value = args[++i];
47
78
  if (!value || value.startsWith('-'))
48
79
  throw new UsageError('Profile option requires a value');
49
80
  values.set(flag, value);
50
81
  }
51
- const provider = values.get('--provider');
52
- if (provider !== 'codex' && provider !== 'claude' && provider !== 'grok')
53
- throw new UsageError('Expected codex, claude or grok provider');
54
82
  const path = (flag) => {
55
83
  const value = values.get(flag);
56
84
  if (!value || !isAbsolute(value) || resolve(value) !== value || parsePath(value).root === value) {
@@ -58,28 +86,74 @@ function parse(args) {
58
86
  }
59
87
  return value;
60
88
  };
61
- return { help: false, json, provider, directory: path('--directory'), executable: path('--executable') };
89
+ if (subcommand === 'repin')
90
+ return { help: false, subcommand, json, dryRun, directory: path('--directory'), executable: path('--executable') };
91
+ const provider = values.get('--provider');
92
+ if (provider !== 'codex' && provider !== 'claude' && provider !== 'grok')
93
+ throw new UsageError('Expected codex, claude or grok provider');
94
+ return { help: false, subcommand, json, provider, directory: path('--directory'), executable: path('--executable') };
95
+ }
96
+ const quote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
97
+ async function prepare(options) {
98
+ const { prepareResourceNativeProfile } = await import('../core/resources/native-profile.js');
99
+ const report = prepareResourceNativeProfile({ provider: options.provider, directory: options.directory, executable: options.executable });
100
+ console.log(options.json ? JSON.stringify(report, null, 2) : [
101
+ `Native profile · ${report.provider} · prepared · authentication not checked`,
102
+ `Directory: ${report.directory}`, `Command file: ${report.commandPath}`,
103
+ `Separate interactive sign-in: ${report.loginCommand.map(quote).join(' ')}`,
104
+ 'No login was executed. Verify native account, billing route and quota before enrolling capacity.',
105
+ ].join('\n'));
106
+ }
107
+ async function repin(options) {
108
+ const { repinResourceNativeProfile, ResourceNativeProfileRepinError } = await import('../core/resources/native-profile.js');
109
+ let report;
110
+ try {
111
+ report = repinResourceNativeProfile({ directory: options.directory, executable: options.executable, dryRun: options.dryRun });
112
+ }
113
+ catch (error) {
114
+ throw new RepinFailure(error instanceof ResourceNativeProfileRepinError ? error.message : REPIN_UNAVAILABLE);
115
+ }
116
+ if (options.json) {
117
+ console.log(JSON.stringify(report, null, 2));
118
+ return;
119
+ }
120
+ const heading = report.status === 'repinned' ? (report.resumed ? 'repinned (finished an interrupted repin)' : 'repinned')
121
+ : report.status === 'would-repin' ? (report.resumed ? 'dry run · would finish an interrupted repin' : 'dry run · would repin')
122
+ : 'already pinned · nothing written';
123
+ const lines = [`Native profile · ${report.provider} · ${heading} · authentication not checked`, `Directory: ${report.directory}`];
124
+ if (report.status === 'unchanged')
125
+ lines.push(`Executable: ${report.executable}`);
126
+ else
127
+ lines.push(`Executable: ${report.previousExecutable} -> ${report.executable}`);
128
+ if (report.backups) {
129
+ lines.push(`Previous files kept: ${[report.backups.launcherPath, report.backups.manifestPath, report.backups.commandPath].map(quote).join(' ')}`);
130
+ lines.push('Sessions already running keep the binary they started with; the next launch through this profile uses the new one.');
131
+ }
132
+ if (report.status === 'would-repin')
133
+ lines.push('Nothing was written.');
134
+ lines.push(`Nothing was executed. Check the new binary with: ashlr resources launcher check --provider ${report.provider} --command ${quote(report.commandPath)} --cwd <private dir>`);
135
+ console.log(lines.join('\n'));
62
136
  }
63
137
  export async function cmdResourceProfile(args) {
138
+ let subcommand = null;
64
139
  try {
65
140
  const options = parse(args);
66
141
  if (options.help) {
67
142
  console.log(USAGE);
68
143
  return 0;
69
144
  }
70
- const { prepareResourceNativeProfile } = await import('../core/resources/native-profile.js');
71
- const report = prepareResourceNativeProfile({ provider: options.provider, directory: options.directory, executable: options.executable });
72
- const quote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
73
- console.log(options.json ? JSON.stringify(report, null, 2) : [
74
- `Native profile · ${report.provider} · prepared · authentication not checked`,
75
- `Directory: ${report.directory}`, `Command file: ${report.commandPath}`,
76
- `Separate interactive sign-in: ${report.loginCommand.map(quote).join(' ')}`,
77
- 'No login was executed. Verify native account, billing route and quota before enrolling capacity.',
78
- ].join('\n'));
145
+ subcommand = options.subcommand;
146
+ if (options.subcommand === 'repin')
147
+ await repin(options);
148
+ else
149
+ await prepare(options);
79
150
  return 0;
80
151
  }
81
152
  catch (error) {
82
- const message = error instanceof UsageError ? error.message : 'Native profile preparation unavailable; inspect the selected target for partial files';
153
+ // Repin failures carry fixed, path-free text that says whether the profile
154
+ // changed; anything else (and every prepare failure) stays generic.
155
+ const message = error instanceof UsageError || error instanceof RepinFailure ? error.message
156
+ : subcommand === 'repin' ? REPIN_UNAVAILABLE : 'Native profile preparation unavailable; inspect the selected target for partial files';
83
157
  if (args.includes('--json'))
84
158
  console.log(JSON.stringify({ error: message }));
85
159
  else
@@ -1 +1 @@
1
- {"version":3,"file":"resource-profile.js","sourceRoot":"","sources":["../../src/cli/resource-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;CAoBb,CAAC;AACF,MAAM,UAAW,SAAQ,KAAK;CAAG;AAEjC,SAAS,KAAK,CAAC,IAAc;IAC3B,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI;QACjG,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAC3G,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI;QAAE,MAAM,IAAI,UAAU,CAAC,2BAA2B,CAAC,CAAC;IACpG,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC;QAAE,OAAO,EAAE,IAAI,EA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CAAC,IAAI,CAAC,CAAC;QAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAChF,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QAChC,IAAI,OAAO,CAAC,UAAU,KAAK,OAAO;YAAE,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;;YAAM,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QACtF,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,2EAA2E;QAC3E,oEAAoE;QACpE,MAAM,OAAO,GAAG,KAAK,YAAY,UAAU,IAAI,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO;YAC1F,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,uFAAuF,CAAC;QACzI,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;;YAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1G,OAAO,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -11,4 +11,23 @@ export declare function parseClaudeNativeUsage(raw: string): ResourceConnectionQ
11
11
  * Claude 2.1.257 may silently seed /usage from cached headers; observedAt is the
12
12
  * collection time, NOT quota freshness. These windows must never feed admission.
13
13
  */
14
+ /**
15
+ * Claude Code builds whose `-p /usage` is VERIFIED to be a local command that
16
+ * never reaches a model, and whose output `parseClaudeNativeUsage` reads.
17
+ *
18
+ * Any other version still fails closed: an unknown build could route the slash
19
+ * command to inference. Add a version ONLY after repeating BOTH checks:
20
+ * 1. the binary's command table defines `name:"usage"` as `type:"local"` with
21
+ * `supportsNonInteractive:!0` (grep `strings <binary>`), and
22
+ * 2. one live `-p /usage` run reports `num_turns: 0` and `total_cost_usd: 0`
23
+ * and parses to windows.
24
+ *
25
+ * 2.1.257 — the original pin.
26
+ * 2.1.280 — verified 2026-09-24: identical local definition in the binary; a
27
+ * live run returned num_turns 0, total_cost_usd 0 and three windows
28
+ * (five_hour, seven_day, seven_day_fable). Needed because Opus 5.5
29
+ * (`claude-opus-5-5`) exists only from 2.1.280, so seats re-pinned
30
+ * for it would otherwise lose their usage meter.
31
+ */
32
+ export declare const CLAUDE_USAGE_VERIFIED_VERSIONS: readonly string[];
14
33
  export declare function probeClaudeAccountUsage(options: ClaudeAccountStatusOptions): Promise<ClaudeAccountUsageResult>;
@@ -61,6 +61,25 @@ export function parseClaudeNativeUsage(raw) {
61
61
  * Claude 2.1.257 may silently seed /usage from cached headers; observedAt is the
62
62
  * collection time, NOT quota freshness. These windows must never feed admission.
63
63
  */
64
+ /**
65
+ * Claude Code builds whose `-p /usage` is VERIFIED to be a local command that
66
+ * never reaches a model, and whose output `parseClaudeNativeUsage` reads.
67
+ *
68
+ * Any other version still fails closed: an unknown build could route the slash
69
+ * command to inference. Add a version ONLY after repeating BOTH checks:
70
+ * 1. the binary's command table defines `name:"usage"` as `type:"local"` with
71
+ * `supportsNonInteractive:!0` (grep `strings <binary>`), and
72
+ * 2. one live `-p /usage` run reports `num_turns: 0` and `total_cost_usd: 0`
73
+ * and parses to windows.
74
+ *
75
+ * 2.1.257 — the original pin.
76
+ * 2.1.280 — verified 2026-09-24: identical local definition in the binary; a
77
+ * live run returned num_turns 0, total_cost_usd 0 and three windows
78
+ * (five_hour, seven_day, seven_day_fable). Needed because Opus 5.5
79
+ * (`claude-opus-5-5`) exists only from 2.1.280, so seats re-pinned
80
+ * for it would otherwise lose their usage meter.
81
+ */
82
+ export const CLAUDE_USAGE_VERIFIED_VERSIONS = ['2.1.257', '2.1.280'];
64
83
  export async function probeClaudeAccountUsage(options) {
65
84
  const pinned = validateClaudeAccountStatusOptions(options);
66
85
  const started = performance.now();
@@ -104,8 +123,10 @@ export async function probeClaudeAccountUsage(options) {
104
123
  return value.stdout;
105
124
  };
106
125
  // Unknown versions never receive a slash command: its fallback could be inference.
107
- if ((await run(['--version'])).trim() !== '2.1.257 (Claude Code)')
126
+ const reported = (await run(['--version'])).trim();
127
+ if (!CLAUDE_USAGE_VERIFIED_VERSIONS.some((version) => reported === `${version} (Claude Code)`)) {
108
128
  return report('usage-version-unsupported');
129
+ }
109
130
  const raw = await run(['--safe-mode', '--restricted', '--tools', '', '--strict-mcp-config', '--mcp-config',
110
131
  '{"mcpServers":{}}', '--no-chrome', '--no-session-persistence', '--output-format', 'json', '-p', '/usage']);
111
132
  const windows = parseClaudeNativeUsage(raw);
@@ -1 +1 @@
1
- {"version":3,"file":"claude-account-usage.js","sourceRoot":"","sources":["../../../src/core/resources/claude-account-usage.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,kCAAkC,EACF,MAAM,4BAA4B,CAAC;AAEtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKhD,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC;AAC7B,MAAM,KAAK,GAAG,2EAA2E,CAAC;AAC1F,MAAM,MAAM,GAA2B;IACrC,iBAAiB,EAAE,WAAW,EAAE,2BAA2B,EAAE,WAAW;IACxE,4BAA4B,EAAE,kBAAkB,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AM,CAAC,SAAS,EAAE,CAAC;QAC/F,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC,gBAAgB,KAAK,MAAM,CAAC,gBAAgB;YACjH,KAAK,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW;YAAE,OAAO,MAAM,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QAC7F,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO;YAAE,OAAO,MAAM,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,SAAS,EAAE;YAAE,OAAO,MAAM,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QACjE,OAAO,MAAM,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,2BAA2B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;YAAE,OAAO,KAA4C,CAAC;QACtJ,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC;IACvI,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,IAAI,gBAAgB,EAAE,CAAC;YAAC,IAAI,CAAC;gBAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,wCAAwC,CAAC,CAAC;QAAC,CAAC;IACrH,CAAC;AACH,CAAC"}
@@ -21,9 +21,65 @@ export interface ResourceNativeProfile {
21
21
  command: string[];
22
22
  loginCommand: string[];
23
23
  }
24
+ /**
25
+ * Key order of profile.json, exactly as `prepareResourceNativeProfile` builds it.
26
+ * Exported so a test can pin prepare's output to it: repin refuses any other
27
+ * shape, so the two must never drift apart silently.
28
+ */
29
+ export declare const RESOURCE_NATIVE_PROFILE_MANIFEST_KEYS: readonly ["schemaVersion", "scope", "status", "authentication", "provider", "directory", "executable", "nodeExecutable", "commandPath", "launcherPath", "nativeStatePath", "anthropicStatePath", "manifestPath", "command", "loginCommand"];
24
30
  /**
25
31
  * Exclusive private leaf only. Existing paths are never reused, removed, repaired
26
32
  * or overwritten. A failed write may leave a partial directory for inspection.
27
33
  * Native login remains a separate operation through the generated command.
28
34
  */
29
35
  export declare function prepareResourceNativeProfile(options: ResourceNativeProfileOptions): ResourceNativeProfile;
36
+ export interface ResourceNativeProfileRepinOptions {
37
+ directory: string;
38
+ executable: string;
39
+ /** Validate everything and report what would change; write nothing. */
40
+ dryRun?: boolean;
41
+ }
42
+ export interface ResourceNativeProfileRepin {
43
+ schemaVersion: 1;
44
+ scope: 'native-profile-repin';
45
+ /**
46
+ * `repinned` — launcher.mjs and profile.json now name `executable`.
47
+ * `unchanged` — both already named `executable`; nothing was written.
48
+ * `would-repin` — dry run: every check passed; nothing was written.
49
+ */
50
+ status: 'repinned' | 'unchanged' | 'would-repin';
51
+ authentication: 'not-checked';
52
+ provider: ResourceNativeProfileProvider;
53
+ directory: string;
54
+ previousExecutable: string;
55
+ executable: string;
56
+ launcherPath: string;
57
+ manifestPath: string;
58
+ commandPath: string;
59
+ /** The `*.prev` copies of the three files as they stood before this repin; null when nothing was repinned. */
60
+ backups: {
61
+ launcherPath: string;
62
+ manifestPath: string;
63
+ commandPath: string;
64
+ } | null;
65
+ /** True when this call finished (or, dry, would finish) a repin interrupted between its launcher and profile.json publishes. */
66
+ resumed: boolean;
67
+ }
68
+ /**
69
+ * - `invalid` — options, executable, runtime, private directories or file modes failed validation. Nothing written.
70
+ * - `inconsistent` — the files are not an unmodified prepared profile, or disagree with each other. Nothing written.
71
+ * - `failed-unchanged` — a write failed before launcher.mjs changed; the profile still runs its previous executable.
72
+ * - `failed-partial` — launcher.mjs changed but the rest did not complete; rerun the same repin, or restore `*.prev`.
73
+ */
74
+ export type ResourceNativeProfileRepinFailure = 'invalid' | 'inconsistent' | 'failed-unchanged' | 'failed-partial';
75
+ export declare class ResourceNativeProfileRepinError extends Error {
76
+ readonly failure: ResourceNativeProfileRepinFailure;
77
+ constructor(failure: ResourceNativeProfileRepinFailure);
78
+ }
79
+ /**
80
+ * Re-pin one existing prepared profile to a different native executable.
81
+ * Rewrites only the executable locator (see the section comment above);
82
+ * idempotent when already pinned; resumes its own interrupted run; never
83
+ * executes anything and never reads native state or credentials.
84
+ */
85
+ export declare function repinResourceNativeProfile(options: ResourceNativeProfileRepinOptions): ResourceNativeProfileRepin;