agentfootprint 9.118.0 → 9.119.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/AGENTS.md +47 -25
- package/CAPABILITIES.md +2 -1
- package/README.md +31 -0
- package/ai-instructions/claude-code/SKILL.md +47 -25
- package/dist/core/agent/AgentBuilder.js +1 -1
- package/dist/core/agent/coverage/absent.js +32 -8
- package/dist/core/agent/coverage/absent.js.map +1 -1
- package/dist/core/agent/coverage/items.js +26 -10
- package/dist/core/agent/coverage/items.js.map +1 -1
- package/dist/core/agent/coverage/ledger.js +14 -5
- package/dist/core/agent/coverage/ledger.js.map +1 -1
- package/dist/core/agent/coverage/refusal.js +89 -0
- package/dist/core/agent/coverage/refusal.js.map +1 -0
- package/dist/debug.js +1 -1
- package/dist/debug.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +1 -1
- package/dist/esm/core/agent/AgentBuilder.js +1 -1
- package/dist/esm/core/agent/coverage/absent.d.ts +7 -0
- package/dist/esm/core/agent/coverage/absent.js +32 -8
- package/dist/esm/core/agent/coverage/absent.js.map +1 -1
- package/dist/esm/core/agent/coverage/items.d.ts +13 -2
- package/dist/esm/core/agent/coverage/items.js +25 -9
- package/dist/esm/core/agent/coverage/items.js.map +1 -1
- package/dist/esm/core/agent/coverage/ledger.d.ts +7 -0
- package/dist/esm/core/agent/coverage/ledger.js +15 -6
- package/dist/esm/core/agent/coverage/ledger.js.map +1 -1
- package/dist/esm/core/agent/coverage/refusal.d.ts +64 -0
- package/dist/esm/core/agent/coverage/refusal.js +83 -0
- package/dist/esm/core/agent/coverage/refusal.js.map +1 -0
- package/dist/esm/debug.js +1 -1
- package/dist/esm/debug.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +2 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/semantics/check.js +1 -1
- package/dist/esm/lib/semantics/check.js.map +1 -1
- package/dist/esm/lib/semantics/described.d.ts +86 -0
- package/dist/esm/lib/semantics/described.js +183 -0
- package/dist/esm/lib/semantics/described.js.map +1 -0
- package/dist/esm/lib/semantics/envelope.d.ts +90 -4
- package/dist/esm/lib/semantics/envelope.js +229 -105
- package/dist/esm/lib/semantics/envelope.js.map +1 -1
- package/dist/esm/lib/semantics/index.d.ts +5 -3
- package/dist/esm/lib/semantics/index.js +4 -2
- package/dist/esm/lib/semantics/index.js.map +1 -1
- package/dist/esm/lib/semantics/types.d.ts +107 -3
- package/dist/esm/lib/semantics/types.js +2 -2
- package/dist/esm/lib/semantics/types.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/semantics/check.js +1 -1
- package/dist/lib/semantics/check.js.map +1 -1
- package/dist/lib/semantics/described.js +187 -0
- package/dist/lib/semantics/described.js.map +1 -0
- package/dist/lib/semantics/envelope.js +231 -106
- package/dist/lib/semantics/envelope.js.map +1 -1
- package/dist/lib/semantics/index.js +6 -3
- package/dist/lib/semantics/index.js.map +1 -1
- package/dist/lib/semantics/types.js +2 -2
- package/dist/lib/semantics/types.js.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +1 -1
- package/dist/types/core/agent/coverage/absent.d.ts +7 -0
- package/dist/types/core/agent/coverage/absent.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/items.d.ts +13 -2
- package/dist/types/core/agent/coverage/items.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/ledger.d.ts +7 -0
- package/dist/types/core/agent/coverage/ledger.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/refusal.d.ts +65 -0
- package/dist/types/core/agent/coverage/refusal.d.ts.map +1 -0
- package/dist/types/events/payloads.d.ts +2 -1
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/semantics/described.d.ts +87 -0
- package/dist/types/lib/semantics/described.d.ts.map +1 -0
- package/dist/types/lib/semantics/envelope.d.ts +90 -4
- package/dist/types/lib/semantics/envelope.d.ts.map +1 -1
- package/dist/types/lib/semantics/index.d.ts +5 -3
- package/dist/types/lib/semantics/index.d.ts.map +1 -1
- package/dist/types/lib/semantics/types.d.ts +107 -3
- package/dist/types/lib/semantics/types.d.ts.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -210,35 +210,57 @@ the model — the framework stamps `toolCallId` / `toolName` / `iteration`, you
|
|
|
210
210
|
`payload`. `agent.on('agentfootprint.stream.*')` and `toSSE(agent)` carry it with
|
|
211
211
|
no extra wiring.
|
|
212
212
|
|
|
213
|
-
###
|
|
213
|
+
### What a tool returns: rows, a verdict with limits, or nothing
|
|
214
|
+
|
|
215
|
+
| helper | use it when | the model reads | the record keeps |
|
|
216
|
+
|---|---|---|---|
|
|
217
|
+
| `describedResult({ … })` | rows, a series or relationships from a system of record — or a question back (`clarify`) | data + `grain` + `provenance` + one `not_covered` line per gap + a static note — NOT the `checked` list | the whole envelope on `tools.semantics_declared`, coverage in `coverageDeclared` |
|
|
218
|
+
| `coverage(value, { … })` | any other value that has limits (a verdict, a sentence) | your value under `result`, the coverage lists under `af_coverage` | `tools.coverage_declared`, `coverageDeclared` |
|
|
219
|
+
| `absent({ … })` | nothing matched | what was looked for, the coverage, "a retry returns the same" | `tools.absent`, `coverageDeclared`, status `'absent'` |
|
|
220
|
+
|
|
221
|
+
The rule: rows from a system of record → `describedResult()`; any other value with limits →
|
|
222
|
+
`coverage()`; nothing matched → `absent()`. Never wrap one in another. All three are the tool's
|
|
223
|
+
RESPONSE — nothing goes into the system prompt or the tool schema.
|
|
214
224
|
|
|
215
225
|
```typescript
|
|
216
|
-
import { absent, coverage, defineTool } from 'agentfootprint';
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
// A verdict WITH its boundary — what "fine" does and does not rule out.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
import { absent, coverage, defineTool, describedResult } from 'agentfootprint';
|
|
227
|
+
|
|
228
|
+
execute: ({ vm, summary }) => {
|
|
229
|
+
const { exportedAt, source, runs: all } = backupExport; // the system of record
|
|
230
|
+
const runs = all.filter((r) => r.vm === vm);
|
|
231
|
+
const ground = {
|
|
232
|
+
checked: [`every backup job in the export of ${exportedAt}`],
|
|
233
|
+
cannotCover: [{ what: 'PPDM', why: 'not collected on this install' }],
|
|
234
|
+
};
|
|
235
|
+
// "I looked and there is nothing" — never readable as "I could not look".
|
|
236
|
+
if (runs.length === 0) return absent({ what: `backup runs for ${vm}`, ...ground });
|
|
237
|
+
// A verdict WITH its boundary — what "fine" does and does not rule out.
|
|
238
|
+
if (summary) return coverage(`${vm}: ${runs.length} backup runs`, ground);
|
|
239
|
+
// Rows WITH their caveats. measuredAt comes from the data (the export's time,
|
|
240
|
+
// the moment of a live read, the newest sample) — never a typed-in date.
|
|
241
|
+
return describedResult({
|
|
242
|
+
facts: runs.map((r) => ({ entity: vm, day: r.day, ok: r.ok === 1 })),
|
|
243
|
+
provenance: { measuredAt: exportedAt, source },
|
|
244
|
+
coverage: ground,
|
|
245
|
+
});
|
|
246
|
+
},
|
|
232
247
|
```
|
|
233
248
|
|
|
234
|
-
|
|
235
|
-
`
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
249
|
+
`describedResult()` is camelCase throughout (`measuredAt`, `ageSeconds`, `isCounter`,
|
|
250
|
+
`filterNote`); the envelope the model reads stays snake_case. Series need `grain`
|
|
251
|
+
(`{ interval, aggregation, isCounter }` — state `isCounter` for `sum`/`count`-like
|
|
252
|
+
aggregations); series or facts without `provenance` are a compile error and a run-time
|
|
253
|
+
refusal. `semantic()` is the deprecated name for the same envelope with a snake_case
|
|
254
|
+
declaration — do not use it in new code.
|
|
255
|
+
|
|
256
|
+
A helper that cannot honor its declaration throws inside `execute`: the model reads text
|
|
257
|
+
starting `refused: ` in place of the data, and the run continues. An absence gets the
|
|
258
|
+
delivered status `'absent'` (route it with `onToolStatus: 'absent'`) and grounds only its
|
|
259
|
+
COVERAGE in the evidence gate — so an id the model invented does not become grounded by one
|
|
260
|
+
lookup that found nothing. It is never an error: nothing retries it, nothing refuses it, no
|
|
261
|
+
`error: true`. Add `.limitsTravelWithTheAnswer()` on the agent and the framework APPENDS the
|
|
262
|
+
run's declared coverage to the final answer string (not to streamed tokens; it breaks
|
|
263
|
+
`runTyped()`'s JSON), so the model cannot drop what it never wrote.
|
|
242
264
|
|
|
243
265
|
## Observing a run
|
|
244
266
|
|
package/CAPABILITIES.md
CHANGED
|
@@ -25,7 +25,8 @@ not in this table, search `src/index.ts` for the nearest noun before writing cod
|
|
|
25
25
|
| turning a written operational procedure (a runbook, a triage playbook) into ONE agent tool whose every answer is EVIDENCE — coverage folded up from the inner tools it calls, rule name+version, verdict rows with GENERATED meanings, and the recorded walk as an artifact ticket, never bytes | `runbookAsTool` — dials: `procedure` (factory, invoked per call with `ctx.tools`) + `resultKind` (`'verdict/*'` arms the rowset projection; anything else ships spine + the chart's `report`) + `rules {name, version}` (default absent ⇒ `rule_version: 'undeclared'`) + `verdicts {decider, maxRows}` (default 50; `verdict_meanings` = statically declared branches + this run's rule labels + the DEFAULT branch's label, which reaches evidence only when the chart calls `decide(s, rules, {branch, label})` — fp ≥9.16.1, the default is chosen by NO rule so nothing else can name it, and inside a generated fan-out branch the static walk is blind too; an undeclared or blank label stays ABSENT from the map, never invented from a branch id, and there is deliberately NO caller-supplied meanings map) + `presentation` (`'prose'` default = ship `table` + `VERDICT_RENDER_NOTE` "output it VERBATIM"; `'panel'` = the HOST renders the rowset, so NO `table` key at all + `PANEL_RENDER_NOTE` "the rows are already on the reader's screen — do not reproduce them"; the rowset half is byte-identical across modes, `table` stays RESERVED in both, an unknown value THROWS at definition) + `walk {cap, recording}` (cap default 500; over-cap ⇒ control-flow projection, declared · `recording: true` or `{label, maxBytes}`, default OFF — ALSO files the inner chart's own `{snapshot, events, structure}` under `recording/run` and puts its ref on the spine as `walk.recording_ref`, because the ROW projection cannot be drawn; snapshot read from the REDACTED mirror so one `redact` means the same for both; over `maxBytes` (`DEFAULT_RECORDING_MAX_BYTES` = 5,000,000) it is REFUSED not truncated; every absence — no store / over size / unserializable / store threw — is STATED in `walk.recording_note`, and the four `recording_*` fields are absent entirely when the dial is off) + `composedOf` (drift-checked at agent BUILD) + kept `recorders`/`keepRecord`/`keepRecordLimit`/`redact`; reserved state keys `verdicts`/`coverage`/`report` (the `report` bag lands BESIDE the spine, never over it — a report field spelling `af_coverage`/`af_provenance`/`rule_version`/`walk`/`report_note` or a live projection key is discarded and NAMED in `result.report_note`; precedence is explicit in `report.ts`, never spread order); inner `absent()` passes through VERBATIM unless the call said `allowAbsent`; walk kind `recording/chart-walk` + `walk_segment` discriminant | `src/core/runbook/` | 9.76.0, recording 9.79.0 |
|
|
26
26
|
| speaking MCP from a BROWSER — the SDK is browser-clean (its client + streamableHttp bundle at `platform:'browser'` with zero `node:` edges and never pull in `client/stdio.js`); the one barrier was that `lazyRequire` gets CALLED there, so the fix is to let the caller supply what the loader would have found | `mcpClient({ sdk })` (`McpSdk` = the two SDK modules you imported statically; the library STILL builds the transport, so headers/fetch/gateway vending/`retryOnThrottle`/`_meta` all keep working) · `mcpClient({ connection })` (`McpConnection` = listTools/callTool/close, deliberately NO `connect` — you already did; the only arm that reaches the SDK's `jsonSchemaValidator`, i.e. CSP) + `McpConnectionOptions`; `refuseConflictingOptions` REFUSES at construction every option a transport would have consumed, naming where it moved (a knob naming a behaviour that no longer happens is the defect class); `transportUrl` resolves a relative `url` against `globalThis.location.href` (absolute takes the identical branch, Node refuses by name); `sdkLoadFailure` classifies the seven load sites so a browser is never told to install a package it has (resolution failure ⇒ byte-identical historical message); `retryingFetch` + `ThrottleFetch` promoted out of `@internal` so the connection arm keeps its 429 handling. stdio keeps `lazyRequire` FOREVER — it spawns a subprocess. ZERO packaging change: no subpath, no `browser` condition (TypeScript is blind to it), peer stays optional (no literal dynamic `import()`). Fenced by `test/lib/mcp/browserGraph.test.ts` | `src/lib/mcp/` | 9.81.0 |
|
|
27
27
|
| calling ANOTHER registered tool from inside a tool's `execute` — composition over the agent's own dispatch map instead of importing the module and building a second query stack | `agentToolDispatch` + `ctx.tools` (ToolDispatch has/call) — sees static and skill-carried tools, NEVER ToolProvider-delivered ones (no build-time list, the 9.72.0 caveat); inner calls get the outer facts with hasArtifacts false and a derived toolCallId, `needs` resolved fail-closed non-interactively, `checkIn` and `wants` tools refused by name, no nested dispatch; declare ingredients via `composedOf` (and `gates` for a pausing procedure) — both travel MCP `_meta` | `src/core/agent/toolDispatch.ts` | 9.76.0 |
|
|
28
|
-
| a tool returning numbers WITH the caveats that make them honest — interval/aggregation grain, is-it-a-counter, when the world was measured, which ground was NOT covered — as typed data the model reads compactly and the record keeps whole | `semantic()` + `tools.semantics_declared` (model sees `semanticsForModel` projection; `coverage` field absorbed by the coverage()/absent() channel) | `src/lib/semantics/` | 9.53.0 |
|
|
28
|
+
| a tool returning numbers WITH the caveats that make them honest — interval/aggregation grain, is-it-a-counter, when the world was measured, which ground was NOT covered — as typed data the model reads compactly and the record keeps whole | `semantic()` + `tools.semantics_declared` (model sees `semanticsForModel` projection; `coverage` field absorbed by the coverage()/absent() channel; `semantic()` is the deprecated name — use `describedResult()`, next row) | `src/lib/semantics/` | 9.53.0 |
|
|
29
|
+
| the same typed tool result declared in ONE spelling — camelCase `measuredAt`/`isCounter`/`filterNote`, respelled to the unchanged snake_case wire — with a missing source a COMPILE error; which result helper to return (rows → describedResult, a value with limits → coverage, nothing → absent) | `describedResult()` + `DescribedResultDeclaration` (`provenance` required whenever `series`/`facts` is present; the snake_case spelling refused, naming the camelCase one) | `src/lib/semantics/described.ts` | 9.119.0 |
|
|
29
30
|
| a build gate that refuses a triage/inventory tool that forgot its caveats, by tool name and field name | `checkSemantics` + `defineTool({ resultClass })` (`'triage'`/`'inventory'`, the closed set) + bin `agentfootprint-check-semantics` | `src/lib/semantics/check.ts` | 9.53.0 |
|
|
30
31
|
| an agent that runs out of `maxIterations` mid-task handing back a HALF-SENTENCE as its answer — and nothing saying the budget ran out | `wrapUpAtMaxIterations` (default ON) + `WRAP_UP_INSTRUCTION` + `agent.budget_exhausted` + `stoppedEarly.wrappedUp` | `src/core/agent/stages/wrapUp.ts` | 9.56.0 |
|
|
31
32
|
| the conversation outgrowing the context window — dropping, summarizing or token-budgeting old turns, every removal on the record (the three refusal rows below all guard this window) | `.window()` + `slidingWindow` / `summarizeOldest` (= `.compaction()`) / `tokenBudget` + `keepRecentTurns` (default 6) + `thresholdTokens` (required, deliberately no default) + `retain: 'conversation'` (default) / `'discard'` | `src/core/agent/window/` | 7.17.0 |
|
package/README.md
CHANGED
|
@@ -107,6 +107,37 @@ For production, import a real provider from `agentfootprint/providers` and swap
|
|
|
107
107
|
|
|
108
108
|
**No cloud account?** `ollama('llama3.2')` from `agentfootprint/providers` runs the same agent against a local model for $0 — the free rung between the mock and the bill. Full recipes: [Ollama](https://agentfootprint.dev/docs/build/ollama/) · [OpenAI-compatible endpoints](https://agentfootprint.dev/docs/build/openai/#openai-compatible-endpoints-ollama-llamacpp-vllm-together-groq-lm-studio).
|
|
109
109
|
|
|
110
|
+
## What a tool returns — three helpers, one rule
|
|
111
|
+
|
|
112
|
+
Whatever a tool returns is what the model reads next. When that value has limits the model must not lose, return it through one of three helpers — each is the tool's response; nothing is added to the system prompt or the tool's schema:
|
|
113
|
+
|
|
114
|
+
| helper | use it when | the model reads | the record keeps |
|
|
115
|
+
|---|---|---|---|
|
|
116
|
+
| `describedResult({ … })` | rows, a series or relationships from a system of record | the data, with `grain`, `provenance` and one `not_covered` line per gap | the whole envelope (`tools.semantics_declared`) |
|
|
117
|
+
| `coverage(value, { … })` | any other value that has limits | your value, with what was and was not checked | `tools.coverage_declared` |
|
|
118
|
+
| `absent({ … })` | nothing matched | what was looked for, where, and that a retry returns the same | `tools.absent` |
|
|
119
|
+
|
|
120
|
+
Never wrap one in another. Add `.limitsTravelWithTheAnswer()` and the declared coverage is appended to the final answer — provenance and grain never are.
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
import { absent, coverage, describedResult } from 'agentfootprint';
|
|
124
|
+
|
|
125
|
+
execute: ({ vm, summary }) => {
|
|
126
|
+
const { exportedAt, source, runs: all } = backupExport; // your system of record
|
|
127
|
+
const runs = all.filter((r) => r.vm === vm);
|
|
128
|
+
const ground = { checked: [`every backup job in the export of ${exportedAt}`] };
|
|
129
|
+
if (runs.length === 0) return absent({ what: `backup runs for ${vm}`, ...ground }); // nothing matched
|
|
130
|
+
if (summary) return coverage(`${vm}: ${runs.length} backup runs`, ground); // a verdict with limits
|
|
131
|
+
return describedResult({ // rows from the record
|
|
132
|
+
facts: runs.map((r) => ({ entity: vm, day: r.day, ok: r.ok === 1 })),
|
|
133
|
+
provenance: { measuredAt: exportedAt, source }, // the time comes from the data
|
|
134
|
+
coverage: ground,
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
What the model reads from each, exactly: [Tools → what `execute` returns](https://agentfootprint.dev/docs/build/tools/#what-execute-returns--three-helpers-one-rule).
|
|
140
|
+
|
|
110
141
|
## How — we abstract context engineering
|
|
111
142
|
|
|
112
143
|
Skills, steering, RAG, facts, memory, guardrails — every name for context does one thing: it injects into one of three LLM slots. So we abstracted the injection itself.
|
|
@@ -210,35 +210,57 @@ the model — the framework stamps `toolCallId` / `toolName` / `iteration`, you
|
|
|
210
210
|
`payload`. `agent.on('agentfootprint.stream.*')` and `toSSE(agent)` carry it with
|
|
211
211
|
no extra wiring.
|
|
212
212
|
|
|
213
|
-
###
|
|
213
|
+
### What a tool returns: rows, a verdict with limits, or nothing
|
|
214
|
+
|
|
215
|
+
| helper | use it when | the model reads | the record keeps |
|
|
216
|
+
|---|---|---|---|
|
|
217
|
+
| `describedResult({ … })` | rows, a series or relationships from a system of record — or a question back (`clarify`) | data + `grain` + `provenance` + one `not_covered` line per gap + a static note — NOT the `checked` list | the whole envelope on `tools.semantics_declared`, coverage in `coverageDeclared` |
|
|
218
|
+
| `coverage(value, { … })` | any other value that has limits (a verdict, a sentence) | your value under `result`, the coverage lists under `af_coverage` | `tools.coverage_declared`, `coverageDeclared` |
|
|
219
|
+
| `absent({ … })` | nothing matched | what was looked for, the coverage, "a retry returns the same" | `tools.absent`, `coverageDeclared`, status `'absent'` |
|
|
220
|
+
|
|
221
|
+
The rule: rows from a system of record → `describedResult()`; any other value with limits →
|
|
222
|
+
`coverage()`; nothing matched → `absent()`. Never wrap one in another. All three are the tool's
|
|
223
|
+
RESPONSE — nothing goes into the system prompt or the tool schema.
|
|
214
224
|
|
|
215
225
|
```typescript
|
|
216
|
-
import { absent, coverage, defineTool } from 'agentfootprint';
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
// A verdict WITH its boundary — what "fine" does and does not rule out.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
import { absent, coverage, defineTool, describedResult } from 'agentfootprint';
|
|
227
|
+
|
|
228
|
+
execute: ({ vm, summary }) => {
|
|
229
|
+
const { exportedAt, source, runs: all } = backupExport; // the system of record
|
|
230
|
+
const runs = all.filter((r) => r.vm === vm);
|
|
231
|
+
const ground = {
|
|
232
|
+
checked: [`every backup job in the export of ${exportedAt}`],
|
|
233
|
+
cannotCover: [{ what: 'PPDM', why: 'not collected on this install' }],
|
|
234
|
+
};
|
|
235
|
+
// "I looked and there is nothing" — never readable as "I could not look".
|
|
236
|
+
if (runs.length === 0) return absent({ what: `backup runs for ${vm}`, ...ground });
|
|
237
|
+
// A verdict WITH its boundary — what "fine" does and does not rule out.
|
|
238
|
+
if (summary) return coverage(`${vm}: ${runs.length} backup runs`, ground);
|
|
239
|
+
// Rows WITH their caveats. measuredAt comes from the data (the export's time,
|
|
240
|
+
// the moment of a live read, the newest sample) — never a typed-in date.
|
|
241
|
+
return describedResult({
|
|
242
|
+
facts: runs.map((r) => ({ entity: vm, day: r.day, ok: r.ok === 1 })),
|
|
243
|
+
provenance: { measuredAt: exportedAt, source },
|
|
244
|
+
coverage: ground,
|
|
245
|
+
});
|
|
246
|
+
},
|
|
232
247
|
```
|
|
233
248
|
|
|
234
|
-
|
|
235
|
-
`
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
249
|
+
`describedResult()` is camelCase throughout (`measuredAt`, `ageSeconds`, `isCounter`,
|
|
250
|
+
`filterNote`); the envelope the model reads stays snake_case. Series need `grain`
|
|
251
|
+
(`{ interval, aggregation, isCounter }` — state `isCounter` for `sum`/`count`-like
|
|
252
|
+
aggregations); series or facts without `provenance` are a compile error and a run-time
|
|
253
|
+
refusal. `semantic()` is the deprecated name for the same envelope with a snake_case
|
|
254
|
+
declaration — do not use it in new code.
|
|
255
|
+
|
|
256
|
+
A helper that cannot honor its declaration throws inside `execute`: the model reads text
|
|
257
|
+
starting `refused: ` in place of the data, and the run continues. An absence gets the
|
|
258
|
+
delivered status `'absent'` (route it with `onToolStatus: 'absent'`) and grounds only its
|
|
259
|
+
COVERAGE in the evidence gate — so an id the model invented does not become grounded by one
|
|
260
|
+
lookup that found nothing. It is never an error: nothing retries it, nothing refuses it, no
|
|
261
|
+
`error: true`. Add `.limitsTravelWithTheAnswer()` on the agent and the framework APPENDS the
|
|
262
|
+
run's declared coverage to the final answer string (not to streamed tokens; it breaks
|
|
263
|
+
`runTyped()`'s JSON), so the model cannot drop what it never wrote.
|
|
242
264
|
|
|
243
265
|
## Observing a run
|
|
244
266
|
|
|
@@ -1244,7 +1244,7 @@ class AgentBuilder {
|
|
|
1244
1244
|
*
|
|
1245
1245
|
* @example
|
|
1246
1246
|
* const agent = Agent.create({ provider, model })
|
|
1247
|
-
* .tool(screenTool) // returns
|
|
1247
|
+
* .tool(screenTool) // returns describedResult({ facts: [...], provenance })
|
|
1248
1248
|
* .outputSchema(AnswerSchema)
|
|
1249
1249
|
* .claims({ nav_count: { entity: 'screen2', field: 'nav' } })
|
|
1250
1250
|
* .build();
|
|
@@ -65,6 +65,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
65
65
|
exports.tryInsteadToolOfAbsence = exports.tryInsteadOfAbsence = exports.coverageOfAbsence = exports.absent = exports.ABSENCE_NOTE = exports.readAbsence = exports.ABSENCE_MARKER = void 0;
|
|
66
66
|
const tools_js_1 = require("../../tools.js");
|
|
67
67
|
const items_js_1 = require("./items.js");
|
|
68
|
+
const refusal_js_1 = require("./refusal.js");
|
|
68
69
|
// The recognizer lives in the leaf `recognize.ts` (a post-hoc reader asks it
|
|
69
70
|
// without loading this mint); re-exported here so every import keeps working.
|
|
70
71
|
const recognize_js_1 = require("./recognize.js");
|
|
@@ -91,6 +92,21 @@ const TOOL_SUGGESTION_KEYS = Object.keys({
|
|
|
91
92
|
tool: true,
|
|
92
93
|
why: true,
|
|
93
94
|
});
|
|
95
|
+
/**
|
|
96
|
+
* The declaration's keys, tied to {@link AbsenceDeclaration} in BOTH
|
|
97
|
+
* directions, the {@link TOOL_SUGGESTION_KEYS} way. Any other key is refused,
|
|
98
|
+
* naming the spelling meant when it is a slip of one of these: a declaration
|
|
99
|
+
* fed from plain JavaScript or JSON with `not_checked` used to mint without
|
|
100
|
+
* that list, and the limit it declared vanished without a word.
|
|
101
|
+
*/
|
|
102
|
+
const ABSENCE_DECLARATION_KEYS = Object.keys({
|
|
103
|
+
what: true,
|
|
104
|
+
checked: true,
|
|
105
|
+
notChecked: true,
|
|
106
|
+
cannotCover: true,
|
|
107
|
+
tryInstead: true,
|
|
108
|
+
tryInsteadTool: true,
|
|
109
|
+
});
|
|
94
110
|
/**
|
|
95
111
|
* `undefined` and `null` both mean "not given" for the typed tool and its
|
|
96
112
|
* `why`. A JSON producer writes a missing optional value as `null`, and
|
|
@@ -199,6 +215,13 @@ function readToolSuggestion(raw) {
|
|
|
199
215
|
* `'absent'` (routable by `onToolStatus`), a `tools.absent` event, and an
|
|
200
216
|
* evidence-corpus rule of its own.
|
|
201
217
|
*
|
|
218
|
+
* Refuses (throws, where it is called) a declaration it cannot honor — and
|
|
219
|
+
* any key the declaration does not have, naming the spelling meant when the
|
|
220
|
+
* key is a casing slip (`not_checked` → `notChecked`), so a list declared
|
|
221
|
+
* from plain JavaScript or JSON cannot vanish without a word. Every refusal
|
|
222
|
+
* starts `refused: `: inside `execute` it becomes the call's error result,
|
|
223
|
+
* which the model reads.
|
|
224
|
+
*
|
|
202
225
|
* @example a port-lookup tool that found no matching FLOGI
|
|
203
226
|
* defineTool({
|
|
204
227
|
* name: 'flogi_for_port',
|
|
@@ -225,31 +248,32 @@ function readToolSuggestion(raw) {
|
|
|
225
248
|
function absent(decl) {
|
|
226
249
|
const fn = 'absent';
|
|
227
250
|
if (typeof decl !== 'object' || decl === null) {
|
|
228
|
-
throw
|
|
251
|
+
throw (0, refusal_js_1.refusal)(`${fn}() takes a declaration — { what, checked, notChecked?, cannotCover?, tryInstead?, ` +
|
|
229
252
|
`tryInsteadTool? }.`);
|
|
230
253
|
}
|
|
254
|
+
(0, refusal_js_1.refuseUnknownKeys)(decl, ABSENCE_DECLARATION_KEYS);
|
|
231
255
|
const what = typeof decl.what === 'string' ? decl.what.trim() : '';
|
|
232
256
|
if (what === '') {
|
|
233
|
-
throw
|
|
257
|
+
throw (0, refusal_js_1.refusal)(`\`what\` must say what was looked for (e.g. 'FLOGI entries on fc1/3'). An ` +
|
|
234
258
|
`absence that cannot name what it did not find is indistinguishable from a tool that ` +
|
|
235
259
|
`returned nothing by accident.`);
|
|
236
260
|
}
|
|
237
|
-
const checked = (0, items_js_1.normalizeCoverageList)(
|
|
261
|
+
const checked = (0, items_js_1.normalizeCoverageList)('checked', decl.checked, false);
|
|
238
262
|
if (checked.length === 0) {
|
|
239
|
-
throw
|
|
263
|
+
throw (0, refusal_js_1.refusal)(`'${what}' — \`checked\` must name at least one source, window or population ` +
|
|
240
264
|
`that WAS searched. An absence with no coverage is a null with extra steps: the reader ` +
|
|
241
265
|
`still cannot tell "I looked and there is nothing" from "I could not look", which is ` +
|
|
242
266
|
`the confusion this function exists to remove. If you genuinely could not look, that ` +
|
|
243
267
|
`is an error — throw, or return a failure the model can retry.`);
|
|
244
268
|
}
|
|
245
|
-
const notChecked = (0, items_js_1.normalizeCoverageList)(
|
|
246
|
-
const cannotCover = (0, items_js_1.normalizeCoverageList)(
|
|
269
|
+
const notChecked = (0, items_js_1.normalizeCoverageList)('notChecked', decl.notChecked, false);
|
|
270
|
+
const cannotCover = (0, items_js_1.normalizeCoverageList)('cannotCover', decl.cannotCover, true);
|
|
247
271
|
const sentence = readSentence(decl.tryInstead);
|
|
248
272
|
if (sentence.problem !== undefined)
|
|
249
|
-
throw
|
|
273
|
+
throw (0, refusal_js_1.refusal)(`'${what}' — ${sentence.problem}`);
|
|
250
274
|
const tool = readToolSuggestion(decl.tryInsteadTool);
|
|
251
275
|
if (tool.problem !== undefined)
|
|
252
|
-
throw
|
|
276
|
+
throw (0, refusal_js_1.refusal)(`'${what}' — ${tool.problem}`);
|
|
253
277
|
const tryInstead = sentence.value;
|
|
254
278
|
const tryInsteadTool = tool.value;
|
|
255
279
|
// The name's charset is the tool registry's question: the owner warns in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absent.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/absent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;;;AAEH,6CAAuD;AACvD,yCAAmD;
|
|
1
|
+
{"version":3,"file":"absent.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/absent.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U,EAAE,IAAI;QAChB,OAAO;QACP,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;QACzD,GAAG,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;QAC5D,sBAAsB,EAAE,IAAI;QAC5B,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;QAC5D,GAAG,CAAC,cAAc,KAAK,SAAS,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;QACzE,IAAI,EAAE,oBAAY;KACnB,CAAC;AACJ,CAAC;AAnDD,wBAmDC;AAED;sDACsD;AACtD,SAAgB,iBAAiB,CAAC,OAAoB;IACpD,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;QAC9B,UAAU,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;QACrC,WAAW,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;KACxC,CAAC;AACJ,CAAC;AAND,8CAMC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,OAAoB;IACtD,OAAO,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC;AAFD,kDAEC;AAED;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,OAAoB;IAC1D,OAAO,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC;AAC5D,CAAC;AAFD,0DAEC"}
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
* Emits: N/A.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.listsWithoutRecordOnly = exports.mergeItems = exports.sameItem = exports.normalizeCoverageList = exports.listWithoutRecordOnly = exports.readItemExtras = exports.RECORD_ONLY_ITEM_KEYS = exports.MAX_SHORT_CHARS = void 0;
|
|
15
|
+
exports.listsWithoutRecordOnly = exports.mergeItems = exports.sameItem = exports.normalizeCoverageList = exports.COVERAGE_DECLARATION_KEYS = exports.listWithoutRecordOnly = exports.readItemExtras = exports.RECORD_ONLY_ITEM_KEYS = exports.MAX_SHORT_CHARS = void 0;
|
|
16
16
|
const footprintjs_1 = require("footprintjs");
|
|
17
17
|
const plainLine_js_1 = require("../../../lib/plainLine.js");
|
|
18
|
+
const refusal_js_1 = require("./refusal.js");
|
|
18
19
|
const isPlainString = (v) => typeof v === 'string' && v.trim().length > 0;
|
|
19
20
|
/** The longest `short` a report prints on one line. */
|
|
20
21
|
exports.MAX_SHORT_CHARS = 80;
|
|
@@ -138,9 +139,24 @@ function listWithoutRecordOnly(list) {
|
|
|
138
139
|
: i);
|
|
139
140
|
}
|
|
140
141
|
exports.listWithoutRecordOnly = listWithoutRecordOnly;
|
|
142
|
+
/**
|
|
143
|
+
* The keys a {@link CoverageDeclaration} has — the three lists, as the author
|
|
144
|
+
* spells them — tied to the type in BOTH directions: a key the interface
|
|
145
|
+
* gains, or one listed here that it does not have, fails to compile.
|
|
146
|
+
* `coverage()` and a `describedResult()` / `semantic()` declaration's
|
|
147
|
+
* `coverage` refuse any other
|
|
148
|
+
* key (`refusal.ts` · `refuseUnknownKeys`), so `not_checked` is refused,
|
|
149
|
+
* naming `notChecked`, instead of vanishing.
|
|
150
|
+
*/
|
|
151
|
+
exports.COVERAGE_DECLARATION_KEYS = Object.keys({
|
|
152
|
+
checked: true,
|
|
153
|
+
notChecked: true,
|
|
154
|
+
cannotCover: true,
|
|
155
|
+
});
|
|
141
156
|
/**
|
|
142
157
|
* Normalize one author list into {@link CoverageItem}s, refusing anything a
|
|
143
|
-
* reader could not act on.
|
|
158
|
+
* reader could not act on. Every refusal starts with `refusal.ts` ·
|
|
159
|
+
* `REFUSED_PREFIX` and names the list and index, never the helper.
|
|
144
160
|
*
|
|
145
161
|
* `requireWhy` is true only for `cannotCover`. The asymmetry is deliberate:
|
|
146
162
|
* "we checked the fcns database" and "we did not check the archive" are
|
|
@@ -150,11 +166,11 @@ exports.listWithoutRecordOnly = listWithoutRecordOnly;
|
|
|
150
166
|
* the one an operator is most likely to want to fix, so the reason is the
|
|
151
167
|
* useful half.
|
|
152
168
|
*/
|
|
153
|
-
function normalizeCoverageList(
|
|
169
|
+
function normalizeCoverageList(section, list, requireWhy) {
|
|
154
170
|
if (list === undefined)
|
|
155
171
|
return [];
|
|
156
172
|
if (!Array.isArray(list)) {
|
|
157
|
-
throw
|
|
173
|
+
throw (0, refusal_js_1.refusal)(`\`${section}\` must be an array of strings or { what, why } entries — to say ` +
|
|
158
174
|
`nothing about it, omit the field (absent means "not declared", never "nothing there").`);
|
|
159
175
|
}
|
|
160
176
|
const items = [];
|
|
@@ -162,7 +178,7 @@ function normalizeCoverageList(fn, section, list, requireWhy) {
|
|
|
162
178
|
const at = `${section}[${i}]`;
|
|
163
179
|
if (isPlainString(raw)) {
|
|
164
180
|
if (requireWhy) {
|
|
165
|
-
throw
|
|
181
|
+
throw (0, refusal_js_1.refusal)(`${at} is '${raw.trim()}' with no reason. Every \`cannotCover\` entry needs a ` +
|
|
166
182
|
`\`why\` — a blind spot this tool can NEVER see is a claim about what it is, and a ` +
|
|
167
183
|
`reader cannot act on, escalate or disprove a claim with no reason. Write ` +
|
|
168
184
|
`{ what: '${raw.trim()}', why: '…' }, or move it to \`notChecked\` if a wider ` +
|
|
@@ -172,18 +188,18 @@ function normalizeCoverageList(fn, section, list, requireWhy) {
|
|
|
172
188
|
return;
|
|
173
189
|
}
|
|
174
190
|
if (typeof raw !== 'object' || raw === null || !isPlainString(raw.what)) {
|
|
175
|
-
throw
|
|
191
|
+
throw (0, refusal_js_1.refusal)(`${at} names no ground. Each entry is either a non-empty string or ` +
|
|
176
192
|
`{ what, why } — what a reader has to know is WHICH source, window or population ` +
|
|
177
193
|
`this is about.`);
|
|
178
194
|
}
|
|
179
195
|
const item = raw;
|
|
180
196
|
const why = item.why;
|
|
181
197
|
if (why !== undefined && !isPlainString(why)) {
|
|
182
|
-
throw
|
|
198
|
+
throw (0, refusal_js_1.refusal)(`${at} ('${item.what.trim()}') has a \`why\` that says nothing. Give it a ` +
|
|
183
199
|
`reason or omit the field.`);
|
|
184
200
|
}
|
|
185
201
|
if (requireWhy && why === undefined) {
|
|
186
|
-
throw
|
|
202
|
+
throw (0, refusal_js_1.refusal)(`${at} ('${item.what.trim()}') has no \`why\`. Every \`cannotCover\` entry ` +
|
|
187
203
|
`needs one — see the entry above this line in the docs for why a permanent blind ` +
|
|
188
204
|
`spot must say what makes it permanent.`);
|
|
189
205
|
}
|
|
@@ -194,10 +210,10 @@ function normalizeCoverageList(fn, section, list, requireWhy) {
|
|
|
194
210
|
const kind = item.kind == null ? undefined : item.kind;
|
|
195
211
|
const shortFault = short === undefined ? undefined : shortProblem(short, what);
|
|
196
212
|
if (shortFault !== undefined)
|
|
197
|
-
throw
|
|
213
|
+
throw (0, refusal_js_1.refusal)(`${at} ('${what}') — ${shortFault}`);
|
|
198
214
|
const kindFault = kind === undefined ? undefined : kindProblem(kind, section);
|
|
199
215
|
if (kindFault !== undefined)
|
|
200
|
-
throw
|
|
216
|
+
throw (0, refusal_js_1.refusal)(`${at} ('${what}') — ${kindFault}`);
|
|
201
217
|
items.push({
|
|
202
218
|
what,
|
|
203
219
|
...(why !== undefined && { why: why.trim() }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/items.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,6CAAwC;AAExC,4DAA6D;
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/items.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,6CAAwC;AAExC,4DAA6D;AAE7D,6CAAuC;AAMvC,MAAM,aAAa,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC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,CAAC;AAC1C,CAAC;AAVD,wDAUC"}
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.coverageOfLedger = exports.readCoverageLedger = exports.coverage = exports.COVERAGE_NOTE = exports.COVERAGE_MARKER = void 0;
|
|
37
37
|
const items_js_1 = require("./items.js");
|
|
38
|
+
const refusal_js_1 = require("./refusal.js");
|
|
38
39
|
/** The reserved key that makes a ledger recognizable. */
|
|
39
40
|
exports.COVERAGE_MARKER = 'af_coverage';
|
|
40
41
|
/**
|
|
@@ -62,6 +63,13 @@ exports.COVERAGE_NOTE = 'This result covers only what `checked` lists. `not_chec
|
|
|
62
63
|
* `.limitsTravelWithTheAnswer()` configured, appends it to the run's final
|
|
63
64
|
* answer where the model cannot drop it.
|
|
64
65
|
*
|
|
66
|
+
* Refuses (throws, where it is called) a boundary that declares nothing, a
|
|
67
|
+
* malformed item, and any key the boundary does not have — naming the
|
|
68
|
+
* spelling meant when the key is a casing slip (`not_checked` →
|
|
69
|
+
* `notChecked`), so a list declared from plain JavaScript or JSON cannot
|
|
70
|
+
* vanish without a word. Every refusal starts `refused: `: inside `execute`
|
|
71
|
+
* it becomes the call's error result, which the model reads.
|
|
72
|
+
*
|
|
65
73
|
* @example the highest-stakes tool in a triage agent
|
|
66
74
|
* defineTool({
|
|
67
75
|
* name: 'replication_health',
|
|
@@ -84,14 +92,15 @@ exports.COVERAGE_NOTE = 'This result covers only what `checked` lists. `not_chec
|
|
|
84
92
|
function coverage(content, decl) {
|
|
85
93
|
const fn = 'coverage';
|
|
86
94
|
if (typeof decl !== 'object' || decl === null) {
|
|
87
|
-
throw
|
|
95
|
+
throw (0, refusal_js_1.refusal)(`${fn}() takes the result and its boundary — coverage(result, { checked?, notChecked?, ` +
|
|
88
96
|
`cannotCover? }). To return a result with no declared boundary, return it bare.`);
|
|
89
97
|
}
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
const
|
|
98
|
+
(0, refusal_js_1.refuseUnknownKeys)(decl, items_js_1.COVERAGE_DECLARATION_KEYS);
|
|
99
|
+
const checked = (0, items_js_1.normalizeCoverageList)('checked', decl.checked, false);
|
|
100
|
+
const notChecked = (0, items_js_1.normalizeCoverageList)('notChecked', decl.notChecked, false);
|
|
101
|
+
const cannotCover = (0, items_js_1.normalizeCoverageList)('cannotCover', decl.cannotCover, true);
|
|
93
102
|
if (checked.length === 0 && notChecked.length === 0 && cannotCover.length === 0) {
|
|
94
|
-
throw
|
|
103
|
+
throw (0, refusal_js_1.refusal)(`all three lists are empty, so this ledger declares no boundary at all — it ` +
|
|
95
104
|
`would tell a reader nothing while looking like it did, which is worse than saying ` +
|
|
96
105
|
`nothing. Name what you checked, what you skipped, or what you can never see; or ` +
|
|
97
106
|
`return the result bare.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/ledger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../../../src/core/agent/coverage/ledger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAEH,yCAA8E;AAC9E,6CAA0D;AAG1D,yDAAyD;AAC5C,QAAA,eAAe,GAAG,aAAa,CAAC;AAE7C;;;;;;;;;;GAUG;AACU,QAAA,aAAa,GACxB,6FAA6F;IAC7F,0FAA0F;IAC1F,iBAAiB;IACjB,0FAA0F;IAC1F,sCAAsC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,SAAgB,QAAQ,CAAI,OAAU,EAAE,IAAyB;IAC/D,MAAM,EAAE,GAAG,UAAU,CAAC;IACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,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