@parcha/agentrun-serve 0.1.0-beta.54 → 0.1.0-beta.56
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 +142 -2
- package/README.md +310 -98
- package/dist/adapters.d.ts +11 -0
- package/dist/adapters.js +49 -0
- package/dist/agent-package.d.ts +3 -3
- package/dist/agent-package.js +6 -13
- package/dist/agents-store.js +6 -5
- package/dist/answer-json.d.ts +6 -2
- package/dist/answer-json.js +22 -4
- package/dist/api-only.d.ts +16 -4
- package/dist/api-only.js +23 -7
- package/dist/calendar/tools.js +3 -2
- package/dist/chatgpt-plan.d.ts +16 -1
- package/dist/chatgpt-plan.js +116 -12
- package/dist/claude-login.d.ts +34 -5
- package/dist/claude-login.js +31 -7
- package/dist/claude-sign-in.d.ts +35 -0
- package/dist/claude-sign-in.js +90 -0
- package/dist/cli.js +5 -3
- package/dist/composio-made.d.ts +26 -1
- package/dist/composio-made.js +39 -2
- package/dist/composio-preset.d.ts +3 -2
- package/dist/composio-preset.js +46 -14
- package/dist/computer-held-routes.js +2 -3
- package/dist/computer-setting.d.ts +4 -2
- package/dist/computer-setting.js +0 -2
- package/dist/computers-running.d.ts +8 -0
- package/dist/computers-running.js +27 -0
- package/dist/console/assets/backend-Boh7tC4i.js +166 -0
- package/dist/console/assets/index-CQ3cJRzI.js +746 -0
- package/dist/console/assets/index-DKkaS3a0.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/docker-host-addresses.d.ts +23 -3
- package/dist/docker-host-addresses.js +90 -18
- package/dist/exa-keyless.d.ts +2 -3
- package/dist/exa-keyless.js +43 -127
- package/dist/firecrawl-keyless.d.ts +41 -0
- package/dist/firecrawl-keyless.js +152 -0
- package/dist/handed-secret.d.ts +3 -1
- package/dist/handed-secret.js +4 -2
- package/dist/harness-keys.d.ts +98 -0
- package/dist/harness-keys.js +247 -0
- package/dist/harness-recipe-entry.d.ts +14 -9
- package/dist/harness-recipe-entry.js +25 -14
- package/dist/harness-table.d.ts +16 -1
- package/dist/harness-table.js +19 -7
- package/dist/harness.d.ts +4 -0
- package/dist/harness.js +12 -1
- package/dist/host-check.d.ts +6 -0
- package/dist/host-check.js +10 -0
- package/dist/import-summary.d.ts +1 -1
- package/dist/import-summary.js +1 -1
- package/dist/import.d.ts +5 -5
- package/dist/import.js +54 -67
- package/dist/key-refusal.d.ts +21 -5
- package/dist/key-refusal.js +231 -37
- package/dist/keyless-mcp.d.ts +36 -0
- package/dist/keyless-mcp.js +127 -0
- package/dist/learn/audit.d.ts +3 -3
- package/dist/learn/audit.js +3 -3
- package/dist/learn/commit.d.ts +8 -7
- package/dist/learn/commit.js +60 -20
- package/dist/learn/compile.d.ts +4 -3
- package/dist/learn/compile.js +7 -5
- package/dist/learn/folder.d.ts +16 -3
- package/dist/learn/folder.js +46 -13
- package/dist/learn/promote.d.ts +37 -13
- package/dist/learn/promote.js +112 -40
- package/dist/learn/secrets.d.ts +20 -10
- package/dist/learn/secrets.js +44 -176
- package/dist/learning-routes.d.ts +22 -17
- package/dist/learning-routes.js +40 -39
- package/dist/learning.js +2 -2
- package/dist/llms.txt +1 -1
- package/dist/manifest.d.ts +10 -0
- package/dist/manifest.js +30 -0
- package/dist/mcp-pin-first.d.ts +4 -2
- package/dist/mcp-pin-first.js +5 -2
- package/dist/mcp-secret-writes.d.ts +16 -7
- package/dist/mcp-secret-writes.js +35 -27
- package/dist/mcp-servers-store.d.ts +30 -6
- package/dist/mcp-servers-store.js +112 -28
- package/dist/mcp-sources.d.ts +10 -2
- package/dist/mcp-sources.js +9 -2
- package/dist/mcp-store.d.ts +13 -7
- package/dist/mcp-store.js +12 -9
- package/dist/model-form.d.ts +3 -2
- package/dist/model-form.js +11 -7
- package/dist/model.d.ts +20 -4
- package/dist/model.js +68 -9
- package/dist/native/history.d.ts +1 -1
- package/dist/native/history.js +2 -2
- package/dist/ollama-provider.d.ts +92 -0
- package/dist/ollama-provider.js +495 -0
- package/dist/openapi/agentrun-v2.openapi.json +2 -2
- package/dist/openapi.d.ts +3 -3
- package/dist/openapi.js +197 -55
- package/dist/page.d.ts +11 -3
- package/dist/page.js +22 -7
- package/dist/place-offers.d.ts +25 -1
- package/dist/place-offers.js +62 -8
- package/dist/print.js +1 -1
- package/dist/purged-workflow.d.ts +35 -7
- package/dist/purged-workflow.js +73 -26
- package/dist/redact/match.d.ts +74 -0
- package/dist/redact/match.js +771 -0
- package/dist/run-computer.d.ts +2 -0
- package/dist/run-computer.js +2 -0
- package/dist/run-files.d.ts +4 -0
- package/dist/run-files.js +4 -0
- package/dist/run-keys.d.ts +2 -4
- package/dist/run-keys.js +6 -7
- package/dist/run-launch.d.ts +4 -0
- package/dist/run-launch.js +4 -0
- package/dist/run-reads-over-store.d.ts +3 -2
- package/dist/run-reads-over-store.js +66 -2
- package/dist/run-secrets.js +5 -2
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +4 -4
- package/dist/runner/adapter-loop.d.ts +9 -3
- package/dist/runner/adapter-loop.js +34 -15
- package/dist/runner/adapter-run-spec.d.ts +3 -0
- package/dist/runner/adapter-run-spec.js +9 -4
- package/dist/runner/audit.js +8 -4
- package/dist/runner/beside.d.ts +2 -1
- package/dist/runner/beside.js +13 -5
- package/dist/runner/claim-secrets.d.ts +5 -8
- package/dist/runner/claim-secrets.js +6 -0
- package/dist/runner/cli-run-spec.d.ts +1 -1
- package/dist/runner/cli-run-spec.js +41 -7
- package/dist/runner/harness-loops.d.ts +22 -9
- package/dist/runner/harness-loops.js +21 -11
- package/dist/runner/held.d.ts +3 -0
- package/dist/runner/learning-end.d.ts +1 -1
- package/dist/runner/learning-end.js +8 -3
- package/dist/runner/loop-contract.d.ts +9 -4
- package/dist/runner/main.js +12 -6
- package/dist/runner/mcp-claim.d.ts +3 -0
- package/dist/runner/mcp-claim.js +26 -2
- package/dist/runner/mcp-run.d.ts +3 -0
- package/dist/runner/mcp-run.js +2 -1
- package/dist/runner/metrics.d.ts +10 -10
- package/dist/runner/metrics.js +19 -38
- package/dist/runner/model-route.d.ts +3 -0
- package/dist/runner/model-route.js +6 -2
- package/dist/runner/presence.d.ts +4 -3
- package/dist/runner/presence.js +4 -2
- package/dist/runner/promotion.d.ts +15 -9
- package/dist/runner/promotion.js +25 -15
- package/dist/runner/run-child-host.d.ts +2 -0
- package/dist/runner/run-child-host.js +19 -9
- package/dist/runner/run-child.js +3 -1
- package/dist/runner/runner.d.ts +4 -0
- package/dist/runner/runner.js +33 -3
- package/dist/runner/sdk-loop.js +2 -0
- package/dist/runner/workflow-loop.d.ts +2 -2
- package/dist/runner/workflow-loop.js +1 -2
- package/dist/runner/workflow-spec.d.ts +1 -1
- package/dist/runner/workflow-spec.js +6 -6
- package/dist/sdk/check.d.ts +4 -1
- package/dist/sdk/check.js +2 -1
- package/dist/sdk/runs.d.ts +2 -2
- package/dist/sdk/runs.js +8 -6
- package/dist/secret-cut.js +2 -1
- package/dist/secret-writes.d.ts +3 -2
- package/dist/secret-writes.js +1 -1
- package/dist/server.d.ts +49 -10
- package/dist/server.js +324 -118
- package/dist/standard-webhooks.d.ts +11 -0
- package/dist/standard-webhooks.js +20 -2
- package/dist/store/dialect.d.ts +3 -0
- package/dist/store/dialect.js +1 -0
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +1 -1
- package/dist/store/postgres/dialect.js +3 -0
- package/dist/store/schema.js +5 -2
- package/dist/store/sqlite/store.js +133 -47
- package/dist/store/store.d.ts +64 -15
- package/dist/store/store.js +7 -0
- package/dist/store-reads/journal.d.ts +7 -2
- package/dist/store-reads/journal.js +9 -6
- package/dist/store-reads/learning.d.ts +12 -9
- package/dist/store-reads/learning.js +18 -24
- package/dist/store-view.d.ts +0 -5
- package/dist/store-view.js +10 -9
- package/dist/template-eval.d.ts +51 -6
- package/dist/template-eval.js +177 -53
- package/dist/template-import.js +4 -2
- package/dist/templates.d.ts +5 -3
- package/dist/templates.js +19 -40
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.js +1 -1
- package/dist/timeline/labels.d.ts +2 -2
- package/dist/timeline/labels.js +2 -2
- package/dist/timeline/timeline.d.ts +14 -9
- package/dist/timeline/timeline.js +15 -7
- package/dist/tool-gate.js +3 -1
- package/dist/tool-plane.d.ts +17 -9
- package/dist/tool-plane.js +38 -17
- package/dist/tools.js +2 -2
- package/dist/trigger-launch-hook.d.ts +16 -8
- package/dist/trigger-launch-hook.js +32 -23
- package/dist/trigger-targets.d.ts +18 -8
- package/dist/trigger-targets.js +42 -19
- package/dist/triggers.d.ts +85 -23
- package/dist/triggers.js +303 -96
- package/dist/validate.js +1 -1
- package/dist/web-fake.js +3 -3
- package/dist/web-fetch-direct.d.ts +4 -0
- package/dist/web-fetch-direct.js +8 -1
- package/dist/web-fetch.d.ts +12 -3
- package/dist/web-fetch.js +47 -14
- package/dist/web-search.d.ts +33 -4
- package/dist/web-search.js +100 -41
- package/dist/webhooks.js +4 -5
- package/dist/workspace/computer-deps.d.ts +2 -1
- package/dist/workspace/computer-deps.js +5 -4
- package/dist/workspace/computer-for-claim.d.ts +8 -2
- package/dist/workspace/computer-for-claim.js +28 -9
- package/dist/workspace/computer-janitor.d.ts +15 -7
- package/dist/workspace/computer-janitor.js +33 -8
- package/dist/workspace/computer-kept.d.ts +52 -4
- package/dist/workspace/computer-kept.js +118 -6
- package/dist/workspace/run-end-computers.d.ts +5 -1
- package/dist/workspace/run-end-computers.js +27 -1
- package/dist/wrapped.d.ts +57 -0
- package/dist/wrapped.js +51 -0
- package/launcher/agentrun-serve +5 -1
- package/package.json +17 -13
- package/templates/README.md +10 -9
- package/dist/console/assets/index-B_85An2t.js +0 -745
- package/dist/console/assets/index-n1YsbnYh.css +0 -1
- package/dist/import-sources.d.ts +0 -116
- package/dist/import-sources.js +0 -693
package/dist/runner/runner.js
CHANGED
|
@@ -23,6 +23,7 @@ import { isFenced } from "./store-port.js";
|
|
|
23
23
|
import { FINAL_STATES } from "../store/store.js";
|
|
24
24
|
import { Unanswered } from "../store/postgres/connection.js";
|
|
25
25
|
import { clearWaitEnded } from "../browser-wait-ended.js";
|
|
26
|
+
import { keptBy, readKept } from "../workspace/computer-kept.js";
|
|
26
27
|
import { cutDeep, heldRedactor, processSecretRedactor } from "./redact.js";
|
|
27
28
|
import { withLiveTicker } from "./live-ticker.js";
|
|
28
29
|
import { keepPresence } from "./presence.js";
|
|
@@ -545,6 +546,23 @@ export function startRunner(options) {
|
|
|
545
546
|
return false;
|
|
546
547
|
}
|
|
547
548
|
};
|
|
549
|
+
/** Whether the run under `claim` has a computer its park kept pinned to a runner other than this one, this process
|
|
550
|
+
* (computer-kept.ts: the row names a runner and incarnation, keptBy). A row that cannot be read says yes: a loop
|
|
551
|
+
* started on a guess would read the row again in its claim's computer, take it and try the machine from here,
|
|
552
|
+
* dropping the row that runner's timer ends it by. Ending the stop with no loop touches no computer, and the row's
|
|
553
|
+
* runner (or any janitor, once that runner is gone) still ends it. */
|
|
554
|
+
const keptElsewhere = async (claim) => {
|
|
555
|
+
if (!store.settings)
|
|
556
|
+
return false;
|
|
557
|
+
try {
|
|
558
|
+
const kept = await readKept(store.settings, claim.runId);
|
|
559
|
+
const ours = (options.presence ?? presence)?.incarnation;
|
|
560
|
+
return kept?.runner !== undefined && !keptBy(kept, ours ? { runner: name, incarnation: ours } : undefined);
|
|
561
|
+
}
|
|
562
|
+
catch {
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
565
|
+
};
|
|
548
566
|
/** A claim of a run whose stopped end was refused (its untaken stop row has tries): it only ends the run, with no loop,
|
|
549
567
|
* so no turn, model request or tool runs on a run that is stopping. */
|
|
550
568
|
const endRetried = async (claim, stop) => {
|
|
@@ -698,7 +716,11 @@ export function startRunner(options) {
|
|
|
698
716
|
let ending = () => { };
|
|
699
717
|
// Set below, once held is made: the loop asks deliverNow only once its first turn has ended, well after.
|
|
700
718
|
let heldNow;
|
|
719
|
+
// This runner's process as its word in the store names it (presence.ts), for the claim's computer: a park that keeps one
|
|
720
|
+
// only this runner can reach again pins it to this runner and this incarnation (computer-kept.ts pinnedOf).
|
|
721
|
+
const ours = (options.presence ?? presence)?.incarnation;
|
|
701
722
|
const loop = loopsOf({
|
|
723
|
+
...(ours ? { incarnation: ours } : {}),
|
|
702
724
|
journal: (forClaim) => fenced(store.journal(forClaim), fence, forClaim.runId, () => ending()),
|
|
703
725
|
flush: () => store.flush(),
|
|
704
726
|
signal: abort.signal,
|
|
@@ -849,13 +871,18 @@ export function startRunner(options) {
|
|
|
849
871
|
// starts now, not even its first input: a loop started first would send that input before the stop reached it;
|
|
850
872
|
// - a run whose untaken stop row has tries, which failed to apply that stop before. Either source of tries counts: a
|
|
851
873
|
// refused stopped end (endRefused, released running) or a failed resume (resumeFailed's store.retry, released
|
|
852
|
-
// parked)
|
|
874
|
+
// parked);
|
|
875
|
+
// - a parked run stopped or cancelled whose computer its park kept pinned to another runner, or whose kept row can't
|
|
876
|
+
// be read (keptElsewhere): the store gives a stop to any runner at once, never waiting on the pin, and this
|
|
877
|
+
// runner can't reach that machine.
|
|
878
|
+
// A loop would take the kept row (takeKept) and try to attach it, orphaning it on that runner's host; ending here
|
|
879
|
+
// leaves the row that runner's, whose own timer at its time, or its janitor once the run is final, ends it.
|
|
853
880
|
// One read of those claims' rows, made only when the batch has a queued or a released run.
|
|
854
881
|
const reread = claims.filter((claim) => claim.from === "queued" || claim.from === "running" || claim.from === "parked");
|
|
855
882
|
const rows = reread.length ? await store.commandsOf(reread.map((claim) => ({ runId: claim.runId, after: 0 }))) : new Map();
|
|
856
883
|
for (const claim of claims) {
|
|
857
884
|
const stop = endingRow((rows.get(claim.runId) ?? []).filter((row) => row.takenAt === null));
|
|
858
|
-
const endsOnly = stop !== undefined && (claim.from === "queued" || stop.tries > 0 || (claim.from === "running" && (await neverStarted(claim))));
|
|
885
|
+
const endsOnly = stop !== undefined && (claim.from === "queued" || stop.tries > 0 || (claim.from === "running" && (await neverStarted(claim))) || (claim.from === "parked" && (await keptElsewhere(claim))));
|
|
859
886
|
if (stop && endsOnly && !closed && !killed && !runs.has(claim.runId)) {
|
|
860
887
|
const key = `${claim.runId}:${claim.epoch}`;
|
|
861
888
|
endingClaims.add(key);
|
|
@@ -903,7 +930,8 @@ export function startRunner(options) {
|
|
|
903
930
|
* claim's loop still running holds its weight too): each claimed on its own, its weight put in `weights`. The first that
|
|
904
931
|
* does not fit ends the claim, unless the runner holds nothing: then it is claimed alone. */
|
|
905
932
|
const claimByMemory = async (budget, free, weights) => {
|
|
906
|
-
|
|
933
|
+
// As this runner's claimer: a run whose computer is kept for another runner still there is not among them.
|
|
934
|
+
const waiting = await store.runs.claimable({ limit: free, runner: name });
|
|
907
935
|
if (waiting.length === 0)
|
|
908
936
|
return [];
|
|
909
937
|
const weighed = await budget.weigh(waiting);
|
|
@@ -1068,8 +1096,10 @@ export function startRunner(options) {
|
|
|
1068
1096
|
for (const held of runs.values())
|
|
1069
1097
|
clock.clearTimeout(held.deadline);
|
|
1070
1098
|
};
|
|
1099
|
+
const incarnation = (options.presence ?? presence)?.incarnation;
|
|
1071
1100
|
return {
|
|
1072
1101
|
name,
|
|
1102
|
+
...(incarnation ? { incarnation } : {}),
|
|
1073
1103
|
held: () => [...runs.values()].filter((held) => !held.fence.lost && !held.ending).map((held) => held.claim),
|
|
1074
1104
|
async close() {
|
|
1075
1105
|
if (closed || killed)
|
package/dist/runner/sdk-loop.js
CHANGED
|
@@ -6,6 +6,7 @@ import { BACKGROUND_CONTEXT, withAbortSignal } from "@earendil-works/chord/conte
|
|
|
6
6
|
import { ROOT_CONVERSATION_ID } from "@earendil-works/pi-durable";
|
|
7
7
|
import { freeRequestLimitOf } from "@parcha/agentrun-kernel/kernel/cap";
|
|
8
8
|
import { learningFolderOf, secretsShown } from "../learning.js";
|
|
9
|
+
import { refusedIn } from "../purged-workflow.js";
|
|
9
10
|
import { said, STOPPED } from "../learning-words.js";
|
|
10
11
|
import { cliPolicyOf, closeSdkInbox, sdkInbox } from "../sdk/runs.js";
|
|
11
12
|
import { settleSdkCheck } from "../sdk/check.js";
|
|
@@ -103,6 +104,7 @@ export function createSdkLoop(launch, host, route) {
|
|
|
103
104
|
store: host.store, agentId: agent, launch, inbox,
|
|
104
105
|
shown: async () => secretsShown(Object.values(await storeSecrets(host.store, host.sealKey, host.data)), { local: true }),
|
|
105
106
|
log: (line) => host.log?.(line),
|
|
107
|
+
refused: refusedIn(() => learningFolderOf(host.data, agent), host.store, (line) => host.log?.(line)),
|
|
106
108
|
});
|
|
107
109
|
}
|
|
108
110
|
catch (error) {
|
|
@@ -5,7 +5,7 @@ import type { Workflow } from "@parcha/agentrun-dsl";
|
|
|
5
5
|
import { type WorkflowTaskHost } from "../workflow/task.js";
|
|
6
6
|
import { type BudgetData, type EndData } from "./journal-kinds.js";
|
|
7
7
|
import { type Claim, type Journal, type LoopFactory } from "./loop-contract.js";
|
|
8
|
-
import {
|
|
8
|
+
import type { HeldRedact } from "./redact.js";
|
|
9
9
|
/** A cap refusal, as the kernel cap hands one to parkOf/checkRaise (the loop never imports the cap; its rule is handed in
|
|
10
10
|
* via the spec, so flat or tiered pricing is the cap's, not this loop's). */
|
|
11
11
|
/** `node`: the label of the workflow node whose step the cap held (a model node's request, a call node's call, a
|
|
@@ -130,7 +130,7 @@ export declare const isWorkflowRevision: (revision: {
|
|
|
130
130
|
/** What a claim's spec is built from beside the claim: the runner's one redactor (LoopDeps.redact), which holds the keys
|
|
131
131
|
* the claim opens from the store (redact.ts holdClaimed). */
|
|
132
132
|
export interface WorkflowSpecRun {
|
|
133
|
-
readonly redact
|
|
133
|
+
readonly redact: HeldRedact;
|
|
134
134
|
/** A fresh journal of the claim, for what the spec reads from the run's records at its end (its decisions' booked
|
|
135
135
|
* cost): a fresh one, since the Harness closes its own before the end is written. */
|
|
136
136
|
readonly journal?: () => Journal;
|
|
@@ -23,7 +23,6 @@ import { createWorkflowExtension } from "../workflow/task.js";
|
|
|
23
23
|
import { readWorkflowRun, startWorkflowRevision, workflowCarry } from "../workflow-run.js";
|
|
24
24
|
import { KINDS } from "./journal-kinds.js";
|
|
25
25
|
import { stopEnd } from "./loop-contract.js";
|
|
26
|
-
import { heldRedactor } from "./redact.js";
|
|
27
26
|
import { END_PATCH_MS, END_PATCH_UNKNOWN, readAgain } from "./loop.js";
|
|
28
27
|
/** A paused run's words, its row's summary while it waits for a resume. */
|
|
29
28
|
export const PAUSED_WORDS = "Paused.";
|
|
@@ -218,7 +217,7 @@ function workflowLoop(specOf, deps) {
|
|
|
218
217
|
const parkController = new AbortController();
|
|
219
218
|
let heldRefusal;
|
|
220
219
|
const context = withAbortSignal(AbortSignal.any([deps.signal, parkController.signal]), BACKGROUND_CONTEXT);
|
|
221
|
-
spec = await specOf(claim, {
|
|
220
|
+
spec = await specOf(claim, { redact: deps.redact, journal: () => deps.journal(claim) });
|
|
222
221
|
claimNow = claim;
|
|
223
222
|
specReady();
|
|
224
223
|
const revision = { id: spec.revisionId, kind: "workflow", body: { workflow: spec.workflow, tools: [...spec.tools] } };
|
|
@@ -83,7 +83,7 @@ interface DecisionProviders {
|
|
|
83
83
|
export declare function workflowSpecOf(deps: WorkflowSpecDeps): (claim: {
|
|
84
84
|
runId: string;
|
|
85
85
|
runner?: string;
|
|
86
|
-
}, run
|
|
86
|
+
}, run: WorkflowSpecRun) => Promise<WorkflowRunSpec>;
|
|
87
87
|
/** The run's rule with a park on a refusal: `before` (runCap's one rule for the model session) is asked, and on a refusal
|
|
88
88
|
* the run parks through the loop's hook (parkOf decides room vs for good from the refusal), the same as the pi adapter's
|
|
89
89
|
* parkAtCap. It still returns the refusal, so the proxy refuses the request and the node's turn ends. */
|
|
@@ -15,7 +15,7 @@ import { defineExtension, ROOT_CONVERSATION_ID, wrapTool } from "@earendil-works
|
|
|
15
15
|
import { chargedCost, DecisionProviderError, EffectFailure, inspectWorkflow } from "@parcha/agentrun-dsl";
|
|
16
16
|
import { modelPortFor } from "@parcha/agentrun-kernel";
|
|
17
17
|
import { startModelProxy } from "@parcha/agentrun-kernel/host";
|
|
18
|
-
import { CapRefused, checkRaise, DecisionPriceUnreadable, DECISION_SESSION, followUpOf, freeCeilingMessage, freeRequestLimitOf, parkOf, runCap } from "@parcha/agentrun-kernel/kernel/cap";
|
|
18
|
+
import { CapRefused, checkRaise, DecisionPriceUnreadable, DECISION_SESSION, followUpOf, freeCeilingMessage, freeRequestLimitOf, maxRequestsOf, parkOf, runCap } from "@parcha/agentrun-kernel/kernel/cap";
|
|
19
19
|
import { completer } from "../llm.js";
|
|
20
20
|
// The decision providers' list prices, the catalog's read and the replay check (decision-cap.ts), with holdOf, which the
|
|
21
21
|
// parity tests hold this cap's figures to.
|
|
@@ -43,7 +43,7 @@ import { KINDS, NODE_LOG_SESSION, WORKFLOW_SESSION } from "./journal-kinds.js";
|
|
|
43
43
|
import { cutStrings } from "../key-refusal.js";
|
|
44
44
|
import { CLOSE_MS } from "./loop.js";
|
|
45
45
|
import { PAUSED_WORDS } from "./workflow-loop.js";
|
|
46
|
-
import {
|
|
46
|
+
import { holdClaimed } from "./redact.js";
|
|
47
47
|
import { holdStored } from "./store-secrets.js";
|
|
48
48
|
import { workflowHost } from "./workflow-host.js";
|
|
49
49
|
import { SUBMIT_TOOL } from "../workflow/host-tools.js";
|
|
@@ -140,7 +140,7 @@ export function workflowSpecOf(deps) {
|
|
|
140
140
|
const holding = async (opening) => {
|
|
141
141
|
const opened = await opening;
|
|
142
142
|
if (run?.redact)
|
|
143
|
-
holdClaimed(
|
|
143
|
+
holdClaimed(run.redact, opened);
|
|
144
144
|
return opened;
|
|
145
145
|
};
|
|
146
146
|
const claimed = await readClaim(deps, claim.runId);
|
|
@@ -153,7 +153,7 @@ export function workflowSpecOf(deps) {
|
|
|
153
153
|
throw new Error(nodeToolUnboundText(unbound));
|
|
154
154
|
// Every secret the server keeps sealed (store-secrets.ts) held by the runner's one redactor before the workflow runs.
|
|
155
155
|
if (run?.redact && deps.sealKey)
|
|
156
|
-
await holdStored(
|
|
156
|
+
await holdStored(run.redact, deps.store, deps.sealKey, deps.data);
|
|
157
157
|
const tiers = tiersOf(claimed.workflow);
|
|
158
158
|
// The run's own keys, as the server's runnable check reads them: each by its name from the runner's environment first,
|
|
159
159
|
// then the store's sealed value (claim-secrets.ts; the environment wins, rule 4), scoped to what the run needs. Its
|
|
@@ -171,7 +171,7 @@ export function workflowSpecOf(deps) {
|
|
|
171
171
|
if (keyedAtClaim(runKey))
|
|
172
172
|
withoutModelKeys(claimedEnv);
|
|
173
173
|
if (runKey && run?.redact)
|
|
174
|
-
holdRunKey(
|
|
174
|
+
holdRunKey(run.redact, runKey);
|
|
175
175
|
const providerOf = deps.providerOf ?? routeProviderOf(claimModelEnv(deps.env ?? process.env, claimedEnv, runKey, claim));
|
|
176
176
|
// Each tier's provider and cap model, resolved once; the proxies start here (before the Harness opens, since the models
|
|
177
177
|
// catalog the Harness takes points at them), their hooks deferred to the booking wired at harnessReady.
|
|
@@ -342,7 +342,7 @@ export function workflowSpecOf(deps) {
|
|
|
342
342
|
const writer = await sessions.open(SESSION);
|
|
343
343
|
// Its model nodes' requests on free models count toward the run's limit of them, capped or not. A step waiting for
|
|
344
344
|
// room under it (a map's branch, beside its siblings' holds) leaves at the run's stop or park, unsent.
|
|
345
|
-
const run = runCap({ sessions: sessions, capUsd: () => effectiveCapUsd, modelOf: capModelOf, freeRequests: freeRequestLimitOf(deps.env ?? process.env, claimed.revision.body.maxRequests), ...(context.abortSignal ? { stopped: context.abortSignal } : {}) });
|
|
345
|
+
const run = runCap({ sessions: sessions, capUsd: () => effectiveCapUsd, modelOf: capModelOf, freeRequests: freeRequestLimitOf(deps.env ?? process.env, claimed.revision.body.maxRequests), ...(maxRequestsOf(claimed.revision.body.maxRequests) === undefined ? {} : { maxRequests: maxRequestsOf(claimed.revision.body.maxRequests) }), ...(context.abortSignal ? { stopped: context.abortSignal } : {}) });
|
|
346
346
|
booking = await modelPortFor(writer, {
|
|
347
347
|
key: SESSION,
|
|
348
348
|
label: SESSION,
|
package/dist/sdk/check.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Shown } from "../learning.js";
|
|
2
|
+
import { type PromotionDeps } from "../runner/promotion.js";
|
|
2
3
|
import type { RunLaunch } from "../run-launch.js";
|
|
3
4
|
import type { Store } from "../store/store.js";
|
|
4
5
|
import type { SdkInbox } from "./runs.js";
|
|
@@ -21,7 +22,8 @@ export type SdkWorkflowCheckEvent = {
|
|
|
21
22
|
* the check (sdkCheckTurn: kept until the check holds compile_after rows, the one that makes compile_after deciding on
|
|
22
23
|
* them all); any other turn is given back (releaseSdkCheck) and the check waits for the next turn; a turn the backend
|
|
23
24
|
* never completed before its inbox expired is one failed row (sdkCheckDeadline). Exact retries and reclaims compete on
|
|
24
|
-
* the reservation.
|
|
25
|
+
* the reservation. `refused`: what the purge gate refuses of the records, so the promotions trim keeps the champion its
|
|
26
|
+
* readers serve (purged-workflow.ts refusedIn). */
|
|
25
27
|
export declare function settleSdkCheck(deps: {
|
|
26
28
|
store: Store;
|
|
27
29
|
agentId: string;
|
|
@@ -29,4 +31,5 @@ export declare function settleSdkCheck(deps: {
|
|
|
29
31
|
inbox: SdkInbox;
|
|
30
32
|
shown: () => Promise<Shown>;
|
|
31
33
|
log: (line: string) => void;
|
|
34
|
+
refused?: PromotionDeps["refused"];
|
|
32
35
|
}): Promise<import("../learn/promote.js").Recorded | undefined>;
|
package/dist/sdk/check.js
CHANGED
|
@@ -25,7 +25,8 @@ function notBaseline(inbox, reported) {
|
|
|
25
25
|
* the check (sdkCheckTurn: kept until the check holds compile_after rows, the one that makes compile_after deciding on
|
|
26
26
|
* them all); any other turn is given back (releaseSdkCheck) and the check waits for the next turn; a turn the backend
|
|
27
27
|
* never completed before its inbox expired is one failed row (sdkCheckDeadline). Exact retries and reclaims compete on
|
|
28
|
-
* the reservation.
|
|
28
|
+
* the reservation. `refused`: what the purge gate refuses of the records, so the promotions trim keeps the champion its
|
|
29
|
+
* readers serve (purged-workflow.ts refusedIn). */
|
|
29
30
|
export async function settleSdkCheck(deps) {
|
|
30
31
|
const { inbox } = deps;
|
|
31
32
|
const check = inbox.learning_check;
|
package/dist/sdk/runs.d.ts
CHANGED
|
@@ -131,8 +131,8 @@ export declare class SdkRuns {
|
|
|
131
131
|
workflows: LearnedWorkflow[];
|
|
132
132
|
};
|
|
133
133
|
}>;
|
|
134
|
-
/** The purged run (
|
|
135
|
-
*
|
|
134
|
+
/** The purged run (purgeGate) that wrote a workflow of `pinned`, each read at the learning commit a start took its
|
|
135
|
+
* text from. One read-only exec per commit. */
|
|
136
136
|
private purgedPinned;
|
|
137
137
|
/** The workflows a start delivers and the learning commit each was read at (`commits`: the seed's, or its champion
|
|
138
138
|
* record's), and the drafts a check may take. */
|
package/dist/sdk/runs.js
CHANGED
|
@@ -18,7 +18,7 @@ import { secretRedactor } from "../runner/redact.js";
|
|
|
18
18
|
import { redactedOutput } from "../key-refusal.js";
|
|
19
19
|
import { decodedStrings, draftProblems } from "../learn/workflow-draft.js";
|
|
20
20
|
import { snapshotAt } from "../learn/folder.js";
|
|
21
|
-
import { purgedRun,
|
|
21
|
+
import { purgedRun, purgeGate, refusedIn, refusedOf } from "../purged-workflow.js";
|
|
22
22
|
import { sdkWorkflowManifest, sdkDraftTools } from "./workflows.js";
|
|
23
23
|
import { promotionOf, promotionsOf, resetAtOf } from "../learn/promote.js";
|
|
24
24
|
import { championTextOf, releaseSdkCheck, reserveSdkCheck } from "../runner/promotion.js";
|
|
@@ -308,7 +308,7 @@ export class SdkRuns {
|
|
|
308
308
|
// A turn is a check only when it can be one's baseline: no protected value in its task or policy, and an input the
|
|
309
309
|
// draft takes (sdkTakes). A prose turn whose input the client cannot resolve is given back (releaseSdkCheck).
|
|
310
310
|
const takes = (flow) => !redacted && sdkTakes(flow, input, resolveSchemaForWorkflow);
|
|
311
|
-
const checkDeps = { store: this.store, agentId: entry.agent.id, log: () => { }, shown: async () => secretsShown(this.secrets(), { local: true }) };
|
|
311
|
+
const checkDeps = { store: this.store, agentId: entry.agent.id, log: () => { }, shown: async () => secretsShown(this.secrets(), { local: true }), refused: refusedIn(() => learningFolderOf(this.data, entry.agent.id), this.store) };
|
|
312
312
|
const check = learning ? await reserveSdkCheck(checkDeps, { runId, revision: learning.seed, learning: revisionBody.learning, flows: selected.candidates, takes }) : undefined;
|
|
313
313
|
// A shadow check needs the original agent's own answer, not an answer produced by its existing champion.
|
|
314
314
|
const workflows = check ? [] : selected.workflows;
|
|
@@ -407,15 +407,15 @@ export class SdkRuns {
|
|
|
407
407
|
},
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
|
-
/** The purged run (
|
|
411
|
-
*
|
|
410
|
+
/** The purged run (purgeGate) that wrote a workflow of `pinned`, each read at the learning commit a start took its
|
|
411
|
+
* text from. One read-only exec per commit. */
|
|
412
412
|
async purgedPinned(agentId, pinned) {
|
|
413
413
|
if (pinned.length === 0)
|
|
414
414
|
return undefined;
|
|
415
415
|
const folder = learningFolderOf(this.data, agentId);
|
|
416
416
|
try {
|
|
417
417
|
const reads = new Map();
|
|
418
|
-
const at = (commit) => reads.get(commit) ?? reads.set(commit, snapshotAt(folder.workspace, commit).then((snapshot) =>
|
|
418
|
+
const at = (commit) => reads.get(commit) ?? reads.set(commit, snapshotAt(folder.workspace, commit).then(async (snapshot) => (await purgeGate(snapshot, this.store)).workflows)).get(commit);
|
|
419
419
|
for (const [flow, commit] of pinned) {
|
|
420
420
|
const row = (await at(commit)).get(flow.name);
|
|
421
421
|
if (row)
|
|
@@ -447,8 +447,10 @@ export class SdkRuns {
|
|
|
447
447
|
};
|
|
448
448
|
const workflows = [], candidates = [], commits = {};
|
|
449
449
|
const atCommit = async (name, commit) => chooseWorkflows(await seedAt(folder.workspace, commit, this.store), secretsShown(this.secrets(), { local: true })).flows.find((one) => one.name === name);
|
|
450
|
+
// The champion skips a record the purge gate refuses at its commit (purged-workflow.ts refusedOf), as a claim's does.
|
|
451
|
+
const refused = async (all, names) => refusedOf(all, names ?? all.map((one) => one.workflow), folder.workspace, this.store);
|
|
450
452
|
for (const flow of flows) {
|
|
451
|
-
const { text: serving, champion } = await championTextOf(records, flow, atCommit);
|
|
453
|
+
const { text: serving, champion } = await championTextOf(records, flow, atCommit, refused);
|
|
452
454
|
if (serving && compatible(serving)) {
|
|
453
455
|
workflows.push(serving);
|
|
454
456
|
commits[serving.name] = serving === flow ? seed.sha : champion.commit;
|
package/dist/secret-cut.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// cut, for what the importer writes (a transcript can hold a key a tool printed or was given). The import adds the keys
|
|
3
3
|
// secretlint finds in what it reads (`secretsIn`): keys of a known format, whoever's they are.
|
|
4
4
|
import { lintSource } from "@secretlint/core";
|
|
5
|
+
// The recommended preset's rules, built into core since secretlint v14 (the preset's own package is deprecated).
|
|
6
|
+
import { recommendedRules as recommended } from "@secretlint/core/builtin";
|
|
5
7
|
import { secretLintProfiler } from "@secretlint/profiler";
|
|
6
|
-
import { rules as recommended } from "@secretlint/secretlint-rule-preset-recommend";
|
|
7
8
|
// No performance marks: the profiler would leave about 14 a call in the process's global buffer.
|
|
8
9
|
secretLintProfiler.setEnabled(false);
|
|
9
10
|
import { keyShaped } from "./secret-name.js";
|
package/dist/secret-writes.d.ts
CHANGED
|
@@ -63,10 +63,11 @@ export type SecretPredicate = (body: unknown) => boolean;
|
|
|
63
63
|
/** What a request is besides its body, for a predicate that must read what is stored: the route's path parameters (in
|
|
64
64
|
* the order its pattern names them) and the server's one store. `seen`: what the predicate read to let the request
|
|
65
65
|
* through, which the dispatch hands its operation, so a write allowed against one stored state is refused when that
|
|
66
|
-
* state changed before the write lands. */
|
|
66
|
+
* state changed before the write lands. `apiOnly`: the server is API-only (api-only.ts), with no owner to write one. */
|
|
67
67
|
export type SecretRequest = {
|
|
68
68
|
readonly params: readonly string[];
|
|
69
69
|
readonly store: unknown;
|
|
70
|
+
readonly apiOnly?: boolean;
|
|
70
71
|
seen?: unknown;
|
|
71
72
|
};
|
|
72
73
|
/** Whether a request writes a secret by what it would do to what is stored (drop or replace a sealed credential), read
|
|
@@ -139,7 +140,7 @@ export declare const SECRET_META_SCHEMA: {
|
|
|
139
140
|
readonly name: {
|
|
140
141
|
readonly type: "string";
|
|
141
142
|
readonly pattern: "^[a-z][a-z0-9-]*(:[^:]+)+$";
|
|
142
|
-
readonly description: "The secret's name, \"<plane>:<id>\": a lowercase plane and the id as the plane keys it, joined with \":\": tool:<KEY_NAME>, model:<KEY_NAME>, mcp:<server> (several of one server: mcp:<server>:<field>), computer:<provider>:<KEY>, workspace:archil, trigger:<id>, webhook:outbound, github:app, source:<adapter>:<field>. An object holding one secret carries it as `secret`, one holding several as `secrets`.";
|
|
143
|
+
readonly description: "The secret's name, \"<plane>:<id>\": a lowercase plane and the id as the plane keys it, joined with \":\": tool:<KEY_NAME>, model:<KEY_NAME>, mcp:<server> (several of one server: mcp:<server>:<field>), computer:<provider>:<KEY>, harness:<harness>:<KEY>, workspace:archil, trigger:<id>, webhook:outbound, github:app, source:<adapter>:<field>. An object holding one secret carries it as `secret`, one holding several as `secrets`.";
|
|
143
144
|
};
|
|
144
145
|
readonly set: {
|
|
145
146
|
readonly type: "boolean";
|
package/dist/secret-writes.js
CHANGED
|
@@ -160,7 +160,7 @@ export const SECRET_META_SCHEMA = {
|
|
|
160
160
|
required: ["name", "set", "source", "changed_at"],
|
|
161
161
|
description: "What a secret's view says of it: its name, whether it is set, where it came from, and when it last changed. Never a value, a prefix, a length or a hash.",
|
|
162
162
|
properties: {
|
|
163
|
-
name: { type: "string", pattern: "^[a-z][a-z0-9-]*(:[^:]+)+$", description: "The secret's name, \"<plane>:<id>\": a lowercase plane and the id as the plane keys it, joined with \":\": tool:<KEY_NAME>, model:<KEY_NAME>, mcp:<server> (several of one server: mcp:<server>:<field>), computer:<provider>:<KEY>, workspace:archil, trigger:<id>, webhook:outbound, github:app, source:<adapter>:<field>. An object holding one secret carries it as `secret`, one holding several as `secrets`." },
|
|
163
|
+
name: { type: "string", pattern: "^[a-z][a-z0-9-]*(:[^:]+)+$", description: "The secret's name, \"<plane>:<id>\": a lowercase plane and the id as the plane keys it, joined with \":\": tool:<KEY_NAME>, model:<KEY_NAME>, mcp:<server> (several of one server: mcp:<server>:<field>), computer:<provider>:<KEY>, harness:<harness>:<KEY>, workspace:archil, trigger:<id>, webhook:outbound, github:app, source:<adapter>:<field>. An object holding one secret carries it as `secret`, one holding several as `secrets`." },
|
|
164
164
|
set: { type: "boolean", description: "Whether a value is set." },
|
|
165
165
|
source: { enum: ["env", "console", "sign-in", null], description: "Where it came from: env, the environment the server starts with (which always wins, by the same name, and greys the console's field); console, pasted in the console by the owner's session; sign-in, obtained by an OAuth sign-in or Connect. null when not set." },
|
|
166
166
|
changed_at: { type: ["string", "null"], format: "date-time", description: "When the credential itself last changed (pasted, signed in, rotated); null when not set or not known." },
|
package/dist/server.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ import { type LearningMode } from "./learning.js";
|
|
|
8
8
|
import { type Place } from "./place.js";
|
|
9
9
|
import { type ApiToken } from "./api-token.js";
|
|
10
10
|
import { type Store } from "./store/index.js";
|
|
11
|
-
import { type BoxOffer } from "./place-offers.js";
|
|
11
|
+
import { type BoxOffer, type ContainerFacts } from "./place-offers.js";
|
|
12
|
+
import { type Wait } from "./docker-host-addresses.js";
|
|
12
13
|
import { type StoredKeys } from "./secrets.js";
|
|
13
14
|
import { type ComposioControl } from "./composio-preset.js";
|
|
14
15
|
import type { UsageEventName } from "./telemetry.js";
|
|
@@ -146,6 +147,10 @@ export type ServeOptions = {
|
|
|
146
147
|
/** With `faux` only: a module whose default export is the fetch web_search's keyless Exa search sends through, in place
|
|
147
148
|
* of Exa's MCP endpoint (exa-keyless.ts). */
|
|
148
149
|
fauxExa?: string;
|
|
150
|
+
/** With `faux` only: the URL of a fake MCP server (a test's, on loopback) that web_search's and web_fetch's keyless
|
|
151
|
+
* Firecrawl ask in place of Firecrawl's endpoint (firecrawl-keyless.ts). A URL, not a module: it is passed as given.
|
|
152
|
+
* Under `faux` with none, keyless Firecrawl is never asked. */
|
|
153
|
+
fauxFirecrawl?: string;
|
|
149
154
|
/** A module of harness table entries merged over the built-in ones (harness-table.ts HARNESS_TABLE_ENV): a test's
|
|
150
155
|
* stand-ins for the harnesses. */
|
|
151
156
|
harnessTable?: string;
|
|
@@ -160,6 +165,9 @@ export type ServeOptions = {
|
|
|
160
165
|
harnessSignIn?: boolean;
|
|
161
166
|
/** With `faux` only: Docker answers, so docker is available, and nothing asks Docker (place-offers.ts). */
|
|
162
167
|
fauxDocker?: boolean;
|
|
168
|
+
/** For tests: how long the Claude Code CLI's own sign-in this server starts waits for its browser before it is ended
|
|
169
|
+
* (claude-sign-in.ts), in place of 10 minutes. */
|
|
170
|
+
claudeSignInLimitMs?: number;
|
|
163
171
|
/** For tests: the lock each harness's first use installs by (harness-install.ts), by harness, with the package.json it
|
|
164
172
|
* locks beside it, in place of the one AgentRun ships, whose packages a test's own registry serves. */
|
|
165
173
|
harnessLocks?: Readonly<Record<string, string>>;
|
|
@@ -169,6 +177,12 @@ export type ServeOptions = {
|
|
|
169
177
|
/** Under `faux`: a file read as this server's /proc/self/mountinfo (box-paths.ts), a container's in a test; absent (and
|
|
170
178
|
* no FAUX_MOUNTINFO_ENV), a faux server is on a host. */
|
|
171
179
|
fauxMountinfo?: string;
|
|
180
|
+
/** For tests: whether Docker's start probe takes this server to be in a container (place-offers.ts containerReason),
|
|
181
|
+
* in place of its own marks; a faux server's is a host's. */
|
|
182
|
+
probeContainer?: ContainerFacts;
|
|
183
|
+
/** For tests: the wait before each read again of the Docker host's addresses after the start's failed
|
|
184
|
+
* (docker-host-addresses.ts retryHostAddresses), in place of the backoff's timer. */
|
|
185
|
+
hostReadWait?: Wait;
|
|
172
186
|
/** Extra `Host` names to accept besides the loopback ones, on any port (host-check.ts). */
|
|
173
187
|
allowHosts?: string[];
|
|
174
188
|
/** The console's built files, answered at / (default dist/console beside the server, which this package's build copies
|
|
@@ -219,6 +233,9 @@ export type ServeOptions = {
|
|
|
219
233
|
githubApi?: string;
|
|
220
234
|
/** A test's seam: the origin a github_app MCP server may have (default GitHub's hosted MCP: github.ts GITHUB_MCP_ORIGIN). */
|
|
221
235
|
githubMcpOrigin?: string;
|
|
236
|
+
/** A test's seam: the one origin a Composio key read from the environment is sent to (default Composio's:
|
|
237
|
+
* composio-made.ts COMPOSIO_ORIGIN). */
|
|
238
|
+
composioMcpOrigin?: string;
|
|
222
239
|
/** A test's seam: how long a hook's body has to arrive, whole (default 30 s: push-handler.ts HOOK_BODY_MS). */
|
|
223
240
|
hookBodyMs?: number;
|
|
224
241
|
/** A test's seam: awaited by a message (a person's, or a trigger's firing) once its checks have passed and just before its
|
|
@@ -298,6 +315,9 @@ export type Serve = {
|
|
|
298
315
|
* it is this process's finding, never a store's, so another runner on a shared store never inherits it. A runner in
|
|
299
316
|
* its own process takes its own operator's opt-in from its own environment (runner/main.ts runnerLoopback). */
|
|
300
317
|
localInstall: boolean;
|
|
318
|
+
/** The OLLAMA_HOST its runner beside it asks (ollama-provider.ts ollamaHostOf): this server's own, else the default
|
|
319
|
+
* address where this is one owner's own machine; none on a shared one that names none (runner/beside.ts ollamaHost). */
|
|
320
|
+
ollamaHost: string | undefined;
|
|
301
321
|
/** This server's own addresses (McpServersOverStore.own): where it listens, and its public address when that is on
|
|
302
322
|
* loopback. The runner beside it is told them with localInstall (runner/beside.ts mcpOwn), so its runs' loopback reads
|
|
303
323
|
* never reach this server, as its own reads never do. */
|
|
@@ -375,11 +395,11 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
|
|
|
375
395
|
run_isolation: "uid" | "process";
|
|
376
396
|
/** The harnesses a revision may name (`definition.harness`), whether this server runs each, and how many at once. */
|
|
377
397
|
harnesses: {
|
|
398
|
+
available: boolean;
|
|
378
399
|
max_concurrent_runs: number;
|
|
379
400
|
id: string;
|
|
380
401
|
label: string;
|
|
381
402
|
promises: import("./harness-table.js").HarnessPromises;
|
|
382
|
-
available: boolean;
|
|
383
403
|
steer: boolean;
|
|
384
404
|
reason?: string;
|
|
385
405
|
default_model: string | null;
|
|
@@ -607,12 +627,19 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
|
|
|
607
627
|
routes: boolean;
|
|
608
628
|
at_rest: string;
|
|
609
629
|
};
|
|
630
|
+
/** GET /settings/harness-keys and PUT/DELETE of one key: a plan-billed recipe's keys, saved for that harness alone
|
|
631
|
+
* (harness-keys.ts); `harnesses` its ids here, so the console offers the page only where there is one. */
|
|
632
|
+
harness_keys: {
|
|
633
|
+
routes: boolean;
|
|
634
|
+
at_rest: string;
|
|
635
|
+
harnesses: string[];
|
|
636
|
+
};
|
|
610
637
|
/** /settings/mcp-servers: remote MCP servers previewed and saved, each credential sealed under the server's seal key,
|
|
611
638
|
* which always exists (seal-key.ts), so MCP credentials are always kept sealed. Every harness of the table runs a
|
|
612
639
|
* grant (runnable.ts takes one on any), a module's among them. */
|
|
613
640
|
mcp_client: {
|
|
614
641
|
transports: string[];
|
|
615
|
-
auth: ("headers" | "none" | "
|
|
642
|
+
auth: ("headers" | "none" | "bearer" | "oauth" | "github_app" | "per_run")[];
|
|
616
643
|
at_rest: string;
|
|
617
644
|
harnesses: string[];
|
|
618
645
|
};
|
|
@@ -703,11 +730,11 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
|
|
|
703
730
|
run_isolation: "uid" | "process";
|
|
704
731
|
/** The harnesses a revision may name (`definition.harness`), whether this server runs each, and how many at once. */
|
|
705
732
|
harnesses: {
|
|
733
|
+
available: boolean;
|
|
706
734
|
max_concurrent_runs: number;
|
|
707
735
|
id: string;
|
|
708
736
|
label: string;
|
|
709
737
|
promises: import("./harness-table.js").HarnessPromises;
|
|
710
|
-
available: boolean;
|
|
711
738
|
steer: boolean;
|
|
712
739
|
reason?: string;
|
|
713
740
|
default_model: string | null;
|
|
@@ -935,12 +962,19 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
|
|
|
935
962
|
routes: boolean;
|
|
936
963
|
at_rest: string;
|
|
937
964
|
};
|
|
965
|
+
/** GET /settings/harness-keys and PUT/DELETE of one key: a plan-billed recipe's keys, saved for that harness alone
|
|
966
|
+
* (harness-keys.ts); `harnesses` its ids here, so the console offers the page only where there is one. */
|
|
967
|
+
harness_keys: {
|
|
968
|
+
routes: boolean;
|
|
969
|
+
at_rest: string;
|
|
970
|
+
harnesses: string[];
|
|
971
|
+
};
|
|
938
972
|
/** /settings/mcp-servers: remote MCP servers previewed and saved, each credential sealed under the server's seal key,
|
|
939
973
|
* which always exists (seal-key.ts), so MCP credentials are always kept sealed. Every harness of the table runs a
|
|
940
974
|
* grant (runnable.ts takes one on any), a module's among them. */
|
|
941
975
|
mcp_client: {
|
|
942
976
|
transports: string[];
|
|
943
|
-
auth: ("headers" | "none" | "
|
|
977
|
+
auth: ("headers" | "none" | "bearer" | "oauth" | "github_app" | "per_run")[];
|
|
944
978
|
at_rest: string;
|
|
945
979
|
harnesses: string[];
|
|
946
980
|
};
|
|
@@ -1023,11 +1057,16 @@ export declare function forCaller<T extends {
|
|
|
1023
1057
|
}>(caps: T, ownerSession: boolean): T;
|
|
1024
1058
|
/** A start with --harness-sign-in on a server that is not one owner's own, on their own machine. */
|
|
1025
1059
|
export declare const HARNESS_SIGN_IN_NOT_LOCAL = "HARNESS_SIGN_IN_NOT_LOCAL";
|
|
1060
|
+
/** Why `options` on `data` is not one owner's own server on their own machine, each reason in words; none when it is. One
|
|
1061
|
+
* owner's own: it listens on loopback alone, with no public address; its store is the SQLite one in its data directory (no
|
|
1062
|
+
* AGENTRUN_STORE_URL, which servers elsewhere share); its runs run beside it as its own user (`ownUser`:
|
|
1063
|
+
* runIsolationOf's `process`), never under --no-runner or a user of their own; and one person starts them, as Claude
|
|
1064
|
+
* Code's login on this machine asks (claude-login.ts whyNotOneOwner): an owner, and one API token. What --harness-sign-in
|
|
1065
|
+
* starts under (harnessSignInRefusal), and where the Ollama at this machine's default address is a model of the person
|
|
1066
|
+
* who starts runs (ollama-provider.ts ollamaHostOf). */
|
|
1067
|
+
export declare function whyNotOwnMachine(options: Pick<ServeOptions, "host" | "publicUrl" | "runnerApart" | "apiOnly" | "token" | "tokens">, data: string, ownUser: boolean): string[];
|
|
1026
1068
|
/** Why `options` on `data` may not run a recipe on its owner's own sign-in (--harness-sign-in), in words; undefined when
|
|
1027
|
-
* it may
|
|
1028
|
-
*
|
|
1029
|
-
* it as its own user (`ownUser`: runIsolationOf's `process`), never under --no-runner or a user of their own; and one
|
|
1030
|
-
* person starts them, as Claude Code's login on this machine asks (claude-login.ts whyNotOneOwner): an owner, and one
|
|
1031
|
-
* API token. A check, a schedule and a shared server run on a key (HARNESS.md#sign-in). */
|
|
1069
|
+
* it may: one owner's own server on their own machine alone (whyNotOwnMachine). A check, a schedule and a shared server
|
|
1070
|
+
* run on a key (HARNESS.md#sign-in). */
|
|
1032
1071
|
export declare function harnessSignInRefusal(options: Pick<ServeOptions, "host" | "publicUrl" | "runnerApart" | "apiOnly" | "token" | "tokens">, data: string, ownUser: boolean): string | undefined;
|
|
1033
1072
|
export declare function startServe(options: ServeOptions): Promise<Serve>;
|