@keystrokehq/cli 0.0.31 → 0.0.37
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 +25 -4
- package/dist/{accept.handler-DNfIXPSP.mjs → accept.handler-DCsud1s5.mjs} +4 -4
- package/dist/{admin-CJp8XksD.mjs → admin-BaOtHeZ2.mjs} +10 -10
- package/dist/{agent-manifest-De5TCxZq.mjs → agent-manifest-DfWD5tvv.mjs} +17 -27
- package/dist/{agents-G37PM35Z.mjs → agents-BVAVfMR_.mjs} +9 -9
- package/dist/{api-keys-4igNHJ_W.mjs → api-keys-BhEEsHUh.mjs} +6 -6
- package/dist/{api-BK3EhPvs.mjs → api-sWkB_Wta.mjs} +1 -1
- package/dist/{auth-CIOmmV4x.mjs → auth-BnsitjzT.mjs} +6 -6
- package/dist/{auth.handler-CznN_vfz.mjs → auth.handler-W_xk14TL.mjs} +3 -3
- package/dist/authored-workflow-ref-fkHEEVnd.mjs +113 -0
- package/dist/{build-agents-DseUtzd4-CSGpNXur.mjs → build-agents-CUzBnlAG-3ePFZiJ6.mjs} +12 -11
- package/dist/{build-progress-DLM1Bt4T.mjs → build-progress-CM-b6Bby.mjs} +2 -2
- package/dist/{build-tasks-C09SdfjC-BmAVLTtQ.mjs → build-tasks-5eOvI19S-tbN6CRx9.mjs} +4 -4
- package/dist/{build-workflows-BZ_m97Pr-BiyptCrn.mjs → build-workflows-C-gQM3l5-_zcBHE3M.mjs} +14 -9
- package/dist/{build.handler-zHimoO7c.mjs → build.handler-CpAsAsBc.mjs} +12 -9
- package/dist/{clear-cache.handler-BP0K1-uN.mjs → clear-cache.handler-gJpwslkK.mjs} +2 -2
- package/dist/{clear.handler-T27GpgSu.mjs → clear.handler-CDyG6-dk.mjs} +1 -1
- package/dist/{clear.handler-PsA5QKHx.mjs → clear.handler-_sR33Hp8.mjs} +2 -2
- package/dist/{commander-BlrSdFcu.mjs → commander-C6SSTQJ2.mjs} +22 -3
- package/dist/{connect-BbLJhlIA.mjs → connect-27EgnljZ.mjs} +3 -3
- package/dist/{connect.handler-BthE-7Wg.mjs → connect.handler-COM1LnNg.mjs} +5 -5
- package/dist/{context-sgKhRc5v.mjs → context-ebZssGCY.mjs} +4 -4
- package/dist/{create.handler-BovbO_g0.mjs → create.handler-CAWJAGzQ.mjs} +3 -3
- package/dist/{credential-env-map-CRs0llf0.mjs → credential-env-map-5a41jLwM.mjs} +1 -1
- package/dist/{credential-requirements-D0mavK8j-CFMf0Xwu.mjs → credential-requirements-B5Alhu1v-DanlSKnT.mjs} +3 -3
- package/dist/{credential-schema-mismatch-ClQgEVtO.mjs → credential-schema-mismatch-c17ktoNU.mjs} +1 -1
- package/dist/{credentials-CsncZ52a.mjs → credentials-C0ssbMlp.mjs} +10 -10
- package/dist/{credentials-DKrSaaLw.mjs → credentials-DtwLbee6.mjs} +1 -1
- package/dist/current-deployment-workflow-C6x65imE.mjs +20 -0
- package/dist/current.handler-DP1L_hm3.mjs +19 -0
- package/dist/{delete.handler-DkAK396w.mjs → delete.handler-C-5XFkgN.mjs} +2 -2
- package/dist/{deploy-DvPfR9fC.mjs → deploy-BcVQJza8.mjs} +2 -2
- package/dist/{deploy-progress-BsUH7fGE.mjs → deploy-progress-Bt86Yc1r.mjs} +2 -2
- package/dist/{deploy.handler-BW3f2N2G.mjs → deploy.handler-GPS9lxGk.mjs} +16 -16
- package/dist/{diff-utils-Bs--xmoV.mjs → diff-utils-YEUYtSRs.mjs} +1 -1
- package/dist/{diff.handler-BwhsoAg0.mjs → diff.handler-DkM5dhaN.mjs} +15 -9
- package/dist/{dist-Dw7gCE7y.mjs → dist-B5jy238v.mjs} +37 -11
- package/dist/{dist-CTEtWDW4.mjs → dist-BmbFJq8U.mjs} +8 -27
- package/dist/{env.handler-Dks6ZQh-.mjs → env.handler-V_isbSi2.mjs} +52 -29
- package/dist/{error-boundary-0veZ_RDS.mjs → error-boundary-BRxUsPi7.mjs} +3 -3
- package/dist/{iam-command-utils-CSZj4XlH.mjs → iam-command-utils-DNDN0wT6.mjs} +3 -13
- package/dist/{import-module-y0glInUe-DV_3dsU0.mjs → import-module-y0glInUe-EuAWaw9g.mjs} +506 -128
- package/dist/{init-DX08T87c.mjs → init-D1OmmclX.mjs} +8 -3
- package/dist/{init.handler-CzlmkNXi.mjs → init.handler-CUbYlUgP.mjs} +57 -14
- package/dist/{inspect.handler-v9snxDLi.mjs → inspect.handler-BE6coOuW.mjs} +24 -13
- package/dist/{integration-catalog-CiZ62hb_.mjs → integration-catalog-pSmWHFLQ.mjs} +3 -3
- package/dist/{integrations-MEExmqcg.mjs → integrations-DZD5t8n2.mjs} +7 -7
- package/dist/{invites-BuatfJmN.mjs → invites-BuR1H-tA.mjs} +5 -5
- package/dist/{invites.list.handler-CK6mL10z.mjs → invites.list.handler-Dj4a6XOg.mjs} +6 -5
- package/dist/{invites.resend.handler-CKZouK1Z.mjs → invites.resend.handler-DEGF4vlB.mjs} +6 -5
- package/dist/{invites.revoke.handler-H0VI-3sp.mjs → invites.revoke.handler-Dg4ZvlFS.mjs} +6 -5
- package/dist/keystroke.mjs +122 -77
- package/dist/{list-enrichment-DP1wEyBZ.mjs → list-enrichment-dqbkXJzy.mjs} +2 -2
- package/dist/{list.handler-LxZInip2.mjs → list.handler-2g1CZAvB.mjs} +4 -4
- package/dist/{list.handler-BKfGLkFu.mjs → list.handler-7MkJfkak.mjs} +5 -5
- package/dist/list.handler-BTYVIn6z.mjs +39 -0
- package/dist/{list.handler-BiY5NFWd.mjs → list.handler-Bchcr3-e.mjs} +3 -3
- package/dist/list.handler-Choc4SZz.mjs +64 -0
- package/dist/{list.handler-Jk_vK66s.mjs → list.handler-D47C1z3m.mjs} +4 -4
- package/dist/{list.handler-DVnFrlis.mjs → list.handler-DYE48apa.mjs} +7 -7
- package/dist/{list.handler-DIMWZx78.mjs → list.handler-KcCaG3PZ.mjs} +4 -4
- package/dist/list2.handler-BIaIyrQf.mjs +99 -0
- package/dist/{listen-C_7Rgwkb.mjs → listen-CVY-_F29.mjs} +3 -3
- package/dist/{listen.handler-dJgorIzr.mjs → listen.handler-D_nEvXRn.mjs} +4 -4
- package/dist/{logs-B9YMhUGt.mjs → logs-CZ2qnsSH.mjs} +3 -3
- package/dist/{logs.handler-BfjCsAyq.mjs → logs.handler-BRUzZC9Z.mjs} +26 -29
- package/dist/{logs.handler-DGGVPMOX.mjs → logs.handler-Wk6mYyAZ.mjs} +1 -1
- package/dist/{members.add.handler-DSRCRxsI.mjs → members.add.handler-BJ0wr6rP.mjs} +6 -5
- package/dist/{members.invite.handler-BNpHn1dY.mjs → members.invite.handler-DyveDMuq.mjs} +6 -5
- package/dist/{members.list.handler-Bn9LJEPG.mjs → members.list.handler-CyQxH_zS.mjs} +6 -5
- package/dist/{members.remove.handler-Dkr2t_tX.mjs → members.remove.handler-Dtv9PooY.mjs} +6 -5
- package/dist/{members.update.handler-DBtUYuAY.mjs → members.update.handler-CeK-tCjT.mjs} +6 -5
- package/dist/{operations-AWMLs6mE.mjs → operations-CxQlt0S0.mjs} +5 -5
- package/dist/{org-DOH7YHk2.mjs → org-B8MPHJJu.mjs} +35 -28
- package/dist/org-context-BI9OSpbb.mjs +112 -0
- package/dist/org-output-DffU7DKn.mjs +64 -0
- package/dist/{orgs.create.handler-BO70zIdp.mjs → orgs.create.handler-BKvSmkU3.mjs} +4 -4
- package/dist/{orgs.get.handler-BuGg5bc9.mjs → orgs.get.handler-BA-CexIY.mjs} +4 -4
- package/dist/{orgs.list.handler--5HutMkl.mjs → orgs.list.handler-eCEg5kC1.mjs} +4 -4
- package/dist/{output-BWcVRt-T.mjs → output-DnIFEmi5.mjs} +1 -1
- package/dist/package-manager-BP3-q8hh.mjs +162 -0
- package/dist/{paused.handler-DHvxz-cC.mjs → paused.handler-4wKMTKZ-.mjs} +20 -33
- package/dist/{projects-C5GZ5Jrf.mjs → projects-Wu_2fB_x.mjs} +11 -9
- package/dist/{register.handler-CePNU3sP.mjs → register.handler-BvAkXCwE.mjs} +2 -2
- package/dist/{render-credential-Bn15FEUC.mjs → render-credential-D-H1ECDt.mjs} +1 -1
- package/dist/{render-operation-Bc7Wu1sP.mjs → render-operation-VdEPhoII.mjs} +2 -2
- package/dist/{requirements.handler-B5rqCjMu.mjs → requirements.handler-Bab4kBtw.mjs} +7 -7
- package/dist/{resolve-cli-credentials-CAOSVMJP.mjs → resolve-cli-credentials-GVOOedoQ.mjs} +1 -1
- package/dist/{resolve-project-E9mrh_el.mjs → resolve-project-DLKlAy0z.mjs} +24 -8
- package/dist/{run-polling-DawiBus-.mjs → run-polling-C5fI7xTp.mjs} +97 -14
- package/dist/{run.handler-BG7xitEK.mjs → run.handler-BKD5Xu0A.mjs} +42 -30
- package/dist/{runs-swYYBT6C.mjs → runs-CT31dczt.mjs} +4 -4
- package/dist/{schema-display-FvI8QjOQ.mjs → schema-display-sZ6ConJd.mjs} +33 -26
- package/dist/schemas-ClAIoIrX.mjs +281 -0
- package/dist/{search-BEfy2fG9.mjs → search-BeQW_pf4.mjs} +3 -3
- package/dist/{search.handler-V7ObLGjN.mjs → search.handler-BJ-ZlDL4.mjs} +6 -6
- package/dist/{show.handler-C_VDYU91.mjs → show.handler-BrIHUH28.mjs} +4 -4
- package/dist/{show.handler-CsidInW8.mjs → show.handler-Cqe_hCqU.mjs} +5 -5
- package/dist/{show.handler-Wmv0tkxx.mjs → show.handler-DB8xl5FU.mjs} +6 -6
- package/dist/{skill-installer-D6j9IA3Z.mjs → skill-installer-DuMhavmM.mjs} +3 -1
- package/dist/{skills-sync.handler-BAATdT6N.mjs → skills-sync.handler-BGs-_YD9.mjs} +13 -7
- package/dist/{skills.command-0-E8mcYE.mjs → skills.command-DUWn6FbL.mjs} +5 -5
- package/dist/skills.handler-DqLXJepA.mjs +9 -0
- package/dist/{spinner-progress-lrKDs4YF.mjs → spinner-progress-BYxlr3lY.mjs} +1 -1
- package/dist/status.handler-DAId4bVU.mjs +72 -0
- package/dist/{switch.handler-BwYndsP-.mjs → switch.handler-Cd4Yg2n8.mjs} +17 -4
- package/dist/{sync-6fZkIUtn.mjs → sync-DgC4lcxh.mjs} +2 -2
- package/dist/{sync.handler-Ctr-cN9X.mjs → sync.handler-Cm_WtGmH.mjs} +8 -8
- package/dist/{task-BWuIKWh4.mjs → task-DTvLzUkA.mjs} +2 -88
- package/dist/{task-target-build-QllcCfoN.mjs → task-target-build-CtvRyVjH.mjs} +5 -5
- package/dist/task-target-deploy-runner.mjs +6 -6
- package/dist/{test-C8VIZe9V.mjs → test-4V7nh67i.mjs} +5 -5
- package/dist/{test.handler-BCW0YBPd.mjs → test.handler-BdCYcwR4.mjs} +2 -2
- package/dist/{test.handler-DLaxrJ9V.mjs → test.handler-Bo4YTs2Z.mjs} +19 -16
- package/dist/{tool.handler-8qNmgdRe.mjs → tool.handler-CPCrSDq2.mjs} +12 -12
- package/dist/{trigger-artifacts-BcRScRSp-BiD2h6do.mjs → trigger-artifacts-BcRScRSp-BRpU-He5.mjs} +2 -2
- package/dist/{trigger-manifest-C07EM-b2.mjs → trigger-manifest-BVqjDhxU.mjs} +1 -1
- package/dist/{upgrade-DgOcc8IT.mjs → upgrade-2qUOcjxb.mjs} +4 -8
- package/dist/upgrade.handler-PqlKSuUE.mjs +99 -0
- package/dist/{upload.handler-B7xle1oX.mjs → upload.handler-CS-vLpzC.mjs} +9 -9
- package/dist/{users.get.handler-C4t1vXwi.mjs → users.get.handler-CH1c6Lnj.mjs} +4 -4
- package/dist/{users.list.handler-Dvl90grq.mjs → users.list.handler-CxbZFgjO.mjs} +4 -4
- package/dist/{users.set-role.handler-Djw1_VGf.mjs → users.set-role.handler-CBRE-Ws6.mjs} +4 -4
- package/dist/{validate.handler-Drf_lssw.mjs → validate.handler-1d-UmtXB.mjs} +171 -26
- package/dist/{workflow-build-Begvjfq8.mjs → workflow-build-Bm8JoVv4.mjs} +234 -32
- package/dist/{workflow-build-manifest-1sC52TIG.mjs → workflow-build-manifest-CV6bBmDO.mjs} +1 -1
- package/dist/{workflow-bundler-BzHk73PM-muPv1yGG.mjs → workflow-bundler-Bs3zQNQv-Dy7lXxy3.mjs} +15 -4
- package/dist/{workflows-DjMlxuBX.mjs → workflows-ny7rOdeH.mjs} +34 -37
- package/dist/{writer-byNNUjRm-B-on1n6c.mjs → writer-BLg0RuZa-Y6ExdYH9.mjs} +6 -4
- package/package.json +11 -11
- package/dist/current-deployment-workflow-B1VQCYC-.mjs +0 -94
- package/dist/current.handler-BaGaCLzB.mjs +0 -21
- package/dist/list.handler-BEMj3FyH.mjs +0 -76
- package/dist/list.handler-Cq_oQY5B.mjs +0 -52
- package/dist/list.handler-htR9TeiS.mjs +0 -24
- package/dist/package-manager-DT1EhOkS.mjs +0 -61
- package/dist/schemas-D2zfmyC-.mjs +0 -671
- package/dist/skills.handler-DYIQK0Vu.mjs +0 -9
- package/dist/status.handler-Ch_DtyBp.mjs +0 -109
- package/dist/upgrade.handler-DSZuw7-9.mjs +0 -80
- /package/dist/{build-metadata-BB_L45ZS-DSJL7dTy.mjs → build-metadata-BB_L45ZS-DRQsV6JK.mjs} +0 -0
- /package/dist/{deploy-DhCbYFc7.mjs → deploy-BiKBH25R.mjs} +0 -0
- /package/dist/{detect-env-access-CwkOYeYM-COq4U-4Y.mjs → detect-env-access-CwkOYeYM-r4aynBU0.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-DGK5XTQp.mjs → read-credential-keys-77a91T8M-I07NYwfH.mjs} +0 -0
- /package/dist/{run-polling-fBouPjJ2.mjs → run-polling-1c0ckC1A.mjs} +0 -0
- /package/dist/{schemas-4Mq_bxob.mjs → schemas-8nhXlXWh.mjs} +0 -0
- /package/dist/{task-target-deploy-B_3HPSo2.mjs → task-target-deploy-m9LfE488.mjs} +0 -0
- /package/dist/{types-AlA-ifK9.mjs → types-Cb0eWmUU.mjs} +0 -0
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as projects } from "./dist-
|
|
3
|
+
import { N as throwReportedCliExit, k as CliExitError, p as ui, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { i as projects } from "./dist-B5jy238v.mjs";
|
|
5
5
|
import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
|
|
6
|
-
import { i as writeJson } from "./output-
|
|
7
|
-
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-
|
|
8
|
-
import { n as resolveWorkflowsDir } from "./resolve-project-
|
|
9
|
-
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-
|
|
10
|
-
import { i as resolveWorkflowGlobals, o as validateInputOrExit, r as resolveRunInput, s as validateWorkflowGlobalsOrExit, t as pollForCompletion } from "./run-polling-
|
|
6
|
+
import { i as writeJson } from "./output-DnIFEmi5.mjs";
|
|
7
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-ebZssGCY.mjs";
|
|
8
|
+
import { n as resolveWorkflowsDir } from "./resolve-project-DLKlAy0z.mjs";
|
|
9
|
+
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-C6x65imE.mjs";
|
|
10
|
+
import { i as resolveWorkflowGlobals, o as validateInputOrExit, r as resolveRunInput, s as validateWorkflowGlobalsOrExit, t as pollForCompletion } from "./run-polling-C5fI7xTp.mjs";
|
|
11
|
+
import { n as assertAuthoredWorkflowId, t as WORKFLOW_ID_COMMANDS } from "./authored-workflow-ref-fkHEEVnd.mjs";
|
|
11
12
|
//#region src/commands/workflows/run.handler.ts
|
|
12
13
|
async function handleWorkflowsRun(options, ctx) {
|
|
13
14
|
const client = requireClient(ctx);
|
|
14
|
-
const projectId = await
|
|
15
|
+
const { projectId, authoredWorkflowId, workflowsDir } = await resolveRunWorkflowTarget(options, ctx);
|
|
15
16
|
const input = await resolveRunInput(options);
|
|
16
17
|
const globals = await resolveWorkflowGlobals(options);
|
|
17
|
-
const
|
|
18
|
+
const workflow = (await requireDeploymentWorkflowFound(await loadCurrentDeploymentWorkflow(client, {
|
|
18
19
|
projectId,
|
|
19
|
-
authoredWorkflowId
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
authoredWorkflowId
|
|
21
|
+
}), {
|
|
22
|
+
authoredWorkflowId,
|
|
23
|
+
workflowsDir
|
|
24
|
+
})).workflow;
|
|
23
25
|
const inputSchema = workflow.manifest.workflowSchemas.input;
|
|
24
|
-
const validatedInput = isJsonObjectSchema(inputSchema) && inputSchema.type !== "unknown" ? validateInputOrExit(
|
|
26
|
+
const validatedInput = isJsonObjectSchema(inputSchema) && inputSchema.type !== "unknown" ? validateInputOrExit(authoredWorkflowId, input, inputSchema) : input;
|
|
25
27
|
const globalsSchema = workflow.manifest.workflowGlobals;
|
|
26
28
|
const validatedGlobals = resolveValidatedWorkflowGlobals({
|
|
27
|
-
|
|
29
|
+
authoredWorkflowId,
|
|
28
30
|
schema: globalsSchema,
|
|
29
31
|
globals
|
|
30
32
|
});
|
|
@@ -62,18 +64,27 @@ async function handleWorkflowsRun(options, ctx) {
|
|
|
62
64
|
}
|
|
63
65
|
renderWaitResult(runId, snapshot, options.timeout);
|
|
64
66
|
}
|
|
65
|
-
async function
|
|
66
|
-
|
|
67
|
+
async function resolveRunWorkflowTarget(options, ctx) {
|
|
68
|
+
const authoredWorkflowId = options.workflow;
|
|
67
69
|
const workflowsDir = await resolveWorkflowsDir(options.path);
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
if (workflowsDir) {
|
|
71
|
+
await assertAuthoredWorkflowId(authoredWorkflowId, workflowsDir, WORKFLOW_ID_COMMANDS.run);
|
|
72
|
+
const projectConfig = await assertWorkflowProjectRoot(workflowsDir);
|
|
73
|
+
await assertProjectConfigMatchesAuthenticatedOrg(requireClient(ctx), projectConfig);
|
|
74
|
+
projects.track(workflowsDir);
|
|
75
|
+
return {
|
|
76
|
+
projectId: options.projectId ?? projectConfig.projectId,
|
|
77
|
+
authoredWorkflowId,
|
|
78
|
+
workflowsDir
|
|
79
|
+
};
|
|
72
80
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
if (options.projectId) return {
|
|
82
|
+
projectId: options.projectId,
|
|
83
|
+
authoredWorkflowId
|
|
84
|
+
};
|
|
85
|
+
ui.error("No keystroke.config.ts found in this directory or any parent directory.");
|
|
86
|
+
ui.hint("Run inside a Keystroke project or pass --project-id <uuid>.");
|
|
87
|
+
throwReportedCliExit("No keystroke.config.ts found");
|
|
77
88
|
}
|
|
78
89
|
async function loadCurrentDeploymentWorkflow(client, params) {
|
|
79
90
|
try {
|
|
@@ -83,17 +94,18 @@ async function loadCurrentDeploymentWorkflow(client, params) {
|
|
|
83
94
|
throwReportedCliExit(`Failed to load current deployment workflow: ${toErrorMessage(error)}`, { cause: error });
|
|
84
95
|
}
|
|
85
96
|
}
|
|
86
|
-
function
|
|
87
|
-
if (deploymentLookup.status === "found") return;
|
|
97
|
+
async function requireDeploymentWorkflowFound(deploymentLookup, options) {
|
|
98
|
+
if (deploymentLookup.status === "found") return deploymentLookup;
|
|
88
99
|
if (deploymentLookup.status === "missingCurrentDeployment") {
|
|
89
100
|
ui.error("This project has no current deployment.");
|
|
90
101
|
ui.hint("Run `keystroke deploy` to create the current deployment, then try again.");
|
|
91
102
|
throwReportedCliExit("This project has no current deployment.");
|
|
92
103
|
}
|
|
93
104
|
if (deploymentLookup.status === "missingWorkflow") {
|
|
94
|
-
|
|
105
|
+
if (options.workflowsDir) await assertAuthoredWorkflowId(options.authoredWorkflowId, options.workflowsDir, WORKFLOW_ID_COMMANDS.run, { refreshManifests: true });
|
|
106
|
+
ui.error(`Workflow "${options.authoredWorkflowId}" is not part of the current deployment.`);
|
|
95
107
|
ui.hint("Run `keystroke deploy` to include it in the current deployment, then try again.");
|
|
96
|
-
throwReportedCliExit(`Workflow "${
|
|
108
|
+
throwReportedCliExit(`Workflow "${options.authoredWorkflowId}" is not part of the current deployment.`);
|
|
97
109
|
}
|
|
98
110
|
throw new Error(`Unhandled deployment lookup status: ${JSON.stringify(deploymentLookup)}`);
|
|
99
111
|
}
|
|
@@ -103,7 +115,7 @@ function resolveValidatedWorkflowGlobals(params) {
|
|
|
103
115
|
value: params.globals.value
|
|
104
116
|
} : { shouldSend: false };
|
|
105
117
|
const candidate = params.globals.value ?? {};
|
|
106
|
-
const validated = validateWorkflowGlobalsOrExit(params.
|
|
118
|
+
const validated = validateWorkflowGlobalsOrExit(params.authoredWorkflowId, candidate, params.schema);
|
|
107
119
|
if (params.globals.provided || Object.keys(validated).length > 0) return {
|
|
108
120
|
shouldSend: true,
|
|
109
121
|
value: validated
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
5
|
-
import { t as createTypedCommand } from "./commander-
|
|
6
|
-
import { i as requireClient } from "./context-
|
|
3
|
+
import { N as throwReportedCliExit, n as style, p as ui, t as ANSI, x as toErrorMessage } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-DnIFEmi5.mjs";
|
|
5
|
+
import { t as createTypedCommand } from "./commander-C6SSTQJ2.mjs";
|
|
6
|
+
import { i as requireClient } from "./context-ebZssGCY.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/commands/runs/inspect-display.ts
|
|
9
9
|
function renderRunInspect(input) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
4
|
//#region src/lib/schema-display.ts
|
|
5
5
|
/**
|
|
6
6
|
* Returns true when the schema is the fallback "unknown" sentinel emitted
|
|
@@ -11,8 +11,9 @@ function isUnknownSchema(schema) {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Generates a minimal placeholder JSON object for a given JSON Schema.
|
|
14
|
-
* Walks `properties` recursively to produce
|
|
15
|
-
*
|
|
14
|
+
* Walks `properties` recursively to produce structural `--input` examples
|
|
15
|
+
* (required keys and rough types). Examples are not guaranteed to pass
|
|
16
|
+
* validation (e.g. minLength, format, unions, or const constraints).
|
|
16
17
|
*
|
|
17
18
|
* Examples:
|
|
18
19
|
* { type: "number" } => 0
|
|
@@ -26,6 +27,26 @@ function generateExampleJson(schema) {
|
|
|
26
27
|
if (schema == null || typeof schema !== "object") return null;
|
|
27
28
|
return generateValue(schema);
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* JSON string for a workflow `--input` value derived from the input schema.
|
|
32
|
+
* See {@link generateExampleJson} for placeholder semantics.
|
|
33
|
+
*/
|
|
34
|
+
function formatExampleInputJson(inputSchema) {
|
|
35
|
+
if (inputSchema == null || typeof inputSchema !== "object" || isUnknownSchema(inputSchema)) return "{}";
|
|
36
|
+
const example = generateExampleJson(inputSchema);
|
|
37
|
+
return JSON.stringify(example ?? {});
|
|
38
|
+
}
|
|
39
|
+
/** Wraps a string in single quotes with POSIX-safe `'` escaping for shell snippets. */
|
|
40
|
+
function shellEscapeSingleQuoted(value) {
|
|
41
|
+
return `'${value.replace(/'/g, "'\"'\"'")}'`;
|
|
42
|
+
}
|
|
43
|
+
/** Shell-safe `--input '...'` flag generated from a workflow input JSON Schema. */
|
|
44
|
+
function formatWorkflowInputFlag(inputSchema) {
|
|
45
|
+
return `--input ${shellEscapeSingleQuoted(formatExampleInputJson(inputSchema))}`;
|
|
46
|
+
}
|
|
47
|
+
function formatWorkflowTestExampleCommand(authoredWorkflowId, inputSchema) {
|
|
48
|
+
return `$ keystroke workflows test ${authoredWorkflowId} ${formatWorkflowInputFlag(inputSchema)}`;
|
|
49
|
+
}
|
|
29
50
|
function generateValue(schema) {
|
|
30
51
|
if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0];
|
|
31
52
|
switch (Array.isArray(schema.type) ? schema.type[0] : schema.type) {
|
|
@@ -105,12 +126,12 @@ function resolveTypeHint(fieldSchema) {
|
|
|
105
126
|
/**
|
|
106
127
|
* Formats a missing-required-fields error into a descriptive CLI message.
|
|
107
128
|
*/
|
|
108
|
-
function formatMissingInputError(
|
|
129
|
+
function formatMissingInputError(authoredWorkflowId, missingFields, inputSchema) {
|
|
109
130
|
const lines = [];
|
|
110
|
-
lines.push(`Missing required input for workflow "${
|
|
131
|
+
lines.push(`Missing required input for workflow "${authoredWorkflowId}"\n`);
|
|
111
132
|
if (inputSchema == null || typeof inputSchema !== "object") {
|
|
112
133
|
lines.push(" (input schema unavailable)\n");
|
|
113
|
-
lines.push(` $
|
|
134
|
+
lines.push(` ${formatWorkflowTestExampleCommand(authoredWorkflowId)}`);
|
|
114
135
|
return lines.join("\n");
|
|
115
136
|
}
|
|
116
137
|
const properties = inputSchema.properties && typeof inputSchema.properties === "object" ? inputSchema.properties : {};
|
|
@@ -120,38 +141,24 @@ function formatMissingInputError(workflowName, missingFields, inputSchema) {
|
|
|
120
141
|
lines.push(` ${field} (${typeHint}): Required`);
|
|
121
142
|
}
|
|
122
143
|
lines.push("");
|
|
123
|
-
const exampleValue = generateExampleJson(inputSchema);
|
|
124
|
-
const exampleJson = JSON.stringify(exampleValue);
|
|
125
144
|
lines.push("Expected input:");
|
|
126
|
-
lines.push(` $
|
|
145
|
+
lines.push(` ${formatWorkflowTestExampleCommand(authoredWorkflowId, inputSchema)}`);
|
|
127
146
|
return lines.join("\n");
|
|
128
147
|
}
|
|
129
148
|
/**
|
|
130
149
|
* Formats validation issues into a descriptive CLI message.
|
|
131
|
-
*
|
|
132
|
-
* Example output:
|
|
133
|
-
*
|
|
134
|
-
* Invalid input for workflow "Addition"
|
|
135
|
-
*
|
|
136
|
-
* num: Required
|
|
137
|
-
* num2: Required
|
|
138
|
-
*
|
|
139
|
-
* Expected input:
|
|
140
|
-
* $ keystroke workflows test "Addition" --input '{"num":0,"num2":0}'
|
|
141
150
|
*/
|
|
142
|
-
function formatValidationError(
|
|
151
|
+
function formatValidationError(authoredWorkflowId, issues, inputSchema) {
|
|
143
152
|
const lines = [];
|
|
144
|
-
lines.push(`Invalid input for workflow "${
|
|
153
|
+
lines.push(`Invalid input for workflow "${authoredWorkflowId}"\n`);
|
|
145
154
|
for (const issue of issues) {
|
|
146
155
|
const fieldPath = issue.path.length === 0 || issue.path.length === 1 && issue.path[0] === "" ? "(root)" : issue.path.join(".");
|
|
147
156
|
lines.push(` ${fieldPath}: ${issue.message}`);
|
|
148
157
|
}
|
|
149
158
|
lines.push("");
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
lines.push(`Expected input:`);
|
|
153
|
-
lines.push(` $ keystroke workflows test "${workflowName}" --input '${exampleJson}'`);
|
|
159
|
+
lines.push("Expected input:");
|
|
160
|
+
lines.push(` ${formatWorkflowTestExampleCommand(authoredWorkflowId, inputSchema)}`);
|
|
154
161
|
return lines.join("\n");
|
|
155
162
|
}
|
|
156
163
|
//#endregion
|
|
157
|
-
export {
|
|
164
|
+
export { isUnknownSchema as a, validateRequiredFields as c, formatWorkflowInputFlag as i, formatMissingInputError as n, renderJsonSchema as o, formatValidationError as r, resolveTypeHint as s, formatExampleInputJson as t };
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region ../../packages/core/src/shared/schema.ts
|
|
5
|
+
const MAX_JSON_DEPTH = 20;
|
|
6
|
+
function buildJsonValueSchema(depth) {
|
|
7
|
+
const primitives = z.union([
|
|
8
|
+
z.string(),
|
|
9
|
+
z.number(),
|
|
10
|
+
z.boolean(),
|
|
11
|
+
z.null()
|
|
12
|
+
]);
|
|
13
|
+
if (depth <= 0) return primitives;
|
|
14
|
+
const nested = buildJsonValueSchema(depth - 1);
|
|
15
|
+
return z.union([
|
|
16
|
+
primitives,
|
|
17
|
+
z.array(nested),
|
|
18
|
+
z.record(z.string(), nested)
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
const jsonValueSchema = buildJsonValueSchema(MAX_JSON_DEPTH);
|
|
22
|
+
const jsonSchemaObject = z.record(z.string(), jsonValueSchema);
|
|
23
|
+
const anyZodSchemaSchema = z.custom((value) => value instanceof z.ZodType, "Expected a Zod schema");
|
|
24
|
+
const zodObjectSchema = z.custom((value) => value instanceof z.ZodObject, "Expected a Zod object schema");
|
|
25
|
+
/**
|
|
26
|
+
* Creates a Zod schema that validates an object structurally by checking
|
|
27
|
+
* for required properties. This avoids `instanceof` checks which fail
|
|
28
|
+
* when class definitions are duplicated across bundle boundaries.
|
|
29
|
+
*/
|
|
30
|
+
function createStructuralSchema(requiredKeys, label) {
|
|
31
|
+
return z.custom((value) => value != null && (typeof value === "object" || typeof value === "function") && requiredKeys.every((key) => key in value), `Expected ${label}`);
|
|
32
|
+
}
|
|
33
|
+
function trimmedNonEmptyString(fieldName) {
|
|
34
|
+
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` });
|
|
35
|
+
}
|
|
36
|
+
/** Trimmed string with at least one character; no upper length limit. */
|
|
37
|
+
function trimmedNonEmptyStringUnbounded(fieldName) {
|
|
38
|
+
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Non-empty trimmed string restricted to URL-safe characters.
|
|
42
|
+
* Use for IDs (workflow, step, etc.) that must be safe in URLs, env vars, and as object keys.
|
|
43
|
+
*/
|
|
44
|
+
function idNoSpacesString(fieldName) {
|
|
45
|
+
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` });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Non-empty trimmed string for credential definition ids.
|
|
49
|
+
* Allows namespaced ids such as `keystroke:slack` plus letters, numbers,
|
|
50
|
+
* hyphens, and underscores.
|
|
51
|
+
*/
|
|
52
|
+
function credentialSetIdString(fieldName) {
|
|
53
|
+
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` }).refine((s) => /^[a-zA-Z0-9_:-]+$/.test(s), { error: `${fieldName} must only contain letters, numbers, hyphens, underscores, and colons` });
|
|
54
|
+
}
|
|
55
|
+
function optionalTrimmedNonEmptyString(fieldName) {
|
|
56
|
+
return trimmedNonEmptyString(fieldName).optional();
|
|
57
|
+
}
|
|
58
|
+
function descriptionString(fieldName) {
|
|
59
|
+
return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(1024, { error: `${fieldName} cannot exceed 1024 characters` });
|
|
60
|
+
}
|
|
61
|
+
function optionalDescriptionString(fieldName) {
|
|
62
|
+
return descriptionString(fieldName).optional();
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region ../../packages/core/src/credential-set/constants.ts
|
|
66
|
+
/**
|
|
67
|
+
* Shared constants for the credential/connection system.
|
|
68
|
+
* Defined in core (bottom of dependency chain) so all packages can import them.
|
|
69
|
+
*/
|
|
70
|
+
const CREDENTIAL_EXPOSURES = {
|
|
71
|
+
"user-runtime": "user-runtime",
|
|
72
|
+
"platform-only": "platform-only"
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region ../../packages/core/src/credential-set/schemas.ts
|
|
76
|
+
const credentialSetProxyInjectionSchema = z.object({
|
|
77
|
+
/** Substitute placeholder in HTTP headers (default: true). */
|
|
78
|
+
headers: z.boolean().optional(),
|
|
79
|
+
/** Substitute placeholder in the HTTP Basic Auth credential (default: true). */
|
|
80
|
+
basicAuth: z.boolean().optional(),
|
|
81
|
+
/** Substitute placeholder in URL query params (default: false).
|
|
82
|
+
* Use for APIs that authenticate via `?api_key=...` (Google Maps, OWM, etc.). */
|
|
83
|
+
queryParams: z.boolean().optional(),
|
|
84
|
+
/** Substitute placeholder in the HTTP request body (default: false).
|
|
85
|
+
* Use for form-encoded auth payloads (Stripe, AWS SigV4 query, etc.). */
|
|
86
|
+
body: z.boolean().optional()
|
|
87
|
+
});
|
|
88
|
+
const credentialSetProxyConfigSchema = z.object({
|
|
89
|
+
/** Exact-match host allowlist (forwarded to SecretBuilder.allowHost). */
|
|
90
|
+
hosts: z.array(z.string().min(1)).optional(),
|
|
91
|
+
/** Wildcard host allowlist (forwarded to SecretBuilder.allowHostPattern).
|
|
92
|
+
* Example: `["*.browserbase.com"]` covers any subdomain. */
|
|
93
|
+
hostPatterns: z.array(z.string().min(1)).optional(),
|
|
94
|
+
/** Per-scope substitution toggles. Omit to use SDK defaults. */
|
|
95
|
+
injection: credentialSetProxyInjectionSchema.optional()
|
|
96
|
+
});
|
|
97
|
+
const onCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
|
|
98
|
+
const credentialExposureSchema = z.enum([CREDENTIAL_EXPOSURES["user-runtime"], CREDENTIAL_EXPOSURES["platform-only"]]);
|
|
99
|
+
const connectionMetadataConfigSchema = z.object({
|
|
100
|
+
id: credentialSetIdString("Credential connection id").optional(),
|
|
101
|
+
label: optionalTrimmedNonEmptyString("Credential connection label"),
|
|
102
|
+
description: optionalDescriptionString("Credential connection description"),
|
|
103
|
+
recommended: z.boolean().optional(),
|
|
104
|
+
advanced: z.boolean().optional(),
|
|
105
|
+
needsRawSecret: z.boolean().optional()
|
|
106
|
+
});
|
|
107
|
+
const connectionMetadataManifestSchema = connectionMetadataConfigSchema;
|
|
108
|
+
const registeredDescriptorSchema = z.object({
|
|
109
|
+
id: trimmedNonEmptyString("Registered descriptor id"),
|
|
110
|
+
config: z.record(z.string(), z.unknown()).optional()
|
|
111
|
+
});
|
|
112
|
+
const registeredResolverDescriptorSchema = registeredDescriptorSchema.extend({ cacheMs: z.number().int().nonnegative().optional() });
|
|
113
|
+
const manualConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
114
|
+
kind: z.literal("manual"),
|
|
115
|
+
input: zodObjectSchema.optional(),
|
|
116
|
+
instructions: z.string().min(1).optional(),
|
|
117
|
+
validate: z.function().optional()
|
|
118
|
+
});
|
|
119
|
+
const manualConnectionFieldManifestSchema = z.object({
|
|
120
|
+
key: z.string().min(1),
|
|
121
|
+
label: z.string().min(1),
|
|
122
|
+
description: z.string().min(1).optional(),
|
|
123
|
+
optional: z.boolean(),
|
|
124
|
+
secret: z.literal(true)
|
|
125
|
+
});
|
|
126
|
+
const manualConnectionConfigManifestSchema = connectionMetadataManifestSchema.extend({
|
|
127
|
+
kind: z.literal("manual"),
|
|
128
|
+
input: jsonSchemaObject.optional(),
|
|
129
|
+
fields: z.array(manualConnectionFieldManifestSchema).optional(),
|
|
130
|
+
generated: z.boolean().optional(),
|
|
131
|
+
instructions: z.string().min(1).optional()
|
|
132
|
+
});
|
|
133
|
+
/** Declarative form of `Vault` — strings typed against the credential set's
|
|
134
|
+
* stored/auth schema keys at the {@link CredentialSetConfig} boundary; the Zod
|
|
135
|
+
* schema here enforces non-empty strings only. `CredentialSet` itself performs
|
|
136
|
+
* the schema-key membership check at construction time. */
|
|
137
|
+
const vaultMappingSchema = z.object({
|
|
138
|
+
accessToken: z.string().min(1),
|
|
139
|
+
refreshToken: z.string().min(1).optional(),
|
|
140
|
+
instanceUrl: z.string().min(1).optional(),
|
|
141
|
+
raw: z.record(z.string().min(1), z.string().min(1)).optional()
|
|
142
|
+
});
|
|
143
|
+
/** Function form of `Vault` — an object pairing the access-token vault key
|
|
144
|
+
* (`accessTokenKey`) with the `build` function that computes the full vault
|
|
145
|
+
* write map. The explicit key keeps the disconnect path's revocation read
|
|
146
|
+
* reliable even when `build` transforms the access token. */
|
|
147
|
+
const vaultMappingFnSchema = z.object({
|
|
148
|
+
accessTokenKey: z.string().min(1),
|
|
149
|
+
build: z.custom((val) => typeof val === "function", { message: "vault.build must be a function." })
|
|
150
|
+
});
|
|
151
|
+
/** Runtime shape of `Vault`. Accepts either the declarative mapping or the
|
|
152
|
+
* function-form object `{ accessTokenKey, build }`. */
|
|
153
|
+
const vaultConfigSchema = z.union([vaultMappingSchema, vaultMappingFnSchema], { error: "vault must be a declarative mapping object or a `{ accessTokenKey, build }` object." });
|
|
154
|
+
/** Manifest projection of `Vault` — declarative mappings serialize verbatim;
|
|
155
|
+
* function-form mappings serialize as `{ kind: 'function', accessTokenKey }`
|
|
156
|
+
* since closures are not manifest-safe but the access-token key is. */
|
|
157
|
+
const vaultManifestSchema = z.discriminatedUnion("kind", [z.object({
|
|
158
|
+
kind: z.literal("declarative"),
|
|
159
|
+
accessToken: z.string().min(1),
|
|
160
|
+
refreshToken: z.string().min(1).optional(),
|
|
161
|
+
instanceUrl: z.string().min(1).optional(),
|
|
162
|
+
raw: z.record(z.string().min(1), z.string().min(1)).optional()
|
|
163
|
+
}), z.object({
|
|
164
|
+
kind: z.literal("function"),
|
|
165
|
+
accessTokenKey: z.string().min(1)
|
|
166
|
+
})]);
|
|
167
|
+
const oauthConnectionConfigBaseSchema = z.object({
|
|
168
|
+
kind: z.literal("oauth"),
|
|
169
|
+
authUrl: z.string().url(),
|
|
170
|
+
tokenUrl: z.string().url(),
|
|
171
|
+
scopes: z.array(z.string()).readonly(),
|
|
172
|
+
revokeUrl: z.string().url().nullable().optional(),
|
|
173
|
+
tokenType: z.enum(["long-lived", "refreshable"]),
|
|
174
|
+
pkce: z.boolean().optional(),
|
|
175
|
+
/** Fallback token lifetime when the provider omits `expires_in`. Positive
|
|
176
|
+
* integer seconds. Shared between config + manifest schemas (both extend
|
|
177
|
+
* this base). */
|
|
178
|
+
defaultExpiresInSeconds: z.number().int().positive().optional()
|
|
179
|
+
});
|
|
180
|
+
const oauthConnectionConfigSchema = oauthConnectionConfigBaseSchema.extend({
|
|
181
|
+
...connectionMetadataConfigSchema.shape,
|
|
182
|
+
vault: vaultConfigSchema,
|
|
183
|
+
oauth: registeredDescriptorSchema.optional(),
|
|
184
|
+
buildAuthUrl: z.function().optional(),
|
|
185
|
+
exchangeCode: z.function().optional(),
|
|
186
|
+
refreshToken: z.function().optional(),
|
|
187
|
+
extractInstallationInfo: z.function().optional(),
|
|
188
|
+
validate: z.function().optional()
|
|
189
|
+
});
|
|
190
|
+
const oauthConnectionConfigManifestSchema = oauthConnectionConfigBaseSchema.extend({
|
|
191
|
+
...connectionMetadataManifestSchema.shape,
|
|
192
|
+
vault: vaultManifestSchema,
|
|
193
|
+
oauth: registeredDescriptorSchema.optional()
|
|
194
|
+
});
|
|
195
|
+
const credentialsExchangeConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
196
|
+
kind: z.literal("credentials-exchange"),
|
|
197
|
+
instructions: z.string().min(1).optional(),
|
|
198
|
+
input: zodObjectSchema
|
|
199
|
+
}).extend({
|
|
200
|
+
exchange: z.function(),
|
|
201
|
+
rotate: z.function().optional(),
|
|
202
|
+
validate: z.function().optional()
|
|
203
|
+
});
|
|
204
|
+
/** Manifest projection of `CredentialsExchangeConnectionConfig` — only the
|
|
205
|
+
* declarative `input` schema (rendered as JSON Schema) and `instructions`
|
|
206
|
+
* copy survive serialization. The three hooks (`exchange`, `rotate`,
|
|
207
|
+
* `validate`) are runtime closures and are stripped. */
|
|
208
|
+
const credentialsExchangeConnectionConfigManifestSchema = z.object({
|
|
209
|
+
kind: z.literal("credentials-exchange"),
|
|
210
|
+
...connectionMetadataManifestSchema.shape,
|
|
211
|
+
instructions: z.string().min(1).optional(),
|
|
212
|
+
input: jsonSchemaObject
|
|
213
|
+
});
|
|
214
|
+
const exchangeCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
215
|
+
kind: z.literal("exchange"),
|
|
216
|
+
input: zodObjectSchema,
|
|
217
|
+
exchange: registeredDescriptorSchema
|
|
218
|
+
});
|
|
219
|
+
const exchangeCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
|
|
220
|
+
kind: z.literal("exchange"),
|
|
221
|
+
input: jsonSchemaObject,
|
|
222
|
+
exchange: registeredDescriptorSchema
|
|
223
|
+
});
|
|
224
|
+
const dynamicCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
|
|
225
|
+
kind: z.literal("dynamic"),
|
|
226
|
+
input: zodObjectSchema.optional(),
|
|
227
|
+
resolver: registeredResolverDescriptorSchema
|
|
228
|
+
});
|
|
229
|
+
const dynamicCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
|
|
230
|
+
kind: z.literal("dynamic"),
|
|
231
|
+
input: jsonSchemaObject.optional(),
|
|
232
|
+
resolver: registeredResolverDescriptorSchema
|
|
233
|
+
});
|
|
234
|
+
const platformCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({ kind: z.literal("platform") });
|
|
235
|
+
const platformCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({ kind: z.literal("platform") });
|
|
236
|
+
const connectionConfigSchema = z.discriminatedUnion("kind", [
|
|
237
|
+
manualConnectionConfigSchema,
|
|
238
|
+
oauthConnectionConfigSchema,
|
|
239
|
+
credentialsExchangeConnectionConfigSchema,
|
|
240
|
+
exchangeCredentialConnectionConfigSchema,
|
|
241
|
+
dynamicCredentialConnectionConfigSchema,
|
|
242
|
+
platformCredentialConnectionConfigSchema
|
|
243
|
+
]);
|
|
244
|
+
/** Manifest projection of `ConnectionConfig` — declarative metadata only. */
|
|
245
|
+
const connectionConfigManifestSchema = z.discriminatedUnion("kind", [
|
|
246
|
+
manualConnectionConfigManifestSchema,
|
|
247
|
+
oauthConnectionConfigManifestSchema,
|
|
248
|
+
credentialsExchangeConnectionConfigManifestSchema,
|
|
249
|
+
exchangeCredentialConnectionManifestSchema,
|
|
250
|
+
dynamicCredentialConnectionManifestSchema,
|
|
251
|
+
platformCredentialConnectionManifestSchema
|
|
252
|
+
]);
|
|
253
|
+
const CredentialSetManifestSchema = z.object({
|
|
254
|
+
manifestVersion: z.literal(1),
|
|
255
|
+
type: z.literal("credentialSet"),
|
|
256
|
+
id: credentialSetIdString("Credential set id"),
|
|
257
|
+
name: trimmedNonEmptyString("Credential set name"),
|
|
258
|
+
description: optionalDescriptionString("Credential set description"),
|
|
259
|
+
auth: jsonSchemaObject,
|
|
260
|
+
exposure: credentialExposureSchema.optional(),
|
|
261
|
+
proxy: credentialSetProxyConfigSchema.optional(),
|
|
262
|
+
/** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
|
|
263
|
+
needsRawSecret: z.boolean().optional(),
|
|
264
|
+
/** Policy when a step throws `CredentialRevokedError` against this credential set. */
|
|
265
|
+
onCredentialRevoked: onCredentialRevokedSchema.optional(),
|
|
266
|
+
connections: z.array(connectionConfigManifestSchema).optional()
|
|
267
|
+
});
|
|
268
|
+
z.object({
|
|
269
|
+
id: credentialSetIdString("Credential set id"),
|
|
270
|
+
name: optionalTrimmedNonEmptyString("Credential set name"),
|
|
271
|
+
description: optionalDescriptionString("Credential set description"),
|
|
272
|
+
auth: zodObjectSchema,
|
|
273
|
+
exposure: credentialExposureSchema.optional(),
|
|
274
|
+
proxy: credentialSetProxyConfigSchema.optional(),
|
|
275
|
+
/** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
|
|
276
|
+
needsRawSecret: z.boolean().optional(),
|
|
277
|
+
onCredentialRevoked: onCredentialRevokedSchema.optional(),
|
|
278
|
+
connections: z.array(connectionConfigSchema).readonly().optional()
|
|
279
|
+
});
|
|
280
|
+
//#endregion
|
|
281
|
+
export { descriptionString as a, optionalDescriptionString as c, trimmedNonEmptyStringUnbounded as d, createStructuralSchema as i, optionalTrimmedNonEmptyString as l, credentialSetProxyConfigSchema as n, idNoSpacesString as o, anyZodSchemaSchema as r, jsonSchemaObject as s, CredentialSetManifestSchema as t, trimmedNonEmptyString as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
4
|
-
import { t as createTypedCommand } from "./commander-
|
|
3
|
+
import { n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-DnIFEmi5.mjs";
|
|
4
|
+
import { t as createTypedCommand } from "./commander-C6SSTQJ2.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/commands/search/search.command.ts
|
|
7
7
|
const SearchTypeValues = [
|
|
@@ -46,7 +46,7 @@ function createSearchCommand() {
|
|
|
46
46
|
description: "Search query (matches name and related fields per --type)",
|
|
47
47
|
key: "query"
|
|
48
48
|
},
|
|
49
|
-
loadHandler: async () => (await import("./search.handler-
|
|
49
|
+
loadHandler: async () => (await import("./search.handler-BJ-ZlDL4.mjs")).handleSearch
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import { t as renderCredential } from "./render-credential-
|
|
7
|
-
import {
|
|
8
|
-
import { t as renderOperation } from "./render-operation-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-DnIFEmi5.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-ebZssGCY.mjs";
|
|
6
|
+
import { t as renderCredential } from "./render-credential-D-H1ECDt.mjs";
|
|
7
|
+
import { i as formatPackageInstallCommand, r as detectPackageManager } from "./package-manager-BP3-q8hh.mjs";
|
|
8
|
+
import { t as renderOperation } from "./render-operation-VdEPhoII.mjs";
|
|
9
9
|
//#region src/lib/render-integration.ts
|
|
10
10
|
function renderIntegration(i, { full = false, packageManager } = {}) {
|
|
11
11
|
ui.br();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-DnIFEmi5.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-ebZssGCY.mjs";
|
|
6
|
+
import { i as formatPackageInstallCommand, r as detectPackageManager } from "./package-manager-BP3-q8hh.mjs";
|
|
7
7
|
//#region src/commands/integrations/show.handler.ts
|
|
8
8
|
async function handleIntegrationShow(options, ctx) {
|
|
9
9
|
const client = requireClient(ctx);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
7
|
-
import { t as renderCredential } from "./render-credential-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-DnIFEmi5.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-ebZssGCY.mjs";
|
|
6
|
+
import { o as renderJsonSchema } from "./schema-display-sZ6ConJd.mjs";
|
|
7
|
+
import { t as renderCredential } from "./render-credential-D-H1ECDt.mjs";
|
|
8
8
|
//#region src/commands/credentials/definitions/show.handler.ts
|
|
9
9
|
async function handleCredentialDefinitionShow(options, ctx) {
|
|
10
10
|
const { credential } = await requireClient(ctx).credentials.definitions.get(options.id);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { i as writeJson } from "./output-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as renderOperation } from "./render-operation-
|
|
3
|
+
import { p as ui } from "./keystroke.mjs";
|
|
4
|
+
import { i as writeJson } from "./output-DnIFEmi5.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-ebZssGCY.mjs";
|
|
6
|
+
import { o as renderJsonSchema } from "./schema-display-sZ6ConJd.mjs";
|
|
7
|
+
import { r as detectPackageManager } from "./package-manager-BP3-q8hh.mjs";
|
|
8
|
+
import { t as renderOperation } from "./render-operation-VdEPhoII.mjs";
|
|
9
9
|
//#region src/commands/operations/show.handler.ts
|
|
10
10
|
async function handleOperationShow(options, ctx) {
|
|
11
11
|
const { operation } = await requireClient(ctx).operations.get(options.id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { k as CliExitError, p as ui } from "./keystroke.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { access, cp, mkdir, readFile, readdir, rm, symlink, writeFile } from "node:fs/promises";
|
|
@@ -487,6 +487,8 @@ async function resolveSkillInstallChoices(options) {
|
|
|
487
487
|
//#region src/lib/skill-installer/summary.ts
|
|
488
488
|
function summarizeSkillInstall(result, verb) {
|
|
489
489
|
ui.success(`${verb} ${result.skills.length} Keystroke skill(s) to ${result.canonicalDir}: ${result.skills.join(", ")}`);
|
|
490
|
+
const universalCanonicalAgents = result.agentTargets.filter((target) => target.slug !== "universal" && target.action === "canonical");
|
|
491
|
+
if (universalCanonicalAgents.length > 0) ui.hint(`${universalCanonicalAgents.map((target) => target.label).join(", ")} read skills from ${result.canonicalDir} (no separate agent skill folder).`);
|
|
490
492
|
const additionalTargets = result.agentTargets.filter((target) => target.action !== "canonical");
|
|
491
493
|
if (additionalTargets.length > 0) ui.success(`Provisioned ${additionalTargets.length} agent target(s): ${additionalTargets.map((target) => `${target.label} (${target.path}, ${target.action})`).join(", ")}`);
|
|
492
494
|
const changedGuidance = result.guidanceFiles.filter((file) => file.action !== "skipped");
|