@keystrokehq/cli 0.0.19 → 0.0.20
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/{accept.handler-BVmNNAgL.mjs → accept.handler-CiqqUxKN.mjs} +1 -1
- package/dist/{admin-DQlHFuXn.mjs → admin-B0U2Aghv.mjs} +9 -9
- package/dist/{agent-bundle-package-DWV6B_5q-FPT0bJaA.mjs → agent-bundle-package-DWV6B_5q-BsbCEeMw.mjs} +1 -1
- package/dist/{agents-Dd7UeQCw.mjs → agents-DBebUEwk.mjs} +6 -6
- package/dist/{api-nR61stdq.mjs → api-BjBpWWlm.mjs} +1 -1
- package/dist/{api-keys-BsMBFiD_.mjs → api-keys-BHAgmC4E.mjs} +5 -5
- package/dist/{auth-ZTuuEoD6.mjs → auth-D-PZAjdd.mjs} +5 -5
- package/dist/{auth.handler-C1dZBdaG.mjs → auth.handler-CxTDSO6O.mjs} +1 -1
- package/dist/{build-agents-DseUtzd4-CthuIecx.mjs → build-agents-DseUtzd4-BNtZrqoY.mjs} +5 -5
- package/dist/{build-metadata-C8Ra_Gi--L3l8w0rh.mjs → build-metadata-BB_L45ZS-d5-QLDZ5.mjs} +10 -10
- package/dist/{build-progress-AR8xow4_.mjs → build-progress-BVwDg6lC.mjs} +1 -1
- package/dist/{build-tasks-GVuMLS0h-BaPhhGXO.mjs → build-tasks-C09SdfjC-DxKcmENc.mjs} +4 -4
- package/dist/{build-workflows-CV4tBo6S-szwrAGWT.mjs → build-workflows-BZ_m97Pr-DwcnRlyh.mjs} +9 -10
- package/dist/{build.handler-DJrEMCBw.mjs → build.handler-CTX80S1K.mjs} +4 -4
- package/dist/{chunk-CH6r78ws.mjs → chunk-DYxdGL9S.mjs} +2 -1
- package/dist/{clear.handler-BgeAg2de.mjs → clear.handler-Bksm2HI4.mjs} +1 -1
- package/dist/{commander-C5qcOo8m.mjs → commander-DQLrBSIW.mjs} +1 -1
- package/dist/{connect-BtBKoXpi.mjs → connect-DV_EztVs.mjs} +2 -2
- package/dist/{connect.handler-E8CmLRSF.mjs → connect.handler-DbuGt3Xb.mjs} +3 -3
- package/dist/{context-BydAGTiB.mjs → context-BUzxM3QI.mjs} +2 -2
- package/dist/{create.handler-CBxIPC3r.mjs → create.handler-CQCRk-Na.mjs} +1 -1
- package/dist/{credentials-BGaRMclS.mjs → credentials-m18a1_hw.mjs} +6 -6
- package/dist/{credentials-jRiXEr6P.mjs → credentials-xPtLFTjW.mjs} +2 -2
- package/dist/{current-deployment-workflow-BVliROAz.mjs → current-deployment-workflow-pyBoobIm.mjs} +4 -4
- package/dist/{current.handler-DBl9S67d.mjs → current.handler-BJGJgdGP.mjs} +1 -1
- package/dist/{delete.handler-Buu7Ip0D.mjs → delete.handler-DNoehdOH.mjs} +1 -1
- package/dist/{deploy-CzTlgAFj.mjs → deploy-3tHCBGky.mjs} +2 -2
- package/dist/{deploy-BPDUTKZD.mjs → deploy-BKjcO_sm.mjs} +1 -1
- package/dist/{deploy-progress-DK87VKJ-.mjs → deploy-progress-CyolzjRB.mjs} +1 -1
- package/dist/{deploy.handler-CCcJ7y3A.mjs → deploy.handler-TnPNBYXZ.mjs} +27 -15
- package/dist/{detect-env-access-CwkOYeYM-CNTyUzme.mjs → detect-env-access-CwkOYeYM-D8-hxij0.mjs} +2 -2
- package/dist/{diff.handler-DUVFixeG.mjs → diff.handler-DO2WzdGB.mjs} +3 -3
- package/dist/{dist-Cx0RV8s7.mjs → dist-BGrWr5fp.mjs} +32 -37
- package/dist/{env.handler-C8kNFz2U.mjs → env.handler-C5GNyiJt.mjs} +6 -6
- package/dist/{error-boundary-B8cmSwJH.mjs → error-boundary-GtRvP2oP.mjs} +1 -1
- package/dist/{file-metadata-lrX05iRt.mjs → file-metadata-B8c7Y5yg.mjs} +2 -7
- package/dist/{import-module--8x5SLum-DjPUZr4i.mjs → import-module-y0glInUe-CfNsQNia.mjs} +48 -840
- package/dist/{init-DeeOVc9m.mjs → init-D9RIT2CY.mjs} +3 -3
- package/dist/{init.handler-BMdhpusQ.mjs → init.handler-0TJY1YNy.mjs} +2 -2
- package/dist/{inspect.handler-QyTo8rWO.mjs → inspect.handler-BrYFfN4H.mjs} +3 -3
- package/dist/{integration-catalog-CmvYPvI6.mjs → integration-catalog-BrJsBkfx.mjs} +1 -1
- package/dist/{integrations-tXZM-84g.mjs → integrations-vSyAQ6HA.mjs} +5 -5
- package/dist/{invites-ClyAatBW.mjs → invites-BASM4PJr.mjs} +4 -4
- package/dist/{invites.list.handler-CPkK_tPM.mjs → invites.list.handler-c-aw6g5o.mjs} +1 -1
- package/dist/{invites.resend.handler-DIRI7tS2.mjs → invites.resend.handler-MnMEjP_Z.mjs} +1 -1
- package/dist/{invites.revoke.handler-CcXcDBlU.mjs → invites.revoke.handler-CHX6Z8kj.mjs} +1 -1
- package/dist/keystroke.mjs +21 -21
- package/dist/{list-enrichment-B9238wom.mjs → list-enrichment-DcplcioC.mjs} +1 -1
- package/dist/{list.handler-Cbc9rlBx.mjs → list.handler-BBzB1_1l.mjs} +1 -1
- package/dist/{list.handler-DdFGHkqt.mjs → list.handler-BsgCd1oF.mjs} +5 -5
- package/dist/{list.handler-BB-Dcm5B.mjs → list.handler-CDtjm-6d.mjs} +1 -1
- package/dist/{list.handler-Xl_F89kq.mjs → list.handler-DJNtXw7C.mjs} +1 -1
- package/dist/{list.handler-ClPAPSWm.mjs → list.handler-DXwKdfIv.mjs} +2 -2
- package/dist/{list.handler-tnsRn-Rj.mjs → list2.handler-BdE1k2kl.mjs} +3 -3
- package/dist/{listen-ksMVpdNa.mjs → listen-Ca9KdiB2.mjs} +2 -2
- package/dist/{listen.handler-DEJSBg8y.mjs → listen.handler-KWPN03S8.mjs} +2 -2
- package/dist/{logs-C-JxXsgc.mjs → logs-BEDf7hZ0.mjs} +3 -3
- package/dist/{logs.handler-BIegqc2p.mjs → logs.handler-mk1lcZbU.mjs} +2 -2
- package/dist/{members.add.handler-D4ggN2Xi.mjs → members.add.handler-CTvlxBZU.mjs} +1 -1
- package/dist/{members.invite.handler-BYIt6Oib.mjs → members.invite.handler-wFO0r7Pi.mjs} +1 -1
- package/dist/{members.list.handler-CvpeYKC4.mjs → members.list.handler-PPdqs4nI.mjs} +1 -1
- package/dist/{members.remove.handler-C4GBUVYE.mjs → members.remove.handler-a5WI6zE4.mjs} +1 -1
- package/dist/{members.update.handler-TpM1oi0L.mjs → members.update.handler-3xblTzmz.mjs} +1 -1
- package/dist/{metadata-layout-Bv-B0nHj-B1c5giJ7.mjs → metadata-layout-Bv-B0nHj-DtMWZ7Cc.mjs} +1 -1
- package/dist/{normalize-path-CojS-CgQ-D4wSBHgG.mjs → normalize-path-CojS-CgQ-CRqBc6D6.mjs} +1 -1
- package/dist/{org-DIGyb7XZ.mjs → org-CzLw3neZ.mjs} +15 -15
- package/dist/{orgs.create.handler-RIYhse_Q.mjs → orgs.create.handler-CcPpDweZ.mjs} +1 -1
- package/dist/{orgs.get.handler-BfOpbSom.mjs → orgs.get.handler-BACPg7vR.mjs} +1 -1
- package/dist/{orgs.list.handler-BMgj9yTD.mjs → orgs.list.handler-DEF8OyvM.mjs} +1 -1
- package/dist/{paused.handler-DAZ1EaLN.mjs → paused.handler-D4j8_Za4.mjs} +1 -1
- package/dist/{projects-Cy6CH3fI.mjs → projects-CJCKxG2u.mjs} +4 -4
- package/dist/{projects-BndElPAx.mjs → projects-s5ehKLil.mjs} +2 -2
- package/dist/{requirements.handler-C5vobjdJ.mjs → requirements.handler-Bk-sAE9C.mjs} +5 -5
- package/dist/{run-polling-BhOdFyh3.mjs → run-polling-DKclfet-.mjs} +3 -3
- package/dist/{run.handler-BpLmwF_a.mjs → run.handler-x0B-CjNF.mjs} +4 -4
- package/dist/{runs-DaSd4eXn.mjs → runs-DoMVOCNj.mjs} +2 -2
- package/dist/{skills-sync.handler-DOxudKmV.mjs → skills-sync.handler-CYkCeuQn.mjs} +1 -1
- package/dist/{skills.command-DQc_qGAF.mjs → skills.command-DeAgMGGw.mjs} +4 -4
- package/dist/{source-analysis-BBg2E_6G-Ut7kYHOz.mjs → source-analysis-BBg2E_6G-BJTRqWrQ.mjs} +3 -3
- package/dist/{source-analysis-Cs0CTBQk.mjs → source-analysis-BMMPIHN9.mjs} +1 -1
- package/dist/src-BHTjsZ9V.mjs +456 -0
- package/dist/{src-0XVwHXNp.mjs → src-BYQwp8Ig.mjs} +1 -1
- package/dist/{switch.handler-CCjMrRZN.mjs → switch.handler-CV4ZBXAu.mjs} +1 -1
- package/dist/{sync-BdTQDZjP.mjs → sync-KCVM02IY.mjs} +2 -2
- package/dist/{sync.handler-DjY8nqbB.mjs → sync.handler-Cuw89341.mjs} +6 -6
- package/dist/task-BSCN9cU4.mjs +945 -0
- package/dist/{task-target-build-DCV0UDaz.mjs → task-target-build-B0HF2_At.mjs} +41 -55
- package/dist/task-target-deploy-ClbwKJ8K.mjs +4 -0
- package/dist/{task-target-deploy-CZBGNC0H-I-tvkGCC.mjs → task-target-deploy-dQYnMO8n-CeTmRcDw.mjs} +15 -17
- package/dist/task-target-deploy-runner.mjs +4 -4
- package/dist/{test-TTQXrhHm.mjs → test-Rm3thni3.mjs} +2 -2
- package/dist/{test.handler-B7Ahe9ta.mjs → test.handler-CTd-heRS.mjs} +8 -8
- package/dist/{test.handler-CkkplyX6.mjs → test.handler-DhhcsvHN.mjs} +1 -1
- package/dist/{tool.handler-DMfFZCRg.mjs → tool.handler-C3LNyQbc.mjs} +9 -63
- package/dist/{trigger-artifacts-RizI57RC-DjhOsdOm.mjs → trigger-artifacts-BcRScRSp-DqFgzl_B.mjs} +53 -119
- package/dist/trigger-manifest-DTni4NaZ.mjs +42 -0
- package/dist/{upgrade-Cx-bUWUc.mjs → upgrade-Cf7y38xR.mjs} +2 -2
- package/dist/{upload-BbcMkyVl.mjs → upload-CJWApEgz.mjs} +1 -1
- package/dist/{upload.handler-_d2WZwxd.mjs → upload.handler-BHIWYPph.mjs} +7 -7
- package/dist/{users.get.handler-DIooG7Wy.mjs → users.get.handler-spWaHG8h.mjs} +1 -1
- package/dist/{users.list.handler-DdGW-DSg.mjs → users.list.handler-DLuU7cd_.mjs} +1 -1
- package/dist/{users.set-role.handler-Ek-kntLp.mjs → users.set-role.handler-CojFmpcD.mjs} +1 -1
- package/dist/{utils-BMUWnz1P.mjs → utils-Ddltm1sR.mjs} +1 -1
- package/dist/{validate.handler-Cq2uJjXY.mjs → validate.handler-DIJBuX1P.mjs} +4 -4
- package/dist/{workflow-build-C8AiYxqp.mjs → workflow-build-IGYhEC8Y.mjs} +22 -22
- package/dist/{workflow-bundler-BzHk73PM-WI31RJjH.mjs → workflow-bundler-BzHk73PM-Cs-4Ml-p.mjs} +2 -2
- package/dist/{workflows-K6zetcqI.mjs → workflows-MANdvLft.mjs} +19 -21
- package/dist/{writer-B-SpZ0G2-CLh7sXRd.mjs → writer-byNNUjRm-w5O7-VT_.mjs} +24 -33
- package/package.json +11 -11
- package/dist/common-AK0q0Oz0.mjs +0 -20
- package/dist/credential-requirements-Ob-7H-0F.mjs +0 -250
- package/dist/cron-parser-Dw_cWzFu.mjs +0 -393
- package/dist/declared-credential-requirements-D6KT-r-e.mjs +0 -103
- package/dist/task-BRmL2lmw.mjs +0 -486
- package/dist/task-target-deploy-DmpCWE3u.mjs +0 -4
- package/dist/trigger-manifest-DxdCjGz_.mjs +0 -29
- package/dist/workflow-build-manifest-BKKW9D05.mjs +0 -259
- /package/dist/{agent-manifest-tIsqF2OP.mjs → agent-manifest-CZ7BeUSG.mjs} +0 -0
- /package/dist/{browser-BpJ8ut9z.mjs → browser-Cu4k-wT_.mjs} +0 -0
- /package/dist/{clear-cache.handler-CTLQ1PIN.mjs → clear-cache.handler-8RFmjHoo.mjs} +0 -0
- /package/dist/{clear.handler-C_pXAeBG.mjs → clear.handler-mfNmIUYP.mjs} +0 -0
- /package/dist/{concurrency-gXn9Rw8x-BTlfau8D.mjs → concurrency-gXn9Rw8x-BSBbRfVp.mjs} +0 -0
- /package/dist/{credential-env-map-BA4LNI7x.mjs → credential-env-map-qLCR_QbO.mjs} +0 -0
- /package/dist/{credential-schema-mismatch-z74ud-YZ.mjs → credential-schema-mismatch-BHI_B-U-.mjs} +0 -0
- /package/dist/{diff-utils-B0ED-Igv.mjs → diff-utils-x5pi8SrL.mjs} +0 -0
- /package/dist/{layout-P1v-Gssz.mjs → layout-DRf9qUf8.mjs} +0 -0
- /package/dist/{list.handler-BLkQKiV1.mjs → list.handler-CynN-ezD.mjs} +0 -0
- /package/dist/{logs.handler-DyRoevtO.mjs → logs.handler-CcA1UzJm.mjs} +0 -0
- /package/dist/{oxc-B3KI3rf_-Cvx4Z-4H.mjs → oxc-B3KI3rf_-Cnk0L10M.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-B0eiobOd.mjs → read-credential-keys-77a91T8M-CzXPGxdU.mjs} +0 -0
- /package/dist/{register.handler-BXeh5mdb.mjs → register.handler-CSvlOMF6.mjs} +0 -0
- /package/dist/{resolve-project-CNQtOWE4.mjs → resolve-project-CWP2fji3.mjs} +0 -0
- /package/dist/{rolldown-runtime-twds-ZHy-8uqgIurC.mjs → rolldown-runtime-twds-ZHy-BoF7MLzP.mjs} +0 -0
- /package/dist/{run-polling-DARidqo-.mjs → run-polling-CzyVv7Ba.mjs} +0 -0
- /package/dist/{schema-BjH_e4Fo.mjs → schema-CvSZqa3t.mjs} +0 -0
- /package/dist/{schema-display-NVEl_DFY.mjs → schema-display-DxLA3j5H.mjs} +0 -0
- /package/dist/{schemas-BxFPUGWT.mjs → schemas-U2OzP9gP.mjs} +0 -0
- /package/dist/{skill-installer-BBgN2tzW.mjs → skill-installer-CYFshTBy.mjs} +0 -0
- /package/dist/{skills.handler-Do9I3dQS.mjs → skills.handler-Bma-MJX-.mjs} +0 -0
- /package/dist/{spinner-progress-Bx-fYItP.mjs → spinner-progress-DV28G4tP.mjs} +0 -0
- /package/dist/{status.handler-BsVtDW_V.mjs → status.handler-BOV0eX3J.mjs} +0 -0
- /package/dist/{types-BMBuhHhW.mjs → types-DamInJD6.mjs} +0 -0
- /package/dist/{upgrade.handler-5qSzPC7D.mjs → upgrade.handler-Bz_oQcAw.mjs} +0 -0
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { n as findProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as parseCronExpression } from "./cron-parser-Dw_cWzFu.mjs";
|
|
8
|
-
import { t as runWithConcurrency } from "./concurrency-gXn9Rw8x-BTlfau8D.mjs";
|
|
4
|
+
import { a as WorkflowCoreManifestSchema, o as FlowGraphSchema, r as WORKFLOW_MANIFEST_SCHEMA_VERSION, t as src_exports } from "./src-BHTjsZ9V.mjs";
|
|
5
|
+
import { c as optionalDescriptionString, i as createStructuralSchema, l as optionalTrimmedNonEmptyString, o as idNoSpacesString, r as anyZodSchemaSchema, s as jsonSchemaObject, t as CredentialSetManifestSchema, u as trimmedNonEmptyString } from "./schemas-U2OzP9gP.mjs";
|
|
6
|
+
import { t as runWithConcurrency } from "./concurrency-gXn9Rw8x-BSBbRfVp.mjs";
|
|
9
7
|
import { createRequire } from "node:module";
|
|
10
8
|
import * as os from "node:os";
|
|
11
9
|
import * as path$1 from "node:path";
|
|
@@ -14,8 +12,9 @@ import { z } from "zod";
|
|
|
14
12
|
import { execFile } from "node:child_process";
|
|
15
13
|
import { randomUUID } from "node:crypto";
|
|
16
14
|
import { promisify } from "node:util";
|
|
15
|
+
import { cronTriggerManifestSchema, pollingTriggerManifestSchema, webhookTriggerManifestSchema } from "@keystrokehq/core/trigger";
|
|
17
16
|
//#region ../../packages/core/src/mcp-server/schemas.ts
|
|
18
|
-
const credentialSetInstanceSchema$
|
|
17
|
+
const credentialSetInstanceSchema$1 = createStructuralSchema([
|
|
19
18
|
"id",
|
|
20
19
|
"auth",
|
|
21
20
|
"connections"
|
|
@@ -23,27 +22,27 @@ const credentialSetInstanceSchema$3 = createStructuralSchema$1([
|
|
|
23
22
|
const McpTransportSchema = z.discriminatedUnion("type", [
|
|
24
23
|
z.object({
|
|
25
24
|
type: z.literal("stdio"),
|
|
26
|
-
command: trimmedNonEmptyString
|
|
25
|
+
command: trimmedNonEmptyString("Command"),
|
|
27
26
|
args: z.array(z.string()).optional(),
|
|
28
27
|
env: z.record(z.string(), z.string()).optional()
|
|
29
28
|
}),
|
|
30
29
|
z.object({
|
|
31
30
|
type: z.literal("http"),
|
|
32
|
-
url: trimmedNonEmptyString
|
|
31
|
+
url: trimmedNonEmptyString("URL"),
|
|
33
32
|
headers: z.record(z.string(), z.string()).optional()
|
|
34
33
|
}),
|
|
35
34
|
z.object({
|
|
36
35
|
type: z.literal("sse"),
|
|
37
|
-
url: trimmedNonEmptyString
|
|
36
|
+
url: trimmedNonEmptyString("URL"),
|
|
38
37
|
headers: z.record(z.string(), z.string()).optional()
|
|
39
38
|
})
|
|
40
39
|
]);
|
|
41
40
|
z.object({
|
|
42
|
-
id: trimmedNonEmptyString
|
|
43
|
-
name: optionalTrimmedNonEmptyString
|
|
44
|
-
description: optionalDescriptionString
|
|
41
|
+
id: trimmedNonEmptyString("MCP server ID"),
|
|
42
|
+
name: optionalTrimmedNonEmptyString("MCP server name"),
|
|
43
|
+
description: optionalDescriptionString("MCP server description"),
|
|
45
44
|
transport: McpTransportSchema,
|
|
46
|
-
credentialSets: z.array(credentialSetInstanceSchema$
|
|
45
|
+
credentialSets: z.array(credentialSetInstanceSchema$1).optional(),
|
|
47
46
|
credentials: z.function().optional()
|
|
48
47
|
});
|
|
49
48
|
const McpServerManifestSchema = z.object({
|
|
@@ -53,7 +52,7 @@ const McpServerManifestSchema = z.object({
|
|
|
53
52
|
name: z.string().min(1),
|
|
54
53
|
description: z.string().optional(),
|
|
55
54
|
transport: McpTransportSchema,
|
|
56
|
-
credentialSets: z.array(CredentialSetManifestSchema
|
|
55
|
+
credentialSets: z.array(CredentialSetManifestSchema),
|
|
57
56
|
credentialInjection: z.object({
|
|
58
57
|
env: z.record(z.string(), z.object({
|
|
59
58
|
credentialSetId: z.string().min(1),
|
|
@@ -67,7 +66,7 @@ const McpServerManifestSchema = z.object({
|
|
|
67
66
|
});
|
|
68
67
|
//#endregion
|
|
69
68
|
//#region ../../packages/core/src/messaging-gateway/schemas.ts
|
|
70
|
-
const credentialSetInstanceSchema
|
|
69
|
+
const credentialSetInstanceSchema = createStructuralSchema([
|
|
71
70
|
"id",
|
|
72
71
|
"auth",
|
|
73
72
|
"connections"
|
|
@@ -76,11 +75,11 @@ const MessagingGatewayModeSchema = z.enum(["platform", "custom"]);
|
|
|
76
75
|
const MessagingGatewayCredentialScopeSchema = z.enum(["organization", "project"]);
|
|
77
76
|
z.object({
|
|
78
77
|
id: idNoSpacesString("MessagingGateway id"),
|
|
79
|
-
name: optionalDescriptionString
|
|
80
|
-
description: optionalDescriptionString
|
|
78
|
+
name: optionalDescriptionString("MessagingGateway name"),
|
|
79
|
+
description: optionalDescriptionString("MessagingGateway description"),
|
|
81
80
|
provider: z.string().min(1, "MessagingGateway provider is required"),
|
|
82
81
|
mode: MessagingGatewayModeSchema,
|
|
83
|
-
credentialSet: credentialSetInstanceSchema
|
|
82
|
+
credentialSet: credentialSetInstanceSchema,
|
|
84
83
|
credentialScope: MessagingGatewayCredentialScopeSchema.optional(),
|
|
85
84
|
appRef: z.string().min(1).optional()
|
|
86
85
|
});
|
|
@@ -92,7 +91,7 @@ const MessagingGatewayManifestSchema = z.object({
|
|
|
92
91
|
description: z.string().optional(),
|
|
93
92
|
provider: z.string().min(1),
|
|
94
93
|
mode: MessagingGatewayModeSchema,
|
|
95
|
-
credentialSet: CredentialSetManifestSchema
|
|
94
|
+
credentialSet: CredentialSetManifestSchema,
|
|
96
95
|
credentialScope: MessagingGatewayCredentialScopeSchema.optional(),
|
|
97
96
|
appRef: z.string().min(1).optional()
|
|
98
97
|
});
|
|
@@ -118,7 +117,7 @@ const SandboxRuntimeSchema = z.object({
|
|
|
118
117
|
const SandboxFileSourceSchema = z.discriminatedUnion("type", [z.object({
|
|
119
118
|
type: z.literal("git"),
|
|
120
119
|
/** Remote git URL to clone. */
|
|
121
|
-
url: trimmedNonEmptyString
|
|
120
|
+
url: trimmedNonEmptyString("Git URL"),
|
|
122
121
|
/** Branch to clone. Omit for default branch. */
|
|
123
122
|
branch: z.string().optional(),
|
|
124
123
|
/**
|
|
@@ -130,7 +129,7 @@ const SandboxFileSourceSchema = z.discriminatedUnion("type", [z.object({
|
|
|
130
129
|
}), z.object({
|
|
131
130
|
type: z.literal("local"),
|
|
132
131
|
/** Source path on the host (the dev's machine), resolved against project root. */
|
|
133
|
-
path: trimmedNonEmptyString
|
|
132
|
+
path: trimmedNonEmptyString("Local path"),
|
|
134
133
|
/**
|
|
135
134
|
* Where the file/dir lands inside the VM. Relative paths resolve
|
|
136
135
|
* against the sandbox `workdir`; absolute paths must stay under
|
|
@@ -139,9 +138,9 @@ const SandboxFileSourceSchema = z.discriminatedUnion("type", [z.object({
|
|
|
139
138
|
target: z.string().optional()
|
|
140
139
|
})]);
|
|
141
140
|
z.object({
|
|
142
|
-
id: optionalTrimmedNonEmptyString
|
|
143
|
-
name: optionalTrimmedNonEmptyString
|
|
144
|
-
description: optionalDescriptionString
|
|
141
|
+
id: optionalTrimmedNonEmptyString("Sandbox ID"),
|
|
142
|
+
name: optionalTrimmedNonEmptyString("Sandbox name"),
|
|
143
|
+
description: optionalDescriptionString("Sandbox description"),
|
|
145
144
|
runtime: SandboxRuntimeSchema.optional(),
|
|
146
145
|
fileSources: z.array(SandboxFileSourceSchema).optional(),
|
|
147
146
|
setupCommands: z.array(z.string()).optional()
|
|
@@ -170,18 +169,18 @@ const AgentThinkingLevelSchema = z.enum([
|
|
|
170
169
|
"high",
|
|
171
170
|
"xhigh"
|
|
172
171
|
]);
|
|
173
|
-
const mcpServerInstanceSchema = createStructuralSchema
|
|
172
|
+
const mcpServerInstanceSchema = createStructuralSchema([
|
|
174
173
|
"id",
|
|
175
174
|
"transport",
|
|
176
175
|
"credentialSets"
|
|
177
176
|
], "a McpServer instance");
|
|
178
|
-
const sandboxInstanceSchema = createStructuralSchema
|
|
177
|
+
const sandboxInstanceSchema = createStructuralSchema([
|
|
179
178
|
"id",
|
|
180
179
|
"runtime",
|
|
181
180
|
"fileSources",
|
|
182
181
|
"setupCommands"
|
|
183
182
|
], "a Sandbox instance");
|
|
184
|
-
const messagingGatewayInstanceSchema = createStructuralSchema
|
|
183
|
+
const messagingGatewayInstanceSchema = createStructuralSchema([
|
|
185
184
|
"id",
|
|
186
185
|
"provider",
|
|
187
186
|
"mode",
|
|
@@ -199,14 +198,14 @@ const AgentToolCredentialSetReferenceSchema = z.object({
|
|
|
199
198
|
required: z.boolean()
|
|
200
199
|
});
|
|
201
200
|
z.object({
|
|
202
|
-
id: trimmedNonEmptyString
|
|
203
|
-
name: trimmedNonEmptyString
|
|
204
|
-
description: optionalDescriptionString
|
|
201
|
+
id: trimmedNonEmptyString("Agent ID"),
|
|
202
|
+
name: trimmedNonEmptyString("Agent name"),
|
|
203
|
+
description: optionalDescriptionString("Agent description"),
|
|
205
204
|
systemPrompt: z.string().min(1, { error: "System prompt is required" }),
|
|
206
|
-
model: trimmedNonEmptyString
|
|
205
|
+
model: trimmedNonEmptyString("Model"),
|
|
207
206
|
thinkingLevel: AgentThinkingLevelSchema.optional(),
|
|
208
|
-
input: anyZodSchemaSchema
|
|
209
|
-
output: anyZodSchemaSchema
|
|
207
|
+
input: anyZodSchemaSchema.optional(),
|
|
208
|
+
output: anyZodSchemaSchema.optional(),
|
|
210
209
|
tools: z.array(z.unknown()).optional(),
|
|
211
210
|
mcpServers: z.array(mcpServerInstanceSchema).optional(),
|
|
212
211
|
sandbox: sandboxInstanceSchema.optional(),
|
|
@@ -230,10 +229,10 @@ const AgentManifestSchema = z.object({
|
|
|
230
229
|
systemPrompt: z.string(),
|
|
231
230
|
model: z.string(),
|
|
232
231
|
thinkingLevel: AgentThinkingLevelSchema,
|
|
233
|
-
input: jsonSchemaObject
|
|
234
|
-
output: jsonSchemaObject
|
|
232
|
+
input: jsonSchemaObject,
|
|
233
|
+
output: jsonSchemaObject,
|
|
235
234
|
maxSteps: z.number(),
|
|
236
|
-
credentialSets: z.array(CredentialSetManifestSchema
|
|
235
|
+
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
237
236
|
tools: z.array(z.object({
|
|
238
237
|
id: z.string(),
|
|
239
238
|
displayName: z.string(),
|
|
@@ -253,792 +252,8 @@ const AgentManifestSchema = z.object({
|
|
|
253
252
|
sandbox: SandboxManifestSchema.optional(),
|
|
254
253
|
messaging: z.array(MessagingGatewayManifestSchema).optional()
|
|
255
254
|
});
|
|
256
|
-
z.string().length(64, "Must be 64 characters").regex(/^[a-f0-9]{64}$/i, "Must be hexadecimal").transform((value) => value);
|
|
257
|
-
const JsonSchemaSchema = z.record(z.string(), z.unknown());
|
|
258
|
-
z.object({
|
|
259
|
-
constant: z.object({
|
|
260
|
-
attempts: z.number().int().min(1).max(10),
|
|
261
|
-
seconds: z.number().positive()
|
|
262
|
-
}).optional(),
|
|
263
|
-
exponential: z.object({
|
|
264
|
-
attempts: z.number().int().min(1).max(10),
|
|
265
|
-
base: z.number().min(1).optional(),
|
|
266
|
-
multiplier: z.number().positive().optional()
|
|
267
|
-
}).optional()
|
|
268
|
-
}).refine((data) => {
|
|
269
|
-
return data.constant !== void 0 !== (data.exponential !== void 0);
|
|
270
|
-
}, { error: "Retry config must specify exactly one of constant or exponential strategy" });
|
|
271
|
-
z.union([z.number().int().positive().finite(), z.string().regex(/^[1-9]\d*[smhdwy]$/)]);
|
|
272
|
-
const DurationStringSchema = z.string().refine((val) => /^\d+[smhdwy]$/.test(val), { message: "Invalid duration format. Must be a positive integer followed by s, m, h, d, w, or y (e.g., \"5m\", \"1h\")" }).refine((val) => {
|
|
273
|
-
const match = val.match(/^(\d+)[smhdwy]$/);
|
|
274
|
-
if (!match?.[1]) return false;
|
|
275
|
-
const num = Number.parseInt(match[1], 10);
|
|
276
|
-
return num > 0 && Number.isFinite(num);
|
|
277
|
-
}, { message: "Duration value must be a positive integer greater than 0" });
|
|
278
|
-
const CronExpressionSchema = z.string().superRefine((val, ctx) => {
|
|
279
|
-
try {
|
|
280
|
-
parseCronExpression(val);
|
|
281
|
-
} catch (error) {
|
|
282
|
-
const errorMessage = error instanceof Error ? error.message : "Invalid cron expression format";
|
|
283
|
-
ctx.addIssue({
|
|
284
|
-
code: "custom",
|
|
285
|
-
message: `Invalid cron expression: ${errorMessage}. Must be a valid 5-field cron: minute hour day month weekday (e.g., "0 9 * * *", "*/15 * * * *")`
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
const ScheduleSchema = z.union([
|
|
290
|
-
z.number().refine((val) => val > 0, { message: "Duration in milliseconds must be positive" }).refine(Number.isFinite, { message: "Duration in milliseconds must be finite" }).refine(Number.isInteger, { message: "Duration in milliseconds must be an integer" }),
|
|
291
|
-
DurationStringSchema,
|
|
292
|
-
CronExpressionSchema
|
|
293
|
-
]);
|
|
294
|
-
const IANATimezoneSchema = z.enum([
|
|
295
|
-
"UTC",
|
|
296
|
-
"GMT",
|
|
297
|
-
"Etc/UTC",
|
|
298
|
-
"Etc/GMT",
|
|
299
|
-
"America/New_York",
|
|
300
|
-
"America/Chicago",
|
|
301
|
-
"America/Denver",
|
|
302
|
-
"America/Los_Angeles",
|
|
303
|
-
"America/Phoenix",
|
|
304
|
-
"America/Anchorage",
|
|
305
|
-
"America/Toronto",
|
|
306
|
-
"America/Vancouver",
|
|
307
|
-
"America/Mexico_City",
|
|
308
|
-
"America/Sao_Paulo",
|
|
309
|
-
"America/Buenos_Aires",
|
|
310
|
-
"Europe/London",
|
|
311
|
-
"Europe/Paris",
|
|
312
|
-
"Europe/Berlin",
|
|
313
|
-
"Europe/Rome",
|
|
314
|
-
"Europe/Madrid",
|
|
315
|
-
"Europe/Amsterdam",
|
|
316
|
-
"Europe/Stockholm",
|
|
317
|
-
"Europe/Vienna",
|
|
318
|
-
"Europe/Zurich",
|
|
319
|
-
"Europe/Moscow",
|
|
320
|
-
"Europe/Athens",
|
|
321
|
-
"Europe/Dublin",
|
|
322
|
-
"Asia/Tokyo",
|
|
323
|
-
"Asia/Shanghai",
|
|
324
|
-
"Asia/Hong_Kong",
|
|
325
|
-
"Asia/Singapore",
|
|
326
|
-
"Asia/Seoul",
|
|
327
|
-
"Asia/Dubai",
|
|
328
|
-
"Asia/Kolkata",
|
|
329
|
-
"Asia/Bangkok",
|
|
330
|
-
"Asia/Jakarta",
|
|
331
|
-
"Asia/Manila",
|
|
332
|
-
"Asia/Taipei",
|
|
333
|
-
"Australia/Sydney",
|
|
334
|
-
"Australia/Melbourne",
|
|
335
|
-
"Australia/Brisbane",
|
|
336
|
-
"Australia/Perth",
|
|
337
|
-
"Australia/Adelaide",
|
|
338
|
-
"Pacific/Auckland",
|
|
339
|
-
"Pacific/Honolulu",
|
|
340
|
-
"Africa/Cairo",
|
|
341
|
-
"Africa/Johannesburg",
|
|
342
|
-
"Africa/Lagos",
|
|
343
|
-
"Africa/Nairobi",
|
|
344
|
-
"Asia/Riyadh",
|
|
345
|
-
"Asia/Tehran",
|
|
346
|
-
"Asia/Jerusalem",
|
|
347
|
-
"Asia/Doha"
|
|
348
|
-
]);
|
|
349
|
-
//#endregion
|
|
350
|
-
//#region ../../packages/core/dist/chunks/schema-RilQR7M-.mjs
|
|
351
|
-
const MAX_JSON_DEPTH = 20;
|
|
352
|
-
function buildJsonValueSchema(depth) {
|
|
353
|
-
const primitives = z.union([
|
|
354
|
-
z.string(),
|
|
355
|
-
z.number(),
|
|
356
|
-
z.boolean(),
|
|
357
|
-
z.null()
|
|
358
|
-
]);
|
|
359
|
-
if (depth <= 0) return primitives;
|
|
360
|
-
const nested = buildJsonValueSchema(depth - 1);
|
|
361
|
-
return z.union([
|
|
362
|
-
primitives,
|
|
363
|
-
z.array(nested),
|
|
364
|
-
z.record(z.string(), nested)
|
|
365
|
-
]);
|
|
366
|
-
}
|
|
367
|
-
const jsonValueSchema = buildJsonValueSchema(MAX_JSON_DEPTH);
|
|
368
|
-
const jsonSchemaObject = z.record(z.string(), jsonValueSchema);
|
|
369
|
-
const anyZodSchemaSchema = z.custom((value) => value instanceof z.ZodType, "Expected a Zod schema");
|
|
370
|
-
const zodObjectSchema = z.custom((value) => value instanceof z.ZodObject, "Expected a Zod object schema");
|
|
371
|
-
/**
|
|
372
|
-
* Creates a Zod schema that validates an object structurally by checking
|
|
373
|
-
* for required properties. This avoids `instanceof` checks which fail
|
|
374
|
-
* when class definitions are duplicated across bundle boundaries.
|
|
375
|
-
*/
|
|
376
|
-
function createStructuralSchema(requiredKeys, label) {
|
|
377
|
-
return z.custom((value) => value != null && (typeof value === "object" || typeof value === "function") && requiredKeys.every((key) => key in value), `Expected ${label}`);
|
|
378
|
-
}
|
|
379
|
-
function trimmedNonEmptyString(fieldName) {
|
|
380
|
-
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` });
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Non-empty trimmed string for credential definition ids.
|
|
384
|
-
* Allows namespaced ids such as `keystroke:slack` plus letters, numbers,
|
|
385
|
-
* hyphens, and underscores.
|
|
386
|
-
*/
|
|
387
|
-
function credentialSetIdString(fieldName) {
|
|
388
|
-
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` }).refine((s) => /^[a-zA-Z0-9_:-]+$/.test(s), { error: `${fieldName} must only contain letters, numbers, hyphens, underscores, and colons` });
|
|
389
|
-
}
|
|
390
|
-
function optionalTrimmedNonEmptyString(fieldName) {
|
|
391
|
-
return trimmedNonEmptyString(fieldName).optional();
|
|
392
|
-
}
|
|
393
|
-
function descriptionString(fieldName) {
|
|
394
|
-
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(1024, { error: `${fieldName} cannot exceed 1024 characters` });
|
|
395
|
-
}
|
|
396
|
-
function optionalDescriptionString(fieldName) {
|
|
397
|
-
return descriptionString(fieldName).optional();
|
|
398
|
-
}
|
|
399
|
-
//#endregion
|
|
400
|
-
//#region ../../packages/core/dist/chunks/schemas-CUxIyWrr.mjs
|
|
401
|
-
/**
|
|
402
|
-
* Shared constants for the credential/connection system.
|
|
403
|
-
* Defined in core (bottom of dependency chain) so all packages can import them.
|
|
404
|
-
*/
|
|
405
|
-
const CREDENTIAL_EXPOSURES = {
|
|
406
|
-
"user-runtime": "user-runtime",
|
|
407
|
-
"platform-only": "platform-only"
|
|
408
|
-
};
|
|
409
|
-
const credentialSetProxyInjectionSchema = z.object({
|
|
410
|
-
/** Substitute placeholder in HTTP headers (default: true). */
|
|
411
|
-
headers: z.boolean().optional(),
|
|
412
|
-
/** Substitute placeholder in the HTTP Basic Auth credential (default: true). */
|
|
413
|
-
basicAuth: z.boolean().optional(),
|
|
414
|
-
/** Substitute placeholder in URL query params (default: false).
|
|
415
|
-
* Use for APIs that authenticate via `?api_key=...` (Google Maps, OWM, etc.). */
|
|
416
|
-
queryParams: z.boolean().optional(),
|
|
417
|
-
/** Substitute placeholder in the HTTP request body (default: false).
|
|
418
|
-
* Use for form-encoded auth payloads (Stripe, AWS SigV4 query, etc.). */
|
|
419
|
-
body: z.boolean().optional()
|
|
420
|
-
});
|
|
421
|
-
const credentialSetProxyConfigSchema = z.object({
|
|
422
|
-
/** Exact-match host allowlist (forwarded to SecretBuilder.allowHost). */
|
|
423
|
-
hosts: z.array(z.string().min(1)).optional(),
|
|
424
|
-
/** Wildcard host allowlist (forwarded to SecretBuilder.allowHostPattern).
|
|
425
|
-
* Example: `["*.browserbase.com"]` covers any subdomain. */
|
|
426
|
-
hostPatterns: z.array(z.string().min(1)).optional(),
|
|
427
|
-
/** Per-scope substitution toggles. Omit to use SDK defaults. */
|
|
428
|
-
injection: credentialSetProxyInjectionSchema.optional()
|
|
429
|
-
});
|
|
430
|
-
const onCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
|
|
431
|
-
const credentialExposureSchema = z.enum([CREDENTIAL_EXPOSURES["user-runtime"], CREDENTIAL_EXPOSURES["platform-only"]]);
|
|
432
|
-
const connectionMetadataConfigSchema = z.object({
|
|
433
|
-
id: credentialSetIdString("Credential connection id").optional(),
|
|
434
|
-
label: optionalTrimmedNonEmptyString("Credential connection label"),
|
|
435
|
-
description: optionalDescriptionString("Credential connection description"),
|
|
436
|
-
recommended: z.boolean().optional(),
|
|
437
|
-
advanced: z.boolean().optional(),
|
|
438
|
-
needsRawSecret: z.boolean().optional()
|
|
439
|
-
});
|
|
440
|
-
const connectionMetadataManifestSchema = connectionMetadataConfigSchema;
|
|
441
|
-
const registeredDescriptorSchema = z.object({
|
|
442
|
-
id: trimmedNonEmptyString("Registered descriptor id"),
|
|
443
|
-
config: z.record(z.string(), z.unknown()).optional()
|
|
444
|
-
});
|
|
445
|
-
const registeredResolverDescriptorSchema = registeredDescriptorSchema.extend({ cacheMs: z.number().int().nonnegative().optional() });
|
|
446
|
-
const manualConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
447
|
-
kind: z.literal("manual"),
|
|
448
|
-
input: zodObjectSchema.optional(),
|
|
449
|
-
instructions: z.string().min(1).optional(),
|
|
450
|
-
validate: z.function().optional()
|
|
451
|
-
});
|
|
452
|
-
const manualConnectionFieldManifestSchema = z.object({
|
|
453
|
-
key: z.string().min(1),
|
|
454
|
-
label: z.string().min(1),
|
|
455
|
-
description: z.string().min(1).optional(),
|
|
456
|
-
optional: z.boolean(),
|
|
457
|
-
secret: z.literal(true)
|
|
458
|
-
});
|
|
459
|
-
const manualConnectionConfigManifestSchema = connectionMetadataManifestSchema.extend({
|
|
460
|
-
kind: z.literal("manual"),
|
|
461
|
-
input: jsonSchemaObject.optional(),
|
|
462
|
-
fields: z.array(manualConnectionFieldManifestSchema).optional(),
|
|
463
|
-
generated: z.boolean().optional(),
|
|
464
|
-
instructions: z.string().min(1).optional()
|
|
465
|
-
});
|
|
466
|
-
/** Declarative form of `Vault` — strings typed against the credential set's
|
|
467
|
-
* stored/auth schema keys at the {@link CredentialSetConfig} boundary; the Zod
|
|
468
|
-
* schema here enforces non-empty strings only. `CredentialSet` itself performs
|
|
469
|
-
* the schema-key membership check at construction time. */
|
|
470
|
-
const vaultMappingSchema = z.object({
|
|
471
|
-
accessToken: z.string().min(1),
|
|
472
|
-
refreshToken: z.string().min(1).optional(),
|
|
473
|
-
instanceUrl: z.string().min(1).optional(),
|
|
474
|
-
raw: z.record(z.string().min(1), z.string().min(1)).optional()
|
|
475
|
-
});
|
|
476
|
-
/** Function form of `Vault` — an object pairing the access-token vault key
|
|
477
|
-
* (`accessTokenKey`) with the `build` function that computes the full vault
|
|
478
|
-
* write map. The explicit key keeps the disconnect path's revocation read
|
|
479
|
-
* reliable even when `build` transforms the access token. */
|
|
480
|
-
const vaultMappingFnSchema = z.object({
|
|
481
|
-
accessTokenKey: z.string().min(1),
|
|
482
|
-
build: z.custom((val) => typeof val === "function", { message: "vault.build must be a function." })
|
|
483
|
-
});
|
|
484
|
-
/** Runtime shape of `Vault`. Accepts either the declarative mapping or the
|
|
485
|
-
* function-form object `{ accessTokenKey, build }`. */
|
|
486
|
-
const vaultConfigSchema = z.union([vaultMappingSchema, vaultMappingFnSchema], { error: "vault must be a declarative mapping object or a `{ accessTokenKey, build }` object." });
|
|
487
|
-
/** Manifest projection of `Vault` — declarative mappings serialize verbatim;
|
|
488
|
-
* function-form mappings serialize as `{ kind: 'function', accessTokenKey }`
|
|
489
|
-
* since closures are not manifest-safe but the access-token key is. */
|
|
490
|
-
const vaultManifestSchema = z.discriminatedUnion("kind", [z.object({
|
|
491
|
-
kind: z.literal("declarative"),
|
|
492
|
-
accessToken: z.string().min(1),
|
|
493
|
-
refreshToken: z.string().min(1).optional(),
|
|
494
|
-
instanceUrl: z.string().min(1).optional(),
|
|
495
|
-
raw: z.record(z.string().min(1), z.string().min(1)).optional()
|
|
496
|
-
}), z.object({
|
|
497
|
-
kind: z.literal("function"),
|
|
498
|
-
accessTokenKey: z.string().min(1)
|
|
499
|
-
})]);
|
|
500
|
-
const oauthConnectionConfigBaseSchema = z.object({
|
|
501
|
-
kind: z.literal("oauth"),
|
|
502
|
-
authUrl: z.string().url(),
|
|
503
|
-
tokenUrl: z.string().url(),
|
|
504
|
-
scopes: z.array(z.string()).readonly(),
|
|
505
|
-
revokeUrl: z.string().url().nullable().optional(),
|
|
506
|
-
tokenType: z.enum(["long-lived", "refreshable"]),
|
|
507
|
-
pkce: z.boolean().optional(),
|
|
508
|
-
/** Fallback token lifetime when the provider omits `expires_in`. Positive
|
|
509
|
-
* integer seconds. Shared between config + manifest schemas (both extend
|
|
510
|
-
* this base). */
|
|
511
|
-
defaultExpiresInSeconds: z.number().int().positive().optional()
|
|
512
|
-
});
|
|
513
|
-
const oauthConnectionConfigSchema = oauthConnectionConfigBaseSchema.extend({
|
|
514
|
-
...connectionMetadataConfigSchema.shape,
|
|
515
|
-
vault: vaultConfigSchema,
|
|
516
|
-
oauth: registeredDescriptorSchema.optional(),
|
|
517
|
-
buildAuthUrl: z.function().optional(),
|
|
518
|
-
exchangeCode: z.function().optional(),
|
|
519
|
-
refreshToken: z.function().optional(),
|
|
520
|
-
extractInstallationInfo: z.function().optional(),
|
|
521
|
-
validate: z.function().optional()
|
|
522
|
-
});
|
|
523
|
-
const oauthConnectionConfigManifestSchema = oauthConnectionConfigBaseSchema.extend({
|
|
524
|
-
...connectionMetadataManifestSchema.shape,
|
|
525
|
-
vault: vaultManifestSchema,
|
|
526
|
-
oauth: registeredDescriptorSchema.optional()
|
|
527
|
-
});
|
|
528
|
-
const credentialsExchangeConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
529
|
-
kind: z.literal("credentials-exchange"),
|
|
530
|
-
instructions: z.string().min(1).optional(),
|
|
531
|
-
input: zodObjectSchema
|
|
532
|
-
}).extend({
|
|
533
|
-
exchange: z.function(),
|
|
534
|
-
rotate: z.function().optional(),
|
|
535
|
-
validate: z.function().optional()
|
|
536
|
-
});
|
|
537
|
-
/** Manifest projection of `CredentialsExchangeConnectionConfig` — only the
|
|
538
|
-
* declarative `input` schema (rendered as JSON Schema) and `instructions`
|
|
539
|
-
* copy survive serialization. The three hooks (`exchange`, `rotate`,
|
|
540
|
-
* `validate`) are runtime closures and are stripped. */
|
|
541
|
-
const credentialsExchangeConnectionConfigManifestSchema = z.object({
|
|
542
|
-
kind: z.literal("credentials-exchange"),
|
|
543
|
-
...connectionMetadataManifestSchema.shape,
|
|
544
|
-
instructions: z.string().min(1).optional(),
|
|
545
|
-
input: jsonSchemaObject
|
|
546
|
-
});
|
|
547
|
-
const exchangeCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
548
|
-
kind: z.literal("exchange"),
|
|
549
|
-
input: zodObjectSchema,
|
|
550
|
-
exchange: registeredDescriptorSchema
|
|
551
|
-
});
|
|
552
|
-
const exchangeCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
|
|
553
|
-
kind: z.literal("exchange"),
|
|
554
|
-
input: jsonSchemaObject,
|
|
555
|
-
exchange: registeredDescriptorSchema
|
|
556
|
-
});
|
|
557
|
-
const dynamicCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
558
|
-
kind: z.literal("dynamic"),
|
|
559
|
-
input: zodObjectSchema.optional(),
|
|
560
|
-
resolver: registeredResolverDescriptorSchema
|
|
561
|
-
});
|
|
562
|
-
const dynamicCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
|
|
563
|
-
kind: z.literal("dynamic"),
|
|
564
|
-
input: jsonSchemaObject.optional(),
|
|
565
|
-
resolver: registeredResolverDescriptorSchema
|
|
566
|
-
});
|
|
567
|
-
const platformCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({ kind: z.literal("platform") });
|
|
568
|
-
const platformCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({ kind: z.literal("platform") });
|
|
569
|
-
const connectionConfigSchema = z.discriminatedUnion("kind", [
|
|
570
|
-
manualConnectionConfigSchema,
|
|
571
|
-
oauthConnectionConfigSchema,
|
|
572
|
-
credentialsExchangeConnectionConfigSchema,
|
|
573
|
-
exchangeCredentialConnectionConfigSchema,
|
|
574
|
-
dynamicCredentialConnectionConfigSchema,
|
|
575
|
-
platformCredentialConnectionConfigSchema
|
|
576
|
-
]);
|
|
577
|
-
/** Manifest projection of `ConnectionConfig` — declarative metadata only. */
|
|
578
|
-
const connectionConfigManifestSchema = z.discriminatedUnion("kind", [
|
|
579
|
-
manualConnectionConfigManifestSchema,
|
|
580
|
-
oauthConnectionConfigManifestSchema,
|
|
581
|
-
credentialsExchangeConnectionConfigManifestSchema,
|
|
582
|
-
exchangeCredentialConnectionManifestSchema,
|
|
583
|
-
dynamicCredentialConnectionManifestSchema,
|
|
584
|
-
platformCredentialConnectionManifestSchema
|
|
585
|
-
]);
|
|
586
|
-
const CredentialSetManifestSchema = z.object({
|
|
587
|
-
manifestVersion: z.literal(1),
|
|
588
|
-
type: z.literal("credentialSet"),
|
|
589
|
-
id: credentialSetIdString("Credential set id"),
|
|
590
|
-
name: trimmedNonEmptyString("Credential set name"),
|
|
591
|
-
description: optionalDescriptionString("Credential set description"),
|
|
592
|
-
auth: jsonSchemaObject,
|
|
593
|
-
exposure: credentialExposureSchema.optional(),
|
|
594
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
595
|
-
/** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
|
|
596
|
-
needsRawSecret: z.boolean().optional(),
|
|
597
|
-
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
598
|
-
onCredentialRevoked: onCredentialRevokedSchema.optional(),
|
|
599
|
-
connections: z.array(connectionConfigManifestSchema).optional()
|
|
600
|
-
});
|
|
601
|
-
z.object({
|
|
602
|
-
id: credentialSetIdString("Credential set id"),
|
|
603
|
-
name: optionalTrimmedNonEmptyString("Credential set name"),
|
|
604
|
-
description: optionalDescriptionString("Credential set description"),
|
|
605
|
-
auth: zodObjectSchema,
|
|
606
|
-
exposure: credentialExposureSchema.optional(),
|
|
607
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
608
|
-
/** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
|
|
609
|
-
needsRawSecret: z.boolean().optional(),
|
|
610
|
-
onCredentialRevoked: onCredentialRevokedSchema.optional(),
|
|
611
|
-
connections: z.array(connectionConfigSchema).readonly().optional()
|
|
612
|
-
});
|
|
613
|
-
//#endregion
|
|
614
|
-
//#region ../../packages/core/dist/chunks/schemas-B8U1MF_0.mjs
|
|
615
|
-
const SourceLocationSchema = z.object({
|
|
616
|
-
filePath: z.string().min(1),
|
|
617
|
-
absoluteFilePath: z.string().min(1).optional(),
|
|
618
|
-
line: z.number().int().positive(),
|
|
619
|
-
column: z.number().int().positive(),
|
|
620
|
-
position: z.number().int().nonnegative().optional(),
|
|
621
|
-
endLine: z.number().int().positive(),
|
|
622
|
-
endColumn: z.number().int().positive(),
|
|
623
|
-
endPosition: z.number().int().nonnegative().optional(),
|
|
624
|
-
synthetic: z.boolean().optional()
|
|
625
|
-
});
|
|
626
|
-
z.string().min(1);
|
|
627
|
-
const ImportSourceSchema = z.object({
|
|
628
|
-
kind: z.enum([
|
|
629
|
-
"local",
|
|
630
|
-
"module-import",
|
|
631
|
-
"namespace-import",
|
|
632
|
-
"dynamic"
|
|
633
|
-
]),
|
|
634
|
-
moduleSpecifier: z.string().min(1).optional(),
|
|
635
|
-
importName: z.string().min(1).optional(),
|
|
636
|
-
localName: z.string().min(1).optional(),
|
|
637
|
-
resolvedPath: z.string().min(1).optional()
|
|
638
|
-
});
|
|
639
|
-
const CallKindSchema = z.enum([
|
|
640
|
-
"workflow-step",
|
|
641
|
-
"agent",
|
|
642
|
-
"tool",
|
|
643
|
-
"hook",
|
|
644
|
-
"child-workflow",
|
|
645
|
-
"function-call",
|
|
646
|
-
"method-call",
|
|
647
|
-
"dynamic-call",
|
|
648
|
-
"parallel-call",
|
|
649
|
-
"process-exit",
|
|
650
|
-
"iife",
|
|
651
|
-
"expression"
|
|
652
|
-
]);
|
|
653
|
-
const CapturedVariableSourceKindSchema = z.enum([
|
|
654
|
-
"local-const",
|
|
655
|
-
"relative-import",
|
|
656
|
-
"package-import"
|
|
657
|
-
]);
|
|
658
|
-
const CapturedVariableValueTypeSchema = z.enum([
|
|
659
|
-
"string",
|
|
660
|
-
"number",
|
|
661
|
-
"boolean",
|
|
662
|
-
"object",
|
|
663
|
-
"array",
|
|
664
|
-
"function",
|
|
665
|
-
"unknown"
|
|
666
|
-
]);
|
|
667
|
-
z.object({
|
|
668
|
-
name: z.string().min(1),
|
|
669
|
-
value: z.union([
|
|
670
|
-
z.string(),
|
|
671
|
-
z.number(),
|
|
672
|
-
z.boolean()
|
|
673
|
-
]).optional(),
|
|
674
|
-
sourceText: z.string().optional(),
|
|
675
|
-
valueType: CapturedVariableValueTypeSchema,
|
|
676
|
-
resolvable: z.boolean(),
|
|
677
|
-
source: CapturedVariableSourceKindSchema,
|
|
678
|
-
importPath: z.string().optional(),
|
|
679
|
-
declaration: z.object({
|
|
680
|
-
filePath: z.string().min(1),
|
|
681
|
-
line: z.number().int().positive()
|
|
682
|
-
})
|
|
683
|
-
});
|
|
684
|
-
const IntegrationScopeSchema = z.enum([
|
|
685
|
-
"organization",
|
|
686
|
-
"project",
|
|
687
|
-
"user_provided_credential"
|
|
688
|
-
]);
|
|
689
|
-
const IntegrationCredentialRefSchema = z.discriminatedUnion("type", [z.object({
|
|
690
|
-
type: z.literal("id"),
|
|
691
|
-
id: z.string().startsWith("cset_")
|
|
692
|
-
}), z.object({
|
|
693
|
-
type: z.literal("name"),
|
|
694
|
-
name: z.string().trim().min(1)
|
|
695
|
-
})]);
|
|
696
|
-
function hasProjectOrOrganizationScope(scope) {
|
|
697
|
-
return scope === "organization" || scope === "project";
|
|
698
|
-
}
|
|
699
|
-
const CredentialRefTokenKeyNameSchema = z.string().regex(/^[A-Za-z0-9_]+$/, "Credential key must contain only letters, digits, and underscores (required for ref-token proxying)");
|
|
700
|
-
/** Shared enum for top-level credential-set `onCredentialRevoked` policy. */
|
|
701
|
-
const OnCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
|
|
702
|
-
/** A credential set after resolution in a built manifest. Contains definition id, scope, alias, and credential keys.*/
|
|
703
|
-
const ResolvedCredentialSetSchema = z.object({
|
|
704
|
-
resolvedId: z.string(),
|
|
705
|
-
scope: IntegrationScopeSchema.optional(),
|
|
706
|
-
alias: z.string().optional(),
|
|
707
|
-
credentialRef: IntegrationCredentialRefSchema.optional(),
|
|
708
|
-
/** Auth-shape keys expected post-resolve. */
|
|
709
|
-
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
710
|
-
/** Subset of `credentialKeys` that are optional in the auth shape. */
|
|
711
|
-
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
712
|
-
/** Auth-shaped vault keys required for vault reads and upload flows. */
|
|
713
|
-
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
714
|
-
/** Subset of auth-shaped vault keys that may be absent from the vault without
|
|
715
|
-
* failing resolution. Derived from the credential set's `auth` schema. */
|
|
716
|
-
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
717
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
718
|
-
/** When true, resolved values are passed raw (no ref-token proxy) for this set. */
|
|
719
|
-
needsRawSecret: z.boolean().optional(),
|
|
720
|
-
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
721
|
-
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
722
|
-
/** Persistence-layer schema fingerprint stamped at build time. The
|
|
723
|
-
* resolver's phase 2 compares this against the vault row's stored
|
|
724
|
-
* fingerprint and raises `CredentialSchemaMismatchError` on drift.
|
|
725
|
-
* Optional here so pre-fingerprint artifacts still parse; the
|
|
726
|
-
* workflow builder populates it for every authored credential set
|
|
727
|
-
* that has a resolvable fingerprint. */
|
|
728
|
-
schemaFingerprint: z.string().optional()
|
|
729
|
-
}).superRefine((value, ctx) => {
|
|
730
|
-
if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
|
|
731
|
-
code: z.ZodIssueCode.custom,
|
|
732
|
-
path: ["credentialRef"],
|
|
733
|
-
message: "credentialRef requires scope to be \"project\" or \"organization\""
|
|
734
|
-
});
|
|
735
|
-
});
|
|
736
|
-
z.object({
|
|
737
|
-
credentialSetId: z.string(),
|
|
738
|
-
/** Auth-shape keys expected post-resolve. */
|
|
739
|
-
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
740
|
-
/** Optional subset of the auth-shape keys. */
|
|
741
|
-
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
742
|
-
/** Stored-shape keys required for vault reads. */
|
|
743
|
-
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
744
|
-
/** Optional subset of the stored-shape keys. */
|
|
745
|
-
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
746
|
-
schemaFingerprint: z.string().optional(),
|
|
747
|
-
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
748
|
-
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
749
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
750
|
-
needsRawSecret: z.boolean().optional(),
|
|
751
|
-
requiredOAuthScopes: z.array(z.string()).optional()
|
|
752
|
-
});
|
|
753
|
-
const CredentialRequirementEntrySchema = z.object({
|
|
754
|
-
credentialSetId: z.string(),
|
|
755
|
-
scope: IntegrationScopeSchema.optional(),
|
|
756
|
-
alias: z.string().optional(),
|
|
757
|
-
credentialRef: IntegrationCredentialRefSchema.optional(),
|
|
758
|
-
/** Auth-shape keys expected post-resolve. */
|
|
759
|
-
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
760
|
-
/** Optional subset of the auth-shape keys. */
|
|
761
|
-
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
762
|
-
/** Auth-shaped vault keys required for vault reads. */
|
|
763
|
-
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
764
|
-
/** Optional subset of the stored-shape keys. */
|
|
765
|
-
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
766
|
-
schemaFingerprint: z.string().optional(),
|
|
767
|
-
proxy: credentialSetProxyConfigSchema.optional(),
|
|
768
|
-
needsRawSecret: z.boolean().optional(),
|
|
769
|
-
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
770
|
-
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
771
|
-
requiredOAuthScopes: z.array(z.string()).optional()
|
|
772
|
-
}).superRefine((value, ctx) => {
|
|
773
|
-
if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
|
|
774
|
-
code: z.ZodIssueCode.custom,
|
|
775
|
-
path: ["credentialRef"],
|
|
776
|
-
message: "credentialRef requires scope to be \"project\" or \"organization\""
|
|
777
|
-
});
|
|
778
|
-
});
|
|
779
|
-
z.object({
|
|
780
|
-
required: z.array(z.string()),
|
|
781
|
-
byStep: z.record(z.string(), z.array(CredentialRequirementEntrySchema))
|
|
782
|
-
});
|
|
783
|
-
const TriggerCallbackNameSchema = z.enum([
|
|
784
|
-
"filter",
|
|
785
|
-
"idempotencyKey",
|
|
786
|
-
"verify",
|
|
787
|
-
"callback"
|
|
788
|
-
]);
|
|
789
|
-
const TriggerCredentialRequirementEntrySchema = CredentialRequirementEntrySchema;
|
|
790
|
-
const TriggerCredentialRequirementsSchema = z.object({
|
|
791
|
-
required: z.array(z.string()),
|
|
792
|
-
byCallback: z.partialRecord(TriggerCallbackNameSchema, z.array(TriggerCredentialRequirementEntrySchema))
|
|
793
|
-
});
|
|
794
|
-
const ExecutionIdentityPolicySchema = z.object({ subjectMode: z.enum(["never", "requiredWhenUserProvidedCredential"]) });
|
|
795
|
-
z.object({
|
|
796
|
-
nodeId: z.string().min(1),
|
|
797
|
-
stepName: z.string().min(1),
|
|
798
|
-
label: z.string().min(1),
|
|
799
|
-
callKind: CallKindSchema,
|
|
800
|
-
stepId: z.string().min(1).optional(),
|
|
801
|
-
source: SourceLocationSchema.optional(),
|
|
802
|
-
astKind: z.string().min(1).optional(),
|
|
803
|
-
importSource: ImportSourceSchema.optional(),
|
|
804
|
-
outputBinding: z.string().min(1).optional(),
|
|
805
|
-
scopeOverride: IntegrationScopeSchema.optional(),
|
|
806
|
-
description: z.string().optional(),
|
|
807
|
-
sourceCode: z.string().optional(),
|
|
808
|
-
exportName: z.string().optional(),
|
|
809
|
-
inputSchema: JsonSchemaSchema.optional(),
|
|
810
|
-
outputSchema: JsonSchemaSchema.optional(),
|
|
811
|
-
credentialSets: z.array(ResolvedCredentialSetSchema).optional()
|
|
812
|
-
});
|
|
813
|
-
const TriggerTypeSchema = z.enum([
|
|
814
|
-
"webhook",
|
|
815
|
-
"cron",
|
|
816
|
-
"polling"
|
|
817
|
-
]);
|
|
818
|
-
/**
|
|
819
|
-
* Persisted on `deployment_triggers.trigger_source`. Mirrors the
|
|
820
|
-
* `webhookTrigger({ source: { type } })` discriminator so the server
|
|
821
|
-
* can index-filter app-source rows during provider-webhook fanout.
|
|
822
|
-
*/
|
|
823
|
-
const TriggerSourceSchema = z.enum(["custom", "app"]);
|
|
824
|
-
const WebhookMethodSchema$1 = z.enum([
|
|
825
|
-
"GET",
|
|
826
|
-
"POST",
|
|
827
|
-
"PUT",
|
|
828
|
-
"PATCH"
|
|
829
|
-
]);
|
|
830
|
-
const TriggerCallbackBundleUploadSchema = z.object({
|
|
831
|
-
code: z.string(),
|
|
832
|
-
hash: z.string(),
|
|
833
|
-
size: z.number()
|
|
834
|
-
});
|
|
835
|
-
const TriggerCallbackExportsSchema = z.object({
|
|
836
|
-
verify: z.string().min(1).optional(),
|
|
837
|
-
filter: z.string().min(1).optional(),
|
|
838
|
-
idempotencyKey: z.string().min(1).optional(),
|
|
839
|
-
callback: z.string().min(1).optional()
|
|
840
|
-
});
|
|
841
|
-
const TransformCallbackExportsSchema = z.object({ transform: z.string().min(1).optional() });
|
|
842
|
-
z.object({
|
|
843
|
-
id: z.string(),
|
|
844
|
-
type: TriggerTypeSchema,
|
|
845
|
-
/**
|
|
846
|
-
* Source-of-truth discriminator for webhook triggers. `'custom'` means
|
|
847
|
-
* the trigger owns its own HTTP path; `'app'` means it is fanned out by
|
|
848
|
-
* a Keystroke-managed provider app. Undefined for non-webhook triggers.
|
|
849
|
-
*/
|
|
850
|
-
triggerSource: TriggerSourceSchema.optional(),
|
|
851
|
-
enabled: z.boolean(),
|
|
852
|
-
path: z.string().optional(),
|
|
853
|
-
method: WebhookMethodSchema$1.optional(),
|
|
854
|
-
schedule: z.string().optional(),
|
|
855
|
-
timezone: z.string().optional(),
|
|
856
|
-
config: z.record(z.string(), z.unknown()).optional(),
|
|
857
|
-
requiredCredentials: TriggerCredentialRequirementsSchema.optional(),
|
|
858
|
-
storagePath: z.string().min(1).optional(),
|
|
859
|
-
callbackBundle: TriggerCallbackBundleUploadSchema.optional(),
|
|
860
|
-
callbackExports: TriggerCallbackExportsSchema.optional(),
|
|
861
|
-
transformCallbackBundle: TriggerCallbackBundleUploadSchema.optional(),
|
|
862
|
-
transformCallbackExports: TransformCallbackExportsSchema.optional()
|
|
863
|
-
});
|
|
864
|
-
const credentialSetInstanceSchema$1 = createStructuralSchema([
|
|
865
|
-
"id",
|
|
866
|
-
"auth",
|
|
867
|
-
"connections"
|
|
868
|
-
], "a CredentialSet instance");
|
|
869
|
-
const TriggerModeDefaultSchema = z.enum(["managed", "subscribable"]);
|
|
870
|
-
const TriggerCallbackPresenceSchema = z.object({
|
|
871
|
-
filter: z.boolean(),
|
|
872
|
-
idempotencyKey: z.boolean(),
|
|
873
|
-
poll: z.boolean().optional(),
|
|
874
|
-
transformAllowed: z.boolean(),
|
|
875
|
-
verify: z.boolean().optional()
|
|
876
|
-
});
|
|
877
|
-
const TriggerRuntimeDescriptorSchema = z.object({ callbacks: TriggerCallbackPresenceSchema });
|
|
878
|
-
z.object({
|
|
879
|
-
manifestVersion: z.literal(1),
|
|
880
|
-
type: z.literal("trigger"),
|
|
881
|
-
triggerType: TriggerTypeSchema,
|
|
882
|
-
name: trimmedNonEmptyString("Trigger name"),
|
|
883
|
-
description: descriptionString("Trigger description"),
|
|
884
|
-
enabled: z.boolean(),
|
|
885
|
-
modeDefault: TriggerModeDefaultSchema,
|
|
886
|
-
executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
|
|
887
|
-
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
888
|
-
runtime: TriggerRuntimeDescriptorSchema
|
|
889
|
-
});
|
|
890
|
-
const triggerBaseConfigSchema = z.object({
|
|
891
|
-
credentialSets: z.array(credentialSetInstanceSchema$1).optional(),
|
|
892
|
-
description: descriptionString("Trigger description"),
|
|
893
|
-
enabled: z.boolean().default(true),
|
|
894
|
-
executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
|
|
895
|
-
modeDefault: TriggerModeDefaultSchema.default("managed"),
|
|
896
|
-
name: trimmedNonEmptyString("Trigger name")
|
|
897
|
-
});
|
|
898
|
-
triggerBaseConfigSchema.extend({
|
|
899
|
-
input: anyZodSchemaSchema,
|
|
900
|
-
payload: z.custom((value) => {
|
|
901
|
-
return jsonValueSchema.safeParse(value).success;
|
|
902
|
-
}, "Expected a JSON-serializable payload"),
|
|
903
|
-
schedule: ScheduleSchema,
|
|
904
|
-
timezone: IANATimezoneSchema.optional()
|
|
905
|
-
});
|
|
906
|
-
const cronTriggerRuntimeSchema = TriggerRuntimeDescriptorSchema.extend({
|
|
907
|
-
input: jsonSchemaObject,
|
|
908
|
-
payloadMode: z.literal("static"),
|
|
909
|
-
schedule: z.string(),
|
|
910
|
-
timezone: z.string().optional()
|
|
911
|
-
});
|
|
912
|
-
const cronTriggerManifestSchema = z.object({
|
|
913
|
-
manifestVersion: z.literal(1),
|
|
914
|
-
type: z.literal("trigger"),
|
|
915
|
-
triggerType: z.literal("cron"),
|
|
916
|
-
name: trimmedNonEmptyString("Trigger name"),
|
|
917
|
-
description: descriptionString("Trigger description"),
|
|
918
|
-
enabled: z.boolean(),
|
|
919
|
-
modeDefault: z.enum(["managed", "subscribable"]),
|
|
920
|
-
executionIdentityPolicy: triggerBaseConfigSchema.shape.executionIdentityPolicy,
|
|
921
|
-
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
922
|
-
runtime: cronTriggerRuntimeSchema,
|
|
923
|
-
/** Static payload for cron triggers — the workflow input when this trigger fires */
|
|
924
|
-
payload: jsonValueSchema.optional()
|
|
925
|
-
});
|
|
926
|
-
z.object({
|
|
927
|
-
lastPolledAt: z.string().optional(),
|
|
928
|
-
lastResponse: z.unknown().optional()
|
|
929
|
-
});
|
|
930
|
-
triggerBaseConfigSchema.extend({
|
|
931
|
-
poll: z.function(),
|
|
932
|
-
filter: z.function().optional(),
|
|
933
|
-
idempotencyKey: z.function().optional(),
|
|
934
|
-
response: anyZodSchemaSchema,
|
|
935
|
-
schedule: ScheduleSchema
|
|
936
|
-
});
|
|
937
|
-
const pollingTriggerRuntimeSchema = TriggerRuntimeDescriptorSchema.extend({
|
|
938
|
-
response: jsonSchemaObject,
|
|
939
|
-
schedule: z.string(),
|
|
940
|
-
state: z.object({
|
|
941
|
-
lastPolledAt: z.literal(true),
|
|
942
|
-
lastResponse: z.literal(true)
|
|
943
|
-
})
|
|
944
|
-
});
|
|
945
|
-
const pollingTriggerManifestSchema = z.object({
|
|
946
|
-
manifestVersion: z.literal(1),
|
|
947
|
-
type: z.literal("trigger"),
|
|
948
|
-
triggerType: z.literal("polling"),
|
|
949
|
-
name: trimmedNonEmptyString("Trigger name"),
|
|
950
|
-
description: descriptionString("Trigger description"),
|
|
951
|
-
enabled: z.boolean(),
|
|
952
|
-
modeDefault: z.enum(["managed", "subscribable"]),
|
|
953
|
-
executionIdentityPolicy: triggerBaseConfigSchema.shape.executionIdentityPolicy,
|
|
954
|
-
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
955
|
-
runtime: pollingTriggerRuntimeSchema
|
|
956
|
-
});
|
|
957
|
-
const WebhookMethodSchema = z.enum([
|
|
958
|
-
"PATCH",
|
|
959
|
-
"POST",
|
|
960
|
-
"PUT"
|
|
961
|
-
]);
|
|
962
|
-
z.object({
|
|
963
|
-
method: z.string(),
|
|
964
|
-
path: z.string(),
|
|
965
|
-
query: z.record(z.string(), z.union([
|
|
966
|
-
z.string(),
|
|
967
|
-
z.array(z.string()),
|
|
968
|
-
z.undefined()
|
|
969
|
-
])),
|
|
970
|
-
headers: z.record(z.string(), z.string().optional()),
|
|
971
|
-
rawBody: z.string()
|
|
972
|
-
});
|
|
973
|
-
const WebhookResponseConfigSchema = z.object({
|
|
974
|
-
ignoredBody: jsonValueSchema.optional(),
|
|
975
|
-
ignoredStatus: z.number().int().positive().optional(),
|
|
976
|
-
successBody: jsonValueSchema.optional(),
|
|
977
|
-
successStatus: z.number().int().positive().optional()
|
|
978
|
-
});
|
|
979
|
-
/**
|
|
980
|
-
* Custom webhook trigger paths describe the suffix that a request URL has
|
|
981
|
-
* after the organization id. The router serves these triggers at
|
|
982
|
-
* `/api/v1/webhooks/{orgId}{path}` (e.g. `path: '/orders'` → request
|
|
983
|
-
* `/api/v1/webhooks/{orgId}/orders`). Authors must therefore supply only the
|
|
984
|
-
* trailing path segment, not the `/webhooks/` prefix that the route already
|
|
985
|
-
* provides.
|
|
986
|
-
*/
|
|
987
|
-
const webhookPathSchema = z.string().trim().min(1, { error: "Webhook path cannot be empty" }).max(50, { error: "Webhook path cannot exceed 50 characters" }).refine((s) => !/\s/.test(s), { error: "Webhook path cannot contain spaces or whitespace" }).refine((s) => s.startsWith("/"), { error: "Webhook path must start with /" }).refine((s) => s.length > 1, { error: "Webhook path must include a path segment after the leading \"/\"" }).refine((s) => !/^\/webhooks(\/|$)/i.test(s), { error: "Webhook path must not start with \"/webhooks\". Provide just the suffix that follows the organization id in the URL — e.g. use \"/orders\" for a webhook served at \"/api/v1/webhooks/{orgId}/orders\"." });
|
|
988
|
-
const credentialSetInstanceSchema = createStructuralSchema([
|
|
989
|
-
"id",
|
|
990
|
-
"auth",
|
|
991
|
-
"connections"
|
|
992
|
-
], "a CredentialSet instance");
|
|
993
|
-
const webhookCustomSourceConfigSchema = z.object({
|
|
994
|
-
type: z.literal("custom"),
|
|
995
|
-
method: WebhookMethodSchema,
|
|
996
|
-
path: webhookPathSchema,
|
|
997
|
-
verify: z.function().optional(),
|
|
998
|
-
response: WebhookResponseConfigSchema.optional(),
|
|
999
|
-
credentialSets: z.array(credentialSetInstanceSchema).optional()
|
|
1000
|
-
});
|
|
1001
|
-
const webhookAppSourceConfigSchema = z.object({
|
|
1002
|
-
type: z.literal("app"),
|
|
1003
|
-
appRef: trimmedNonEmptyString("appRef")
|
|
1004
|
-
});
|
|
1005
|
-
const webhookSourceConfigSchema = z.discriminatedUnion("type", [webhookCustomSourceConfigSchema, webhookAppSourceConfigSchema]);
|
|
1006
|
-
const webhookCustomSourceManifestSchema = z.object({
|
|
1007
|
-
type: z.literal("custom"),
|
|
1008
|
-
method: WebhookMethodSchema,
|
|
1009
|
-
path: z.string().min(1).max(1024),
|
|
1010
|
-
response: WebhookResponseConfigSchema.optional()
|
|
1011
|
-
});
|
|
1012
|
-
const webhookAppSourceManifestSchema = z.object({
|
|
1013
|
-
type: z.literal("app"),
|
|
1014
|
-
appRef: trimmedNonEmptyString("appRef")
|
|
1015
|
-
});
|
|
1016
|
-
const WebhookSourceManifestSchema = z.discriminatedUnion("type", [webhookCustomSourceManifestSchema, webhookAppSourceManifestSchema]);
|
|
1017
|
-
triggerBaseConfigSchema.omit({ credentialSets: true }).extend({
|
|
1018
|
-
source: webhookSourceConfigSchema,
|
|
1019
|
-
payload: anyZodSchemaSchema.optional(),
|
|
1020
|
-
filter: z.function().optional(),
|
|
1021
|
-
idempotencyKey: z.function().optional()
|
|
1022
|
-
});
|
|
1023
|
-
const webhookTriggerRuntimeSchema = TriggerRuntimeDescriptorSchema.extend({
|
|
1024
|
-
source: WebhookSourceManifestSchema,
|
|
1025
|
-
payload: jsonSchemaObject
|
|
1026
|
-
});
|
|
1027
|
-
const webhookTriggerManifestSchema = z.object({
|
|
1028
|
-
manifestVersion: z.literal(1),
|
|
1029
|
-
type: z.literal("trigger"),
|
|
1030
|
-
triggerType: z.literal("webhook"),
|
|
1031
|
-
name: trimmedNonEmptyString("Trigger name"),
|
|
1032
|
-
description: descriptionString("Trigger description"),
|
|
1033
|
-
enabled: z.boolean(),
|
|
1034
|
-
modeDefault: z.enum(["managed", "subscribable"]),
|
|
1035
|
-
executionIdentityPolicy: triggerBaseConfigSchema.shape.executionIdentityPolicy,
|
|
1036
|
-
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
1037
|
-
runtime: webhookTriggerRuntimeSchema
|
|
1038
|
-
});
|
|
1039
|
-
z.unknown();
|
|
1040
255
|
//#endregion
|
|
1041
|
-
//#region ../../packages/workflow-builder/dist/import-module
|
|
256
|
+
//#region ../../packages/workflow-builder/dist/import-module-y0glInUe.mjs
|
|
1042
257
|
var DiscoveryError = class extends Error {
|
|
1043
258
|
code;
|
|
1044
259
|
filePath;
|
|
@@ -2178,7 +1393,7 @@ function isTriggerLike(value) {
|
|
|
2178
1393
|
value != null &&
|
|
2179
1394
|
(typeof value === 'object' || typeof value === 'function') &&
|
|
2180
1395
|
typeof value.toManifest === 'function' &&
|
|
2181
|
-
typeof value.
|
|
1396
|
+
typeof value.id === 'string'
|
|
2182
1397
|
);
|
|
2183
1398
|
}
|
|
2184
1399
|
|
|
@@ -2189,7 +1404,7 @@ function isBoundTriggerLike(value) {
|
|
|
2189
1404
|
value.isBoundTrigger === true &&
|
|
2190
1405
|
value.trigger != null &&
|
|
2191
1406
|
typeof value.trigger.toManifest === 'function' &&
|
|
2192
|
-
typeof value.trigger.
|
|
1407
|
+
typeof value.trigger.id === 'string'
|
|
2193
1408
|
);
|
|
2194
1409
|
}
|
|
2195
1410
|
|
|
@@ -2206,18 +1421,17 @@ function getTriggerCandidate(value) {
|
|
|
2206
1421
|
function describeTriggerEntry(entry) {
|
|
2207
1422
|
if (entry && typeof entry === 'object') {
|
|
2208
1423
|
if ('isBoundTrigger' in entry && entry.isBoundTrigger === true && entry.trigger) {
|
|
2209
|
-
return entry.trigger.
|
|
1424
|
+
return entry.trigger.id ?? '<unknown trigger>';
|
|
2210
1425
|
}
|
|
2211
|
-
if ('
|
|
2212
|
-
return entry.
|
|
1426
|
+
if ('id' in entry && typeof entry.id === 'string') {
|
|
1427
|
+
return entry.id;
|
|
2213
1428
|
}
|
|
2214
1429
|
}
|
|
2215
1430
|
return '<unknown trigger>';
|
|
2216
1431
|
}
|
|
2217
1432
|
|
|
2218
1433
|
function findTriggerSource(entry, trigger, workflowMod, workflowFilePath, siblingModules) {
|
|
2219
|
-
const
|
|
2220
|
-
// First, check if the trigger is re-exported from the workflow module (identity check)
|
|
1434
|
+
const triggerId = trigger.id;
|
|
2221
1435
|
for (const [name, exp] of Object.entries(workflowMod)) {
|
|
2222
1436
|
const candidate = getTriggerCandidate(exp);
|
|
2223
1437
|
if (exp === entry || exp === trigger || candidate === trigger) {
|
|
@@ -2233,13 +1447,13 @@ function findTriggerSource(entry, trigger, workflowMod, workflowFilePath, siblin
|
|
|
2233
1447
|
exp === entry ||
|
|
2234
1448
|
exp === trigger ||
|
|
2235
1449
|
candidate === trigger ||
|
|
2236
|
-
candidate?.
|
|
1450
|
+
candidate?.id === triggerId
|
|
2237
1451
|
) {
|
|
2238
1452
|
siblingMatches.push({ triggerExportName: name, sourceFilePath: filePath });
|
|
2239
1453
|
continue;
|
|
2240
1454
|
}
|
|
2241
1455
|
|
|
2242
|
-
if (isBoundTriggerLike(exp) && exp.trigger.
|
|
1456
|
+
if (isBoundTriggerLike(exp) && exp.trigger.id === triggerId) {
|
|
2243
1457
|
siblingMatches.push({ triggerExportName: name, sourceFilePath: filePath });
|
|
2244
1458
|
}
|
|
2245
1459
|
}
|
|
@@ -2251,7 +1465,7 @@ function findTriggerSource(entry, trigger, workflowMod, workflowFilePath, siblin
|
|
|
2251
1465
|
.join(', ');
|
|
2252
1466
|
throw new Error(
|
|
2253
1467
|
'Ambiguous trigger source for "' +
|
|
2254
|
-
|
|
1468
|
+
triggerId +
|
|
2255
1469
|
'" in ' +
|
|
2256
1470
|
workflowFilePath +
|
|
2257
1471
|
'. Matching sibling exports: ' +
|
|
@@ -2280,9 +1494,6 @@ async function discoverTriggers(workflow, mod, workflowFilePath) {
|
|
|
2280
1494
|
const trigger = isBound ? entry.trigger : entry;
|
|
2281
1495
|
const triggerManifest = trigger.toManifest();
|
|
2282
1496
|
const hasTransform = isBound && typeof entry.transform === 'function';
|
|
2283
|
-
const hasFilter = isBound
|
|
2284
|
-
? typeof entry.filter === 'function'
|
|
2285
|
-
: typeof trigger.filter === 'function';
|
|
2286
1497
|
const { triggerExportName, sourceFilePath } = findTriggerSource(
|
|
2287
1498
|
entry,
|
|
2288
1499
|
trigger,
|
|
@@ -2290,7 +1501,6 @@ async function discoverTriggers(workflow, mod, workflowFilePath) {
|
|
|
2290
1501
|
workflowFilePath,
|
|
2291
1502
|
siblingModules
|
|
2292
1503
|
);
|
|
2293
|
-
// For cron triggers, capture the static payload for runtime use
|
|
2294
1504
|
const staticPayload =
|
|
2295
1505
|
triggerManifest.triggerType === 'cron' && 'payload' in trigger
|
|
2296
1506
|
? trigger.payload
|
|
@@ -2300,16 +1510,15 @@ async function discoverTriggers(workflow, mod, workflowFilePath) {
|
|
|
2300
1510
|
triggerExportName,
|
|
2301
1511
|
sourceFilePath,
|
|
2302
1512
|
hasTransform,
|
|
2303
|
-
hasFilter,
|
|
2304
1513
|
staticPayload,
|
|
2305
1514
|
triggerIndex,
|
|
2306
1515
|
});
|
|
2307
1516
|
} catch (error) {
|
|
2308
|
-
const
|
|
1517
|
+
const triggerLabel = describeTriggerEntry(entry);
|
|
2309
1518
|
const message = serializeError(error);
|
|
2310
1519
|
throw new Error(
|
|
2311
1520
|
'Failed to discover trigger "' +
|
|
2312
|
-
|
|
1521
|
+
triggerLabel +
|
|
2313
1522
|
'" for workflow "' +
|
|
2314
1523
|
workflow.name +
|
|
2315
1524
|
'": ' +
|
|
@@ -2508,7 +1717,6 @@ const LoadedWorkflowTriggerSchema = z.object({
|
|
|
2508
1717
|
triggerExportName: z.string().optional(),
|
|
2509
1718
|
sourceFilePath: z.string().optional(),
|
|
2510
1719
|
hasTransform: z.boolean(),
|
|
2511
|
-
hasFilter: z.boolean(),
|
|
2512
1720
|
staticPayload: z.unknown().optional(),
|
|
2513
1721
|
triggerIndex: z.number()
|
|
2514
1722
|
});
|
|
@@ -2517,7 +1725,7 @@ const LoaderTimingSchema = z.object({
|
|
|
2517
1725
|
manifestMs: z.number(),
|
|
2518
1726
|
flowGraphMs: z.number()
|
|
2519
1727
|
});
|
|
2520
|
-
const DeclaredCredentialEntrySchema = DeclaredCredentialRequirementSchema;
|
|
1728
|
+
const DeclaredCredentialEntrySchema = src_exports.DeclaredCredentialRequirementSchema;
|
|
2521
1729
|
const CredentialsByCallsiteFingerprintSchema = z.record(z.string(), z.array(DeclaredCredentialEntrySchema));
|
|
2522
1730
|
const CredentialAttributionWarningSchema = z.object({
|
|
2523
1731
|
category: z.literal("unmatched-callsite"),
|