@cursor/july 0.1.7 → 0.1.9
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/dist/bin/agent-serve.js +31 -2
- package/dist/channels/slack/channel-watch.d.ts +6 -1
- package/dist/channels/slack/channel-watch.d.ts.map +1 -1
- package/dist/channels/slack/channel-watch.js +22 -1
- package/dist/channels/slack/cursor-account.d.ts +4 -0
- package/dist/channels/slack/cursor-account.d.ts.map +1 -1
- package/dist/channels/slack/cursor-account.js +12 -2
- package/dist/channels/slack/defaults.d.ts +10 -5
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +39 -17
- package/dist/channels/slack/dispatch.d.ts +18 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +141 -38
- package/dist/channels/slack/inbound.d.ts +13 -3
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +17 -9
- package/dist/channels/slack/index.d.ts +4 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +4 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +1 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +3 -0
- package/dist/channels/slack/nudge-carrier.d.ts +19 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
- package/dist/channels/slack/nudge-carrier.js +166 -0
- package/dist/channels/slack/nudge-store.d.ts +61 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -0
- package/dist/channels/slack/nudge-store.js +266 -0
- package/dist/channels/slack/post-update-delivery.js +318 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +74 -25
- package/dist/channels/slack/stop.d.ts +14 -0
- package/dist/channels/slack/stop.d.ts.map +1 -0
- package/dist/channels/slack/stop.js +22 -0
- package/dist/channels/slack/thread-context.d.ts +81 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +470 -0
- package/dist/channels/slack/types.d.ts +27 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.COTN7wgo.js → app.Ciosf24M.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.D154Detj.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BW3TBdT0.js → VPLocalSearchBox.BcRDly7n.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BEJW0vE7.js → theme.CMpbjdfx.js} +2 -2
- package/dist/docs/assets/{deployment.md.BtfEsc9S.js → deployment.md.DC5-ImcM.js} +1 -1
- package/dist/docs/assets/{example-agents_approval-buddy.md.8R5phXb5.js → example-agents_approval-buddy.md.DFGBYLcc.js} +2 -2
- package/dist/docs/assets/{example-agents_approval-buddy.md.8R5phXb5.lean.js → example-agents_approval-buddy.md.DFGBYLcc.lean.js} +1 -1
- package/dist/docs/assets/example-agents_index.md.BPXjUtRB.js +2 -0
- package/dist/docs/assets/example-agents_index.md.BPXjUtRB.lean.js +1 -0
- package/dist/docs/assets/example-agents_oncall.md.BG_sUMly.js +10 -0
- package/dist/docs/assets/example-agents_oncall.md.BG_sUMly.lean.js +1 -0
- package/dist/docs/assets/{example-agents_security-reviewer.md.D2rtwDTO.js → example-agents_security-reviewer.md.CE9v-aKm.js} +2 -2
- package/dist/docs/assets/{example-agents_security-reviewer.md.D2rtwDTO.lean.js → example-agents_security-reviewer.md.CE9v-aKm.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.CCwqHvSV.js → guides_slack.md.FWale6Ip.js} +4 -3
- package/dist/docs/assets/{guides_slack.md.CCwqHvSV.lean.js → guides_slack.md.FWale6Ip.lean.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.DdjWabnN.js → reference_sessions.md.DLd6mvbv.js} +2 -2
- package/dist/docs/assets/{reference_sessions.md.DdjWabnN.lean.js → reference_sessions.md.DLd6mvbv.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.CVnInNiN.js → storage.md.DRTdnFvd.js} +9 -2
- package/dist/docs/assets/{storage.md.CVnInNiN.lean.js → storage.md.DRTdnFvd.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +6 -6
- package/dist/docs/evals.html +4 -4
- package/dist/docs/example-agents/approval-buddy.html +5 -5
- package/dist/docs/example-agents/benny.html +5 -5
- package/dist/docs/example-agents/bugbot.html +5 -5
- package/dist/docs/example-agents/codebase-wiki.html +4 -4
- package/dist/docs/example-agents/codeowners-review.html +4 -4
- package/dist/docs/example-agents/concierge.html +4 -4
- package/dist/docs/example-agents/fsd.html +4 -4
- package/dist/docs/example-agents/index.html +6 -6
- package/dist/docs/example-agents/knowledge-base.html +4 -4
- package/dist/docs/example-agents/oncall.html +34 -0
- package/dist/docs/example-agents/security-reviewer.html +6 -6
- package/dist/docs/example-agents/slack-agent.html +4 -4
- package/dist/docs/example-agents/weather-agent.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/slack.html +7 -6
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +4 -4
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +13 -6
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +45 -18
- package/dist/internal/cli-mcp.d.ts +64 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -0
- package/dist/internal/cli-mcp.js +570 -0
- package/dist/internal/deploy-client.d.ts +7 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -0
- package/dist/internal/deploy-source.d.ts +3 -0
- package/dist/internal/deploy-source.d.ts.map +1 -1
- package/dist/internal/deploy-source.js +25 -7
- package/dist/internal/discovery.js +1 -1
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +3 -0
- package/dist/internal/host-kv.d.ts +17 -0
- package/dist/internal/host-kv.d.ts.map +1 -0
- package/dist/internal/host-kv.js +77 -0
- package/dist/internal/hosting.d.ts +12 -2
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +21 -4
- package/dist/internal/json-dir-store.js +100 -0
- package/dist/internal/logs-client.d.ts +16 -2
- package/dist/internal/logs-client.d.ts.map +1 -1
- package/dist/internal/logs-client.js +51 -16
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +8 -0
- package/dist/internal/session-engine.d.ts +42 -7
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +276 -66
- package/dist/internal/storage-coordinator.d.ts +18 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +43 -0
- package/dist/internal/workspace.d.ts +19 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +47 -13
- package/dist/playground/assets/{index-72vCOBWO.js → index-C0-QEG4O.js} +42 -42
- package/dist/playground/assets/index-z3JY9O2x.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +65 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +203 -0
- package/dist/storage-backends/file-kv.d.ts +42 -0
- package/dist/storage-backends/file-kv.d.ts.map +1 -0
- package/dist/storage-backends/file-kv.js +190 -0
- package/dist/storage-backends/postgres-kv.d.ts +82 -0
- package/dist/storage-backends/postgres-kv.d.ts.map +1 -0
- package/dist/storage-backends/postgres-kv.js +185 -0
- package/dist/storage.d.ts +10 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +10 -1
- package/dist/types.d.ts +79 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/.vitepress/cache/deps/package.json +3 -0
- package/docs/deployment.md +7 -3
- package/docs/example-agents/approval-buddy.md +1 -1
- package/docs/example-agents/index.md +15 -10
- package/docs/example-agents/oncall.md +216 -0
- package/docs/example-agents/security-reviewer.md +5 -5
- package/docs/guides/slack.md +11 -2
- package/docs/reference/sessions.md +13 -4
- package/docs/storage.md +41 -0
- package/package.json +22 -1
- package/skills/framework-map/SKILL.md +6 -4
- package/src/bin/agent-serve.ts +32 -2
- package/src/channels/slack/channel-watch.ts +28 -1
- package/src/channels/slack/cursor-account.ts +20 -0
- package/src/channels/slack/defaults.ts +51 -20
- package/src/channels/slack/dispatch.ts +215 -40
- package/src/channels/slack/inbound.ts +30 -10
- package/src/channels/slack/index.ts +4 -0
- package/src/channels/slack/live-delivery.ts +1 -0
- package/src/channels/slack/manifest.ts +3 -0
- package/src/channels/slack/nudge-carrier.ts +182 -0
- package/src/channels/slack/nudge-store.ts +308 -0
- package/src/channels/slack/slack-channel.ts +106 -31
- package/src/channels/slack/stop.ts +25 -0
- package/src/channels/slack/thread-context.ts +572 -0
- package/src/channels/slack/types.ts +27 -0
- package/src/internal/cli-deploy.ts +58 -20
- package/src/internal/cli-mcp.ts +708 -0
- package/src/internal/deploy-client.ts +11 -0
- package/src/internal/deploy-source.ts +24 -6
- package/src/internal/discovery.ts +1 -1
- package/src/internal/distribution.ts +3 -0
- package/src/internal/host-kv.ts +85 -0
- package/src/internal/hosting.ts +24 -4
- package/src/internal/logs-client.ts +67 -21
- package/src/internal/server.ts +31 -0
- package/src/internal/session-engine.ts +379 -61
- package/src/internal/storage-coordinator.ts +41 -0
- package/src/internal/workspace.ts +48 -11
- package/src/storage-backends/cursor-hosted.ts +246 -0
- package/src/storage-backends/file-kv.ts +221 -0
- package/src/storage-backends/postgres-kv.ts +253 -0
- package/src/storage.ts +11 -1
- package/src/types.ts +83 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.B7UcKvIn.js +0 -1
- package/dist/docs/assets/example-agents_index.md.CRqJlnIf.js +0 -2
- package/dist/docs/assets/example-agents_index.md.CRqJlnIf.lean.js +0 -1
- package/dist/internal/persistence-coordinator.d.ts +0 -127
- package/dist/internal/persistence-coordinator.d.ts.map +0 -1
- package/dist/persistence.d.ts +0 -184
- package/dist/persistence.d.ts.map +0 -1
- package/dist/playground/assets/index-BjnMwYoR.css +0 -1
- /package/dist/docs/assets/{deployment.md.BtfEsc9S.lean.js → deployment.md.DC5-ImcM.lean.js} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as t,c as a,o as r,ag as i}from"./chunks/framework.CAZyNGu9.js";const m=JSON.parse('{"title":"Choose the right agentkit example","description":"Compare all eleven example agents by runtime, channels, tools, state, and the framework pattern each one teaches.","frontmatter":{"title":"Choose the right agentkit example","description":"Compare all eleven example agents by runtime, channels, tools, state, and the framework pattern each one teaches."},"headers":[],"relativePath":"example-agents/index.md","filePath":"example-agents/index.md"}'),o={name:"example-agents/index.md"};function s(n,e,l,d,h,c){return r(),a("div",null,[...e[0]||(e[0]=[i(`<h1 id="choose-the-right-agentkit-example" tabindex="-1">Choose the right agentkit example <a class="header-anchor" href="#choose-the-right-agentkit-example" aria-label="Permalink to "Choose the right agentkit example""></a></h1><p>The examples progress from one-channel assistants to durable, event-driven workflows. Start with the smallest agent for your use case. Each guide explains its request flow, framework features, verification path, and reusable design.</p><p>The source projects live under <a href="./../../examples/"><code>examples/</code></a>. Run the commands below from <code>packages/agent-serve</code>. See <a href="./../README.html#run-the-cli">Run the CLI</a> if the <code>agentkit</code> command isn't installed.</p><h2 id="compare-the-examples" tabindex="-1">Compare the examples <a class="header-anchor" href="#compare-the-examples" aria-label="Permalink to "Compare the examples""></a></h2><table tabindex="0"><thead><tr><th>Agent</th><th>Runtime</th><th>Intake</th><th>Framework focus</th><th>What sets it apart</th></tr></thead><tbody><tr><td><a href="./weather-agent.html">Weather agent</a></td><td>Local</td><td>HTTP and two Slack transports</td><td>Tools, stdio MCP, approvals, skill, subagent, schedule, hook, A/B, and evals</td><td>It demonstrates the broad local-runtime surface in one domain.</td></tr><tr><td><a href="./slack-agent.html">Slack agent</a></td><td>Local</td><td>Account-linked Slack</td><td>Channel identity, threads, and suggested prompts</td><td>It reaches Slack without authored tools.</td></tr><tr><td><a href="./concierge.html">Concierge</a></td><td>Local</td><td>Built-in HTTP</td><td>Peer MCP and multi-agent serving</td><td>It delegates to a separate agent with its own tools, sessions, and context.</td></tr><tr><td><a href="./benny.html">Playbook router</a></td><td>Local with repo context</td><td>Two Slack transports</td><td>Channel watching, inherited skills, custom cwd, and an eval</td><td>An allowlisted Slack channel becomes an intake queue for repo playbooks.</td></tr><tr><td><a href="./bugbot.html">PR evidence reviewer</a></td><td>Local</td><td>Custom HTTP and Slack</td><td>Host tool, skill, seeded workspaces, and an eval</td><td>The model receives a prepared diff-first evidence tree instead of a checkout.</td></tr><tr><td><a href="./approval-buddy.html">Approval Buddy</a></td><td>Local</td><td>GitHub and Slack</td><td>Policy tools, two subagents, durable storage, and evals</td><td>Code decides whether a PR may be approved. Reviews stay informational.</td></tr><tr><td><a href="./security-reviewer.html">Security Reviewer</a></td><td>Local host pipeline</td><td>GitHub and chat</td><td>Staged tools, parallel SDK agents, progress UI, durable storage, A/B, and evals</td><td>Reviewers and triage overlap while the playground shows every stage.</td></tr><tr><td><a href="./fsd.html">Remote PR coordinator</a></td><td>Local coordinator and remote PR sessions</td><td>HTTP, GitHub, and Slack</td><td>Remote handoff, hooks, affinity, buffering, reminders, and workflow MCP</td><td>One remote conversation follows a PR across chat, webhooks, and timed wakes.</td></tr><tr><td><a href="./knowledge-base.html">Knowledge base</a></td><td>Local</td><td>Built-in HTTP chat</td><td>Durable host-side state, a conventions skill, a schedule, unit tests, and evals</td><td>People curate shared facts in chat, and fresh sessions retrieve them from markdown.</td></tr><tr><td><a href="./codebase-wiki.html">Codebase wiki</a></td><td>Local</td><td>GitHub and chat</td><td>Task-dispatch webhooks, seeded digests, a mapping skill, a schedule, and evals</td><td>Merged PRs accumulate into per-feature wiki pages with a daily digest.</td></tr><tr><td><a href="./codeowners-review.html">Codeowners review</a></td><td>Local</td><td>GitHub, chat, and fixtures</td><td>Ownership routing in code, playbook data files, parallel subagents, and evals</td><td>Each product area reviews with its own playbook, and verdicts aggregate mechanically.</td></tr></tbody></table><h2 id="pick-a-learning-path" tabindex="-1">Pick a learning path <a class="header-anchor" href="#pick-a-learning-path" aria-label="Permalink to "Pick a learning path""></a></h2><p>Use this order when you want to learn agentkit one capability at a time:</p><ol><li>Start with <a href="./weather-agent.html">Weather agent</a> to explore the filesystem conventions and local runtime.</li><li>Strip the project back to <a href="./slack-agent.html">Slack agent</a> to see the minimum channel surface.</li><li>Read <a href="./benny.html">Playbook router</a> when Slack should route requests into repo playbooks.</li><li>Add composition with <a href="./concierge.html">Concierge</a>.</li><li>Study <a href="./bugbot.html">PR evidence reviewer</a> before giving a model repository evidence.</li><li>Move policy into code with <a href="./approval-buddy.html">Approval Buddy</a>.</li><li>Compare <a href="./security-reviewer.html">Security Reviewer</a> and <a href="./fsd.html">Remote PR coordinator</a> for host-side versus remote PR work.</li><li>See parallel subagent delegation carry team judgment in <a href="./codeowners-review.html">Codeowners review</a>.</li><li>Curate team context through conversation with <a href="./knowledge-base.html">Knowledge base</a>, then let GitHub events maintain product documentation in <a href="./codebase-wiki.html">Codebase wiki</a>.</li></ol><h2 id="common-prerequisites" tabindex="-1">Common prerequisites <a class="header-anchor" href="#common-prerequisites" aria-label="Permalink to "Common prerequisites""></a></h2><p>All examples require:</p><ul><li>Node 22.13 or newer. Don't run agentkit under Bun.</li><li>Workspace dependencies installed.</li><li>An agent-runtime credential for model turns.</li></ul><p>Several examples need more:</p><ul><li>Account-linked Slack channels require a connected host account.</li><li>GitHub examples require access to the target repository. Codebase wiki and Codeowners review call the host <code>gh</code> CLI for PR data; the codeowners fixtures run without network.</li><li>Approval Buddy and Security Reviewer define custom durable session storage.</li><li>Remote PR coordinator starts remote agent sessions and needs access to its workflow backend.</li></ul><p>Each guide lists its own credentials, services, and side effects.</p><h2 id="validate-any-example" tabindex="-1">Validate any example <a class="header-anchor" href="#validate-any-example" aria-label="Permalink to "Validate any example""></a></h2><p>Discovery commands don't start a model turn:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agentkit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> validate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> examples/weather-agent</span></span>
|
|
2
|
-
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agentkit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> info</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> examples/weather-agent</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --json</span></span></code></pre></div><p>Start one development server with <code>agentkit dev examples/<name></code>. Concierge depends on Weather agent, so its guide creates an isolated two-project mount. Don't mount the whole examples directory to test one agent; several advanced examples subscribe to live GitHub events.</p><h2 id="read-by-framework-feature" tabindex="-1">Read by framework feature <a class="header-anchor" href="#read-by-framework-feature" aria-label="Permalink to "Read by framework feature""></a></h2><ul><li><a href="./../concepts.html">Concepts</a> explains filesystem discovery and runtime boundaries.</li><li><a href="./../reference/project-layout.html">Project layout</a> lists every authored folder.</li><li><a href="./../reference/tools.html">Tools</a>, <a href="./../reference/channels.html">channels</a>, and <a href="./../reference/connections.html">MCP connections</a> cover the core extension points.</li><li><a href="./../evals.html">Evals</a> and <a href="./../ab.html">live A/B metrics</a> cover measured iteration.</li><li><a href="./../deployment.html">Deployment</a> covers credentials, auth, storage, and hosting.</li></ul>`,20)])])}const u=t(o,[["render",s]]);export{m as __pageData,u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t,c as a,o as r,ag as i}from"./chunks/framework.CAZyNGu9.js";const m=JSON.parse('{"title":"Choose the right agentkit example","description":"Compare all eleven example agents by runtime, channels, tools, state, and the framework pattern each one teaches.","frontmatter":{"title":"Choose the right agentkit example","description":"Compare all eleven example agents by runtime, channels, tools, state, and the framework pattern each one teaches."},"headers":[],"relativePath":"example-agents/index.md","filePath":"example-agents/index.md"}'),o={name:"example-agents/index.md"};function s(n,e,l,d,h,c){return r(),a("div",null,[...e[0]||(e[0]=[i("",20)])])}const u=t(o,[["render",s]]);export{m as __pageData,u as default};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime for `definePersistence` (`agent/persistence.ts`).
|
|
3
|
-
*
|
|
4
|
-
* The coordinator is the single funnel between the engine's hot paths and
|
|
5
|
-
* the author's key-value sink. The sink is four functions (`put` / `get` /
|
|
6
|
-
* `delete` / `list`); the coordinator owns everything else: it mints every
|
|
7
|
-
* key from the versioned scheme ({@link persistenceKeys}), coalesces
|
|
8
|
-
* session records and batches event chunks per turn (or debounce window),
|
|
9
|
-
* serializes delivery on one bounded queue per agent, and isolates
|
|
10
|
-
* failures — a throwing sink is logged and its write dropped; persistence
|
|
11
|
-
* must never stall or fail a turn.
|
|
12
|
-
*
|
|
13
|
-
* Scaling shape: sessions, evals, and A/Bs all reduce to keyed puts on the
|
|
14
|
-
* same queue, so one author-owned sink covers every domain, and new
|
|
15
|
-
* domains are new key prefixes — not new config surface.
|
|
16
|
-
*/
|
|
17
|
-
import type { ABSamplePersistence } from "../ab.js";
|
|
18
|
-
import type { EvalRunPersistence } from "../evals.js";
|
|
19
|
-
import { type PersistenceContext, type PersistenceDefinition, type ResolvedPersistencePolicy } from "../persistence.js";
|
|
20
|
-
import type { SessionEvent, SessionRecord } from "../types.js";
|
|
21
|
-
import type { ABSnapshot } from "./ab-snapshot.js";
|
|
22
|
-
export interface PersistenceCoordinatorOptions {
|
|
23
|
-
definition: PersistenceDefinition;
|
|
24
|
-
agentName: string;
|
|
25
|
-
projectRoot: string;
|
|
26
|
-
logger: (line: string) => void;
|
|
27
|
-
}
|
|
28
|
-
export declare class PersistenceCoordinator {
|
|
29
|
-
readonly policy: ResolvedPersistencePolicy;
|
|
30
|
-
private readonly definition;
|
|
31
|
-
private readonly agentName;
|
|
32
|
-
private readonly projectRoot;
|
|
33
|
-
private readonly logger;
|
|
34
|
-
/** Per-session pending state (events + coalesced record). */
|
|
35
|
-
private readonly buffers;
|
|
36
|
-
/**
|
|
37
|
-
* Last continuation key written to the sink per session, so a token
|
|
38
|
-
* change emits a delete for the stale index entry alongside the new put.
|
|
39
|
-
*/
|
|
40
|
-
private readonly continuationIndex;
|
|
41
|
-
/** Single delivery chain: writes reach the sink serialized, in order. */
|
|
42
|
-
private queue;
|
|
43
|
-
/** Ops on the queue not yet delivered (bounded by MAX_PENDING_OPS). */
|
|
44
|
-
private pending;
|
|
45
|
-
/** Ops dropped because the queue was full. */
|
|
46
|
-
private dropped;
|
|
47
|
-
private lastAbSnapshotAt;
|
|
48
|
-
private closed;
|
|
49
|
-
constructor(options: PersistenceCoordinatorOptions);
|
|
50
|
-
/** Durable session-record update (engine calls after every store save). */
|
|
51
|
-
sessionRecord(record: SessionRecord): void;
|
|
52
|
-
/** One appended session event (engine calls from its dispatch funnel). */
|
|
53
|
-
event(event: SessionEvent): void;
|
|
54
|
-
/**
|
|
55
|
-
* A boundary event's dispatch settled: channel/hook handlers ran and
|
|
56
|
-
* their record updates (channel state, continuation tokens) are
|
|
57
|
-
* buffered. This — not the append — is the turn-end flush point, so the
|
|
58
|
-
* persisted session record includes the boundary event's own handler
|
|
59
|
-
* mutations. Debounced batching intentionally ignores boundaries.
|
|
60
|
-
*/
|
|
61
|
-
eventDispatched(event: SessionEvent): void;
|
|
62
|
-
/** Flush everything buffered for one session (ordered: events, record). */
|
|
63
|
-
flushSession(sessionId: string, reason?: PersistenceContext["reason"]): void;
|
|
64
|
-
/**
|
|
65
|
-
* Index maintenance for `continuation/{channelId}/{token}` → sessionId:
|
|
66
|
-
* put the current token, delete the previous one when it changed.
|
|
67
|
-
*/
|
|
68
|
-
private continuationOps;
|
|
69
|
-
/** Whether the sink can serve the startup bulk restore (`list`). */
|
|
70
|
-
get canBulkRestore(): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Saved session records for this agent (startup restore). Errors are
|
|
73
|
-
* logged and read as "nothing saved" — a broken store must never block
|
|
74
|
-
* serve start.
|
|
75
|
-
*/
|
|
76
|
-
listSessions(): Promise<SessionRecord[]>;
|
|
77
|
-
/**
|
|
78
|
-
* Saved event stream for one session: chunk values concatenated in key
|
|
79
|
-
* order (chunks are keyed by their first event's index, zero-padded, so
|
|
80
|
-
* ascending key order is append order). Errors read as an empty stream.
|
|
81
|
-
*/
|
|
82
|
-
listSessionEvents(sessionId: string): Promise<SessionEvent[]>;
|
|
83
|
-
/**
|
|
84
|
-
* One saved session by channel continuation key (lazy restore). Unlike
|
|
85
|
-
* the startup reads, sink errors **propagate**: a failing store must
|
|
86
|
-
* fail the follow-up (which the caller can retry) rather than read as
|
|
87
|
-
* "unknown token" — that would mint a new session under the same
|
|
88
|
-
* continuation key and permanently shadow the real one on this host.
|
|
89
|
-
* A definitive miss (no index entry, or a write-only sink without
|
|
90
|
-
* `get`) resolves undefined.
|
|
91
|
-
*/
|
|
92
|
-
getSessionByContinuation(channelId: string, continuationKey: string): Promise<SessionRecord | undefined>;
|
|
93
|
-
/**
|
|
94
|
-
* Adapter for {@link EvalRunPersistence} so the playground eval store
|
|
95
|
-
* can fall back to this sink when `evals.config.ts` sets no
|
|
96
|
-
* `persistRuns`.
|
|
97
|
-
*/
|
|
98
|
-
asEvalRunPersistence(): EvalRunPersistence;
|
|
99
|
-
/**
|
|
100
|
-
* Adapter for {@link ABSamplePersistence} so the AB collector can fall
|
|
101
|
-
* back to this sink when `ab.config.ts` sets no `persistSamples`.
|
|
102
|
-
*/
|
|
103
|
-
asABSamplePersistence(): ABSamplePersistence;
|
|
104
|
-
/**
|
|
105
|
-
* Refresh the persisted aggregate A/B snapshot, throttled to once per
|
|
106
|
-
* {@link AB_SNAPSHOT_MIN_INTERVAL_MS} (the playground recomputes the
|
|
107
|
-
* fold on every `GET /v1/abs` poll).
|
|
108
|
-
*/
|
|
109
|
-
abSnapshot(snapshot: ABSnapshot): void;
|
|
110
|
-
/** Latest persisted aggregate A/B snapshot; errors read as absent. */
|
|
111
|
-
getLatestAbSnapshot(): Promise<ABSnapshot | undefined>;
|
|
112
|
-
/**
|
|
113
|
-
* Flush all buffers and drain the queue, giving the sink at most
|
|
114
|
-
* {@link CLOSE_DRAIN_TIMEOUT_MS} — a hung sink must not stall shutdown
|
|
115
|
-
* past the pod grace period. Called from engine close.
|
|
116
|
-
*/
|
|
117
|
-
close(): Promise<void>;
|
|
118
|
-
/** Pending deliveries (exposed for tests and drain instrumentation). */
|
|
119
|
-
whenIdle(): Promise<void>;
|
|
120
|
-
private buffer;
|
|
121
|
-
private armDebounce;
|
|
122
|
-
/** `list` wrapper for the startup reads: missing hook or throw ⇒ empty. */
|
|
123
|
-
private tryList;
|
|
124
|
-
private enqueue;
|
|
125
|
-
private context;
|
|
126
|
-
}
|
|
127
|
-
//# sourceMappingURL=persistence-coordinator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-coordinator.d.ts","sourceRoot":"","sources":["../../src/internal/persistence-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAkB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAE1B,KAAK,yBAAyB,EAE/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAa,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAyCnD,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,qBAAqB,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AASD,qBAAa,sBAAsB;IACjC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAwB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,6DAA6D;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoC;IACtE,yEAAyE;IACzE,OAAO,CAAC,KAAK,CAAoC;IACjD,u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ACxE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAExB;IAED,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,WAAW;IAgBnB,2EAA2E;YAC7D,OAAO;IAkBrB,OAAO,CAAC,OAAO;IAqCf,OAAO,CAAC,OAAO;CAGhB"}
|
package/dist/persistence.d.ts
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Durable persistence plug-in for agent-serve.
|
|
3
|
-
*
|
|
4
|
-
* Author `agent/persistence.ts` with {@link definePersistence} to mirror the
|
|
5
|
-
* framework's durable state into storage you own (a database, S3, a data
|
|
6
|
-
* pipeline, …). Without it, state lives under `--state-root` on local disk
|
|
7
|
-
* only (and eval/A/B history follows the narrower `persistRuns` /
|
|
8
|
-
* `persistSamples` / `persistSnapshots` hooks).
|
|
9
|
-
*
|
|
10
|
-
* The sink is a plain key-value store — four functions, no schema:
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { definePersistence } from "@anysphere/agent-serve/persistence";
|
|
14
|
-
*
|
|
15
|
-
* export default definePersistence({
|
|
16
|
-
* put: (key, value) => db.upsert(key, value),
|
|
17
|
-
* get: (key) => db.get(key),
|
|
18
|
-
* delete: (key) => db.delete(key),
|
|
19
|
-
* list: (prefix) => db.listByPrefix(prefix), // [{ key, value }] in key order
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* The **framework mints every key** from a stable, versioned scheme (see
|
|
24
|
-
* {@link persistenceKeys}) and decides **when** to call the sink: session
|
|
25
|
-
* records and event chunks flush when a turn's handlers have settled,
|
|
26
|
-
* reads happen at serve start (bulk restore), on continuation-token misses
|
|
27
|
-
* (lazy restore), and at playground hydration. Authors do not schedule
|
|
28
|
-
* reads or writes — the only timing knobs are {@link PersistencePolicy}'s
|
|
29
|
-
* `debounceMs` (event write batching) and `restore` (startup hydration).
|
|
30
|
-
*
|
|
31
|
-
* Because keys are opaque strings to the sink, new kinds of durable state
|
|
32
|
-
* (reminders, channel cursors, thread affinity, …) are new key prefixes —
|
|
33
|
-
* existing sinks store them with no code changes.
|
|
34
|
-
*
|
|
35
|
-
* Delivery semantics: writes are **serialized** (one sink call in flight
|
|
36
|
-
* per agent, in order), **bounded** (a sink that falls behind sheds writes
|
|
37
|
-
* rather than growing memory), and **at-most-once** — a throwing `put` is
|
|
38
|
-
* logged and dropped, never retried, and never fails a turn. The local
|
|
39
|
-
* event log under `--state-root` remains the live source of truth; this
|
|
40
|
-
* interface is the durable mirror.
|
|
41
|
-
*/
|
|
42
|
-
import type { JsonValue } from "./types.js";
|
|
43
|
-
/** One `{ key, value }` pair returned by {@link PersistenceConfig.list}. */
|
|
44
|
-
export interface PersistenceEntry {
|
|
45
|
-
key: string;
|
|
46
|
-
value: JsonValue;
|
|
47
|
-
}
|
|
48
|
-
/** Context passed to every sink call. */
|
|
49
|
-
export interface PersistenceContext {
|
|
50
|
-
/** Agent name (also baked into every key; see {@link persistenceKeys}). */
|
|
51
|
-
agentName: string;
|
|
52
|
-
/** Absolute agent project root (directory that contains `agent/`). */
|
|
53
|
-
projectRoot: string;
|
|
54
|
-
/**
|
|
55
|
-
* Why the framework is calling:
|
|
56
|
-
* - `"policy"` — a flush trigger fired (turn end, debounce, change)
|
|
57
|
-
* - `"shutdown"` — the serve process is draining; last chance to write
|
|
58
|
-
* - `"restore"` — serve start or a lazy restore; reads rebuilding state
|
|
59
|
-
*/
|
|
60
|
-
reason: "policy" | "shutdown" | "restore";
|
|
61
|
-
}
|
|
62
|
-
export interface PersistencePolicy {
|
|
63
|
-
/**
|
|
64
|
-
* Batch event-chunk writes on a quiet-period timer instead of flushing
|
|
65
|
-
* once per turn. The debounce **spans turn boundaries** — a rapid
|
|
66
|
-
* multi-turn exchange becomes one write when the session goes quiet —
|
|
67
|
-
* so it is the right choice for chatty sessions where per-turn writes
|
|
68
|
-
* are too many. Unset (default): one event chunk per turn.
|
|
69
|
-
*/
|
|
70
|
-
debounceMs?: number;
|
|
71
|
-
/**
|
|
72
|
-
* Guardrails for the **startup bulk restore**. Whatever `list` returns
|
|
73
|
-
* is filtered to these caps before anything is written to local disk, so
|
|
74
|
-
* a large store cannot blow up `--state-root` or stall serve start.
|
|
75
|
-
* Newest sessions (by `updatedAt`) win within each cap.
|
|
76
|
-
*
|
|
77
|
-
* `"off"` disables the startup restore entirely — sessions then restore
|
|
78
|
-
* one at a time as follow-ups actually arrive (lazy-only; recommended
|
|
79
|
-
* for high-traffic deployments).
|
|
80
|
-
*/
|
|
81
|
-
restore?: PersistenceRestorePolicy | "off";
|
|
82
|
-
}
|
|
83
|
-
/** Caps applied to the startup bulk restore. See {@link PersistencePolicy.restore}. */
|
|
84
|
-
export interface PersistenceRestorePolicy {
|
|
85
|
-
/** Max sessions materialized (default {@link PERSISTENCE_DEFAULT_RESTORE_MAX_SESSIONS}). */
|
|
86
|
-
maxSessions?: number;
|
|
87
|
-
/**
|
|
88
|
-
* Skip sessions whose `updatedAt` is older than this (default
|
|
89
|
-
* {@link PERSISTENCE_DEFAULT_RESTORE_MAX_AGE_MS}). Older sessions remain
|
|
90
|
-
* reachable lazily on their next follow-up.
|
|
91
|
-
*/
|
|
92
|
-
maxAgeMs?: number;
|
|
93
|
-
/**
|
|
94
|
-
* Stop restoring once this many bytes of records + events have been
|
|
95
|
-
* written (default {@link PERSISTENCE_DEFAULT_RESTORE_MAX_TOTAL_BYTES}).
|
|
96
|
-
* Checked before each session is written, so one oversized stream
|
|
97
|
-
* cannot blow past the budget.
|
|
98
|
-
*/
|
|
99
|
-
maxTotalBytes?: number;
|
|
100
|
-
}
|
|
101
|
-
export interface PersistenceConfig {
|
|
102
|
-
/** Optional label surfaced on `GET /v1/info` diagnostics. */
|
|
103
|
-
name?: string;
|
|
104
|
-
/** Timing knobs; see {@link PersistencePolicy}. */
|
|
105
|
-
policy?: PersistencePolicy;
|
|
106
|
-
/**
|
|
107
|
-
* Store one value under a key (upsert, last-write-wins). Called on the
|
|
108
|
-
* framework's schedule — never concurrently, always in order. Keep it
|
|
109
|
-
* fast or buffer internally: the delivery queue is bounded, so a sink
|
|
110
|
-
* that falls behind sustained traffic sheds writes (logged) instead of
|
|
111
|
-
* growing memory; it never stalls the agent loop.
|
|
112
|
-
*/
|
|
113
|
-
put(key: string, value: JsonValue, ctx: PersistenceContext): void | Promise<void>;
|
|
114
|
-
/** Remove a key. Optional — without it, deletions are skipped. */
|
|
115
|
-
delete?(key: string, ctx: PersistenceContext): void | Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Point lookup. Optional — required for **lazy restore** (resolving a
|
|
118
|
-
* continuation token on a replacement host) and the A/B backfill.
|
|
119
|
-
* Return `undefined`/`null` only for a **definitive** miss: on the lazy
|
|
120
|
-
* restore path a throw propagates and fails the follow-up (retryable) —
|
|
121
|
-
* a store outage must not read as "unknown token", which would fork the
|
|
122
|
-
* conversation onto a new session.
|
|
123
|
-
*/
|
|
124
|
-
get?(key: string, ctx: PersistenceContext): JsonValue | undefined | null | Promise<JsonValue | undefined | null>;
|
|
125
|
-
/**
|
|
126
|
-
* All entries under a key prefix, in ascending key order. Optional —
|
|
127
|
-
* required for the **startup bulk restore** (sessions + event streams)
|
|
128
|
-
* and playground eval history.
|
|
129
|
-
*/
|
|
130
|
-
list?(prefix: string, ctx: PersistenceContext): PersistenceEntry[] | Promise<PersistenceEntry[]>;
|
|
131
|
-
}
|
|
132
|
-
export type PersistenceDefinition = PersistenceConfig & {
|
|
133
|
-
readonly __agentServe: "persistence";
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Author the project persistence sink (`agent/persistence.ts`, default
|
|
137
|
-
* export). See the module doc for semantics and an example.
|
|
138
|
-
*/
|
|
139
|
-
export declare function definePersistence(config: PersistenceConfig): PersistenceDefinition;
|
|
140
|
-
/**
|
|
141
|
-
* The framework-owned key scheme. Keys are a **stable, versioned contract**
|
|
142
|
-
* (the `v1/` root): sinks may treat them as opaque strings, or route on
|
|
143
|
-
* prefixes (e.g. event chunks to object storage, everything else to a
|
|
144
|
-
* database). Channel ids and continuation tokens are the only segments
|
|
145
|
-
* that may contain caller-controlled characters; they are URI-encoded.
|
|
146
|
-
*
|
|
147
|
-
* | Key | Value |
|
|
148
|
-
* | --- | --- |
|
|
149
|
-
* | `v1/{agent}/session/{sessionId}` | `SessionRecord` |
|
|
150
|
-
* | `v1/{agent}/session-events/{sessionId}/{index}` | `SessionEvent[]` chunk (index = first event's index, zero-padded) |
|
|
151
|
-
* | `v1/{agent}/continuation/{channelId}/{token}` | `{ sessionId }` |
|
|
152
|
-
* | `v1/{agent}/eval-run/{runId}` | `EvalRunSnapshot` |
|
|
153
|
-
* | `v1/{agent}/ab-sample/{sessionId}/{at}` | `ABMetricSample` |
|
|
154
|
-
* | `v1/{agent}/ab-snapshot` | latest aggregate `ABSnapshot` |
|
|
155
|
-
*/
|
|
156
|
-
export declare const persistenceKeys: {
|
|
157
|
-
readonly session: (agent: string, sessionId: string) => string;
|
|
158
|
-
readonly sessionPrefix: (agent: string) => string;
|
|
159
|
-
readonly sessionEvents: (agent: string, sessionId: string, firstIndex: number) => string;
|
|
160
|
-
readonly sessionEventsPrefix: (agent: string, sessionId: string) => string;
|
|
161
|
-
readonly continuation: (agent: string, channelId: string, continuationKey: string) => string;
|
|
162
|
-
readonly evalRun: (agent: string, runId: string) => string;
|
|
163
|
-
readonly evalRunPrefix: (agent: string) => string;
|
|
164
|
-
readonly abSample: (agent: string, sessionId: string, at: string) => string;
|
|
165
|
-
readonly abSnapshot: (agent: string) => string;
|
|
166
|
-
};
|
|
167
|
-
export declare const PERSISTENCE_DEFAULT_RESTORE_MAX_SESSIONS = 1000;
|
|
168
|
-
export declare const PERSISTENCE_DEFAULT_RESTORE_MAX_AGE_MS: number;
|
|
169
|
-
export declare const PERSISTENCE_DEFAULT_RESTORE_MAX_TOTAL_BYTES = 1073741824;
|
|
170
|
-
/** {@link PersistencePolicy} with defaults applied. */
|
|
171
|
-
export interface ResolvedPersistencePolicy {
|
|
172
|
-
/** Event-chunk flush trigger: per turn, or debounced across turns. */
|
|
173
|
-
events: "turnEnd" | {
|
|
174
|
-
debounceMs: number;
|
|
175
|
-
};
|
|
176
|
-
restore: "off" | {
|
|
177
|
-
maxSessions: number;
|
|
178
|
-
maxAgeMs: number;
|
|
179
|
-
maxTotalBytes: number;
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
/** Apply {@link PersistencePolicy} defaults (exposed for tooling/tests). */
|
|
183
|
-
export declare function resolvePersistencePolicy(policy: PersistencePolicy | undefined): ResolvedPersistencePolicy;
|
|
184
|
-
//# sourceMappingURL=persistence.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../src/persistence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM5C,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,yCAAyC;AACzC,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC;CAC5C;AAED,uFAAuF;AACvF,MAAM,WAAW,wBAAwB;IACvC,4FAA4F;IAC5F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;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