@runtypelabs/sdk 11.2.0 → 11.3.1

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.mjs CHANGED
@@ -14516,6 +14516,85 @@ async function promoteAgent(input) {
14516
14516
  };
14517
14517
  }
14518
14518
  //#endregion
14519
+ //#region src/simulations-namespace.ts
14520
+ const segment = encodeURIComponent;
14521
+ /**
14522
+ * Simulations tool memory and future designs (`/v1/simulations`): recorded exchanges, tool profiles,
14523
+ * design previews, synthesis review, design briefs and run episodes. Pre-GA: the API answers 404 `SIMULATIONS_DISABLED`
14524
+ * where simulations are not available (production today).
14525
+ */
14526
+ var SimulationsEndpoint = class {
14527
+ constructor(client) {
14528
+ this.client = client;
14529
+ }
14530
+ /** Change a target's name, config or recording consent (`{ enabled, retentionDays }`). */
14531
+ async updateTarget(targetId, data) {
14532
+ return this.client.patch(`/simulations/targets/${segment(targetId)}`, data);
14533
+ }
14534
+ /** Save a variant's design; `validate: true` refuses it with 422 as run admission would. */
14535
+ async updateVariant(simulationId, variantId, data) {
14536
+ return this.client.patch(`/simulations/${segment(simulationId)}/variants/${segment(variantId)}`, data);
14537
+ }
14538
+ /** What Runtype learned about one tool of a target from its recorded answers. */
14539
+ async getToolProfile(targetId, tool) {
14540
+ return this.client.get(`/simulations/targets/${segment(targetId)}/tools/${segment(tool)}/profile`);
14541
+ }
14542
+ /** A target's recorded exchanges, newest first. */
14543
+ async listExchanges(targetId, params = {}) {
14544
+ const query = {};
14545
+ if (params.tool !== void 0) query.tool = params.tool;
14546
+ if (params.published !== void 0) query.published = String(params.published);
14547
+ if (params.limit !== void 0) query.limit = params.limit;
14548
+ if (params.cursor !== void 0) query.cursor = params.cursor;
14549
+ return this.client.get(`/simulations/targets/${segment(targetId)}/exchanges`, query);
14550
+ }
14551
+ /** Record calls your server answered outside a simulation, or backfill from transcripts or tool executions. */
14552
+ async uploadExchanges(targetId, data) {
14553
+ return this.client.post(`/simulations/targets/${segment(targetId)}/exchanges`, data);
14554
+ }
14555
+ /** Delete a target's recorded exchanges, or one tool's. */
14556
+ async purgeExchanges(targetId, options = {}) {
14557
+ const query = options.tool === void 0 ? "" : `?tool=${segment(options.tool)}`;
14558
+ return this.client.delete(`/simulations/targets/${segment(targetId)}/exchanges${query}`);
14559
+ }
14560
+ /** Answer one recorded exchange as published and as the variant's design answers it. */
14561
+ async previewVariant(simulationId, variantId, data) {
14562
+ return this.client.post(`/simulations/${segment(simulationId)}/variants/${segment(variantId)}/preview`, data);
14563
+ }
14564
+ /** Discard a run variant's frozen synthesized answers so its next run synthesizes again. */
14565
+ async resynthesizeVariant(runId, variantId) {
14566
+ return this.client.post(`/simulations/runs/${segment(runId)}/variants/${segment(variantId)}/resynthesize`);
14567
+ }
14568
+ /** Mark a synthesized answer plausible or implausible; `null` clears the review. */
14569
+ async reviewSynthesizedAnswer(runId, exchangeId, plausible) {
14570
+ return this.client.post(`/simulations/runs/${segment(runId)}/exchanges/${segment(exchangeId)}/review`, { plausible });
14571
+ }
14572
+ /** Export a run's future design as a Markdown brief; exporting again returns the same brief. */
14573
+ async exportDesignBrief(runId) {
14574
+ return this.client.post(`/simulations/runs/${segment(runId)}/design-brief`);
14575
+ }
14576
+ /** A simulation's exported briefs, with each operation's adoption state and the baseline since. */
14577
+ async listDesignBriefs(simulationId) {
14578
+ return this.client.get(`/simulations/${segment(simulationId)}/design-briefs`);
14579
+ }
14580
+ /** A run's episodes with status, error, turns, tool calls and served-by; filter `status: 'failed'` to debug. */
14581
+ async listEpisodes(runId, params = {}) {
14582
+ const query = {};
14583
+ if (params.status !== void 0) query.status = params.status;
14584
+ if (params.passed !== void 0) query.passed = String(params.passed);
14585
+ if (params.variantId !== void 0) query.variantId = params.variantId;
14586
+ if (params.simulatedUserId !== void 0) query.simulatedUserId = params.simulatedUserId;
14587
+ if (params.taskId !== void 0) query.taskId = params.taskId;
14588
+ if (params.limit !== void 0) query.limit = params.limit;
14589
+ if (params.cursor !== void 0) query.cursor = params.cursor;
14590
+ return this.client.get(`/simulations/runs/${segment(runId)}/episodes`, query);
14591
+ }
14592
+ /** One episode with its transcript, grader scores and per-turn layer facts: why it failed or surprised. */
14593
+ async getEpisode(runId, episodeId) {
14594
+ return this.client.get(`/simulations/runs/${segment(runId)}/episodes/${segment(episodeId)}`);
14595
+ }
14596
+ };
14597
+ //#endregion
14519
14598
  //#region src/transform.ts
14520
14599
  /**
14521
14600
  * Transform URL query parameters
@@ -14530,7 +14609,7 @@ function transformQueryParams(params) {
14530
14609
  }
14531
14610
  //#endregion
14532
14611
  //#region src/version.ts
14533
- const SDK_VERSION = "11.2.0";
14612
+ const SDK_VERSION = "11.3.1";
14534
14613
  /**
14535
14614
  * Canonical client identity the API uses for attribution
14536
14615
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
@@ -14610,6 +14689,7 @@ var RuntypeClient = class {
14610
14689
  this.flowVersions = new FlowVersionsEndpoint(this);
14611
14690
  this.integrations = new IntegrationsEndpoint(this);
14612
14691
  this.billing = new BillingEndpoint(this);
14692
+ this.simulations = new SimulationsEndpoint(this);
14613
14693
  this.toolApprovalGrants = new ToolApprovalGrantsEndpoint(this);
14614
14694
  }
14615
14695
  /**
@@ -16747,5 +16827,5 @@ const STEP_TYPE_TO_METHOD = {
16747
16827
  "memory-summary": "memorySummary"
16748
16828
  };
16749
16829
  //#endregion
16750
- 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, 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 };
16830
+ 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, 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 };
16751
16831
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "11.2.0",
3
+ "version": "11.3.1",
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,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {},
26
26
  "devDependencies": {
27
- "@runtypelabs/shared": "3.88.0",
27
+ "@runtypelabs/shared": "3.90.0",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsdown": "^0.23.0",
30
30
  "typescript": "^6.0.3",