@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
package/dist/learn/folder.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type LearningPlace as OneLearningPlace, type LearningWorkspace as OneLearningWorkspace, type Workspace } from "../workspace/index.js";
|
|
2
|
-
|
|
3
|
-
/** The host's folder inside the learning folder: the snapshot, the diffs and the script. Never a note's, never seeded. */
|
|
2
|
+
/** The host's folder inside the learning folder: the snapshot, the diffs and the script. Never learned, never seeded. */
|
|
4
3
|
export declare const HOST_DIR = ".agentrun";
|
|
5
4
|
export declare const SNAPSHOT_FILE = ".agentrun/snapshot.json";
|
|
6
5
|
export declare const DIFFS_DIR = ".agentrun/diffs";
|
|
@@ -8,14 +7,14 @@ export declare const DIFFS_DIR = ".agentrun/diffs";
|
|
|
8
7
|
export declare const AUDITS_FILE = "audits.jsonl";
|
|
9
8
|
/** The most changes the snapshot's log keeps, newest first; `log_more` says older exist. */
|
|
10
9
|
export declare const LOG_KEEP = 200;
|
|
11
|
-
/** A file main holds over this is no
|
|
10
|
+
/** A file main holds over this is no learned file: a workflow's file is at most 16 KB (check.ts CAPS.file). */
|
|
12
11
|
export declare const FILE_CAP: number;
|
|
13
12
|
/** A diff's file whose patch is larger than this is withheld as too large (learning.sh PATCH_CAP). */
|
|
14
13
|
export declare const PATCH_CAP: number;
|
|
15
14
|
declare const PERSON_KINDS: readonly ["approved", "edited", "created", "retired", "restored"];
|
|
16
15
|
export type PersonKind = (typeof PERSON_KINDS)[number];
|
|
17
16
|
export type LastChange = {
|
|
18
|
-
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned"
|
|
17
|
+
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned";
|
|
19
18
|
by: "person" | "run";
|
|
20
19
|
at: string;
|
|
21
20
|
};
|
|
@@ -25,23 +24,6 @@ export type SnapHistory = {
|
|
|
25
24
|
retire?: LastChange;
|
|
26
25
|
person?: LastChange;
|
|
27
26
|
};
|
|
28
|
-
export type SnapNote = {
|
|
29
|
-
file: string;
|
|
30
|
-
oid: string;
|
|
31
|
-
bytes: number;
|
|
32
|
-
name: string;
|
|
33
|
-
description: string;
|
|
34
|
-
type: string;
|
|
35
|
-
status: "active" | "pending" | "superseded" | "retired";
|
|
36
|
-
origin: "you" | "run";
|
|
37
|
-
supersedes: string[];
|
|
38
|
-
superseded_by: string | null;
|
|
39
|
-
/** Past SNAPSHOT.md v1, additive, on a retired note alone: the status its restore gives back (notes.ts LearnedNote
|
|
40
|
-
* retired_from). */
|
|
41
|
-
retired_from?: "active" | "pending";
|
|
42
|
-
order: number;
|
|
43
|
-
history: SnapHistory;
|
|
44
|
-
};
|
|
45
27
|
export type SnapFile = {
|
|
46
28
|
path: string;
|
|
47
29
|
oid: string;
|
|
@@ -52,8 +34,7 @@ export type SnapLearned = {
|
|
|
52
34
|
file: string;
|
|
53
35
|
description: string;
|
|
54
36
|
status: "active" | "pending" | "retired";
|
|
55
|
-
/**
|
|
56
|
-
* retiredFrom). */
|
|
37
|
+
/** On a retired draft alone: the status its restore gives back (workflow-draft.ts retiredFrom). */
|
|
57
38
|
retired_from?: "active" | "pending";
|
|
58
39
|
run: string | null;
|
|
59
40
|
files: SnapFile[];
|
|
@@ -61,9 +42,8 @@ export type SnapLearned = {
|
|
|
61
42
|
bytes: number;
|
|
62
43
|
order: number;
|
|
63
44
|
history: SnapHistory;
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
* regular files alone. */
|
|
45
|
+
/** Present only when there are some: the paths of the tracked symbolic links (git mode 120000) in the item's folder;
|
|
46
|
+
* `files` names regular files alone. */
|
|
67
47
|
links?: string[];
|
|
68
48
|
};
|
|
69
49
|
export type SnapChange = {
|
|
@@ -82,17 +62,13 @@ export type Snapshot = {
|
|
|
82
62
|
v: 1;
|
|
83
63
|
main: string;
|
|
84
64
|
at: string;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
bytes: number;
|
|
88
|
-
};
|
|
65
|
+
/** corrections.md's blob, present only when main holds it. */
|
|
66
|
+
corrections?: SnapFile;
|
|
89
67
|
/** The audit ledger (learn/audit.ts AUDITS_FILE), once a row was written: the host's, never laid into a run. */
|
|
90
68
|
audits?: {
|
|
91
69
|
oid: string;
|
|
92
70
|
bytes: number;
|
|
93
71
|
};
|
|
94
|
-
notes: SnapNote[];
|
|
95
|
-
skills: SnapLearned[];
|
|
96
72
|
workflows: SnapLearned[];
|
|
97
73
|
log: SnapChange[];
|
|
98
74
|
log_more: boolean;
|
|
@@ -153,8 +129,8 @@ export declare function snapshotOfRead(read: ReturnType<typeof parseRead>): Snap
|
|
|
153
129
|
* under `.agentrun/`. `absent`: paths that must not be on main, as git holds it (any file, any mode); `same`: paths
|
|
154
130
|
* that must be on main as they are on another commit (a run's seed). The script checks both on main as it commits. */
|
|
155
131
|
export type FolderChange = {
|
|
156
|
-
/** A run's merge names the run and
|
|
157
|
-
*
|
|
132
|
+
/** A run's merge names the run and its reason, and its `round` past the first (a follow-up's correction): its diff is
|
|
133
|
+
* kept under runDiffKey. The host's own book-keeping (an audit row) names what it kept. */
|
|
158
134
|
by: {
|
|
159
135
|
person: PersonKind;
|
|
160
136
|
file: string;
|
|
@@ -190,6 +166,14 @@ export type LearningPlace = OneLearningPlace;
|
|
|
190
166
|
export type LearningFolder = OneLearningWorkspace;
|
|
191
167
|
/** Agent `place.agentId`'s learning folder as a Workspace: the one learningWorkspace, or the test's stand-in. */
|
|
192
168
|
export declare function learningWorkspace(place: LearningPlace): LearningFolder;
|
|
169
|
+
/** What a learning folder's script run is, as a runner checks one a run's process asks of it (run-child-host.ts): its
|
|
170
|
+
* argv, the script's own environment, its deadline. */
|
|
171
|
+
export declare const LEARNING_SCRIPT: {
|
|
172
|
+
file: () => string;
|
|
173
|
+
env: () => Record<string, string>;
|
|
174
|
+
timeoutMs: () => number;
|
|
175
|
+
ensure: (ws: Workspace) => Promise<void>;
|
|
176
|
+
};
|
|
193
177
|
/** A learning folder this server cannot read or write: a link in it (`link`, its words naming it), or a backend that
|
|
194
178
|
* cannot answer. Fails closed: nothing learned is read, nothing is written. */
|
|
195
179
|
export declare class FolderUnreadable extends Error {
|
|
@@ -203,8 +187,6 @@ export declare function folderFailure(error: unknown): unknown;
|
|
|
203
187
|
export declare class FolderBusy extends Error {
|
|
204
188
|
constructor();
|
|
205
189
|
}
|
|
206
|
-
/** Whether `error` is a body that was not the snapshot's blob (a reader holding an older snapshot meets it). */
|
|
207
|
-
export declare const isBodyMismatch: (error: unknown) => boolean;
|
|
208
190
|
/** The folder's snapshot, or undefined when there is none (no main yet: the agent never learned). One that does not
|
|
209
191
|
* read as v1 throws. */
|
|
210
192
|
export declare function readSnapshot(ws: Workspace): Promise<Snapshot | undefined>;
|
|
@@ -225,10 +207,10 @@ export declare function readLearning<T>(ws: Workspace, read: (folder: FolderRead
|
|
|
225
207
|
* id for its first round, `<run>.r<round>` for each later one (a follow-up's look-back), so each round merges once. */
|
|
226
208
|
export declare const runDiffKey: (runId: string, round?: number) => string;
|
|
227
209
|
export declare function readRunDiff(ws: Workspace, run: string): Promise<RunDiff | undefined>;
|
|
228
|
-
/**
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
export declare
|
|
210
|
+
/** Run `runId`'s merge of `round` (readRunDiff), or undefined when it never merged here. A stop between a merge's commit
|
|
211
|
+
* and its diff file leaves main and the run's ref moved with no diff: when main's log names the run and the round has no
|
|
212
|
+
* diff, the script's `merged` writes the diff from the run's ref (one exec), and it is read. */
|
|
213
|
+
export declare function runMergeOf(ws: Workspace, runId: string, round?: number): Promise<RunDiff | undefined>;
|
|
232
214
|
/** The script, as checked in (learning.sh beside this file), and the name it is written under in the folder. */
|
|
233
215
|
export declare const LEARNING_SH: string;
|
|
234
216
|
export declare const SCRIPT_FILE: string;
|
|
@@ -247,8 +229,9 @@ export declare class FolderTooLarge extends Error {
|
|
|
247
229
|
constructor(bytes: number);
|
|
248
230
|
}
|
|
249
231
|
/** What one commit did: landed (its main and the snapshot written), stale (main is `main`, not the one it read:
|
|
250
|
-
* nothing was written), refused (a precondition failed on main: nothing was written),
|
|
251
|
-
* brought in line (main moved, no snapshot written)
|
|
232
|
+
* nothing was written), refused (a precondition failed on main: nothing was written), landed without its files
|
|
233
|
+
* brought in line (main moved, no snapshot written), or merged (the run, this round, merged already: its merge commit,
|
|
234
|
+
* nothing written). */
|
|
252
235
|
export type Committed = {
|
|
253
236
|
landed: true;
|
|
254
237
|
main: string;
|
|
@@ -264,6 +247,8 @@ export type Committed = {
|
|
|
264
247
|
} | {
|
|
265
248
|
unaligned: true;
|
|
266
249
|
main: string;
|
|
250
|
+
} | {
|
|
251
|
+
merged: string;
|
|
267
252
|
};
|
|
268
253
|
/**
|
|
269
254
|
* One write to main, one exec of the script: `change` on the snapshot it was computed from (`base`: none for the
|
|
@@ -289,10 +274,7 @@ export declare function folderAt(ws: Workspace, commit: string): Promise<{
|
|
|
289
274
|
* the folder has no such commit. */
|
|
290
275
|
export declare function textsAt(ws: Workspace, commit: string, paths: readonly string[]): Promise<Record<string, string> | undefined>;
|
|
291
276
|
export declare function learningRepair(ws: Workspace): Promise<Snapshot | undefined>;
|
|
292
|
-
/**
|
|
293
|
-
* that is no note) included. A read through the script. */
|
|
294
|
-
export declare function heldOnMain(ws: Workspace, main: string, path: string): Promise<boolean>;
|
|
295
|
-
/** The folder's first commit when it has no main yet (an empty MEMORY.md, the host's), and main's commit: through the
|
|
277
|
+
/** The folder's first commit when it has no main yet (an empty tree, the host's), and main's commit: through the
|
|
296
278
|
* script's init, which makes the repository where there is none. A main with no snapshot (an init that stopped
|
|
297
279
|
* before it) is repaired. */
|
|
298
280
|
export declare function learningInit(ws: Workspace): Promise<string>;
|
|
@@ -305,12 +287,18 @@ export declare class FolderRefused extends Error {
|
|
|
305
287
|
same: string[];
|
|
306
288
|
});
|
|
307
289
|
}
|
|
290
|
+
/** A run's merge (its round) that is on main already, made by another call (a reclaimed run racing its first claim, or
|
|
291
|
+
* a retry after a stop past its commit): `merge`, its commit. Nothing was written. */
|
|
292
|
+
export declare class FolderMerged extends Error {
|
|
293
|
+
readonly merge: string;
|
|
294
|
+
constructor(merge: string);
|
|
295
|
+
}
|
|
308
296
|
/**
|
|
309
297
|
* A write to the folder's main: `compute` reads the snapshot and the bodies it needs (as readLearning gives them) and
|
|
310
298
|
* says what to write, or nothing (its result stands alone). Committed by commitChange; a main that moved under it, or
|
|
311
299
|
* a body that changed as it was read, computes it again on the folder as it is then (WRITE_TRIES in all). A folder with
|
|
312
300
|
* no main yet is made first (learningInit). A snapshot that is not main's is rebuilt (learningRepair). Throws
|
|
313
|
-
* FolderRefused when a precondition fails on main.
|
|
301
|
+
* FolderRefused when a precondition fails on main, and FolderMerged when a run's merge (its round) is there already.
|
|
314
302
|
*/
|
|
315
303
|
export declare function writeLearning<T>(ws: Workspace, compute: (folder: FolderRead) => Promise<{
|
|
316
304
|
result: T;
|