@parcha/agentrun-serve 0.1.0-beta.46 → 0.1.0-beta.48
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 +211 -1
- package/NOTICE +4 -0
- package/README.md +350 -53
- package/dist/acp-package.d.ts +53 -6
- package/dist/acp-package.js +3 -3
- package/dist/adapter-facts.d.ts +3 -4
- package/dist/adapter-facts.js +4 -4
- package/dist/adapters.d.ts +3 -5
- package/dist/adapters.js +1 -31
- package/dist/agents-store.d.ts +5 -3
- package/dist/agents-store.js +13 -8
- package/dist/answer-json.d.ts +10 -0
- package/dist/answer-json.js +24 -0
- package/dist/api-only.d.ts +11 -11
- package/dist/api-only.js +16 -11
- package/dist/archil-routes.js +2 -1
- package/dist/browser-live.d.ts +9 -4
- package/dist/browser-live.js +18 -5
- package/dist/cap.js +10 -2
- package/dist/chatgpt-plan.js +2 -1
- package/dist/cli.js +109 -41
- package/dist/composio-made.d.ts +19 -2
- package/dist/composio-made.js +17 -5
- package/dist/composio-preset.d.ts +42 -7
- package/dist/composio-preset.js +106 -70
- package/dist/composio-triggers.d.ts +9 -4
- package/dist/composio-triggers.js +20 -13
- package/dist/computer-attach.d.ts +11 -10
- package/dist/computer-attach.js +13 -14
- package/dist/computer-commands.d.ts +3 -0
- package/dist/computer-commands.js +3 -2
- package/dist/computer-lost.d.ts +4 -0
- package/dist/computer-lost.js +8 -3
- package/dist/computer-routes.d.ts +8 -5
- package/dist/computer-routes.js +7 -5
- package/dist/computer-setting.d.ts +2 -0
- package/dist/computer-setting.js +2 -0
- package/dist/computers.d.ts +14 -76
- package/dist/computers.js +24 -68
- package/dist/conformance.d.ts +4 -0
- package/dist/conformance.js +6 -0
- package/dist/console/assets/index-CTGegcKt.css +1 -0
- package/dist/console/assets/index-D1Se6mgG.js +715 -0
- package/dist/console/index.html +2 -2
- package/dist/cost-heal.d.ts +13 -0
- package/dist/cost-heal.js +27 -0
- package/dist/dial-relay.d.ts +6 -2
- package/dist/dial-relay.js +9 -12
- package/dist/email/routes.js +2 -1
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +5 -0
- package/dist/exa-keyless.d.ts +1 -1
- package/dist/exa-keyless.js +1 -1
- package/dist/faux-computers.d.ts +2 -3
- package/dist/faux-computers.js +9 -31
- package/dist/github-connection.js +2 -1
- package/dist/harness-archive.d.ts +19 -2
- package/dist/harness-archive.js +49 -15
- package/dist/harness-check.d.ts +75 -0
- package/dist/harness-check.js +518 -0
- package/dist/harness-cursor.d.ts +28 -0
- package/dist/harness-cursor.js +42 -0
- package/dist/harness-goose.d.ts +4 -29
- package/dist/harness-goose.js +6 -86
- package/dist/harness-module.d.ts +4 -0
- package/dist/harness-module.js +1 -0
- package/dist/harness-owned.d.ts +52 -0
- package/dist/harness-owned.js +92 -0
- package/dist/harness-recipe.d.ts +127 -0
- package/dist/harness-recipe.js +335 -0
- package/dist/harness-table.d.ts +120 -5
- package/dist/harness-table.js +280 -6
- package/dist/harness.d.ts +2 -0
- package/dist/harness.js +5 -4
- package/dist/host-check.d.ts +6 -0
- package/dist/host-check.js +14 -0
- package/dist/host.d.ts +10 -3
- package/dist/host.js +17 -3
- package/dist/import-sources.d.ts +2 -0
- package/dist/import-sources.js +2 -0
- package/dist/import-summary.d.ts +15 -5
- package/dist/import-summary.js +24 -8
- package/dist/import.d.ts +24 -4
- package/dist/import.js +108 -26
- package/dist/key-refusal.d.ts +3 -1
- package/dist/key-refusal.js +26 -5
- package/dist/key-words.d.ts +1 -1
- package/dist/key-words.js +4 -4
- package/dist/learn/check.d.ts +3 -0
- package/dist/learn/check.js +31 -20
- package/dist/learn/compile.js +12 -5
- package/dist/learn/promote.d.ts +80 -2
- package/dist/learn/promote.js +95 -3
- package/dist/learn/secrets.d.ts +4 -0
- package/dist/learn/secrets.js +23 -0
- package/dist/learned-nodes.d.ts +4 -3
- package/dist/learned-workflow.js +4 -1
- package/dist/learning-cost.d.ts +6 -16
- package/dist/learning-cost.js +6 -12
- package/dist/learning-model.d.ts +18 -0
- package/dist/learning-model.js +77 -0
- package/dist/learning-words.d.ts +2 -0
- package/dist/learning-words.js +1 -1
- package/dist/listen-first.d.ts +10 -0
- package/dist/listen-first.js +25 -1
- package/dist/llms.txt +2 -1
- package/dist/mcp-gateway.d.ts +2 -1
- package/dist/mcp-gateway.js +31 -15
- package/dist/mcp-probe.d.ts +18 -6
- package/dist/mcp-probe.js +41 -8
- package/dist/mcp-secret-writes.d.ts +8 -0
- package/dist/mcp-secret-writes.js +104 -4
- package/dist/mcp-servers-store.d.ts +11 -5
- package/dist/mcp-servers-store.js +46 -20
- package/dist/model-form.d.ts +2 -1
- package/dist/model-form.js +30 -16
- package/dist/model-gateway.d.ts +113 -0
- package/dist/model-gateway.js +433 -0
- package/dist/model.d.ts +5 -3
- package/dist/model.js +26 -18
- package/dist/monid.js +1 -1
- package/dist/native/binding.d.ts +4 -0
- package/dist/native/binding.js +9 -0
- package/dist/native/cli.d.ts +3 -2
- package/dist/native/cli.js +6 -5
- package/dist/openapi.d.ts +2 -0
- package/dist/openapi.js +356 -43
- package/dist/owner.d.ts +4 -2
- package/dist/owner.js +10 -4
- package/dist/page.d.ts +9 -0
- package/dist/page.js +10 -2
- package/dist/port-models.js +17 -10
- package/dist/provider.d.ts +3 -3
- package/dist/provider.js +12 -3
- package/dist/public-address.d.ts +28 -0
- package/dist/public-address.js +62 -0
- package/dist/run-launch.d.ts +1 -1
- package/dist/run-launch.js +1 -1
- package/dist/run-secrets.d.ts +3 -2
- package/dist/run-secrets.js +7 -4
- package/dist/run-trace.js +6 -3
- package/dist/runner/adapter-loop.d.ts +14 -8
- package/dist/runner/adapter-loop.js +58 -24
- package/dist/runner/adapter-run-spec.d.ts +15 -2
- package/dist/runner/adapter-run-spec.js +48 -10
- package/dist/runner/adapters/index.d.ts +4 -2
- package/dist/runner/adapters/index.js +6 -26
- package/dist/runner/adapters/pi.d.ts +5 -2
- package/dist/runner/adapters/pi.js +7 -4
- package/dist/runner/audit.d.ts +7 -0
- package/dist/runner/audit.js +15 -6
- package/dist/runner/claim-secrets.js +5 -1
- package/dist/runner/cli-run-spec.js +22 -10
- package/dist/runner/compare-end.d.ts +43 -0
- package/dist/runner/compare-end.js +95 -0
- package/dist/runner/computer-journal.d.ts +3 -0
- package/dist/runner/computer-journal.js +22 -2
- package/dist/runner/conformance/host-tools.d.ts +4 -0
- package/dist/runner/conformance/host-tools.js +14 -0
- package/dist/runner/harness-loops.d.ts +6 -1
- package/dist/runner/harness-loops.js +94 -54
- package/dist/runner/held.d.ts +5 -4
- package/dist/runner/journal-kinds.d.ts +4 -1
- package/dist/runner/journal-kinds.js +3 -0
- package/dist/runner/loop-contract.d.ts +10 -0
- package/dist/runner/main.d.ts +5 -5
- package/dist/runner/main.js +62 -11
- package/dist/runner/mcp-claim.js +40 -12
- package/dist/runner/meta-tools.js +4 -2
- package/dist/runner/metrics.d.ts +26 -0
- package/dist/runner/metrics.js +44 -1
- package/dist/runner/presence.d.ts +44 -0
- package/dist/runner/presence.js +96 -0
- package/dist/runner/promotion.d.ts +70 -7
- package/dist/runner/promotion.js +178 -28
- package/dist/runner/run-child-host.js +40 -10
- package/dist/runner/runner.d.ts +5 -0
- package/dist/runner/runner.js +8 -0
- package/dist/runner/sdk-loop.js +25 -1
- package/dist/runner/store-port.d.ts +3 -0
- package/dist/runner/store-secrets.js +19 -7
- package/dist/runner/workflow-first.d.ts +5 -2
- package/dist/runner/workflow-first.js +6 -3
- package/dist/runner/workflow-spec.js +3 -2
- package/dist/runs-over-store.d.ts +7 -2
- package/dist/runs-over-store.js +12 -4
- package/dist/sdk/check.d.ts +31 -0
- package/dist/sdk/check.js +58 -0
- package/dist/sdk/runs.d.ts +11 -3
- package/dist/sdk/runs.js +90 -15
- package/dist/sdk/schema.js +12 -4
- package/dist/secret-writes.d.ts +16 -3
- package/dist/secret-writes.js +28 -3
- package/dist/server-secrets-store.js +5 -0
- package/dist/server.d.ts +34 -2
- package/dist/server.js +437 -90
- package/dist/sign-ins-secrets.js +4 -1
- package/dist/skills/agentrun-serve/SKILL.md +11 -0
- package/dist/slack-url.d.ts +5 -0
- package/dist/slack-url.js +11 -0
- package/dist/slack.d.ts +107 -0
- package/dist/slack.js +292 -0
- package/dist/start-switches.d.ts +28 -0
- package/dist/start-switches.js +37 -0
- package/dist/stats.d.ts +1 -1
- package/dist/stats.js +2 -1
- package/dist/stop-signals.d.ts +11 -0
- package/dist/stop-signals.js +22 -0
- package/dist/store/agent-body.d.ts +1 -1
- package/dist/store/agent-body.js +2 -2
- package/dist/store/index.d.ts +3 -3
- package/dist/store/index.js +1 -1
- package/dist/store/postgres/migrations/0020_runners.sql +18 -0
- package/dist/store/postgres/store.d.ts +1 -1
- package/dist/store/postgres/store.js +4 -2
- package/dist/store/schema.d.ts +13 -5
- package/dist/store/schema.js +20 -11
- package/dist/store/seal.d.ts +16 -4
- package/dist/store/sqlite/store.d.ts +1 -1
- package/dist/store/sqlite/store.js +112 -28
- package/dist/store/store.d.ts +78 -24
- package/dist/store/store.js +11 -0
- package/dist/store-reads/analytics.js +3 -2
- package/dist/store-reads/cap.d.ts +7 -0
- package/dist/store-reads/cap.js +11 -1
- package/dist/store-reads/journal.js +27 -1
- package/dist/store-reads/learning.d.ts +23 -2
- package/dist/store-reads/learning.js +29 -8
- package/dist/store-reads/runs.d.ts +9 -0
- package/dist/store-reads/runs.js +19 -6
- package/dist/store-reads/stats.d.ts +4 -1
- package/dist/store-reads/stats.js +15 -6
- package/dist/store-view.d.ts +125 -14
- package/dist/store-view.js +156 -21
- package/dist/telemetry.d.ts +7 -7
- package/dist/telemetry.js +38 -15
- package/dist/template-eval.js +5 -2
- package/dist/template-github-permissions.d.ts +5 -1
- package/dist/template-github-permissions.js +7 -3
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.js +1 -1
- package/dist/timeline/timeline.d.ts +8 -0
- package/dist/timeline/timeline.js +30 -0
- package/dist/tool-gate.d.ts +8 -4
- package/dist/tool-gate.js +6 -7
- package/dist/tool-keys-store.js +2 -2
- package/dist/tool-keys.js +2 -1
- package/dist/tool-plane.d.ts +4 -0
- package/dist/tool-plane.js +12 -12
- package/dist/trigger-adapter.d.ts +3 -4
- package/dist/trigger-adapter.js +2 -2
- package/dist/trigger-composio.js +3 -3
- package/dist/trigger-email.js +0 -2
- package/dist/trigger-feed.js +0 -2
- package/dist/trigger-schedule.js +3 -0
- package/dist/trigger-secrets-shown.d.ts +6 -3
- package/dist/trigger-secrets-shown.js +22 -13
- package/dist/trigger-targets.d.ts +12 -3
- package/dist/trigger-targets.js +90 -10
- package/dist/triggers.d.ts +2 -2
- package/dist/validate.js +5 -1
- package/dist/viewer-credential.d.ts +25 -0
- package/dist/viewer-credential.js +51 -0
- package/dist/webhooks.d.ts +82 -8
- package/dist/webhooks.js +128 -45
- package/dist/wires.d.ts +6 -1
- package/dist/wires.js +5 -0
- package/dist/workspace/attach.d.ts +3 -2
- package/dist/workspace/attach.js +2 -1
- package/dist/workspace/attached-computers.d.ts +6 -8
- package/dist/workspace/attached-computers.js +27 -24
- package/dist/workspace/computer-deps.d.ts +2 -3
- package/dist/workspace/computer-deps.js +3 -6
- package/dist/workspace/computer-for-claim.js +72 -96
- package/dist/workspace/computer-kept.d.ts +0 -7
- package/dist/workspace/computer-kept.js +0 -17
- package/dist/workspace/resolve-computer.d.ts +23 -14
- package/dist/workspace/resolve-computer.js +66 -61
- package/dist/workspace/synced-folder.d.ts +20 -15
- package/dist/workspace/synced-folder.js +33 -43
- package/launcher/agentrun-serve +4 -1
- package/package.json +18 -10
- package/skills/agentrun-serve/SKILL.md +11 -0
- package/templates/README.md +1 -1
- package/templates/code-review/agent.md +2 -3
- package/templates/code-review/evals/mentions-defused/case.yaml +0 -1
- package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +0 -27
- package/templates/code-review/evals/other-repo/case.yaml +0 -1
- package/templates/code-review/evals/other-repo/fixtures/github-mcp.json +0 -18
- package/templates/code-review/evals/other-repo/graders/no-other-repo.md +1 -1
- package/dist/console/assets/index-C2MYaUBa.css +0 -1
- package/dist/console/assets/index-CZZeCReB.js +0 -701
package/dist/sdk/runs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Backend SDK calls remain in their application. This inbox only records their evidence and immutable completion;
|
|
2
2
|
// the ordinary fenced runner owns journals, reflection, checking and learning commits.
|
|
3
3
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
4
|
-
import { inspectWorkflow } from "@parcha/agentrun-dsl";
|
|
4
|
+
import { inspectWorkflow, resolveSchemaForWorkflow } from "@parcha/agentrun-dsl";
|
|
5
5
|
import { ApiError } from "../errors.js";
|
|
6
6
|
import { canonical, isObject } from "../store/agent-body.js";
|
|
7
7
|
import { uuidv7 } from "../agents-store.js";
|
|
@@ -9,10 +9,14 @@ import { launchBody } from "../run-launch.js";
|
|
|
9
9
|
import { learningStartFor } from "../runs-over-store.js";
|
|
10
10
|
import { chooseWorkflows, learningFolderOf, seedAt, secretsShown } from "../learning.js";
|
|
11
11
|
import { INSTRUCTION_EVIDENCE_BYTES } from "../native/instructions.js";
|
|
12
|
+
import { refuseWhileNoRunner } from "../runner/presence.js";
|
|
12
13
|
import { secretRedactor } from "../runner/redact.js";
|
|
13
14
|
import { redactedOutput } from "../key-refusal.js";
|
|
14
15
|
import { decodedStrings, draftProblems } from "../learn/workflow-draft.js";
|
|
15
16
|
import { sdkWorkflowManifest, sdkDraftTools } from "./workflows.js";
|
|
17
|
+
import { promotionOf, promotionsOf } from "../learn/promote.js";
|
|
18
|
+
import { championTextOf, releaseSdkCheck, reserveSdkCheck } from "../runner/promotion.js";
|
|
19
|
+
import { fits, workflowDigest } from "../runner/workflow-first.js";
|
|
16
20
|
const keyOf = (id) => `sdk-run:${id}`;
|
|
17
21
|
/** The settings key an SDK run's record is kept under (the run's delete with its agent's: agent-delete.ts). */
|
|
18
22
|
export const sdkRunKey = keyOf;
|
|
@@ -47,7 +51,7 @@ const usageOf = (value) => {
|
|
|
47
51
|
}
|
|
48
52
|
return result;
|
|
49
53
|
};
|
|
50
|
-
export const sdkOf = (body) => isObject(body) && isObject(body.sdk) && (body.sdk.runtime === "claude-agent-sdk" || body.sdk.runtime === "codex-sdk")
|
|
54
|
+
export const sdkOf = (body) => isObject(body) && isObject(body.sdk) && (body.sdk.runtime === "claude-agent-sdk" || body.sdk.runtime === "codex-sdk" || body.sdk.runtime === "eve")
|
|
51
55
|
? { runtime: body.sdk.runtime }
|
|
52
56
|
: undefined;
|
|
53
57
|
export async function sdkInbox(store, runId) {
|
|
@@ -187,6 +191,9 @@ export class SdkRuns {
|
|
|
187
191
|
const revisionBody = entry.revision.body;
|
|
188
192
|
if (revisionBody.maxCostUsd !== undefined)
|
|
189
193
|
throw new ApiError("agent_not_runnable", "AgentRun cannot enforce a spend cap on an external SDK. Configure the budget in the backend SDK and remove this managed run cap.");
|
|
194
|
+
// A runner keeps an SDK run's evidence and ends it: while every runner here refused to claim, the start is refused in
|
|
195
|
+
// their words, as any start is (prepareLaunch), before the caller holds a receipt it would run on.
|
|
196
|
+
await refuseWhileNoRunner(this.store.runners);
|
|
190
197
|
const learning = await learningStartFor(deps, entry, pinned.revision, revisionBody, {
|
|
191
198
|
noWorkflows: !workflow,
|
|
192
199
|
...(compile.model ? { model: compile.model } : {}),
|
|
@@ -200,9 +207,24 @@ export class SdkRuns {
|
|
|
200
207
|
if (learning.seedFailed)
|
|
201
208
|
throw new ApiError("unavailable", "The learning seed could not be read. Retry after restoring the agent learning folder.");
|
|
202
209
|
}
|
|
203
|
-
const
|
|
210
|
+
const selected = learning && !learning.noWorkflows && workflow ? await this.selectedWorkflows(entry.agent.id, learning.seed, workflow) : { workflows: [], candidates: [] };
|
|
204
211
|
const cleaned = this.clean({ instructions, ...(model ? { model } : {}) });
|
|
205
212
|
const runId = uuidv7();
|
|
213
|
+
const redacted = cleanedInput !== input || cleaned.instructions !== instructions;
|
|
214
|
+
let task;
|
|
215
|
+
try {
|
|
216
|
+
task = JSON.parse(input);
|
|
217
|
+
}
|
|
218
|
+
catch { /* A prose task: the client resolves the draft's input from the turn. */ }
|
|
219
|
+
// 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
|
|
220
|
+
// draft takes. A JSON object task is the input, so it must fit (the managed check's own rule); a prose task's input
|
|
221
|
+
// is resolved by the client from the turn's recorded tool inputs or the host's resolveCheckInput, and a turn it
|
|
222
|
+
// cannot resolve is given back (releaseSdkCheck), never counted.
|
|
223
|
+
const takes = (flow) => !redacted && (!isObject(task) || fits(flow, task, resolveSchemaForWorkflow));
|
|
224
|
+
const checkDeps = { store: this.store, agentId: entry.agent.id, log: () => { }, shown: async () => secretsShown(this.secrets(), { local: true }) };
|
|
225
|
+
const check = learning ? await reserveSdkCheck(checkDeps, { runId, revision: learning.seed, learning: revisionBody.learning, flows: selected.candidates, takes }) : undefined;
|
|
226
|
+
// A shadow check needs the original agent's own answer, not an answer produced by its existing champion.
|
|
227
|
+
const workflows = check ? [] : selected.workflows;
|
|
206
228
|
const launch = {
|
|
207
229
|
input: { content: cleanedInput },
|
|
208
230
|
title: cleanedInput.trim().replace(/\s+/g, " ").slice(0, 80),
|
|
@@ -217,18 +239,27 @@ export class SdkRuns {
|
|
|
217
239
|
...(learning ? { learning: { ...learning, workflows: workflows.map((flow) => flow.name) } } : {}),
|
|
218
240
|
};
|
|
219
241
|
const now = Date.now();
|
|
220
|
-
await this.store.settings.put(keyOf(runId), {
|
|
221
|
-
run_id: runId,
|
|
222
|
-
created_at: now,
|
|
223
|
-
expires_at: now + 3_600_000,
|
|
224
|
-
batches: [],
|
|
225
|
-
learning_workflows: workflows,
|
|
226
|
-
});
|
|
227
242
|
try {
|
|
243
|
+
await this.store.settings.put(keyOf(runId), {
|
|
244
|
+
run_id: runId,
|
|
245
|
+
created_at: now,
|
|
246
|
+
expires_at: now + 3_600_000,
|
|
247
|
+
batches: [],
|
|
248
|
+
learning_workflows: workflows,
|
|
249
|
+
...(check ? { learning_check: check } : {}),
|
|
250
|
+
...(redacted ? { check_redacted: true } : {}),
|
|
251
|
+
});
|
|
228
252
|
await this.store.runs.create({ id: runId, agentId: entry.agent.id, revisionId: entry.revision.id, ...(origin ? { origin } : {}) }, { body: launchBody(launch) });
|
|
229
253
|
}
|
|
230
254
|
catch (error) {
|
|
231
255
|
await this.store.settings.remove(keyOf(runId));
|
|
256
|
+
// The reservation comes first because the launch it is created with withholds the champion from a check's turn.
|
|
257
|
+
// No turn ran, so the check waits for the next one, the release uncounted: never a hold of a draft never compared.
|
|
258
|
+
if (check) {
|
|
259
|
+
const record = promotionOf(await promotionsOf(this.store.settings, entry.agent.id).catch(() => []), check.workflow.name, check.digest);
|
|
260
|
+
if (record?.decided === "replaying" && record.replay_id === check.id)
|
|
261
|
+
await releaseSdkCheck(checkDeps, record, "its start could not be admitted", false).catch(() => undefined);
|
|
262
|
+
}
|
|
232
263
|
throw error;
|
|
233
264
|
}
|
|
234
265
|
return this.receipt(runId, consoleOrigin);
|
|
@@ -242,7 +273,7 @@ export class SdkRuns {
|
|
|
242
273
|
const workflows = inbox.learning_workflows ?? [];
|
|
243
274
|
const shown = secretsShown(this.secrets(), { local: true });
|
|
244
275
|
if (shown.holds(launch.learning?.section ?? "") ||
|
|
245
|
-
workflows.some((flow) => {
|
|
276
|
+
[...workflows, ...(inbox.learning_check ? [inbox.learning_check.workflow] : [])].some((flow) => {
|
|
246
277
|
const decoded = decodedStrings(flow.workflow);
|
|
247
278
|
return shown.holds(flow.name) || shown.holds(flow.description) || shown.holds(flow.workflow) || decoded === "too_deep" || decoded.some(shown.holds);
|
|
248
279
|
}))
|
|
@@ -257,6 +288,7 @@ export class SdkRuns {
|
|
|
257
288
|
revision: launch.learning?.seed ?? null,
|
|
258
289
|
context: launch.learning?.section ?? "",
|
|
259
290
|
workflows,
|
|
291
|
+
...(inbox.learning_check ? { check: inbox.learning_check } : {}),
|
|
260
292
|
},
|
|
261
293
|
};
|
|
262
294
|
}
|
|
@@ -267,14 +299,25 @@ export class SdkRuns {
|
|
|
267
299
|
const { flows } = chooseWorkflows(seed, secretsShown(this.secrets(), { local: true }));
|
|
268
300
|
const dsl = await import("@parcha/agentrun-dsl");
|
|
269
301
|
const { tools, gated, deniedBy } = sdkDraftTools(binding.workflow_tools);
|
|
302
|
+
const records = await promotionsOf(this.store.settings, agentId);
|
|
270
303
|
let room = 256 * 1024;
|
|
271
|
-
|
|
304
|
+
const compatible = (flow) => {
|
|
272
305
|
const bytes = Buffer.byteLength(JSON.stringify(flow));
|
|
273
306
|
if (bytes > room || draftProblems(dsl, flow.workflow, tools, gated, deniedBy, undefined, binding.workflow_adapters).length)
|
|
274
307
|
return false;
|
|
275
308
|
room -= bytes;
|
|
276
309
|
return true;
|
|
277
|
-
}
|
|
310
|
+
};
|
|
311
|
+
const workflows = [], candidates = [];
|
|
312
|
+
const atCommit = async (name, commit) => chooseWorkflows(await seedAt(folder.workspace, commit), secretsShown(this.secrets(), { local: true })).flows.find((one) => one.name === name);
|
|
313
|
+
for (const flow of flows) {
|
|
314
|
+
const { text: serving } = await championTextOf(records, flow, atCommit);
|
|
315
|
+
if (serving && compatible(serving))
|
|
316
|
+
workflows.push(serving);
|
|
317
|
+
if ((!serving || workflowDigest(serving) !== workflowDigest(flow)) && compatible(flow))
|
|
318
|
+
candidates.push(flow);
|
|
319
|
+
}
|
|
320
|
+
return { workflows, candidates };
|
|
278
321
|
}
|
|
279
322
|
finally {
|
|
280
323
|
await folder.end();
|
|
@@ -319,6 +362,31 @@ export class SdkRuns {
|
|
|
319
362
|
only(value, ["type", "session_id"]);
|
|
320
363
|
return { type: "session", session_id: text(value.session_id, "session_id", 256) };
|
|
321
364
|
}
|
|
365
|
+
if (value.type === "workflow_check") {
|
|
366
|
+
only(value, ["type", "id", "digest", "outcome", "answer", "reason", "skipped", "fresh_reads"]);
|
|
367
|
+
if (value.fresh_reads !== undefined && (!Number.isSafeInteger(value.fresh_reads) || value.fresh_reads < 1 || value.fresh_reads > 256))
|
|
368
|
+
refuse("fresh_reads must be an integer from 1 to 256 when supplied.");
|
|
369
|
+
if (!["answered", "handed_back", "failed", "skipped_write"].includes(String(value.outcome)))
|
|
370
|
+
refuse("Invalid workflow check outcome.");
|
|
371
|
+
if (value.outcome === "answered" && typeof value.answer !== "string")
|
|
372
|
+
refuse("An answered workflow check needs its answer.");
|
|
373
|
+
if (value.skipped !== undefined) {
|
|
374
|
+
if (!isObject(value.skipped))
|
|
375
|
+
refuse("A skipped workflow check names its tool.");
|
|
376
|
+
only(value.skipped, ["tool", "unmarked"]);
|
|
377
|
+
text(value.skipped.tool, "skipped.tool", 256);
|
|
378
|
+
if (value.skipped.unmarked !== undefined && value.skipped.unmarked !== true)
|
|
379
|
+
refuse("skipped.unmarked must be true when supplied.");
|
|
380
|
+
}
|
|
381
|
+
if (value.outcome === "skipped_write" && value.skipped === undefined)
|
|
382
|
+
refuse("A skipped write names its tool.");
|
|
383
|
+
return { type: "workflow_check", id: text(value.id, "id", 256), digest: text(value.digest, "digest", 256), outcome: value.outcome,
|
|
384
|
+
...(value.answer !== undefined ? { answer: text(value.answer, "answer") } : {}),
|
|
385
|
+
...(value.reason !== undefined ? { reason: text(value.reason, "reason", 8000) } : {}),
|
|
386
|
+
...(value.skipped !== undefined ? { skipped: value.skipped } : {}),
|
|
387
|
+
...(value.fresh_reads !== undefined ? { fresh_reads: value.fresh_reads } : {}),
|
|
388
|
+
};
|
|
389
|
+
}
|
|
322
390
|
if (value.type === "tool") {
|
|
323
391
|
only(value, ["type", "id", "name", "status", "input", "output", "parent_tool_use_id"]);
|
|
324
392
|
if (!["started", "completed", "failed"].includes(String(value.status)))
|
|
@@ -336,6 +404,7 @@ export class SdkRuns {
|
|
|
336
404
|
return refuse("Unsupported SDK event type.");
|
|
337
405
|
});
|
|
338
406
|
const batch = this.clean({ sequence: body.sequence, events }, runId);
|
|
407
|
+
const checkRedacted = canonical(events) !== canonical(batch.events);
|
|
339
408
|
const known = (await sdkInbox(this.store, runId)).batches.find((item) => item.sequence === batch.sequence);
|
|
340
409
|
if (known) {
|
|
341
410
|
if (canonical(known) !== canonical(batch))
|
|
@@ -356,7 +425,13 @@ export class SdkRuns {
|
|
|
356
425
|
if (batch.sequence !== row.batches.length + 1)
|
|
357
426
|
throw new ApiError("idempotency_mismatch", "SDK event sequences must be contiguous.");
|
|
358
427
|
checkToolParents(row, batch.events);
|
|
359
|
-
|
|
428
|
+
const checks = [...row.batches.flatMap(item => item.events), ...batch.events].filter((event) => event.type === "workflow_check");
|
|
429
|
+
if (checks.length > 1)
|
|
430
|
+
refuse("Only one workflow check may be delivered per SDK run.");
|
|
431
|
+
for (const check of checks)
|
|
432
|
+
if (!row.learning_check || check.id !== row.learning_check.id || check.digest !== row.learning_check.digest)
|
|
433
|
+
refuse("The workflow check must name this SDK run's reserved candidate.");
|
|
434
|
+
return { ...row, batches: [...row.batches, batch], ...(checkRedacted ? { check_redacted: true } : {}) };
|
|
360
435
|
}, EVIDENCE_LIMIT);
|
|
361
436
|
return { accepted: true };
|
|
362
437
|
}
|
|
@@ -389,7 +464,7 @@ export class SdkRuns {
|
|
|
389
464
|
return row;
|
|
390
465
|
}
|
|
391
466
|
writableInbox(row);
|
|
392
|
-
return { ...row, completion };
|
|
467
|
+
return { ...row, completion, ...(completion.answer !== body.answer ? { check_redacted: true } : {}) };
|
|
393
468
|
});
|
|
394
469
|
return { accepted: true };
|
|
395
470
|
}
|
package/dist/sdk/schema.js
CHANGED
|
@@ -6,7 +6,7 @@ const object = (properties, required = Object.keys(properties)) => ({
|
|
|
6
6
|
properties,
|
|
7
7
|
required,
|
|
8
8
|
});
|
|
9
|
-
export const SDK_BINDING = object({ runtime: { enum: ["claude-agent-sdk", "codex-sdk"] } });
|
|
9
|
+
export const SDK_BINDING = object({ runtime: { enum: ["claude-agent-sdk", "codex-sdk", "eve"] } });
|
|
10
10
|
const usage = object(Object.fromEntries(["input_tokens", "output_tokens", "cache_read_tokens", "cache_write_tokens", "cost_usd"].map((key) => [
|
|
11
11
|
key,
|
|
12
12
|
{ type: [key === "cost_usd" ? "number" : "integer", "null"], minimum: 0 },
|
|
@@ -25,6 +25,13 @@ const event = {
|
|
|
25
25
|
oneOf: [
|
|
26
26
|
object({ type: { const: "text" }, text: { ...text, maxLength: 128000 } }),
|
|
27
27
|
object({ type: { const: "session" }, session_id: { ...text, maxLength: 256 } }),
|
|
28
|
+
object({
|
|
29
|
+
type: { const: "workflow_check" }, id: { ...text, maxLength: 256 }, digest: { ...text, maxLength: 256 },
|
|
30
|
+
outcome: { enum: ["answered", "handed_back", "failed", "skipped_write"] },
|
|
31
|
+
answer: { ...text, maxLength: 128000 }, reason: { ...text, maxLength: 8000 },
|
|
32
|
+
skipped: object({ tool: { ...text, maxLength: 256 }, unmarked: { const: true } }, ["tool"]),
|
|
33
|
+
fresh_reads: { type: "integer", minimum: 1, maximum: 256 },
|
|
34
|
+
}, ["type", "id", "digest", "outcome"]),
|
|
28
35
|
object({
|
|
29
36
|
type: { const: "tool" },
|
|
30
37
|
id: { ...text, maxLength: 256 },
|
|
@@ -49,15 +56,16 @@ const learning = object({
|
|
|
49
56
|
enabled: { type: "boolean" },
|
|
50
57
|
revision: { type: ["string", "null"] },
|
|
51
58
|
context: { ...text, description: "The agent's corrections.md as the run reads it under # Learned; empty when Off or nothing is learned yet." },
|
|
52
|
-
workflows: { type: "array", items: object({ name: text, workflow: text, description: text }), description: "
|
|
53
|
-
});
|
|
59
|
+
workflows: { type: "array", items: object({ name: text, workflow: text, description: text }), description: "Promoted, capability-compatible learned workflows pinned to this run; empty without a backend workflow bridge, during an independent shadow-check turn, or when learning is Off." },
|
|
60
|
+
check: { ...object({ id: text, revision: text, digest: text, workflow: object({ name: text, workflow: text, description: text }) }), description: "One compiled draft reserved for a shadow check against this run's native answer. Keep outside the model context; replay only recorded tool results after the native turn and submit workflow_check evidence." },
|
|
61
|
+
}, ["enabled", "revision", "context", "workflows"]);
|
|
54
62
|
export const SDK_PATHS = {
|
|
55
63
|
"/agents/{agent_id}/sdk-runs": {
|
|
56
64
|
post: {
|
|
57
65
|
...mark,
|
|
58
66
|
operationId: "startSdkRun",
|
|
59
67
|
summary: "Register a task executed by an existing backend SDK",
|
|
60
|
-
description: "Requires an SDK agent definition. Captures the actual original policy and input, pins
|
|
68
|
+
description: "Requires an SDK agent definition. Captures the actual original policy and input, pins promoted workflows and any compiled shadow-check candidate separately, and returns a credential scoped to this run. The backend retains all model/tool/auth settings. Learning requires a configured server reflection/grading model; learning Off needs no server model key.",
|
|
61
69
|
parameters: [id("agent_id"), { ...key, required: true }],
|
|
62
70
|
requestBody: body(object({
|
|
63
71
|
runtime: SDK_BINDING.properties.runtime,
|
package/dist/secret-writes.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { IncomingMessage } from "node:http";
|
|
2
2
|
/** The one refusal a secret write from anything but the owner's session gets (403 forbidden). */
|
|
3
3
|
export declare const SECRET_WRITE_REFUSAL = "Saving, replacing or removing a secret takes the owner's signed-in session in the console; the API token can't write secrets.";
|
|
4
|
+
/** The refusal's words with where to finish it: the one sentence, then "Finish it in the console: <link>" when the
|
|
5
|
+
* operation has a console page (registerSecretPage). The same link is the error's `details.console_url`. */
|
|
6
|
+
export declare const secretWriteRefusal: (link?: string) => string;
|
|
4
7
|
/**
|
|
5
8
|
* Whether the console a launcher opened on a loopback-bound server with no accounts (no password: the browser that
|
|
6
9
|
* followed the launch link, `/?launch=<code>`, its cookie a session id made at random and kept by the server, never
|
|
@@ -89,13 +92,23 @@ export declare const writesSecret: (operationId: string, body: unknown) => boole
|
|
|
89
92
|
/** Whether this request of `operationId` writes a secret: by its body, or by what it would drop or replace in the store
|
|
90
93
|
* (its plane's stored predicate). The dispatch's one check asks this. */
|
|
91
94
|
export declare function writesSecretFor(operationId: string, body: unknown, request: SecretRequest): Promise<boolean>;
|
|
95
|
+
/** An operation's console page: a fixed path, or one built from the request's non-secret fields. */
|
|
96
|
+
export type SecretPage = string | ((body: unknown, request: SecretRequest) => string | Promise<string>);
|
|
97
|
+
/** Where in the console the owner finishes `operationIds` (each a registered secret write). */
|
|
98
|
+
export declare function registerSecretPage(operationIds: string | readonly string[], page: SecretPage): void;
|
|
99
|
+
/** Whether `operationId` names its console page. */
|
|
100
|
+
export declare const hasSecretPage: (operationId: string) => boolean;
|
|
101
|
+
/** The console page that finishes this request of `operationId`, a path from the console's root; undefined when the
|
|
102
|
+
* console has none for it, or the page could not be built (then the refusal carries no link). */
|
|
103
|
+
export declare function secretPageFor(operationId: string, body: unknown, request: SecretRequest): Promise<string | undefined>;
|
|
92
104
|
type Json = Record<string, unknown>;
|
|
93
105
|
/** The operations of `doc` that write a secret: their request body marks a field `x-agentrun-secret`, or the operation is
|
|
94
106
|
* marked whole (a removal, which has no body). The generated CLI leaves every one of them out. */
|
|
95
107
|
export declare function markedOperations(doc: Json): string[];
|
|
96
|
-
/** The marked operations of `doc` no plane registered a predicate for
|
|
97
|
-
*
|
|
98
|
-
|
|
108
|
+
/** The marked operations of `doc` no plane registered a predicate for nor said on purpose to write no secret
|
|
109
|
+
* (registerNotSecretWrite: a preview's marked fields are kept nowhere): each a route a secret could take past the
|
|
110
|
+
* dispatch check. Empty is the only passing answer. */
|
|
111
|
+
export declare const unguardedOperations: (doc: Json) => string[];
|
|
99
112
|
/** Where a secret came from: the environment the server starts with (which always wins, by the same name), pasted in the
|
|
100
113
|
* console, or obtained by a sign-in (OAuth, Connect); null when it is not set. */
|
|
101
114
|
export type SecretSource = "env" | "console" | "sign-in";
|
package/dist/secret-writes.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { byConsoleSession, byOwnerSession } from "./page.js";
|
|
2
2
|
/** The one refusal a secret write from anything but the owner's session gets (403 forbidden). */
|
|
3
3
|
export const SECRET_WRITE_REFUSAL = "Saving, replacing or removing a secret takes the owner's signed-in session in the console; the API token can't write secrets.";
|
|
4
|
+
/** The refusal's words with where to finish it: the one sentence, then "Finish it in the console: <link>" when the
|
|
5
|
+
* operation has a console page (registerSecretPage). The same link is the error's `details.console_url`. */
|
|
6
|
+
export const secretWriteRefusal = (link) => (link ? `${SECRET_WRITE_REFUSAL} Finish it in the console: ${link}` : SECRET_WRITE_REFUSAL);
|
|
4
7
|
// ---- who may write a secret ------------------------------------------------------------------------------------------
|
|
5
8
|
/**
|
|
6
9
|
* Whether the console a launcher opened on a loopback-bound server with no accounts (no password: the browser that
|
|
@@ -77,6 +80,27 @@ export async function writesSecretFor(operationId, body, request) {
|
|
|
77
80
|
const stored = storedPredicates.get(operationId);
|
|
78
81
|
return stored ? (await stored(body, request)) === true : false;
|
|
79
82
|
}
|
|
83
|
+
const pages = new Map();
|
|
84
|
+
/** Where in the console the owner finishes `operationIds` (each a registered secret write). */
|
|
85
|
+
export function registerSecretPage(operationIds, page) {
|
|
86
|
+
for (const operationId of typeof operationIds === "string" ? [operationIds] : operationIds)
|
|
87
|
+
pages.set(operationId, page);
|
|
88
|
+
}
|
|
89
|
+
/** Whether `operationId` names its console page. */
|
|
90
|
+
export const hasSecretPage = (operationId) => pages.has(operationId);
|
|
91
|
+
/** The console page that finishes this request of `operationId`, a path from the console's root; undefined when the
|
|
92
|
+
* console has none for it, or the page could not be built (then the refusal carries no link). */
|
|
93
|
+
export async function secretPageFor(operationId, body, request) {
|
|
94
|
+
const page = pages.get(operationId);
|
|
95
|
+
if (typeof page !== "function")
|
|
96
|
+
return page;
|
|
97
|
+
try {
|
|
98
|
+
return await page(body, request);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
80
104
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
81
105
|
/** Whether `schema` (in `doc`, its $refs followed once each) marks any field `x-agentrun-secret: true`. */
|
|
82
106
|
function marksSecret(doc, schema, seen = new Set()) {
|
|
@@ -113,9 +137,10 @@ export function markedOperations(doc) {
|
|
|
113
137
|
}
|
|
114
138
|
return out;
|
|
115
139
|
}
|
|
116
|
-
/** The marked operations of `doc` no plane registered a predicate for
|
|
117
|
-
*
|
|
118
|
-
|
|
140
|
+
/** The marked operations of `doc` no plane registered a predicate for nor said on purpose to write no secret
|
|
141
|
+
* (registerNotSecretWrite: a preview's marked fields are kept nowhere): each a route a secret could take past the
|
|
142
|
+
* dispatch check. Empty is the only passing answer. */
|
|
143
|
+
export const unguardedOperations = (doc) => markedOperations(doc).filter((operationId) => !registry.has(operationId) && notSecretWriteReason(operationId) === undefined);
|
|
119
144
|
/** A secret's name, "<plane>:<id>": the plane and each part of its id joined with ":" (secretName("computer", provider,
|
|
120
145
|
* KEY) is "computer:<provider>:<KEY>", secretName("workspace", "archil") "workspace:archil"). */
|
|
121
146
|
export function secretName(plane, ...id) {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { sealedSettingsOverStore } from "./sealed-settings-store.js";
|
|
7
7
|
import { besideTheStore } from "./server-secrets.js";
|
|
8
8
|
import { SEAL_KEY_ENV, sealKeyOf } from "./tool-keys.js";
|
|
9
|
+
import { SLACK_CHANNEL, SLACK_URL_SPEC, slackUrlForms } from "./slack.js";
|
|
9
10
|
import { WEBHOOK_CHANNEL, WEBHOOK_SECRET_SPEC } from "./webhooks.js";
|
|
10
11
|
/** The server's own secrets over the store: what it keeps beside the store (besideTheStore), the outbound webhook's
|
|
11
12
|
* signing secret and each one it held before (adapter webhook-out, retired ones too, so a secret replaced or removed stays
|
|
@@ -23,6 +24,10 @@ export async function openServerSecretsOverStore(store, data, env, adapters, say
|
|
|
23
24
|
const webhookSettings = sealedSettingsOverStore(store, WEBHOOK_CHANNEL, WEBHOOK_SECRET_SPEC, key, (fields) => fields.condition === "trigger_setting_unopened" ? say({ condition: "unreadable", name: SEAL_KEY_ENV, data, effect: "this server's webhook secret cannot be read under this seal key, so it is not cut" }) : say(fields));
|
|
24
25
|
await webhookSettings.load();
|
|
25
26
|
secrets.add("webhook", () => webhookSettings.values());
|
|
27
|
+
// Slack's incoming-webhook URL, and each it held before (slack.ts): the URL is the credential, cut as a secret is.
|
|
28
|
+
const slackSettings = sealedSettingsOverStore(store, SLACK_CHANNEL, SLACK_URL_SPEC, key, (fields) => fields.condition === "trigger_setting_unopened" ? say({ condition: "unreadable", name: SEAL_KEY_ENV, data, effect: "this server's Slack URL cannot be read under this seal key, so it is not cut" }) : say(fields));
|
|
29
|
+
await slackSettings.load();
|
|
30
|
+
secrets.add("slack", () => slackSettings.values().flatMap(slackUrlForms));
|
|
26
31
|
const settings = new Map();
|
|
27
32
|
for (const adapter of adapters) {
|
|
28
33
|
if (!adapter.settings)
|
package/dist/server.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LearningModel } from "./learning-model.js";
|
|
1
2
|
import { type Server } from "node:http";
|
|
2
3
|
import { type ModelNeeds } from "./model.js";
|
|
3
4
|
import { type HarnessCapability } from "./harness.js";
|
|
@@ -232,6 +233,9 @@ export type ServeOptions = {
|
|
|
232
233
|
* (webhooks.ts), in place of the system resolver's. A test's server answers its example hosts here, so no CI
|
|
233
234
|
* runner's resolver decides what a test sees. */
|
|
234
235
|
webhookLookup?: (host: string) => Promise<string[]>;
|
|
236
|
+
/** A test's seam: the origin Slack's messages are posted to in place of https://hooks.slack.com, each URL's path kept
|
|
237
|
+
* (slack.ts sendTo), so no test reaches Slack. */
|
|
238
|
+
slackTarget?: string;
|
|
235
239
|
};
|
|
236
240
|
/** The switches a run's process gets, each module path resolved: the owner's harness modules (harnessModules), and the test
|
|
237
241
|
* switches, which are empty outside tests. A test's in-process runner takes the same (test/support.mjs
|
|
@@ -281,6 +285,10 @@ export type Serve = {
|
|
|
281
285
|
};
|
|
282
286
|
/** Resolves once every run's listing is current (run-listing.ts Lister.settled): for tests and benchmarks. */
|
|
283
287
|
listingSettled(): Promise<void>;
|
|
288
|
+
/** Says in the store, until the stop, that the runner beside this server refused to claim any run, in `words` (its run
|
|
289
|
+
* isolation refused, cli.ts): while no runner that claims is there, a start is refused in them and the runs queued
|
|
290
|
+
* fail (runner/presence.ts). Once; a second call keeps the first. */
|
|
291
|
+
refuseRuns(words: string): void;
|
|
284
292
|
};
|
|
285
293
|
/** A route: `name` is its operationId in the OpenAPI document (openapi.ts); `capability`, when this server turns it off;
|
|
286
294
|
* `raw`, a route whose body is bytes and not JSON, which the page's session may send with any content type, still only
|
|
@@ -345,6 +353,7 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
|
|
|
345
353
|
reason?: string;
|
|
346
354
|
default_model: string | null;
|
|
347
355
|
installs?: "on_first_use";
|
|
356
|
+
card?: string;
|
|
348
357
|
models: string[];
|
|
349
358
|
free_models: {
|
|
350
359
|
id: string;
|
|
@@ -376,6 +385,7 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
|
|
|
376
385
|
fast: string | null;
|
|
377
386
|
strong: string | null;
|
|
378
387
|
};
|
|
388
|
+
learning_model: LearningModel;
|
|
379
389
|
/** `pending`: a workflow draft with a call no price covers is kept to wait for its owner's OK, served to no run;
|
|
380
390
|
* `approve`: whether the caller can approve one, which takes the owner's password session (forCaller), and
|
|
381
391
|
* `approve_needs` when not. */
|
|
@@ -458,6 +468,9 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
|
|
|
458
468
|
available: boolean;
|
|
459
469
|
harnesses: string[];
|
|
460
470
|
})[];
|
|
471
|
+
/** The switches only the operator sets, in the server's environment at its start (start-switches.ts): each one's state,
|
|
472
|
+
* the value it read and what it allows. Never a secret's value. */
|
|
473
|
+
switches: Record<string, import("./start-switches.js").StartSwitch>;
|
|
461
474
|
/** How this server holds its secrets (secrets.ts, the launcher), and what that does not cover. */
|
|
462
475
|
secrets: {
|
|
463
476
|
names: string[];
|
|
@@ -469,7 +482,7 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
|
|
|
469
482
|
* `models.default`, `models.strong`) with the tools it names of `node_tools`; a node that names no thinking level
|
|
470
483
|
* thinks at the run's effort, or medium. */
|
|
471
484
|
workflows: {
|
|
472
|
-
nodes: ("agent" | "
|
|
485
|
+
nodes: ("agent" | "report" | "extract" | "decide")[];
|
|
473
486
|
node_tools: string[];
|
|
474
487
|
adapters: string[];
|
|
475
488
|
decisions: {
|
|
@@ -582,6 +595,13 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
|
|
|
582
595
|
signing: string;
|
|
583
596
|
at_rest: string;
|
|
584
597
|
};
|
|
598
|
+
/** /settings/slack: one Slack incoming-webhook URL each of `events` is posted to as a readable message (slack.ts); the
|
|
599
|
+
* URL kept sealed, never shown. */
|
|
600
|
+
slack: {
|
|
601
|
+
routes: boolean;
|
|
602
|
+
events: ("run.needs_input" | "run.ended" | "trigger.failed")[];
|
|
603
|
+
at_rest: string;
|
|
604
|
+
};
|
|
585
605
|
/** /triggers: what starts an agent's capped runs with no caller (triggers.ts). */
|
|
586
606
|
triggers: {
|
|
587
607
|
routes: boolean;
|
|
@@ -654,6 +674,7 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
|
|
|
654
674
|
reason?: string;
|
|
655
675
|
default_model: string | null;
|
|
656
676
|
installs?: "on_first_use";
|
|
677
|
+
card?: string;
|
|
657
678
|
models: string[];
|
|
658
679
|
free_models: {
|
|
659
680
|
id: string;
|
|
@@ -685,6 +706,7 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
|
|
|
685
706
|
fast: string | null;
|
|
686
707
|
strong: string | null;
|
|
687
708
|
};
|
|
709
|
+
learning_model: LearningModel;
|
|
688
710
|
/** `pending`: a workflow draft with a call no price covers is kept to wait for its owner's OK, served to no run;
|
|
689
711
|
* `approve`: whether the caller can approve one, which takes the owner's password session (forCaller), and
|
|
690
712
|
* `approve_needs` when not. */
|
|
@@ -767,6 +789,9 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
|
|
|
767
789
|
available: boolean;
|
|
768
790
|
harnesses: string[];
|
|
769
791
|
})[];
|
|
792
|
+
/** The switches only the operator sets, in the server's environment at its start (start-switches.ts): each one's state,
|
|
793
|
+
* the value it read and what it allows. Never a secret's value. */
|
|
794
|
+
switches: Record<string, import("./start-switches.js").StartSwitch>;
|
|
770
795
|
/** How this server holds its secrets (secrets.ts, the launcher), and what that does not cover. */
|
|
771
796
|
secrets: {
|
|
772
797
|
names: string[];
|
|
@@ -778,7 +803,7 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
|
|
|
778
803
|
* `models.default`, `models.strong`) with the tools it names of `node_tools`; a node that names no thinking level
|
|
779
804
|
* thinks at the run's effort, or medium. */
|
|
780
805
|
workflows: {
|
|
781
|
-
nodes: ("agent" | "
|
|
806
|
+
nodes: ("agent" | "report" | "extract" | "decide")[];
|
|
782
807
|
node_tools: string[];
|
|
783
808
|
adapters: string[];
|
|
784
809
|
decisions: {
|
|
@@ -891,6 +916,13 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
|
|
|
891
916
|
signing: string;
|
|
892
917
|
at_rest: string;
|
|
893
918
|
};
|
|
919
|
+
/** /settings/slack: one Slack incoming-webhook URL each of `events` is posted to as a readable message (slack.ts); the
|
|
920
|
+
* URL kept sealed, never shown. */
|
|
921
|
+
slack: {
|
|
922
|
+
routes: boolean;
|
|
923
|
+
events: ("run.needs_input" | "run.ended" | "trigger.failed")[];
|
|
924
|
+
at_rest: string;
|
|
925
|
+
};
|
|
894
926
|
/** /triggers: what starts an agent's capped runs with no caller (triggers.ts). */
|
|
895
927
|
triggers: {
|
|
896
928
|
routes: boolean;
|