@shobyde/boaz 0.9.1 → 0.9.3

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 CHANGED
@@ -9,7 +9,7 @@
9
9
  Most "AI in your app" implementations stream the DOM to a server, pay per token, and hand a language model a bag of selectors. This package takes the opposite position:
10
10
 
11
11
  - **The app publishes a contract, not a DOM dump.** Co-located `defineCapability()` declarations are extracted at build time into a small JSON manifest. The assistant knows exactly which screens and operations exist because the build said so.
12
- - **The app declares facts, the library does the reasoning.** `KnowledgeBase` holds rows plus Datalog-style rules; `createRulesEngine()` joins them against the question, then composes a sentence from the result. No weights, no GPU, no network.
12
+ - **The app declares facts, the library evaluates the rules.** `KnowledgeBase` holds rows plus Datalog-style rules; `createRulesEngine()` joins them against the question, then composes a sentence from the result. No weights, no GPU, no network.
13
13
  - **Every call is checked before it runs.** Ids must exist in the manifest, arguments must satisfy the JSON Schema, mutating actions pass a confirmation gate, and a turn is capped at three sequential calls.
14
14
  - **Replies can stream, with provenance.** `streaming: { chunkChars, paceMs }` emits `delta` events on the same channel as tool steps, and a rule answer carries the goal, the terms it matched and the rule it applied.
15
15
 
@@ -24,7 +24,7 @@ Every version is also attached to its GitHub release, which npm installs directl
24
24
  prebuilt `dist/`:
25
25
 
26
26
  ```bash
27
- npm install https://github.com/shobyde/boaz/releases/download/v0.9.0/boaz-0.9.0.tgz
27
+ npm install https://github.com/shobyde/boaz/releases/download/v0.9.2/boaz-0.9.2.tgz
28
28
  ```
29
29
 
30
30
  ## The pieces
@@ -113,12 +113,13 @@ knowledge base (with the question's terms as assumptions), and calls `compose` w
113
113
  When no rule matches, or `compose` returns an empty string, it hands the turn to the keyword engine,
114
114
  which navigates and calls actions from the manifest.
115
115
 
116
- Answers come back with the reasoning attached:
116
+ Answers come back with the trace attached:
117
117
 
118
118
  ```ts
119
119
  const { text, steps } = await runtime.send('which invoices are overdue?');
120
120
  // text: "3 invoices: INV-2039 (Meridian Health, $9,600), INV-2037 (Ardent Freight, $3,120), INV-2032 (Vesper Audio, $560)."
121
- // steps: [{ type: 'inference', goal: 'invoices_with(?I, ?C, ?S, ?A)', terms: ['overdue'],
121
+ // steps: [{ type: 'inference', // a rule step
122
+ // goal: 'invoices_with(?I, ?C, ?S, ?A)', terms: ['overdue'],
122
123
  // solutions: [...], rule: 'invoices_with(?I, ?C, ?S, ?A) :- invoice(?I, ?C, ?S, ?A), asked(?S)' }]
123
124
  ```
124
125
 
@@ -161,18 +162,18 @@ Handlers register on mount, so an action declared for another screen is not call
161
162
  ## Streaming
162
163
 
163
164
  `streaming` reveals the reply as `delta` events instead of one block. The text is already known when
164
- the first delta fires, so this is pacing, not inference: a host that wants instant text leaves it off,
165
+ the first delta fires, so this is pacing, not computation: a host that wants instant text leaves it off,
165
166
  and a host that shows a transcript gets the same event shape it uses for tool steps.
166
167
 
167
168
  ```
168
- step inference overdue(?I, ?C, ?A) terms: [overdue] 0ms
169
+ step rule overdue(?I, ?C, ?A) terms: [overdue] 0ms
169
170
  delta "3 overdue: "
170
171
  delta "INV-2039 (Meridian Health), "
171
172
  ...
172
173
  turn text = "3 overdue: INV-2039 (...)."
173
174
  ```
174
175
 
175
- For a deterministic engine the honest thing to stream is the reasoning, not a fake progress bar:
176
+ For a deterministic engine the honest thing to stream is the trace, not a fake progress bar:
176
177
  the trace is real and it arrives in about a millisecond.
177
178
 
178
179
  ## Grounding (only when you bring your own engine)
@@ -212,6 +213,153 @@ host can use its own. shobyde.com renders A2UI components with native elements,
212
213
  components and the page keeps its design system, and `groundglass` checks every surface the assistant
213
214
  can emit in CI.
214
215
 
216
+ ## The conversation facade
217
+
218
+ `createConversation` is the SDK-shaped entry point. Give it a system prompt, the
219
+ domain knowledge, and tools. It owns the runtime, working memory, turn
220
+ classification and tool continuation; the app owns the facts, the handlers and
221
+ the rendering.
222
+
223
+ ```js
224
+ import { createConversation } from '@shobyde/boaz/conversation';
225
+ import { defineCapability } from '@shobyde/boaz/core';
226
+
227
+ const chat = createConversation({
228
+ system: 'Answer from the project record. Never invent a repository.',
229
+ knowledge: { facts, rules, answers },
230
+ subjects: ['Boaz', 'Hobnob', 'Readback'],
231
+ tools: [
232
+ defineCapability({
233
+ id: 'github.activity',
234
+ kind: 'query',
235
+ title: 'Read GitHub activity',
236
+ description: 'Reads commit and release counts for a repository.',
237
+ paramsSchema: {
238
+ type: 'object',
239
+ properties: { repo: { type: 'string', enum: ['boaz', 'hobnob', 'readback'] } },
240
+ required: ['repo'],
241
+ additionalProperties: false,
242
+ },
243
+ handler: async ({ repo }) => ({ answer: `${repo}: 81 commits.` }),
244
+ // Optional: the host knows the repository names. The facade still runs
245
+ // the capability through the same schema and handler path.
246
+ resolve: (question) => (/hobnob/i.test(question) ? { repo: 'hobnob' } : null),
247
+ }),
248
+ ],
249
+ getSnapshot: () => ({ currentRoute: location.pathname }),
250
+ });
251
+
252
+ const turn = await chat.ask('how many commits does Hobnob have?');
253
+ const next = await chat.ask('what about Readback?');
254
+
255
+ next.text; // the answer
256
+ next.steps; // the same trace steps the runtime emits
257
+ next.surfaces; // any surface steps the tools returned
258
+ next.kind; // fresh, continue-new-subject, command, recap...
259
+ chat.memory; // the working set and the last-tool record
260
+ chat.reset(); // clear runtime and memory together
261
+ ```
262
+
263
+ `system` is instructions for the host or a model prompt; it is not a fact.
264
+ `knowledge` is the fact/rule base. `tools` are the capabilities, schemas and
265
+ handlers. The facade never touches the DOM and never makes a network call on
266
+ its own.
267
+
268
+ ### Streaming, not just a final string
269
+
270
+ `ask()` is the convenience that collects the turn. `stream()` (also `query()`)
271
+ exposes the same turn as typed events, which is the shape a UI or another agent consumes:
272
+
273
+ ```js
274
+ for await (const event of chat.stream('how many commits does Hobnob have?')) {
275
+ switch (event.type) {
276
+ case 'turn.started':
277
+ // event.kind, event.classification
278
+ break;
279
+ case 'text.delta':
280
+ process.stdout.write(event.text);
281
+ break;
282
+ case 'tool.use':
283
+ // event.id, event.args
284
+ break;
285
+ case 'tool.result':
286
+ // event.ok, event.text, event.result, event.steps
287
+ break;
288
+ case 'surface':
289
+ // event.messages, a declarative surface to render
290
+ break;
291
+ case 'turn.completed':
292
+ // event.turn.text, steps, surfaces, memory record
293
+ break;
294
+ }
295
+ }
296
+ ```
297
+
298
+ The event union is:
299
+
300
+ ```ts
301
+ turn.started | retrieval | text.delta | step | tool.use |
302
+ tool.result | surface | turn.completed | error
303
+ ```
304
+
305
+ There is no token stream because there is no model. A text delta is the finished
306
+ sentence delivered in display chunks; `streaming: false` makes it one chunk.
307
+ Tool calls, results, trace steps and surfaces stay separate objects instead of
308
+ being flattened into the sentence.
309
+
310
+ `onEvent` receives the same events when a consumer prefers a callback over an
311
+ async iterator. `ask()` simply drains `stream()` and returns `turn.completed`.
312
+
313
+ Tools may carry a `resolve(query, context)` hook for domain dispatch that
314
+ retrieval cannot infer, such as a repository name or a chart subject. The hook
315
+ returns arguments only. Validation, execution and follow-up memory stay in the
316
+ facade.
317
+
318
+ A tool can also omit `resolve` and let the normal matcher choose it. The two
319
+ paths share the same capability id, schema and handler.
320
+
321
+ ## Follow-ups that keep the last tool
322
+
323
+ A conversation can repeat an operation on a new subject:
324
+
325
+ ```text
326
+ how many commits does Boaz have?
327
+ what about Hobnob?
328
+ ```
329
+
330
+ `createWorkingMemory` records the capability, its arguments and the effective
331
+ question for a turn. `memory.followUpTool()` turns the second sentence into the
332
+ first with the subject replaced, so the app's normal matcher and schema still
333
+ choose the capability and validate the arguments:
334
+
335
+ ```js
336
+ import { createWorkingMemory } from '@shobyde/boaz/core';
337
+
338
+ const memory = createWorkingMemory({ subjects: ['Boaz', 'Hobnob'] });
339
+
340
+ memory.observe('how many commits does Boaz have?', {
341
+ capabilityId: 'github.activity',
342
+ args: { repo: 'boaz' },
343
+ entities: ['Boaz'],
344
+ });
345
+
346
+ const next = memory.followUpTool('what about Hobnob?');
347
+ // {
348
+ // capabilityId: 'github.activity',
349
+ // query: 'how many commits does Hobnob have?',
350
+ // previousSubject: 'Boaz',
351
+ // subject: 'Hobnob',
352
+ // previousQuery: 'how many commits does Boaz have?',
353
+ // previousArgs: { repo: 'boaz' }
354
+ // }
355
+ ```
356
+
357
+ The primitive only rewrites. The host passes `next.query` back through its own
358
+ resolver; the old args are kept for a host that maps arguments directly rather
359
+ than re-matching. It does not fire when there is no recent tool turn, when the
360
+ follow-up names no new subject, or when the old subject is not in the previous
361
+ question.
362
+
215
363
  ## No React? The core is framework-free
216
364
 
217
365
  `@shobyde/boaz/react` is a convenience, not the contract. shobyde.com runs the same package in a
@@ -331,11 +479,11 @@ Letting a program act in a live app is the risky part, so the boundaries are str
331
479
  2. **Schema validation with one retry.** Arguments are validated against `paramsSchema`. A failure is replayed verbatim (`arguments.status must be one of "paid", "open", "overdue" (enum)`) with one chance to correct.
332
480
  3. **Confirmation gate.** `requiresConfirmation: true` pauses the turn, emits the request to the UI, and only calls the handler on an explicit approve. Cancel ends the turn with "Cancelled. Nothing was changed."
333
481
  4. **Step cap.** At most 3 sequential tool calls per message (`maxToolCalls`), so a confused engine cannot loop.
334
- 5. **Bounded inference.** Rules are evaluated to a depth limit with deduped solutions, and a rule can only derive facts from rows the app declared.
482
+ 5. **Bounded rule evaluation.** Rules are evaluated to a depth limit with deduped solutions, and a rule can only derive facts from rows the app declared.
335
483
 
336
484
  ## Engines
337
485
 
338
- - **`createRulesEngine()`** — BM25 over your answer rules, Datalog over your facts, `compose` for the sentence. Handles `asked()` assumptions, returns an `inference` step, and falls through to keyword matching when nothing matches.
486
+ - **`createRulesEngine()`** — BM25 over your answer rules, Datalog over your facts, `compose` for the sentence. Handles `asked()` assumptions, returns a rule step (type `inference`), and falls through to keyword matching when nothing matches.
339
487
  - **`createLexicalEngine()`** — deterministic BM25 over the manifest. It navigates, calls actions when every required argument is unambiguous from the visitor's words (enum value present, email present), and asks otherwise.
340
488
  - **`AgentEngine`** — a six-line interface (`id` + `complete(messages, tools)`). Wrap your own endpoint, a hosted model, or a test double; nothing in the loop assumes where the text came from.
341
489
 
@@ -370,7 +518,7 @@ Verified on this machine:
370
518
 
371
519
  Not verified here:
372
520
 
373
- - Rule quality beyond the demo: the tests cover the engine, not whether your rules are the right ones. `inference` steps are the tool for that review.
521
+ - Rule quality beyond the demo: the tests cover the engine, not whether your rules are the right ones. Rule (type `inference`) steps are the tool for that review.
374
522
  - Token counts are `chars / 4` estimates; the budget is approximate by design.
375
523
  - `CAP008` route detection is a heuristic over React Router JSX and `path:` literals. File-based routers (Next `app/`, Remix) are not scanned yet.
376
524
 
@@ -24,7 +24,7 @@ export interface TurnResult {
24
24
  }>;
25
25
  /** The rule that planned the first call, when a rule planned it. */
26
26
  plannedBy?: string;
27
- /** The answer rule that composed the prose, from its inference step. */
27
+ /** The answer rule that composed the prose, from its rule step. */
28
28
  composedBy?: string;
29
29
  }
30
30
  export declare function loadAgentModule(file: string): Promise<AgentModule>;
@@ -1 +1 @@
1
- {"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/cli/harness.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,CAC7B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAEhC,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,WAAW,CAAC;IAChC,kFAAkF;IAClF,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;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SAAS,EACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,SAAS,CAKpB;AAED,uEAAuE;AACvE,wBAAgB,cAAc,CAC5B,YAAY,EAAE,kBAAkB,EAAE,GAAG,SAAS,EAC9C,EAAE,EAAE,MAAM,GACT,kBAAkB,GAAG,SAAS,CAEhC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,kBAAkB,EAAE,GAAG,SAAS,EAC9C,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAMpB"}
@@ -1,2 +1,2 @@
1
- export declare const BOAZ_SKILL_MD = "---\nname: boaz-capabilities\ndescription: Use when adding or changing a route, control, answer rule, or reply copy in an app with the boaz assistant. Declares capabilities, then proves the answers are routed and readable.\n---\n\n# boaz: capabilities, answers and proof\n\nThis repository ships an in-browser assistant (`boaz`). It has no model:\nit answers from the build-time capability manifest, from facts and rules your app\ndeclares, and from the page text. It cannot read your source and it cannot see\nthe DOM. A feature without a capability declaration is invisible to it, and a\nquestion no rule claims gets a keyword guess.\n\n## When this skill applies\n\nAny time you:\n\n- add a route, page, tab, or deep-linked view;\n- add or change a modal, wizard, filter, sort, or bulk action;\n- rename a user-visible control or change what it does;\n- add an answer rule (a sentence computed from app data);\n- change any reply copy the assistant says;\n- delete a screen, action or rule.\n\n## 1. Declare what exists\n\nEvery user-reachable destination gets a `route` capability. Every mutating or\nstateful control gets an `action`. Live state the assistant should read before\nacting gets a `query`. A fixed paragraph it should quote gets a `knowledge`.\n\nDeclare it in a `capabilities.ts` next to the feature, not in a central file.\nCentral files rot; co-located ones get updated with the feature.\n\n```ts\nimport { defineCapability } from '@shobyde/boaz/core';\n\nexport const openInvoices = defineCapability({\n id: 'billing.open_invoices',\n kind: 'route',\n title: 'Billing & invoices',\n description:\n 'Takes the visitor to the billing page where they can change plan, update the payment card, or download past invoices as PDF.',\n keywords: ['invoice', 'receipt', 'payment', 'card', 'subscription', 'plan'],\n route: '/settings/billing',\n});\n```\n\n**Metadata that decides retrieval** (the description is the search text):\n\n- **id**: `<area>.<verb_or_noun>`, lowercase, never reused for something else.\n The conversation refers to ids.\n- **title**: what a visitor would call it. \"Download invoices\", not\n `InvoiceTableToolbar`.\n- **description**: start from the visitor's goal \u2014 \"Use when the visitor\n wants to\u2026\". If it lacks the words a visitor types, the capability is\n unfindable.\n- **keywords**: synonyms and plural forms. Cheap; add them.\n- **route**: where its UI lives, even for actions.\n- **paramsSchema**: strict JSON Schema, `additionalProperties: false`, enums over\n free strings.\n\n**Confirmation** (`requiresConfirmation: true`) is for deletes, spends, sends,\nand anything hard to undo. Not for navigation, filtering, or opening a dialog.\n\n## 2. Decide who answers: capability, rule, or knowledge\n\nThe engine tries, in order: an answer rule, then the keyword engine over the\ncapabilities, then nothing.\n\n| the visitor says | it should be |\n| --- | --- |\n| \"open billing\", \"filter invoices to overdue\" | a `route`/`action` capability |\n| \"which invoices are overdue?\" | a `query` capability, or an answer rule if it joins data |\n| \"what is your refund policy?\" | a `knowledge` capability |\n| \"which projects use Python?\" (a join over rows) | an **answer rule** |\n| \"what does he do?\" (a phrasing with no content words) | an **answer rule** with `match` |\n\nRules live in your app, not the library. The library owns retrieval, inference\nand the order of operations; you own the facts.\n\n```ts\nexport const answers = [\n {\n id: 'projects.using',\n title: 'Which projects use a technology',\n keywords: ['which projects use', 'written in', 'uses'],\n goal: 'projects_using(?P)',\n steps: [{ capabilityId: 'projects.list', toFacts: projectFacts }],\n // Needs the visitor to name a technology: no subject, no call.\n explain: ({ terms, solutions }) => `Matched ${terms[0]} against ${solutions.length} projects`,\n compose: ({ solutions, terms }) => phraseProjectsUsing(solutions, terms[0]),\n },\n];\n```\n\nRule options that matter:\n\n- **`steps`** run a capability first; the result becomes facts for the goal.\n- **`requiresSubject`** \u2014 a rule that joins `asked(?T)` waits until the question\n names a value to look up; a listing rule (\"which invoices are overdue\") runs\n whenever it matches. Set `false` to opt out entirely.\n- **`constants`** on the engine: values a tool will return, declared up front, so\n \"what's built with python?\" is recognised before the tool has run.\n- **`match(query)`** \u2014 an explicit trigger for phrasings keyword matching cannot\n see, because they tokenize to nothing (\"what does he do?\").\n- **`threshold`** \u2014 raise it when two rules share vocabulary.\n\n**Controller verbs are the app's.** A question starting with show / open / go /\ntake / read / expand / copy / download / print / visit / browse / scroll / jump /\nnavigate / see is handled by a capability, not by an answer rule. Apps with their\nown commands extend the list instead of fighting it:\n\n```ts\ncreateRulesEngine({ ..., controllerVerbs: ['filter', 'sort', 'apply', 'clear'] });\n```\n\n**Enums are literal.** A capability is called with the enum value that appeared in\nthe question, so \"show only the unpaid invoices\" cannot fill `status: overdue`.\nInclude the visitor's word in the enum and normalise it in the handler.\n\n## 3. Write the copy like writing\n\nOne intent should not have one sentence. Key the construction on the question\nform (count-first for \"how many\", entity-first for \"which\"), and pick a\nrealisation from a hash of the question, so paraphrases differ while a repeated\nquestion stays identical \u2014 a visitor can quote what they saw.\n\n```ts\nconst pick = (list, key) => list[hash(key) % list.length];\n\nif (/how many|how much/i.test(query)) return pick([`${n} projects: ${names}.`, ...], query);\nreturn pick([`${names} \u2014 ${n} of them.`, `Everything public: ${names}.`, ...], query);\n```\n\nThree rules that keep this honest:\n\n- **One intent per rule.** Two rules that read the same tool will fight over any\n shared keyword (\"built\"), and the loser hijacks the question.\n- **Facts first, flourish never.** Every realisation must carry every required\n fact; a stylish wrong answer is a bug.\n- **Never invent a claim to sound human.** Extra sentences must come from data\n (\"each has engineering notes\"), not from adjectives.\n\n## 4. Prove it works\n\n`verify` proves the declarations are sound. These two commands prove the\nassistant is actually useful, and they are the ones to run before you call a\ntask done.\n\n**Probe file** \u2014 the questions you promise to answer, grouped into intents:\n\n```json\n{\n \"questions\": [\n { \"question\": \"which projects use python?\", \"expect\": \"projects.using\", \"intent\": \"projects.using\", \"must\": [\"Readback\", \"Groundglass\"] },\n { \"question\": \"what's built with python?\", \"expect\": \"projects.using\", \"intent\": \"projects.using\", \"must\": [\"Readback\", \"Groundglass\"] },\n { \"question\": \"open the newest article\", \"expect\": \"blog.open_newest\" },\n { \"question\": \"show the hobnob card\", \"expect\": \"projects.card\", \"args\": { \"project\": \"hobnob\" } }\n ]\n}\n```\n\nFour paraphrases per intent is enough to expose a template. `must` is what a\ncorrect answer contains; `args` is what the capability must be called with. Only\nintents with a `must` list are scored \u2014 a route or action has no copy to compare.\n\n**Setup module** \u2014 the harness asks *your* engine, not a reimplementation:\n\n```js\n// agent-setup.mjs\nimport manifest from './agent-manifest.json' with { type: 'json' };\nimport { createRulesEngine } from '@shobyde/boaz/rules';\n\nexport const capabilities = manifest.capabilities;\nexport const answers = /* your rules */ [];\n\n// Without this, a rule that reads a tool answers with the tool call, not a sentence.\nexport const runCapability = async (id, args) =>\n handlers[id] ? handlers[id](args) : {};\n\nexport function createEngine() {\n return createRulesEngine({ knowledge, answers, capabilities, constants });\n}\n```\n\n**Run them:**\n\n```bash\nnpx boaz audit --probes agent-probes.json --module agent-setup.mjs\nnpx boaz bench --probes agent-probes.json --module agent-setup.mjs --samples\n```\n\n- `audit` prints one line per miss \u2014 expected id, what actually ran \u2014 and exits 1.\n Put it in CI. Add a probe for every capability you declare, in a visitor's words.\n It reports the engine's own plan: a rule that asked for a capability is named,\n a keyword match on the same capability is not. Rules that reply in prose are\n checked by `bench` through their `must` facts.\n- `bench` scores the copy per intent: **fidelity** (required facts present),\n **similarity** between paraphrases with the facts masked, **openers**, **spread**,\n **ttr**, **stable** (same question twice). Exit 1 when a fact goes missing or an\n answer wobbles.\n\nReading the numbers:\n\n| number | means |\n| --- | --- |\n| similarity 1.00 | every phrasing returned the identical sentence \u2014 a template |\n| similarity \u2248 0.5 | the wording follows the question |\n| similarity < 0.25 | check `--samples`: the topics may be drifting |\n| fidelity 100% | no paraphrase lost a fact; anything less is a bug, not style |\n| stable NO | the same question answered differently \u2014 drop the randomness |\n\nThen read the samples. The numbers say the answers stopped repeating; they cannot\nsay the answers read well.\n\n**No probe file yet?** Generate a starting one from the manifest:\n\n```bash\nnpx boaz probes --generate --manifest dist/agent-manifest.json\n```\n\nIt writes `probes.generated.json` with one question per capability title and\nkeyword, each already expecting the capability it came from, and prints two\nlists worth reading: phrases that two capabilities in the same query class both\nclaim (no probe can assert a coin flip; give one of them a phrase of its own),\nand capabilities with no probe (a capability that requires arguments cannot be\nprobed from a phrase alone, so write that one by hand with `args`). Edit the\nphrasing to match how your visitors actually talk, then run `audit`. A miss on a\ngenerated probe usually means the manifest still claims a phrasing that an\nanswer rule took over.\n\n## Done means\n\n```bash\nnpx boaz verify\nnpx boaz audit --probes agent-probes.json --module agent-setup.mjs\nnpx boaz bench --probes agent-probes.json --module agent-setup.mjs\n```\n\nAll three exit 0. If a new route is intentionally invisible to the assistant, say\nso in the pull request instead of leaving an unexplained CAP008.\n\n## Failure modes this catches\n\n| symptom | cause | fix |\n| --- | --- | --- |\n| \"I'm not sure\" for a supported thing | no capability description contains the visitor's words | rewrite the description, add keywords |\n| a question runs the wrong action | two capabilities share a noun; no verb to separate them | give each its own verb and phrase |\n| a bare noun answer (\"No stack lists much.\") | a rule matched on a quantifier | keep rules to question-shaped phrases |\n| every phrasing answers identically | one `compose` string per intent | construction on the question, realisation on the hash |\n| a phrasing with no content words is ignored | it tokenizes to nothing | `match(query)` on the rule |\n| a tool is called for a question with nothing to look up | `requiresSubject` default | name it `false` for listing rules |\n";
1
+ export declare const BOAZ_SKILL_MD = "---\nname: boaz-capabilities\ndescription: Use when adding or changing a route, control, answer rule, or reply copy in an app with the boaz assistant. Declares capabilities, then proves the answers are routed and readable.\n---\n\n# boaz: capabilities, answers and proof\n\nThis repository ships an in-browser assistant (`boaz`). It has no model:\nit answers from the build-time capability manifest, from facts and rules your app\ndeclares, and from the page text. It cannot read your source and it cannot see\nthe DOM. A feature without a capability declaration is invisible to it, and a\nquestion no rule claims gets a keyword guess.\n\n## When this skill applies\n\nAny time you:\n\n- add a route, page, tab, or deep-linked view;\n- add or change a modal, wizard, filter, sort, or bulk action;\n- rename a user-visible control or change what it does;\n- add an answer rule (a sentence computed from app data);\n- change any reply copy the assistant says;\n- delete a screen, action or rule.\n\n## 1. Declare what exists\n\nEvery user-reachable destination gets a `route` capability. Every mutating or\nstateful control gets an `action`. Live state the assistant should read before\nacting gets a `query`. A fixed paragraph it should quote gets a `knowledge`.\n\nDeclare it in a `capabilities.ts` next to the feature, not in a central file.\nCentral files rot; co-located ones get updated with the feature.\n\n```ts\nimport { defineCapability } from '@shobyde/boaz/core';\n\nexport const openInvoices = defineCapability({\n id: 'billing.open_invoices',\n kind: 'route',\n title: 'Billing & invoices',\n description:\n 'Takes the visitor to the billing page where they can change plan, update the payment card, or download past invoices as PDF.',\n keywords: ['invoice', 'receipt', 'payment', 'card', 'subscription', 'plan'],\n route: '/settings/billing',\n});\n```\n\n**Metadata that decides retrieval** (the description is the search text):\n\n- **id**: `<area>.<verb_or_noun>`, lowercase, never reused for something else.\n The conversation refers to ids.\n- **title**: what a visitor would call it. \"Download invoices\", not\n `InvoiceTableToolbar`.\n- **description**: start from the visitor's goal \u2014 \"Use when the visitor\n wants to\u2026\". If it lacks the words a visitor types, the capability is\n unfindable.\n- **keywords**: synonyms and plural forms. Cheap; add them.\n- **route**: where its UI lives, even for actions.\n- **paramsSchema**: strict JSON Schema, `additionalProperties: false`, enums over\n free strings.\n\n**Confirmation** (`requiresConfirmation: true`) is for deletes, spends, sends,\nand anything hard to undo. Not for navigation, filtering, or opening a dialog.\n\n## 2. Decide who answers: capability, rule, or knowledge\n\nThe engine tries, in order: an answer rule, then the keyword engine over the\ncapabilities, then nothing.\n\n| the visitor says | it should be |\n| --- | --- |\n| \"open billing\", \"filter invoices to overdue\" | a `route`/`action` capability |\n| \"which invoices are overdue?\" | a `query` capability, or an answer rule if it joins data |\n| \"what is your refund policy?\" | a `knowledge` capability |\n| \"which projects use Python?\" (a join over rows) | an **answer rule** |\n| \"what does he do?\" (a phrasing with no content words) | an **answer rule** with `match` |\n\nRules live in your app, not the library. The library owns retrieval, rule evaluation\nand the order of operations; you own the facts.\n\n```ts\nexport const answers = [\n {\n id: 'projects.using',\n title: 'Which projects use a technology',\n keywords: ['which projects use', 'written in', 'uses'],\n goal: 'projects_using(?P)',\n steps: [{ capabilityId: 'projects.list', toFacts: projectFacts }],\n // Needs the visitor to name a technology: no subject, no call.\n explain: ({ terms, solutions }) => `Matched ${terms[0]} against ${solutions.length} projects`,\n compose: ({ solutions, terms }) => phraseProjectsUsing(solutions, terms[0]),\n },\n];\n```\n\nRule options that matter:\n\n- **`steps`** run a capability first; the result becomes facts for the goal.\n- **`requiresSubject`** \u2014 a rule that joins `asked(?T)` waits until the question\n names a value to look up; a listing rule (\"which invoices are overdue\") runs\n whenever it matches. Set `false` to opt out entirely.\n- **`constants`** on the engine: values a tool will return, declared up front, so\n \"what's built with python?\" is recognised before the tool has run.\n- **`match(query)`** \u2014 an explicit trigger for phrasings keyword matching cannot\n see, because they tokenize to nothing (\"what does he do?\").\n- **`threshold`** \u2014 raise it when two rules share vocabulary.\n\n**Controller verbs are the app's.** A question starting with show / open / go /\ntake / read / expand / copy / download / print / visit / browse / scroll / jump /\nnavigate / see is handled by a capability, not by an answer rule. Apps with their\nown commands extend the list instead of fighting it:\n\n```ts\ncreateRulesEngine({ ..., controllerVerbs: ['filter', 'sort', 'apply', 'clear'] });\n```\n\n**Enums are literal.** A capability is called with the enum value that appeared in\nthe question, so \"show only the unpaid invoices\" cannot fill `status: overdue`.\nInclude the visitor's word in the enum and normalise it in the handler.\n\n## 3. Write the copy like writing\n\nOne intent should not have one sentence. Key the construction on the question\nform (count-first for \"how many\", entity-first for \"which\"), and pick a\nrealisation from a hash of the question, so paraphrases differ while a repeated\nquestion stays identical \u2014 a visitor can quote what they saw.\n\n```ts\nconst pick = (list, key) => list[hash(key) % list.length];\n\nif (/how many|how much/i.test(query)) return pick([`${n} projects: ${names}.`, ...], query);\nreturn pick([`${names} \u2014 ${n} of them.`, `Everything public: ${names}.`, ...], query);\n```\n\nThree rules that keep this honest:\n\n- **One intent per rule.** Two rules that read the same tool will fight over any\n shared keyword (\"built\"), and the loser hijacks the question.\n- **Facts first, flourish never.** Every realisation must carry every required\n fact; a stylish wrong answer is a bug.\n- **Never invent a claim to sound human.** Extra sentences must come from data\n (\"each has engineering notes\"), not from adjectives.\n\n## 4. Prove it works\n\n`verify` proves the declarations are sound. These two commands prove the\nassistant is actually useful, and they are the ones to run before you call a\ntask done.\n\n**Probe file** \u2014 the questions you promise to answer, grouped into intents:\n\n```json\n{\n \"questions\": [\n { \"question\": \"which projects use python?\", \"expect\": \"projects.using\", \"intent\": \"projects.using\", \"must\": [\"Readback\", \"Groundglass\"] },\n { \"question\": \"what's built with python?\", \"expect\": \"projects.using\", \"intent\": \"projects.using\", \"must\": [\"Readback\", \"Groundglass\"] },\n { \"question\": \"open the newest article\", \"expect\": \"blog.open_newest\" },\n { \"question\": \"show the hobnob card\", \"expect\": \"projects.card\", \"args\": { \"project\": \"hobnob\" } }\n ]\n}\n```\n\nFour paraphrases per intent is enough to expose a template. `must` is what a\ncorrect answer contains; `args` is what the capability must be called with. Only\nintents with a `must` list are scored \u2014 a route or action has no copy to compare.\n\n**Setup module** \u2014 the harness asks *your* engine, not a reimplementation:\n\n```js\n// agent-setup.mjs\nimport manifest from './agent-manifest.json' with { type: 'json' };\nimport { createRulesEngine } from '@shobyde/boaz/rules';\n\nexport const capabilities = manifest.capabilities;\nexport const answers = /* your rules */ [];\n\n// Without this, a rule that reads a tool answers with the tool call, not a sentence.\nexport const runCapability = async (id, args) =>\n handlers[id] ? handlers[id](args) : {};\n\nexport function createEngine() {\n return createRulesEngine({ knowledge, answers, capabilities, constants });\n}\n```\n\n**Run them:**\n\n```bash\nnpx boaz audit --probes agent-probes.json --module agent-setup.mjs\nnpx boaz bench --probes agent-probes.json --module agent-setup.mjs --samples\n```\n\n- `audit` prints one line per miss \u2014 expected id, what actually ran \u2014 and exits 1.\n Put it in CI. Add a probe for every capability you declare, in a visitor's words.\n It reports the engine's own plan: a rule that asked for a capability is named,\n a keyword match on the same capability is not. Rules that reply in prose are\n checked by `bench` through their `must` facts.\n- `bench` scores the copy per intent: **fidelity** (required facts present),\n **similarity** between paraphrases with the facts masked, **openers**, **spread**,\n **ttr**, **stable** (same question twice). Exit 1 when a fact goes missing or an\n answer wobbles.\n\nReading the numbers:\n\n| number | means |\n| --- | --- |\n| similarity 1.00 | every phrasing returned the identical sentence \u2014 a template |\n| similarity \u2248 0.5 | the wording follows the question |\n| similarity < 0.25 | check `--samples`: the topics may be drifting |\n| fidelity 100% | no paraphrase lost a fact; anything less is a bug, not style |\n| stable NO | the same question answered differently \u2014 drop the randomness |\n\nThen read the samples. The numbers say the answers stopped repeating; they cannot\nsay the answers read well.\n\n**No probe file yet?** Generate a starting one from the manifest:\n\n```bash\nnpx boaz probes --generate --manifest dist/agent-manifest.json\n```\n\nIt writes `probes.generated.json` with one question per capability title and\nkeyword, each already expecting the capability it came from, and prints two\nlists worth reading: phrases that two capabilities in the same query class both\nclaim (no probe can assert a coin flip; give one of them a phrase of its own),\nand capabilities with no probe (a capability that requires arguments cannot be\nprobed from a phrase alone, so write that one by hand with `args`). Edit the\nphrasing to match how your visitors actually talk, then run `audit`. A miss on a\ngenerated probe usually means the manifest still claims a phrasing that an\nanswer rule took over.\n\n## Done means\n\n```bash\nnpx boaz verify\nnpx boaz audit --probes agent-probes.json --module agent-setup.mjs\nnpx boaz bench --probes agent-probes.json --module agent-setup.mjs\n```\n\nAll three exit 0. If a new route is intentionally invisible to the assistant, say\nso in the pull request instead of leaving an unexplained CAP008.\n\n## Failure modes this catches\n\n| symptom | cause | fix |\n| --- | --- | --- |\n| \"I'm not sure\" for a supported thing | no capability description contains the visitor's words | rewrite the description, add keywords |\n| a question runs the wrong action | two capabilities share a noun; no verb to separate them | give each its own verb and phrase |\n| a bare noun answer (\"No stack lists much.\") | a rule matched on a quantifier | keep rules to question-shaped phrases |\n| every phrasing answers identically | one `compose` string per intent | construction on the question, realisation on the hash |\n| a phrasing with no content words is ignored | it tokenizes to nothing | `match(query)` on the rule |\n| a tool is called for a question with nothing to look up | `requiresSubject` default | name it `false` for listing rules |\n";
2
2
  //# sourceMappingURL=skill-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-template.d.ts","sourceRoot":"","sources":["../../src/cli/skill-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,izWA4PzB,CAAC"}
1
+ {"version":3,"file":"skill-template.d.ts","sourceRoot":"","sources":["../../src/cli/skill-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,uzWA4PzB,CAAC"}
@@ -75,7 +75,7 @@ capabilities, then nothing.
75
75
  | "which projects use Python?" (a join over rows) | an **answer rule** |
76
76
  | "what does he do?" (a phrasing with no content words) | an **answer rule** with \`match\` |
77
77
 
78
- Rules live in your app, not the library. The library owns retrieval, inference
78
+ Rules live in your app, not the library. The library owns retrieval, rule evaluation
79
79
  and the order of operations; you own the facts.
80
80
 
81
81
  \`\`\`ts
@@ -0,0 +1,149 @@
1
+ import { AgentRuntime } from '../core/loop.js';
2
+ import { type RegistryLookup } from '../core/registry.js';
3
+ import { type MemoryTurn, type WorkingMemory } from '../core/memory.js';
4
+ import type { AgentEngine, CapabilityDeclaration, ManifestCapability, RuntimeSnapshot, TurnStep } from '../core/types.js';
5
+ import { type AnswerRule, type RulesEngineOptions } from '../rules/engine.js';
6
+ import { KnowledgeBase, type FactRow, type Rule } from '../rules/knowledge.js';
7
+ export type TurnKind = 'fresh' | 'continue-same-subject' | 'continue-new-subject' | 'command' | 'recap' | 'correction' | 'preference';
8
+ export interface TurnClassification {
9
+ kind: TurnKind;
10
+ confidence: number;
11
+ cues: string[];
12
+ subject?: string;
13
+ newSubject?: string;
14
+ previousSubject?: string;
15
+ }
16
+ export interface ConversationKnowledge {
17
+ base?: KnowledgeBase;
18
+ facts?: FactRow[];
19
+ rules?: Array<string | Rule>;
20
+ answers?: AnswerRule[];
21
+ constants?: string[];
22
+ }
23
+ /**
24
+ * A tool with an optional host-side resolver. The resolver is for tools the
25
+ * app wants to dispatch directly from the visitor's words, before retrieval:
26
+ * GitHub repo names and chart subjects are the obvious cases. It returns the
27
+ * args for the capability, or null when the turn is not for this tool.
28
+ */
29
+ export type ConversationTool = CapabilityDeclaration & {
30
+ resolve?: (query: string, context: {
31
+ memory: WorkingMemory;
32
+ turn: TurnClassification;
33
+ lastTool: MemoryTurn | null;
34
+ }) => Record<string, unknown> | null;
35
+ };
36
+ export interface ToolCall {
37
+ id: string;
38
+ args: Record<string, unknown>;
39
+ }
40
+ export interface ConversationOptions {
41
+ /** The system prompt. Held for the runtime and shown in traces. */
42
+ instructions?: string;
43
+ /** Alias for `instructions`, for SDK-style call sites. */
44
+ system?: string;
45
+ /**
46
+ * Domain knowledge: a KnowledgeBase, facts/rules/answers to build one, or a
47
+ * system-prompt string used when the app has no structured knowledge yet.
48
+ */
49
+ knowledge?: KnowledgeBase | ConversationKnowledge | string;
50
+ /** Declared constants a tool can return, so the matcher knows them early. */
51
+ constants?: string[];
52
+ /** Page or document grounding for questions the facts do not cover. */
53
+ grounding?: RulesEngineOptions['grounding'];
54
+ /** Answer rules when knowledge is passed as a KnowledgeBase. */
55
+ answers?: AnswerRule[];
56
+ /** Tools with handlers. The facade builds the manifest and registry. */
57
+ tools?: ConversationTool[];
58
+ /** Prebuilt manifest/registry, for hosts that already have them. */
59
+ capabilities?: ManifestCapability[];
60
+ registry?: RegistryLookup;
61
+ /** Subject vocabulary for working memory and follow-ups. */
62
+ subjects?: string[];
63
+ attributes?: Record<string, string[]>;
64
+ /** Reuse a session across conversation objects. */
65
+ memory?: WorkingMemory;
66
+ /** Override the engine; otherwise a rules engine is built. */
67
+ engine?: AgentEngine;
68
+ /** A host resolver for tools that are not declared with `resolve`. */
69
+ resolveTool?: (query: string, context: {
70
+ memory: WorkingMemory;
71
+ turn: TurnClassification;
72
+ lastTool: MemoryTurn | null;
73
+ }) => ToolCall | null;
74
+ /** Runtime host callbacks. */
75
+ getSnapshot?: () => RuntimeSnapshot;
76
+ navigate?: (route: string) => void | Promise<void>;
77
+ dispatch?: (event: string, payload?: unknown) => void;
78
+ confirm?: (request: {
79
+ title: string;
80
+ description?: string;
81
+ }) => Promise<boolean>;
82
+ maxToolCalls?: number;
83
+ topK?: number;
84
+ streaming?: false | {
85
+ chunkChars?: number;
86
+ paceMs?: number;
87
+ leadInMs?: number;
88
+ };
89
+ /** Receives the same typed events as `stream()`. */
90
+ onEvent?: (event: ConversationEvent) => void;
91
+ }
92
+ export interface ConversationTurn {
93
+ text: string;
94
+ steps: TurnStep[];
95
+ surfaces: unknown[];
96
+ turn: MemoryTurn;
97
+ kind: TurnKind;
98
+ followUp: ReturnType<WorkingMemory['followUpTool']>;
99
+ }
100
+ export type ConversationEvent = {
101
+ type: 'turn.started';
102
+ kind: TurnKind;
103
+ classification: TurnClassification;
104
+ } | {
105
+ type: 'retrieval';
106
+ ids: string[];
107
+ } | {
108
+ type: 'text.delta';
109
+ text: string;
110
+ } | {
111
+ type: 'step';
112
+ step: TurnStep;
113
+ } | {
114
+ type: 'tool.use';
115
+ id: string;
116
+ args: Record<string, unknown>;
117
+ } | {
118
+ type: 'tool.result';
119
+ id: string;
120
+ ok: boolean;
121
+ text: string;
122
+ result?: unknown;
123
+ steps: TurnStep[];
124
+ } | {
125
+ type: 'surface';
126
+ messages: unknown[];
127
+ } | {
128
+ type: 'turn.completed';
129
+ turn: ConversationTurn;
130
+ } | {
131
+ type: 'error';
132
+ message: string;
133
+ };
134
+ export interface Conversation {
135
+ readonly memory: WorkingMemory;
136
+ readonly runtime: AgentRuntime;
137
+ readonly capabilities: ManifestCapability[];
138
+ /** Collect the turn and return its final object. */
139
+ ask(text: string): Promise<ConversationTurn>;
140
+ /** Stream typed text, tool, step and surface events as they happen. */
141
+ stream(text: string): AsyncIterable<ConversationEvent>;
142
+ /** Alias for `stream`, for SDK call sites that expect `query()`. */
143
+ query(text: string): AsyncIterable<ConversationEvent>;
144
+ classify(text: string): TurnClassification;
145
+ suggestions(limit?: number): string[];
146
+ reset(): void;
147
+ }
148
+ export declare function createConversation(options?: ConversationOptions): Conversation;
149
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAwC,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,KAAK,EACV,WAAW,EAEX,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,uBAAuB,GACvB,sBAAsB,GACtB,SAAS,GACT,OAAO,GACP,YAAY,GACZ,YAAY,CAAC;AAEjB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,SAAS,CA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