@parcha/agentrun-serve 0.1.0-beta.43 → 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 +231 -0
- package/README.md +580 -320
- 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 +92 -22
- package/dist/composio-preset.d.ts +4 -3
- package/dist/composio-preset.js +81 -11
- package/dist/composio-triggers.d.ts +34 -2
- package/dist/composio-triggers.js +261 -31
- 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/computer-lost.d.ts +11 -0
- package/dist/computer-lost.js +19 -0
- package/dist/computer-record.d.ts +10 -2
- package/dist/computer-record.js +50 -18
- package/dist/computer-setting.d.ts +1 -0
- package/dist/computer-setting.js +2 -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 +4 -1
- package/dist/errors.js +10 -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 +59 -3
- package/dist/harness-table.js +119 -14
- package/dist/harness.d.ts +17 -1
- package/dist/harness.js +22 -11
- package/dist/host.d.ts +12 -10
- package/dist/host.js +19 -16
- package/dist/import-worker.d.ts +3 -0
- package/dist/import-worker.js +7 -5
- package/dist/import.d.ts +22 -1
- package/dist/import.js +141 -28
- 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 +26 -89
- package/dist/learn/check.js +58 -336
- 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 +88 -103
- package/dist/learn/corrections.d.ts +13 -0
- package/dist/learn/corrections.js +23 -0
- package/dist/learn/delete.d.ts +17 -0
- package/dist/learn/delete.js +42 -0
- 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 +20 -2
- package/dist/learn/promote.js +17 -4
- package/dist/learn/{skills.d.ts → workflow-draft.d.ts} +34 -38
- package/dist/learn/{skills.js → workflow-draft.js} +65 -59
- package/dist/learn/workflow-nodes.d.ts +22 -1
- package/dist/learn/workflow-nodes.js +29 -10
- package/dist/learned-workflow.js +2 -2
- package/dist/learning-cost.d.ts +127 -13
- package/dist/learning-cost.js +142 -10
- package/dist/learning-routes.d.ts +99 -170
- package/dist/learning-routes.js +199 -420
- 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 +62 -393
- package/dist/learning.js +101 -651
- package/dist/listen-first.d.ts +30 -0
- package/dist/listen-first.js +115 -0
- package/dist/live-reach.d.ts +25 -2
- package/dist/live-reach.js +46 -4
- package/dist/llms.txt +2 -1
- package/dist/local-models.d.ts +3 -11
- package/dist/local-models.js +5 -6
- package/dist/mcp-servers-store.d.ts +16 -16
- package/dist/model-form.js +6 -5
- package/dist/model.d.ts +12 -4
- package/dist/model.js +41 -16
- 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 +375 -347
- package/dist/owner.d.ts +8 -0
- package/dist/owner.js +11 -0
- package/dist/paid-calls.d.ts +14 -0
- package/dist/paid-calls.js +31 -1
- package/dist/particle-provider.d.ts +11 -0
- package/dist/particle-provider.js +135 -0
- package/dist/place.d.ts +8 -3
- package/dist/place.js +13 -9
- 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 +30 -2
- 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 +16 -90
- package/dist/run-listing.d.ts +34 -0
- package/dist/run-listing.js +128 -0
- package/dist/run-model-key.d.ts +64 -0
- package/dist/run-model-key.js +147 -0
- 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 +14 -6
- package/dist/runner/adapter-loop.js +25 -14
- package/dist/runner/adapter-run-spec.d.ts +22 -7
- package/dist/runner/adapter-run-spec.js +130 -77
- package/dist/runner/adapters/index.d.ts +4 -2
- package/dist/runner/adapters/index.js +35 -4
- package/dist/runner/adapters/pi.d.ts +4 -12
- package/dist/runner/adapters/pi.js +2 -2
- package/dist/runner/audit.d.ts +5 -1
- package/dist/runner/audit.js +31 -12
- package/dist/runner/beside.d.ts +7 -2
- package/dist/runner/beside.js +41 -9
- package/dist/runner/claim-secrets.d.ts +66 -1
- package/dist/runner/claim-secrets.js +136 -3
- package/dist/runner/cli-run-spec.d.ts +2 -1
- package/dist/runner/cli-run-spec.js +82 -59
- package/dist/runner/commands.d.ts +3 -6
- 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 +5 -4
- package/dist/runner/feedback-round.js +14 -10
- package/dist/runner/github-app.js +3 -1
- package/dist/runner/harness-loops.d.ts +0 -8
- package/dist/runner/harness-loops.js +30 -56
- package/dist/runner/held.d.ts +170 -0
- package/dist/runner/held.js +57 -0
- package/dist/runner/journal-kinds.d.ts +7 -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 -66
- package/dist/runner/learning-end.js +250 -299
- package/dist/runner/learning-seed.d.ts +15 -33
- package/dist/runner/learning-seed.js +24 -45
- package/dist/runner/loop-contract.d.ts +8 -3
- package/dist/runner/loop-contract.js +4 -0
- package/dist/runner/loop.js +6 -2
- package/dist/runner/main.d.ts +18 -9
- package/dist/runner/main.js +82 -22
- package/dist/runner/mcp-run.d.ts +11 -0
- package/dist/runner/mcp-run.js +67 -0
- package/dist/runner/memory-claim.d.ts +14 -6
- package/dist/runner/memory-claim.js +18 -9
- 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 +13 -6
- package/dist/runner/promotion.js +63 -17
- package/dist/runner/reflect-hook.d.ts +64 -91
- package/dist/runner/reflect-hook.js +112 -206
- 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 +58 -9
- 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 +14 -6
- package/dist/runner/workflow-first.d.ts +5 -0
- package/dist/runner/workflow-first.js +4 -0
- package/dist/runner/workflow-spec.js +17 -4
- package/dist/runs-over-store.d.ts +21 -32
- package/dist/runs-over-store.js +44 -41
- package/dist/sdk/runs.d.ts +6 -11
- package/dist/sdk/runs.js +20 -41
- package/dist/sdk/schema.js +3 -4
- package/dist/sdk/workflows.d.ts +1 -1
- 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 +119 -83
- package/dist/server.js +1121 -419
- 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 +3 -3
- package/dist/store/index.js +2 -2
- 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/seal.d.ts +20 -2
- package/dist/store/seal.js +24 -8
- package/dist/store/sqlite/connection.d.ts +2 -0
- package/dist/store/sqlite/connection.js +3 -1
- package/dist/store/sqlite/run-launch.d.ts +4 -1
- package/dist/store/sqlite/run-launch.js +12 -0
- package/dist/store/sqlite/run-patch.d.ts +0 -17
- package/dist/store/sqlite/run-patch.js +4 -33
- package/dist/store/sqlite/store.d.ts +3 -2
- package/dist/store/sqlite/store.js +360 -75
- package/dist/store/sqlite/worker.js +25 -0
- package/dist/store/store.d.ts +231 -39
- package/dist/store/store.js +25 -3
- package/dist/store-reads/analytics.js +11 -1
- package/dist/store-reads/learning.d.ts +131 -194
- package/dist/store-reads/learning.js +292 -301
- package/dist/store-reads/loop.d.ts +0 -1
- package/dist/store-reads/loop.js +1 -1
- package/dist/store-reads/stats.js +13 -3
- package/dist/store-view.d.ts +34 -2
- package/dist/store-view.js +108 -41
- package/dist/telemetry.d.ts +59 -0
- package/dist/telemetry.js +153 -0
- 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/tool-plane.d.ts +12 -12
- package/dist/tools.d.ts +13 -13
- package/dist/tools.js +29 -9
- package/dist/trigger-adapter.d.ts +3 -0
- package/dist/trigger-adapters.d.ts +4 -0
- package/dist/trigger-adapters.js +13 -0
- package/dist/trigger-composio.d.ts +58 -1
- package/dist/trigger-composio.js +160 -6
- package/dist/triggers.d.ts +64 -5
- package/dist/triggers.js +141 -17
- package/dist/validate.d.ts +11 -7
- package/dist/validate.js +9 -8
- 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 +22 -8
- package/dist/workspace/computer-for-claim.js +339 -46
- 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 +41 -21
- 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 -9
- 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-BrcDSBD8.css +0 -1
- package/dist/console/assets/index-Bz6IWncl.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 -33
- package/dist/learning-evals.js +0 -98
- 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
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { type ItemStatus, type Learning, type
|
|
1
|
+
import { type ItemStatus, type Learning, type Shown } from "../learning.js";
|
|
2
2
|
import { type RunLaunch } from "../run-launch.js";
|
|
3
3
|
import { type Impact, type ImpactLearning } from "../learning-run.js";
|
|
4
|
-
import { type CostReplay, type CostRun, type CostSummary, type RunPath, runCostOf } from "../learning-cost.js";
|
|
4
|
+
import { amortize, type Bill, type CostReplay, type CostRun, type CostSummary, type RunPath, runCostOf } from "../learning-cost.js";
|
|
5
5
|
import { type PastRun, workflowCostsOf } from "../runner/workflow-first.js";
|
|
6
6
|
import { type Reflect } from "../reflect-range.js";
|
|
7
|
-
import type { NoteRuns } from "../learning.js";
|
|
8
7
|
import type { EntryLike, TimelineEvent } from "../timeline/index.js";
|
|
9
8
|
import type { AnalyticsFilter } from "./analytics.js";
|
|
10
|
-
import { type KeptProposal } from "../runner/learning-loop.js";
|
|
11
9
|
import { type PromotionRecord } from "../learn/promote.js";
|
|
12
10
|
import type { LearningProposal, Store } from "../store/store.js";
|
|
13
11
|
/** A run's learning end: the Learning fields its end sets. */
|
|
14
|
-
export type RunLearningEnd =
|
|
15
|
-
/** The kept row as the end-of-run hook writes it (runner/reflect-hook.ts)
|
|
16
|
-
* when the job answered, its cost and what looking back cost once the run looked back. */
|
|
12
|
+
export type RunLearningEnd = Learning;
|
|
13
|
+
/** The kept row as the end-of-run hook writes it (runner/reflect-hook.ts), read as untrusted. */
|
|
17
14
|
type KeptRow = {
|
|
18
|
-
readonly state?:
|
|
19
|
-
readonly reason?:
|
|
20
|
-
readonly detail?:
|
|
15
|
+
readonly state?: unknown;
|
|
16
|
+
readonly reason?: unknown;
|
|
17
|
+
readonly detail?: unknown;
|
|
21
18
|
readonly problems?: Learning["problems"];
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
19
|
+
readonly merged?: unknown;
|
|
20
|
+
readonly workflows?: Learning["workflows"];
|
|
21
|
+
readonly corrections?: unknown;
|
|
22
|
+
readonly compiled?: unknown;
|
|
23
|
+
readonly draft_errors?: unknown;
|
|
24
24
|
readonly answered_at?: unknown;
|
|
25
25
|
readonly job_cost_usd?: unknown;
|
|
26
26
|
readonly look_back_usd?: unknown;
|
|
27
27
|
};
|
|
28
|
-
/** What a kept row says of a run that looked back (
|
|
28
|
+
/** What a kept row says of a run that looked back (its compile turn's figures): none for one that did not. */
|
|
29
29
|
declare function answeredOf(row: KeptRow): Pick<Learning, "answered_at" | "job_cost_usd" | "look_back_usd">;
|
|
30
|
-
/** The reads of a run's records a learning read makes: its launch, a round of its kept learning, a run's row
|
|
31
|
-
*
|
|
30
|
+
/** The reads of a run's records a learning read makes: its launch, a round of its kept learning, a run's row. The
|
|
31
|
+
* store's own reads, one a run, or an agent's read at once (agentRecordsOf). */
|
|
32
32
|
export type RunRecords = {
|
|
33
33
|
/** `learningStart`: a run's learning start read from the agent's one narrow read (agentRecordsOf), when it was; absent, the run's launch is read. */
|
|
34
34
|
readonly runs: Pick<Store["runs"], "launch" | "get"> & {
|
|
@@ -36,17 +36,17 @@ export type RunRecords = {
|
|
|
36
36
|
};
|
|
37
37
|
readonly learning: Pick<Store["learning"], "proposal">;
|
|
38
38
|
};
|
|
39
|
-
/** Agent `agentId`'s runs' records read at once, whatever their number: its runs' launches (Store.runs.
|
|
40
|
-
* round its runs' learning kept
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
39
|
+
/** Agent `agentId`'s runs' records read at once, whatever their number: its runs' launches (Store.runs.learningStarts)
|
|
40
|
+
* and every round its runs' learning kept (Store.learning.kept), two reads beside `listed` (its runs, as runs.list read
|
|
41
|
+
* them). Each answers as the store's per-run read does: a run of `listed` with no launch row is StoreLaunchMissing, one
|
|
42
|
+
* that kept no learning has no round. A run not of `listed` is read from the store, but for an audit's shadow run:
|
|
43
|
+
* `listed` is every run of the agent, its shadows among them. */
|
|
44
44
|
export declare function agentRecordsOf(store: Store, agentId: string, listed: readonly RunRecord[]): Promise<RunRecords>;
|
|
45
|
-
/** Run `runId`'s learning end (its newest round's, or round `round`'s); null when the run kept no learning.
|
|
46
|
-
|
|
45
|
+
/** Run `runId`'s learning end (its newest round's, or round `round`'s); null when the run kept no learning. `records`:
|
|
46
|
+
* where its rows are read (the store's per-run reads by default). */
|
|
47
|
+
export declare function runLearningEnd(store: Pick<RunRecords, "learning">, runId: string, round?: number, records?: Pick<RunRecords, "learning">): Promise<RunLearningEnd | null>;
|
|
47
48
|
/** How the runs that tried to learn fared (GET /stats's `learning`): `runs` with a learning end, `merged`, `dropped` by
|
|
48
|
-
* reason, and `in_progress` (
|
|
49
|
-
* learningStats). */
|
|
49
|
+
* reason, and `in_progress` (any other state). */
|
|
50
50
|
export type LearningCounts = {
|
|
51
51
|
runs: number;
|
|
52
52
|
merged: number;
|
|
@@ -56,13 +56,12 @@ export type LearningCounts = {
|
|
|
56
56
|
/** GET /stats's learning counts from the one store, over the runs `filter` picks as the analytics pick them (not archived,
|
|
57
57
|
* their own or their agent's; started in [from, to); of `agent`): an agentic run with a learning end counts, its end
|
|
58
58
|
* read as the run's view reads it (runLearningEnd). A workflow's run, and one with no learning, is not counted; nor is
|
|
59
|
-
* one whose reason this server does not give
|
|
60
|
-
*
|
|
59
|
+
* one whose reason this server does not give. An imported run keeps no learning in the store. Each agent's runs'
|
|
60
|
+
* records are read at once (agentRecordsOf; `records`, already read for `filter.agent`), never a read a run. */
|
|
61
61
|
export declare function learningCountsOverStore(store: Store, filter: AnalyticsFilter, records?: RunRecords): Promise<LearningCounts>;
|
|
62
62
|
/** What learning spent outside any run (GET /usage's `learning` meter) in [from, to) (ms), one entry per run whose
|
|
63
|
-
* learning ended then
|
|
64
|
-
*
|
|
65
|
-
* of the store (Learning.spend), whatever the number of runs. */
|
|
63
|
+
* learning ended then: its agent, when its learning ended, and what it spent outside the run. One read of the store
|
|
64
|
+
* (Learning.spend), whatever the number of runs. */
|
|
66
65
|
export declare function learningSpendOverStore(store: Store, window: {
|
|
67
66
|
from: number;
|
|
68
67
|
to: number;
|
|
@@ -71,32 +70,28 @@ export declare function learningSpendOverStore(store: Store, window: {
|
|
|
71
70
|
at: string;
|
|
72
71
|
cost: number | null;
|
|
73
72
|
}[]>;
|
|
74
|
-
/** An agent's learning counts as its learning view gives them (GET /agents/{id}/learning
|
|
75
|
-
*
|
|
76
|
-
* agentLearningOverStore's. */
|
|
73
|
+
/** An agent's learning counts as its learning view gives them (GET /agents/{id}/learning): how its runs that tried to
|
|
74
|
+
* learn fared, less `runs`, from the one store. */
|
|
77
75
|
export declare function agentLearningCountsOverStore(store: Store, agentId: string, records?: RunRecords): Promise<Omit<LearningCounts, "runs">>;
|
|
78
|
-
/** Agent `agentId`'s learning view from the one store (GET /agents/{id}/learning
|
|
79
|
-
* (
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* launch's seedNotes: every note in its seed, before the budget picked the given ones (main's seed_notes). Its runs'
|
|
84
|
-
* launches and learning are read at once (agentRecordsOf), and a settled run's journal once a server (settledCache):
|
|
85
|
-
* a read a run only the first time it is seen. */
|
|
76
|
+
/** Agent `agentId`'s learning view from the one store (GET /agents/{id}/learning): its counts (agentLearningCountsOverStore)
|
|
77
|
+
* and what learning changed (learningImpact), never a run's files. Each run's part is read from its launch (the
|
|
78
|
+
* corrections and workflows it started from), its journal (the workflows its claims laid) and its learning end (when its
|
|
79
|
+
* job answered and what it and looking back cost). Its runs' launches and learning are read at once (agentRecordsOf),
|
|
80
|
+
* and a settled run's journal once a server (settledCache). */
|
|
86
81
|
export declare function agentLearningOverStore(store: Store, agentId: string): Promise<{
|
|
87
82
|
counts: Omit<LearningCounts, "runs">;
|
|
88
83
|
impact: Impact;
|
|
89
|
-
notes: NoteRuns;
|
|
90
84
|
}>;
|
|
91
85
|
/** Agent `agentId`'s cost per run from the one store (GET /agents/{id}/learning/cost, learning-cost.ts): each of its
|
|
92
|
-
* agentic runs that ended (ended, stopped or failed), oldest first,
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
86
|
+
* agentic runs that ended (ended, stopped or failed), oldest first, each run that does a job numbered from 1 (a replay
|
|
87
|
+
* none: the bill's numbering), with its own cost and what learning added for it (runCostOf over its row's cost and its
|
|
88
|
+
* learning's spend, learningSpendOf), the path it took and the learned workflow it ran (its run record's, pathOfRow), the
|
|
89
|
+
* revision of that workflow (metrics.workflow_digest) and whether an audit's shadow ran for it; and what
|
|
90
|
+
* the series shows (costSummary). A run still at work, an imported or archived one and a workflow revision's run are left
|
|
91
|
+
* out. A run that learns whose record names no path (its end's patch was late or failed, or no runner wrote its end) is
|
|
92
|
+
* left out too and counted (`unknown_path_runs`): its path and cost are not known, never `agent` at $0. `limit`: the
|
|
93
|
+
* latest runs shown, each keeping its number; the summary is over every run; `bill` is the owner's bill over all of
|
|
94
|
+
* them (billOf, with the revision ledger: agentLedgerOf). */
|
|
100
95
|
export declare function agentCostOverStore(store: Store, agentId: string, limit?: number): Promise<{
|
|
101
96
|
runs: CostRun[];
|
|
102
97
|
summary: CostSummary;
|
|
@@ -104,7 +99,45 @@ export declare function agentCostOverStore(store: Store, agentId: string, limit?
|
|
|
104
99
|
unknown_cost_runs: number;
|
|
105
100
|
unknown_path_runs: number;
|
|
106
101
|
workflows: ReturnType<typeof workflowCostsOf>;
|
|
102
|
+
bill: Bill;
|
|
107
103
|
}>;
|
|
104
|
+
type LedgerRow = Pick<RunRecord, "id" | "metrics" | "startedAt" | "costUsd" | "costAtMostUsd">;
|
|
105
|
+
/** A compile turn a run's end-of-run step asked (runner/reflect-hook.ts), as its kept round says it: the revision it
|
|
106
|
+
* drafted (`digest`, null when every draft failed its checks, or the turn was stopped or capped before a draft was kept,
|
|
107
|
+
* so it drafted none; `workflow` null for the latter, which kept no draft's name) and what its turn spent (`usd`, the
|
|
108
|
+
* round's `look_back_usd`: the step's only model turn is its compile turn, so that one figure is the compile's; null when
|
|
109
|
+
* unknown). */
|
|
110
|
+
export type CompileSpend = {
|
|
111
|
+
readonly workflow: string | null;
|
|
112
|
+
readonly digest: string | null;
|
|
113
|
+
readonly usd: number | null;
|
|
114
|
+
};
|
|
115
|
+
/** Each revision of the agent's learned workflows (one per workflow and digest its promotion records name, in the order
|
|
116
|
+
* they were first recorded) with its learning spend, and what its served runs carry of it (amortize), over `rows`: the
|
|
117
|
+
* agent's ended runs that do a job or check one (no shadow, no imported or archived run). A revision is its workflow and
|
|
118
|
+
* its digest, never the digest alone: two workflows of the same text share a digest, and each pays its own way. Its
|
|
119
|
+
* spend is the compile turns that drafted it (`compiles` of its workflow at its digest: a recompile drafts a revision of
|
|
120
|
+
* its own) and its check (the replay runs that ran it: metrics.path `replay` of its workflow at its digest); unknown
|
|
121
|
+
* once a part's cost is (null, or only a bound). A compile whose drafts all failed drafted none: no revision carries it
|
|
122
|
+
* (the bill's unattributed does). It is spread over its first K served runs (`workflow` or `handed_back` of its workflow
|
|
123
|
+
* at its digest), K its check's compile_after; `state` from its newest record. */
|
|
124
|
+
export declare function revisionLedgerOf(records: readonly PromotionRecord[], rows: readonly LedgerRow[], compiles?: readonly CompileSpend[]): ReturnType<typeof amortize>;
|
|
125
|
+
/** Run `runId`'s path and its costs as GET /runs/{id} shows them (A8): `path` its record's (metrics.path, RUN_PATHS:
|
|
126
|
+
* `agent` for a run that does not learn; null while it has not ended, for a workflow revision's run, and for a run that
|
|
127
|
+
* learns whose end named none); `usd` its own spend, the job's (runCostOf's `cost_usd`: its row's cost, `rowUsd` when
|
|
128
|
+
* given, less its compile turns; null while unknown); `learning_usd` what learning spent for it: its follow-up rounds'
|
|
129
|
+
* turns (learningSpendOf less its compile turns, each its revision's), its audit shadow's cost, and its share of its
|
|
130
|
+
* revision's compile and check (revisionLedgerOf); `all_in_usd` the two. A replay or a shadow run carries none: its
|
|
131
|
+
* spend is on the runs it serves, so its `learning_usd` and `all_in_usd` are 0, and the sum of every run's `all_in_usd`
|
|
132
|
+
* and the bill's `unattributed_usd` is the booked total. While the run is at work `usd` is `rowUsd` and the rest null;
|
|
133
|
+
* null while unknown (its shadow still at work, a compile's or a check's cost unknown), never $0. Undefined for an
|
|
134
|
+
* unknown run. */
|
|
135
|
+
export declare function runAllInOverStore(store: Store, runId: string, rowUsd?: number | null): Promise<{
|
|
136
|
+
path: RunPath | null;
|
|
137
|
+
usd: number | null;
|
|
138
|
+
learning_usd: number | null;
|
|
139
|
+
all_in_usd: number | null;
|
|
140
|
+
} | undefined>;
|
|
108
141
|
/** The check the serving promotion was decided on, as the cost summary says it: the champion (championOf) of the learned
|
|
109
142
|
* workflow the newest run a learned workflow ran first on ran (`workflow` or `handed_back`), its record's check numbers
|
|
110
143
|
* (the share of the inputs it ran on that said what the agent said, against the agent's own 100%). `cleared`: it passed
|
|
@@ -112,25 +145,19 @@ export declare function agentCostOverStore(store: Store, agentId: string, limit?
|
|
|
112
145
|
* on no input (a dry run). */
|
|
113
146
|
export declare function servingReplayOf(records: readonly PromotionRecord[], runs: readonly CostRun[]): CostReplay | null;
|
|
114
147
|
/** What run `runId`'s learning spent, as its cost per run counts it, over every round a follow-up opened (roundsOf): what
|
|
115
|
-
* it kept as it answered (
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
|
|
120
|
-
* its look-back here, `rowUsd` (the run's row cost) less that job (roundsLooked). */
|
|
121
|
-
export declare function learningSpendOf(store: RunRecords, runId: string, rowUsd: number | null): Promise<{
|
|
122
|
-
looked: ReturnType<typeof answeredOf> | null;
|
|
123
|
-
grade: number | null;
|
|
124
|
-
}>;
|
|
148
|
+
* it kept as it answered (answeredOf). A run a follow-up opened again (roundsSpendOf's figures): its job is what it had
|
|
149
|
+
* cost when its first round answered, and everything after (each later round's follow-up turn and every round's
|
|
150
|
+
* look-back: feedback the run was given is learning, never the job) is its look-back here, `rowUsd` (the run's row cost)
|
|
151
|
+
* less that job (roundsLooked). */
|
|
152
|
+
export declare function learningSpendOf(store: RunRecords, runId: string, rowUsd: number | null): Promise<ReturnType<typeof answeredOf> | null>;
|
|
125
153
|
/** Every round run `runId` kept (one a follow-up opened again is a round past its first), oldest first: none when it kept
|
|
126
154
|
* no learning. The store's proposal(runId) is the newest round alone; a read of what the run's learning did or spent
|
|
127
155
|
* reads them all. */
|
|
128
156
|
export declare function roundsOf(store: Pick<RunRecords, "learning">, runId: string): Promise<LearningProposal[]>;
|
|
129
157
|
type RunRecord = NonNullable<Awaited<ReturnType<Store["runs"]["get"]>>>;
|
|
130
|
-
/** A run's own cost and what learning added for it (runCostOf): its row's cost, every round of its learning
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* the cost page shows and the money rule reads (pastRunsOverStore); null when any part is unknown. */
|
|
158
|
+
/** A run's own cost and what learning added for it (runCostOf): its row's cost, every round of its learning
|
|
159
|
+
* (learningSpendOf) and its audit's shadow run (shadowSpendOf). `total_usd` is the run's all-in cost, the one the cost page shows and the money rule reads
|
|
160
|
+
* (pastRunsOverStore); null when any part is unknown. */
|
|
134
161
|
export declare function allInOf(store: RunRecords, run: RunRecord): Promise<ReturnType<typeof runCostOf>>;
|
|
135
162
|
/** What run `runId`'s audit shadow run (runner/audit.ts) adds to its all-in cost: `open` while it is queued or running
|
|
136
163
|
* (its cost not known yet: `usd` null, never $0), else its cost once it ended, stopped or failed (null: unknown); 0 when
|
|
@@ -141,14 +168,19 @@ export declare function shadowSpendOf(store: {
|
|
|
141
168
|
open: boolean;
|
|
142
169
|
usd: number | null;
|
|
143
170
|
}>;
|
|
144
|
-
/** One run of the cost series, as number `n` of it: its figures (allInOf)
|
|
145
|
-
* and
|
|
146
|
-
|
|
171
|
+
/** One run of the cost series, as number `n` of it (null for a replay): its figures (allInOf), its path, the workflow
|
|
172
|
+
* revision that ran it and whether an audit's shadow ran for it (agentCostOverStore's loop body); `took_over` is the
|
|
173
|
+
* series' (tookOverOf). */
|
|
174
|
+
export declare function costRunOf(store: RunRecords, run: RunRecord, n: number | null): Promise<Omit<CostRun, "took_over">>;
|
|
147
175
|
/** The runs the money rule reads for agent `agentId` (runner/workflow-first.ts costLineOf), one set for the run's launch
|
|
148
176
|
* and the cost page: of its newest PAST_RUNS runs, each that ended (ended, stopped or failed), is neither imported nor
|
|
149
177
|
* archived nor a workflow revision's run, with its all-in cost (allInOf). `known`: all-in costs already read, by run id
|
|
150
178
|
* (the cost page's series), read again for no run; `records`, where any other's rows are read (the store's by default). */
|
|
151
179
|
export declare function pastRunsOverStore(store: Store, agentId: string, known?: ReadonlyMap<string, number | null>, records?: RunRecords): Promise<PastRun[]>;
|
|
180
|
+
/** The money rule's decision for agent `agentId` (runner/workflow-first.ts costStopOf) over the runs a run's launch reads
|
|
181
|
+
* (pastRunsOverStore), as the launch reads them: runs that can't be read now stop nothing (workflowFirstOf serves). What
|
|
182
|
+
* the promotions read and the learning view fold into each workflow's state (learn/promote.ts servingStateOf). */
|
|
183
|
+
export declare const costStopOverStore: (store: Store, agentId: string) => Promise<import("../learn/promote.js").CostStop>;
|
|
152
184
|
/** The path run `runId` took and the learned workflow it ran, the one classifier its run record keeps (metrics.path,
|
|
153
185
|
* metrics.workflow, metrics.workflow_digest: workflow-first.ts pathMetrics, written at the run's end) and its cost per run
|
|
154
186
|
* reads (pathOfRow). A run its learned workflow served first (its WORKFLOW_FIRST entry, servedOf): `workflow` when it
|
|
@@ -163,23 +195,19 @@ export declare function runPathOverStore(store: Store, runId: string, started: R
|
|
|
163
195
|
digest?: string;
|
|
164
196
|
promotion?: number;
|
|
165
197
|
}>;
|
|
166
|
-
/** What a run's claim laid of its learning seed: the learned
|
|
198
|
+
/** What a run's claim laid of its learning seed: the learned workflows it was given, by name. */
|
|
167
199
|
type Laid = {
|
|
168
|
-
readonly skills: readonly string[];
|
|
169
200
|
readonly workflows: readonly string[];
|
|
170
201
|
};
|
|
171
|
-
/** What every claim of a run laid, from its learningLaid entries, each name once
|
|
172
|
-
* claim's skill folders there already and lays none of them again, though the run still has them. None laid when it has
|
|
173
|
-
* no entry. */
|
|
202
|
+
/** What every claim of a run laid, from its learningLaid entries, each name once. None laid when it has no entry. */
|
|
174
203
|
export declare function laidOf(entries: readonly Pick<EntryLike, "kind" | "data">[]): Laid;
|
|
175
204
|
/** What every round of a run that a follow-up opened again spent (undefined for a run with one round): when its first
|
|
176
|
-
* round's job answered and what the job cost to then, the look-backs of every round added up
|
|
177
|
-
*
|
|
205
|
+
* round's job answered and what the job cost to then, and the look-backs of every round added up. A figure that is
|
|
206
|
+
* unknown in any round is unknown (null). */
|
|
178
207
|
type RoundsSpend = {
|
|
179
208
|
answered_at: string;
|
|
180
209
|
job_cost_usd: number | null;
|
|
181
210
|
look_back_usd: number | null;
|
|
182
|
-
grade_usd: number | null;
|
|
183
211
|
};
|
|
184
212
|
/** What a run with rounds (`rounds`) kept as it answered, as its cost per run and its impact both read it: its job is
|
|
185
213
|
* what it had cost when its first round answered; everything its row (`rowUsd`) spent after that (each later round's
|
|
@@ -187,35 +215,15 @@ type RoundsSpend = {
|
|
|
187
215
|
* unknown when the row's cost is and the job's is known (the request no one priced came after the job answered: a later
|
|
188
216
|
* round stopped mid-request keeps no figures, so the rounds' sum would read short as if settled); the rounds'
|
|
189
217
|
* look-backs added up when the job's cost is unknown. */
|
|
190
|
-
export declare function roundsLooked(rounds: RoundsSpend, rowUsd: number | null):
|
|
191
|
-
answered_at: string;
|
|
192
|
-
job_cost_usd: number | null;
|
|
193
|
-
look_back_usd: number | null;
|
|
194
|
-
};
|
|
218
|
+
export declare function roundsLooked(rounds: RoundsSpend, rowUsd: number | null): RoundsSpend;
|
|
195
219
|
export declare function roundsSpendOf(store: RunRecords, runId: string): Promise<RoundsSpend | undefined>;
|
|
196
|
-
/** What a run's learning end tells its impact
|
|
197
|
-
*
|
|
198
|
-
* not); its grade's cost once it ended (0 when nothing was graded). */
|
|
220
|
+
/** What a run's learning end tells its impact: how it ended and when, the corrections and workflows it started from, when
|
|
221
|
+
* its job answered and its costs once it looked back (a look-back of 0 for an ended one that did not). */
|
|
199
222
|
export declare function impactLearningOf(end: RunLearningEnd, started: RunLaunch["learning"], laid: Laid | undefined, rounds?: RoundsSpend, rowUsd?: number | null): ImpactLearning;
|
|
200
|
-
/**
|
|
201
|
-
*
|
|
202
|
-
|
|
203
|
-
readonly given?: NoteUsed[];
|
|
204
|
-
readonly read?: NoteUsed[];
|
|
205
|
-
};
|
|
206
|
-
/** The notes a run's job read (learning-run.ts noteRead's rule, over the runner's journal rows): its own successful
|
|
207
|
-
* `read` calls on a file of its copy of the folder, the end-of-run turn's (`reflect`) left out, keyed on the notes it was
|
|
208
|
-
* `given` and named as given. A file it was not given (MEMORY.md, one it wrote, one not in its seed) is not one of them. */
|
|
209
|
-
export declare function notesReadOf(given: readonly NoteUsed[] | undefined, reflect: Pick<Reflect, "after" | "until"> | undefined, rows: readonly TimelineEvent[]): NoteUsed[];
|
|
210
|
-
/** What a run's job did with the learned skills and workflows its launch offered it (GET /runs/{id}/learning `used`:
|
|
211
|
-
* its `skills` and `workflows`, apart from the skills and workflows it learned): each skill, and whether the job read its SKILL.md (a read of `.agents/skills/<name>/SKILL.md`, or a
|
|
212
|
-
* harness's own skill tool on it); each learned workflow the job called, by the call's `name` (callArgsOf), how
|
|
213
|
-
* many calls and how many failed. The end-of-run turn's rows are left out, as notesRead leaves them. */
|
|
223
|
+
/** What a run's job did with the learned workflows its launch offered it (GET /runs/{id}/learning `used`): each learned
|
|
224
|
+
* workflow the job called, by the call's `name` (callArgsOf), how many calls and how many failed. The end-of-run turn's
|
|
225
|
+
* rows are left out. */
|
|
214
226
|
export type LearnedUse = {
|
|
215
|
-
readonly skills: readonly {
|
|
216
|
-
readonly name: string;
|
|
217
|
-
readonly read: boolean;
|
|
218
|
-
}[];
|
|
219
227
|
readonly workflows: readonly {
|
|
220
228
|
readonly name: string;
|
|
221
229
|
readonly calls: number;
|
|
@@ -224,53 +232,33 @@ export type LearnedUse = {
|
|
|
224
232
|
};
|
|
225
233
|
/** Each tool call of a run's journal, by its call's id: its tool and the arguments it was called with, as recorded (pi's
|
|
226
234
|
* call in its assistant entry, a CLI harness's in its record's call start). A timeline row's input preview is cut and
|
|
227
|
-
* for some tools absent, so what a call
|
|
235
|
+
* for some tools absent, so what a call ran is read from these. */
|
|
228
236
|
export declare function callArgsOf(entries: readonly EntryLike[]): Map<string, {
|
|
229
237
|
tool: string;
|
|
230
238
|
args: Record<string, unknown>;
|
|
231
239
|
}>;
|
|
232
|
-
/** The
|
|
233
|
-
|
|
234
|
-
* and never as a host tool's call record, so no timeline row or callArgsOf entry has it. Each by the name the model
|
|
235
|
-
* gave (`agentrun:<name>` or the bare one), only when its step completed, and only outside every end-of-run turn (a
|
|
236
|
-
* reopened run's follow-up's loads are the job's). */
|
|
237
|
-
export declare function nativeSkillLoads(entries: readonly EntryLike[]): string[];
|
|
238
|
-
/** `laid`: what the run's claims laid (laidOf): a skill its launch offered but no claim laid (over the budget, or a name
|
|
239
|
-
* the revision's own skill holds, whose copy is the one installed) is not the run's learned skill, whatever it read.
|
|
240
|
-
* `loads`: the skills its job loaded with a harness's own Skill tool (nativeSkillLoads), each a read of its SKILL.md. */
|
|
241
|
-
export declare function learnedUseOf(started: RunLaunch["learning"], reflect: Pick<Reflect, "after" | "until"> | undefined, rows: readonly TimelineEvent[], args?: ReadonlyMap<string, {
|
|
240
|
+
/** The learned workflows a run's job called (LearnedUse), over its timeline rows less the end-of-run turn's (`reflect`). */
|
|
241
|
+
export declare function learnedUseOf(reflect: Pick<Reflect, "after" | "until"> | undefined, rows: readonly TimelineEvent[], args?: ReadonlyMap<string, {
|
|
242
242
|
tool: string;
|
|
243
243
|
args: Record<string, unknown>;
|
|
244
|
-
}
|
|
245
|
-
/** `end` with its run's given notes (from its launch's learning start) and the notes its job read. */
|
|
246
|
-
export declare function withNotes(end: RunLearningEnd, started: RunLaunch["learning"], read: readonly NoteUsed[]): RunLearning;
|
|
244
|
+
}>): LearnedUse;
|
|
247
245
|
/** The learning of a run that only uses what its agent learned (`learning: "use"`): seeded while it runs, as a run that
|
|
248
246
|
* learns is; dropped `use` once it ended, since it is never asked what to keep. */
|
|
249
247
|
export declare function usedOnly(started: NonNullable<RunLaunch["learning"]>, terminal: boolean, at: string): RunLearningEnd;
|
|
250
248
|
/** GET /runs/{id}/learning from the one store, in the shape the route gives (learning-routes.ts runLearningBody): the
|
|
251
|
-
* run's learning end (runLearningEnd)
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
* no learning. */
|
|
249
|
+
* run's learning end (runLearningEnd) and the seed it started from as its launch records it, what it held for its
|
|
250
|
+
* owner's OK as it stands on its agent's folder's main (`statuses`, learning-routes.ts statusesOf, read only when it held
|
|
251
|
+
* something; none: as the merge wrote it), settled once the run is final. Null when the run kept no learning. */
|
|
255
252
|
export declare function runLearningOverStore(store: Store, runId: string, shown: Shown, secrets: readonly string[], statuses?: (agentId: string) => Promise<ReadonlyMap<string, ItemStatus> | undefined>): Promise<{
|
|
253
|
+
run: string;
|
|
254
|
+
state: "dropped" | "merged" | "seeded" | "reflecting";
|
|
255
|
+
reason: "cancelled" | "use" | "empty" | "crashed" | "reflect_failed" | "no_budget" | "checker" | "unknown_cost" | "seed_failed" | null;
|
|
256
|
+
detail: string | null;
|
|
257
|
+
at: string;
|
|
258
|
+
workflows: import("../learning.js").LearnedFile[];
|
|
259
|
+
corrections: number;
|
|
256
260
|
seed: string | null;
|
|
257
261
|
merged: string | null;
|
|
258
|
-
pending: {
|
|
259
|
-
file: string;
|
|
260
|
-
name: string;
|
|
261
|
-
}[];
|
|
262
|
-
verdict: {
|
|
263
|
-
merge: boolean;
|
|
264
|
-
reason: string;
|
|
265
|
-
items: {
|
|
266
|
-
why: string;
|
|
267
|
-
question?: string | undefined;
|
|
268
|
-
origin?: "run" | "you" | undefined;
|
|
269
|
-
pending?: boolean | undefined;
|
|
270
|
-
file: string;
|
|
271
|
-
keep: boolean;
|
|
272
|
-
}[];
|
|
273
|
-
} | null;
|
|
274
262
|
problems: {
|
|
275
263
|
detail: string;
|
|
276
264
|
path?: string | undefined;
|
|
@@ -278,7 +266,6 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
|
|
|
278
266
|
}[];
|
|
279
267
|
compiled: {
|
|
280
268
|
workflow: string;
|
|
281
|
-
from_notes: string[];
|
|
282
269
|
attempts: {
|
|
283
270
|
ok: boolean;
|
|
284
271
|
errors: string[];
|
|
@@ -287,63 +274,34 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
|
|
|
287
274
|
promoted: boolean | null;
|
|
288
275
|
} | null;
|
|
289
276
|
draft_errors: string[];
|
|
290
|
-
cost_usd: {
|
|
291
|
-
grade: number | null;
|
|
292
|
-
};
|
|
293
|
-
tokens: {
|
|
294
|
-
grade: import("../learning.js").Tokens | null;
|
|
295
|
-
};
|
|
296
277
|
used: {
|
|
297
|
-
skills: {
|
|
298
|
-
name: string;
|
|
299
|
-
read: boolean;
|
|
300
|
-
}[];
|
|
301
278
|
workflows: {
|
|
302
279
|
name: string;
|
|
303
280
|
calls: number;
|
|
304
281
|
failed: number;
|
|
305
282
|
}[];
|
|
306
283
|
};
|
|
307
|
-
given?: NoteUsed[];
|
|
308
|
-
read?: NoteUsed[];
|
|
309
|
-
learned?: import("../learning.js").NoteLearned[];
|
|
310
|
-
skills?: import("../learning.js").LearnedFile[];
|
|
311
|
-
workflows?: import("../learning.js").LearnedFile[];
|
|
312
|
-
run: string;
|
|
313
|
-
state: "dropped" | "proposed" | "merged" | "seeded" | "reflecting";
|
|
314
|
-
reason: "cancelled" | "use" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
315
|
-
detail: string | null;
|
|
316
|
-
at: string;
|
|
317
284
|
} | {
|
|
318
285
|
graded: {
|
|
319
286
|
workflow: string | null;
|
|
320
287
|
feedback_status: "running" | "ended" | "not_run" | null;
|
|
321
288
|
source: "feedback" | "eval";
|
|
322
289
|
graded_at: string;
|
|
323
|
-
path: "agent" | "workflow" | "
|
|
290
|
+
path: "agent" | "workflow" | "replay" | "handed_back" | "audit";
|
|
324
291
|
workflow_digest: string | null;
|
|
325
|
-
feedback: "
|
|
292
|
+
feedback: "correction" | null;
|
|
326
293
|
run_id: string;
|
|
327
294
|
correct: boolean;
|
|
328
295
|
};
|
|
296
|
+
run: string;
|
|
297
|
+
state: "dropped" | "merged" | "seeded" | "reflecting";
|
|
298
|
+
reason: "cancelled" | "use" | "empty" | "crashed" | "reflect_failed" | "no_budget" | "checker" | "unknown_cost" | "seed_failed" | null;
|
|
299
|
+
detail: string | null;
|
|
300
|
+
at: string;
|
|
301
|
+
workflows: import("../learning.js").LearnedFile[];
|
|
302
|
+
corrections: number;
|
|
329
303
|
seed: string | null;
|
|
330
304
|
merged: string | null;
|
|
331
|
-
pending: {
|
|
332
|
-
file: string;
|
|
333
|
-
name: string;
|
|
334
|
-
}[];
|
|
335
|
-
verdict: {
|
|
336
|
-
merge: boolean;
|
|
337
|
-
reason: string;
|
|
338
|
-
items: {
|
|
339
|
-
why: string;
|
|
340
|
-
question?: string | undefined;
|
|
341
|
-
origin?: "run" | "you" | undefined;
|
|
342
|
-
pending?: boolean | undefined;
|
|
343
|
-
file: string;
|
|
344
|
-
keep: boolean;
|
|
345
|
-
}[];
|
|
346
|
-
} | null;
|
|
347
305
|
problems: {
|
|
348
306
|
detail: string;
|
|
349
307
|
path?: string | undefined;
|
|
@@ -351,7 +309,6 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
|
|
|
351
309
|
}[];
|
|
352
310
|
compiled: {
|
|
353
311
|
workflow: string;
|
|
354
|
-
from_notes: string[];
|
|
355
312
|
attempts: {
|
|
356
313
|
ok: boolean;
|
|
357
314
|
errors: string[];
|
|
@@ -360,32 +317,12 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
|
|
|
360
317
|
promoted: boolean | null;
|
|
361
318
|
} | null;
|
|
362
319
|
draft_errors: string[];
|
|
363
|
-
cost_usd: {
|
|
364
|
-
grade: number | null;
|
|
365
|
-
};
|
|
366
|
-
tokens: {
|
|
367
|
-
grade: import("../learning.js").Tokens | null;
|
|
368
|
-
};
|
|
369
320
|
used: {
|
|
370
|
-
skills: {
|
|
371
|
-
name: string;
|
|
372
|
-
read: boolean;
|
|
373
|
-
}[];
|
|
374
321
|
workflows: {
|
|
375
322
|
name: string;
|
|
376
323
|
calls: number;
|
|
377
324
|
failed: number;
|
|
378
325
|
}[];
|
|
379
326
|
};
|
|
380
|
-
given?: NoteUsed[];
|
|
381
|
-
read?: NoteUsed[];
|
|
382
|
-
learned?: import("../learning.js").NoteLearned[];
|
|
383
|
-
skills?: import("../learning.js").LearnedFile[];
|
|
384
|
-
workflows?: import("../learning.js").LearnedFile[];
|
|
385
|
-
run: string;
|
|
386
|
-
state: "dropped" | "proposed" | "merged" | "seeded" | "reflecting";
|
|
387
|
-
reason: "cancelled" | "use" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
388
|
-
detail: string | null;
|
|
389
|
-
at: string;
|
|
390
327
|
} | null>;
|
|
391
328
|
export {};
|