@treeseed/dsh-chapters 0.1.23 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/cordis.patch.yml +54 -1
- package/docs/architecture.md +1 -466
- package/docs/backlog.md +234 -4
- package/docs/contract.md +127 -1
- package/docs/development.md +248 -12
- package/docs/host-compaction-seam.md +108 -0
- package/docs/knowledge-repo.md +532 -16
- package/docs/project-state.md +323 -0
- package/docs/verify.md +217 -0
- package/lib/archive.d.ts +49 -1
- package/lib/archive.js +56 -2
- package/lib/archive.js.map +1 -1
- package/lib/arrival.js +24 -10
- package/lib/arrival.js.map +1 -1
- package/lib/attach.d.ts +46 -0
- package/lib/attach.js +120 -0
- package/lib/attach.js.map +1 -0
- package/lib/auto-save.d.ts +145 -0
- package/lib/auto-save.js +318 -0
- package/lib/auto-save.js.map +1 -0
- package/lib/client.js +413 -11
- package/lib/client.js.map +1 -1
- package/lib/commands.d.ts +11 -1
- package/lib/commands.js +138 -7
- package/lib/commands.js.map +1 -1
- package/lib/compose.js +25 -6
- package/lib/compose.js.map +1 -1
- package/lib/continue-core.d.ts +24 -1
- package/lib/continue-core.js +41 -9
- package/lib/continue-core.js.map +1 -1
- package/lib/diag.d.ts +47 -0
- package/lib/diag.js +141 -0
- package/lib/diag.js.map +1 -0
- package/lib/engine-core.d.ts +51 -1
- package/lib/engine-core.js +70 -7
- package/lib/engine-core.js.map +1 -1
- package/lib/engine.d.ts +93 -0
- package/lib/engine.js +477 -36
- package/lib/engine.js.map +1 -1
- package/lib/enrich-queue.js +28 -2
- package/lib/enrich-queue.js.map +1 -1
- package/lib/enrich-wire.d.ts +92 -2
- package/lib/enrich-wire.js +135 -17
- package/lib/enrich-wire.js.map +1 -1
- package/lib/enrich.d.ts +27 -2
- package/lib/enrich.js +114 -18
- package/lib/enrich.js.map +1 -1
- package/lib/index.d.ts +59 -0
- package/lib/index.js +215 -2
- package/lib/index.js.map +1 -1
- package/lib/indexing.d.ts +7 -0
- package/lib/indexing.js.map +1 -1
- package/lib/injections.d.ts +1 -0
- package/lib/injections.js +38 -0
- package/lib/injections.js.map +1 -1
- package/lib/last-resort.d.ts +24 -0
- package/lib/last-resort.js +27 -0
- package/lib/last-resort.js.map +1 -0
- package/lib/prompt.d.ts +130 -0
- package/lib/prompt.js +255 -0
- package/lib/prompt.js.map +1 -0
- package/lib/registry.d.ts +39 -1
- package/lib/registry.js +76 -9
- package/lib/registry.js.map +1 -1
- package/lib/render.d.ts +31 -3
- package/lib/render.js +82 -3
- package/lib/render.js.map +1 -1
- package/lib/repair-run.d.ts +49 -0
- package/lib/repair-run.js +423 -0
- package/lib/repair-run.js.map +1 -0
- package/lib/repair.d.ts +200 -0
- package/lib/repair.js +354 -0
- package/lib/repair.js.map +1 -0
- package/lib/rules-commands.d.ts +22 -0
- package/lib/rules-commands.js +177 -20
- package/lib/rules-commands.js.map +1 -1
- package/lib/rules.d.ts +184 -7
- package/lib/rules.js +312 -27
- package/lib/rules.js.map +1 -1
- package/lib/save-core.d.ts +72 -0
- package/lib/save-core.js +220 -0
- package/lib/save-core.js.map +1 -0
- package/lib/session-rules.d.ts +222 -0
- package/lib/session-rules.js +454 -0
- package/lib/session-rules.js.map +1 -0
- package/lib/store.d.ts +22 -1
- package/lib/store.js +94 -17
- package/lib/store.js.map +1 -1
- package/lib/sync.js +13 -1
- package/lib/sync.js.map +1 -1
- package/lib/tools.d.ts +14 -0
- package/lib/tools.js +341 -91
- package/lib/tools.js.map +1 -1
- package/lib/types.d.ts +31 -1
- package/lib/types.js +12 -0
- package/lib/types.js.map +1 -1
- package/lib/version.d.ts +9 -0
- package/lib/version.js +10 -0
- package/lib/version.js.map +1 -0
- package/lib/warnings.d.ts +10 -0
- package/lib/warnings.js +18 -0
- package/lib/warnings.js.map +1 -0
- package/package.json +9 -3
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["useState","useRef","useCallback","h","Tooltip"],"sources":["../src/client/doors.ts","../src/client/index.ts"],"sourcesContent":["/**\n * The client door runner: the two deterministic archive doors, executed over\n * `remote.commands` and followed by a SWITCH to the fresh child.\n *\n * ONE runner, two rows. The server side keeps the same discipline — both doors\n * come from `deterministicCommand(door)` in src/tools.ts, and a unit row pins\n * that they archive identically. Copy-pasting this body is how the two would\n * drift apart, so there is exactly one implementation and a table of rows.\n *\n * `chapters-continue` ships only as a composer command; without a button here\n * the child is created correctly and the UI shows nothing, which reads as\n * \"nothing happened\". The row is the missing affordance, not new logic.\n *\n * React-free on purpose: the primitives package pulls CSS modules the node\n * test runner cannot load, so the testable half lives here and index.ts is the\n * thin chrome that renders these rows as buttons (tests/unit/client-doors.test.ts).\n *\n * @module dsh-chapters/src/client/doors\n */\n\n/** Structural slice of the aggregated remote service (@deepseek-ai/dsh-api-remotes).\n * `remote.commands` must ALSO appear in inject — the federation gates each\n * sub-service individually (the live feedback package declares\n * remote.messageFeedback beside remote for exactly this reason). */\nexport interface ClientRemote {\n commands?: {\n execute(sessionId: string, line: string, attachments: readonly unknown[]): Promise<{\n ok?: boolean\n value?: { commandId?: string; result?: { kind?: string; text?: string } }\n error?: { code?: string; message?: string }\n }>\n }\n}\n\n/** The client sessions service (dsh-client-runtime): open() lives on the\n * prototype; everything else on the surface stays untrusted and unused. */\nexport interface ClientSessions {\n open(sessionId: string): unknown\n}\n\nexport interface DoorResult {\n ok: boolean\n message: string\n}\n\n/**\n * One assistant-action row. `noun` is the server's own word for the child in\n * its success text (`branch` / `continuation`), so the fallback wording and the\n * title regex both track the door without a second implementation.\n */\nexport interface DoorAction {\n /** The slot registration id. */\n id: string\n /** Position in the assistant action row. */\n order: number\n /** Button + tooltip label, and the accessible name the e2e specs select on. */\n label: string\n /** The host command this row executes — the ONLY semantic difference at runtime. */\n command: string\n /** The noun in `${noun} “title” is session ch-…`. */\n noun: string\n /** The row's glyph (16×16 viewBox, single path). */\n iconPath: string\n}\n\nexport const DOOR_ACTIONS: readonly DoorAction[] = [\n {\n id: 'chapters-fork',\n order: 30,\n label: 'Fork with chapters',\n command: '/chapters-fork',\n noun: 'branch',\n iconPath: 'M5 3.25a2.25 2.25 0 1 0-1.5 2.12v5.26a2.25 2.25 0 1 0 1.5 0V9h5a2.25 2.25 0 0 0 2.25-2.25v-1.4a2.25 2.25 0 1 0-1.5 0v1.4A.75.75 0 0 1 10 7.5H5V5.37A2.25 2.25 0 0 0 5 3.25Z',\n },\n {\n id: 'chapters-continue',\n order: 31,\n label: 'Continue with chapters',\n command: '/chapters-continue',\n noun: 'continuation',\n iconPath: 'M1 8a.75.75 0 0 1 0-1.5h9.44L7.72 3.28a.75.75 0 1 1 1.06-1.06l3.5 3.5.53.53-.53.53-3.5 3.5a.75.75 0 1 1-1.06-1.06L10.44 9.5H1Zm13-5.25v10.5a.75.75 0 0 1-1.5 0v-10.5a.75.75 0 0 1 1.5 0Z',\n },\n]\n\n/** Pull the child id out of either door's durable success text — both end in\n * `… is session ch-…` (src/tools.ts), so this regex is door-agnostic. */\nexport const CHILD_ID = /is session (ch-[\\w-]+)/\n\n/** The quoted title the door gave the child, matched by its OWN noun so a\n * refusal or an unrelated quote cannot pass for it. */\nexport const doorTitle = (noun: string): RegExp => new RegExp(`${noun} \\\\u201C([^\\\\u201D]+)\\\\u201D is session`)\n\nfunction openByService(sessions: ClientSessions | undefined, sessionId: string): Promise<boolean> {\n return (async () => {\n const svc = sessions as unknown as { open?: (id: string) => unknown; refresh?: () => unknown } | undefined\n if (typeof svc?.open !== 'function') return false\n try { await svc.refresh?.() } catch { /* refresh best-effort */ }\n // The store must know the session before open() resolves it; a child\n // created seconds ago is only server-known until refresh lands. Retry\n // open briefly across that window.\n const started = Date.now()\n for (;;) {\n try { svc.open(sessionId); return true } catch {\n if (Date.now() - started > 4_000) return false\n await new Promise((r) => setTimeout(r, 250))\n }\n }\n })()\n}\n\n/**\n * Fallback path: expand collapsed groups / show-more buttons, then click the\n * newest treeitem whose label contains the child title (newest-updated sorts\n * first, so the first match is the fresh child).\n */\nasync function openBranchRow(title: string, budgetMs = 4_000): Promise<boolean> {\n if (typeof document === 'undefined') return false\n const needle = title.toLowerCase()\n const tryClick = (): boolean => {\n const rows = Array.from(document.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'))\n const hit = rows.find((row) => (row.textContent ?? '').toLowerCase().includes(needle))\n if (hit === undefined) return false\n hit.click()\n return true\n }\n const clickMore = (): number => {\n const buttons = Array.from(document.querySelectorAll<HTMLElement>('button'))\n .filter((b) => /more sessions|ungrouped/i.test(b.textContent ?? '') && b.getAttribute('aria-expanded') !== 'true')\n for (const b of buttons) b.click()\n return buttons.length\n }\n const started = Date.now()\n let expansions = 0\n while (Date.now() - started < budgetMs) {\n if (tryClick()) return true\n if (expansions < 4 && clickMore() > 0) { expansions += 1; await new Promise((r) => setTimeout(r, 250)); continue }\n await new Promise((resolve) => setTimeout(resolve, 150))\n }\n return tryClick()\n}\n\nexport function makeDoorRunner(\n remote: ClientRemote,\n sessions: ClientSessions | undefined,\n door: DoorAction,\n): (sessionId: string) => Promise<DoorResult> {\n return async function run(sessionId: string): Promise<DoorResult> {\n try {\n if (remote.commands?.execute === undefined) return { ok: false, message: 'commands remote unavailable' }\n const res = await remote.commands.execute(sessionId, door.command, [])\n if (res.ok !== true) return { ok: false, message: (res.error?.message ?? `the ${door.noun} call failed`).slice(0, 90) }\n const result = res.value?.result\n const text = typeof result?.text === 'string' ? result.text : ''\n if (result?.kind !== 'success') return { ok: false, message: (text || `the ${door.noun} was refused — see the command result`).slice(0, 90) }\n const child = CHILD_ID.exec(text)?.[1]\n if (child === undefined) return { ok: true, message: `${door.noun} created — appearing in the sidebar` }\n const opened = await openByService(sessions, child)\n if (opened) return { ok: true, message: '' }\n const title = doorTitle(door.noun).exec(text)?.[1]\n if (title !== undefined && await openBranchRow(title)) return { ok: true, message: '' }\n return { ok: true, message: `${door.noun} created — open it in the sidebar` }\n } catch (error) {\n return { ok: false, message: String((error as Error)?.message ?? error).slice(0, 90) }\n }\n }\n}\n","/**\n * dsh-chapters client entry: the per-message door buttons.\n *\n * Registers the two deterministic archive doors into the assistant action row\n * (`conversation.chat.assistant-actions` — the slot the official feedback\n * package populates beside copy/branch). Clicking one executes its host\n * command — `/chapters-fork`, `/chapters-continue` — through `remote.commands`,\n * the exact wire the composer's input line rides, then SWITCHES the app to the\n * fresh child:\n *\n * 1. `sessions.open(child)` — the client sessions service carries open() on\n * its prototype (Playwright-verified against this host; a keys-dump alone\n * hid it, which is why an earlier round wrongly gave up on this path);\n * 2. fallback: click the child's sidebar row after expanding collapsed\n * groups (plugin children can render under collapsed 'Ungrouped' heads);\n * 3. last resort: an inline note — the child is durable either way.\n *\n * There is deliberately NO second implementation of door logic here: the\n * buttons are mouths for the host commands (watermark, segmentation, budget,\n * titles, refusal-with-numbers all server-side, all tested), and the runner\n * they share is `src/client/doors.ts` — one body, one row per door. The purity\n * gate in tsdown.client.config.ts keeps this file cross-plugin-free.\n *\n * @module dsh-chapters/src/client\n */\n\nimport { createElement as h, useCallback, useEffect, useRef, useState, type ReactElement } from 'react'\n// The host's own tooltip bubble — a platform module served by the loader table,\n// external like react. Every action in this row labels through it.\nimport { Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { DOOR_ACTIONS, makeDoorRunner, type ClientRemote, type ClientSessions, type DoorAction, type DoorResult } from './doors.ts'\n\ninterface ClientSlots {\n inject(name: string, factory: () => unknown): void\n register(registration: Record<string, unknown>, component: unknown): unknown\n}\n\ninterface Ctx {\n slots: ClientSlots\n get(name: string): unknown\n}\n\nexport const inject = ['slots', 'remote', 'remote.commands', 'sessions'] as const\n\n/** Props composed by the slot framework: owner (`messageId`) + our injected verb. */\ninterface DoorActionProps {\n messageId: string\n run: () => Promise<DoorResult>\n}\n\n/**\n * Style parity with the native IconActions row: rules copied verbatim from the\n * host's MessageIconActions module (`._xzv4MW_action` in dsh-client-ui-chat's\n * compiled client + the feedback package's :disabled) — same metrics, tokens,\n * hover. Update this string if the host restyles its action row. Both doors\n * share these metrics.\n *\n * The final rule hides the native branch action IN THE MESSAGE ROW only\n * (user-approved cosmetic decision, docs/architecture.md): built-in chrome, so\n * the selector is its accessible label scoped to action-row buttons; both\n * locale spellings covered. If the host rewords the label the button simply\n * reappears — fails open, visibly.\n */\nconst CSS = [\n '.dsh-chapters_forkAction{width:calc(28px + var(--dsh-content-font-delta,0px));height:calc(28px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}',\n '.dsh-chapters_forkAction svg{width:calc(15px + var(--dsh-content-font-delta,0px));height:calc(15px + var(--dsh-content-font-delta,0px))}',\n '.dsh-chapters_forkAction:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}',\n '.dsh-chapters_forkAction:disabled{cursor:default;opacity:.4}',\n '.dsh-chapters_forkNote{color:var(--dsw-alias-label-tertiary);padding-left:4px;font-size:13px;line-height:20px}',\n 'button[class*=\"_action\"][aria-label=\"Branch into a new conversation\"],button[class*=\"_action\"][aria-label=\"\\u5728\\u65b0\\u5bf9\\u8bdd\\u4e2d\\u5206\\u652f\"]{display:none !important}',\n].join('\\n')\nconst CSS_TAG_ID = 'dsh-chapters/assistant-action.css'\n\nfunction injectStyles(): void {\n try {\n if (typeof document === 'undefined' || document.querySelector(`style[data-plugin-css=${JSON.stringify(CSS_TAG_ID)}]`) !== null) return\n const tag = document.createElement('style')\n tag.dataset.plugin = 'dsh-chapters'\n tag.dataset.pluginCss = CSS_TAG_ID\n tag.textContent = CSS\n document.head.appendChild(tag)\n } catch { /* styling is cosmetic; the action still works without it */ }\n}\n\n/** One component body for every door row; only the label and glyph differ. */\nfunction makeDoorAction(door: DoorAction) {\n return function ChaptersDoorAction({ run }: DoorActionProps) {\n const [busy, setBusy] = useState(false)\n const [note, setNote] = useState<string | null>(null)\n const alive = useRef(true)\n useEffect(() => () => { alive.current = false }, [])\n const onClick = useCallback(() => {\n if (busy) return\n setBusy(true)\n setNote(null)\n void run().then((result) => {\n if (!alive.current) return\n setBusy(false)\n setNote(result.message === '' ? null : result.message)\n setTimeout(() => { if (alive.current) setNote(null) }, 8000)\n })\n }, [busy, run])\n const button = h('button', {\n type: 'button',\n 'aria-label': door.label,\n disabled: busy,\n onClick,\n className: 'dsh-chapters_forkAction',\n },\n h('svg', { viewBox: '0 0 16 16', width: '15', height: '15', fill: 'currentColor', 'aria-hidden': 'true' },\n h('path', { d: door.iconPath })))\n return h('span', { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' } },\n h(Tooltip, { label: door.label, side: 'bottom' as const, children: button as ReactElement<Record<string, unknown>> }),\n note !== null\n ? h('span', { className: 'dsh-chapters_forkNote' }, note)\n : null)\n }\n}\n\nexport function apply(ctx: Ctx): void {\n injectStyles()\n const slots = ctx.slots\n const remote = (ctx.get('remote') ?? {}) as ClientRemote\n let sessions: ClientSessions | undefined\n try { sessions = ctx.get('sessions') as ClientSessions | undefined } catch { sessions = undefined }\n // No early return on missing descriptors: the buttons register regardless\n // and the click reports the gap. A missing button is worse than a button\n // that explains itself. Components and runners are built ONCE here — slot\n // factories may re-run, and a fresh component identity per call would\n // remount the row.\n const rows = DOOR_ACTIONS.map((door) => ({ door, run: makeDoorRunner(remote, sessions, door), component: makeDoorAction(door) }))\n slots.inject('conversation.chat.assistant-actions', () => rows.map(({ door, run, component }) => slots.register({\n name: 'conversation.chat.assistant-actions',\n id: door.id,\n order: door.order,\n inject: (sessionId: string) => ({ run: () => run(sessionId) }),\n }, component)))\n}\n"],"mappings":";;;;;;;;;EAiEA,MAAa,eAAsC,CACjD;GACE,IAAI;GACJ,OAAO;GACP,OAAO;GACP,SAAS;GACT,MAAM;GACN,UAAU;EACZ,GACA;GACE,IAAI;GACJ,OAAO;GACP,OAAO;GACP,SAAS;GACT,MAAM;GACN,UAAU;EACZ,CACF;;;EAIA,MAAa,WAAW;;;EAIxB,MAAa,aAAa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A,cAAAA,CAAE,UAAU;KACzB,MAAM;KACN,cAAc,KAAK;KACnB,UAAU;KACV;KACA,WAAW;IACb,IAAA,GACEA,MAAAA,cAAAA,CAAE,OAAO;KAAE,SAAS;KAAa,OAAO;KAAM,QAAQ;KAAM,MAAM;KAAgB,eAAe;IAAO,IAAA,GACtGA,MAAAA,cAAAA,CAAE,QAAQ,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC;IACpC,QAAA,GAAOA,MAAAA,cAAAA,CAAE,QAAQ,EAAE,OAAO;KAAE,SAAS;KAAe,YAAY;KAAU,KAAK;IAAM,EAAE,IAAA,GACrFA,MAAAA,cAAAA,CAAEC,sCAAAA,SAAS;KAAE,OAAO,KAAK;KAAO,MAAM;KAAmB,UAAU;IAAgD,CAAC,GACpH,SAAS,QAAA,GACLD,MAAAA,cAAAA,CAAE,QAAQ,EAAE,WAAW,wBAAwB,GAAG,IAAI,IACtD,IAAI;GACZ;EACF;EAEA,SAAgB,MAAM,KAAgB;GACpC,aAAa;GACb,MAAM,QAAQ,IAAI;GAClB,MAAM,SAAU,IAAI,IAAI,QAAQ,KAAK,CAAC;GACtC,IAAI;GACJ,IAAI;IAAE,WAAW,IAAI,IAAI,UAAU;GAAgC,QAAQ;IAAE,WAAW,KAAA;GAAU;GAMlG,MAAM,OAAO,aAAa,KAAK,UAAU;IAAE;IAAM,KAAK,eAAe,QAAQ,UAAU,IAAI;IAAG,WAAW,eAAe,IAAI;GAAE,EAAE;GAChI,MAAM,OAAO,6CAA6C,KAAK,KAAK,EAAE,MAAM,KAAK,gBAAgB,MAAM,SAAS;IAC9G,MAAM;IACN,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,SAAS,eAAuB,EAAE,WAAW,IAAI,SAAS,EAAE;GAC9D,GAAG,SAAS,CAAC,CAAC;EAChB"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["useState","useRef","useCallback","h","Tooltip"],"sources":["../src/client/doors.ts","../src/client/prompt-ghost.ts","../src/client/index.ts"],"sourcesContent":["/**\n * The client door runner: the two deterministic archive doors, executed over\n * `remote.commands` and followed by a SWITCH to the fresh child.\n *\n * ONE runner, two rows. The server side keeps the same discipline — both doors\n * come from `deterministicCommand(door)` in src/tools.ts, and a unit row pins\n * that they archive identically. Copy-pasting this body is how the two would\n * drift apart, so there is exactly one implementation and a table of rows.\n *\n * `chapters-continue` ships only as a composer command; without a button here\n * the child is created correctly and the UI shows nothing, which reads as\n * \"nothing happened\". The row is the missing affordance, not new logic.\n *\n * React-free on purpose: the primitives package pulls CSS modules the node\n * test runner cannot load, so the testable half lives here and index.ts is the\n * thin chrome that renders these rows as buttons (tests/unit/client-doors.test.ts).\n *\n * @module dsh-chapters/src/client/doors\n */\n\n/** Structural slice of the aggregated remote service (@deepseek-ai/dsh-api-remotes).\n * `remote.commands` must ALSO appear in inject — the federation gates each\n * sub-service individually (the live feedback package declares\n * remote.messageFeedback beside remote for exactly this reason). */\nexport interface ClientRemote {\n commands?: {\n execute(sessionId: string, line: string, attachments: readonly unknown[]): Promise<{\n ok?: boolean\n value?: { commandId?: string; result?: { kind?: string; text?: string } }\n error?: { code?: string; message?: string }\n }>\n }\n}\n\n/** The client sessions service (dsh-client-runtime): open() lives on the\n * prototype; everything else on the surface stays untrusted and unused. */\nexport interface ClientSessions {\n open(sessionId: string): unknown\n}\n\nexport interface DoorResult {\n ok: boolean\n message: string\n}\n\n/**\n * One assistant-action row. `noun` is the server's own word for the child in\n * its success text (`branch` / `continuation`), so the fallback wording and the\n * title regex both track the door without a second implementation.\n */\nexport interface DoorAction {\n /** The slot registration id. */\n id: string\n /** Position in the assistant action row. */\n order: number\n /** Button + tooltip label, and the accessible name the e2e specs select on. */\n label: string\n /** The host command this row executes — the ONLY semantic difference at runtime. */\n command: string\n /** The noun in `${noun} “title” is session ch-…`. */\n noun: string\n /** The row's glyph (16×16 viewBox, single path). */\n iconPath: string\n}\n\nexport const DOOR_ACTIONS: readonly DoorAction[] = [\n {\n id: 'chapters-fork',\n order: 30,\n label: 'Fork with chapters',\n command: '/chapters-fork',\n noun: 'branch',\n iconPath: 'M5 3.25a2.25 2.25 0 1 0-1.5 2.12v5.26a2.25 2.25 0 1 0 1.5 0V9h5a2.25 2.25 0 0 0 2.25-2.25v-1.4a2.25 2.25 0 1 0-1.5 0v1.4A.75.75 0 0 1 10 7.5H5V5.37A2.25 2.25 0 0 0 5 3.25Z',\n },\n {\n id: 'chapters-continue',\n order: 31,\n label: 'Continue with chapters',\n command: '/chapters-continue',\n noun: 'continuation',\n iconPath: 'M1 8a.75.75 0 0 1 0-1.5h9.44L7.72 3.28a.75.75 0 1 1 1.06-1.06l3.5 3.5.53.53-.53.53-3.5 3.5a.75.75 0 1 1-1.06-1.06L10.44 9.5H1Zm13-5.25v10.5a.75.75 0 0 1-1.5 0v-10.5a.75.75 0 0 1 1.5 0Z',\n },\n]\n\n/** Pull the child id out of either door's durable success text — both end in\n * `… is session ch-…` (src/tools.ts), so this regex is door-agnostic. */\n/**\n * Which build of THIS file produced a door note (#77). When the live probe reported a roster\n * trace of `missing → missing → missing` — meaning adoption should have fired three times — while\n * showing no adoption outcome at all, the first question stopped being \"why did the client refuse\"\n * and became \"did the browser run the code I am reading?\". A note that names its own build makes\n * that a glance instead of an archaeology session into symlinked plugin trees.\n */\nexport const DOOR_BUILD = '2026-10-22T23:55 door-build-stamp'\n\nexport const CHILD_ID = /is session (ch-[\\w-]+)/\n\n/** The quoted title the door gave the child, matched by its OWN noun so a\n * refusal or an unrelated quote cannot pass for it. */\nexport const doorTitle = (noun: string): RegExp => new RegExp(`${noun} \\\\u201C([^\\\\u201D]+)\\\\u201D is session`)\n\n/**\n * A refusal reason that can never render as nothing. `String(err.message ?? err)` is `''` for a\n * host error built with an empty message, and an empty reason disappears from the note — the\n * reader then concludes \"no refusal happened\", which is the opposite of the truth (#77).\n */\nfunction refusalReason(error: unknown): string {\n const raw = error instanceof Error ? error.message : String(error)\n const trimmed = raw.trim()\n const named = trimmed === '' ? (error instanceof Error && error.name.trim() !== '' ? error.name : '') : trimmed\n const base = named === '' ? (error === null ? 'null thrown' : typeof error) : named\n return base.replace(/\\s+/g, ' ').slice(0, 90)\n}\n\n/**\n * Is the child in the client's OWN roster? This is the question that separates two very\n * different failures, and the door used to report the symptom without it:\n * - the client never learned the session exists (roster: missing) → the fix is server-side\n * publication, and no amount of clicking `open` will ever work;\n * - the client knows it and `open` still did nothing (roster: contains) → a navigation bug.\n * Measured host 0.2.0-rc.2: the sessions service exposes `projectList`, `refresh`, `retain`,\n * `handleSessionAdded` — the roster is a projection the client fills from control frames.\n */\n/**\n * The client's own session ids, or `null` when the store cannot be read. ONE reader for both\n * the note and the adoption decision, so the door never acts on a verdict it did not report.\n */\nfunction rosterIds(sessions: ClientSessions | undefined): Set<string> | null {\n const store = (sessions as unknown as { list?: { getSnapshot?: () => unknown } })?.list\n if (typeof store?.getSnapshot !== 'function') return null\n const snap = store.getSnapshot()\n const ids = new Set<string>()\n if (Array.isArray((snap as { ids?: unknown[] } | undefined)?.ids)) {\n for (const id of (snap as { ids: unknown[] }).ids) ids.add(String(id))\n } else if ((snap as { byId?: object } | undefined)?.byId !== undefined) {\n for (const k of Object.keys((snap as { byId: object }).byId)) ids.add(k)\n } else return null\n return ids\n}\n\nfunction rosterNote(sessions: ClientSessions | undefined, child: string): string {\n try {\n // The host's client store shape is `list.getSnapshot() → { ids, byId, phase }`.\n // `projectList()` turned out to be a MUTATOR that returns undefined (measured), so the first\n // version of this note printed \"0 sessions\" about a conversation that visibly had one — the\n // repo's own `listEvents` lesson (\"measure the SHAPE, not the presence\"), repeated by me in\n // the same week. Read the store; when it isn't reachable, presence is UNKNOWN and the note\n // says that rather than inventing an absence.\n const ids = rosterIds(sessions)\n if (ids === null) {\n const store = (sessions as unknown as { list?: { getSnapshot?: () => unknown } })?.list\n const shape = typeof store?.getSnapshot !== 'function' ? 'no list store on the service' : 'snapshot unreadable'\n return ` (roster: ${shape} — presence of ${child.slice(0, 11)}… is UNKNOWN, not absent)`\n }\n if (ids.size === 0) return ` (roster: empty — presence of ${child.slice(0, 11)}… is UNKNOWN, not absent)`\n const n = ids.size\n return ids.has(child)\n ? ` (roster: contains ${child.slice(0, 11)}…, ${String(n)} sessions — open() is the failure)`\n : ` (roster: MISSING, ${String(n)} sessions — the client never catalogued this session)`\n } catch { return '' }\n}\n\n/** The service's own method names, as a hint attached to a failure note (never a guess). */\nfunction verbsNote(sessions: ClientSessions | undefined): string {\n try {\n const svc = sessions as unknown as Record<string, unknown> | undefined\n if (svc === null || svc === undefined || typeof svc !== 'object') return ' (sessions service: absent)'\n // Measured: `Object.keys(svc)` returned NOTHING for the real service, because the host\n // puts its verbs on the PROTOTYPE (a class instance), not as own keys. A diagnostic that\n // reports \"no methods\" about a working service is worse than none — walk the chain.\n const found = new Set<string>()\n let node: unknown = svc\n // Stop at Object.prototype: its four legacy accessors are not service verbs, and listing\n // them pushed the real names past the cap on the first live run.\n for (let depth = 0; depth < 6 && node !== null && node !== undefined && node !== Object.prototype; depth++) {\n for (const key of Object.getOwnPropertyNames(node as object)) {\n if (key === 'constructor') continue\n try { if (typeof (svc as Record<string, unknown>)[key] === 'function') found.add(key) } catch { /* getter that throws — not a verb we can use either */ }\n }\n node = Object.getPrototypeOf(node)\n }\n const verbs = [...found].sort().slice(0, 24)\n return verbs.length === 0 ? ' (sessions service: no methods on the chain)' : ` (sessions verbs: ${verbs.join(', ')})`\n } catch { return ' (sessions service: unreadable)' }\n}\n\nfunction openByService(\n sessions: ClientSessions | undefined,\n sessionId: string,\n /** #77: adopt (and re-project) only when the client's own roster is missing this session.\n * `onAfter` reports the roster at the instant after adoption, before any later refresh can\n * discard the mutation — the difference between an ordering bug and a publication gap. */\n adopt?: { needed: boolean, onRefused: (reason: string) => void, onSubscribeRefused?: (reason: string) => void, onAfter: (seen: boolean | null) => void, onStep?: (step: string) => void },\n nav?: { openSession?: (id: string) => unknown },\n): Promise<boolean> {\n return (async () => {\n const svc = sessions as unknown as {\n open?: (id: string) => unknown; refresh?: () => unknown; projectList?: () => unknown\n create?: (opts: { sessionId?: string }) => unknown\n using?: (id: string, opts: { source: string }, fn: () => Promise<void>) => unknown\n } | undefined\n // #77, the actual root cause: `sessions.open` DOES NOT EXIST on this host. The sessions\n // service offers create/fork/using/retain/binding/refresh; the host's own fork button calls\n // `ctx.uiWorkspace.openSession(childId)` (`dsh-client-ui-chat/lib/client.js`). The line here\n // used to be `if (typeof svc?.open !== 'function') return false`, so every service attempt\n // since the door was written returned false on line one and the note blamed the client's\n // roster for a verb that was never there.\n if (svc === undefined) return false\n const navigate = typeof nav?.openSession === 'function'\n ? (id: string): unknown => nav.openSession!(id)\n : typeof svc?.open === 'function'\n ? (id: string): unknown => svc.open!(id)\n : null\n if (navigate === null) {\n adopt?.onStep?.('no-verb')\n return false\n }\n try { await svc.refresh?.() } catch { /* refresh best-effort */ }\n // #57: re-project the client's session catalog. The host does this ITSELF after every\n // create and fork — `dsh-api-session-controller/lib/client.js`, `create()` and `fork()`\n // both end in `this.projectList()` — because a session the client has never catalogued is\n // not addressable by `open()` no matter how often you call it. A plugin-created child is\n // exactly that case: durable, workspace-attached, absent from the client's roster. Measured\n // on 0.2.0-rc.2: without this the door created the child, `open` resolved, and the app\n // stayed on the parent (the door's own note now says `roster: …` so this is never a guess).\n try { svc.projectList?.() } catch { /* best-effort, like refresh */ }\n // #77: adopt-and-catalogue. `manager.create()` is documented \"on success merge into\n // summaries immediately (no wait for the next refresh)\" and forwards a caller-owned\n // `sessionId`, while the server ADOPTS a persisted id instead of authoring a second session\n // (`create(request)` → `ensureSession(sessionId, cwd, request.sessionId !== undefined, …)`).\n // Nothing about the child's content is authored here — the seed notice was committed\n // host-plane long before this call — this only lets the client see what the host already\n // knows. A refusal is reported to the caller, never swallowed.\n if (adopt?.needed === true && typeof svc.create === 'function') {\n // the block narrates itself: entry first, then whichever way it left. The live note once\n // said \"try\" from the runner and showed nothing downstream — with this line, an absent\n // `enter-create` IS the answer instead of a mystery.\n adopt.onStep?.('enter-create')\n try {\n await svc.create({ sessionId })\n adopt.onStep?.('settle-create')\n try { svc.projectList?.() } catch { /* re-project again, now that a mutation exists */ }\n // the momentary read is the whole point: a later `refreshList()` reassigns the manager's\n // mutations from the server result, so an adoption that DID land is invisible by the time\n // the last attempt fails. Report what was true at the instant it mattered.\n const after = rosterIds(sessions)\n adopt.onAfter?.(after === null ? null : after.has(sessionId))\n } catch (error) {\n adopt.onStep?.('refuse-create')\n adopt.onRefused(refusalReason(error))\n }\n }\n // #77, second candidate: if adoption left the child out of the roster, SUBSCRIBE to it.\n // `using(target, {source}, fn)` is the host's own way to address a session that is not\n // currently displayed (`sessions/service.js`: retain → `manager.get(id).open()`). A refusal is\n // reported exactly like adoption's. No URL route exists as an alternative — checked every\n // dsh-client-* bundle: the only `/session/` strings are resource addresses for files.\n if (adopt?.needed === true && typeof svc.using === 'function' && rosterIds(sessions)?.has(sessionId) === false) {\n adopt.onStep?.('enter-using')\n try {\n await svc.using(sessionId, { source: 'dsh-chapters-door' }, async () => undefined)\n adopt.onStep?.('settle-using')\n try { svc.projectList?.() } catch { /* best-effort, like the others */ }\n const seen = rosterIds(sessions)\n adopt.onAfter?.(seen === null ? null : seen.has(sessionId))\n } catch (error) {\n adopt.onStep?.('refuse-using')\n adopt.onSubscribeRefused?.(refusalReason(error))\n }\n }\n // The store must know the session before open() resolves it; a child\n // created seconds ago is only server-known until refresh lands. Retry\n // open briefly across that window.\n const started = Date.now()\n for (;;) {\n try { navigate(sessionId); return true } catch {\n if (Date.now() - started > 4_000) return false\n await new Promise((r) => setTimeout(r, 250))\n }\n }\n })()\n}\n\n/**\n * Fallback path: expand collapsed groups / show-more buttons, then click the\n * newest treeitem whose label contains the child title (newest-updated sorts\n * first, so the first match is the fresh child).\n */\nasync function openBranchRow(title: string, budgetMs = 4_000): Promise<boolean> {\n if (typeof document === 'undefined') return false\n const needle = title.toLowerCase()\n const tryClick = (): boolean => {\n const rows = Array.from(document.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'))\n const hit = rows.find((row) => (row.textContent ?? '').toLowerCase().includes(needle))\n if (hit === undefined) return false\n hit.click()\n return true\n }\n const clickMore = (): number => {\n const buttons = Array.from(document.querySelectorAll<HTMLElement>('button'))\n .filter((b) => /more sessions|ungrouped/i.test(b.textContent ?? '') && b.getAttribute('aria-expanded') !== 'true')\n for (const b of buttons) b.click()\n return buttons.length\n }\n const started = Date.now()\n let expansions = 0\n while (Date.now() - started < budgetMs) {\n if (tryClick()) return true\n if (expansions < 4 && clickMore() > 0) { expansions += 1; await new Promise((r) => setTimeout(r, 250)); continue }\n await new Promise((resolve) => setTimeout(resolve, 150))\n }\n return tryClick()\n}\n\nexport function makeDoorRunner(\n remote: ClientRemote,\n sessions: ClientSessions | undefined,\n door: DoorAction,\n /**\n * \"Is THIS session the one the client is now showing?\" #54: `sessions.open()` returns\n * void, so a call that resolves proves the request was accepted, not that the app\n * switched. Measured on host 0.2.0-rc.2: no note element (open resolved), yet\n * `dsh.sessions.current` still named the parent and the child was absent from the\n * sidebar after a full reload — the user got silence and a missing session. Absent\n * (a client that cannot answer) the runner keeps the old behavior, and the wiring is\n * pinned by a row so production can never quietly drop it.\n */\n verifySwitched?: (childSessionId: string) => Promise<boolean>,\n /**\n * #77: how many times to re-pull the client's list, re-project and re-open. The session\n * manager documents `refreshList()` as \"single-flight within one Host generation\"\n * (`dsh-api-session-controller/lib/types/client/sessions/manager.js`), so a pull issued while\n * another is in flight can resolve from the STALE result — precisely the moment a session\n * created microseconds ago is missing. Retrying is both the fix candidate and the measurement:\n * which attempt lands tells us whether this is ordering (ours) or silence (host-side).\n * A client with no `refresh` verb gets exactly ONE attempt — re-asking `open` against a roster\n * we cannot re-pull would be theater.\n */\n opts?: { attempts?: number, attemptPauseMs?: number, navigator?: { openSession?: (id: string) => unknown } },\n): (sessionId: string) => Promise<DoorResult> {\n return async function run(sessionId: string): Promise<DoorResult> {\n try {\n if (remote.commands?.execute === undefined) return { ok: false, message: 'commands remote unavailable' }\n const res = await remote.commands.execute(sessionId, door.command, [])\n if (res.ok !== true) return { ok: false, message: (res.error?.message ?? `the ${door.noun} call failed`).slice(0, 90) }\n const result = res.value?.result\n const text = typeof result?.text === 'string' ? result.text : ''\n if (result?.kind !== 'success') return { ok: false, message: (text || `the ${door.noun} was refused — see the command result`).slice(0, 90) }\n const child = CHILD_ID.exec(text)?.[1]\n if (child === undefined) return { ok: true, message: `${door.noun} created — appearing in the sidebar` }\n const switchedOnce = async (): Promise<boolean> => {\n if (verifySwitched === undefined) return true\n try { return await verifySwitched(child) } catch { return false }\n }\n const canRepull = typeof (sessions as unknown as { refresh?: unknown } | undefined)?.refresh === 'function'\n const maxAttempts = canRepull ? (opts?.attempts ?? 3) : 1\n let tried = 0\n let adoptRefusal = ''\n let subscribeRefusal = ''\n // #77: what the roster reader answered AT EACH DECISION, not only at the end. The live\n // probe reported MISSING after three attempts while neither candidate fired, which can\n // only mean the reader disagreed with itself over time — and a note that says one number\n // cannot show that.\n const rosterTrace: string[] = []\n const steps: string[] = []\n let adoptSaw: boolean | null | undefined\n for (let i = 0; i < maxAttempts; i++) {\n tried += 1\n // decide adoption from the SAME reader the note reports, so the door never acts on a\n // verdict it did not tell the user about; an unreadable roster is not \"missing\"\n const ids = rosterIds(sessions)\n // Loaded-but-empty is a DECISION (the child is not there → try the sanctioned paths);\n // unreadable is UNKNOWN and must not invent a session (#77: the strict form here meant\n // neither candidate ever ran in the live probe, and its silence looked like a result).\n const needed = ids !== null && !ids.has(child)\n // `+c` / `+u` = the candidate verbs are present on the injected service AT THAT MOMENT.\n // Without this, a note that says the roster was missing while no adoption outcome appears\n // is uninterpretable: either the code never ran, or the service has no create to call.\n const svcShape = sessions as unknown as { create?: unknown, using?: unknown, open?: unknown } | undefined\n // +c create, +u using, +o sessions.open, +w workspace navigator — the exact predicates\n // the door branches on, so a note can be read instead of re-derived from source\n rosterTrace.push(`${ids === null ? 'unknown' : ids.size === 0 ? 'empty' : ids.has(child) ? 'has' : 'missing'}${typeof svcShape?.create === 'function' ? '+c' : '-c'}${typeof svcShape?.using === 'function' ? '+u' : '-u'}${typeof svcShape?.open === 'function' ? '+o' : '-o'}${typeof opts?.navigator?.openSession === 'function' ? '+w' : '-w'}`)\n if (await openByService(sessions, child, {\n needed,\n onRefused: (reason) => { adoptRefusal = reason },\n onSubscribeRefused: (reason) => { subscribeRefusal = reason },\n onAfter: (seen) => { adoptSaw = seen },\n onStep: (step) => { if (!steps.includes(step)) steps.push(step) },\n }, opts?.navigator) && await switchedOnce()) return { ok: true, message: '' }\n if (i + 1 < maxAttempts) await new Promise((r) => { setTimeout(r, opts?.attemptPauseMs ?? 300).unref?.() })\n }\n // the service path did not take — the sidebar row is the same affordance a human uses\n const title = doorTitle(door.noun).exec(text)?.[1]\n if (title !== undefined && await openBranchRow(title) && await switchedOnce()) return { ok: true, message: '' }\n // #54: a child that is created but not shown is a DIFFERENT fact from one the user\n // has to open by hand, and the message must not blur them.\n // #56/#57: the note must be ACTIONABLE. \"the app did not switch\" is true and useless;\n // naming the verbs the injected service actually exposes turns one failure into the\n // diagnosis (is there a refresh/reload to call, or is `open` the only verb and the\n // omission server-side?). A detected failure that isn't delivered is the same bug.\n return verifySwitched === undefined\n ? { ok: true, message: `${door.noun} created — open it in the sidebar` }\n : { ok: true, message: `${door.noun} created — the app did not switch after ${String(tried)} attempt${tried === 1 ? '' : 's'}; open it from the sidebar [roster per attempt: ${rosterTrace.join(' → ')}] [tried: ${steps.length === 0 ? 'none' : steps.includes('no-verb') ? 'no open or openSession verb on any injected service' : steps.join(', ')}] (build: ${DOOR_BUILD})${adoptRefusal === '' ? '' : ` (adoption refused: ${adoptRefusal})`}${subscribeRefusal === '' ? '' : ` (subscribe refused: ${subscribeRefusal})`}${adoptSaw === undefined ? '' : ` (right after adopt: ${adoptSaw ? 'contains' : 'missing'} ${child.slice(0, 15)})`}${rosterNote(sessions, child)}${verbsNote(sessions)}` }\n } catch (error) {\n return { ok: false, message: String((error as Error)?.message ?? error).slice(0, 90) }\n }\n }\n}\n","/**\n * The client ghost body for prompt recommendations (#71, site §28) — React-free,\n * exactly like the door runner beside it: this module owns the wire call, the\n * reply parsing, and the visibility decision; `src/client/index.ts` stays thin\n * chrome. The anti-dup row in tests/unit/client-doors.test.ts pins that\n * index.ts never touches the wire itself; the ghost obeys the same rule with\n * its OWN single body here (two call sites in this file, one per verb —\n * a pinned row proves it).\n *\n * Lifecycle (per session-scope mount):\n * idle transition (running true→false) → fetch once per boundary →\n * shown while the draft is EMPTY → typing hides it → ArrowRight/click\n * accepts into the draft → Esc dismisses until the next boundary.\n * A refusal (off, no route, model failure) shows NOTHING and retries only at\n * the next boundary — the disabled state is invisible, never a banner.\n *\n * @module dsh-chapters/src/client/prompt-ghost\n */\nimport type { ClientRemote } from './doors.ts'\n\nexport type GhostPhase = 'idle' | 'shown' | 'accepted' | 'dismissed' | 'refused'\n\n/** One boundary's fetched suggestion. `model` is the defining model's spec,\n * fetched once per mount for the hover label — a display fact, never part of\n * the accepted text. */\nexport interface GhostSuggestion { text: string; model?: string | undefined }\n\n/**\n * The ONE visibility predicate, in the host's own terms: the shipped\n * placeholder shows on `draft === '' && attachments.length === 0`\n * (InputBar.tsx `showPlaceholder`) — whitespace-only is CONTENT, it hides the\n * guidance. The ghost agrees exactly, so the two layers can never disagree\n * about \"empty\", and a typed (or space-typed) draft hides ours instantly.\n */\nexport function shouldShowGhost(phase: GhostPhase, running: boolean, draft: string, hasAttachments: boolean, suggestion: GhostSuggestion | null): boolean {\n return phase === 'shown' && !running && !hasAttachments && draft === '' && suggestion !== null && suggestion.text !== ''\n}\n\n/**\n * The gesture decision for a keydown while the ghost is visible:\n * ArrowRight accepts, Escape dismisses, anything else is the host's business.\n * Returns the action for the caller to apply (and whether to preventDefault).\n */\nexport function ghostKeyAction(key: string): 'accept' | 'dismiss' | null {\n if (key === 'ArrowRight') return 'accept'\n if (key === 'Escape') return 'dismiss'\n return null\n}\n\nexport interface GhostFetchResult { ok: boolean; text: string; refused?: boolean }\n\n/**\n * Execute `/chapters-prompt suggest` for one session. Never throws: every arm\n * answers. `refused: true` marks a refusal worth retrying at the next boundary;\n * a wire/registry failure is also a refusal, so one bad network cannot loop.\n */\nexport function makePromptFetcher(remote: ClientRemote): (sessionId: string) => Promise<GhostFetchResult> {\n return async (sessionId) => {\n if (remote.commands?.execute === undefined) return { ok: false, text: 'commands remote unavailable', refused: true }\n try {\n const res = await remote.commands.execute(sessionId, '/chapters-prompt suggest', [])\n const result = res.value?.result\n const text = typeof result?.text === 'string' ? result.text : ''\n if (result?.kind === 'success' && text !== '') return { ok: true, text }\n return { ok: false, text, refused: true }\n } catch (error) {\n return { ok: false, text: String((error as Error)?.message ?? error).slice(0, 90), refused: true }\n }\n }\n}\n\n/**\n * Execute `/chapters-prompt model` once per mount and pull the spec out of the\n * status sentence for the hover label. Absent/unparseable ⇒ no label (the chip\n * still works) — a display fact is never a dependency.\n */\nexport function makeModelLabelFetcher(remote: ClientRemote): (sessionId: string) => Promise<string | null> {\n return async (sessionId) => {\n if (remote.commands?.execute === undefined) return null\n try {\n const res = await remote.commands.execute(sessionId, '/chapters-prompt model', [])\n const text = res.value?.result?.kind === 'success' ? res.value.result.text ?? '' : ''\n const m = text.match(/^prompt model: (\\S+(?: \\S+)*) \\(.*\\) — ON$/)\n return m?.[1] ?? null\n } catch {\n return null\n }\n }\n}\n\n/**\n * The boundary bookkeeping as a pure reducer so the component holds no logic:\n * `runningEdge` reports the true→false transition of the session.\n */\nexport function ghostReducer(state: { phase: GhostPhase; boundary: number }, event:\n | { type: 'idle-edge' }\n | { type: 'fetched'; ok: boolean }\n | { type: 'accept' }\n | { type: 'dismiss' },\n): { phase: GhostPhase; boundary: number } {\n switch (event.type) {\n case 'idle-edge':\n return { phase: 'idle', boundary: state.boundary + 1 }\n case 'fetched':\n if (state.phase !== 'idle') return state // accept/dismiss/refused wins over a late answer\n return { ...state, phase: event.ok ? 'shown' : 'refused' }\n case 'accept':\n return { ...state, phase: 'accepted' }\n case 'dismiss':\n return { ...state, phase: 'dismissed' }\n }\n}\n\n/** The reducer's event union, named for the chrome's dispatch call. */\nexport type GhostEvent = Parameters<typeof ghostReducer>[1]\n","/**\n * dsh-chapters client entry: the per-message door buttons.\n *\n * Registers the two deterministic archive doors into the assistant action row\n * (`conversation.chat.assistant-actions` — the slot the official feedback\n * package populates beside copy/branch). Clicking one executes its host\n * command — `/chapters-fork`, `/chapters-continue` — through `remote.commands`,\n * the exact wire the composer's input line rides, then SWITCHES the app to the\n * fresh child:\n *\n * 1. `sessions.open(child)` — the client sessions service carries open() on\n * its prototype (Playwright-verified against this host; a keys-dump alone\n * hid it, which is why an earlier round wrongly gave up on this path);\n * 2. fallback: click the child's sidebar row after expanding collapsed\n * groups (plugin children can render under collapsed 'Ungrouped' heads);\n * 3. last resort: an inline note — the child is durable either way.\n *\n * There is deliberately NO second implementation of door logic here: the\n * buttons are mouths for the host commands (watermark, segmentation, budget,\n * titles, refusal-with-numbers all server-side, all tested), and the runner\n * they share is `src/client/doors.ts` — one body, one row per door. The purity\n * gate in tsdown.client.config.ts keeps this file cross-plugin-free.\n *\n * @module dsh-chapters/src/client\n */\n\nimport { createElement as h, useCallback, useEffect, useRef, useState, type ReactElement } from 'react'\n// The host's own tooltip bubble — a platform module served by the loader table,\n// external like react. Every action in this row labels through it.\nimport { Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { DOOR_ACTIONS, makeDoorRunner, type ClientRemote, type ClientSessions, type DoorAction, type DoorResult } from './doors.ts'\nimport {\n ghostKeyAction, ghostReducer, makeModelLabelFetcher, makePromptFetcher, shouldShowGhost,\n type GhostEvent, type GhostFetchResult, type GhostPhase, type GhostSuggestion,\n} from './prompt-ghost.ts'\n\ninterface ClientSlots {\n inject(name: string, factory: () => unknown): void\n register(registration: Record<string, unknown>, component: unknown): unknown\n}\n\ninterface Ctx {\n slots: ClientSlots\n get(name: string): unknown\n}\n\n// #77: `uiWorkspace` is not optional in practice — it owns `openSession(target)`, the verb the\n// host's own fork button uses (`ctx.uiWorkspace.openSession(childId)` in dsh-client-ui-chat).\n// `sessions` has no `open` at all, so without this row the door has never had a way to switch.\nexport const inject = ['slots', 'remote', 'remote.commands', 'sessions', 'uiWorkspace'] as const\n\n/** Props composed by the slot framework: owner (`messageId`) + our injected verb. */\ninterface DoorActionProps {\n messageId: string\n run: () => Promise<DoorResult>\n}\n\n/**\n * Style parity with the native IconActions row: rules copied verbatim from the\n * host's MessageIconActions module (`._xzv4MW_action` in dsh-client-ui-chat's\n * compiled client + the feedback package's :disabled) — same metrics, tokens,\n * hover. Update this string if the host restyles its action row. Both doors\n * share these metrics.\n *\n * The final rule hides the native branch action IN THE MESSAGE ROW only\n * (user-approved cosmetic decision, docs/architecture.md): built-in chrome, so\n * the selector is its accessible label scoped to action-row buttons; both\n * locale spellings covered. If the host rewords the label the button simply\n * reappears — fails open, visibly.\n */\nconst CSS = [\n '.dsh-chapters_forkAction{width:calc(28px + var(--dsh-content-font-delta,0px));height:calc(28px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}',\n '.dsh-chapters_forkAction svg{width:calc(15px + var(--dsh-content-font-delta,0px));height:calc(15px + var(--dsh-content-font-delta,0px))}',\n '.dsh-chapters_forkAction:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}',\n '.dsh-chapters_forkAction:disabled{cursor:default;opacity:.4}',\n '.dsh-chapters_forkNote{color:var(--dsw-alias-label-tertiary);padding-left:4px;font-size:13px;line-height:20px}',\n // #71 the prompt ghost chip — the overlay anchor is the composer card's top band\n // (`inset: 0 0 auto; height: 0`), the same hole the trigger menu pops from. The\n // chip floats there, placeholder-caption palette, click-to-accept; the Right-arrow\n // path needs no pixels at all. Fails open: worst case (host restyles the card) it\n // reads as a slightly misplaced suggestion, never broken chrome.\n '.dsh-chapters_ghostWrap{position:absolute;top:2px;left:14px;right:14px;display:flex;justify-content:flex-start;pointer-events:none;z-index:1}',\n '.dsh-chapters_ghost{pointer-events:auto;display:inline-flex;align-items:center;gap:6px;max-width:min(70%,560px);padding:2px 10px;border:none;border-radius:12px;cursor:pointer;background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-caption);font-size:12px;line-height:18px}',\n '.dsh-chapters_ghost:hover{color:var(--dsw-alias-label-secondary)}',\n '.dsh-chapters_ghostText{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}',\n '.dsh-chapters_ghostGlyph{flex:none;font-weight:600}',\n 'button[class*=\"_action\"][aria-label=\"Branch into a new conversation\"],button[class*=\"_action\"][aria-label=\"\\u5728\\u65b0\\u5bf9\\u8bdd\\u4e2d\\u5206\\u652f\"]{display:none !important}',\n].join('\\n')\nconst CSS_TAG_ID = 'dsh-chapters/assistant-action.css'\n\nfunction injectStyles(): void {\n try {\n if (typeof document === 'undefined' || document.querySelector(`style[data-plugin-css=${JSON.stringify(CSS_TAG_ID)}]`) !== null) return\n const tag = document.createElement('style')\n tag.dataset.plugin = 'dsh-chapters'\n tag.dataset.pluginCss = CSS_TAG_ID\n tag.textContent = CSS\n document.head.appendChild(tag)\n } catch { /* styling is cosmetic; the action still works without it */ }\n}\n\n/** One component body for every door row; only the label and glyph differ. */\nfunction makeDoorAction(door: DoorAction) {\n return function ChaptersDoorAction({ run }: DoorActionProps) {\n const [busy, setBusy] = useState(false)\n const [note, setNote] = useState<string | null>(null)\n const alive = useRef(true)\n useEffect(() => () => { alive.current = false }, [])\n const onClick = useCallback(() => {\n if (busy) return\n setBusy(true)\n setNote(null)\n void run().then((result) => {\n if (!alive.current) return\n setBusy(false)\n setNote(result.message === '' ? null : result.message)\n setTimeout(() => { if (alive.current) setNote(null) }, 8000)\n })\n }, [busy, run])\n const button = h('button', {\n type: 'button',\n 'aria-label': door.label,\n disabled: busy,\n onClick,\n className: 'dsh-chapters_forkAction',\n },\n h('svg', { viewBox: '0 0 16 16', width: '15', height: '15', fill: 'currentColor', 'aria-hidden': 'true' },\n h('path', { d: door.iconPath })))\n return h('span', { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' } },\n h(Tooltip, { label: door.label, side: 'bottom' as const, children: button as ReactElement<Record<string, unknown>> }),\n note !== null\n ? h('span', { className: 'dsh-chapters_forkNote' }, note)\n : null)\n }\n}\n\n/**\n * The ghost chrome (#71): standard session hooks in, pure decisions out. It\n * holds NO logic — visibility, gestures, and the wire live in prompt-ghost.ts;\n * this component only binds those to React and the host Tooltip.\n */\ninterface GhostProps {\n sessionId: string\n useInput: (sel: (s: { draft: string; attachmentIds: readonly unknown[] }) => unknown) => unknown\n useSession: (sel: (s: { running?: boolean | null }) => unknown) => unknown\n inputActions?: { setDraft(text: string): void } | undefined\n fetchSuggestion: () => Promise<GhostFetchResult>\n fetchLabel: () => Promise<string | null>\n}\n\nfunction makeGhostView() {\n return function ChaptersPromptGhost(props: GhostProps) {\n const snap = props.useInput((s) => s) as { draft: string; attachmentIds: readonly unknown[] } | undefined\n const running = (props.useSession((s) => s.running) as boolean | null | undefined) ?? false\n const draft = snap?.draft ?? ''\n const hasAttachments = (snap?.attachmentIds.length ?? 0) > 0\n const [state, setState] = useState<{ phase: GhostPhase; boundary: number }>({ phase: 'idle', boundary: 0 })\n const [suggestion, setSuggestion] = useState<GhostSuggestion | null>(null)\n const [model, setModel] = useState<string | null>(null)\n // #79: the label answer is what tells this component whether the feature exists at all.\n // Until it arrives, nothing is fetched; when it says OFF, nothing is EVER fetched. Before\n // this, an idle edge pulled `/chapters-prompt suggest` on every boot and the server had to\n // refuse it — visible in the durable log as `prompt suggestions are off` command errors in\n // sessions that never enabled the feature.\n const [labelKnown, setLabelKnown] = useState(false)\n const alive = useRef(true)\n useEffect(() => () => { alive.current = false }, [])\n const dispatch = useCallback((ev: GhostEvent) => { setState((s) => ghostReducer(s, ev)) }, [])\n\n // The model label is a display fact: fetch once per mount, absence tolerated.\n // #79: the dep array used to be `[props]`, and React hands a NEW props object every render\n // — with this component subscribed to the whole input store, that meant a durable\n // `/chapters-prompt model` command per keystroke (measured: 4–26 command pairs per session,\n // on boots where the feature is OFF and the correct number is zero). The callback is read\n // through a ref so the mount-scoped guard cannot be defeated by an unstable identity.\n const fetchLabelRef = useRef(props.fetchLabel)\n fetchLabelRef.current = props.fetchLabel\n const labelFetched = useRef(false)\n useEffect(() => {\n if (labelFetched.current) return\n labelFetched.current = true\n void fetchLabelRef.current().then((m) => {\n if (!alive.current) return\n setModel(m)\n setLabelKnown(true)\n })\n }, [])\n\n // Idle edge: the first settled render and every running true→false transition\n // open a new boundary (the host-side cache watermark does the token economics;\n // this only decides WHEN to ask).\n const prevRunning = useRef<boolean | null>(null)\n useEffect(() => {\n const first = prevRunning.current === null\n const edge = !running && (first || prevRunning.current === true)\n prevRunning.current = running\n if (edge) dispatch({ type: 'idle-edge' })\n }, [running, dispatch])\n\n // One fetch per boundary, while idle. A late answer cannot resurrect an\n // accepted/dismissed chip — the reducer owns that race.\n const fetchedFor = useRef(-1)\n const { phase, boundary } = state\n useEffect(() => {\n if (!labelKnown || model === null) return\n if (phase !== 'idle' || fetchedFor.current === boundary) return\n fetchedFor.current = boundary\n void props.fetchSuggestion().then((r) => {\n if (!alive.current) return\n setSuggestion(r.ok ? { text: r.text, model: model !== null ? model : undefined } : null)\n dispatch({ type: 'fetched', ok: r.ok })\n })\n }, [phase, boundary, props, dispatch, labelKnown, model])\n\n const accept = useCallback(() => {\n if (suggestion === null) return\n props.inputActions?.setDraft(suggestion.text)\n dispatch({ type: 'accept' })\n }, [suggestion, props, dispatch])\n\n // The gesture: ArrowRight accepts, Esc dismisses — ONLY while the chip is\n // visible, ONLY for events whose target is the composer editor itself\n // (`data-composer-input`), attached at capture because the host keymap never\n // claims ArrowRight and Escape-with-no-menu passes. The listener detaches\n // with visibility, so a hidden ghost cannot eat a keystroke.\n const visible = shouldShowGhost(state.phase, running, draft, hasAttachments, suggestion)\n useEffect(() => {\n if (!visible) return\n const onKey = (event: KeyboardEvent) => {\n const action = ghostKeyAction(event.key)\n if (action === null) return\n const target = event.target as HTMLElement | null\n if (target === null || typeof target.closest !== 'function' || target.closest('[data-composer-input]') === null) return\n event.preventDefault()\n event.stopPropagation()\n if (action === 'accept') accept()\n else dispatch({ type: 'dismiss' })\n }\n document.addEventListener('keydown', onKey, true)\n return () => { document.removeEventListener('keydown', onKey, true) }\n }, [visible, accept, dispatch])\n\n if (!visible || suggestion === null) return null\n const tip = `next step suggested${model !== null ? ` by ${model}` : ''} — → or click puts it in the draft, Esc dismisses`\n return h('span', { className: 'dsh-chapters_ghostWrap' },\n h(Tooltip, {\n label: tip,\n side: 'top' as const,\n children: h('button', {\n type: 'button',\n className: 'dsh-chapters_ghost',\n 'aria-label': 'Accept the suggested next prompt',\n onClick: accept,\n },\n h('span', { className: 'dsh-chapters_ghostGlyph', 'aria-hidden': 'true' }, '→'),\n h('span', { className: 'dsh-chapters_ghostText' }, suggestion.text)) as ReactElement<Record<string, unknown>>,\n }))\n }\n}\n\nexport function apply(ctx: Ctx): void {\n injectStyles()\n const slots = ctx.slots\n const remote = (ctx.get('remote') ?? {}) as ClientRemote\n let sessions: ClientSessions | undefined\n try { sessions = ctx.get('sessions') as ClientSessions | undefined } catch { sessions = undefined }\n // Defensive: a host that cannot provide the navigator must leave the door registering and\n // reporting its own limitation, not failing at boot.\n let uiWorkspace: { openSession?: (id: string) => unknown } | undefined\n try { uiWorkspace = ctx.get('uiWorkspace') as { openSession?: (id: string) => unknown } | undefined } catch { uiWorkspace = undefined }\n // No early return on missing descriptors: the buttons register regardless\n // and the click reports the gap. A missing button is worse than a button\n // that explains itself. Components and runners are built ONCE here — slot\n // factories may re-run, and a fresh component identity per call would\n // remount the row.\n // #54: the switch verifier. `dsh.sessions.current` is published by the host's own\n // dsh-client-ui-workspace (grep-confirmed, not folklore) — the same key the e2e specs\n // read to name a session exactly, which is the point: the door now checks the fact the\n // user would notice, not whether a void call threw.\n const currentSessionId = (): string | null => {\n try {\n const raw = window.localStorage.getItem('dsh.sessions.current')\n if (raw === null) return null\n const parsed = JSON.parse(raw) as { sessionId?: string } | null\n return parsed?.sessionId ?? null\n } catch { return null }\n }\n const rows = DOOR_ACTIONS.map((door) => ({\n door,\n run: makeDoorRunner(remote, sessions, door, async (child) => {\n for (let i = 0; i < 8; i++) {\n if (currentSessionId() === child) return true\n await new Promise((r) => setTimeout(r, 250))\n }\n return currentSessionId() === child\n }, { ...(uiWorkspace !== undefined ? { navigator: uiWorkspace } : {} ) }),\n component: makeDoorAction(door),\n }))\n slots.inject('conversation.chat.assistant-actions', () => rows.map(({ door, run, component }) => slots.register({\n name: 'conversation.chat.assistant-actions',\n id: door.id,\n order: door.order,\n inject: (sessionId: string) => ({ run: () => run(sessionId) }),\n }, component)))\n // #71: the ghost row. ONE component identity (built here, not per slot\n // re-inject), ONE wire body (prompt-ghost.ts), standard session hooks do the\n // rest. Registration into a slot another package declares rides slots.inject,\n // which waits for the declaration — the documented cross-package pattern.\n const ghostView = makeGhostView()\n const fetchSuggestion = makePromptFetcher(remote)\n const fetchLabel = makeModelLabelFetcher(remote)\n slots.inject('conversation.input.overlay', () => slots.register({\n name: 'conversation.input.overlay',\n id: 'chapters-prompt-ghost',\n order: 12,\n inject: (sessionId: string) => ({\n fetchSuggestion: () => fetchSuggestion(sessionId),\n fetchLabel: () => fetchLabel(sessionId),\n }),\n }, ghostView))\n}\n"],"mappings":";;;;;;;;;EAiEA,MAAa,eAAsC,CACjD;GACE,IAAI;GACJ,OAAO;GACP,OAAO;GACP,SAAS;GACT,MAAM;GACN,UAAU;EACZ,GACA;GACE,IAAI;GACJ,OAAO;GACP,OAAO;GACP,SAAS;GACT,MAAM;GACN,UAAU;EACZ,CACF;;;;;;;;;;EAWA,MAAa,aAAa;EAE1B,MAAa,WAAW;;;EAIxB,MAAa,aAAa,SAAyB,IAAI,OAAO,GAAG,KAAK,wCAAwC;;;;;;EAO9G,SAAS,cAAc,OAAwB;GAE7C,MAAM,WADM,iBAAiB,QAAQ,MAAM,UAA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kB,MAAM;GAChD,MAAM,aAAa,sBAAsB,MAAM;GAC/C,MAAM,OAAO,oCAAoC,MAAM,SAAS;IAC9D,MAAM;IACN,IAAI;IACJ,OAAO;IACP,SAAS,eAAuB;KAC9B,uBAAuB,gBAAgB,SAAS;KAChD,kBAAkB,WAAW,SAAS;IACxC;GACF,GAAG,SAAS,CAAC;EACf"}
|
package/lib/commands.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type SyncScheduler } from './sync.ts';
|
|
2
2
|
import type { DomainLike } from './store.ts';
|
|
3
3
|
import type { ToolsCtx } from './tools.ts';
|
|
4
|
+
import type { PromptCommandSurface } from './prompt.ts';
|
|
4
5
|
/** Structural slice of EnrichWiring the commands need (keeps queue types out). */
|
|
5
6
|
export interface EnrichCommandSurface {
|
|
6
7
|
runNow(cwd?: string): Promise<{
|
|
@@ -20,9 +21,18 @@ export interface HostCommandsConfig {
|
|
|
20
21
|
/** P2 enrichment command surface (host plane; manual-drain semantics). */
|
|
21
22
|
enrich?: EnrichCommandSurface;
|
|
22
23
|
/** P3 rule lifecycle family, bound to a workspace (S2 module underneath). */
|
|
23
|
-
rules?: (cwd: string, args: string) => Promise<{
|
|
24
|
+
rules?: (cwd: string, args: string, sessionId?: string) => Promise<{
|
|
24
25
|
kind: 'success' | 'error';
|
|
25
26
|
text: string;
|
|
26
27
|
}>;
|
|
28
|
+
/** Door 5 (issue #47): whether subagent settlements auto-archive. Reported in
|
|
29
|
+
* /chapters-status because it runs WITHOUT a human seeing it happen. */
|
|
30
|
+
subagentAutoSave?: boolean;
|
|
31
|
+
/** #71: prompt recommendations surface (host plane; pull transport — the
|
|
32
|
+
* client composer ghost executes `suggest`). Reported by /chapters-status. */
|
|
33
|
+
prompt?: PromptCommandSurface;
|
|
34
|
+
/** §7.8: fed to `resolveProject` so the identity line reports the SAME key the
|
|
35
|
+
* plugin binds by, not a naive re-derivation. */
|
|
36
|
+
projectKeyOverride?: string;
|
|
27
37
|
}
|
|
28
38
|
export declare function registerHostCommands(ctx: ToolsCtx, domain: DomainLike, config: HostCommandsConfig): () => void;
|
package/lib/commands.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* /chapters-link treedx+<url>/<repo> <token> bind a TreeDX service upstream
|
|
10
10
|
* /chapters-status last sync result
|
|
11
11
|
* /chapters-enrich run | model … | report P2 enrichment surface (record §6.2)
|
|
12
|
+
* /chapters-prompt model … | off | suggest prompt recommendations (#71, site §28)
|
|
12
13
|
*/
|
|
13
14
|
import fs from 'node:fs';
|
|
14
15
|
import path from 'node:path';
|
|
@@ -20,6 +21,10 @@ import { resolveRepoId } from "./treedx/provider.js";
|
|
|
20
21
|
import { readState } from "./treedx/state.js";
|
|
21
22
|
import { selectProvider } from "./provider.js";
|
|
22
23
|
import { resolveStoreRoot } from "./store.js";
|
|
24
|
+
import { diagnosticStatusLine } from "./diag.js";
|
|
25
|
+
import { registryHealth } from "./repair.js";
|
|
26
|
+
/** Door 5 state, stated with its config name so a user can flip it (issue #47). */
|
|
27
|
+
const AUTO_SAVE_LINE = (config) => `\nSubagent auto-save: ${config.subagentAutoSave === false ? 'OFF (subagentAutoSave: false)' : 'ON — chapters-preset children archive their completed turns at settlement'}`;
|
|
23
28
|
const cwdOf = (agent) => (agent?.session?.header?.cwd ?? process.cwd());
|
|
24
29
|
/** branch name (or short oid) the mirror's HEAD points at. */
|
|
25
30
|
function readMirrorHead(mirrorAbs) {
|
|
@@ -82,6 +87,21 @@ export function registerHostCommands(ctx, domain, config) {
|
|
|
82
87
|
`Provider: ${rec.kind ?? 'git'}`,
|
|
83
88
|
`Upstream: ${rec.remote}`,
|
|
84
89
|
`Bound: ${rec.slug} · key ${rec.projectKey} · since ${rec.linkedAt}`,
|
|
90
|
+
// §7.8 IDENTITY MUST FAIL LOUDLY. Project rules carry across checkouts
|
|
91
|
+
// because the key derives from the canonicalized REMOTE — so the four
|
|
92
|
+
// ways it can diverge (no remote ⇒ path-derived, a fork listed first,
|
|
93
|
+
// a TreeDX link keyed on the pool, an unlinked clone) are reported here
|
|
94
|
+
// rather than leaving a checkout silently owning its own namespace.
|
|
95
|
+
(() => {
|
|
96
|
+
const derived = resolveProject(cwd, config.projectKeyOverride !== undefined && config.projectKeyOverride !== '' ? config.projectKeyOverride : undefined);
|
|
97
|
+
const where = derived.projectKeySource === 'remote' ? `remote ${derived.remote ?? ''}`
|
|
98
|
+
: derived.projectKeySource === 'override' ? 'config override'
|
|
99
|
+
: `PATH ${cwd} (not the remote — unstable across machines)`;
|
|
100
|
+
return derived.projectKey === rec.projectKey
|
|
101
|
+
? `Identity: ${derived.projectKeySource} — matches the bound key (${where})`
|
|
102
|
+
: `Identity: ${derived.projectKeySource} ⚠ THIS CHECKOUT RESOLVES A DIFFERENT PROJECT KEY (${derived.projectKey.slice(0, 8)}… vs bound ${rec.projectKey.slice(0, 8)}…) — rules and chapters approved elsewhere will NOT appear here. ${where}`;
|
|
103
|
+
})(),
|
|
104
|
+
diagnosticStatusLine(),
|
|
85
105
|
`Mirror: ${fs.existsSync(mirrorAbs) ? DEFAULT_CLONE_DIR : '(not created yet)'}` +
|
|
86
106
|
(treedx ? ` head ${head ?? (tstate === null ? 'not cloned' : 'empty repo')}${tstate?.offline === true ? ' · OFFLINE (push deferred)' : ''}` : ` branch ${head ?? 'main'}`) +
|
|
87
107
|
(origin !== null && origin !== (treedx ? rec.remote : local ? resolveLocalUpstreamPath(rec.remote, cwd) : rec.remote) ? ` [origin drift: ${origin} — will rebuild]` : ''),
|
|
@@ -209,10 +229,14 @@ export function registerHostCommands(ctx, domain, config) {
|
|
|
209
229
|
const cwd = cwdOf(invocation.agent);
|
|
210
230
|
const project = projectForCwd(domain.table('projects').entries(), cwd);
|
|
211
231
|
const status = readSyncStatus(cwd, config.artifactStoreRoot);
|
|
232
|
+
// #61: this command used to RETURN here when nothing was linked — one sentence, and every health
|
|
233
|
+
// line below it (Enrichment, Diagnostics, Auto-save, Findings) was unreachable precisely for the
|
|
234
|
+
// users who most needed it. An unlinked project is a STATE, not an absence of health.
|
|
235
|
+
const lines = [];
|
|
212
236
|
if (project === undefined && status === null) {
|
|
213
|
-
|
|
237
|
+
lines.push('No knowledge repository is linked yet. Link one with /chapters-link <https-remote-url> [token] — '
|
|
238
|
+
+ 'until then this project\u2019s chapters, rules and index stay on THIS machine only.');
|
|
214
239
|
}
|
|
215
|
-
const lines = [];
|
|
216
240
|
if (project !== undefined) {
|
|
217
241
|
const pending = config.scheduler?.hasPending(cwd) === true;
|
|
218
242
|
lines.push(`Project: ${project.slug} \u00B7 key ${project.projectKey}`);
|
|
@@ -223,14 +247,64 @@ export function registerHostCommands(ctx, domain, config) {
|
|
|
223
247
|
catch {
|
|
224
248
|
lines.push('Provider: (kind unrecognized — sync will refuse loudly, nothing silently reroutes)');
|
|
225
249
|
}
|
|
250
|
+
// #50 §7.8 IDENTITY MUST FAIL LOUDLY. Project rules carry across checkouts
|
|
251
|
+
// because the key is UUIDv5 over the canonicalized REMOTE — so the ways it
|
|
252
|
+
// can silently diverge (no readable remote ⇒ path-derived, a fork listed
|
|
253
|
+
// before origin, a TreeDX link keyed on the pool location) are reported
|
|
254
|
+
// here instead of leaving a checkout owning a private rules namespace while
|
|
255
|
+
// its developer believes the team's rules apply.
|
|
256
|
+
{
|
|
257
|
+
const derived = resolveProject(cwd, config.projectKeyOverride !== undefined && config.projectKeyOverride !== '' ? config.projectKeyOverride : undefined);
|
|
258
|
+
const where = derived.projectKeySource === 'remote' ? `remote ${derived.remote ?? ''}`
|
|
259
|
+
: derived.projectKeySource === 'override' ? 'config override'
|
|
260
|
+
: `PATH ${cwd} (not the remote — unstable across machines)`;
|
|
261
|
+
lines.push(derived.projectKey === project.projectKey
|
|
262
|
+
? `Identity: ${derived.projectKeySource} — matches the bound key (${where})`
|
|
263
|
+
: `Identity: ${derived.projectKeySource} ⚠ THIS CHECKOUT RESOLVES A DIFFERENT PROJECT KEY (${derived.projectKey.slice(0, 8)}… vs bound ${project.projectKey.slice(0, 8)}…) — rules and chapters approved elsewhere will NOT appear here. ${where}`);
|
|
264
|
+
}
|
|
226
265
|
lines.push(pending ? 'Sync: a push is pending (debounced)' : `Sync: ${status?.mode ?? 'never run'}${pending ? '' : ''}`);
|
|
227
266
|
}
|
|
228
267
|
if (status !== null) {
|
|
229
268
|
lines.push(`Last sync: ${status.at} \u2014 ${status.lastOk ? 'synced' : `${status.mode ?? 'local-only'}: ${status.detail}`}`);
|
|
230
269
|
lines.push(` ${(status.steps ?? []).join(' \u2192 ')}`);
|
|
231
270
|
}
|
|
232
|
-
|
|
233
|
-
|
|
271
|
+
// #61: an unwired surface is STATED, not omitted. A reader who sees no enrichment line cannot tell
|
|
272
|
+
// whether enrichment is off, broken, or simply not printed here — which is how "the feature never
|
|
273
|
+
// ran" hides for three days behind a logger nobody reads.
|
|
274
|
+
lines.push(config.enrich !== undefined ? config.enrich.statusLine() : 'Enrichment: not wired on this plane (no model route registered)');
|
|
275
|
+
lines.push(config.prompt !== undefined ? config.prompt.statusLine() : 'Prompt suggestions: not wired on this plane');
|
|
276
|
+
lines.push(diagnosticStatusLine());
|
|
277
|
+
lines.push(AUTO_SAVE_LINE(config));
|
|
278
|
+
// Findings, read-only, from the #60 auditor's row-level view. What a status cannot check WITHOUT
|
|
279
|
+
// the durable log is named as unchecked rather than counted as clean: coverage holes, orphan
|
|
280
|
+
// files and dead citations need `/chapters-repair audit`.
|
|
281
|
+
{
|
|
282
|
+
const states = [...domain.table('sessions').entries()]
|
|
283
|
+
.map(([, st]) => st)
|
|
284
|
+
.filter((st) => st.rootSession !== undefined);
|
|
285
|
+
const health = registryHealth(states);
|
|
286
|
+
const dead = states.reduce((m, st) => m + (st.chapters?.length ?? 0), 0);
|
|
287
|
+
lines.push(`Findings (registry-level, this machine): ${health.text}`);
|
|
288
|
+
lines.push(` NOT checked here: coverage holes, orphan files, dead citations — run /chapters-repair audit${dead === 0 ? ' (no chapter records at all yet)' : ''}`);
|
|
289
|
+
}
|
|
290
|
+
// The retrievability line: a long session that has never tripped an archive moment is the field
|
|
291
|
+
// case #61 found (2,363 events, 414 tool calls, `chapters: []`) — knowledge that exists only in
|
|
292
|
+
// the log and is invisible to every search on this machine.
|
|
293
|
+
{
|
|
294
|
+
const session = invocation.agent;
|
|
295
|
+
const sess = session.session ?? session.agent?.session;
|
|
296
|
+
const events = sess?.snapshotEvents?.() ?? [];
|
|
297
|
+
const ends = events.filter((e) => e.type === 'turn/end').length;
|
|
298
|
+
const mine = sess?.id !== undefined
|
|
299
|
+
? (domain.table('sessions').get(sess.id)?.chapters.length ?? 0)
|
|
300
|
+
: 0;
|
|
301
|
+
if (mine === 0 && ends > 0) {
|
|
302
|
+
lines.push(`This session: ${events.length} events, ${ends} completed turn(s), 0 chapters — NOTHING it does is retrievable. /chapters-save archives it, or /chapters-continue opens a child on the archive.`);
|
|
303
|
+
}
|
|
304
|
+
else if (mine > 0) {
|
|
305
|
+
lines.push(`This session: ${events.length} events, ${ends} completed turn(s), ${mine} chapter record(s) archived.`);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
234
308
|
return { kind: 'success', text: lines.join('\n') };
|
|
235
309
|
},
|
|
236
310
|
};
|
|
@@ -267,6 +341,56 @@ export function registerHostCommands(ctx, domain, config) {
|
|
|
267
341
|
}
|
|
268
342
|
},
|
|
269
343
|
};
|
|
344
|
+
const promptCommand = {
|
|
345
|
+
name: 'chapters-prompt',
|
|
346
|
+
description: 'Prompt recommendations (#71, site \u00A728): set the defining model, turn the composer ghost off, or answer the client\u2019s pull.',
|
|
347
|
+
input: { hint: 'model [provider/model | clear] | off | suggest' },
|
|
348
|
+
async handler(invocation) {
|
|
349
|
+
if (config.prompt === undefined)
|
|
350
|
+
return { kind: 'error', text: 'prompt recommendations are not wired on this plane' };
|
|
351
|
+
const parts = (invocation.rawInput ?? '').trim().split(/\s+/).filter((p) => p.length > 0);
|
|
352
|
+
const verb = parts[0] ?? 'help';
|
|
353
|
+
try {
|
|
354
|
+
if (verb === 'model') {
|
|
355
|
+
const arg = parts[1];
|
|
356
|
+
if (arg === undefined) {
|
|
357
|
+
const { spec, source } = config.prompt.effective();
|
|
358
|
+
return { kind: 'success', text: spec === ''
|
|
359
|
+
? `prompt model: OFF${source === 'override' ? ' (stored override — /chapters-prompt model <provider/model> to enable)' : ' (unset — set one with /chapters-prompt model <provider/model>)'}`
|
|
360
|
+
: `prompt model: ${spec} (${source}) — ON` };
|
|
361
|
+
}
|
|
362
|
+
if (arg === 'clear') {
|
|
363
|
+
await config.prompt.setModel(null);
|
|
364
|
+
const { spec } = config.prompt.effective();
|
|
365
|
+
return { kind: 'success', text: spec === ''
|
|
366
|
+
? 'prompt model override cleared — the config default is unset, so suggestions are OFF'
|
|
367
|
+
: `prompt model override cleared — now following the config default (${spec}, ON)` };
|
|
368
|
+
}
|
|
369
|
+
await config.prompt.setModel(arg);
|
|
370
|
+
return { kind: 'success', text: `prompt model set to ${arg} — this ENABLES the composer ghost (one bounded call per turn boundary; /chapters-prompt off disables)` };
|
|
371
|
+
}
|
|
372
|
+
if (verb === 'off') {
|
|
373
|
+
await config.prompt.setModel('');
|
|
374
|
+
return { kind: 'success', text: 'prompt suggestions OFF (stored override; /chapters-prompt model clear restores the config default)' };
|
|
375
|
+
}
|
|
376
|
+
if (verb === 'suggest') {
|
|
377
|
+
const holder = invocation.agent;
|
|
378
|
+
const sess = holder.session ?? holder.agent?.session;
|
|
379
|
+
if (sess?.id === undefined)
|
|
380
|
+
return { kind: 'error', text: 'suggest needs a session scope — run it inside a session (the composer ghost calls this verb; humans rarely do)' };
|
|
381
|
+
const events = (sess.snapshotEvents?.() ?? []);
|
|
382
|
+
const titleEvent = [...events].reverse().find((e) => e.type === 'session/title');
|
|
383
|
+
const title = titleEvent !== undefined && typeof titleEvent.data.title === 'string' ? titleEvent.data.title : undefined;
|
|
384
|
+
const r = await config.prompt.suggest({ id: sess.id, title, events: [...events] });
|
|
385
|
+
return r.ok ? { kind: 'success', text: r.text } : { kind: 'error', text: r.text };
|
|
386
|
+
}
|
|
387
|
+
return { kind: 'success', text: 'usage: /chapters-prompt model [provider/model | clear] | off | suggest' };
|
|
388
|
+
}
|
|
389
|
+
catch (error) {
|
|
390
|
+
return { kind: 'error', text: `chapters-prompt failed: ${String(error?.message ?? error).slice(0, 200)}` };
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
};
|
|
270
394
|
try {
|
|
271
395
|
const d1 = commands.register(linkCommand);
|
|
272
396
|
if (typeof d1 === 'function')
|
|
@@ -277,14 +401,21 @@ export function registerHostCommands(ctx, domain, config) {
|
|
|
277
401
|
const d3 = commands.register(enrichCommand);
|
|
278
402
|
if (typeof d3 === 'function')
|
|
279
403
|
disposers.push(d3);
|
|
404
|
+
const d3b = commands.register(promptCommand);
|
|
405
|
+
if (typeof d3b === 'function')
|
|
406
|
+
disposers.push(d3b);
|
|
280
407
|
if (config.rules !== undefined) {
|
|
281
408
|
const rulesFn = config.rules;
|
|
282
409
|
const rulesCommandDef = {
|
|
283
410
|
name: 'chapters-rule',
|
|
284
|
-
description: '
|
|
285
|
-
input: { hint: 'add <category> <text> | list [--all|--proposed|--category <c
|
|
411
|
+
description: 'Rules (record \u00A77): project tier propose/approve/revoke per machine; session tier review, pin, conflict report.',
|
|
412
|
+
input: { hint: 'add <category> <text> | list [--all|--proposed|--category <c>|--scope project|session] | active | approve <id> | revoke <id> | pin <id> | unpin <id> | conflicts' },
|
|
286
413
|
async handler(invocation) {
|
|
287
|
-
|
|
414
|
+
// the session id reaches the resolver because the SESSION tier activates
|
|
415
|
+
// by ancestry (§7.5): `active` cannot answer without knowing which tree
|
|
416
|
+
// is asking. Command output never enters the model context (§7.2).
|
|
417
|
+
const sessionId = invocation.agent?.session?.id;
|
|
418
|
+
const r = await rulesFn(cwdOf(invocation.agent), invocation.rawInput ?? '', sessionId);
|
|
288
419
|
return { kind: r.kind, text: r.text };
|
|
289
420
|
},
|
|
290
421
|
};
|
package/lib/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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,CAAC,KAAK,CAAA;YAC5B,MAAM,eAAe,GAAG;gBACtB,IAAI,EAAE,eAAe;gBACrB,WAAW,EAAE,qHAAqH;gBAClI,KAAK,EAAE,EAAE,IAAI,EAAE,kKAAkK,EAAE;gBACnL,KAAK,CAAC,OAAO,CAAC,UAAiD;oBAC7D,yEAAyE;oBACzE,wEAAwE;oBACxE,mEAAmE;oBACnE,MAAM,SAAS,GAAI,UAAU,CAAC,KAAmD,EAAE,OAAO,EAAE,EAAE,CAAA;oBAC9F,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,QAAQ,IAAI,EAAE,EAAE,SAAS,CAAC,CAAA;oBACtF,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;gBACvC,CAAC;aACF,CAAA;YACD,MAAM,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;YAC7C,IAAI,OAAO,EAAE,KAAK,UAAU;gBAAE,SAAS,CAAC,IAAI,CAAC,EAAgB,CAAC,CAAA;QAChE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0EAA0E;QAC1E,oEAAoE;QACpE,MAAM,OAAO,GAAG,mDAAmD,MAAM,CAAC,KAAK,CAAC,GAAG,CAAA;QACnF,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,CAAA;QAC3B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC;IACD,OAAO,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC,IAAI,SAAS;QAAE,CAAC,EAAE,CAAA,CAAC,CAAC,CAAA;AACjD,CAAC"}
|
package/lib/compose.js
CHANGED
|
@@ -68,9 +68,18 @@ export function composeChapters(events, spanStart, spanEnd, collections, config)
|
|
|
68
68
|
const unarchivedSeqs = events
|
|
69
69
|
.filter((e) => e.seq >= spanStart && e.seq <= spanEnd && !covered.has(e.seq))
|
|
70
70
|
.map((e) => e.seq);
|
|
71
|
+
// #59 — this set is NOT evidence of unfinished work. It is simply "no collection signed it", and
|
|
72
|
+
// a collection can be missing because the signature was lost in a registry lost-update while the
|
|
73
|
+
// TURN COMPLETED (measured: session-2edf9694, 32 turn/ends vs 31 collections → 203 events in no
|
|
74
|
+
// chapter, while the note below used to assert they were unfinished). Those seqs are ABSORBED into
|
|
75
|
+
// the neighbouring ranges by `close()` below, so nothing finished is ever dropped; the note now
|
|
76
|
+
// says which of them actually belong to an unfinished turn, derived from `turn/end`, not assumed.
|
|
71
77
|
if (unarchivedSeqs.length > 0) {
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
const lastTurnEnd = events.reduce((m, e) => (e.type === 'turn/end' && e.seq <= spanEnd && e.seq > m ? e.seq : m), -1);
|
|
79
|
+
const unsignedDone = unarchivedSeqs.filter((sq) => sq <= lastTurnEnd);
|
|
80
|
+
notes.push(unsignedDone.length > 0
|
|
81
|
+
? `${unsignedDone.length} unsigned event(s) in ${spanStart}..${lastTurnEnd} are inside COMPLETED turns — absorbed into the adjacent chapter (record §4.3, #59)`
|
|
82
|
+
: `only unfinished tail content (${unarchivedSeqs[0]}..${unarchivedSeqs[unarchivedSeqs.length - 1]}) stays live, per §4.3`);
|
|
74
83
|
}
|
|
75
84
|
const runningOf = (c) => ({
|
|
76
85
|
first: c, last: c, paths: new Set(c.paths), commands: new Set(c.commands), terms: new Set(c.terms),
|
|
@@ -99,6 +108,10 @@ export function composeChapters(events, spanStart, spanEnd, collections, config)
|
|
|
99
108
|
return hit !== undefined && hit.title !== '' ? hit.title : undefined;
|
|
100
109
|
};
|
|
101
110
|
const chapters = [];
|
|
111
|
+
// Contiguity bookkeeping (#59): the first range starts at the SPAN, not at its collection, and each
|
|
112
|
+
// later range starts one past the previous end — that is what absorbs an unsigned-but-completed
|
|
113
|
+
// turn instead of dropping it. `pendingLo` is the next legal start.
|
|
114
|
+
let pendingLo = spanStart;
|
|
102
115
|
let running = runningOf(usable[0]);
|
|
103
116
|
// True after a plan closed the chapter: the NEXT collection opens the next
|
|
104
117
|
// chapter, it is never merged backwards (and never re-added — a duplicate
|
|
@@ -147,11 +160,16 @@ export function composeChapters(events, spanStart, spanEnd, collections, config)
|
|
|
147
160
|
closedAtPlan = true;
|
|
148
161
|
}
|
|
149
162
|
}
|
|
163
|
+
// Half one of §4.3 still binds: never archive past the last COMPLETED turn. `spanEnd` is the
|
|
164
|
+
// caller's anchor and normally IS a turn/end, so this is the identity; when a manual `/compact`
|
|
165
|
+
// hands a span that cuts a turn, the clamp keeps the unfinished tail live instead of absorbing
|
|
166
|
+
// it. Both halves of the guard, one line: nothing unfinished in, nothing finished out.
|
|
167
|
+
const lastCompletedEnd = events.reduce((m, e) => (e.type === 'turn/end' && e.seq <= spanEnd && e.seq > m ? e.seq : m), spanStart);
|
|
150
168
|
if (!closedAtPlan)
|
|
151
|
-
close();
|
|
152
|
-
function close() {
|
|
153
|
-
const lo =
|
|
154
|
-
const hi = running.endSeq;
|
|
169
|
+
close(lastCompletedEnd);
|
|
170
|
+
function close(hiOverride) {
|
|
171
|
+
const lo = pendingLo;
|
|
172
|
+
const hi = hiOverride ?? running.endSeq;
|
|
155
173
|
const identity = deriveIdentity(messagesOf(events, lo, hi), false, firstPlanTitleIn(lo, hi));
|
|
156
174
|
const pathsHint = [...running.paths].slice(0, 3).join(', ');
|
|
157
175
|
chapters.push({
|
|
@@ -160,6 +178,7 @@ export function composeChapters(events, spanStart, spanEnd, collections, config)
|
|
|
160
178
|
startSeq: lo,
|
|
161
179
|
endSeq: hi,
|
|
162
180
|
});
|
|
181
|
+
pendingLo = hi + 1;
|
|
163
182
|
}
|
|
164
183
|
return { chapters, notes, unarchivedSeqs };
|
|
165
184
|
}
|