driverkit 0.0.0-stage → 0.1.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/CONTROLS.md +578 -0
- package/README.md +104 -2
- package/dist/agent/backend.d.ts +69 -0
- package/dist/agent/backend.d.ts.map +1 -0
- package/dist/agent/backend.js +130 -0
- package/dist/agent/backend.js.map +1 -0
- package/dist/agent/control.d.ts +148 -0
- package/dist/agent/control.d.ts.map +1 -0
- package/dist/agent/control.js +342 -0
- package/dist/agent/control.js.map +1 -0
- package/dist/agent/index.d.ts +9 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +6 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/loop.d.ts +136 -0
- package/dist/agent/loop.d.ts.map +1 -0
- package/dist/agent/loop.js +824 -0
- package/dist/agent/loop.js.map +1 -0
- package/dist/agent/render.d.ts +173 -0
- package/dist/agent/render.d.ts.map +1 -0
- package/dist/agent/render.js +425 -0
- package/dist/agent/render.js.map +1 -0
- package/dist/agent/tools.d.ts +138 -0
- package/dist/agent/tools.d.ts.map +1 -0
- package/dist/agent/tools.js +622 -0
- package/dist/agent/tools.js.map +1 -0
- package/dist/agent/types.d.ts +566 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +32 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/browser/budget.d.ts +92 -0
- package/dist/browser/budget.d.ts.map +1 -0
- package/dist/browser/budget.js +151 -0
- package/dist/browser/budget.js.map +1 -0
- package/dist/browser/connect.d.ts +368 -0
- package/dist/browser/connect.d.ts.map +1 -0
- package/dist/browser/connect.js +1038 -0
- package/dist/browser/connect.js.map +1 -0
- package/dist/browser/elsewhere.d.ts +89 -0
- package/dist/browser/elsewhere.d.ts.map +1 -0
- package/dist/browser/elsewhere.js +91 -0
- package/dist/browser/elsewhere.js.map +1 -0
- package/dist/browser/frames.d.ts +85 -0
- package/dist/browser/frames.d.ts.map +1 -0
- package/dist/browser/frames.js +11 -0
- package/dist/browser/frames.js.map +1 -0
- package/dist/browser/index.d.ts +8 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +9 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/check/check.d.ts +171 -0
- package/dist/check/check.d.ts.map +1 -0
- package/dist/check/check.js +666 -0
- package/dist/check/check.js.map +1 -0
- package/dist/check/index.d.ts +3 -0
- package/dist/check/index.d.ts.map +1 -0
- package/dist/check/index.js +2 -0
- package/dist/check/index.js.map +1 -0
- package/dist/check/types.d.ts +149 -0
- package/dist/check/types.d.ts.map +1 -0
- package/dist/check/types.js +29 -0
- package/dist/check/types.js.map +1 -0
- package/dist/controls/controls.d.ts +198 -0
- package/dist/controls/controls.d.ts.map +1 -0
- package/dist/controls/controls.js +742 -0
- package/dist/controls/controls.js.map +1 -0
- package/dist/controls/dom.d.ts +108 -0
- package/dist/controls/dom.d.ts.map +1 -0
- package/dist/controls/dom.js +56 -0
- package/dist/controls/dom.js.map +1 -0
- package/dist/controls/index.d.ts +26 -0
- package/dist/controls/index.d.ts.map +1 -0
- package/dist/controls/index.js +23 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/controls/rows.d.ts +66 -0
- package/dist/controls/rows.d.ts.map +1 -0
- package/dist/controls/rows.js +127 -0
- package/dist/controls/rows.js.map +1 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/registry.d.ts +192 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +2799 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/types.d.ts +2468 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +19 -0
- package/dist/core/types.js.map +1 -0
- package/dist/otel/index.d.ts +122 -0
- package/dist/otel/index.d.ts.map +1 -0
- package/dist/otel/index.js +157 -0
- package/dist/otel/index.js.map +1 -0
- package/dist/react/index.d.ts +191 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +547 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/runtime.d.ts +95 -0
- package/dist/react/runtime.d.ts.map +1 -0
- package/dist/react/runtime.js +54 -0
- package/dist/react/runtime.js.map +1 -0
- package/dist/react/store.d.ts +333 -0
- package/dist/react/store.d.ts.map +1 -0
- package/dist/react/store.js +695 -0
- package/dist/react/store.js.map +1 -0
- package/dist/relay/auth.d.ts +244 -0
- package/dist/relay/auth.d.ts.map +1 -0
- package/dist/relay/auth.js +391 -0
- package/dist/relay/auth.js.map +1 -0
- package/dist/relay/frames.d.ts +141 -0
- package/dist/relay/frames.d.ts.map +1 -0
- package/dist/relay/frames.js +20 -0
- package/dist/relay/frames.js.map +1 -0
- package/dist/relay/index.d.ts +8 -0
- package/dist/relay/index.d.ts.map +1 -0
- package/dist/relay/index.js +4 -0
- package/dist/relay/index.js.map +1 -0
- package/dist/relay/relay.d.ts +277 -0
- package/dist/relay/relay.d.ts.map +1 -0
- package/dist/relay/relay.js +1026 -0
- package/dist/relay/relay.js.map +1 -0
- package/dist/relay/serve.d.ts +33 -0
- package/dist/relay/serve.d.ts.map +1 -0
- package/dist/relay/serve.js +86 -0
- package/dist/relay/serve.js.map +1 -0
- package/dist/widget/chat.d.ts +290 -0
- package/dist/widget/chat.d.ts.map +1 -0
- package/dist/widget/chat.js +486 -0
- package/dist/widget/chat.js.map +1 -0
- package/dist/widget/css.d.ts +49 -0
- package/dist/widget/css.d.ts.map +1 -0
- package/dist/widget/css.js +532 -0
- package/dist/widget/css.js.map +1 -0
- package/dist/widget/dom.d.ts +143 -0
- package/dist/widget/dom.d.ts.map +1 -0
- package/dist/widget/dom.js +27 -0
- package/dist/widget/dom.js.map +1 -0
- package/dist/widget/highlight.d.ts +64 -0
- package/dist/widget/highlight.d.ts.map +1 -0
- package/dist/widget/highlight.js +136 -0
- package/dist/widget/highlight.js.map +1 -0
- package/dist/widget/index.d.ts +9 -0
- package/dist/widget/index.d.ts.map +1 -0
- package/dist/widget/index.js +20 -0
- package/dist/widget/index.js.map +1 -0
- package/dist/widget/position.d.ts +166 -0
- package/dist/widget/position.d.ts.map +1 -0
- package/dist/widget/position.js +497 -0
- package/dist/widget/position.js.map +1 -0
- package/dist/widget/settings.d.ts +116 -0
- package/dist/widget/settings.d.ts.map +1 -0
- package/dist/widget/settings.js +117 -0
- package/dist/widget/settings.js.map +1 -0
- package/dist/widget/widget.d.ts +442 -0
- package/dist/widget/widget.d.ts.map +1 -0
- package/dist/widget/widget.js +2005 -0
- package/dist/widget/widget.js.map +1 -0
- package/package.json +153 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAW3D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AA2H1F;;;;;;;;;;GAUG;AACH,MAAM,OAAO,GAAoC;IAC/C,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAmB;IAMnD,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC;IAE9B;;;;;;;;;OASG;IACH,SAAS,SAAS,CAAC,MAAc,EAAE,OAAqB;QACtD,2EAA2E;QAC3E,oEAAoE;QACpE,MAAM,CAAC,EAAE,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n * driverkit/react — the same panel, for a team that already has React.\n *\n * WHY THIS EXISTS BESIDE `driverkit/widget` AND NOT INSTEAD OF IT.\n * `mountWidget` is hand-written DOM in a shadow root with zero dependencies,\n * and that is the right shape for a drop-in: it goes into a Thymeleaf\n * template, a Rails view or a static page, and the host owns no version of\n * anything it did not pick. It is the wrong shape for a team that has React, a\n * design system and an opinion about what their product looks like — for them\n * the shadow root is a wall around the panel and the hand-written markup is\n * something to fight. So there are two paths. **The vanilla widget's\n * dependency count stays zero and its behaviour is untouched by anything in\n * here.**\n *\n * WHAT THE PUBLIC SURFACE IS, AND WHY IT IS THIS ONE. Three things, in\n * decreasing order of how much they assume:\n *\n * `createDriverPanel(React)` returns everything. One call, because React\n * itself is an argument rather than an import — see `runtime.ts`, which is\n * the file to read before judging that.\n *\n * `useDriver(driver, options)` is the primitive, and it is the whole\n * library: the conversation, the gate, the run controls, the budget and the\n * receipts, as plain data and plain functions. A host that renders none of\n * our components still gets all of the behaviour. This is deliberately the\n * thing the documentation leads with, because a team adopting this has a\n * design system and headless-with-defaults is the only shape that respects\n * one.\n *\n * `<DriverPanel />` is one assembly of the components, for the team that\n * wants a panel today and will restyle it on Thursday. Every part of it is\n * replaceable one at a time through `components`, so \"restyle it\" never has\n * to become \"fork it\".\n *\n * Both, rather than one, because the two audiences are real and a single\n * `<DriverPanel />` would make the design-system team reimplement the gate —\n * which is the one thing in here nobody should be reimplementing.\n *\n * WHAT IS DELIBERATELY ABSENT, with the vanilla widget's own reasoning\n * re-examined rather than copied; `REACT.md` has the full list:\n *\n * **No shadow root.** The vanilla panel needs one because it is rendering\n * into an app whose CSS it has never seen. A React app has a CSS isolation\n * story of its own — modules, Tailwind, styled-components, whatever it\n * picked — and a shadow root would break it: the host's own class names\n * would not reach inside, which is the opposite of the point.\n *\n * **No launcher, no drag, no corner.** Those exist because the vanilla\n * widget has to place itself in a page nobody told it about. Here the host\n * renders `<DriverPanel />` where it wants it, in its own layout, and a\n * library that positioned itself `fixed` would be overriding a decision the\n * host is better placed to make.\n *\n * **No `aria-live` on the transcript**, which the vanilla panel has and\n * which is a bug at a 600ms pace: a live region containing the whole\n * conversation is re-read as each step row lands, so the person hears a\n * growing transcript from the top instead of what just changed. State is\n * announced instead, through small `role=\"status\"` regions that say one\n * thing — see `ReceiptStatus` and `RunAnnouncer`.\n *\n * **No `textContent` discipline, because React is the discipline.** The\n * vanilla file keeps `innerHTML` out of its DOM wrapper on purpose; here the\n * equivalent rule is that nothing in this area calls\n * `dangerouslySetInnerHTML`, including at the markdown seam, where a host\n * supplies a COMPONENT and never a string of HTML.\n *\n * The `era` counter is kept, and that one is worth saying out loud: React does\n * not help with it. A `setState` from an async callback that outlived a Clear\n * is exactly as wrong as the `appendChild` it replaced. See `store.ts`.\n */\n\nimport { commas } from \"../agent/index.ts\";\nimport type { ApprovalRequest, Driver, Scalar } from \"../core/index.ts\";\nimport type { Component, ReactRuntime } from \"./runtime.ts\";\nimport { createPanelStore, receiptLine } from \"./store.ts\";\nimport type {\n ApprovalEntry,\n Decision,\n PanelOptions,\n PanelSnapshot,\n PanelStore,\n SaidEntry,\n StepEntry,\n} from \"./store.ts\";\n\nexport { COMMIT_ASK_ABOVE, createPanelStore, receiptLine, stepOutcome } from \"./store.ts\";\nexport type {\n ApprovalEntry,\n ApprovalPhase,\n Decision,\n Entry,\n Grant,\n PanelOptions,\n PanelSnapshot,\n PanelStore,\n RunControlsFactory,\n SaidEntry,\n StepEntry,\n StepStatus,\n} from \"./store.ts\";\nexport type { Component, Node, ReactRuntime } from \"./runtime.ts\";\n\n/** What `useDriver` hands back: the snapshot, flattened, plus the actions. */\nexport interface Driving extends PanelSnapshot {\n ask: (text: string) => Promise<void>;\n stop: () => void;\n clear: () => void;\n pause: () => void;\n resume: () => void;\n step: () => void;\n setPace: (ms: number) => void;\n setStepMode: (on: boolean) => void;\n setConfirmCommits: (on: boolean) => void;\n decide: (id: string, decision: Decision) => void;\n revoke: (verb: string) => void;\n /** This panel's gate, as a `MountOptions.approve` hook. Wire it up with a\n * forward reference so a commit arriving over the relay renders the same\n * card. See `PanelStore.approve`. */\n approve: (req: ApprovalRequest) => Promise<unknown>;\n /** The store itself, for a host that wants to reach past the hook. */\n store: PanelStore;\n}\n\n/**\n * The markdown seam.\n *\n * **Markdown rendering is not built here and must not be.** It is being built\n * for the vanilla widget, and when it lands this is where it plugs in: a\n * component that is handed the model's prose for one turn and returns nodes.\n *\n * What it can rely on: `text` is the model's **complete** text for that turn.\n * `onSay` delivers a whole turn at once — driverkit does not stream tokens —\n * so a renderer here never sees a half-written fence, never has to parse\n * incrementally, and needs none of the streaming-markdown machinery the rest\n * of the world needs. It is called on render, so it must be pure and should be\n * memoized by the host if its parse is expensive.\n *\n * What it must not do: return HTML for React to inject. The prop is a\n * component precisely so that the escape hatch is not a string — a markdown\n * renderer that handed us `dangerouslySetInnerHTML` would make a model's\n * output into a script tag in the host's page, and the model's output is the\n * least trusted thing on this screen.\n */\nexport type ProseRenderer = Component<{ text: string }>;\n\nexport interface PanelComponents {\n Transcript: Component<TranscriptProps>;\n Said: Component<{ entry: SaidEntry; Prose: ProseRenderer }>;\n StepRow: Component<{ entry: StepEntry }>;\n ApprovalCard: Component<ApprovalCardProps>;\n RunControlsBar: Component<RunControlsBarProps>;\n Composer: Component<ComposerProps>;\n BudgetNotice: Component<{ driving: Driving }>;\n GrantList: Component<{ driving: Driving }>;\n Prose: ProseRenderer;\n}\n\nexport interface TranscriptProps {\n driving: Driving;\n components: PanelComponents;\n /** Whether the approval cards offer the free-text note. From\n * `PanelOptions.notes`, threaded through here rather than read from the\n * options by each card, so that a host replacing one component does not\n * have to re-plumb an option it did not change. */\n notes: boolean;\n}\n\nexport interface ApprovalCardProps {\n entry: ApprovalEntry;\n decide: (id: string, decision: Decision) => void;\n /** Whether to offer the free-text note. From `PanelOptions.notes`. */\n notes: boolean;\n}\n\nexport interface RunControlsBarProps {\n driving: Driving;\n}\n\nexport interface ComposerProps {\n driving: Driving;\n placeholder?: string;\n}\n\nexport interface DriverPanelProps {\n driver: Driver;\n options: PanelOptions;\n placeholder?: string;\n /** Replace any part of the default assembly, one piece at a time. */\n components?: Partial<PanelComponents>;\n /** Render the model's prose. The markdown seam; see `ProseRenderer`. */\n Prose?: ProseRenderer;\n}\n\n/**\n * One store, and the mounted components holding it.\n *\n * `holds` is why this is an object rather than two refs: the hook's cleanup\n * and its next mount have to agree about whether anybody still wants the\n * store, and the cleanup closes over the holding it was mounted with — which\n * is also what makes a `driver` change tear down the right store rather than\n * the current one.\n */\ninterface Holding {\n driver: Driver;\n store: PanelStore;\n holds: number;\n}\n\n/**\n * Visually hidden and still read aloud.\n *\n * Inline rather than a stylesheet because this area ships no CSS at all — a\n * headless library that injected a `<style>` would be making exactly the\n * decision it claims to leave to the host. These five properties are the one\n * exception, and they are not a look: a `role=\"status\"` that is `display:\n * none` is not announced, and one that is merely off-screen with `width: 0`\n * is skipped by some screen readers, so the clip has to be right or the\n * announcement does not happen.\n */\nconst SR_ONLY: Record<string, string | number> = {\n position: \"absolute\",\n width: 1,\n height: 1,\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n whiteSpace: \"nowrap\",\n};\n\n/**\n * Bind this area to the host's React and get the panel.\n *\n * ```tsx\n * // driver-panel.tsx — one file you own\n * import * as React from \"react\";\n * import { createDriverPanel } from \"driverkit/react\";\n *\n * export const { DriverPanel, useDriver, components } = createDriverPanel(React);\n * ```\n *\n * Everything after that line is ordinary React. See `runtime.ts` for why the\n * line is there at all.\n */\nexport function createDriverPanel(react: ReactRuntime): {\n useDriver: (driver: Driver, options: PanelOptions) => Driving;\n DriverPanel: Component<DriverPanelProps>;\n /** The default components, so a host can wrap one instead of writing it. */\n components: PanelComponents;\n} {\n const h = react.createElement;\n\n /**\n * The whole library, as a hook.\n *\n * The store is built once per `driver` and the options are read then — which\n * is a real constraint and so it is said plainly: changing `think` or\n * `maxSteps` on a later render does not change a store that already exists.\n * The things a person changes while watching a run (the pace, step mode,\n * confirmations) are not options but state, with setters, for exactly that\n * reason. A host that genuinely needs new options re-keys the component.\n */\n function useDriver(driver: Driver, options: PanelOptions): Driving {\n // Forces one re-render, for the single case the effect below cannot repair\n // on its own: a mount onto a store that has already been torn down.\n const [, revive] = react.useState(0);\n const held = react.useRef<Holding | null>(null);\n if (held.current === null || held.current.driver !== driver) {\n // The outgoing store is NOT destroyed here. Render must not tear\n // anything down: React may double-invoke this function, or throw the\n // render away entirely, and `destroy` aborts a run and lapses an open\n // question — the two things that must not happen speculatively. The\n // effect below owns the teardown, and a `driver` change reaches it as a\n // changed dependency.\n held.current = { driver, store: createPanelStore(driver, options), holds: 0 };\n }\n const holding = held.current;\n const store = holding.store;\n\n // The run is aborted and any open question is answered `lapsed` when the\n // last holder goes. Not `denied`: nobody refused it, and the record must\n // not say somebody did. See `store.ts`.\n //\n // WHY THIS IS A RETAIN COUNT AND A DEFERRED TEARDOWN rather than the one\n // line it looks like it should be. `destroy` is final — it clears the\n // listeners and latches the store closed, so `ask` returns immediately\n // afterwards. React mounts an effect, runs its cleanup and mounts it again\n // in StrictMode, which is how every React app runs in development, and a\n // plain `return () => store.destroy()` therefore kills the store during\n // mount and leaves the adopter a panel whose composer does nothing. That\n // was real: it is what this hook did, and it was invisible here until\n // there was a React to render it with. So the cleanup gives up its hold\n // and defers the decision past the synchronous remount; only a hold count\n // that is still zero one microtask later is an unmount.\n react.useEffect(() => {\n if (holding.store.destroyed()) {\n // A remount onto a torn-down store — a hide and a re-show far enough\n // apart that the microtask already ran. Nothing can revive the store,\n // so build another one; the conversation is gone either way, because\n // the panel was not on screen.\n held.current = null;\n revive((n) => n + 1);\n return;\n }\n holding.holds += 1;\n return () => {\n holding.holds -= 1;\n queueMicrotask(() => {\n if (holding.holds === 0) holding.store.destroy();\n });\n };\n }, [holding]);\n\n const snapshot = react.useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getSnapshot,\n );\n\n return react.useMemo(\n () => ({\n ...snapshot,\n ask: store.ask,\n stop: store.stop,\n clear: store.clear,\n pause: store.pause,\n resume: store.resume,\n step: store.step,\n setPace: store.setPace,\n setStepMode: store.setStepMode,\n setConfirmCommits: store.setConfirmCommits,\n decide: store.decide,\n revoke: store.revoke,\n approve: store.approve,\n store,\n }),\n [snapshot, store],\n );\n }\n\n /** The default prose renderer: the model's text, as text. The seam's\n * identity function, so a host that plugs in markdown is replacing\n * something rather than filling a hole. */\n const Prose: ProseRenderer = ({ text }) => text;\n\n const Said: PanelComponents[\"Said\"] = ({ entry, Prose: Render }) =>\n h(\n \"div\",\n { className: `dk-${entry.kind}`, \"data-dk\": entry.kind },\n entry.kind === \"assistant\" ? h(Render, { text: entry.text }) : entry.text,\n );\n\n const StepRow: PanelComponents[\"StepRow\"] = ({ entry }) =>\n h(\n \"div\",\n {\n className: `dk-step dk-step-${entry.status}${entry.commit ? \" dk-step-commit\" : \"\"}`,\n \"data-dk\": \"step\",\n \"data-status\": entry.status,\n // The marker for a commit is on the row for the person as well as in\n // the prompt for the model. This is the row somebody scrolls back to\n // when they want to know what changed their data.\n ...(entry.commit ? { title: \"Changes data, and may be irreversible.\" } : {}),\n },\n // The row's text reads the same whether somebody looked at it while it\n // was pending or a minute afterwards: the state is an attribute, never\n // part of the sentence.\n `${entry.verb}${entry.verbKind ? ` (${entry.verbKind})` : \"\"}${argSummary(entry.args)}`,\n entry.outcome === undefined ? null : ` · ${entry.outcome}`,\n );\n\n /**\n * The receipt's status line: one region that stays, and a line inside it\n * that is replaced on every phase change.\n *\n * THE STRUCTURE IS THE POINT, and the first version of it had it inside out,\n * so the reasoning is written down rather than implied. The region itself —\n * the `role=\"status\"`, which is also the focus target — is mounted once,\n * when the phase leaves `asking`, and then stays. Only the line inside it is\n * keyed on the phase, so each new verdict replaces a node rather than\n * mutating the text of one.\n *\n * Three things follow, and the earlier shape (the key on this component, so\n * that the whole region remounted) got two of them wrong:\n *\n * **Focus moves once.** It moves here the first time the phase leaves\n * `asking`, so somebody who pressed a button lands on the answer rather\n * than on whatever followed the buttons that have just gone — and never\n * again, because a receipt that stole focus when the app's verdict\n * arrived a moment later would yank somebody out of the message they had\n * started typing. A remounting region made that promise false twice over:\n * the `moved` ref died with the old node so the move ran again on every\n * phase, and had it not, the node holding focus would have been removed\n * from the document and the focus dropped to `<body>`. Both were real and\n * both are now tested — see `test/react-dom.test.ts`, which is the first\n * thing in this repository to render this file with React.\n *\n * **The announcement still happens.** A live region is announced when its\n * contents change while it is in the document; a region inserted together\n * with its text is the case screen readers most often miss. Keeping the\n * region and replacing the line inside it is therefore the more reliable\n * of the two shapes, not a concession — and the `key` is still\n * load-bearing, because it is what makes the line a new node instead of an\n * updated one.\n *\n * **`data-phase` is on the region**, where a stylesheet and a test can\n * find it without caring which node holds the words.\n */\n const ReceiptStatus: Component<{ entry: ApprovalEntry; decided: boolean }> = ({\n entry,\n decided,\n }) => {\n const node = react.useRef<{ focus?: () => void } | null>(null);\n const moved = react.useRef(false);\n react.useEffect(() => {\n if (!decided || moved.current) return;\n moved.current = true;\n node.current?.focus?.();\n }, [decided]);\n return h(\n \"div\",\n {\n ref: node,\n // -1 so it can be focused programmatically and is not a tab stop. The\n // receipt is a record, not a control.\n tabIndex: -1,\n role: \"status\",\n className: \"dk-ask-said\",\n \"data-dk\": \"receipt\",\n \"data-phase\": entry.phase,\n },\n h(\"span\", { key: entry.phase, className: \"dk-ask-line\" }, receiptLine(entry)),\n );\n };\n\n /**\n * The question, and then the receipt it becomes. **The same element either\n * way.**\n *\n * The card does not unmount when it is answered: the buttons are replaced by\n * the status line, in place, keeping the question's own words and its\n * position in scrollback. The vanilla panel keeps the row too but tells the\n * person only that they answered; this also says what the APP then did,\n * which is the half that turns a decision into a record of a change.\n */\n const ApprovalCard: PanelComponents[\"ApprovalCard\"] = ({ entry, decide, notes }) => {\n const [note, setNote] = react.useState(\"\");\n const asking = entry.phase === \"asking\";\n\n const why =\n (entry.reversible\n ? \"This changes data, but the app says this can be undone.\" +\n (entry.large\n ? \" You are being asked because of how many rows it affects: an undo over this\" +\n \" many is a promise an app may not be able to keep.\"\n : \"\")\n : \"This changes data and may be irreversible.\") +\n (entry.count === undefined\n ? \" No count was reported, so nobody can tell you how many rows it affects.\"\n : \"\");\n\n return h(\n \"div\",\n {\n className: `dk-ask dk-ask-${entry.phase}`,\n \"data-dk\": \"approval\",\n \"data-phase\": entry.phase,\n },\n h(\n \"div\",\n { className: \"dk-ask-q\" },\n entry.count === undefined\n ? `${entry.describe}?`\n : `${entry.describe} — ${commas(entry.count)} rows?`,\n ),\n h(\"div\", { className: \"dk-ask-why\" }, why + argSummary(entry.args)),\n asking\n ? h(\n \"div\",\n { className: \"dk-ask-actions\" },\n notes\n ? h(\"label\", { className: \"dk-ask-note\" }, [\n h(\"span\", { key: \"l\" }, \"Why? (optional, sent to the model on a refusal)\"),\n h(\"textarea\", {\n key: \"t\",\n value: note,\n rows: 2,\n onChange: (e: { target: { value: string } }) => setNote(e.target.value),\n // Enter does not submit. Typing here is a comment and must\n // never be the thing that authorizes a call; a field that\n // answered the question on Enter would make the note the\n // decision.\n onKeyDown: (e: { key: string; stopPropagation: () => void }) => {\n if (e.key === \"Enter\") e.stopPropagation();\n },\n }),\n ])\n : null,\n // \"No\" first in the DOM, so it is the first of the two a keyboard\n // reaches. Reaching \"Yes\" takes one more deliberate key, which is\n // the right way round for a button that can accept a thousand rows.\n h(\n \"button\",\n {\n key: \"no\",\n type: \"button\",\n className: \"dk-no\",\n onClick: () => decide(entry.id, { allow: false, note }),\n },\n \"No\",\n ),\n h(\n \"button\",\n {\n key: \"yes\",\n type: \"button\",\n className: \"dk-yes\",\n onClick: () => decide(entry.id, { allow: true, note }),\n },\n \"Yes, do it\",\n ),\n // The standing rules, each labelled with the rule itself rather\n // than with \"always\". The exact text that will be installed is on\n // screen before the click, which is the only way somebody can be\n // said to have agreed to it.\n entry.grantOffer === undefined\n ? null\n : h(\n \"div\",\n { key: \"grants\", className: \"dk-ask-grants\" },\n h(\n \"button\",\n {\n key: \"ar\",\n type: \"button\",\n className: \"dk-no-always\",\n onClick: () => decide(entry.id, { allow: false, always: true, note }),\n },\n grantLabel(entry.verb, false),\n ),\n h(\n \"button\",\n {\n key: \"aa\",\n type: \"button\",\n className: \"dk-yes-always\",\n onClick: () => decide(entry.id, { allow: true, always: true, note }),\n },\n grantLabel(entry.verb, true),\n ),\n ),\n )\n : // NO `key` on this: the region must not remount when the phase\n // moves on. The keyed node is the line inside it. See\n // `ReceiptStatus`.\n h(ReceiptStatus, { entry, decided: true }),\n entry.note === undefined || entry.note === \"\"\n ? null\n : h(\"div\", { className: \"dk-ask-noted\" }, `You noted: ${entry.note}`),\n );\n };\n\n const Transcript: PanelComponents[\"Transcript\"] = ({ driving, components, notes }) =>\n h(\n \"div\",\n {\n className: \"dk-log\",\n \"data-dk\": \"transcript\",\n // NO `aria-live`. The vanilla panel puts `aria-live=\"polite\"` on this\n // container, and at a 600ms pace that means the whole conversation is\n // re-read as each step row lands — a live region nobody can use. The\n // state is announced instead, in one-sentence `role=\"status\"` regions:\n // `RunAnnouncer` for the run, `ReceiptStatus` for a decision.\n },\n driving.entries.map((entry) =>\n entry.kind === \"step\"\n ? h(components.StepRow, { key: entry.id, entry })\n : entry.kind === \"approval\"\n ? h(components.ApprovalCard, {\n key: entry.id,\n entry,\n decide: driving.decide,\n notes,\n })\n : h(components.Said, { key: entry.id, entry, Prose: components.Prose }),\n ),\n );\n\n /**\n * One short sentence about what the run is doing, for somebody who cannot see\n * the buttons change.\n *\n * Rendered only while a run is in flight: a status region that said\n * \"running\" to an idle panel would be announcing the absence of news.\n *\n * Same shape as `ReceiptStatus` and for the same reason: the region stays\n * mounted and the sentence inside it is keyed, so each change replaces a\n * node in a region that was already in the document. A live region inserted\n * with its text already in it is the case screen readers most often miss.\n */\n const RunAnnouncer: Component<{ driving: Driving }> = ({ driving }) => {\n const said =\n driving.runState === \"paused\"\n ? \"Run paused\"\n : driving.runState === \"awaiting-approval\"\n ? \"Waiting for you\"\n : \"Run continuing\";\n return h(\n \"div\",\n { role: \"status\", style: SR_ONLY },\n h(\"span\", { key: said }, driving.busy ? said : \"\"),\n );\n };\n\n const RunControlsBar: PanelComponents[\"RunControlsBar\"] = ({ driving }) => {\n if (!driving.busy) return null;\n const held = driving.runState === \"paused\";\n return h(\n \"div\",\n { className: \"dk-run\", \"data-dk\": \"controls\" },\n h(\n \"button\",\n {\n key: \"pause\",\n type: \"button\",\n className: \"dk-pause\",\n \"aria-label\": held ? \"Resume the run\" : \"Pause the run\",\n onClick: () => (held ? driving.resume() : driving.pause()),\n },\n held ? \"Resume\" : \"Pause\",\n ),\n h(\n \"button\",\n { key: \"step\", type: \"button\", className: \"dk-once\", onClick: () => driving.step() },\n \"Step\",\n ),\n // Stop is the abort signal and nothing else, which is also why it is not\n // on `RunControls`: an abort outranks a pause, so a held run is still\n // stoppable and never wedged.\n h(\n \"button\",\n { key: \"stop\", type: \"button\", className: \"dk-stop\", onClick: () => driving.stop() },\n \"Stop\",\n ),\n // The pace, visibly and changeably, because the person watching their own\n // screen move is the one who should decide how fast it moves. Named\n // speeds rather than a free slider: a number of milliseconds is not a\n // thing anybody has an opinion about, and a radio group of four labelled\n // buttons is reachable with a keyboard without anybody being careful\n // about it forever.\n h(\n \"div\",\n { key: \"pace\", className: \"dk-speeds\", role: \"radiogroup\", \"aria-label\": \"Pace\" },\n SPEEDS.map((speed) =>\n h(\n \"button\",\n {\n key: speed.id,\n type: \"button\",\n role: \"radio\",\n \"aria-checked\": nearest(driving.paceMs).id === speed.id,\n className: \"dk-speed\",\n onClick: () => driving.setPace(speed.ms),\n },\n speed.label,\n ),\n ),\n ),\n h(\n \"span\",\n { key: \"note\", className: \"dk-run-note\" },\n driving.runState === \"paused\"\n ? \"Paused\"\n : // Not \"running\": the run is waiting for the person, and a panel\n // that said \"running\" there would be telling them to wait for the\n // thing that is waiting for them.\n driving.runState === \"awaiting-approval\"\n ? \"Waiting for you\"\n : `${nearest(driving.paceMs).label} · ${driving.paceMs} ms a step`,\n ),\n h(RunAnnouncer, { key: \"live\", driving }),\n );\n };\n\n const Composer: PanelComponents[\"Composer\"] = ({ driving, placeholder }) => {\n const [draft, setDraft] = react.useState(\"\");\n return h(\n \"form\",\n {\n className: \"dk-form\",\n onSubmit: (e: { preventDefault: () => void }) => {\n e.preventDefault();\n const text = draft.trim();\n if (text === \"\" || driving.busy) return;\n setDraft(\"\");\n void driving.ask(text);\n },\n },\n h(\"input\", {\n key: \"input\",\n type: \"text\",\n className: \"dk-input\",\n value: draft,\n ...(placeholder === undefined ? {} : { placeholder }),\n onChange: (e: { target: { value: string } }) => setDraft(e.target.value),\n }),\n h(\n \"button\",\n { key: \"send\", type: \"submit\", className: \"dk-send\", disabled: driving.busy },\n \"Send\",\n ),\n );\n };\n\n /**\n * The session's ceiling, where the app declared one.\n *\n * The one thing on the panel with no control beside it, and the reason\n * `Driver.budget` exists at all: `MountOptions.budget` is set by whoever\n * mounted the app, and a viewer must not be able to raise their own ceiling.\n * Shown before the ceiling is reached rather than only after, because a run\n * that stops mid-job and does not say why is read as a broken app.\n *\n * Absent when the app declared no ceiling. A line reading \"no limit\" would be\n * one more thing to read; the counter is still on `Driver.budget` for anybody\n * debugging.\n */\n const BudgetNotice: PanelComponents[\"BudgetNotice\"] = ({ driving }) => {\n const spend = driving.budget;\n if (!spend) return null;\n const parts: string[] = [];\n if (spend.calls.limit !== undefined) {\n parts.push(`${spend.calls.used} of ${spend.calls.limit} steps used`);\n }\n if (spend.commits.limit !== undefined) {\n parts.push(`${spend.commits.used} of ${spend.commits.limit} changes to data used`);\n }\n if (parts.length === 0) return null;\n return h(\n \"div\",\n { className: \"dk-budget\", \"data-dk\": \"budget\" },\n h(\"span\", { key: \"l\", className: \"dk-budget-label\" }, \"This session's limit\"),\n h(\"span\", { key: \"v\", className: \"dk-budget-value\" }, parts.join(\" · \")),\n h(\n \"span\",\n { key: \"w\", className: \"dk-budget-why\" },\n \"Set by the app, not by this panel, so it cannot be changed from here.\",\n ),\n );\n };\n\n /** The standing rules, and a way to take one back. A grant nobody can see is\n * a grant nobody can revoke. */\n const GrantList: PanelComponents[\"GrantList\"] = ({ driving }) => {\n if (driving.grants.length === 0) return null;\n return h(\n \"div\",\n { className: \"dk-grants\", \"data-dk\": \"grants\" },\n h(\"span\", { key: \"l\" }, \"Standing rules for this session\"),\n h(\n \"ul\",\n { key: \"u\" },\n driving.grants.map((grant) =>\n h(\n \"li\",\n { key: grant.verb },\n grant.rule,\n h(\n \"button\",\n {\n key: \"r\",\n type: \"button\",\n onClick: () => driving.revoke(grant.verb),\n },\n \"Revoke\",\n ),\n ),\n ),\n ),\n );\n };\n\n const components: PanelComponents = {\n Transcript,\n Said,\n StepRow,\n ApprovalCard,\n RunControlsBar,\n Composer,\n BudgetNotice,\n GrantList,\n Prose,\n };\n\n const DriverPanel: Component<DriverPanelProps> = (props) => {\n const driving = useDriver(props.driver, props.options);\n const parts: PanelComponents = {\n ...components,\n ...props.components,\n ...(props.Prose === undefined ? {} : { Prose: props.Prose }),\n };\n return h(\n \"div\",\n { className: \"dk-panel\", \"data-dk\": \"panel\" },\n h(parts.Transcript, {\n key: \"log\",\n driving,\n components: parts,\n notes: props.options.notes === true,\n }),\n h(parts.RunControlsBar, { key: \"controls\", driving }),\n h(parts.GrantList, { key: \"grants\", driving }),\n h(parts.BudgetNotice, { key: \"budget\", driving }),\n h(parts.Composer, {\n key: \"composer\",\n driving,\n ...(props.placeholder === undefined ? {} : { placeholder: props.placeholder }),\n }),\n );\n };\n\n return { useDriver, DriverPanel, components };\n}\n\n/**\n * The named speeds, re-declared for the same reason `COMMIT_ASK_ABOVE` is:\n * `src/widget/settings.ts` is the vanilla panel's, and importing it would pull\n * that area's `localStorage` access and its DOM types into a React bundle.\n * `test/react.test.ts` pins that the two lists agree.\n */\nconst SPEEDS: ReadonlyArray<{ id: string; label: string; ms: number }> = [\n { id: \"fast\", label: \"Fast\", ms: 250 },\n { id: \"steady\", label: \"Steady\", ms: 600 },\n { id: \"slow\", label: \"Slow\", ms: 1500 },\n { id: \"crawl\", label: \"Crawl\", ms: 3000 },\n];\n\nfunction nearest(ms: number): { id: string; label: string; ms: number } {\n let best = SPEEDS[0]!;\n for (const speed of SPEEDS) {\n if (Math.abs(speed.ms - ms) < Math.abs(best.ms - ms)) best = speed;\n }\n return best;\n}\n\n/** The arguments, short. Same shape and same clamp as the vanilla panel's, so\n * one row does not read differently in the two. */\nfunction argSummary(args: Record<string, Scalar>): string {\n const parts = Object.entries(args).map(([k, v]) => `${k}=${String(v)}`);\n if (parts.length === 0) return \"\";\n const text = parts.join(\" \");\n return ` ${text.length > 60 ? text.slice(0, 57) + \"…\" : text}`;\n}\n\nfunction grantLabel(verb: string, allow: boolean): string {\n return allow ? `Always allow “${verb}”` : `Always refuse “${verb}”`;\n}\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slice of React this area uses, typed structurally.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS FILE EXISTS AT ALL, which is the first question anybody will ask of
|
|
5
|
+
* a React library that does not `import React from "react"`. It is the same
|
|
6
|
+
* argument `src/otel/index.ts` makes about `@opentelemetry/api`, and it is
|
|
7
|
+
* stronger here rather than weaker, because React's failure mode when there
|
|
8
|
+
* are two copies is louder than OTel's and more common:
|
|
9
|
+
*
|
|
10
|
+
* 1. **There is one React per app, and a second one breaks hooks.** React's
|
|
11
|
+
* hook dispatcher is module-level mutable state. A component built
|
|
12
|
+
* against a different copy of `react` than the one that rendered it
|
|
13
|
+
* throws "Invalid hook call", or — worse, and this is the realistic case
|
|
14
|
+
* with a bundler that hoisted two versions — silently reads the wrong
|
|
15
|
+
* dispatcher. A library that imports its own `react` can get that second
|
|
16
|
+
* copy through a version mismatch, a nested `node_modules`, a monorepo
|
|
17
|
+
* hoist, or an app that loads React from a CDN while the bundle resolves
|
|
18
|
+
* it from disk. Taking the runtime as an argument makes it impossible:
|
|
19
|
+
* the only React that can be passed is the one the host already has.
|
|
20
|
+
*
|
|
21
|
+
* 2. **It keeps the optional peer honest in the published `.d.ts`.** `import
|
|
22
|
+
* type { ReactNode } from "react"` in a declaration file is an
|
|
23
|
+
* unresolvable import for anybody who did not install React — which is
|
|
24
|
+
* the whole population this library promises not to inconvenience.
|
|
25
|
+
* `peerDependenciesMeta: { optional: true }` stops npm installing it; it
|
|
26
|
+
* does nothing about a dangling type reference. Nothing in here names
|
|
27
|
+
* `react`, so there is nothing to dangle.
|
|
28
|
+
*
|
|
29
|
+
* 3. **It keeps the emitted JavaScript free of bare specifiers.** The
|
|
30
|
+
* package's own packaging test pins that every area but the relay emits
|
|
31
|
+
* JavaScript naming no bare specifier, because that is the difference
|
|
32
|
+
* between "copy `dist/` onto a static host" and "and also write an import
|
|
33
|
+
* map". `from "react"` would be the second import-map entry this library
|
|
34
|
+
* has ever needed. See `test/packaging.test.ts`.
|
|
35
|
+
*
|
|
36
|
+
* WHAT IT COSTS, stated plainly because it is a real cost. The host writes one
|
|
37
|
+
* line — `const { DriverPanel } = createDriverPanel(React)` — in a file it
|
|
38
|
+
* owns, and that is less idiomatic than a bare import. The components that
|
|
39
|
+
* come back are ordinary components, so everything after that line is
|
|
40
|
+
* ordinary React; what is lost is the ability to `import { DriverPanel } from
|
|
41
|
+
* "driverkit/react"` in forty files instead of re-exporting it from one. That
|
|
42
|
+
* is the trade, and it is taken in this direction because the thing on the
|
|
43
|
+
* other side is not a convenience but a class of bug the adopter cannot debug
|
|
44
|
+
* from inside their own app.
|
|
45
|
+
*
|
|
46
|
+
* The shapes below are written to be satisfied BY React's own types, not to
|
|
47
|
+
* re-describe them, and they are deliberately the narrowest set that works:
|
|
48
|
+
* every name here is a name a future React could rename. `peerDependencies`
|
|
49
|
+
* in `package.json` records the range they were written against — React 18 or
|
|
50
|
+
* newer, because `useSyncExternalStore` is an 18 API and it is the one that
|
|
51
|
+
* makes the rest of this area small.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Anything React can render. `unknown` on purpose.
|
|
55
|
+
*
|
|
56
|
+
* `ReactNode` is a big union and re-describing it would be re-describing it
|
|
57
|
+
* wrongly — a host passing a real `ReactNode` would then fail to satisfy a
|
|
58
|
+
* narrower copy of it. Nothing in here inspects a child, so nothing in here
|
|
59
|
+
* needs to know what one is: these values are created by the host's
|
|
60
|
+
* `createElement` and handed straight back to it.
|
|
61
|
+
*/
|
|
62
|
+
export type Node = unknown;
|
|
63
|
+
/** A component, as this area builds and accepts them. */
|
|
64
|
+
export type Component<P> = (props: P) => Node;
|
|
65
|
+
/**
|
|
66
|
+
* The hooks and the element factory, as one object.
|
|
67
|
+
*
|
|
68
|
+
* Satisfied by the `react` module namespace itself — `createDriverPanel(React)`
|
|
69
|
+
* with `import * as React from "react"` or the default import, both of which
|
|
70
|
+
* carry every name below.
|
|
71
|
+
*/
|
|
72
|
+
export interface ReactRuntime {
|
|
73
|
+
createElement(type: unknown, props?: Record<string, unknown> | null, ...children: Node[]): Node;
|
|
74
|
+
/** For a list of siblings with no wrapper element. */
|
|
75
|
+
readonly Fragment: unknown;
|
|
76
|
+
/**
|
|
77
|
+
* React 18's store subscription, and the reason this area needs so little of
|
|
78
|
+
* React.
|
|
79
|
+
*
|
|
80
|
+
* The panel's whole state lives in a framework-free store (see `store.ts`),
|
|
81
|
+
* so the React layer is a subscription and a render and nothing else. The
|
|
82
|
+
* alternative was a `useReducer` plus an effect per event, which would have
|
|
83
|
+
* put the transcript, the step list and the approval state machine inside
|
|
84
|
+
* React — untestable in this repository, which has no React to test with,
|
|
85
|
+
* and unusable from anything that is not React.
|
|
86
|
+
*/
|
|
87
|
+
useSyncExternalStore<T>(subscribe: (onChange: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T): T;
|
|
88
|
+
useState<T>(initial: T | (() => T)): [T, (next: T | ((prev: T) => T)) => void];
|
|
89
|
+
useRef<T>(initial: T): {
|
|
90
|
+
current: T;
|
|
91
|
+
};
|
|
92
|
+
useEffect(effect: () => void | (() => void), deps?: readonly unknown[]): void;
|
|
93
|
+
useMemo<T>(factory: () => T, deps?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MAAM,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAAC;IAC9E,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,CAAC,CAAC;CAW5D"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slice of React this area uses, typed structurally.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS FILE EXISTS AT ALL, which is the first question anybody will ask of
|
|
5
|
+
* a React library that does not `import React from "react"`. It is the same
|
|
6
|
+
* argument `src/otel/index.ts` makes about `@opentelemetry/api`, and it is
|
|
7
|
+
* stronger here rather than weaker, because React's failure mode when there
|
|
8
|
+
* are two copies is louder than OTel's and more common:
|
|
9
|
+
*
|
|
10
|
+
* 1. **There is one React per app, and a second one breaks hooks.** React's
|
|
11
|
+
* hook dispatcher is module-level mutable state. A component built
|
|
12
|
+
* against a different copy of `react` than the one that rendered it
|
|
13
|
+
* throws "Invalid hook call", or — worse, and this is the realistic case
|
|
14
|
+
* with a bundler that hoisted two versions — silently reads the wrong
|
|
15
|
+
* dispatcher. A library that imports its own `react` can get that second
|
|
16
|
+
* copy through a version mismatch, a nested `node_modules`, a monorepo
|
|
17
|
+
* hoist, or an app that loads React from a CDN while the bundle resolves
|
|
18
|
+
* it from disk. Taking the runtime as an argument makes it impossible:
|
|
19
|
+
* the only React that can be passed is the one the host already has.
|
|
20
|
+
*
|
|
21
|
+
* 2. **It keeps the optional peer honest in the published `.d.ts`.** `import
|
|
22
|
+
* type { ReactNode } from "react"` in a declaration file is an
|
|
23
|
+
* unresolvable import for anybody who did not install React — which is
|
|
24
|
+
* the whole population this library promises not to inconvenience.
|
|
25
|
+
* `peerDependenciesMeta: { optional: true }` stops npm installing it; it
|
|
26
|
+
* does nothing about a dangling type reference. Nothing in here names
|
|
27
|
+
* `react`, so there is nothing to dangle.
|
|
28
|
+
*
|
|
29
|
+
* 3. **It keeps the emitted JavaScript free of bare specifiers.** The
|
|
30
|
+
* package's own packaging test pins that every area but the relay emits
|
|
31
|
+
* JavaScript naming no bare specifier, because that is the difference
|
|
32
|
+
* between "copy `dist/` onto a static host" and "and also write an import
|
|
33
|
+
* map". `from "react"` would be the second import-map entry this library
|
|
34
|
+
* has ever needed. See `test/packaging.test.ts`.
|
|
35
|
+
*
|
|
36
|
+
* WHAT IT COSTS, stated plainly because it is a real cost. The host writes one
|
|
37
|
+
* line — `const { DriverPanel } = createDriverPanel(React)` — in a file it
|
|
38
|
+
* owns, and that is less idiomatic than a bare import. The components that
|
|
39
|
+
* come back are ordinary components, so everything after that line is
|
|
40
|
+
* ordinary React; what is lost is the ability to `import { DriverPanel } from
|
|
41
|
+
* "driverkit/react"` in forty files instead of re-exporting it from one. That
|
|
42
|
+
* is the trade, and it is taken in this direction because the thing on the
|
|
43
|
+
* other side is not a convenience but a class of bug the adopter cannot debug
|
|
44
|
+
* from inside their own app.
|
|
45
|
+
*
|
|
46
|
+
* The shapes below are written to be satisfied BY React's own types, not to
|
|
47
|
+
* re-describe them, and they are deliberately the narrowest set that works:
|
|
48
|
+
* every name here is a name a future React could rename. `peerDependencies`
|
|
49
|
+
* in `package.json` records the range they were written against — React 18 or
|
|
50
|
+
* newer, because `useSyncExternalStore` is an 18 API and it is the one that
|
|
51
|
+
* makes the rest of this area small.
|
|
52
|
+
*/
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/react/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG","sourcesContent":["/**\n * The slice of React this area uses, typed structurally.\n *\n * WHY THIS FILE EXISTS AT ALL, which is the first question anybody will ask of\n * a React library that does not `import React from \"react\"`. It is the same\n * argument `src/otel/index.ts` makes about `@opentelemetry/api`, and it is\n * stronger here rather than weaker, because React's failure mode when there\n * are two copies is louder than OTel's and more common:\n *\n * 1. **There is one React per app, and a second one breaks hooks.** React's\n * hook dispatcher is module-level mutable state. A component built\n * against a different copy of `react` than the one that rendered it\n * throws \"Invalid hook call\", or — worse, and this is the realistic case\n * with a bundler that hoisted two versions — silently reads the wrong\n * dispatcher. A library that imports its own `react` can get that second\n * copy through a version mismatch, a nested `node_modules`, a monorepo\n * hoist, or an app that loads React from a CDN while the bundle resolves\n * it from disk. Taking the runtime as an argument makes it impossible:\n * the only React that can be passed is the one the host already has.\n *\n * 2. **It keeps the optional peer honest in the published `.d.ts`.** `import\n * type { ReactNode } from \"react\"` in a declaration file is an\n * unresolvable import for anybody who did not install React — which is\n * the whole population this library promises not to inconvenience.\n * `peerDependenciesMeta: { optional: true }` stops npm installing it; it\n * does nothing about a dangling type reference. Nothing in here names\n * `react`, so there is nothing to dangle.\n *\n * 3. **It keeps the emitted JavaScript free of bare specifiers.** The\n * package's own packaging test pins that every area but the relay emits\n * JavaScript naming no bare specifier, because that is the difference\n * between \"copy `dist/` onto a static host\" and \"and also write an import\n * map\". `from \"react\"` would be the second import-map entry this library\n * has ever needed. See `test/packaging.test.ts`.\n *\n * WHAT IT COSTS, stated plainly because it is a real cost. The host writes one\n * line — `const { DriverPanel } = createDriverPanel(React)` — in a file it\n * owns, and that is less idiomatic than a bare import. The components that\n * come back are ordinary components, so everything after that line is\n * ordinary React; what is lost is the ability to `import { DriverPanel } from\n * \"driverkit/react\"` in forty files instead of re-exporting it from one. That\n * is the trade, and it is taken in this direction because the thing on the\n * other side is not a convenience but a class of bug the adopter cannot debug\n * from inside their own app.\n *\n * The shapes below are written to be satisfied BY React's own types, not to\n * re-describe them, and they are deliberately the narrowest set that works:\n * every name here is a name a future React could rename. `peerDependencies`\n * in `package.json` records the range they were written against — React 18 or\n * newer, because `useSyncExternalStore` is an 18 API and it is the one that\n * makes the rest of this area small.\n */\n\n/**\n * Anything React can render. `unknown` on purpose.\n *\n * `ReactNode` is a big union and re-describing it would be re-describing it\n * wrongly — a host passing a real `ReactNode` would then fail to satisfy a\n * narrower copy of it. Nothing in here inspects a child, so nothing in here\n * needs to know what one is: these values are created by the host's\n * `createElement` and handed straight back to it.\n */\nexport type Node = unknown;\n\n/** A component, as this area builds and accepts them. */\nexport type Component<P> = (props: P) => Node;\n\n/**\n * The hooks and the element factory, as one object.\n *\n * Satisfied by the `react` module namespace itself — `createDriverPanel(React)`\n * with `import * as React from \"react\"` or the default import, both of which\n * carry every name below.\n */\nexport interface ReactRuntime {\n createElement(\n type: unknown,\n props?: Record<string, unknown> | null,\n ...children: Node[]\n ): Node;\n /** For a list of siblings with no wrapper element. */\n readonly Fragment: unknown;\n /**\n * React 18's store subscription, and the reason this area needs so little of\n * React.\n *\n * The panel's whole state lives in a framework-free store (see `store.ts`),\n * so the React layer is a subscription and a render and nothing else. The\n * alternative was a `useReducer` plus an effect per event, which would have\n * put the transcript, the step list and the approval state machine inside\n * React — untestable in this repository, which has no React to test with,\n * and unusable from anything that is not React.\n */\n useSyncExternalStore<T>(\n subscribe: (onChange: () => void) => () => void,\n getSnapshot: () => T,\n getServerSnapshot?: () => T,\n ): T;\n useState<T>(initial: T | (() => T)): [T, (next: T | ((prev: T) => T)) => void];\n useRef<T>(initial: T): { current: T };\n useEffect(effect: () => void | (() => void), deps?: readonly unknown[]): void;\n useMemo<T>(factory: () => T, deps?: readonly unknown[]): T;\n // NO `useCallback`. It used to be here, unused by this area, and it was a\n // compile error in the adopter's own `createDriverPanel(React)` line: React\n // types it `<T extends Function>(callback: T, deps: DependencyList) => T`,\n // which does not satisfy a `<T>(fn: T, deps?) => T` that accepts any `T` at\n // all. That is the cost of a structural interface written against types\n // nobody in this repository could resolve, and it is exactly the kind of\n // thing \"the narrowest set that works\" above is a defence against: a member\n // this file does not call cannot be checked by anything, and this one was\n // wrong. `test/react-dom.test.ts` now assigns React's own namespace to this\n // interface, so `tsc` answers the question rather than the prose.\n}\n"]}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The React panel's state, with no React in it.
|
|
3
|
+
*
|
|
4
|
+
* WHY THE STATE IS NOT IN REACT. Everything the panel knows — the transcript,
|
|
5
|
+
* the step list, the run's control state, the approval state machine — lives in
|
|
6
|
+
* a plain object with `subscribe`/`getSnapshot`, and the React layer is a
|
|
7
|
+
* `useSyncExternalStore` call over it. Three reasons, in the order they
|
|
8
|
+
* mattered while writing it:
|
|
9
|
+
*
|
|
10
|
+
* 1. **It is the half that has to be tested, and this repository has no
|
|
11
|
+
* React.** The published package depends on nothing and there is no
|
|
12
|
+
* network install here, so a state machine expressed as `useReducer`
|
|
13
|
+
* plus eight `useEffect`s would be a state machine nothing in the suite
|
|
14
|
+
* could drive. The approval receipt — the one behaviour this area exists
|
|
15
|
+
* to get right — is asserted in `test/react.test.ts` against this file,
|
|
16
|
+
* with no renderer involved.
|
|
17
|
+
*
|
|
18
|
+
* 2. **`drive` is not a React citizen.** It is an async loop that fires
|
|
19
|
+
* callbacks from inside awaits, and callbacks that land after an unmount
|
|
20
|
+
* or after a Clear are the normal case rather than the exception. A store
|
|
21
|
+
* can be written once to be correct about that — see `era` — where a
|
|
22
|
+
* component tree would have to be correct about it at every subscription
|
|
23
|
+
* point.
|
|
24
|
+
*
|
|
25
|
+
* 3. **It is what makes the components replaceable.** A host with a design
|
|
26
|
+
* system wants our behaviour and its own markup. If the behaviour is in
|
|
27
|
+
* the components, "restyle it" means "fork it". Here a host can take
|
|
28
|
+
* `useDriver()` and render none of our components at all, and nothing
|
|
29
|
+
* about the gate, the pacing or the receipt changes.
|
|
30
|
+
*
|
|
31
|
+
* The parts of the vanilla widget's reasoning that still apply are applied
|
|
32
|
+
* here and marked; the ones that do not are listed in `REACT.md` with why.
|
|
33
|
+
*/
|
|
34
|
+
import type { Clock, DriveOptions, RunControls, RunControlsOptions, RunState } from "../agent/index.ts";
|
|
35
|
+
import type { Approval, ApprovalRequest, BudgetState, Driver, Scalar, VerbKind } from "../core/index.ts";
|
|
36
|
+
/**
|
|
37
|
+
* The selection size past which a commit is confirmed even though the app
|
|
38
|
+
* called it reversible.
|
|
39
|
+
*
|
|
40
|
+
* **Deliberately the same number as `COMMIT_ASK_ABOVE` in
|
|
41
|
+
* `src/widget/widget.ts`, and deliberately not imported from it.** Importing it
|
|
42
|
+
* would make this area's module graph include the vanilla widget's, and
|
|
43
|
+
* therefore its hand-written DOM, its stylesheet, its drag positioner and its
|
|
44
|
+
* `localStorage` access — in a React app's bundle, to read one integer. The
|
|
45
|
+
* whole promise of this entry point is that the two panels are independent, and
|
|
46
|
+
* a constant is not worth breaking it for.
|
|
47
|
+
*
|
|
48
|
+
* Two copies of a number drift, so the drift is a test failure rather than a
|
|
49
|
+
* hope: `test/react.test.ts` pins that these two agree. The reasoning behind
|
|
50
|
+
* the value — why a screenful rather than the thousands where an app's undo
|
|
51
|
+
* actually stops being credible — is written once, over there, and is not
|
|
52
|
+
* restated here so that there is still only one place it can be argued with.
|
|
53
|
+
*/
|
|
54
|
+
export declare const COMMIT_ASK_ABOVE = 25;
|
|
55
|
+
/** How the panel gets a control surface. `runControls` by default; an interface
|
|
56
|
+
* rather than only a factory, exactly as the agent area says. */
|
|
57
|
+
export type RunControlsFactory = (options: RunControlsOptions) => RunControls;
|
|
58
|
+
export type StepStatus = "pending" | "running" | "done" | "refused" | "skipped";
|
|
59
|
+
/**
|
|
60
|
+
* Where an approval has got to. **One entry moves through these; it is never
|
|
61
|
+
* replaced and never removed.**
|
|
62
|
+
*
|
|
63
|
+
* This is the behaviour the area exists for, so it is worth saying what the
|
|
64
|
+
* states are for rather than only what they are. A gate whose card disappears
|
|
65
|
+
* when you answer it leaves a transcript in which the question and its answer
|
|
66
|
+
* are two unrelated lines, and scrollback is the only place an auditor can
|
|
67
|
+
* stand. So the card becomes its own receipt, in place, and the phases are the
|
|
68
|
+
* phases a reader of that receipt needs distinguished:
|
|
69
|
+
*
|
|
70
|
+
* `asking` the buttons are live and nothing has happened.
|
|
71
|
+
* `allowed` a person said yes and the verb is now running. Also the
|
|
72
|
+
* resting state for a commit that arrived from outside a
|
|
73
|
+
* run, where there is no result event to wait for and
|
|
74
|
+
* claiming "finished" would be making it up.
|
|
75
|
+
* `allowed-ok` the verb ran and the app said ok.
|
|
76
|
+
* `allowed-refused` the verb ran and **the app refused it anyway**. A
|
|
77
|
+
* separate phase because "you approved this" and "this
|
|
78
|
+
* happened" are different facts and a receipt that only
|
|
79
|
+
* recorded the first would be the more flattering of the
|
|
80
|
+
* two. A stale rev, a spent budget and a plan token that
|
|
81
|
+
* no longer matches all land here.
|
|
82
|
+
* `denied` a person said no.
|
|
83
|
+
* `stopped` the run was stopped before the verb ran. Not a denial:
|
|
84
|
+
* nobody refused it.
|
|
85
|
+
* `lapsed` the panel went away with the question still open, so
|
|
86
|
+
* nobody answered. Distinct from `denied` for the same
|
|
87
|
+
* reason the core keeps `timed-out` apart from `declined`.
|
|
88
|
+
*/
|
|
89
|
+
export type ApprovalPhase = "asking" | "allowed" | "allowed-ok" | "allowed-refused" | "denied" | "stopped" | "lapsed";
|
|
90
|
+
/** Something said: by the person, by the model, or by the panel about itself. */
|
|
91
|
+
export interface SaidEntry {
|
|
92
|
+
kind: "you" | "assistant" | "note";
|
|
93
|
+
id: string;
|
|
94
|
+
text: string;
|
|
95
|
+
}
|
|
96
|
+
/** One call, as three states of one entry. */
|
|
97
|
+
export interface StepEntry {
|
|
98
|
+
kind: "step";
|
|
99
|
+
id: string;
|
|
100
|
+
callId: string;
|
|
101
|
+
verb: string;
|
|
102
|
+
verbKind?: VerbKind;
|
|
103
|
+
args: Record<string, Scalar>;
|
|
104
|
+
/** The verb's `at` selector, straight from the manifest and used by nothing
|
|
105
|
+
* in here. See `onAim` for the seam a host outlines it through. */
|
|
106
|
+
at?: string;
|
|
107
|
+
commit: boolean;
|
|
108
|
+
status: StepStatus;
|
|
109
|
+
/** What happened, as a phrase appended to the row. Absent while pending. */
|
|
110
|
+
outcome?: string;
|
|
111
|
+
/** From a `describe` verb's `Report.count`, when it reported one. */
|
|
112
|
+
count?: number;
|
|
113
|
+
}
|
|
114
|
+
/** A standing permission a person installed from a card. See `PanelOptions.grants`. */
|
|
115
|
+
export interface Grant {
|
|
116
|
+
verb: string;
|
|
117
|
+
/** The rule, in the words that were shown before the click. */
|
|
118
|
+
rule: string;
|
|
119
|
+
/** Allow, or always refuse. Both are rules worth being able to install, and
|
|
120
|
+
* a standing refusal is the one a person reaches for when a model keeps
|
|
121
|
+
* asking about something it is never going to be allowed to do. */
|
|
122
|
+
allow: boolean;
|
|
123
|
+
}
|
|
124
|
+
/** A question, and then the receipt it becomes. */
|
|
125
|
+
export interface ApprovalEntry {
|
|
126
|
+
kind: "approval";
|
|
127
|
+
id: string;
|
|
128
|
+
verb: string;
|
|
129
|
+
/** The verb's own `describe` from the manifest — the app's words, not ours. */
|
|
130
|
+
describe: string;
|
|
131
|
+
args: Record<string, Scalar>;
|
|
132
|
+
count?: number;
|
|
133
|
+
reversible: boolean;
|
|
134
|
+
/** Whether the count alone is why this is being asked about. */
|
|
135
|
+
large: boolean;
|
|
136
|
+
phase: ApprovalPhase;
|
|
137
|
+
/**
|
|
138
|
+
* The rule a person would install by pressing "always", **in the words it is
|
|
139
|
+
* shown in before the click.** The same string is stored on the `Grant`, so
|
|
140
|
+
* what was agreed to and what was installed cannot differ.
|
|
141
|
+
*/
|
|
142
|
+
grantOffer?: string;
|
|
143
|
+
/** The rule that answered this without asking, when one did. */
|
|
144
|
+
via?: string;
|
|
145
|
+
/** A free-text note typed beside the decision. See `decide`. */
|
|
146
|
+
note?: string;
|
|
147
|
+
/** The app's refusal slug, when the approved verb was refused anyway. */
|
|
148
|
+
refused?: string;
|
|
149
|
+
}
|
|
150
|
+
export type Entry = SaidEntry | StepEntry | ApprovalEntry;
|
|
151
|
+
export interface PanelSnapshot {
|
|
152
|
+
entries: readonly Entry[];
|
|
153
|
+
/** A run is in flight. */
|
|
154
|
+
busy: boolean;
|
|
155
|
+
runState: RunState;
|
|
156
|
+
paceMs: number;
|
|
157
|
+
/** Unspent `step()` permits, for a button that wants to show one is owed. */
|
|
158
|
+
permits: number;
|
|
159
|
+
stepMode: boolean;
|
|
160
|
+
confirmCommits: boolean;
|
|
161
|
+
/** What this driver has spent, re-read on every change. Absent when the
|
|
162
|
+
* driver does not account for itself. */
|
|
163
|
+
budget?: BudgetState;
|
|
164
|
+
grants: readonly Grant[];
|
|
165
|
+
/** The open question, if there is one. Also in `entries`, in its place. */
|
|
166
|
+
pending?: ApprovalEntry;
|
|
167
|
+
/** Which conversation this is. Bumped by `clear`. */
|
|
168
|
+
era: number;
|
|
169
|
+
}
|
|
170
|
+
export interface PanelOptions extends Pick<DriveOptions, "think" | "instructions" | "maxSteps" | "refusalLimit"> {
|
|
171
|
+
/** The first line in the transcript. Omit it for an empty panel. */
|
|
172
|
+
greeting?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Ask before a `commit` the app cannot undo. Default true, as in the vanilla
|
|
175
|
+
* widget and for the same reason: a person watching a panel move their own
|
|
176
|
+
* app should not learn about a thousand accepted rows afterwards.
|
|
177
|
+
*/
|
|
178
|
+
confirmCommits?: boolean;
|
|
179
|
+
/** Ask above this selection size even when the commit declared itself
|
|
180
|
+
* reversible. Default `COMMIT_ASK_ABOVE`. */
|
|
181
|
+
commitAskAbove?: number;
|
|
182
|
+
/** Ask before every commit, reversible or not. Default false. */
|
|
183
|
+
confirmEveryCommit?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Your own gate for the in-page run, replacing this one. Overrides rather
|
|
186
|
+
* than stacks — see the vanilla widget's `onBeforeCommit`, which this
|
|
187
|
+
* mirrors exactly.
|
|
188
|
+
*/
|
|
189
|
+
onBeforeCommit?: DriveOptions["onBeforeCommit"];
|
|
190
|
+
/**
|
|
191
|
+
* Offer "always allow" / "always refuse" beside the once-only answer.
|
|
192
|
+
* **Default false.**
|
|
193
|
+
*
|
|
194
|
+
* Off by default because a standing permission on a data-changing verb is a
|
|
195
|
+
* larger thing to hand somebody than a button that says yes once, and an
|
|
196
|
+
* app should decide to offer it rather than find that it did. When it is on,
|
|
197
|
+
* two rules hold and both are load-bearing:
|
|
198
|
+
*
|
|
199
|
+
* The rule is shown in full on the card **before** the click, in the same
|
|
200
|
+
* string that is then stored, so nobody installs a rule whose text they
|
|
201
|
+
* have not read.
|
|
202
|
+
*
|
|
203
|
+
* Grants live for this panel and this page load only. Nothing is written
|
|
204
|
+
* to storage, deliberately: a standing approval for a commit that came
|
|
205
|
+
* back after a reload, in a session nobody remembers granting it in, is
|
|
206
|
+
* worse than asking again. `revoke` takes one away sooner, and
|
|
207
|
+
* `PanelSnapshot.grants` is there so a host can render the list — a grant
|
|
208
|
+
* nobody can see is a grant nobody can revoke.
|
|
209
|
+
*/
|
|
210
|
+
grants?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Offer a free-text note beside the decision. Default false.
|
|
213
|
+
*
|
|
214
|
+
* On a denial the note becomes the hint the model is told, which is a real
|
|
215
|
+
* feature of the gate rather than decoration: `CommitDecision` takes a
|
|
216
|
+
* string, and "not until finance signs off" is something a model can act on
|
|
217
|
+
* where "declined" is not.
|
|
218
|
+
*
|
|
219
|
+
* **Typing in it never approves anything.** The note is read only when a
|
|
220
|
+
* decision button is pressed, Enter in the field does not submit, and a
|
|
221
|
+
* note with no decision leaves the question exactly as open as it was. A
|
|
222
|
+
* gate that inferred consent from a typed explanation would let the
|
|
223
|
+
* explanation authorize the call.
|
|
224
|
+
*/
|
|
225
|
+
notes?: boolean;
|
|
226
|
+
/** Starting pace in ms. Default `WATCHABLE_PACE` via `runControls`. A person
|
|
227
|
+
* can change it live; see `setPace`. */
|
|
228
|
+
pace?: number;
|
|
229
|
+
/** Start every run paused, one `step()` per call. Default false. */
|
|
230
|
+
stepMode?: boolean;
|
|
231
|
+
/** Where Pause, Resume and Step are sent. Default `runControls`, built once
|
|
232
|
+
* per run because "paused" is a statement about a run. */
|
|
233
|
+
controls?: RunControlsFactory;
|
|
234
|
+
/** The timer the pace waits on. Injectable so a suite need not sleep. */
|
|
235
|
+
clock?: Clock;
|
|
236
|
+
/**
|
|
237
|
+
* Told which element the next call is about, from the verb's `at`.
|
|
238
|
+
*
|
|
239
|
+
* The seam the vanilla widget's spotlight would plug into. It is a callback
|
|
240
|
+
* rather than a built-in outline because the outline is DOM written outside
|
|
241
|
+
* React's tree, into a page whose stacking and transforms belong to the
|
|
242
|
+
* host; a React app that wants it can draw it with the tools it already has.
|
|
243
|
+
* `at` is presentational here as it is everywhere: never resolved, never
|
|
244
|
+
* clicked, never read for a value.
|
|
245
|
+
*/
|
|
246
|
+
onAim?: (at: string | undefined) => void;
|
|
247
|
+
/** A failed `think` lands here as well as in the transcript. */
|
|
248
|
+
onError?: (err: unknown) => void;
|
|
249
|
+
AbortController?: {
|
|
250
|
+
new (): {
|
|
251
|
+
signal: AbortSignal;
|
|
252
|
+
abort: () => void;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
export interface PanelStore {
|
|
257
|
+
subscribe: (listener: () => void) => () => void;
|
|
258
|
+
/** Referentially stable until something changes, which is what
|
|
259
|
+
* `useSyncExternalStore` requires of it. */
|
|
260
|
+
getSnapshot: () => PanelSnapshot;
|
|
261
|
+
/** Ask something. Resolves when the run ends. */
|
|
262
|
+
ask: (text: string) => Promise<void>;
|
|
263
|
+
/** Abort the run. Stop is the abort signal and is not on `RunControls`: an
|
|
264
|
+
* abort outranks a pause, so a held run is still stoppable. */
|
|
265
|
+
stop: () => void;
|
|
266
|
+
/** Throw away the transcript and the history, and stop whatever is running. */
|
|
267
|
+
clear: () => void;
|
|
268
|
+
pause: () => void;
|
|
269
|
+
resume: () => void;
|
|
270
|
+
step: () => void;
|
|
271
|
+
setPace: (ms: number) => void;
|
|
272
|
+
setStepMode: (on: boolean) => void;
|
|
273
|
+
setConfirmCommits: (on: boolean) => void;
|
|
274
|
+
/** Answer an open question. A no-op for an id that is not open, which is what
|
|
275
|
+
* makes a double click harmless. */
|
|
276
|
+
decide: (id: string, decision: Decision) => void;
|
|
277
|
+
revoke: (verb: string) => void;
|
|
278
|
+
/**
|
|
279
|
+
* This panel's question, in the shape of `MountOptions.approve`.
|
|
280
|
+
*
|
|
281
|
+
* The same function behind the in-page gate and the relay path, exactly as
|
|
282
|
+
* the vanilla widget does it, so a commit arriving over MCP renders the same
|
|
283
|
+
* card under the same rules:
|
|
284
|
+
*
|
|
285
|
+
* ```ts
|
|
286
|
+
* let panel: PanelStore;
|
|
287
|
+
* const driver = mount({ …, approve: (req) => panel.approve(req) });
|
|
288
|
+
* panel = createPanelStore(driver, { think });
|
|
289
|
+
* ```
|
|
290
|
+
*/
|
|
291
|
+
approve: (req: ApprovalRequest) => Promise<Approval>;
|
|
292
|
+
/** Stop the run, answer any open question as lapsed, and release the
|
|
293
|
+
* listeners. Called from the hook's unmount effect. It is FINAL: a
|
|
294
|
+
* destroyed store answers no further `ask`, which is what `destroyed`
|
|
295
|
+
* below exists to let a caller find out before it tries. */
|
|
296
|
+
destroy: () => void;
|
|
297
|
+
/**
|
|
298
|
+
* Whether `destroy` has already run.
|
|
299
|
+
*
|
|
300
|
+
* For a caller that did not do the destroying and cannot be sure it did not
|
|
301
|
+
* happen — which is `useDriver` on a remount, because React can run an
|
|
302
|
+
* effect's cleanup and then mount the same effect again. A store that has
|
|
303
|
+
* been closed cannot be reopened, so the hook asks rather than assuming, and
|
|
304
|
+
* builds a new one when the answer is yes.
|
|
305
|
+
*/
|
|
306
|
+
destroyed: () => boolean;
|
|
307
|
+
}
|
|
308
|
+
export interface Decision {
|
|
309
|
+
allow: boolean;
|
|
310
|
+
/** Install the rule that was offered on the card. Ignored when `grants` is
|
|
311
|
+
* off or the card offered none. */
|
|
312
|
+
always?: boolean;
|
|
313
|
+
/** What was typed beside the decision. On a denial it becomes the model's
|
|
314
|
+
* hint. It is never what authorized anything. */
|
|
315
|
+
note?: string;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* What a receipt says, as one short line of plain text.
|
|
319
|
+
*
|
|
320
|
+
* A pure function and exported, for two reasons. It is what the card renders
|
|
321
|
+
* into its `role="status"`, and a status line is the one piece of this that a
|
|
322
|
+
* screen reader user gets instead of the layout, so it is asserted directly in
|
|
323
|
+
* the suite rather than through a renderer. And a host replacing the card keeps
|
|
324
|
+
* the wording without having to re-derive it from the phase — the phases are a
|
|
325
|
+
* state machine and the sentences are a product decision, and a host should be
|
|
326
|
+
* able to take the second without reimplementing the first.
|
|
327
|
+
*/
|
|
328
|
+
export declare function receiptLine(entry: ApprovalEntry): string;
|
|
329
|
+
/** The step list's outcome phrase, given a result. Pure, so the suite can read
|
|
330
|
+
* it without a renderer, and so a host's own row renders the same words. */
|
|
331
|
+
export declare function stepOutcome(ok: boolean, refused?: string, count?: number): string;
|
|
332
|
+
export declare function createPanelStore(driver: Driver, options: PanelOptions): PanelStore;
|
|
333
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/react/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EAEV,KAAK,EAGL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,WAAW,EACX,MAAM,EACN,MAAM,EAEN,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;kEACkE;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,WAAW,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,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