@leuduan/lagent 0.0.0-stage → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +16 -0
- package/README.md +144 -2
- package/dist/chunks/2O7ZGEIT.js +1 -0
- package/dist/chunks/2OSESBIL.js +1 -0
- package/dist/chunks/34KW6VNQ.js +1 -0
- package/dist/chunks/37YOGDGY.js +1 -0
- package/dist/chunks/3LQHQRIU.js +6 -0
- package/dist/chunks/3QCW4WDJ.js +1 -0
- package/dist/chunks/4XVRUSCQ.js +1 -0
- package/dist/chunks/6ECI2GGV.js +1 -0
- package/dist/chunks/74HKUGRR.js +1 -0
- package/dist/chunks/ADHERZLW.js +2 -0
- package/dist/chunks/AP6Q4EPT.js +36 -0
- package/dist/chunks/BM3S37EZ.js +1 -0
- package/dist/chunks/C5LYCXJG.js +1 -0
- package/dist/chunks/CDQG7RKA.js +1 -0
- package/dist/chunks/D7E6EWIE.js +3 -0
- package/dist/chunks/DDANMY45.js +3 -0
- package/dist/chunks/DRYAN665.js +1 -0
- package/dist/chunks/DXFXAYDN.js +17 -0
- package/dist/chunks/EGZI4XQX.js +24 -0
- package/dist/chunks/ENWFSU27.js +41 -0
- package/dist/chunks/G6RXC3AL.js +1 -0
- package/dist/chunks/G74AGRAJ.js +15 -0
- package/dist/chunks/GQGNVSKB.js +1 -0
- package/dist/chunks/IJ2WNMD5.js +7 -0
- package/dist/chunks/J5S4URAW.js +1 -0
- package/dist/chunks/JPZFKSWT.js +1 -0
- package/dist/chunks/KESCTXGO.js +5 -0
- package/dist/chunks/L3N4FIEN.js +1 -0
- package/dist/chunks/NAOUTU7A.js +4 -0
- package/dist/chunks/NDIM7MEW.js +1 -0
- package/dist/chunks/O4PPOM5Z.js +2 -0
- package/dist/chunks/OVZFGILJ.js +1 -0
- package/dist/chunks/P5ZHHOOM.js +6 -0
- package/dist/chunks/PUSUPTAT.js +1 -0
- package/dist/chunks/QMMLQJBS.js +1 -0
- package/dist/chunks/RK3VP2Q4.js +3 -0
- package/dist/chunks/SGGMBSBA.js +1 -0
- package/dist/chunks/SL2YLB2F.js +1 -0
- package/dist/chunks/TOOIB6J2.js +1 -0
- package/dist/chunks/TYTQRLTX.js +1 -0
- package/dist/chunks/UC3FVVJ2.js +5 -0
- package/dist/chunks/UCTEU62F.js +1 -0
- package/dist/chunks/UD3VJER6.js +1 -0
- package/dist/chunks/UKXMCHHT.js +1 -0
- package/dist/chunks/WUUKTSRT.js +7 -0
- package/dist/chunks/X65X4KP5.js +7 -0
- package/dist/chunks/YIR5MYGU.js +1 -0
- package/dist/chunks/YLNJXQ3Z.js +1 -0
- package/dist/context.d.ts +101 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +77 -0
- package/dist/journal/catalog.d.ts +112 -0
- package/dist/journal/forkChain.d.ts +16 -0
- package/dist/journal/index.d.ts +15 -0
- package/dist/journal/journal.d.ts +475 -0
- package/dist/journal/projection.d.ts +87 -0
- package/dist/journal/store.d.ts +181 -0
- package/dist/kit/claim.d.ts +13 -0
- package/dist/kit/drain.d.ts +10 -0
- package/dist/kit/extension.d.ts +180 -0
- package/dist/kit/grants.d.ts +9 -0
- package/dist/kit/modes.d.ts +65 -0
- package/dist/kit/retries.d.ts +25 -0
- package/dist/kit/scope.d.ts +32 -0
- package/dist/kit/service.d.ts +7 -0
- package/dist/kit/strategy.d.ts +10 -0
- package/dist/kit/timers.d.ts +43 -0
- package/dist/kit/tool.d.ts +72 -0
- package/dist/llm/client.d.ts +135 -0
- package/dist/llm/content.d.ts +52 -0
- package/dist/llm/door.d.ts +21 -0
- package/dist/llm/door.js +1 -0
- package/dist/llm/failure.d.ts +82 -0
- package/dist/llm/index.d.ts +16 -0
- package/dist/llm/primitives.d.ts +286 -0
- package/dist/llm/prompt.d.ts +21 -0
- package/dist/llm/provider.d.ts +63 -0
- package/dist/llm/readLedger.d.ts +24 -0
- package/dist/llm/request.d.ts +58 -0
- package/dist/loop/agent.d.ts +134 -0
- package/dist/loop/auxiliary.d.ts +54 -0
- package/dist/loop/chain.d.ts +46 -0
- package/dist/loop/chunks.d.ts +27 -0
- package/dist/loop/continuation.d.ts +166 -0
- package/dist/loop/decide.d.ts +64 -0
- package/dist/loop/errors.d.ts +162 -0
- package/dist/loop/forks.d.ts +61 -0
- package/dist/loop/holds.d.ts +104 -0
- package/dist/loop/hooks.d.ts +241 -0
- package/dist/loop/inbox.d.ts +188 -0
- package/dist/loop/index.d.ts +37 -0
- package/dist/loop/limits.d.ts +14 -0
- package/dist/loop/opening.d.ts +42 -0
- package/dist/loop/prepare.d.ts +30 -0
- package/dist/loop/projections.d.ts +307 -0
- package/dist/loop/replace.d.ts +33 -0
- package/dist/loop/requests.d.ts +129 -0
- package/dist/loop/route.d.ts +53 -0
- package/dist/loop/runtime.d.ts +85 -0
- package/dist/loop/state.d.ts +70 -0
- package/dist/loop/strategy.d.ts +71 -0
- package/dist/loop/summary.d.ts +3 -0
- package/dist/loop/surface.d.ts +153 -0
- package/dist/loop/threadState.d.ts +72 -0
- package/dist/loop/tool.d.ts +101 -0
- package/dist/loop/toolCalls.d.ts +42 -0
- package/dist/loop/wake.d.ts +32 -0
- package/dist/models/config/agent.d.ts +18 -0
- package/dist/models/config/prompt.d.ts +18 -0
- package/dist/models/door.d.ts +12 -0
- package/dist/models/door.js +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/jsonSchema.d.ts +7 -0
- package/dist/models/wire/journal.d.ts +2772 -0
- package/dist/models/wire/primitives.d.ts +65 -0
- package/dist/plugin.d.ts +53 -0
- package/dist/plugin.js +1 -0
- package/dist/plugins/agentsMd.d.ts +76 -0
- package/dist/plugins/agentsMd.js +1 -0
- package/dist/plugins/ask/askQuestion.d.ts +9 -0
- package/dist/plugins/ask/index.d.ts +26 -0
- package/dist/plugins/ask/index.js +1 -0
- package/dist/plugins/ask/service.d.ts +125 -0
- package/dist/plugins/commands/background.d.ts +8 -0
- package/dist/plugins/commands/foreground.d.ts +4 -0
- package/dist/plugins/commands/index.d.ts +40 -0
- package/dist/plugins/commands/index.js +1 -0
- package/dist/plugins/commands/output.d.ts +115 -0
- package/dist/plugins/commands/record.d.ts +549 -0
- package/dist/plugins/commands/service.d.ts +314 -0
- package/dist/plugins/commands/shell.d.ts +25 -0
- package/dist/plugins/compaction/checkpoint.d.ts +91 -0
- package/dist/plugins/compaction/config.d.ts +133 -0
- package/dist/plugins/compaction/estimate.d.ts +29 -0
- package/dist/plugins/compaction/index.d.ts +2 -0
- package/dist/plugins/compaction/index.js +7 -0
- package/dist/plugins/compaction/log.d.ts +61 -0
- package/dist/plugins/compaction/planner.d.ts +207 -0
- package/dist/plugins/compaction/preset.d.ts +86 -0
- package/dist/plugins/compaction/prune.d.ts +9 -0
- package/dist/plugins/compaction/records.d.ts +227 -0
- package/dist/plugins/compaction/segments.d.ts +23 -0
- package/dist/plugins/compaction/shared.d.ts +14 -0
- package/dist/plugins/compaction/summarize.d.ts +13 -0
- package/dist/plugins/dateAndBranch.d.ts +47 -0
- package/dist/plugins/dateAndBranch.js +1 -0
- package/dist/plugins/delegations/answers.d.ts +39 -0
- package/dist/plugins/delegations/assignmentKey.d.ts +22 -0
- package/dist/plugins/delegations/cleanup.d.ts +161 -0
- package/dist/plugins/delegations/constraint.d.ts +76 -0
- package/dist/plugins/delegations/index.d.ts +39 -0
- package/dist/plugins/delegations/index.js +1 -0
- package/dist/plugins/delegations/notices.d.ts +261 -0
- package/dist/plugins/delegations/obligations.d.ts +210 -0
- package/dist/plugins/delegations/record.d.ts +632 -0
- package/dist/plugins/delegations/request.d.ts +381 -0
- package/dist/plugins/delegations/role.d.ts +30 -0
- package/dist/plugins/delegations/service.d.ts +562 -0
- package/dist/plugins/delegations/standing.d.ts +19 -0
- package/dist/plugins/delegations/stopCheck.d.ts +21 -0
- package/dist/plugins/delegations/testing.d.ts +16 -0
- package/dist/plugins/delegations/tools.d.ts +71 -0
- package/dist/plugins/delegations/waitBook.d.ts +116 -0
- package/dist/plugins/delegations/waits.d.ts +118 -0
- package/dist/plugins/diagnostics/digest.d.ts +14 -0
- package/dist/plugins/diagnostics/index.d.ts +68 -0
- package/dist/plugins/diagnostics/index.js +1 -0
- package/dist/plugins/historyRecall/history.d.ts +9 -0
- package/dist/plugins/historyRecall/index.d.ts +31 -0
- package/dist/plugins/historyRecall/index.js +1 -0
- package/dist/plugins/historyRecall/render.d.ts +34 -0
- package/dist/plugins/historyRecall/tools.d.ts +4 -0
- package/dist/plugins/mcp/catalog.d.ts +36 -0
- package/dist/plugins/mcp/config.d.ts +63 -0
- package/dist/plugins/mcp/connection.d.ts +53 -0
- package/dist/plugins/mcp/errors.d.ts +32 -0
- package/dist/plugins/mcp/index.d.ts +33 -0
- package/dist/plugins/mcp/index.js +5 -0
- package/dist/plugins/mcp/mount.d.ts +98 -0
- package/dist/plugins/mcp/names.d.ts +25 -0
- package/dist/plugins/mcp/render.d.ts +29 -0
- package/dist/plugins/mcp/slots.d.ts +15 -0
- package/dist/plugins/mcp/stdio.d.ts +49 -0
- package/dist/plugins/mcp/tool.d.ts +41 -0
- package/dist/plugins/providers/anthropic.d.ts +175 -0
- package/dist/plugins/providers/anthropicMessages.d.ts +65 -0
- package/dist/plugins/providers/codex.d.ts +60 -0
- package/dist/plugins/providers/codexAuth.d.ts +116 -0
- package/dist/plugins/providers/deepseek.d.ts +55 -0
- package/dist/plugins/providers/door.d.ts +61 -0
- package/dist/plugins/providers/door.js +1 -0
- package/dist/plugins/providers/failure.d.ts +23 -0
- package/dist/plugins/providers/gateway.d.ts +23 -0
- package/dist/plugins/providers/index.d.ts +6 -0
- package/dist/plugins/providers/openaiChat.d.ts +62 -0
- package/dist/plugins/providers/openaiResponses.d.ts +100 -0
- package/dist/plugins/providers/opencodeCopilot.d.ts +23 -0
- package/dist/plugins/providers/opencodeGo.d.ts +98 -0
- package/dist/plugins/providers/shared.d.ts +104 -0
- package/dist/plugins/providers/stream.d.ts +154 -0
- package/dist/plugins/routeContext.d.ts +22 -0
- package/dist/plugins/routeContext.js +1 -0
- package/dist/plugins/schedules/index.d.ts +21 -0
- package/dist/plugins/schedules/index.js +5 -0
- package/dist/plugins/schedules/record.d.ts +396 -0
- package/dist/plugins/schedules/service.d.ts +120 -0
- package/dist/plugins/schedules/time.d.ts +26 -0
- package/dist/plugins/schedules/tools.d.ts +6 -0
- package/dist/plugins/skills/discovery.d.ts +54 -0
- package/dist/plugins/skills/index.d.ts +31 -0
- package/dist/plugins/skills/index.js +1 -0
- package/dist/plugins/skills/tool.d.ts +11 -0
- package/dist/plugins/store/durableObject.d.ts +23 -0
- package/dist/plugins/store/durableObject.js +1 -0
- package/dist/plugins/store/durableObjectConnection.d.ts +27 -0
- package/dist/plugins/store/memory.d.ts +29 -0
- package/dist/plugins/store/sql.d.ts +59 -0
- package/dist/plugins/store/sqlite.d.ts +31 -0
- package/dist/plugins/store/sqlite.js +1 -0
- package/dist/plugins/subAgents/availableRoutes.d.ts +53 -0
- package/dist/plugins/subAgents/fork.d.ts +32 -0
- package/dist/plugins/subAgents/index.d.ts +67 -0
- package/dist/plugins/subAgents/index.js +1 -0
- package/dist/plugins/subAgents/tool.d.ts +38 -0
- package/dist/plugins/toolPolicy/index.d.ts +61 -0
- package/dist/plugins/toolPolicy/index.js +1 -0
- package/dist/plugins/tools/editFiles.d.ts +128 -0
- package/dist/plugins/tools/fsRead.d.ts +17 -0
- package/dist/plugins/tools/html.d.ts +23 -0
- package/dist/plugins/tools/index.d.ts +59 -0
- package/dist/plugins/tools/index.js +1 -0
- package/dist/plugins/tools/network.d.ts +23 -0
- package/dist/plugins/tools/ripgrep.d.ts +20 -0
- package/dist/plugins/tools/textEdit.d.ts +67 -0
- package/dist/plugins/tools/web.d.ts +32 -0
- package/dist/plugins/truncateToolOutput.d.ts +26 -0
- package/dist/plugins/truncateToolOutput.js +1 -0
- package/dist/plugins/usage/index.d.ts +24 -0
- package/dist/plugins/usage/index.js +1 -0
- package/dist/plugins/usage/tracker.d.ts +34 -0
- package/dist/plugins/verify/facts.d.ts +356 -0
- package/dist/plugins/verify/index.d.ts +75 -0
- package/dist/plugins/verify/index.js +1 -0
- package/dist/plugins/verify/service.d.ts +90 -0
- package/dist/plugins/workflows/assignment.d.ts +16 -0
- package/dist/plugins/workflows/bindings.d.ts +95 -0
- package/dist/plugins/workflows/cleanup.d.ts +38 -0
- package/dist/plugins/workflows/definition.d.ts +184 -0
- package/dist/plugins/workflows/fold.d.ts +373 -0
- package/dist/plugins/workflows/index.d.ts +28 -0
- package/dist/plugins/workflows/index.js +6 -0
- package/dist/plugins/workflows/observations.d.ts +81 -0
- package/dist/plugins/workflows/participants.d.ts +143 -0
- package/dist/plugins/workflows/policy.d.ts +112 -0
- package/dist/plugins/workflows/providers.d.ts +146 -0
- package/dist/plugins/workflows/record.d.ts +2863 -0
- package/dist/plugins/workflows/routing.d.ts +116 -0
- package/dist/plugins/workflows/schema.d.ts +26 -0
- package/dist/plugins/workflows/service.d.ts +477 -0
- package/dist/plugins/workflows/submit.d.ts +8 -0
- package/dist/plugins/workflows/view.d.ts +103 -0
- package/dist/plugins/workflows/work.d.ts +21 -0
- package/dist/plugins/workspaceContext.d.ts +38 -0
- package/dist/plugins/workspaceContext.js +1 -0
- package/dist/presets/agents.d.ts +7 -0
- package/dist/presets/base.d.ts +10 -0
- package/dist/presets/codex.d.ts +60 -0
- package/dist/presets/index.d.ts +4 -0
- package/dist/presets/prompts.d.ts +56 -0
- package/dist/sandbox/absent.d.ts +32 -0
- package/dist/sandbox/client.d.ts +39 -0
- package/dist/sandbox/files.d.ts +28 -0
- package/dist/sandbox/index.d.ts +49 -0
- package/dist/sandbox/index.js +4 -0
- package/dist/sandbox/mode.d.ts +57 -0
- package/dist/sandbox/policy.d.ts +86 -0
- package/dist/sandbox/protocol.d.ts +107 -0
- package/dist/sandbox/service.d.ts +143 -0
- package/dist/sandbox/worker.d.ts +12 -0
- package/dist/sandbox/worker.js +1 -0
- package/dist/services/admission.d.ts +174 -0
- package/dist/services/agents.d.ts +37 -0
- package/dist/services/birth.d.ts +220 -0
- package/dist/services/contributions.d.ts +73 -0
- package/dist/services/core.d.ts +34 -0
- package/dist/services/journal.d.ts +26 -0
- package/dist/services/launches.d.ts +104 -0
- package/dist/services/llm.d.ts +80 -0
- package/dist/services/owner.d.ts +367 -0
- package/dist/services/preset.d.ts +154 -0
- package/dist/services/presets.d.ts +139 -0
- package/dist/services/prompts.d.ts +67 -0
- package/dist/services/runEvents.d.ts +79 -0
- package/dist/services/thread.d.ts +267 -0
- package/dist/services/threadActivation.d.ts +100 -0
- package/dist/services/threadDirs.d.ts +38 -0
- package/dist/services/threadView.d.ts +92 -0
- package/dist/services/threads.d.ts +449 -0
- package/dist/services/tools.d.ts +41 -0
- package/dist/sys/environment.d.ts +47 -0
- package/dist/sys/git.d.ts +60 -0
- package/dist/sys/paths.d.ts +56 -0
- package/dist/sys/spawn.d.ts +176 -0
- package/dist/testing/clock.d.ts +17 -0
- package/dist/testing/fakeLlm.d.ts +74 -0
- package/dist/testing/fedLlm.d.ts +32 -0
- package/dist/testing/helpers.d.ts +344 -0
- package/dist/testing/index.d.ts +13 -0
- package/dist/testing/index.js +1 -0
- package/dist/testing/processes.d.ts +13 -0
- package/dist/testing/sandbox.d.ts +71 -0
- package/dist/testing/settlement.d.ts +6 -0
- package/dist/testing/tmpDirs.d.ts +17 -0
- package/dist/util/async.d.ts +8 -0
- package/dist/util/diff.d.ts +25 -0
- package/dist/util/dispatch.d.ts +8 -0
- package/dist/util/errors.d.ts +28 -0
- package/dist/util/foldState.d.ts +17 -0
- package/dist/util/freeze.d.ts +2 -0
- package/dist/util/ids.d.ts +2 -0
- package/dist/util/json.d.ts +37 -0
- package/dist/util/log.d.ts +6 -0
- package/dist/util/text.d.ts +21 -0
- package/dist/util/version.d.ts +2 -0
- package/package.json +175 -3
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type ExtensionRecord, type Seq } from '../../models/index.js';
|
|
3
|
+
import type { DeepReadonly } from '../../util/json.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the journal keeps of a background command, so that a lagent process that did not start it
|
|
6
|
+
* can still say what it knows: that it was started, by whom and where, and whether and how it
|
|
7
|
+
* ended. Written by the commands plugin as `ext` rows of its own identity.
|
|
8
|
+
*
|
|
9
|
+
* The start row is written while the spawned group is still held at its startup gate, before the
|
|
10
|
+
* command runs, so no command ever runs unlisted; it says the command *may have started*, since the
|
|
11
|
+
* process can die after the row and before the gate opens. The end row is written when the plugin
|
|
12
|
+
* sees the command settle, and carries whether the stop succeeded: a settled wait does not prove
|
|
13
|
+
* the group is gone. A notifying command's natural exit writes its end row in the group of the
|
|
14
|
+
* notice that tells the thread (`commandNotice`).
|
|
15
|
+
*/
|
|
16
|
+
declare const CommandRowSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
op: z.ZodLiteral<"started">;
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
call_seq: z.ZodNumber;
|
|
20
|
+
command: z.ZodString;
|
|
21
|
+
cwd: z.ZodString;
|
|
22
|
+
pgid: z.ZodNumber;
|
|
23
|
+
started_at: z.ZodString;
|
|
24
|
+
owner: z.ZodString;
|
|
25
|
+
notify: z.ZodNullable<z.ZodEnum<{
|
|
26
|
+
exit: "exit";
|
|
27
|
+
}>>;
|
|
28
|
+
launch: z.ZodNullable<z.ZodObject<{
|
|
29
|
+
launcher: z.ZodString;
|
|
30
|
+
version: z.ZodString;
|
|
31
|
+
policy: z.ZodString;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
34
|
+
op: z.ZodLiteral<"ended">;
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
exit_code: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
exit_signal: z.ZodNullable<z.ZodString>;
|
|
38
|
+
stopped_by: z.ZodNullable<z.ZodEnum<{
|
|
39
|
+
abort: "abort";
|
|
40
|
+
timeout: "timeout";
|
|
41
|
+
stop: "stop";
|
|
42
|
+
}>>;
|
|
43
|
+
stop_failed: z.ZodBoolean;
|
|
44
|
+
stop_reason: z.ZodNullable<z.ZodString>;
|
|
45
|
+
ended_at: z.ZodString;
|
|
46
|
+
}, z.core.$strict>], "op">;
|
|
47
|
+
export type CommandRow = z.output<typeof CommandRowSchema>;
|
|
48
|
+
export type CommandStarted = Extract<CommandRow, {
|
|
49
|
+
op: 'started';
|
|
50
|
+
}>;
|
|
51
|
+
export type CommandEnded = Extract<CommandRow, {
|
|
52
|
+
op: 'ended';
|
|
53
|
+
}>;
|
|
54
|
+
export declare const commandRow: {
|
|
55
|
+
record: (value: {
|
|
56
|
+
op: "started";
|
|
57
|
+
id: string;
|
|
58
|
+
call_seq: number;
|
|
59
|
+
command: string;
|
|
60
|
+
cwd: string;
|
|
61
|
+
pgid: number;
|
|
62
|
+
started_at: string;
|
|
63
|
+
owner: string;
|
|
64
|
+
notify: "exit" | null;
|
|
65
|
+
launch: {
|
|
66
|
+
launcher: string;
|
|
67
|
+
version: string;
|
|
68
|
+
policy: string;
|
|
69
|
+
} | null;
|
|
70
|
+
} | {
|
|
71
|
+
op: "ended";
|
|
72
|
+
id: string;
|
|
73
|
+
exit_code: number | null;
|
|
74
|
+
exit_signal: string | null;
|
|
75
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
76
|
+
stop_failed: boolean;
|
|
77
|
+
stop_reason: string | null;
|
|
78
|
+
ended_at: string;
|
|
79
|
+
}) => ExtensionRecord;
|
|
80
|
+
parse: (value: {
|
|
81
|
+
op: "started";
|
|
82
|
+
id: string;
|
|
83
|
+
call_seq: number;
|
|
84
|
+
command: string;
|
|
85
|
+
cwd: string;
|
|
86
|
+
pgid: number;
|
|
87
|
+
started_at: string;
|
|
88
|
+
owner: string;
|
|
89
|
+
notify: "exit" | null;
|
|
90
|
+
launch: {
|
|
91
|
+
launcher: string;
|
|
92
|
+
version: string;
|
|
93
|
+
policy: string;
|
|
94
|
+
} | null;
|
|
95
|
+
} | {
|
|
96
|
+
op: "ended";
|
|
97
|
+
id: string;
|
|
98
|
+
exit_code: number | null;
|
|
99
|
+
exit_signal: string | null;
|
|
100
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
101
|
+
stop_failed: boolean;
|
|
102
|
+
stop_reason: string | null;
|
|
103
|
+
ended_at: string;
|
|
104
|
+
}) => {
|
|
105
|
+
op: "started";
|
|
106
|
+
id: string;
|
|
107
|
+
call_seq: number;
|
|
108
|
+
command: string;
|
|
109
|
+
cwd: string;
|
|
110
|
+
pgid: number;
|
|
111
|
+
started_at: string;
|
|
112
|
+
owner: string;
|
|
113
|
+
notify: "exit" | null;
|
|
114
|
+
launch: {
|
|
115
|
+
launcher: string;
|
|
116
|
+
version: string;
|
|
117
|
+
policy: string;
|
|
118
|
+
} | null;
|
|
119
|
+
} | {
|
|
120
|
+
op: "ended";
|
|
121
|
+
id: string;
|
|
122
|
+
exit_code: number | null;
|
|
123
|
+
exit_signal: string | null;
|
|
124
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
125
|
+
stop_failed: boolean;
|
|
126
|
+
stop_reason: string | null;
|
|
127
|
+
ended_at: string;
|
|
128
|
+
};
|
|
129
|
+
entry: (value: {
|
|
130
|
+
op: "started";
|
|
131
|
+
id: string;
|
|
132
|
+
call_seq: number;
|
|
133
|
+
command: string;
|
|
134
|
+
cwd: string;
|
|
135
|
+
pgid: number;
|
|
136
|
+
started_at: string;
|
|
137
|
+
owner: string;
|
|
138
|
+
notify: "exit" | null;
|
|
139
|
+
launch: {
|
|
140
|
+
launcher: string;
|
|
141
|
+
version: string;
|
|
142
|
+
policy: string;
|
|
143
|
+
} | null;
|
|
144
|
+
} | {
|
|
145
|
+
op: "ended";
|
|
146
|
+
id: string;
|
|
147
|
+
exit_code: number | null;
|
|
148
|
+
exit_signal: string | null;
|
|
149
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
150
|
+
stop_failed: boolean;
|
|
151
|
+
stop_reason: string | null;
|
|
152
|
+
ended_at: string;
|
|
153
|
+
}, options: import("../../journal/journal.js").AppendOptions) => {
|
|
154
|
+
type: "ext";
|
|
155
|
+
data: {
|
|
156
|
+
plugin: string;
|
|
157
|
+
instance_id: string;
|
|
158
|
+
kind: string;
|
|
159
|
+
version: number;
|
|
160
|
+
data: z.core.util.JSONType;
|
|
161
|
+
};
|
|
162
|
+
options: import("../../journal/journal.js").AppendOptions;
|
|
163
|
+
};
|
|
164
|
+
append(journal: import("../../journal/journal.js").PluginJournal, value: {
|
|
165
|
+
op: "started";
|
|
166
|
+
id: string;
|
|
167
|
+
call_seq: number;
|
|
168
|
+
command: string;
|
|
169
|
+
cwd: string;
|
|
170
|
+
pgid: number;
|
|
171
|
+
started_at: string;
|
|
172
|
+
owner: string;
|
|
173
|
+
notify: "exit" | null;
|
|
174
|
+
launch: {
|
|
175
|
+
launcher: string;
|
|
176
|
+
version: string;
|
|
177
|
+
policy: string;
|
|
178
|
+
} | null;
|
|
179
|
+
} | {
|
|
180
|
+
op: "ended";
|
|
181
|
+
id: string;
|
|
182
|
+
exit_code: number | null;
|
|
183
|
+
exit_signal: string | null;
|
|
184
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
185
|
+
stop_failed: boolean;
|
|
186
|
+
stop_reason: string | null;
|
|
187
|
+
ended_at: string;
|
|
188
|
+
}, options: import("../../journal/journal.js").AppendOptions): Promise<import("../../models/index.js").JournalEvent<"ext">>;
|
|
189
|
+
read(event: import("../../models/index.js").JournalEvent): {
|
|
190
|
+
op: "started";
|
|
191
|
+
id: string;
|
|
192
|
+
call_seq: number;
|
|
193
|
+
command: string;
|
|
194
|
+
cwd: string;
|
|
195
|
+
pgid: number;
|
|
196
|
+
started_at: string;
|
|
197
|
+
owner: string;
|
|
198
|
+
notify: "exit" | null;
|
|
199
|
+
launch: {
|
|
200
|
+
launcher: string;
|
|
201
|
+
version: string;
|
|
202
|
+
policy: string;
|
|
203
|
+
} | null;
|
|
204
|
+
} | {
|
|
205
|
+
op: "ended";
|
|
206
|
+
id: string;
|
|
207
|
+
exit_code: number | null;
|
|
208
|
+
exit_signal: string | null;
|
|
209
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
210
|
+
stop_failed: boolean;
|
|
211
|
+
stop_reason: string | null;
|
|
212
|
+
ended_at: string;
|
|
213
|
+
} | undefined;
|
|
214
|
+
contribution(message: {
|
|
215
|
+
role?: import("../../models/index.js").InputRole;
|
|
216
|
+
content: string | readonly import("../../llm/content.js").ContentPartInput[];
|
|
217
|
+
}, value: {
|
|
218
|
+
op: "started";
|
|
219
|
+
id: string;
|
|
220
|
+
call_seq: number;
|
|
221
|
+
command: string;
|
|
222
|
+
cwd: string;
|
|
223
|
+
pgid: number;
|
|
224
|
+
started_at: string;
|
|
225
|
+
owner: string;
|
|
226
|
+
notify: "exit" | null;
|
|
227
|
+
launch: {
|
|
228
|
+
launcher: string;
|
|
229
|
+
version: string;
|
|
230
|
+
policy: string;
|
|
231
|
+
} | null;
|
|
232
|
+
} | {
|
|
233
|
+
op: "ended";
|
|
234
|
+
id: string;
|
|
235
|
+
exit_code: number | null;
|
|
236
|
+
exit_signal: string | null;
|
|
237
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
238
|
+
stop_failed: boolean;
|
|
239
|
+
stop_reason: string | null;
|
|
240
|
+
ended_at: string;
|
|
241
|
+
}, options?: {
|
|
242
|
+
sourceSeqs?: readonly Seq[];
|
|
243
|
+
}): import("../../models/index.js").StepContribution;
|
|
244
|
+
matchesSource(record: DeepReadonly<ExtensionRecord>): boolean;
|
|
245
|
+
rejection(reason: string, value: {
|
|
246
|
+
op: "started";
|
|
247
|
+
id: string;
|
|
248
|
+
call_seq: number;
|
|
249
|
+
command: string;
|
|
250
|
+
cwd: string;
|
|
251
|
+
pgid: number;
|
|
252
|
+
started_at: string;
|
|
253
|
+
owner: string;
|
|
254
|
+
notify: "exit" | null;
|
|
255
|
+
launch: {
|
|
256
|
+
launcher: string;
|
|
257
|
+
version: string;
|
|
258
|
+
policy: string;
|
|
259
|
+
} | null;
|
|
260
|
+
} | {
|
|
261
|
+
op: "ended";
|
|
262
|
+
id: string;
|
|
263
|
+
exit_code: number | null;
|
|
264
|
+
exit_signal: string | null;
|
|
265
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
266
|
+
stop_failed: boolean;
|
|
267
|
+
stop_reason: string | null;
|
|
268
|
+
ended_at: string;
|
|
269
|
+
}): {
|
|
270
|
+
decision: "reject";
|
|
271
|
+
reason: string;
|
|
272
|
+
source: ExtensionRecord;
|
|
273
|
+
};
|
|
274
|
+
readContribution: (event: import("../../models/index.js").JournalEvent) => {
|
|
275
|
+
op: "started";
|
|
276
|
+
id: string;
|
|
277
|
+
call_seq: number;
|
|
278
|
+
command: string;
|
|
279
|
+
cwd: string;
|
|
280
|
+
pgid: number;
|
|
281
|
+
started_at: string;
|
|
282
|
+
owner: string;
|
|
283
|
+
notify: "exit" | null;
|
|
284
|
+
launch: {
|
|
285
|
+
launcher: string;
|
|
286
|
+
version: string;
|
|
287
|
+
policy: string;
|
|
288
|
+
} | null;
|
|
289
|
+
} | {
|
|
290
|
+
op: "ended";
|
|
291
|
+
id: string;
|
|
292
|
+
exit_code: number | null;
|
|
293
|
+
exit_signal: string | null;
|
|
294
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
295
|
+
stop_failed: boolean;
|
|
296
|
+
stop_reason: string | null;
|
|
297
|
+
ended_at: string;
|
|
298
|
+
} | undefined;
|
|
299
|
+
readSource: (source: DeepReadonly<ExtensionRecord> | null) => {
|
|
300
|
+
op: "started";
|
|
301
|
+
id: string;
|
|
302
|
+
call_seq: number;
|
|
303
|
+
command: string;
|
|
304
|
+
cwd: string;
|
|
305
|
+
pgid: number;
|
|
306
|
+
started_at: string;
|
|
307
|
+
owner: string;
|
|
308
|
+
notify: "exit" | null;
|
|
309
|
+
launch: {
|
|
310
|
+
launcher: string;
|
|
311
|
+
version: string;
|
|
312
|
+
policy: string;
|
|
313
|
+
} | null;
|
|
314
|
+
} | {
|
|
315
|
+
op: "ended";
|
|
316
|
+
id: string;
|
|
317
|
+
exit_code: number | null;
|
|
318
|
+
exit_signal: string | null;
|
|
319
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
320
|
+
stop_failed: boolean;
|
|
321
|
+
stop_reason: string | null;
|
|
322
|
+
ended_at: string;
|
|
323
|
+
} | undefined;
|
|
324
|
+
told: import("../../journal/projection.js").PluginProjection<import("../../kit/extension.js").ToldNotices<{
|
|
325
|
+
op: "started";
|
|
326
|
+
id: string;
|
|
327
|
+
call_seq: number;
|
|
328
|
+
command: string;
|
|
329
|
+
cwd: string;
|
|
330
|
+
pgid: number;
|
|
331
|
+
started_at: string;
|
|
332
|
+
owner: string;
|
|
333
|
+
notify: "exit" | null;
|
|
334
|
+
launch: {
|
|
335
|
+
launcher: string;
|
|
336
|
+
version: string;
|
|
337
|
+
policy: string;
|
|
338
|
+
} | null;
|
|
339
|
+
} | {
|
|
340
|
+
op: "ended";
|
|
341
|
+
id: string;
|
|
342
|
+
exit_code: number | null;
|
|
343
|
+
exit_signal: string | null;
|
|
344
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
345
|
+
stop_failed: boolean;
|
|
346
|
+
stop_reason: string | null;
|
|
347
|
+
ended_at: string;
|
|
348
|
+
}>>;
|
|
349
|
+
projection<State>(fold: {
|
|
350
|
+
key: string;
|
|
351
|
+
init(): State;
|
|
352
|
+
apply(state: State, value: {
|
|
353
|
+
op: "started";
|
|
354
|
+
id: string;
|
|
355
|
+
call_seq: number;
|
|
356
|
+
command: string;
|
|
357
|
+
cwd: string;
|
|
358
|
+
pgid: number;
|
|
359
|
+
started_at: string;
|
|
360
|
+
owner: string;
|
|
361
|
+
notify: "exit" | null;
|
|
362
|
+
launch: {
|
|
363
|
+
launcher: string;
|
|
364
|
+
version: string;
|
|
365
|
+
policy: string;
|
|
366
|
+
} | null;
|
|
367
|
+
} | {
|
|
368
|
+
op: "ended";
|
|
369
|
+
id: string;
|
|
370
|
+
exit_code: number | null;
|
|
371
|
+
exit_signal: string | null;
|
|
372
|
+
stopped_by: "abort" | "timeout" | "stop" | null;
|
|
373
|
+
stop_failed: boolean;
|
|
374
|
+
stop_reason: string | null;
|
|
375
|
+
ended_at: string;
|
|
376
|
+
}, event: import("../../models/index.js").JournalEvent<"ext">): State;
|
|
377
|
+
onFork?: "inherit" | "reset";
|
|
378
|
+
}): import("../../journal/projection.js").PluginProjection<State>;
|
|
379
|
+
};
|
|
380
|
+
/** One recorded command: how it started, and how it ended if the plugin saw it end. */
|
|
381
|
+
export type CommandRecord = {
|
|
382
|
+
readonly started: CommandStarted;
|
|
383
|
+
readonly ended: CommandEnded | null;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* A thread's recorded commands, by id. Resets at a fork's spawn row: a command describes what its
|
|
387
|
+
* source's execution did, not the conversation a fork continues.
|
|
388
|
+
*/
|
|
389
|
+
export declare const commandRecords: import("../../journal/projection.js").PluginProjection<Map<string, CommandRecord>>;
|
|
390
|
+
declare const CommandNoticeSchema: z.ZodObject<{
|
|
391
|
+
id: z.ZodString;
|
|
392
|
+
exit_code: z.ZodNullable<z.ZodNumber>;
|
|
393
|
+
exit_signal: z.ZodNullable<z.ZodString>;
|
|
394
|
+
summary: z.ZodString;
|
|
395
|
+
}, z.core.$strict>;
|
|
396
|
+
export type CommandNotice = z.output<typeof CommandNoticeSchema>;
|
|
397
|
+
/**
|
|
398
|
+
* The source of a command's exit notice: the input the commands plugin queues on the thread that
|
|
399
|
+
* started a command with `notify: "exit"` when it exits on its own. Its `summary` is one bounded
|
|
400
|
+
* line, such as `cmd-42 exited (exit code 0)`, for a host to show collapsed.
|
|
401
|
+
*/
|
|
402
|
+
export declare const commandNotice: {
|
|
403
|
+
record: (value: {
|
|
404
|
+
id: string;
|
|
405
|
+
exit_code: number | null;
|
|
406
|
+
exit_signal: string | null;
|
|
407
|
+
summary: string;
|
|
408
|
+
}) => ExtensionRecord;
|
|
409
|
+
parse: (value: {
|
|
410
|
+
id: string;
|
|
411
|
+
exit_code: number | null;
|
|
412
|
+
exit_signal: string | null;
|
|
413
|
+
summary: string;
|
|
414
|
+
}) => {
|
|
415
|
+
id: string;
|
|
416
|
+
exit_code: number | null;
|
|
417
|
+
exit_signal: string | null;
|
|
418
|
+
summary: string;
|
|
419
|
+
};
|
|
420
|
+
entry: (value: {
|
|
421
|
+
id: string;
|
|
422
|
+
exit_code: number | null;
|
|
423
|
+
exit_signal: string | null;
|
|
424
|
+
summary: string;
|
|
425
|
+
}, options: import("../../journal/journal.js").AppendOptions) => {
|
|
426
|
+
type: "ext";
|
|
427
|
+
data: {
|
|
428
|
+
plugin: string;
|
|
429
|
+
instance_id: string;
|
|
430
|
+
kind: string;
|
|
431
|
+
version: number;
|
|
432
|
+
data: z.core.util.JSONType;
|
|
433
|
+
};
|
|
434
|
+
options: import("../../journal/journal.js").AppendOptions;
|
|
435
|
+
};
|
|
436
|
+
append(journal: import("../../journal/journal.js").PluginJournal, value: {
|
|
437
|
+
id: string;
|
|
438
|
+
exit_code: number | null;
|
|
439
|
+
exit_signal: string | null;
|
|
440
|
+
summary: string;
|
|
441
|
+
}, options: import("../../journal/journal.js").AppendOptions): Promise<import("../../models/index.js").JournalEvent<"ext">>;
|
|
442
|
+
read(event: import("../../models/index.js").JournalEvent): {
|
|
443
|
+
id: string;
|
|
444
|
+
exit_code: number | null;
|
|
445
|
+
exit_signal: string | null;
|
|
446
|
+
summary: string;
|
|
447
|
+
} | undefined;
|
|
448
|
+
contribution(message: {
|
|
449
|
+
role?: import("../../models/index.js").InputRole;
|
|
450
|
+
content: string | readonly import("../../llm/content.js").ContentPartInput[];
|
|
451
|
+
}, value: {
|
|
452
|
+
id: string;
|
|
453
|
+
exit_code: number | null;
|
|
454
|
+
exit_signal: string | null;
|
|
455
|
+
summary: string;
|
|
456
|
+
}, options?: {
|
|
457
|
+
sourceSeqs?: readonly Seq[];
|
|
458
|
+
}): import("../../models/index.js").StepContribution;
|
|
459
|
+
matchesSource(record: DeepReadonly<ExtensionRecord>): boolean;
|
|
460
|
+
rejection(reason: string, value: {
|
|
461
|
+
id: string;
|
|
462
|
+
exit_code: number | null;
|
|
463
|
+
exit_signal: string | null;
|
|
464
|
+
summary: string;
|
|
465
|
+
}): {
|
|
466
|
+
decision: "reject";
|
|
467
|
+
reason: string;
|
|
468
|
+
source: ExtensionRecord;
|
|
469
|
+
};
|
|
470
|
+
readContribution: (event: import("../../models/index.js").JournalEvent) => {
|
|
471
|
+
id: string;
|
|
472
|
+
exit_code: number | null;
|
|
473
|
+
exit_signal: string | null;
|
|
474
|
+
summary: string;
|
|
475
|
+
} | undefined;
|
|
476
|
+
readSource: (source: DeepReadonly<ExtensionRecord> | null) => {
|
|
477
|
+
id: string;
|
|
478
|
+
exit_code: number | null;
|
|
479
|
+
exit_signal: string | null;
|
|
480
|
+
summary: string;
|
|
481
|
+
} | undefined;
|
|
482
|
+
told: import("../../journal/projection.js").PluginProjection<import("../../kit/extension.js").ToldNotices<{
|
|
483
|
+
id: string;
|
|
484
|
+
exit_code: number | null;
|
|
485
|
+
exit_signal: string | null;
|
|
486
|
+
summary: string;
|
|
487
|
+
}>>;
|
|
488
|
+
projection<State>(fold: {
|
|
489
|
+
key: string;
|
|
490
|
+
init(): State;
|
|
491
|
+
apply(state: State, value: {
|
|
492
|
+
id: string;
|
|
493
|
+
exit_code: number | null;
|
|
494
|
+
exit_signal: string | null;
|
|
495
|
+
summary: string;
|
|
496
|
+
}, event: import("../../models/index.js").JournalEvent<"ext">): State;
|
|
497
|
+
onFork?: "inherit" | "reset";
|
|
498
|
+
}): import("../../journal/projection.js").PluginProjection<State>;
|
|
499
|
+
};
|
|
500
|
+
/** What a command notice's source carries, when `source` is one; `undefined` for any other. For a host drawing the notice. */
|
|
501
|
+
export declare const readCommandNotice: (source: DeepReadonly<ExtensionRecord> | null) => CommandNotice | undefined;
|
|
502
|
+
/** The foreground command tool's name. */
|
|
503
|
+
export declare const RUN_COMMAND = "run_command";
|
|
504
|
+
/**
|
|
505
|
+
* How a `run_command` call's process group is known to have ended, from its rows alone, on
|
|
506
|
+
* affirmative evidence only: `not-run` while no dispatch attempt of it was allowed, so nothing was
|
|
507
|
+
* launched; once one was, `ended` only when its result carries the tool's own report that the stop
|
|
508
|
+
* succeeded (`stop_failed: false`), `stop-failed` when that report says the stop failed, and
|
|
509
|
+
* `unknown` otherwise: no result yet, a call cut off, or a result written by anything but the tool,
|
|
510
|
+
* such as an error that replaced its report.
|
|
511
|
+
*/
|
|
512
|
+
export type ForegroundEnd = 'not-run' | 'ended' | 'stop-failed' | 'unknown';
|
|
513
|
+
/**
|
|
514
|
+
* A thread's `run_command` calls, by the seq of their `tool/call` row, with how each one's process
|
|
515
|
+
* group is known to have ended. A foreground command leaves no record of its own: its call, the
|
|
516
|
+
* dispatch attempt allowed before the tool runs, and its result are the evidence. Resets at a fork's
|
|
517
|
+
* spawn row, as the background records do.
|
|
518
|
+
*/
|
|
519
|
+
export declare const foregroundCommands: import("../../journal/projection.js").PluginProjection<Map<number, ForegroundEnd>>;
|
|
520
|
+
/**
|
|
521
|
+
* A command a thread's rows leave without affirmative evidence of its end: a background one with no
|
|
522
|
+
* end row, or a `run_command` call launched with no report of its end from the tool itself; either
|
|
523
|
+
* kind with `stop_failed` when the stop it reported failed to end its process group.
|
|
524
|
+
*/
|
|
525
|
+
declare const UnendedCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
526
|
+
kind: z.ZodLiteral<"background">;
|
|
527
|
+
id: z.ZodString;
|
|
528
|
+
stop_failed: z.ZodBoolean;
|
|
529
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
530
|
+
kind: z.ZodLiteral<"foreground">;
|
|
531
|
+
call_seq: z.ZodNumber;
|
|
532
|
+
stop_failed: z.ZodBoolean;
|
|
533
|
+
}, z.core.$strict>], "kind">;
|
|
534
|
+
export type UnendedCommand = z.output<typeof UnendedCommandSchema>;
|
|
535
|
+
/**
|
|
536
|
+
* What a thread's catalog entry says of its commands: those without an established end, for every
|
|
537
|
+
* thread while the commands plugin is mounted. A thread whose records cannot be read reads
|
|
538
|
+
* `unavailable`, which nothing reads as "none".
|
|
539
|
+
*/
|
|
540
|
+
export declare const commandsContribution: import("../../services/contributions.js").ContributionDefinition<({
|
|
541
|
+
kind: "background";
|
|
542
|
+
id: string;
|
|
543
|
+
stop_failed: boolean;
|
|
544
|
+
} | {
|
|
545
|
+
kind: "foreground";
|
|
546
|
+
call_seq: number;
|
|
547
|
+
stop_failed: boolean;
|
|
548
|
+
})[]>;
|
|
549
|
+
export {};
|