@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
|
@@ -1,60 +1,38 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Problem } from "../learn/index.js";
|
|
2
|
+
import { type CompileAsk, type DraftChecked } from "../learn/compile.js";
|
|
2
3
|
import type { EndOfRunTurn } from "./loop-contract.js";
|
|
3
|
-
/** How long a run's end-of-run turn may take before it is aborted and the run ends without it. */
|
|
4
|
-
export declare const REFLECT_TIMEOUT_MS: number;
|
|
5
4
|
/** A turn the spend cap refused (the cap's refusal words, cap.ts CAP_REFUSAL_PREFIX). */
|
|
6
5
|
export declare const CAP_REFUSAL: RegExp;
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
6
|
+
/** A draft the checks passed, as it is committed: its files whole, the README held for its owner's OK when it calls an
|
|
7
|
+
* unpriced tool (`held`), and the commit a revision was read at (`bases`, its conflict base). */
|
|
8
|
+
export type DraftCommit = {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly files: readonly {
|
|
11
|
+
readonly path: string;
|
|
13
12
|
readonly text: string;
|
|
14
13
|
}[];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
} | {
|
|
25
|
-
readonly state: "dropped";
|
|
26
|
-
readonly reason: "empty";
|
|
27
|
-
} | {
|
|
28
|
-
readonly state: "dropped";
|
|
29
|
-
readonly reason: "unparsed";
|
|
30
|
-
readonly detail: string;
|
|
14
|
+
readonly held?: readonly string[];
|
|
15
|
+
readonly bases?: Readonly<Record<string, string>>;
|
|
16
|
+
};
|
|
17
|
+
/** What a merge landed: the commit (and the correction it left out beside its draft, learn/commit.ts
|
|
18
|
+
* LearningCommitResult `refusedCorrection`), or why it did not. */
|
|
19
|
+
export type Committed = {
|
|
20
|
+
readonly ok: true;
|
|
21
|
+
readonly commit: string;
|
|
22
|
+
readonly refusedCorrection?: readonly Problem[];
|
|
31
23
|
} | {
|
|
32
|
-
readonly
|
|
33
|
-
readonly reason: "
|
|
34
|
-
readonly problems: readonly
|
|
35
|
-
readonly rule: string;
|
|
36
|
-
readonly path?: string;
|
|
37
|
-
}[];
|
|
24
|
+
readonly ok: false;
|
|
25
|
+
readonly reason: "conflict" | "refused" | "unavailable";
|
|
26
|
+
readonly problems: readonly Problem[];
|
|
38
27
|
};
|
|
39
|
-
/** What the
|
|
28
|
+
/** What the step reads of the run and the host. */
|
|
40
29
|
export interface ReflectDeps {
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
readonly gradeOff?: () => string | undefined;
|
|
45
|
-
/** Whether the run's job gave nothing new to look back on: its only tool work was its learned workflows, each of them
|
|
46
|
-
* answering, with no error, no refused call, no approval and nothing said after its first message. Such a run is not
|
|
47
|
-
* asked its end-of-run turn (no model request, nothing spent looking back), and its learning is dropped `empty` in
|
|
48
|
-
* said.onlyWorkflow's words. Absent, or a read that throws: every run is asked. */
|
|
30
|
+
/** Whether the run's job gave nothing new to learn from: its only tool work was its learned workflows, each answering,
|
|
31
|
+
* with nothing said after its first message. Such a run compiles nothing unless a compile is due, and its learning is
|
|
32
|
+
* dropped `empty` in said.onlyWorkflow's words. Absent, or a read that throws: none. */
|
|
49
33
|
readonly nothingNew?: (runId: string) => Promise<boolean>;
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* back), and its compile turn, when one is due, is asked alone; with nothing due its learning is dropped `empty` in
|
|
53
|
-
* said.noFeedback's words. Absent (a notes job), or a read that throws: the run is asked its look-back. */
|
|
54
|
-
readonly ownerSaid?: (runId: string) => Promise<boolean>;
|
|
55
|
-
/** The run's facts for reflectSkip: whether it learns, a person's cancel, its cap reached, its cap, its cost so far as a
|
|
56
|
-
* person is shown it (`costUsd`, kept as the job's), and under a cap its spend as the cap's gates read it (`spentUsd`,
|
|
57
|
-
* learning-end.ts capSpendOf: a request with no price of its own at its held figure; null: unknown). */
|
|
34
|
+
/** The run's facts: whether it learns, a person's cancel, its cap reached, its cap, its cost so far as a person is shown
|
|
35
|
+
* it (`costUsd`, kept as the job's), and under a cap its spend as the cap's gates read it (`spentUsd`; null: unknown). */
|
|
58
36
|
readonly facts: (runId: string) => Promise<{
|
|
59
37
|
learns: boolean;
|
|
60
38
|
cancelled?: boolean;
|
|
@@ -66,18 +44,25 @@ export interface ReflectDeps {
|
|
|
66
44
|
capUsd: number;
|
|
67
45
|
spentUsd: number | null;
|
|
68
46
|
})>;
|
|
69
|
-
/**
|
|
70
|
-
readonly
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
47
|
+
/** What the run's owner said of it: a grade's words, and each message they sent after its first, in order. */
|
|
48
|
+
readonly feedback: (runId: string) => Promise<readonly string[]>;
|
|
49
|
+
/** Why the owner's words would be refused as a line of corrections.md on main now (learn/commit.ts correctionRefused);
|
|
50
|
+
* empty when they would be taken. */
|
|
51
|
+
readonly correctionRefused: (input: {
|
|
52
|
+
runId: string;
|
|
53
|
+
agentId: string;
|
|
54
|
+
round: number;
|
|
55
|
+
text: string;
|
|
56
|
+
refuse: readonly string[];
|
|
57
|
+
}) => Promise<readonly Problem[]>;
|
|
58
|
+
/** The compile turn's facts (learn/compile.ts CompileAsk), `refuse` cut from what they quote: undefined when the run
|
|
59
|
+
* compiles nothing (its job not due, a workflow that answered). Absent, or a read that throws: no compile turn. */
|
|
76
60
|
readonly compileFacts?: (input: {
|
|
77
61
|
runId: string;
|
|
78
62
|
agentId: string;
|
|
79
63
|
outcome: "completed" | "failed";
|
|
80
64
|
refuse: readonly string[];
|
|
65
|
+
round: number;
|
|
81
66
|
}) => Promise<CompileAsk | undefined>;
|
|
82
67
|
/** Compile once: a compile turn whose drafts all failed their checks (one answered, none passed) is the compile's
|
|
83
68
|
* attempt, kept on a promotion record (learning-end.ts recordDraftFailed) that compileFacts reads. Its `workflow` and
|
|
@@ -91,55 +76,39 @@ export interface ReflectDeps {
|
|
|
91
76
|
}) => Promise<void>;
|
|
92
77
|
/** The compile turn's deadline, every attempt in it. Default learn/compile.ts COMPILE_TIMEOUT_MS. */
|
|
93
78
|
readonly compileDeadlineMs?: number;
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
triggered?: ReflectTurn["triggered"];
|
|
98
|
-
}>;
|
|
99
|
-
/** Every value the run must never learn (learning-run.ts refused): the host's secrets and what the run was handed, its
|
|
100
|
-
* sign-in pointer among them; `unreadable` when what it was handed can't be read back, and the run learns nothing.
|
|
101
|
-
* Absent, none. */
|
|
102
|
-
readonly refuse?: (runId: string) => Promise<readonly string[] | "unreadable">;
|
|
103
|
-
/** proposeRun's checks over the turn, against the seed the run started from, refusing `refuse`. `revised`: in the
|
|
104
|
-
* compile turn's checks, the workflow it revises from main's text and the commit of main it was first asked at (its
|
|
105
|
-
* CompileAsk's `base`, as the turn's first ask kept it), that workflow's conflict base. */
|
|
106
|
-
readonly check: (input: {
|
|
79
|
+
/** One compile draft through the checks (learning-end.ts checkDraftOf): its errors, else what is committed and its
|
|
80
|
+
* digest. `revised`: a revision's workflow and the commit of main it was read at, its conflict base. */
|
|
81
|
+
readonly checkDraft: (input: {
|
|
107
82
|
runId: string;
|
|
108
83
|
agentId: string;
|
|
109
|
-
|
|
110
|
-
|
|
84
|
+
draft: {
|
|
85
|
+
name: string;
|
|
86
|
+
text: string;
|
|
87
|
+
};
|
|
111
88
|
refuse: readonly string[];
|
|
112
89
|
revised?: {
|
|
113
90
|
readonly workflow: string;
|
|
114
91
|
readonly base: string;
|
|
115
92
|
};
|
|
116
|
-
}) => Promise<
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
93
|
+
}) => Promise<DraftChecked<DraftCommit>>;
|
|
94
|
+
/** The round's merge on the agent's learning folder (learning-end.ts commitDirect): its draft and its owner's
|
|
95
|
+
* correction, one commit by the run. */
|
|
96
|
+
readonly commit: (input: {
|
|
97
|
+
runId: string;
|
|
98
|
+
agentId: string;
|
|
99
|
+
round: number;
|
|
100
|
+
draft?: DraftCommit;
|
|
101
|
+
correction?: string;
|
|
102
|
+
refuse: readonly string[];
|
|
103
|
+
}) => Promise<Committed>;
|
|
104
|
+
/** Every value the run must never learn: the host's secrets and what the run was handed, its sign-in pointer among
|
|
105
|
+
* them; `unreadable` when what it was handed can't be read back, and the run learns nothing. Absent, none. */
|
|
106
|
+
readonly refuse?: (runId: string) => Promise<readonly string[] | "unreadable">;
|
|
107
|
+
/** For tests: the clock. Default Date.now. */
|
|
125
108
|
readonly now?: () => number;
|
|
126
|
-
/** The cap the learning run's grade runs under, read once the turn closed (learning-end.ts gradeCapOf): what the run's
|
|
127
|
-
* cap leaves once everything the run spent is counted, carried on the learning run's launch as its own cap, so the
|
|
128
|
-
* grade never takes the run past its cap. Null when what the run spent under its cap is unknown: the grade is not
|
|
129
|
-
* run, said so (said.gradeUnknownSpend). Undefined for an uncapped run: its grade is capped by nothing. */
|
|
130
|
-
readonly gradeCap?: (runId: string) => Promise<number | null | undefined>;
|
|
131
109
|
/** Which end of the run this is: 1, its first (the default); an end after a follow-up opened the run again is the next
|
|
132
|
-
* round,
|
|
133
|
-
* (every row the hook gives carries it), graded and merged by a learning run of its own. */
|
|
110
|
+
* round, kept beside the earlier rounds' (every row the step gives carries it), with a merge of its own. */
|
|
134
111
|
readonly round?: number;
|
|
135
|
-
/** A later round's: what the round before it kept of the run's spend (its job's and its look-back's), so the follow-up's
|
|
136
|
-
* own share, between that look-back and this one, is kept apart (`follow_up_usd`); and whether it was asked its turn
|
|
137
|
-
* (`looked`: a round cut before it was asked says nothing of looking back before). */
|
|
138
|
-
readonly before?: {
|
|
139
|
-
readonly job_cost_usd?: number | null;
|
|
140
|
-
readonly look_back_usd?: number | null;
|
|
141
|
-
readonly looked?: boolean;
|
|
142
|
-
};
|
|
143
112
|
}
|
|
144
|
-
/** The end-of-run
|
|
113
|
+
/** The end-of-run step for runs that learn. */
|
|
145
114
|
export declare function createReflectHook(deps: ReflectDeps): EndOfRunTurn;
|