@loopingai/core 0.1.0 → 0.1.2
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 +74 -1
- package/dist/agent/history.d.ts +3 -3
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/model.d.ts +0 -7
- package/dist/agent/model.d.ts.map +1 -1
- package/dist/agent/model.js +0 -13
- package/dist/agent/model.js.map +1 -1
- package/dist/agent/session.d.ts +21 -11
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +13 -10
- package/dist/agent/session.js.map +1 -1
- package/dist/config.d.ts +0 -17
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -6
- package/dist/config.js.map +1 -1
- package/dist/contract/index.d.ts +1 -1
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js.map +1 -1
- package/dist/contract/plugin.d.ts +105 -3
- package/dist/contract/plugin.d.ts.map +1 -1
- package/dist/contract/plugin.js.map +1 -1
- package/dist/contract/validation.d.ts +6 -4
- package/dist/contract/validation.d.ts.map +1 -1
- package/dist/contract/validation.js.map +1 -1
- package/dist/db/db.d.ts +32 -14
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db.js.map +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/index.d.ts +31 -2
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +63 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/subagent/index.d.ts +3 -3
- package/dist/subagent/index.js +3 -3
- package/dist/subagent/workspace.d.ts +21 -0
- package/dist/subagent/workspace.d.ts.map +1 -1
- package/dist/subagent/workspace.js +80 -5
- package/dist/subagent/workspace.js.map +1 -1
- package/dist/subtasks/catalog.d.ts +5 -4
- package/dist/subtasks/catalog.d.ts.map +1 -1
- package/dist/subtasks/catalog.js +5 -4
- package/dist/subtasks/catalog.js.map +1 -1
- package/dist/subtasks/delegate.d.ts +2 -1
- package/dist/subtasks/delegate.d.ts.map +1 -1
- package/dist/subtasks/delegate.js +2 -1
- package/dist/subtasks/delegate.js.map +1 -1
- package/dist/testing/fake-session.d.ts +1 -1
- package/dist/testing/fake-session.d.ts.map +1 -1
- package/dist/testing/fake-session.js +1 -1
- package/dist/testing/fake-session.js.map +1 -1
- package/dist/testing/node.d.ts +23 -0
- package/dist/testing/node.d.ts.map +1 -1
- package/dist/testing/node.js +23 -0
- package/dist/testing/node.js.map +1 -1
- package/dist/testing/vcr-spec.d.ts +4 -4
- package/dist/testing/vcr-spec.d.ts.map +1 -1
- package/dist/testing/vcr-spec.js +32 -11
- package/dist/testing/vcr-spec.js.map +1 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -207,6 +207,77 @@ its cause.
|
|
|
207
207
|
The contract is **additive-only within a major**: new capabilities arrive as optional
|
|
208
208
|
fields on `AgentPlugin`.
|
|
209
209
|
|
|
210
|
+
### Plugin-owned tables
|
|
211
|
+
|
|
212
|
+
A plugin owns its tables outright, through `store: PluginStore` — but it must stay out of
|
|
213
|
+
core's migration journal. `drizzle-orm/durable-sqlite/migrator` keeps one flat integer
|
|
214
|
+
journal and one global `__drizzle_migrations` table, and two independently-versioned
|
|
215
|
+
packages cannot share that index space.
|
|
216
|
+
|
|
217
|
+
That is a prohibition on exactly **one import**, not on drizzle. The query builder holds
|
|
218
|
+
no journal and no connection state, so a plugin declares its tables with `sqliteTable`,
|
|
219
|
+
writes idempotent DDL in `ensureTables`, and queries through its own handle:
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
export const scrapes = sqliteTable("scraper_scrapes", { url: text("url").primaryKey() });
|
|
223
|
+
|
|
224
|
+
store: {
|
|
225
|
+
plugin: "scraper",
|
|
226
|
+
version: 1,
|
|
227
|
+
// Re-run on every hibernation wake-up, so it must be idempotent.
|
|
228
|
+
ensureTables: (sql) => sql.exec(`CREATE TABLE IF NOT EXISTS scraper_scrapes (…)`)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// …and anywhere the plugin queries:
|
|
232
|
+
const db = drizzle(storage, { schema: { scrapes } });
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Core records each store's version in a `plugin_migrations` row, so `ensureTables` receives
|
|
236
|
+
the version last seen on disk and an upgrade path can branch on it.
|
|
237
|
+
|
|
238
|
+
### Session hooks
|
|
239
|
+
|
|
240
|
+
`onMessagesDisplaced` hands over the raw messages a compaction is about to fold into a
|
|
241
|
+
summary. Core performs the compaction, so core announces the loss; it neither stores the
|
|
242
|
+
messages nor knows who wants them. An episodic-memory plugin, an audit log, and a
|
|
243
|
+
cold-storage dump all want exactly this callback, and each gets it:
|
|
244
|
+
|
|
245
|
+
```ts
|
|
246
|
+
// in your DO, wiring the runtime's fan-out into the session
|
|
247
|
+
buildAgentSession(this, model, {
|
|
248
|
+
…,
|
|
249
|
+
onMessagesDisplaced: this.runtime.onMessagesDisplaced
|
|
250
|
+
});
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Best-effort in both directions — a listener that throws never aborts compaction (history
|
|
254
|
+
must still shorten when a side store is down), and the fan-out is `Promise.allSettled`, so
|
|
255
|
+
one plugin's outage cannot cost another its notification.
|
|
256
|
+
|
|
257
|
+
`shouldHandleTurn` is the other side of the session: a gate that decides whether a turn
|
|
258
|
+
runs at all, before the loop builds or calls anything. An agent that sees every message in
|
|
259
|
+
its channels is mostly seeing messages that are not for it, and asking a model already
|
|
260
|
+
trying to be helpful to stay quiet degrades _invisibly_ — failing to call a decline-tool
|
|
261
|
+
looks identical to deciding not to. Every declaring plugin is consulted and the answers are
|
|
262
|
+
AND-ed, so any one gate may decline.
|
|
263
|
+
|
|
264
|
+
```ts
|
|
265
|
+
if (!(await this.runtime.shouldHandleTurn({ history }))) return; // declined
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
It **fails open**: a gate that throws is counted as `true`. The two mistakes are not
|
|
269
|
+
symmetric — a wrong reply is noise the user can see and ignore, while a wrong silence is
|
|
270
|
+
invisible to the person who needed an answer.
|
|
271
|
+
|
|
272
|
+
### The workspace backend
|
|
273
|
+
|
|
274
|
+
Core declares the `WorkspaceBacking` shape and enforces the caps, but ships no backend —
|
|
275
|
+
the predecessor's was `@cloudflare/shell`, which is experimental, and an agent that never
|
|
276
|
+
delegates file work should not carry it. A plugin supplies one via `workspaceBacking`; at
|
|
277
|
+
most one may, and an agent that installs none gets `memoryWorkspaceBacking`. So
|
|
278
|
+
`runtime.workspaceBacking` is always defined and your `SubagentRuntime` never needs a null
|
|
279
|
+
check.
|
|
280
|
+
|
|
210
281
|
---
|
|
211
282
|
|
|
212
283
|
## Testing
|
|
@@ -246,7 +317,9 @@ await withDb("accepts a turn once", async (db) => {
|
|
|
246
317
|
- The main agent's soul. Core ships no prompt copy.
|
|
247
318
|
- Config _values_ — model ids, budgets, limits. Core ships the shapes and safe
|
|
248
319
|
defaults, and `resolveConfig` validates your overrides.
|
|
249
|
-
- Vectorize recall, browser tools, shell. All optional → plugins.
|
|
320
|
+
- Vectorize recall, browser tools, shell. All optional → plugins. Core contains no
|
|
321
|
+
embedding code at all: it ships the `onMessagesDisplaced` hook and nothing about what
|
|
322
|
+
a listener does with the messages — no embedding model, no index, no dimension.
|
|
250
323
|
|
|
251
324
|
---
|
|
252
325
|
|
package/dist/agent/history.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ import type { SessionMessage } from "agents/experimental/memory/session";
|
|
|
7
7
|
* A2A adapter} has already reduced the inbound message to a plain string.
|
|
8
8
|
*
|
|
9
9
|
* The gateway inlines a `<turn from="…" id="…" channel="…" at="…">…</turn>` tag
|
|
10
|
-
* into the message text in multi-actor channels so the model
|
|
11
|
-
*
|
|
12
|
-
* wrapper
|
|
10
|
+
* into the message text in multi-actor channels so the model — and anything
|
|
11
|
+
* downstream that needs per-message provenance — can attribute "who said what".
|
|
12
|
+
* This agent only *parses* that wrapper; it never authors one.
|
|
13
13
|
*
|
|
14
14
|
* We persist only the user turn and the assistant's final text: intra-turn tool
|
|
15
15
|
* steps stay inside the single `generateText` call, so stored history is plain
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* turns "the model called something that ends the round" into a checked value.
|
|
9
9
|
*/
|
|
10
10
|
export { newTurnBudget, stepAllowance, type TurnBudget } from "./budget.js";
|
|
11
|
-
export { createModelRuntime, type
|
|
12
|
-
export { appendOnce,
|
|
11
|
+
export { createModelRuntime, type GatewayMetadata, type ModelOverrides, type ModelPair, type ModelRuntime, type ModelRuntimeDeps } from "./model.js";
|
|
12
|
+
export { appendOnce, buildAgentSession, notifyingCompaction, type AgentSessionOptions, type SessionHost, type SessionLike } from "./session.js";
|
|
13
13
|
export { deterministicSessionMessage, finalReplyMessageId, parseRoundAckMessageId, parseTurn, roundAckMessageId, sessionText, taskUserMessageId, toModelMessages, type ParsedTurn } from "./history.js";
|
|
14
14
|
export { buildIntermediateContentHandler, isTransientAiError, type OnContent } from "./inference.js";
|
|
15
15
|
export { ControlCallError, controlTools, controlToolSet, type ControlTool, type TurnDecision } from "./control.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EACL,kBAAkB,EAClB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EACL,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,EAClB,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACf,MAAM,kBAAkB,CAAC"}
|
package/dist/agent/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { newTurnBudget, stepAllowance } from "./budget.js";
|
|
11
11
|
export { createModelRuntime } from "./model.js";
|
|
12
|
-
export { appendOnce,
|
|
12
|
+
export { appendOnce, buildAgentSession, notifyingCompaction } from "./session.js";
|
|
13
13
|
export { deterministicSessionMessage, finalReplyMessageId, parseRoundAckMessageId, parseTurn, roundAckMessageId, sessionText, taskUserMessageId, toModelMessages } from "./history.js";
|
|
14
14
|
export { buildIntermediateContentHandler, isTransientAiError } from "./inference.js";
|
|
15
15
|
export { ControlCallError, controlTools, controlToolSet } from "./control.js";
|
package/dist/agent/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAmB,MAAM,aAAa,CAAC;AAE5E,OAAO,EACL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAmB,MAAM,aAAa,CAAC;AAE5E,OAAO,EACL,kBAAkB,EAMnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EAIpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EAEhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,EAGf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACf,MAAM,kBAAkB,CAAC"}
|
package/dist/agent/model.d.ts
CHANGED
|
@@ -8,12 +8,6 @@ import type { ModelConfig } from "../config.js";
|
|
|
8
8
|
* Workers, and a module constant cannot be overridden by a consumer. So this is
|
|
9
9
|
* a factory over an injected binding and an injected {@link ModelConfig}.
|
|
10
10
|
*/
|
|
11
|
-
/**
|
|
12
|
-
* Embed a batch of texts for episodic recall. Uses the same Workers-AI + AI
|
|
13
|
-
* Gateway path as the chat models so embeddings get the same gateway
|
|
14
|
-
* observability/caching. The output dimension must match the Vectorize index.
|
|
15
|
-
*/
|
|
16
|
-
export type Embed = (texts: string[]) => Promise<number[][]>;
|
|
17
11
|
/**
|
|
18
12
|
* Custom metadata attached to the AI Gateway log for every call a pair makes.
|
|
19
13
|
* The gateway's own `metadata` is otherwise `null`, so a model call can only be
|
|
@@ -55,7 +49,6 @@ export interface ModelRuntime {
|
|
|
55
49
|
* `validateRecipe` is the single validation owner for recipe-supplied ids.
|
|
56
50
|
*/
|
|
57
51
|
createModelPair(overrides?: ModelOverrides): ModelPair;
|
|
58
|
-
embedTexts: Embed;
|
|
59
52
|
}
|
|
60
53
|
export interface ModelRuntimeDeps {
|
|
61
54
|
/** The `AI` binding. Read lazily — see {@link createModelRuntime}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/agent/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/agent/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAExE,MAAM,WAAW,cAAc;IAC7B,0CAA0C;IAC1C,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,gFAAgF;AAChF,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,aAAa,CAAC;IAC7B,QAAQ,EAAE,MAAM,aAAa,CAAC;IAC9B,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,eAAe,CAAC,SAAS,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CACxD;AAED,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,EAAE,EAAE,EAAE,CAAC;IACP,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CA2CvE"}
|
package/dist/agent/model.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createWorkersAI } from "workers-ai-provider";
|
|
2
|
-
import { embedMany } from "ai";
|
|
3
2
|
/**
|
|
4
3
|
* Build the model runtime for one agent instance.
|
|
5
4
|
*
|
|
@@ -44,18 +43,6 @@ export function createModelRuntime(deps) {
|
|
|
44
43
|
primaryId: () => primaryId,
|
|
45
44
|
fallbackId: () => fallbackId
|
|
46
45
|
};
|
|
47
|
-
},
|
|
48
|
-
async embedTexts(texts) {
|
|
49
|
-
if (texts.length === 0)
|
|
50
|
-
return [];
|
|
51
|
-
const { embeddings } = await embedMany({
|
|
52
|
-
model: workersai().embedding(config.embeddingModelId),
|
|
53
|
-
values: texts,
|
|
54
|
-
// Failures surface to the caller (best-effort archival swallows them);
|
|
55
|
-
// the SDK's retry/backoff would only add latency on a hard failure.
|
|
56
|
-
maxRetries: 0
|
|
57
|
-
});
|
|
58
|
-
return embeddings;
|
|
59
46
|
}
|
|
60
47
|
};
|
|
61
48
|
}
|
package/dist/agent/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/agent/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/agent/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,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AAQ,CAAC,CAAC;gBACtC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS;gBAC1B,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/agent/session.d.ts
CHANGED
|
@@ -5,8 +5,12 @@ import { createCompactFunction } from "agents/experimental/memory/utils";
|
|
|
5
5
|
/**
|
|
6
6
|
* The one continuous {@link Session} an agent Durable Object owns. Ported from
|
|
7
7
|
* the looping-gateway admin agent's `shared/session.ts` (single Session per DO —
|
|
8
|
-
* soul + memory + compaction).
|
|
9
|
-
*
|
|
8
|
+
* soul + memory + compaction).
|
|
9
|
+
*
|
|
10
|
+
* Compaction is the one **lossy** thing this module does, so it is also the one
|
|
11
|
+
* thing it announces: `onMessagesDisplaced` hands over the raw messages a
|
|
12
|
+
* summary is about to replace. Core neither stores them nor knows who wants
|
|
13
|
+
* them — a host wires the seam to whatever does.
|
|
10
14
|
*/
|
|
11
15
|
/**
|
|
12
16
|
* The SQLite-backed host the Sessions API needs — satisfied by the Agents SDK
|
|
@@ -28,7 +32,7 @@ export interface SessionLike {
|
|
|
28
32
|
getMessage(id: string): Promise<SessionMessage | null>;
|
|
29
33
|
refreshSystemPrompt(): Promise<string>;
|
|
30
34
|
tools(): Promise<ToolSet>;
|
|
31
|
-
/** Compaction overlays so far — non-empty ⇒
|
|
35
|
+
/** Compaction overlays so far — non-empty ⇒ history has been displaced. */
|
|
32
36
|
getCompactions(): Promise<unknown[]>;
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
@@ -67,20 +71,26 @@ export interface AgentSessionOptions {
|
|
|
67
71
|
*/
|
|
68
72
|
maxOutputTokens: number;
|
|
69
73
|
/**
|
|
70
|
-
*
|
|
71
|
-
* Best-effort: a throw here must never abort compaction.
|
|
74
|
+
* Hand over the raw messages each compaction displaces, before a summary
|
|
75
|
+
* replaces them. Best-effort: a throw here must never abort compaction.
|
|
76
|
+
*
|
|
77
|
+
* The seam, not a policy — pass `runtime.onMessagesDisplaced` to reach every
|
|
78
|
+
* installed plugin declaring the hook, or any function of your own.
|
|
72
79
|
*/
|
|
73
|
-
|
|
80
|
+
onMessagesDisplaced?: (messages: SessionMessage[]) => Promise<void>;
|
|
74
81
|
}
|
|
75
82
|
type CompactFn = ReturnType<typeof createCompactFunction>;
|
|
76
83
|
/**
|
|
77
84
|
* Wrap a compaction function so the raw messages it folds into a summary are
|
|
78
|
-
* also handed to `
|
|
79
|
-
* range is `fromMessageId..toMessageId` of the result,
|
|
80
|
-
*
|
|
81
|
-
*
|
|
85
|
+
* also handed to `onMessagesDisplaced` before they stop being readable as
|
|
86
|
+
* history. The displaced range is `fromMessageId..toMessageId` of the result,
|
|
87
|
+
* sliced from the `history` the compaction saw.
|
|
88
|
+
*
|
|
89
|
+
* A listener's failure is swallowed — compaction must still shorten history
|
|
90
|
+
* when whatever is listening is briefly unavailable. The alternative is
|
|
91
|
+
* unbounded context because a side concern is down.
|
|
82
92
|
*/
|
|
83
|
-
export declare function
|
|
93
|
+
export declare function notifyingCompaction(base: CompactFn, onMessagesDisplaced?: (messages: SessionMessage[]) => Promise<void>): CompactFn;
|
|
84
94
|
/**
|
|
85
95
|
* Build the one continuous `Session` an agent Durable Object owns: a read-only
|
|
86
96
|
* `"soul"` identity block + a writable `"memory"` scratchpad, with history
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/agent/session.ts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,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,qFAAqF;IACrF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,eAAe,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1D;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,EACf,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAClE,SAAS,CAiBX;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CA2BT"}
|
package/dist/agent/session.js
CHANGED
|
@@ -22,13 +22,16 @@ export async function appendOnce(session, message) {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Wrap a compaction function so the raw messages it folds into a summary are
|
|
25
|
-
* also handed to `
|
|
26
|
-
* range is `fromMessageId..toMessageId` of the result,
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* also handed to `onMessagesDisplaced` before they stop being readable as
|
|
26
|
+
* history. The displaced range is `fromMessageId..toMessageId` of the result,
|
|
27
|
+
* sliced from the `history` the compaction saw.
|
|
28
|
+
*
|
|
29
|
+
* A listener's failure is swallowed — compaction must still shorten history
|
|
30
|
+
* when whatever is listening is briefly unavailable. The alternative is
|
|
31
|
+
* unbounded context because a side concern is down.
|
|
29
32
|
*/
|
|
30
|
-
export function
|
|
31
|
-
if (!
|
|
33
|
+
export function notifyingCompaction(base, onMessagesDisplaced) {
|
|
34
|
+
if (!onMessagesDisplaced)
|
|
32
35
|
return base;
|
|
33
36
|
return async (history, options) => {
|
|
34
37
|
const result = await base(history, options);
|
|
@@ -37,10 +40,10 @@ export function archivingCompaction(base, onArchive) {
|
|
|
37
40
|
const to = history.findIndex((m) => m.id === result.toMessageId);
|
|
38
41
|
if (from !== -1 && to !== -1) {
|
|
39
42
|
try {
|
|
40
|
-
await
|
|
43
|
+
await onMessagesDisplaced(history.slice(from, to + 1));
|
|
41
44
|
}
|
|
42
45
|
catch (err) {
|
|
43
|
-
console.error("[
|
|
46
|
+
console.error("[session] displacement listener failed", err);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
@@ -54,7 +57,7 @@ export function archivingCompaction(base, onArchive) {
|
|
|
54
57
|
* or thread) accumulate into this single conversation.
|
|
55
58
|
*/
|
|
56
59
|
export function buildAgentSession(agent, model, opts) {
|
|
57
|
-
const compact =
|
|
60
|
+
const compact = notifyingCompaction(createCompactFunction({
|
|
58
61
|
// The one boundary worth owning. `protectHead` (3) and `minTailMessages`
|
|
59
62
|
// (2) keep the SDK defaults: the head is the conversation's opening and is
|
|
60
63
|
// cheap, and the tail floor is a safety net rather than a budget.
|
|
@@ -67,7 +70,7 @@ export function buildAgentSession(agent, model, opts) {
|
|
|
67
70
|
prompt,
|
|
68
71
|
maxOutputTokens: opts.maxOutputTokens
|
|
69
72
|
}).then((r) => r.text)
|
|
70
|
-
}), opts.
|
|
73
|
+
}), opts.onMessagesDisplaced);
|
|
71
74
|
return Session.create(agent)
|
|
72
75
|
.withContext("soul", { provider: { get: async () => opts.soul() } })
|
|
73
76
|
.withContext("memory", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":[],"mappings":"AACA,OAAO,E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,QAAQ,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,iBAAiB;QACnC,SAAS,EAAE,IAAI,CAAC,eAAe;KAChC,CAAC;SACD,YAAY,CAAC,OAAO,CAAC;SACrB,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -31,11 +31,6 @@ export interface ModelConfig {
|
|
|
31
31
|
maxOutputTokens: number;
|
|
32
32
|
/** Reasoning budget forwarded on the binding's `inputs` by workers-ai-provider. */
|
|
33
33
|
reasoningEffort: "low" | "medium" | "high";
|
|
34
|
-
/**
|
|
35
|
-
* Embedding model backing recall. Its dimension/metric must match the
|
|
36
|
-
* Vectorize index (1024-dim, cosine); changing it means recreating the index.
|
|
37
|
-
*/
|
|
38
|
-
embeddingModelId: string;
|
|
39
34
|
}
|
|
40
35
|
/**
|
|
41
36
|
* An execution budget, in the only two currencies that mean anything: **turns**
|
|
@@ -89,17 +84,6 @@ export interface SessionConfig {
|
|
|
89
84
|
/** One-line description shown to the model for the writable `"memory"` block. */
|
|
90
85
|
memoryDescription: string;
|
|
91
86
|
}
|
|
92
|
-
/** Episodic-recall (Vectorize) tuning. */
|
|
93
|
-
export interface RecallConfig {
|
|
94
|
-
/** Default number of archived messages one `recall` query returns. */
|
|
95
|
-
topK: number;
|
|
96
|
-
/**
|
|
97
|
-
* Max chars of a message's text stored in its vector metadata. Keeps each
|
|
98
|
-
* vector under Vectorize's ~10 KiB/vector limit; recall returns this snippet
|
|
99
|
-
* plus provenance, not the full original message.
|
|
100
|
-
*/
|
|
101
|
-
metadataTextMax: number;
|
|
102
|
-
}
|
|
103
87
|
export interface CoreConfig {
|
|
104
88
|
model: ModelConfig;
|
|
105
89
|
/** What bounds the MAIN agent across every round of one task. */
|
|
@@ -132,7 +116,6 @@ export interface CoreConfig {
|
|
|
132
116
|
*/
|
|
133
117
|
maxSubtasks: number;
|
|
134
118
|
session: SessionConfig;
|
|
135
|
-
recall: RecallConfig;
|
|
136
119
|
}
|
|
137
120
|
/**
|
|
138
121
|
* A working baseline. Every value is overridable; none is a ceiling. These are
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,eAAe,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,eAAe,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CAC5C;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,eAAe,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;OAaG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,WAAW,CAAC;IACnB,iEAAiE;IACjE,eAAe,EAAE,WAAW,CAAC;IAC7B;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAoBjC,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,mBAAmB,GAAG;KAC/B,CAAC,IAAI,MAAM,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,MAAM,GAClD,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GACtB,UAAU,CAAC,CAAC,CAAC;CAClB,CAAC;AAEF,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,GAAE,mBAAwB,GAAG,UAAU,CA2C7E"}
|
package/dist/config.js
CHANGED
|
@@ -22,8 +22,7 @@ export const DEFAULT_CORE_CONFIG = {
|
|
|
22
22
|
fallbackChatModelId: "@cf/moonshotai/kimi-k2.7-code",
|
|
23
23
|
aiGatewayId: "default",
|
|
24
24
|
maxOutputTokens: 16_384,
|
|
25
|
-
reasoningEffort: "medium"
|
|
26
|
-
embeddingModelId: "@cf/baai/bge-m3"
|
|
25
|
+
reasoningEffort: "medium"
|
|
27
26
|
},
|
|
28
27
|
mainAgentLimits: { maxTurns: 20, maxWallMs: 60 * 60_000 },
|
|
29
28
|
subagentLimits: { maxTurns: 20, maxWallMs: 30 * 60_000 },
|
|
@@ -35,8 +34,7 @@ export const DEFAULT_CORE_CONFIG = {
|
|
|
35
34
|
compactTailTokens: 5_000,
|
|
36
35
|
memoryDescription: "Durable facts worth remembering across all of this caller's conversations — " +
|
|
37
36
|
"stable preferences, decisions, people, and context. Keep it concise."
|
|
38
|
-
}
|
|
39
|
-
recall: { topK: 5, metadataTextMax: 2000 }
|
|
37
|
+
}
|
|
40
38
|
};
|
|
41
39
|
export class ConfigError extends Error {
|
|
42
40
|
constructor(message) {
|
|
@@ -65,8 +63,7 @@ export function resolveConfig(overrides = {}) {
|
|
|
65
63
|
},
|
|
66
64
|
toolOutputWindow: overrides.toolOutputWindow ?? DEFAULT_CORE_CONFIG.toolOutputWindow,
|
|
67
65
|
maxSubtasks: overrides.maxSubtasks ?? DEFAULT_CORE_CONFIG.maxSubtasks,
|
|
68
|
-
session: { ...DEFAULT_CORE_CONFIG.session, ...overrides.session }
|
|
69
|
-
recall: { ...DEFAULT_CORE_CONFIG.recall, ...overrides.recall }
|
|
66
|
+
session: { ...DEFAULT_CORE_CONFIG.session, ...overrides.session }
|
|
70
67
|
};
|
|
71
68
|
const positive = (value, name) => {
|
|
72
69
|
if (!Number.isFinite(value) || value <= 0) {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgHH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAe;IAC7C,KAAK,EAAE;QACL,WAAW,EAAE,qBAAqB;QAClC,mBAAmB,EAAE,+BAA+B;QACpD,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,MAAM;QACvB,eAAe,EAAE,QAAQ;KAC1B;IACD,eAAe,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE;I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AC,CAAC;QAC3E,CAAC;IACH,CAAC,CAAC;IAEF,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;IACtE,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;IACxE,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAC;IACpE,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,0BAA0B,CAAC,CAAC;IACtE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IACtD,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAEhE,4EAA4E;IAC5E,4DAA4D;IAC5D,MAAM,QAAQ,GACZ,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC;IACvE,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,WAAW,CACnB,gFAAgF,QAAQ,IAAI;YAC1F,wDAAwD,CAC3D,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Re-exported from the package root as well, so a plugin author writes
|
|
5
5
|
* `import { definePlugin } from "@loopingai/core"` and nothing else.
|
|
6
6
|
*/
|
|
7
|
-
export { PLUGIN_CONTRACT_VERSION, definePlugin, type AgentPlugin, type EmitProgress, type EnrichResultContext, type PluginRequirements, type RecipeToolSet, type ResolveRuntimeContext, type ToolFamilyBuilder, type ToolFamilyContext } from "./plugin.js";
|
|
7
|
+
export { PLUGIN_CONTRACT_VERSION, definePlugin, type AgentPlugin, type EmitProgress, type EnrichResultContext, type MainAgentToolContext, type PluginRequirements, type RecipeToolSet, type ResolveRuntimeContext, type ToolFamilyBuilder, type ToolFamilyContext, type TurnGateContext } from "./plugin.js";
|
|
8
8
|
export type { DelegationNames, RecipeLimits, ResolvedRecipe, SubtaskParams, SubtaskParamsSchema, SubtaskParamsShape, SubtaskTypeSpec, ValidatedRecipe } from "./recipe.js";
|
|
9
9
|
export { RecipeValidationError, resolveLimits, validateRecipe, type RecipePolicy } from "./validation.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,uBAAuB,EACvB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,uBAAuB,EACvB,YAAY,EAWb,MAAM,aAAa,CAAC;AAarB,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,cAAc,EAEf,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ToolSet } from "ai";
|
|
2
|
+
import type { SessionMessage } from "agents/experimental/memory/session";
|
|
3
|
+
import type { SessionLike } from "../agent/session.js";
|
|
2
4
|
import type { PluginStore } from "../db/db.js";
|
|
3
|
-
import type { WorkspaceHandle } from "../subagent/workspace.js";
|
|
5
|
+
import type { WorkspaceBacking, WorkspaceHandle } from "../subagent/workspace.js";
|
|
4
6
|
import type { ProgressEvent, RecipeExecutionRequest, RecipeExecutionResult, SubtaskRuntime } from "../subtasks/types.js";
|
|
5
7
|
import type { SubtaskParams, SubtaskTypeSpec } from "./recipe.js";
|
|
6
8
|
/**
|
|
@@ -87,6 +89,34 @@ export interface EnrichResultContext<TRuntime = SubtaskRuntime> {
|
|
|
87
89
|
request: RecipeExecutionRequest;
|
|
88
90
|
runtime: TRuntime;
|
|
89
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* What a plugin knows when it builds the *main* agent's tools.
|
|
94
|
+
*
|
|
95
|
+
* Deliberately just the session, and deliberately not the caller's identity. A
|
|
96
|
+
* plugin that needs a per-caller value takes it as config at instantiation, like
|
|
97
|
+
* every other config value — the Durable Object is keyed 1:1 by the verified
|
|
98
|
+
* caller, so that value is constant for its life. Putting it here as well would
|
|
99
|
+
* give a plugin two ways to reach one fact, and the *other* hook that needs it
|
|
100
|
+
* ({@link AgentPlugin.onMessagesDisplaced}) has no context to read it from
|
|
101
|
+
* anyway.
|
|
102
|
+
*
|
|
103
|
+
* What the session gives that config cannot is **durable state the tool surface
|
|
104
|
+
* depends on** — whether history has ever been compacted, how many contexts are
|
|
105
|
+
* set. That is a question only the session can answer, and only at call time.
|
|
106
|
+
*/
|
|
107
|
+
export interface MainAgentToolContext {
|
|
108
|
+
session: SessionLike;
|
|
109
|
+
}
|
|
110
|
+
/** What a plugin knows when deciding whether a turn should run at all. */
|
|
111
|
+
export interface TurnGateContext {
|
|
112
|
+
/**
|
|
113
|
+
* The conversation so far, **including the message being judged** — which is
|
|
114
|
+
* already appended when a gate runs, so the agent reads a message it declines.
|
|
115
|
+
* A bare message is frequently unclassifiable ("yes", "thanks", "and the
|
|
116
|
+
* second one?"), so the tail is what makes the judgement possible at all.
|
|
117
|
+
*/
|
|
118
|
+
history: SessionMessage[];
|
|
119
|
+
}
|
|
90
120
|
/** Bindings and secrets a plugin needs the *host* to provide in `wrangler.jsonc`. */
|
|
91
121
|
export interface PluginRequirements {
|
|
92
122
|
/** Secret names, e.g. `["ARC_API_KEY"]`. */
|
|
@@ -114,11 +144,25 @@ export interface AgentPlugin<TRuntime = SubtaskRuntime> {
|
|
|
114
144
|
* `validateRecipe`, so the legal set is exactly what is installed.
|
|
115
145
|
*/
|
|
116
146
|
toolFamilies?: Record<string, ToolFamilyBuilder<TRuntime>>;
|
|
117
|
-
/**
|
|
118
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Tools offered to the *main* agent (e.g. a catalogue lookup before
|
|
149
|
+
* delegating).
|
|
150
|
+
*
|
|
151
|
+
* May return a promise, so a plugin can shape its tool surface from durable
|
|
152
|
+
* state — offering a search tool only once there is something to search, say.
|
|
153
|
+
* A tool that can only ever return "nothing here yet" costs the model a call to
|
|
154
|
+
* find that out, and costs every round the tokens to describe it.
|
|
155
|
+
*/
|
|
156
|
+
mainAgentTools?: (ctx: MainAgentToolContext) => ToolSet | Promise<ToolSet>;
|
|
119
157
|
/**
|
|
120
158
|
* What the main agent is told it can do with this domain, rendered into its
|
|
121
159
|
* soul alongside the other capability blocks.
|
|
160
|
+
*
|
|
161
|
+
* A plugin that declares a {@link subtaskType} should put its capability block
|
|
162
|
+
* on the *type* instead ({@link SubtaskTypeSpec.capability}) and leave this
|
|
163
|
+
* unset — the two are rendered by different call sites, so declaring both
|
|
164
|
+
* makes the main agent read the same advice twice per round. Which is the
|
|
165
|
+
* exact failure the type's own prompt fields were introduced to end.
|
|
122
166
|
*/
|
|
123
167
|
capability?: string;
|
|
124
168
|
/**
|
|
@@ -137,8 +181,66 @@ export interface AgentPlugin<TRuntime = SubtaskRuntime> {
|
|
|
137
181
|
enrichResult?: (ctx: EnrichResultContext<TRuntime>, result: RecipeExecutionResult) => Promise<RecipeExecutionResult>;
|
|
138
182
|
/** Release anything {@link resolveRuntime} acquired, when an execution is canceled. */
|
|
139
183
|
onAbort?: (ctx: ResolveRuntimeContext) => Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* Decide whether a turn should run at all, before the loop builds or calls
|
|
186
|
+
* anything.
|
|
187
|
+
*
|
|
188
|
+
* An agent that sees every message in its channels is mostly seeing messages
|
|
189
|
+
* that are not for it. Left to the main loop that judgement is made by a model
|
|
190
|
+
* simultaneously trying to be helpful, with history and half a dozen tools in
|
|
191
|
+
* view, and it degrades exactly there — *invisibly*, because failing to call a
|
|
192
|
+
* decline-tool looks identical to deciding not to. A gate moves the decision
|
|
193
|
+
* somewhere it cannot be skipped.
|
|
194
|
+
*
|
|
195
|
+
* **Fails open, and the asymmetry is the whole design.** A gate that throws is
|
|
196
|
+
* counted as `true`, so an outage degrades to the previous behaviour (run the
|
|
197
|
+
* turn) and never to a silent agent: a wrong reply is noise the user can see
|
|
198
|
+
* and ignore, while a wrong silence is invisible — the person who needed the
|
|
199
|
+
* agent simply never hears back. Failing *synchronously* is as safe as
|
|
200
|
+
* rejecting.
|
|
201
|
+
*
|
|
202
|
+
* Every declaring plugin is consulted and the results are AND-ed: any one gate
|
|
203
|
+
* may decline the turn. Returning `true` is always valid.
|
|
204
|
+
*/
|
|
205
|
+
shouldHandleTurn?: (ctx: TurnGateContext) => Promise<boolean>;
|
|
206
|
+
/**
|
|
207
|
+
* The raw messages a compaction is about to fold into a summary, handed over
|
|
208
|
+
* before they stop being readable as history.
|
|
209
|
+
*
|
|
210
|
+
* This is core being honest about a **lossy operation it performs**, not a
|
|
211
|
+
* write path for any one plugin: compaction is destructive, core is what
|
|
212
|
+
* destroys, and anything that wants the originals — an archive, an audit log,
|
|
213
|
+
* a cold-storage dump — needs to be told at exactly this moment. What a plugin
|
|
214
|
+
* does with them is entirely its own business; core neither knows nor cares.
|
|
215
|
+
*
|
|
216
|
+
* Best-effort in both directions. A throw here never aborts compaction —
|
|
217
|
+
* history must still shorten when a side store is briefly unavailable — and
|
|
218
|
+
* the runtime fans out with `Promise.allSettled`, so one plugin's failure can
|
|
219
|
+
* neither abort another plugin's write nor leave it unawaited. Failing
|
|
220
|
+
* *synchronously* is as safe as rejecting: this need not be an `async`
|
|
221
|
+
* function, and the runtime handles either.
|
|
222
|
+
*/
|
|
223
|
+
onMessagesDisplaced?: (messages: SessionMessage[]) => Promise<void>;
|
|
140
224
|
/** Tables this plugin owns, outside core's migration journal. See {@link PluginStore}. */
|
|
141
225
|
store?: PluginStore;
|
|
226
|
+
/**
|
|
227
|
+
* The durable file store a subagent execution's workspace is built over.
|
|
228
|
+
*
|
|
229
|
+
* Core declares the {@link WorkspaceBacking} shape and enforces the caps, but
|
|
230
|
+
* ships no backend: the predecessor's was `@cloudflare/shell`, which is
|
|
231
|
+
* experimental ("expect breaking changes"), and an agent that never delegates
|
|
232
|
+
* file work should not carry it. So the backend arrives here, from a plugin,
|
|
233
|
+
* and an agent that installs none falls back to an in-memory one.
|
|
234
|
+
*
|
|
235
|
+
* At most one installed plugin may declare this — two backends would mean two
|
|
236
|
+
* answers to "where did that file go", and the file would be in whichever the
|
|
237
|
+
* runtime happened to pick.
|
|
238
|
+
*
|
|
239
|
+
* `sql` is the executing facet's own SQLite, so isolation per execution is
|
|
240
|
+
* free and deleting the child wipes the workspace with it. `name` is lazy
|
|
241
|
+
* because a facet's name is set after construction.
|
|
242
|
+
*/
|
|
243
|
+
workspaceBacking?: (sql: SqlStorage, name: () => string | undefined) => WorkspaceBacking;
|
|
142
244
|
/**
|
|
143
245
|
* Bindings and secrets the host must declare in `wrangler.jsonc`. A plugin
|
|
144
246
|
* cannot add its own binding, so declaring them lets startup fail with a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/contract/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/contract/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAElE;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK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;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,EAAE,CACjB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,MAAM,MAAM,GAAG,SAAS,KAC3B,gBAAgB,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,QAAQ,GAAG,cAAc,EACpD,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,GAAG;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACA,WAAW,CAAC,QAAQ,CAAC,CAKvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/contract/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/contract/plugin.ts"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAkQzC;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAC1B,MAEC;IAED,OAAO;QACL,GAAG,MAAM;QACT,eAAe,EAAE,MAAM,CAAC,eAAe,IAAI,uBAAuB;KACnE,CAAC;AACJ,CAAC"}
|