@runtypelabs/sdk 4.17.1 → 4.19.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
@@ -97,6 +97,7 @@ __export(index_exports, {
97
97
  compileWorkflowConfig: () => compileWorkflowConfig,
98
98
  computeAgentContentHash: () => computeAgentContentHash,
99
99
  computeFlowContentHash: () => computeFlowContentHash,
100
+ computeFpoContentHash: () => computeFpoContentHash,
100
101
  computeProductContentHash: () => computeProductContentHash,
101
102
  computeSkillContentHash: () => computeSkillContentHash,
102
103
  computeSurfaceContentHash: () => computeSurfaceContentHash,
@@ -107,6 +108,7 @@ __export(index_exports, {
107
108
  defaultWorkflowConfig: () => defaultWorkflowConfig,
108
109
  defineAgent: () => defineAgent,
109
110
  defineFlow: () => defineFlow,
111
+ defineFpo: () => defineFpo,
110
112
  definePlaybook: () => definePlaybook,
111
113
  defineProduct: () => defineProduct,
112
114
  defineSkill: () => defineSkill,
@@ -114,6 +116,7 @@ __export(index_exports, {
114
116
  defineTool: () => defineTool,
115
117
  deployWorkflow: () => deployWorkflow,
116
118
  ensureDefaultWorkflowHooks: () => ensureDefaultWorkflowHooks,
119
+ ensureFpo: () => ensureFpo,
117
120
  evaluateGeneratedRuntimeToolProposal: () => evaluateGeneratedRuntimeToolProposal,
118
121
  extractDeclaredToolResultChars: () => extractDeclaredToolResultChars,
119
122
  gameWorkflow: () => gameWorkflow,
@@ -127,6 +130,7 @@ __export(index_exports, {
127
130
  listWorkflowHooks: () => listWorkflowHooks,
128
131
  normalizeAgentDefinition: () => normalizeAgentDefinition,
129
132
  normalizeCandidatePath: () => normalizeCandidatePath,
133
+ normalizeFpoDefinition: () => normalizeFpoDefinition,
130
134
  normalizeProductDefinition: () => normalizeProductDefinition,
131
135
  normalizeSkillDefinition: () => normalizeSkillDefinition,
132
136
  normalizeSurfaceDefinition: () => normalizeSurfaceDefinition,
@@ -4368,6 +4372,65 @@ async function pullProduct(client, name) {
4368
4372
  return client.get("/products/pull", { name });
4369
4373
  }
4370
4374
 
4375
+ // src/products-ensure-fpo.ts
4376
+ function isPlainObject6(value) {
4377
+ return value !== null && typeof value === "object" && !Array.isArray(value);
4378
+ }
4379
+ function normalizeValue5(value) {
4380
+ if (Array.isArray(value)) {
4381
+ return value.map((item) => normalizeValue5(item));
4382
+ }
4383
+ if (isPlainObject6(value)) {
4384
+ const normalized = {};
4385
+ for (const key of Object.keys(value).sort()) {
4386
+ const entry = value[key];
4387
+ if (entry === void 0 || entry === null) continue;
4388
+ normalized[key] = normalizeValue5(entry);
4389
+ }
4390
+ return normalized;
4391
+ }
4392
+ return value;
4393
+ }
4394
+ function normalizeFpoDefinition(fpo) {
4395
+ const productInput = isPlainObject6(fpo.product) ? fpo.product : {};
4396
+ const { name: _identityName, ...productRest } = productInput;
4397
+ const product = normalizeValue5(productRest);
4398
+ return {
4399
+ ...fpo.version !== void 0 && fpo.version !== null ? { version: normalizeValue5(fpo.version) } : {},
4400
+ product,
4401
+ capabilities: normalizeValue5(fpo.capabilities ?? []),
4402
+ tools: normalizeValue5(fpo.tools ?? []),
4403
+ surfaces: normalizeValue5(fpo.surfaces ?? []),
4404
+ ...fpo.records !== void 0 && fpo.records !== null ? { records: normalizeValue5(fpo.records) } : {},
4405
+ ...fpo.schedules !== void 0 && fpo.schedules !== null ? { schedules: normalizeValue5(fpo.schedules) } : {},
4406
+ ...fpo.secrets !== void 0 && fpo.secrets !== null ? { secrets: normalizeValue5(fpo.secrets) } : {}
4407
+ };
4408
+ }
4409
+ async function computeFpoContentHash(fpo) {
4410
+ const serialized = JSON.stringify(normalizeFpoDefinition(fpo));
4411
+ const encoded = new TextEncoder().encode(serialized);
4412
+ const hashBuffer = await crypto.subtle.digest("SHA-256", encoded);
4413
+ return Array.from(new Uint8Array(hashBuffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
4414
+ }
4415
+ function defineFpo(fpo) {
4416
+ if (!isPlainObject6(fpo)) {
4417
+ throw new Error("defineFpo requires an FPO object");
4418
+ }
4419
+ const product = isPlainObject6(fpo.product) ? fpo.product : void 0;
4420
+ if (!product || typeof product.name !== "string" || product.name.length === 0) {
4421
+ throw new Error('defineFpo requires a non-empty "product.name" (the converge identity)');
4422
+ }
4423
+ return fpo;
4424
+ }
4425
+ async function ensureFpo(client, fpo, options = {}) {
4426
+ const { dryRun, onConflict } = options;
4427
+ return client.post("/products/ensure-fpo", {
4428
+ fpo,
4429
+ ...dryRun ? { dryRun: true } : {},
4430
+ ...onConflict ? { onConflict } : {}
4431
+ });
4432
+ }
4433
+
4371
4434
  // src/products-namespace.ts
4372
4435
  var ProductsNamespace = class {
4373
4436
  constructor(getClient) {
@@ -4405,29 +4468,48 @@ var ProductsNamespace = class {
4405
4468
  async pull(name) {
4406
4469
  return pullProduct(this.getClient(), name);
4407
4470
  }
4471
+ /**
4472
+ * Idempotently converge an entire Full Product Object (the nested product
4473
+ * graph) in one shot. Ships the full FPO; the server fans out to the
4474
+ * per-entity ensure services and returns a per-entity report. NON-atomic:
4475
+ * inspect `result.hasFailures` / `entities[].result` and re-run to self-heal.
4476
+ *
4477
+ * Scope (this release): product + capability backing flows/agents + capability
4478
+ * links. Surfaces/records/schedules/secrets and capability-as-tool composition
4479
+ * are not yet converged (reported in `entities[]` as `failed`/`skipped`).
4480
+ *
4481
+ * @example
4482
+ * ```typescript
4483
+ * const result = await Runtype.products.ensureFpo(fpo)
4484
+ * if (result.hasFailures) console.warn(result.entities.filter((e) => e.result === 'failed'))
4485
+ * ```
4486
+ */
4487
+ async ensureFpo(fpo, options = {}) {
4488
+ return ensureFpo(this.getClient(), fpo, options);
4489
+ }
4408
4490
  };
4409
4491
 
4410
4492
  // src/surfaces-ensure.ts
4411
- function isPlainObject6(value) {
4493
+ function isPlainObject7(value) {
4412
4494
  return value !== null && typeof value === "object" && !Array.isArray(value);
4413
4495
  }
4414
- function normalizeValue5(value) {
4496
+ function normalizeValue6(value) {
4415
4497
  if (Array.isArray(value)) {
4416
- return value.map((item) => normalizeValue5(item));
4498
+ return value.map((item) => normalizeValue6(item));
4417
4499
  }
4418
- if (isPlainObject6(value)) {
4500
+ if (isPlainObject7(value)) {
4419
4501
  const normalized = {};
4420
4502
  for (const key of Object.keys(value).sort()) {
4421
4503
  const entry = value[key];
4422
4504
  if (entry === void 0 || entry === null) continue;
4423
- normalized[key] = normalizeValue5(entry);
4505
+ normalized[key] = normalizeValue6(entry);
4424
4506
  }
4425
4507
  return normalized;
4426
4508
  }
4427
4509
  return value;
4428
4510
  }
4429
4511
  function normalizeSurfaceDefinition(definition) {
4430
- const behavior = isPlainObject6(definition.behavior) ? normalizeValue5(definition.behavior) : { type: definition.type };
4512
+ const behavior = isPlainObject7(definition.behavior) ? normalizeValue6(definition.behavior) : { type: definition.type };
4431
4513
  return {
4432
4514
  type: definition.type,
4433
4515
  behavior,
@@ -4480,13 +4562,13 @@ function defineSurface(input) {
4480
4562
  `defineSurface requires "type" to be one of: ${[...SURFACE_DEFINITION_TYPES].join(", ")}`
4481
4563
  );
4482
4564
  }
4483
- if (input.behavior !== void 0 && !isPlainObject6(input.behavior)) {
4565
+ if (input.behavior !== void 0 && !isPlainObject7(input.behavior)) {
4484
4566
  throw new Error('defineSurface "behavior" must be an object when provided');
4485
4567
  }
4486
- if (input.inbound !== void 0 && !isPlainObject6(input.inbound)) {
4568
+ if (input.inbound !== void 0 && !isPlainObject7(input.inbound)) {
4487
4569
  throw new Error('defineSurface "inbound" must be an object when provided');
4488
4570
  }
4489
- if (input.outbound !== void 0 && !isPlainObject6(input.outbound)) {
4571
+ if (input.outbound !== void 0 && !isPlainObject7(input.outbound)) {
4490
4572
  throw new Error('defineSurface "outbound" must be an object when provided');
4491
4573
  }
4492
4574
  if (input.status !== void 0 && !["draft", "active", "paused"].includes(input.status)) {
@@ -4542,7 +4624,7 @@ function parseRequestError6(err) {
4542
4624
  }
4543
4625
  function toConflictError6(err) {
4544
4626
  const { status, body } = parseRequestError6(err);
4545
- if (status !== 409 || !isPlainObject6(body)) return null;
4627
+ if (status !== 409 || !isPlainObject7(body)) return null;
4546
4628
  const code = body.code;
4547
4629
  if (code !== "external_modification" && code !== "remote_changed") return null;
4548
4630
  return new SurfaceEnsureConflictError(
@@ -9908,6 +9990,8 @@ var _AgentsEndpoint = class _AgentsEndpoint {
9908
9990
  messages,
9909
9991
  debugMode: options.debugMode,
9910
9992
  model: options.model,
9993
+ ...options.temperature !== void 0 ? { temperature: options.temperature } : {},
9994
+ ...options.maxTokens !== void 0 ? { maxTokens: options.maxTokens } : {},
9911
9995
  ...options.reasoning !== void 0 ? { reasoning: options.reasoning } : {},
9912
9996
  ...options.toolIds?.length ? { tools: { toolIds: options.toolIds } } : {},
9913
9997
  ...requestContextManagement ? { contextManagement: requestContextManagement } : {}
@@ -12827,6 +12911,7 @@ var STEP_TYPE_TO_METHOD = {
12827
12911
  compileWorkflowConfig,
12828
12912
  computeAgentContentHash,
12829
12913
  computeFlowContentHash,
12914
+ computeFpoContentHash,
12830
12915
  computeProductContentHash,
12831
12916
  computeSkillContentHash,
12832
12917
  computeSurfaceContentHash,
@@ -12837,6 +12922,7 @@ var STEP_TYPE_TO_METHOD = {
12837
12922
  defaultWorkflowConfig,
12838
12923
  defineAgent,
12839
12924
  defineFlow,
12925
+ defineFpo,
12840
12926
  definePlaybook,
12841
12927
  defineProduct,
12842
12928
  defineSkill,
@@ -12844,6 +12930,7 @@ var STEP_TYPE_TO_METHOD = {
12844
12930
  defineTool,
12845
12931
  deployWorkflow,
12846
12932
  ensureDefaultWorkflowHooks,
12933
+ ensureFpo,
12847
12934
  evaluateGeneratedRuntimeToolProposal,
12848
12935
  extractDeclaredToolResultChars,
12849
12936
  gameWorkflow,
@@ -12857,6 +12944,7 @@ var STEP_TYPE_TO_METHOD = {
12857
12944
  listWorkflowHooks,
12858
12945
  normalizeAgentDefinition,
12859
12946
  normalizeCandidatePath,
12947
+ normalizeFpoDefinition,
12860
12948
  normalizeProductDefinition,
12861
12949
  normalizeSkillDefinition,
12862
12950
  normalizeSurfaceDefinition,
package/dist/index.d.cts CHANGED
@@ -20053,6 +20053,115 @@ interface paths {
20053
20053
  patch?: never;
20054
20054
  trace?: never;
20055
20055
  };
20056
+ "/v1/products/ensure-fpo": {
20057
+ parameters: {
20058
+ query?: never;
20059
+ header?: never;
20060
+ path?: never;
20061
+ cookie?: never;
20062
+ };
20063
+ get?: never;
20064
+ put?: never;
20065
+ /**
20066
+ * Ensure full product (config-as-code converge of the whole FPO)
20067
+ * @description Idempotently converge an entire Full Product Object (the nested product graph) in one shot. Fans out to the per-entity ensure services in dependency order (product → capability backing flows/agents → capability-as-tool composition → capability links → surfaces + surface items → records → schedules → secret bindings), returning a per-entity report. Identity is the product name + account scope. NON-atomic by design: a per-entity failure is reported in `entities[].result = "failed"` (and `hasFailures`) and a re-run self-heals; only a top-level product reject aborts. Set dryRun to plan without writing. Whole-FPO fast-probe, pull-fpo, and prune are not yet supported (PR3).
20068
+ */
20069
+ post: {
20070
+ parameters: {
20071
+ query?: never;
20072
+ header?: never;
20073
+ path?: never;
20074
+ cookie?: never;
20075
+ };
20076
+ requestBody?: {
20077
+ content: {
20078
+ "application/json": {
20079
+ /** @description Plan without writing — returns a per-entity plan (CI drift gate). */
20080
+ dryRun?: boolean;
20081
+ /** @description A complete Full Product Object (FPO): the nested product graph (product, capabilities, tools, surfaces, ...). Validated server-side via the shared FPO validator. */
20082
+ fpo: {
20083
+ [key: string]: unknown;
20084
+ };
20085
+ /**
20086
+ * @description Per nested entity: "overwrite" converges over dashboard/API edits.
20087
+ * @enum {string}
20088
+ */
20089
+ onConflict?: "error" | "overwrite";
20090
+ };
20091
+ };
20092
+ };
20093
+ responses: {
20094
+ /** @description Converge result: unchanged | converged | plan (dryRun), with a per-entity report. */
20095
+ 200: {
20096
+ headers: {
20097
+ [name: string]: unknown;
20098
+ };
20099
+ content: {
20100
+ "application/json": components["schemas"]["ProductFpoEnsureResponse"];
20101
+ };
20102
+ };
20103
+ /** @description FPO validation error */
20104
+ 400: {
20105
+ headers: {
20106
+ [name: string]: unknown;
20107
+ };
20108
+ content: {
20109
+ "application/json": components["schemas"]["Error"];
20110
+ };
20111
+ };
20112
+ /** @description Unauthorized */
20113
+ 401: {
20114
+ headers: {
20115
+ [name: string]: unknown;
20116
+ };
20117
+ content: {
20118
+ "application/json": components["schemas"]["Error"];
20119
+ };
20120
+ };
20121
+ /** @description Insufficient permissions */
20122
+ 403: {
20123
+ headers: {
20124
+ [name: string]: unknown;
20125
+ };
20126
+ content: {
20127
+ "application/json": components["schemas"]["Error"];
20128
+ };
20129
+ };
20130
+ /** @description Conflict converging the top-level product: external_modification or remote_changed. */
20131
+ 409: {
20132
+ headers: {
20133
+ [name: string]: unknown;
20134
+ };
20135
+ content: {
20136
+ "application/json": components["schemas"]["ProductEnsureConflict"];
20137
+ };
20138
+ };
20139
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
20140
+ 422: {
20141
+ headers: {
20142
+ [name: string]: unknown;
20143
+ };
20144
+ content: {
20145
+ "application/json": components["schemas"]["ProductEnsureHashMismatch"];
20146
+ };
20147
+ };
20148
+ /** @description Internal server error */
20149
+ 500: {
20150
+ headers: {
20151
+ [name: string]: unknown;
20152
+ };
20153
+ content: {
20154
+ "application/json": components["schemas"]["Error"];
20155
+ };
20156
+ };
20157
+ };
20158
+ };
20159
+ delete?: never;
20160
+ options?: never;
20161
+ head?: never;
20162
+ patch?: never;
20163
+ trace?: never;
20164
+ };
20056
20165
  "/v1/products/generation/sessions": {
20057
20166
  parameters: {
20058
20167
  query?: never;
@@ -37149,6 +37258,30 @@ interface components {
37149
37258
  /** @enum {string} */
37150
37259
  result: "plan";
37151
37260
  };
37261
+ ProductFpoEnsureResponse: {
37262
+ /** @description Server-computed canonical whole-FPO content hash. */
37263
+ contentHash: string;
37264
+ entities: {
37265
+ error?: string;
37266
+ /** @description Resulting platform id (absent on failure/skip). */
37267
+ id?: string;
37268
+ /** @enum {string} */
37269
+ kind: "product" | "flow" | "agent" | "capability" | "tool" | "surface" | "record" | "schedule";
37270
+ name: string;
37271
+ /** @description The FPO-local ref (capability id / entity name) for correlation. */
37272
+ ref: string;
37273
+ /** @enum {string} */
37274
+ result: "created" | "updated" | "unchanged" | "failed" | "skipped";
37275
+ }[];
37276
+ /** @description True when one or more entities failed to converge (re-run to self-heal). */
37277
+ hasFailures: boolean;
37278
+ productId?: string;
37279
+ /**
37280
+ * @description `unchanged` when every entity was unchanged, `converged` when at least one was created/updated, `plan` for dryRun.
37281
+ * @enum {string}
37282
+ */
37283
+ result: "unchanged" | "converged" | "plan";
37284
+ };
37152
37285
  ProductPullResponse: {
37153
37286
  contentHash: string;
37154
37287
  definition: {
@@ -41974,6 +42107,71 @@ declare class ProductDriftError extends Error {
41974
42107
  constructor(plan: EnsureProductPlan);
41975
42108
  }
41976
42109
 
42110
+ /**
42111
+ * SDK config-as-code converge for an entire Full Product Object (FPO).
42112
+ *
42113
+ * `products.ensureFpo` converges the whole nested product graph in one request
42114
+ * by POSTing the FPO to `POST /v1/products/ensure-fpo`, where the server fans
42115
+ * out to the per-entity ensure services. Unlike `products.ensure` (top-level
42116
+ * record only), there is no hash-only probe in this release: the full FPO is
42117
+ * always shipped and the server returns the canonical whole-FPO hash + a
42118
+ * per-entity report. (The hash-only fast-probe lands once the server persists a
42119
+ * per-product FPO hash — see the plan's PR3.)
42120
+ *
42121
+ * `computeFpoContentHash` is inlined here (the SDK avoids a `@runtypelabs/shared`
42122
+ * dependency) and pinned byte-for-byte against the canonical implementation by
42123
+ * the shared fixture corpus (`packages/shared/test-fixtures/fpo-content-hash/`)
42124
+ * asserted from BOTH packages. A normalization change in
42125
+ * `packages/shared/src/utils/fpo-content-hash.ts` MUST be mirrored here in the
42126
+ * same PR.
42127
+ */
42128
+
42129
+ /** An FPO for hashing/sending. Permissive — the server validates the rich contract. */
42130
+ type FpoInput = Record<string, unknown>;
42131
+ /**
42132
+ * Canonical normalized form of an FPO: `_meta` and the top-level `product.name`
42133
+ * are excluded (generation provenance / identity), the whole graph is recursively
42134
+ * normalized, array order preserved. Mirrors `normalizeFpoDefinition` in shared.
42135
+ */
42136
+ declare function normalizeFpoDefinition(fpo: FpoInput): Record<string, unknown>;
42137
+ /** SHA-256 (hex) over the canonical normalized FPO. */
42138
+ declare function computeFpoContentHash(fpo: FpoInput): Promise<string>;
42139
+ /**
42140
+ * Light identity helper. Returns the FPO unchanged after asserting it carries a
42141
+ * `product.name` (the converge identity). The rich FPO contract is validated
42142
+ * server-side; `defineFpo` only guards the field the SDK needs.
42143
+ */
42144
+ declare function defineFpo(fpo: FpoInput): FpoInput;
42145
+ interface EnsureFpoOptions {
42146
+ /** Plan without writing — returns a per-entity plan (CI drift gate). */
42147
+ dryRun?: boolean;
42148
+ /** Per nested entity: "overwrite" converges over dashboard/API edits. */
42149
+ onConflict?: 'error' | 'overwrite';
42150
+ }
42151
+ /** One nested entity's converge result. */
42152
+ interface FpoEntityOutcome {
42153
+ kind: 'product' | 'flow' | 'agent' | 'capability' | 'tool' | 'surface' | 'record' | 'schedule';
42154
+ ref: string;
42155
+ name: string;
42156
+ result: 'created' | 'updated' | 'unchanged' | 'failed' | 'skipped';
42157
+ id?: string;
42158
+ error?: string;
42159
+ }
42160
+ interface EnsureFpoResult {
42161
+ result: 'unchanged' | 'converged' | 'plan';
42162
+ productId?: string;
42163
+ contentHash: string;
42164
+ entities: FpoEntityOutcome[];
42165
+ hasFailures: boolean;
42166
+ }
42167
+ /**
42168
+ * Converge an entire FPO onto the platform. Ships the full FPO (no hash-only
42169
+ * probe in this release); the server fans out to the per-entity ensure services
42170
+ * and returns the whole-FPO hash + per-entity report. Non-atomic: inspect
42171
+ * `result.hasFailures` / `entities[].result` and re-run to self-heal.
42172
+ */
42173
+ declare function ensureFpo(client: RuntypeClient$1, fpo: FpoInput, options?: EnsureFpoOptions): Promise<EnsureFpoResult>;
42174
+
41977
42175
  /**
41978
42176
  * ProductsNamespace — config-as-code operations for products.
41979
42177
  *
@@ -42017,6 +42215,23 @@ declare class ProductsNamespace {
42017
42215
  * absorb-drift direction of the ensure protocol.
42018
42216
  */
42019
42217
  pull(name: string): Promise<ProductPullResult>;
42218
+ /**
42219
+ * Idempotently converge an entire Full Product Object (the nested product
42220
+ * graph) in one shot. Ships the full FPO; the server fans out to the
42221
+ * per-entity ensure services and returns a per-entity report. NON-atomic:
42222
+ * inspect `result.hasFailures` / `entities[].result` and re-run to self-heal.
42223
+ *
42224
+ * Scope (this release): product + capability backing flows/agents + capability
42225
+ * links. Surfaces/records/schedules/secrets and capability-as-tool composition
42226
+ * are not yet converged (reported in `entities[]` as `failed`/`skipped`).
42227
+ *
42228
+ * @example
42229
+ * ```typescript
42230
+ * const result = await Runtype.products.ensureFpo(fpo)
42231
+ * if (result.hasFailures) console.warn(result.entities.filter((e) => e.result === 'failed'))
42232
+ * ```
42233
+ */
42234
+ ensureFpo(fpo: FpoInput, options?: EnsureFpoOptions): Promise<EnsureFpoResult>;
42020
42235
  }
42021
42236
 
42022
42237
  /**
@@ -44147,6 +44362,10 @@ interface AgentExecuteRequest {
44147
44362
  debugMode?: boolean;
44148
44363
  /** Model ID to use for this session (overrides agent config) */
44149
44364
  model?: string;
44365
+ /** Sampling temperature override (0-2) for this request only (overrides agent config) */
44366
+ temperature?: number;
44367
+ /** Max output-token budget override for this request only (overrides agent config) */
44368
+ maxTokens?: number;
44150
44369
  /**
44151
44370
  * System-prompt override for this request only (overrides the saved agent
44152
44371
  * config; never persisted). For agents whose system prompt is rebuilt every
@@ -44507,6 +44726,10 @@ interface RunTaskOptions {
44507
44726
  localTools?: Record<string, LocalToolDefinition>;
44508
44727
  /** Model ID to use (overrides agent's configured model) */
44509
44728
  model?: string;
44729
+ /** Sampling temperature override (0-2) applied to each session (overrides agent config) */
44730
+ temperature?: number;
44731
+ /** Max output-token budget applied to each session (overrides agent config) */
44732
+ maxTokens?: number;
44510
44733
  /** Enable reasoning/thinking for models that support it (e.g. Gemini 3, o-series) */
44511
44734
  reasoning?: boolean;
44512
44735
  /** Previous messages from a prior run (for continuation/resume) */
@@ -46864,8 +47087,19 @@ interface WorkflowMilestoneConfig {
46864
47087
  forceEndTurn?: WorkflowSlot<'forceEndTurn'>;
46865
47088
  /** Per-milestone model override (consumed by the runner, not the compiler) */
46866
47089
  model?: string;
47090
+ /** Per-milestone sampling-temperature override (consumed by the runner, not the compiler) */
47091
+ temperature?: number;
47092
+ /** Per-milestone max output-token override (consumed by the runner, not the compiler) */
47093
+ maxTokens?: number;
46867
47094
  /** Per-milestone fallback models (consumed by the runner, not the compiler) */
46868
47095
  fallbackModels?: unknown[];
47096
+ /**
47097
+ * When true, this milestone's fallback chain also fires on empty output (a
47098
+ * model that finishes successfully but returns no visible text), not just on
47099
+ * error. Opt-in; needs `fallbackModels` so there's something to fall back to.
47100
+ * Consumed by the runner, not the compiler.
47101
+ */
47102
+ fallbackOnEmpty?: boolean;
46869
47103
  }
46870
47104
  interface WorkflowConfig {
46871
47105
  name: string;
@@ -47041,4 +47275,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
47041
47275
  declare function getDefaultPlanPath(taskName: string): string;
47042
47276
  declare function sanitizeTaskSlug(taskName: string): string;
47043
47277
 
47044
- export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AssetReferenceContentPart, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalGetResult, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DefineProductInput, type DefineSkillInput, type DefineSurfaceInput, type DefineToolInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type EnsureProductConverged, type EnsureProductOptions, type EnsureProductPlan, type EnsureProductResult, type EnsureSkillConverged, type EnsureSkillOptions, type EnsureSkillPlan, type EnsureSkillResult, type EnsureSurfaceConverged, type EnsureSurfaceOptions, type EnsureSurfacePlan, type EnsureSurfaceResult, type EnsureToolConverged, type EnsureToolOptions, type EnsureToolPlan, type EnsureToolResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type ProductDefinition, ProductDriftError, ProductEnsureConflictError, type ProductPullResult, ProductsNamespace, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordCostAggregation, type RecordCostModelBreakdown, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, type RecordStepResult, type RecordStepResultsParams, type RecordStepResultsResponse, type RecordWriteResponse, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOffloadRecorder, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillScanFinding as RuntypeSkillScanFinding, type SkillScanResult as RuntypeSkillScanResult, type SkillScanVerdict as RuntypeSkillScanVerdict, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillDefinition, SkillDriftError, SkillEnsureConflictError, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillPullResult, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceDefinition, type SurfaceDefinitionEnvironment, type SurfaceDefinitionStatus, type SurfaceDefinitionType, SurfaceDriftError, SurfaceEnsureConflictError, type SurfaceListParams, type SurfacePullResult, SurfacesEndpoint, SurfacesNamespace, type TextContentPart, type Tool, type ToolApprovalGrant, ToolApprovalGrantsEndpoint, type ToolConfig, type ToolDefinition, type ToolDefinitionType, ToolDriftError, ToolEnsureConflictError, type ToolPullResult, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, ToolsNamespace, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, computeProductContentHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, definePlaybook, defineProduct, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, normalizeProductDefinition, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };
47278
+ export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AssetReferenceContentPart, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalGetResult, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DefineProductInput, type DefineSkillInput, type DefineSurfaceInput, type DefineToolInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type EnsureFpoOptions, type EnsureFpoResult, type EnsureProductConverged, type EnsureProductOptions, type EnsureProductPlan, type EnsureProductResult, type EnsureSkillConverged, type EnsureSkillOptions, type EnsureSkillPlan, type EnsureSkillResult, type EnsureSurfaceConverged, type EnsureSurfaceOptions, type EnsureSurfacePlan, type EnsureSurfaceResult, type EnsureToolConverged, type EnsureToolOptions, type EnsureToolPlan, type EnsureToolResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type FpoEntityOutcome, type FpoInput, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type ProductDefinition, ProductDriftError, ProductEnsureConflictError, type ProductPullResult, ProductsNamespace, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordCostAggregation, type RecordCostModelBreakdown, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, type RecordStepResult, type RecordStepResultsParams, type RecordStepResultsResponse, type RecordWriteResponse, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOffloadRecorder, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillScanFinding as RuntypeSkillScanFinding, type SkillScanResult as RuntypeSkillScanResult, type SkillScanVerdict as RuntypeSkillScanVerdict, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillDefinition, SkillDriftError, SkillEnsureConflictError, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillPullResult, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceDefinition, type SurfaceDefinitionEnvironment, type SurfaceDefinitionStatus, type SurfaceDefinitionType, SurfaceDriftError, SurfaceEnsureConflictError, type SurfaceListParams, type SurfacePullResult, SurfacesEndpoint, SurfacesNamespace, type TextContentPart, type Tool, type ToolApprovalGrant, ToolApprovalGrantsEndpoint, type ToolConfig, type ToolDefinition, type ToolDefinitionType, ToolDriftError, ToolEnsureConflictError, type ToolPullResult, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, ToolsNamespace, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, computeFpoContentHash, computeProductContentHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, defineFpo, definePlaybook, defineProduct, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, ensureFpo, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, normalizeFpoDefinition, normalizeProductDefinition, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };
package/dist/index.d.ts CHANGED
@@ -20053,6 +20053,115 @@ interface paths {
20053
20053
  patch?: never;
20054
20054
  trace?: never;
20055
20055
  };
20056
+ "/v1/products/ensure-fpo": {
20057
+ parameters: {
20058
+ query?: never;
20059
+ header?: never;
20060
+ path?: never;
20061
+ cookie?: never;
20062
+ };
20063
+ get?: never;
20064
+ put?: never;
20065
+ /**
20066
+ * Ensure full product (config-as-code converge of the whole FPO)
20067
+ * @description Idempotently converge an entire Full Product Object (the nested product graph) in one shot. Fans out to the per-entity ensure services in dependency order (product → capability backing flows/agents → capability-as-tool composition → capability links → surfaces + surface items → records → schedules → secret bindings), returning a per-entity report. Identity is the product name + account scope. NON-atomic by design: a per-entity failure is reported in `entities[].result = "failed"` (and `hasFailures`) and a re-run self-heals; only a top-level product reject aborts. Set dryRun to plan without writing. Whole-FPO fast-probe, pull-fpo, and prune are not yet supported (PR3).
20068
+ */
20069
+ post: {
20070
+ parameters: {
20071
+ query?: never;
20072
+ header?: never;
20073
+ path?: never;
20074
+ cookie?: never;
20075
+ };
20076
+ requestBody?: {
20077
+ content: {
20078
+ "application/json": {
20079
+ /** @description Plan without writing — returns a per-entity plan (CI drift gate). */
20080
+ dryRun?: boolean;
20081
+ /** @description A complete Full Product Object (FPO): the nested product graph (product, capabilities, tools, surfaces, ...). Validated server-side via the shared FPO validator. */
20082
+ fpo: {
20083
+ [key: string]: unknown;
20084
+ };
20085
+ /**
20086
+ * @description Per nested entity: "overwrite" converges over dashboard/API edits.
20087
+ * @enum {string}
20088
+ */
20089
+ onConflict?: "error" | "overwrite";
20090
+ };
20091
+ };
20092
+ };
20093
+ responses: {
20094
+ /** @description Converge result: unchanged | converged | plan (dryRun), with a per-entity report. */
20095
+ 200: {
20096
+ headers: {
20097
+ [name: string]: unknown;
20098
+ };
20099
+ content: {
20100
+ "application/json": components["schemas"]["ProductFpoEnsureResponse"];
20101
+ };
20102
+ };
20103
+ /** @description FPO validation error */
20104
+ 400: {
20105
+ headers: {
20106
+ [name: string]: unknown;
20107
+ };
20108
+ content: {
20109
+ "application/json": components["schemas"]["Error"];
20110
+ };
20111
+ };
20112
+ /** @description Unauthorized */
20113
+ 401: {
20114
+ headers: {
20115
+ [name: string]: unknown;
20116
+ };
20117
+ content: {
20118
+ "application/json": components["schemas"]["Error"];
20119
+ };
20120
+ };
20121
+ /** @description Insufficient permissions */
20122
+ 403: {
20123
+ headers: {
20124
+ [name: string]: unknown;
20125
+ };
20126
+ content: {
20127
+ "application/json": components["schemas"]["Error"];
20128
+ };
20129
+ };
20130
+ /** @description Conflict converging the top-level product: external_modification or remote_changed. */
20131
+ 409: {
20132
+ headers: {
20133
+ [name: string]: unknown;
20134
+ };
20135
+ content: {
20136
+ "application/json": components["schemas"]["ProductEnsureConflict"];
20137
+ };
20138
+ };
20139
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
20140
+ 422: {
20141
+ headers: {
20142
+ [name: string]: unknown;
20143
+ };
20144
+ content: {
20145
+ "application/json": components["schemas"]["ProductEnsureHashMismatch"];
20146
+ };
20147
+ };
20148
+ /** @description Internal server error */
20149
+ 500: {
20150
+ headers: {
20151
+ [name: string]: unknown;
20152
+ };
20153
+ content: {
20154
+ "application/json": components["schemas"]["Error"];
20155
+ };
20156
+ };
20157
+ };
20158
+ };
20159
+ delete?: never;
20160
+ options?: never;
20161
+ head?: never;
20162
+ patch?: never;
20163
+ trace?: never;
20164
+ };
20056
20165
  "/v1/products/generation/sessions": {
20057
20166
  parameters: {
20058
20167
  query?: never;
@@ -37149,6 +37258,30 @@ interface components {
37149
37258
  /** @enum {string} */
37150
37259
  result: "plan";
37151
37260
  };
37261
+ ProductFpoEnsureResponse: {
37262
+ /** @description Server-computed canonical whole-FPO content hash. */
37263
+ contentHash: string;
37264
+ entities: {
37265
+ error?: string;
37266
+ /** @description Resulting platform id (absent on failure/skip). */
37267
+ id?: string;
37268
+ /** @enum {string} */
37269
+ kind: "product" | "flow" | "agent" | "capability" | "tool" | "surface" | "record" | "schedule";
37270
+ name: string;
37271
+ /** @description The FPO-local ref (capability id / entity name) for correlation. */
37272
+ ref: string;
37273
+ /** @enum {string} */
37274
+ result: "created" | "updated" | "unchanged" | "failed" | "skipped";
37275
+ }[];
37276
+ /** @description True when one or more entities failed to converge (re-run to self-heal). */
37277
+ hasFailures: boolean;
37278
+ productId?: string;
37279
+ /**
37280
+ * @description `unchanged` when every entity was unchanged, `converged` when at least one was created/updated, `plan` for dryRun.
37281
+ * @enum {string}
37282
+ */
37283
+ result: "unchanged" | "converged" | "plan";
37284
+ };
37152
37285
  ProductPullResponse: {
37153
37286
  contentHash: string;
37154
37287
  definition: {
@@ -41974,6 +42107,71 @@ declare class ProductDriftError extends Error {
41974
42107
  constructor(plan: EnsureProductPlan);
41975
42108
  }
41976
42109
 
42110
+ /**
42111
+ * SDK config-as-code converge for an entire Full Product Object (FPO).
42112
+ *
42113
+ * `products.ensureFpo` converges the whole nested product graph in one request
42114
+ * by POSTing the FPO to `POST /v1/products/ensure-fpo`, where the server fans
42115
+ * out to the per-entity ensure services. Unlike `products.ensure` (top-level
42116
+ * record only), there is no hash-only probe in this release: the full FPO is
42117
+ * always shipped and the server returns the canonical whole-FPO hash + a
42118
+ * per-entity report. (The hash-only fast-probe lands once the server persists a
42119
+ * per-product FPO hash — see the plan's PR3.)
42120
+ *
42121
+ * `computeFpoContentHash` is inlined here (the SDK avoids a `@runtypelabs/shared`
42122
+ * dependency) and pinned byte-for-byte against the canonical implementation by
42123
+ * the shared fixture corpus (`packages/shared/test-fixtures/fpo-content-hash/`)
42124
+ * asserted from BOTH packages. A normalization change in
42125
+ * `packages/shared/src/utils/fpo-content-hash.ts` MUST be mirrored here in the
42126
+ * same PR.
42127
+ */
42128
+
42129
+ /** An FPO for hashing/sending. Permissive — the server validates the rich contract. */
42130
+ type FpoInput = Record<string, unknown>;
42131
+ /**
42132
+ * Canonical normalized form of an FPO: `_meta` and the top-level `product.name`
42133
+ * are excluded (generation provenance / identity), the whole graph is recursively
42134
+ * normalized, array order preserved. Mirrors `normalizeFpoDefinition` in shared.
42135
+ */
42136
+ declare function normalizeFpoDefinition(fpo: FpoInput): Record<string, unknown>;
42137
+ /** SHA-256 (hex) over the canonical normalized FPO. */
42138
+ declare function computeFpoContentHash(fpo: FpoInput): Promise<string>;
42139
+ /**
42140
+ * Light identity helper. Returns the FPO unchanged after asserting it carries a
42141
+ * `product.name` (the converge identity). The rich FPO contract is validated
42142
+ * server-side; `defineFpo` only guards the field the SDK needs.
42143
+ */
42144
+ declare function defineFpo(fpo: FpoInput): FpoInput;
42145
+ interface EnsureFpoOptions {
42146
+ /** Plan without writing — returns a per-entity plan (CI drift gate). */
42147
+ dryRun?: boolean;
42148
+ /** Per nested entity: "overwrite" converges over dashboard/API edits. */
42149
+ onConflict?: 'error' | 'overwrite';
42150
+ }
42151
+ /** One nested entity's converge result. */
42152
+ interface FpoEntityOutcome {
42153
+ kind: 'product' | 'flow' | 'agent' | 'capability' | 'tool' | 'surface' | 'record' | 'schedule';
42154
+ ref: string;
42155
+ name: string;
42156
+ result: 'created' | 'updated' | 'unchanged' | 'failed' | 'skipped';
42157
+ id?: string;
42158
+ error?: string;
42159
+ }
42160
+ interface EnsureFpoResult {
42161
+ result: 'unchanged' | 'converged' | 'plan';
42162
+ productId?: string;
42163
+ contentHash: string;
42164
+ entities: FpoEntityOutcome[];
42165
+ hasFailures: boolean;
42166
+ }
42167
+ /**
42168
+ * Converge an entire FPO onto the platform. Ships the full FPO (no hash-only
42169
+ * probe in this release); the server fans out to the per-entity ensure services
42170
+ * and returns the whole-FPO hash + per-entity report. Non-atomic: inspect
42171
+ * `result.hasFailures` / `entities[].result` and re-run to self-heal.
42172
+ */
42173
+ declare function ensureFpo(client: RuntypeClient$1, fpo: FpoInput, options?: EnsureFpoOptions): Promise<EnsureFpoResult>;
42174
+
41977
42175
  /**
41978
42176
  * ProductsNamespace — config-as-code operations for products.
41979
42177
  *
@@ -42017,6 +42215,23 @@ declare class ProductsNamespace {
42017
42215
  * absorb-drift direction of the ensure protocol.
42018
42216
  */
42019
42217
  pull(name: string): Promise<ProductPullResult>;
42218
+ /**
42219
+ * Idempotently converge an entire Full Product Object (the nested product
42220
+ * graph) in one shot. Ships the full FPO; the server fans out to the
42221
+ * per-entity ensure services and returns a per-entity report. NON-atomic:
42222
+ * inspect `result.hasFailures` / `entities[].result` and re-run to self-heal.
42223
+ *
42224
+ * Scope (this release): product + capability backing flows/agents + capability
42225
+ * links. Surfaces/records/schedules/secrets and capability-as-tool composition
42226
+ * are not yet converged (reported in `entities[]` as `failed`/`skipped`).
42227
+ *
42228
+ * @example
42229
+ * ```typescript
42230
+ * const result = await Runtype.products.ensureFpo(fpo)
42231
+ * if (result.hasFailures) console.warn(result.entities.filter((e) => e.result === 'failed'))
42232
+ * ```
42233
+ */
42234
+ ensureFpo(fpo: FpoInput, options?: EnsureFpoOptions): Promise<EnsureFpoResult>;
42020
42235
  }
42021
42236
 
42022
42237
  /**
@@ -44147,6 +44362,10 @@ interface AgentExecuteRequest {
44147
44362
  debugMode?: boolean;
44148
44363
  /** Model ID to use for this session (overrides agent config) */
44149
44364
  model?: string;
44365
+ /** Sampling temperature override (0-2) for this request only (overrides agent config) */
44366
+ temperature?: number;
44367
+ /** Max output-token budget override for this request only (overrides agent config) */
44368
+ maxTokens?: number;
44150
44369
  /**
44151
44370
  * System-prompt override for this request only (overrides the saved agent
44152
44371
  * config; never persisted). For agents whose system prompt is rebuilt every
@@ -44507,6 +44726,10 @@ interface RunTaskOptions {
44507
44726
  localTools?: Record<string, LocalToolDefinition>;
44508
44727
  /** Model ID to use (overrides agent's configured model) */
44509
44728
  model?: string;
44729
+ /** Sampling temperature override (0-2) applied to each session (overrides agent config) */
44730
+ temperature?: number;
44731
+ /** Max output-token budget applied to each session (overrides agent config) */
44732
+ maxTokens?: number;
44510
44733
  /** Enable reasoning/thinking for models that support it (e.g. Gemini 3, o-series) */
44511
44734
  reasoning?: boolean;
44512
44735
  /** Previous messages from a prior run (for continuation/resume) */
@@ -46864,8 +47087,19 @@ interface WorkflowMilestoneConfig {
46864
47087
  forceEndTurn?: WorkflowSlot<'forceEndTurn'>;
46865
47088
  /** Per-milestone model override (consumed by the runner, not the compiler) */
46866
47089
  model?: string;
47090
+ /** Per-milestone sampling-temperature override (consumed by the runner, not the compiler) */
47091
+ temperature?: number;
47092
+ /** Per-milestone max output-token override (consumed by the runner, not the compiler) */
47093
+ maxTokens?: number;
46867
47094
  /** Per-milestone fallback models (consumed by the runner, not the compiler) */
46868
47095
  fallbackModels?: unknown[];
47096
+ /**
47097
+ * When true, this milestone's fallback chain also fires on empty output (a
47098
+ * model that finishes successfully but returns no visible text), not just on
47099
+ * error. Opt-in; needs `fallbackModels` so there's something to fall back to.
47100
+ * Consumed by the runner, not the compiler.
47101
+ */
47102
+ fallbackOnEmpty?: boolean;
46869
47103
  }
46870
47104
  interface WorkflowConfig {
46871
47105
  name: string;
@@ -47041,4 +47275,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
47041
47275
  declare function getDefaultPlanPath(taskName: string): string;
47042
47276
  declare function sanitizeTaskSlug(taskName: string): string;
47043
47277
 
47044
- export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AssetReferenceContentPart, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalGetResult, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DefineProductInput, type DefineSkillInput, type DefineSurfaceInput, type DefineToolInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type EnsureProductConverged, type EnsureProductOptions, type EnsureProductPlan, type EnsureProductResult, type EnsureSkillConverged, type EnsureSkillOptions, type EnsureSkillPlan, type EnsureSkillResult, type EnsureSurfaceConverged, type EnsureSurfaceOptions, type EnsureSurfacePlan, type EnsureSurfaceResult, type EnsureToolConverged, type EnsureToolOptions, type EnsureToolPlan, type EnsureToolResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type ProductDefinition, ProductDriftError, ProductEnsureConflictError, type ProductPullResult, ProductsNamespace, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordCostAggregation, type RecordCostModelBreakdown, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, type RecordStepResult, type RecordStepResultsParams, type RecordStepResultsResponse, type RecordWriteResponse, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOffloadRecorder, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillScanFinding as RuntypeSkillScanFinding, type SkillScanResult as RuntypeSkillScanResult, type SkillScanVerdict as RuntypeSkillScanVerdict, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillDefinition, SkillDriftError, SkillEnsureConflictError, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillPullResult, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceDefinition, type SurfaceDefinitionEnvironment, type SurfaceDefinitionStatus, type SurfaceDefinitionType, SurfaceDriftError, SurfaceEnsureConflictError, type SurfaceListParams, type SurfacePullResult, SurfacesEndpoint, SurfacesNamespace, type TextContentPart, type Tool, type ToolApprovalGrant, ToolApprovalGrantsEndpoint, type ToolConfig, type ToolDefinition, type ToolDefinitionType, ToolDriftError, ToolEnsureConflictError, type ToolPullResult, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, ToolsNamespace, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, computeProductContentHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, definePlaybook, defineProduct, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, normalizeProductDefinition, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };
47278
+ export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AssetReferenceContentPart, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalGetResult, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DefineProductInput, type DefineSkillInput, type DefineSurfaceInput, type DefineToolInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type EnsureFpoOptions, type EnsureFpoResult, type EnsureProductConverged, type EnsureProductOptions, type EnsureProductPlan, type EnsureProductResult, type EnsureSkillConverged, type EnsureSkillOptions, type EnsureSkillPlan, type EnsureSkillResult, type EnsureSurfaceConverged, type EnsureSurfaceOptions, type EnsureSurfacePlan, type EnsureSurfaceResult, type EnsureToolConverged, type EnsureToolOptions, type EnsureToolPlan, type EnsureToolResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type FpoEntityOutcome, type FpoInput, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type ProductDefinition, ProductDriftError, ProductEnsureConflictError, type ProductPullResult, ProductsNamespace, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordCostAggregation, type RecordCostModelBreakdown, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, type RecordStepResult, type RecordStepResultsParams, type RecordStepResultsResponse, type RecordWriteResponse, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOffloadRecorder, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillScanFinding as RuntypeSkillScanFinding, type SkillScanResult as RuntypeSkillScanResult, type SkillScanVerdict as RuntypeSkillScanVerdict, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillDefinition, SkillDriftError, SkillEnsureConflictError, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillPullResult, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceDefinition, type SurfaceDefinitionEnvironment, type SurfaceDefinitionStatus, type SurfaceDefinitionType, SurfaceDriftError, SurfaceEnsureConflictError, type SurfaceListParams, type SurfacePullResult, SurfacesEndpoint, SurfacesNamespace, type TextContentPart, type Tool, type ToolApprovalGrant, ToolApprovalGrantsEndpoint, type ToolConfig, type ToolDefinition, type ToolDefinitionType, ToolDriftError, ToolEnsureConflictError, type ToolPullResult, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, ToolsNamespace, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, computeFpoContentHash, computeProductContentHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, defineFpo, definePlaybook, defineProduct, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, ensureFpo, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, normalizeFpoDefinition, normalizeProductDefinition, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };
package/dist/index.mjs CHANGED
@@ -4219,6 +4219,65 @@ async function pullProduct(client, name) {
4219
4219
  return client.get("/products/pull", { name });
4220
4220
  }
4221
4221
 
4222
+ // src/products-ensure-fpo.ts
4223
+ function isPlainObject6(value) {
4224
+ return value !== null && typeof value === "object" && !Array.isArray(value);
4225
+ }
4226
+ function normalizeValue5(value) {
4227
+ if (Array.isArray(value)) {
4228
+ return value.map((item) => normalizeValue5(item));
4229
+ }
4230
+ if (isPlainObject6(value)) {
4231
+ const normalized = {};
4232
+ for (const key of Object.keys(value).sort()) {
4233
+ const entry = value[key];
4234
+ if (entry === void 0 || entry === null) continue;
4235
+ normalized[key] = normalizeValue5(entry);
4236
+ }
4237
+ return normalized;
4238
+ }
4239
+ return value;
4240
+ }
4241
+ function normalizeFpoDefinition(fpo) {
4242
+ const productInput = isPlainObject6(fpo.product) ? fpo.product : {};
4243
+ const { name: _identityName, ...productRest } = productInput;
4244
+ const product = normalizeValue5(productRest);
4245
+ return {
4246
+ ...fpo.version !== void 0 && fpo.version !== null ? { version: normalizeValue5(fpo.version) } : {},
4247
+ product,
4248
+ capabilities: normalizeValue5(fpo.capabilities ?? []),
4249
+ tools: normalizeValue5(fpo.tools ?? []),
4250
+ surfaces: normalizeValue5(fpo.surfaces ?? []),
4251
+ ...fpo.records !== void 0 && fpo.records !== null ? { records: normalizeValue5(fpo.records) } : {},
4252
+ ...fpo.schedules !== void 0 && fpo.schedules !== null ? { schedules: normalizeValue5(fpo.schedules) } : {},
4253
+ ...fpo.secrets !== void 0 && fpo.secrets !== null ? { secrets: normalizeValue5(fpo.secrets) } : {}
4254
+ };
4255
+ }
4256
+ async function computeFpoContentHash(fpo) {
4257
+ const serialized = JSON.stringify(normalizeFpoDefinition(fpo));
4258
+ const encoded = new TextEncoder().encode(serialized);
4259
+ const hashBuffer = await crypto.subtle.digest("SHA-256", encoded);
4260
+ return Array.from(new Uint8Array(hashBuffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
4261
+ }
4262
+ function defineFpo(fpo) {
4263
+ if (!isPlainObject6(fpo)) {
4264
+ throw new Error("defineFpo requires an FPO object");
4265
+ }
4266
+ const product = isPlainObject6(fpo.product) ? fpo.product : void 0;
4267
+ if (!product || typeof product.name !== "string" || product.name.length === 0) {
4268
+ throw new Error('defineFpo requires a non-empty "product.name" (the converge identity)');
4269
+ }
4270
+ return fpo;
4271
+ }
4272
+ async function ensureFpo(client, fpo, options = {}) {
4273
+ const { dryRun, onConflict } = options;
4274
+ return client.post("/products/ensure-fpo", {
4275
+ fpo,
4276
+ ...dryRun ? { dryRun: true } : {},
4277
+ ...onConflict ? { onConflict } : {}
4278
+ });
4279
+ }
4280
+
4222
4281
  // src/products-namespace.ts
4223
4282
  var ProductsNamespace = class {
4224
4283
  constructor(getClient) {
@@ -4256,29 +4315,48 @@ var ProductsNamespace = class {
4256
4315
  async pull(name) {
4257
4316
  return pullProduct(this.getClient(), name);
4258
4317
  }
4318
+ /**
4319
+ * Idempotently converge an entire Full Product Object (the nested product
4320
+ * graph) in one shot. Ships the full FPO; the server fans out to the
4321
+ * per-entity ensure services and returns a per-entity report. NON-atomic:
4322
+ * inspect `result.hasFailures` / `entities[].result` and re-run to self-heal.
4323
+ *
4324
+ * Scope (this release): product + capability backing flows/agents + capability
4325
+ * links. Surfaces/records/schedules/secrets and capability-as-tool composition
4326
+ * are not yet converged (reported in `entities[]` as `failed`/`skipped`).
4327
+ *
4328
+ * @example
4329
+ * ```typescript
4330
+ * const result = await Runtype.products.ensureFpo(fpo)
4331
+ * if (result.hasFailures) console.warn(result.entities.filter((e) => e.result === 'failed'))
4332
+ * ```
4333
+ */
4334
+ async ensureFpo(fpo, options = {}) {
4335
+ return ensureFpo(this.getClient(), fpo, options);
4336
+ }
4259
4337
  };
4260
4338
 
4261
4339
  // src/surfaces-ensure.ts
4262
- function isPlainObject6(value) {
4340
+ function isPlainObject7(value) {
4263
4341
  return value !== null && typeof value === "object" && !Array.isArray(value);
4264
4342
  }
4265
- function normalizeValue5(value) {
4343
+ function normalizeValue6(value) {
4266
4344
  if (Array.isArray(value)) {
4267
- return value.map((item) => normalizeValue5(item));
4345
+ return value.map((item) => normalizeValue6(item));
4268
4346
  }
4269
- if (isPlainObject6(value)) {
4347
+ if (isPlainObject7(value)) {
4270
4348
  const normalized = {};
4271
4349
  for (const key of Object.keys(value).sort()) {
4272
4350
  const entry = value[key];
4273
4351
  if (entry === void 0 || entry === null) continue;
4274
- normalized[key] = normalizeValue5(entry);
4352
+ normalized[key] = normalizeValue6(entry);
4275
4353
  }
4276
4354
  return normalized;
4277
4355
  }
4278
4356
  return value;
4279
4357
  }
4280
4358
  function normalizeSurfaceDefinition(definition) {
4281
- const behavior = isPlainObject6(definition.behavior) ? normalizeValue5(definition.behavior) : { type: definition.type };
4359
+ const behavior = isPlainObject7(definition.behavior) ? normalizeValue6(definition.behavior) : { type: definition.type };
4282
4360
  return {
4283
4361
  type: definition.type,
4284
4362
  behavior,
@@ -4331,13 +4409,13 @@ function defineSurface(input) {
4331
4409
  `defineSurface requires "type" to be one of: ${[...SURFACE_DEFINITION_TYPES].join(", ")}`
4332
4410
  );
4333
4411
  }
4334
- if (input.behavior !== void 0 && !isPlainObject6(input.behavior)) {
4412
+ if (input.behavior !== void 0 && !isPlainObject7(input.behavior)) {
4335
4413
  throw new Error('defineSurface "behavior" must be an object when provided');
4336
4414
  }
4337
- if (input.inbound !== void 0 && !isPlainObject6(input.inbound)) {
4415
+ if (input.inbound !== void 0 && !isPlainObject7(input.inbound)) {
4338
4416
  throw new Error('defineSurface "inbound" must be an object when provided');
4339
4417
  }
4340
- if (input.outbound !== void 0 && !isPlainObject6(input.outbound)) {
4418
+ if (input.outbound !== void 0 && !isPlainObject7(input.outbound)) {
4341
4419
  throw new Error('defineSurface "outbound" must be an object when provided');
4342
4420
  }
4343
4421
  if (input.status !== void 0 && !["draft", "active", "paused"].includes(input.status)) {
@@ -4393,7 +4471,7 @@ function parseRequestError6(err) {
4393
4471
  }
4394
4472
  function toConflictError6(err) {
4395
4473
  const { status, body } = parseRequestError6(err);
4396
- if (status !== 409 || !isPlainObject6(body)) return null;
4474
+ if (status !== 409 || !isPlainObject7(body)) return null;
4397
4475
  const code = body.code;
4398
4476
  if (code !== "external_modification" && code !== "remote_changed") return null;
4399
4477
  return new SurfaceEnsureConflictError(
@@ -9759,6 +9837,8 @@ var _AgentsEndpoint = class _AgentsEndpoint {
9759
9837
  messages,
9760
9838
  debugMode: options.debugMode,
9761
9839
  model: options.model,
9840
+ ...options.temperature !== void 0 ? { temperature: options.temperature } : {},
9841
+ ...options.maxTokens !== void 0 ? { maxTokens: options.maxTokens } : {},
9762
9842
  ...options.reasoning !== void 0 ? { reasoning: options.reasoning } : {},
9763
9843
  ...options.toolIds?.length ? { tools: { toolIds: options.toolIds } } : {},
9764
9844
  ...requestContextManagement ? { contextManagement: requestContextManagement } : {}
@@ -12677,6 +12757,7 @@ export {
12677
12757
  compileWorkflowConfig,
12678
12758
  computeAgentContentHash,
12679
12759
  computeFlowContentHash,
12760
+ computeFpoContentHash,
12680
12761
  computeProductContentHash,
12681
12762
  computeSkillContentHash,
12682
12763
  computeSurfaceContentHash,
@@ -12687,6 +12768,7 @@ export {
12687
12768
  defaultWorkflowConfig,
12688
12769
  defineAgent,
12689
12770
  defineFlow,
12771
+ defineFpo,
12690
12772
  definePlaybook,
12691
12773
  defineProduct,
12692
12774
  defineSkill,
@@ -12694,6 +12776,7 @@ export {
12694
12776
  defineTool,
12695
12777
  deployWorkflow,
12696
12778
  ensureDefaultWorkflowHooks,
12779
+ ensureFpo,
12697
12780
  evaluateGeneratedRuntimeToolProposal,
12698
12781
  extractDeclaredToolResultChars,
12699
12782
  gameWorkflow,
@@ -12707,6 +12790,7 @@ export {
12707
12790
  listWorkflowHooks,
12708
12791
  normalizeAgentDefinition,
12709
12792
  normalizeCandidatePath,
12793
+ normalizeFpoDefinition,
12710
12794
  normalizeProductDefinition,
12711
12795
  normalizeSkillDefinition,
12712
12796
  normalizeSurfaceDefinition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "4.17.1",
3
+ "version": "4.19.0",
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",