@parcha/agentrun-serve 0.1.0-beta.44 → 0.1.0-beta.45
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/CHANGELOG.md +131 -5
- package/README.md +371 -300
- package/dist/acp-package.d.ts +28 -0
- package/dist/acp-package.js +23 -0
- package/dist/adapter-facts.d.ts +8 -1
- package/dist/adapter-facts.js +9 -1
- package/dist/adapters.d.ts +5 -0
- package/dist/adapters.js +36 -3
- package/dist/agent-delete.d.ts +50 -0
- package/dist/agent-delete.js +125 -0
- package/dist/agents-store.d.ts +9 -3
- package/dist/agents-store.js +22 -8
- package/dist/agents.d.ts +5 -1
- package/dist/agents.js +8 -4
- package/dist/api-only.d.ts +8 -3
- package/dist/api-only.js +10 -4
- package/dist/archil-routes.d.ts +5 -1
- package/dist/archil-routes.js +57 -2
- package/dist/browser-wait-ended.d.ts +2 -0
- package/dist/browser-wait-ended.js +2 -0
- package/dist/calendar/ics-faux.d.ts +3 -1
- package/dist/calendar/ics-faux.js +12 -2
- package/dist/calendar/tools.js +5 -2
- package/dist/chatgpt-plan.js +3 -1
- package/dist/claude-login.d.ts +135 -0
- package/dist/claude-login.js +244 -0
- package/dist/cli.js +52 -16
- package/dist/composio-preset.js +69 -7
- package/dist/composio-triggers.d.ts +14 -0
- package/dist/composio-triggers.js +79 -15
- package/dist/computer-attach.d.ts +40 -5
- package/dist/computer-attach.js +130 -15
- package/dist/computer-keys.d.ts +3 -0
- package/dist/computer-keys.js +7 -1
- package/dist/computer-live.js +3 -2
- package/dist/computers.d.ts +21 -10
- package/dist/computers.js +39 -28
- package/dist/console/assets/index-3O2Yl6hZ.js +701 -0
- package/dist/console/assets/index-DaFsZuzQ.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/decisions.d.ts +1 -1
- package/dist/dial-relay.d.ts +29 -0
- package/dist/dial-relay.js +94 -0
- package/dist/email/tools.js +10 -5
- package/dist/env-proxy.d.ts +2 -0
- package/dist/env-proxy.js +35 -0
- package/dist/errors.d.ts +3 -1
- package/dist/errors.js +7 -4
- package/dist/faux-computers.d.ts +8 -2
- package/dist/faux-computers.js +83 -6
- package/dist/harness-archive.d.ts +67 -0
- package/dist/harness-archive.js +177 -0
- package/dist/harness-goose.d.ts +34 -0
- package/dist/harness-goose.js +87 -0
- package/dist/harness-install.d.ts +21 -0
- package/dist/harness-install.js +24 -11
- package/dist/harness-opencode/adapter.js +1 -1
- package/dist/harness-table.d.ts +9 -1
- package/dist/harness-table.js +20 -3
- package/dist/harness.d.ts +1 -2
- package/dist/harness.js +3 -4
- package/dist/host.js +2 -1
- package/dist/key-check.js +3 -0
- package/dist/learn/audit.d.ts +6 -6
- package/dist/learn/audit.js +3 -7
- package/dist/learn/check.d.ts +23 -89
- package/dist/learn/check.js +57 -335
- package/dist/learn/commit.d.ts +63 -90
- package/dist/learn/commit.js +124 -316
- package/dist/learn/compile.d.ts +53 -50
- package/dist/learn/compile.js +87 -102
- package/dist/learn/corrections.d.ts +13 -0
- package/dist/learn/corrections.js +23 -0
- package/dist/learn/delete.d.ts +5 -5
- package/dist/learn/delete.js +8 -10
- package/dist/learn/folder.d.ts +35 -47
- package/dist/learn/folder.js +118 -134
- package/dist/learn/index.d.ts +3 -5
- package/dist/learn/index.js +6 -9
- package/dist/learn/learning.sh +45 -15
- package/dist/learn/promote.d.ts +13 -1
- package/dist/learn/promote.js +9 -0
- package/dist/learn/{skills.d.ts → workflow-draft.d.ts} +30 -38
- package/dist/learn/{skills.js → workflow-draft.js} +48 -58
- package/dist/learn/workflow-nodes.js +1 -1
- package/dist/learned-workflow.js +2 -2
- package/dist/learning-cost.d.ts +38 -24
- package/dist/learning-cost.js +41 -24
- package/dist/learning-routes.d.ts +91 -170
- package/dist/learning-routes.js +183 -421
- package/dist/learning-run.d.ts +19 -40
- package/dist/learning-run.js +23 -93
- package/dist/learning-setting.d.ts +4 -4
- package/dist/learning-setting.js +6 -6
- package/dist/learning-words.d.ts +28 -74
- package/dist/learning-words.js +64 -162
- package/dist/learning.d.ts +61 -392
- package/dist/learning.js +101 -651
- package/dist/live-reach.d.ts +25 -2
- package/dist/live-reach.js +46 -4
- package/dist/llms.txt +1 -1
- package/dist/local-models.d.ts +3 -11
- package/dist/local-models.js +5 -6
- package/dist/mcp-servers-store.d.ts +4 -4
- package/dist/model-form.js +6 -5
- package/dist/model.d.ts +4 -0
- package/dist/model.js +26 -9
- package/dist/native/binding.js +1 -1
- package/dist/native/connection.js +1 -1
- package/dist/native/discovery.js +1 -1
- package/dist/native/instructions.d.ts +3 -0
- package/dist/native/instructions.js +5 -3
- package/dist/native/remote-worker-bridge.js +9 -43
- package/dist/native/remote.d.ts +8 -15
- package/dist/native/remote.js +3 -3
- package/dist/native/schema.js +1 -1
- package/dist/native/types.d.ts +2 -2
- package/dist/openapi.js +268 -316
- package/dist/paid-calls.d.ts +8 -0
- package/dist/paid-calls.js +20 -0
- package/dist/particle-provider.d.ts +11 -0
- package/dist/particle-provider.js +135 -0
- package/dist/port-models.d.ts +12 -4
- package/dist/port-models.js +28 -11
- package/dist/print.d.ts +27 -0
- package/dist/print.js +21 -0
- package/dist/provider.d.ts +7 -0
- package/dist/provider.js +15 -1
- package/dist/reflect-range.js +2 -3
- package/dist/run-launch.d.ts +14 -28
- package/dist/run-launch.js +9 -12
- package/dist/run-learning-served.d.ts +15 -89
- package/dist/run-listing.d.ts +34 -0
- package/dist/run-listing.js +128 -0
- package/dist/run-model-key.js +1 -1
- package/dist/run-timeline-served.js +5 -3
- package/dist/run-trace.d.ts +97 -0
- package/dist/run-trace.js +253 -0
- package/dist/run-view.d.ts +15 -0
- package/dist/run-view.js +9 -0
- package/dist/runnable.js +2 -1
- package/dist/runner/adapter-loop.d.ts +8 -6
- package/dist/runner/adapter-loop.js +16 -12
- package/dist/runner/adapter-run-spec.d.ts +16 -4
- package/dist/runner/adapter-run-spec.js +64 -58
- package/dist/runner/adapters/index.js +22 -0
- package/dist/runner/adapters/pi.d.ts +4 -12
- package/dist/runner/adapters/pi.js +2 -2
- package/dist/runner/audit.d.ts +1 -1
- package/dist/runner/audit.js +16 -8
- package/dist/runner/beside.d.ts +6 -2
- package/dist/runner/beside.js +38 -9
- package/dist/runner/claim-secrets.d.ts +18 -2
- package/dist/runner/claim-secrets.js +42 -18
- package/dist/runner/cli-run-spec.js +55 -51
- package/dist/runner/conformance/harness.d.ts +6 -0
- package/dist/runner/conformance/harness.js +16 -5
- package/dist/runner/dispatch.d.ts +2 -2
- package/dist/runner/end-of-run.d.ts +6 -14
- package/dist/runner/end-of-run.js +8 -33
- package/dist/runner/feedback-round.d.ts +2 -2
- package/dist/runner/feedback-round.js +7 -7
- package/dist/runner/github-app.js +3 -1
- package/dist/runner/harness-loops.d.ts +0 -8
- package/dist/runner/harness-loops.js +11 -59
- package/dist/runner/held.d.ts +170 -0
- package/dist/runner/held.js +57 -0
- package/dist/runner/journal-kinds.d.ts +2 -3
- package/dist/runner/journal-kinds.js +2 -3
- package/dist/runner/learned-first.d.ts +40 -0
- package/dist/runner/learned-first.js +32 -0
- package/dist/runner/learning-end.d.ts +77 -69
- package/dist/runner/learning-end.js +250 -303
- package/dist/runner/learning-seed.d.ts +15 -33
- package/dist/runner/learning-seed.js +24 -45
- package/dist/runner/loop-contract.d.ts +2 -3
- package/dist/runner/main.d.ts +17 -9
- package/dist/runner/main.js +63 -20
- package/dist/runner/mcp-run.d.ts +11 -0
- package/dist/runner/mcp-run.js +67 -0
- package/dist/runner/memory-claim.d.ts +10 -5
- package/dist/runner/memory-claim.js +12 -6
- package/dist/runner/model-route.d.ts +7 -4
- package/dist/runner/model-route.js +22 -10
- package/dist/runner/native-loop.d.ts +0 -7
- package/dist/runner/native-loop.js +9 -101
- package/dist/runner/promotion.d.ts +8 -6
- package/dist/runner/promotion.js +19 -12
- package/dist/runner/reflect-hook.d.ts +64 -95
- package/dist/runner/reflect-hook.js +112 -225
- package/dist/runner/run-channel.d.ts +43 -0
- package/dist/runner/run-channel.js +467 -0
- package/dist/runner/run-child-host.d.ts +169 -0
- package/dist/runner/run-child-host.js +1222 -0
- package/dist/runner/run-child.d.ts +1 -0
- package/dist/runner/run-child.js +254 -0
- package/dist/runner/run-errors.d.ts +2 -0
- package/dist/runner/run-errors.js +20 -0
- package/dist/runner/runner.js +1 -5
- package/dist/runner/sdk-ask.d.ts +78 -0
- package/dist/runner/sdk-ask.js +158 -0
- package/dist/runner/sdk-loop.d.ts +2 -4
- package/dist/runner/sdk-loop.js +29 -49
- package/dist/runner/store-secrets.d.ts +5 -3
- package/dist/runner/store-secrets.js +5 -1
- package/dist/runner/workflow-first.d.ts +5 -0
- package/dist/runner/workflow-first.js +4 -0
- package/dist/runner/workflow-spec.js +7 -2
- package/dist/runs-over-store.d.ts +16 -28
- package/dist/runs-over-store.js +31 -38
- package/dist/sdk/runs.d.ts +6 -11
- package/dist/sdk/runs.js +20 -41
- package/dist/sdk/schema.js +3 -4
- package/dist/seal-key.d.ts +5 -0
- package/dist/seal-key.js +7 -0
- package/dist/secrets.d.ts +3 -0
- package/dist/secrets.js +16 -3
- package/dist/server.d.ts +55 -33
- package/dist/server.js +685 -320
- package/dist/sign-ins-store.d.ts +8 -0
- package/dist/sign-ins-store.js +36 -1
- package/dist/skills.js +1 -1
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +1 -1
- package/dist/store/journal/storage.js +3 -0
- package/dist/store/postgres/migrations/0017_run_listing.sql +83 -0
- package/dist/store/postgres/migrations/0018_trigger_template.sql +6 -0
- package/dist/store/postgres/migrations/0019_runner_relays.sql +28 -0
- package/dist/store/schema.d.ts +53 -4
- package/dist/store/schema.js +137 -6
- package/dist/store/sqlite/connection.d.ts +2 -0
- package/dist/store/sqlite/connection.js +3 -1
- package/dist/store/sqlite/run-patch.d.ts +0 -17
- package/dist/store/sqlite/run-patch.js +4 -33
- package/dist/store/sqlite/store.js +246 -63
- package/dist/store/sqlite/worker.js +25 -0
- package/dist/store/store.d.ts +193 -36
- package/dist/store/store.js +25 -3
- package/dist/store-reads/learning.d.ts +102 -204
- package/dist/store-reads/learning.js +159 -321
- package/dist/store-reads/loop.d.ts +0 -1
- package/dist/store-reads/loop.js +1 -1
- package/dist/store-view.d.ts +29 -1
- package/dist/store-view.js +97 -31
- package/dist/template-eval.d.ts +3 -6
- package/dist/template-eval.js +22 -36
- package/dist/templates.d.ts +2 -1
- package/dist/templates.js +6 -3
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.js +1 -1
- package/dist/timeline/timeline.d.ts +5 -1
- package/dist/timeline/timeline.js +16 -0
- package/dist/tool-gate.d.ts +0 -7
- package/dist/tool-gate.js +1 -15
- package/dist/tool-keys-store.d.ts +1 -1
- package/dist/tool-keys.d.ts +6 -4
- package/dist/tool-keys.js +12 -6
- package/dist/tools.d.ts +2 -2
- package/dist/tools.js +11 -4
- package/dist/triggers.d.ts +60 -5
- package/dist/triggers.js +123 -18
- package/dist/validate.js +1 -1
- package/dist/webhooks.d.ts +4 -1
- package/dist/webhooks.js +11 -4
- package/dist/workspace/agent-computer.d.ts +2 -0
- package/dist/workspace/agent-computer.js +2 -0
- package/dist/workspace/archil-claim.d.ts +7 -0
- package/dist/workspace/archil-claim.js +29 -0
- package/dist/workspace/archil.d.ts +9 -1
- package/dist/workspace/archil.js +165 -3
- package/dist/workspace/attach.d.ts +3 -1
- package/dist/workspace/attach.js +2 -0
- package/dist/workspace/attached-computers.d.ts +16 -5
- package/dist/workspace/attached-computers.js +25 -9
- package/dist/workspace/computer-deps.js +1 -1
- package/dist/workspace/computer-for-claim.d.ts +7 -3
- package/dist/workspace/computer-for-claim.js +119 -22
- package/dist/workspace/computer-hold.js +2 -1
- package/dist/workspace/computer-kept.d.ts +11 -1
- package/dist/workspace/computer-kept.js +24 -3
- package/dist/workspace/resolve-computer.d.ts +33 -19
- package/dist/workspace/resolve-computer.js +172 -64
- package/dist/workspace/revision-skills.d.ts +1 -2
- package/dist/workspace/revision-skills.js +3 -4
- package/dist/workspace/run-workspace.d.ts +1 -1
- package/dist/workspace/run-workspace.js +5 -0
- package/dist/workspace/synced-folder.d.ts +85 -0
- package/dist/workspace/synced-folder.js +230 -0
- package/dist/workspace/workspace.d.ts +4 -0
- package/launcher/agentrun-serve +1 -1
- package/package.json +10 -10
- package/templates/README.md +7 -7
- package/templates/inbound-lead/agent.md +3 -3
- package/templates/inbound-lead/evals/learned-correction/case.yaml +3 -3
- package/templates/inbound-lead/evals/learned-correction/fixtures/corrections.md +1 -0
- package/templates/inbound-lead/evals/learned-correction/graders/applies-correction.md +22 -0
- package/templates/inbound-lead/evals/learned-correction/graders/learned-origin.md +1 -1
- package/templates/inbound-lead/evals/learned-correction/prompt.md +1 -1
- package/templates/inbound-lead/lead.schema.json +6 -5
- package/templates/inbound-lead/rules/RUBRIC.md +4 -4
- package/templates/inbound-lead/skills/lead/SKILL.md +4 -4
- package/templates/market-monitor/evals/learned-preference/case.yaml +4 -4
- package/templates/market-monitor/evals/learned-preference/fixtures/corrections.md +1 -0
- package/templates/market-monitor/evals/learned-preference/graders/omits-junior-post.md +3 -3
- package/templates/market-monitor/evals/learned-preference/prompt.md +1 -1
- package/templates/release-notes/evals/learned-style/case.yaml +4 -4
- package/templates/release-notes/evals/learned-style/fixtures/corrections.md +1 -0
- package/templates/release-notes/evals/learned-style/graders/same-changes.md +2 -2
- package/templates/release-notes/evals/learned-style/prompt.md +1 -1
- package/dist/console/assets/index-BUktRvS-.css +0 -1
- package/dist/console/assets/index-nB9kTfIN.js +0 -711
- package/dist/learn/grade.d.ts +0 -138
- package/dist/learn/grade.js +0 -682
- package/dist/learn/notes.d.ts +0 -81
- package/dist/learn/notes.js +0 -178
- package/dist/learn/reflect.d.ts +0 -77
- package/dist/learn/reflect.js +0 -228
- package/dist/learn/relevance.d.ts +0 -24
- package/dist/learn/relevance.js +0 -91
- package/dist/learn/seed-check.d.ts +0 -74
- package/dist/learn/seed-check.js +0 -103
- package/dist/learning-batch.d.ts +0 -291
- package/dist/learning-batch.js +0 -600
- package/dist/learning-evals.d.ts +0 -35
- package/dist/learning-evals.js +0 -99
- package/dist/native/context.d.ts +0 -6
- package/dist/native/context.js +0 -22
- package/dist/propose.d.ts +0 -52
- package/dist/propose.js +0 -224
- package/dist/runner/learning-ask.d.ts +0 -47
- package/dist/runner/learning-ask.js +0 -128
- package/dist/runner/learning-dispatch.d.ts +0 -45
- package/dist/runner/learning-dispatch.js +0 -99
- package/dist/runner/learning-factory.d.ts +0 -16
- package/dist/runner/learning-factory.js +0 -50
- package/dist/runner/learning-loop.d.ts +0 -273
- package/dist/runner/learning-loop.js +0 -521
- package/dist/usage.d.ts +0 -11
- package/dist/usage.js +0 -11
- package/templates/inbound-lead/evals/learned-correction/fixtures/learning/MEMORY.md +0 -1
- package/templates/inbound-lead/evals/learned-correction/fixtures/learning/no-agencies.md +0 -14
- package/templates/inbound-lead/evals/learned-correction/graders/applies-note.md +0 -21
- package/templates/market-monitor/evals/learned-preference/fixtures/learning/MEMORY.md +0 -1
- package/templates/market-monitor/evals/learned-preference/fixtures/learning/skip-junior-job-posts.md +0 -8
- package/templates/release-notes/evals/learned-style/fixtures/learning/MEMORY.md +0 -1
- package/templates/release-notes/evals/learned-style/fixtures/learning/say-agent-not-bot.md +0 -13
|
@@ -7,24 +7,15 @@ export declare function servedRunLearning(deps: {
|
|
|
7
7
|
signIns?: SignInReader;
|
|
8
8
|
statuses?: (agentId: string) => Promise<ReadonlyMap<string, ItemStatus> | undefined>;
|
|
9
9
|
}, store: Store, runId: string): Promise<{
|
|
10
|
+
run: string;
|
|
11
|
+
state: "dropped" | "merged" | "seeded" | "reflecting";
|
|
12
|
+
reason: "cancelled" | "use" | "empty" | "crashed" | "reflect_failed" | "no_budget" | "checker" | "unknown_cost" | "seed_failed" | null;
|
|
13
|
+
detail: string | null;
|
|
14
|
+
at: string;
|
|
15
|
+
workflows: import("./learning.js").LearnedFile[];
|
|
16
|
+
corrections: number;
|
|
10
17
|
seed: string | null;
|
|
11
18
|
merged: string | null;
|
|
12
|
-
pending: {
|
|
13
|
-
file: string;
|
|
14
|
-
name: string;
|
|
15
|
-
}[];
|
|
16
|
-
verdict: {
|
|
17
|
-
merge: boolean;
|
|
18
|
-
reason: string;
|
|
19
|
-
items: {
|
|
20
|
-
why: string;
|
|
21
|
-
question?: string | undefined;
|
|
22
|
-
origin?: "run" | "you" | undefined;
|
|
23
|
-
pending?: boolean | undefined;
|
|
24
|
-
file: string;
|
|
25
|
-
keep: boolean;
|
|
26
|
-
}[];
|
|
27
|
-
} | null;
|
|
28
19
|
problems: {
|
|
29
20
|
detail: string;
|
|
30
21
|
path?: string | undefined;
|
|
@@ -32,7 +23,6 @@ export declare function servedRunLearning(deps: {
|
|
|
32
23
|
}[];
|
|
33
24
|
compiled: {
|
|
34
25
|
workflow: string;
|
|
35
|
-
from_notes: string[];
|
|
36
26
|
attempts: {
|
|
37
27
|
ok: boolean;
|
|
38
28
|
errors: string[];
|
|
@@ -41,33 +31,13 @@ export declare function servedRunLearning(deps: {
|
|
|
41
31
|
promoted: boolean | null;
|
|
42
32
|
} | null;
|
|
43
33
|
draft_errors: string[];
|
|
44
|
-
cost_usd: {
|
|
45
|
-
grade: number | null;
|
|
46
|
-
};
|
|
47
|
-
tokens: {
|
|
48
|
-
grade: import("./learning.js").Tokens | null;
|
|
49
|
-
};
|
|
50
34
|
used: {
|
|
51
|
-
skills: {
|
|
52
|
-
name: string;
|
|
53
|
-
read: boolean;
|
|
54
|
-
}[];
|
|
55
35
|
workflows: {
|
|
56
36
|
name: string;
|
|
57
37
|
calls: number;
|
|
58
38
|
failed: number;
|
|
59
39
|
}[];
|
|
60
40
|
};
|
|
61
|
-
given?: import("./learning.js").NoteUsed[];
|
|
62
|
-
read?: import("./learning.js").NoteUsed[];
|
|
63
|
-
learned?: import("./learning.js").NoteLearned[];
|
|
64
|
-
skills?: import("./learning.js").LearnedFile[];
|
|
65
|
-
workflows?: import("./learning.js").LearnedFile[];
|
|
66
|
-
run: string;
|
|
67
|
-
state: "dropped" | "proposed" | "merged" | "seeded" | "reflecting";
|
|
68
|
-
reason: "cancelled" | "use" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
69
|
-
detail: string | null;
|
|
70
|
-
at: string;
|
|
71
41
|
} | {
|
|
72
42
|
graded: {
|
|
73
43
|
workflow: string | null;
|
|
@@ -76,28 +46,19 @@ export declare function servedRunLearning(deps: {
|
|
|
76
46
|
graded_at: string;
|
|
77
47
|
path: "agent" | "workflow" | "replay" | "handed_back" | "audit";
|
|
78
48
|
workflow_digest: string | null;
|
|
79
|
-
feedback: "
|
|
49
|
+
feedback: "correction" | null;
|
|
80
50
|
run_id: string;
|
|
81
51
|
correct: boolean;
|
|
82
52
|
};
|
|
53
|
+
run: string;
|
|
54
|
+
state: "dropped" | "merged" | "seeded" | "reflecting";
|
|
55
|
+
reason: "cancelled" | "use" | "empty" | "crashed" | "reflect_failed" | "no_budget" | "checker" | "unknown_cost" | "seed_failed" | null;
|
|
56
|
+
detail: string | null;
|
|
57
|
+
at: string;
|
|
58
|
+
workflows: import("./learning.js").LearnedFile[];
|
|
59
|
+
corrections: number;
|
|
83
60
|
seed: string | null;
|
|
84
61
|
merged: string | null;
|
|
85
|
-
pending: {
|
|
86
|
-
file: string;
|
|
87
|
-
name: string;
|
|
88
|
-
}[];
|
|
89
|
-
verdict: {
|
|
90
|
-
merge: boolean;
|
|
91
|
-
reason: string;
|
|
92
|
-
items: {
|
|
93
|
-
why: string;
|
|
94
|
-
question?: string | undefined;
|
|
95
|
-
origin?: "run" | "you" | undefined;
|
|
96
|
-
pending?: boolean | undefined;
|
|
97
|
-
file: string;
|
|
98
|
-
keep: boolean;
|
|
99
|
-
}[];
|
|
100
|
-
} | null;
|
|
101
62
|
problems: {
|
|
102
63
|
detail: string;
|
|
103
64
|
path?: string | undefined;
|
|
@@ -105,7 +66,6 @@ export declare function servedRunLearning(deps: {
|
|
|
105
66
|
}[];
|
|
106
67
|
compiled: {
|
|
107
68
|
workflow: string;
|
|
108
|
-
from_notes: string[];
|
|
109
69
|
attempts: {
|
|
110
70
|
ok: boolean;
|
|
111
71
|
errors: string[];
|
|
@@ -114,33 +74,13 @@ export declare function servedRunLearning(deps: {
|
|
|
114
74
|
promoted: boolean | null;
|
|
115
75
|
} | null;
|
|
116
76
|
draft_errors: string[];
|
|
117
|
-
cost_usd: {
|
|
118
|
-
grade: number | null;
|
|
119
|
-
};
|
|
120
|
-
tokens: {
|
|
121
|
-
grade: import("./learning.js").Tokens | null;
|
|
122
|
-
};
|
|
123
77
|
used: {
|
|
124
|
-
skills: {
|
|
125
|
-
name: string;
|
|
126
|
-
read: boolean;
|
|
127
|
-
}[];
|
|
128
78
|
workflows: {
|
|
129
79
|
name: string;
|
|
130
80
|
calls: number;
|
|
131
81
|
failed: number;
|
|
132
82
|
}[];
|
|
133
83
|
};
|
|
134
|
-
given?: import("./learning.js").NoteUsed[];
|
|
135
|
-
read?: import("./learning.js").NoteUsed[];
|
|
136
|
-
learned?: import("./learning.js").NoteLearned[];
|
|
137
|
-
skills?: import("./learning.js").LearnedFile[];
|
|
138
|
-
workflows?: import("./learning.js").LearnedFile[];
|
|
139
|
-
run: string;
|
|
140
|
-
state: "dropped" | "proposed" | "merged" | "seeded" | "reflecting";
|
|
141
|
-
reason: "cancelled" | "use" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
142
|
-
detail: string | null;
|
|
143
|
-
at: string;
|
|
144
84
|
} | null>;
|
|
145
85
|
/** Run `runId`'s learning diff as GET /runs/{id}/learning/diff serves it (learning-routes.ts runDiffOverStore), cut as its
|
|
146
86
|
* learning is, or ApiError forbidden for a withheld run. */
|
|
@@ -161,20 +101,6 @@ export declare function servedRunDiff(deps: {
|
|
|
161
101
|
patch: string;
|
|
162
102
|
withheld?: undefined;
|
|
163
103
|
})[];
|
|
164
|
-
} | {
|
|
165
|
-
base: string;
|
|
166
|
-
head: null;
|
|
167
|
-
files: ({
|
|
168
|
-
path: string;
|
|
169
|
-
status: string;
|
|
170
|
-
withheld: string;
|
|
171
|
-
patch?: undefined;
|
|
172
|
-
} | {
|
|
173
|
-
path: string;
|
|
174
|
-
status: string;
|
|
175
|
-
patch: string;
|
|
176
|
-
withheld?: undefined;
|
|
177
|
-
})[];
|
|
178
104
|
} | {
|
|
179
105
|
base: string | null;
|
|
180
106
|
head: null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RunListing, Store } from "./store/store.js";
|
|
2
|
+
import { type ViewDeps } from "./store-view.js";
|
|
3
|
+
/** How often an idle lister looks again (ms). */
|
|
4
|
+
export declare const LISTER_IDLE_MS = 400;
|
|
5
|
+
export interface Lister {
|
|
6
|
+
/** Starts its own passes: the first at once, then one each idle time (none with an idle time of Infinity). */
|
|
7
|
+
start(): void;
|
|
8
|
+
/** Builds run `runId`'s listing over `deps` and writes it at `mark`, the mark read before the build (Runs.putListing:
|
|
9
|
+
* not written when a write moved it since). A listing that read a workflow held for its owner's OK puts its agent's
|
|
10
|
+
* folder among those each pass reads, with the statuses this build read: an approval that lands after that read is
|
|
11
|
+
* then seen by the next pass, whoever built the listing (a pass, or a list). Undefined for an unknown run. */
|
|
12
|
+
build(runId: string, mark: number, deps: ViewDeps): Promise<{
|
|
13
|
+
listing: RunListing | undefined;
|
|
14
|
+
written: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
/** Resolves once a pass finds nothing it may build now: every run's listing is current, but for a held run built within
|
|
17
|
+
* its rebuild time. For tests and benchmarks; the server never waits on it. */
|
|
18
|
+
settled(): Promise<void>;
|
|
19
|
+
/** The server's keys or settings changed: every failed run's listing (its error words) is marked behind before this
|
|
20
|
+
* resolves, so the next list builds it again. */
|
|
21
|
+
keysChanged(): Promise<void>;
|
|
22
|
+
/** A person changed agent `agentId`'s learning folder (a workflow approved, retired or restored): each of its runs
|
|
23
|
+
* whose listing read a workflow held for the owner's OK is marked behind before this resolves, so the next list says what
|
|
24
|
+
* the folder says now. A change made outside the server is read by the next pass. */
|
|
25
|
+
learningChanged(agentId: string): Promise<void>;
|
|
26
|
+
/** Stops after the pass under way. */
|
|
27
|
+
stop(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
/** The lister over `store`, its passes not started (Lister.start): a list may build through it before they are. */
|
|
30
|
+
export declare function createLister(store: Store, depsOf: () => ViewDeps, options?: {
|
|
31
|
+
readonly log?: (line: string, error: Error) => void;
|
|
32
|
+
readonly now?: () => number;
|
|
33
|
+
readonly idleMs?: number;
|
|
34
|
+
}): Lister;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { LISTING_HELD, LISTING_KEYED } from "./store/schema.js";
|
|
2
|
+
import { LISTING_RETRY_MS, listingOverStore } from "./store-view.js";
|
|
3
|
+
/** Most rows one read of a pass reads. */
|
|
4
|
+
const PASS_ROWS = 32;
|
|
5
|
+
/** How often an idle lister looks again (ms). */
|
|
6
|
+
export const LISTER_IDLE_MS = 400;
|
|
7
|
+
/** The least time between two builds of one run a runner holds (ms). */
|
|
8
|
+
const HELD_REBUILD_MS = 1_000;
|
|
9
|
+
/** The lister over `store`, its passes not started (Lister.start): a list may build through it before they are. */
|
|
10
|
+
export function createLister(store, depsOf, options = {}) {
|
|
11
|
+
const now = options.now ?? Date.now;
|
|
12
|
+
/** Infinity: no pass of its own, only those settled() asks for. */
|
|
13
|
+
const idleMs = options.idleMs ?? LISTER_IDLE_MS;
|
|
14
|
+
let closing = false;
|
|
15
|
+
let timer;
|
|
16
|
+
let pass = Promise.resolve(0);
|
|
17
|
+
/** A held run's last build: when, and how long it took. */
|
|
18
|
+
const built = new Map();
|
|
19
|
+
/** The agents with a run whose learning holds items for the owner's OK, with their folder's statuses as last read (for an
|
|
20
|
+
* agent first met in a build, as that build read them). */
|
|
21
|
+
const folders = new Map();
|
|
22
|
+
/** When each run whose view failed to build last failed. */
|
|
23
|
+
const failed = new Map();
|
|
24
|
+
/** The first pass marks behind every listing that read outside its run: the keys or folders may have moved while no
|
|
25
|
+
* server ran. */
|
|
26
|
+
let relistKeys = true;
|
|
27
|
+
const say = (what, error) => options.log?.(what, error instanceof Error ? error : new Error(String(error)));
|
|
28
|
+
/** Lister.build: the one build of a listing, a pass's or a list's. */
|
|
29
|
+
async function build(id, mark, deps) {
|
|
30
|
+
// The folder statuses this build read, by agent: the baseline a later pass compares against, never a read made after
|
|
31
|
+
// it, which a person's approval landing before this listing's write would already hold.
|
|
32
|
+
const read = new Map();
|
|
33
|
+
const statuses = deps.statuses;
|
|
34
|
+
const buildDeps = statuses ? { ...deps, statuses: async (agentId) => { const seen = await statuses(agentId); if (!read.has(agentId))
|
|
35
|
+
read.set(agentId, seen); return seen; } } : deps;
|
|
36
|
+
const listing = await listingOverStore(store, id, buildDeps);
|
|
37
|
+
const written = listing ? await store.runs.putListing(id, mark, listing) : false;
|
|
38
|
+
const agentId = listing ? String(listing.item.agent_id) : "";
|
|
39
|
+
if (listing && listing.flags & LISTING_HELD && !folders.has(agentId))
|
|
40
|
+
folders.set(agentId, read.get(agentId));
|
|
41
|
+
return { listing, written };
|
|
42
|
+
}
|
|
43
|
+
/** One pass: what moved outside the runs' writes, then each behind row this pass may build. The rows it built. */
|
|
44
|
+
async function once() {
|
|
45
|
+
const deps = depsOf();
|
|
46
|
+
if (relistKeys) {
|
|
47
|
+
relistKeys = false;
|
|
48
|
+
await store.runs.relist({ flags: LISTING_HELD | LISTING_KEYED });
|
|
49
|
+
}
|
|
50
|
+
for (const [agentId, seen] of folders) {
|
|
51
|
+
const statuses = await deps.statuses?.(agentId);
|
|
52
|
+
if (statuses === seen)
|
|
53
|
+
continue;
|
|
54
|
+
folders.set(agentId, statuses);
|
|
55
|
+
await store.runs.relist({ flags: LISTING_HELD, agentId });
|
|
56
|
+
}
|
|
57
|
+
// PASS_ROWS rows at a time, until a read builds one or none is left. A row passed over (a held run built within its
|
|
58
|
+
// rebuild time, a run whose view failed to build and waits for its retry, one written meanwhile) stays behind, so
|
|
59
|
+
// the next read starts after every row passed over so far: such rows never hold up the rows after them.
|
|
60
|
+
let count = 0;
|
|
61
|
+
let passed = 0;
|
|
62
|
+
for (;;) {
|
|
63
|
+
const rows = await store.runs.behind({ limit: PASS_ROWS, offset: passed });
|
|
64
|
+
for (const { id, mark, held } of rows) {
|
|
65
|
+
if (closing)
|
|
66
|
+
break;
|
|
67
|
+
const last = built.get(id);
|
|
68
|
+
if ((held && last && now() - last.at < Math.max(HELD_REBUILD_MS, 4 * last.ms)) || (failed.get(id) ?? -Infinity) > now() - LISTING_RETRY_MS) {
|
|
69
|
+
passed++;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const start = now();
|
|
73
|
+
let listing;
|
|
74
|
+
let written;
|
|
75
|
+
try {
|
|
76
|
+
({ listing, written } = await build(id, mark, deps));
|
|
77
|
+
failed.delete(id);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
failed.set(id, now());
|
|
81
|
+
say("run_listing_unbuilt", error);
|
|
82
|
+
passed++;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (!written)
|
|
86
|
+
passed++;
|
|
87
|
+
if (!listing)
|
|
88
|
+
continue;
|
|
89
|
+
count++;
|
|
90
|
+
if (held)
|
|
91
|
+
built.set(id, { at: now(), ms: now() - start });
|
|
92
|
+
else
|
|
93
|
+
built.delete(id);
|
|
94
|
+
}
|
|
95
|
+
if (closing || count > 0 || rows.length < PASS_ROWS)
|
|
96
|
+
return count;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/** A pass after the one under way: one at a time, whoever asks. */
|
|
100
|
+
const turn = () => (pass = pass.then(() => (closing ? 0 : once())).catch((error) => (say("run_listing_unbuilt", error), 0)));
|
|
101
|
+
function next(delay) {
|
|
102
|
+
if (closing || !Number.isFinite(idleMs))
|
|
103
|
+
return;
|
|
104
|
+
timer = setTimeout(() => void turn().then((count) => next(count > 0 ? 0 : idleMs)), delay);
|
|
105
|
+
timer.unref();
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
start() {
|
|
109
|
+
next(0);
|
|
110
|
+
},
|
|
111
|
+
build,
|
|
112
|
+
async settled() {
|
|
113
|
+
while ((await turn()) > 0)
|
|
114
|
+
;
|
|
115
|
+
},
|
|
116
|
+
async keysChanged() {
|
|
117
|
+
await store.runs.relist({ flags: LISTING_KEYED });
|
|
118
|
+
},
|
|
119
|
+
async learningChanged(agentId) {
|
|
120
|
+
await store.runs.relist({ flags: LISTING_HELD, agentId });
|
|
121
|
+
},
|
|
122
|
+
async stop() {
|
|
123
|
+
closing = true;
|
|
124
|
+
clearTimeout(timer);
|
|
125
|
+
await pass;
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
package/dist/run-model-key.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// alone, read at each request, never enumerable and never on the env a tool, a harness or a sandbox runs under.
|
|
10
10
|
//
|
|
11
11
|
// No setting: what the server holds decides. A run with a model_key spends on it alone, outside its turn too (its
|
|
12
|
-
// subagents, learned nodes, end-of-run
|
|
12
|
+
// subagents, learned nodes, end-of-run compile turn), never on the server's key. A run without one spends on the server's
|
|
13
13
|
// key for its route, as before. A server that holds no key for a run's route (no AGENT_MODEL_API_KEY, nothing saved in
|
|
14
14
|
// Settings) is an operator saying "callers bring their own": a start or a message that would start a turn with no key
|
|
15
15
|
// to spend is 422 model_key_required, never a failure at the first model call. Spend after a run's turn ended (its key
|
|
@@ -5,7 +5,7 @@ import { withLearning } from "./learning-run.js";
|
|
|
5
5
|
import { runLearningEnd } from "./store-reads/learning.js";
|
|
6
6
|
import { heldNumber, redacted } from "./key-refusal.js";
|
|
7
7
|
import { runCutValues, runErrorWordsOf, underCut } from "./run-cut.js";
|
|
8
|
-
import { answersOf, asksOf, shownOf, withApprovalRows, withAsks, withBudgetRows, withOverCap } from "./run-view.js";
|
|
8
|
+
import { answersOf, asksOf, shownOf, stopAsked, withApprovalRows, withAsks, withBudgetRows, withOverCap } from "./run-view.js";
|
|
9
9
|
import { launchOf } from "./handed-values.js";
|
|
10
10
|
import { capNowOf } from "./runner/journal-kinds.js";
|
|
11
11
|
import { journalRecords } from "./runner/journal-reader.js";
|
|
@@ -34,7 +34,6 @@ export async function servedTimelineRows(deps, store, runId, context, calls = fa
|
|
|
34
34
|
const run = await snapshot.runs.get(runId);
|
|
35
35
|
const ended = run ? FINAL_STATES.includes(run.state) : false;
|
|
36
36
|
const records = await journalRecords(snapshot.readJournal(runId), context);
|
|
37
|
-
const final = run?.state === "stopped" || run?.state === "failed" ? run.state : undefined;
|
|
38
37
|
// A question the agent asked (ask_person) and waits on: its waiting row after the call's result (run-view.ts withAsks), as
|
|
39
38
|
// the run's view carries it and main's served Timeline did, so the console's "The agent asks" box reads that question,
|
|
40
39
|
// never an earlier wait's words.
|
|
@@ -44,6 +43,9 @@ export async function servedTimelineRows(deps, store, runId, context, calls = fa
|
|
|
44
43
|
// Over is not final: an agentic run a person stopped is final in the store but reads running in its view (readRun: its
|
|
45
44
|
// turn is over, the run can go on), and its usage row says what it has cost so far there, so here too.
|
|
46
45
|
const view = await readRun(snapshot, runId, context);
|
|
46
|
+
// And every call still waiting once a stop is asked and not yet taken, as the run's view reads it (stopAsked).
|
|
47
|
+
const final = run?.state === "stopped" || run?.state === "failed" ? run.state
|
|
48
|
+
: stopAsked(view, run, await snapshot.commands(runId, 0)) ? "stopped" : undefined;
|
|
47
49
|
const options = { redact, settled: ended, ended: view ? view.state !== "running" : false, ...(calls ? { calls: { result: CALL_RESULT_CHARS, redact: (text) => redacted(text, values, CALL_RESULT_CHARS), held: (value) => heldNumber(value, values) } } : {}) };
|
|
48
50
|
const timeline = await wholeAnswers(snapshot, runId, context, await runTimeline(snapshot, runId, context, options), options, wholeAnswerFor(values));
|
|
49
51
|
// A run whose booked spend passed its cap says so, by how much, after its usage row (run-view.ts withOverCap, as main's
|
|
@@ -58,7 +60,7 @@ export async function servedTimelineRows(deps, store, runId, context, calls = fa
|
|
|
58
60
|
const receipts = await decisionsOverStore(snapshot, runId, context).catch(() => null);
|
|
59
61
|
const decisionShown = { redact: (text) => redacted(text, values), hold: 6 * values.reduce((most, value) => Math.max(most, value.length), 0) + 16 };
|
|
60
62
|
const own = receipts === null || receipts.length ? withDecisions(rows, receipts, decisionShown, { ended }) : rows;
|
|
61
|
-
// The run's learning end, once its learning
|
|
63
|
+
// The run's learning end, once its learning merged or dropped (runLearningEnd).
|
|
62
64
|
const end = await runLearningEnd(snapshot, runId);
|
|
63
65
|
// Each trigger the rows name, read once for this read: its name now, or none for one gone.
|
|
64
66
|
const names = new Map();
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
|
+
import { type ServedTimelineDeps } from "./run-timeline-served.js";
|
|
3
|
+
import { type ApprovalAnswer } from "./run-view.js";
|
|
4
|
+
import type { Store } from "./store/store.js";
|
|
5
|
+
import { type EntryLike, type TimelineEvent } from "./timeline/index.js";
|
|
6
|
+
/** The most spans one read serves: the run's first, in the order they started. `dropped` counts the rest. */
|
|
7
|
+
export declare const TRACE_SPANS_MAX = 2000;
|
|
8
|
+
/** `reasoning`: the thinking tokens among `output`, where the provider reports them. */
|
|
9
|
+
export type TraceTokens = {
|
|
10
|
+
input: number;
|
|
11
|
+
cache_read: number;
|
|
12
|
+
cache_write: number;
|
|
13
|
+
output: number;
|
|
14
|
+
reasoning?: number;
|
|
15
|
+
};
|
|
16
|
+
/** How a span ended. `waiting`: a tool call held for its owner's approval, which has not run. `running`: a tool call
|
|
17
|
+
* with no result yet. `refused`: a call refused before it ran (a deny). `interrupted`: a request or a call cut before
|
|
18
|
+
* its end, or a call whose approval was withdrawn with its run. A model request is a span once it answered, so it is
|
|
19
|
+
* never waiting or running. */
|
|
20
|
+
export type TraceStatus = "ok" | "failed" | "refused" | "interrupted" | "waiting" | "running";
|
|
21
|
+
export type TraceSpan = {
|
|
22
|
+
/** The span's id in this trace: stable across reads of the run. */
|
|
23
|
+
id: string;
|
|
24
|
+
kind: "model" | "tool";
|
|
25
|
+
/** The span this one ran under: a tool call's, the model request that called it, or the call it nested in; a subagent's
|
|
26
|
+
* model request's, the call that started the subagent. Null at the top. */
|
|
27
|
+
parent_id: string | null;
|
|
28
|
+
/** A model request's model, as its answer names it (a decision's, the model its provider answered with, else the
|
|
29
|
+
* provider); a tool call's tool. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** The subagent the span ran in, as the Timeline labels it; a workflow decision's node. */
|
|
32
|
+
agent_label: string | null;
|
|
33
|
+
started_at: string;
|
|
34
|
+
/** Null while a tool call runs or waits, and for a span whose end the record does not keep (a request with no
|
|
35
|
+
* duration, a call cut with no result). */
|
|
36
|
+
ended_at: string | null;
|
|
37
|
+
status: TraceStatus;
|
|
38
|
+
/** A model request's stop reason, as pi names it (`stop`, `toolUse`, `length`, `error`, `aborted`). Null on a tool call. */
|
|
39
|
+
stop_reason: string | null;
|
|
40
|
+
/** A model request's tokens: `input` not read from cache, `cache_read`, `cache_write`, `output`. A decision's receipt
|
|
41
|
+
* keeps its input whole, so all of it is `input`. Null when the answer reported none (a cut request), and on a tool call. */
|
|
42
|
+
tokens: TraceTokens | null;
|
|
43
|
+
/** A model request's cost; a tool call's, the sum of the charges booked under it. Null when it is not known (a cut
|
|
44
|
+
* request, a charge of an unknown amount, a request whose run's cost is its booking's: `model_requests`), and on a
|
|
45
|
+
* call nothing was charged under (`charged`). */
|
|
46
|
+
usd: number | null;
|
|
47
|
+
/** Whether anything was charged under a tool call (a browser session's time, a paid tool's fee): `usd` is their sum.
|
|
48
|
+
* False on a model request. */
|
|
49
|
+
charged: boolean;
|
|
50
|
+
/** A workflow decision's request (a judge's, a route's, a verify's), which has a cost of its own whatever
|
|
51
|
+
* `model_requests` says of the run's other requests. False on every other span. */
|
|
52
|
+
decision: boolean;
|
|
53
|
+
/** A tool call whose tool has no price set: it ran outside the run's cost. */
|
|
54
|
+
not_metered: boolean;
|
|
55
|
+
/** The tool call's id, as its Timeline rows carry it. Null on a model request. */
|
|
56
|
+
tool_use_id: string | null;
|
|
57
|
+
input_preview: string | null;
|
|
58
|
+
result_preview: string | null;
|
|
59
|
+
result_size_bytes: number | null;
|
|
60
|
+
};
|
|
61
|
+
export type RunTrace = {
|
|
62
|
+
run_id: string;
|
|
63
|
+
/** What the run's record keeps of its model requests. `priced`: each is a span with its tokens and its cost.
|
|
64
|
+
* `tokens_only`: a workflow run. Each model node's request is a span with its tokens and no cost (the run's cost is
|
|
65
|
+
* its booking's); each decision is a span with its own cost. `not_recorded`: the harness's record keeps no request,
|
|
66
|
+
* so the spans are its tool calls alone. */
|
|
67
|
+
model_requests: "priced" | "tokens_only" | "not_recorded";
|
|
68
|
+
spans: TraceSpan[];
|
|
69
|
+
/** Spans left out past TRACE_SPANS_MAX. */
|
|
70
|
+
dropped: number;
|
|
71
|
+
};
|
|
72
|
+
/** What came of a call's approval, by the call's id: `decision` absent while it still waits; `answered_at`, when it was
|
|
73
|
+
* answered or withdrawn, where the journal says. */
|
|
74
|
+
export type TraceApprovals = ReadonlyMap<string, {
|
|
75
|
+
decision?: ApprovalAnswer["decision"];
|
|
76
|
+
answered_at?: string;
|
|
77
|
+
}>;
|
|
78
|
+
/** The approvals of a run's calls, from its journal's asks and answers (run-view.ts asksOf, answersOf), as its served
|
|
79
|
+
* Timeline reads them. `final`: the run's state where it is stopped or failed, whose end its journal may not hold. */
|
|
80
|
+
export declare function traceApprovals(entries: readonly {
|
|
81
|
+
kind?: string;
|
|
82
|
+
data?: unknown;
|
|
83
|
+
}[], final?: "stopped" | "failed"): TraceApprovals;
|
|
84
|
+
/** The spans of a run whose served Timeline rows are `rows` and whose journal entries are `entries` (as the store keeps
|
|
85
|
+
* them: runEntries). `redact`: the run's cut, for the one text taken from an entry (a model's name); every other word is
|
|
86
|
+
* a row's, cut already. `approvals`: what came of each call that asked for one (traceApprovals): how such a call ended
|
|
87
|
+
* is read from there, never from its rows, which the Timeline rewords while it waits. `decisions`: a workflow run's
|
|
88
|
+
* decision receipts (store-reads/decisions.ts), each a model request of its own: a judge's, a route's, a verify's. */
|
|
89
|
+
export declare function traceSpans(rows: readonly TimelineEvent[], entries: readonly EntryLike[], options?: {
|
|
90
|
+
redact?: (text: string) => string;
|
|
91
|
+
approvals?: TraceApprovals;
|
|
92
|
+
decisions?: readonly Record<string, unknown>[];
|
|
93
|
+
}): Pick<RunTrace, "model_requests" | "spans" | "dropped">;
|
|
94
|
+
/** Run `runId`'s trace as served: its spans over its served Timeline rows and its journal, the model's name through the
|
|
95
|
+
* run's cut. A run withheld (its sign-in can't be read back here) is refused (403), as its graph and its files are:
|
|
96
|
+
* none of its words is served, and an empty trace would read as a run that did nothing. */
|
|
97
|
+
export declare function servedRunTrace(deps: ServedTimelineDeps, store: Store, runId: string, context: Context): Promise<RunTrace>;
|