@oyasmi/pipiclaw 0.8.11 → 0.9.0-beta.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/dist/agent/channel-runner.d.ts +3 -0
- package/dist/agent/channel-runner.js +9 -0
- package/dist/agent/commands.d.ts +1 -1
- package/dist/agent/commands.js +9 -0
- package/dist/agent/job-manager.d.ts +11 -3
- package/dist/agent/job-manager.js +63 -6
- package/dist/agent/prompt/sections.js +46 -7
- package/dist/agent/prompt/types.d.ts +9 -0
- package/dist/agent/session-events.js +7 -42
- package/dist/agent/types.d.ts +4 -0
- package/dist/playbooks/agent-delegation.md +46 -21
- package/dist/playbooks/runtime-orientation.md +2 -2
- package/dist/runtime/bootstrap.d.ts +38 -0
- package/dist/runtime/bootstrap.js +167 -14
- package/dist/runtime/dingtalk.d.ts +9 -0
- package/dist/runtime/dingtalk.js +3 -0
- package/dist/runtime/durable-dispatch.d.ts +4 -0
- package/dist/runtime/durable-dispatch.js +16 -0
- package/dist/runtime/store.d.ts +7 -0
- package/dist/runtime/subagent-commands.d.ts +15 -0
- package/dist/runtime/subagent-commands.js +122 -0
- package/dist/runtime/task-commands.js +5 -1
- package/dist/security/logger.js +10 -1
- package/dist/security/types.d.ts +17 -1
- package/dist/shared/host-process.d.ts +21 -0
- package/dist/shared/host-process.js +44 -0
- package/dist/shared/jsonl-appender.d.ts +2 -0
- package/dist/shared/jsonl-appender.js +25 -13
- package/dist/shared/shell-words.d.ts +9 -0
- package/dist/shared/shell-words.js +52 -0
- package/dist/subagents/discovery.d.ts +42 -1
- package/dist/subagents/discovery.js +302 -69
- package/dist/subagents/external/claude-code.d.ts +2 -0
- package/dist/subagents/external/claude-code.js +152 -0
- package/dist/subagents/external/codex-cli.d.ts +2 -0
- package/dist/subagents/external/codex-cli.js +133 -0
- package/dist/subagents/external/exec.d.ts +2 -0
- package/dist/subagents/external/exec.js +38 -0
- package/dist/subagents/external/harness.d.ts +102 -0
- package/dist/subagents/external/harness.js +76 -0
- package/dist/subagents/external/registry.d.ts +2 -0
- package/dist/subagents/external/registry.js +11 -0
- package/dist/subagents/external/run.d.ts +49 -0
- package/dist/subagents/external/run.js +266 -0
- package/dist/subagents/runs.d.ts +230 -0
- package/dist/subagents/runs.js +615 -0
- package/dist/subagents/tool.d.ts +26 -0
- package/dist/subagents/tool.js +464 -182
- package/dist/subagents/workspace-lease.d.ts +36 -0
- package/dist/subagents/workspace-lease.js +48 -0
- package/dist/tasks/artifact-subject.js +50 -2
- package/dist/tasks/control.d.ts +12 -0
- package/dist/tasks/control.js +20 -0
- package/dist/tasks/store.d.ts +21 -0
- package/dist/tasks/store.js +80 -0
- package/dist/tasks/verification.d.ts +8 -0
- package/dist/tasks/verification.js +10 -2
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +12 -1
- package/dist/tools/registry.js +1 -0
- package/dist/tools/subagent-manage.d.ts +23 -0
- package/dist/tools/subagent-manage.js +154 -0
- package/dist/tools/tool-details.d.ts +1 -1
- package/dist/tui/app.js +2 -0
- package/dist/tui/commands.d.ts +1 -0
- package/dist/tui/commands.js +2 -0
- package/dist/tui/turn-controller.d.ts +1 -0
- package/dist/tui/turn-controller.js +1 -0
- package/dist/usage/ledger.d.ts +13 -0
- package/dist/usage/ledger.js +15 -2
- package/dist/usage/render.js +22 -0
- package/examples/sub-agents/README.md +61 -12
- package/examples/sub-agents/builder-hard.md +45 -0
- package/examples/sub-agents/builder.md +41 -0
- package/examples/sub-agents/documenter.md +53 -0
- package/examples/sub-agents/log-sifter.md +43 -0
- package/examples/sub-agents/planner.md +42 -0
- package/examples/sub-agents/reviewer.md +38 -38
- package/examples/sub-agents/scout.md +31 -0
- package/examples/sub-agents/verifier.md +32 -36
- package/examples/sub-agents/worker.md +36 -0
- package/package.json +1 -1
- package/examples/sub-agents/researcher.md +0 -41
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A process-wide, exclusive *write* lease on a checkout (spec 040, D10.1).
|
|
3
|
+
*
|
|
4
|
+
* Only `mutates: write` runs take a lease; read runs never do. The key is the delegation's
|
|
5
|
+
* working directory realpath, and a conflict is a prefix relationship in either direction
|
|
6
|
+
* (`/repo` and `/repo/pkg` are the same resource, not two). This is deliberately the whole
|
|
7
|
+
* mechanism: no read/write distinction, no counting, no upgrade/downgrade. What actually produces
|
|
8
|
+
* a wrong result is two writers touching the same tree at once; a reviewer reading a diff that
|
|
9
|
+
* moves under it is a quality problem, not a correctness one, and is left to `agent-delegation.md`
|
|
10
|
+
* plus the parked-review's own judgement rather than a second locking dimension.
|
|
11
|
+
*
|
|
12
|
+
* Global, not per-channel: two channels pointed at the same checkout must still exclude each
|
|
13
|
+
* other. The main agent's own write/edit/bash calls deliberately do **not** participate — see
|
|
14
|
+
* the design doc D10.1 for why (it would deadlock a run against the very turn that dispatched
|
|
15
|
+
* it, and turns this into a runtime-wide concurrency redesign this spec does not attempt).
|
|
16
|
+
*/
|
|
17
|
+
export interface WorkspaceLeaseHolder {
|
|
18
|
+
runId: string;
|
|
19
|
+
channelId: string;
|
|
20
|
+
workingDirectory: string;
|
|
21
|
+
}
|
|
22
|
+
/** The stable lease key for a working directory: its realpath, so a symlink or `..` cannot dodge a conflict. */
|
|
23
|
+
export declare function workspaceLeaseKey(workingDirectory: string): string;
|
|
24
|
+
export type AcquireWorkspaceLeaseResult = {
|
|
25
|
+
ok: true;
|
|
26
|
+
leaseKey: string;
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
leaseKey: string;
|
|
30
|
+
heldBy: WorkspaceLeaseHolder;
|
|
31
|
+
};
|
|
32
|
+
export declare function acquireWorkspaceLease(holder: WorkspaceLeaseHolder): AcquireWorkspaceLeaseResult;
|
|
33
|
+
export declare function releaseWorkspaceLease(leaseKey: string | undefined): void;
|
|
34
|
+
/** Read-only check for a pre-flight gate (e.g. `purpose=verify`, D9) that must not itself take a lease. */
|
|
35
|
+
export declare function findWorkspaceLeaseHolder(workingDirectory: string): WorkspaceLeaseHolder | undefined;
|
|
36
|
+
export declare function formatWorkspaceLeaseConflict(heldBy: WorkspaceLeaseHolder): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
2
|
+
const leases = new Map();
|
|
3
|
+
function withTrailingSlash(path) {
|
|
4
|
+
return path.endsWith("/") ? path : `${path}/`;
|
|
5
|
+
}
|
|
6
|
+
function pathsConflict(a, b) {
|
|
7
|
+
return (a === b ||
|
|
8
|
+
withTrailingSlash(a).startsWith(withTrailingSlash(b)) ||
|
|
9
|
+
withTrailingSlash(b).startsWith(withTrailingSlash(a)));
|
|
10
|
+
}
|
|
11
|
+
/** The stable lease key for a working directory: its realpath, so a symlink or `..` cannot dodge a conflict. */
|
|
12
|
+
export function workspaceLeaseKey(workingDirectory) {
|
|
13
|
+
try {
|
|
14
|
+
return realpathSync(workingDirectory);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return workingDirectory;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function findConflict(leaseKey) {
|
|
21
|
+
for (const [key, holder] of leases) {
|
|
22
|
+
if (pathsConflict(key, leaseKey))
|
|
23
|
+
return holder;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
export function acquireWorkspaceLease(holder) {
|
|
28
|
+
const leaseKey = workspaceLeaseKey(holder.workingDirectory);
|
|
29
|
+
const conflict = findConflict(leaseKey);
|
|
30
|
+
if (conflict) {
|
|
31
|
+
return { ok: false, leaseKey, heldBy: conflict };
|
|
32
|
+
}
|
|
33
|
+
leases.set(leaseKey, holder);
|
|
34
|
+
return { ok: true, leaseKey };
|
|
35
|
+
}
|
|
36
|
+
export function releaseWorkspaceLease(leaseKey) {
|
|
37
|
+
if (leaseKey)
|
|
38
|
+
leases.delete(leaseKey);
|
|
39
|
+
}
|
|
40
|
+
/** Read-only check for a pre-flight gate (e.g. `purpose=verify`, D9) that must not itself take a lease. */
|
|
41
|
+
export function findWorkspaceLeaseHolder(workingDirectory) {
|
|
42
|
+
return findConflict(workspaceLeaseKey(workingDirectory));
|
|
43
|
+
}
|
|
44
|
+
export function formatWorkspaceLeaseConflict(heldBy) {
|
|
45
|
+
return (`Workspace "${heldBy.workingDirectory}" is already held by a running write delegation ` +
|
|
46
|
+
`(runId ${heldBy.runId}, channel ${heldBy.channelId}). Wait for it to finish, cancel it with ` +
|
|
47
|
+
"subagent_manage, or use a separate `git worktree add` checkout via workingDirectory.");
|
|
48
|
+
}
|
|
@@ -1,7 +1,54 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { join } from "node:path";
|
|
3
5
|
import { promisify } from "node:util";
|
|
4
6
|
const execFileAsync = promisify(execFile);
|
|
7
|
+
/**
|
|
8
|
+
* git quotes a path containing special characters in double quotes with C-style escapes (spec
|
|
9
|
+
* 040, D9). `JSON.parse` accepts the same escape set for the characters git actually emits
|
|
10
|
+
* (`\"`, `\\`, `\t`, `\n`) and is close enough for a hash input; a path so exotic it defeats this
|
|
11
|
+
* still contributes *a* value to the hash; it just won't be the literal decoded path.
|
|
12
|
+
*/
|
|
13
|
+
function unquoteGitPath(raw) {
|
|
14
|
+
if (raw.startsWith('"') && raw.endsWith('"')) {
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(raw);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return raw;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return raw;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fold untracked-file *content* into the subject, not just their path/status (D9). `git status
|
|
26
|
+
* --porcelain` reports an untracked file as present, but two different untracked files with the
|
|
27
|
+
* same name are indistinguishable to it — a verifier that edits an untracked file's content
|
|
28
|
+
* (or reverts it after inspection) previously left no trace in `workspaceSubjectHash` at all.
|
|
29
|
+
* Best-effort per file: an unreadable entry (deleted mid-scan, a directory, a permission error)
|
|
30
|
+
* still contributes its path to the hash, just not content — this function must never throw, since
|
|
31
|
+
* its caller already treats the whole subject computation as best-effort.
|
|
32
|
+
*/
|
|
33
|
+
async function untrackedFileDigest(workingDirectory, statusOutput) {
|
|
34
|
+
const paths = statusOutput
|
|
35
|
+
.split("\n")
|
|
36
|
+
.filter((line) => line.startsWith("?? "))
|
|
37
|
+
.map((line) => unquoteGitPath(line.slice(3).trim()))
|
|
38
|
+
.filter(Boolean)
|
|
39
|
+
.sort();
|
|
40
|
+
const hash = createHash("sha256");
|
|
41
|
+
for (const relativePath of paths) {
|
|
42
|
+
hash.update(relativePath);
|
|
43
|
+
try {
|
|
44
|
+
hash.update(await readFile(join(workingDirectory, relativePath)));
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Unreadable — the path alone still went into the hash above.
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return hash.digest("hex");
|
|
51
|
+
}
|
|
5
52
|
/**
|
|
6
53
|
* A compact, deterministic description of the code/artifact subject a verifier
|
|
7
54
|
* observed. It intentionally uses only Git's own view, keeping verification
|
|
@@ -10,7 +57,7 @@ const execFileAsync = promisify(execFile);
|
|
|
10
57
|
export async function workspaceSubjectHash(workingDirectory) {
|
|
11
58
|
try {
|
|
12
59
|
const { stdout } = await execFileAsync("git", ["-C", workingDirectory, "status", "--porcelain=v1", "--untracked-files=all"], { maxBuffer: 4 * 1024 * 1024 });
|
|
13
|
-
const [head, unstaged, staged] = await Promise.all([
|
|
60
|
+
const [head, unstaged, staged, untrackedDigest] = await Promise.all([
|
|
14
61
|
execFileAsync("git", ["-C", workingDirectory, "rev-parse", "HEAD"], { maxBuffer: 1024 * 1024 }),
|
|
15
62
|
execFileAsync("git", ["-C", workingDirectory, "diff", "--no-ext-diff", "--binary"], {
|
|
16
63
|
maxBuffer: 4 * 1024 * 1024,
|
|
@@ -18,9 +65,10 @@ export async function workspaceSubjectHash(workingDirectory) {
|
|
|
18
65
|
execFileAsync("git", ["-C", workingDirectory, "diff", "--cached", "--no-ext-diff", "--binary"], {
|
|
19
66
|
maxBuffer: 4 * 1024 * 1024,
|
|
20
67
|
}),
|
|
68
|
+
untrackedFileDigest(workingDirectory, stdout),
|
|
21
69
|
]);
|
|
22
70
|
return createHash("sha256")
|
|
23
|
-
.update([head.stdout.trim(), stdout, unstaged.stdout, staged.stdout].join("\0"))
|
|
71
|
+
.update([head.stdout.trim(), stdout, unstaged.stdout, staged.stdout, untrackedDigest].join("\0"))
|
|
24
72
|
.digest("hex");
|
|
25
73
|
}
|
|
26
74
|
catch {
|
package/dist/tasks/control.d.ts
CHANGED
|
@@ -35,6 +35,17 @@ export interface TaskProvenance {
|
|
|
35
35
|
createdAt?: string;
|
|
36
36
|
sourceMessageId?: string;
|
|
37
37
|
}
|
|
38
|
+
/** Durable ownership marker for the interval between a structured completion wake activating a
|
|
39
|
+
* task and its transport accepting the corresponding turn. */
|
|
40
|
+
export interface TaskWakeHandoff {
|
|
41
|
+
kind: "subagent";
|
|
42
|
+
resourceId: string;
|
|
43
|
+
dispatchId: string;
|
|
44
|
+
generation: number;
|
|
45
|
+
previousLastOutcome: TaskOutcome;
|
|
46
|
+
previousBlockedReason?: string;
|
|
47
|
+
previousLastStartedAt?: string;
|
|
48
|
+
}
|
|
38
49
|
/** The v2 persisted control block. Execution authority comes from capability and scope. */
|
|
39
50
|
export interface TaskControl {
|
|
40
51
|
version: 2;
|
|
@@ -55,6 +66,7 @@ export interface TaskControl {
|
|
|
55
66
|
/** Present only while the task is disabled. */
|
|
56
67
|
stop?: TaskStop;
|
|
57
68
|
provenance?: TaskProvenance;
|
|
69
|
+
wakeHandoff?: TaskWakeHandoff;
|
|
58
70
|
}
|
|
59
71
|
export interface TaskControlPatch {
|
|
60
72
|
priority?: TaskPriority;
|
package/dist/tasks/control.js
CHANGED
|
@@ -88,6 +88,24 @@ function parseProvenance(value) {
|
|
|
88
88
|
}
|
|
89
89
|
return { createdBy, createdAt, sourceMessageId };
|
|
90
90
|
}
|
|
91
|
+
function parseWakeHandoff(value) {
|
|
92
|
+
if (value === undefined)
|
|
93
|
+
return undefined;
|
|
94
|
+
if (!isRecord(value))
|
|
95
|
+
throw new Error("control.wakeHandoff must be an object");
|
|
96
|
+
if (value.kind !== "subagent" || typeof value.resourceId !== "string" || typeof value.dispatchId !== "string") {
|
|
97
|
+
throw new Error("control.wakeHandoff requires kind=subagent, resourceId, and dispatchId");
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
kind: "subagent",
|
|
101
|
+
resourceId: value.resourceId,
|
|
102
|
+
dispatchId: value.dispatchId,
|
|
103
|
+
generation: nonNegativeInteger(value.generation),
|
|
104
|
+
previousLastOutcome: enumValue(normalizeLegacyOutcome(value.previousLastOutcome), OUTCOMES, "pending"),
|
|
105
|
+
previousBlockedReason: optionalString(value.previousBlockedReason),
|
|
106
|
+
previousLastStartedAt: optionalString(value.previousLastStartedAt),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
91
109
|
/**
|
|
92
110
|
* Keys from the v1 control block that this version deliberately retires. They remain visible to
|
|
93
111
|
* doctor until the next successful write, but they never enter the v2 control object.
|
|
@@ -202,6 +220,7 @@ export function parseTaskControl(raw) {
|
|
|
202
220
|
cycleId: optionalString(value.cycleId),
|
|
203
221
|
stop,
|
|
204
222
|
provenance: parseProvenance(value.provenance),
|
|
223
|
+
wakeHandoff: parseWakeHandoff(value.wakeHandoff),
|
|
205
224
|
};
|
|
206
225
|
}
|
|
207
226
|
function zeroUsage() {
|
|
@@ -224,6 +243,7 @@ export function resetTaskControlForCycle(control, cycleId) {
|
|
|
224
243
|
lastFinishedAt: undefined,
|
|
225
244
|
cycleId: normalizedCycleId,
|
|
226
245
|
stop: undefined,
|
|
246
|
+
wakeHandoff: undefined,
|
|
227
247
|
};
|
|
228
248
|
}
|
|
229
249
|
function patchOptionalString(current, value) {
|
package/dist/tasks/store.d.ts
CHANGED
|
@@ -51,6 +51,27 @@ export declare function finishTaskAttempt(channelDir: string, id: string, result
|
|
|
51
51
|
export declare function escalateTask(channelDir: string, id: string, reason: string): Promise<boolean>;
|
|
52
52
|
/** Atomically convert a due timed wait to active before any wake is dispatched. */
|
|
53
53
|
export declare function activateWaitingTask(channelDir: string, id: string, expectedWaitingFor?: TaskWaitingFor): Promise<StoredTaskDocument | undefined>;
|
|
54
|
+
export interface WakeTaskTransitionHooks {
|
|
55
|
+
/** Test-only fault seam: both hooks run before the single atomic task-file write. */
|
|
56
|
+
beforeActivation?: () => void;
|
|
57
|
+
beforeAttemptClaim?: () => void;
|
|
58
|
+
}
|
|
59
|
+
export interface WakeTaskHandoffInput {
|
|
60
|
+
kind: "subagent";
|
|
61
|
+
resourceId: string;
|
|
62
|
+
dispatchId: string;
|
|
63
|
+
}
|
|
64
|
+
/** Activate a completion-woken task and claim its next attempt in one task-file mutation. Keeping
|
|
65
|
+
* these state changes in one atomic write means a transient failure cannot leave the task active
|
|
66
|
+
* but unclaimed, which would make a retry of the same durable wake look ineligible. */
|
|
67
|
+
export declare function activateWaitingTaskAndClaimAttempt(channelDir: string, id: string, expectedWaitingFor: TaskWaitingFor, now: Date, hooks?: WakeTaskTransitionHooks, handoff?: WakeTaskHandoffInput): Promise<{
|
|
68
|
+
document: StoredTaskDocument;
|
|
69
|
+
generation: number;
|
|
70
|
+
} | undefined>;
|
|
71
|
+
/** Return a transport-rejected structured wake to its exact pre-activation task state. */
|
|
72
|
+
export declare function rollbackWakeTaskActivation(channelDir: string, id: string, expected: WakeTaskHandoffInput): Promise<void>;
|
|
73
|
+
/** Clear the durable handoff after the transport has accepted the activated turn. */
|
|
74
|
+
export declare function finishWakeTaskActivation(channelDir: string, id: string, expected: WakeTaskHandoffInput): Promise<void>;
|
|
54
75
|
/**
|
|
55
76
|
* A stable cycle id for a runtime-opened recurring cycle: `cycle-YYYY-MM-DD`, disambiguated
|
|
56
77
|
* with a `-N` suffix when the same task is reopened more than once on the same local day.
|
package/dist/tasks/store.js
CHANGED
|
@@ -168,6 +168,86 @@ export async function activateWaitingTask(channelDir, id, expectedWaitingFor) {
|
|
|
168
168
|
});
|
|
169
169
|
return activated ? document : undefined;
|
|
170
170
|
}
|
|
171
|
+
/** Activate a completion-woken task and claim its next attempt in one task-file mutation. Keeping
|
|
172
|
+
* these state changes in one atomic write means a transient failure cannot leave the task active
|
|
173
|
+
* but unclaimed, which would make a retry of the same durable wake look ineligible. */
|
|
174
|
+
export async function activateWaitingTaskAndClaimAttempt(channelDir, id, expectedWaitingFor, now, hooks, handoff) {
|
|
175
|
+
let generation;
|
|
176
|
+
const document = await updateStoredTask(channelDir, id, (task) => {
|
|
177
|
+
const status = normalizeStoredStatus(task.fields.status, Boolean(task.fields.schedule));
|
|
178
|
+
const existingHandoff = task.fields.control?.wakeHandoff;
|
|
179
|
+
if (handoff &&
|
|
180
|
+
status === "active" &&
|
|
181
|
+
existingHandoff?.kind === handoff.kind &&
|
|
182
|
+
existingHandoff.resourceId === handoff.resourceId &&
|
|
183
|
+
existingHandoff.dispatchId === handoff.dispatchId &&
|
|
184
|
+
task.fields.control?.attemptGeneration === existingHandoff.generation) {
|
|
185
|
+
generation = existingHandoff.generation;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (status !== "waiting" || task.fields.enabled === false)
|
|
189
|
+
return;
|
|
190
|
+
if (task.fields.control?.waitingFor !== expectedWaitingFor)
|
|
191
|
+
return;
|
|
192
|
+
hooks?.beforeActivation?.();
|
|
193
|
+
task.fields.control ??= createDefaultTaskControl();
|
|
194
|
+
task.fields.status = "active";
|
|
195
|
+
task.fields.wake = undefined;
|
|
196
|
+
task.fields.control.waitingFor = undefined;
|
|
197
|
+
task.fields.control.blockedReason = undefined;
|
|
198
|
+
hooks?.beforeAttemptClaim?.();
|
|
199
|
+
generation = task.fields.control.attemptGeneration + 1;
|
|
200
|
+
const previousLastOutcome = task.fields.control.lastOutcome;
|
|
201
|
+
const previousBlockedReason = task.fields.control.blockedReason;
|
|
202
|
+
const previousLastStartedAt = task.fields.control.lastStartedAt;
|
|
203
|
+
task.fields.control.usage.attempts++;
|
|
204
|
+
task.fields.control.attemptGeneration = generation;
|
|
205
|
+
task.fields.control.lastStartedAt = formatLocalTime(now);
|
|
206
|
+
task.fields.control.lastOutcome = "running";
|
|
207
|
+
if (handoff) {
|
|
208
|
+
task.fields.control.wakeHandoff = {
|
|
209
|
+
...handoff,
|
|
210
|
+
generation,
|
|
211
|
+
previousLastOutcome,
|
|
212
|
+
previousBlockedReason,
|
|
213
|
+
previousLastStartedAt,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return document && generation !== undefined ? { document, generation } : undefined;
|
|
218
|
+
}
|
|
219
|
+
function isMatchingWakeHandoff(handoff, expected) {
|
|
220
|
+
return (handoff?.kind === expected.kind &&
|
|
221
|
+
handoff.resourceId === expected.resourceId &&
|
|
222
|
+
handoff.dispatchId === expected.dispatchId);
|
|
223
|
+
}
|
|
224
|
+
/** Return a transport-rejected structured wake to its exact pre-activation task state. */
|
|
225
|
+
export async function rollbackWakeTaskActivation(channelDir, id, expected) {
|
|
226
|
+
await updateStoredTask(channelDir, id, (task) => {
|
|
227
|
+
const control = task.fields.control;
|
|
228
|
+
const handoff = control?.wakeHandoff;
|
|
229
|
+
if (!control || !isMatchingWakeHandoff(handoff, expected) || control.attemptGeneration !== handoff.generation) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
task.fields.status = "waiting";
|
|
233
|
+
task.fields.wake = undefined;
|
|
234
|
+
control.waitingFor = "external-signal";
|
|
235
|
+
control.usage.attempts = Math.max(0, control.usage.attempts - 1);
|
|
236
|
+
control.attemptGeneration = Math.max(0, handoff.generation - 1);
|
|
237
|
+
control.lastOutcome = handoff.previousLastOutcome;
|
|
238
|
+
control.blockedReason = handoff.previousBlockedReason;
|
|
239
|
+
control.lastStartedAt = handoff.previousLastStartedAt;
|
|
240
|
+
control.wakeHandoff = undefined;
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/** Clear the durable handoff after the transport has accepted the activated turn. */
|
|
244
|
+
export async function finishWakeTaskActivation(channelDir, id, expected) {
|
|
245
|
+
await updateStoredTask(channelDir, id, (task) => {
|
|
246
|
+
if (isMatchingWakeHandoff(task.fields.control?.wakeHandoff, expected) && task.fields.control) {
|
|
247
|
+
task.fields.control.wakeHandoff = undefined;
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
171
251
|
/**
|
|
172
252
|
* A stable cycle id for a runtime-opened recurring cycle: `cycle-YYYY-MM-DD`, disambiguated
|
|
173
253
|
* with a `-N` suffix when the same task is reopened more than once on the same local day.
|
|
@@ -27,6 +27,14 @@ export interface VerificationAttestation {
|
|
|
27
27
|
* a PASS against an unrelated repository. Absent on attestations written before this field.
|
|
28
28
|
*/
|
|
29
29
|
subjectDir?: string;
|
|
30
|
+
/**
|
|
31
|
+
* `enforced` — a built-in verifier, whose write/edit tools are structurally removed before it
|
|
32
|
+
* runs (a real gate). `advisory` — an external verifier (spec 040, D9): the tools cannot be
|
|
33
|
+
* removed, so the verdict rests on the target CLI's own sandbox flag plus the workspace hash,
|
|
34
|
+
* neither of which pipiclaw can prove. Defaults to `enforced` for attestations written before
|
|
35
|
+
* this field existed — every verifier was built-in then.
|
|
36
|
+
*/
|
|
37
|
+
verificationStrength: "enforced" | "advisory";
|
|
30
38
|
}
|
|
31
39
|
export declare function verificationDir(channelDir: string): string;
|
|
32
40
|
export declare function verificationAttestationPath(channelDir: string, runId: string): string;
|
|
@@ -33,6 +33,7 @@ export async function writeVerificationAttestation(channelDir, input) {
|
|
|
33
33
|
workspaceChanged: input.workspaceChanged,
|
|
34
34
|
subjectHash: input.subjectHash,
|
|
35
35
|
subjectDir: input.subjectHash ? input.subjectDir : undefined,
|
|
36
|
+
verificationStrength: input.verificationStrength,
|
|
36
37
|
};
|
|
37
38
|
await mkdir(verificationDir(channelDir), { recursive: true });
|
|
38
39
|
await writeFileAtomically(verificationAttestationPath(channelDir, input.runId), `${JSON.stringify(attestation, null, 2)}\n`);
|
|
@@ -60,8 +61,15 @@ export async function readVerificationAttestation(channelDir, runId) {
|
|
|
60
61
|
(value.subjectHash !== undefined &&
|
|
61
62
|
!/^[a-f0-9]{64}$/i.test(String(value.subjectHash))) ||
|
|
62
63
|
(value.subjectDir !== undefined &&
|
|
63
|
-
typeof value.subjectDir !== "string")
|
|
64
|
+
typeof value.subjectDir !== "string") ||
|
|
65
|
+
(value.verificationStrength !== undefined &&
|
|
66
|
+
value.verificationStrength !== "enforced" &&
|
|
67
|
+
value.verificationStrength !== "advisory")) {
|
|
64
68
|
throw new Error(`Verification run "${runId}" has an invalid attestation. Run the verifier again.`);
|
|
65
69
|
}
|
|
66
|
-
|
|
70
|
+
// Pre-spec-040 attestations predate this field; every verifier back then was built-in.
|
|
71
|
+
return {
|
|
72
|
+
...value,
|
|
73
|
+
verificationStrength: value.verificationStrength ?? "enforced",
|
|
74
|
+
};
|
|
67
75
|
}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { MemoryCandidateStore } from "../memory/candidates.js";
|
|
|
5
5
|
import type { MediaSender } from "../runtime/channel-context.js";
|
|
6
6
|
import type { SecurityConfig } from "../security/types.js";
|
|
7
7
|
import type { PipiclawMemoryRecallSettings, PipiclawSessionSearchSettings } from "../settings.js";
|
|
8
|
-
import type
|
|
8
|
+
import { type SubAgentDiscoveryResult } from "../subagents/discovery.js";
|
|
9
9
|
import type { PipiclawToolsConfig } from "./config.js";
|
|
10
10
|
export interface CreatePipiclawToolsOptions {
|
|
11
11
|
executor: Executor;
|
package/dist/tools/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { getChannelJobManager } from "../agent/job-manager.js";
|
|
2
2
|
import { APP_HOME_DIR } from "../paths.js";
|
|
3
3
|
import { loadSecurityConfig } from "../security/config.js";
|
|
4
|
+
import { withSubAgentsDirWriteDeny } from "../subagents/discovery.js";
|
|
4
5
|
import { createSubAgentTool } from "../subagents/tool.js";
|
|
5
6
|
import { loadToolsConfig } from "./config.js";
|
|
6
7
|
import { buildToolSet } from "./registry.js";
|
|
8
|
+
import { createSubAgentManageTool } from "./subagent-manage.js";
|
|
7
9
|
import { withToolDetails } from "./tool-details.js";
|
|
8
10
|
export function createPipiclawTools(options) {
|
|
9
|
-
|
|
11
|
+
// Spec 040, D8.1: the main agent's own write/edit tools can write a self-authorizing
|
|
12
|
+
// `runtime: external` role file just as readily as a sub-agent's can; deny it here too.
|
|
13
|
+
const securityConfig = withSubAgentsDirWriteDeny(options.securityConfig ?? loadSecurityConfig(APP_HOME_DIR), options.workspaceDir);
|
|
10
14
|
const toolsConfig = options.toolsConfig ?? loadToolsConfig(APP_HOME_DIR);
|
|
11
15
|
const securityContext = {
|
|
12
16
|
workspaceDir: options.workspaceDir,
|
|
@@ -58,5 +62,12 @@ export function createPipiclawTools(options) {
|
|
|
58
62
|
channelId: options.channelId,
|
|
59
63
|
},
|
|
60
64
|
}), "subagent"),
|
|
65
|
+
withToolDetails(createSubAgentManageTool({
|
|
66
|
+
channelId: options.channelId,
|
|
67
|
+
channelDir: options.channelDir,
|
|
68
|
+
getSubAgentDiscovery: options.getSubAgentDiscovery,
|
|
69
|
+
workspaceDir: options.workspaceDir,
|
|
70
|
+
securityConfig,
|
|
71
|
+
}), "subagent_manage"),
|
|
61
72
|
];
|
|
62
73
|
}
|
package/dist/tools/registry.js
CHANGED
|
@@ -179,6 +179,7 @@ export const TOOL_REGISTRY = [
|
|
|
179
179
|
export const TOOL_NAMES = new Set([
|
|
180
180
|
...TOOL_REGISTRY.map((registration) => registration.name),
|
|
181
181
|
"subagent",
|
|
182
|
+
"subagent_manage",
|
|
182
183
|
]);
|
|
183
184
|
/**
|
|
184
185
|
* Build a tool set from the registry, honoring sub-agent availability and config gates.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import { Type } from "typebox";
|
|
3
|
+
import type { SecurityConfig } from "../security/types.js";
|
|
4
|
+
import type { SubAgentDiscoveryResult } from "../subagents/discovery.js";
|
|
5
|
+
declare const subagentManageSchema: Type.TObject<{
|
|
6
|
+
label: Type.TString;
|
|
7
|
+
op: Type.TUnion<[Type.TLiteral<"list">, Type.TLiteral<"cancel">, Type.TLiteral<"follow_up">]>;
|
|
8
|
+
runId: Type.TOptional<Type.TString>;
|
|
9
|
+
task: Type.TOptional<Type.TString>;
|
|
10
|
+
}>;
|
|
11
|
+
export interface SubAgentManageToolOptions {
|
|
12
|
+
channelId: string;
|
|
13
|
+
/** Needed only for `follow_up` on a `purpose=verify` run: where the attestation is written. */
|
|
14
|
+
channelDir?: string;
|
|
15
|
+
/** Needed only for `follow_up`: re-resolves the role's current config by name. */
|
|
16
|
+
getSubAgentDiscovery?: () => SubAgentDiscoveryResult;
|
|
17
|
+
/** Needed only for `follow_up`, which dispatches a new external process and must audit it
|
|
18
|
+
* exactly like the initial dispatch (D8.1/T5). */
|
|
19
|
+
workspaceDir?: string;
|
|
20
|
+
securityConfig?: SecurityConfig;
|
|
21
|
+
}
|
|
22
|
+
export declare function createSubAgentManageTool(options: SubAgentManageToolOptions): AgentTool<typeof subagentManageSchema>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import { DEFAULT_SECURITY_CONFIG } from "../security/config.js";
|
|
3
|
+
import { RecoverableToolError } from "../shared/recoverable-error.js";
|
|
4
|
+
import { launchExternalRun } from "../subagents/external/run.js";
|
|
5
|
+
import { getSubAgentRunManager } from "../subagents/runs.js";
|
|
6
|
+
import { acquireWorkspaceLease, formatWorkspaceLeaseConflict, releaseWorkspaceLease, } from "../subagents/workspace-lease.js";
|
|
7
|
+
const subagentManageSchema = Type.Object({
|
|
8
|
+
label: Type.String({ description: "Brief description of what you're checking (shown to user)" }),
|
|
9
|
+
op: Type.Union([Type.Literal("list"), Type.Literal("cancel"), Type.Literal("follow_up")], {
|
|
10
|
+
description: '"list" a snapshot of this channel\'s delegation runs, "cancel" a running one by runId, or ' +
|
|
11
|
+
'"follow_up" to continue a resumable run with a new instruction (produces a new runId).',
|
|
12
|
+
}),
|
|
13
|
+
runId: Type.Optional(Type.String({ description: "Required for cancel and follow_up." })),
|
|
14
|
+
task: Type.Optional(Type.String({ description: "Follow-up instruction. Required for op=follow_up." })),
|
|
15
|
+
});
|
|
16
|
+
function formatDuration(ms) {
|
|
17
|
+
const seconds = Math.round(ms / 1000);
|
|
18
|
+
if (seconds < 60)
|
|
19
|
+
return `${seconds}s`;
|
|
20
|
+
return `${Math.floor(seconds / 60)}m${seconds % 60}s`;
|
|
21
|
+
}
|
|
22
|
+
function formatRunLine(record) {
|
|
23
|
+
const harness = record.harness ? `${record.runtime}/${record.harness}` : record.runtime;
|
|
24
|
+
const elapsed = (record.finishedAt ?? Date.now()) - record.startedAt;
|
|
25
|
+
const task = record.taskId ? `, task ${record.taskId}` : "";
|
|
26
|
+
const lease = record.leaseKey ? ", lease held" : "";
|
|
27
|
+
return `- [${record.runId}] ${record.agent} (${harness}) — ${record.status} (${formatDuration(elapsed)}${task}${lease})`;
|
|
28
|
+
}
|
|
29
|
+
/** Resumable harnesses only: `claude-code`/`codex-cli`. `exec` has no session concept, and internal
|
|
30
|
+
* runs have no persisted transcript by design (spec 040, non-goals). */
|
|
31
|
+
function resumableHarnessOf(record) {
|
|
32
|
+
if (record.runtime !== "external")
|
|
33
|
+
return undefined;
|
|
34
|
+
return record.harness === "codex-cli" || record.harness === "claude-code" ? record.harness : undefined;
|
|
35
|
+
}
|
|
36
|
+
export function createSubAgentManageTool(options) {
|
|
37
|
+
const manager = () => getSubAgentRunManager(options.channelId);
|
|
38
|
+
return {
|
|
39
|
+
name: "subagent_manage",
|
|
40
|
+
label: "subagent_manage",
|
|
41
|
+
description: "Inspect and control delegation runs (internal sub-agents and, once configured, external agents): " +
|
|
42
|
+
"op=list shows a snapshot of this channel's runs; op=cancel stops a running one by runId without " +
|
|
43
|
+
"waking the channel (that is your own decision, not a failure); op=follow_up continues a resumable " +
|
|
44
|
+
"run with a new instruction, producing a new runId. A run finishing wakes this channel by itself, " +
|
|
45
|
+
"so never poll here waiting for one — end the turn instead.",
|
|
46
|
+
parameters: subagentManageSchema,
|
|
47
|
+
execute: async (toolCallId, { op, runId, task }) => {
|
|
48
|
+
if (op === "list") {
|
|
49
|
+
const runs = manager().list();
|
|
50
|
+
const text = runs.length === 0 ? "No delegation runs." : runs.map(formatRunLine).join("\n");
|
|
51
|
+
return { content: [{ type: "text", text }], details: { kind: "subagent_manage", op, runs } };
|
|
52
|
+
}
|
|
53
|
+
if (!runId) {
|
|
54
|
+
throw new RecoverableToolError(`${op} requires runId.`);
|
|
55
|
+
}
|
|
56
|
+
if (op === "cancel") {
|
|
57
|
+
const status = await manager().cancel(runId);
|
|
58
|
+
if (status === "not_found") {
|
|
59
|
+
throw new RecoverableToolError(`Run "${runId}" was not found on this channel.`);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: "text", text: `Cancel requested for run ${runId}: ${status}` }],
|
|
63
|
+
details: { kind: "subagent_manage", op, runId, status },
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// follow_up
|
|
67
|
+
if (!task || !task.trim()) {
|
|
68
|
+
throw new RecoverableToolError("follow_up requires task.");
|
|
69
|
+
}
|
|
70
|
+
const record = manager().get(runId);
|
|
71
|
+
if (!record) {
|
|
72
|
+
throw new RecoverableToolError(`Run "${runId}" was not found on this channel.`);
|
|
73
|
+
}
|
|
74
|
+
const harness = resumableHarnessOf(record);
|
|
75
|
+
if (!harness) {
|
|
76
|
+
// Internal runs have no persisted transcript to resume — the isolated-context design
|
|
77
|
+
// is the point, not a gap. `exec` has no session concept at all. Directing the model
|
|
78
|
+
// at a fresh delegation, not a fallback to "just use internal", keeps this honest (P2).
|
|
79
|
+
throw new RecoverableToolError(`Run "${runId}" (${record.runtime}${record.harness ? `/${record.harness}` : ""}) does not support ` +
|
|
80
|
+
"follow_up yet. Delegate a new run instead, carrying forward whatever context or prior output it needs.");
|
|
81
|
+
}
|
|
82
|
+
if (record.status === "running") {
|
|
83
|
+
throw new RecoverableToolError(`Run "${runId}" is still running; wait for it to finish before following up.`);
|
|
84
|
+
}
|
|
85
|
+
if (!record.sessionId) {
|
|
86
|
+
throw new RecoverableToolError(`Run "${runId}" never reported a session id (it likely failed before producing one); it cannot be resumed. Delegate a new run instead.`);
|
|
87
|
+
}
|
|
88
|
+
const discovery = options.getSubAgentDiscovery?.();
|
|
89
|
+
const role = discovery?.agents.find((agent) => agent.name === record.agent && agent.runtime === "external");
|
|
90
|
+
if (!role) {
|
|
91
|
+
throw new RecoverableToolError(`Role "${record.agent}" is no longer configured as an external role; cannot follow up run "${runId}".`);
|
|
92
|
+
}
|
|
93
|
+
if (role.unavailable) {
|
|
94
|
+
throw new RecoverableToolError(`Role "${record.agent}" is currently unavailable: ${role.unavailable}`);
|
|
95
|
+
}
|
|
96
|
+
let leaseKey;
|
|
97
|
+
if (role.mutates === "write") {
|
|
98
|
+
const lease = acquireWorkspaceLease({
|
|
99
|
+
runId: toolCallId,
|
|
100
|
+
channelId: options.channelId,
|
|
101
|
+
workingDirectory: record.workingDirectory,
|
|
102
|
+
});
|
|
103
|
+
if (!lease.ok) {
|
|
104
|
+
throw new RecoverableToolError(formatWorkspaceLeaseConflict(lease.heldBy));
|
|
105
|
+
}
|
|
106
|
+
leaseKey = lease.leaseKey;
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
await launchExternalRun({
|
|
110
|
+
runId: toolCallId,
|
|
111
|
+
channelId: options.channelId,
|
|
112
|
+
channelDir: options.channelDir,
|
|
113
|
+
label: `follow-up: ${task.slice(0, 80)}`,
|
|
114
|
+
agent: role.name,
|
|
115
|
+
source: role.source,
|
|
116
|
+
harness,
|
|
117
|
+
command: role.command ?? "",
|
|
118
|
+
shell: role.shell,
|
|
119
|
+
env: role.env,
|
|
120
|
+
externalModelRef: role.externalModelRef,
|
|
121
|
+
thinkingLevel: role.thinkingLevel,
|
|
122
|
+
maxWallTimeSec: role.maxWallTimeSec,
|
|
123
|
+
systemPrompt: role.systemPrompt,
|
|
124
|
+
task,
|
|
125
|
+
workingDirectory: record.workingDirectory,
|
|
126
|
+
artifactDir: record.artifactDir.replace(/[^/\\]+$/, toolCallId),
|
|
127
|
+
purpose: record.purpose,
|
|
128
|
+
taskId: record.taskId,
|
|
129
|
+
leaseKey,
|
|
130
|
+
resumeSessionId: record.sessionId,
|
|
131
|
+
mutates: role.mutates,
|
|
132
|
+
workspaceDir: options.workspaceDir ?? "",
|
|
133
|
+
securityConfig: options.securityConfig ?? DEFAULT_SECURITY_CONFIG,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
// Until launchExternalRun has durably registered the run, no settlement authority owns
|
|
138
|
+
// this lease. Releasing here mirrors the initial subagent dispatch path and covers prompt,
|
|
139
|
+
// artifact, audit, invocation, and pre-spawn failures in follow_up.
|
|
140
|
+
releaseWorkspaceLease(leaseKey);
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
content: [
|
|
145
|
+
{
|
|
146
|
+
type: "text",
|
|
147
|
+
text: `Follow-up dispatched as runId=${toolCallId} (resuming ${record.runId}). This channel will be woken when it finishes.`,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
details: { kind: "subagent_manage", op, runId: toolCallId, resumedFrom: record.runId },
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -18,7 +18,7 @@ export { RecoverableToolError } from "../shared/recoverable-error.js";
|
|
|
18
18
|
* Every tool that can appear in a tool set. Equal to the registry's tool names plus
|
|
19
19
|
* `subagent`, which is registered separately (see the note on TOOL_REGISTRY).
|
|
20
20
|
*/
|
|
21
|
-
export type ToolDetailsKind = "read" | "bash" | "edit" | "grep" | "write" | "web_search" | "web_fetch" | "send_media" | "session_search" | "memory_manage" | "skill_manage" | "event_manage" | "task_manage" | "job" | "subagent";
|
|
21
|
+
export type ToolDetailsKind = "read" | "bash" | "edit" | "grep" | "write" | "web_search" | "web_fetch" | "send_media" | "session_search" | "memory_manage" | "skill_manage" | "event_manage" | "task_manage" | "job" | "subagent" | "subagent_manage";
|
|
22
22
|
/** The fields every tool result's `details` carries. Tool-specific fields extend this. */
|
|
23
23
|
export interface ToolDetails {
|
|
24
24
|
/** Which tool produced this result. Stamped by `withToolDetails`; never written by hand. */
|
package/dist/tui/app.js
CHANGED
|
@@ -17,6 +17,7 @@ import { ensureChannelDir } from "../runtime/channel-paths.js";
|
|
|
17
17
|
import { finalDeliveryOf, progressStyleOf } from "../runtime/dingtalk.js";
|
|
18
18
|
import { handleEventsCommand } from "../runtime/event-commands.js";
|
|
19
19
|
import { ChannelStore } from "../runtime/store.js";
|
|
20
|
+
import { handleSubagentsCommand } from "../runtime/subagent-commands.js";
|
|
20
21
|
import { handleTasksCommand } from "../runtime/task-commands.js";
|
|
21
22
|
import { flushSecurityLogs } from "../security/logger.js";
|
|
22
23
|
import { getUsageLedger } from "../usage/ledger.js";
|
|
@@ -111,6 +112,7 @@ export async function runTuiApp(options) {
|
|
|
111
112
|
workspaceDir: paths.workspaceDir,
|
|
112
113
|
channelId,
|
|
113
114
|
}),
|
|
115
|
+
runSubagents: (args) => handleSubagentsCommand({ args, channelId, discovery: runner.getSubAgentDiscoverySnapshot() }),
|
|
114
116
|
statusInfo: { version: readCliVersion(), startedAt: Date.now() },
|
|
115
117
|
});
|
|
116
118
|
try {
|
package/dist/tui/commands.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface DispatchDeps {
|
|
|
39
39
|
renderUsage(args: string): Promise<string>;
|
|
40
40
|
runEvents(args: string): Promise<string>;
|
|
41
41
|
runTasks(args: string): Promise<string>;
|
|
42
|
+
runSubagents(args: string): Promise<string>;
|
|
42
43
|
}
|
|
43
44
|
export declare function dispatch(input: string, deps: DispatchDeps): Promise<DispatchOutcome>;
|
|
44
45
|
/**
|