@runtypelabs/sdk 11.0.1 → 11.3.0
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 +118 -1
- package/dist/index.d.cts +14847 -10841
- package/dist/index.d.ts +14847 -10841
- package/dist/index.mjs +117 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/sandbox-deployments-namespace.ts
|
|
3
|
+
/** Managed deployment authoring; acceptance records intent before the deployment becomes ready. */
|
|
4
|
+
var SandboxDeploymentsNamespace = class {
|
|
5
|
+
constructor(getClient) {
|
|
6
|
+
this.getClient = getClient;
|
|
7
|
+
}
|
|
8
|
+
runtimeProfiles() {
|
|
9
|
+
return this.getClient().get("/sandbox-deployments/runtime-profiles");
|
|
10
|
+
}
|
|
11
|
+
definition(id) {
|
|
12
|
+
return this.getClient().get(`/sandbox-deployments/${encodeURIComponent(id)}/definition`);
|
|
13
|
+
}
|
|
14
|
+
/** Use retained runtime and uploaded source IDs; the API resolves pins and authoring defaults. */
|
|
15
|
+
create(data, options) {
|
|
16
|
+
return this.getClient().post("/sandbox-deployments", data, { "Idempotency-Key": options.idempotencyKey });
|
|
17
|
+
}
|
|
18
|
+
/** Replace the complete config or spec without renewing retention. */
|
|
19
|
+
update(id, data, options) {
|
|
20
|
+
return this.getClient().put(`/sandbox-deployments/${encodeURIComponent(id)}`, data, {
|
|
21
|
+
"Idempotency-Key": options.idempotencyKey,
|
|
22
|
+
"If-Match": String(options.ifMatch)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
2
27
|
//#region src/unified-stream-adapter.ts
|
|
3
28
|
/**
|
|
4
29
|
* @deprecated Unified events are now the only public execution-stream format.
|
|
@@ -1304,6 +1329,7 @@ var FlowBuilder = class {
|
|
|
1304
1329
|
recordFilter: config.recordFilter,
|
|
1305
1330
|
limit: config.limit,
|
|
1306
1331
|
onEmpty: config.onEmpty,
|
|
1332
|
+
errorHandling: config.errorHandling,
|
|
1307
1333
|
fieldsToInclude: config.fieldsToInclude,
|
|
1308
1334
|
fieldsToExclude: config.fieldsToExclude,
|
|
1309
1335
|
availableFields: config.availableFields,
|
|
@@ -10467,6 +10493,7 @@ var RuntypeFlowBuilder = class {
|
|
|
10467
10493
|
recordFilter: config.recordFilter,
|
|
10468
10494
|
limit: config.limit,
|
|
10469
10495
|
onEmpty: config.onEmpty,
|
|
10496
|
+
errorHandling: config.errorHandling,
|
|
10470
10497
|
fieldsToInclude: config.fieldsToInclude,
|
|
10471
10498
|
fieldsToExclude: config.fieldsToExclude,
|
|
10472
10499
|
availableFields: config.availableFields,
|
|
@@ -14104,6 +14131,9 @@ var Runtype = class {
|
|
|
14104
14131
|
static get surfaces() {
|
|
14105
14132
|
return new SurfacesNamespace(() => this.getClient());
|
|
14106
14133
|
}
|
|
14134
|
+
static get sandboxDeployments() {
|
|
14135
|
+
return new SandboxDeploymentsNamespace(() => this.getClient());
|
|
14136
|
+
}
|
|
14107
14137
|
/**
|
|
14108
14138
|
* Client tokens — publishable credentials for widgets. `ensure` finds a token
|
|
14109
14139
|
* by name, creates it when missing, and converges its agents, flows, origins,
|
|
@@ -14487,6 +14517,85 @@ async function promoteAgent(input) {
|
|
|
14487
14517
|
};
|
|
14488
14518
|
}
|
|
14489
14519
|
//#endregion
|
|
14520
|
+
//#region src/simulations-namespace.ts
|
|
14521
|
+
const segment = encodeURIComponent;
|
|
14522
|
+
/**
|
|
14523
|
+
* Simulations tool memory and future designs (`/v1/simulations`): recorded exchanges, tool profiles,
|
|
14524
|
+
* design previews, synthesis review, design briefs and run episodes. Pre-GA: the API answers 404 `SIMULATIONS_DISABLED`
|
|
14525
|
+
* where simulations are not available (production today).
|
|
14526
|
+
*/
|
|
14527
|
+
var SimulationsEndpoint = class {
|
|
14528
|
+
constructor(client) {
|
|
14529
|
+
this.client = client;
|
|
14530
|
+
}
|
|
14531
|
+
/** Change a target's name, config or recording consent (`{ enabled, retentionDays }`). */
|
|
14532
|
+
async updateTarget(targetId, data) {
|
|
14533
|
+
return this.client.patch(`/simulations/targets/${segment(targetId)}`, data);
|
|
14534
|
+
}
|
|
14535
|
+
/** Save a variant's design; `validate: true` refuses it with 422 as run admission would. */
|
|
14536
|
+
async updateVariant(simulationId, variantId, data) {
|
|
14537
|
+
return this.client.patch(`/simulations/${segment(simulationId)}/variants/${segment(variantId)}`, data);
|
|
14538
|
+
}
|
|
14539
|
+
/** What Runtype learned about one tool of a target from its recorded answers. */
|
|
14540
|
+
async getToolProfile(targetId, tool) {
|
|
14541
|
+
return this.client.get(`/simulations/targets/${segment(targetId)}/tools/${segment(tool)}/profile`);
|
|
14542
|
+
}
|
|
14543
|
+
/** A target's recorded exchanges, newest first. */
|
|
14544
|
+
async listExchanges(targetId, params = {}) {
|
|
14545
|
+
const query = {};
|
|
14546
|
+
if (params.tool !== void 0) query.tool = params.tool;
|
|
14547
|
+
if (params.published !== void 0) query.published = String(params.published);
|
|
14548
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
14549
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
14550
|
+
return this.client.get(`/simulations/targets/${segment(targetId)}/exchanges`, query);
|
|
14551
|
+
}
|
|
14552
|
+
/** Record calls your server answered outside a simulation, or backfill from transcripts or tool executions. */
|
|
14553
|
+
async uploadExchanges(targetId, data) {
|
|
14554
|
+
return this.client.post(`/simulations/targets/${segment(targetId)}/exchanges`, data);
|
|
14555
|
+
}
|
|
14556
|
+
/** Delete a target's recorded exchanges, or one tool's. */
|
|
14557
|
+
async purgeExchanges(targetId, options = {}) {
|
|
14558
|
+
const query = options.tool === void 0 ? "" : `?tool=${segment(options.tool)}`;
|
|
14559
|
+
return this.client.delete(`/simulations/targets/${segment(targetId)}/exchanges${query}`);
|
|
14560
|
+
}
|
|
14561
|
+
/** Answer one recorded exchange as published and as the variant's design answers it. */
|
|
14562
|
+
async previewVariant(simulationId, variantId, data) {
|
|
14563
|
+
return this.client.post(`/simulations/${segment(simulationId)}/variants/${segment(variantId)}/preview`, data);
|
|
14564
|
+
}
|
|
14565
|
+
/** Discard a run variant's frozen synthesized answers so its next run synthesizes again. */
|
|
14566
|
+
async resynthesizeVariant(runId, variantId) {
|
|
14567
|
+
return this.client.post(`/simulations/runs/${segment(runId)}/variants/${segment(variantId)}/resynthesize`);
|
|
14568
|
+
}
|
|
14569
|
+
/** Mark a synthesized answer plausible or implausible; `null` clears the review. */
|
|
14570
|
+
async reviewSynthesizedAnswer(runId, exchangeId, plausible) {
|
|
14571
|
+
return this.client.post(`/simulations/runs/${segment(runId)}/exchanges/${segment(exchangeId)}/review`, { plausible });
|
|
14572
|
+
}
|
|
14573
|
+
/** Export a run's future design as a Markdown brief; exporting again returns the same brief. */
|
|
14574
|
+
async exportDesignBrief(runId) {
|
|
14575
|
+
return this.client.post(`/simulations/runs/${segment(runId)}/design-brief`);
|
|
14576
|
+
}
|
|
14577
|
+
/** A simulation's exported briefs, with each operation's adoption state and the baseline since. */
|
|
14578
|
+
async listDesignBriefs(simulationId) {
|
|
14579
|
+
return this.client.get(`/simulations/${segment(simulationId)}/design-briefs`);
|
|
14580
|
+
}
|
|
14581
|
+
/** A run's episodes with status, error, turns, tool calls and served-by; filter `status: 'failed'` to debug. */
|
|
14582
|
+
async listEpisodes(runId, params = {}) {
|
|
14583
|
+
const query = {};
|
|
14584
|
+
if (params.status !== void 0) query.status = params.status;
|
|
14585
|
+
if (params.passed !== void 0) query.passed = String(params.passed);
|
|
14586
|
+
if (params.variantId !== void 0) query.variantId = params.variantId;
|
|
14587
|
+
if (params.simulatedUserId !== void 0) query.simulatedUserId = params.simulatedUserId;
|
|
14588
|
+
if (params.taskId !== void 0) query.taskId = params.taskId;
|
|
14589
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
14590
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
14591
|
+
return this.client.get(`/simulations/runs/${segment(runId)}/episodes`, query);
|
|
14592
|
+
}
|
|
14593
|
+
/** One episode with its transcript, grader scores and per-turn layer facts: why it failed or surprised. */
|
|
14594
|
+
async getEpisode(runId, episodeId) {
|
|
14595
|
+
return this.client.get(`/simulations/runs/${segment(runId)}/episodes/${segment(episodeId)}`);
|
|
14596
|
+
}
|
|
14597
|
+
};
|
|
14598
|
+
//#endregion
|
|
14490
14599
|
//#region src/transform.ts
|
|
14491
14600
|
/**
|
|
14492
14601
|
* Transform URL query parameters
|
|
@@ -14501,7 +14610,7 @@ function transformQueryParams(params) {
|
|
|
14501
14610
|
}
|
|
14502
14611
|
//#endregion
|
|
14503
14612
|
//#region src/version.ts
|
|
14504
|
-
const SDK_VERSION = "11.0
|
|
14613
|
+
const SDK_VERSION = "11.3.0";
|
|
14505
14614
|
/**
|
|
14506
14615
|
* Canonical client identity the API uses for attribution
|
|
14507
14616
|
* (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
|
|
@@ -14553,6 +14662,7 @@ var RuntypeClient = class {
|
|
|
14553
14662
|
...config.headers || {}
|
|
14554
14663
|
};
|
|
14555
14664
|
if (config.apiKey) this.headers.Authorization = `Bearer ${config.apiKey}`;
|
|
14665
|
+
this.sandboxDeployments = new SandboxDeploymentsNamespace(() => this);
|
|
14556
14666
|
this.flows = new FlowsEndpoint(this);
|
|
14557
14667
|
this.prompts = new PromptsEndpoint(this);
|
|
14558
14668
|
this.records = new RecordsEndpoint(this);
|
|
@@ -14580,6 +14690,7 @@ var RuntypeClient = class {
|
|
|
14580
14690
|
this.flowVersions = new FlowVersionsEndpoint(this);
|
|
14581
14691
|
this.integrations = new IntegrationsEndpoint(this);
|
|
14582
14692
|
this.billing = new BillingEndpoint(this);
|
|
14693
|
+
this.simulations = new SimulationsEndpoint(this);
|
|
14583
14694
|
this.toolApprovalGrants = new ToolApprovalGrantsEndpoint(this);
|
|
14584
14695
|
}
|
|
14585
14696
|
/**
|
|
@@ -15930,6 +16041,10 @@ const STEP_FIELD_REGISTRY = {
|
|
|
15930
16041
|
format: "json",
|
|
15931
16042
|
skipDefault: "succeed"
|
|
15932
16043
|
},
|
|
16044
|
+
{
|
|
16045
|
+
key: "errorHandling",
|
|
16046
|
+
format: "value"
|
|
16047
|
+
},
|
|
15933
16048
|
{
|
|
15934
16049
|
key: "fieldsToInclude",
|
|
15935
16050
|
format: "json"
|
|
@@ -16792,10 +16907,12 @@ exports.SDK_USER_AGENT = SDK_USER_AGENT;
|
|
|
16792
16907
|
exports.SDK_VERSION = SDK_VERSION;
|
|
16793
16908
|
exports.STEP_FIELD_REGISTRY = STEP_FIELD_REGISTRY;
|
|
16794
16909
|
exports.STEP_TYPE_TO_METHOD = STEP_TYPE_TO_METHOD;
|
|
16910
|
+
exports.SandboxDeploymentsNamespace = SandboxDeploymentsNamespace;
|
|
16795
16911
|
exports.ScheduleDriftError = ScheduleDriftError;
|
|
16796
16912
|
exports.ScheduleEnsureConflictError = ScheduleEnsureConflictError;
|
|
16797
16913
|
exports.SchedulesEndpoint = SchedulesEndpoint;
|
|
16798
16914
|
exports.SecretsEndpoint = SecretsEndpoint;
|
|
16915
|
+
exports.SimulationsEndpoint = SimulationsEndpoint;
|
|
16799
16916
|
exports.SkillDriftError = SkillDriftError;
|
|
16800
16917
|
exports.SkillEnsureConflictError = SkillEnsureConflictError;
|
|
16801
16918
|
exports.SkillProposalsNamespace = SkillProposalsNamespace;
|