@doist/automations-mcp 1.3.0 → 1.4.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.
@@ -2973,22 +2973,22 @@ var require_compile = __commonJS({
2973
2973
  }
2974
2974
  }
2975
2975
  exports.compileSchema = compileSchema;
2976
- function resolveRef(root15, baseId, ref) {
2976
+ function resolveRef(root16, baseId, ref) {
2977
2977
  var _a;
2978
2978
  ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
2979
- const schOrFunc = root15.refs[ref];
2979
+ const schOrFunc = root16.refs[ref];
2980
2980
  if (schOrFunc)
2981
2981
  return schOrFunc;
2982
- let _sch = resolve.call(this, root15, ref);
2982
+ let _sch = resolve.call(this, root16, ref);
2983
2983
  if (_sch === void 0) {
2984
- const schema = (_a = root15.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
2984
+ const schema = (_a = root16.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
2985
2985
  const { schemaId } = this.opts;
2986
2986
  if (schema)
2987
- _sch = new SchemaEnv({ schema, schemaId, root: root15, baseId });
2987
+ _sch = new SchemaEnv({ schema, schemaId, root: root16, baseId });
2988
2988
  }
2989
2989
  if (_sch === void 0)
2990
2990
  return;
2991
- return root15.refs[ref] = inlineOrCompile.call(this, _sch);
2991
+ return root16.refs[ref] = inlineOrCompile.call(this, _sch);
2992
2992
  }
2993
2993
  exports.resolveRef = resolveRef;
2994
2994
  function inlineOrCompile(sch) {
@@ -3006,23 +3006,23 @@ var require_compile = __commonJS({
3006
3006
  function sameSchemaEnv(s1, s2) {
3007
3007
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3008
3008
  }
3009
- function resolve(root15, ref) {
3009
+ function resolve(root16, ref) {
3010
3010
  let sch;
3011
3011
  while (typeof (sch = this.refs[ref]) == "string")
3012
3012
  ref = sch;
3013
- return sch || this.schemas[ref] || resolveSchema.call(this, root15, ref);
3013
+ return sch || this.schemas[ref] || resolveSchema.call(this, root16, ref);
3014
3014
  }
3015
- function resolveSchema(root15, ref) {
3015
+ function resolveSchema(root16, ref) {
3016
3016
  const p = this.opts.uriResolver.parse(ref);
3017
3017
  const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
3018
- let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root15.baseId, void 0);
3019
- if (Object.keys(root15.schema).length > 0 && refPath === baseId) {
3020
- return getJsonPointer.call(this, p, root15);
3018
+ let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root16.baseId, void 0);
3019
+ if (Object.keys(root16.schema).length > 0 && refPath === baseId) {
3020
+ return getJsonPointer.call(this, p, root16);
3021
3021
  }
3022
3022
  const id = (0, resolve_1.normalizeId)(refPath);
3023
3023
  const schOrRef = this.refs[id] || this.schemas[id];
3024
3024
  if (typeof schOrRef == "string") {
3025
- const sch = resolveSchema.call(this, root15, schOrRef);
3025
+ const sch = resolveSchema.call(this, root16, schOrRef);
3026
3026
  if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
3027
3027
  return;
3028
3028
  return getJsonPointer.call(this, p, sch);
@@ -3037,7 +3037,7 @@ var require_compile = __commonJS({
3037
3037
  const schId = schema[schemaId];
3038
3038
  if (schId)
3039
3039
  baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
3040
- return new SchemaEnv({ schema, schemaId, root: root15, baseId });
3040
+ return new SchemaEnv({ schema, schemaId, root: root16, baseId });
3041
3041
  }
3042
3042
  return getJsonPointer.call(this, p, schOrRef);
3043
3043
  }
@@ -3049,7 +3049,7 @@ var require_compile = __commonJS({
3049
3049
  "dependencies",
3050
3050
  "definitions"
3051
3051
  ]);
3052
- function getJsonPointer(parsedRef, { baseId, schema, root: root15 }) {
3052
+ function getJsonPointer(parsedRef, { baseId, schema, root: root16 }) {
3053
3053
  var _a;
3054
3054
  if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
3055
3055
  return;
@@ -3068,10 +3068,10 @@ var require_compile = __commonJS({
3068
3068
  let env;
3069
3069
  if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
3070
3070
  const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
3071
- env = resolveSchema.call(this, root15, $ref);
3071
+ env = resolveSchema.call(this, root16, $ref);
3072
3072
  }
3073
3073
  const { schemaId } = this.opts;
3074
- env = env || new SchemaEnv({ schema, schemaId, root: root15, baseId });
3074
+ env = env || new SchemaEnv({ schema, schemaId, root: root16, baseId });
3075
3075
  if (env.schema !== env.root.schema)
3076
3076
  return env;
3077
3077
  return void 0;
@@ -4226,8 +4226,8 @@ var require_core = __commonJS({
4226
4226
  keyRef = sch;
4227
4227
  if (sch === void 0) {
4228
4228
  const { schemaId } = this.opts;
4229
- const root15 = new compile_1.SchemaEnv({ schema: {}, schemaId });
4230
- sch = compile_1.resolveSchema.call(this, root15, keyRef);
4229
+ const root16 = new compile_1.SchemaEnv({ schema: {}, schemaId });
4230
+ sch = compile_1.resolveSchema.call(this, root16, keyRef);
4231
4231
  if (!sch)
4232
4232
  return;
4233
4233
  this.refs[keyRef] = sch;
@@ -4588,20 +4588,20 @@ var require_ref = __commonJS({
4588
4588
  code(cxt) {
4589
4589
  const { gen, schema: $ref, it } = cxt;
4590
4590
  const { baseId, schemaEnv: env, validateName, opts, self } = it;
4591
- const { root: root15 } = env;
4592
- if (($ref === "#" || $ref === "#/") && baseId === root15.baseId)
4591
+ const { root: root16 } = env;
4592
+ if (($ref === "#" || $ref === "#/") && baseId === root16.baseId)
4593
4593
  return callRootRef();
4594
- const schOrEnv = compile_1.resolveRef.call(self, root15, baseId, $ref);
4594
+ const schOrEnv = compile_1.resolveRef.call(self, root16, baseId, $ref);
4595
4595
  if (schOrEnv === void 0)
4596
4596
  throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
4597
4597
  if (schOrEnv instanceof compile_1.SchemaEnv)
4598
4598
  return callValidate(schOrEnv);
4599
4599
  return inlineRefSchema(schOrEnv);
4600
4600
  function callRootRef() {
4601
- if (env === root15)
4601
+ if (env === root16)
4602
4602
  return callRef(cxt, validateName, env, env.$async);
4603
- const rootName = gen.scopeValue("root", { ref: root15 });
4604
- return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root15, root15.$async);
4603
+ const rootName = gen.scopeValue("root", { ref: root16 });
4604
+ return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root16, root16.$async);
4605
4605
  }
4606
4606
  function callValidate(sch) {
4607
4607
  const v = getValidate(cxt, sch);
@@ -7054,71 +7054,98 @@ var MODEL_CATALOG = {
7054
7054
  "gemini-2.5-flash-lite": {
7055
7055
  provider: "gemini",
7056
7056
  family: "2.5",
7057
- providerModelId: "gemini-2.5-flash-lite"
7057
+ providerModelId: "gemini-2.5-flash-lite",
7058
+ manifestSelectable: true
7058
7059
  },
7059
7060
  "gemini-2.5-flash": {
7060
7061
  provider: "gemini",
7061
7062
  family: "2.5",
7062
- providerModelId: "gemini-2.5-flash"
7063
+ providerModelId: "gemini-2.5-flash",
7064
+ manifestSelectable: true
7063
7065
  },
7064
7066
  "gemini-3.1-pro": {
7065
7067
  provider: "gemini",
7066
7068
  family: "3",
7067
- providerModelId: "gemini-3.1-pro-preview"
7069
+ providerModelId: "gemini-3.1-pro-preview",
7070
+ manifestSelectable: true
7068
7071
  },
7069
7072
  "gemini-3.8-flash": {
7070
7073
  provider: "gemini",
7071
7074
  family: "3",
7072
- providerModelId: "gemini-3.8-flash"
7075
+ providerModelId: "gemini-3.8-flash",
7076
+ manifestSelectable: true
7073
7077
  },
7074
7078
  "claude-opus-4-6": {
7075
7079
  provider: "anthropic",
7076
7080
  family: "4.6",
7077
- providerModelId: "claude-opus-4-6"
7081
+ providerModelId: "claude-opus-4-6",
7082
+ manifestSelectable: true
7078
7083
  },
7079
7084
  "claude-sonnet-5": {
7080
7085
  provider: "anthropic",
7081
7086
  family: "5",
7082
- providerModelId: "claude-sonnet-5"
7087
+ providerModelId: "claude-sonnet-5",
7088
+ manifestSelectable: true
7089
+ },
7090
+ "claude-sonnet-5-5": {
7091
+ provider: "anthropic",
7092
+ family: "5",
7093
+ providerModelId: "claude-sonnet-5-5",
7094
+ manifestSelectable: false
7095
+ },
7096
+ "claude-haiku-5-5": {
7097
+ provider: "anthropic",
7098
+ family: "5",
7099
+ providerModelId: "claude-haiku-5-5",
7100
+ manifestSelectable: false
7083
7101
  },
7084
7102
  "claude-sonnet-4-6": {
7085
7103
  provider: "anthropic",
7086
7104
  family: "4.6",
7087
- providerModelId: "claude-sonnet-4-6"
7105
+ providerModelId: "claude-sonnet-4-6",
7106
+ manifestSelectable: true
7088
7107
  },
7089
7108
  "claude-haiku-4-5": {
7090
7109
  provider: "anthropic",
7091
7110
  family: "4.5",
7092
- providerModelId: "claude-haiku-4-5"
7111
+ providerModelId: "claude-haiku-4-5",
7112
+ manifestSelectable: true
7093
7113
  },
7094
7114
  "deepseek-v4-flash": {
7095
7115
  provider: "openrouter",
7096
7116
  family: "deepseek",
7097
- providerModelId: "deepseek/deepseek-v4-flash-0731"
7117
+ providerModelId: "deepseek/deepseek-v4-flash-0731",
7118
+ manifestSelectable: true
7098
7119
  },
7099
7120
  "deepseek-v4-pro": {
7100
7121
  provider: "openrouter",
7101
7122
  family: "deepseek",
7102
- providerModelId: "deepseek/deepseek-v4-pro"
7123
+ providerModelId: "deepseek/deepseek-v4-pro",
7124
+ manifestSelectable: true
7103
7125
  },
7104
7126
  "mimo-v2.5": {
7105
7127
  provider: "openrouter",
7106
7128
  family: "mimo",
7107
- providerModelId: "xiaomi/mimo-v2.5"
7129
+ providerModelId: "xiaomi/mimo-v2.5",
7130
+ manifestSelectable: true
7108
7131
  },
7109
7132
  "mimo-v2.5-pro": {
7110
7133
  provider: "openrouter",
7111
7134
  family: "mimo",
7112
- providerModelId: "xiaomi/mimo-v2.5-pro"
7135
+ providerModelId: "xiaomi/mimo-v2.5-pro",
7136
+ manifestSelectable: true
7113
7137
  },
7114
7138
  "glm-5.2": {
7115
7139
  provider: "openrouter",
7116
7140
  family: "glm",
7117
- providerModelId: "z-ai/glm-5.2"
7141
+ providerModelId: "z-ai/glm-5.2",
7142
+ manifestSelectable: true
7118
7143
  }
7119
7144
  };
7120
7145
  var SUPPORTED_LLM_MODELS = Object.keys(MODEL_CATALOG);
7121
7146
  var SUPPORTED_SEARCH_MODELS = SUPPORTED_LLM_MODELS.filter(supportsWebSearch);
7147
+ var MANIFEST_LLM_MODELS = SUPPORTED_LLM_MODELS.filter((modelId) => MODEL_CATALOG[modelId].manifestSelectable);
7148
+ var MANIFEST_SEARCH_MODELS = MANIFEST_LLM_MODELS.filter((modelId) => supportsWebSearch(modelId));
7122
7149
  function supportsWebSearch(modelId) {
7123
7150
  const { provider } = MODEL_CATALOG[modelId];
7124
7151
  return provider === "gemini" || provider === "anthropic";
@@ -7158,7 +7185,161 @@ var admitUsersResponseSchema = z.object({
7158
7185
  });
7159
7186
 
7160
7187
  // ../../packages/core/dist/esm/schemas/admin-reliability.schema.js
7161
- import { z as z5 } from "zod";
7188
+ import { z as z6 } from "zod";
7189
+
7190
+ // ../../packages/core/dist/esm/schemas/usage-billing.schema.js
7191
+ import { z as z2 } from "zod";
7192
+ var UsageBillingProductSchema = z2.literal("automations");
7193
+ var USAGE_BILLING_BLOCK_REASONS = [
7194
+ "insufficient_credit",
7195
+ "temporarily_unavailable"
7196
+ ];
7197
+ var USAGE_BILLING_AUTHORIZATION_DENIAL_REASONS = [
7198
+ ...USAGE_BILLING_BLOCK_REASONS,
7199
+ "no_billing_account"
7200
+ ];
7201
+ var UsageBillingAuthorizationDenialReasonSchema = z2.enum(USAGE_BILLING_AUTHORIZATION_DENIAL_REASONS);
7202
+ var UsageBillingBlockReasonSchema = z2.enum(USAGE_BILLING_BLOCK_REASONS);
7203
+ var UsageBillingAccountSchema = z2.object({
7204
+ id: z2.string().regex(/^[1-9]\d*$/),
7205
+ type: z2.literal("user")
7206
+ });
7207
+ var RESERVATION_ID_MAX_LENGTH = 100;
7208
+ var EXTERNAL_EVENT_ID_MAX_LENGTH = 100;
7209
+ var CATEGORY_MAX_LENGTH = 64;
7210
+ var AuthorizeUsageRequestSchema = z2.object({
7211
+ product: UsageBillingProductSchema,
7212
+ account: UsageBillingAccountSchema,
7213
+ reservation_id: z2.string().min(1).max(RESERVATION_ID_MAX_LENGTH),
7214
+ category: z2.string().min(1).max(CATEGORY_MAX_LENGTH)
7215
+ });
7216
+ var UsageBillingUnitsSchema = z2.number().int().nonnegative();
7217
+ var UsageBillingBalanceSchema = z2.number().int();
7218
+ var RecordUsageRefsSchema = z2.record(z2.string().max(40), z2.string().max(500)).refine((refs) => Object.keys(refs).length <= 50);
7219
+ var AuthorizeUsageResponseSchema = z2.discriminatedUnion("decision", [
7220
+ z2.object({
7221
+ decision: z2.literal("allowed"),
7222
+ reservation_id: z2.string().min(1),
7223
+ available_units: UsageBillingBalanceSchema
7224
+ }),
7225
+ z2.object({
7226
+ decision: z2.literal("denied"),
7227
+ reason: UsageBillingAuthorizationDenialReasonSchema,
7228
+ available_units: UsageBillingBalanceSchema
7229
+ })
7230
+ ]);
7231
+ var RecordUsageRequestSchema = z2.object({
7232
+ product: UsageBillingProductSchema,
7233
+ account: UsageBillingAccountSchema,
7234
+ reservation_id: z2.string().min(1).max(RESERVATION_ID_MAX_LENGTH),
7235
+ external_event_id: z2.string().min(1).max(EXTERNAL_EVENT_ID_MAX_LENGTH).refine((value) => !value.startsWith("reservation:")),
7236
+ category: z2.string().min(1).max(CATEGORY_MAX_LENGTH),
7237
+ status: z2.enum(["success", "failed", "cancelled", "timed_out", "partial"]),
7238
+ incurred_cost: z2.number().int().nonnegative(),
7239
+ refs: RecordUsageRefsSchema.optional(),
7240
+ description: z2.string().min(1).max(255)
7241
+ });
7242
+ var RecordUsageResponseSchema = z2.object({
7243
+ recorded: z2.boolean(),
7244
+ charged_units: UsageBillingUnitsSchema,
7245
+ available_units: UsageBillingBalanceSchema
7246
+ });
7247
+ var TOP_UP_USD_MIN_AMOUNT = 500;
7248
+ var TopUpCurrencySchema = z2.preprocess((value) => typeof value === "string" ? value.toLowerCase() : value, z2.literal("usd"));
7249
+ var StartTopUpRequestSchema = z2.object({
7250
+ amount: z2.number().int().min(TOP_UP_USD_MIN_AMOUNT),
7251
+ // The public OpenAPI example uses lowercase `usd`; the backend also
7252
+ // normalizes caller casing before checking the currently supported currency.
7253
+ currency: TopUpCurrencySchema,
7254
+ return_url: z2.url()
7255
+ });
7256
+ var StartTopUpResponseSchema = z2.object({
7257
+ session_id: z2.string().min(1),
7258
+ checkout_url: z2.url()
7259
+ });
7260
+ var BillingPortalUrlRequestSchema = z2.object({
7261
+ return_url: z2.url()
7262
+ });
7263
+ var BillingPortalUrlResponseSchema = z2.object({
7264
+ billing_portal_url: z2.url()
7265
+ });
7266
+ var ReadStateResponseSchema = z2.object({
7267
+ available_units: UsageBillingBalanceSchema,
7268
+ available_amount: UsageBillingBalanceSchema,
7269
+ currency: z2.string(),
7270
+ usage_allowed: z2.boolean(),
7271
+ low_balance: z2.boolean(),
7272
+ depleted: z2.boolean(),
7273
+ /**
7274
+ * Additive hold-free snapshot. These fields remain optional until every
7275
+ * Todoist producer emits them, and balances may be overdrawn after a
7276
+ * settlement.
7277
+ */
7278
+ settled_units: UsageBillingBalanceSchema.optional(),
7279
+ settled_amount: UsageBillingBalanceSchema.optional(),
7280
+ is_settled_low_balance: z2.boolean().optional(),
7281
+ usage_block_reason: UsageBillingBlockReasonSchema.nullable().optional()
7282
+ });
7283
+ var UsageBillingAmountSchema = UsageBillingUnitsSchema.nullable();
7284
+ var UsageBillingEntrySchema = z2.object({
7285
+ id: z2.number().int().positive(),
7286
+ type: z2.string().min(1),
7287
+ created_at: z2.iso.datetime(),
7288
+ category: z2.string().min(1).optional(),
7289
+ status: z2.string().min(1).optional(),
7290
+ charged_units: UsageBillingAmountSchema,
7291
+ /** `charged_units` in integer microdollars. `null` exactly when it is. */
7292
+ charged_amount: UsageBillingAmountSchema,
7293
+ credited_units: UsageBillingAmountSchema,
7294
+ /** `credited_units` in integer microdollars. `null` exactly when it is. */
7295
+ credited_amount: UsageBillingAmountSchema,
7296
+ refs: z2.record(z2.string(), z2.unknown()).optional(),
7297
+ description: z2.string().optional()
7298
+ }).refine((entry) => entry.charged_units === null === (entry.charged_amount === null) && entry.credited_units === null === (entry.credited_amount === null), { message: "Each units field and its amount must be null together" });
7299
+ var USAGE_BILLING_ENTRY_TYPES = [
7300
+ "usage_settled",
7301
+ "top_up",
7302
+ "adjustment",
7303
+ "void",
7304
+ "expiry",
7305
+ "chargeback"
7306
+ ];
7307
+ var UsageBillingEntryTypeSchema = z2.enum(USAGE_BILLING_ENTRY_TYPES);
7308
+ var ReadTransactionsResponseSchema = z2.object({
7309
+ /**
7310
+ * On the page rather than on each entry: an account pins one price for its
7311
+ * whole life, so no two entries can differ.
7312
+ */
7313
+ currency: z2.string(),
7314
+ entries: z2.array(UsageBillingEntrySchema),
7315
+ has_more: z2.boolean(),
7316
+ /** Absent on the last page. */
7317
+ next_cursor: z2.string().min(1).optional()
7318
+ });
7319
+ var ReadUsageSummaryRequestSchema = z2.object({
7320
+ /** Omit to total every category. */
7321
+ category: z2.string().min(1).optional(),
7322
+ /** Start of the window, inclusive. Omit to start at the account's first event. */
7323
+ since: z2.iso.datetime().optional(),
7324
+ /** End of the window, exclusive. Omit to run to now. */
7325
+ until: z2.iso.datetime().optional()
7326
+ });
7327
+ var ReadUsageSummaryResponseSchema = z2.object({
7328
+ currency: z2.string(),
7329
+ usage_count: UsageBillingUnitsSchema,
7330
+ charged_units: UsageBillingUnitsSchema,
7331
+ /** `charged_units` in integer microdollars. `0` on an account with no usage. */
7332
+ charged_amount: UsageBillingUnitsSchema
7333
+ });
7334
+ var GrantWelcomeCreditRequestSchema = z2.object({
7335
+ product: UsageBillingProductSchema,
7336
+ account: UsageBillingAccountSchema,
7337
+ operator: z2.email().max(254)
7338
+ });
7339
+ var GrantWelcomeCreditResponseSchema = z2.object({
7340
+ status: z2.enum(["granted", "already_granted"]),
7341
+ grant_id: z2.string().min(1)
7342
+ });
7162
7343
 
7163
7344
  // ../../packages/core/dist/esm/types/failure-category.types.js
7164
7345
  var FAILURE_CATEGORIES = [
@@ -7184,22 +7365,22 @@ var FAILURE_CATEGORIES = [
7184
7365
  "billing_unavailable",
7185
7366
  "unknown"
7186
7367
  ];
7187
- var SKIP_CATEGORIES = ["insufficient_credit"];
7368
+ var SKIP_CATEGORIES = USAGE_BILLING_AUTHORIZATION_DENIAL_REASONS;
7188
7369
 
7189
7370
  // ../../packages/core/dist/esm/schemas/automation-run.schema.js
7190
- import { z as z4 } from "zod";
7371
+ import { z as z5 } from "zod";
7191
7372
 
7192
7373
  // ../../packages/core/dist/esm/schemas/shared.schema.js
7193
- import { z as z2 } from "zod";
7194
- var RolloutCompatibleNullableStringSchema = z2.string().nullish().transform((value) => value ?? null);
7374
+ import { z as z3 } from "zod";
7375
+ var RolloutCompatibleNullableStringSchema = z3.string().nullish().transform((value) => value ?? null);
7195
7376
 
7196
7377
  // ../../packages/core/dist/esm/schemas/query-param.schema.js
7197
- import { z as z3 } from "zod";
7198
- var isoDateTimeOrDateQueryParamSchema = z3.union([
7199
- z3.iso.datetime({ offset: true }),
7200
- z3.iso.date()
7378
+ import { z as z4 } from "zod";
7379
+ var isoDateTimeOrDateQueryParamSchema = z4.union([
7380
+ z4.iso.datetime({ offset: true }),
7381
+ z4.iso.date()
7201
7382
  ]);
7202
- var booleanQueryParamSchema = z3.preprocess((value) => value === "true" ? true : value === "false" ? false : value, z3.boolean());
7383
+ var booleanQueryParamSchema = z4.preprocess((value) => value === "true" ? true : value === "false" ? false : value, z4.boolean());
7203
7384
  var booleanQueryFlagSchema = booleanQueryParamSchema.optional().transform((value) => value === true);
7204
7385
 
7205
7386
  // ../../packages/core/dist/esm/schemas/automation-run.schema.js
@@ -7220,8 +7401,8 @@ function isEmptyRunDateRange(range) {
7220
7401
  return false;
7221
7402
  return untilExclusive ? since.getTime() >= until.getTime() : since.getTime() > until.getTime();
7222
7403
  }
7223
- var ListAutomationRunsQuerySchema = z4.object({
7224
- status: z4.enum(AUTOMATION_RUN_STATUSES).optional(),
7404
+ var ListAutomationRunsQuerySchema = z5.object({
7405
+ status: z5.enum(AUTOMATION_RUN_STATUSES).optional(),
7225
7406
  since: isoDateTimeOrDateQueryParamSchema.optional(),
7226
7407
  until: isoDateTimeOrDateQueryParamSchema.optional()
7227
7408
  }).superRefine((query, ctx) => {
@@ -7233,45 +7414,45 @@ var ListAutomationRunsQuerySchema = z4.object({
7233
7414
  });
7234
7415
  }
7235
7416
  });
7236
- var AutomationRunResultSchema = z4.object({
7237
- type: z4.literal("markdown"),
7238
- text: z4.string().trim().min(1).max(AUTOMATION_RUN_RESULT_TEXT_MAX_LENGTH)
7417
+ var AutomationRunResultSchema = z5.object({
7418
+ type: z5.literal("markdown"),
7419
+ text: z5.string().trim().min(1).max(AUTOMATION_RUN_RESULT_TEXT_MAX_LENGTH)
7239
7420
  });
7240
7421
  var RolloutCompatibleAutomationRunResultSchema = AutomationRunResultSchema.nullish().transform((result) => {
7241
7422
  return result ?? null;
7242
7423
  });
7243
7424
  var automationRunDtoBaseShape = {
7244
- id: z4.string(),
7245
- automationId: z4.string(),
7246
- createdAt: z4.string(),
7247
- updatedAt: z4.string(),
7425
+ id: z5.string(),
7426
+ automationId: z5.string(),
7427
+ createdAt: z5.string(),
7428
+ updatedAt: z5.string(),
7248
7429
  result: RolloutCompatibleAutomationRunResultSchema,
7249
- temporalUrl: z4.string().nullish(),
7430
+ temporalUrl: z5.string().nullish(),
7250
7431
  // Whoever started the run from the app; null for schedules, webhooks and
7251
7432
  // API triggers, and for a worker that predates the field.
7252
7433
  triggeredBy: RolloutCompatibleNullableStringSchema
7253
7434
  };
7254
- var AutomationRunDtoSchema = z4.discriminatedUnion("status", [
7255
- z4.object({ ...automationRunDtoBaseShape, status: z4.literal("pending") }),
7256
- z4.object({ ...automationRunDtoBaseShape, status: z4.literal("running") }),
7257
- z4.object({ ...automationRunDtoBaseShape, status: z4.literal("completed") }),
7258
- z4.object({ ...automationRunDtoBaseShape, status: z4.literal("cancelled") }),
7259
- z4.object({
7435
+ var AutomationRunDtoSchema = z5.discriminatedUnion("status", [
7436
+ z5.object({ ...automationRunDtoBaseShape, status: z5.literal("pending") }),
7437
+ z5.object({ ...automationRunDtoBaseShape, status: z5.literal("running") }),
7438
+ z5.object({ ...automationRunDtoBaseShape, status: z5.literal("completed") }),
7439
+ z5.object({ ...automationRunDtoBaseShape, status: z5.literal("cancelled") }),
7440
+ z5.object({
7260
7441
  ...automationRunDtoBaseShape,
7261
- status: z4.literal("failed"),
7262
- failureReason: z4.string().nullish(),
7263
- failureCategory: z4.enum(FAILURE_CATEGORIES).nullish().catch(null)
7442
+ status: z5.literal("failed"),
7443
+ failureReason: z5.string().nullish(),
7444
+ failureCategory: z5.enum(FAILURE_CATEGORIES).nullish().catch(null)
7264
7445
  }),
7265
- z4.object({
7446
+ z5.object({
7266
7447
  ...automationRunDtoBaseShape,
7267
- status: z4.literal("skipped"),
7268
- skipReason: z4.string().nullish(),
7269
- skipCategory: z4.enum(SKIP_CATEGORIES).nullish()
7448
+ status: z5.literal("skipped"),
7449
+ skipReason: z5.string().nullish(),
7450
+ skipCategory: z5.enum(SKIP_CATEGORIES).nullish()
7270
7451
  })
7271
7452
  ]);
7272
- var automationRunListResponseSchema = z4.object({
7273
- data: z4.array(AutomationRunDtoSchema),
7274
- nextCursor: z4.string().nullable()
7453
+ var automationRunListResponseSchema = z5.object({
7454
+ data: z5.array(AutomationRunDtoSchema),
7455
+ nextCursor: z5.string().nullable()
7275
7456
  });
7276
7457
  var MAX_TOOL_CALL_ARGUMENT_KEYS = 32;
7277
7458
  var MAX_TOOL_CALL_ARGUMENT_KEY_LENGTH = 64;
@@ -7290,41 +7471,41 @@ var TOOL_CALL_ERROR_CATEGORIES = [
7290
7471
  "invalid-request",
7291
7472
  "unknown"
7292
7473
  ];
7293
- var ToolCallTimestampSchema = z4.union([z4.string(), z4.date()]).transform((timestamp) => timestamp instanceof Date ? timestamp.toISOString() : timestamp);
7294
- var SafeToolCallDtoSchema = z4.object({
7295
- id: z4.string(),
7296
- name: z4.string(),
7297
- argumentKeys: z4.array(z4.string()),
7298
- hasResult: z4.boolean(),
7299
- hasError: z4.boolean(),
7300
- outcome: z4.enum(TOOL_CALL_OUTCOMES).optional(),
7301
- errorCategory: z4.enum(TOOL_CALL_ERROR_CATEGORIES).optional(),
7302
- resultPreview: z4.string().max(MAX_TOOL_CALL_PREVIEW_LENGTH).optional(),
7303
- errorPreview: z4.string().max(MAX_TOOL_CALL_PREVIEW_LENGTH).optional(),
7474
+ var ToolCallTimestampSchema = z5.union([z5.string(), z5.date()]).transform((timestamp) => timestamp instanceof Date ? timestamp.toISOString() : timestamp);
7475
+ var SafeToolCallDtoSchema = z5.object({
7476
+ id: z5.string(),
7477
+ name: z5.string(),
7478
+ argumentKeys: z5.array(z5.string()),
7479
+ hasResult: z5.boolean(),
7480
+ hasError: z5.boolean(),
7481
+ outcome: z5.enum(TOOL_CALL_OUTCOMES).optional(),
7482
+ errorCategory: z5.enum(TOOL_CALL_ERROR_CATEGORIES).optional(),
7483
+ resultPreview: z5.string().max(MAX_TOOL_CALL_PREVIEW_LENGTH).optional(),
7484
+ errorPreview: z5.string().max(MAX_TOOL_CALL_PREVIEW_LENGTH).optional(),
7304
7485
  timestamp: ToolCallTimestampSchema
7305
7486
  });
7306
- var LegacyToolCallDtoInputSchema = z4.object({
7307
- id: z4.string(),
7308
- name: z4.string(),
7309
- arguments: z4.record(z4.string(), z4.unknown()).optional(),
7310
- result: z4.unknown().optional(),
7311
- error: z4.unknown().optional(),
7312
- errorStatus: z4.number().int().min(100).max(599).optional(),
7313
- errorCode: z4.string().optional(),
7487
+ var LegacyToolCallDtoInputSchema = z5.object({
7488
+ id: z5.string(),
7489
+ name: z5.string(),
7490
+ arguments: z5.record(z5.string(), z5.unknown()).optional(),
7491
+ result: z5.unknown().optional(),
7492
+ error: z5.unknown().optional(),
7493
+ errorStatus: z5.number().int().min(100).max(599).optional(),
7494
+ errorCode: z5.string().optional(),
7314
7495
  timestamp: ToolCallTimestampSchema
7315
7496
  });
7316
- var ToolCallDtoInputSchema = z4.union([SafeToolCallDtoSchema, LegacyToolCallDtoInputSchema]);
7317
- var ToolCallDtoSchema = z4.preprocess((toolCall) => {
7497
+ var ToolCallDtoInputSchema = z5.union([SafeToolCallDtoSchema, LegacyToolCallDtoInputSchema]);
7498
+ var ToolCallDtoSchema = z5.preprocess((toolCall) => {
7318
7499
  const parsed = ToolCallDtoInputSchema.safeParse(toolCall);
7319
7500
  return parsed.success ? normalizeToolCallDto(parsed.data) : toolCall;
7320
7501
  }, SafeToolCallDtoSchema);
7321
- var ToolCallDtosSchema = z4.preprocess((toolCalls) => {
7502
+ var ToolCallDtosSchema = z5.preprocess((toolCalls) => {
7322
7503
  if (!Array.isArray(toolCalls)) {
7323
7504
  return toolCalls;
7324
7505
  }
7325
7506
  const parsedToolCalls = toolCalls.map((toolCall) => ToolCallDtoInputSchema.safeParse(toolCall)).filter((result) => result.success).map((result) => result.data);
7326
7507
  return parsedToolCalls.length === toolCalls.length ? normalizeToolCallDtos(parsedToolCalls) : toolCalls;
7327
- }, z4.array(SafeToolCallDtoSchema));
7508
+ }, z5.array(SafeToolCallDtoSchema));
7328
7509
  var AUTOMATION_RUN_DEBUG_REASONS = [
7329
7510
  "condition-not-met",
7330
7511
  "exit-condition-met",
@@ -7333,42 +7514,42 @@ var AUTOMATION_RUN_DEBUG_REASONS = [
7333
7514
  "run-result-not-configured",
7334
7515
  "run-result-empty"
7335
7516
  ];
7336
- var AutomationRunDebugReasonSchema = z4.enum(AUTOMATION_RUN_DEBUG_REASONS);
7337
- var AutomationRunStepDtoOutputSchema = z4.object({
7338
- stepId: z4.string(),
7339
- type: z4.string(),
7340
- description: z4.string(),
7341
- status: z4.enum(AUTOMATION_RUN_STATUSES),
7342
- startedAt: z4.string().optional(),
7343
- completedAt: z4.string().optional(),
7344
- result: z4.unknown().optional(),
7345
- error: z4.string().optional(),
7346
- generatedCode: z4.string().optional(),
7517
+ var AutomationRunDebugReasonSchema = z5.enum(AUTOMATION_RUN_DEBUG_REASONS);
7518
+ var AutomationRunStepDtoOutputSchema = z5.object({
7519
+ stepId: z5.string(),
7520
+ type: z5.string(),
7521
+ description: z5.string(),
7522
+ status: z5.enum(AUTOMATION_RUN_STATUSES),
7523
+ startedAt: z5.string().optional(),
7524
+ completedAt: z5.string().optional(),
7525
+ result: z5.unknown().optional(),
7526
+ error: z5.string().optional(),
7527
+ generatedCode: z5.string().optional(),
7347
7528
  toolCalls: ToolCallDtosSchema.optional(),
7348
7529
  debugReason: AutomationRunDebugReasonSchema.optional()
7349
7530
  });
7350
7531
  var AutomationRunStepDtoSchema = AutomationRunStepDtoOutputSchema;
7351
7532
  var automationRunDetailDtoBaseShape = {
7352
7533
  ...automationRunDtoBaseShape,
7353
- steps: z4.array(AutomationRunStepDtoSchema)
7534
+ steps: z5.array(AutomationRunStepDtoSchema)
7354
7535
  };
7355
- var AutomationRunDetailDtoSchema = z4.discriminatedUnion("status", [
7356
- z4.object({ ...automationRunDetailDtoBaseShape, status: z4.literal("pending") }),
7357
- z4.object({ ...automationRunDetailDtoBaseShape, status: z4.literal("running") }),
7358
- z4.object({ ...automationRunDetailDtoBaseShape, status: z4.literal("completed") }),
7359
- z4.object({ ...automationRunDetailDtoBaseShape, status: z4.literal("cancelled") }),
7360
- z4.object({ ...automationRunDetailDtoBaseShape, status: z4.literal("data-expired") }),
7361
- z4.object({
7536
+ var AutomationRunDetailDtoSchema = z5.discriminatedUnion("status", [
7537
+ z5.object({ ...automationRunDetailDtoBaseShape, status: z5.literal("pending") }),
7538
+ z5.object({ ...automationRunDetailDtoBaseShape, status: z5.literal("running") }),
7539
+ z5.object({ ...automationRunDetailDtoBaseShape, status: z5.literal("completed") }),
7540
+ z5.object({ ...automationRunDetailDtoBaseShape, status: z5.literal("cancelled") }),
7541
+ z5.object({ ...automationRunDetailDtoBaseShape, status: z5.literal("data-expired") }),
7542
+ z5.object({
7362
7543
  ...automationRunDetailDtoBaseShape,
7363
- status: z4.literal("failed"),
7364
- failureReason: z4.string().nullish(),
7365
- failureCategory: z4.enum(FAILURE_CATEGORIES).nullish().catch(null)
7544
+ status: z5.literal("failed"),
7545
+ failureReason: z5.string().nullish(),
7546
+ failureCategory: z5.enum(FAILURE_CATEGORIES).nullish().catch(null)
7366
7547
  }),
7367
- z4.object({
7548
+ z5.object({
7368
7549
  ...automationRunDetailDtoBaseShape,
7369
- status: z4.literal("skipped"),
7370
- skipReason: z4.string().nullish(),
7371
- skipCategory: z4.enum(SKIP_CATEGORIES).nullish()
7550
+ status: z5.literal("skipped"),
7551
+ skipReason: z5.string().nullish(),
7552
+ skipCategory: z5.enum(SKIP_CATEGORIES).nullish()
7372
7553
  })
7373
7554
  ]);
7374
7555
  function summarizeToolCallArgumentKeys(args) {
@@ -7708,7 +7889,7 @@ function isRecord(value) {
7708
7889
  // ../../packages/core/dist/esm/schemas/admin-reliability.schema.js
7709
7890
  var MAX_RELIABILITY_WINDOW_DAYS = 90;
7710
7891
  var MAX_RELIABILITY_WINDOW_MS = MAX_RELIABILITY_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
7711
- var adminReliabilityQuerySchema = z5.object({
7892
+ var adminReliabilityQuerySchema = z6.object({
7712
7893
  since: isoDateTimeOrDateQueryParamSchema.optional(),
7713
7894
  until: isoDateTimeOrDateQueryParamSchema.optional()
7714
7895
  }).refine((query) => {
@@ -7723,108 +7904,113 @@ var adminReliabilityQuerySchema = z5.object({
7723
7904
  path: ["since"],
7724
7905
  message: `Date range must be at most ${MAX_RELIABILITY_WINDOW_DAYS} days`
7725
7906
  });
7726
- var adminReliabilityTotalsSchema = z5.object({
7727
- totalAutomations: z5.number(),
7728
- enabledAutomations: z5.number(),
7729
- totalLiveRuns: z5.number(),
7730
- terminalLiveRuns: z5.number(),
7731
- completedLiveRuns: z5.number(),
7732
- failedLiveRuns: z5.number(),
7733
- skippedLiveRuns: z5.number(),
7734
- insufficientCreditSkippedRuns: z5.number(),
7735
- failureRate: z5.number()
7736
- });
7737
- var adminReliabilityFailureCategorySchema = z5.object({
7738
- category: z5.enum(FAILURE_CATEGORIES).nullable(),
7739
- failures: z5.number(),
7740
- shareOfFailedRuns: z5.number(),
7741
- shareOfTerminalRuns: z5.number()
7742
- });
7743
- var adminReliabilityDailyRowSchema = z5.object({
7744
- date: z5.iso.date(),
7745
- terminalLiveRuns: z5.number(),
7746
- completedLiveRuns: z5.number(),
7747
- failedLiveRuns: z5.number(),
7748
- skippedLiveRuns: z5.number(),
7749
- insufficientCreditSkippedRuns: z5.number(),
7750
- failureRate: z5.number()
7751
- });
7752
- var adminReliabilityResponseSchema = z5.object({
7753
- since: z5.iso.datetime({ offset: true }),
7754
- until: z5.iso.datetime({ offset: true }),
7907
+ var adminReliabilityTotalsSchema = z6.object({
7908
+ totalAutomations: z6.number(),
7909
+ enabledAutomations: z6.number(),
7910
+ totalLiveRuns: z6.number(),
7911
+ terminalLiveRuns: z6.number(),
7912
+ completedLiveRuns: z6.number(),
7913
+ failedLiveRuns: z6.number(),
7914
+ skippedLiveRuns: z6.number(),
7915
+ insufficientCreditSkippedRuns: z6.number(),
7916
+ failureRate: z6.number()
7917
+ });
7918
+ var adminReliabilityFailureCategorySchema = z6.object({
7919
+ category: z6.enum(FAILURE_CATEGORIES).nullable(),
7920
+ failures: z6.number(),
7921
+ shareOfFailedRuns: z6.number(),
7922
+ shareOfTerminalRuns: z6.number()
7923
+ });
7924
+ var adminReliabilityDailyRowSchema = z6.object({
7925
+ date: z6.iso.date(),
7926
+ terminalLiveRuns: z6.number(),
7927
+ completedLiveRuns: z6.number(),
7928
+ failedLiveRuns: z6.number(),
7929
+ skippedLiveRuns: z6.number(),
7930
+ insufficientCreditSkippedRuns: z6.number(),
7931
+ failureRate: z6.number()
7932
+ });
7933
+ var adminReliabilityResponseSchema = z6.object({
7934
+ since: z6.iso.datetime({ offset: true }),
7935
+ until: z6.iso.datetime({ offset: true }),
7755
7936
  totals: adminReliabilityTotalsSchema,
7756
- failureCategories: z5.array(adminReliabilityFailureCategorySchema),
7757
- daily: z5.array(adminReliabilityDailyRowSchema)
7937
+ failureCategories: z6.array(adminReliabilityFailureCategorySchema),
7938
+ daily: z6.array(adminReliabilityDailyRowSchema)
7758
7939
  });
7759
7940
 
7760
7941
  // ../../packages/core/dist/esm/schemas/admin-sample-automation.schema.js
7761
- import { z as z8 } from "zod";
7942
+ import { z as z9 } from "zod";
7762
7943
 
7763
7944
  // ../../packages/core/dist/esm/schemas/connector.schema.js
7764
- import { z as z6 } from "zod";
7765
- var TriggerSupportedEventSchema = z6.object({
7766
- id: z6.string(),
7767
- name: z6.string(),
7768
- description: z6.string()
7769
- });
7770
- var ConnectorCapabilitiesSchema = z6.object({
7771
- mcp: z6.object({
7772
- serverUrl: z6.string(),
7773
- scopes: z6.array(z6.string()),
7774
- connectionIds: z6.array(z6.string())
7945
+ import { z as z7 } from "zod";
7946
+ var TriggerSupportedEventSchema = z7.object({
7947
+ id: z7.string(),
7948
+ name: z7.string(),
7949
+ description: z7.string()
7950
+ });
7951
+ var ConnectorCapabilitiesSchema = z7.object({
7952
+ mcp: z7.object({
7953
+ serverUrl: z7.string(),
7954
+ scopes: z7.array(z7.string()),
7955
+ connectionIds: z7.array(z7.string())
7775
7956
  }).optional(),
7776
- triggers: z6.object({
7777
- scopes: z6.array(z6.string()),
7778
- connectionIds: z6.array(z6.string()),
7779
- supportedEvents: z6.array(TriggerSupportedEventSchema)
7957
+ triggers: z7.object({
7958
+ scopes: z7.array(z7.string()),
7959
+ connectionIds: z7.array(z7.string()),
7960
+ supportedEvents: z7.array(TriggerSupportedEventSchema)
7780
7961
  }).optional()
7781
7962
  });
7782
- var ConnectorSchema = z6.object({
7783
- id: z6.string(),
7784
- name: z6.string(),
7785
- description: z6.string(),
7786
- iconUrl: z6.url().nullable().optional(),
7963
+ var ConnectorSchema = z7.object({
7964
+ id: z7.string(),
7965
+ name: z7.string(),
7966
+ description: z7.string(),
7967
+ iconUrl: z7.url().nullable().optional(),
7787
7968
  capabilities: ConnectorCapabilitiesSchema,
7788
7969
  /** Whether this connector has any user account setup flow. */
7789
- requiresConnection: z6.boolean(),
7970
+ requiresConnection: z7.boolean(),
7790
7971
  /**
7791
7972
  * Whether the connector is a product-owned built-in service. This is
7792
7973
  * independent from whether a third-party connector requires account setup.
7793
7974
  */
7794
- isSystem: z6.boolean().optional(),
7975
+ isSystem: z7.boolean().optional(),
7795
7976
  /**
7796
7977
  * Managed connectors (e.g. WhatsApp) share a single linked identity across
7797
7978
  * connection types — one onboarding covers both action and trigger uses.
7798
7979
  * The FE collapses per-type rows into a single account when this is true.
7799
7980
  */
7800
- isManaged: z6.boolean().optional()
7981
+ isManaged: z7.boolean().optional(),
7982
+ /**
7983
+ * The service only admits loopback OAuth clients, so account setup runs in
7984
+ * the Automations CLI on the user's machine instead of the web app.
7985
+ */
7986
+ connectsViaCli: z7.boolean().optional()
7801
7987
  });
7802
- var GetConnectorsQuerySchema = z6.object({
7803
- query: z6.string().optional()
7988
+ var GetConnectorsQuerySchema = z7.object({
7989
+ query: z7.string().optional()
7804
7990
  });
7805
- var GetConnectorActionsQuerySchema = z6.object({
7806
- connectionId: z6.uuid().optional()
7991
+ var GetConnectorActionsQuerySchema = z7.object({
7992
+ connectionId: z7.uuid().optional()
7807
7993
  });
7808
- var ConnectorActionsResponseSchema = z6.object({
7809
- actions: z6.array(z6.object({
7810
- name: z6.string(),
7811
- title: z6.string().optional(),
7812
- description: z6.string()
7994
+ var ConnectorActionsResponseSchema = z7.object({
7995
+ actions: z7.array(z7.object({
7996
+ name: z7.string(),
7997
+ title: z7.string().optional(),
7998
+ description: z7.string()
7813
7999
  }))
7814
8000
  });
7815
- var connectorDetailsSchema = z6.object({
7816
- name: z6.string(),
7817
- displayName: z6.string(),
7818
- description: z6.string(),
7819
- iconUrl: z6.string().nullable().optional()
8001
+ var connectorDetailsSchema = z7.object({
8002
+ name: z7.string(),
8003
+ displayName: z7.string(),
8004
+ description: z7.string(),
8005
+ iconUrl: z7.string().nullable().optional()
7820
8006
  });
7821
- var connectorListResponseSchema = z6.object({
7822
- data: z6.array(ConnectorSchema),
7823
- nextCursor: z6.string().nullable()
8007
+ var connectorListResponseSchema = z7.object({
8008
+ data: z7.array(ConnectorSchema),
8009
+ nextCursor: z7.string().nullable()
7824
8010
  });
7825
8011
 
7826
8012
  // ../../packages/core/dist/esm/schemas/manifest.schema.js
7827
- import { z as z7 } from "zod/v4";
8013
+ import { z as z8 } from "zod/v4";
7828
8014
 
7829
8015
  // ../../packages/core/dist/esm/utils/duration.js
7830
8016
  var durationUnits = ["ms", "s", "m", "h", "d", "w"];
@@ -8001,19 +8187,19 @@ function resolvePropertySchemaInSchema(schema, propertyPath) {
8001
8187
 
8002
8188
  // ../../packages/core/dist/esm/schemas/manifest.schema.js
8003
8189
  var uuidv7Regex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/i;
8004
- var uuidv7Schema = z7.string().regex(uuidv7Regex);
8190
+ var uuidv7Schema = z8.string().regex(uuidv7Regex);
8005
8191
  var timezoneComponent = "[A-Za-z0-9+]+(?:[._+-][A-Za-z0-9+]+)*";
8006
- var durationStringSchema = z7.string().regex(durationStringRegex, "Must be a valid duration string (e.g., '500ms', '10s', '1m')").meta({
8192
+ var durationStringSchema = z8.string().regex(durationStringRegex, "Must be a valid duration string (e.g., '500ms', '10s', '1m')").meta({
8007
8193
  description: "A duration string, composed of a positive integer and a unit: 'ms', 's', 'm', 'h', 'd', 'w'."
8008
8194
  });
8009
- var retrySchema = z7.object({
8010
- maxAttempts: z7.number().int().min(EXECUTION_RETRY_MIN_RETRIES).max(EXECUTION_RETRY_MAX_RETRIES).default(EXECUTION_RETRY_DEFAULT_RETRIES).meta({ description: "The number of retries after the initial step attempt." }),
8011
- strategy: z7.enum(["fixed", "exponential_backoff"]).default("exponential_backoff").meta({ description: "The backoff strategy to use for retries." }),
8195
+ var retrySchema = z8.object({
8196
+ maxAttempts: z8.number().int().min(EXECUTION_RETRY_MIN_RETRIES).max(EXECUTION_RETRY_MAX_RETRIES).default(EXECUTION_RETRY_DEFAULT_RETRIES).meta({ description: "The number of retries after the initial step attempt." }),
8197
+ strategy: z8.enum(["fixed", "exponential_backoff"]).default("exponential_backoff").meta({ description: "The backoff strategy to use for retries." }),
8012
8198
  delay: durationStringSchema.default(EXECUTION_RETRY_DEFAULT_DELAY).meta({
8013
8199
  description: "The initial delay between retries (e.g., '500ms', '1m', '10m')."
8014
8200
  })
8015
8201
  }).meta({ description: "Defines the retry policy for a failed step." });
8016
- var onErrorSchema = z7.object({
8202
+ var onErrorSchema = z8.object({
8017
8203
  retries: retrySchema.optional()
8018
8204
  }).meta({
8019
8205
  description: "Defines the error handling policy for the automation or a specific step."
@@ -8024,13 +8210,13 @@ var executionTimeoutSchema = durationStringSchema.refine((value) => {
8024
8210
  }, { message: "Execution timeout must be between 1 minute and 60 minutes" }).meta({
8025
8211
  description: "Maximum runtime for a single step, expressed as a duration string (e.g., '10m')."
8026
8212
  });
8027
- var executionPolicySchema = z7.object({
8213
+ var executionPolicySchema = z8.object({
8028
8214
  timeout: executionTimeoutSchema.optional().default(EXECUTION_TIMEOUT_DEFAULT),
8029
8215
  onError: onErrorSchema.optional()
8030
8216
  }).meta({
8031
8217
  description: "Defines how long a step may run and how failures are retried. Available globally and per step."
8032
8218
  });
8033
- var intervalScheduleSchema = z7.string().regex(intervalScheduleRegex, "Must be a valid interval string (e.g., '45m' or '6h/5h')").meta({ description: "An interval string (e.g., '45m' or '6h/5h')." });
8219
+ var intervalScheduleSchema = z8.string().regex(intervalScheduleRegex, "Must be a valid interval string (e.g., '45m' or '6h/5h')").meta({ description: "An interval string (e.g., '45m' or '6h/5h')." });
8034
8220
  var cronScheduleSchema = (() => {
8035
8221
  function createCronField(rangePattern) {
8036
8222
  return `(?:(?:(?:\\*|(?:${rangePattern})(?:-(?:${rangePattern}))?)(?:\\/\\d+)?)(?:,(?:(?:\\*|(?:${rangePattern})(?:-(?:${rangePattern}))?)(?:\\/\\d+)?))*)`;
@@ -8042,72 +8228,72 @@ var cronScheduleSchema = (() => {
8042
8228
  const dayOfWeek = createCronField("[0-6]");
8043
8229
  const cronExpressionRegex = new RegExp(`^${minutes}\\s+${hours}\\s+${dayOfMonth}\\s+${month}\\s+${dayOfWeek}$`);
8044
8230
  const timezoneRegex = new RegExp(`^${timezoneComponent}(?:/${timezoneComponent})*$`);
8045
- return z7.object({
8046
- timezone: z7.string().regex(timezoneRegex, "Must be a valid IANA Time Zone name").meta({
8231
+ return z8.object({
8232
+ timezone: z8.string().regex(timezoneRegex, "Must be a valid IANA Time Zone name").meta({
8047
8233
  description: "IANA Time Zone name (e.g., America/New_York). Required for cron schedules."
8048
8234
  }),
8049
- expression: z7.string().regex(cronExpressionRegex, "Must be a valid 5-part cron expression").meta({
8235
+ expression: z8.string().regex(cronExpressionRegex, "Must be a valid 5-part cron expression").meta({
8050
8236
  description: "Standard 5-part cron expression (minute hour day month dayOfWeek)"
8051
8237
  })
8052
8238
  }).meta({
8053
8239
  description: "A cron schedule with required timezone"
8054
8240
  });
8055
8241
  })();
8056
- var scheduleValueSchema = z7.union([intervalScheduleSchema, cronScheduleSchema]).meta({ description: "The schedule definition for the trigger." });
8242
+ var scheduleValueSchema = z8.union([intervalScheduleSchema, cronScheduleSchema]).meta({ description: "The schedule definition for the trigger." });
8057
8243
  var TRIGGER_TYPES = ["schedule", "webhook", "api"];
8058
- var scheduleTriggerSchema = z7.object({
8059
- type: z7.literal("schedule"),
8244
+ var scheduleTriggerSchema = z8.object({
8245
+ type: z8.literal("schedule"),
8060
8246
  value: scheduleValueSchema,
8061
- description: z7.string().optional().meta({ description: "A natural language description of what the trigger does." })
8247
+ description: z8.string().optional().meta({ description: "A natural language description of what the trigger does." })
8062
8248
  });
8063
- var webhookTriggerSchema = z7.object({
8064
- type: z7.literal("webhook"),
8065
- event: z7.string({
8249
+ var webhookTriggerSchema = z8.object({
8250
+ type: z8.literal("webhook"),
8251
+ event: z8.string({
8066
8252
  message: 'Webhook triggers require an "event" field with the event type (e.g., "todoist.item.added").'
8067
8253
  }).regex(/^[a-z0-9-]+\.[a-z0-9_]+\.[a-z0-9_]+(\.[a-z0-9_]+)*$/, "Event type must be in the format 'connector.entity.action' with exactly 3 required parts, optionally followed by additional segments (e.g., 'todoist.item.added', 'google-calendar.event.created')").meta({
8068
8254
  description: "The event type to listen for (e.g., 'todoist.item.added', 'gmail.message.new'). This references a specific trigger definition from a connector."
8069
8255
  }),
8070
- outputSchema: z7.object({
8071
- type: z7.string({
8256
+ outputSchema: z8.object({
8257
+ type: z8.string({
8072
8258
  message: 'outputSchema must be a valid JSON Schema with a "type" field. Use {"type": "string"} or {"type": "object", ...}.'
8073
8259
  })
8074
8260
  }, {
8075
8261
  message: 'Webhook triggers require an "outputSchema" field describing the trigger payload structure.'
8076
- }).catchall(z7.unknown()).meta({
8262
+ }).catchall(z8.unknown()).meta({
8077
8263
  description: "A JSON Schema that describes the structure of the trigger payload."
8078
8264
  }),
8079
- inputSchema: z7.record(z7.string(), z7.unknown()).optional().meta({
8265
+ inputSchema: z8.record(z8.string(), z8.unknown()).optional().meta({
8080
8266
  description: "An optional JSON Schema to filter the CloudEvent data field. Only events matching this schema will trigger the automation."
8081
8267
  }),
8082
- description: z7.string().optional().meta({ description: "A natural language description of what the trigger does." })
8268
+ description: z8.string().optional().meta({ description: "A natural language description of what the trigger does." })
8083
8269
  });
8084
- var apiTriggerIdSchema = z7.string().regex(uuidv7Regex, "API trigger ID must be a valid UUIDv7");
8085
- var apiTriggerSchema = z7.object({
8086
- type: z7.literal("api"),
8270
+ var apiTriggerIdSchema = z8.string().regex(uuidv7Regex, "API trigger ID must be a valid UUIDv7");
8271
+ var apiTriggerSchema = z8.object({
8272
+ type: z8.literal("api"),
8087
8273
  id: apiTriggerIdSchema.optional().meta({
8088
8274
  description: "A system-generated unique ID for the trigger endpoint (UUIDv7 format). Auto-generated if not provided."
8089
8275
  }),
8090
- outputSchema: z7.object({
8091
- type: z7.string({
8276
+ outputSchema: z8.object({
8277
+ type: z8.string({
8092
8278
  message: 'outputSchema must be a valid JSON Schema with a "type" field. Use {"type": "string"} or {"type": "object", ...}.'
8093
8279
  })
8094
8280
  }, {
8095
8281
  message: 'API triggers require an "outputSchema" field describing the trigger payload structure.'
8096
- }).catchall(z7.unknown()).meta({
8282
+ }).catchall(z8.unknown()).meta({
8097
8283
  description: "A JSON Schema that describes the structure of the trigger payload."
8098
8284
  }),
8099
- inputSchema: z7.object({
8100
- type: z7.string({
8285
+ inputSchema: z8.object({
8286
+ type: z8.string({
8101
8287
  message: 'inputSchema must be a valid JSON Schema with a "type" field. Use {"type": "string"} or {"type": "object", ...}.'
8102
8288
  })
8103
8289
  }, {
8104
8290
  message: 'API triggers with input validation require an "inputSchema" field to validate incoming request payloads.'
8105
- }).catchall(z7.unknown()).optional().meta({
8291
+ }).catchall(z8.unknown()).optional().meta({
8106
8292
  description: "Optional JSON Schema to validate incoming request payloads."
8107
8293
  }),
8108
- description: z7.string().optional().meta({ description: "A natural language description of what the trigger does." })
8294
+ description: z8.string().optional().meta({ description: "A natural language description of what the trigger does." })
8109
8295
  });
8110
- var triggerSchema = z7.discriminatedUnion("type", [scheduleTriggerSchema, webhookTriggerSchema, apiTriggerSchema], {
8296
+ var triggerSchema = z8.discriminatedUnion("type", [scheduleTriggerSchema, webhookTriggerSchema, apiTriggerSchema], {
8111
8297
  message: 'Invalid trigger configuration. Schedule triggers need "value", webhook triggers need "event" and "outputSchema", API triggers need "outputSchema" (and optionally "id" and "inputSchema" for advanced features). Use the correct fields for your trigger type.'
8112
8298
  }).meta({ description: "Defines the event that initiates an automation run." });
8113
8299
  function validateTriggersConstraints(triggers, ctx) {
@@ -8116,7 +8302,7 @@ function validateTriggersConstraints(triggers, ctx) {
8116
8302
  const types = new Set(triggers.map((t) => t.type));
8117
8303
  if (types.size > 1) {
8118
8304
  ctx.addIssue({
8119
- code: z7.ZodIssueCode.custom,
8305
+ code: z8.ZodIssueCode.custom,
8120
8306
  message: "All triggers must be the same type. Cannot mix schedule, webhook, and api triggers."
8121
8307
  });
8122
8308
  return;
@@ -8124,7 +8310,7 @@ function validateTriggersConstraints(triggers, ctx) {
8124
8310
  const triggerType = triggers[0]?.type;
8125
8311
  if ((triggerType === "schedule" || triggerType === "api") && triggers.length > 1) {
8126
8312
  ctx.addIssue({
8127
- code: z7.ZodIssueCode.custom,
8313
+ code: z8.ZodIssueCode.custom,
8128
8314
  message: `Only one ${triggerType} trigger is allowed per automation.`
8129
8315
  });
8130
8316
  return;
@@ -8134,7 +8320,7 @@ function validateTriggersConstraints(triggers, ctx) {
8134
8320
  const connectors = new Set(events.map((e) => e.split(".")[0]));
8135
8321
  if (connectors.size > 1) {
8136
8322
  ctx.addIssue({
8137
- code: z7.ZodIssueCode.custom,
8323
+ code: z8.ZodIssueCode.custom,
8138
8324
  message: `All webhook triggers must be from the same connector. Found: ${[...connectors].join(", ")}.`
8139
8325
  });
8140
8326
  return;
@@ -8142,20 +8328,20 @@ function validateTriggersConstraints(triggers, ctx) {
8142
8328
  const duplicateEvents = events.filter((e, i) => events.indexOf(e) !== i);
8143
8329
  if (duplicateEvents.length > 0) {
8144
8330
  ctx.addIssue({
8145
- code: z7.ZodIssueCode.custom,
8331
+ code: z8.ZodIssueCode.custom,
8146
8332
  message: `Duplicate trigger events are not allowed: ${[...new Set(duplicateEvents)].join(", ")}.`
8147
8333
  });
8148
8334
  }
8149
8335
  }
8150
8336
  }
8151
- var triggersSchema = z7.array(triggerSchema).nonempty({ message: "At least one trigger is required." }).superRefine(validateTriggersConstraints).meta({
8337
+ var triggersSchema = z8.array(triggerSchema).nonempty({ message: "At least one trigger is required." }).superRefine(validateTriggersConstraints).meta({
8152
8338
  description: "An array of triggers for the automation. Multiple webhook triggers from the same connector are supported."
8153
8339
  });
8154
- var stepIdSchema = z7.string().regex(/^[a-zA-Z][a-zA-Z0-9]*$/, "ID must be in camelCase format (no dashes or underscores allowed)").meta({ description: "A unique camelCase identifier for the step." });
8155
- var resultFromPathSchema = z7.string().regex(/^[a-zA-Z_]\w*(\.[a-zA-Z_]\w*)*$/, 'Path must be a dot-separated property path like "text" or "task.description".').meta({
8340
+ var stepIdSchema = z8.string().regex(/^[a-zA-Z][a-zA-Z0-9]*$/, "ID must be in camelCase format (no dashes or underscores allowed)").meta({ description: "A unique camelCase identifier for the step." });
8341
+ var resultFromPathSchema = z8.string().regex(/^[a-zA-Z_]\w*(\.[a-zA-Z_]\w*)*$/, 'Path must be a dot-separated property path like "text" or "task.description".').meta({
8156
8342
  description: 'Dot-separated property path relative to a step output, such as "text" or "task.description".'
8157
8343
  });
8158
- var resultFromSchema = z7.object({
8344
+ var resultFromSchema = z8.object({
8159
8345
  stepId: stepIdSchema.meta({
8160
8346
  description: "The step whose output should be used as the persisted run result."
8161
8347
  }),
@@ -8163,28 +8349,28 @@ var resultFromSchema = z7.object({
8163
8349
  }).strict().meta({
8164
8350
  description: "Declares which step output becomes the persisted user-facing automation run result."
8165
8351
  });
8166
- var stepOutputSchema = z7.object({
8167
- type: z7.string({
8352
+ var stepOutputSchema = z8.object({
8353
+ type: z8.string({
8168
8354
  message: 'outputSchema must be a valid JSON Schema with a "type" field. Use {"type": "string"} or {"type": "object", ...}.'
8169
8355
  })
8170
- }).catchall(z7.unknown()).meta({ description: "A JSON Schema object defining the expected output of this step." });
8171
- var searchStepOutputSchema = z7.object({
8172
- type: z7.literal("string").meta({
8356
+ }).catchall(z8.unknown()).meta({ description: "A JSON Schema object defining the expected output of this step." });
8357
+ var searchStepOutputSchema = z8.object({
8358
+ type: z8.literal("string").meta({
8173
8359
  description: 'Must be "string" for search steps.'
8174
8360
  })
8175
8361
  }).strict().default({ type: "string" }).meta({
8176
8362
  description: 'JSON Schema for search step output. Must be exactly {"type": "string"}.'
8177
8363
  });
8178
- var exitOnSchema = z7.record(z7.string(), z7.unknown()).meta({
8364
+ var exitOnSchema = z8.record(z8.string(), z8.unknown()).meta({
8179
8365
  description: "A JSON Schema object that terminates the automation's run if matched. Otherwise, or if omitted, the automation continues to the next step."
8180
8366
  });
8181
- var ifConditionSchema = z7.string().regex(ifConditionRegex, `Must be a single comparison, e.g. "{{steps.askUser.choice}} == 'archive'": a {{steps.<id>.<path>}} or {{trigger.<path>}} reference, then == or !=, then a single-quoted literal. No boolean combinators.`).meta({
8367
+ var ifConditionSchema = z8.string().regex(ifConditionRegex, `Must be a single comparison, e.g. "{{steps.askUser.choice}} == 'archive'": a {{steps.<id>.<path>}} or {{trigger.<path>}} reference, then == or !=, then a single-quoted literal. No boolean combinators.`).meta({
8182
8368
  description: `An optional condition gating whether this step runs, e.g. "{{steps.askUser.choice}} == 'archive'". A single comparison against an earlier step or trigger value; when false the step is skipped.`
8183
8369
  });
8184
- var baseStepSchema = z7.object({
8370
+ var baseStepSchema = z8.object({
8185
8371
  id: stepIdSchema,
8186
- title: z7.string().optional().meta({ description: "A short human-readable title of the step." }),
8187
- description: z7.string().meta({ description: "A human-readable description of what the step does." }),
8372
+ title: z8.string().optional().meta({ description: "A short human-readable title of the step." }),
8373
+ description: z8.string().meta({ description: "A human-readable description of what the step does." }),
8188
8374
  if: ifConditionSchema.optional(),
8189
8375
  exitOn: exitOnSchema.optional().meta({
8190
8376
  description: "A JSON Schema object that terminates the automation's run if the step output matches. If omitted or not matched, execution continues."
@@ -8194,76 +8380,76 @@ var baseStepSchema = z7.object({
8194
8380
  })
8195
8381
  });
8196
8382
  var MODEL_TIERS = ["lite", "flash", "pro"];
8197
- var SUPPORTED_MODEL_REFERENCES = [...MODEL_TIERS, ...SUPPORTED_LLM_MODELS];
8198
- var modelReferenceSchema = z7.enum(SUPPORTED_MODEL_REFERENCES).meta({
8383
+ var SUPPORTED_MODEL_REFERENCES = [...MODEL_TIERS, ...MANIFEST_LLM_MODELS];
8384
+ var modelReferenceSchema = z8.enum(SUPPORTED_MODEL_REFERENCES).meta({
8199
8385
  description: "A stable model tier (lite, flash, pro) or a supported literal model override."
8200
8386
  });
8201
- var llmStepSchema = baseStepSchema.merge(z7.object({
8202
- type: z7.literal("llm"),
8203
- prompt: z7.string().meta({ description: "The prompt template to be sent to the LLM." }),
8387
+ var llmStepSchema = baseStepSchema.merge(z8.object({
8388
+ type: z8.literal("llm"),
8389
+ prompt: z8.string().meta({ description: "The prompt template to be sent to the LLM." }),
8204
8390
  outputSchema: stepOutputSchema,
8205
8391
  model: modelReferenceSchema,
8206
- tools: z7.record(z7.string(), z7.array(z7.string())).default({}).meta({
8392
+ tools: z8.record(z8.string(), z8.array(z8.string())).default({}).meta({
8207
8393
  description: 'A mapping from MCP server connector IDs to arrays of their tool names (e.g., {"todoist": ["find-tasks-by-date"], "linear": ["create-issue"]}).'
8208
8394
  })
8209
8395
  })).strict();
8210
- var codegenStepSchema = baseStepSchema.merge(z7.object({
8211
- type: z7.literal("codegen"),
8212
- prompt: z7.string().meta({
8396
+ var codegenStepSchema = baseStepSchema.merge(z8.object({
8397
+ type: z8.literal("codegen"),
8398
+ prompt: z8.string().meta({
8213
8399
  description: "The goal or instruction for what the generated code should accomplish."
8214
8400
  }),
8215
8401
  outputSchema: stepOutputSchema,
8216
8402
  model: modelReferenceSchema,
8217
- tools: z7.record(z7.string(), z7.array(z7.string())).default({}).meta({
8403
+ tools: z8.record(z8.string(), z8.array(z8.string())).default({}).meta({
8218
8404
  description: 'A mapping from MCP server connector IDs to arrays of their tool names that will be available in the generated code (e.g., {"todoist": ["find-tasks", "update-tasks"]}).'
8219
8405
  }),
8220
- extractedUrls: z7.array(z7.url()).optional().meta({
8406
+ extractedUrls: z8.array(z8.url()).optional().meta({
8221
8407
  description: "URLs that will be fetched during step execution (auto-extracted from prompt examples)"
8222
8408
  })
8223
8409
  }));
8224
- var runtimeSchema = z7.object({
8225
- language: z7.literal("typescript").meta({
8410
+ var runtimeSchema = z8.object({
8411
+ language: z8.literal("typescript").meta({
8226
8412
  description: "Programming language. Only 'typescript' is supported in v0."
8227
8413
  }),
8228
- version: z7.enum(SUPPORTED_RUNTIME_VERSIONS).meta({
8414
+ version: z8.enum(SUPPORTED_RUNTIME_VERSIONS).meta({
8229
8415
  description: "Language specification version. Supported values: '5.9', '6.0'."
8230
8416
  })
8231
8417
  }).meta({
8232
8418
  description: "Defines the execution environment for the code step."
8233
8419
  });
8234
- var codeStepSchema = baseStepSchema.merge(z7.object({
8235
- type: z7.literal("code"),
8420
+ var codeStepSchema = baseStepSchema.merge(z8.object({
8421
+ type: z8.literal("code"),
8236
8422
  outputSchema: stepOutputSchema,
8237
8423
  runtime: runtimeSchema.optional().default({ language: "typescript", version: "5.9" }).meta({
8238
8424
  description: "An object defining the execution environment. If omitted, it defaults to TypeScript 5.9."
8239
8425
  }),
8240
- code: z7.string().meta({
8426
+ code: z8.string().meta({
8241
8427
  description: "The code to execute. It has access to trigger and steps objects."
8242
8428
  }),
8243
- extractedUrls: z7.array(z7.url()).optional().meta({
8429
+ extractedUrls: z8.array(z8.url()).optional().meta({
8244
8430
  description: "URLs that will be fetched during step execution (auto-extracted from code)"
8245
8431
  })
8246
8432
  }));
8247
- var searchStepSchema = baseStepSchema.merge(z7.object({
8248
- type: z7.literal("search"),
8249
- prompt: z7.string().min(1).meta({
8433
+ var searchStepSchema = baseStepSchema.merge(z8.object({
8434
+ type: z8.literal("search"),
8435
+ prompt: z8.string().min(1).meta({
8250
8436
  description: "The search prompt to execute using web search."
8251
8437
  }),
8252
8438
  outputSchema: searchStepOutputSchema,
8253
- model: z7.enum([...MODEL_TIERS, ...SUPPORTED_SEARCH_MODELS]).optional().meta({
8439
+ model: z8.enum([...MODEL_TIERS, ...MANIFEST_SEARCH_MODELS]).optional().meta({
8254
8440
  description: "A stable tier (lite, flash, pro) or a supported search-enabled literal model override."
8255
8441
  })
8256
8442
  }));
8257
- var delayStepOutputSchema = z7.object({
8258
- type: z7.literal("object").meta({
8443
+ var delayStepOutputSchema = z8.object({
8444
+ type: z8.literal("object").meta({
8259
8445
  description: 'Must be "object" for delay steps.'
8260
8446
  })
8261
- }).catchall(z7.unknown()).meta({
8447
+ }).catchall(z8.unknown()).meta({
8262
8448
  description: 'JSON Schema for delay step output. Must include {"type": "object"}.'
8263
8449
  });
8264
8450
  var baseDelayStepSchema = baseStepSchema.omit({ execution: true });
8265
- var delayStepSchema = baseDelayStepSchema.merge(z7.object({
8266
- type: z7.literal("delay"),
8451
+ var delayStepSchema = baseDelayStepSchema.merge(z8.object({
8452
+ type: z8.literal("delay"),
8267
8453
  duration: durationStringSchema.meta({
8268
8454
  description: "Duration to delay the execution for as a duration string, e.g., '1d', '1w', '2h'."
8269
8455
  }),
@@ -8275,16 +8461,16 @@ var askExpiresAfterSchema = durationStringSchema.refine((value) => durationStrin
8275
8461
  }).meta({
8276
8462
  description: "How long to wait for a response before the prompt expires, as a duration string (e.g. '1w'). Defaults to 1w, capped at 30d. On expiry the run terminates."
8277
8463
  });
8278
- var askOptionSchema = z7.object({
8279
- label: z7.string().min(1).meta({ description: "The button text shown to the user." }),
8280
- value: z7.string().min(1).meta({
8464
+ var askOptionSchema = z8.object({
8465
+ label: z8.string().min(1).meta({ description: "The button text shown to the user." }),
8466
+ value: z8.string().min(1).meta({
8281
8467
  description: "The machine value emitted as the choice. Unique within the step."
8282
8468
  }),
8283
- terminate: z7.boolean().optional().default(false).meta({
8469
+ terminate: z8.boolean().optional().default(false).meta({
8284
8470
  description: 'When true, choosing this option stops the run and no later steps execute (the explicit "deny"/"stop" path).'
8285
8471
  })
8286
8472
  }).strict().meta({ description: "A single selectable option in an ask step." });
8287
- var askOptionsSchema = z7.array(askOptionSchema).min(2, "An ask step requires at least two options.").superRefine((options, ctx) => {
8473
+ var askOptionsSchema = z8.array(askOptionSchema).min(2, "An ask step requires at least two options.").superRefine((options, ctx) => {
8288
8474
  const seen = /* @__PURE__ */ new Set();
8289
8475
  for (let index = 0; index < options.length; index++) {
8290
8476
  const value = options[index]?.value;
@@ -8292,7 +8478,7 @@ var askOptionsSchema = z7.array(askOptionSchema).min(2, "An ask step requires at
8292
8478
  continue;
8293
8479
  if (seen.has(value)) {
8294
8480
  ctx.addIssue({
8295
- code: z7.ZodIssueCode.custom,
8481
+ code: z8.ZodIssueCode.custom,
8296
8482
  message: `Duplicate option value "${value}". Option values must be unique within an ask step.`,
8297
8483
  path: [index, "value"]
8298
8484
  });
@@ -8308,19 +8494,19 @@ var askStepOutputSchema = stepOutputSchema.refine((schema) => {
8308
8494
  }).meta({
8309
8495
  description: 'A JSON Schema describing the ask step output. Must be an object with a "choice" property whose value is one of the option values.'
8310
8496
  });
8311
- var askStepSchema = baseAskStepSchema.merge(z7.object({
8312
- type: z7.literal("ask"),
8313
- message: z7.string().min(1).meta({
8497
+ var askStepSchema = baseAskStepSchema.merge(z8.object({
8498
+ type: z8.literal("ask"),
8499
+ message: z8.string().min(1).meta({
8314
8500
  description: 'The short headline shown to the user, e.g. "Archive or delete 3 inactive projects?".'
8315
8501
  }),
8316
- details: z7.string().optional().meta({
8502
+ details: z8.string().optional().meta({
8317
8503
  description: "Optional longer markdown context, e.g. a preview of what each option would do."
8318
8504
  }),
8319
8505
  options: askOptionsSchema,
8320
8506
  expiresAfter: askExpiresAfterSchema.optional().default(ASK_EXPIRES_AFTER_DEFAULT),
8321
8507
  outputSchema: askStepOutputSchema
8322
8508
  })).strict();
8323
- var stepSchema = z7.discriminatedUnion("type", [
8509
+ var stepSchema = z8.discriminatedUnion("type", [
8324
8510
  llmStepSchema,
8325
8511
  codegenStepSchema,
8326
8512
  codeStepSchema,
@@ -8332,22 +8518,22 @@ var MANIFEST_VERSIONS = [0, 1];
8332
8518
  var CURRENT_MANIFEST_VERSION = MANIFEST_VERSIONS[MANIFEST_VERSIONS.length - 1];
8333
8519
  var manifestVersionSchema = (() => {
8334
8520
  const [firstVersion, ...otherVersions] = MANIFEST_VERSIONS;
8335
- let schema = z7.literal(firstVersion);
8521
+ let schema = z8.literal(firstVersion);
8336
8522
  for (const version of otherVersions) {
8337
- schema = schema.or(z7.literal(version));
8523
+ schema = schema.or(z8.literal(version));
8338
8524
  }
8339
8525
  return schema;
8340
8526
  })().meta({
8341
8527
  description: `The version of the manifest schema. Latest is ${MANIFEST_VERSIONS[MANIFEST_VERSIONS.length - 1]}.`
8342
8528
  });
8343
- var manifestSchemaBase = z7.object({
8529
+ var manifestSchemaBase = z8.object({
8344
8530
  manifestVersion: manifestVersionSchema,
8345
- name: z7.string().min(1).meta({
8531
+ name: z8.string().min(1).meta({
8346
8532
  description: "A human-readable name for the automation that can include spaces."
8347
8533
  }),
8348
- description: z7.string().meta({ description: "A human-readable description of the automation's purpose." }),
8534
+ description: z8.string().meta({ description: "A human-readable description of the automation's purpose." }),
8349
8535
  triggers: triggersSchema,
8350
- overlap: z7.enum([
8536
+ overlap: z8.enum([
8351
8537
  "skip",
8352
8538
  "buffer_one",
8353
8539
  "buffer_all",
@@ -8359,14 +8545,14 @@ var manifestSchemaBase = z7.object({
8359
8545
  }),
8360
8546
  execution: executionPolicySchema.optional().meta({ description: "Global defaults for timeout and retry behavior." }),
8361
8547
  resultFrom: resultFromSchema.optional(),
8362
- steps: z7.array(stepSchema).nonempty().meta({ description: "An ordered array of step objects that define the workflow." })
8548
+ steps: z8.array(stepSchema).nonempty().meta({ description: "An ordered array of step objects that define the workflow." })
8363
8549
  }).meta({ description: "The root schema for an Automation Manifest, defining its behavior." });
8364
8550
  var manifestSchema = manifestSchemaBase.superRefine(validateManifestResultFrom).superRefine(validateManifestTemplateVariables).superRefine(validateManifestAskOverlap).superRefine(validateManifestAskChoiceEnum);
8365
8551
  var partialManifestSchema = manifestSchemaBase.partial().extend({
8366
8552
  // Override steps to allow empty array for drafts (remove .nonempty() requirement)
8367
- steps: z7.array(stepSchema).default([]),
8553
+ steps: z8.array(stepSchema).default([]),
8368
8554
  // Override triggers to allow empty array for drafts (remove .nonempty() but keep invariants)
8369
- triggers: z7.array(triggerSchema).superRefine(validateTriggersConstraints).optional()
8555
+ triggers: z8.array(triggerSchema).superRefine(validateTriggersConstraints).optional()
8370
8556
  }).required({
8371
8557
  manifestVersion: true,
8372
8558
  steps: true
@@ -8422,8 +8608,8 @@ function validateTemplateVariable({ variable, context, stepId, currentStepGuard,
8422
8608
  if (parts.length === 0) {
8423
8609
  return null;
8424
8610
  }
8425
- const [root15, ...rest] = parts;
8426
- if (root15 === "trigger") {
8611
+ const [root16, ...rest] = parts;
8612
+ if (root16 === "trigger") {
8427
8613
  if (rest.length === 0) {
8428
8614
  return `Step "${stepId}" ${sourceType} references "{{trigger}}" without a property. Use {{trigger.<property>}} syntax (e.g., {{trigger.payload}}, {{trigger.metadata}}).`;
8429
8615
  }
@@ -8446,7 +8632,7 @@ function validateTemplateVariable({ variable, context, stepId, currentStepGuard,
8446
8632
  }
8447
8633
  return null;
8448
8634
  }
8449
- if (root15 === "steps") {
8635
+ if (root16 === "steps") {
8450
8636
  const referencedStepId = rest[0];
8451
8637
  if (!referencedStepId) {
8452
8638
  return `Step "${stepId}" ${sourceType} references "steps" but is missing the step identifier in template variable "{{${variable}}}". Use {{steps.<stepId>}} syntax.`;
@@ -8487,7 +8673,7 @@ function validateManifestAskOverlap(data, ctx) {
8487
8673
  const overlap = data.overlap ?? "skip";
8488
8674
  if (!BOUNDED_OVERLAP_MODES.includes(overlap)) {
8489
8675
  ctx.addIssue({
8490
- code: z7.ZodIssueCode.custom,
8676
+ code: z8.ZodIssueCode.custom,
8491
8677
  message: `Manifests with an ask step must use a bounded overlap mode (${BOUNDED_OVERLAP_MODES.join(", ")}). "${overlap}" can accumulate parked or buffered runs while a prompt waits for a response.`,
8492
8678
  path: ["overlap"]
8493
8679
  });
@@ -8504,7 +8690,7 @@ function validateManifestAskChoiceEnum(data, ctx) {
8504
8690
  const choiceEnum = choiceSchema?.enum;
8505
8691
  if (!Array.isArray(choiceEnum)) {
8506
8692
  ctx.addIssue({
8507
- code: z7.ZodIssueCode.custom,
8693
+ code: z8.ZodIssueCode.custom,
8508
8694
  message: `Ask step "${step.id ?? stepIndex}" outputSchema must declare choice as an enum of the option values.`,
8509
8695
  path: choicePath
8510
8696
  });
@@ -8513,7 +8699,7 @@ function validateManifestAskChoiceEnum(data, ctx) {
8513
8699
  const nonStringEnum = choiceEnum.filter((value) => typeof value !== "string");
8514
8700
  if (nonStringEnum.length > 0) {
8515
8701
  ctx.addIssue({
8516
- code: z7.ZodIssueCode.custom,
8702
+ code: z8.ZodIssueCode.custom,
8517
8703
  message: `Ask step "${step.id ?? stepIndex}" outputSchema choice enum must contain only string values; ask options always emit strings.`,
8518
8704
  path: choicePath
8519
8705
  });
@@ -8531,7 +8717,7 @@ function validateManifestAskChoiceEnum(data, ctx) {
8531
8717
  unexpected.length > 0 ? `unexpected ${unexpected.map((v) => `'${v}'`).join(", ")}` : ""
8532
8718
  ].filter(Boolean).join("; ");
8533
8719
  ctx.addIssue({
8534
- code: z7.ZodIssueCode.custom,
8720
+ code: z8.ZodIssueCode.custom,
8535
8721
  message: `Ask step "${step.id ?? stepIndex}" outputSchema choice enum must list exactly the option values (${detail}).`,
8536
8722
  path: choicePath
8537
8723
  });
@@ -8545,7 +8731,7 @@ function validateManifestResultFrom(data, ctx) {
8545
8731
  const referencedStep = steps.find((step) => step.id === data.resultFrom?.stepId);
8546
8732
  if (!referencedStep) {
8547
8733
  ctx.addIssue({
8548
- code: z7.ZodIssueCode.custom,
8734
+ code: z8.ZodIssueCode.custom,
8549
8735
  message: `resultFrom.stepId references unknown step "${data.resultFrom.stepId}".`,
8550
8736
  path: ["resultFrom", "stepId"]
8551
8737
  });
@@ -8553,7 +8739,7 @@ function validateManifestResultFrom(data, ctx) {
8553
8739
  }
8554
8740
  if (referencedStep.if) {
8555
8741
  ctx.addIssue({
8556
- code: z7.ZodIssueCode.custom,
8742
+ code: z8.ZodIssueCode.custom,
8557
8743
  message: `resultFrom.stepId references step "${referencedStep.id}", which only runs conditionally (\`if\`). resultFrom must point at a step that always runs.`,
8558
8744
  path: ["resultFrom", "stepId"]
8559
8745
  });
@@ -8562,7 +8748,7 @@ function validateManifestResultFrom(data, ctx) {
8562
8748
  const outputSchema23 = referencedStep.outputSchema;
8563
8749
  if (!outputSchema23) {
8564
8750
  ctx.addIssue({
8565
- code: z7.ZodIssueCode.custom,
8751
+ code: z8.ZodIssueCode.custom,
8566
8752
  message: `resultFrom.stepId references step "${referencedStep.id}" without an outputSchema.`,
8567
8753
  path: ["resultFrom", "stepId"]
8568
8754
  });
@@ -8571,7 +8757,7 @@ function validateManifestResultFrom(data, ctx) {
8571
8757
  if (!data.resultFrom.path) {
8572
8758
  if (!isPlainStringSchema(outputSchema23)) {
8573
8759
  ctx.addIssue({
8574
- code: z7.ZodIssueCode.custom,
8760
+ code: z8.ZodIssueCode.custom,
8575
8761
  message: "resultFrom.path may be omitted only when the referenced step outputSchema is a string.",
8576
8762
  path: ["resultFrom", "path"]
8577
8763
  });
@@ -8582,7 +8768,7 @@ function validateManifestResultFrom(data, ctx) {
8582
8768
  const resolvedSchema = resolvePropertySchemaInSchema(outputSchema23, propertyPath);
8583
8769
  if (!resolvedSchema) {
8584
8770
  ctx.addIssue({
8585
- code: z7.ZodIssueCode.custom,
8771
+ code: z8.ZodIssueCode.custom,
8586
8772
  message: `resultFrom.path "${data.resultFrom.path}" does not exist in step "${referencedStep.id}" outputSchema.`,
8587
8773
  path: ["resultFrom", "path"]
8588
8774
  });
@@ -8590,7 +8776,7 @@ function validateManifestResultFrom(data, ctx) {
8590
8776
  }
8591
8777
  if (!isStringTypedSchema(resolvedSchema)) {
8592
8778
  ctx.addIssue({
8593
- code: z7.ZodIssueCode.custom,
8779
+ code: z8.ZodIssueCode.custom,
8594
8780
  message: "resultFrom.path must resolve to a string value.",
8595
8781
  path: ["resultFrom", "path"]
8596
8782
  });
@@ -8721,7 +8907,7 @@ function validateManifestTemplateVariables(data, ctx) {
8721
8907
  });
8722
8908
  if (error) {
8723
8909
  ctx.addIssue({
8724
- code: z7.ZodIssueCode.custom,
8910
+ code: z8.ZodIssueCode.custom,
8725
8911
  message: error,
8726
8912
  path: ["steps", stepIndex, "if"]
8727
8913
  });
@@ -8734,7 +8920,7 @@ function validateManifestTemplateVariables(data, ctx) {
8734
8920
  });
8735
8921
  if (literalError) {
8736
8922
  ctx.addIssue({
8737
- code: z7.ZodIssueCode.custom,
8923
+ code: z8.ZodIssueCode.custom,
8738
8924
  message: literalError,
8739
8925
  path: ["steps", stepIndex, "if"]
8740
8926
  });
@@ -8756,7 +8942,7 @@ function validateManifestTemplateVariables(data, ctx) {
8756
8942
  unavailableStepRefs.add(parts[1]);
8757
8943
  } else {
8758
8944
  ctx.addIssue({
8759
- code: z7.ZodIssueCode.custom,
8945
+ code: z8.ZodIssueCode.custom,
8760
8946
  message: error,
8761
8947
  path: ["steps", stepIndex, "prompt"]
8762
8948
  });
@@ -8786,7 +8972,7 @@ function validateManifestTemplateVariables(data, ctx) {
8786
8972
  if (!error)
8787
8973
  continue;
8788
8974
  ctx.addIssue({
8789
- code: z7.ZodIssueCode.custom,
8975
+ code: z8.ZodIssueCode.custom,
8790
8976
  message: error,
8791
8977
  path: ["steps", stepIndex, fieldName]
8792
8978
  });
@@ -8803,14 +8989,14 @@ function validateManifestTemplateVariables(data, ctx) {
8803
8989
  const sourceType = step.type === "code" ? "code" : "prompt";
8804
8990
  const fieldName = step.type === "code" ? "code" : "prompt";
8805
8991
  ctx.addIssue({
8806
- code: z7.ZodIssueCode.custom,
8992
+ code: z8.ZodIssueCode.custom,
8807
8993
  message: `Step "${step.id}" ${sourceType} references step "${referencedStepId}" before it is available. Steps can only reference outputs from earlier steps.`,
8808
8994
  path: ["steps", stepIndex, fieldName]
8809
8995
  });
8810
8996
  }
8811
8997
  for (const err of propertyPathErrors) {
8812
8998
  ctx.addIssue({
8813
- code: z7.ZodIssueCode.custom,
8999
+ code: z8.ZodIssueCode.custom,
8814
9000
  message: err.message,
8815
9001
  path: err.path
8816
9002
  });
@@ -8825,45 +9011,45 @@ function validateManifestTemplateVariables(data, ctx) {
8825
9011
  }
8826
9012
 
8827
9013
  // ../../packages/core/dist/esm/schemas/admin-sample-automation.schema.js
8828
- var sampleAutomationIdSchema = z8.string().trim().min(1, "Sample automation ID is required").max(100, "Sample automation ID must be 100 characters or fewer").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Sample automation ID must use lowercase letters, numbers, and hyphens only");
8829
- var sampleAutomationInstructionsSchema = z8.string().nullable();
8830
- var adminSampleAutomationSchema = z8.object({
9014
+ var sampleAutomationIdSchema = z9.string().trim().min(1, "Sample automation ID is required").max(100, "Sample automation ID must be 100 characters or fewer").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Sample automation ID must use lowercase letters, numbers, and hyphens only");
9015
+ var sampleAutomationInstructionsSchema = z9.string().nullable();
9016
+ var adminSampleAutomationSchema = z9.object({
8831
9017
  id: sampleAutomationIdSchema,
8832
9018
  manifest: manifestSchema,
8833
9019
  instructions: sampleAutomationInstructionsSchema.default(null),
8834
- connectorNames: z8.array(z8.string()),
8835
- connectorDetails: z8.array(connectorDetailsSchema),
8836
- isPublished: z8.boolean(),
8837
- isOneClickInstallEnabled: z8.boolean().default(false),
8838
- staffPick: z8.boolean().default(false),
8839
- createdAt: z8.string().datetime(),
8840
- updatedAt: z8.string().datetime()
8841
- });
8842
- var adminSampleAutomationsSchema = z8.array(adminSampleAutomationSchema);
8843
- var createAdminSampleAutomationSchema = z8.object({
9020
+ connectorNames: z9.array(z9.string()),
9021
+ connectorDetails: z9.array(connectorDetailsSchema),
9022
+ isPublished: z9.boolean(),
9023
+ isOneClickInstallEnabled: z9.boolean().default(false),
9024
+ staffPick: z9.boolean().default(false),
9025
+ createdAt: z9.string().datetime(),
9026
+ updatedAt: z9.string().datetime()
9027
+ });
9028
+ var adminSampleAutomationsSchema = z9.array(adminSampleAutomationSchema);
9029
+ var createAdminSampleAutomationSchema = z9.object({
8844
9030
  id: sampleAutomationIdSchema,
8845
9031
  manifest: manifestSchema,
8846
9032
  instructions: sampleAutomationInstructionsSchema.default(null),
8847
- isPublished: z8.boolean().default(false),
8848
- isOneClickInstallEnabled: z8.boolean().default(false),
8849
- staffPick: z8.boolean().default(false)
9033
+ isPublished: z9.boolean().default(false),
9034
+ isOneClickInstallEnabled: z9.boolean().default(false),
9035
+ staffPick: z9.boolean().default(false)
8850
9036
  });
8851
- var updateAdminSampleAutomationSchema = z8.object({
9037
+ var updateAdminSampleAutomationSchema = z9.object({
8852
9038
  manifest: manifestSchema,
8853
9039
  instructions: sampleAutomationInstructionsSchema.optional(),
8854
- isPublished: z8.boolean(),
8855
- isOneClickInstallEnabled: z8.boolean().optional(),
8856
- staffPick: z8.boolean().optional()
9040
+ isPublished: z9.boolean(),
9041
+ isOneClickInstallEnabled: z9.boolean().optional(),
9042
+ staffPick: z9.boolean().optional()
8857
9043
  });
8858
- var toggleAdminSampleAutomationPublicationSchema = z8.object({
8859
- isPublished: z8.boolean()
9044
+ var toggleAdminSampleAutomationPublicationSchema = z9.object({
9045
+ isPublished: z9.boolean()
8860
9046
  });
8861
- var deleteAdminSampleAutomationSchema = z8.object({
8862
- title: z8.string().min(1, "Sample automation title confirmation is required")
9047
+ var deleteAdminSampleAutomationSchema = z9.object({
9048
+ title: z9.string().min(1, "Sample automation title confirmation is required")
8863
9049
  });
8864
9050
 
8865
9051
  // ../../packages/core/dist/esm/schemas/automation.schema.js
8866
- import { z as z10 } from "zod";
9052
+ import { z as z11 } from "zod";
8867
9053
 
8868
9054
  // ../../packages/core/dist/esm/types/automation.types.js
8869
9055
  var AUTOMATION_CONNECTION_STATUSES = ["ready", "almost-ready", "not-ready"];
@@ -8874,177 +9060,202 @@ var AUTOMATION_DISABLED_REASONS = [
8874
9060
  ];
8875
9061
 
8876
9062
  // ../../packages/core/dist/esm/schemas/connection.schema.js
8877
- import { z as z9 } from "zod";
8878
- var CreateConnectionParamsSchema = z9.object({
8879
- connectorId: z9.string(),
8880
- capability: z9.enum(CONNECTION_TYPES),
8881
- name: z9.string().optional()
8882
- });
8883
- var CreateConnectionBodySchema = z9.object({
8884
- automationIds: z9.array(z9.uuid()).optional()
8885
- });
8886
- var OAuthConnectionSetupSchema = z9.object({
8887
- kind: z9.literal("oauth"),
8888
- authorizationUrl: z9.string().url()
8889
- });
8890
- var ManagedConnectionSetupSchema = z9.object({
8891
- kind: z9.literal("managed"),
8892
- code: z9.string().regex(MANAGED_CONNECTION_SETUP_CODE_EXACT_REGEX),
8893
- instructions: z9.string(),
8894
- deepLinkUrl: z9.string().url().nullable(),
8895
- expiresAt: z9.iso.datetime()
8896
- });
8897
- var ConnectionSetupSchema = z9.discriminatedUnion("kind", [
9063
+ import { z as z10 } from "zod";
9064
+ var CreateConnectionParamsSchema = z10.object({
9065
+ connectorId: z10.string(),
9066
+ capability: z10.enum(CONNECTION_TYPES),
9067
+ name: z10.string().optional()
9068
+ });
9069
+ var CreateConnectionBodySchema = z10.object({
9070
+ automationIds: z10.array(z10.uuid()).optional()
9071
+ });
9072
+ var ImportLocalOAuthConnectionBodySchema = z10.object({
9073
+ /** The public client the CLI registered; the server bound the grant to it. */
9074
+ clientId: z10.string().min(1),
9075
+ accessToken: z10.string().min(1),
9076
+ refreshToken: z10.string().min(1).optional(),
9077
+ /** Seconds until `accessToken` expires, as the token endpoint reported it. */
9078
+ expiresIn: z10.number().int().positive().optional(),
9079
+ /**
9080
+ * A broken connection of the caller's, for the same connector, whose
9081
+ * automation bindings move to the new grant when the account cannot be
9082
+ * matched to it.
9083
+ */
9084
+ repairConnectionId: z10.uuid().optional()
9085
+ });
9086
+ var LocalOAuthSetupSchema = z10.object({
9087
+ /** RFC 7591 registration endpoint; null when the server offers none. */
9088
+ registrationEndpoint: z10.string().url().nullable(),
9089
+ authorizationEndpoint: z10.string().url(),
9090
+ tokenEndpoint: z10.string().url(),
9091
+ /** RFC 8707 resource indicator for the MCP server, when it advertises one. */
9092
+ resource: z10.string().url().nullable(),
9093
+ scopes: z10.array(z10.string())
9094
+ });
9095
+ var OAuthConnectionSetupSchema = z10.object({
9096
+ kind: z10.literal("oauth"),
9097
+ authorizationUrl: z10.string().url()
9098
+ });
9099
+ var ManagedConnectionSetupSchema = z10.object({
9100
+ kind: z10.literal("managed"),
9101
+ code: z10.string().regex(MANAGED_CONNECTION_SETUP_CODE_EXACT_REGEX),
9102
+ instructions: z10.string(),
9103
+ deepLinkUrl: z10.string().url().nullable(),
9104
+ expiresAt: z10.iso.datetime()
9105
+ });
9106
+ var ConnectionSetupSchema = z10.discriminatedUnion("kind", [
8898
9107
  OAuthConnectionSetupSchema,
8899
9108
  ManagedConnectionSetupSchema
8900
9109
  ]);
8901
- var CreateConnectionResponseSchema = z9.object({
8902
- connectionId: z9.uuid(),
9110
+ var CreateConnectionResponseSchema = z10.object({
9111
+ connectionId: z10.uuid(),
8903
9112
  setup: ConnectionSetupSchema.nullable()
8904
9113
  });
8905
- var ConnectionCapabilitySchema = z9.object({
8906
- capability: z9.enum(CONNECTION_TYPES),
8907
- scopes: z9.array(z9.string()),
8908
- authorizedAt: z9.iso.datetime()
8909
- });
8910
- var ConnectionSchema = z9.object({
8911
- id: z9.uuid(),
8912
- name: z9.string(),
8913
- connectorId: z9.string(),
8914
- connectorIconUrl: z9.url().nullable().optional(),
8915
- capabilities: z9.array(ConnectionCapabilitySchema),
8916
- accountDisplayLabel: z9.string().optional(),
8917
- status: z9.enum(CONNECTION_STATUSES).optional(),
8918
- createdAt: z9.string().optional(),
8919
- metadata: z9.record(z9.string(), z9.unknown()),
9114
+ var ConnectionCapabilitySchema = z10.object({
9115
+ capability: z10.enum(CONNECTION_TYPES),
9116
+ scopes: z10.array(z10.string()),
9117
+ authorizedAt: z10.iso.datetime()
9118
+ });
9119
+ var ConnectionSchema = z10.object({
9120
+ id: z10.uuid(),
9121
+ name: z10.string(),
9122
+ connectorId: z10.string(),
9123
+ connectorIconUrl: z10.url().nullable().optional(),
9124
+ capabilities: z10.array(ConnectionCapabilitySchema),
9125
+ accountDisplayLabel: z10.string().optional(),
9126
+ status: z10.enum(CONNECTION_STATUSES).optional(),
9127
+ createdAt: z10.string().optional(),
9128
+ metadata: z10.record(z10.string(), z10.unknown()),
8920
9129
  setup: ConnectionSetupSchema.nullable()
8921
9130
  });
8922
- var ConnectionDetailsSchema = z9.object({
8923
- id: z9.uuid(),
8924
- name: z9.string(),
8925
- connectorId: z9.string(),
8926
- connectorIconUrl: z9.url().nullable().optional(),
8927
- capabilities: z9.array(ConnectionCapabilitySchema),
8928
- accountDisplayLabel: z9.string(),
8929
- status: z9.enum(CONNECTION_STATUSES),
8930
- createdAt: z9.string(),
8931
- metadata: z9.record(z9.string(), z9.unknown()),
9131
+ var ConnectionDetailsSchema = z10.object({
9132
+ id: z10.uuid(),
9133
+ name: z10.string(),
9134
+ connectorId: z10.string(),
9135
+ connectorIconUrl: z10.url().nullable().optional(),
9136
+ capabilities: z10.array(ConnectionCapabilitySchema),
9137
+ accountDisplayLabel: z10.string(),
9138
+ status: z10.enum(CONNECTION_STATUSES),
9139
+ createdAt: z10.string(),
9140
+ metadata: z10.record(z10.string(), z10.unknown()),
8932
9141
  setup: ConnectionSetupSchema.nullable()
8933
9142
  });
8934
- var GetConnectionsQuerySchema = z9.object({
9143
+ var GetConnectionsQuerySchema = z10.object({
8935
9144
  /**
8936
9145
  * Capability filter. `type` is accepted as a deprecated alias during the
8937
9146
  * rolling-deploy window where older FE/SDK builds may still send the old
8938
9147
  * query param. Remove once all clients are on the post-PR1 SDK.
8939
9148
  */
8940
- capability: z9.enum(CONNECTION_TYPES).optional(),
8941
- type: z9.enum(CONNECTION_TYPES).optional(),
8942
- connectorId: z9.string().optional(),
8943
- status: z9.enum(CONNECTION_STATUSES).optional()
9149
+ capability: z10.enum(CONNECTION_TYPES).optional(),
9150
+ type: z10.enum(CONNECTION_TYPES).optional(),
9151
+ connectorId: z10.string().optional(),
9152
+ status: z10.enum(CONNECTION_STATUSES).optional()
8944
9153
  });
8945
- var GetConnectionsResponseSchema = z9.object({
8946
- connections: z9.array(ConnectionSchema)
9154
+ var GetConnectionsResponseSchema = z10.object({
9155
+ connections: z10.array(ConnectionSchema)
8947
9156
  });
8948
- var DependentAutomationSchema = z9.object({
8949
- id: z9.string(),
8950
- name: z9.string(),
8951
- description: z9.string(),
8952
- enabled: z9.boolean(),
8953
- connectorStatus: z9.enum(["ready", "attention", "missing"]),
8954
- requiredConnectionTypes: z9.array(z9.enum(CONNECTION_TYPES))
9157
+ var DependentAutomationSchema = z10.object({
9158
+ id: z10.string(),
9159
+ name: z10.string(),
9160
+ description: z10.string(),
9161
+ enabled: z10.boolean(),
9162
+ connectorStatus: z10.enum(["ready", "attention", "missing"]),
9163
+ requiredConnectionTypes: z10.array(z10.enum(CONNECTION_TYPES))
8955
9164
  });
8956
- var GetConnectionDependentAutomationsResponseSchema = z9.object({
8957
- automations: z9.array(DependentAutomationSchema)
9165
+ var GetConnectionDependentAutomationsResponseSchema = z10.object({
9166
+ automations: z10.array(DependentAutomationSchema)
8958
9167
  });
8959
9168
  var CONNECTION_IN_USE_CONFLICT_CODE = "connection_in_use_conflict";
8960
- var BlockingAutomationSchema = z9.object({
8961
- id: z9.string(),
8962
- name: z9.string()
9169
+ var BlockingAutomationSchema = z10.object({
9170
+ id: z10.string(),
9171
+ name: z10.string()
8963
9172
  });
8964
- var ConnectionInUseConflictSchema = z9.object({
8965
- code: z9.literal(CONNECTION_IN_USE_CONFLICT_CODE),
8966
- message: z9.string(),
8967
- automations: z9.array(BlockingAutomationSchema)
9173
+ var ConnectionInUseConflictSchema = z10.object({
9174
+ code: z10.literal(CONNECTION_IN_USE_CONFLICT_CODE),
9175
+ message: z10.string(),
9176
+ automations: z10.array(BlockingAutomationSchema)
8968
9177
  });
8969
9178
 
8970
9179
  // ../../packages/core/dist/esm/schemas/automation.schema.js
8971
- var runStatusSchema = z10.discriminatedUnion("status", [
8972
- z10.object({
8973
- status: z10.literal("pending"),
8974
- lastRun: z10.iso.datetime().optional()
9180
+ var runStatusSchema = z11.discriminatedUnion("status", [
9181
+ z11.object({
9182
+ status: z11.literal("pending"),
9183
+ lastRun: z11.iso.datetime().optional()
8975
9184
  }),
8976
- z10.object({
8977
- status: z10.literal("running"),
8978
- lastRun: z10.iso.datetime()
9185
+ z11.object({
9186
+ status: z11.literal("running"),
9187
+ lastRun: z11.iso.datetime()
8979
9188
  }),
8980
- z10.object({
8981
- status: z10.literal("completed"),
8982
- lastRun: z10.iso.datetime()
9189
+ z11.object({
9190
+ status: z11.literal("completed"),
9191
+ lastRun: z11.iso.datetime()
8983
9192
  }),
8984
- z10.object({
8985
- status: z10.literal("failed"),
8986
- lastRun: z10.iso.datetime(),
8987
- failureReason: z10.string().optional()
9193
+ z11.object({
9194
+ status: z11.literal("failed"),
9195
+ lastRun: z11.iso.datetime(),
9196
+ failureReason: z11.string().optional()
8988
9197
  }),
8989
- z10.object({
8990
- status: z10.literal("cancelled"),
8991
- lastRun: z10.iso.datetime()
9198
+ z11.object({
9199
+ status: z11.literal("cancelled"),
9200
+ lastRun: z11.iso.datetime()
8992
9201
  }),
8993
- z10.object({
8994
- status: z10.literal("skipped"),
8995
- lastRun: z10.iso.datetime(),
8996
- skipReason: z10.string().optional(),
8997
- skipCategory: z10.enum(SKIP_CATEGORIES).optional()
9202
+ z11.object({
9203
+ status: z11.literal("skipped"),
9204
+ lastRun: z11.iso.datetime(),
9205
+ skipReason: z11.string().optional(),
9206
+ skipCategory: z11.enum(SKIP_CATEGORIES).optional()
8998
9207
  })
8999
9208
  ]);
9000
- var automationSchema = z10.object({
9001
- id: z10.string(),
9002
- connections: z10.array(ConnectionDetailsSchema),
9003
- enabled: z10.boolean(),
9209
+ var automationSchema = z11.object({
9210
+ id: z11.string(),
9211
+ connections: z11.array(ConnectionDetailsSchema),
9212
+ enabled: z11.boolean(),
9004
9213
  status: runStatusSchema,
9005
- connectionStatus: z10.enum(AUTOMATION_CONNECTION_STATUSES),
9006
- draftId: z10.string().nullable(),
9007
- manifest: z10.union([manifestSchema, z10.record(z10.string(), z10.unknown())]).nullable(),
9008
- updatedAt: z10.iso.datetime(),
9214
+ connectionStatus: z11.enum(AUTOMATION_CONNECTION_STATUSES),
9215
+ draftId: z11.string().nullable(),
9216
+ manifest: z11.union([manifestSchema, z11.record(z11.string(), z11.unknown())]).nullable(),
9217
+ updatedAt: z11.iso.datetime(),
9218
+ // The person who created the automation; null only from an API instance that predates it.
9219
+ createdBy: RolloutCompatibleNullableStringSchema,
9009
9220
  // The last person who changed the automation; null until someone has.
9010
9221
  updatedBy: RolloutCompatibleNullableStringSchema,
9011
9222
  // null means the automation belongs to the creator's personal space
9012
- workspaceId: z10.string().nullable(),
9013
- visibility: z10.enum(AUTOMATION_VISIBILITIES),
9014
- isOwner: z10.boolean(),
9015
- disabledReason: z10.enum(AUTOMATION_DISABLED_REASONS).nullable()
9223
+ workspaceId: z11.string().nullable(),
9224
+ visibility: z11.enum(AUTOMATION_VISIBILITIES),
9225
+ isOwner: z11.boolean(),
9226
+ disabledReason: z11.enum(AUTOMATION_DISABLED_REASONS).nullable()
9016
9227
  });
9017
- var automationListResponseSchema = z10.object({
9018
- data: z10.array(automationSchema),
9019
- nextCursor: z10.string().nullable()
9228
+ var automationListResponseSchema = z11.object({
9229
+ data: z11.array(automationSchema),
9230
+ nextCursor: z11.string().nullable()
9020
9231
  });
9021
- var updateAutomationSchema = z10.object({
9022
- enabled: z10.boolean().optional(),
9232
+ var updateAutomationSchema = z11.object({
9233
+ enabled: z11.boolean().optional(),
9023
9234
  manifest: manifestSchema.optional()
9024
9235
  }).refine((data) => Object.keys(data).length > 0, {
9025
9236
  message: "At least one field must be provided"
9026
9237
  });
9027
- var updateAutomationMetadataSchema = z10.object({
9028
- name: z10.string().min(1),
9029
- description: z10.string()
9238
+ var updateAutomationMetadataSchema = z11.object({
9239
+ name: z11.string().min(1),
9240
+ description: z11.string()
9030
9241
  });
9031
- var updateAutomationScheduleSchema = z10.object({
9242
+ var updateAutomationScheduleSchema = z11.object({
9032
9243
  value: scheduleValueSchema
9033
9244
  });
9034
- var updateAutomationVisibilitySchema = z10.object({
9035
- visibility: z10.enum(AUTOMATION_VISIBILITIES)
9245
+ var updateAutomationVisibilitySchema = z11.object({
9246
+ visibility: z11.enum(AUTOMATION_VISIBILITIES)
9036
9247
  });
9037
- var moveAutomationSchema = z10.object({
9038
- visibility: z10.enum(AUTOMATION_VISIBILITIES).default("workspace")
9248
+ var moveAutomationSchema = z11.object({
9249
+ visibility: z11.enum(AUTOMATION_VISIBILITIES).default("workspace")
9039
9250
  });
9040
9251
 
9041
9252
  // ../../packages/core/dist/esm/schemas/automation-connection.schema.js
9042
- import z11 from "zod";
9043
- var AutomationConnectionMappingSchema = z11.object({
9044
- connectorId: z11.string().trim().min(1, "connectorId is required"),
9045
- connectionId: z11.string().trim().min(1, "connectionId is required")
9253
+ import z12 from "zod";
9254
+ var AutomationConnectionMappingSchema = z12.object({
9255
+ connectorId: z12.string().trim().min(1, "connectorId is required"),
9256
+ connectionId: z12.string().trim().min(1, "connectionId is required")
9046
9257
  }).strict();
9047
- var UpsertAutomationConnectionSchema = z11.object({
9258
+ var UpsertAutomationConnectionSchema = z12.object({
9048
9259
  connectionId: uuidv7Schema.min(1, "connectionId is required"),
9049
9260
  /**
9050
9261
  * Manifest slot to bind this connection to. Required when the
@@ -9053,37 +9264,37 @@ var UpsertAutomationConnectionSchema = z11.object({
9053
9264
  * onboarding). Optional for single-capability connections, where
9054
9265
  * the service infers the role from `connection.capabilities[0]`.
9055
9266
  */
9056
- connectionType: z11.enum(CONNECTION_TYPES).optional()
9267
+ connectionType: z12.enum(CONNECTION_TYPES).optional()
9057
9268
  }).strict();
9058
- var SetAutomationConnectionsSchema = z11.object({
9059
- mappings: z11.array(AutomationConnectionMappingSchema).nonempty("mappings cannot be empty")
9269
+ var SetAutomationConnectionsSchema = z12.object({
9270
+ mappings: z12.array(AutomationConnectionMappingSchema).nonempty("mappings cannot be empty")
9060
9271
  }).strict();
9061
- var RequiredConnectorSchema = z11.object({
9062
- connectorName: z11.string(),
9063
- connectorId: z11.string(),
9064
- connectorDisplayName: z11.string(),
9065
- description: z11.string(),
9066
- connectorIconUrl: z11.string().nullable(),
9067
- requiredTypes: z11.array(z11.enum(CONNECTION_TYPES)),
9272
+ var RequiredConnectorSchema = z12.object({
9273
+ connectorName: z12.string(),
9274
+ connectorId: z12.string(),
9275
+ connectorDisplayName: z12.string(),
9276
+ description: z12.string(),
9277
+ connectorIconUrl: z12.string().nullable(),
9278
+ requiredTypes: z12.array(z12.enum(CONNECTION_TYPES)),
9068
9279
  /** Whether uses of this connector require a Connection binding. */
9069
- requiresConnection: z11.boolean(),
9280
+ requiresConnection: z12.boolean(),
9070
9281
  /**
9071
9282
  * Product-owned built-in status. Connection validation uses
9072
9283
  * `requiresConnection` independently from this UI classification.
9073
9284
  */
9074
- isSystem: z11.boolean().optional()
9075
- });
9076
- var AutomationConnectionSchema = z11.object({
9077
- connectorId: z11.string(),
9078
- connectionId: z11.uuid(),
9079
- connectorName: z11.string(),
9080
- connectorIconUrl: z11.url().nullable().optional(),
9081
- status: z11.enum(CONNECTION_STATUSES),
9082
- type: z11.enum(CONNECTION_TYPES)
9083
- });
9084
- var ConnectorTypeStatusSchema = z11.object({
9085
- required: z11.boolean(),
9086
- status: z11.enum(CONNECTOR_TYPE_STATUSES),
9285
+ isSystem: z12.boolean().optional()
9286
+ });
9287
+ var AutomationConnectionSchema = z12.object({
9288
+ connectorId: z12.string(),
9289
+ connectionId: z12.uuid(),
9290
+ connectorName: z12.string(),
9291
+ connectorIconUrl: z12.url().nullable().optional(),
9292
+ status: z12.enum(CONNECTION_STATUSES),
9293
+ type: z12.enum(CONNECTION_TYPES)
9294
+ });
9295
+ var ConnectorTypeStatusSchema = z12.object({
9296
+ required: z12.boolean(),
9297
+ status: z12.enum(CONNECTOR_TYPE_STATUSES),
9087
9298
  connection: ConnectionSchema.pick({
9088
9299
  id: true,
9089
9300
  accountDisplayLabel: true,
@@ -9092,32 +9303,32 @@ var ConnectorTypeStatusSchema = z11.object({
9092
9303
  }).optional(),
9093
9304
  setup: ConnectionSetupSchema.nullable()
9094
9305
  });
9095
- var AutomationConnectorStatusSchema = z11.object({
9096
- id: z11.string(),
9097
- name: z11.string(),
9098
- description: z11.string(),
9099
- iconUrl: z11.string().nullable(),
9306
+ var AutomationConnectorStatusSchema = z12.object({
9307
+ id: z12.string(),
9308
+ name: z12.string(),
9309
+ description: z12.string(),
9310
+ iconUrl: z12.string().nullable(),
9100
9311
  mcp: ConnectorTypeStatusSchema,
9101
9312
  trigger: ConnectorTypeStatusSchema
9102
9313
  });
9103
- var AutomationConnectionValidationSchema = z11.object({
9104
- required: z11.array(RequiredConnectorSchema),
9105
- mapped: z11.array(AutomationConnectionSchema),
9106
- missing: z11.array(z11.object({
9107
- connectorName: z11.string(),
9108
- connectionType: z11.enum(CONNECTION_TYPES),
9109
- reason: z11.enum(CONNECTION_ISSUE_REASONS)
9314
+ var AutomationConnectionValidationSchema = z12.object({
9315
+ required: z12.array(RequiredConnectorSchema),
9316
+ mapped: z12.array(AutomationConnectionSchema),
9317
+ missing: z12.array(z12.object({
9318
+ connectorName: z12.string(),
9319
+ connectionType: z12.enum(CONNECTION_TYPES),
9320
+ reason: z12.enum(CONNECTION_ISSUE_REASONS)
9110
9321
  })),
9111
- connectors: z11.array(AutomationConnectorStatusSchema),
9112
- isReady: z11.boolean()
9322
+ connectors: z12.array(AutomationConnectorStatusSchema),
9323
+ isReady: z12.boolean()
9113
9324
  });
9114
- var GetRequiredConnectorsResponseSchema = z11.object({
9115
- required: z11.array(RequiredConnectorSchema)
9325
+ var GetRequiredConnectorsResponseSchema = z12.object({
9326
+ required: z12.array(RequiredConnectorSchema)
9116
9327
  });
9117
- var GetAutomationConnectionsResponseSchema = z11.object({
9118
- data: z11.array(AutomationConnectionSchema)
9328
+ var GetAutomationConnectionsResponseSchema = z12.object({
9329
+ data: z12.array(AutomationConnectionSchema)
9119
9330
  });
9120
- var UpsertAutomationConnectionResponseSchema = z11.object({
9331
+ var UpsertAutomationConnectionResponseSchema = z12.object({
9121
9332
  data: AutomationConnectionSchema
9122
9333
  });
9123
9334
  var ManifestConnectionCheckResultSchema = AutomationConnectionValidationSchema.pick({
@@ -9126,389 +9337,402 @@ var ManifestConnectionCheckResultSchema = AutomationConnectionValidationSchema.p
9126
9337
  });
9127
9338
 
9128
9339
  // ../../packages/core/dist/esm/schemas/automation-execution.schema.js
9129
- import { z as z12 } from "zod";
9130
- var AutomationRunDebugEventSchema = z12.union([
9131
- z12.object({
9132
- stepId: z12.string(),
9340
+ import { z as z13 } from "zod";
9341
+ var AutomationRunDebugEventSchema = z13.union([
9342
+ z13.object({
9343
+ stepId: z13.string(),
9133
9344
  reason: AutomationRunDebugReasonSchema.exclude(["run-result-not-configured"])
9134
9345
  }),
9135
- z12.object({
9136
- reason: z12.literal("run-result-not-configured")
9346
+ z13.object({
9347
+ reason: z13.literal("run-result-not-configured")
9137
9348
  }).strict()
9138
9349
  ]);
9139
- var groundingMetadataSchema = z12.object({
9140
- webSearchQueries: z12.array(z12.string()).optional(),
9141
- searchEntryPoint: z12.object({
9142
- renderedContent: z12.string().optional()
9350
+ var groundingMetadataSchema = z13.object({
9351
+ webSearchQueries: z13.array(z13.string()).optional(),
9352
+ searchEntryPoint: z13.object({
9353
+ renderedContent: z13.string().optional()
9143
9354
  }).optional(),
9144
- groundingChunks: z12.array(z12.object({
9145
- web: z12.object({
9146
- uri: z12.string(),
9147
- title: z12.string().optional(),
9148
- domain: z12.string().optional()
9355
+ groundingChunks: z13.array(z13.object({
9356
+ web: z13.object({
9357
+ uri: z13.string(),
9358
+ title: z13.string().optional(),
9359
+ domain: z13.string().optional()
9149
9360
  }).optional()
9150
9361
  })).optional(),
9151
- groundingSupports: z12.array(z12.object({
9152
- segment: z12.object({
9153
- startIndex: z12.number(),
9154
- endIndex: z12.number(),
9155
- text: z12.string().optional()
9362
+ groundingSupports: z13.array(z13.object({
9363
+ segment: z13.object({
9364
+ startIndex: z13.number(),
9365
+ endIndex: z13.number(),
9366
+ text: z13.string().optional()
9156
9367
  }),
9157
- groundingChunkIndices: z12.array(z12.number()),
9158
- confidenceScores: z12.array(z12.number()).optional()
9368
+ groundingChunkIndices: z13.array(z13.number()),
9369
+ confidenceScores: z13.array(z13.number()).optional()
9159
9370
  })).optional(),
9160
- retrievalMetadata: z12.record(z12.string(), z12.unknown()).optional()
9371
+ retrievalMetadata: z13.record(z13.string(), z13.unknown()).optional()
9161
9372
  });
9162
- var automationStepUsageSchema = z12.object({
9163
- inputTokens: z12.number().nonnegative(),
9164
- outputTokens: z12.number().nonnegative(),
9165
- totalTokens: z12.number().nonnegative(),
9166
- totalCostMicroDollars: z12.number().nonnegative()
9373
+ var automationStepUsageSchema = z13.object({
9374
+ inputTokens: z13.number().nonnegative(),
9375
+ outputTokens: z13.number().nonnegative(),
9376
+ totalTokens: z13.number().nonnegative(),
9377
+ totalCostMicroDollars: z13.number().nonnegative()
9167
9378
  });
9168
- var automationOutputSchema = z12.object({
9169
- stepId: z12.string(),
9170
- result: z12.unknown(),
9379
+ var automationOutputSchema = z13.object({
9380
+ stepId: z13.string(),
9381
+ result: z13.unknown(),
9171
9382
  toolCalls: ToolCallDtosSchema.optional(),
9172
- generatedCode: z12.string().optional(),
9383
+ generatedCode: z13.string().optional(),
9173
9384
  groundingMetadata: groundingMetadataSchema.optional(),
9174
9385
  usage: automationStepUsageSchema.optional()
9175
9386
  });
9176
- var automationExecutionResultSchema = z12.discriminatedUnion("status", [
9177
- z12.object({
9178
- status: z12.literal("success"),
9179
- outputs: z12.array(automationOutputSchema),
9180
- debugEvents: z12.array(AutomationRunDebugEventSchema).optional()
9387
+ var automationExecutionResultSchema = z13.discriminatedUnion("status", [
9388
+ z13.object({
9389
+ status: z13.literal("success"),
9390
+ outputs: z13.array(automationOutputSchema),
9391
+ debugEvents: z13.array(AutomationRunDebugEventSchema).optional()
9181
9392
  }),
9182
- z12.object({
9183
- status: z12.literal("skipped"),
9184
- skipReason: z12.string()
9393
+ z13.object({
9394
+ status: z13.literal("skipped"),
9395
+ skipReason: z13.string()
9185
9396
  })
9186
9397
  ]);
9187
9398
 
9188
9399
  // ../../packages/core/dist/esm/schemas/automation-draft.schema.js
9189
- import { z as z13 } from "zod";
9190
- var automationDraftSchema = z13.object({
9191
- id: z13.string(),
9192
- partialManifest: z13.record(z13.string(), z13.unknown()),
9193
- isComplete: z13.boolean(),
9194
- automationId: z13.string().nullable(),
9400
+ import { z as z14 } from "zod";
9401
+ var automationDraftSchema = z14.object({
9402
+ id: z14.string(),
9403
+ partialManifest: z14.record(z14.string(), z14.unknown()),
9404
+ isComplete: z14.boolean(),
9405
+ automationId: z14.string().nullable(),
9195
9406
  conversationId: RolloutCompatibleNullableStringSchema,
9196
9407
  // null means the draft was authored in the creator's personal space
9197
- workspaceId: z13.string().nullable(),
9198
- createdAt: z13.string(),
9199
- updatedAt: z13.string(),
9200
- connectorDetails: z13.array(connectorDetailsSchema).optional()
9408
+ workspaceId: z14.string().nullable(),
9409
+ createdAt: z14.string(),
9410
+ updatedAt: z14.string(),
9411
+ connectorDetails: z14.array(connectorDetailsSchema).optional()
9201
9412
  });
9202
- var automationDraftValidationSchema = z13.object({
9203
- state: z13.enum(["incomplete", "ready"]),
9204
- issues: z13.array(z13.string()),
9205
- modified: z13.boolean()
9413
+ var automationDraftValidationSchema = z14.object({
9414
+ state: z14.enum(["incomplete", "ready"]),
9415
+ issues: z14.array(z14.string()),
9416
+ modified: z14.boolean()
9206
9417
  });
9207
9418
  var automationDraftWithValidationSchema = automationDraftValidationSchema.extend({
9208
9419
  draft: automationDraftSchema
9209
9420
  });
9210
- var automationDraftListResponseSchema = z13.object({
9211
- data: z13.array(automationDraftSchema),
9212
- nextCursor: z13.string().nullable()
9421
+ var automationDraftListResponseSchema = z14.object({
9422
+ data: z14.array(automationDraftSchema),
9423
+ nextCursor: z14.string().nullable()
9213
9424
  });
9214
- var finalizeAutomationDraftResponseSchema = z13.object({
9425
+ var finalizeAutomationDraftResponseSchema = z14.object({
9215
9426
  automation: automationSchema
9216
9427
  });
9217
- var testAutomationDraftResponseSchema = z13.object({
9218
- success: z13.literal(true)
9428
+ var testAutomationDraftResponseSchema = z14.object({
9429
+ success: z14.literal(true)
9430
+ });
9431
+ var AUTOMATION_OPEN_DRAFT_CONFLICT_CODE = "automation_open_draft_conflict";
9432
+ var AutomationOpenDraftConflictSchema = z14.object({
9433
+ code: z14.literal(AUTOMATION_OPEN_DRAFT_CONFLICT_CODE),
9434
+ message: z14.string(),
9435
+ draftId: z14.string()
9436
+ });
9437
+ var AUTOMATION_DRAFT_NOT_READY_CODE = "automation_draft_not_ready";
9438
+ var AutomationDraftNotReadySchema = z14.object({
9439
+ code: z14.literal(AUTOMATION_DRAFT_NOT_READY_CODE),
9440
+ message: z14.string()
9219
9441
  });
9220
9442
 
9221
9443
  // ../../packages/core/dist/esm/schemas/automation-draft-connection.schema.js
9222
- import z14 from "zod";
9223
- var CreateAutomationDraftConnectionSchema = z14.object({
9224
- connectorId: z14.string().trim().min(1, "connectorId is required"),
9225
- connectionType: z14.enum(CONNECTION_TYPES),
9444
+ import z15 from "zod";
9445
+ var CreateAutomationDraftConnectionSchema = z15.object({
9446
+ connectorId: z15.string().trim().min(1, "connectorId is required"),
9447
+ connectionType: z15.enum(CONNECTION_TYPES),
9226
9448
  connectionId: uuidv7Schema.min(1, "connectionId is required")
9227
9449
  }).strict();
9228
- var AutomationDraftConnectionSchema = z14.object({
9229
- draftId: z14.string(),
9230
- connectorId: z14.string(),
9231
- connectionId: z14.uuid(),
9232
- connectionType: z14.enum(CONNECTION_TYPES),
9233
- connectorName: z14.string(),
9234
- connectorIconUrl: z14.url().nullable().optional(),
9235
- status: z14.enum(CONNECTION_STATUSES),
9236
- createdAt: z14.string(),
9237
- updatedAt: z14.string()
9238
- });
9239
- var AutomationDraftConnectorStatusSchema = z14.object({
9240
- id: z14.string(),
9241
- name: z14.string(),
9242
- description: z14.string(),
9243
- iconUrl: z14.string().nullable(),
9450
+ var AutomationDraftConnectionSchema = z15.object({
9451
+ draftId: z15.string(),
9452
+ connectorId: z15.string(),
9453
+ connectionId: z15.uuid(),
9454
+ connectionType: z15.enum(CONNECTION_TYPES),
9455
+ connectorName: z15.string(),
9456
+ connectorIconUrl: z15.url().nullable().optional(),
9457
+ status: z15.enum(CONNECTION_STATUSES),
9458
+ createdAt: z15.string(),
9459
+ updatedAt: z15.string()
9460
+ });
9461
+ var AutomationDraftConnectorStatusSchema = z15.object({
9462
+ id: z15.string(),
9463
+ name: z15.string(),
9464
+ description: z15.string(),
9465
+ iconUrl: z15.string().nullable(),
9244
9466
  mcp: ConnectorTypeStatusSchema,
9245
9467
  trigger: ConnectorTypeStatusSchema
9246
9468
  });
9247
- var AutomationDraftConnectionValidationSchema = z14.object({
9248
- draftId: z14.string(),
9249
- connected: z14.array(AutomationDraftConnectionSchema),
9250
- missing: z14.array(z14.object({
9251
- connectorName: z14.string(),
9252
- connectionType: z14.enum(CONNECTION_TYPES),
9253
- reason: z14.enum(CONNECTION_ISSUE_REASONS)
9469
+ var AutomationDraftConnectionValidationSchema = z15.object({
9470
+ draftId: z15.string(),
9471
+ connected: z15.array(AutomationDraftConnectionSchema),
9472
+ missing: z15.array(z15.object({
9473
+ connectorName: z15.string(),
9474
+ connectionType: z15.enum(CONNECTION_TYPES),
9475
+ reason: z15.enum(CONNECTION_ISSUE_REASONS)
9254
9476
  })),
9255
- connectors: z14.array(AutomationDraftConnectorStatusSchema),
9256
- isValid: z14.boolean()
9477
+ connectors: z15.array(AutomationDraftConnectorStatusSchema),
9478
+ isValid: z15.boolean()
9257
9479
  });
9258
- var GetAutomationDraftConnectionsResponseSchema = z14.object({
9259
- connections: z14.array(AutomationDraftConnectionSchema)
9480
+ var GetAutomationDraftConnectionsResponseSchema = z15.object({
9481
+ connections: z15.array(AutomationDraftConnectionSchema)
9260
9482
  });
9261
- var GetAutomationDraftConnectionValidationResponseSchema = z14.object({
9483
+ var GetAutomationDraftConnectionValidationResponseSchema = z15.object({
9262
9484
  validation: AutomationDraftConnectionValidationSchema
9263
9485
  });
9264
9486
 
9265
9487
  // ../../packages/core/dist/esm/schemas/automation-draft-message.schema.js
9266
- import { z as z15 } from "zod";
9267
- var saveMessageSchema = z15.object({
9268
- role: z15.string(),
9269
- parts: z15.unknown(),
9270
- order: z15.number(),
9271
- messageId: z15.string()
9488
+ import { z as z16 } from "zod";
9489
+ var saveMessageSchema = z16.object({
9490
+ role: z16.string(),
9491
+ parts: z16.unknown(),
9492
+ order: z16.number(),
9493
+ messageId: z16.string()
9272
9494
  });
9273
9495
 
9274
9496
  // ../../packages/core/dist/esm/schemas/chat.schema.js
9275
- import { z as z16 } from "zod";
9276
- var chatConversationSchema = z16.object({
9277
- id: z16.string(),
9278
- title: z16.string().nullable(),
9279
- archivedAt: z16.string().nullable(),
9280
- isArchived: z16.boolean(),
9281
- todoistUserId: z16.string(),
9497
+ import { z as z17 } from "zod";
9498
+ var chatConversationSchema = z17.object({
9499
+ id: z17.string(),
9500
+ title: z17.string().nullable(),
9501
+ archivedAt: z17.string().nullable(),
9502
+ isArchived: z17.boolean(),
9503
+ todoistUserId: z17.string(),
9282
9504
  // null means the conversation was authored in the user's personal space
9283
- workspaceId: z16.string().nullable(),
9284
- createdAt: z16.string(),
9285
- updatedAt: z16.string()
9505
+ workspaceId: z17.string().nullable(),
9506
+ createdAt: z17.string(),
9507
+ updatedAt: z17.string()
9286
9508
  });
9287
9509
  var chatMessageSchema = saveMessageSchema;
9288
- var getConversationsResponseSchema = z16.array(chatConversationSchema);
9289
- var getMessagesResponseSchema = z16.array(chatMessageSchema);
9290
- var chatCompactionStatusSchema = z16.enum(["starting", "complete", "failed"]);
9291
- var chatCompactionBlockerSchema = z16.enum([
9510
+ var getConversationsResponseSchema = z17.array(chatConversationSchema);
9511
+ var getMessagesResponseSchema = z17.array(chatMessageSchema);
9512
+ var chatCompactionStatusSchema = z17.enum(["starting", "complete", "failed"]);
9513
+ var chatCompactionBlockerSchema = z17.enum([
9292
9514
  "none",
9293
9515
  "insufficient_messages",
9294
9516
  "trailing_unanswered_user",
9295
9517
  "incomplete_tool_interaction"
9296
9518
  ]);
9297
- var chatCompactionResultStatusSchema = z16.enum(["compacted", "skipped", "stale", "failed"]);
9298
- var chatCompactionStatusDataSchema = z16.object({
9519
+ var chatCompactionResultStatusSchema = z17.enum(["compacted", "skipped", "stale", "failed"]);
9520
+ var chatCompactionStatusDataSchema = z17.object({
9299
9521
  status: chatCompactionStatusSchema,
9300
- conversationId: z16.string(),
9301
- compactionId: z16.string(),
9302
- message: z16.string()
9303
- });
9304
- var chatCompactionTelemetryDataSchema = z16.object({
9305
- kind: z16.literal("telemetry"),
9306
- phase: z16.enum(["snapshot", "post-compaction"]),
9307
- conversationId: z16.string(),
9308
- compactionId: z16.string().nullable(),
9309
- triggerMessages: z16.number().int().positive(),
9310
- triggerTokens: z16.number().int().positive(),
9311
- hardMaxTokens: z16.number().int().positive(),
9312
- preserveRecentTurns: z16.number().int().positive(),
9313
- messageCountAfterCutoff: z16.number().int().nonnegative(),
9314
- estimatedTokens: z16.number().int().nonnegative(),
9315
- thresholdProgressPercent: z16.number().int().min(0).max(100),
9316
- shouldCompact: z16.boolean(),
9317
- boundaryEligible: z16.boolean(),
9522
+ conversationId: z17.string(),
9523
+ compactionId: z17.string(),
9524
+ message: z17.string()
9525
+ });
9526
+ var chatCompactionTelemetryDataSchema = z17.object({
9527
+ kind: z17.literal("telemetry"),
9528
+ phase: z17.enum(["snapshot", "post-compaction"]),
9529
+ conversationId: z17.string(),
9530
+ compactionId: z17.string().nullable(),
9531
+ triggerMessages: z17.number().int().positive(),
9532
+ triggerTokens: z17.number().int().positive(),
9533
+ hardMaxTokens: z17.number().int().positive(),
9534
+ preserveRecentTurns: z17.number().int().positive(),
9535
+ messageCountAfterCutoff: z17.number().int().nonnegative(),
9536
+ estimatedTokens: z17.number().int().nonnegative(),
9537
+ thresholdProgressPercent: z17.number().int().min(0).max(100),
9538
+ shouldCompact: z17.boolean(),
9539
+ boundaryEligible: z17.boolean(),
9318
9540
  blocker: chatCompactionBlockerSchema,
9319
- attempted: z16.boolean(),
9541
+ attempted: z17.boolean(),
9320
9542
  resultStatus: chatCompactionResultStatusSchema.nullable(),
9321
- messagesSummarized: z16.number().int().nonnegative().nullable(),
9322
- cutoffOrder: z16.number().int().positive().nullable()
9543
+ messagesSummarized: z17.number().int().nonnegative().nullable(),
9544
+ cutoffOrder: z17.number().int().positive().nullable()
9323
9545
  });
9324
- var chatCompactionDataSchema = z16.union([
9546
+ var chatCompactionDataSchema = z17.union([
9325
9547
  chatCompactionStatusDataSchema,
9326
9548
  chatCompactionTelemetryDataSchema
9327
9549
  ]);
9328
- var chatCompactionDataPartSchema = z16.object({
9329
- type: z16.literal("data-compaction"),
9550
+ var chatCompactionDataPartSchema = z17.object({
9551
+ type: z17.literal("data-compaction"),
9330
9552
  data: chatCompactionDataSchema
9331
9553
  });
9332
- var chatConversationTitleUpdatedDataSchema = z16.object({
9333
- kind: z16.literal("conversation-title-updated"),
9334
- conversationId: z16.string(),
9335
- title: z16.string()
9554
+ var chatConversationTitleUpdatedDataSchema = z17.object({
9555
+ kind: z17.literal("conversation-title-updated"),
9556
+ conversationId: z17.string(),
9557
+ title: z17.string()
9336
9558
  });
9337
- var chatConversationDataPartSchema = z16.object({
9338
- type: z16.literal("data-conversation"),
9559
+ var chatConversationDataPartSchema = z17.object({
9560
+ type: z17.literal("data-conversation"),
9339
9561
  data: chatConversationTitleUpdatedDataSchema
9340
9562
  });
9341
- var chatUsagePhaseSchema = z16.enum(["streaming", "final"]);
9342
- var chatUsageMessageMetadataSchema = z16.object({
9343
- kind: z16.literal("usage"),
9563
+ var chatUsagePhaseSchema = z17.enum(["streaming", "final"]);
9564
+ var chatUsageMessageMetadataSchema = z17.object({
9565
+ kind: z17.literal("usage"),
9344
9566
  phase: chatUsagePhaseSchema,
9345
- modelId: z16.string(),
9346
- providerNames: z16.array(z16.string()).optional(),
9347
- inputTokens: z16.number().int().nonnegative(),
9348
- noCacheInputTokens: z16.number().int().nonnegative(),
9349
- cacheReadInputTokens: z16.number().int().nonnegative(),
9350
- cacheWriteInputTokens: z16.number().int().nonnegative(),
9351
- outputTokens: z16.number().int().nonnegative(),
9352
- totalTokens: z16.number().int().nonnegative(),
9353
- inputCostMicroDollars: z16.number().int().nonnegative(),
9354
- outputCostMicroDollars: z16.number().int().nonnegative(),
9355
- totalCostMicroDollars: z16.number().int().nonnegative(),
9567
+ modelId: z17.string(),
9568
+ providerNames: z17.array(z17.string()).optional(),
9569
+ inputTokens: z17.number().int().nonnegative(),
9570
+ noCacheInputTokens: z17.number().int().nonnegative(),
9571
+ cacheReadInputTokens: z17.number().int().nonnegative(),
9572
+ cacheWriteInputTokens: z17.number().int().nonnegative(),
9573
+ outputTokens: z17.number().int().nonnegative(),
9574
+ totalTokens: z17.number().int().nonnegative(),
9575
+ inputCostMicroDollars: z17.number().int().nonnegative(),
9576
+ outputCostMicroDollars: z17.number().int().nonnegative(),
9577
+ totalCostMicroDollars: z17.number().int().nonnegative(),
9356
9578
  /**
9357
9579
  * Part of `totalCostMicroDollars` that builds the shared prompt prefix, and is not billed.
9358
9580
  * Defaulted so a client running ahead of the server still parses the metadata it sends.
9359
9581
  */
9360
- cacheWrite1hCostMicroDollars: z16.number().int().nonnegative().default(0),
9361
- searchCostMicroDollars: z16.number().int().nonnegative(),
9362
- nestedLlmCostMicroDollars: z16.number().int().nonnegative(),
9363
- estimatedUserInputTokens: z16.number().int().nonnegative(),
9364
- estimatedUserInputCostMicroDollars: z16.number().int().nonnegative(),
9365
- estimatedBaselineInputTokens: z16.number().int().nonnegative(),
9366
- estimatedBaselineInputCostMicroDollars: z16.number().int().nonnegative()
9367
- });
9368
- var chatUsageStreamEventSchema = z16.object({
9369
- type: z16.string(),
9582
+ cacheWrite1hCostMicroDollars: z17.number().int().nonnegative().default(0),
9583
+ searchCostMicroDollars: z17.number().int().nonnegative(),
9584
+ nestedLlmCostMicroDollars: z17.number().int().nonnegative(),
9585
+ estimatedUserInputTokens: z17.number().int().nonnegative(),
9586
+ estimatedUserInputCostMicroDollars: z17.number().int().nonnegative(),
9587
+ estimatedBaselineInputTokens: z17.number().int().nonnegative(),
9588
+ estimatedBaselineInputCostMicroDollars: z17.number().int().nonnegative()
9589
+ });
9590
+ var chatUsageStreamEventSchema = z17.object({
9591
+ type: z17.string(),
9370
9592
  messageMetadata: chatUsageMessageMetadataSchema
9371
9593
  });
9372
- var chatUsagePreviewSchema = z16.object({
9373
- kind: z16.literal("preview"),
9374
- modelId: z16.string(),
9375
- estimatedBaselineInputTokens: z16.number().int().nonnegative(),
9376
- estimatedBaselineInputCostMicroDollars: z16.number().int().nonnegative(),
9377
- excludesToolSchemaOverhead: z16.boolean()
9594
+ var chatUsagePreviewSchema = z17.object({
9595
+ kind: z17.literal("preview"),
9596
+ modelId: z17.string(),
9597
+ estimatedBaselineInputTokens: z17.number().int().nonnegative(),
9598
+ estimatedBaselineInputCostMicroDollars: z17.number().int().nonnegative(),
9599
+ excludesToolSchemaOverhead: z17.boolean()
9378
9600
  });
9379
- var chatStreamRequestErrorResponseSchema = z16.object({
9380
- message: z16.string(),
9381
- statusCode: z16.number().int(),
9382
- code: z16.enum(USAGE_BILLING_DENIAL_CODES).optional().catch(void 0)
9601
+ var chatStreamRequestErrorResponseSchema = z17.object({
9602
+ message: z17.string(),
9603
+ statusCode: z17.number().int(),
9604
+ code: z17.enum(USAGE_BILLING_DENIAL_CODES).optional().catch(void 0),
9605
+ /** Present only when the server establishes whether work started. */
9606
+ execution_started: z17.boolean().optional()
9383
9607
  });
9384
9608
  var CHAT_CONVERSATION_STATUSES = ["active", "archived", "all"];
9385
- var chatConversationStatusSchema = z16.enum(CHAT_CONVERSATION_STATUSES);
9386
- var getChatConversationsQuerySchema = z16.object({
9609
+ var chatConversationStatusSchema = z17.enum(CHAT_CONVERSATION_STATUSES);
9610
+ var getChatConversationsQuerySchema = z17.object({
9387
9611
  status: chatConversationStatusSchema.default("active"),
9388
- limit: z16.coerce.number().int().positive().max(200).default(10)
9612
+ limit: z17.coerce.number().int().positive().max(200).default(10)
9389
9613
  });
9390
- var createChatConversationSchema = z16.object({
9391
- title: z16.string().nullable().optional()
9614
+ var createChatConversationSchema = z17.object({
9615
+ title: z17.string().nullable().optional()
9392
9616
  });
9393
- var updateChatConversationSchema = z16.object({
9394
- title: z16.string().nullable().optional(),
9395
- isArchived: z16.boolean().optional()
9617
+ var updateChatConversationSchema = z17.object({
9618
+ title: z17.string().nullable().optional(),
9619
+ isArchived: z17.boolean().optional()
9396
9620
  }).refine((value) => value.title !== void 0 || value.isArchived !== void 0, {
9397
9621
  message: "At least one field must be provided"
9398
9622
  });
9399
9623
 
9400
9624
  // ../../packages/core/dist/esm/chat-tools/complete-automation-draft.js
9401
- import { z as z18 } from "zod";
9625
+ import { z as z19 } from "zod";
9402
9626
 
9403
9627
  // ../../packages/core/dist/esm/schemas/automation-preview-artifact.schema.js
9404
- import { z as z17 } from "zod";
9628
+ import { z as z18 } from "zod";
9405
9629
  var automationPreviewSources = ["synthetic", "run"];
9406
9630
  var automationPreviewKinds = ["content", "action", "none", "error"];
9407
9631
  var automationPreviewGenerationKinds = ["content", "action", "none"];
9408
- var automationPreviewSourceSchema = z17.enum(automationPreviewSources);
9409
- var automationPreviewKindSchema = z17.enum(automationPreviewKinds);
9410
- var automationPreviewGenerationKindSchema = z17.enum(automationPreviewGenerationKinds);
9411
- var automationPreviewArtifactSchema = z17.object({
9632
+ var automationPreviewSourceSchema = z18.enum(automationPreviewSources);
9633
+ var automationPreviewKindSchema = z18.enum(automationPreviewKinds);
9634
+ var automationPreviewGenerationKindSchema = z18.enum(automationPreviewGenerationKinds);
9635
+ var automationPreviewArtifactSchema = z18.object({
9412
9636
  source: automationPreviewSourceSchema,
9413
9637
  kind: automationPreviewKindSchema,
9414
- manifestHash: z17.string().regex(/^[a-f0-9]{64}$/, "manifestHash must be a sha256 hex digest"),
9415
- title: z17.string().trim().min(1),
9416
- summary: z17.string().trim().min(1),
9417
- markdown: z17.string().trim().min(1).nullable()
9638
+ manifestHash: z18.string().regex(/^[a-f0-9]{64}$/, "manifestHash must be a sha256 hex digest"),
9639
+ title: z18.string().trim().min(1),
9640
+ summary: z18.string().trim().min(1),
9641
+ markdown: z18.string().trim().min(1).nullable()
9418
9642
  }).superRefine((artifact, ctx) => {
9419
9643
  if (artifact.kind === "content" && artifact.markdown == null) {
9420
9644
  ctx.addIssue({
9421
- code: z17.ZodIssueCode.custom,
9645
+ code: z18.ZodIssueCode.custom,
9422
9646
  message: "content artifacts must include markdown",
9423
9647
  path: ["markdown"]
9424
9648
  });
9425
9649
  }
9426
9650
  if (artifact.kind !== "content" && artifact.markdown != null) {
9427
9651
  ctx.addIssue({
9428
- code: z17.ZodIssueCode.custom,
9652
+ code: z18.ZodIssueCode.custom,
9429
9653
  message: "only content artifacts may include markdown",
9430
9654
  path: ["markdown"]
9431
9655
  });
9432
9656
  }
9433
9657
  });
9434
- var automationPreviewGenerationSchema = z17.object({
9658
+ var automationPreviewGenerationSchema = z18.object({
9435
9659
  kind: automationPreviewGenerationKindSchema,
9436
- title: z17.string().trim().min(1),
9437
- summary: z17.string().trim().min(1),
9438
- markdown: z17.string().trim().min(1).nullish()
9660
+ title: z18.string().trim().min(1),
9661
+ summary: z18.string().trim().min(1),
9662
+ markdown: z18.string().trim().min(1).nullish()
9439
9663
  });
9440
9664
 
9441
9665
  // ../../packages/core/dist/esm/chat-tools/complete-automation-draft.js
9442
- var CompleteAutomationDraftActionSchema = z18.enum(["create", "update"]);
9443
- var CompleteAutomationDraftInputSchema = z18.object({
9444
- draftId: z18.string().min(1).describe("The draft ID to generate an automation preview for."),
9445
- language: z18.string().trim().min(1).optional().describe("Optional human language name for the preview. When relevant, pass the language used in the current user conversation.")
9446
- });
9447
- var CompleteAutomationDraftOutputSchema = z18.union([
9448
- z18.object({
9449
- success: z18.literal(true),
9450
- message: z18.string().min(1),
9451
- instructions: z18.string().min(1),
9452
- draftId: z18.string().min(1),
9666
+ var CompleteAutomationDraftActionSchema = z19.enum(["create", "update"]);
9667
+ var CompleteAutomationDraftInputSchema = z19.object({
9668
+ draftId: z19.string().min(1).describe("The draft ID to generate an automation preview for."),
9669
+ language: z19.string().trim().min(1).optional().describe("Optional human language name for the preview. When relevant, pass the language used in the current user conversation.")
9670
+ });
9671
+ var CompleteAutomationDraftOutputSchema = z19.union([
9672
+ z19.object({
9673
+ success: z19.literal(true),
9674
+ message: z19.string().min(1),
9675
+ instructions: z19.string().min(1),
9676
+ draftId: z19.string().min(1),
9453
9677
  action: CompleteAutomationDraftActionSchema,
9454
9678
  artifact: automationPreviewArtifactSchema
9455
9679
  }),
9456
- z18.object({
9457
- success: z18.literal(false),
9458
- message: z18.string().min(1),
9459
- instructions: z18.string().min(1),
9460
- draftId: z18.string().min(1)
9680
+ z19.object({
9681
+ success: z19.literal(false),
9682
+ message: z19.string().min(1),
9683
+ instructions: z19.string().min(1),
9684
+ draftId: z19.string().min(1)
9461
9685
  })
9462
9686
  ]);
9463
- var toolCompleteAutomationDraftSchema = z18.object({
9464
- type: z18.literal("tool-complete-automation-draft"),
9465
- toolCallId: z18.string().min(1),
9466
- state: z18.literal("input-available"),
9687
+ var toolCompleteAutomationDraftSchema = z19.object({
9688
+ type: z19.literal("tool-complete-automation-draft"),
9689
+ toolCallId: z19.string().min(1),
9690
+ state: z19.literal("input-available"),
9467
9691
  input: CompleteAutomationDraftInputSchema
9468
9692
  });
9469
- var toolCompleteAutomationDraftResultSchema = z18.object({
9470
- type: z18.literal("tool-complete-automation-draft"),
9471
- toolCallId: z18.string().min(1),
9472
- state: z18.literal("output-available"),
9693
+ var toolCompleteAutomationDraftResultSchema = z19.object({
9694
+ type: z19.literal("tool-complete-automation-draft"),
9695
+ toolCallId: z19.string().min(1),
9696
+ state: z19.literal("output-available"),
9473
9697
  input: CompleteAutomationDraftInputSchema,
9474
9698
  output: CompleteAutomationDraftOutputSchema
9475
9699
  });
9476
9700
 
9477
9701
  // ../../packages/core/dist/esm/chat-tools/publish-draft.js
9478
- import { z as z19 } from "zod";
9479
- var PublishDraftInputSchema = z19.object({
9480
- draftId: z19.string().min(1).describe("The draft ID to preview and publish."),
9481
- language: z19.string().trim().min(1).optional().describe("Optional human language name for the preview. When relevant, pass the language used in the current user conversation.")
9702
+ import { z as z20 } from "zod";
9703
+ var PublishDraftInputSchema = z20.object({
9704
+ draftId: z20.string().min(1).describe("The draft ID to preview and publish."),
9705
+ language: z20.string().trim().min(1).optional().describe("Optional human language name for the preview. When relevant, pass the language used in the current user conversation.")
9482
9706
  });
9483
- var PublishDraftOutputSchema = z19.union([
9484
- z19.object({
9485
- success: z19.literal(true),
9486
- message: z19.string().min(1),
9487
- instructions: z19.string().min(1),
9488
- draftId: z19.string().min(1),
9707
+ var PublishDraftOutputSchema = z20.union([
9708
+ z20.object({
9709
+ success: z20.literal(true),
9710
+ message: z20.string().min(1),
9711
+ instructions: z20.string().min(1),
9712
+ draftId: z20.string().min(1),
9489
9713
  action: CompleteAutomationDraftActionSchema,
9490
- automationId: z19.string().min(1),
9714
+ automationId: z20.string().min(1),
9491
9715
  previewArtifact: automationPreviewArtifactSchema.optional()
9492
9716
  }),
9493
- z19.object({
9494
- success: z19.literal(false),
9495
- message: z19.string().min(1),
9496
- instructions: z19.string().min(1),
9497
- draftId: z19.string().min(1),
9717
+ z20.object({
9718
+ success: z20.literal(false),
9719
+ message: z20.string().min(1),
9720
+ instructions: z20.string().min(1),
9721
+ draftId: z20.string().min(1),
9498
9722
  action: CompleteAutomationDraftActionSchema.optional(),
9499
9723
  previewArtifact: automationPreviewArtifactSchema.optional()
9500
9724
  })
9501
9725
  ]);
9502
- var toolPublishDraftSchema = z19.object({
9503
- type: z19.literal("tool-publish-draft"),
9504
- toolCallId: z19.string().min(1),
9505
- state: z19.literal("input-available"),
9726
+ var toolPublishDraftSchema = z20.object({
9727
+ type: z20.literal("tool-publish-draft"),
9728
+ toolCallId: z20.string().min(1),
9729
+ state: z20.literal("input-available"),
9506
9730
  input: PublishDraftInputSchema
9507
9731
  });
9508
- var toolPublishDraftResultSchema = z19.object({
9509
- type: z19.literal("tool-publish-draft"),
9510
- toolCallId: z19.string().min(1),
9511
- state: z19.literal("output-available"),
9732
+ var toolPublishDraftResultSchema = z20.object({
9733
+ type: z20.literal("tool-publish-draft"),
9734
+ toolCallId: z20.string().min(1),
9735
+ state: z20.literal("output-available"),
9512
9736
  input: PublishDraftInputSchema,
9513
9737
  output: PublishDraftOutputSchema
9514
9738
  });
@@ -9523,102 +9747,102 @@ function isPublishDraftResult(part) {
9523
9747
  }
9524
9748
 
9525
9749
  // ../../packages/core/dist/esm/chat-tools/test-automation-draft.js
9526
- import { z as z20 } from "zod";
9527
- var TestAutomationDraftInputSchema = z20.object({
9528
- draftId: z20.string().min(1).describe("The draft ID to test.")
9750
+ import { z as z21 } from "zod";
9751
+ var TestAutomationDraftInputSchema = z21.object({
9752
+ draftId: z21.string().min(1).describe("The draft ID to test.")
9529
9753
  });
9530
- var automationTestRunStepStatusSchema = z20.object({
9531
- stepId: z20.string().min(1),
9532
- status: z20.enum(AUTOMATION_RUN_STATUSES)
9754
+ var automationTestRunStepStatusSchema = z21.object({
9755
+ stepId: z21.string().min(1),
9756
+ status: z21.enum(AUTOMATION_RUN_STATUSES)
9533
9757
  });
9534
- var automationTestRunProgressSchema = z20.object({
9535
- draftId: z20.string().min(1),
9536
- status: z20.enum(AUTOMATION_RUN_STATUSES),
9537
- steps: z20.array(automationTestRunStepStatusSchema).default([])
9758
+ var automationTestRunProgressSchema = z21.object({
9759
+ draftId: z21.string().min(1),
9760
+ status: z21.enum(AUTOMATION_RUN_STATUSES),
9761
+ steps: z21.array(automationTestRunStepStatusSchema).default([])
9538
9762
  });
9539
- var automationTestRunPreviewTriggerSchema = z20.union([
9540
- z20.object({
9541
- type: z20.literal("schedule"),
9763
+ var automationTestRunPreviewTriggerSchema = z21.union([
9764
+ z21.object({
9765
+ type: z21.literal("schedule"),
9542
9766
  value: scheduleValueSchema,
9543
- description: z20.string().optional()
9767
+ description: z21.string().optional()
9544
9768
  }),
9545
- z20.object({
9546
- type: z20.literal("api"),
9547
- description: z20.string().optional()
9769
+ z21.object({
9770
+ type: z21.literal("api"),
9771
+ description: z21.string().optional()
9548
9772
  }),
9549
- z20.object({
9550
- type: z20.literal("webhook"),
9551
- event: z20.string().min(1),
9552
- description: z20.string().optional()
9773
+ z21.object({
9774
+ type: z21.literal("webhook"),
9775
+ event: z21.string().min(1),
9776
+ description: z21.string().optional()
9553
9777
  })
9554
9778
  ]);
9555
- var automationTestRunPreviewAskSchema = z20.object({
9556
- message: z20.string().min(1),
9557
- expiresAfter: z20.string().min(1),
9558
- options: z20.array(z20.object({ label: z20.string().min(1), terminate: z20.boolean() }))
9559
- });
9560
- var automationTestRunPreviewStepSchema = z20.object({
9561
- stepId: z20.string().min(1),
9562
- title: z20.string().optional(),
9563
- description: z20.string(),
9564
- connectorIds: z20.array(z20.string().min(1)).default([]),
9779
+ var automationTestRunPreviewAskSchema = z21.object({
9780
+ message: z21.string().min(1),
9781
+ expiresAfter: z21.string().min(1),
9782
+ options: z21.array(z21.object({ label: z21.string().min(1), terminate: z21.boolean() }))
9783
+ });
9784
+ var automationTestRunPreviewStepSchema = z21.object({
9785
+ stepId: z21.string().min(1),
9786
+ title: z21.string().optional(),
9787
+ description: z21.string(),
9788
+ connectorIds: z21.array(z21.string().min(1)).default([]),
9565
9789
  /** Present only for `ask` steps; its presence identifies them. */
9566
9790
  ask: automationTestRunPreviewAskSchema.optional()
9567
9791
  });
9568
- var automationTestRunPreviewSchema = z20.object({
9569
- triggers: z20.array(automationTestRunPreviewTriggerSchema).default([]),
9570
- steps: z20.array(automationTestRunPreviewStepSchema).default([])
9792
+ var automationTestRunPreviewSchema = z21.object({
9793
+ triggers: z21.array(automationTestRunPreviewTriggerSchema).default([]),
9794
+ steps: z21.array(automationTestRunPreviewStepSchema).default([])
9571
9795
  });
9572
- var TestAutomationDraftOutputSchema = z20.union([
9573
- z20.object({
9574
- success: z20.literal(true),
9575
- message: z20.string().min(1),
9576
- draftId: z20.string().min(1),
9796
+ var TestAutomationDraftOutputSchema = z21.union([
9797
+ z21.object({
9798
+ success: z21.literal(true),
9799
+ message: z21.string().min(1),
9800
+ draftId: z21.string().min(1),
9577
9801
  action: CompleteAutomationDraftActionSchema,
9578
9802
  preview: automationTestRunPreviewSchema,
9579
9803
  testRun: automationTestRunProgressSchema
9580
9804
  }),
9581
- z20.object({
9582
- success: z20.literal(false),
9583
- message: z20.string().min(1),
9584
- draftId: z20.string().min(1),
9805
+ z21.object({
9806
+ success: z21.literal(false),
9807
+ message: z21.string().min(1),
9808
+ draftId: z21.string().min(1),
9585
9809
  action: CompleteAutomationDraftActionSchema.optional()
9586
9810
  })
9587
9811
  ]);
9588
- var toolTestAutomationDraftSchema = z20.object({
9589
- type: z20.literal("tool-test-draft"),
9590
- toolCallId: z20.string().min(1),
9591
- state: z20.literal("input-available"),
9812
+ var toolTestAutomationDraftSchema = z21.object({
9813
+ type: z21.literal("tool-test-draft"),
9814
+ toolCallId: z21.string().min(1),
9815
+ state: z21.literal("input-available"),
9592
9816
  input: TestAutomationDraftInputSchema
9593
9817
  });
9594
- var toolTestAutomationDraftResultSchema = z20.object({
9595
- type: z20.literal("tool-test-draft"),
9596
- toolCallId: z20.string().min(1),
9597
- state: z20.literal("output-available"),
9818
+ var toolTestAutomationDraftResultSchema = z21.object({
9819
+ type: z21.literal("tool-test-draft"),
9820
+ toolCallId: z21.string().min(1),
9821
+ state: z21.literal("output-available"),
9598
9822
  input: TestAutomationDraftInputSchema,
9599
9823
  output: TestAutomationDraftOutputSchema
9600
9824
  });
9601
9825
 
9602
9826
  // ../../packages/core/dist/esm/chat-tools/prompt-enable-push.js
9603
- import { z as z21 } from "zod";
9604
- var PromptEnablePushInputSchema = z21.object({
9605
- draftId: z21.string().min(1).optional().describe("Optional draft ID currently being edited, if available")
9827
+ import { z as z22 } from "zod";
9828
+ var PromptEnablePushInputSchema = z22.object({
9829
+ draftId: z22.string().min(1).optional().describe("Optional draft ID currently being edited, if available")
9606
9830
  });
9607
- var PromptEnablePushOutputSchema = z21.object({
9608
- enabled: z21.boolean().describe("Whether the user finished enabling push notifications and has at least one active subscription."),
9609
- deviceCount: z21.number().int().min(0).describe("Number of active push devices the user has registered."),
9610
- message: z21.string().min(1).describe("Human-readable status describing the outcome of the prompt.")
9831
+ var PromptEnablePushOutputSchema = z22.object({
9832
+ enabled: z22.boolean().describe("Whether the user finished enabling push notifications and has at least one active subscription."),
9833
+ deviceCount: z22.number().int().min(0).describe("Number of active push devices the user has registered."),
9834
+ message: z22.string().min(1).describe("Human-readable status describing the outcome of the prompt.")
9611
9835
  });
9612
- var toolPromptEnablePushSchema = z21.object({
9613
- type: z21.literal("tool-prompt-enable-push-notifications"),
9614
- toolCallId: z21.string().min(1),
9615
- state: z21.literal("input-available"),
9836
+ var toolPromptEnablePushSchema = z22.object({
9837
+ type: z22.literal("tool-prompt-enable-push-notifications"),
9838
+ toolCallId: z22.string().min(1),
9839
+ state: z22.literal("input-available"),
9616
9840
  input: PromptEnablePushInputSchema
9617
9841
  });
9618
- var toolPromptEnablePushResultSchema = z21.object({
9619
- type: z21.literal("tool-prompt-enable-push-notifications"),
9620
- toolCallId: z21.string().min(1),
9621
- state: z21.literal("output-available"),
9842
+ var toolPromptEnablePushResultSchema = z22.object({
9843
+ type: z22.literal("tool-prompt-enable-push-notifications"),
9844
+ toolCallId: z22.string().min(1),
9845
+ state: z22.literal("output-available"),
9622
9846
  input: PromptEnablePushInputSchema,
9623
9847
  output: PromptEnablePushOutputSchema
9624
9848
  });
@@ -9627,42 +9851,42 @@ function isPromptEnablePush(part) {
9627
9851
  }
9628
9852
 
9629
9853
  // ../../packages/core/dist/esm/chat-tools/select-connections.js
9630
- import { z as z22 } from "zod";
9631
- var SelectConnectionTypeSchema = z22.enum(["mcp", "trigger"]);
9632
- var ConnectionItemSchema = z22.object({
9633
- connectorId: z22.string().min(1).describe("The connector ID to select a connection for"),
9634
- serviceName: z22.string().min(1).describe("The human-readable name of the service"),
9854
+ import { z as z23 } from "zod";
9855
+ var SelectConnectionTypeSchema = z23.enum(["mcp", "trigger"]);
9856
+ var ConnectionItemSchema = z23.object({
9857
+ connectorId: z23.string().min(1).describe("The connector ID to select a connection for"),
9858
+ serviceName: z23.string().min(1).describe("The human-readable name of the service"),
9635
9859
  connectionType: SelectConnectionTypeSchema.describe('Type of connection needed: "mcp" for actions, "trigger" for events')
9636
9860
  });
9637
- var SelectConnectionsInputSchema = z22.object({
9638
- draftId: z22.string().min(1).describe("The draft ID these connections belong to"),
9639
- connections: z22.array(ConnectionItemSchema).min(1).describe("List of connections needed for this automation")
9861
+ var SelectConnectionsInputSchema = z23.object({
9862
+ draftId: z23.string().min(1).describe("The draft ID these connections belong to"),
9863
+ connections: z23.array(ConnectionItemSchema).min(1).describe("List of connections needed for this automation")
9640
9864
  });
9641
- var ConnectionResultItemSchema = z22.union([
9642
- z22.object({
9643
- type: z22.literal("success"),
9644
- connectionId: z22.string().min(1),
9645
- connectorId: z22.string().min(1),
9865
+ var ConnectionResultItemSchema = z23.union([
9866
+ z23.object({
9867
+ type: z23.literal("success"),
9868
+ connectionId: z23.string().min(1),
9869
+ connectorId: z23.string().min(1),
9646
9870
  connectionType: SelectConnectionTypeSchema
9647
9871
  }),
9648
- z22.object({
9649
- type: z22.literal("error"),
9650
- message: z22.string().min(1),
9651
- connectorId: z22.string().min(1),
9872
+ z23.object({
9873
+ type: z23.literal("error"),
9874
+ message: z23.string().min(1),
9875
+ connectorId: z23.string().min(1),
9652
9876
  connectionType: SelectConnectionTypeSchema
9653
9877
  })
9654
9878
  ]);
9655
- var SelectConnectionsOutputSchema = z22.array(ConnectionResultItemSchema);
9656
- var toolSelectConnectionsSchema = z22.object({
9657
- type: z22.literal("tool-select-connections"),
9658
- toolCallId: z22.string().min(1),
9659
- state: z22.literal("input-available"),
9879
+ var SelectConnectionsOutputSchema = z23.array(ConnectionResultItemSchema);
9880
+ var toolSelectConnectionsSchema = z23.object({
9881
+ type: z23.literal("tool-select-connections"),
9882
+ toolCallId: z23.string().min(1),
9883
+ state: z23.literal("input-available"),
9660
9884
  input: SelectConnectionsInputSchema
9661
9885
  });
9662
- var toolSelectConnectionsResultSchema = z22.object({
9663
- type: z22.literal("tool-select-connections"),
9664
- toolCallId: z22.string().min(1),
9665
- state: z22.literal("output-available"),
9886
+ var toolSelectConnectionsResultSchema = z23.object({
9887
+ type: z23.literal("tool-select-connections"),
9888
+ toolCallId: z23.string().min(1),
9889
+ state: z23.literal("output-available"),
9666
9890
  input: SelectConnectionsInputSchema,
9667
9891
  output: SelectConnectionsOutputSchema
9668
9892
  });
@@ -9671,33 +9895,33 @@ function isSelectConnections(part) {
9671
9895
  }
9672
9896
 
9673
9897
  // ../../packages/core/dist/esm/chat-tools/remove-draft-connection.js
9674
- import { z as z23 } from "zod";
9675
- var RemoveDraftConnectionInputSchema = z23.object({
9676
- draftId: z23.string().min(1).describe("The draft ID to remove the connection from"),
9677
- connectorId: z23.string().min(1).describe("The connector ID to remove from the draft"),
9678
- connectionType: z23.enum(CONNECTION_TYPES).optional().describe("Optional connection type to remove. Omit to remove all draft links for this connector."),
9679
- force: z23.boolean().optional().default(false).describe("When false, removal is blocked if the current draft manifest still requires the connector. When true, removal is allowed and the draft may become unpublishable until edited.")
9680
- });
9681
- var RemovedDraftConnectionItemSchema = z23.object({
9682
- connectorId: z23.string().min(1),
9683
- connectionType: z23.enum(CONNECTION_TYPES)
9684
- });
9685
- var RemoveDraftConnectionOutputSchema = z23.object({
9686
- success: z23.boolean(),
9687
- message: z23.string().min(1),
9688
- draftId: z23.string().min(1),
9689
- removed: z23.array(RemovedDraftConnectionItemSchema)
9690
- });
9691
- var toolRemoveDraftConnectionSchema = z23.object({
9692
- type: z23.literal("tool-remove-draft-connection"),
9693
- toolCallId: z23.string().min(1),
9694
- state: z23.literal("input-available"),
9898
+ import { z as z24 } from "zod";
9899
+ var RemoveDraftConnectionInputSchema = z24.object({
9900
+ draftId: z24.string().min(1).describe("The draft ID to remove the connection from"),
9901
+ connectorId: z24.string().min(1).describe("The connector ID to remove from the draft"),
9902
+ connectionType: z24.enum(CONNECTION_TYPES).optional().describe("Optional connection type to remove. Omit to remove all draft links for this connector."),
9903
+ force: z24.boolean().optional().default(false).describe("When false, removal is blocked if the current draft manifest still requires the connector. When true, removal is allowed and the draft may become unpublishable until edited.")
9904
+ });
9905
+ var RemovedDraftConnectionItemSchema = z24.object({
9906
+ connectorId: z24.string().min(1),
9907
+ connectionType: z24.enum(CONNECTION_TYPES)
9908
+ });
9909
+ var RemoveDraftConnectionOutputSchema = z24.object({
9910
+ success: z24.boolean(),
9911
+ message: z24.string().min(1),
9912
+ draftId: z24.string().min(1),
9913
+ removed: z24.array(RemovedDraftConnectionItemSchema)
9914
+ });
9915
+ var toolRemoveDraftConnectionSchema = z24.object({
9916
+ type: z24.literal("tool-remove-draft-connection"),
9917
+ toolCallId: z24.string().min(1),
9918
+ state: z24.literal("input-available"),
9695
9919
  input: RemoveDraftConnectionInputSchema
9696
9920
  });
9697
- var toolRemoveDraftConnectionResultSchema = z23.object({
9698
- type: z23.literal("tool-remove-draft-connection"),
9699
- toolCallId: z23.string().min(1),
9700
- state: z23.literal("output-available"),
9921
+ var toolRemoveDraftConnectionResultSchema = z24.object({
9922
+ type: z24.literal("tool-remove-draft-connection"),
9923
+ toolCallId: z24.string().min(1),
9924
+ state: z24.literal("output-available"),
9701
9925
  input: RemoveDraftConnectionInputSchema,
9702
9926
  output: RemoveDraftConnectionOutputSchema
9703
9927
  });
@@ -9709,14 +9933,16 @@ var MAX_COHORT_RESULTS = 366;
9709
9933
  var MAX_COHORT_ROWS = 120;
9710
9934
 
9711
9935
  // ../../packages/core/dist/esm/schemas/cohorts.schema.js
9712
- import { z as z24 } from "zod";
9936
+ import { z as z25 } from "zod";
9713
9937
  var FRONTEND_COHORT_EVENTS = [
9714
9938
  "session:started",
9715
9939
  "onboarding:completed",
9716
9940
  "chat:sent",
9717
9941
  "automation:repaired",
9718
9942
  "template:used",
9719
- "top-up:completed"
9943
+ "top-up:completed",
9944
+ "guided-creation:started",
9945
+ "guided-creation:completed"
9720
9946
  ];
9721
9947
  var BACKEND_COHORT_EVENTS = [
9722
9948
  // API-process (publish lifecycle)
@@ -9734,37 +9960,37 @@ var BACKEND_COHORT_EVENTS = [
9734
9960
  "workspace:automation:moved"
9735
9961
  ];
9736
9962
  var COHORT_EVENTS = [...FRONTEND_COHORT_EVENTS, ...BACKEND_COHORT_EVENTS];
9737
- var cohortEventSchema = z24.enum(COHORT_EVENTS);
9738
- var frontendCohortEventSchema = z24.enum(FRONTEND_COHORT_EVENTS);
9739
- var backendCohortEventSchema = z24.enum(BACKEND_COHORT_EVENTS);
9963
+ var cohortEventSchema = z25.enum(COHORT_EVENTS);
9964
+ var frontendCohortEventSchema = z25.enum(FRONTEND_COHORT_EVENTS);
9965
+ var backendCohortEventSchema = z25.enum(BACKEND_COHORT_EVENTS);
9740
9966
  var PLATFORM_VALUES = ["web", "ios", "android", "desktop"];
9741
- var platformValueSchema = z24.enum(PLATFORM_VALUES);
9967
+ var platformValueSchema = z25.enum(PLATFORM_VALUES);
9742
9968
  var USER_PROPERTY_EVENTS = [
9743
9969
  "platform:web",
9744
9970
  "platform:ios",
9745
9971
  "platform:android",
9746
9972
  "platform:desktop"
9747
9973
  ];
9748
- var userPropertyEventSchema = z24.enum(USER_PROPERTY_EVENTS);
9749
- var markableCohortEventSchema = z24.union([cohortEventSchema, userPropertyEventSchema]);
9750
- var registerCohortEventSchema = z24.object({
9974
+ var userPropertyEventSchema = z25.enum(USER_PROPERTY_EVENTS);
9975
+ var markableCohortEventSchema = z25.union([cohortEventSchema, userPropertyEventSchema]);
9976
+ var registerCohortEventSchema = z25.object({
9751
9977
  event_name: frontendCohortEventSchema,
9752
9978
  // The client knows the platform it runs on (the backend always sees `api`),
9753
9979
  // so it reports it here; the backend co-marks the caller's `platform:<value>`
9754
9980
  // property for the active period. Optional — absent means "don't update".
9755
9981
  platform: platformValueSchema.optional()
9756
9982
  });
9757
- var registerCohortEventResponseSchema = z24.object({
9758
- status: z24.literal("ok")
9983
+ var registerCohortEventResponseSchema = z25.object({
9984
+ status: z25.literal("ok")
9759
9985
  });
9760
9986
  var MAX_REDIS_BITMAP_OFFSET = 2 ** 32 - 1;
9761
- var registerInternalCohortEventSchema = z24.object({
9987
+ var registerInternalCohortEventSchema = z25.object({
9762
9988
  event_name: backendCohortEventSchema,
9763
- user_id: z24.string().regex(/^\d+$/, "user_id must be a non-negative integer string").refine((value) => Number(value) <= MAX_REDIS_BITMAP_OFFSET, "user_id exceeds the maximum Redis bitmap offset")
9989
+ user_id: z25.string().regex(/^\d+$/, "user_id must be a non-negative integer string").refine((value) => Number(value) <= MAX_REDIS_BITMAP_OFFSET, "user_id exceeds the maximum Redis bitmap offset")
9764
9990
  });
9765
- var cohortTimeGroupSchema = z24.enum(RESOLUTIONS);
9766
- var cohortFilterOperatorSchema = z24.enum(FILTER_OPERATORS);
9767
- var cohortStartDateSchema = z24.string().regex(/^\d{4}-\d{2}-\d{2}$/, "startDate must be YYYY-MM-DD").refine((value) => {
9991
+ var cohortTimeGroupSchema = z25.enum(RESOLUTIONS);
9992
+ var cohortFilterOperatorSchema = z25.enum(FILTER_OPERATORS);
9993
+ var cohortStartDateSchema = z25.string().regex(/^\d{4}-\d{2}-\d{2}$/, "startDate must be YYYY-MM-DD").refine((value) => {
9768
9994
  const date = /* @__PURE__ */ new Date(`${value}T00:00:00Z`);
9769
9995
  return !Number.isNaN(date.getTime()) && date.toISOString().startsWith(value);
9770
9996
  }, { message: "startDate must be a real calendar date" });
@@ -9773,7 +9999,7 @@ function coerceToArray(value) {
9773
9999
  return void 0;
9774
10000
  return Array.isArray(value) ? value : [value];
9775
10001
  }
9776
- var cohortMatrixQuerySchema = z24.object({
10002
+ var cohortMatrixQuerySchema = z25.object({
9777
10003
  /** The event that defines who enters the cohort. */
9778
10004
  cohortEvent: cohortEventSchema,
9779
10005
  /** The event that counts as "coming back". */
@@ -9791,11 +10017,11 @@ var cohortMatrixQuerySchema = z24.object({
9791
10017
  * these platforms in the period being evaluated. Multi-select;
9792
10018
  * absent/empty means no platform filter.
9793
10019
  */
9794
- platform: z24.preprocess(coerceToArray, z24.array(platformValueSchema)).optional(),
10020
+ platform: z25.preprocess(coerceToArray, z25.array(platformValueSchema)).optional(),
9795
10021
  timeGroup: cohortTimeGroupSchema,
9796
10022
  asPercent: booleanQueryParamSchema.optional(),
9797
- numResults: z24.coerce.number().int().positive().max(MAX_COHORT_RESULTS).optional(),
9798
- numOfRows: z24.coerce.number().int().nonnegative().max(MAX_COHORT_ROWS).optional(),
10023
+ numResults: z25.coerce.number().int().positive().max(MAX_COHORT_RESULTS).optional(),
10024
+ numOfRows: z25.coerce.number().int().nonnegative().max(MAX_COHORT_ROWS).optional(),
9799
10025
  startDate: cohortStartDateSchema.optional()
9800
10026
  }).superRefine((query, ctx) => {
9801
10027
  if (query.cohortFilterOperator && !query.cohortFilter) {
@@ -9820,13 +10046,13 @@ var cohortMatrixQuerySchema = z24.object({
9820
10046
  });
9821
10047
  }
9822
10048
  });
9823
- var cohortMatrixRowSchema = z24.object({
9824
- date: z24.iso.datetime(),
9825
- cohortSize: z24.number(),
9826
- values: z24.array(z24.number().nullable())
10049
+ var cohortMatrixRowSchema = z25.object({
10050
+ date: z25.iso.datetime(),
10051
+ cohortSize: z25.number(),
10052
+ values: z25.array(z25.number().nullable())
9827
10053
  });
9828
- var cohortMatrixResponseSchema = z24.object({
9829
- rows: z24.array(cohortMatrixRowSchema)
10054
+ var cohortMatrixResponseSchema = z25.object({
10055
+ rows: z25.array(cohortMatrixRowSchema)
9830
10056
  });
9831
10057
 
9832
10058
  // ../../packages/core/dist/esm/types/workspace.types.js
@@ -9870,22 +10096,22 @@ function assertKnownTimezone(timezone) {
9870
10096
 
9871
10097
  // ../../packages/core/dist/esm/schemas/manifest.validation.js
9872
10098
  var import_ajv_formats = __toESM(require_dist(), 1);
9873
- import { z as z25 } from "zod/v4";
10099
+ import { z as z26 } from "zod/v4";
9874
10100
 
9875
10101
  // ../../packages/core/dist/esm/schemas/notification-dispatch.schema.js
9876
- import { z as z27 } from "zod";
10102
+ import { z as z28 } from "zod";
9877
10103
 
9878
10104
  // ../../packages/core/dist/esm/schemas/notification.schema.js
9879
- import { z as z26 } from "zod";
10105
+ import { z as z27 } from "zod";
9880
10106
  var NOTIFICATION_TYPES = ["notification", "prompt"];
9881
10107
  var INFO_NOTIFICATION_STATUSES = ["active"];
9882
10108
  var PROMPT_NOTIFICATION_STATUSES = ["pending", "responded", "expired"];
9883
10109
  var INFO_NOTIFICATION_RESPONSES = ["read", "dismissed"];
9884
10110
  var NOTIFICATION_RESPONSES = [...INFO_NOTIFICATION_RESPONSES];
9885
- var NotificationResponseSchema = z26.object({
9886
- status: z26.enum(INFO_NOTIFICATION_RESPONSES).optional(),
9887
- action: z26.literal("answer").optional(),
9888
- value: z26.string().min(1).optional()
10111
+ var NotificationResponseSchema = z27.object({
10112
+ status: z27.enum(INFO_NOTIFICATION_RESPONSES).optional(),
10113
+ action: z27.literal("answer").optional(),
10114
+ value: z27.string().min(1).optional()
9889
10115
  }).refine((data) => {
9890
10116
  const isStatusResponse = data.status !== void 0 && data.action === void 0;
9891
10117
  const isAnswer = data.action === "answer" && data.value !== void 0 && data.status === void 0;
@@ -9895,39 +10121,39 @@ var NOTIFICATION_STATUSES = [
9895
10121
  ...INFO_NOTIFICATION_STATUSES,
9896
10122
  ...PROMPT_NOTIFICATION_STATUSES
9897
10123
  ];
9898
- var notificationBaseSchema = z26.object({
9899
- id: z26.string(),
9900
- userId: z26.string(),
9901
- automationId: z26.string().nullable(),
9902
- automationRunId: z26.string().nullable(),
9903
- stepId: z26.string().nullable(),
9904
- message: z26.string(),
9905
- details: z26.string().nullable(),
9906
- readAt: z26.string().nullable(),
9907
- dismissedAt: z26.string().nullable(),
9908
- createdAt: z26.string(),
9909
- updatedAt: z26.string()
10124
+ var notificationBaseSchema = z27.object({
10125
+ id: z27.string(),
10126
+ userId: z27.string(),
10127
+ automationId: z27.string().nullable(),
10128
+ automationRunId: z27.string().nullable(),
10129
+ stepId: z27.string().nullable(),
10130
+ message: z27.string(),
10131
+ details: z27.string().nullable(),
10132
+ readAt: z27.string().nullable(),
10133
+ dismissedAt: z27.string().nullable(),
10134
+ createdAt: z27.string(),
10135
+ updatedAt: z27.string()
9910
10136
  });
9911
10137
  var InfoNotificationSchema = notificationBaseSchema.extend({
9912
- type: z26.literal("notification"),
9913
- status: z26.literal("active"),
9914
- expiresAt: z26.null(),
9915
- respondedAt: z26.null()
10138
+ type: z27.literal("notification"),
10139
+ status: z27.literal("active"),
10140
+ expiresAt: z27.null(),
10141
+ respondedAt: z27.null()
9916
10142
  });
9917
- var PromptOptionSchema = z26.object({
9918
- label: z26.string(),
9919
- value: z26.string(),
9920
- terminate: z26.boolean()
10143
+ var PromptOptionSchema = z27.object({
10144
+ label: z27.string(),
10145
+ value: z27.string(),
10146
+ terminate: z27.boolean()
9921
10147
  });
9922
10148
  var PromptNotificationSchema = notificationBaseSchema.extend({
9923
- type: z26.literal("prompt"),
9924
- status: z26.enum(PROMPT_NOTIFICATION_STATUSES),
9925
- options: z26.array(PromptOptionSchema),
9926
- response: z26.string().nullable(),
9927
- expiresAt: z26.string().nullable(),
9928
- respondedAt: z26.string().nullable()
9929
- });
9930
- var NotificationSchema = z26.discriminatedUnion("type", [
10149
+ type: z27.literal("prompt"),
10150
+ status: z27.enum(PROMPT_NOTIFICATION_STATUSES),
10151
+ options: z27.array(PromptOptionSchema),
10152
+ response: z27.string().nullable(),
10153
+ expiresAt: z27.string().nullable(),
10154
+ respondedAt: z27.string().nullable()
10155
+ });
10156
+ var NotificationSchema = z27.discriminatedUnion("type", [
9931
10157
  InfoNotificationSchema,
9932
10158
  PromptNotificationSchema
9933
10159
  ]);
@@ -9935,92 +10161,92 @@ var VALID_STATUSES_BY_NOTIFICATION_TYPE = {
9935
10161
  notification: INFO_NOTIFICATION_STATUSES,
9936
10162
  prompt: PROMPT_NOTIFICATION_STATUSES
9937
10163
  };
9938
- var ListNotificationsQuerySchema = z26.object({
9939
- type: z26.enum(NOTIFICATION_TYPES).optional(),
9940
- status: z26.enum(NOTIFICATION_STATUSES).optional(),
10164
+ var ListNotificationsQuerySchema = z27.object({
10165
+ type: z27.enum(NOTIFICATION_TYPES).optional(),
10166
+ status: z27.enum(NOTIFICATION_STATUSES).optional(),
9941
10167
  // Non-empty: `?automationId=` would otherwise parse to `''` and silently
9942
10168
  // widen the query to every notification the caller can see.
9943
- automationId: z26.string().min(1).optional()
10169
+ automationId: z27.string().min(1).optional()
9944
10170
  }).refine((data) => {
9945
10171
  if (data.type && data.status) {
9946
10172
  return VALID_STATUSES_BY_NOTIFICATION_TYPE[data.type].includes(data.status);
9947
10173
  }
9948
10174
  return true;
9949
10175
  }, { message: "Invalid status for the specified notification type" });
9950
- var NotificationListResponseSchema = z26.object({
9951
- data: z26.array(NotificationSchema),
9952
- nextCursor: z26.string().nullable()
10176
+ var NotificationListResponseSchema = z27.object({
10177
+ data: z27.array(NotificationSchema),
10178
+ nextCursor: z27.string().nullable()
9953
10179
  });
9954
- var PendingPromptAutomationsResponseSchema = z26.object({
9955
- automationIds: z26.array(z26.string())
10180
+ var PendingPromptAutomationsResponseSchema = z27.object({
10181
+ automationIds: z27.array(z27.string())
9956
10182
  });
9957
10183
 
9958
10184
  // ../../packages/core/dist/esm/schemas/notification-dispatch.schema.js
9959
- var automationRunFailedDispatchSchema = z27.object({
9960
- kind: z27.literal("automation_run_failed"),
9961
- userId: z27.string().min(1),
9962
- automationId: z27.string().min(1),
9963
- automationRunId: z27.string().min(1),
9964
- failureReason: z27.string().min(1)
9965
- });
9966
- var connectionBrokenDispatchSchema = z27.object({
9967
- kind: z27.literal("connection_broken"),
9968
- userId: z27.string().min(1),
9969
- connectionId: z27.string().min(1),
9970
- connectorId: z27.string().min(1),
9971
- connectorName: z27.string().min(1),
9972
- connectorDisplayName: z27.string().min(1),
9973
- reason: z27.string().min(1),
9974
- automationId: z27.string().min(1).optional()
9975
- });
9976
- var promptPendingDispatchSchema = z27.object({
9977
- kind: z27.literal("prompt_pending"),
9978
- userId: z27.string().min(1),
9979
- automationId: z27.string().min(1),
9980
- automationRunId: z27.string().min(1),
9981
- promptId: z27.string().min(1),
10185
+ var automationRunFailedDispatchSchema = z28.object({
10186
+ kind: z28.literal("automation_run_failed"),
10187
+ userId: z28.string().min(1),
10188
+ automationId: z28.string().min(1),
10189
+ automationRunId: z28.string().min(1),
10190
+ failureReason: z28.string().min(1)
10191
+ });
10192
+ var connectionBrokenDispatchSchema = z28.object({
10193
+ kind: z28.literal("connection_broken"),
10194
+ userId: z28.string().min(1),
10195
+ connectionId: z28.string().min(1),
10196
+ connectorId: z28.string().min(1),
10197
+ connectorName: z28.string().min(1),
10198
+ connectorDisplayName: z28.string().min(1),
10199
+ reason: z28.string().min(1),
10200
+ automationId: z28.string().min(1).optional()
10201
+ });
10202
+ var promptPendingDispatchSchema = z28.object({
10203
+ kind: z28.literal("prompt_pending"),
10204
+ userId: z28.string().min(1),
10205
+ automationId: z28.string().min(1),
10206
+ automationRunId: z28.string().min(1),
10207
+ promptId: z28.string().min(1),
9982
10208
  // The question being asked, surfaced in the email and push bodies. Optional
9983
10209
  // so the dispatch stays valid if a prompt ever carries no headline text.
9984
- question: z27.string().min(1).optional(),
10210
+ question: z28.string().min(1).optional(),
9985
10211
  // The prompt's answer choices and wait deadline, carried so the dispatcher
9986
10212
  // can mint one capability token per option and render the answers as
9987
10213
  // notification action buttons. Both are optional: a dispatch without them
9988
10214
  // still delivers, as a plain notification the user taps to open the app.
9989
10215
  options: PromptOptionSchema.array().optional(),
9990
- expiresAt: z27.iso.datetime().optional()
10216
+ expiresAt: z28.iso.datetime().optional()
9991
10217
  });
9992
- var promptResolvedDispatchSchema = z27.object({
9993
- kind: z27.literal("prompt_resolved"),
9994
- userId: z27.string().min(1),
9995
- automationId: z27.string().min(1).optional(),
9996
- promptId: z27.string().min(1),
9997
- resolution: z27.enum(["responded", "expired"])
10218
+ var promptResolvedDispatchSchema = z28.object({
10219
+ kind: z28.literal("prompt_resolved"),
10220
+ userId: z28.string().min(1),
10221
+ automationId: z28.string().min(1).optional(),
10222
+ promptId: z28.string().min(1),
10223
+ resolution: z28.enum(["responded", "expired"])
9998
10224
  });
9999
10225
  var usageBalanceFields = {
10000
- userId: z27.string().min(1),
10001
- currency: z27.string().min(1)
10226
+ userId: z28.string().min(1),
10227
+ currency: z28.string().min(1)
10002
10228
  };
10003
- var balanceLowDispatchSchema = z27.object({
10004
- kind: z27.literal("balance_low"),
10229
+ var balanceLowDispatchSchema = z28.object({
10230
+ kind: z28.literal("balance_low"),
10005
10231
  ...usageBalanceFields,
10006
10232
  // Positive, because this fires above the gate limit while automations are
10007
10233
  // still running, and its copy quotes the figure. A zero or negative value
10008
10234
  // reaching here would render "-$3.50 left" to a user.
10009
- balanceUnits: z27.number().int().positive(),
10010
- balanceAmount: z27.number().int().positive()
10235
+ balanceUnits: z28.number().int().positive(),
10236
+ balanceAmount: z28.number().int().positive()
10011
10237
  });
10012
- var insufficientBalanceDispatchSchema = z27.object({
10013
- kind: z27.literal("insufficient_balance"),
10238
+ var insufficientBalanceDispatchSchema = z28.object({
10239
+ kind: z28.literal("insufficient_balance"),
10014
10240
  ...usageBalanceFields,
10015
10241
  // Unbounded on purpose, unlike `balance_low`. A run is never clamped
10016
10242
  // mid-flight, so one that overruns its cap can drive the balance below
10017
10243
  // zero — the beta accepts that rather than dropping a charge already paid
10018
10244
  // to the provider. This copy quotes no figure, so a negative value never
10019
10245
  // reaches the user.
10020
- balanceUnits: z27.number().int(),
10021
- balanceAmount: z27.number().int()
10246
+ balanceUnits: z28.number().int(),
10247
+ balanceAmount: z28.number().int()
10022
10248
  });
10023
- var notificationDispatchSchema = z27.discriminatedUnion("kind", [
10249
+ var notificationDispatchSchema = z28.discriminatedUnion("kind", [
10024
10250
  automationRunFailedDispatchSchema,
10025
10251
  connectionBrokenDispatchSchema,
10026
10252
  promptPendingDispatchSchema,
@@ -10030,243 +10256,108 @@ var notificationDispatchSchema = z27.discriminatedUnion("kind", [
10030
10256
  ]);
10031
10257
 
10032
10258
  // ../../packages/core/dist/esm/schemas/oauth-callback.schema.js
10033
- import { z as z28 } from "zod";
10034
- var oauthCallbackCompletionRequestSchema = z28.object({
10035
- code: z28.string().optional(),
10036
- state: z28.string().optional(),
10037
- error: z28.string().optional(),
10038
- error_description: z28.string().optional()
10039
- });
10040
- var oauthCallbackSuccessResultSchema = z28.object({
10041
- isSuccess: z28.literal(true),
10042
- connectionId: z28.string(),
10043
- connector: z28.string(),
10044
- connectorName: z28.string(),
10045
- connectorIconUrl: z28.string().optional()
10046
- });
10047
- var oauthCallbackFailureResultSchema = z28.object({
10048
- isSuccess: z28.literal(false),
10049
- error: z28.string(),
10050
- errorDescription: z28.string().optional(),
10051
- connector: z28.string().optional(),
10052
- connectorName: z28.string().optional(),
10053
- connectorIconUrl: z28.string().optional()
10054
- });
10055
- var oauthCallbackCompletionResultSchema = z28.discriminatedUnion("isSuccess", [
10259
+ import { z as z29 } from "zod";
10260
+ var oauthCallbackCompletionRequestSchema = z29.object({
10261
+ code: z29.string().optional(),
10262
+ state: z29.string().optional(),
10263
+ error: z29.string().optional(),
10264
+ error_description: z29.string().optional()
10265
+ });
10266
+ var oauthCallbackSuccessResultSchema = z29.object({
10267
+ isSuccess: z29.literal(true),
10268
+ connectionId: z29.string(),
10269
+ connector: z29.string(),
10270
+ connectorName: z29.string(),
10271
+ connectorIconUrl: z29.string().optional()
10272
+ });
10273
+ var oauthCallbackFailureResultSchema = z29.object({
10274
+ isSuccess: z29.literal(false),
10275
+ error: z29.string(),
10276
+ errorDescription: z29.string().optional(),
10277
+ connector: z29.string().optional(),
10278
+ connectorName: z29.string().optional(),
10279
+ connectorIconUrl: z29.string().optional()
10280
+ });
10281
+ var oauthCallbackCompletionResultSchema = z29.discriminatedUnion("isSuccess", [
10056
10282
  oauthCallbackSuccessResultSchema,
10057
10283
  oauthCallbackFailureResultSchema
10058
10284
  ]);
10059
10285
 
10060
10286
  // ../../packages/core/dist/esm/schemas/pagination.schema.js
10061
- import { z as z29 } from "zod";
10287
+ import { z as z30 } from "zod";
10062
10288
  var DEFAULT_PAGINATION_LIMIT = 20;
10063
10289
  var MAX_PAGINATION_LIMIT = 100;
10064
- var CursorPaginationSchema = z29.object({
10065
- cursor: z29.string().optional(),
10066
- limit: z29.preprocess((val) => Number(val), z29.number().int().min(1).max(MAX_PAGINATION_LIMIT)).default(DEFAULT_PAGINATION_LIMIT)
10290
+ var CursorPaginationSchema = z30.object({
10291
+ cursor: z30.string().optional(),
10292
+ limit: z30.preprocess((val) => Number(val), z30.number().int().min(1).max(MAX_PAGINATION_LIMIT)).default(DEFAULT_PAGINATION_LIMIT)
10067
10293
  });
10068
10294
 
10069
10295
  // ../../packages/core/dist/esm/schemas/push-subscription.schema.js
10070
- import { z as z30 } from "zod";
10071
- var PushSubscriptionKeysSchema = z30.object({
10072
- p256dh: z30.string().min(1).max(255),
10073
- auth: z30.string().min(1).max(255)
10296
+ import { z as z31 } from "zod";
10297
+ var PushSubscriptionKeysSchema = z31.object({
10298
+ p256dh: z31.string().min(1).max(255),
10299
+ auth: z31.string().min(1).max(255)
10074
10300
  });
10075
- var RegisterPushSubscriptionSchema = z30.object({
10076
- endpoint: z30.url().max(768),
10301
+ var RegisterPushSubscriptionSchema = z31.object({
10302
+ endpoint: z31.url().max(768),
10077
10303
  keys: PushSubscriptionKeysSchema,
10078
- deviceName: z30.string().max(255).optional()
10304
+ deviceName: z31.string().max(255).optional()
10079
10305
  });
10080
- var UpdatePushSubscriptionSchema = z30.object({
10081
- deviceName: z30.string().max(255).nullable().optional()
10306
+ var UpdatePushSubscriptionSchema = z31.object({
10307
+ deviceName: z31.string().max(255).nullable().optional()
10082
10308
  });
10083
- var RemovePushSubscriptionByEndpointQuerySchema = z30.object({
10084
- endpoint: z30.url().max(768)
10309
+ var RemovePushSubscriptionByEndpointQuerySchema = z31.object({
10310
+ endpoint: z31.url().max(768)
10085
10311
  });
10086
- var PushSubscriptionSchema = z30.object({
10087
- id: z30.string(),
10088
- endpoint: z30.string(),
10089
- deviceName: z30.string().nullable(),
10090
- userAgent: z30.string().nullable(),
10091
- createdAt: z30.string(),
10092
- updatedAt: z30.string(),
10093
- lastUsedAt: z30.string().nullable()
10312
+ var PushSubscriptionSchema = z31.object({
10313
+ id: z31.string(),
10314
+ endpoint: z31.string(),
10315
+ deviceName: z31.string().nullable(),
10316
+ userAgent: z31.string().nullable(),
10317
+ createdAt: z31.string(),
10318
+ updatedAt: z31.string(),
10319
+ lastUsedAt: z31.string().nullable()
10094
10320
  });
10095
- var PushSubscriptionListResponseSchema = z30.object({
10096
- subscriptions: z30.array(PushSubscriptionSchema)
10321
+ var PushSubscriptionListResponseSchema = z31.object({
10322
+ subscriptions: z31.array(PushSubscriptionSchema)
10097
10323
  });
10098
10324
 
10099
10325
  // ../../packages/core/dist/esm/schemas/sample-automation.schema.js
10100
- import { z as z31 } from "zod";
10101
- var sampleAutomationSchema = z31.object({
10102
- id: z31.string(),
10103
- manifest: manifestSchema,
10104
- connectorDetails: z31.array(connectorDetailsSchema),
10105
- isOneClickInstallEnabled: z31.boolean().default(false),
10106
- staffPick: z31.boolean().default(false)
10107
- });
10108
- var sampleAutomationsSchema = z31.array(sampleAutomationSchema);
10109
-
10110
- // ../../packages/core/dist/esm/schemas/subscription.schema.js
10111
10326
  import { z as z32 } from "zod";
10112
- var createSubscriptionSchema = z32.object({
10113
- connectorId: z32.string().min(1, "Connector ID is required"),
10114
- connectionId: z32.string().min(1, "Connection ID is required"),
10115
- triggerEventId: z32.string().min(1, "Trigger event ID is required"),
10116
- outputSchema: z32.record(z32.string(), z32.unknown()),
10117
- inputSchema: z32.record(z32.string(), z32.unknown()).optional()
10118
- });
10119
- var subscriptionResponseSchema = z32.object({
10327
+ var sampleAutomationSchema = z32.object({
10120
10328
  id: z32.string(),
10121
- agentId: z32.string(),
10122
- connectorId: z32.string(),
10123
- connectionId: z32.string(),
10124
- triggerEventId: z32.string(),
10125
- providerType: z32.enum(PROVIDER_TYPES),
10126
- status: z32.enum(WEBHOOK_SUBSCRIPTION_STATUSES),
10127
- outputSchema: z32.record(z32.string(), z32.unknown()).optional(),
10128
- inputSchema: z32.record(z32.string(), z32.unknown()).optional(),
10129
- webhook: z32.object({
10130
- endpoint: z32.string(),
10131
- providerConfig: z32.record(z32.string(), z32.unknown()).optional()
10132
- }).optional(),
10133
- createdAt: z32.string(),
10134
- updatedAt: z32.string()
10329
+ manifest: manifestSchema,
10330
+ connectorDetails: z32.array(connectorDetailsSchema),
10331
+ isOneClickInstallEnabled: z32.boolean().default(false),
10332
+ staffPick: z32.boolean().default(false)
10135
10333
  });
10334
+ var sampleAutomationsSchema = z32.array(sampleAutomationSchema);
10136
10335
 
10137
- // ../../packages/core/dist/esm/schemas/usage-billing.schema.js
10336
+ // ../../packages/core/dist/esm/schemas/subscription.schema.js
10138
10337
  import { z as z33 } from "zod";
10139
- var UsageBillingProductSchema = z33.literal("automations");
10140
- var UsageBillingAccountSchema = z33.object({
10141
- id: z33.string().regex(/^[1-9]\d*$/),
10142
- type: z33.literal("user")
10143
- });
10144
- var RESERVATION_ID_MAX_LENGTH = 100;
10145
- var EXTERNAL_EVENT_ID_MAX_LENGTH = 100;
10146
- var CATEGORY_MAX_LENGTH = 64;
10147
- var AuthorizeUsageRequestSchema = z33.object({
10148
- product: UsageBillingProductSchema,
10149
- account: UsageBillingAccountSchema,
10150
- reservation_id: z33.string().min(1).max(RESERVATION_ID_MAX_LENGTH),
10151
- category: z33.string().min(1).max(CATEGORY_MAX_LENGTH)
10152
- });
10153
- var UsageBillingUnitsSchema = z33.number().int().nonnegative();
10154
- var UsageBillingBalanceSchema = z33.number().int();
10155
- var RecordUsageRefsSchema = z33.record(z33.string().max(40), z33.string().max(500)).refine((refs) => Object.keys(refs).length <= 50);
10156
- var AuthorizeUsageResponseSchema = z33.discriminatedUnion("decision", [
10157
- z33.object({
10158
- decision: z33.literal("allowed"),
10159
- reservation_id: z33.string().min(1),
10160
- available_units: UsageBillingBalanceSchema
10161
- }),
10162
- z33.object({
10163
- decision: z33.literal("denied"),
10164
- reason: z33.enum(["insufficient_credit", "no_billing_account"]),
10165
- available_units: UsageBillingBalanceSchema
10166
- })
10167
- ]);
10168
- var RecordUsageRequestSchema = z33.object({
10169
- product: UsageBillingProductSchema,
10170
- account: UsageBillingAccountSchema,
10171
- reservation_id: z33.string().min(1).max(RESERVATION_ID_MAX_LENGTH),
10172
- external_event_id: z33.string().min(1).max(EXTERNAL_EVENT_ID_MAX_LENGTH).refine((value) => !value.startsWith("reservation:")),
10173
- category: z33.string().min(1).max(CATEGORY_MAX_LENGTH),
10174
- status: z33.enum(["success", "failed", "cancelled", "timed_out", "partial"]),
10175
- incurred_cost: z33.number().int().nonnegative(),
10176
- refs: RecordUsageRefsSchema.optional(),
10177
- description: z33.string().min(1).max(255)
10178
- });
10179
- var RecordUsageResponseSchema = z33.object({
10180
- recorded: z33.boolean(),
10181
- charged_units: UsageBillingUnitsSchema,
10182
- available_units: UsageBillingBalanceSchema
10183
- });
10184
- var TOP_UP_USD_MIN_AMOUNT = 500;
10185
- var TopUpCurrencySchema = z33.preprocess((value) => typeof value === "string" ? value.toLowerCase() : value, z33.literal("usd"));
10186
- var StartTopUpRequestSchema = z33.object({
10187
- amount: z33.number().int().min(TOP_UP_USD_MIN_AMOUNT),
10188
- // The public OpenAPI example uses lowercase `usd`; the backend also
10189
- // normalizes caller casing before checking the currently supported currency.
10190
- currency: TopUpCurrencySchema,
10191
- return_url: z33.url()
10192
- });
10193
- var StartTopUpResponseSchema = z33.object({
10194
- session_id: z33.string().min(1),
10195
- checkout_url: z33.url()
10196
- });
10197
- var BillingPortalUrlRequestSchema = z33.object({
10198
- return_url: z33.url()
10199
- });
10200
- var BillingPortalUrlResponseSchema = z33.object({
10201
- billing_portal_url: z33.url()
10202
- });
10203
- var ReadStateResponseSchema = z33.object({
10204
- available_units: UsageBillingBalanceSchema,
10205
- available_amount: UsageBillingBalanceSchema,
10206
- currency: z33.string(),
10207
- usage_allowed: z33.boolean(),
10208
- low_balance: z33.boolean(),
10209
- depleted: z33.boolean()
10210
- });
10211
- var UsageBillingAmountSchema = UsageBillingUnitsSchema.nullable();
10212
- var UsageBillingEntrySchema = z33.object({
10213
- id: z33.number().int().positive(),
10214
- type: z33.string().min(1),
10215
- created_at: z33.iso.datetime(),
10216
- category: z33.string().min(1).optional(),
10217
- status: z33.string().min(1).optional(),
10218
- charged_units: UsageBillingAmountSchema,
10219
- /** `charged_units` in integer microdollars. `null` exactly when it is. */
10220
- charged_amount: UsageBillingAmountSchema,
10221
- credited_units: UsageBillingAmountSchema,
10222
- /** `credited_units` in integer microdollars. `null` exactly when it is. */
10223
- credited_amount: UsageBillingAmountSchema,
10224
- refs: z33.record(z33.string(), z33.unknown()).optional(),
10225
- description: z33.string().optional()
10226
- }).refine((entry) => entry.charged_units === null === (entry.charged_amount === null) && entry.credited_units === null === (entry.credited_amount === null), { message: "Each units field and its amount must be null together" });
10227
- var USAGE_BILLING_ENTRY_TYPES = [
10228
- "usage_settled",
10229
- "top_up",
10230
- "adjustment",
10231
- "void",
10232
- "expiry",
10233
- "chargeback"
10234
- ];
10235
- var UsageBillingEntryTypeSchema = z33.enum(USAGE_BILLING_ENTRY_TYPES);
10236
- var ReadTransactionsResponseSchema = z33.object({
10237
- /**
10238
- * On the page rather than on each entry: an account pins one price for its
10239
- * whole life, so no two entries can differ.
10240
- */
10241
- currency: z33.string(),
10242
- entries: z33.array(UsageBillingEntrySchema),
10243
- has_more: z33.boolean(),
10244
- /** Absent on the last page. */
10245
- next_cursor: z33.string().min(1).optional()
10246
- });
10247
- var ReadUsageSummaryRequestSchema = z33.object({
10248
- /** Omit to total every category. */
10249
- category: z33.string().min(1).optional(),
10250
- /** Start of the window, inclusive. Omit to start at the account's first event. */
10251
- since: z33.iso.datetime().optional(),
10252
- /** End of the window, exclusive. Omit to run to now. */
10253
- until: z33.iso.datetime().optional()
10254
- });
10255
- var ReadUsageSummaryResponseSchema = z33.object({
10256
- currency: z33.string(),
10257
- usage_count: UsageBillingUnitsSchema,
10258
- charged_units: UsageBillingUnitsSchema,
10259
- /** `charged_units` in integer microdollars. `0` on an account with no usage. */
10260
- charged_amount: UsageBillingUnitsSchema
10261
- });
10262
- var GrantWelcomeCreditRequestSchema = z33.object({
10263
- product: UsageBillingProductSchema,
10264
- account: UsageBillingAccountSchema,
10265
- operator: z33.email().max(254)
10266
- });
10267
- var GrantWelcomeCreditResponseSchema = z33.object({
10268
- status: z33.enum(["granted", "already_granted"]),
10269
- grant_id: z33.string().min(1)
10338
+ var createSubscriptionSchema = z33.object({
10339
+ connectorId: z33.string().min(1, "Connector ID is required"),
10340
+ connectionId: z33.string().min(1, "Connection ID is required"),
10341
+ triggerEventId: z33.string().min(1, "Trigger event ID is required"),
10342
+ outputSchema: z33.record(z33.string(), z33.unknown()),
10343
+ inputSchema: z33.record(z33.string(), z33.unknown()).optional()
10344
+ });
10345
+ var subscriptionResponseSchema = z33.object({
10346
+ id: z33.string(),
10347
+ agentId: z33.string(),
10348
+ connectorId: z33.string(),
10349
+ connectionId: z33.string(),
10350
+ triggerEventId: z33.string(),
10351
+ providerType: z33.enum(PROVIDER_TYPES),
10352
+ status: z33.enum(WEBHOOK_SUBSCRIPTION_STATUSES),
10353
+ outputSchema: z33.record(z33.string(), z33.unknown()).optional(),
10354
+ inputSchema: z33.record(z33.string(), z33.unknown()).optional(),
10355
+ webhook: z33.object({
10356
+ endpoint: z33.string(),
10357
+ providerConfig: z33.record(z33.string(), z33.unknown()).optional()
10358
+ }).optional(),
10359
+ createdAt: z33.string(),
10360
+ updatedAt: z33.string()
10270
10361
  });
10271
10362
 
10272
10363
  // ../../packages/core/dist/esm/schemas/user-settings.schema.js
@@ -11031,6 +11122,9 @@ var automationDraftsEndpoints = {
11031
11122
  };
11032
11123
 
11033
11124
  // ../../packages/sdk/dist/esm/clients/automation-drafts/automation-drafts-client.js
11125
+ function toCreateQuery(translate) {
11126
+ return translate === void 0 ? void 0 : { translate };
11127
+ }
11034
11128
  var AutomationDraftsClient = class extends BaseClient {
11035
11129
  async list(args = {}, options) {
11036
11130
  const { cursor, limit } = CursorPaginationSchema.parse(args);
@@ -11053,11 +11147,13 @@ var AutomationDraftsClient = class extends BaseClient {
11053
11147
  }
11054
11148
  async create(manifest, options) {
11055
11149
  const body = partialManifestSchema.parse(manifest);
11150
+ const { translate, ...requestOptions } = options ?? {};
11056
11151
  const data = await this.request({
11057
11152
  method: "POST",
11058
11153
  path: automationDraftsEndpoints.list,
11154
+ query: toCreateQuery(translate),
11059
11155
  body,
11060
- options
11156
+ options: requestOptions
11061
11157
  });
11062
11158
  return automationDraftWithValidationSchema.parse(data);
11063
11159
  }
@@ -11344,11 +11440,23 @@ var WorkspaceAutomationRunsClient = class extends BaseClient {
11344
11440
 
11345
11441
  // ../../packages/sdk/dist/esm/clients/workspace-automation-draft-connections/endpoints.js
11346
11442
  var workspaceAutomationDraftConnectionsEndpoints = {
11347
- list: (workspaceId, draftId) => `/workspaces/${encodeURIComponent(workspaceId)}/automation-drafts/${encodeURIComponent(draftId)}/connections`
11443
+ list: (workspaceId, draftId) => root6(workspaceId, draftId),
11444
+ status: (workspaceId, draftId) => `${root6(workspaceId, draftId)}/status`
11348
11445
  };
11446
+ function root6(workspaceId, draftId) {
11447
+ return `/workspaces/${encodeURIComponent(workspaceId)}/automation-drafts/${encodeURIComponent(draftId)}/connections`;
11448
+ }
11349
11449
 
11350
11450
  // ../../packages/sdk/dist/esm/clients/workspace-automation-draft-connections/workspace-automation-draft-connections-client.js
11351
11451
  var WorkspaceAutomationDraftConnectionsClient = class extends BaseClient {
11452
+ async list(workspaceId, draftId, options) {
11453
+ const data = await this.request({
11454
+ method: "GET",
11455
+ path: workspaceAutomationDraftConnectionsEndpoints.list(IdSchema.parse(workspaceId), IdSchema.parse(draftId)),
11456
+ options
11457
+ });
11458
+ return GetAutomationDraftConnectionsResponseSchema.parse(data);
11459
+ }
11352
11460
  async upsert(workspaceId, draftId, body, options) {
11353
11461
  const parsedBody = CreateAutomationDraftConnectionSchema.parse(body);
11354
11462
  const data = await this.request({
@@ -11359,14 +11467,23 @@ var WorkspaceAutomationDraftConnectionsClient = class extends BaseClient {
11359
11467
  });
11360
11468
  return AutomationDraftConnectionSchema.parse(data);
11361
11469
  }
11470
+ async getStatus(workspaceId, draftId, options) {
11471
+ const data = await this.request({
11472
+ method: "GET",
11473
+ path: workspaceAutomationDraftConnectionsEndpoints.status(IdSchema.parse(workspaceId), IdSchema.parse(draftId)),
11474
+ options
11475
+ });
11476
+ return GetAutomationDraftConnectionValidationResponseSchema.parse(data);
11477
+ }
11362
11478
  };
11363
11479
 
11364
11480
  // ../../packages/sdk/dist/esm/clients/workspace-automation-drafts/endpoints.js
11365
11481
  var workspaceAutomationDraftsEndpoints = {
11366
- list: (workspaceId) => `${root6(workspaceId)}`,
11367
- detail: (workspaceId, id) => `${root6(workspaceId)}/${encodeURIComponent(id)}`
11482
+ list: (workspaceId) => `${root7(workspaceId)}`,
11483
+ detail: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}`,
11484
+ finalize: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}/finalize`
11368
11485
  };
11369
- function root6(workspaceId) {
11486
+ function root7(workspaceId) {
11370
11487
  return `/workspaces/${encodeURIComponent(workspaceId)}/automation-drafts`;
11371
11488
  }
11372
11489
 
@@ -11390,6 +11507,29 @@ var WorkspaceAutomationDraftsClient = class extends BaseClient {
11390
11507
  });
11391
11508
  return automationDraftWithValidationSchema.parse(data);
11392
11509
  }
11510
+ async create(workspaceId, manifest, options) {
11511
+ const body = partialManifestSchema.parse(manifest);
11512
+ const { translate, ...requestOptions } = options ?? {};
11513
+ const data = await this.request({
11514
+ method: "POST",
11515
+ path: workspaceAutomationDraftsEndpoints.list(IdSchema.parse(workspaceId)),
11516
+ // Only sent when set, so a default create is unchanged on the wire.
11517
+ query: translate === void 0 ? void 0 : { translate },
11518
+ body,
11519
+ options: requestOptions
11520
+ });
11521
+ return automationDraftWithValidationSchema.parse(data);
11522
+ }
11523
+ async update(workspaceId, draftId, manifest, options) {
11524
+ const body = partialManifestSchema.parse(manifest);
11525
+ const data = await this.request({
11526
+ method: "PUT",
11527
+ path: workspaceAutomationDraftsEndpoints.detail(IdSchema.parse(workspaceId), IdSchema.parse(draftId)),
11528
+ body,
11529
+ options
11530
+ });
11531
+ return automationDraftWithValidationSchema.parse(data);
11532
+ }
11393
11533
  /** Deletes the draft. Only its owner can; the API answers 404 otherwise. */
11394
11534
  async delete(workspaceId, draftId, options) {
11395
11535
  await this.request({
@@ -11398,6 +11538,15 @@ var WorkspaceAutomationDraftsClient = class extends BaseClient {
11398
11538
  options
11399
11539
  });
11400
11540
  }
11541
+ /** Publishes the draft as a workspace automation, or updates the one it edits. */
11542
+ async finalize(workspaceId, draftId, options) {
11543
+ const data = await this.request({
11544
+ method: "POST",
11545
+ path: workspaceAutomationDraftsEndpoints.finalize(IdSchema.parse(workspaceId), IdSchema.parse(draftId)),
11546
+ options
11547
+ });
11548
+ return finalizeAutomationDraftResponseSchema.parse(data);
11549
+ }
11401
11550
  };
11402
11551
 
11403
11552
  // ../../packages/sdk/dist/esm/clients/workspace-chat/endpoints.js
@@ -11421,15 +11570,16 @@ var WorkspaceChatClient = class extends BaseClient {
11421
11570
 
11422
11571
  // ../../packages/sdk/dist/esm/clients/workspace-automations/endpoints.js
11423
11572
  var workspaceAutomationsEndpoints = {
11424
- list: (workspaceId) => `${root7(workspaceId)}`,
11425
- detail: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}`,
11426
- metadata: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}/metadata`,
11427
- schedule: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}/schedule`,
11428
- visibility: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}/visibility`,
11429
- move: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}/move`,
11430
- trigger: (workspaceId, id) => `${root7(workspaceId)}/${encodeURIComponent(id)}/trigger`
11573
+ list: (workspaceId) => `${root8(workspaceId)}`,
11574
+ detail: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}`,
11575
+ metadata: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/metadata`,
11576
+ schedule: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/schedule`,
11577
+ visibility: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/visibility`,
11578
+ move: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/move`,
11579
+ trigger: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/trigger`,
11580
+ draft: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/draft`
11431
11581
  };
11432
- function root7(workspaceId) {
11582
+ function root8(workspaceId) {
11433
11583
  return `/workspaces/${encodeURIComponent(workspaceId)}/automations`;
11434
11584
  }
11435
11585
 
@@ -11527,12 +11677,33 @@ var WorkspaceAutomationsClient = class extends BaseClient {
11527
11677
  options
11528
11678
  });
11529
11679
  }
11680
+ /** The edit draft currently open for the automation, if any (404 otherwise). */
11681
+ async getDraft(workspaceId, id, options) {
11682
+ const data = await this.request({
11683
+ method: "GET",
11684
+ path: workspaceAutomationsEndpoints.draft(IdSchema.parse(workspaceId), IdSchema.parse(id)),
11685
+ options
11686
+ });
11687
+ return automationDraftSchema.parse(data);
11688
+ }
11689
+ /**
11690
+ * Opens an edit draft seeded from the published manifest. Answers 409 when
11691
+ * one is already open; see `getOpenDraftConflictError`.
11692
+ */
11693
+ async createDraft(workspaceId, id, options) {
11694
+ const data = await this.request({
11695
+ method: "POST",
11696
+ path: workspaceAutomationsEndpoints.draft(IdSchema.parse(workspaceId), IdSchema.parse(id)),
11697
+ options
11698
+ });
11699
+ return createDraftResponseSchema.parse(data);
11700
+ }
11530
11701
  };
11531
11702
 
11532
11703
  // ../../packages/sdk/dist/esm/clients/workspaces/endpoints.js
11533
- var root8 = "/workspaces";
11704
+ var root9 = "/workspaces";
11534
11705
  var workspacesEndpoints = {
11535
- list: root8
11706
+ list: root9
11536
11707
  };
11537
11708
 
11538
11709
  // ../../packages/sdk/dist/esm/clients/workspaces/workspaces-client.js
@@ -11554,12 +11725,12 @@ var WorkspacesClient = class extends BaseClient {
11554
11725
  };
11555
11726
 
11556
11727
  // ../../packages/sdk/dist/esm/clients/chat/endpoints.js
11557
- var root9 = "/chat/conversations";
11728
+ var root10 = "/chat/conversations";
11558
11729
  var chatEndpoints = {
11559
- conversations: root9,
11560
- conversation: (id) => `${root9}/${encodeURIComponent(id)}`,
11561
- messages: (id) => `${root9}/${encodeURIComponent(id)}/messages`,
11562
- usagePreview: (id) => `${root9}/${encodeURIComponent(id)}/usage-preview`
11730
+ conversations: root10,
11731
+ conversation: (id) => `${root10}/${encodeURIComponent(id)}`,
11732
+ messages: (id) => `${root10}/${encodeURIComponent(id)}/messages`,
11733
+ usagePreview: (id) => `${root10}/${encodeURIComponent(id)}/usage-preview`
11563
11734
  };
11564
11735
 
11565
11736
  // ../../packages/sdk/dist/esm/clients/chat/chat-client.js
@@ -11636,14 +11807,15 @@ var ChatClient = class extends BaseClient {
11636
11807
  import { z as z51 } from "zod";
11637
11808
 
11638
11809
  // ../../packages/sdk/dist/esm/clients/connections/endpoints.js
11639
- var root10 = "/connections";
11810
+ var root11 = "/connections";
11640
11811
  var connectionsEndpoints = {
11641
- list: root10,
11642
- detail: (id) => `${root10}/${encodeURIComponent(id)}`,
11643
- token: (id) => `${root10}/${encodeURIComponent(id)}/token`,
11644
- dependentAutomations: (connectorId) => `${root10}/${encodeURIComponent(connectorId)}/automations`,
11645
- create: (connectorId, capability) => `${root10}/${encodeURIComponent(connectorId)}/${encodeURIComponent(capability)}`,
11646
- checkManifest: `${root10}/check-manifest`
11812
+ list: root11,
11813
+ detail: (id) => `${root11}/${encodeURIComponent(id)}`,
11814
+ token: (id) => `${root11}/${encodeURIComponent(id)}/token`,
11815
+ dependentAutomations: (connectorId) => `${root11}/${encodeURIComponent(connectorId)}/automations`,
11816
+ create: (connectorId, capability) => `${root11}/${encodeURIComponent(connectorId)}/${encodeURIComponent(capability)}`,
11817
+ localOAuth: (connectorId, capability) => `${root11}/${encodeURIComponent(connectorId)}/${encodeURIComponent(capability)}/local-oauth`,
11818
+ checkManifest: `${root11}/check-manifest`
11647
11819
  };
11648
11820
 
11649
11821
  // ../../packages/sdk/dist/esm/clients/connections/connections-client.js
@@ -11722,6 +11894,41 @@ var ConnectionsClient = class extends BaseClient {
11722
11894
  });
11723
11895
  return CreateConnectionResponseSchema.parse(data);
11724
11896
  }
11897
+ /**
11898
+ * The authorization server endpoints and scopes for running a
11899
+ * `connectsViaCli` connector's OAuth flow with a loopback client.
11900
+ */
11901
+ async getLocalOAuthSetup(args, options) {
11902
+ const { connectorId, capability } = CreateConnectionParamsSchema.parse({
11903
+ connectorId: IdSchema.parse(args.connectorId),
11904
+ capability: args.capability
11905
+ });
11906
+ const data = await this.request({
11907
+ method: "GET",
11908
+ path: connectionsEndpoints.localOAuth(connectorId, capability),
11909
+ options
11910
+ });
11911
+ return LocalOAuthSetupSchema.parse(data);
11912
+ }
11913
+ /**
11914
+ * Stores a grant the CLI obtained with a loopback OAuth client, for a
11915
+ * connector whose authorization server admits no hosted clients
11916
+ * (`connectsViaCli`). The connection comes back already authorized.
11917
+ */
11918
+ async importLocalOAuth(args, options) {
11919
+ const { connectorId, capability } = CreateConnectionParamsSchema.parse({
11920
+ connectorId: IdSchema.parse(args.connectorId),
11921
+ capability: args.capability
11922
+ });
11923
+ const body = ImportLocalOAuthConnectionBodySchema.parse(args.grant);
11924
+ const data = await this.request({
11925
+ method: "POST",
11926
+ path: connectionsEndpoints.localOAuth(connectorId, capability),
11927
+ body,
11928
+ options
11929
+ });
11930
+ return CreateConnectionResponseSchema.parse(data);
11931
+ }
11725
11932
  async checkManifest(manifest, options) {
11726
11933
  const parsedManifest = partialManifestSchema.parse(manifest);
11727
11934
  const data = await this.request({
@@ -11801,12 +12008,12 @@ function createClientContext(authToken, options = {}, apiOrigin = "automations")
11801
12008
  import { z as z54 } from "zod";
11802
12009
 
11803
12010
  // ../../packages/sdk/dist/esm/clients/notifications/endpoints.js
11804
- var root11 = "/notifications";
12011
+ var root12 = "/notifications";
11805
12012
  var notificationsEndpoints = {
11806
- list: root11,
11807
- pendingPromptAutomations: `${root11}/pending-prompt-automations`,
11808
- detail: (id) => `${root11}/${encodeURIComponent(id)}`,
11809
- respond: (id) => `${root11}/${encodeURIComponent(id)}/respond`
12013
+ list: root12,
12014
+ pendingPromptAutomations: `${root12}/pending-prompt-automations`,
12015
+ detail: (id) => `${root12}/${encodeURIComponent(id)}`,
12016
+ respond: (id) => `${root12}/${encodeURIComponent(id)}/respond`
11810
12017
  };
11811
12018
  var pushRoot = "/push-subscriptions";
11812
12019
  var pushSubscriptionsEndpoints = {
@@ -11931,11 +12138,11 @@ var NotificationsClient = class extends BaseClient {
11931
12138
  };
11932
12139
 
11933
12140
  // ../../packages/sdk/dist/esm/clients/user-settings/endpoints.js
11934
- var root12 = "/settings";
12141
+ var root13 = "/settings";
11935
12142
  var userSettingsEndpoints = {
11936
- onboarding: `${root12}/onboarding`,
11937
- preferences: `${root12}/preferences`,
11938
- terms: `${root12}/terms`
12143
+ onboarding: `${root13}/onboarding`,
12144
+ preferences: `${root13}/preferences`,
12145
+ terms: `${root13}/terms`
11939
12146
  };
11940
12147
 
11941
12148
  // ../../packages/sdk/dist/esm/clients/user-settings/user-settings-client.js
@@ -12100,11 +12307,11 @@ var UsageBillingClient = class extends BaseClient {
12100
12307
  };
12101
12308
 
12102
12309
  // ../../packages/sdk/dist/esm/clients/webhook-event-subscriptions/endpoints.js
12103
- var root13 = "/webhook-event-subscriptions";
12310
+ var root14 = "/webhook-event-subscriptions";
12104
12311
  var webhookEventSubscriptionsEndpoints = {
12105
- list: root13,
12106
- detail: (id) => `${root13}/${encodeURIComponent(id)}`,
12107
- deliveries: (id) => `${root13}/${encodeURIComponent(id)}/deliveries`
12312
+ list: root14,
12313
+ detail: (id) => `${root14}/${encodeURIComponent(id)}`,
12314
+ deliveries: (id) => `${root14}/${encodeURIComponent(id)}/deliveries`
12108
12315
  };
12109
12316
 
12110
12317
  // ../../packages/sdk/dist/esm/clients/webhook-event-subscriptions/webhook-event-subscriptions-client.js
@@ -12180,12 +12387,12 @@ var WebhookEventSubscriptionsClient = class extends BaseClient {
12180
12387
  import { z as z56 } from "zod";
12181
12388
 
12182
12389
  // ../../packages/sdk/dist/esm/clients/webhook-subscriptions/endpoints.js
12183
- function root14(automationId) {
12390
+ function root15(automationId) {
12184
12391
  return `/automations/${encodeURIComponent(automationId)}/subscriptions`;
12185
12392
  }
12186
12393
  var webhookSubscriptionsEndpoints = {
12187
- list: (automationId) => root14(automationId),
12188
- detail: (automationId, subscriptionId) => `${root14(automationId)}/${encodeURIComponent(subscriptionId)}`
12394
+ list: (automationId) => root15(automationId),
12395
+ detail: (automationId, subscriptionId) => `${root15(automationId)}/${encodeURIComponent(subscriptionId)}`
12189
12396
  };
12190
12397
 
12191
12398
  // ../../packages/sdk/dist/esm/clients/webhook-subscriptions/webhook-subscriptions-client.js
@@ -12358,6 +12565,7 @@ function summarizeAutomationListItem(dto) {
12358
12565
  visibility: dto.visibility,
12359
12566
  isOwner: dto.isOwner,
12360
12567
  ...dto.workspaceId ? { workspaceId: dto.workspaceId } : {},
12568
+ ...dto.createdBy ? { createdBy: dto.createdBy } : {},
12361
12569
  ...dto.updatedBy ? { updatedBy: dto.updatedBy } : {},
12362
12570
  ...dto.disabledReason ? { disabledReason: dto.disabledReason } : {},
12363
12571
  triggers: triggers.flatMap((trigger) => summarizeTrigger(trigger) ?? []),
@@ -12936,7 +13144,7 @@ import { McpServer } from "@modelcontextprotocol/server";
12936
13144
  // package.json
12937
13145
  var package_default = {
12938
13146
  name: "@doist/automations-mcp",
12939
- version: "1.3.0",
13147
+ version: "1.4.0",
12940
13148
  description: "MCP server and importable AI tools for Todoist Automations",
12941
13149
  type: "module",
12942
13150
  main: "./dist/index.js",
@@ -12991,9 +13199,9 @@ var package_default = {
12991
13199
  devDependencies: {
12992
13200
  "@doist/automations-core": "*",
12993
13201
  "@doist/automations-sdk": "*",
12994
- "@modelcontextprotocol/client": "2.0.0",
12995
- "@modelcontextprotocol/server": "2.0.0",
12996
- "@types/node": "24.13.6",
13202
+ "@modelcontextprotocol/client": "2.3.1",
13203
+ "@modelcontextprotocol/server": "2.3.1",
13204
+ "@types/node": "24.19.1",
12997
13205
  "conventional-changelog-conventionalcommits": "9.3.1",
12998
13206
  esbuild: "0.28.2",
12999
13207
  "gpt-tokenizer": "4.0.0",
@@ -13001,7 +13209,7 @@ var package_default = {
13001
13209
  "semantic-release-monorepo": "8.0.2",
13002
13210
  tsx: "4.23.15",
13003
13211
  typescript: "6.0.3",
13004
- vitest: "4.1.11"
13212
+ vitest: "5.0.3"
13005
13213
  },
13006
13214
  engines: {
13007
13215
  node: ">=24.15.0 <25",
@@ -13259,6 +13467,9 @@ var automationSummarySchema = z60.object({
13259
13467
  visibility: z60.enum(AUTOMATION_VISIBILITIES),
13260
13468
  isOwner: z60.boolean(),
13261
13469
  workspaceId: z60.string().optional().describe("Absent for personal automations."),
13470
+ createdBy: z60.string().optional().describe(
13471
+ "The Todoist user id of whoever created the automation. It never changes, including when the automation is moved."
13472
+ ),
13262
13473
  updatedBy: z60.string().optional().describe(
13263
13474
  "The Todoist user id of whoever last changed the automation, which in a workspace can be an admin rather than the creator. Absent until someone has changed it."
13264
13475
  ),
@@ -14923,7 +15134,7 @@ You have access to a user's Todoist Automations through the tools listed.
14923
15134
  - An automation belongs either to the user's personal space or to one Todoist workspace, and the two are separate. Pass workspaceId to reach workspace automations; omit it for personal ones.
14924
15135
  - update-automation, set-automation-schedule, set-automation-visibility, move-automation, trigger-automation, delete-automation, delete-draft and disconnect-service act immediately: no preview, and no confirmation of their own. Read the target first (get-automation, get-draft for a draft, or get-connector for a connection) so it is the right one, and confirm intent with the user before changing, running or deleting anything they did not explicitly ask for.
14925
15136
  - trigger-automation returns before the run finishes; find-runs shows the outcome.
14926
- - A workspace automation is either visible to the whole workspace or private to its creator; isOwner says whether the user created it. Another member's automation is read-only for the user, but trigger-automation still works on it and the run executes on its creator's connections; find-runs shows who started each run as triggeredBy.
15137
+ - A workspace automation is either visible to the whole workspace or private to its creator; isOwner says whether the user created it, and createdBy gives the creator's Todoist user id. Another member's automation is read-only for the user, but trigger-automation still works on it and the run executes on its creator's connections; find-runs shows who started each run as triggeredBy.
14927
15138
  - A workspace admin can update-automation, set-automation-visibility and delete-automation on another member's team-visible automation, but cannot reschedule it, change what it does (that needs its creator's draft or conversation) or reach a private one. updatedBy on an automation tells the creator's own change from an admin's.
14928
15139
  - move-automation puts an automation the user created into a workspace, from the personal space or another workspace, and never back out. Connections stay personal in every space: a moved or shared automation keeps running on its creator's own connections.
14929
15140
  - Authoring happens in the space the conversation was started in: pass workspaceId to start-conversation to author a workspace automation, and continue-conversation follows it automatically.
@@ -14958,4 +15169,4 @@ export {
14958
15169
  DEFAULT_BASE_URL,
14959
15170
  getMcpServer
14960
15171
  };
14961
- //# sourceMappingURL=chunk-JNUCEABU.js.map
15172
+ //# sourceMappingURL=chunk-RHDIMBV7.js.map