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