@astrosheep/keiyaku 4.0.3 → 4.0.5
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/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/package.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +4 -4
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +15 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-task/SKILL.md +3 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +34 -13
- package/build/src/akuma/akuma.d.ts +34 -12
- package/build/src/akuma/akuma.js +118 -63
- package/build/src/akuma/allowed.d.ts +7 -0
- package/build/src/akuma/allowed.js +33 -0
- package/build/src/akuma/archetype.d.ts +7 -4
- package/build/src/akuma/archetype.js +15 -16
- package/build/src/akuma/body.d.ts +6 -1
- package/build/src/akuma/body.js +36 -27
- package/build/src/akuma/heart/facts.d.ts +82 -14
- package/build/src/akuma/heart/index.d.ts +5 -18
- package/build/src/akuma/heart/index.js +14 -84
- package/build/src/akuma/heart/request-authority.d.ts +12 -0
- package/build/src/akuma/heart/request-authority.js +119 -0
- package/build/src/akuma/heart/request-rows.d.ts +16 -0
- package/build/src/akuma/heart/request-rows.js +88 -0
- package/build/src/akuma/heart/rows.d.ts +1 -26
- package/build/src/akuma/heart/rows.js +0 -50
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +22 -10
- package/build/src/akuma/heart/soul.js +2 -36
- package/build/src/akuma/heart/storage.d.ts +1 -0
- package/build/src/akuma/heart/storage.js +15 -0
- package/build/src/akuma/heart/timeline.d.ts +1 -5
- package/build/src/akuma/heart/timeline.js +8 -17
- package/build/src/akuma/index.d.ts +5 -2
- package/build/src/akuma/index.js +1 -0
- package/build/src/akuma/projection.d.ts +17 -3
- package/build/src/akuma/projection.js +40 -3
- package/build/src/akuma/provider-recipe.js +1 -11
- package/build/src/akuma/provider.d.ts +2 -7
- package/build/src/akuma/provider.js +2 -1
- package/build/src/akuma/providers/acp/core.d.ts +3 -1
- package/build/src/akuma/providers/acp/core.js +10 -6
- package/build/src/akuma/providers/acp/events.d.ts +11 -3
- package/build/src/akuma/providers/acp/events.js +78 -4
- package/build/src/akuma/providers/acp/index.js +0 -1
- package/build/src/akuma/providers/claude/events.js +62 -3
- package/build/src/akuma/providers/claude/index.d.ts +0 -4
- package/build/src/akuma/providers/claude/index.js +7 -3
- package/build/src/akuma/providers/codex-app-server/events.js +1 -13
- package/build/src/akuma/providers/codex-app-server/index.d.ts +2 -27
- package/build/src/akuma/providers/codex-app-server/index.js +0 -2
- package/build/src/akuma/providers/grok-build/index.d.ts +2 -1
- package/build/src/akuma/providers/grok-build/index.js +72 -3
- package/build/src/akuma/providers/opencode-sdk/events.js +71 -6
- package/build/src/akuma/providers/opencode-sdk/index.d.ts +2 -28
- package/build/src/akuma/providers/opencode-sdk/index.js +8 -4
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +1 -1
- package/build/src/akuma/providers/opencode-sdk/session.js +1 -1
- package/build/src/akuma/providers/pi/events.js +17 -3
- package/build/src/akuma/providers/pi/index.js +11 -4
- package/build/src/akuma/providers/unified-patch.d.ts +4 -0
- package/build/src/akuma/providers/unified-patch.js +14 -0
- package/build/src/akuma/publication.d.ts +1 -1
- package/build/src/akuma/publication.js +1 -1
- package/build/src/akuma/request-serve.d.ts +87 -0
- package/build/src/akuma/request-serve.js +484 -0
- package/build/src/akuma/request-wire.d.ts +124 -0
- package/build/src/akuma/request-wire.js +380 -0
- package/build/src/akuma/requests.d.ts +41 -41
- package/build/src/akuma/requests.js +75 -374
- package/build/src/akuma-body.d.ts +8 -0
- package/build/src/akuma-body.js +84 -0
- package/build/src/body/arc.js +4 -29
- package/build/src/body/decode.js +5 -39
- package/build/src/body/envelope.d.ts +7 -0
- package/build/src/body/envelope.js +37 -0
- package/build/src/cli/accepted.d.ts +4 -1
- package/build/src/cli/accepted.js +39 -9
- package/build/src/cli/commands/akuma-invoke.d.ts +8 -7
- package/build/src/cli/commands/akuma-invoke.js +18 -10
- package/build/src/cli/commands/akuma.d.ts +11 -2
- package/build/src/cli/commands/akuma.js +67 -28
- package/build/src/cli/commands/amend.d.ts +1 -1
- package/build/src/cli/commands/amend.js +1 -1
- package/build/src/cli/commands/contract.d.ts +8 -8
- package/build/src/cli/commands/contract.js +3 -3
- package/build/src/cli/commands/install.js +2 -2
- package/build/src/cli/commands/task-invoke.js +98 -9
- package/build/src/cli/commands/task-query.d.ts +1 -1
- package/build/src/cli/commands/task-query.js +11 -5
- package/build/src/cli/coordinates.d.ts +2 -0
- package/build/src/cli/coordinates.js +12 -5
- package/build/src/cli/invoke.d.ts +1 -0
- package/build/src/cli/invoke.js +116 -75
- package/build/src/cli/main.d.ts +2 -0
- package/build/src/cli/main.js +29 -4
- package/build/src/cli/parse.d.ts +3 -2
- package/build/src/cli/parse.js +25 -8
- package/build/src/cli/render/akuma.d.ts +2 -2
- package/build/src/cli/render/akuma.js +138 -24
- package/build/src/cli/render/audit.js +18 -8
- package/build/src/cli/render/contract.d.ts +2 -0
- package/build/src/cli/render/contract.js +243 -36
- package/build/src/cli/render/kanshi.js +64 -29
- package/build/src/cli/render/receipt.d.ts +2 -1
- package/build/src/cli/render/receipt.js +37 -2
- package/build/src/cli/render/terminal.d.ts +0 -2
- package/build/src/cli/render/terminal.js +0 -29
- package/build/src/cli/render/text.js +3 -1
- package/build/src/cli/result.d.ts +52 -9
- package/build/src/cli/selectors.d.ts +1 -0
- package/build/src/cli/selectors.js +9 -6
- package/build/src/contract-worktree.d.ts +1 -2
- package/build/src/contract-worktree.js +7 -9
- package/build/src/core/facts/codec.js +9 -0
- package/build/src/core/facts/fold.js +13 -1
- package/build/src/core/facts/types.d.ts +8 -1
- package/build/src/core/subject.js +4 -3
- package/build/src/core/verbs/placement.d.ts +9 -1
- package/build/src/core/verbs/placement.js +24 -6
- package/build/src/core/verbs/reintegrate.d.ts +13 -0
- package/build/src/core/verbs/reintegrate.js +24 -0
- package/build/src/dispatch/index.d.ts +1 -1
- package/build/src/dispatch/index.js +50 -39
- package/build/src/git/admission.d.ts +2 -1
- package/build/src/git/hooks.d.ts +0 -4
- package/build/src/git/hooks.js +0 -36
- package/build/src/git/integration.d.ts +7 -8
- package/build/src/git/integration.js +62 -9
- package/build/src/git/observe.d.ts +2 -1
- package/build/src/git/observe.js +6 -5
- package/build/src/git/process.d.ts +26 -0
- package/build/src/git/process.js +94 -0
- package/build/src/git/read-observation.d.ts +2 -1
- package/build/src/git/read-observation.js +3 -2
- package/build/src/git/reconcile.d.ts +8 -2
- package/build/src/git/reconcile.js +63 -14
- package/build/src/git/repository.d.ts +2 -29
- package/build/src/git/repository.js +4 -118
- package/build/src/git/scratch.d.ts +1 -1
- package/build/src/git/scratch.js +1 -1
- package/build/src/git/target-placement.d.ts +1 -1
- package/build/src/git/target-placement.js +9 -7
- package/build/src/git/tender.d.ts +20 -5
- package/build/src/git/tender.js +45 -13
- package/build/src/git/terminal-seal.d.ts +16 -2
- package/build/src/git/terminal-seal.js +15 -5
- package/build/src/git/workspace.d.ts +2 -1
- package/build/src/git/workspace.js +13 -5
- package/build/src/index.d.ts +1 -2
- package/build/src/index.js +1 -1
- package/build/src/kanshi/index.d.ts +1 -1
- package/build/src/kanshi/index.js +1 -1
- package/build/src/kanshi/read.d.ts +9 -1
- package/build/src/kanshi/read.js +91 -37
- package/build/src/kanshi/report.d.ts +1 -0
- package/build/src/library/address.d.ts +5 -14
- package/build/src/library/address.js +27 -23
- package/build/src/library/akuma-creation.d.ts +4 -2
- package/build/src/library/akuma-creation.js +43 -26
- package/build/src/library/audit.d.ts +2 -1
- package/build/src/library/audit.js +1 -1
- package/build/src/library/bind.d.ts +2 -1
- package/build/src/library/bind.js +4 -4
- package/build/src/library/catalog.d.ts +1 -2
- package/build/src/library/catalog.js +11 -6
- package/build/src/library/configuration.d.ts +5 -1
- package/build/src/library/configuration.js +71 -18
- package/build/src/library/contract.d.ts +70 -3
- package/build/src/library/contract.js +213 -27
- package/build/src/library/delivery.d.ts +1 -1
- package/build/src/library/fleet.d.ts +70 -12
- package/build/src/library/fleet.js +236 -56
- package/build/src/library/input.d.ts +0 -1
- package/build/src/library/input.js +1 -5
- package/build/src/library/keiyaku.d.ts +4 -4
- package/build/src/library/keiyaku.js +1 -2
- package/build/src/library/mutation.d.ts +2 -1
- package/build/src/library/reconcile.d.ts +2 -1
- package/build/src/library/reconcile.js +3 -1
- package/build/src/library/region.d.ts +1 -1
- package/build/src/library/repo.d.ts +3 -1
- package/build/src/library/repo.js +8 -4
- package/build/src/protocol/abandon.d.ts +9 -0
- package/build/src/protocol/abandon.js +15 -0
- package/build/src/protocol/amend.d.ts +16 -0
- package/build/src/protocol/amend.js +77 -0
- package/build/src/protocol/arc.d.ts +6 -0
- package/build/src/protocol/arc.js +12 -0
- package/build/src/protocol/attempt.d.ts +2 -1
- package/build/src/protocol/audit.d.ts +53 -0
- package/build/src/protocol/audit.js +140 -0
- package/build/src/protocol/bind.d.ts +2 -3
- package/build/src/protocol/bind.js +2 -16
- package/build/src/protocol/completion.d.ts +32 -0
- package/build/src/protocol/completion.js +130 -0
- package/build/src/protocol/deliver.d.ts +37 -0
- package/build/src/protocol/deliver.js +160 -0
- package/build/src/protocol/intent.d.ts +1 -1
- package/build/src/protocol/intent.js +1 -1
- package/build/src/protocol/operations.d.ts +65 -198
- package/build/src/protocol/operations.js +21 -634
- package/build/src/protocol/placement.d.ts +4 -13
- package/build/src/protocol/placement.js +3 -15
- package/build/src/protocol/read/status.d.ts +4 -2
- package/build/src/protocol/read/status.js +27 -15
- package/build/src/protocol/reconcile.d.ts +35 -0
- package/build/src/protocol/reconcile.js +41 -0
- package/build/src/protocol/reintegrate.d.ts +31 -0
- package/build/src/protocol/reintegrate.js +74 -0
- package/build/src/protocol/review.d.ts +33 -0
- package/build/src/protocol/review.js +148 -0
- package/build/src/protocol/run.d.ts +1 -1
- package/build/src/runtime/proc/run.d.ts +1 -0
- package/build/src/runtime/proc/run.js +9 -2
- package/build/src/settlement/fence.d.ts +1 -1
- package/build/src/settlement/holder.d.ts +1 -1
- package/build/src/settlement/settle.d.ts +2 -1
- package/build/src/settlement/settle.js +4 -1
- package/build/src/task/board.d.ts +18 -4
- package/build/src/task/board.js +73 -29
- package/build/src/task/compose.d.ts +1 -1
- package/build/src/task/compose.js +11 -4
- package/build/src/task/index.d.ts +4 -4
- package/build/src/task/index.js +8 -131
- package/build/src/task/input.d.ts +18 -0
- package/build/src/task/input.js +189 -0
- package/build/src/task/mutation.d.ts +39 -0
- package/build/src/task/mutation.js +85 -0
- package/build/src/task/operations.d.ts +4 -19
- package/build/src/task/operations.js +64 -18
- package/build/src/task/query.d.ts +9 -2
- package/build/src/task/query.js +32 -64
- package/build/src/task/store.js +0 -2
- package/build/src/verification/execution.d.ts +1 -1
- package/build/src/verification/execution.js +2 -1
- package/build/src/workspace-place.d.ts +1 -4
- package/build/src/workspace-place.js +0 -15
- package/package.json +5 -3
|
@@ -114,21 +114,35 @@ export type ActivitySnapshotEntry<Row extends SnapshotRow = SnapshotRow> = Reado
|
|
|
114
114
|
kind: "gap";
|
|
115
115
|
count: number;
|
|
116
116
|
}>;
|
|
117
|
+
export type ReportedFileChange = Readonly<{
|
|
118
|
+
sequence: number;
|
|
119
|
+
at: string;
|
|
120
|
+
op: "add" | "update" | "delete" | "unspecified";
|
|
121
|
+
path: string;
|
|
122
|
+
diffstat?: Readonly<{
|
|
123
|
+
added: number;
|
|
124
|
+
removed: number;
|
|
125
|
+
}>;
|
|
126
|
+
}>;
|
|
127
|
+
type ReportedChangeSummary = Readonly<{
|
|
128
|
+
reportedChanges: readonly ReportedFileChange[];
|
|
129
|
+
reportedChangesOmitted: number;
|
|
130
|
+
}>;
|
|
117
131
|
export type Snapshot = Readonly<{
|
|
118
132
|
kind: "unborn";
|
|
119
133
|
entries: readonly [];
|
|
120
134
|
omitted: 0;
|
|
121
|
-
}> | Readonly<{
|
|
135
|
+
} & ReportedChangeSummary> | Readonly<{
|
|
122
136
|
kind: "open";
|
|
123
137
|
turn: TurnStartRow;
|
|
124
138
|
entries: readonly ActivitySnapshotEntry<OpenSnapshotRow>[];
|
|
125
139
|
omitted: number;
|
|
126
|
-
}> | Readonly<{
|
|
140
|
+
} & ReportedChangeSummary> | Readonly<{
|
|
127
141
|
kind: "idle";
|
|
128
142
|
outcome?: OutcomeRow;
|
|
129
143
|
entries: readonly ActivitySnapshotEntry<IdleSnapshotRow>[];
|
|
130
144
|
omitted: number;
|
|
131
|
-
}>;
|
|
145
|
+
} & ReportedChangeSummary>;
|
|
132
146
|
export type ActivitySnapshot = Snapshot;
|
|
133
147
|
export type ActivityHistory = Readonly<{
|
|
134
148
|
rows: readonly ActivityRow[];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { decodeAgentEvent } from "./provider.js";
|
|
2
2
|
const DEFAULT_TAIL = 3;
|
|
3
3
|
const DEFAULT_VOICE = 3;
|
|
4
|
+
const REPORTED_CHANGE_LIMIT = 5;
|
|
5
|
+
const EMPTY_REPORTED = { reportedChanges: [], reportedChangesOmitted: 0 };
|
|
4
6
|
function duration(startedAt, completedAt) {
|
|
5
7
|
const start = Date.parse(startedAt);
|
|
6
8
|
const end = Date.parse(completedAt);
|
|
@@ -204,11 +206,45 @@ export function ordinarySelectedCount(snapshot) {
|
|
|
204
206
|
return count + 1;
|
|
205
207
|
}, 0);
|
|
206
208
|
}
|
|
209
|
+
function isSuccessfulFileChange(row) {
|
|
210
|
+
return row.kind === "tool"
|
|
211
|
+
&& typeof row.state === "object"
|
|
212
|
+
&& row.state.status === "ok"
|
|
213
|
+
&& row.call.kind === "fileChange";
|
|
214
|
+
}
|
|
215
|
+
function flattenReportedChanges(rows) {
|
|
216
|
+
return rows.flatMap((row) => {
|
|
217
|
+
if (!isSuccessfulFileChange(row))
|
|
218
|
+
return [];
|
|
219
|
+
return row.call.changes.map((change) => ({
|
|
220
|
+
sequence: row.sequence,
|
|
221
|
+
at: row.at,
|
|
222
|
+
op: change.op,
|
|
223
|
+
path: change.path,
|
|
224
|
+
...(change.diffstat === undefined ? {} : { diffstat: change.diffstat }),
|
|
225
|
+
}));
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function summarizeReportedChanges(rows) {
|
|
229
|
+
const eligible = flattenReportedChanges(rows);
|
|
230
|
+
return {
|
|
231
|
+
reportedChanges: eligible.slice(-REPORTED_CHANGE_LIMIT),
|
|
232
|
+
reportedChangesOmitted: Math.max(0, eligible.length - REPORTED_CHANGE_LIMIT),
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function frontierReportedChanges(ledger) {
|
|
236
|
+
if (ledger.openTurn !== undefined)
|
|
237
|
+
return summarizeReportedChanges(ledger.openTurn.rows);
|
|
238
|
+
const closed = ledger.turns.findLast((turn) => turn.kind === "closed");
|
|
239
|
+
return closed === undefined ? EMPTY_REPORTED : summarizeReportedChanges(closed.rows);
|
|
240
|
+
}
|
|
207
241
|
/** Select one current Turn, one latest outcome, or no focus; pending tells stay actionable. */
|
|
208
242
|
export function selectSnapshot(ledger, budget = { tail: DEFAULT_TAIL, voice: DEFAULT_VOICE }) {
|
|
209
|
-
if (ledger.turns.length === 0 && !ledger.rows.some((row) => row.kind === "tell"))
|
|
210
|
-
return { kind: "unborn", entries: [], omitted: 0 };
|
|
243
|
+
if (ledger.turns.length === 0 && !ledger.rows.some((row) => row.kind === "tell")) {
|
|
244
|
+
return { kind: "unborn", entries: [], omitted: 0, ...EMPTY_REPORTED };
|
|
245
|
+
}
|
|
211
246
|
const pending = ledger.rows.filter((row) => row.kind === "tell" && row.state === "pending");
|
|
247
|
+
const reported = frontierReportedChanges(ledger);
|
|
212
248
|
if (ledger.openTurn !== undefined) {
|
|
213
249
|
const window = ledger.openTurn.rows;
|
|
214
250
|
const active = window.filter((row) => row.kind === "tool" && row.state === "active");
|
|
@@ -222,13 +258,14 @@ export function selectSnapshot(ledger, budget = { tail: DEFAULT_TAIL, voice: DEF
|
|
|
222
258
|
const voice = voiceCount === 0 ? [] : voiceCandidates.slice(-voiceCount);
|
|
223
259
|
const selected = new Set([...tail, ...voice, ...active, ...pending]);
|
|
224
260
|
const omitted = window.filter((row) => !selected.has(row)).length;
|
|
225
|
-
return { kind: "open", turn: ledger.openTurn.turn, entries: openEntries(ledger, window, selected), omitted };
|
|
261
|
+
return { kind: "open", turn: ledger.openTurn.turn, entries: openEntries(ledger, window, selected), omitted, ...reported };
|
|
226
262
|
}
|
|
227
263
|
return {
|
|
228
264
|
kind: "idle",
|
|
229
265
|
...(ledger.latestOutcome === undefined ? {} : { outcome: ledger.latestOutcome }),
|
|
230
266
|
entries: entries(pending),
|
|
231
267
|
omitted: 0,
|
|
268
|
+
...reported,
|
|
232
269
|
};
|
|
233
270
|
}
|
|
234
271
|
/** Apply the one snapshot policy used by every public observation consumer. */
|
|
@@ -24,10 +24,6 @@ export function decodeProviderOptions(value) {
|
|
|
24
24
|
const options = record(value);
|
|
25
25
|
if (options === null)
|
|
26
26
|
throw new TypeError("provider options must be an object");
|
|
27
|
-
const allowed = ["effort", "model", "network", "readonly", "systemPrompt"];
|
|
28
|
-
const unknown = Object.keys(options).find((key) => !allowed.includes(key));
|
|
29
|
-
if (unknown !== undefined)
|
|
30
|
-
throw new TypeError(`provider options have unknown field ${unknown}`);
|
|
31
27
|
const model = optionText(options, "model", "refuse");
|
|
32
28
|
const effort = optionText(options, "effort", "refuse");
|
|
33
29
|
if (options.readonly !== undefined && options.readonly !== true) {
|
|
@@ -50,12 +46,10 @@ export function decodeReadonlyRestraint(value) {
|
|
|
50
46
|
const restraint = record(value);
|
|
51
47
|
if (restraint === null)
|
|
52
48
|
throw new TypeError("readonly restraint must be an object");
|
|
53
|
-
|
|
54
|
-
if (restraint.enforcement === "native" && keys.length === 1 && keys[0] === "enforcement") {
|
|
49
|
+
if (restraint.enforcement === "native") {
|
|
55
50
|
return Object.freeze({ enforcement: "native" });
|
|
56
51
|
}
|
|
57
52
|
if (restraint.enforcement === "none"
|
|
58
|
-
&& keys.length === 2 && keys[0] === "diagnostic" && keys[1] === "enforcement"
|
|
59
53
|
&& typeof restraint.diagnostic === "string" && restraint.diagnostic.trim().length > 0) {
|
|
60
54
|
return Object.freeze({ enforcement: "none", diagnostic: restraint.diagnostic });
|
|
61
55
|
}
|
|
@@ -69,10 +63,6 @@ export function decodeProviderRecipe(input) {
|
|
|
69
63
|
const value = record(input);
|
|
70
64
|
if (value === null)
|
|
71
65
|
throw new TypeError("provider execution must be an object");
|
|
72
|
-
const allowed = ["config", "env", "executable", "kind", "name"];
|
|
73
|
-
const unknown = Object.keys(value).find((key) => !allowed.includes(key));
|
|
74
|
-
if (unknown !== undefined)
|
|
75
|
-
throw new TypeError(`provider execution has unknown field ${unknown}`);
|
|
76
66
|
if (typeof value.name !== "string" || value.name.trim().length === 0) {
|
|
77
67
|
throw new TypeError("provider execution name must be a nonblank string");
|
|
78
68
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Confinement } from "./heart/index.js";
|
|
2
1
|
import { decodeResumeCoordinate, encodeResumeCoordinate, type ResumeCoordinate } from "./coordinate.js";
|
|
3
2
|
import type { ProviderOptions, ReadonlyRestraint } from "./provider-recipe.js";
|
|
4
3
|
export type { ResumeCoordinate } from "./coordinate.js";
|
|
@@ -23,7 +22,7 @@ export type ToolCall = Readonly<{
|
|
|
23
22
|
}> | Readonly<{
|
|
24
23
|
kind: "fileChange";
|
|
25
24
|
changes: readonly Readonly<{
|
|
26
|
-
op: "add" | "update" | "delete";
|
|
25
|
+
op: "add" | "update" | "delete" | "unspecified";
|
|
27
26
|
path: string;
|
|
28
27
|
diffstat?: Readonly<{
|
|
29
28
|
added: number;
|
|
@@ -138,7 +137,7 @@ export type DriveInput = Readonly<{
|
|
|
138
137
|
cwd: string;
|
|
139
138
|
options: ProviderOptions;
|
|
140
139
|
signal: AbortSignal;
|
|
141
|
-
requests
|
|
140
|
+
requests: Readonly<{
|
|
142
141
|
dir: string;
|
|
143
142
|
}>;
|
|
144
143
|
}>;
|
|
@@ -151,10 +150,6 @@ export type ProviderOptionAdmission = Readonly<{
|
|
|
151
150
|
diagnostic: string;
|
|
152
151
|
}>;
|
|
153
152
|
export type ProviderAdapter = Readonly<{
|
|
154
|
-
confinement(input: Readonly<{
|
|
155
|
-
cwd: string;
|
|
156
|
-
options: ProviderOptions;
|
|
157
|
-
}>): Confinement;
|
|
158
153
|
admitOptions(options: ProviderOptions): ProviderOptionAdmission;
|
|
159
154
|
fork?(input: Readonly<{
|
|
160
155
|
session: ResumeCoordinate;
|
|
@@ -87,7 +87,8 @@ function decodeDiffstat(value) {
|
|
|
87
87
|
}
|
|
88
88
|
function decodeFileChangeMember(value) {
|
|
89
89
|
const change = object(value);
|
|
90
|
-
if (change === null || (change.op !== "add" && change.op !== "update"
|
|
90
|
+
if (change === null || (change.op !== "add" && change.op !== "update"
|
|
91
|
+
&& change.op !== "delete" && change.op !== "unspecified")
|
|
91
92
|
|| typeof change.path !== "string")
|
|
92
93
|
return null;
|
|
93
94
|
const diffstat = decodeDiffstat(change.diffstat);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as acp from "@agentclientprotocol/sdk";
|
|
2
2
|
import { spawnStdioProcess } from "../../../runtime/proc/stdio.js";
|
|
3
3
|
import { type ProviderAdapter, type Session } from "../../provider.js";
|
|
4
|
+
import { type AcpToolInterpreter, type AcpToolUpdate } from "./events.js";
|
|
5
|
+
export type { AcpToolInterpreter, AcpToolUpdate };
|
|
4
6
|
export type AcpStartInput = Parameters<ProviderAdapter["start"]>[0] | Parameters<NonNullable<ProviderAdapter["resume"]>>[0];
|
|
5
7
|
export type AcpDependencies = Readonly<{
|
|
6
8
|
spawnProcess?: typeof spawnStdioProcess;
|
|
9
|
+
interpretTool?: AcpToolInterpreter;
|
|
7
10
|
}>;
|
|
8
11
|
export type AcpLiveSession = Readonly<{
|
|
9
12
|
session: Session;
|
|
@@ -16,4 +19,3 @@ type AcpLaunch = Readonly<{
|
|
|
16
19
|
env?: Readonly<Record<string, string>>;
|
|
17
20
|
}>;
|
|
18
21
|
export declare function startAcpSession(launch: AcpLaunch, input: AcpStartInput, dependencies?: AcpDependencies): Promise<AcpLiveSession>;
|
|
19
|
-
export {};
|
|
@@ -2,8 +2,8 @@ import * as acp from "@agentclientprotocol/sdk";
|
|
|
2
2
|
import { Readable, Writable } from "node:stream";
|
|
3
3
|
import { spawnStdioProcess } from "../../../runtime/proc/stdio.js";
|
|
4
4
|
import { abortable } from "../../abort.js";
|
|
5
|
-
import { AgentEventChannel, } from "../../provider.js";
|
|
6
|
-
import { EMPTY_ACP_EVENT_STATE, flushAcpEvents, mapAcpUpdate } from "./events.js";
|
|
5
|
+
import { AKUMA_REQUESTS_ENV, AgentEventChannel, } from "../../provider.js";
|
|
6
|
+
import { EMPTY_ACP_EVENT_STATE, flushAcpEvents, mapAcpUpdate, } from "./events.js";
|
|
7
7
|
function diagnostic(error) {
|
|
8
8
|
if (!(error instanceof Error))
|
|
9
9
|
return String(error);
|
|
@@ -46,7 +46,7 @@ async function establishSession(agent, input) {
|
|
|
46
46
|
await agent.request(acp.methods.agent.session.load, { cwd: input.cwd, mcpServers: [], sessionId });
|
|
47
47
|
return sessionId;
|
|
48
48
|
}
|
|
49
|
-
function createAcpTurn(connection) {
|
|
49
|
+
function createAcpTurn(connection, interpret) {
|
|
50
50
|
const events = new AgentEventChannel();
|
|
51
51
|
let state = EMPTY_ACP_EVENT_STATE;
|
|
52
52
|
let terminal = false;
|
|
@@ -55,7 +55,7 @@ function createAcpTurn(connection) {
|
|
|
55
55
|
const update = (next) => {
|
|
56
56
|
if (terminal)
|
|
57
57
|
return;
|
|
58
|
-
const mapped = mapAcpUpdate(next, state);
|
|
58
|
+
const mapped = mapAcpUpdate(next, state, interpret);
|
|
59
59
|
state = mapped.state;
|
|
60
60
|
for (const event of mapped.events)
|
|
61
61
|
events.emit(event);
|
|
@@ -130,7 +130,11 @@ export async function startAcpSession(launch, input, dependencies = {}) {
|
|
|
130
130
|
const child = (dependencies.spawnProcess ?? spawnStdioProcess)({
|
|
131
131
|
argv: launch.argv,
|
|
132
132
|
cwd: input.cwd,
|
|
133
|
-
env: {
|
|
133
|
+
env: {
|
|
134
|
+
...globalThis.process.env,
|
|
135
|
+
...launch.env,
|
|
136
|
+
...(input.requests === undefined ? {} : { [AKUMA_REQUESTS_ENV]: input.requests.dir }),
|
|
137
|
+
},
|
|
134
138
|
});
|
|
135
139
|
let sessionId;
|
|
136
140
|
let turn;
|
|
@@ -138,7 +142,7 @@ export async function startAcpSession(launch, input, dependencies = {}) {
|
|
|
138
142
|
if (notification.sessionId === sessionId)
|
|
139
143
|
turn.update(notification.update);
|
|
140
144
|
}).connect(acp.ndJsonStream(Writable.toWeb(child.input), Readable.toWeb(child.output)));
|
|
141
|
-
turn = createAcpTurn(connection);
|
|
145
|
+
turn = createAcpTurn(connection, dependencies.interpretTool);
|
|
142
146
|
try {
|
|
143
147
|
sessionId = await abortable(establishSession(connection.agent, input), signal);
|
|
144
148
|
turn.events.emit({ type: "session", coordinate: { sessionId } });
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { SessionUpdate } from "@agentclientprotocol/sdk";
|
|
2
|
-
import { type AgentEvent } from "../../provider.js";
|
|
2
|
+
import { type AgentEvent, type ToolCall } from "../../provider.js";
|
|
3
3
|
type OpenBlock = Readonly<{
|
|
4
4
|
type: "assistant" | "thought";
|
|
5
5
|
text: string;
|
|
6
6
|
}> | null;
|
|
7
|
+
export type AcpToolObservation = Readonly<{
|
|
8
|
+
name: string;
|
|
9
|
+
call: ToolCall;
|
|
10
|
+
}>;
|
|
11
|
+
export type AcpToolUpdate = Extract<SessionUpdate, {
|
|
12
|
+
sessionUpdate: "tool_call" | "tool_call_update";
|
|
13
|
+
}>;
|
|
14
|
+
export type AcpToolInterpreter = (update: AcpToolUpdate) => ToolCall | undefined;
|
|
7
15
|
export type AcpEventState = Readonly<{
|
|
8
16
|
answer: string;
|
|
9
17
|
assistantMessageId: string | null;
|
|
10
18
|
open: OpenBlock;
|
|
11
|
-
tools: ReadonlyMap<string,
|
|
19
|
+
tools: ReadonlyMap<string, AcpToolObservation>;
|
|
12
20
|
}>;
|
|
13
21
|
type AcpEventMapping = Readonly<{
|
|
14
22
|
events: readonly AgentEvent[];
|
|
@@ -16,5 +24,5 @@ type AcpEventMapping = Readonly<{
|
|
|
16
24
|
}>;
|
|
17
25
|
export declare const EMPTY_ACP_EVENT_STATE: AcpEventState;
|
|
18
26
|
export declare function flushAcpEvents(state: AcpEventState, boundary?: readonly AgentEvent[]): AcpEventMapping;
|
|
19
|
-
export declare function mapAcpUpdate(update: SessionUpdate, previous: AcpEventState): AcpEventMapping;
|
|
27
|
+
export declare function mapAcpUpdate(update: SessionUpdate, previous: AcpEventState, interpret?: AcpToolInterpreter): AcpEventMapping;
|
|
20
28
|
export {};
|
|
@@ -33,7 +33,82 @@ function appendBlock(state, type, text, messageId) {
|
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
function nonblank(value) {
|
|
37
|
+
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
|
|
38
|
+
}
|
|
39
|
+
function object(value) {
|
|
40
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
41
|
+
? value
|
|
42
|
+
: undefined;
|
|
43
|
+
}
|
|
44
|
+
function positiveLine(value) {
|
|
45
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 1
|
|
46
|
+
? value
|
|
47
|
+
: undefined;
|
|
48
|
+
}
|
|
49
|
+
function otherCall(name) {
|
|
50
|
+
return { kind: "other", display: name };
|
|
51
|
+
}
|
|
52
|
+
function locationFact(locations) {
|
|
53
|
+
if (locations === null || locations === undefined)
|
|
54
|
+
return {};
|
|
55
|
+
for (const location of locations) {
|
|
56
|
+
const path = nonblank(location.path);
|
|
57
|
+
if (path === undefined)
|
|
58
|
+
continue;
|
|
59
|
+
const offset = positiveLine(location.line);
|
|
60
|
+
return offset === undefined ? { path } : { path, offset };
|
|
61
|
+
}
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
64
|
+
function standardCall(update, name) {
|
|
65
|
+
const location = locationFact(update.locations);
|
|
66
|
+
if (update.kind === "read") {
|
|
67
|
+
return location.path === undefined
|
|
68
|
+
? otherCall(name)
|
|
69
|
+
: {
|
|
70
|
+
kind: "read",
|
|
71
|
+
path: location.path,
|
|
72
|
+
...(location.offset === undefined ? {} : { offset: location.offset }),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const input = object(update.rawInput);
|
|
76
|
+
if (update.kind === "execute") {
|
|
77
|
+
const command = nonblank(input?.command);
|
|
78
|
+
return command === undefined ? otherCall(name) : { kind: "run", command };
|
|
79
|
+
}
|
|
80
|
+
if (update.kind === "search") {
|
|
81
|
+
const query = nonblank(input?.query);
|
|
82
|
+
if (query === undefined)
|
|
83
|
+
return otherCall(name);
|
|
84
|
+
const path = nonblank(input?.path);
|
|
85
|
+
const glob = nonblank(input?.glob);
|
|
86
|
+
const scope = input?.scope;
|
|
87
|
+
const searchScope = scope === "content" || scope === "files" || scope === "web"
|
|
88
|
+
? scope
|
|
89
|
+
: undefined;
|
|
90
|
+
return {
|
|
91
|
+
kind: "search",
|
|
92
|
+
query,
|
|
93
|
+
...(searchScope === undefined ? {} : { scope: searchScope }),
|
|
94
|
+
...(path === undefined ? {} : { path }),
|
|
95
|
+
...(glob === undefined ? {} : { glob }),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return otherCall(name);
|
|
99
|
+
}
|
|
100
|
+
function strongest(previous, next) {
|
|
101
|
+
if (previous === undefined || previous.kind === "other")
|
|
102
|
+
return next;
|
|
103
|
+
return next.kind === "other" ? previous : next;
|
|
104
|
+
}
|
|
105
|
+
function observeTool(update, previous, interpret) {
|
|
106
|
+
const name = nonblank(update.name) ?? nonblank(update.title) ?? previous?.name ?? "ACP tool";
|
|
107
|
+
const standard = standardCall(update, name);
|
|
108
|
+
const dialect = standard.kind === "other" ? interpret?.(update) : undefined;
|
|
109
|
+
return { name, call: strongest(previous?.call, dialect ?? standard) };
|
|
110
|
+
}
|
|
111
|
+
export function mapAcpUpdate(update, previous, interpret) {
|
|
37
112
|
switch (update.sessionUpdate) {
|
|
38
113
|
case "agent_message_chunk":
|
|
39
114
|
case "agent_thought_chunk": {
|
|
@@ -47,15 +122,14 @@ export function mapAcpUpdate(update, previous) {
|
|
|
47
122
|
case "user_message_chunk": return flushAcpEvents(previous);
|
|
48
123
|
case "tool_call":
|
|
49
124
|
case "tool_call_update": {
|
|
50
|
-
const
|
|
51
|
-
const observed = { name, call: { kind: "other", display: name } };
|
|
125
|
+
const observed = observeTool(update, previous.tools.get(update.toolCallId), interpret);
|
|
52
126
|
const tools = new Map(previous.tools);
|
|
53
127
|
if (update.status === "completed" || update.status === "failed") {
|
|
54
128
|
tools.delete(update.toolCallId);
|
|
55
129
|
return flushAcpEvents({ ...previous, tools }, [{ type: "tool", phase: "completed", id: update.toolCallId, ...observed, result: { status: update.status === "completed" ? "ok" : "error" } }]);
|
|
56
130
|
}
|
|
57
131
|
const started = tools.has(update.toolCallId);
|
|
58
|
-
tools.set(update.toolCallId,
|
|
132
|
+
tools.set(update.toolCallId, observed);
|
|
59
133
|
return started
|
|
60
134
|
? flushAcpEvents({ ...previous, tools })
|
|
61
135
|
: flushAcpEvents({ ...previous, tools }, [{ type: "tool", phase: "started", id: update.toolCallId, ...observed }]);
|
|
@@ -86,7 +86,6 @@ export function createAcpProvider(execution, dependencies = {}) {
|
|
|
86
86
|
return (await startAcpSession(launch, input, dependencies)).session;
|
|
87
87
|
};
|
|
88
88
|
return {
|
|
89
|
-
confinement: () => ({ kind: "unconfined" }),
|
|
90
89
|
admitOptions: (options) => optionAdmission(options, config),
|
|
91
90
|
start: async (input) => await drive(input),
|
|
92
91
|
resume: async (input) => await drive(input),
|
|
@@ -141,12 +141,63 @@ function fileChangeCall(name, path) {
|
|
|
141
141
|
}
|
|
142
142
|
return undefined;
|
|
143
143
|
}
|
|
144
|
+
function startedPath(name, value) {
|
|
145
|
+
if (name === "NotebookEdit")
|
|
146
|
+
return nonblank(value.notebook_path);
|
|
147
|
+
return nonblank(value.file_path) ?? (name === "Read" ? nonblank(value.path) : undefined);
|
|
148
|
+
}
|
|
149
|
+
function nonnegativeInt(value) {
|
|
150
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : undefined;
|
|
151
|
+
}
|
|
152
|
+
function fileChange(op, path, gitDiff) {
|
|
153
|
+
const diff = object(gitDiff);
|
|
154
|
+
const added = nonnegativeInt(diff?.additions);
|
|
155
|
+
const removed = nonnegativeInt(diff?.deletions);
|
|
156
|
+
const diffstat = added === undefined || removed === undefined ? undefined : { added, removed };
|
|
157
|
+
return {
|
|
158
|
+
kind: "fileChange",
|
|
159
|
+
changes: [{ op, path, ...(diffstat === undefined ? {} : { diffstat }) }],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function writeResult(result) {
|
|
163
|
+
const value = object(result);
|
|
164
|
+
if (value === undefined || (value.type !== "create" && value.type !== "update"))
|
|
165
|
+
return undefined;
|
|
166
|
+
const path = nonblank(value.filePath);
|
|
167
|
+
if (path === undefined)
|
|
168
|
+
return undefined;
|
|
169
|
+
const op = value.type === "create" ? "add" : "update";
|
|
170
|
+
return fileChange(op, path, value.gitDiff);
|
|
171
|
+
}
|
|
172
|
+
function editResult(result) {
|
|
173
|
+
const value = object(result);
|
|
174
|
+
if (value === undefined || value.type === "create" || value.type === "update")
|
|
175
|
+
return undefined;
|
|
176
|
+
const path = nonblank(value.filePath);
|
|
177
|
+
if (path === undefined)
|
|
178
|
+
return undefined;
|
|
179
|
+
const status = object(value.gitDiff)?.status;
|
|
180
|
+
return fileChange(status === "added" ? "add" : "update", path, value.gitDiff);
|
|
181
|
+
}
|
|
182
|
+
function notebookResult(result) {
|
|
183
|
+
const path = nonblank(object(result)?.notebook_path);
|
|
184
|
+
return path === undefined
|
|
185
|
+
? undefined
|
|
186
|
+
: { kind: "fileChange", changes: [{ op: "update", path }] };
|
|
187
|
+
}
|
|
188
|
+
function structuredFileChange(name, result) {
|
|
189
|
+
if (name === "Write")
|
|
190
|
+
return writeResult(result);
|
|
191
|
+
if (name === "Edit")
|
|
192
|
+
return editResult(result);
|
|
193
|
+
return name === "NotebookEdit" ? notebookResult(result) : undefined;
|
|
194
|
+
}
|
|
144
195
|
function toolCall(name, input) {
|
|
145
196
|
const value = object(input) ?? {};
|
|
146
197
|
const run = runCall(name, value);
|
|
147
198
|
if (run !== undefined)
|
|
148
199
|
return run;
|
|
149
|
-
const path =
|
|
200
|
+
const path = startedPath(name, value);
|
|
150
201
|
return readCall(name, path, value)
|
|
151
202
|
?? searchCall(name, value)
|
|
152
203
|
?? fileChangeCall(name, path)
|
|
@@ -192,9 +243,17 @@ function toolResultEvents(message, events, state) {
|
|
|
192
243
|
if (observed === undefined)
|
|
193
244
|
continue;
|
|
194
245
|
state.tools.delete(id);
|
|
246
|
+
const failed = value.is_error === true;
|
|
247
|
+
const structured = failed
|
|
248
|
+
? undefined
|
|
249
|
+
: structuredFileChange(observed.name, message.tool_use_result);
|
|
195
250
|
events.emit({
|
|
196
|
-
type: "tool",
|
|
197
|
-
|
|
251
|
+
type: "tool",
|
|
252
|
+
phase: "completed",
|
|
253
|
+
id,
|
|
254
|
+
name: observed.name,
|
|
255
|
+
call: structured ?? observed.call,
|
|
256
|
+
result: { status: failed ? "error" : "ok" },
|
|
198
257
|
});
|
|
199
258
|
}
|
|
200
259
|
}
|
|
@@ -21,10 +21,6 @@ export type ClaudeSdk = Readonly<{
|
|
|
21
21
|
}>;
|
|
22
22
|
export declare function createClaudeProvider(load: () => Promise<ClaudeSdk>, execution?: ClaudeExecution): ProviderAdapter;
|
|
23
23
|
export declare const claudeProvider: Readonly<{
|
|
24
|
-
confinement(input: Readonly<{
|
|
25
|
-
cwd: string;
|
|
26
|
-
options: ProviderOptions;
|
|
27
|
-
}>): import("../../index.js").Confinement;
|
|
28
24
|
admitOptions(options: ProviderOptions): import("../../provider.js").ProviderOptionAdmission;
|
|
29
25
|
fork?(input: Readonly<{
|
|
30
26
|
session: ResumeCoordinate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { abortable } from "../../abort.js";
|
|
3
|
-
import { AgentEventChannel, } from "../../provider.js";
|
|
3
|
+
import { AKUMA_REQUESTS_ENV, AgentEventChannel, } from "../../provider.js";
|
|
4
4
|
import { emitClaudeMessage, } from "./events.js";
|
|
5
5
|
import { claudeUserMessage, createClaudeInput, isClaudeTurnEnded } from "./input.js";
|
|
6
6
|
export { CLAUDE_MESSAGE_DISPOSITIONS, CLAUDE_SYSTEM_DISPOSITIONS } from "./events.js";
|
|
@@ -61,8 +61,13 @@ function claudeQueryOptions(input, execution, abortController) {
|
|
|
61
61
|
return {
|
|
62
62
|
cwd: input.cwd,
|
|
63
63
|
abortController,
|
|
64
|
+
...(input.requests === undefined ? {} : { additionalDirectories: [input.requests.dir] }),
|
|
64
65
|
...(execution.executable === undefined ? {} : { pathToClaudeCodeExecutable: execution.executable }),
|
|
65
|
-
...(execution.env === undefined ? {} : { env: {
|
|
66
|
+
...((execution.env === undefined && input.requests === undefined) ? {} : { env: {
|
|
67
|
+
...process.env,
|
|
68
|
+
...execution.env,
|
|
69
|
+
...(input.requests === undefined ? {} : { [AKUMA_REQUESTS_ENV]: input.requests.dir }),
|
|
70
|
+
} }),
|
|
66
71
|
permissionMode: mode,
|
|
67
72
|
...(mode === "bypassPermissions" ? { allowDangerouslySkipPermissions: true } : {}),
|
|
68
73
|
settingSources: ["user", "project", "local"],
|
|
@@ -269,7 +274,6 @@ async function driveClaude(load, execution, drive) {
|
|
|
269
274
|
}
|
|
270
275
|
export function createClaudeProvider(load, execution = {}) {
|
|
271
276
|
return {
|
|
272
|
-
confinement: () => ({ kind: "unconfined" }),
|
|
273
277
|
admitOptions: admitClaudeOptions,
|
|
274
278
|
fork: (input) => forkClaude(load, execution, input),
|
|
275
279
|
start: (input) => driveClaude(load, execution, input),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { noteEvent, unknownEvent, } from "../../provider.js";
|
|
2
|
+
import { diffstatFromUnifiedPatch } from "../unified-patch.js";
|
|
2
3
|
export const CODEX_NOTIFICATION_DISPOSITIONS = {
|
|
3
4
|
"account/login/completed": "drop",
|
|
4
5
|
"account/rateLimits/updated": "drop",
|
|
@@ -135,19 +136,6 @@ function fileChangeOp(value) {
|
|
|
135
136
|
? record.type
|
|
136
137
|
: undefined;
|
|
137
138
|
}
|
|
138
|
-
function diffstatFromUnifiedPatch(patch) {
|
|
139
|
-
if (!patch.split("\n").some((line) => /^@@ -\d+(?:,\d+)? \+\d+(?:,\d+)? @@/u.test(line)))
|
|
140
|
-
return undefined;
|
|
141
|
-
let added = 0;
|
|
142
|
-
let removed = 0;
|
|
143
|
-
for (const line of patch.split("\n")) {
|
|
144
|
-
if (line.startsWith("+") && !line.startsWith("+++"))
|
|
145
|
-
added += 1;
|
|
146
|
-
if (line.startsWith("-") && !line.startsWith("---"))
|
|
147
|
-
removed += 1;
|
|
148
|
-
}
|
|
149
|
-
return { added, removed };
|
|
150
|
-
}
|
|
151
139
|
function itemChanges(item) {
|
|
152
140
|
if (!Array.isArray(item.changes))
|
|
153
141
|
return [];
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { ProviderExecution
|
|
1
|
+
import { type ProviderAdapter } from "../../provider.js";
|
|
2
|
+
import type { ProviderExecution } from "../../provider-recipe.js";
|
|
3
3
|
export { CODEX_ITEM_DISPOSITIONS, CODEX_NOTIFICATION_DISPOSITIONS } from "./events.js";
|
|
4
4
|
export declare function createCodexAppServerProvider(input?: string | ProviderExecution): ProviderAdapter;
|
|
5
|
-
export declare const codexAppServerProvider: Readonly<{
|
|
6
|
-
confinement(input: Readonly<{
|
|
7
|
-
cwd: string;
|
|
8
|
-
options: ProviderOptions;
|
|
9
|
-
}>): import("../../index.js").Confinement;
|
|
10
|
-
admitOptions(options: ProviderOptions): import("../../provider.js").ProviderOptionAdmission;
|
|
11
|
-
fork?(input: Readonly<{
|
|
12
|
-
session: import("../../coordinate.js").ResumeCoordinate;
|
|
13
|
-
at: string;
|
|
14
|
-
cwd: string;
|
|
15
|
-
}>): Promise<Readonly<{
|
|
16
|
-
session: import("../../coordinate.js").ResumeCoordinate;
|
|
17
|
-
}>>;
|
|
18
|
-
start(input: import("../../provider.js").DriveInput & Readonly<{
|
|
19
|
-
session: Readonly<{
|
|
20
|
-
kind: "fresh";
|
|
21
|
-
}>;
|
|
22
|
-
}>): Promise<Session>;
|
|
23
|
-
resume?(input: import("../../provider.js").DriveInput & Readonly<{
|
|
24
|
-
session: Readonly<{
|
|
25
|
-
kind: "resume";
|
|
26
|
-
coordinate: import("../../coordinate.js").ResumeCoordinate;
|
|
27
|
-
}>;
|
|
28
|
-
}>): Promise<Session>;
|
|
29
|
-
}>;
|
|
@@ -190,7 +190,6 @@ export function createCodexAppServerProvider(input = "codex") {
|
|
|
190
190
|
? { name: "codex-app-server", kind: "codex-app-server", executable: input }
|
|
191
191
|
: input;
|
|
192
192
|
return {
|
|
193
|
-
confinement: ({ cwd }) => ({ kind: "declared", writableRoots: [cwd] }),
|
|
194
193
|
admitOptions(options) {
|
|
195
194
|
return {
|
|
196
195
|
kind: "admitted",
|
|
@@ -203,4 +202,3 @@ export function createCodexAppServerProvider(input = "codex") {
|
|
|
203
202
|
resume: (input) => startCodex(execution, input),
|
|
204
203
|
};
|
|
205
204
|
}
|
|
206
|
-
export const codexAppServerProvider = createCodexAppServerProvider();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderAdapter } from "../../provider.js";
|
|
2
2
|
import type { ProviderExecution } from "../../provider-recipe.js";
|
|
3
|
-
import { type AcpDependencies } from "../acp/core.js";
|
|
3
|
+
import { type AcpDependencies, type AcpToolInterpreter } from "../acp/core.js";
|
|
4
|
+
export declare const interpretGrokTool: AcpToolInterpreter;
|
|
4
5
|
export declare function createGrokBuildProvider(execution: ProviderExecution, dependencies?: AcpDependencies): ProviderAdapter;
|