@parcha/agentrun-serve 0.1.0-beta.48 → 0.1.0-beta.50

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.
Files changed (170) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +236 -26
  3. package/dist/agent-delete.d.ts +36 -12
  4. package/dist/agent-delete.js +213 -30
  5. package/dist/agents-store.d.ts +6 -2
  6. package/dist/agents-store.js +18 -5
  7. package/dist/agents.d.ts +8 -1
  8. package/dist/agents.js +14 -4
  9. package/dist/answer-json.d.ts +2 -2
  10. package/dist/answer-json.js +3 -4
  11. package/dist/api-only.d.ts +7 -10
  12. package/dist/api-only.js +9 -11
  13. package/dist/archil-routes.d.ts +1 -1
  14. package/dist/archil-routes.js +4 -3
  15. package/dist/browser-sessions.d.ts +56 -0
  16. package/dist/browser-sessions.js +117 -0
  17. package/dist/compute-cost.d.ts +101 -0
  18. package/dist/compute-cost.js +250 -0
  19. package/dist/computer-routes.d.ts +4 -15
  20. package/dist/computer-routes.js +6 -10
  21. package/dist/console/assets/index-D0mr9wfZ.css +1 -0
  22. package/dist/console/assets/index-D7G6o-1E.js +720 -0
  23. package/dist/console/index.html +2 -2
  24. package/dist/errors.d.ts +4 -1
  25. package/dist/errors.js +15 -5
  26. package/dist/eval-previous.d.ts +52 -0
  27. package/dist/eval-previous.js +164 -0
  28. package/dist/file-types.d.ts +2 -0
  29. package/dist/file-types.js +3 -1
  30. package/dist/harness.js +2 -1
  31. package/dist/import.js +4 -3
  32. package/dist/learn/check.d.ts +16 -4
  33. package/dist/learn/check.js +30 -26
  34. package/dist/learn/promote.d.ts +7 -1
  35. package/dist/learn/promote.js +47 -0
  36. package/dist/learn/repick.d.ts +43 -0
  37. package/dist/learn/repick.js +202 -0
  38. package/dist/learn/workflow-draft.d.ts +4 -0
  39. package/dist/learn/workflow-draft.js +10 -7
  40. package/dist/learned-workflow.d.ts +2 -0
  41. package/dist/learned-workflow.js +19 -2
  42. package/dist/learning-setting.d.ts +13 -0
  43. package/dist/learning-setting.js +23 -1
  44. package/dist/llms.txt +1 -1
  45. package/dist/openapi.js +180 -14
  46. package/dist/paid-calls.d.ts +17 -7
  47. package/dist/paid-calls.js +15 -9
  48. package/dist/run-launch.d.ts +2 -2
  49. package/dist/run-launch.js +2 -1
  50. package/dist/run-learning-served.d.ts +1 -1
  51. package/dist/run-timeline-served.js +5 -3
  52. package/dist/run-usage.d.ts +125 -0
  53. package/dist/run-usage.js +394 -0
  54. package/dist/runner/adapter-loop.d.ts +4 -0
  55. package/dist/runner/adapter-loop.js +66 -21
  56. package/dist/runner/adapter-run-spec.d.ts +8 -3
  57. package/dist/runner/adapter-run-spec.js +13 -6
  58. package/dist/runner/big-writes.d.ts +33 -0
  59. package/dist/runner/big-writes.js +105 -0
  60. package/dist/runner/cli-run-spec.js +14 -6
  61. package/dist/runner/conformance/harness.d.ts +2 -0
  62. package/dist/runner/conformance/harness.js +18 -4
  63. package/dist/runner/feedback-round.d.ts +29 -1
  64. package/dist/runner/feedback-round.js +54 -3
  65. package/dist/runner/held.d.ts +4 -1
  66. package/dist/runner/journal-kinds.d.ts +3 -1
  67. package/dist/runner/learning-end.js +54 -18
  68. package/dist/runner/loop-contract.d.ts +3 -0
  69. package/dist/runner/metrics.d.ts +4 -0
  70. package/dist/runner/metrics.js +9 -0
  71. package/dist/runner/monid-run.js +2 -2
  72. package/dist/runner/promotion.js +8 -2
  73. package/dist/runner/reflect-hook.js +3 -2
  74. package/dist/runner/run-child-host.d.ts +15 -2
  75. package/dist/runner/run-child-host.js +24 -8
  76. package/dist/runner/run-child.js +3 -0
  77. package/dist/runner/save-slots.d.ts +9 -0
  78. package/dist/runner/save-slots.js +91 -0
  79. package/dist/runs-over-store.d.ts +3 -2
  80. package/dist/runs-over-store.js +9 -7
  81. package/dist/sdk/runs.d.ts +3 -4
  82. package/dist/sdk/runs.js +10 -7
  83. package/dist/sdk/runtimes.d.ts +19 -0
  84. package/dist/sdk/runtimes.js +23 -0
  85. package/dist/sdk/schema.d.ts +14 -8
  86. package/dist/sdk/schema.js +18 -6
  87. package/dist/server.d.ts +7 -3
  88. package/dist/server.js +223 -100
  89. package/dist/store/agent-body.d.ts +2 -3
  90. package/dist/store/agent-body.js +3 -2
  91. package/dist/store/index.d.ts +2 -2
  92. package/dist/store/index.js +1 -1
  93. package/dist/store/journal/storage.js +1 -1
  94. package/dist/store/open.d.ts +1 -1
  95. package/dist/store/open.js +1 -1
  96. package/dist/store/postgres/migrations/0021_purged.sql +13 -0
  97. package/dist/store/postgres/migrations/0022_computer_intervals.sql +27 -0
  98. package/dist/store/postgres/migrations/0023_computer_interval_resources.sql +14 -0
  99. package/dist/store/schema.d.ts +20 -1
  100. package/dist/store/schema.js +60 -5
  101. package/dist/store/sqlite/connection.d.ts +4 -1
  102. package/dist/store/sqlite/connection.js +5 -0
  103. package/dist/store/sqlite/run-patch.d.ts +8 -3
  104. package/dist/store/sqlite/run-patch.js +15 -7
  105. package/dist/store/sqlite/store.d.ts +2 -1
  106. package/dist/store/sqlite/store.js +279 -68
  107. package/dist/store/sqlite/worker.d.ts +9 -0
  108. package/dist/store/sqlite/worker.js +18 -1
  109. package/dist/store/store.d.ts +149 -9
  110. package/dist/store/store.js +63 -0
  111. package/dist/store-reads/analytics.js +2 -1
  112. package/dist/store-reads/cap.d.ts +17 -7
  113. package/dist/store-reads/cap.js +54 -4
  114. package/dist/store-reads/decisions.d.ts +21 -0
  115. package/dist/store-reads/decisions.js +22 -0
  116. package/dist/store-reads/journal.d.ts +8 -2
  117. package/dist/store-reads/journal.js +27 -8
  118. package/dist/store-reads/learning.d.ts +1 -1
  119. package/dist/store-reads/learning.js +5 -2
  120. package/dist/store-reads/runs.js +2 -0
  121. package/dist/store-reads/stats.js +4 -2
  122. package/dist/store-view.d.ts +12 -1
  123. package/dist/store-view.js +98 -38
  124. package/dist/template-eval.d.ts +15 -1
  125. package/dist/template-eval.js +92 -13
  126. package/dist/templates.d.ts +1 -1
  127. package/dist/templates.js +4 -3
  128. package/dist/timeline/labels.js +17 -0
  129. package/dist/tool-list.js +1 -0
  130. package/dist/tools.d.ts +6 -2
  131. package/dist/tools.js +22 -1
  132. package/dist/trigger-targets.d.ts +28 -9
  133. package/dist/trigger-targets.js +19 -16
  134. package/dist/triggers.d.ts +2 -1
  135. package/dist/triggers.js +5 -2
  136. package/dist/validate.d.ts +4 -2
  137. package/dist/validate.js +13 -3
  138. package/dist/viewer-credential.d.ts +3 -4
  139. package/dist/viewer-credential.js +6 -4
  140. package/dist/web-fake.d.ts +25 -0
  141. package/dist/web-fake.js +38 -1
  142. package/dist/web-save.d.ts +75 -0
  143. package/dist/web-save.js +235 -0
  144. package/dist/workspace/archil-claim.d.ts +5 -2
  145. package/dist/workspace/archil-claim.js +5 -2
  146. package/dist/workspace/archil-disk.d.ts +10 -1
  147. package/dist/workspace/archil-disk.js +19 -1
  148. package/dist/workspace/archil.d.ts +3 -0
  149. package/dist/workspace/archil.js +101 -16
  150. package/dist/workspace/computer-for-claim.d.ts +19 -1
  151. package/dist/workspace/computer-for-claim.js +88 -20
  152. package/dist/workspace/computer-intervals.d.ts +26 -0
  153. package/dist/workspace/computer-intervals.js +58 -0
  154. package/dist/workspace/computer-janitor.d.ts +7 -3
  155. package/dist/workspace/computer-janitor.js +14 -6
  156. package/dist/workspace/computer-kept.d.ts +7 -2
  157. package/dist/workspace/computer-kept.js +9 -2
  158. package/dist/workspace/pieced.d.ts +14 -0
  159. package/dist/workspace/pieced.js +23 -0
  160. package/dist/workspace/resolve-computer.d.ts +7 -4
  161. package/dist/workspace/resolve-computer.js +21 -32
  162. package/dist/workspace/run-disk.js +32 -12
  163. package/dist/workspace/run-end-computers.d.ts +1 -0
  164. package/dist/workspace/run-end-computers.js +4 -1
  165. package/dist/workspace/run-workspace.d.ts +1 -1
  166. package/dist/workspace/run-workspace.js +11 -6
  167. package/package.json +10 -10
  168. package/templates/README.md +36 -7
  169. package/dist/console/assets/index-CTGegcKt.css +0 -1
  170. package/dist/console/assets/index-D1Se6mgG.js +0 -715
@@ -78,14 +78,16 @@ export async function archiveRun(store, runId, archived) {
78
78
  }
79
79
  /** Stops the run: one stop command row, which the run's runner reads and applies (it aborts the turn in flight, withdraws a
80
80
  * tool call waiting for approval, and ends the run stopped). A stop always lands — one command, no second path. An imported
81
- * or already-ended run has none to stop: `false`, nothing written (store.command refuses a final run, RunFinal). */
82
- export async function stop(store, runId) {
83
- const row = await store.runs.get(runId);
84
- if (!row || row.importedFrom)
81
+ * run, or one that reads ended (`moment.terminal`: one looking back after its job's end among them, whose end its
82
+ * look-back never undoes), has none to stop: `false`, nothing written (and store.command refuses a final run, RunFinal). */
83
+ export async function stop(store, moment) {
84
+ if (moment.importedSource !== undefined)
85
+ return false;
86
+ await refuseSdkStop(store, moment.id);
87
+ if (moment.terminal)
85
88
  return false;
86
- await refuseSdkStop(store, runId);
87
89
  try {
88
- await sendCommand(store, runId, { kind: "stop", body: {} });
90
+ await sendCommand(store, moment.id, { kind: "stop", body: {} });
89
91
  return true;
90
92
  }
91
93
  catch (error) {
@@ -509,7 +511,7 @@ export async function startInline(store, deps, inline, body, { origin, sealed }
509
511
  const entry = stored
510
512
  ? firstOfVersion ? { ...stored, agent: { ...stored.agent, name: inline.name, description: inline.description } } : stored
511
513
  : {
512
- agent: { id: uuidv7(), name: inline.name, description: inline.description, currentRevision: null, createdAt: Date.now(), archivedAt: null, externalRef: ref },
514
+ agent: { id: uuidv7(), name: inline.name, description: inline.description, currentRevision: null, createdAt: Date.now(), archivedAt: null, externalRef: ref, purgedAt: null },
513
515
  revision: null, version: 0, revisions: 0, sizes: new Map(),
514
516
  };
515
517
  // A store revision is the revision the run path reads as a pi Revision (its body is the revision body), as pinnedOf hands
@@ -4,7 +4,8 @@ import { type StartDeps } from "../runs-over-store.js";
4
4
  import { type LearnedWorkflow } from "../learning.js";
5
5
  import type { SdkWorkflowCheckEvent } from "./check.js";
6
6
  import { type SdkWorkflowCheck } from "../runner/promotion.js";
7
- export type SdkRuntime = "claude-agent-sdk" | "codex-sdk" | "eve";
7
+ import { type SdkBinding } from "./runtimes.js";
8
+ export { SDK_RUNTIMES, isSdkRuntime, type SdkRuntime } from "./runtimes.js";
8
9
  export type SdkUsage = {
9
10
  input_tokens: number | null;
10
11
  output_tokens: number | null;
@@ -56,9 +57,7 @@ export type SdkInbox = {
56
57
  };
57
58
  /** The settings key an SDK run's record is kept under (the run's delete with its agent's: agent-delete.ts). */
58
59
  export declare const sdkRunKey: (id: string) => string;
59
- export declare const sdkOf: (body: unknown) => {
60
- runtime: SdkRuntime;
61
- } | undefined;
60
+ export declare const sdkOf: (body: unknown) => SdkBinding | undefined;
62
61
  export declare function sdkInbox(store: Pick<Store, "settings">, runId: string): Promise<SdkInbox>;
63
62
  /** Completion and closure compete on the same inbox. A stale runner cannot close it, and a completion that won
64
63
  * remains available to the next claim even if this one cannot read or journal it. No external SDK call is replayed. */
package/dist/sdk/runs.js CHANGED
@@ -17,6 +17,8 @@ import { sdkWorkflowManifest, sdkDraftTools } from "./workflows.js";
17
17
  import { promotionOf, promotionsOf } from "../learn/promote.js";
18
18
  import { championTextOf, releaseSdkCheck, reserveSdkCheck } from "../runner/promotion.js";
19
19
  import { fits, workflowDigest } from "../runner/workflow-first.js";
20
+ import { SDK_WORKFLOW_RUNTIMES, sdkBindingOf } from "./runtimes.js";
21
+ export { SDK_RUNTIMES, isSdkRuntime } from "./runtimes.js";
20
22
  const keyOf = (id) => `sdk-run:${id}`;
21
23
  /** The settings key an SDK run's record is kept under (the run's delete with its agent's: agent-delete.ts). */
22
24
  export const sdkRunKey = keyOf;
@@ -51,9 +53,7 @@ const usageOf = (value) => {
51
53
  }
52
54
  return result;
53
55
  };
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")
55
- ? { runtime: body.sdk.runtime }
56
- : undefined;
56
+ export const sdkOf = (body) => isObject(body) ? sdkBindingOf(body.sdk) : undefined;
57
57
  export async function sdkInbox(store, runId) {
58
58
  const row = await store.settings.get(keyOf(runId));
59
59
  if (!isObject(row))
@@ -163,7 +163,10 @@ export class SdkRuns {
163
163
  return redactedOutput(body, redact.heldValues?.() ?? []);
164
164
  }
165
165
  async start(entry, body, deps, origin, compile, consoleOrigin) {
166
- only(body, ["runtime", "input", "instructions", "model", "workflow_tools", "workflow_adapters"]);
166
+ only(body, ["runtime", "platform", "input", "instructions", "model", "workflow_tools", "workflow_adapters"]);
167
+ const source = sdkBindingOf(body) ?? refuse("The SDK source needs a supported runtime; external requires a platform label of 1–80 characters without surrounding whitespace, controls or lone surrogates. Other runtimes do not take platform.");
168
+ if (!SDK_WORKFLOW_RUNTIMES.includes(source.runtime) && (body.workflow_tools !== undefined || body.workflow_adapters !== undefined))
169
+ refuse("External runs receive owner corrections; workflow_tools and workflow_adapters require a backend workflow bridge.");
167
170
  const workflow = sdkWorkflowManifest(body.workflow_tools, body.workflow_adapters);
168
171
  if (workflow && canonical(this.clean(workflow)) !== canonical(workflow))
169
172
  refuse("The workflow manifest contains a protected value; keep credentials in the backend.");
@@ -172,8 +175,8 @@ export class SdkRuns {
172
175
  throw new ApiError("agent_not_runnable", "This agent is not registered as a backend SDK agent.");
173
176
  if (entry.agent.archivedAt !== null)
174
177
  throw new ApiError("agent_archived", "This SDK agent is archived.");
175
- if (body.runtime !== binding.runtime)
176
- refuse("The SDK runtime must match the registered agent.");
178
+ if (source.runtime !== binding.runtime || source.platform !== binding.platform)
179
+ refuse("The SDK runtime and platform must match the registered agent.");
177
180
  const input = text(body.input, "input"), instructions = text(body.instructions, "instructions");
178
181
  const model = body.model === undefined ? undefined : text(body.model, "model", 256);
179
182
  if (origin) {
@@ -231,7 +234,7 @@ export class SdkRuns {
231
234
  place: { mode: "runner" },
232
235
  harness: "sdk",
233
236
  sdk: {
234
- runtime: binding.runtime,
237
+ ...binding,
235
238
  ...workflow,
236
239
  instructions: cleaned.instructions,
237
240
  ...(cleaned.model ? { model: cleaned.model } : {}),
@@ -0,0 +1,19 @@
1
+ /** Execution stays with the caller. External platforms report through the same API without becoming a managed
2
+ * harness or acquiring a workflow bridge. Their platform is a display label, never a capability selector. */
3
+ export declare const SDK_RUNTIMES: readonly ["claude-agent-sdk", "codex-sdk", "eve", "external"];
4
+ export type SdkRuntime = (typeof SDK_RUNTIMES)[number];
5
+ export type SdkBinding = {
6
+ runtime: Exclude<SdkRuntime, "external">;
7
+ platform?: never;
8
+ } | {
9
+ runtime: "external";
10
+ platform: string;
11
+ };
12
+ /** Only these integrations supply a backend workflow bridge. */
13
+ export declare const SDK_WORKFLOW_RUNTIMES: readonly SdkRuntime[];
14
+ export declare const isSdkRuntime: (value: unknown) => value is SdkRuntime;
15
+ export declare const SDK_PLATFORM_MAX_LENGTH = 80;
16
+ export declare const SDK_PLATFORM_PATTERN = "^(?!\\s)(?![\\s\\S]*\\s$)[^\\u0000-\\u001f\\u007f-\\u009f\\ud800-\\udfff]+$";
17
+ export declare const isSdkPlatform: (value: unknown) => value is string;
18
+ /** Read just the source identity from a binding, start body or persisted launch. Callers check their own extra keys. */
19
+ export declare function sdkBindingOf(value: unknown): SdkBinding | undefined;
@@ -0,0 +1,23 @@
1
+ /** Execution stays with the caller. External platforms report through the same API without becoming a managed
2
+ * harness or acquiring a workflow bridge. Their platform is a display label, never a capability selector. */
3
+ export const SDK_RUNTIMES = ["claude-agent-sdk", "codex-sdk", "eve", "external"];
4
+ /** Only these integrations supply a backend workflow bridge. */
5
+ export const SDK_WORKFLOW_RUNTIMES = ["claude-agent-sdk", "codex-sdk", "eve"];
6
+ export const isSdkRuntime = (value) => typeof value === "string" && SDK_RUNTIMES.includes(value);
7
+ export const SDK_PLATFORM_MAX_LENGTH = 80;
8
+ // Unicode mode treats a surrogate pair as one character; the range rejects only a lone half. Keep the schema and
9
+ // runtime check identical, including the refusal to trim a label that participates in an agent's identity.
10
+ export const SDK_PLATFORM_PATTERN = "^(?!\\s)(?![\\s\\S]*\\s$)[^\\u0000-\\u001f\\u007f-\\u009f\\ud800-\\udfff]+$";
11
+ const platformPattern = new RegExp(SDK_PLATFORM_PATTERN, "u");
12
+ export const isSdkPlatform = (value) => typeof value === "string" && [...value].length <= SDK_PLATFORM_MAX_LENGTH && platformPattern.test(value);
13
+ /** Read just the source identity from a binding, start body or persisted launch. Callers check their own extra keys. */
14
+ export function sdkBindingOf(value) {
15
+ if (!value || typeof value !== "object" || Array.isArray(value))
16
+ return undefined;
17
+ const { runtime, platform } = value;
18
+ if (!isSdkRuntime(runtime))
19
+ return undefined;
20
+ if (runtime === "external")
21
+ return isSdkPlatform(platform) ? { runtime, platform } : undefined;
22
+ return platform === undefined ? { runtime } : undefined;
23
+ }
@@ -1,15 +1,21 @@
1
1
  export declare const SDK_BINDING: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: Record<string, unknown>;
5
- required: string[];
2
+ "x-agentrun-python-preserve-object": boolean;
3
+ oneOf: {
4
+ type: string;
5
+ additionalProperties: boolean;
6
+ properties: Record<string, unknown>;
7
+ required: string[];
8
+ }[];
6
9
  };
7
10
  export declare const SDK_RUN: {
8
11
  "x-agentrun-serve": string;
9
- type: string;
10
- additionalProperties: boolean;
11
- properties: Record<string, unknown>;
12
- required: string[];
12
+ "x-agentrun-python-preserve-object": boolean;
13
+ oneOf: {
14
+ type: string;
15
+ additionalProperties: boolean;
16
+ properties: Record<string, unknown>;
17
+ required: string[];
18
+ }[];
13
19
  };
14
20
  export declare const SDK_PATHS: {
15
21
  "/agents/{agent_id}/sdk-runs": {
@@ -1,4 +1,5 @@
1
1
  import { MCP_TOOL_KEY_PATTERN } from "../tool-names.js";
2
+ import { SDK_RUNTIMES, SDK_PLATFORM_MAX_LENGTH, SDK_PLATFORM_PATTERN } from "./runtimes.js";
2
3
  const text = { type: "string" };
3
4
  const object = (properties, required = Object.keys(properties)) => ({
4
5
  type: "object",
@@ -6,14 +7,26 @@ const object = (properties, required = Object.keys(properties)) => ({
6
7
  properties,
7
8
  required,
8
9
  });
9
- export const SDK_BINDING = object({ runtime: { enum: ["claude-agent-sdk", "codex-sdk", "eve"] } });
10
+ const platform = {
11
+ ...text, minLength: 1, maxLength: SDK_PLATFORM_MAX_LENGTH, pattern: SDK_PLATFORM_PATTERN,
12
+ description: "External source's display label, such as openclaw or capy. Preserved exactly; no surrounding whitespace, controls or lone surrogates. Never selects a managed harness or workflow capability.",
13
+ };
14
+ /** Closed alternatives keep platform required only for external sources in every generated client. External starts
15
+ * do not accept bridge fields, even an empty catalog: a platform name never confers an integration's capabilities. */
16
+ const sdkObject = (properties = {}, required = Object.keys(properties)) => ({
17
+ "x-agentrun-python-preserve-object": true,
18
+ oneOf: [
19
+ object({ runtime: { enum: SDK_RUNTIMES.filter(runtime => runtime !== "external") }, ...properties }, ["runtime", ...required]),
20
+ object({ runtime: { const: "external" }, platform, ...Object.fromEntries(Object.entries(properties).filter(([key]) => key !== "workflow_tools" && key !== "workflow_adapters")) }, ["runtime", "platform", ...required]),
21
+ ],
22
+ });
23
+ export const SDK_BINDING = sdkObject();
10
24
  const usage = object(Object.fromEntries(["input_tokens", "output_tokens", "cache_read_tokens", "cache_write_tokens", "cost_usd"].map((key) => [
11
25
  key,
12
26
  { type: [key === "cost_usd" ? "number" : "integer", "null"], minimum: 0 },
13
27
  ])), []);
14
28
  export const SDK_RUN = {
15
- ...object({
16
- runtime: SDK_BINDING.properties.runtime,
29
+ ...sdkObject({
17
30
  model: { type: ["string", "null"] },
18
31
  session_id: { type: ["string", "null"] },
19
32
  learning_revision: { type: ["string", "null"] },
@@ -67,8 +80,7 @@ export const SDK_PATHS = {
67
80
  summary: "Register a task executed by an existing backend SDK",
68
81
  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.",
69
82
  parameters: [id("agent_id"), { ...key, required: true }],
70
- requestBody: body(object({
71
- runtime: SDK_BINDING.properties.runtime,
83
+ requestBody: body(sdkObject({
72
84
  input: { ...text, maxLength: 128000 },
73
85
  instructions: { ...text, maxLength: 128000 },
74
86
  model: { ...text, maxLength: 256 },
@@ -81,7 +93,7 @@ export const SDK_PATHS = {
81
93
  price_usd: { type: "number", minimum: 0 },
82
94
  }, ["name", "description", "input_schema", "permission"]) },
83
95
  workflow_adapters: { type: "array", maxItems: 2, uniqueItems: true, items: { enum: ["runNode", "runJudge"] }, description: "Optional backend callbacks available for workflow model and decision nodes. Default empty; requires workflow_tools." },
84
- }, ["runtime", "input", "instructions"])),
96
+ }, ["input", "instructions"])),
85
97
  responses: {
86
98
  201: response(object({
87
99
  run_id: text,
package/dist/server.d.ts CHANGED
@@ -208,9 +208,13 @@ export type ServeOptions = {
208
208
  /** A test's seam: step 2 of DELETE /agents/{id} (agent-delete.ts) in place of the learning module's deleteLearning over
209
209
  * the agent's learning folder (learn/delete.ts), the server's own. */
210
210
  deleteLearning?: DeleteLearning;
211
- /** A test's seam: awaited at each step's point of DELETE /agents/{id} (agent-delete.ts AgentDeleteStep), so a throw
212
- * there stops the delete as a crash would. */
213
- agentDeleteAt?: (step: AgentDeleteStep, agentId: string) => void | Promise<void>;
211
+ /** A test's seam: awaited at each step's point of DELETE /agents/{id} and DELETE /runs/{id} (agent-delete.ts
212
+ * AgentDeleteStep), with the agent's id or the run's, so a throw there stops the delete as a crash would. */
213
+ agentDeleteAt?: (step: AgentDeleteStep, id: string) => void | Promise<void>;
214
+ /** A test's seam: told each time a request waits in an agent's delete turn behind another (agent-delete.ts oneAtATime),
215
+ * with the agent's id and how many of its requests wait there now, so a test knows a write sent while a DELETE is
216
+ * held is queued behind it before it lets the DELETE go. */
217
+ deleteTurnQueued?: (agentId: string, waiting: number) => void;
214
218
  /** A test's seam: awaited with a request's path and answer once its work under an Idempotency-Key is done, before the
215
219
  * answer is kept, so a test can hold a request there while a DELETE /agents/{id} runs. */
216
220
  beforeKeep?: (path: string, answer: unknown) => void | Promise<void>;