@runtypelabs/sdk 11.2.0 → 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 CHANGED
@@ -14517,6 +14517,85 @@ async function promoteAgent(input) {
14517
14517
  };
14518
14518
  }
14519
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
14520
14599
  //#region src/transform.ts
14521
14600
  /**
14522
14601
  * Transform URL query parameters
@@ -14531,7 +14610,7 @@ function transformQueryParams(params) {
14531
14610
  }
14532
14611
  //#endregion
14533
14612
  //#region src/version.ts
14534
- const SDK_VERSION = "11.2.0";
14613
+ const SDK_VERSION = "11.3.0";
14535
14614
  /**
14536
14615
  * Canonical client identity the API uses for attribution
14537
14616
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
@@ -14611,6 +14690,7 @@ var RuntypeClient = class {
14611
14690
  this.flowVersions = new FlowVersionsEndpoint(this);
14612
14691
  this.integrations = new IntegrationsEndpoint(this);
14613
14692
  this.billing = new BillingEndpoint(this);
14693
+ this.simulations = new SimulationsEndpoint(this);
14614
14694
  this.toolApprovalGrants = new ToolApprovalGrantsEndpoint(this);
14615
14695
  }
14616
14696
  /**
@@ -16832,6 +16912,7 @@ exports.ScheduleDriftError = ScheduleDriftError;
16832
16912
  exports.ScheduleEnsureConflictError = ScheduleEnsureConflictError;
16833
16913
  exports.SchedulesEndpoint = SchedulesEndpoint;
16834
16914
  exports.SecretsEndpoint = SecretsEndpoint;
16915
+ exports.SimulationsEndpoint = SimulationsEndpoint;
16835
16916
  exports.SkillDriftError = SkillDriftError;
16836
16917
  exports.SkillEnsureConflictError = SkillEnsureConflictError;
16837
16918
  exports.SkillProposalsNamespace = SkillProposalsNamespace;