@runtypelabs/sdk 11.8.1 → 11.8.2
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/dist/index.cjs +57 -113
- package/dist/index.d.cts +206 -136
- package/dist/index.d.ts +206 -136
- package/dist/index.mjs +57 -113
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/sandbox-deployments-namespace.ts
|
|
2
2
|
/** Managed deployment authoring; acceptance records intent before the deployment becomes ready. */
|
|
3
3
|
var SandboxDeploymentsNamespace = class {
|
|
4
4
|
constructor(getClient) {
|
|
@@ -22,8 +22,7 @@ var SandboxDeploymentsNamespace = class {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
//#region src/unified-stream-adapter.ts
|
|
25
|
+
// src/unified-stream-adapter.ts
|
|
27
26
|
/**
|
|
28
27
|
* @deprecated Unified events are now the only public execution-stream format.
|
|
29
28
|
* Retained so published SDK consumers can compile while removing old opt-in
|
|
@@ -530,8 +529,7 @@ function errorObject(error) {
|
|
|
530
529
|
message: String(error)
|
|
531
530
|
};
|
|
532
531
|
}
|
|
533
|
-
|
|
534
|
-
//#region src/stream-utils.ts
|
|
532
|
+
// src/stream-utils.ts
|
|
535
533
|
/**
|
|
536
534
|
* Parse SSE stream chunks into individual events
|
|
537
535
|
*
|
|
@@ -799,8 +797,7 @@ async function* streamEvents(response, _options = {}) {
|
|
|
799
797
|
reader.releaseLock();
|
|
800
798
|
}
|
|
801
799
|
}
|
|
802
|
-
|
|
803
|
-
//#region src/flow-result.ts
|
|
800
|
+
// src/flow-result.ts
|
|
804
801
|
/**
|
|
805
802
|
* Result wrapper for flow execution
|
|
806
803
|
*
|
|
@@ -951,8 +948,7 @@ var FlowResult = class {
|
|
|
951
948
|
if (this.consumed) throw new Error("Response has already been consumed. The streaming response body can only be read once. Use the cached results from stream(), getResult(), or getAllResults() instead.");
|
|
952
949
|
}
|
|
953
950
|
};
|
|
954
|
-
|
|
955
|
-
//#region src/flow-builder.ts
|
|
951
|
+
// src/flow-builder.ts
|
|
956
952
|
/**
|
|
957
953
|
* Shared implementation for the `validate()` methods on {@link FlowBuilder},
|
|
958
954
|
* `ClientFlowBuilder`, and `RuntypeFlowBuilder`. Guards against validating a
|
|
@@ -1810,8 +1806,7 @@ function createExternalTool(config) {
|
|
|
1810
1806
|
...config.idempotent !== void 0 ? { idempotent: config.idempotent } : {}
|
|
1811
1807
|
};
|
|
1812
1808
|
}
|
|
1813
|
-
|
|
1814
|
-
//#region src/local-tool-pause.ts
|
|
1809
|
+
// src/local-tool-pause.ts
|
|
1815
1810
|
/**
|
|
1816
1811
|
* Fold a unified `await` event, or an SDK stable-callback `flow_await` /
|
|
1817
1812
|
* `step_await`, into the per-tool paused-state map. Compatibility frames may
|
|
@@ -1858,8 +1853,7 @@ function resolveBatchExecutionId(pausedTools) {
|
|
|
1858
1853
|
for (const tool of pausedTools) if (tool.executionId) return tool.executionId;
|
|
1859
1854
|
return "";
|
|
1860
1855
|
}
|
|
1861
|
-
|
|
1862
|
-
//#region src/detached-reconnect.ts
|
|
1856
|
+
// src/detached-reconnect.ts
|
|
1863
1857
|
/**
|
|
1864
1858
|
* Transparent reconnect for a DETACHED agent stream (ADR 0020 point 6;
|
|
1865
1859
|
* blueprint `2026-08-25-durable-by-default-agent-turns.md` §4).
|
|
@@ -2078,8 +2072,7 @@ function withDetachedReconnect(response, reattach, options = {}) {
|
|
|
2078
2072
|
headers: response.headers
|
|
2079
2073
|
});
|
|
2080
2074
|
}
|
|
2081
|
-
|
|
2082
|
-
//#region src/agent-aliases-namespace.ts
|
|
2075
|
+
// src/agent-aliases-namespace.ts
|
|
2083
2076
|
/** The `live` pointer every agent's production traffic follows. Never expires. */
|
|
2084
2077
|
const LIVE_AGENT_ALIAS = "live";
|
|
2085
2078
|
/**
|
|
@@ -2352,8 +2345,7 @@ var AgentDeploymentsNamespace = class {
|
|
|
2352
2345
|
});
|
|
2353
2346
|
}
|
|
2354
2347
|
};
|
|
2355
|
-
|
|
2356
|
-
//#region src/content-hash.ts
|
|
2348
|
+
// src/content-hash.ts
|
|
2357
2349
|
/**
|
|
2358
2350
|
* Canonical content-hash primitives shared by the `*.ensure()` config-as-code
|
|
2359
2351
|
* surfaces (products, tools, skills, surfaces, products-ensure-fpo). Each of
|
|
@@ -2407,8 +2399,7 @@ async function sha256Hex(serialized) {
|
|
|
2407
2399
|
const hashBuffer = await crypto.subtle.digest("SHA-256", encoded);
|
|
2408
2400
|
return Array.from(new Uint8Array(hashBuffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
2409
2401
|
}
|
|
2410
|
-
|
|
2411
|
-
//#region src/collections-ensure.ts
|
|
2402
|
+
// src/collections-ensure.ts
|
|
2412
2403
|
/** Canonical normalized form of a collection definition (slug excluded — identity). */
|
|
2413
2404
|
function normalizeRecordCollectionDefinition(definition) {
|
|
2414
2405
|
return {
|
|
@@ -2520,8 +2511,7 @@ async function ensureCollection(transport, definition, options = {}) {
|
|
|
2520
2511
|
async function pullCollection(transport, slug) {
|
|
2521
2512
|
return transport.get(`/collections/${encodeURIComponent(slug)}/pull`);
|
|
2522
2513
|
}
|
|
2523
|
-
|
|
2524
|
-
//#region src/generated-tool-gate.ts
|
|
2514
|
+
// src/generated-tool-gate.ts
|
|
2525
2515
|
const TOOL_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_]{1,63}$/;
|
|
2526
2516
|
const DEFAULT_MAX_CODE_LENGTH = 12e3;
|
|
2527
2517
|
const DEFAULT_MAX_TIMEOUT_MS = 3e4;
|
|
@@ -2790,8 +2780,7 @@ function applyGeneratedRuntimeToolProposalToDispatchRequest(request, proposal, o
|
|
|
2790
2780
|
request: attachRuntimeToolsToDispatchRequest(request, [decision.tool], options.attach)
|
|
2791
2781
|
};
|
|
2792
2782
|
}
|
|
2793
|
-
|
|
2794
|
-
//#region src/types.ts
|
|
2783
|
+
// src/types.ts
|
|
2795
2784
|
/** Narrow a {@link ClientToolEntry} to the name-only catalog-ref arm. */
|
|
2796
2785
|
function isCatalogClientToolRef(entry) {
|
|
2797
2786
|
return entry.catalog === "runtype-mcp";
|
|
@@ -2799,8 +2788,7 @@ function isCatalogClientToolRef(entry) {
|
|
|
2799
2788
|
function isBuiltinToolExecuteResponse(response) {
|
|
2800
2789
|
return "toolName" in response && !("executionId" in response);
|
|
2801
2790
|
}
|
|
2802
|
-
|
|
2803
|
-
//#region src/dispatch-request.ts
|
|
2791
|
+
// src/dispatch-request.ts
|
|
2804
2792
|
function normalizeDispatchMessageContent(content) {
|
|
2805
2793
|
if (Array.isArray(content) && content.some((part) => typeof part === "object" && part !== null && "type" in part && part.type === "asset_ref")) throw new Error("Dispatch messages cannot submit persisted asset_ref content; provide the original image or file content instead");
|
|
2806
2794
|
return content;
|
|
@@ -2848,8 +2836,7 @@ function normalizeDispatchRequest(request) {
|
|
|
2848
2836
|
agent: request.agent
|
|
2849
2837
|
};
|
|
2850
2838
|
}
|
|
2851
|
-
|
|
2852
|
-
//#region src/schedules-ensure.ts
|
|
2839
|
+
// src/schedules-ensure.ts
|
|
2853
2840
|
function nonEmptyObject(value) {
|
|
2854
2841
|
if (!isPlainObject$1(value)) return void 0;
|
|
2855
2842
|
const normalized = normalizeValue$1(value);
|
|
@@ -3081,8 +3068,7 @@ async function pullSchedule(client, name, target) {
|
|
|
3081
3068
|
...target
|
|
3082
3069
|
});
|
|
3083
3070
|
}
|
|
3084
|
-
|
|
3085
|
-
//#region src/offload-markers.ts
|
|
3071
|
+
// src/offload-markers.ts
|
|
3086
3072
|
const LEDGER_ARTIFACT_LINE_PREFIX = "Ledger artifact: ";
|
|
3087
3073
|
const SPILL_MARKER_PATTERN = /\[Output saved to (art_[A-Za-z0-9_-]+) \(([\d,]+) chars?\); read_offloaded_output to view\]/;
|
|
3088
3074
|
/** Number formatting is pinned to en-US so the `[\d,]+` size patterns parse
|
|
@@ -3206,8 +3192,7 @@ function modelIdSupportsProviderNativeCompaction(modelId) {
|
|
|
3206
3192
|
const normalized = modelId?.trim().toLowerCase() ?? "";
|
|
3207
3193
|
return normalized.includes("claude") || normalized.includes("anthropic");
|
|
3208
3194
|
}
|
|
3209
|
-
|
|
3210
|
-
//#region src/workflow-utils.ts
|
|
3195
|
+
// src/workflow-utils.ts
|
|
3211
3196
|
/**
|
|
3212
3197
|
* Utility functions shared between workflow phase handlers and AgentsEndpoint.
|
|
3213
3198
|
*
|
|
@@ -3259,8 +3244,7 @@ function getDefaultExternalReportPath(taskName) {
|
|
|
3259
3244
|
function sanitizeTaskSlug(taskName) {
|
|
3260
3245
|
return taskName.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80);
|
|
3261
3246
|
}
|
|
3262
|
-
|
|
3263
|
-
//#region src/workflows/hook-registry.ts
|
|
3247
|
+
// src/workflows/hook-registry.ts
|
|
3264
3248
|
const BUILTIN_NAMESPACE = "builtin";
|
|
3265
3249
|
const HOOK_REF_PATTERN = /^[a-z0-9_-]+:[a-z0-9_-]+$/;
|
|
3266
3250
|
/**
|
|
@@ -3315,8 +3299,7 @@ function unregisterWorkflowHook(name) {
|
|
|
3315
3299
|
if (name.startsWith(`${BUILTIN_NAMESPACE}:`)) return false;
|
|
3316
3300
|
return registry.delete(name);
|
|
3317
3301
|
}
|
|
3318
|
-
|
|
3319
|
-
//#region src/workflows/workflow-config.ts
|
|
3302
|
+
// src/workflows/workflow-config.ts
|
|
3320
3303
|
const DISCOVERY_TOOLS = /* @__PURE__ */ new Set([
|
|
3321
3304
|
"search_repo",
|
|
3322
3305
|
"glob_files",
|
|
@@ -3470,8 +3453,7 @@ function compileWorkflowConfig(config, deps = {}) {
|
|
|
3470
3453
|
...buildCandidateBlock ? { buildCandidateBlock } : {}
|
|
3471
3454
|
};
|
|
3472
3455
|
}
|
|
3473
|
-
|
|
3474
|
-
//#region src/workflows/default-workflow.ts
|
|
3456
|
+
// src/workflows/default-workflow.ts
|
|
3475
3457
|
function isExternalTask(state) {
|
|
3476
3458
|
return state.workflowVariant === "external";
|
|
3477
3459
|
}
|
|
@@ -4276,8 +4258,7 @@ const defaultWorkflowConfig = {
|
|
|
4276
4258
|
};
|
|
4277
4259
|
ensureDefaultWorkflowHooks();
|
|
4278
4260
|
const defaultWorkflow = compileWorkflowConfig(defaultWorkflowConfig);
|
|
4279
|
-
|
|
4280
|
-
//#region src/workflows/deploy-workflow.ts
|
|
4261
|
+
// src/workflows/deploy-workflow.ts
|
|
4281
4262
|
const scaffoldPhase = {
|
|
4282
4263
|
name: "scaffold",
|
|
4283
4264
|
description: "Understand requirements for the app to deploy",
|
|
@@ -4421,8 +4402,7 @@ const deployWorkflow = {
|
|
|
4421
4402
|
return "";
|
|
4422
4403
|
}
|
|
4423
4404
|
};
|
|
4424
|
-
|
|
4425
|
-
//#region src/workflows/game-workflow.ts
|
|
4405
|
+
// src/workflows/game-workflow.ts
|
|
4426
4406
|
const blockedTools = [
|
|
4427
4407
|
"write_file",
|
|
4428
4408
|
"read_file",
|
|
@@ -4647,8 +4627,7 @@ const gameWorkflow = {
|
|
|
4647
4627
|
return "";
|
|
4648
4628
|
}
|
|
4649
4629
|
};
|
|
4650
|
-
|
|
4651
|
-
//#region src/workflows/stall-policy.ts
|
|
4630
|
+
// src/workflows/stall-policy.ts
|
|
4652
4631
|
const DEFAULT_STALL_STOP_AFTER = 3;
|
|
4653
4632
|
function isPositiveInteger(value) {
|
|
4654
4633
|
return typeof value === "number" && Number.isInteger(value) && value >= 1;
|
|
@@ -4687,8 +4666,7 @@ function buildEmptySessionNudge(consecutiveEmptySessions) {
|
|
|
4687
4666
|
"If a previous tool call was blocked, re-read the block message and satisfy its requirement instead of ending the turn."
|
|
4688
4667
|
].join("\n");
|
|
4689
4668
|
}
|
|
4690
|
-
|
|
4691
|
-
//#region src/endpoints.ts
|
|
4669
|
+
// src/endpoints.ts
|
|
4692
4670
|
/**
|
|
4693
4671
|
* Path of the execution-scoped events alias,
|
|
4694
4672
|
* `GET /v1/executions/{executionId}/events`.
|
|
@@ -9032,8 +9010,7 @@ var ToolApprovalGrantsEndpoint = class {
|
|
|
9032
9010
|
return this.client.delete(`/tool-approval-grants/${id}`);
|
|
9033
9011
|
}
|
|
9034
9012
|
};
|
|
9035
|
-
|
|
9036
|
-
//#region src/detached-buffered-follow.ts
|
|
9013
|
+
// src/detached-buffered-follow.ts
|
|
9037
9014
|
/** The release fields a response body carries, dropping any it does not name. */
|
|
9038
9015
|
function releaseFieldsOf(data) {
|
|
9039
9016
|
if (typeof data !== "object" || data === null) return {};
|
|
@@ -9140,8 +9117,7 @@ async function followDetachedResume(client, ack, after, carried = {}) {
|
|
|
9140
9117
|
...releaseFieldsOf(ack)
|
|
9141
9118
|
};
|
|
9142
9119
|
}
|
|
9143
|
-
|
|
9144
|
-
//#region src/evals-ensure.ts
|
|
9120
|
+
// src/evals-ensure.ts
|
|
9145
9121
|
const CHECK_GRADER_KINDS = /* @__PURE__ */ new Set([
|
|
9146
9122
|
"contains",
|
|
9147
9123
|
"not_contains",
|
|
@@ -9684,8 +9660,7 @@ async function pullEval(client, name) {
|
|
|
9684
9660
|
async function runEvalSuite(client, input) {
|
|
9685
9661
|
return client.post("/eval/run", input);
|
|
9686
9662
|
}
|
|
9687
|
-
|
|
9688
|
-
//#region src/flows-ensure.ts
|
|
9663
|
+
// src/flows-ensure.ts
|
|
9689
9664
|
function normalizeConfigForHash(config) {
|
|
9690
9665
|
if (!isPlainObject$1(config)) return {};
|
|
9691
9666
|
const normalized = {};
|
|
@@ -10081,8 +10056,7 @@ async function convergeInlineEvals(client, definition, result, onConflict) {
|
|
|
10081
10056
|
async function pullFlow(client, name) {
|
|
10082
10057
|
return client.get("/flows/pull", { name });
|
|
10083
10058
|
}
|
|
10084
|
-
|
|
10085
|
-
//#region src/flows-namespace.ts
|
|
10059
|
+
// src/flows-namespace.ts
|
|
10086
10060
|
/** The persisted-flow protocol retries only when the API names the hash miss; any other 422 is terminal. */
|
|
10087
10061
|
function isPersistedFlowHashMiss(err) {
|
|
10088
10062
|
if (err == null || typeof err !== "object") return false;
|
|
@@ -10971,8 +10945,7 @@ var RuntypeFlowBuilder = class {
|
|
|
10971
10945
|
});
|
|
10972
10946
|
}
|
|
10973
10947
|
};
|
|
10974
|
-
|
|
10975
|
-
//#region src/batches-namespace.ts
|
|
10948
|
+
// src/batches-namespace.ts
|
|
10976
10949
|
var BatchesNamespace = class {
|
|
10977
10950
|
constructor(getClient) {
|
|
10978
10951
|
this.getClient = getClient;
|
|
@@ -11071,8 +11044,7 @@ var BatchesNamespace = class {
|
|
|
11071
11044
|
return this.getClient().get("/batches", params);
|
|
11072
11045
|
}
|
|
11073
11046
|
};
|
|
11074
|
-
|
|
11075
|
-
//#region src/evals-suites.ts
|
|
11047
|
+
// src/evals-suites.ts
|
|
11076
11048
|
var EvalSuitesNamespace = class {
|
|
11077
11049
|
constructor(getClient) {
|
|
11078
11050
|
this.getClient = getClient;
|
|
@@ -11175,8 +11147,7 @@ var EvalSuitesNamespace = class {
|
|
|
11175
11147
|
return this.getClient().get(`/eval/suites/${suiteId}/coverage`);
|
|
11176
11148
|
}
|
|
11177
11149
|
};
|
|
11178
|
-
|
|
11179
|
-
//#region src/evals-namespace.ts
|
|
11150
|
+
// src/evals-namespace.ts
|
|
11180
11151
|
/**
|
|
11181
11152
|
* EvalRunner - Builder returned by Runtype.evals.run()
|
|
11182
11153
|
*
|
|
@@ -11421,8 +11392,7 @@ var EvalsNamespace = class {
|
|
|
11421
11392
|
return this.getClient().get("/evals", params);
|
|
11422
11393
|
}
|
|
11423
11394
|
};
|
|
11424
|
-
|
|
11425
|
-
//#region src/prompts-namespace.ts
|
|
11395
|
+
// src/prompts-namespace.ts
|
|
11426
11396
|
var PromptsNamespace = class {
|
|
11427
11397
|
constructor(getClient) {
|
|
11428
11398
|
this.getClient = getClient;
|
|
@@ -11499,8 +11469,7 @@ var PromptsNamespace = class {
|
|
|
11499
11469
|
await this.getClient().post(`/prompts/${promptId}/delete`);
|
|
11500
11470
|
}
|
|
11501
11471
|
};
|
|
11502
|
-
|
|
11503
|
-
//#region src/skills-ensure.ts
|
|
11472
|
+
// src/skills-ensure.ts
|
|
11504
11473
|
/** Canonical normalized form of a skill manifest (frontmatter name excluded). */
|
|
11505
11474
|
function normalizeSkillDefinition(definition) {
|
|
11506
11475
|
const manifest = isPlainObject$1(definition.manifest) ? definition.manifest : {};
|
|
@@ -11702,8 +11671,7 @@ function manifestToWire(definition) {
|
|
|
11702
11671
|
async function pullSkill(client, name) {
|
|
11703
11672
|
return client.get("/skills/pull", { name });
|
|
11704
11673
|
}
|
|
11705
|
-
|
|
11706
|
-
//#region src/skills-namespace.ts
|
|
11674
|
+
// src/skills-namespace.ts
|
|
11707
11675
|
/**
|
|
11708
11676
|
* The admin review queue for agent-authored skill proposals. This is the human
|
|
11709
11677
|
* review surface for the deployed-agent data plane — listing, approving, and
|
|
@@ -11922,8 +11890,7 @@ var SkillsNamespace = class {
|
|
|
11922
11890
|
return pullSkill(this.getClient(), name);
|
|
11923
11891
|
}
|
|
11924
11892
|
};
|
|
11925
|
-
|
|
11926
|
-
//#region src/agents-namespace.ts
|
|
11893
|
+
// src/agents-namespace.ts
|
|
11927
11894
|
/**
|
|
11928
11895
|
* The refusal a client-side `release` + `deploy` mix answers with. Byte-identical
|
|
11929
11896
|
* to the server's, so both spellings of the mistake read the same.
|
|
@@ -12276,8 +12243,7 @@ var AgentsNamespace = class {
|
|
|
12276
12243
|
}
|
|
12277
12244
|
}
|
|
12278
12245
|
};
|
|
12279
|
-
|
|
12280
|
-
//#region src/executions-namespace.ts
|
|
12246
|
+
// src/executions-namespace.ts
|
|
12281
12247
|
/** Read-only namespace for durable asynchronous execution handles. */
|
|
12282
12248
|
var ExecutionsNamespace = class {
|
|
12283
12249
|
constructor(getClient) {
|
|
@@ -12287,8 +12253,7 @@ var ExecutionsNamespace = class {
|
|
|
12287
12253
|
return this.getClient().getExecutionStatus(executionId);
|
|
12288
12254
|
}
|
|
12289
12255
|
};
|
|
12290
|
-
|
|
12291
|
-
//#region src/runs-namespace.ts
|
|
12256
|
+
// src/runs-namespace.ts
|
|
12292
12257
|
/**
|
|
12293
12258
|
* Read-only namespace over `/v1/runs`, the one list of agent and flow runs.
|
|
12294
12259
|
* A dashboard editor test is listed with `origin: 'dashboard'` (and its `test`
|
|
@@ -12305,8 +12270,7 @@ var RunsNamespace = class {
|
|
|
12305
12270
|
return (await this.getClient().get(`/runs/${encodeURIComponent(executionId)}`, params)).data;
|
|
12306
12271
|
}
|
|
12307
12272
|
};
|
|
12308
|
-
|
|
12309
|
-
//#region src/tools-ensure.ts
|
|
12273
|
+
// src/tools-ensure.ts
|
|
12310
12274
|
/** Canonical normalized form of a tool definition (name excluded — identity). */
|
|
12311
12275
|
function normalizeToolDefinition(definition) {
|
|
12312
12276
|
const parametersSchema = isPlainObject$1(definition.parametersSchema) ? normalizeValue$1(definition.parametersSchema) : {};
|
|
@@ -12506,8 +12470,7 @@ async function ensureTool(client, definition, options = {}) {
|
|
|
12506
12470
|
async function pullTool(client, name) {
|
|
12507
12471
|
return client.get("/tools/pull", { name });
|
|
12508
12472
|
}
|
|
12509
|
-
|
|
12510
|
-
//#region src/tools-namespace.ts
|
|
12473
|
+
// src/tools-namespace.ts
|
|
12511
12474
|
var ToolsNamespace = class {
|
|
12512
12475
|
constructor(getClient) {
|
|
12513
12476
|
this.getClient = getClient;
|
|
@@ -12545,8 +12508,7 @@ var ToolsNamespace = class {
|
|
|
12545
12508
|
return pullTool(this.getClient(), name);
|
|
12546
12509
|
}
|
|
12547
12510
|
};
|
|
12548
|
-
|
|
12549
|
-
//#region src/question-sets-ensure.ts
|
|
12511
|
+
// src/question-sets-ensure.ts
|
|
12550
12512
|
/** Canonical form of a question set definition, without its slug. */
|
|
12551
12513
|
function normalizeQuestionSetDefinition(definition) {
|
|
12552
12514
|
return normalizeValue$1({
|
|
@@ -12693,8 +12655,7 @@ async function ensureQuestionSet(client, definition, options = {}) {
|
|
|
12693
12655
|
async function pullQuestionSet(client, slug) {
|
|
12694
12656
|
return client.get("/question-sets/pull", { slug });
|
|
12695
12657
|
}
|
|
12696
|
-
|
|
12697
|
-
//#region src/question-sets-namespace.ts
|
|
12658
|
+
// src/question-sets-namespace.ts
|
|
12698
12659
|
/** Question set config-as-code: `ensure` and `pull`. */
|
|
12699
12660
|
var QuestionSetsNamespace = class {
|
|
12700
12661
|
constructor(getClient) {
|
|
@@ -12719,8 +12680,7 @@ var QuestionSetsNamespace = class {
|
|
|
12719
12680
|
return pullQuestionSet(this.getClient(), slug);
|
|
12720
12681
|
}
|
|
12721
12682
|
};
|
|
12722
|
-
|
|
12723
|
-
//#region src/signals-namespace.ts
|
|
12683
|
+
// src/signals-namespace.ts
|
|
12724
12684
|
function pathId(id) {
|
|
12725
12685
|
return encodeURIComponent(id);
|
|
12726
12686
|
}
|
|
@@ -12786,8 +12746,7 @@ var SignalsNamespace = class {
|
|
|
12786
12746
|
return this.getClient().get("/signals/stats", params);
|
|
12787
12747
|
}
|
|
12788
12748
|
};
|
|
12789
|
-
|
|
12790
|
-
//#region src/products-ensure.ts
|
|
12749
|
+
// src/products-ensure.ts
|
|
12791
12750
|
/**
|
|
12792
12751
|
* `spec` with its stack as a save stores it: without the server-set fields (`detected`, `declared`,
|
|
12793
12752
|
* `hiddenAt`), which their own write paths set, and with `hidden` deduplicated.
|
|
@@ -12980,8 +12939,7 @@ async function ensureProduct(client, definition, options = {}) {
|
|
|
12980
12939
|
async function pullProduct(client, name) {
|
|
12981
12940
|
return client.get("/products/pull", { name });
|
|
12982
12941
|
}
|
|
12983
|
-
|
|
12984
|
-
//#region src/products-ensure-fpo.ts
|
|
12942
|
+
// src/products-ensure-fpo.ts
|
|
12985
12943
|
/**
|
|
12986
12944
|
* Canonical normalized form of an FPO: `_meta` and the top-level `product.name`
|
|
12987
12945
|
* are excluded (generation provenance / identity), the whole graph is recursively
|
|
@@ -13110,8 +13068,7 @@ async function ensureFpo(client, fpo, options = {}) {
|
|
|
13110
13068
|
async function pullFpo(client, name) {
|
|
13111
13069
|
return client.get("/products/pull-fpo", { name });
|
|
13112
13070
|
}
|
|
13113
|
-
|
|
13114
|
-
//#region src/products-namespace.ts
|
|
13071
|
+
// src/products-namespace.ts
|
|
13115
13072
|
var ProductsNamespace = class {
|
|
13116
13073
|
constructor(getClient) {
|
|
13117
13074
|
this.getClient = getClient;
|
|
@@ -13202,8 +13159,7 @@ var ProductsNamespace = class {
|
|
|
13202
13159
|
return this.getClient().get(`/products/${encodeURIComponent(productId)}/activity`, options.limit === void 0 ? void 0 : { limit: String(options.limit) });
|
|
13203
13160
|
}
|
|
13204
13161
|
};
|
|
13205
|
-
|
|
13206
|
-
//#region src/surfaces-ensure.ts
|
|
13162
|
+
// src/surfaces-ensure.ts
|
|
13207
13163
|
/**
|
|
13208
13164
|
* Canonical normalized form of a surface definition (name excluded — identity).
|
|
13209
13165
|
* `inbound` / `outbound` are EXCLUDED — they carry sealed secrets that hash
|
|
@@ -13424,8 +13380,7 @@ async function ensureSurface(client, productId, definition, options = {}) {
|
|
|
13424
13380
|
async function pullSurface(client, productId, name) {
|
|
13425
13381
|
return client.get(`/products/${encodeURIComponent(productId)}/surfaces/pull`, { name });
|
|
13426
13382
|
}
|
|
13427
|
-
|
|
13428
|
-
//#region src/surfaces-namespace.ts
|
|
13383
|
+
// src/surfaces-namespace.ts
|
|
13429
13384
|
var SurfacesNamespace = class {
|
|
13430
13385
|
constructor(getClient) {
|
|
13431
13386
|
this.getClient = getClient;
|
|
@@ -13462,8 +13417,7 @@ var SurfacesNamespace = class {
|
|
|
13462
13417
|
return pullSurface(this.getClient(), productId, name);
|
|
13463
13418
|
}
|
|
13464
13419
|
};
|
|
13465
|
-
|
|
13466
|
-
//#region src/client-tokens-namespace.ts
|
|
13420
|
+
// src/client-tokens-namespace.ts
|
|
13467
13421
|
/** The definition cannot converge onto the existing token without deleting it. */
|
|
13468
13422
|
var ClientTokenEnsureError = class extends Error {
|
|
13469
13423
|
constructor(message) {
|
|
@@ -13615,8 +13569,7 @@ var ClientTokensNamespace = class {
|
|
|
13615
13569
|
};
|
|
13616
13570
|
}
|
|
13617
13571
|
};
|
|
13618
|
-
|
|
13619
|
-
//#region src/runtype.ts
|
|
13572
|
+
// src/runtype.ts
|
|
13620
13573
|
let globalConfig = {};
|
|
13621
13574
|
let globalClient = null;
|
|
13622
13575
|
/**
|
|
@@ -14247,8 +14200,7 @@ var Runtype = class {
|
|
|
14247
14200
|
return new ClientTokensNamespace(() => this.getClient());
|
|
14248
14201
|
}
|
|
14249
14202
|
};
|
|
14250
|
-
|
|
14251
|
-
//#region src/a2a-handler.ts
|
|
14203
|
+
// src/a2a-handler.ts
|
|
14252
14204
|
function record(value) {
|
|
14253
14205
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
14254
14206
|
}
|
|
@@ -14415,8 +14367,7 @@ function createA2AHandler(options) {
|
|
|
14415
14367
|
}
|
|
14416
14368
|
};
|
|
14417
14369
|
}
|
|
14418
|
-
|
|
14419
|
-
//#region src/agent-promotion.ts
|
|
14370
|
+
// src/agent-promotion.ts
|
|
14420
14371
|
const MANIFEST_VERSION = 1;
|
|
14421
14372
|
/** Receipts read per page, and the page ceiling, while hunting the staged receipt. */
|
|
14422
14373
|
const RECEIPT_PAGE_SIZE = 50;
|
|
@@ -14610,8 +14561,7 @@ async function promoteAgent(input) {
|
|
|
14610
14561
|
})
|
|
14611
14562
|
};
|
|
14612
14563
|
}
|
|
14613
|
-
|
|
14614
|
-
//#region src/simulations-namespace.ts
|
|
14564
|
+
// src/simulations-namespace.ts
|
|
14615
14565
|
const segment = encodeURIComponent;
|
|
14616
14566
|
/**
|
|
14617
14567
|
* Simulations tool memory and future designs (`/v1/simulations`): recorded exchanges, tool profiles,
|
|
@@ -14689,8 +14639,7 @@ var SimulationsEndpoint = class {
|
|
|
14689
14639
|
return this.client.get(`/simulations/runs/${segment(runId)}/episodes/${segment(episodeId)}`);
|
|
14690
14640
|
}
|
|
14691
14641
|
};
|
|
14692
|
-
|
|
14693
|
-
//#region src/transform.ts
|
|
14642
|
+
// src/transform.ts
|
|
14694
14643
|
/**
|
|
14695
14644
|
* Transform URL query parameters
|
|
14696
14645
|
*/
|
|
@@ -14702,9 +14651,8 @@ function transformQueryParams(params) {
|
|
|
14702
14651
|
}
|
|
14703
14652
|
return result;
|
|
14704
14653
|
}
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
const SDK_VERSION = "11.8.1";
|
|
14654
|
+
// src/version.ts
|
|
14655
|
+
const SDK_VERSION = "11.8.2";
|
|
14708
14656
|
/**
|
|
14709
14657
|
* Canonical client identity the API uses for attribution
|
|
14710
14658
|
* (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
|
|
@@ -14720,8 +14668,7 @@ const RUNTYPE_CLIENT_KIND = "sdk";
|
|
|
14720
14668
|
* is the reliable cross-environment signal; this UA carries the version + language.
|
|
14721
14669
|
*/
|
|
14722
14670
|
const SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
|
|
14723
|
-
|
|
14724
|
-
//#region src/client.ts
|
|
14671
|
+
// src/client.ts
|
|
14725
14672
|
function isObjectRecord(value) {
|
|
14726
14673
|
return typeof value === "object" && value !== null;
|
|
14727
14674
|
}
|
|
@@ -15240,8 +15187,7 @@ var RuntypeApiError = class extends Error {
|
|
|
15240
15187
|
function createClient(config) {
|
|
15241
15188
|
return new RuntypeClient(config);
|
|
15242
15189
|
}
|
|
15243
|
-
|
|
15244
|
-
//#region src/batch-builder.ts
|
|
15190
|
+
// src/batch-builder.ts
|
|
15245
15191
|
var BatchBuilder = class {
|
|
15246
15192
|
constructor() {
|
|
15247
15193
|
this.flowId = "";
|
|
@@ -15333,8 +15279,7 @@ var ClientBatchBuilder = class extends BatchBuilder {
|
|
|
15333
15279
|
return this.boundClient.batch(config);
|
|
15334
15280
|
}
|
|
15335
15281
|
};
|
|
15336
|
-
|
|
15337
|
-
//#region src/eval-builder.ts
|
|
15282
|
+
// src/eval-builder.ts
|
|
15338
15283
|
var EvalBuilder = class {
|
|
15339
15284
|
constructor() {
|
|
15340
15285
|
this.evalOptions = {};
|
|
@@ -16966,6 +16911,5 @@ const STEP_TYPE_TO_METHOD = {
|
|
|
16966
16911
|
"memory-summary": "memorySummary",
|
|
16967
16912
|
extract: "extract"
|
|
16968
16913
|
};
|
|
16969
|
-
//#endregion
|
|
16970
16914
|
export { AgentAliasDependencyError, AgentAliasNotFoundError, AgentAliasRevisionMismatchError, AgentAliasRevisionRequiredError, AgentAliasesNamespace, AgentDeploymentsNamespace, AgentDriftError, AgentEnsureConflictError, AgentPromotionError, AgentVersionsEndpoint, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, ApiKeyRequestsEndpoint, ApiKeysEndpoint, BatchBuilder, BatchesNamespace, BillingEndpoint, ChatEndpoint, ClientBatchBuilder, ClientEvalBuilder, ClientFlowBuilder, ClientTokenDriftError, ClientTokenEnsureError, ClientTokensEndpoint, ClientTokensNamespace, CollectionDriftError, CollectionEnsureConflictError, CollectionsEndpoint, ContextTemplatesEndpoint, ConversationsEndpoint, DEFAULT_MAX_DETACHED_RECONNECTS, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, DispatchEndpoint, ENSURE_RELEASE_DEPLOY_CONFLICT_MESSAGE, EvalBuilder, EvalDriftError, EvalEndpoint, EvalEnsureConflictError, EvalRunner, EvalSuitesNamespace, EvalsNamespace, ExecutionsEndpoint, ExecutionsNamespace, FlowBuilder, FlowDriftError, FlowEnsureConflictError, FlowResult, FlowStepsEndpoint, FlowVersionsEndpoint, FlowsEndpoint, FlowsNamespace, FpoDriftError, IntegrationsEndpoint, LEDGER_ARTIFACT_LINE_PREFIX, LIVE_AGENT_ALIAS, LogsEndpoint, ModelConfigsEndpoint, ProductDriftError, ProductEnsureConflictError, ProductsNamespace, PromptsEndpoint, PromptsNamespace, ProviderKeysEndpoint, QuestionSetDriftError, QuestionSetEnsureConflictError, QuestionSetsNamespace, RUNTYPE_CLIENT_KIND, RecordsEndpoint, RunsNamespace, Runtype, RuntypeApiError, RuntypeClient, RuntypeFlowBuilder, SDK_USER_AGENT, SDK_VERSION, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, SandboxDeploymentsNamespace, ScheduleDriftError, ScheduleEnsureConflictError, SchedulesEndpoint, SecretsEndpoint, SignalsNamespace, SimulationsEndpoint, SkillDriftError, SkillEnsureConflictError, SkillProposalsNamespace, SkillsNamespace, SurfaceDriftError, SurfaceEnsureConflictError, SurfacesEndpoint, SurfacesNamespace, ToolApprovalGrantsEndpoint, ToolDriftError, ToolEnsureConflictError, ToolsEndpoint, ToolsNamespace, TypedRecordsScope, UNIFIED_EVENTS_QUERY, UsersEndpoint, activateAgentPromotion, agentAliasErrorCode, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildAgentAdmissionHeaders, buildEmptySessionNudge, buildExecutionEventsPath, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildObservationMaskMarker, buildPolicyGuidance, buildSendViewOffloadMarker, calledTool, combineAbortSignals, compileWorkflowConfig, completed, computeAgentContentHash, computeEvalContentHash, computeFlowContentHash, computeFpoContentHash, computeProductContentHash, computeQuestionSetContentHash, computeRecordCollectionContentHash, computeScheduleContentHash, computeScheduleDefinitionHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, contains, cost, createA2AHandler, createAgentEventTranslator, createClient, createExternalTool, createFlowEventTranslator, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineEval, defineFlow, defineFpo, definePlaybook, defineProduct, defineQuestionSet, defineSchedule, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, ensureEval, ensureFpo, ensureSchedule, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, fpoPlanHasDrift, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isBuiltinToolExecuteResponse, isCatalogClientToolRef, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isUnifiedEventType, isWorkflowHookRef, jsonField, judge, judges, latency, length, listWorkflowHooks, matchesExpected, maxToolCalls, noError, normalizeAgentDefinition, normalizeCandidatePath, normalizeFpoDefinition, normalizeProductDefinition, normalizeQuestionSetDefinition, normalizeRecordCollectionDefinition, normalizeScheduleContent, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, notCalledTool, notContains, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, prepareAgentPromotion, processStream, promoteAgent, promotionIdempotencyKey, pullEval, pullFpo, pullSchedule, ranStep, regex, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, runEvalSuite, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, stepOrder, streamEvents, toolOrder, unregisterWorkflowHook, usedNoTools, validJson, validateAgentPromotion, withDetachedReconnect, withUnifiedEvents };
|
|
16971
16915
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/sdk",
|
|
3
|
-
"version": "11.8.
|
|
3
|
+
"version": "11.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@runtypelabs/shared": "3.
|
|
27
|
+
"@runtypelabs/shared": "3.98.0",
|
|
28
28
|
"openapi-typescript": "^7.13.0",
|
|
29
|
-
"tsdown": "^0.23.
|
|
29
|
+
"tsdown": "^0.23.2",
|
|
30
30
|
"typescript": "^6.0.3",
|
|
31
|
-
"vitest": "^5.0.
|
|
31
|
+
"vitest": "^5.0.5"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"runtype",
|