@dynamicagents/plugins 0.11.1 → 0.13.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 +59 -79
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.js +21 -27
- package/dist/claude-code/cards.d.ts +53 -0
- package/dist/claude-code/cards.js +272 -0
- package/dist/claude-code/config.d.ts +73 -31
- package/dist/claude-code/config.js +0 -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 +15 -14
- package/dist/claude-code/egress.js +51 -14
- package/dist/claude-code/events.d.ts +153 -9
- package/dist/claude-code/events.js +289 -58
- package/dist/claude-code/github.d.ts +39 -0
- package/dist/claude-code/github.js +82 -0
- package/dist/claude-code/index.d.ts +24 -80
- package/dist/claude-code/index.js +19 -234
- package/dist/claude-code/model.d.ts +152 -0
- package/dist/claude-code/model.js +342 -0
- package/dist/claude-code/run.d.ts +283 -92
- package/dist/claude-code/run.js +620 -114
- package/dist/claude-code/session.d.ts +131 -0
- package/dist/claude-code/session.js +285 -0
- package/dist/claude-code/spec.d.ts +46 -0
- package/dist/claude-code/spec.js +83 -0
- package/dist/claude-code/verified.d.ts +15 -0
- package/dist/claude-code/verified.js +15 -0
- package/dist/computer/context.d.ts +19 -0
- package/dist/computer/context.js +222 -0
- package/dist/computer/file-lock.d.ts +5 -0
- package/dist/computer/file-lock.js +40 -0
- package/dist/computer/gate.d.ts +12 -12
- package/dist/computer/gate.js +12 -12
- package/dist/computer/index.d.ts +57 -255
- package/dist/computer/index.js +98 -1039
- package/dist/computer/paths.d.ts +47 -22
- package/dist/computer/paths.js +64 -49
- package/dist/computer/proxy.d.ts +45 -0
- package/dist/computer/proxy.js +234 -0
- package/dist/computer/render.d.ts +27 -38
- package/dist/computer/render.js +32 -65
- package/dist/computer/tools-exec.d.ts +3 -0
- package/dist/computer/tools-exec.js +268 -0
- package/dist/computer/tools-file.d.ts +12 -0
- package/dist/computer/tools-file.js +64 -0
- package/dist/computer/tools-grep.d.ts +3 -0
- package/dist/computer/tools-grep.js +129 -0
- package/dist/repo/checkout.d.ts +35 -6
- package/dist/repo/checkout.js +64 -6
- package/dist/repo/context.d.ts +135 -0
- package/dist/repo/context.js +582 -0
- package/dist/repo/index.d.ts +79 -57
- package/dist/repo/index.js +118 -1112
- package/dist/repo/tools-checks.d.ts +3 -0
- package/dist/repo/tools-checks.js +112 -0
- package/dist/repo/tools-clone.d.ts +4 -0
- package/dist/repo/tools-clone.js +192 -0
- package/dist/repo/tools-pr.d.ts +14 -0
- package/dist/repo/tools-pr.js +196 -0
- package/dist/repo/tools-review.d.ts +12 -0
- package/dist/repo/tools-review.js +393 -0
- package/dist/repo/tools-worktree.d.ts +4 -0
- package/dist/repo/tools-worktree.js +305 -0
- package/dist/repo/tools-worktrees.d.ts +12 -0
- package/dist/repo/tools-worktrees.js +48 -0
- package/dist/repo/url.d.ts +2 -2
- package/dist/repo/url.js +7 -7
- package/dist/scratch/index.d.ts +4 -4
- package/dist/scratch/index.js +12 -11
- package/dist/{computer → workspace}/advisory.d.ts +33 -20
- package/dist/{computer → workspace}/advisory.js +32 -7
- package/dist/workspace/ca-trust.d.ts +95 -0
- package/dist/workspace/ca-trust.js +312 -0
- package/dist/workspace/container-deps.d.ts +54 -0
- package/dist/workspace/container-deps.js +224 -0
- package/dist/workspace/container-fault.d.ts +38 -0
- package/dist/workspace/container-fault.js +73 -0
- package/dist/workspace/exec.d.ts +94 -0
- package/dist/workspace/exec.js +153 -0
- package/dist/workspace/format.d.ts +36 -0
- package/dist/workspace/format.js +57 -0
- package/dist/workspace/git-host.d.ts +79 -0
- package/dist/workspace/git-host.js +226 -0
- package/dist/workspace/git-identity.d.ts +57 -0
- package/dist/workspace/git-identity.js +147 -0
- package/dist/workspace/index.d.ts +43 -47
- package/dist/workspace/index.js +52 -112
- package/dist/workspace/install-job.d.ts +121 -0
- package/dist/workspace/install-job.js +866 -0
- package/dist/{computer → workspace}/install.d.ts +15 -19
- package/dist/{computer → workspace}/install.js +8 -11
- package/dist/workspace/object.d.ts +502 -0
- package/dist/workspace/object.js +1427 -0
- package/dist/workspace/open.d.ts +95 -0
- package/dist/workspace/open.js +63 -0
- package/dist/workspace/read.d.ts +16 -0
- package/dist/workspace/read.js +22 -0
- package/dist/workspace/shell.d.ts +45 -0
- package/dist/workspace/shell.js +80 -0
- package/dist/workspace/sync.d.ts +111 -0
- package/dist/workspace/sync.js +124 -0
- package/dist/workspace/wake.d.ts +19 -0
- package/dist/workspace/wake.js +10 -0
- package/package.json +28 -42
- package/dist/arc-agi/analysis.d.ts +0 -336
- package/dist/arc-agi/analysis.js +0 -829
- package/dist/arc-agi/client.d.ts +0 -82
- package/dist/arc-agi/client.js +0 -113
- package/dist/arc-agi/game-tools.d.ts +0 -25
- package/dist/arc-agi/game-tools.js +0 -26
- package/dist/arc-agi/index.d.ts +0 -42
- package/dist/arc-agi/index.js +0 -175
- package/dist/arc-agi/main-agent.d.ts +0 -27
- package/dist/arc-agi/main-agent.js +0 -65
- package/dist/arc-agi/recipe.d.ts +0 -51
- package/dist/arc-agi/recipe.js +0 -100
- package/dist/arc-agi/scorecard.d.ts +0 -118
- package/dist/arc-agi/scorecard.js +0 -163
- package/dist/arc-agi/soul.d.ts +0 -40
- package/dist/arc-agi/soul.js +0 -90
- package/dist/arc-agi/store.d.ts +0 -154
- package/dist/arc-agi/store.js +0 -216
- package/dist/arc-agi/tools.d.ts +0 -36
- package/dist/arc-agi/tools.js +0 -576
- package/dist/arc-agi/types.d.ts +0 -212
- package/dist/arc-agi/types.js +0 -19
- package/dist/claude-code/recipe.d.ts +0 -53
- package/dist/claude-code/recipe.js +0 -100
- package/dist/computer/read.d.ts +0 -137
- package/dist/computer/read.js +0 -203
- package/dist/recall/index.d.ts +0 -99
- package/dist/recall/index.js +0 -171
- package/dist/triage/index.d.ts +0 -355
- package/dist/triage/index.js +0 -302
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NoteData } from "@dynamicagents/core/subagent";
|
|
2
2
|
/** What a `result` line carries, of the fields anything here reads. */
|
|
3
3
|
export interface ClaudeCodeResult {
|
|
4
4
|
/** `success`, or one of the `error_*` subtypes. */
|
|
@@ -16,6 +16,23 @@ export interface ClaudeCodeResult {
|
|
|
16
16
|
/** How many inner subagents the run spawned — advisory, for the logs. */
|
|
17
17
|
subagentsSpawned?: number;
|
|
18
18
|
permissionDenials: number;
|
|
19
|
+
/**
|
|
20
|
+
* The answer of a session launched with a JSON Schema: the input of its
|
|
21
|
+
* `StructuredOutput` call, which `text` then holds as a JSON string. Absent
|
|
22
|
+
* for any other session, and for one that never made the call.
|
|
23
|
+
*/
|
|
24
|
+
structured?: unknown;
|
|
25
|
+
/**
|
|
26
|
+
* What the CLI says went wrong, when it reports an error rather than an
|
|
27
|
+
* answer.
|
|
28
|
+
*
|
|
29
|
+
* The only account there is of a refused resume: a `--resume` naming a
|
|
30
|
+
* conversation the config directory does not hold ends in a `result` line with
|
|
31
|
+
* no `text` at all, and `No conversation found with session ID: …` here. A
|
|
32
|
+
* caller that reports such a run as a failed session rather than as "not
|
|
33
|
+
* resumable" is reporting the one thing it was handed to say.
|
|
34
|
+
*/
|
|
35
|
+
errors?: string[];
|
|
19
36
|
}
|
|
20
37
|
/**
|
|
21
38
|
* Token counts, flattened.
|
|
@@ -32,14 +49,86 @@ export interface ClaudeCodeUsage {
|
|
|
32
49
|
cacheRead: number;
|
|
33
50
|
cacheWrite: number;
|
|
34
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* What the client knows about the subscription bucket it is drawing on.
|
|
54
|
+
*
|
|
55
|
+
* The one thing on this stream that is about the *deployment* rather than the
|
|
56
|
+
* run. This plugin's entry point describes the 5-hour and weekly limits as
|
|
57
|
+
* routed around rather than predicted, because the gateway only learns a bucket
|
|
58
|
+
* is empty when Anthropic refuses a request — this is the client saying so in
|
|
59
|
+
* advance, on every session.
|
|
60
|
+
*
|
|
61
|
+
* `resetsAt` is **seconds**, not milliseconds, which is the one field here it is
|
|
62
|
+
* possible to get silently wrong: a value handed to `Date` unconverted lands in
|
|
63
|
+
* January 1970, and a credential marked spent until then reads as usable.
|
|
64
|
+
*/
|
|
65
|
+
export interface RateLimitInfo {
|
|
66
|
+
/**
|
|
67
|
+
* {@link RATE_LIMIT_OK} on a healthy bucket. Any other value is
|
|
68
|
+
* **unclassified** — no consumer should read one as exhaustion.
|
|
69
|
+
*/
|
|
70
|
+
status: string;
|
|
71
|
+
/** Unix **seconds** at which this bucket refills. */
|
|
72
|
+
resetsAt?: number;
|
|
73
|
+
/** Which bucket — `five_hour`, and the weekly one. */
|
|
74
|
+
rateLimitType?: string;
|
|
75
|
+
/** Whether spend beyond the bucket is permitted, and why not. */
|
|
76
|
+
overageStatus?: string;
|
|
77
|
+
overageDisabledReason?: string;
|
|
78
|
+
}
|
|
35
79
|
export type ClaudeCodeEvent = {
|
|
36
80
|
kind: "init";
|
|
37
81
|
sessionId: string;
|
|
38
82
|
model?: string;
|
|
39
|
-
|
|
40
|
-
|
|
83
|
+
cwd?: string;
|
|
84
|
+
permissionMode?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The subscription bucket, as the client sees it. Carried rather than acted
|
|
88
|
+
* on here — {@link describe} decides what a reader is told, and the caller
|
|
89
|
+
* decides what the credential pool is told.
|
|
90
|
+
*/
|
|
91
|
+
| {
|
|
92
|
+
kind: "rateLimit";
|
|
93
|
+
info: RateLimitInfo;
|
|
94
|
+
}
|
|
95
|
+
/** One `text` block of an assistant message, verbatim — it is markdown. */
|
|
96
|
+
| {
|
|
97
|
+
kind: "text";
|
|
41
98
|
text: string;
|
|
42
|
-
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* One `thinking` block, as how long it took — never what it said. A block can
|
|
102
|
+
* run to thousands of tokens of private reasoning; a reader is told that the
|
|
103
|
+
* model thought, and for how long, the way the CLI itself says it.
|
|
104
|
+
*
|
|
105
|
+
* `durationMs` is measured, never inferred: see
|
|
106
|
+
* {@link ParsedStream.thinkingFrom} for where it starts, and it is absent
|
|
107
|
+
* whenever that cannot be trusted. `messageId` is the API message the block
|
|
108
|
+
* belongs to — a message can carry more than one.
|
|
109
|
+
*/
|
|
110
|
+
| {
|
|
111
|
+
kind: "thinking";
|
|
112
|
+
messageId?: string;
|
|
113
|
+
durationMs?: number;
|
|
114
|
+
} | {
|
|
115
|
+
kind: "toolUse";
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
input: unknown;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* One `tool_result` block of a `user` line: a tool's answer going back to
|
|
122
|
+
* the model. `structured` is the line's `tool_use_result` — the tool's own
|
|
123
|
+
* record of what it did, richer than the text the model reads — and is read
|
|
124
|
+
* only when the line carries a single result, since it is not per block.
|
|
125
|
+
*/
|
|
126
|
+
| {
|
|
127
|
+
kind: "toolResult";
|
|
128
|
+
id: string;
|
|
129
|
+
isError: boolean;
|
|
130
|
+
content: string;
|
|
131
|
+
structured?: unknown;
|
|
43
132
|
} | {
|
|
44
133
|
kind: "retry";
|
|
45
134
|
detail: string;
|
|
@@ -88,7 +177,46 @@ export interface ParsedStream {
|
|
|
88
177
|
sample?: string;
|
|
89
178
|
/** Lines dropped for carrying `parent_tool_use_id`. See {@link parseStream}. */
|
|
90
179
|
nested: number;
|
|
180
|
+
/**
|
|
181
|
+
* When the pending thinking block began streaming, on the caller's clock:
|
|
182
|
+
* the `now` of the read that brought its first `system/thinking_tokens`
|
|
183
|
+
* line.
|
|
184
|
+
*
|
|
185
|
+
* That line is the one sign on the stream that thinking is under way. The
|
|
186
|
+
* CLI prints it as the block's text arrives, so it comes after everything
|
|
187
|
+
* that is not thinking: request setup, the wait for a first token, an API
|
|
188
|
+
* retry's back-off, a compaction. The line before a block — the tool result
|
|
189
|
+
* it answers — comes before all of those, and timing from it is how a minute
|
|
190
|
+
* of retries reads as a minute of thought. The token line carries no time of
|
|
191
|
+
* its own, which is why the caller's clock stamps it.
|
|
192
|
+
*
|
|
193
|
+
* Cleared by every line that carries a `timestamp`, so a start belongs to
|
|
194
|
+
* the block that follows the last message and never to work before it. Handed
|
|
195
|
+
* back with `carry`, for the same reason, and kept on the caller's cursor.
|
|
196
|
+
*/
|
|
197
|
+
thinkingFrom?: number;
|
|
198
|
+
}
|
|
199
|
+
/** What {@link parseStream} times a thinking block against. */
|
|
200
|
+
export interface ParseClock {
|
|
201
|
+
/** When this read arrived, in epoch milliseconds. */
|
|
202
|
+
now: number;
|
|
203
|
+
/** {@link ParsedStream.thinkingFrom} from the previous read. */
|
|
204
|
+
thinkingFrom?: number;
|
|
91
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* How far a thinking line's arrival may be from its own `timestamp` for the
|
|
208
|
+
* block to be timed.
|
|
209
|
+
*
|
|
210
|
+
* Both ends of a block are timed by when they arrive, which is only the truth
|
|
211
|
+
* while the drain reads live. A drain that re-attached after a cut is handed
|
|
212
|
+
* what was printed meanwhile in one burst, and its arrival times are the
|
|
213
|
+
* replay's — so a block whose line arrived far from when the CLI stamped it
|
|
214
|
+
* reads "Thought", with no time. Locally a line arrives 5–31 ms after its
|
|
215
|
+
* stamp; a re-attach has been measured at about a second. A container clock
|
|
216
|
+
* this far from the Worker's degrades every block to no time, rather than to a
|
|
217
|
+
* wrong one.
|
|
218
|
+
*/
|
|
219
|
+
export declare const LIVE_SLACK_MS = 5000;
|
|
92
220
|
/**
|
|
93
221
|
* Parse whatever has arrived so far into complete events plus a carry.
|
|
94
222
|
*
|
|
@@ -102,21 +230,37 @@ export interface ParsedStream {
|
|
|
102
230
|
* the filter.
|
|
103
231
|
*
|
|
104
232
|
* `result` and `init` are never nested and are read unconditionally.
|
|
233
|
+
*
|
|
234
|
+
* `clock` is when this read arrived, and the pending thinking block's start
|
|
235
|
+
* from the previous read — see {@link ParsedStream.thinkingFrom}. Without it no
|
|
236
|
+
* block is timed.
|
|
237
|
+
*/
|
|
238
|
+
export declare function parseStream(buffer: string, clock?: ParseClock): ParsedStream;
|
|
239
|
+
/**
|
|
240
|
+
* The status a healthy bucket reports, and the only one ever observed.
|
|
241
|
+
*
|
|
242
|
+
* **Every other value is unclassified, not a refusal.** Nothing here knows what
|
|
243
|
+
* a non-`allowed` status means, and the one place that decides whether a
|
|
244
|
+
* credential is spent — `readRateLimitEvent` in this package's `credentials.ts`
|
|
245
|
+
* — recognises none of them, deliberately: retiring a working credential on a
|
|
246
|
+
* guess is the expensive half of that trade. What an unrecognised status earns
|
|
247
|
+
* is a note and a log, so somebody can name it.
|
|
105
248
|
*/
|
|
106
|
-
export declare
|
|
249
|
+
export declare const RATE_LIMIT_OK = "allowed";
|
|
107
250
|
/**
|
|
108
|
-
* Turn events into progress notes the parent
|
|
251
|
+
* Turn events into progress notes for the parent's transcript.
|
|
109
252
|
*
|
|
110
253
|
* **`from` is the number of notes already emitted for this run, and the key is
|
|
111
254
|
* derived from it.** Not from the note's content, not from a clock, and not from
|
|
112
255
|
* the Claude Code `uuid` — from position alone.
|
|
113
256
|
*
|
|
114
|
-
* The reason is replay. A
|
|
115
|
-
*
|
|
257
|
+
* The reason is replay. A drain that dies mid-stream is resumed from the last
|
|
258
|
+
* stored sequence, whatever arrived after it is read again, and the same
|
|
259
|
+
* assistant turn is parsed twice. A
|
|
116
260
|
* content-derived key would make two identical notes collide *by luck* (and two
|
|
117
261
|
* genuinely repeated notes — "Running tests" twice — collide wrongly). A
|
|
118
262
|
* clock-derived key would never collide, so every replay would re-post
|
|
119
263
|
* everything. Position is the only choice that dedupes exactly the events that
|
|
120
264
|
* are the same event.
|
|
121
265
|
*/
|
|
122
|
-
export declare function toProgress(events: readonly ClaudeCodeEvent[], from: number):
|
|
266
|
+
export declare function toProgress(events: readonly ClaudeCodeEvent[], from: number): NoteData[];
|