@doist/automations-mcp 1.3.0 → 1.4.1

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