@dynamicagents/plugins 0.11.0 → 0.12.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/README.md +12 -13
- package/dist/arc-agi/analysis.d.ts +16 -30
- package/dist/arc-agi/analysis.js +20 -47
- package/dist/arc-agi/client.d.ts +3 -2
- package/dist/arc-agi/game-tools.d.ts +5 -6
- package/dist/arc-agi/index.d.ts +6 -8
- package/dist/arc-agi/index.js +3 -3
- package/dist/arc-agi/main-agent.d.ts +5 -8
- package/dist/arc-agi/main-agent.js +5 -8
- package/dist/arc-agi/recipe.d.ts +17 -20
- package/dist/arc-agi/recipe.js +17 -20
- package/dist/arc-agi/soul.d.ts +16 -27
- package/dist/arc-agi/soul.js +16 -27
- package/dist/arc-agi/store.d.ts +4 -5
- package/dist/arc-agi/store.js +4 -5
- package/dist/arc-agi/tools.d.ts +1 -1
- package/dist/arc-agi/tools.js +26 -19
- package/dist/arc-agi/types.d.ts +6 -7
- package/dist/claude-code/config.d.ts +88 -11
- package/dist/claude-code/config.js +11 -2
- package/dist/claude-code/credentials.d.ts +21 -9
- package/dist/claude-code/credentials.js +43 -9
- package/dist/claude-code/egress.d.ts +7 -13
- package/dist/claude-code/egress.js +9 -10
- package/dist/claude-code/events.d.ts +47 -0
- package/dist/claude-code/events.js +96 -10
- package/dist/claude-code/index.d.ts +31 -13
- package/dist/claude-code/index.js +62 -15
- package/dist/claude-code/run.d.ts +135 -41
- package/dist/claude-code/run.js +366 -61
- package/dist/computer/advisory.d.ts +31 -18
- package/dist/computer/advisory.js +30 -5
- package/dist/computer/context.d.ts +23 -0
- package/dist/computer/context.js +225 -0
- package/dist/computer/file-lock.d.ts +5 -0
- package/dist/computer/file-lock.js +39 -0
- package/dist/computer/gate.d.ts +8 -8
- package/dist/computer/gate.js +7 -7
- package/dist/computer/host/ca-trust.d.ts +88 -0
- package/dist/computer/host/ca-trust.js +303 -0
- package/dist/computer/host/container-deps.d.ts +54 -0
- package/dist/computer/host/container-deps.js +224 -0
- package/dist/computer/host/container-fault.d.ts +38 -0
- package/dist/computer/host/container-fault.js +58 -0
- package/dist/computer/host/git-host.d.ts +62 -0
- package/dist/computer/host/git-host.js +156 -0
- package/dist/computer/host/git-identity.d.ts +57 -0
- package/dist/computer/host/git-identity.js +147 -0
- package/dist/computer/host/install-job.d.ts +121 -0
- package/dist/computer/host/install-job.js +766 -0
- package/dist/computer/host/sync.d.ts +111 -0
- package/dist/computer/host/sync.js +124 -0
- package/dist/computer/host/wake.d.ts +19 -0
- package/dist/computer/host/wake.js +10 -0
- package/dist/computer/host/workspace.d.ts +424 -0
- package/dist/computer/host/workspace.js +1258 -0
- package/dist/computer/index.d.ts +70 -50
- package/dist/computer/index.js +79 -767
- package/dist/computer/install.d.ts +8 -12
- package/dist/computer/install.js +6 -9
- package/dist/computer/paths.d.ts +21 -16
- package/dist/computer/paths.js +40 -38
- package/dist/computer/read.d.ts +18 -22
- package/dist/computer/read.js +24 -27
- package/dist/computer/render.d.ts +28 -0
- package/dist/computer/render.js +34 -1
- package/dist/computer/shell.d.ts +45 -0
- package/dist/computer/shell.js +80 -0
- package/dist/computer/tools-exec.d.ts +3 -0
- package/dist/computer/tools-exec.js +269 -0
- package/dist/computer/tools-file.d.ts +4 -0
- package/dist/computer/tools-file.js +124 -0
- package/dist/computer/tools-find.d.ts +3 -0
- package/dist/computer/tools-find.js +216 -0
- package/dist/recall/index.d.ts +9 -3
- package/dist/recall/index.js +22 -12
- package/dist/repo/checkout.d.ts +34 -4
- package/dist/repo/checkout.js +36 -1
- package/dist/repo/context.d.ts +109 -0
- package/dist/repo/context.js +530 -0
- package/dist/repo/index.d.ts +6 -29
- package/dist/repo/index.js +17 -1027
- package/dist/repo/tools-clone.d.ts +4 -0
- package/dist/repo/tools-clone.js +192 -0
- package/dist/repo/tools-forge.d.ts +4 -0
- package/dist/repo/tools-forge.js +179 -0
- package/dist/repo/tools-review.d.ts +3 -0
- package/dist/repo/tools-review.js +373 -0
- package/dist/repo/tools-worktree.d.ts +4 -0
- package/dist/repo/tools-worktree.js +221 -0
- package/dist/triage/index.d.ts +6 -1
- package/dist/triage/index.js +32 -23
- package/dist/workspace/index.d.ts +3 -3
- package/dist/workspace/index.js +3 -3
- package/package.json +21 -15
package/dist/triage/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { generateText, Output, tool } from "ai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createWorkersAI } from "workers-ai-provider";
|
|
4
4
|
import { definePlugin } from "@dynamicagents/core";
|
|
5
|
-
import { parseTurn, sessionText } from "@dynamicagents/core/agent";
|
|
5
|
+
import { gatewayLogFields, parseTurn, sessionText } from "@dynamicagents/core/agent";
|
|
6
6
|
/**
|
|
7
7
|
* `@dynamicagents/plugins/triage` — decide whether an inbound message deserves a
|
|
8
8
|
* reply at all, *before* the tool loop runs.
|
|
@@ -161,43 +161,52 @@ export async function shouldReply(model, history, options = {}) {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
export function triage(config) {
|
|
164
|
-
const { ai, aiGatewayId, modelId = DEFAULT_TRIAGE_MODEL_ID, historyMessages, messageMaxChars } = config;
|
|
164
|
+
const { ai, aiGatewayId, agentName, modelId = DEFAULT_TRIAGE_MODEL_ID, historyMessages, messageMaxChars } = config;
|
|
165
165
|
/**
|
|
166
|
-
* Built on first use, never at module scope
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
166
|
+
* Built on first use, never at module scope, for the reason
|
|
167
|
+
* {@link file://../recall/index.ts} gives on its own provider — and the
|
|
168
|
+
* gateway goes on the model, never on the provider, for the reason it gives
|
|
169
|
+
* there too.
|
|
170
|
+
*
|
|
171
|
+
* The provider is what is memoized, not the model: the model carries the
|
|
172
|
+
* channel of the turn it judges, which differs turn to turn.
|
|
171
173
|
*
|
|
172
174
|
* No fallback model: triage fails open, so a second attempt on a different
|
|
173
175
|
* model buys nothing a `true` does not already buy, at twice the latency in
|
|
174
176
|
* front of every turn.
|
|
175
177
|
*/
|
|
176
|
-
let
|
|
177
|
-
const classifier = () =>
|
|
178
|
-
config.model
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
let provider;
|
|
179
|
+
const classifier = (history) => {
|
|
180
|
+
if (config.model)
|
|
181
|
+
return config.model;
|
|
182
|
+
provider ??= createWorkersAI({ binding: ai });
|
|
183
|
+
if (!aiGatewayId)
|
|
184
|
+
return provider(modelId);
|
|
185
|
+
const judged = history.filter((m) => m.role === "user").at(-1);
|
|
186
|
+
const fields = gatewayLogFields({
|
|
187
|
+
agent: agentName,
|
|
188
|
+
phase: "triage",
|
|
189
|
+
channel: judged ? parseTurn(sessionText(judged))?.channel : undefined
|
|
190
|
+
});
|
|
191
|
+
return provider(modelId, { gateway: { id: aiGatewayId, ...fields } });
|
|
192
|
+
};
|
|
183
193
|
return definePlugin({
|
|
184
194
|
key: "triage",
|
|
185
195
|
/**
|
|
186
196
|
* Building the classifier is inside the guarantee, not in front of it.
|
|
187
197
|
*
|
|
188
|
-
* `shouldReply` catches its own failures, but
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* relying on its host to make that true.)
|
|
198
|
+
* `shouldReply` catches its own failures, but only what happens after it is
|
|
199
|
+
* entered — and `createWorkersAI` throws synchronously when the binding is
|
|
200
|
+
* missing, before the call is ever made. A throw out of this hook is the one
|
|
201
|
+
* outcome the whole design forbids: a triage outage must degrade to *running
|
|
202
|
+
* the turn*, never to a silent agent. A host that also treats a rejected gate
|
|
203
|
+
* as `true` is a second layer, not a substitute — a plugin documenting
|
|
204
|
+
* fail-open cannot rely on its host to make that true.
|
|
196
205
|
*/
|
|
197
206
|
shouldHandleTurn: async ({ history }) => {
|
|
198
207
|
let model;
|
|
199
208
|
try {
|
|
200
|
-
model = classifier();
|
|
209
|
+
model = classifier(history);
|
|
201
210
|
}
|
|
202
211
|
catch (error) {
|
|
203
212
|
console.warn("[triage] classifier unavailable, replying by default", {
|
|
@@ -11,9 +11,9 @@ import type { AgentPlugin, WorkspaceBacking, WorkspaceHandle } from "@dynamicage
|
|
|
11
11
|
* changes"). An agent that never delegates file work should not carry that
|
|
12
12
|
* dependency, so it ships here and is an optional peer.
|
|
13
13
|
*
|
|
14
|
-
* This is the only `@cloudflare/shell` import surface in the package
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* This is the only `@cloudflare/shell` import surface in the package, and stays
|
|
15
|
+
* that way: everything else codes against core's stable wrapper rather than
|
|
16
|
+
* shell's large, churning API.
|
|
17
17
|
*
|
|
18
18
|
* Two halves, and they are independent:
|
|
19
19
|
*
|
package/dist/workspace/index.js
CHANGED
|
@@ -13,9 +13,9 @@ import { Workspace } from "@cloudflare/shell";
|
|
|
13
13
|
* changes"). An agent that never delegates file work should not carry that
|
|
14
14
|
* dependency, so it ships here and is an optional peer.
|
|
15
15
|
*
|
|
16
|
-
* This is the only `@cloudflare/shell` import surface in the package
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* This is the only `@cloudflare/shell` import surface in the package, and stays
|
|
17
|
+
* that way: everything else codes against core's stable wrapper rather than
|
|
18
|
+
* shell's large, churning API.
|
|
19
19
|
*
|
|
20
20
|
* Two halves, and they are independent:
|
|
21
21
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamicagents/plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Optional, composable capabilities for a Dynamic Agent: ARC-AGI-3, browser rendering, a Linux container, git and pull requests, workspace, episodic recall, and pre-turn triage. One subpath per plugin, so a bundle grows only with what it imports.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -77,22 +77,24 @@
|
|
|
77
77
|
"types:check": "wrangler types --include-env=false --check && node scripts/verify-runtime-types.mjs",
|
|
78
78
|
"format": "prettier --write .",
|
|
79
79
|
"lint": "eslint .",
|
|
80
|
-
"check": "npm run verify:peer-ranges && npm run types:check && prettier --check . && eslint . && tsc && npm run build",
|
|
80
|
+
"check": "npm run verify:peer-ranges && npm run verify:references && npm run types:check && prettier --check . && eslint . && tsc && npm run build && npm run verify:exports",
|
|
81
81
|
"test": "vitest run",
|
|
82
82
|
"test:watch": "vitest",
|
|
83
83
|
"test:record": "RECORD=1 vitest run recorded.spec.ts",
|
|
84
84
|
"verify:exports": "node scripts/verify-exports.mjs",
|
|
85
|
+
"verify:references": "node scripts/verify-references.mjs",
|
|
85
86
|
"verify:peer-ranges": "node scripts/verify-peer-ranges.mjs",
|
|
86
87
|
"prepack": "npm run build && npm run verify:exports",
|
|
87
|
-
"prepublishOnly": "npm run check && npm test
|
|
88
|
+
"prepublishOnly": "npm run check && npm test",
|
|
88
89
|
"prepare": "husky || true && npm run build"
|
|
89
90
|
},
|
|
90
91
|
"peerDependencies": {
|
|
91
|
-
"@cloudflare/computer": "^0.
|
|
92
|
+
"@cloudflare/computer": "^0.3.1",
|
|
92
93
|
"@cloudflare/shell": "^0.4.3",
|
|
93
|
-
"@dynamicagents/core": ">=0.
|
|
94
|
-
"
|
|
95
|
-
"
|
|
94
|
+
"@dynamicagents/core": ">=0.12.0 <0.13.0",
|
|
95
|
+
"@platformatic/vfs": "^0.4.0",
|
|
96
|
+
"agents": ">=0.24.0 <0.25.0",
|
|
97
|
+
"ai": "^7.0.88",
|
|
96
98
|
"drizzle-orm": ">=0.45.2",
|
|
97
99
|
"workers-ai-provider": "^4.0.0",
|
|
98
100
|
"zod": "^4.4.3"
|
|
@@ -103,16 +105,20 @@
|
|
|
103
105
|
},
|
|
104
106
|
"@cloudflare/computer": {
|
|
105
107
|
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"@platformatic/vfs": {
|
|
110
|
+
"optional": true
|
|
106
111
|
}
|
|
107
112
|
},
|
|
108
113
|
"devDependencies": {
|
|
109
|
-
"@cloudflare/computer": "^0.
|
|
114
|
+
"@cloudflare/computer": "^0.3.1",
|
|
110
115
|
"@cloudflare/shell": "0.4.3",
|
|
111
|
-
"@
|
|
112
|
-
"@
|
|
113
|
-
"@
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
+
"@platformatic/vfs": "^0.4.0",
|
|
117
|
+
"@cloudflare/vitest-plugin": "^1.1.9",
|
|
118
|
+
"@dynamicagents/core": "^0.12.0",
|
|
119
|
+
"@types/node": "^26.5.1",
|
|
120
|
+
"agents": "^0.24.0",
|
|
121
|
+
"ai": "^7.0.101",
|
|
116
122
|
"drizzle-orm": ">=0.45.2",
|
|
117
123
|
"eslint": "^10.10.0",
|
|
118
124
|
"husky": "^9.1.7",
|
|
@@ -122,8 +128,8 @@
|
|
|
122
128
|
"typescript-eslint": "^8.70.0",
|
|
123
129
|
"vitest": "^4.1.11",
|
|
124
130
|
"workers-ai-provider": "^4.0.0",
|
|
125
|
-
"wrangler": "^4.
|
|
126
|
-
"zod": "^4.5
|
|
131
|
+
"wrangler": "^4.131.2",
|
|
132
|
+
"zod": "^4.6.5"
|
|
127
133
|
},
|
|
128
134
|
"engines": {
|
|
129
135
|
"node": ">=24"
|