@keystrokehq/cli 0.0.13 → 0.0.15
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/README.md +3 -3
- package/dist/{accept.handler-BU6kg8ET.mjs → accept.handler-BsZQqmzU.mjs} +1 -1
- package/dist/{admin-B4GNbCl5.mjs → admin-CXQezpQA.mjs} +9 -9
- package/dist/{agents-LtoIcJGY.mjs → agents-CWGz8CR-.mjs} +6 -6
- package/dist/{api-DuKKdCpF.mjs → api-jkf0TTgD.mjs} +1 -1
- package/dist/{api-keys-BE_hLonn.mjs → api-keys-BZmUiIEr.mjs} +5 -5
- package/dist/{auth-DNK5MYm4.mjs → auth-CGBgi6PG.mjs} +5 -5
- package/dist/{auth.handler-DrjDODhZ.mjs → auth.handler-u3qmoUX0.mjs} +1 -2
- package/dist/{build-agents-DseUtzd4-DIDGsZWL.mjs → build-agents-DseUtzd4-DBQ82ErJ.mjs} +3 -3
- package/dist/{build-metadata-qebrtraZ-D4SQNsBw.mjs → build-metadata-C8Ra_Gi--CTCBRjFA.mjs} +7 -7
- package/dist/{build-progress-CITED2tv.mjs → build-progress-BZivcVz4.mjs} +1 -1
- package/dist/{build-tasks-GVuMLS0h-DnS9QWzf.mjs → build-tasks-GVuMLS0h-CWrrj8SF.mjs} +3 -3
- package/dist/{build-workflows-Dmzay1vP-DKVuBAjD.mjs → build-workflows-CV4tBo6S-B4SPp86e.mjs} +7 -7
- package/dist/{build.handler-BZnLQt0_.mjs → build.handler-DqnngAkl.mjs} +4 -4
- package/dist/{clear.handler-B1c17nAi.mjs → clear.handler-Dpe05eTq.mjs} +1 -1
- package/dist/{commander-BwtBoukr.mjs → commander-i-7LgOyc.mjs} +1 -1
- package/dist/{connect-IPcL37np.mjs → connect-CS6sqNfA.mjs} +2 -2
- package/dist/{connect.handler-ToY6qmMz.mjs → connect.handler-DRO05ak3.mjs} +3 -3
- package/dist/{context-DQ4IA0yO.mjs → context-B1L8pZsH.mjs} +1 -1
- package/dist/{create.handler-BAyG0PmG.mjs → create.handler-DF1Ye4nr.mjs} +1 -1
- package/dist/{credentials-CZiu-534.mjs → credentials-1CPFwx-k.mjs} +6 -6
- package/dist/cron-parser-C2eJD0yD.mjs +393 -0
- package/dist/{current-deployment-workflow-zTmYbUjh.mjs → current-deployment-workflow-CUBHcdZl.mjs} +5 -5
- package/dist/{current.handler-DA4FGfUP.mjs → current.handler-C48q2mBd.mjs} +1 -1
- package/dist/{delete.handler-CJcyvnUF.mjs → delete.handler-Bude0SVP.mjs} +1 -1
- package/dist/{deploy-BvaFgVvf.mjs → deploy-D4ILrWpx.mjs} +1 -1
- package/dist/{deploy-DdMP-YaQ.mjs → deploy-DwRwyVwR.mjs} +2 -2
- package/dist/{deploy-progress-CLO-yidq.mjs → deploy-progress-DJHph1Fz.mjs} +1 -1
- package/dist/{deploy.handler-Bag7rBG-.mjs → deploy.handler-zMb-BHLo.mjs} +16 -16
- package/dist/{detect-env-access-CwkOYeYM-EmkYvbfJ.mjs → detect-env-access-CwkOYeYM-BLtKepjx.mjs} +1 -1
- package/dist/{diff.handler-Brgc-Ccl.mjs → diff.handler-C-XqswH5.mjs} +3 -3
- package/dist/{dist-BMkNN03r.mjs → dist-FQYQ2FLm.mjs} +8 -8
- package/dist/{env.handler-DFKzjIQT.mjs → env.handler-DK3B7MLl.mjs} +6 -6
- package/dist/{error-boundary-B2ZKRkZI.mjs → error-boundary-CyLcinp1.mjs} +1 -1
- package/dist/{import-module-DEI7R8Yh-Xz-KAPvB.mjs → import-module--8x5SLum-DaUNACER.mjs} +819 -36
- package/dist/{init-DhnABm3J.mjs → init-QhRFud0x.mjs} +2 -2
- package/dist/{init.handler-QgehN8B4.mjs → init.handler-Beu-vpIu.mjs} +42 -11
- package/dist/{inspect.handler-CMOFOb4G.mjs → inspect.handler-ULT2jiVU.mjs} +3 -3
- package/dist/{integration-catalog-BRrJIAVz.mjs → integration-catalog-BgT4mLzW.mjs} +1 -1
- package/dist/{integrations-7-U7nmkh.mjs → integrations-6BiywCph.mjs} +5 -5
- package/dist/{invites-CmGmnUla.mjs → invites-BlB-hKUE.mjs} +4 -4
- package/dist/{invites.list.handler-CmkIf-uW.mjs → invites.list.handler-DmeMcezN.mjs} +1 -1
- package/dist/{invites.resend.handler-FZl20yat.mjs → invites.resend.handler-pJTPtKHE.mjs} +1 -1
- package/dist/{invites.revoke.handler-D95mrfmB.mjs → invites.revoke.handler-4NgnnfiU.mjs} +1 -1
- package/dist/keystroke.mjs +21 -21
- package/dist/{list-enrichment-I4XQaMg0.mjs → list-enrichment-C6u5eI0j.mjs} +1 -1
- package/dist/{list.handler-DRnHsEa0.mjs → list.handler-BSyrxCma.mjs} +1 -1
- package/dist/{list.handler-DsYyTUhA.mjs → list.handler-BuX-bb2y.mjs} +1 -1
- package/dist/{list.handler-H8aQSsFM.mjs → list.handler-C7AChEPW.mjs} +2 -2
- package/dist/{list.handler-Cp767f5l.mjs → list.handler-CBEXiTAK.mjs} +1 -1
- package/dist/{list.handler-DXl8igi2.mjs → list.handler-D-YFoKLU.mjs} +5 -5
- package/dist/{list.handler-BrTW2viq.mjs → list.handler-U9-KuVlh.mjs} +1 -1
- package/dist/{list.handler-uzC77oIy.mjs → list2.handler-L3BKR5ok.mjs} +4 -4
- package/dist/{listen-DckJq0y0.mjs → listen-Tx2SrMyo.mjs} +2 -2
- package/dist/{listen.handler-Bf5MXKPO.mjs → listen.handler-C7AqsKLf.mjs} +2 -2
- package/dist/{logs-D_l5BIn2.mjs → logs-NI-DyeFY.mjs} +3 -3
- package/dist/{logs.handler-kYO3Uv9t.mjs → logs.handler-BGJU1p3H.mjs} +2 -2
- package/dist/{members.add.handler-C2cppd-9.mjs → members.add.handler-B4H8Hn6x.mjs} +1 -1
- package/dist/{members.invite.handler-DY6kS4LN.mjs → members.invite.handler-D8ONlt4Y.mjs} +1 -1
- package/dist/{members.list.handler-CFBG3SBw.mjs → members.list.handler-BHJTMMiA.mjs} +1 -1
- package/dist/{members.remove.handler-LQ61_qip.mjs → members.remove.handler-_hKd_sFd.mjs} +1 -1
- package/dist/{members.update.handler-CqISA1mf.mjs → members.update.handler-CC7J0k8n.mjs} +1 -1
- package/dist/{metadata-layout-C6ed-9dl-EF5pCtIH.mjs → metadata-layout-Bv-B0nHj-CqlcZz_g.mjs} +1 -1
- package/dist/{normalize-path-CojS-CgQ-D5D0AIHR.mjs → normalize-path-CojS-CgQ-DFTvyA27.mjs} +1 -1
- package/dist/{org-KQ2nD0yN.mjs → org-8bkIZAJ4.mjs} +15 -15
- package/dist/{orgs.create.handler-Mv5CTGcG.mjs → orgs.create.handler-vXQgDJZ_.mjs} +1 -1
- package/dist/{orgs.get.handler-DvvOhshX.mjs → orgs.get.handler-D_Jfl18x.mjs} +1 -1
- package/dist/{orgs.list.handler-wWAg6cKg.mjs → orgs.list.handler-BNjoTJvV.mjs} +1 -1
- package/dist/{paused.handler-CbMkPD9e.mjs → paused.handler-9ND-i2EN.mjs} +1 -1
- package/dist/{project-config-CJGSh2RQ.mjs → project-config-CsBMT4TL.mjs} +1 -13
- package/dist/{projects-CYqeKQGT.mjs → projects-B5MRnbHS.mjs} +4 -4
- package/dist/{projects-CWLOF5x4.mjs → projects-DfaG_3WP.mjs} +1 -1
- package/dist/{requirements.handler-CnDTBcH5.mjs → requirements.handler-D5dFi7XZ.mjs} +5 -5
- package/dist/{resolve-project-bVPMcs-y.mjs → resolve-project-CURYMjex.mjs} +1 -1
- package/dist/{run-polling-Cb4ssXIE.mjs → run-polling-B4KvySvp.mjs} +1 -1
- package/dist/{run-polling-49w3PYAv.mjs → run-polling-BwyyKDwg.mjs} +3 -3
- package/dist/{run.handler-Bma88649.mjs → run.handler-TJNyF_p_.mjs} +5 -5
- package/dist/{runs-HJejvQnQ.mjs → runs-Bs8VzL8P.mjs} +2 -2
- package/dist/{schema-display-CyCWSgfY.mjs → schema-display-CNqiYBIb.mjs} +4 -4
- package/dist/{skills-sync.handler-Cf74vKJA.mjs → skills-sync.handler-DXF6IgEX.mjs} +1 -1
- package/dist/{skills.command-KyAwBeST.mjs → skills.command-B8yExFCn.mjs} +3 -3
- package/dist/{source-analysis-DTnwNwKq-DoBxUDCg.mjs → source-analysis-BBg2E_6G-BQqm16RR.mjs} +4 -4
- package/dist/{spinner-progress-CS1BEdNB.mjs → spinner-progress-DfkMzwGx.mjs} +1 -1
- package/dist/spinner-worker.d.mts +3 -0
- package/dist/spinner-worker.mjs +203 -0
- package/dist/{src-D-dFmoAF.mjs → src-BQdOWkyv.mjs} +1 -1
- package/dist/{switch.handler-DfsKVtR6.mjs → switch.handler-BFBM8rSi.mjs} +1 -1
- package/dist/{sync-Bi2M_TUK.mjs → sync-BZj7Dkhq.mjs} +2 -2
- package/dist/{sync.handler-D6YFuVlq.mjs → sync.handler-Kk4R2lJ_.mjs} +6 -6
- package/dist/{task-BBgEvdG1.mjs → task-BNXDZU71.mjs} +1 -390
- package/dist/{task-target-build-atWwwnSF.mjs → task-target-build-Du0ObGbb.mjs} +4 -4
- package/dist/{task-target-deploy-CRsrQTOy.mjs → task-target-deploy-OyxLvh3a.mjs} +1 -1
- package/dist/task-target-deploy-runner.mjs +5 -5
- package/dist/test-CJ8Vx_h5.mjs +74 -0
- package/dist/{try-deploy.handler-BMcWQVST.mjs → test.handler-BTn4NFmU.mjs} +15 -17
- package/dist/{test.handler-St9sBXyH.mjs → test.handler-Dk3CmTa7.mjs} +1 -1
- package/dist/{test-Ctjy8mwC.mjs → tool.handler-CuxoCstV.mjs} +65 -93
- package/dist/{trigger-artifacts-RizI57RC-C-yCtEi-.mjs → trigger-artifacts-RizI57RC-abdkW8-z.mjs} +3 -3
- package/dist/{upgrade-YavAf8AC.mjs → upgrade-CdA_Sw4F.mjs} +1 -1
- package/dist/{upload.handler-DemogvI1.mjs → upload.handler-CpKuAaQ_.mjs} +8 -8
- package/dist/{users.get.handler-B20PMSbl.mjs → users.get.handler-D0WO6D1K.mjs} +1 -1
- package/dist/{users.list.handler-BplFTjv3.mjs → users.list.handler-BSTIniF1.mjs} +1 -1
- package/dist/{users.set-role.handler-wdmI6o3G.mjs → users.set-role.handler-DAKdSkbn.mjs} +1 -1
- package/dist/{utils-DpEtybzI.mjs → utils-VC0Vl_pm.mjs} +2 -2
- package/dist/{validate.handler-DSAvNgns.mjs → validate.handler-COJ53qWJ.mjs} +3 -3
- package/dist/{workflow-build-Cmu1TOFu.mjs → workflow-build-kNNcU-R8.mjs} +18 -18
- package/dist/{workflow-bundler-BzHk73PM-UJQa7Ubk.mjs → workflow-bundler-BzHk73PM-CRcJvu9a.mjs} +2 -2
- package/dist/{workflows-DTlypo2t.mjs → workflows-D04CqpO-.mjs} +56 -18
- package/dist/{writer-CtvttJdP-BfNsrheU.mjs → writer-B-SpZ0G2-olEAgSLc.mjs} +8 -8
- package/package.json +8 -8
- package/dist/options-DFPs-tAB.mjs +0 -43
- /package/dist/{agent-bundle-package-DWV6B_5q-cB76j6UL.mjs → agent-bundle-package-DWV6B_5q-rRTPU13L.mjs} +0 -0
- /package/dist/{browser-B4K0VW8p.mjs → browser-3cUiPlk2.mjs} +0 -0
- /package/dist/{clear-cache.handler-Dywqc7TG.mjs → clear-cache.handler-Bkt6GKnF.mjs} +0 -0
- /package/dist/{clear.handler-ui4e1CnJ.mjs → clear.handler-BieI9Oix.mjs} +0 -0
- /package/dist/{concurrency-gXn9Rw8x-CaI6Vtbu.mjs → concurrency-gXn9Rw8x-BI6HQNfC.mjs} +0 -0
- /package/dist/{credential-env-map-D0zgoUl0.mjs → credential-env-map-B2nVJXPn.mjs} +0 -0
- /package/dist/{credential-schema-mismatch-8pqwvswO.mjs → credential-schema-mismatch-CfyBUMPS.mjs} +0 -0
- /package/dist/{credentials-Bu1MBiCL.mjs → credentials-CiOwDS5y.mjs} +0 -0
- /package/dist/{diff-utils-BoXI705D.mjs → diff-utils-4OQTpP5s.mjs} +0 -0
- /package/dist/{file-metadata-Dwy9KKq_.mjs → file-metadata-DaPPpiTh.mjs} +0 -0
- /package/dist/{layout-DRf9qUf8.mjs → layout-CXkZEsXI.mjs} +0 -0
- /package/dist/{logs.handler-DxSKmDCq.mjs → logs.handler-BqmZ4eLx.mjs} +0 -0
- /package/dist/{oxc-B3KI3rf_-CHDUXsus.mjs → oxc-B3KI3rf_-DdiZWqe2.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-CzXPGxdU.mjs → read-credential-keys-77a91T8M-COvwpok_.mjs} +0 -0
- /package/dist/{register.handler-D7ZZAnGP.mjs → register.handler-CttgzybN.mjs} +0 -0
- /package/dist/{rolldown-runtime-twds-ZHy-3DMm_Sby.mjs → rolldown-runtime-twds-ZHy-CO5ir_za.mjs} +0 -0
- /package/dist/{schema-DFJiNWyd.mjs → schema-O9xTWad_.mjs} +0 -0
- /package/dist/{skills.handler-C_4VzVmc.mjs → skills.handler-CPKCf9ZK.mjs} +0 -0
- /package/dist/{status.handler-Cm9aNUBn.mjs → status.handler-DxCJRm1n.mjs} +0 -0
- /package/dist/{sync-keystroke-agent-skills-CX9fS5nQ.mjs → sync-keystroke-agent-skills-ChUj1LnK.mjs} +0 -0
- /package/dist/{task-target-deploy-CZBGNC0H-BwPSfaJQ.mjs → task-target-deploy-CZBGNC0H-Ck724yF4.mjs} +0 -0
- /package/dist/{trigger-manifest-D5rnpPkA.mjs → trigger-manifest-PTjVYL1r.mjs} +0 -0
- /package/dist/{upload-C0kaZu08.mjs → upload-wwSPAC5_.mjs} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as findProjectRoot } from "./project-config-
|
|
4
|
-
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-DodkHgnS.mjs";
|
|
3
|
+
import { n as findProjectRoot } from "./project-config-CsBMT4TL.mjs";
|
|
4
|
+
import { c as optionalDescriptionString$1, i as createStructuralSchema$1, l as optionalTrimmedNonEmptyString$1, o as idNoSpacesString, r as anyZodSchemaSchema$1, s as jsonSchemaObject$1, t as CredentialSetManifestSchema$1, u as trimmedNonEmptyString$1 } from "./schemas-DodkHgnS.mjs";
|
|
5
5
|
import { n as DeclaredCredentialRequirementSchema } from "./credential-requirements-FtBk5JVB.mjs";
|
|
6
6
|
import { a as FlowGraphSchema, i as WorkflowCoreManifestSchema, n as WORKFLOW_MANIFEST_SCHEMA_VERSION } from "./workflow-build-manifest-OPFqFD6f.mjs";
|
|
7
|
-
import { t as
|
|
7
|
+
import { t as parseCronExpression } from "./cron-parser-C2eJD0yD.mjs";
|
|
8
|
+
import { t as runWithConcurrency } from "./concurrency-gXn9Rw8x-BI6HQNfC.mjs";
|
|
8
9
|
import { createRequire } from "node:module";
|
|
9
10
|
import * as os from "node:os";
|
|
10
11
|
import * as path$1 from "node:path";
|
|
@@ -13,9 +14,8 @@ import { z } from "zod";
|
|
|
13
14
|
import { execFile } from "node:child_process";
|
|
14
15
|
import { randomUUID } from "node:crypto";
|
|
15
16
|
import { promisify } from "node:util";
|
|
16
|
-
import { cronTriggerManifestSchema, pollingTriggerManifestSchema, webhookTriggerManifestSchema } from "@keystrokehq/core/trigger";
|
|
17
17
|
//#region ../../packages/core/src/mcp-server/schemas.ts
|
|
18
|
-
const credentialSetInstanceSchema$
|
|
18
|
+
const credentialSetInstanceSchema$3 = createStructuralSchema$1([
|
|
19
19
|
"id",
|
|
20
20
|
"auth",
|
|
21
21
|
"connections"
|
|
@@ -23,27 +23,27 @@ const credentialSetInstanceSchema$1 = createStructuralSchema([
|
|
|
23
23
|
const McpTransportSchema = z.discriminatedUnion("type", [
|
|
24
24
|
z.object({
|
|
25
25
|
type: z.literal("stdio"),
|
|
26
|
-
command: trimmedNonEmptyString("Command"),
|
|
26
|
+
command: trimmedNonEmptyString$1("Command"),
|
|
27
27
|
args: z.array(z.string()).optional(),
|
|
28
28
|
env: z.record(z.string(), z.string()).optional()
|
|
29
29
|
}),
|
|
30
30
|
z.object({
|
|
31
31
|
type: z.literal("http"),
|
|
32
|
-
url: trimmedNonEmptyString("URL"),
|
|
32
|
+
url: trimmedNonEmptyString$1("URL"),
|
|
33
33
|
headers: z.record(z.string(), z.string()).optional()
|
|
34
34
|
}),
|
|
35
35
|
z.object({
|
|
36
36
|
type: z.literal("sse"),
|
|
37
|
-
url: trimmedNonEmptyString("URL"),
|
|
37
|
+
url: trimmedNonEmptyString$1("URL"),
|
|
38
38
|
headers: z.record(z.string(), z.string()).optional()
|
|
39
39
|
})
|
|
40
40
|
]);
|
|
41
41
|
z.object({
|
|
42
|
-
id: trimmedNonEmptyString("MCP server ID"),
|
|
43
|
-
name: optionalTrimmedNonEmptyString("MCP server name"),
|
|
44
|
-
description: optionalDescriptionString("MCP server description"),
|
|
42
|
+
id: trimmedNonEmptyString$1("MCP server ID"),
|
|
43
|
+
name: optionalTrimmedNonEmptyString$1("MCP server name"),
|
|
44
|
+
description: optionalDescriptionString$1("MCP server description"),
|
|
45
45
|
transport: McpTransportSchema,
|
|
46
|
-
credentialSets: z.array(credentialSetInstanceSchema$
|
|
46
|
+
credentialSets: z.array(credentialSetInstanceSchema$3).optional(),
|
|
47
47
|
credentials: z.function().optional()
|
|
48
48
|
});
|
|
49
49
|
const McpServerManifestSchema = z.object({
|
|
@@ -53,7 +53,7 @@ const McpServerManifestSchema = z.object({
|
|
|
53
53
|
name: z.string().min(1),
|
|
54
54
|
description: z.string().optional(),
|
|
55
55
|
transport: McpTransportSchema,
|
|
56
|
-
credentialSets: z.array(CredentialSetManifestSchema),
|
|
56
|
+
credentialSets: z.array(CredentialSetManifestSchema$1),
|
|
57
57
|
credentialInjection: z.object({
|
|
58
58
|
env: z.record(z.string(), z.object({
|
|
59
59
|
credentialSetId: z.string().min(1),
|
|
@@ -67,7 +67,7 @@ const McpServerManifestSchema = z.object({
|
|
|
67
67
|
});
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region ../../packages/core/src/messaging-gateway/schemas.ts
|
|
70
|
-
const credentialSetInstanceSchema = createStructuralSchema([
|
|
70
|
+
const credentialSetInstanceSchema$2 = createStructuralSchema$1([
|
|
71
71
|
"id",
|
|
72
72
|
"auth",
|
|
73
73
|
"connections"
|
|
@@ -76,11 +76,11 @@ const MessagingGatewayModeSchema = z.enum(["platform", "custom"]);
|
|
|
76
76
|
const MessagingGatewayCredentialScopeSchema = z.enum(["organization", "project"]);
|
|
77
77
|
z.object({
|
|
78
78
|
id: idNoSpacesString("MessagingGateway id"),
|
|
79
|
-
name: optionalDescriptionString("MessagingGateway name"),
|
|
80
|
-
description: optionalDescriptionString("MessagingGateway description"),
|
|
79
|
+
name: optionalDescriptionString$1("MessagingGateway name"),
|
|
80
|
+
description: optionalDescriptionString$1("MessagingGateway description"),
|
|
81
81
|
provider: z.string().min(1, "MessagingGateway provider is required"),
|
|
82
82
|
mode: MessagingGatewayModeSchema,
|
|
83
|
-
credentialSet: credentialSetInstanceSchema,
|
|
83
|
+
credentialSet: credentialSetInstanceSchema$2,
|
|
84
84
|
credentialScope: MessagingGatewayCredentialScopeSchema.optional(),
|
|
85
85
|
appRef: z.string().min(1).optional()
|
|
86
86
|
});
|
|
@@ -92,7 +92,7 @@ const MessagingGatewayManifestSchema = z.object({
|
|
|
92
92
|
description: z.string().optional(),
|
|
93
93
|
provider: z.string().min(1),
|
|
94
94
|
mode: MessagingGatewayModeSchema,
|
|
95
|
-
credentialSet: CredentialSetManifestSchema,
|
|
95
|
+
credentialSet: CredentialSetManifestSchema$1,
|
|
96
96
|
credentialScope: MessagingGatewayCredentialScopeSchema.optional(),
|
|
97
97
|
appRef: z.string().min(1).optional()
|
|
98
98
|
});
|
|
@@ -118,7 +118,7 @@ const SandboxRuntimeSchema = z.object({
|
|
|
118
118
|
const SandboxFileSourceSchema = z.discriminatedUnion("type", [z.object({
|
|
119
119
|
type: z.literal("git"),
|
|
120
120
|
/** Remote git URL to clone. */
|
|
121
|
-
url: trimmedNonEmptyString("Git URL"),
|
|
121
|
+
url: trimmedNonEmptyString$1("Git URL"),
|
|
122
122
|
/** Branch to clone. Omit for default branch. */
|
|
123
123
|
branch: z.string().optional(),
|
|
124
124
|
/**
|
|
@@ -130,7 +130,7 @@ const SandboxFileSourceSchema = z.discriminatedUnion("type", [z.object({
|
|
|
130
130
|
}), z.object({
|
|
131
131
|
type: z.literal("local"),
|
|
132
132
|
/** Source path on the host (the dev's machine), resolved against project root. */
|
|
133
|
-
path: trimmedNonEmptyString("Local path"),
|
|
133
|
+
path: trimmedNonEmptyString$1("Local path"),
|
|
134
134
|
/**
|
|
135
135
|
* Where the file/dir lands inside the VM. Relative paths resolve
|
|
136
136
|
* against the sandbox `workdir`; absolute paths must stay under
|
|
@@ -139,9 +139,9 @@ const SandboxFileSourceSchema = z.discriminatedUnion("type", [z.object({
|
|
|
139
139
|
target: z.string().optional()
|
|
140
140
|
})]);
|
|
141
141
|
z.object({
|
|
142
|
-
id: optionalTrimmedNonEmptyString("Sandbox ID"),
|
|
143
|
-
name: optionalTrimmedNonEmptyString("Sandbox name"),
|
|
144
|
-
description: optionalDescriptionString("Sandbox description"),
|
|
142
|
+
id: optionalTrimmedNonEmptyString$1("Sandbox ID"),
|
|
143
|
+
name: optionalTrimmedNonEmptyString$1("Sandbox name"),
|
|
144
|
+
description: optionalDescriptionString$1("Sandbox description"),
|
|
145
145
|
runtime: SandboxRuntimeSchema.optional(),
|
|
146
146
|
fileSources: z.array(SandboxFileSourceSchema).optional(),
|
|
147
147
|
setupCommands: z.array(z.string()).optional()
|
|
@@ -170,18 +170,18 @@ const AgentThinkingLevelSchema = z.enum([
|
|
|
170
170
|
"high",
|
|
171
171
|
"xhigh"
|
|
172
172
|
]);
|
|
173
|
-
const mcpServerInstanceSchema = createStructuralSchema([
|
|
173
|
+
const mcpServerInstanceSchema = createStructuralSchema$1([
|
|
174
174
|
"id",
|
|
175
175
|
"transport",
|
|
176
176
|
"credentialSets"
|
|
177
177
|
], "a McpServer instance");
|
|
178
|
-
const sandboxInstanceSchema = createStructuralSchema([
|
|
178
|
+
const sandboxInstanceSchema = createStructuralSchema$1([
|
|
179
179
|
"id",
|
|
180
180
|
"runtime",
|
|
181
181
|
"fileSources",
|
|
182
182
|
"setupCommands"
|
|
183
183
|
], "a Sandbox instance");
|
|
184
|
-
const messagingGatewayInstanceSchema = createStructuralSchema([
|
|
184
|
+
const messagingGatewayInstanceSchema = createStructuralSchema$1([
|
|
185
185
|
"id",
|
|
186
186
|
"provider",
|
|
187
187
|
"mode",
|
|
@@ -199,14 +199,14 @@ const AgentToolCredentialSetReferenceSchema = z.object({
|
|
|
199
199
|
required: z.boolean()
|
|
200
200
|
});
|
|
201
201
|
z.object({
|
|
202
|
-
id: trimmedNonEmptyString("Agent ID"),
|
|
203
|
-
name: trimmedNonEmptyString("Agent name"),
|
|
204
|
-
description: optionalDescriptionString("Agent description"),
|
|
202
|
+
id: trimmedNonEmptyString$1("Agent ID"),
|
|
203
|
+
name: trimmedNonEmptyString$1("Agent name"),
|
|
204
|
+
description: optionalDescriptionString$1("Agent description"),
|
|
205
205
|
systemPrompt: z.string().min(1, { error: "System prompt is required" }),
|
|
206
|
-
model: trimmedNonEmptyString("Model"),
|
|
206
|
+
model: trimmedNonEmptyString$1("Model"),
|
|
207
207
|
thinkingLevel: AgentThinkingLevelSchema.optional(),
|
|
208
|
-
input: anyZodSchemaSchema.optional(),
|
|
209
|
-
output: anyZodSchemaSchema.optional(),
|
|
208
|
+
input: anyZodSchemaSchema$1.optional(),
|
|
209
|
+
output: anyZodSchemaSchema$1.optional(),
|
|
210
210
|
tools: z.array(z.unknown()).optional(),
|
|
211
211
|
mcpServers: z.array(mcpServerInstanceSchema).optional(),
|
|
212
212
|
sandbox: sandboxInstanceSchema.optional(),
|
|
@@ -230,10 +230,10 @@ const AgentManifestSchema = z.object({
|
|
|
230
230
|
systemPrompt: z.string(),
|
|
231
231
|
model: z.string(),
|
|
232
232
|
thinkingLevel: AgentThinkingLevelSchema,
|
|
233
|
-
input: jsonSchemaObject,
|
|
234
|
-
output: jsonSchemaObject,
|
|
233
|
+
input: jsonSchemaObject$1,
|
|
234
|
+
output: jsonSchemaObject$1,
|
|
235
235
|
maxSteps: z.number(),
|
|
236
|
-
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
236
|
+
credentialSets: z.array(CredentialSetManifestSchema$1).optional(),
|
|
237
237
|
tools: z.array(z.object({
|
|
238
238
|
id: z.string(),
|
|
239
239
|
displayName: z.string(),
|
|
@@ -253,8 +253,791 @@ const AgentManifestSchema = z.object({
|
|
|
253
253
|
sandbox: SandboxManifestSchema.optional(),
|
|
254
254
|
messaging: z.array(MessagingGatewayManifestSchema).optional()
|
|
255
255
|
});
|
|
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-DTrryPH_.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
|
+
* Only allows letters, numbers, hyphens, and underscores.
|
|
385
|
+
*/
|
|
386
|
+
function credentialSetIdString(fieldName) {
|
|
387
|
+
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, and underscores` });
|
|
388
|
+
}
|
|
389
|
+
function optionalTrimmedNonEmptyString(fieldName) {
|
|
390
|
+
return trimmedNonEmptyString(fieldName).optional();
|
|
391
|
+
}
|
|
392
|
+
function descriptionString(fieldName) {
|
|
393
|
+
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(1024, { error: `${fieldName} cannot exceed 1024 characters` });
|
|
394
|
+
}
|
|
395
|
+
function optionalDescriptionString(fieldName) {
|
|
396
|
+
return descriptionString(fieldName).optional();
|
|
397
|
+
}
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region ../../packages/core/dist/chunks/schemas-DcgZIQvs.mjs
|
|
400
|
+
/**
|
|
401
|
+
* Shared constants for the credential/connection system.
|
|
402
|
+
* Defined in core (bottom of dependency chain) so all packages can import them.
|
|
403
|
+
*/
|
|
404
|
+
const CREDENTIAL_EXPOSURES = {
|
|
405
|
+
"user-runtime": "user-runtime",
|
|
406
|
+
"platform-only": "platform-only"
|
|
407
|
+
};
|
|
408
|
+
const credentialSetProxyInjectionSchema = z.object({
|
|
409
|
+
/** Substitute placeholder in HTTP headers (default: true). */
|
|
410
|
+
headers: z.boolean().optional(),
|
|
411
|
+
/** Substitute placeholder in the HTTP Basic Auth credential (default: true). */
|
|
412
|
+
basicAuth: z.boolean().optional(),
|
|
413
|
+
/** Substitute placeholder in URL query params (default: false).
|
|
414
|
+
* Use for APIs that authenticate via `?api_key=...` (Google Maps, OWM, etc.). */
|
|
415
|
+
queryParams: z.boolean().optional(),
|
|
416
|
+
/** Substitute placeholder in the HTTP request body (default: false).
|
|
417
|
+
* Use for form-encoded auth payloads (Stripe, AWS SigV4 query, etc.). */
|
|
418
|
+
body: z.boolean().optional()
|
|
419
|
+
});
|
|
420
|
+
const credentialSetProxyConfigSchema = z.object({
|
|
421
|
+
/** Exact-match host allowlist (forwarded to SecretBuilder.allowHost). */
|
|
422
|
+
hosts: z.array(z.string().min(1)).optional(),
|
|
423
|
+
/** Wildcard host allowlist (forwarded to SecretBuilder.allowHostPattern).
|
|
424
|
+
* Example: `["*.browserbase.com"]` covers any subdomain. */
|
|
425
|
+
hostPatterns: z.array(z.string().min(1)).optional(),
|
|
426
|
+
/** Per-scope substitution toggles. Omit to use SDK defaults. */
|
|
427
|
+
injection: credentialSetProxyInjectionSchema.optional()
|
|
428
|
+
});
|
|
429
|
+
const onCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
|
|
430
|
+
const credentialExposureSchema = z.enum([CREDENTIAL_EXPOSURES["user-runtime"], CREDENTIAL_EXPOSURES["platform-only"]]);
|
|
431
|
+
const connectionMetadataConfigSchema = z.object({
|
|
432
|
+
id: credentialSetIdString("Credential connection id").optional(),
|
|
433
|
+
label: optionalTrimmedNonEmptyString("Credential connection label"),
|
|
434
|
+
description: optionalDescriptionString("Credential connection description"),
|
|
435
|
+
recommended: z.boolean().optional(),
|
|
436
|
+
advanced: z.boolean().optional(),
|
|
437
|
+
needsRawSecret: z.boolean().optional()
|
|
438
|
+
});
|
|
439
|
+
const connectionMetadataManifestSchema = connectionMetadataConfigSchema;
|
|
440
|
+
const registeredDescriptorSchema = z.object({
|
|
441
|
+
id: trimmedNonEmptyString("Registered descriptor id"),
|
|
442
|
+
config: z.record(z.string(), z.unknown()).optional()
|
|
443
|
+
});
|
|
444
|
+
const registeredResolverDescriptorSchema = registeredDescriptorSchema.extend({ cacheMs: z.number().int().nonnegative().optional() });
|
|
445
|
+
const manualConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
446
|
+
kind: z.literal("manual"),
|
|
447
|
+
input: zodObjectSchema.optional(),
|
|
448
|
+
instructions: z.string().min(1).optional(),
|
|
449
|
+
validate: z.function().optional()
|
|
450
|
+
});
|
|
451
|
+
const manualConnectionFieldManifestSchema = z.object({
|
|
452
|
+
key: z.string().min(1),
|
|
453
|
+
label: z.string().min(1),
|
|
454
|
+
description: z.string().min(1).optional(),
|
|
455
|
+
optional: z.boolean(),
|
|
456
|
+
secret: z.literal(true)
|
|
457
|
+
});
|
|
458
|
+
const manualConnectionConfigManifestSchema = connectionMetadataManifestSchema.extend({
|
|
459
|
+
kind: z.literal("manual"),
|
|
460
|
+
input: jsonSchemaObject.optional(),
|
|
461
|
+
fields: z.array(manualConnectionFieldManifestSchema).optional(),
|
|
462
|
+
generated: z.boolean().optional(),
|
|
463
|
+
instructions: z.string().min(1).optional()
|
|
464
|
+
});
|
|
465
|
+
/** Declarative form of `Vault` — strings typed against the credential set's
|
|
466
|
+
* stored/auth schema keys at the {@link CredentialSetConfig} boundary; the Zod
|
|
467
|
+
* schema here enforces non-empty strings only. `CredentialSet` itself performs
|
|
468
|
+
* the schema-key membership check at construction time. */
|
|
469
|
+
const vaultMappingSchema = z.object({
|
|
470
|
+
accessToken: z.string().min(1),
|
|
471
|
+
refreshToken: z.string().min(1).optional(),
|
|
472
|
+
instanceUrl: z.string().min(1).optional(),
|
|
473
|
+
raw: z.record(z.string().min(1), z.string().min(1)).optional()
|
|
474
|
+
});
|
|
475
|
+
/** Function form of `Vault` — an object pairing the access-token vault key
|
|
476
|
+
* (`accessTokenKey`) with the `build` function that computes the full vault
|
|
477
|
+
* write map. The explicit key keeps the disconnect path's revocation read
|
|
478
|
+
* reliable even when `build` transforms the access token. */
|
|
479
|
+
const vaultMappingFnSchema = z.object({
|
|
480
|
+
accessTokenKey: z.string().min(1),
|
|
481
|
+
build: z.custom((val) => typeof val === "function", { message: "vault.build must be a function." })
|
|
482
|
+
});
|
|
483
|
+
/** Runtime shape of `Vault`. Accepts either the declarative mapping or the
|
|
484
|
+
* function-form object `{ accessTokenKey, build }`. */
|
|
485
|
+
const vaultConfigSchema = z.union([vaultMappingSchema, vaultMappingFnSchema], { error: "vault must be a declarative mapping object or a `{ accessTokenKey, build }` object." });
|
|
486
|
+
/** Manifest projection of `Vault` — declarative mappings serialize verbatim;
|
|
487
|
+
* function-form mappings serialize as `{ kind: 'function', accessTokenKey }`
|
|
488
|
+
* since closures are not manifest-safe but the access-token key is. */
|
|
489
|
+
const vaultManifestSchema = z.discriminatedUnion("kind", [z.object({
|
|
490
|
+
kind: z.literal("declarative"),
|
|
491
|
+
accessToken: z.string().min(1),
|
|
492
|
+
refreshToken: z.string().min(1).optional(),
|
|
493
|
+
instanceUrl: z.string().min(1).optional(),
|
|
494
|
+
raw: z.record(z.string().min(1), z.string().min(1)).optional()
|
|
495
|
+
}), z.object({
|
|
496
|
+
kind: z.literal("function"),
|
|
497
|
+
accessTokenKey: z.string().min(1)
|
|
498
|
+
})]);
|
|
499
|
+
const oauthConnectionConfigBaseSchema = z.object({
|
|
500
|
+
kind: z.literal("oauth"),
|
|
501
|
+
authUrl: z.string().url(),
|
|
502
|
+
tokenUrl: z.string().url(),
|
|
503
|
+
scopes: z.array(z.string()).readonly(),
|
|
504
|
+
revokeUrl: z.string().url().nullable().optional(),
|
|
505
|
+
tokenType: z.enum(["long-lived", "refreshable"]),
|
|
506
|
+
pkce: z.boolean().optional(),
|
|
507
|
+
/** Fallback token lifetime when the provider omits `expires_in`. Positive
|
|
508
|
+
* integer seconds. Shared between config + manifest schemas (both extend
|
|
509
|
+
* this base). */
|
|
510
|
+
defaultExpiresInSeconds: z.number().int().positive().optional()
|
|
511
|
+
});
|
|
512
|
+
const oauthConnectionConfigSchema = oauthConnectionConfigBaseSchema.extend({
|
|
513
|
+
...connectionMetadataConfigSchema.shape,
|
|
514
|
+
vault: vaultConfigSchema,
|
|
515
|
+
oauth: registeredDescriptorSchema.optional(),
|
|
516
|
+
buildAuthUrl: z.function().optional(),
|
|
517
|
+
exchangeCode: z.function().optional(),
|
|
518
|
+
refreshToken: z.function().optional(),
|
|
519
|
+
extractInstallationInfo: z.function().optional(),
|
|
520
|
+
validate: z.function().optional()
|
|
521
|
+
});
|
|
522
|
+
const oauthConnectionConfigManifestSchema = oauthConnectionConfigBaseSchema.extend({
|
|
523
|
+
...connectionMetadataManifestSchema.shape,
|
|
524
|
+
vault: vaultManifestSchema,
|
|
525
|
+
oauth: registeredDescriptorSchema.optional()
|
|
526
|
+
});
|
|
527
|
+
const credentialsExchangeConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
528
|
+
kind: z.literal("credentials-exchange"),
|
|
529
|
+
instructions: z.string().min(1).optional(),
|
|
530
|
+
input: zodObjectSchema
|
|
531
|
+
}).extend({
|
|
532
|
+
exchange: z.function(),
|
|
533
|
+
rotate: z.function().optional(),
|
|
534
|
+
validate: z.function().optional()
|
|
535
|
+
});
|
|
536
|
+
/** Manifest projection of `CredentialsExchangeConnectionConfig` — only the
|
|
537
|
+
* declarative `input` schema (rendered as JSON Schema) and `instructions`
|
|
538
|
+
* copy survive serialization. The three hooks (`exchange`, `rotate`,
|
|
539
|
+
* `validate`) are runtime closures and are stripped. */
|
|
540
|
+
const credentialsExchangeConnectionConfigManifestSchema = z.object({
|
|
541
|
+
kind: z.literal("credentials-exchange"),
|
|
542
|
+
...connectionMetadataManifestSchema.shape,
|
|
543
|
+
instructions: z.string().min(1).optional(),
|
|
544
|
+
input: jsonSchemaObject
|
|
545
|
+
});
|
|
546
|
+
const exchangeCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
547
|
+
kind: z.literal("exchange"),
|
|
548
|
+
input: zodObjectSchema,
|
|
549
|
+
exchange: registeredDescriptorSchema
|
|
550
|
+
});
|
|
551
|
+
const exchangeCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
|
|
552
|
+
kind: z.literal("exchange"),
|
|
553
|
+
input: jsonSchemaObject,
|
|
554
|
+
exchange: registeredDescriptorSchema
|
|
555
|
+
});
|
|
556
|
+
const dynamicCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
557
|
+
kind: z.literal("dynamic"),
|
|
558
|
+
input: zodObjectSchema.optional(),
|
|
559
|
+
resolver: registeredResolverDescriptorSchema
|
|
560
|
+
});
|
|
561
|
+
const dynamicCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
|
|
562
|
+
kind: z.literal("dynamic"),
|
|
563
|
+
input: jsonSchemaObject.optional(),
|
|
564
|
+
resolver: registeredResolverDescriptorSchema
|
|
565
|
+
});
|
|
566
|
+
const platformCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({ kind: z.literal("platform") });
|
|
567
|
+
const platformCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({ kind: z.literal("platform") });
|
|
568
|
+
const connectionConfigSchema = z.discriminatedUnion("kind", [
|
|
569
|
+
manualConnectionConfigSchema,
|
|
570
|
+
oauthConnectionConfigSchema,
|
|
571
|
+
credentialsExchangeConnectionConfigSchema,
|
|
572
|
+
exchangeCredentialConnectionConfigSchema,
|
|
573
|
+
dynamicCredentialConnectionConfigSchema,
|
|
574
|
+
platformCredentialConnectionConfigSchema
|
|
575
|
+
]);
|
|
576
|
+
/** Manifest projection of `ConnectionConfig` — declarative metadata only. */
|
|
577
|
+
const connectionConfigManifestSchema = z.discriminatedUnion("kind", [
|
|
578
|
+
manualConnectionConfigManifestSchema,
|
|
579
|
+
oauthConnectionConfigManifestSchema,
|
|
580
|
+
credentialsExchangeConnectionConfigManifestSchema,
|
|
581
|
+
exchangeCredentialConnectionManifestSchema,
|
|
582
|
+
dynamicCredentialConnectionManifestSchema,
|
|
583
|
+
platformCredentialConnectionManifestSchema
|
|
584
|
+
]);
|
|
585
|
+
const CredentialSetManifestSchema = z.object({
|
|
586
|
+
manifestVersion: z.literal(1),
|
|
587
|
+
type: z.literal("credentialSet"),
|
|
588
|
+
id: credentialSetIdString("Credential set id"),
|
|
589
|
+
name: trimmedNonEmptyString("Credential set name"),
|
|
590
|
+
description: optionalDescriptionString("Credential set description"),
|
|
591
|
+
auth: jsonSchemaObject,
|
|
592
|
+
exposure: credentialExposureSchema.optional(),
|
|
593
|
+
proxy: credentialSetProxyConfigSchema.optional(),
|
|
594
|
+
/** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
|
|
595
|
+
needsRawSecret: z.boolean().optional(),
|
|
596
|
+
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
597
|
+
onCredentialRevoked: onCredentialRevokedSchema.optional(),
|
|
598
|
+
connections: z.array(connectionConfigManifestSchema).optional()
|
|
599
|
+
});
|
|
600
|
+
z.object({
|
|
601
|
+
id: credentialSetIdString("Credential set id"),
|
|
602
|
+
name: optionalTrimmedNonEmptyString("Credential set name"),
|
|
603
|
+
description: optionalDescriptionString("Credential set description"),
|
|
604
|
+
auth: zodObjectSchema,
|
|
605
|
+
exposure: credentialExposureSchema.optional(),
|
|
606
|
+
proxy: credentialSetProxyConfigSchema.optional(),
|
|
607
|
+
/** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
|
|
608
|
+
needsRawSecret: z.boolean().optional(),
|
|
609
|
+
onCredentialRevoked: onCredentialRevokedSchema.optional(),
|
|
610
|
+
connections: z.array(connectionConfigSchema).readonly().optional()
|
|
611
|
+
});
|
|
612
|
+
//#endregion
|
|
613
|
+
//#region ../../packages/core/dist/chunks/schemas-Dehm2ijP.mjs
|
|
614
|
+
const SourceLocationSchema = z.object({
|
|
615
|
+
filePath: z.string().min(1),
|
|
616
|
+
absoluteFilePath: z.string().min(1).optional(),
|
|
617
|
+
line: z.number().int().positive(),
|
|
618
|
+
column: z.number().int().positive(),
|
|
619
|
+
position: z.number().int().nonnegative().optional(),
|
|
620
|
+
endLine: z.number().int().positive(),
|
|
621
|
+
endColumn: z.number().int().positive(),
|
|
622
|
+
endPosition: z.number().int().nonnegative().optional(),
|
|
623
|
+
synthetic: z.boolean().optional()
|
|
624
|
+
});
|
|
625
|
+
z.string().min(1);
|
|
626
|
+
const ImportSourceSchema = z.object({
|
|
627
|
+
kind: z.enum([
|
|
628
|
+
"local",
|
|
629
|
+
"module-import",
|
|
630
|
+
"namespace-import",
|
|
631
|
+
"dynamic"
|
|
632
|
+
]),
|
|
633
|
+
moduleSpecifier: z.string().min(1).optional(),
|
|
634
|
+
importName: z.string().min(1).optional(),
|
|
635
|
+
localName: z.string().min(1).optional(),
|
|
636
|
+
resolvedPath: z.string().min(1).optional()
|
|
637
|
+
});
|
|
638
|
+
const CallKindSchema = z.enum([
|
|
639
|
+
"workflow-step",
|
|
640
|
+
"agent",
|
|
641
|
+
"tool",
|
|
642
|
+
"hook",
|
|
643
|
+
"child-workflow",
|
|
644
|
+
"function-call",
|
|
645
|
+
"method-call",
|
|
646
|
+
"dynamic-call",
|
|
647
|
+
"parallel-call",
|
|
648
|
+
"process-exit",
|
|
649
|
+
"iife",
|
|
650
|
+
"expression"
|
|
651
|
+
]);
|
|
652
|
+
const CapturedVariableSourceKindSchema = z.enum([
|
|
653
|
+
"local-const",
|
|
654
|
+
"relative-import",
|
|
655
|
+
"package-import"
|
|
656
|
+
]);
|
|
657
|
+
const CapturedVariableValueTypeSchema = z.enum([
|
|
658
|
+
"string",
|
|
659
|
+
"number",
|
|
660
|
+
"boolean",
|
|
661
|
+
"object",
|
|
662
|
+
"array",
|
|
663
|
+
"function",
|
|
664
|
+
"unknown"
|
|
665
|
+
]);
|
|
666
|
+
z.object({
|
|
667
|
+
name: z.string().min(1),
|
|
668
|
+
value: z.union([
|
|
669
|
+
z.string(),
|
|
670
|
+
z.number(),
|
|
671
|
+
z.boolean()
|
|
672
|
+
]).optional(),
|
|
673
|
+
sourceText: z.string().optional(),
|
|
674
|
+
valueType: CapturedVariableValueTypeSchema,
|
|
675
|
+
resolvable: z.boolean(),
|
|
676
|
+
source: CapturedVariableSourceKindSchema,
|
|
677
|
+
importPath: z.string().optional(),
|
|
678
|
+
declaration: z.object({
|
|
679
|
+
filePath: z.string().min(1),
|
|
680
|
+
line: z.number().int().positive()
|
|
681
|
+
})
|
|
682
|
+
});
|
|
683
|
+
const IntegrationScopeSchema = z.enum([
|
|
684
|
+
"organization",
|
|
685
|
+
"project",
|
|
686
|
+
"user_provided_credential"
|
|
687
|
+
]);
|
|
688
|
+
const IntegrationCredentialRefSchema = z.discriminatedUnion("type", [z.object({
|
|
689
|
+
type: z.literal("id"),
|
|
690
|
+
id: z.string().startsWith("cset_")
|
|
691
|
+
}), z.object({
|
|
692
|
+
type: z.literal("name"),
|
|
693
|
+
name: z.string().trim().min(1)
|
|
694
|
+
})]);
|
|
695
|
+
function hasProjectOrOrganizationScope(scope) {
|
|
696
|
+
return scope === "organization" || scope === "project";
|
|
697
|
+
}
|
|
698
|
+
const CredentialRefTokenKeyNameSchema = z.string().regex(/^[A-Za-z0-9_]+$/, "Credential key must contain only letters, digits, and underscores (required for ref-token proxying)");
|
|
699
|
+
/** Shared enum for top-level credential-set `onCredentialRevoked` policy. */
|
|
700
|
+
const OnCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
|
|
701
|
+
/** A credential set after resolution in a built manifest. Contains definition id, scope, alias, and credential keys.*/
|
|
702
|
+
const ResolvedCredentialSetSchema = z.object({
|
|
703
|
+
resolvedId: z.string(),
|
|
704
|
+
scope: IntegrationScopeSchema.optional(),
|
|
705
|
+
alias: z.string().optional(),
|
|
706
|
+
credentialRef: IntegrationCredentialRefSchema.optional(),
|
|
707
|
+
/** Auth-shape keys expected post-resolve. */
|
|
708
|
+
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
709
|
+
/** Subset of `credentialKeys` that are optional in the auth shape. */
|
|
710
|
+
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
711
|
+
/** Auth-shaped vault keys required for vault reads and upload flows. */
|
|
712
|
+
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
713
|
+
/** Subset of auth-shaped vault keys that may be absent from the vault without
|
|
714
|
+
* failing resolution. Derived from the credential set's `auth` schema. */
|
|
715
|
+
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
716
|
+
proxy: credentialSetProxyConfigSchema.optional(),
|
|
717
|
+
/** When true, resolved values are passed raw (no ref-token proxy) for this set. */
|
|
718
|
+
needsRawSecret: z.boolean().optional(),
|
|
719
|
+
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
720
|
+
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
721
|
+
/** Persistence-layer schema fingerprint stamped at build time. The
|
|
722
|
+
* resolver's phase 2 compares this against the vault row's stored
|
|
723
|
+
* fingerprint and raises `CredentialSchemaMismatchError` on drift.
|
|
724
|
+
* Optional here so pre-fingerprint artifacts still parse; the
|
|
725
|
+
* workflow builder populates it for every authored credential set
|
|
726
|
+
* that has a resolvable fingerprint. */
|
|
727
|
+
schemaFingerprint: z.string().optional()
|
|
728
|
+
}).superRefine((value, ctx) => {
|
|
729
|
+
if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
|
|
730
|
+
code: z.ZodIssueCode.custom,
|
|
731
|
+
path: ["credentialRef"],
|
|
732
|
+
message: "credentialRef requires scope to be \"project\" or \"organization\""
|
|
733
|
+
});
|
|
734
|
+
});
|
|
735
|
+
z.object({
|
|
736
|
+
credentialSetId: z.string(),
|
|
737
|
+
/** Auth-shape keys expected post-resolve. */
|
|
738
|
+
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
739
|
+
/** Optional subset of the auth-shape keys. */
|
|
740
|
+
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
741
|
+
/** Stored-shape keys required for vault reads. */
|
|
742
|
+
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
743
|
+
/** Optional subset of the stored-shape keys. */
|
|
744
|
+
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
745
|
+
schemaFingerprint: z.string().optional(),
|
|
746
|
+
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
747
|
+
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
748
|
+
proxy: credentialSetProxyConfigSchema.optional(),
|
|
749
|
+
needsRawSecret: z.boolean().optional(),
|
|
750
|
+
requiredOAuthScopes: z.array(z.string()).optional()
|
|
751
|
+
});
|
|
752
|
+
const CredentialRequirementEntrySchema = z.object({
|
|
753
|
+
credentialSetId: z.string(),
|
|
754
|
+
scope: IntegrationScopeSchema.optional(),
|
|
755
|
+
alias: z.string().optional(),
|
|
756
|
+
credentialRef: IntegrationCredentialRefSchema.optional(),
|
|
757
|
+
/** Auth-shape keys expected post-resolve. */
|
|
758
|
+
credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
|
|
759
|
+
/** Optional subset of the auth-shape keys. */
|
|
760
|
+
optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
761
|
+
/** Auth-shaped vault keys required for vault reads. */
|
|
762
|
+
storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
763
|
+
/** Optional subset of the stored-shape keys. */
|
|
764
|
+
optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
|
|
765
|
+
schemaFingerprint: z.string().optional(),
|
|
766
|
+
proxy: credentialSetProxyConfigSchema.optional(),
|
|
767
|
+
needsRawSecret: z.boolean().optional(),
|
|
768
|
+
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
769
|
+
onCredentialRevoked: OnCredentialRevokedSchema.optional(),
|
|
770
|
+
requiredOAuthScopes: z.array(z.string()).optional()
|
|
771
|
+
}).superRefine((value, ctx) => {
|
|
772
|
+
if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
|
|
773
|
+
code: z.ZodIssueCode.custom,
|
|
774
|
+
path: ["credentialRef"],
|
|
775
|
+
message: "credentialRef requires scope to be \"project\" or \"organization\""
|
|
776
|
+
});
|
|
777
|
+
});
|
|
778
|
+
z.object({
|
|
779
|
+
required: z.array(z.string()),
|
|
780
|
+
byStep: z.record(z.string(), z.array(CredentialRequirementEntrySchema))
|
|
781
|
+
});
|
|
782
|
+
const TriggerCallbackNameSchema = z.enum([
|
|
783
|
+
"filter",
|
|
784
|
+
"idempotencyKey",
|
|
785
|
+
"verify",
|
|
786
|
+
"callback"
|
|
787
|
+
]);
|
|
788
|
+
const TriggerCredentialRequirementEntrySchema = CredentialRequirementEntrySchema;
|
|
789
|
+
const TriggerCredentialRequirementsSchema = z.object({
|
|
790
|
+
required: z.array(z.string()),
|
|
791
|
+
byCallback: z.partialRecord(TriggerCallbackNameSchema, z.array(TriggerCredentialRequirementEntrySchema))
|
|
792
|
+
});
|
|
793
|
+
const ExecutionIdentityPolicySchema = z.object({ subjectMode: z.enum(["never", "requiredWhenUserProvidedCredential"]) });
|
|
794
|
+
z.object({
|
|
795
|
+
nodeId: z.string().min(1),
|
|
796
|
+
stepName: z.string().min(1),
|
|
797
|
+
label: z.string().min(1),
|
|
798
|
+
callKind: CallKindSchema,
|
|
799
|
+
stepId: z.string().min(1).optional(),
|
|
800
|
+
source: SourceLocationSchema.optional(),
|
|
801
|
+
astKind: z.string().min(1).optional(),
|
|
802
|
+
importSource: ImportSourceSchema.optional(),
|
|
803
|
+
outputBinding: z.string().min(1).optional(),
|
|
804
|
+
scopeOverride: IntegrationScopeSchema.optional(),
|
|
805
|
+
description: z.string().optional(),
|
|
806
|
+
sourceCode: z.string().optional(),
|
|
807
|
+
exportName: z.string().optional(),
|
|
808
|
+
inputSchema: JsonSchemaSchema.optional(),
|
|
809
|
+
outputSchema: JsonSchemaSchema.optional(),
|
|
810
|
+
credentialSets: z.array(ResolvedCredentialSetSchema).optional()
|
|
811
|
+
});
|
|
812
|
+
const TriggerTypeSchema = z.enum([
|
|
813
|
+
"webhook",
|
|
814
|
+
"cron",
|
|
815
|
+
"polling"
|
|
816
|
+
]);
|
|
817
|
+
/**
|
|
818
|
+
* Persisted on `deployment_triggers.trigger_source`. Mirrors the
|
|
819
|
+
* `webhookTrigger({ source: { type } })` discriminator so the server
|
|
820
|
+
* can index-filter app-source rows during provider-webhook fanout.
|
|
821
|
+
*/
|
|
822
|
+
const TriggerSourceSchema = z.enum(["custom", "app"]);
|
|
823
|
+
const WebhookMethodSchema$1 = z.enum([
|
|
824
|
+
"GET",
|
|
825
|
+
"POST",
|
|
826
|
+
"PUT",
|
|
827
|
+
"PATCH"
|
|
828
|
+
]);
|
|
829
|
+
const TriggerCallbackBundleUploadSchema = z.object({
|
|
830
|
+
code: z.string(),
|
|
831
|
+
hash: z.string(),
|
|
832
|
+
size: z.number()
|
|
833
|
+
});
|
|
834
|
+
const TriggerCallbackExportsSchema = z.object({
|
|
835
|
+
verify: z.string().min(1).optional(),
|
|
836
|
+
filter: z.string().min(1).optional(),
|
|
837
|
+
idempotencyKey: z.string().min(1).optional(),
|
|
838
|
+
callback: z.string().min(1).optional()
|
|
839
|
+
});
|
|
840
|
+
const TransformCallbackExportsSchema = z.object({ transform: z.string().min(1).optional() });
|
|
841
|
+
z.object({
|
|
842
|
+
id: z.string(),
|
|
843
|
+
type: TriggerTypeSchema,
|
|
844
|
+
/**
|
|
845
|
+
* Source-of-truth discriminator for webhook triggers. `'custom'` means
|
|
846
|
+
* the trigger owns its own HTTP path; `'app'` means it is fanned out by
|
|
847
|
+
* a Keystroke-managed provider app. Undefined for non-webhook triggers.
|
|
848
|
+
*/
|
|
849
|
+
triggerSource: TriggerSourceSchema.optional(),
|
|
850
|
+
enabled: z.boolean(),
|
|
851
|
+
path: z.string().optional(),
|
|
852
|
+
method: WebhookMethodSchema$1.optional(),
|
|
853
|
+
schedule: z.string().optional(),
|
|
854
|
+
timezone: z.string().optional(),
|
|
855
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
856
|
+
requiredCredentials: TriggerCredentialRequirementsSchema.optional(),
|
|
857
|
+
storagePath: z.string().min(1).optional(),
|
|
858
|
+
callbackBundle: TriggerCallbackBundleUploadSchema.optional(),
|
|
859
|
+
callbackExports: TriggerCallbackExportsSchema.optional(),
|
|
860
|
+
transformCallbackBundle: TriggerCallbackBundleUploadSchema.optional(),
|
|
861
|
+
transformCallbackExports: TransformCallbackExportsSchema.optional()
|
|
862
|
+
});
|
|
863
|
+
const credentialSetInstanceSchema$1 = createStructuralSchema([
|
|
864
|
+
"id",
|
|
865
|
+
"auth",
|
|
866
|
+
"connections"
|
|
867
|
+
], "a CredentialSet instance");
|
|
868
|
+
const TriggerModeDefaultSchema = z.enum(["managed", "subscribable"]);
|
|
869
|
+
const TriggerCallbackPresenceSchema = z.object({
|
|
870
|
+
filter: z.boolean(),
|
|
871
|
+
idempotencyKey: z.boolean(),
|
|
872
|
+
poll: z.boolean().optional(),
|
|
873
|
+
transformAllowed: z.boolean(),
|
|
874
|
+
verify: z.boolean().optional()
|
|
875
|
+
});
|
|
876
|
+
const TriggerRuntimeDescriptorSchema = z.object({ callbacks: TriggerCallbackPresenceSchema });
|
|
877
|
+
z.object({
|
|
878
|
+
manifestVersion: z.literal(1),
|
|
879
|
+
type: z.literal("trigger"),
|
|
880
|
+
triggerType: TriggerTypeSchema,
|
|
881
|
+
name: trimmedNonEmptyString("Trigger name"),
|
|
882
|
+
description: descriptionString("Trigger description"),
|
|
883
|
+
enabled: z.boolean(),
|
|
884
|
+
modeDefault: TriggerModeDefaultSchema,
|
|
885
|
+
executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
|
|
886
|
+
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
887
|
+
runtime: TriggerRuntimeDescriptorSchema
|
|
888
|
+
});
|
|
889
|
+
const triggerBaseConfigSchema = z.object({
|
|
890
|
+
credentialSets: z.array(credentialSetInstanceSchema$1).optional(),
|
|
891
|
+
description: descriptionString("Trigger description"),
|
|
892
|
+
enabled: z.boolean().default(true),
|
|
893
|
+
executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
|
|
894
|
+
modeDefault: TriggerModeDefaultSchema.default("managed"),
|
|
895
|
+
name: trimmedNonEmptyString("Trigger name")
|
|
896
|
+
});
|
|
897
|
+
triggerBaseConfigSchema.extend({
|
|
898
|
+
input: anyZodSchemaSchema,
|
|
899
|
+
payload: z.custom((value) => {
|
|
900
|
+
return jsonValueSchema.safeParse(value).success;
|
|
901
|
+
}, "Expected a JSON-serializable payload"),
|
|
902
|
+
schedule: ScheduleSchema,
|
|
903
|
+
timezone: IANATimezoneSchema.optional()
|
|
904
|
+
});
|
|
905
|
+
const cronTriggerRuntimeSchema = TriggerRuntimeDescriptorSchema.extend({
|
|
906
|
+
input: jsonSchemaObject,
|
|
907
|
+
payloadMode: z.literal("static"),
|
|
908
|
+
schedule: z.string(),
|
|
909
|
+
timezone: z.string().optional()
|
|
910
|
+
});
|
|
911
|
+
const cronTriggerManifestSchema = z.object({
|
|
912
|
+
manifestVersion: z.literal(1),
|
|
913
|
+
type: z.literal("trigger"),
|
|
914
|
+
triggerType: z.literal("cron"),
|
|
915
|
+
name: trimmedNonEmptyString("Trigger name"),
|
|
916
|
+
description: descriptionString("Trigger description"),
|
|
917
|
+
enabled: z.boolean(),
|
|
918
|
+
modeDefault: z.enum(["managed", "subscribable"]),
|
|
919
|
+
executionIdentityPolicy: triggerBaseConfigSchema.shape.executionIdentityPolicy,
|
|
920
|
+
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
921
|
+
runtime: cronTriggerRuntimeSchema,
|
|
922
|
+
/** Static payload for cron triggers — the workflow input when this trigger fires */
|
|
923
|
+
payload: jsonValueSchema.optional()
|
|
924
|
+
});
|
|
925
|
+
z.object({
|
|
926
|
+
lastPolledAt: z.string().optional(),
|
|
927
|
+
lastResponse: z.unknown().optional()
|
|
928
|
+
});
|
|
929
|
+
triggerBaseConfigSchema.extend({
|
|
930
|
+
poll: z.function(),
|
|
931
|
+
filter: z.function().optional(),
|
|
932
|
+
idempotencyKey: z.function().optional(),
|
|
933
|
+
response: anyZodSchemaSchema,
|
|
934
|
+
schedule: ScheduleSchema
|
|
935
|
+
});
|
|
936
|
+
const pollingTriggerRuntimeSchema = TriggerRuntimeDescriptorSchema.extend({
|
|
937
|
+
response: jsonSchemaObject,
|
|
938
|
+
schedule: z.string(),
|
|
939
|
+
state: z.object({
|
|
940
|
+
lastPolledAt: z.literal(true),
|
|
941
|
+
lastResponse: z.literal(true)
|
|
942
|
+
})
|
|
943
|
+
});
|
|
944
|
+
const pollingTriggerManifestSchema = z.object({
|
|
945
|
+
manifestVersion: z.literal(1),
|
|
946
|
+
type: z.literal("trigger"),
|
|
947
|
+
triggerType: z.literal("polling"),
|
|
948
|
+
name: trimmedNonEmptyString("Trigger name"),
|
|
949
|
+
description: descriptionString("Trigger description"),
|
|
950
|
+
enabled: z.boolean(),
|
|
951
|
+
modeDefault: z.enum(["managed", "subscribable"]),
|
|
952
|
+
executionIdentityPolicy: triggerBaseConfigSchema.shape.executionIdentityPolicy,
|
|
953
|
+
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
954
|
+
runtime: pollingTriggerRuntimeSchema
|
|
955
|
+
});
|
|
956
|
+
const WebhookMethodSchema = z.enum([
|
|
957
|
+
"PATCH",
|
|
958
|
+
"POST",
|
|
959
|
+
"PUT"
|
|
960
|
+
]);
|
|
961
|
+
z.object({
|
|
962
|
+
method: z.string(),
|
|
963
|
+
path: z.string(),
|
|
964
|
+
query: z.record(z.string(), z.union([
|
|
965
|
+
z.string(),
|
|
966
|
+
z.array(z.string()),
|
|
967
|
+
z.undefined()
|
|
968
|
+
])),
|
|
969
|
+
headers: z.record(z.string(), z.string().optional()),
|
|
970
|
+
rawBody: z.string()
|
|
971
|
+
});
|
|
972
|
+
const WebhookResponseConfigSchema = z.object({
|
|
973
|
+
ignoredBody: jsonValueSchema.optional(),
|
|
974
|
+
ignoredStatus: z.number().int().positive().optional(),
|
|
975
|
+
successBody: jsonValueSchema.optional(),
|
|
976
|
+
successStatus: z.number().int().positive().optional()
|
|
977
|
+
});
|
|
978
|
+
/**
|
|
979
|
+
* Custom webhook trigger paths describe the suffix that a request URL has
|
|
980
|
+
* after the organization id. The router serves these triggers at
|
|
981
|
+
* `/api/v1/webhooks/{orgId}{path}` (e.g. `path: '/orders'` → request
|
|
982
|
+
* `/api/v1/webhooks/{orgId}/orders`). Authors must therefore supply only the
|
|
983
|
+
* trailing path segment, not the `/webhooks/` prefix that the route already
|
|
984
|
+
* provides.
|
|
985
|
+
*/
|
|
986
|
+
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\"." });
|
|
987
|
+
const credentialSetInstanceSchema = createStructuralSchema([
|
|
988
|
+
"id",
|
|
989
|
+
"auth",
|
|
990
|
+
"connections"
|
|
991
|
+
], "a CredentialSet instance");
|
|
992
|
+
const webhookCustomSourceConfigSchema = z.object({
|
|
993
|
+
type: z.literal("custom"),
|
|
994
|
+
method: WebhookMethodSchema,
|
|
995
|
+
path: webhookPathSchema,
|
|
996
|
+
verify: z.function().optional(),
|
|
997
|
+
response: WebhookResponseConfigSchema.optional(),
|
|
998
|
+
credentialSets: z.array(credentialSetInstanceSchema).optional()
|
|
999
|
+
});
|
|
1000
|
+
const webhookAppSourceConfigSchema = z.object({
|
|
1001
|
+
type: z.literal("app"),
|
|
1002
|
+
appRef: trimmedNonEmptyString("appRef")
|
|
1003
|
+
});
|
|
1004
|
+
const webhookSourceConfigSchema = z.discriminatedUnion("type", [webhookCustomSourceConfigSchema, webhookAppSourceConfigSchema]);
|
|
1005
|
+
const webhookCustomSourceManifestSchema = z.object({
|
|
1006
|
+
type: z.literal("custom"),
|
|
1007
|
+
method: WebhookMethodSchema,
|
|
1008
|
+
path: z.string().min(1).max(1024),
|
|
1009
|
+
response: WebhookResponseConfigSchema.optional()
|
|
1010
|
+
});
|
|
1011
|
+
const webhookAppSourceManifestSchema = z.object({
|
|
1012
|
+
type: z.literal("app"),
|
|
1013
|
+
appRef: trimmedNonEmptyString("appRef")
|
|
1014
|
+
});
|
|
1015
|
+
const WebhookSourceManifestSchema = z.discriminatedUnion("type", [webhookCustomSourceManifestSchema, webhookAppSourceManifestSchema]);
|
|
1016
|
+
triggerBaseConfigSchema.omit({ credentialSets: true }).extend({
|
|
1017
|
+
source: webhookSourceConfigSchema,
|
|
1018
|
+
payload: anyZodSchemaSchema.optional(),
|
|
1019
|
+
filter: z.function().optional(),
|
|
1020
|
+
idempotencyKey: z.function().optional()
|
|
1021
|
+
});
|
|
1022
|
+
const webhookTriggerRuntimeSchema = TriggerRuntimeDescriptorSchema.extend({
|
|
1023
|
+
source: WebhookSourceManifestSchema,
|
|
1024
|
+
payload: jsonSchemaObject
|
|
1025
|
+
});
|
|
1026
|
+
const webhookTriggerManifestSchema = z.object({
|
|
1027
|
+
manifestVersion: z.literal(1),
|
|
1028
|
+
type: z.literal("trigger"),
|
|
1029
|
+
triggerType: z.literal("webhook"),
|
|
1030
|
+
name: trimmedNonEmptyString("Trigger name"),
|
|
1031
|
+
description: descriptionString("Trigger description"),
|
|
1032
|
+
enabled: z.boolean(),
|
|
1033
|
+
modeDefault: z.enum(["managed", "subscribable"]),
|
|
1034
|
+
executionIdentityPolicy: triggerBaseConfigSchema.shape.executionIdentityPolicy,
|
|
1035
|
+
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
1036
|
+
runtime: webhookTriggerRuntimeSchema
|
|
1037
|
+
});
|
|
1038
|
+
z.unknown();
|
|
256
1039
|
//#endregion
|
|
257
|
-
//#region ../../packages/workflow-builder/dist/import-module
|
|
1040
|
+
//#region ../../packages/workflow-builder/dist/import-module--8x5SLum.mjs
|
|
258
1041
|
var DiscoveryError = class extends Error {
|
|
259
1042
|
code;
|
|
260
1043
|
filePath;
|