@keystrokehq/cli 0.0.11 → 0.0.13
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-DWuxmMuY.mjs → accept.handler-BU6kg8ET.mjs} +1 -1
- package/dist/{admin-BK4bFTTd.mjs → admin-B4GNbCl5.mjs} +9 -9
- package/dist/{agent-manifest-sJFbH5H8.mjs → agent-manifest-CZdlCTFs.mjs} +5 -5
- package/dist/{agents-DYnw2VPX.mjs → agents-LtoIcJGY.mjs} +6 -6
- package/dist/api-DuKKdCpF.mjs +246 -0
- package/dist/{api-keys-Dizx3YqE.mjs → api-keys-BE_hLonn.mjs} +5 -5
- package/dist/{auth-BqsKd4IA.mjs → auth-DNK5MYm4.mjs} +5 -5
- package/dist/{auth.handler-BsoWeCFD.mjs → auth.handler-DrjDODhZ.mjs} +1 -1
- package/dist/{build-agents-DfbiMZ_e-CgnKa9A6.mjs → build-agents-DseUtzd4-DIDGsZWL.mjs} +12 -13
- package/dist/{build-metadata-zidV9Cai-Bq37kBOM.mjs → build-metadata-qebrtraZ-D4SQNsBw.mjs} +19 -35
- package/dist/{build-progress-DigAP-BN.mjs → build-progress-CITED2tv.mjs} +1 -1
- package/dist/{build-tasks-O1jYtlv1-Bkw0w1r3.mjs → build-tasks-GVuMLS0h-DnS9QWzf.mjs} +4 -4
- package/dist/{build-workflows-3fdvdHHf-BDTy9QgT.mjs → build-workflows-Dmzay1vP-DKVuBAjD.mjs} +17 -18
- package/dist/{build.handler-B2UDhh72.mjs → build.handler-BZnLQt0_.mjs} +4 -4
- package/dist/{clear.handler-BR97yudD.mjs → clear.handler-B1c17nAi.mjs} +1 -1
- package/dist/{commander-DcftG6dX.mjs → commander-BwtBoukr.mjs} +2 -2
- package/dist/{common-B3bLe3Mk.mjs → common-BaGFkj3n.mjs} +2 -2
- package/dist/{connect-DQ4xIcyE.mjs → connect-IPcL37np.mjs} +12 -6
- package/dist/{connect.handler-CWSLgf87.mjs → connect.handler-ToY6qmMz.mjs} +74 -224
- package/dist/{context-1VgRbzr-.mjs → context-DQ4IA0yO.mjs} +1 -1
- package/dist/{create.handler-C2CkPWsy.mjs → create.handler-BAyG0PmG.mjs} +1 -1
- package/dist/credential-requirements-FtBk5JVB.mjs +250 -0
- package/dist/credentials-Bu1MBiCL.mjs +182 -0
- package/dist/{credentials-D8_AwH9o.mjs → credentials-CZiu-534.mjs} +12 -7
- package/dist/{current-deployment-workflow-B05z0EQa.mjs → current-deployment-workflow-zTmYbUjh.mjs} +5 -5
- package/dist/{current.handler-CuAtMZmm.mjs → current.handler-DA4FGfUP.mjs} +1 -1
- package/dist/{declared-credential-requirements-BtlcsEVn.mjs → declared-credential-requirements-B6h4WRv4.mjs} +5 -34
- package/dist/{delete.handler-DDY3X1Zm.mjs → delete.handler-CJcyvnUF.mjs} +1 -1
- package/dist/{deploy-B8TYutOi.mjs → deploy-BvaFgVvf.mjs} +1 -1
- package/dist/{deploy-Cn6FFnOM.mjs → deploy-DdMP-YaQ.mjs} +2 -2
- package/dist/{deploy-progress-XAfautnA.mjs → deploy-progress-CLO-yidq.mjs} +1 -1
- package/dist/{deploy.handler-D1DcAe-h.mjs → deploy.handler-Bag7rBG-.mjs} +16 -16
- package/dist/{detect-env-access-CwkOYeYM-D4o8gRZs.mjs → detect-env-access-CwkOYeYM-EmkYvbfJ.mjs} +1 -1
- package/dist/{diff.handler-BU6IewNG.mjs → diff.handler-Brgc-Ccl.mjs} +3 -3
- package/dist/{dist-DvO0q6Fo.mjs → dist-BMkNN03r.mjs} +16 -16
- package/dist/{env.handler-C6YAmHLi.mjs → env.handler-DFKzjIQT.mjs} +10 -7
- package/dist/{error-boundary-CpaVvFXk.mjs → error-boundary-B2ZKRkZI.mjs} +1 -1
- package/dist/{file-metadata-BvGM-B2v.mjs → file-metadata-Dwy9KKq_.mjs} +2 -2
- package/dist/{import-module-DDPnzlJ1-BIBSgOhK.mjs → import-module-DEI7R8Yh-Xz-KAPvB.mjs} +248 -246
- package/dist/{init-Da6_obl0.mjs → init-DhnABm3J.mjs} +2 -2
- package/dist/{init.handler-Cq2nk8DO.mjs → init.handler-QgehN8B4.mjs} +4 -4
- package/dist/{inspect.handler-D4YGryQB.mjs → inspect.handler-CMOFOb4G.mjs} +3 -3
- package/dist/{integration-catalog-DtNWaMvh.mjs → integration-catalog-BRrJIAVz.mjs} +5 -5
- package/dist/{integrations-CB_Ukq2g.mjs → integrations-7-U7nmkh.mjs} +7 -6
- package/dist/{invites-BOhuBtoq.mjs → invites-CmGmnUla.mjs} +4 -4
- package/dist/{invites.list.handler-C-Wv6E1g.mjs → invites.list.handler-CmkIf-uW.mjs} +1 -1
- package/dist/{invites.resend.handler-CI78XlQS.mjs → invites.resend.handler-FZl20yat.mjs} +1 -1
- package/dist/{invites.revoke.handler-DigAgNwB.mjs → invites.revoke.handler-D95mrfmB.mjs} +1 -1
- package/dist/keystroke.mjs +21 -21
- package/dist/{list-enrichment-Cxlq6BB9.mjs → list-enrichment-I4XQaMg0.mjs} +5 -1
- package/dist/{list.handler-OiLEylzS.mjs → list.handler-BrTW2viq.mjs} +1 -1
- package/dist/{list.handler-CsODcH6e.mjs → list.handler-Cp767f5l.mjs} +1 -1
- package/dist/{list.handler-BsyGhXns.mjs → list.handler-DRnHsEa0.mjs} +1 -1
- package/dist/{list.handler-B6IByHHB.mjs → list.handler-DXl8igi2.mjs} +13 -5
- package/dist/{list.handler-BpVNYShU.mjs → list.handler-DsYyTUhA.mjs} +1 -1
- package/dist/{list.handler--a1JEGSD.mjs → list.handler-H8aQSsFM.mjs} +3 -3
- package/dist/{list.handler-Dr9Ti-dt.mjs → list.handler-uzC77oIy.mjs} +3 -3
- package/dist/{listen-DUPk6cZC.mjs → listen-DckJq0y0.mjs} +2 -2
- package/dist/{listen.handler-B5WimrfF.mjs → listen.handler-Bf5MXKPO.mjs} +2 -2
- package/dist/{logs-C5_4lh3p.mjs → logs-D_l5BIn2.mjs} +3 -3
- package/dist/{logs.handler-CBHPwDuC.mjs → logs.handler-kYO3Uv9t.mjs} +2 -2
- package/dist/{members.add.handler-LcQJYBsu.mjs → members.add.handler-C2cppd-9.mjs} +1 -1
- package/dist/{members.invite.handler-p279O2aC.mjs → members.invite.handler-DY6kS4LN.mjs} +1 -1
- package/dist/{members.list.handler-Cjukjuot.mjs → members.list.handler-CFBG3SBw.mjs} +1 -1
- package/dist/{members.remove.handler-CzxPiQFv.mjs → members.remove.handler-LQ61_qip.mjs} +1 -1
- package/dist/{members.update.handler-CX5q86e3.mjs → members.update.handler-CqISA1mf.mjs} +1 -1
- package/dist/{normalize-path-CojS-CgQ-D_WTiHKw.mjs → normalize-path-CojS-CgQ-D5D0AIHR.mjs} +1 -1
- package/dist/{org-CnlKW-Hl.mjs → org-KQ2nD0yN.mjs} +15 -15
- package/dist/{orgs.create.handler-DRILhxdn.mjs → orgs.create.handler-Mv5CTGcG.mjs} +1 -1
- package/dist/{orgs.get.handler-Cue6stoX.mjs → orgs.get.handler-DvvOhshX.mjs} +1 -1
- package/dist/{orgs.list.handler-fuDLNI5X.mjs → orgs.list.handler-wWAg6cKg.mjs} +1 -1
- package/dist/{paused.handler-CuOVH4DZ.mjs → paused.handler-CbMkPD9e.mjs} +1 -1
- package/dist/{project-config-D9eFU8Jk.mjs → project-config-CJGSh2RQ.mjs} +4 -7
- package/dist/{projects-DN7dX6nN.mjs → projects-CWLOF5x4.mjs} +656 -3
- package/dist/{projects-DdgHbUpR.mjs → projects-CYqeKQGT.mjs} +4 -4
- package/dist/{requirements.handler-CX13XiXT.mjs → requirements.handler-CnDTBcH5.mjs} +5 -5
- package/dist/{resolve-project-C6UAOfAG.mjs → resolve-project-bVPMcs-y.mjs} +1 -1
- package/dist/{run-polling-1CTIeDea.mjs → run-polling-49w3PYAv.mjs} +3 -3
- package/dist/{run.handler-BxLH75WW.mjs → run.handler-Bma88649.mjs} +5 -5
- package/dist/{runs-lfE7r6i2.mjs → runs-HJejvQnQ.mjs} +2 -2
- package/dist/{schema-BgGlAs8a.mjs → schema-DFJiNWyd.mjs} +2 -1
- package/dist/schemas-DodkHgnS.mjs +280 -0
- package/dist/{skills-sync.handler-CntKndFm.mjs → skills-sync.handler-Cf74vKJA.mjs} +1 -1
- package/dist/{skills.command-X5zZwz2d.mjs → skills.command-KyAwBeST.mjs} +3 -3
- package/dist/{source-analysis-CHkWMC40.mjs → source-analysis-CJPymdaA.mjs} +1 -1
- package/dist/{source-analysis-DEEChuND-Csu0oOlw.mjs → source-analysis-DTnwNwKq-DoBxUDCg.mjs} +5 -5
- package/dist/{src--fCtOxNX.mjs → src-D-dFmoAF.mjs} +1 -1
- package/dist/{switch.handler-RaeKZ3ZB.mjs → switch.handler-DfsKVtR6.mjs} +1 -1
- package/dist/{sync-C89mJp7Y.mjs → sync-Bi2M_TUK.mjs} +2 -2
- package/dist/{sync.handler-BoAHHUQs.mjs → sync.handler-D6YFuVlq.mjs} +6 -6
- package/dist/{schedule-BWAI6qLx.mjs → task-BBgEvdG1.mjs} +395 -25
- package/dist/{task-target-build-D5IrHqSl.mjs → task-target-build-atWwwnSF.mjs} +8 -8
- package/dist/task-target-deploy-CRsrQTOy.mjs +4 -0
- package/dist/{task-target-deploy-Bf5i3ox1-2K0hAwzk.mjs → task-target-deploy-CZBGNC0H-BwPSfaJQ.mjs} +2 -2
- package/dist/task-target-deploy-runner.mjs +5 -5
- package/dist/{test-gPQJRkqa.mjs → test-Ctjy8mwC.mjs} +32 -144
- package/dist/{test.handler-B5GF5txS.mjs → test.handler-St9sBXyH.mjs} +1 -1
- package/dist/{trigger-artifacts-B3OCTX9K-ME6IVdUB.mjs → trigger-artifacts-RizI57RC-C-yCtEi-.mjs} +9 -9
- package/dist/{trigger-manifest-B3Gq1739.mjs → trigger-manifest-D5rnpPkA.mjs} +1 -1
- package/dist/{try-deploy.handler-dA_YGWRq.mjs → try-deploy.handler-BMcWQVST.mjs} +9 -9
- package/dist/{upgrade-xByIxaYu.mjs → upgrade-YavAf8AC.mjs} +2 -2
- package/dist/{upload.handler-BFDM6n_6.mjs → upload.handler-DemogvI1.mjs} +129 -18
- package/dist/{users.get.handler-CzaYM2bi.mjs → users.get.handler-B20PMSbl.mjs} +1 -1
- package/dist/{users.list.handler-CpOWwzBb.mjs → users.list.handler-BplFTjv3.mjs} +1 -1
- package/dist/{users.set-role.handler-BjiSNP2d.mjs → users.set-role.handler-wdmI6o3G.mjs} +1 -1
- package/dist/{utils-C_qCshBA.mjs → utils-DpEtybzI.mjs} +2 -2
- package/dist/{validate.handler-BtDSKAFY.mjs → validate.handler-DSAvNgns.mjs} +3 -3
- package/dist/{workflow-build-Z2_jkOsZ.mjs → workflow-build-Cmu1TOFu.mjs} +32 -32
- package/dist/{workflow-manifest-BfL74mjp.mjs → workflow-build-manifest-OPFqFD6f.mjs} +26 -28
- package/dist/{workflow-bundler-BzHk73PM-tt09RbIA.mjs → workflow-bundler-BzHk73PM-UJQa7Ubk.mjs} +2 -2
- package/dist/{workflows-V09d2r2H.mjs → workflows-DTlypo2t.mjs} +26 -27
- package/dist/{writer-CtvttJdP-DZJ0mZCm.mjs → writer-CtvttJdP-BfNsrheU.mjs} +5 -5
- package/package.json +11 -9
- package/dist/constants-BUgIAu2a.mjs +0 -8
- package/dist/credential-requirements-BCW8aQWS.mjs +0 -480
- package/dist/credentials-DAQfKqn0.mjs +0 -152025
- package/dist/get-intrinsic-BjqiGgLt.mjs +0 -658
- package/dist/hosted-action-dispatcher-registry-BWEtn13o.mjs +0 -126
- package/dist/schema-B-Wgo4rJ.mjs +0 -81
- package/dist/schemas-9FmGqrPT.mjs +0 -42
- package/dist/task-1qz1XNq7.mjs +0 -96
- package/dist/task-target-deploy-Bzfftyru.mjs +0 -4
- /package/dist/{agent-bundle-package-DWV6B_5q-B-qzc3zC.mjs → agent-bundle-package-DWV6B_5q-cB76j6UL.mjs} +0 -0
- /package/dist/{browser-CvuyMLhI.mjs → browser-B4K0VW8p.mjs} +0 -0
- /package/dist/{clear-cache.handler-D-wboLB6.mjs → clear-cache.handler-Dywqc7TG.mjs} +0 -0
- /package/dist/{clear.handler-BC6pz0x-.mjs → clear.handler-ui4e1CnJ.mjs} +0 -0
- /package/dist/{concurrency-gXn9Rw8x-CnBnF2cg.mjs → concurrency-gXn9Rw8x-CaI6Vtbu.mjs} +0 -0
- /package/dist/{credential-env-map-C23GV6LN.mjs → credential-env-map-D0zgoUl0.mjs} +0 -0
- /package/dist/{credential-schema-mismatch-DM9Y91jL.mjs → credential-schema-mismatch-8pqwvswO.mjs} +0 -0
- /package/dist/{diff-utils-AATn2n56.mjs → diff-utils-BoXI705D.mjs} +0 -0
- /package/dist/{layout-CXkZEsXI.mjs → layout-DRf9qUf8.mjs} +0 -0
- /package/dist/{logs.handler-ClIIOeQB.mjs → logs.handler-DxSKmDCq.mjs} +0 -0
- /package/dist/{metadata-layout-C6ed-9dl-C6Bylr_z.mjs → metadata-layout-C6ed-9dl-EF5pCtIH.mjs} +0 -0
- /package/dist/{options-CIVqkc8V.mjs → options-DFPs-tAB.mjs} +0 -0
- /package/dist/{oxc-B3KI3rf_-ghZc3xZ5.mjs → oxc-B3KI3rf_-CHDUXsus.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-B0eiobOd.mjs → read-credential-keys-77a91T8M-CzXPGxdU.mjs} +0 -0
- /package/dist/{register.handler-CpP_KB2u.mjs → register.handler-D7ZZAnGP.mjs} +0 -0
- /package/dist/{rolldown-runtime-twds-ZHy-RuJszab7.mjs → rolldown-runtime-twds-ZHy-3DMm_Sby.mjs} +0 -0
- /package/dist/{run-polling-DDpkIvwy.mjs → run-polling-Cb4ssXIE.mjs} +0 -0
- /package/dist/{schema-display-DuWBmkwk.mjs → schema-display-CyCWSgfY.mjs} +0 -0
- /package/dist/{skills.handler-CofL4oKs.mjs → skills.handler-C_4VzVmc.mjs} +0 -0
- /package/dist/{spinner-progress-Bt8zXPOc.mjs → spinner-progress-CS1BEdNB.mjs} +0 -0
- /package/dist/{status.handler-6cuHa0R0.mjs → status.handler-Cm9aNUBn.mjs} +0 -0
- /package/dist/{sync-keystroke-agent-skills-D746f2W_.mjs → sync-keystroke-agent-skills-CX9fS5nQ.mjs} +0 -0
- /package/dist/{upgrade.handler-DhKeyCy5.mjs → upgrade.handler-C2eZ_tg3.mjs} +0 -0
- /package/dist/{upload-C1qFWMm0.mjs → upload-C0kaZu08.mjs} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { N as throwReportedCliExit, a as getProcessEnv, n as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
-
import { t as assertWorkflowProjectRoot } from "./project-config-
|
|
4
|
+
import { t as assertWorkflowProjectRoot } from "./project-config-CJGSh2RQ.mjs";
|
|
5
5
|
import { a as writeJsonError, i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
6
|
-
import { i as requireClient } from "./context-
|
|
7
|
-
import { a as readManifestsFromOutDir, t as collectCredentialFingerprintMapFromProjectDist } from "./dist-
|
|
8
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as renderCredentialSchemaMismatchText, r as writeCredentialSchemaMismatchJson, t as isCredentialSchemaMismatchErrorLike } from "./credential-schema-mismatch-
|
|
6
|
+
import { i as requireClient } from "./context-DQ4IA0yO.mjs";
|
|
7
|
+
import { a as readManifestsFromOutDir, t as collectCredentialFingerprintMapFromProjectDist } from "./dist-BMkNN03r.mjs";
|
|
8
|
+
import { t as requireWorkflowsDir } from "./resolve-project-bVPMcs-y.mjs";
|
|
9
|
+
import { t as getIntegrationCatalog } from "./integration-catalog-BRrJIAVz.mjs";
|
|
10
|
+
import { t as readCredentialEnvMap } from "./credential-env-map-D0zgoUl0.mjs";
|
|
11
|
+
import { a as verifyCredentialResolvable, i as validateManualCredentialWithHook, n as resolveCredentialValuesFromEnv, r as uploadCredential, t as groupCredentialRequirements } from "./credentials-Bu1MBiCL.mjs";
|
|
12
|
+
import { n as renderCredentialSchemaMismatchText, r as writeCredentialSchemaMismatchJson, t as isCredentialSchemaMismatchErrorLike } from "./credential-schema-mismatch-8pqwvswO.mjs";
|
|
13
13
|
import * as path$1 from "node:path";
|
|
14
14
|
import { confirm, isCancel } from "@clack/prompts";
|
|
15
15
|
//#region src/commands/credentials/upload/upload.handler.ts
|
|
@@ -23,12 +23,88 @@ function quoteCliArg(value) {
|
|
|
23
23
|
return /\s/.test(value) ? `"${value.replace(/"/g, "\\\"")}"` : value;
|
|
24
24
|
}
|
|
25
25
|
function getCredentialDisplayName(catalog, credentialSetId) {
|
|
26
|
-
const info = catalog.
|
|
26
|
+
const info = catalog.byCredentialDefinitionId.get(credentialSetId);
|
|
27
27
|
if (info?.role === "connection" && info.integrationPublicId) return info.integrationPublicId;
|
|
28
28
|
return credentialSetId;
|
|
29
29
|
}
|
|
30
|
+
function isUploadConnectionKind(kind) {
|
|
31
|
+
return kind === "manual" || kind === "credentials-exchange";
|
|
32
|
+
}
|
|
33
|
+
function toUploadConnectionSelection(connection) {
|
|
34
|
+
if (!isUploadConnectionKind(connection.kind)) return null;
|
|
35
|
+
return {
|
|
36
|
+
id: connection.id,
|
|
37
|
+
kind: connection.kind,
|
|
38
|
+
label: connection.label ?? connection.id,
|
|
39
|
+
...connection.instructions ? { instructions: connection.instructions } : {},
|
|
40
|
+
...connection.fields ? { fields: connection.fields } : {},
|
|
41
|
+
...connection.recommended === true ? { recommended: true } : {},
|
|
42
|
+
...connection.advanced === true ? { advanced: true } : {},
|
|
43
|
+
...connection.generated === true ? { generated: true } : {}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function formatUploadConnectionChoices(entry) {
|
|
47
|
+
const uploadConnections = entry.connections.map(toUploadConnectionSelection).filter((connection) => connection !== null);
|
|
48
|
+
if (uploadConnections.length === 0) return "No manual or credentials-exchange upload paths are available for this integration.";
|
|
49
|
+
return `Available upload connection IDs: ${uploadConnections.map((connection) => `${connection.id}${connection.recommended ? " (recommended)" : ""}`).join(", ")}.`;
|
|
50
|
+
}
|
|
51
|
+
function selectUploadConnection(params) {
|
|
52
|
+
const { entry, requestedCredentialConnectionId } = params;
|
|
53
|
+
if (requestedCredentialConnectionId) {
|
|
54
|
+
const selected = entry.connections.find((connection) => connection.id === requestedCredentialConnectionId);
|
|
55
|
+
if (!selected) throw new Error(`Credential connection "${requestedCredentialConnectionId}" is not defined for "${entry.publicId}". ${formatUploadConnectionChoices(entry)}`);
|
|
56
|
+
const uploadSelection = toUploadConnectionSelection(selected);
|
|
57
|
+
if (!uploadSelection) throw new Error(`Credential connection "${selected.id}" for "${entry.publicId}" is "${selected.kind}", not an uploadable manual or credentials-exchange path. ${formatUploadConnectionChoices(entry)}`);
|
|
58
|
+
return uploadSelection;
|
|
59
|
+
}
|
|
60
|
+
return entry.connections.map(toUploadConnectionSelection).find((connection) => connection?.recommended === true) ?? entry.connections.map(toUploadConnectionSelection).find((connection) => connection?.kind === "manual") ?? entry.connections.map(toUploadConnectionSelection).find((connection) => connection !== null) ?? null;
|
|
61
|
+
}
|
|
62
|
+
function getInputKeysFromJsonSchema(schema) {
|
|
63
|
+
if (!schema || typeof schema !== "object") return [];
|
|
64
|
+
const properties = schema.properties;
|
|
65
|
+
if (!properties || typeof properties !== "object" || Array.isArray(properties)) return [];
|
|
66
|
+
return Object.keys(properties);
|
|
67
|
+
}
|
|
68
|
+
function getFieldKey(field) {
|
|
69
|
+
const key = field.key;
|
|
70
|
+
return typeof key === "string" && key.length > 0 ? key : null;
|
|
71
|
+
}
|
|
72
|
+
function getConnectionInputKeys(entry, connection) {
|
|
73
|
+
if (!connection) return [...entry.credentialSet.storedKeys];
|
|
74
|
+
const manifestConnection = entry.connections.find((candidate) => candidate.id === connection.id);
|
|
75
|
+
const fieldKeys = connection.fields?.map(getFieldKey).filter((key) => key !== null);
|
|
76
|
+
if (fieldKeys && fieldKeys.length > 0) return fieldKeys;
|
|
77
|
+
const inputKeys = getInputKeysFromJsonSchema(manifestConnection?.input);
|
|
78
|
+
return inputKeys.length > 0 ? inputKeys : [...entry.credentialSet.storedKeys];
|
|
79
|
+
}
|
|
80
|
+
function connectionToJson(connection) {
|
|
81
|
+
if (!connection) return void 0;
|
|
82
|
+
return {
|
|
83
|
+
id: connection.id,
|
|
84
|
+
kind: connection.kind,
|
|
85
|
+
label: connection.label,
|
|
86
|
+
...connection.instructions ? { instructions: connection.instructions } : {},
|
|
87
|
+
...connection.fields ? { fields: connection.fields } : {},
|
|
88
|
+
...connection.recommended === true ? { recommended: true } : {},
|
|
89
|
+
...connection.advanced === true ? { advanced: true } : {},
|
|
90
|
+
...connection.generated === true ? { generated: true } : {}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function renderConnectionHints(connection) {
|
|
94
|
+
if (!connection) return;
|
|
95
|
+
ui.text(` connection: ${connection.label} (id: ${connection.id}, kind: ${connection.kind})`);
|
|
96
|
+
if (connection.instructions) ui.text(` instructions: ${connection.instructions}`);
|
|
97
|
+
if (connection.fields && connection.fields.length > 0) {
|
|
98
|
+
const labels = connection.fields.map((field) => {
|
|
99
|
+
const key = getFieldKey(field);
|
|
100
|
+
const label = typeof field.label === "string" ? field.label : key;
|
|
101
|
+
return key ? `${key}${label && label !== key ? ` (${label})` : ""}` : null;
|
|
102
|
+
}).filter((field) => field !== null);
|
|
103
|
+
if (labels.length > 0) ui.text(` fields: ${labels.join(", ")}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
30
106
|
function isCatalogCredentialSet(catalog, credentialSetId) {
|
|
31
|
-
return catalog.
|
|
107
|
+
return catalog.byCredentialDefinitionId.has(credentialSetId);
|
|
32
108
|
}
|
|
33
109
|
function buildMissingSchemaFingerprintMessage(params) {
|
|
34
110
|
return `Cannot upload non-official credential set "${params.credentialSetId}" because the CLI could not discover its schema fingerprint from local build artifacts. Run \`keystroke workflows build\` in "${params.projectRoot}" and retry. Use --path to point at the owning Keystroke project if needed.`;
|
|
@@ -68,7 +144,8 @@ function renderSkippedCredentials(skipped) {
|
|
|
68
144
|
if (skipped.length === 0) return;
|
|
69
145
|
ui.br();
|
|
70
146
|
ui.warn(`Skipped ${skipped.length} credential set(s) — env vars not found:`);
|
|
71
|
-
for (const item of skipped) ui.text(` - ${item.displayName} (
|
|
147
|
+
for (const item of skipped) if (item.reason) ui.text(` - ${item.displayName} (${item.reason})`);
|
|
148
|
+
else ui.text(` - ${item.displayName} (missing: ${(item.missingEnvVars ?? []).join(", ")})`);
|
|
72
149
|
}
|
|
73
150
|
function renderSummary(results) {
|
|
74
151
|
const created = results.filter((r) => r.action === "created").length;
|
|
@@ -164,7 +241,7 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
164
241
|
ui.error(`Missing env vars for ${credentialSetId}. Set: ${expectedEnvVars.join(", ")}`);
|
|
165
242
|
throwReportedCliExit(`Missing env vars for ${credentialSetId}. Set: ${expectedEnvVars.join(", ")}`);
|
|
166
243
|
}
|
|
167
|
-
const info = catalog.
|
|
244
|
+
const info = catalog.byCredentialDefinitionId.get(credentialSetId);
|
|
168
245
|
toUpload = [{
|
|
169
246
|
credentialSetId,
|
|
170
247
|
displayName: getCredentialDisplayName(catalog, credentialSetId),
|
|
@@ -172,7 +249,8 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
172
249
|
keys,
|
|
173
250
|
values,
|
|
174
251
|
...fingerprintByCredentialSetId.get(credentialSetId) ? { schemaFingerprint: fingerprintByCredentialSetId.get(credentialSetId) } : {},
|
|
175
|
-
...info?.connectionKind ? { connectionKind: info.connectionKind } : {}
|
|
252
|
+
...info?.connectionKind ? { connectionKind: info.connectionKind } : {},
|
|
253
|
+
...options.credentialConnectionId ? { credentialConnectionId: options.credentialConnectionId } : {}
|
|
176
254
|
}];
|
|
177
255
|
} else if (isExplicitIntegrationMode) {
|
|
178
256
|
const integrationId = options.integration?.trim().toLowerCase();
|
|
@@ -182,8 +260,17 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
182
260
|
throwReportedCliExit(integrationId ? `Official integration "${integrationId}" is not supported for direct upload.` : "--integration is required for official integration upload");
|
|
183
261
|
}
|
|
184
262
|
const publicId = entry.publicId;
|
|
185
|
-
const credentialSetId = entry.credentialSet.
|
|
186
|
-
const
|
|
263
|
+
const credentialSetId = entry.credentialSet.credentialDefinitionId;
|
|
264
|
+
const selectedConnection = selectUploadConnection({
|
|
265
|
+
entry,
|
|
266
|
+
requestedCredentialConnectionId: options.credentialConnectionId
|
|
267
|
+
});
|
|
268
|
+
if (!selectedConnection) {
|
|
269
|
+
ui.error(`Official integration "${publicId}" does not support credential upload.`);
|
|
270
|
+
ui.hint("Use `keystroke connect` for OAuth-only integrations.");
|
|
271
|
+
throwReportedCliExit(`Official integration "${publicId}" does not support credential upload.`);
|
|
272
|
+
}
|
|
273
|
+
const storedKeys = getConnectionInputKeys(entry, selectedConnection);
|
|
187
274
|
const authKeys = entry.credentialSet.authKeys;
|
|
188
275
|
const keyToEnv = envMap?.[credentialSetId];
|
|
189
276
|
const values = resolveCredentialValuesFromEnv(storedKeys, getProcessEnv(), keyToEnv);
|
|
@@ -199,7 +286,9 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
199
286
|
keys: [...storedKeys],
|
|
200
287
|
verifyKeys: [...authKeys],
|
|
201
288
|
values,
|
|
202
|
-
|
|
289
|
+
credentialConnectionId: selectedConnection.id,
|
|
290
|
+
connection: selectedConnection,
|
|
291
|
+
connectionKind: selectedConnection.kind
|
|
203
292
|
}];
|
|
204
293
|
} else {
|
|
205
294
|
const manifests = await readManifestsFromOutDir(projectRoot);
|
|
@@ -218,7 +307,20 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
218
307
|
const keyToEnv = envMap?.[group.credentialSetId];
|
|
219
308
|
const values = resolveCredentialValuesFromEnv(group.keys, env, keyToEnv);
|
|
220
309
|
if (values) {
|
|
221
|
-
const info = catalog.
|
|
310
|
+
const info = catalog.byCredentialDefinitionId.get(group.credentialSetId);
|
|
311
|
+
const catalogEntry = info?.role === "connection" && info.integrationPublicId ? catalog.lookupByPublicId(info.integrationPublicId) : void 0;
|
|
312
|
+
const selectedConnection = catalogEntry ? selectUploadConnection({
|
|
313
|
+
entry: catalogEntry,
|
|
314
|
+
requestedCredentialConnectionId: options.credentialConnectionId
|
|
315
|
+
}) : null;
|
|
316
|
+
if (catalogEntry && !selectedConnection) {
|
|
317
|
+
skipped.push({
|
|
318
|
+
credentialSetId: group.credentialSetId,
|
|
319
|
+
displayName: getCredentialDisplayName(catalog, group.credentialSetId),
|
|
320
|
+
reason: "no uploadable connection; use keystroke connect for OAuth-only integrations"
|
|
321
|
+
});
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
222
324
|
toUpload.push({
|
|
223
325
|
credentialSetId: group.credentialSetId,
|
|
224
326
|
displayName: getCredentialDisplayName(catalog, group.credentialSetId),
|
|
@@ -226,7 +328,9 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
226
328
|
keys: group.keys,
|
|
227
329
|
values,
|
|
228
330
|
...fingerprintByCredentialSetId.get(group.credentialSetId) ? { schemaFingerprint: fingerprintByCredentialSetId.get(group.credentialSetId) } : {},
|
|
229
|
-
...
|
|
331
|
+
...selectedConnection ? { credentialConnectionId: selectedConnection.id } : {},
|
|
332
|
+
...selectedConnection ? { connection: selectedConnection } : {},
|
|
333
|
+
...selectedConnection?.kind ? { connectionKind: selectedConnection.kind } : info?.connectionKind ? { connectionKind: info.connectionKind } : {}
|
|
230
334
|
});
|
|
231
335
|
} else {
|
|
232
336
|
const missingEnvVars = resolveExpectedEnvVarNames(group.credentialSetId, group.keys, envMap);
|
|
@@ -262,6 +366,8 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
262
366
|
items: toUpload.map((item) => ({
|
|
263
367
|
credentialSetId: item.credentialSetId,
|
|
264
368
|
displayName: item.displayName,
|
|
369
|
+
...item.credentialConnectionId ? { credentialConnectionId: item.credentialConnectionId } : {},
|
|
370
|
+
...item.connection ? { connection: connectionToJson(item.connection) } : {},
|
|
265
371
|
scope,
|
|
266
372
|
keys: item.keys,
|
|
267
373
|
envVars: Object.fromEntries(resolveEnvVarStatus(item.keys, item.credentialSetId, envMap, env).map((s) => [s.key, {
|
|
@@ -277,6 +383,7 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
277
383
|
for (const item of toUpload) {
|
|
278
384
|
const envDetails = resolveEnvVarStatus(item.keys, item.credentialSetId, envMap, env).map((s) => `${s.envVar} (${s.present ? "set" : "missing"})`).join(", ");
|
|
279
385
|
ui.text(` - ${item.displayName} (${item.keys.length} key(s)): ${envDetails}`);
|
|
386
|
+
renderConnectionHints(item.connection);
|
|
280
387
|
}
|
|
281
388
|
renderSkippedCredentials(skipped);
|
|
282
389
|
return;
|
|
@@ -289,6 +396,7 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
289
396
|
try {
|
|
290
397
|
const exchangeResponse = await client.credentials.exchange({
|
|
291
398
|
credentialSetId: item.credentialSetId,
|
|
399
|
+
...item.credentialConnectionId ? { credentialConnectionId: item.credentialConnectionId } : {},
|
|
292
400
|
input: item.values,
|
|
293
401
|
scope,
|
|
294
402
|
...projectId ? { projectId } : {},
|
|
@@ -307,6 +415,7 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
307
415
|
results.push({
|
|
308
416
|
requestedCredentialSetId: item.displayName,
|
|
309
417
|
uploadedCredentialSetId: exchangeResponse.credentialSetId,
|
|
418
|
+
credentialConnectionId: exchangeResponse.credentialConnectionId,
|
|
310
419
|
action: "created",
|
|
311
420
|
scope,
|
|
312
421
|
verified: true,
|
|
@@ -356,6 +465,7 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
356
465
|
organizationId,
|
|
357
466
|
projectId,
|
|
358
467
|
credentialSetId: item.credentialSetId,
|
|
468
|
+
...item.credentialConnectionId ? { credentialConnectionId: item.credentialConnectionId } : {},
|
|
359
469
|
name: credName,
|
|
360
470
|
values: item.values,
|
|
361
471
|
updateExisting: options.update,
|
|
@@ -383,6 +493,7 @@ async function handleCredentialsUpload(options, ctx) {
|
|
|
383
493
|
results.push({
|
|
384
494
|
requestedCredentialSetId: item.displayName,
|
|
385
495
|
uploadedCredentialSetId: result.credentialSetId,
|
|
496
|
+
...item.credentialConnectionId ? { credentialConnectionId: item.credentialConnectionId } : {},
|
|
386
497
|
action: result.action,
|
|
387
498
|
scope,
|
|
388
499
|
verified,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as ui } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { i as requireClient } from "./context-DQ4IA0yO.mjs";
|
|
6
6
|
import { n as isIamJsonMode, t as handleIamError } from "./iam-command-utils-ByLX0A-V.mjs";
|
|
7
7
|
//#region src/commands/admin/users.get.handler.ts
|
|
8
8
|
async function handleAdminUsersGet(options, ctx) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as ui } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { i as requireClient } from "./context-DQ4IA0yO.mjs";
|
|
6
6
|
import { n as isIamJsonMode, t as handleIamError } from "./iam-command-utils-ByLX0A-V.mjs";
|
|
7
7
|
import Table from "cli-table3";
|
|
8
8
|
//#region src/commands/admin/users.list.handler.ts
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { n as ui } from "./keystroke.mjs";
|
|
4
4
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
5
|
+
import { i as requireClient } from "./context-DQ4IA0yO.mjs";
|
|
6
6
|
import { n as isIamJsonMode, r as requireConfirmation, t as handleIamError } from "./iam-command-utils-ByLX0A-V.mjs";
|
|
7
7
|
//#region src/commands/admin/users.set-role.handler.ts
|
|
8
8
|
async function handleAdminUsersSetRole(options, ctx) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { i as readProjectConfig } from "./project-config-
|
|
4
|
-
import { h as resolveBuildOutputDir } from "./layout-
|
|
3
|
+
import { i as readProjectConfig } from "./project-config-CJGSh2RQ.mjs";
|
|
4
|
+
import { h as resolveBuildOutputDir } from "./layout-DRf9qUf8.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
//#region ../../packages/project-config/src/utils.ts
|
|
7
7
|
function resolveConfiguredBuildOutputDir(projectRoot, buildConfig) {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { N as throwReportedCliExit, n as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
4
|
import { d as trackProject } from "./dist-BF6r1hfv.mjs";
|
|
5
5
|
import { i as writeJson } from "./output-CGdYhH0p.mjs";
|
|
6
|
-
import { t as requireWorkflowsDir } from "./resolve-project-
|
|
7
|
-
import { s as build, t as WorkflowNotFoundError } from "./workflow-build-
|
|
8
|
-
import { t as createBuildProgress } from "./build-progress-
|
|
6
|
+
import { t as requireWorkflowsDir } from "./resolve-project-bVPMcs-y.mjs";
|
|
7
|
+
import { s as build, t as WorkflowNotFoundError } from "./workflow-build-Cmu1TOFu.mjs";
|
|
8
|
+
import { t as createBuildProgress } from "./build-progress-CITED2tv.mjs";
|
|
9
9
|
import { mkdtemp, rm } from "node:fs/promises";
|
|
10
10
|
import * as os from "node:os";
|
|
11
11
|
import * as path$1 from "node:path";
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
import { i as __toESM, n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
4
4
|
import { d as originalConsole, f as ANSI, n as ui, p as style, u as logger, x as toErrorMessage } from "./keystroke.mjs";
|
|
5
5
|
import { a as getKeystrokeTmpDir } from "./dist-BF6r1hfv.mjs";
|
|
6
|
-
import { t as assertWorkflowProjectRoot } from "./project-config-
|
|
7
|
-
import { a as FlowGraphSchema,
|
|
8
|
-
import { t as AgentVersionManifestSchema } from "./agent-manifest-
|
|
9
|
-
import { r as RelativeFilePathSchema } from "./file-metadata-
|
|
10
|
-
import { c as createArtifactOutputFiles, l as createMetadataOutputFile, o as METADATA_ROOT_DIR_NAME, p as getWorkflowArtifactPaths, t as BUILD_DIR_NAME } from "./layout-
|
|
11
|
-
import { t as resolveConfiguredBuildOutputDir } from "./utils-
|
|
12
|
-
import { a as readAgentSandboxPackage, r as AGENT_VM_TOOLS_RUNTIME_RELATIVE_PATH } from "./agent-bundle-package-DWV6B_5q-
|
|
13
|
-
import { a as prewarmFileContentCache, c as typedEntries, i as createFileContentCache, l as require_out, n as computeBuilderFingerprint, o as resetFileContentCache, r as computeWorkflowFingerprint, s as sha256String } from "./metadata-layout-C6ed-9dl-
|
|
14
|
-
import { a as getAgentArtifactPaths, c as hashWorkflowManifestForDisk, d as resolveOutputDir, i as createAgentOutputFiles, l as removeAgentArtifacts, n as BUILD_CACHE_FILE_NAME, o as hashAgentManifestForDisk, r as allOutputFilesExist, s as hashWorkflowFlowForDisk, t as AGENT_ARTIFACT_DIR_PREFIX, u as removeWorkflowArtifacts } from "./writer-CtvttJdP-
|
|
15
|
-
import { a as createDiscoveryFailure, c as createNamespaceStarExportDiscoveryError, d as isWorkflowLoadResult, f as loadWorkflowMetadataBatch, i as createAmbiguousExportDiscoveryError, l as isAgentLoadResult, o as createDuplicateWorkflowIdFailure, t as DuplicateWorkflowIdError, u as isTaskLoadResult } from "./import-module-
|
|
16
|
-
import { a as literalString, n as identifierName, o as parseSourceFile, r as isNode } from "./oxc-B3KI3rf_-
|
|
17
|
-
import { a as getLocalModuleSpecifier, c as removeAllMetadataArtifacts, d as resolveDefaultExportAssignment, f as resolveLocalModulePath, i as collectWorkflowImportNames, n as DISCOVERY_IGNORE, o as getVariableDeclarators, r as collectLocalWorkflowBindings, s as isExportedVariableStatement, t as DISCOVERY_GLOB, u as removeMetadataArtifacts } from "./source-analysis-
|
|
18
|
-
import { n as parseRelativeFilePath } from "./normalize-path-CojS-CgQ-
|
|
6
|
+
import { t as assertWorkflowProjectRoot } from "./project-config-CJGSh2RQ.mjs";
|
|
7
|
+
import { a as FlowGraphSchema, r as WorkflowBuildManifestSchema } from "./workflow-build-manifest-OPFqFD6f.mjs";
|
|
8
|
+
import { t as AgentVersionManifestSchema } from "./agent-manifest-CZdlCTFs.mjs";
|
|
9
|
+
import { r as RelativeFilePathSchema } from "./file-metadata-Dwy9KKq_.mjs";
|
|
10
|
+
import { c as createArtifactOutputFiles, l as createMetadataOutputFile, o as METADATA_ROOT_DIR_NAME, p as getWorkflowArtifactPaths, t as BUILD_DIR_NAME } from "./layout-DRf9qUf8.mjs";
|
|
11
|
+
import { t as resolveConfiguredBuildOutputDir } from "./utils-DpEtybzI.mjs";
|
|
12
|
+
import { a as readAgentSandboxPackage, r as AGENT_VM_TOOLS_RUNTIME_RELATIVE_PATH } from "./agent-bundle-package-DWV6B_5q-cB76j6UL.mjs";
|
|
13
|
+
import { a as prewarmFileContentCache, c as typedEntries, i as createFileContentCache, l as require_out, n as computeBuilderFingerprint, o as resetFileContentCache, r as computeWorkflowFingerprint, s as sha256String } from "./metadata-layout-C6ed-9dl-EF5pCtIH.mjs";
|
|
14
|
+
import { a as getAgentArtifactPaths, c as hashWorkflowManifestForDisk, d as resolveOutputDir, i as createAgentOutputFiles, l as removeAgentArtifacts, n as BUILD_CACHE_FILE_NAME, o as hashAgentManifestForDisk, r as allOutputFilesExist, s as hashWorkflowFlowForDisk, t as AGENT_ARTIFACT_DIR_PREFIX, u as removeWorkflowArtifacts } from "./writer-CtvttJdP-BfNsrheU.mjs";
|
|
15
|
+
import { a as createDiscoveryFailure, c as createNamespaceStarExportDiscoveryError, d as isWorkflowLoadResult, f as loadWorkflowMetadataBatch, i as createAmbiguousExportDiscoveryError, l as isAgentLoadResult, o as createDuplicateWorkflowIdFailure, t as DuplicateWorkflowIdError, u as isTaskLoadResult } from "./import-module-DEI7R8Yh-Xz-KAPvB.mjs";
|
|
16
|
+
import { a as literalString, n as identifierName, o as parseSourceFile, r as isNode } from "./oxc-B3KI3rf_-CHDUXsus.mjs";
|
|
17
|
+
import { a as getLocalModuleSpecifier, c as removeAllMetadataArtifacts, d as resolveDefaultExportAssignment, f as resolveLocalModulePath, i as collectWorkflowImportNames, n as DISCOVERY_IGNORE, o as getVariableDeclarators, r as collectLocalWorkflowBindings, s as isExportedVariableStatement, t as DISCOVERY_GLOB, u as removeMetadataArtifacts } from "./source-analysis-DTnwNwKq-DoBxUDCg.mjs";
|
|
18
|
+
import { n as parseRelativeFilePath } from "./normalize-path-CojS-CgQ-D5D0AIHR.mjs";
|
|
19
19
|
import * as fs from "node:fs/promises";
|
|
20
20
|
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
21
21
|
import * as path$1 from "node:path";
|
|
@@ -24,8 +24,7 @@ import { fileURLToPath } from "node:url";
|
|
|
24
24
|
import { z } from "zod";
|
|
25
25
|
import { createHash } from "node:crypto";
|
|
26
26
|
import { performance } from "node:perf_hooks";
|
|
27
|
-
//#region ../../packages/
|
|
28
|
-
var import_out = /* @__PURE__ */ __toESM(require_out(), 1);
|
|
27
|
+
//#region ../../packages/workflow-builder/dist/pipeline/flow-graph-toolkit.mjs
|
|
29
28
|
function detectAgentInPathCycles(input) {
|
|
30
29
|
const nodes = /* @__PURE__ */ new Map();
|
|
31
30
|
const edges = /* @__PURE__ */ new Map();
|
|
@@ -71,7 +70,8 @@ function toCycleNode(node) {
|
|
|
71
70
|
};
|
|
72
71
|
}
|
|
73
72
|
//#endregion
|
|
74
|
-
//#region ../../packages/workflow-builder/dist/build-
|
|
73
|
+
//#region ../../packages/workflow-builder/dist/build-D3_BXR_1.mjs
|
|
74
|
+
var import_out = /* @__PURE__ */ __toESM(require_out(), 1);
|
|
75
75
|
const DiscoveredWorkflowSchema = z.object({
|
|
76
76
|
exportFilePath: z.string(),
|
|
77
77
|
resolvedFilePath: z.string(),
|
|
@@ -177,7 +177,7 @@ async function loadCachedArtifact(outputDir, discoveredWorkflow, cachedEntry) {
|
|
|
177
177
|
]);
|
|
178
178
|
if (sha256String(manifestText) !== cachedEntry.manifestHash) return null;
|
|
179
179
|
if (sha256String(flowText) !== cachedEntry.flowGraphHash) return null;
|
|
180
|
-
const manifest =
|
|
180
|
+
const manifest = WorkflowBuildManifestSchema.parse(JSON.parse(manifestText));
|
|
181
181
|
const flowGraph = FlowGraphSchema.parse(JSON.parse(flowText));
|
|
182
182
|
if (manifest.id !== cachedEntry.workflowId) return null;
|
|
183
183
|
if (path.basename(artifactPaths.workflowDir) !== manifest.id) return null;
|
|
@@ -909,25 +909,25 @@ function assertUniqueAgentIds(artifacts) {
|
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
var DuplicateCredentialSetIdError = class extends Error {
|
|
912
|
-
|
|
912
|
+
credentialDefinitionId;
|
|
913
913
|
files;
|
|
914
914
|
constructor(options) {
|
|
915
|
-
super(`Duplicate credential
|
|
915
|
+
super(`Duplicate credential definition id "${options.credentialDefinitionId}" found in ${options.files.join(" and ")}`);
|
|
916
916
|
this.name = "DuplicateCredentialSetIdError";
|
|
917
|
-
this.
|
|
917
|
+
this.credentialDefinitionId = options.credentialDefinitionId;
|
|
918
918
|
this.files = [...options.files];
|
|
919
919
|
}
|
|
920
920
|
};
|
|
921
|
-
function
|
|
921
|
+
function assertUniqueCredentialSetDefinitionIds(analyzedFiles) {
|
|
922
922
|
const seen = /* @__PURE__ */ new Map();
|
|
923
923
|
for (const analyzedFile of analyzedFiles) for (const credentialSet of analyzedFile.definitions.credentialSets) {
|
|
924
|
-
if (!credentialSet.
|
|
925
|
-
const existing = seen.get(credentialSet.
|
|
924
|
+
if (!credentialSet.credentialDefinitionId) continue;
|
|
925
|
+
const existing = seen.get(credentialSet.credentialDefinitionId);
|
|
926
926
|
if (existing && existing !== analyzedFile.filePath) throw new DuplicateCredentialSetIdError({
|
|
927
|
-
|
|
927
|
+
credentialDefinitionId: credentialSet.credentialDefinitionId,
|
|
928
928
|
files: [existing, analyzedFile.filePath]
|
|
929
929
|
});
|
|
930
|
-
seen.set(credentialSet.
|
|
930
|
+
seen.set(credentialSet.credentialDefinitionId, analyzedFile.filePath);
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
function assertNotReservedWorkflowId(artifact) {
|
|
@@ -978,7 +978,7 @@ async function buildDiscoveredWorkflows(options) {
|
|
|
978
978
|
const failures = [...buildPlan.failures];
|
|
979
979
|
const warnings = [];
|
|
980
980
|
if (buildPlan.workflows.length > 0) {
|
|
981
|
-
const { buildWorkflowArtifacts } = await import("./build-workflows-
|
|
981
|
+
const { buildWorkflowArtifacts } = await import("./build-workflows-Dmzay1vP-DKVuBAjD.mjs");
|
|
982
982
|
const result = await buildWorkflowArtifacts({
|
|
983
983
|
entries: buildPlan.workflows,
|
|
984
984
|
workflowsByKey,
|
|
@@ -993,7 +993,7 @@ async function buildDiscoveredWorkflows(options) {
|
|
|
993
993
|
warnings.push(...result.warnings);
|
|
994
994
|
}
|
|
995
995
|
if (buildPlan.agents.length > 0) {
|
|
996
|
-
const { buildAgentArtifacts } = await import("./build-agents-
|
|
996
|
+
const { buildAgentArtifacts } = await import("./build-agents-DseUtzd4-DIDGsZWL.mjs");
|
|
997
997
|
const result = await buildAgentArtifacts({
|
|
998
998
|
entries: buildPlan.agents,
|
|
999
999
|
projectRoot: options.projectRoot
|
|
@@ -1002,7 +1002,7 @@ async function buildDiscoveredWorkflows(options) {
|
|
|
1002
1002
|
failures.push(...result.failures);
|
|
1003
1003
|
}
|
|
1004
1004
|
if (buildPlan.tasks.length > 0) {
|
|
1005
|
-
const { buildTaskArtifacts } = await import("./build-tasks-
|
|
1005
|
+
const { buildTaskArtifacts } = await import("./build-tasks-GVuMLS0h-DnS9QWzf.mjs");
|
|
1006
1006
|
const result = await buildTaskArtifacts({
|
|
1007
1007
|
entries: buildPlan.tasks,
|
|
1008
1008
|
projectRoot: options.projectRoot,
|
|
@@ -1110,7 +1110,7 @@ async function createBuildPlan(options) {
|
|
|
1110
1110
|
const currentWorkflowIndex = workflowProgressIndex;
|
|
1111
1111
|
workflowProgressIndex += 1;
|
|
1112
1112
|
if (!loadResult?.ok) {
|
|
1113
|
-
const { createWorkflowMetadataFailure } = await import("./build-workflows-
|
|
1113
|
+
const { createWorkflowMetadataFailure } = await import("./build-workflows-Dmzay1vP-DKVuBAjD.mjs");
|
|
1114
1114
|
plan.failures.push(createWorkflowMetadataFailure(discoveredWorkflow, loadResult?.error));
|
|
1115
1115
|
continue;
|
|
1116
1116
|
}
|
|
@@ -1308,7 +1308,7 @@ async function runBuild(config, initialTargetBindingKeys, metadataRebuildDecisio
|
|
|
1308
1308
|
cacheResolvedBindingKeys,
|
|
1309
1309
|
releaseBundleMemory: config.releaseBundleMemory
|
|
1310
1310
|
};
|
|
1311
|
-
const { writeBuildOutput, writeTargetedBuildOutput } = await import("./writer-CtvttJdP-
|
|
1311
|
+
const { writeBuildOutput, writeTargetedBuildOutput } = await import("./writer-CtvttJdP-BfNsrheU.mjs").then((n) => n.f).then((n) => n.t);
|
|
1312
1312
|
const writeResult = targetBindingKeys ? await writeTargetedBuildOutput({
|
|
1313
1313
|
artifacts: finalizedScopedArtifacts,
|
|
1314
1314
|
agentArtifacts,
|
|
@@ -1333,7 +1333,7 @@ async function runBuild(config, initialTargetBindingKeys, metadataRebuildDecisio
|
|
|
1333
1333
|
elapsedMs: performance.now() - writeStartedAt,
|
|
1334
1334
|
...writeResult.skippedWriteCount !== void 0 && writeResult.skippedWriteCount > 0 ? { skippedWriteCount: writeResult.skippedWriteCount } : {}
|
|
1335
1335
|
});
|
|
1336
|
-
const { buildMetadataArtifacts } = await import("./build-metadata-
|
|
1336
|
+
const { buildMetadataArtifacts } = await import("./build-metadata-qebrtraZ-D4SQNsBw.mjs");
|
|
1337
1337
|
const metadata = await buildMetadataArtifacts({
|
|
1338
1338
|
projectRoot: config.projectRoot,
|
|
1339
1339
|
outputDir,
|
|
@@ -1362,7 +1362,7 @@ async function runBuild(config, initialTargetBindingKeys, metadataRebuildDecisio
|
|
|
1362
1362
|
errors: conventionErrors
|
|
1363
1363
|
});
|
|
1364
1364
|
try {
|
|
1365
|
-
|
|
1365
|
+
assertUniqueCredentialSetDefinitionIds(metadata.analyzedFacts);
|
|
1366
1366
|
} catch (error) {
|
|
1367
1367
|
if (error instanceof Error) failures.push({
|
|
1368
1368
|
kind: "convention",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
6
|
-
import { t as DurationSchema } from "./schedule-BWAI6qLx.mjs";
|
|
3
|
+
import { n as SHA256HashSchema, t as JsonSchemaSchema } from "./common-BaGFkj3n.mjs";
|
|
4
|
+
import { a as SourceLocationSchema, i as ImportSourceSchema, n as CallsiteFingerprintSchema, t as CallKindSchema } from "./source-analysis-CJPymdaA.mjs";
|
|
5
|
+
import { c as TriggerUploadDataSchema, i as ResolvedCredentialSetSchema, r as IntegrationScopeSchema, t as CredentialRequirementsSchema, u as WorkflowStepEntrySchema } from "./credential-requirements-FtBk5JVB.mjs";
|
|
7
6
|
import { z } from "zod";
|
|
8
|
-
//#region ../../packages/
|
|
7
|
+
//#region ../../packages/workflow-build-contracts/src/flow-graph-schema.ts
|
|
9
8
|
const DecisionKindSchema = z.enum([
|
|
10
9
|
"if",
|
|
11
10
|
"switch",
|
|
@@ -171,11 +170,10 @@ const FlowGraphSchema = z.object({
|
|
|
171
170
|
diagnostics: z.array(z.string())
|
|
172
171
|
});
|
|
173
172
|
//#endregion
|
|
174
|
-
//#region ../../packages/
|
|
173
|
+
//#region ../../packages/workflow-build-contracts/src/workflow-build-manifest.ts
|
|
175
174
|
const WORKFLOW_MANIFEST_GENERATOR = "local-build";
|
|
176
175
|
const WORKFLOW_MANIFEST_SCHEMA_VERSION = "1.0.0";
|
|
177
|
-
|
|
178
|
-
const WorkflowIdentitySchema = z.object({
|
|
176
|
+
z.object({
|
|
179
177
|
name: z.string().trim().min(1).max(255),
|
|
180
178
|
description: z.string().trim().min(1).optional(),
|
|
181
179
|
tags: z.array(z.string()).optional()
|
|
@@ -202,40 +200,40 @@ const BuildInfoSchema = z.object({
|
|
|
202
200
|
sourceChecksum: z.string().length(64),
|
|
203
201
|
generatedFiles: z.array(z.string().min(1))
|
|
204
202
|
});
|
|
205
|
-
|
|
203
|
+
const ManifestDependenciesSchema = z.object({
|
|
204
|
+
localFiles: z.record(z.string(), z.string()),
|
|
205
|
+
packages: z.record(z.string(), z.string()),
|
|
206
|
+
workspacePackages: z.record(z.string(), z.string()),
|
|
207
|
+
builtins: z.array(z.string())
|
|
208
|
+
});
|
|
209
|
+
const DurationSchema = z.union([z.number().int().positive().finite(), z.string().regex(/^[1-9]\d*[smhdwy]$/)]);
|
|
206
210
|
const WorkflowTriggerBindingSchema = z.object({
|
|
207
211
|
triggerName: z.string().min(1),
|
|
208
|
-
triggerType:
|
|
212
|
+
triggerType: z.enum([
|
|
213
|
+
"webhook",
|
|
214
|
+
"cron",
|
|
215
|
+
"polling"
|
|
216
|
+
]),
|
|
209
217
|
hasTransform: z.boolean(),
|
|
210
218
|
hasFilter: z.boolean(),
|
|
211
219
|
narrowedFrom: z.string().optional(),
|
|
212
220
|
lineage: z.array(z.string()).optional()
|
|
213
221
|
});
|
|
214
|
-
|
|
215
|
-
const WorkflowCoreManifestSchema = WorkflowIdentitySchema.extend({
|
|
222
|
+
const WorkflowCoreManifestSchema = z.object({
|
|
216
223
|
schemaVersion: z.literal(WORKFLOW_MANIFEST_SCHEMA_VERSION),
|
|
217
224
|
id: z.string().min(1),
|
|
225
|
+
name: z.string().trim().min(1).max(255),
|
|
226
|
+
description: z.string().trim().min(1).optional(),
|
|
227
|
+
tags: z.array(z.string()).optional(),
|
|
218
228
|
exportName: z.string().min(1),
|
|
219
229
|
workflowSchemas: WorkflowIOSchema,
|
|
220
230
|
workflowGlobals: JsonSchemaSchema.optional(),
|
|
221
231
|
timeout: DurationSchema.optional(),
|
|
222
|
-
buildInfo: BuildInfoSchema,
|
|
223
232
|
triggers: z.array(WorkflowTriggerBindingSchema).optional()
|
|
224
233
|
});
|
|
225
|
-
|
|
226
|
-
const ManifestDependenciesSchema = z.object({
|
|
227
|
-
/** Local source files: relative path (from project root) -> SHA256 content hash */
|
|
228
|
-
localFiles: z.record(z.string(), z.string()),
|
|
229
|
-
/** npm packages: package name -> declared version from package.json */
|
|
230
|
-
packages: z.record(z.string(), z.string()),
|
|
231
|
-
/** Workspace packages: @keystroke/* name -> version specifier */
|
|
232
|
-
workspacePackages: z.record(z.string(), z.string()),
|
|
233
|
-
/** Node.js built-in module specifiers (e.g., "node:fs") */
|
|
234
|
-
builtins: z.array(z.string())
|
|
235
|
-
});
|
|
236
|
-
/** Complete build-enriched manifest. Extends core with steps, dependencies, and credentials discovered by the build pipeline. */
|
|
237
|
-
const WorkflowManifestSchema = WorkflowCoreManifestSchema.extend({
|
|
234
|
+
const WorkflowBuildManifestSchema = WorkflowCoreManifestSchema.extend({
|
|
238
235
|
workflowSource: SourceLocationSchema.optional(),
|
|
236
|
+
buildInfo: BuildInfoSchema,
|
|
239
237
|
dependencies: ManifestDependenciesSchema,
|
|
240
238
|
hasCycles: z.boolean().optional(),
|
|
241
239
|
credentials: CredentialRequirementsSchema.optional(),
|
|
@@ -246,7 +244,7 @@ z.object({
|
|
|
246
244
|
organizationId: z.string(),
|
|
247
245
|
workflowId: z.string(),
|
|
248
246
|
bundle: z.instanceof(Uint8Array).optional(),
|
|
249
|
-
manifest:
|
|
247
|
+
manifest: WorkflowBuildManifestSchema,
|
|
250
248
|
sourcePath: z.string().optional(),
|
|
251
249
|
triggers: z.array(TriggerUploadDataSchema).optional(),
|
|
252
250
|
bundleSize: z.number().optional(),
|
|
@@ -258,4 +256,4 @@ z.object({
|
|
|
258
256
|
deploymentSnapshotOnly: z.boolean().optional()
|
|
259
257
|
});
|
|
260
258
|
//#endregion
|
|
261
|
-
export { FlowGraphSchema as a,
|
|
259
|
+
export { FlowGraphSchema as a, WorkflowCoreManifestSchema as i, WORKFLOW_MANIFEST_SCHEMA_VERSION as n, WorkflowBuildManifestSchema as r, WORKFLOW_MANIFEST_GENERATOR as t };
|
package/dist/{workflow-bundler-BzHk73PM-tt09RbIA.mjs → workflow-bundler-BzHk73PM-UJQa7Ubk.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as identifierName, o as parseSourceFile, r as isNode } from "./oxc-B3KI3rf_-
|
|
4
|
-
import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-
|
|
3
|
+
import { n as identifierName, o as parseSourceFile, r as isNode } from "./oxc-B3KI3rf_-CHDUXsus.mjs";
|
|
4
|
+
import { r as formatEnvAccessError, t as createEnvAccessPlugin } from "./detect-env-access-CwkOYeYM-EmkYvbfJ.mjs";
|
|
5
5
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
7
|
import { createHash } from "node:crypto";
|