@keystrokehq/cli 0.0.1 → 0.0.3
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/AGENTS-blurb.md +1 -1
- package/LICENSE +0 -21
- package/README.md +14 -6
- package/dist/accept.handler-DFtM0IuO.mjs +22 -0
- package/dist/admin-D_7tenRC.mjs +208 -0
- package/dist/{agent-manifest-CDnbkR2f.mjs → agent-manifest-Bfa3DBgc.mjs} +4 -4
- package/dist/{agents-CZJGxVqV.mjs → agents-DMEo-6QB.mjs} +8 -8
- package/dist/api-keys-BThGvtdn.mjs +58 -0
- package/dist/{auth-DN2VusyU.mjs → auth-CY0Gg9sN.mjs} +7 -11
- package/dist/{auth.handler-CT1BQUvu.mjs → auth.handler-CbhiLOG1.mjs} +83 -8
- package/dist/{build-agents-BmM_AsSd-BGi9wtzt.mjs → build-agents-DfbiMZ_e-CRnzruSu.mjs} +7 -7
- package/dist/{build-metadata-BWS7uhd_-DR8gJjTX.mjs → build-metadata-zidV9Cai-RgG4ndIH.mjs} +11 -11
- package/dist/{build-progress-DgYKb4hB.mjs → build-progress-Cn2j1LqF.mjs} +1 -1
- package/dist/{build-tasks-CdihpudT-D5r5HUHe.mjs → build-tasks-O1jYtlv1-Y65uGWuz.mjs} +4 -5
- package/dist/{build-workflows-CfxBnIWh-CdYPv8w2.mjs → build-workflows-3fdvdHHf-DJ_lH1NH.mjs} +9 -9
- package/dist/{build.handler-4799CjWH.mjs → build.handler-Tb3IpABI.mjs} +5 -5
- package/dist/{clear-cache.handler-B9tqSoSM.mjs → clear-cache.handler-BEbPz5Ej.mjs} +1 -1
- package/dist/{clear.handler-BydlX-zE.mjs → clear.handler-CtOZ4aRn.mjs} +1 -1
- package/dist/{clear.handler-BTIXXPTJ.mjs → clear.handler-YS8gPriq.mjs} +2 -2
- package/dist/{commander-DfTVqQ-3.mjs → commander-DZ3F3CVq.mjs} +6 -5
- package/dist/common-BrVAdUyD.mjs +20 -0
- package/dist/{connect-BUXkeH0F.mjs → connect-DpQgYg8z.mjs} +3 -3
- package/dist/{connect.handler-CYel9cy6.mjs → connect.handler-DuRr_yyN.mjs} +5 -5
- package/dist/{context-T7HZuB97.mjs → context-Y1f1hGYy.mjs} +7 -7
- package/dist/create.handler-uNG3I4wS.mjs +24 -0
- package/dist/credential-requirements-DjDFthio.mjs +480 -0
- package/dist/{credential-schema-mismatch-BKo5PjcQ.mjs → credential-schema-mismatch-B-wwbCvw.mjs} +2 -2
- package/dist/{credentials-OfVHOtG3.mjs → credentials-DHlK_O4L.mjs} +823 -14
- package/dist/{credentials-CvmjU0lK.mjs → credentials-UpgEcaub.mjs} +7 -7
- package/dist/{current-deployment-workflow-poHt27i3.mjs → current-deployment-workflow-M8GEIHxv.mjs} +5 -5
- package/dist/{current.handler-B8zKzfPp.mjs → current.handler-BqPUKCvn.mjs} +1 -1
- package/dist/declared-credential-requirements-Bwlb-KZE.mjs +132 -0
- package/dist/default-urls-BS4twrsS.mjs +7 -0
- package/dist/{delete.handler-bAu1iXVQ.mjs → delete.handler-CJTHVZaz.mjs} +1 -1
- package/dist/{deploy-7Jjls436.mjs → deploy-CdnaZY3s.mjs} +1 -1
- package/dist/{deploy-BOPIpRWm.mjs → deploy-Gw0KPrkf.mjs} +2 -2
- package/dist/{deploy-progress-BmGUNFKg.mjs → deploy-progress-CZ2rPlOj.mjs} +1 -1
- package/dist/{deploy.handler-BAzgiNhd.mjs → deploy.handler-zzFAt7pp.mjs} +18 -18
- package/dist/{detect-env-access-CwkOYeYM-D_BCZqV6.mjs → detect-env-access-CwkOYeYM-h2W05D_Q.mjs} +1 -1
- package/dist/{diff.handler-Du7SY8K4.mjs → diff.handler--zdSkUnK.mjs} +5 -5
- package/dist/{dist-CUK7yBM0.mjs → dist-BF6r1hfv.mjs} +3 -3
- package/dist/{dist-BkJUoBiG.mjs → dist-C2Dq_nx3.mjs} +12 -12
- package/dist/{env-91KwMKov.mjs → env-YTZGKGIu.mjs} +9 -10
- package/dist/{env.handler-BAzBuMzQ.mjs → env.handler-d4sJ706C.mjs} +8 -8
- package/dist/{error-boundary-VL-JLfIa.mjs → error-boundary-B9PgBkv8.mjs} +2 -2
- package/dist/{file-metadata-D1vm-XY2.mjs → file-metadata-CdFXMMIw.mjs} +1 -1
- package/dist/hosted-action-dispatcher-registry-TOVzMhUR.mjs +126 -0
- package/dist/iam-command-utils-CNC8JfZ5.mjs +72 -0
- package/dist/{import-module-CV84H5fZ-B_CBCmb4.mjs → import-module-DDPnzlJ1-CYJD2n2b.mjs} +395 -10
- package/dist/{init-DpMCotSK.mjs → init-C0sps8R7.mjs} +2 -2
- package/dist/{init.handler-CPRnif52.mjs → init.handler-DSW6XFZn.mjs} +17 -17
- package/dist/{inspect.handler-DT_cD036.mjs → inspect.handler-DbN0ZVTh.mjs} +5 -5
- package/dist/{integration-catalog-Bt-L3GjF.mjs → integration-catalog-DFlytKJS.mjs} +2 -2
- package/dist/{integrations-DlatPK4W.mjs → integrations-Dcadds2b.mjs} +5 -5
- package/dist/invites-DvsxTRAb.mjs +44 -0
- package/dist/invites.list.handler-B5quln3m.mjs +43 -0
- package/dist/invites.resend.handler-CSpj7bQ5.mjs +23 -0
- package/dist/invites.revoke.handler-_hdEkBdO.mjs +28 -0
- package/dist/keystroke.mjs +31 -22
- package/dist/{list-enrichment-y-cwizLr.mjs → list-enrichment-CTqx0Rk_.mjs} +1 -1
- package/dist/{list.handler-CWF_Dj15.mjs → list.handler-08GY-wnx.mjs} +1 -1
- package/dist/{list.handler-DWaQkJaR.mjs → list.handler-20v4uRMk.mjs} +2 -2
- package/dist/{list.handler-BTWvCyjA.mjs → list.handler-BRq-nScx.mjs} +5 -5
- package/dist/{list.handler-lq3ZGAn4.mjs → list.handler-CWO6DExh.mjs} +3 -3
- package/dist/{list.handler-CZ6G2x_G.mjs → list.handler-DAiJtW20.mjs} +3 -3
- package/dist/list.handler-DLl8ca6F.mjs +42 -0
- package/dist/{list.handler-DqbFcBW7.mjs → list.handler-DSPr0OxS.mjs} +7 -7
- package/dist/{logs-BEg9L5l8.mjs → logs-D_48skmi.mjs} +3 -3
- package/dist/{logs.handler-BD_dXiL1.mjs → logs.handler-4ctMVYMj.mjs} +3 -3
- package/dist/{logs.handler-6hoMBzqw.mjs → logs.handler-C3QnSCaH.mjs} +1 -1
- package/dist/members.add.handler-Dq_giQ8g.mjs +31 -0
- package/dist/members.invite.handler-v404bUsq.mjs +32 -0
- package/dist/members.list.handler-D6TE0yp8.mjs +43 -0
- package/dist/members.remove.handler-BhQ3cyeR.mjs +28 -0
- package/dist/members.update.handler-BVy2cv1K.mjs +28 -0
- package/dist/{metadata-layout-GUYIUo0i-_aG2zjue.mjs → metadata-layout-C6ed-9dl-aBmqqvD5.mjs} +2 -2
- package/dist/{normalize-path-CojS-CgQ-DLCOvnD1.mjs → normalize-path-CojS-CgQ-BKRFUzWW.mjs} +1 -1
- package/dist/org-CkRr-f3S.mjs +234 -0
- package/dist/orgs.create.handler-swGnT2ce.mjs +26 -0
- package/dist/orgs.get.handler-ClAqYTH0.mjs +28 -0
- package/dist/orgs.list.handler-D-ptz8It.mjs +41 -0
- package/dist/{paused.handler-BMFm9Cff.mjs → paused.handler-B3aVqw-m.mjs} +2 -2
- package/dist/{project-config-D1qsQlO7.mjs → project-config-opj6DsPF.mjs} +2 -2
- package/dist/{projects-CHkRE9rS.mjs → projects-Bdl6-Z8l.mjs} +2 -2
- package/dist/{projects-Cjb7sovS.mjs → projects-yA9AAaDM.mjs} +5 -5
- package/dist/{register.handler-BPCdor1_.mjs → register.handler-WzpvVXHx.mjs} +1 -1
- package/dist/{requirements.handler-DPXdSks3.mjs → requirements.handler-coArDE8x.mjs} +7 -7
- package/dist/{resolve-project-DDJ29sCF.mjs → resolve-project-DgfftdPm.mjs} +2 -2
- package/dist/{runs-D9hNLb9A.mjs → runs-B8mW4PqP.mjs} +3 -3
- package/dist/schedule-BRN4hzQM.mjs +505 -0
- package/dist/schema-_FQrHcIS.mjs +17 -0
- package/dist/schema-kbMHVnhm.mjs +81 -0
- package/dist/schemas-DsvCZfF0.mjs +42 -0
- package/dist/{skills-sync.handler-DIy8GR16.mjs → skills-sync.handler-C2faeat-.mjs} +2 -2
- package/dist/{skills.command-CrjI2dN9.mjs → skills.command-DWxcc3Ui.mjs} +4 -4
- package/dist/source-analysis-BspLa3E5.mjs +75 -0
- package/dist/{source-analysis-Cj-ADyu--BJQcFPCG.mjs → source-analysis-DEEChuND-eixwPnPP.mjs} +5 -5
- package/dist/{src-eHwu-Gfw.mjs → src-J09NGJ6Z.mjs} +42 -6
- package/dist/{switch.handler-D_9213Vf.mjs → switch.handler-C4hgbhcH.mjs} +2 -2
- package/dist/{sync-BL_Mo5st.mjs → sync-CL6zXiiA.mjs} +2 -2
- package/dist/{sync.handler-BUFPdzWz.mjs → sync.handler-D1uF8E8I.mjs} +8 -8
- package/dist/{schemas-CDib1RhE.mjs → task-DsrXI6XH.mjs} +10 -39
- package/dist/{task-target-build-CBeCKbu2.mjs → task-target-build-DTzz4fpG.mjs} +4 -4
- package/dist/task-target-deploy-BPLlP__P.mjs +4 -0
- package/dist/{task-target-deploy-CA6elFpF-BEr4gkol.mjs → task-target-deploy-Bf5i3ox1-BU16VPsE.mjs} +2 -3
- package/dist/task-target-deploy-runner.mjs +15 -14
- package/dist/{test-BHTgR3UA.mjs → test-BsTLXIPB.mjs} +31 -31
- package/dist/{test.handler-BcPQ8b74.mjs → test.handler-D25kziPi.mjs} +1 -1
- package/dist/{trigger-artifacts-DQPbQNqC-B4yeeFBY.mjs → trigger-artifacts-B3OCTX9K-DG-FGGJT.mjs} +5 -5
- package/dist/{trigger-manifest-CY7brZeg.mjs → trigger-manifest-CXD9I7Rb.mjs} +1 -2
- package/dist/{try-deploy.handler-DqybNhXx.mjs → try-deploy.handler-2aX5TmLk.mjs} +11 -11
- package/dist/{upload.handler-DCtiznQp.mjs → upload.handler-CqProKVJ.mjs} +10 -10
- package/dist/users.get.handler-C_d2GWKX.mjs +24 -0
- package/dist/users.list.handler-DXAsO8Yk.mjs +36 -0
- package/dist/users.set-role.handler-Bn_yV4RI.mjs +27 -0
- package/dist/{utils-CywxCDM7.mjs → utils-DlYHjGg9.mjs} +2 -2
- package/dist/{validate.handler-DOcTaJL0.mjs → validate.handler-CGD6GttR.mjs} +5 -5
- package/dist/{workflow-build-DBQaBfnn.mjs → workflow-build-BcaIdRR6.mjs} +22 -45
- package/dist/{workflow-bundler-BPiqVscj-X1PFFAuP.mjs → workflow-bundler-BzHk73PM-Cde7cKiU.mjs} +4 -4
- package/dist/{_manifest-JSRE3H8k.mjs → workflow-manifest-CAW5FlX0.mjs} +7 -131
- package/dist/{workflows-g9z87AJJ.mjs → workflows-S-gbfw8f.mjs} +16 -15
- package/dist/{writer-BG8poUm3-BbXlU2kI.mjs → writer-CtvttJdP-DrJruQgR.mjs} +8 -8
- package/package.json +9 -11
- package/THIRD_PARTY_NOTICES.md +0 -16
- package/dist/api-keys-D2lgguuY.mjs +0 -40
- package/dist/org-xLzBtt2_.mjs +0 -41
- package/dist/schedule-BXx3uXwr.mjs +0 -1142
- package/dist/src-C0X6u_Mw.mjs +0 -1340
- package/dist/task-B2sZMaZu.mjs +0 -8
- package/dist/task-target-deploy-C5X-USeR.mjs +0 -4
- /package/dist/{agent-bundle-package-DWV6B_5q-BtV7Xycc.mjs → agent-bundle-package-DWV6B_5q-FPT0bJaA.mjs} +0 -0
- /package/dist/{browser-qwFrUH82.mjs → browser-gddMccBQ.mjs} +0 -0
- /package/dist/{concurrency-gXn9Rw8x-DNl2YtrS.mjs → concurrency-gXn9Rw8x-BTlfau8D.mjs} +0 -0
- /package/dist/{constants-CPpPdSNg.mjs → constants-DHdiT5hc.mjs} +0 -0
- /package/dist/{credential-env-map-CI8yWHVy.mjs → credential-env-map-C8P7uTD-.mjs} +0 -0
- /package/dist/{diff-utils-NEfcjqxt.mjs → diff-utils-DWNcRA8g.mjs} +0 -0
- /package/dist/{get-intrinsic-zLxwtrLK.mjs → get-intrinsic-ZMBBjBEr.mjs} +0 -0
- /package/dist/{layout-CbMtQ2tm.mjs → layout-B95Tku8F.mjs} +0 -0
- /package/dist/{options-CeaTcFxP.mjs → options-Dn9t3K4a.mjs} +0 -0
- /package/dist/{output-DM4b7KgY.mjs → output-q4KljAhu.mjs} +0 -0
- /package/dist/{oxc-B3KI3rf_-n9d1hKNq.mjs → oxc-B3KI3rf_-BeimiQ2U.mjs} +0 -0
- /package/dist/{read-credential-keys-77a91T8M-KA0Iw0Z1.mjs → read-credential-keys-77a91T8M-CAJLnMRi.mjs} +0 -0
- /package/dist/{rolldown-runtime-twds-ZHy-BWWzu8VG.mjs → rolldown-runtime-twds-ZHy-8uqgIurC.mjs} +0 -0
- /package/dist/{run-polling-CAgFRdK3.mjs → run-polling-CTzhTgyN.mjs} +0 -0
- /package/dist/{schema-17qMfNyI.mjs → schema-Di90TXoX.mjs} +0 -0
- /package/dist/{schema-display-CgmeKigW.mjs → schema-display-D4A1gQEM.mjs} +0 -0
- /package/dist/{skills.handler-Bz8bJKql.mjs → skills.handler-8KCSF7wp.mjs} +0 -0
- /package/dist/{spinner-progress-DMVwgqO9.mjs → spinner-progress-bvKd1jXc.mjs} +0 -0
- /package/dist/{status.handler-BO4nwvWn.mjs → status.handler-D9GBEmao.mjs} +0 -0
- /package/dist/{sync-keystroke-agent-skills-Kx_H7UTd.mjs → sync-keystroke-agent-skills-CY9h25_5.mjs} +0 -0
- /package/dist/{upload-CkU--iDC.mjs → upload-B8fiWveA.mjs} +0 -0
|
@@ -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-q4KljAhu.mjs";
|
|
4
|
+
import { t as createTypedCommand } from "./commander-DZ3F3CVq.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/commands/skills/skills.command.ts
|
|
7
7
|
const SkillsCommandOptionsSchema = JsonOptionSchema.extend({ path: z.string().optional().describe("Project root (default: current directory)") });
|
|
@@ -18,13 +18,13 @@ function createSkillsCommand() {
|
|
|
18
18
|
description: "Sync Keystroke agent skills (SKILL.md) from @keystroke/skills",
|
|
19
19
|
schema: SkillsCommandOptionsSchema,
|
|
20
20
|
optionsConfig: SKILLS_OPTIONS_CONFIG,
|
|
21
|
-
loadHandler: async () => (await import("./skills.handler-
|
|
21
|
+
loadHandler: async () => (await import("./skills.handler-8KCSF7wp.mjs")).handleSkillsParent,
|
|
22
22
|
subcommands: [createTypedCommand({
|
|
23
23
|
name: "sync",
|
|
24
24
|
description: "Copy installed @keystroke/skills into .cursor/skills and .claude/skills",
|
|
25
25
|
schema: SkillsCommandOptionsSchema,
|
|
26
26
|
optionsConfig: SKILLS_OPTIONS_CONFIG,
|
|
27
|
-
loadHandler: async () => (await import("./skills-sync.handler-
|
|
27
|
+
loadHandler: async () => (await import("./skills-sync.handler-C2faeat-.mjs")).handleSkillsSync
|
|
28
28
|
})]
|
|
29
29
|
});
|
|
30
30
|
cmd.enablePositionalOptions();
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region ../../packages/core/src/artifacts/source-analysis.ts
|
|
5
|
+
const SourceLocationSchema = z.object({
|
|
6
|
+
filePath: z.string().min(1),
|
|
7
|
+
absoluteFilePath: z.string().min(1).optional(),
|
|
8
|
+
line: z.number().int().positive(),
|
|
9
|
+
column: z.number().int().positive(),
|
|
10
|
+
position: z.number().int().nonnegative().optional(),
|
|
11
|
+
endLine: z.number().int().positive(),
|
|
12
|
+
endColumn: z.number().int().positive(),
|
|
13
|
+
endPosition: z.number().int().nonnegative().optional(),
|
|
14
|
+
synthetic: z.boolean().optional()
|
|
15
|
+
});
|
|
16
|
+
const CallsiteFingerprintSchema = z.string().min(1);
|
|
17
|
+
const ImportSourceSchema = z.object({
|
|
18
|
+
kind: z.enum([
|
|
19
|
+
"local",
|
|
20
|
+
"module-import",
|
|
21
|
+
"namespace-import",
|
|
22
|
+
"dynamic"
|
|
23
|
+
]),
|
|
24
|
+
moduleSpecifier: z.string().min(1).optional(),
|
|
25
|
+
importName: z.string().min(1).optional(),
|
|
26
|
+
localName: z.string().min(1).optional(),
|
|
27
|
+
resolvedPath: z.string().min(1).optional()
|
|
28
|
+
});
|
|
29
|
+
const CallKindSchema = z.enum([
|
|
30
|
+
"workflow-step",
|
|
31
|
+
"agent",
|
|
32
|
+
"tool",
|
|
33
|
+
"hook",
|
|
34
|
+
"child-workflow",
|
|
35
|
+
"function-call",
|
|
36
|
+
"method-call",
|
|
37
|
+
"dynamic-call",
|
|
38
|
+
"parallel-call",
|
|
39
|
+
"process-exit",
|
|
40
|
+
"iife",
|
|
41
|
+
"expression"
|
|
42
|
+
]);
|
|
43
|
+
const CapturedVariableSourceKindSchema = z.enum([
|
|
44
|
+
"local-const",
|
|
45
|
+
"relative-import",
|
|
46
|
+
"package-import"
|
|
47
|
+
]);
|
|
48
|
+
const CapturedVariableValueTypeSchema = z.enum([
|
|
49
|
+
"string",
|
|
50
|
+
"number",
|
|
51
|
+
"boolean",
|
|
52
|
+
"object",
|
|
53
|
+
"array",
|
|
54
|
+
"function",
|
|
55
|
+
"unknown"
|
|
56
|
+
]);
|
|
57
|
+
const CapturedVariableSchema = z.object({
|
|
58
|
+
name: z.string().min(1),
|
|
59
|
+
value: z.union([
|
|
60
|
+
z.string(),
|
|
61
|
+
z.number(),
|
|
62
|
+
z.boolean()
|
|
63
|
+
]).optional(),
|
|
64
|
+
sourceText: z.string().optional(),
|
|
65
|
+
valueType: CapturedVariableValueTypeSchema,
|
|
66
|
+
resolvable: z.boolean(),
|
|
67
|
+
source: CapturedVariableSourceKindSchema,
|
|
68
|
+
importPath: z.string().optional(),
|
|
69
|
+
declaration: z.object({
|
|
70
|
+
filePath: z.string().min(1),
|
|
71
|
+
line: z.number().int().positive()
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { SourceLocationSchema as a, ImportSourceSchema as i, CallsiteFingerprintSchema as n, CapturedVariableSchema as r, CallKindSchema as t };
|
package/dist/{source-analysis-Cj-ADyu--BJQcFPCG.mjs → source-analysis-DEEChuND-eixwPnPP.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { d as getMetadataRoot } from "./layout-
|
|
4
|
-
import { t as BASE_IGNORE_PATTERNS } from "./metadata-layout-
|
|
5
|
-
import { a as literalString, l as unwrapExpression, n as identifierName, r as isNode } from "./oxc-B3KI3rf_-
|
|
3
|
+
import { d as getMetadataRoot } from "./layout-B95Tku8F.mjs";
|
|
4
|
+
import { t as BASE_IGNORE_PATTERNS } from "./metadata-layout-C6ed-9dl-aBmqqvD5.mjs";
|
|
5
|
+
import { a as literalString, l as unwrapExpression, n as identifierName, r as isNode } from "./oxc-B3KI3rf_-BeimiQ2U.mjs";
|
|
6
6
|
import { readFile, readdir, rm } from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
//#region ../../packages/workflow-builder/dist/source-analysis-
|
|
8
|
+
//#region ../../packages/workflow-builder/dist/source-analysis-DEEChuND.mjs
|
|
9
9
|
async function removeAllMetadataArtifacts(outputDir) {
|
|
10
10
|
await rm(getMetadataRoot(outputDir), {
|
|
11
11
|
recursive: true,
|
|
@@ -41,7 +41,7 @@ const DISCOVERY_GLOB = [
|
|
|
41
41
|
"**/*.mts"
|
|
42
42
|
];
|
|
43
43
|
const DISCOVERY_IGNORE = [...BASE_IGNORE_PATTERNS, "**/dist/**"];
|
|
44
|
-
const WORKFLOW_IMPORT_SOURCES = ["@
|
|
44
|
+
const WORKFLOW_IMPORT_SOURCES = ["@keystrokehq/core"];
|
|
45
45
|
const AGENT_FACTORY_IMPORT_SOURCES = ["@keystroke/integration-ai"];
|
|
46
46
|
const AGENT_FACTORY_NAMES = ["agent"];
|
|
47
47
|
function getLocalModuleSpecifier(moduleSpecifier) {
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { a as createKyInstance, i as buildSearchParams, n as auth, r as bundles, s as getClientEnv, t as projects$1 } from "./projects-
|
|
3
|
+
import { a as createKyInstance, i as buildSearchParams, n as auth, r as bundles, s as getClientEnv, t as projects$1 } from "./projects-Bdl6-Z8l.mjs";
|
|
4
|
+
//#region ../../packages/workflow-sdk/src/v1/admin.ts
|
|
5
|
+
const admin = (api) => ({
|
|
6
|
+
orgs: {
|
|
7
|
+
/** Create an organization. Requires system.create_org. */
|
|
8
|
+
create: (params) => api.post("organizations", { json: params }).json(),
|
|
9
|
+
/** List all organizations. Requires system.view_orgs. */
|
|
10
|
+
list: (params) => api.get("admin/orgs", { searchParams: params }).json(),
|
|
11
|
+
/** Get any organization by ID. Requires system.view_orgs. */
|
|
12
|
+
get: (id) => api.get(`admin/orgs/${id}`).json()
|
|
13
|
+
},
|
|
14
|
+
users: {
|
|
15
|
+
list: (params) => api.get("admin/users", { searchParams: params }).json(),
|
|
16
|
+
get: (id) => api.get(`admin/users/${id}`).json(),
|
|
17
|
+
setRole: (id, params) => api.patch(`admin/users/${id}/system-role`, { json: params }).json()
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
4
21
|
//#region ../../packages/workflow-sdk/src/v1/agents.ts
|
|
5
22
|
const agents = (api) => ({ list: (params) => api.get("agents", { searchParams: params }).json() });
|
|
6
23
|
//#endregion
|
|
@@ -96,7 +113,19 @@ const organizations = (api) => ({
|
|
|
96
113
|
/** Update an organization. */
|
|
97
114
|
update: (id, params) => api.patch(`organizations/${id}`, { json: params }).json(),
|
|
98
115
|
/** Delete an organization. */
|
|
99
|
-
remove: (id) => api.delete(`organizations/${id}`).json()
|
|
116
|
+
remove: (id) => api.delete(`organizations/${id}`).json(),
|
|
117
|
+
members: {
|
|
118
|
+
list: (organizationId) => api.get(`organizations/${organizationId}/members`).json(),
|
|
119
|
+
add: (organizationId, params) => api.post(`organizations/${organizationId}/members`, { json: params }).json(),
|
|
120
|
+
update: (organizationId, userId, params) => api.patch(`organizations/${organizationId}/members/${userId}`, { json: params }).json(),
|
|
121
|
+
remove: (organizationId, userId) => api.delete(`organizations/${organizationId}/members/${userId}`).json(),
|
|
122
|
+
invite: (params) => api.post("users/invite", { json: params }).json()
|
|
123
|
+
},
|
|
124
|
+
invites: {
|
|
125
|
+
list: (organizationId, params) => api.get(`organizations/${organizationId}/invites`, { searchParams: params }).json(),
|
|
126
|
+
resend: (organizationId, inviteId) => api.post(`organizations/${organizationId}/invites/${inviteId}/resend`).json(),
|
|
127
|
+
revoke: (organizationId, inviteId) => api.delete(`organizations/${organizationId}/invites/${inviteId}`).json()
|
|
128
|
+
}
|
|
100
129
|
});
|
|
101
130
|
//#endregion
|
|
102
131
|
//#region ../../packages/workflow-sdk/src/v1/projects.ts
|
|
@@ -206,16 +235,22 @@ const userGroups = (api) => ({
|
|
|
206
235
|
//#endregion
|
|
207
236
|
//#region ../../packages/workflow-sdk/src/v1/users.ts
|
|
208
237
|
const users = (api) => ({
|
|
209
|
-
/** Create a new user. */
|
|
210
|
-
create: (params) => api.post("users", { json: params }).json(),
|
|
211
238
|
/** Get the currently authenticated user. */
|
|
212
239
|
getMe: () => api.get("users/me").json(),
|
|
213
240
|
/** List current user's workflow subscriptions across projects. */
|
|
214
241
|
listSubscriptions: () => api.get("users/me/subscriptions").json(),
|
|
215
242
|
/** Get a user by ID. */
|
|
216
243
|
getById: (id) => api.get(`users/${id}`).json(),
|
|
217
|
-
/**
|
|
218
|
-
|
|
244
|
+
/**
|
|
245
|
+
* Invite users to an organization by email. When `organizationId` is omitted
|
|
246
|
+
* the server falls back to the caller's active org from the
|
|
247
|
+
* `X-Organization-Id` header. `role` defaults to `builder`.
|
|
248
|
+
*/
|
|
249
|
+
invite: (params) => api.post("users/invite", { json: params }).json(),
|
|
250
|
+
invites: {
|
|
251
|
+
listPending: () => api.get("users/me/invites").json(),
|
|
252
|
+
accept: (inviteId) => api.post(`users/me/invites/${inviteId}/accept`).json()
|
|
253
|
+
}
|
|
219
254
|
});
|
|
220
255
|
//#endregion
|
|
221
256
|
//#region ../../packages/workflow-sdk/src/v1/webhooks.ts
|
|
@@ -348,6 +383,7 @@ function createClient(config = {}) {
|
|
|
348
383
|
}).extend((options) => ({ prefixUrl: `${options.prefixUrl}/api/v1` }));
|
|
349
384
|
return {
|
|
350
385
|
agents: agents(v1),
|
|
386
|
+
admin: admin(v1),
|
|
351
387
|
apiKeys: apiKeys(v1),
|
|
352
388
|
public: publicApi(v1),
|
|
353
389
|
bundles: bundles(v1),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { D as throwReportedCliExit, t as ui } from "./keystroke.mjs";
|
|
4
|
-
import { u as setActiveOrg } from "./dist-
|
|
5
|
-
import { i as requireClient } from "./context-
|
|
4
|
+
import { u as setActiveOrg } from "./dist-BF6r1hfv.mjs";
|
|
5
|
+
import { i as requireClient } from "./context-Y1f1hGYy.mjs";
|
|
6
6
|
import { select } from "@clack/prompts";
|
|
7
7
|
//#region src/commands/org/switch.handler.ts
|
|
8
8
|
async function handleOrgSwitch(_options, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { t as createTypedCommand } from "./commander-
|
|
3
|
+
import { t as createTypedCommand } from "./commander-DZ3F3CVq.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/commands/sync/sync.command.ts
|
|
6
6
|
/**
|
|
@@ -32,7 +32,7 @@ function createSyncCommand() {
|
|
|
32
32
|
description: "Sync local workflows with Keystroke",
|
|
33
33
|
schema: SyncOptionsSchema,
|
|
34
34
|
optionsConfig: SYNC_OPTIONS_CONFIG,
|
|
35
|
-
loadHandler: async () => (await import("./sync.handler-
|
|
35
|
+
loadHandler: async () => (await import("./sync.handler-D1uF8E8I.mjs")).handleSync
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { D as throwReportedCliExit, h as toErrorMessage, i as logger, t as ui } from "./keystroke.mjs";
|
|
4
|
-
import { d as trackProject } from "./dist-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
10
|
-
import { t as createBuildProgress } from "./build-progress-
|
|
11
|
-
import { t as createDeployProgress } from "./deploy-progress-
|
|
4
|
+
import { d as trackProject } from "./dist-BF6r1hfv.mjs";
|
|
5
|
+
import { r as isLocalMode } from "./env-YTZGKGIu.mjs";
|
|
6
|
+
import { a as validateApiKey, i as requireClient } from "./context-Y1f1hGYy.mjs";
|
|
7
|
+
import { n as deployFromDir } from "./dist-C2Dq_nx3.mjs";
|
|
8
|
+
import { t as requireWorkflowsDir } from "./resolve-project-DgfftdPm.mjs";
|
|
9
|
+
import { a as runWorkflowBuild, n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-BcaIdRR6.mjs";
|
|
10
|
+
import { t as createBuildProgress } from "./build-progress-Cn2j1LqF.mjs";
|
|
11
|
+
import { t as createDeployProgress } from "./deploy-progress-CZ2rPlOj.mjs";
|
|
12
12
|
//#region src/commands/sync/sync.handler.ts
|
|
13
13
|
async function handleSync(options, ctx) {
|
|
14
14
|
try {
|
|
@@ -1,44 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
|
|
4
|
+
import { r as SHA256HashSchema } from "./common-BrVAdUyD.mjs";
|
|
5
|
+
import { a as idNoSpacesString, c as optionalDescriptionString, f as trimmedNonEmptyString, n as createStructuralSchema, o as jsonSchemaObject, p as trimmedNonEmptyStringUnbounded } from "./schema-kbMHVnhm.mjs";
|
|
6
|
+
import { t as DurationSchema } from "./schedule-BRN4hzQM.mjs";
|
|
7
|
+
import { n as TriggerRuntimeDescriptorSchema, t as TriggerManifestSchema } from "./schemas-DsvCZfF0.mjs";
|
|
4
8
|
import { z } from "zod";
|
|
5
|
-
//#region ../../packages/
|
|
6
|
-
const credentialSetInstanceSchema = createStructuralSchema([
|
|
7
|
-
"id",
|
|
8
|
-
"auth",
|
|
9
|
-
"needsResolve"
|
|
10
|
-
], "a CredentialSet instance");
|
|
11
|
-
const TriggerModeDefaultSchema = z.enum(["managed", "subscribable"]);
|
|
12
|
-
const TriggerCallbackPresenceSchema = z.object({
|
|
13
|
-
filter: z.boolean(),
|
|
14
|
-
idempotencyKey: z.boolean(),
|
|
15
|
-
poll: z.boolean().optional(),
|
|
16
|
-
transformAllowed: z.boolean(),
|
|
17
|
-
verify: z.boolean().optional()
|
|
18
|
-
});
|
|
19
|
-
const TriggerRuntimeDescriptorSchema = z.object({ callbacks: TriggerCallbackPresenceSchema });
|
|
20
|
-
const TriggerManifestSchema = z.object({
|
|
21
|
-
manifestVersion: z.literal(1),
|
|
22
|
-
type: z.literal("trigger"),
|
|
23
|
-
triggerType: TriggerTypeSchema,
|
|
24
|
-
name: trimmedNonEmptyString("Trigger name"),
|
|
25
|
-
description: descriptionString("Trigger description"),
|
|
26
|
-
enabled: z.boolean(),
|
|
27
|
-
modeDefault: TriggerModeDefaultSchema,
|
|
28
|
-
executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
|
|
29
|
-
credentialSets: z.array(CredentialSetManifestSchema).optional(),
|
|
30
|
-
runtime: TriggerRuntimeDescriptorSchema
|
|
31
|
-
});
|
|
32
|
-
const triggerBaseConfigSchema = z.object({
|
|
33
|
-
credentialSets: z.array(credentialSetInstanceSchema).optional(),
|
|
34
|
-
description: descriptionString("Trigger description"),
|
|
35
|
-
enabled: z.boolean().default(true),
|
|
36
|
-
executionIdentityPolicy: ExecutionIdentityPolicySchema.optional(),
|
|
37
|
-
modeDefault: TriggerModeDefaultSchema.default("managed"),
|
|
38
|
-
name: trimmedNonEmptyString("Trigger name")
|
|
39
|
-
});
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region ../../packages/workflow-core/src/task/schemas.ts
|
|
9
|
+
//#region ../../packages/core/src/task/schemas.ts
|
|
42
10
|
const agentInstanceSchema = createStructuralSchema([
|
|
43
11
|
"id",
|
|
44
12
|
"name",
|
|
@@ -122,4 +90,7 @@ const TaskBuildManifestSchema = z.object({
|
|
|
122
90
|
buildInfo: TaskBuildInfoStubSchema
|
|
123
91
|
}).strict();
|
|
124
92
|
//#endregion
|
|
125
|
-
|
|
93
|
+
//#region ../../packages/core/src/task/index.ts
|
|
94
|
+
var task_exports = /* @__PURE__ */ __exportAll({ TaskBuildManifestSchema: () => TaskBuildManifestSchema });
|
|
95
|
+
//#endregion
|
|
96
|
+
export { TaskBuildManifestSchema as n, task_exports as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-
|
|
3
|
+
import { t as readCredentialKeysFromSchemaObject } from "./read-credential-keys-77a91T8M-CAJLnMRi.mjs";
|
|
4
4
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
@@ -109,7 +109,7 @@ async function buildTaskTargetFile(options) {
|
|
|
109
109
|
return builtTasks;
|
|
110
110
|
}
|
|
111
111
|
async function bundleTaskTargetModule(options) {
|
|
112
|
-
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-
|
|
112
|
+
const [{ rolldown }, { createEnvAccessPlugin, formatEnvAccessError }] = await Promise.all([import("rolldown"), import("./detect-env-access-CwkOYeYM-h2W05D_Q.mjs").then((n) => n.n).then((n) => n.n)]);
|
|
113
113
|
const entryId = "\0virtual:task-target-entry";
|
|
114
114
|
const trackedDependencies = /* @__PURE__ */ new Set();
|
|
115
115
|
const envViolations = [];
|
|
@@ -216,7 +216,7 @@ async function attachTaskTargetTriggers(options) {
|
|
|
216
216
|
options.artifact.triggers.push(...buildTaskTriggerArtifactsWithoutBundles(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName));
|
|
217
217
|
return [];
|
|
218
218
|
}
|
|
219
|
-
const { buildTriggerArtifacts } = await import("./trigger-artifacts-
|
|
219
|
+
const { buildTriggerArtifacts } = await import("./trigger-artifacts-B3OCTX9K-DG-FGGJT.mjs").then((n) => n.n);
|
|
220
220
|
const triggerResult = await buildTriggerArtifacts(options.entry.taskMetadata.triggers, options.artifact.task.taskId, options.artifact.task.taskName, options.projectRoot, {
|
|
221
221
|
workflowExportName: options.entry.source.localExportName,
|
|
222
222
|
workflowFilePath: options.entry.runtimeBundlePath
|
|
@@ -319,7 +319,7 @@ function createPreparedTaskTarget(artifact, triggers) {
|
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
async function tryParseTaskBuildManifest(manifest) {
|
|
322
|
-
const { TaskBuildManifestSchema } = await import("./task-
|
|
322
|
+
const { TaskBuildManifestSchema } = await import("./task-DsrXI6XH.mjs").then((n) => n.t);
|
|
323
323
|
const result = TaskBuildManifestSchema.safeParse(manifest);
|
|
324
324
|
return result.success ? result.data : null;
|
|
325
325
|
}
|
package/dist/{task-target-deploy-CA6elFpF-BEr4gkol.mjs → task-target-deploy-Bf5i3ox1-BU16VPsE.mjs}
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import "./_manifest-JSRE3H8k.mjs";
|
|
3
|
+
import { r as SHA256HashSchema } from "./common-BrVAdUyD.mjs";
|
|
5
4
|
import { createHash } from "node:crypto";
|
|
6
5
|
//#region ../../packages/shared-types/src/deployments/api/snapshot-payload.ts
|
|
7
6
|
function sortObjectKeysDeep(value) {
|
|
@@ -101,7 +100,7 @@ function buildCanonicalProjectSnapshotPayload(params) {
|
|
|
101
100
|
};
|
|
102
101
|
}
|
|
103
102
|
//#endregion
|
|
104
|
-
//#region ../../packages/workflow-deploy/dist/task-target-deploy-
|
|
103
|
+
//#region ../../packages/workflow-deploy/dist/task-target-deploy-Bf5i3ox1.mjs
|
|
105
104
|
function computeProjectSnapshotHash(params) {
|
|
106
105
|
const hex = createHash("sha256").update(JSON.stringify(buildCanonicalProjectSnapshotPayload({
|
|
107
106
|
workflows: params.workflows,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import "./default-urls-BS4twrsS.mjs";
|
|
4
|
+
import { l as resolveAuthOptions } from "./dist-BF6r1hfv.mjs";
|
|
5
|
+
import { n as findProjectRoot, t as assertWorkflowProjectRoot } from "./project-config-opj6DsPF.mjs";
|
|
5
6
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
6
7
|
import path from "node:path";
|
|
7
8
|
import { spawnSync } from "node:child_process";
|
|
@@ -50,8 +51,8 @@ function parseArgs(argv) {
|
|
|
50
51
|
} else if (arg === "--api-key") {
|
|
51
52
|
options.apiKey = argv[index + 1];
|
|
52
53
|
index += 1;
|
|
53
|
-
} else if (arg === "--
|
|
54
|
-
options.
|
|
54
|
+
} else if (arg === "--server-url") {
|
|
55
|
+
options.serverUrl = argv[index + 1];
|
|
55
56
|
index += 1;
|
|
56
57
|
} else if (arg === "--org") {
|
|
57
58
|
options.org = argv[index + 1];
|
|
@@ -103,7 +104,7 @@ function restartStage(options, projectRoot, stage) {
|
|
|
103
104
|
...options.force ? ["--force"] : [],
|
|
104
105
|
...options.disableSourcemaps ? ["--disable-sourcemaps"] : [],
|
|
105
106
|
...options.apiKey ? ["--api-key", options.apiKey] : [],
|
|
106
|
-
...options.
|
|
107
|
+
...options.serverUrl ? ["--server-url", options.serverUrl] : [],
|
|
107
108
|
...options.org ? ["--org", options.org] : [],
|
|
108
109
|
...options.targetFiles.flatMap((targetFile) => ["--target", targetFile])
|
|
109
110
|
];
|
|
@@ -115,7 +116,7 @@ function restartStage(options, projectRoot, stage) {
|
|
|
115
116
|
}
|
|
116
117
|
async function runBuildPhase(options, projectRoot) {
|
|
117
118
|
const projectConfig = await assertWorkflowProjectRoot(projectRoot);
|
|
118
|
-
const { buildTaskTargetEntries } = await import("./task-target-build-
|
|
119
|
+
const { buildTaskTargetEntries } = await import("./task-target-build-DTzz4fpG.mjs");
|
|
119
120
|
await writeBuildDescriptor(projectRoot, {
|
|
120
121
|
projectRoot,
|
|
121
122
|
projectConfig,
|
|
@@ -128,7 +129,7 @@ async function runBuildPhase(options, projectRoot) {
|
|
|
128
129
|
}
|
|
129
130
|
async function runPreparePhase(projectRoot) {
|
|
130
131
|
const buildDescriptor = await readBuildDescriptor(projectRoot);
|
|
131
|
-
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-
|
|
132
|
+
const { prepareTaskTargetBuiltTasks } = await import("./task-target-build-DTzz4fpG.mjs");
|
|
132
133
|
const prepareResult = await prepareTaskTargetBuiltTasks({
|
|
133
134
|
builtTasks: buildDescriptor.builtTasks,
|
|
134
135
|
projectRoot
|
|
@@ -143,25 +144,25 @@ async function runPreparePhase(projectRoot) {
|
|
|
143
144
|
async function resolveDeployAuthOptions(options) {
|
|
144
145
|
const resolved = await resolveAuthOptions({
|
|
145
146
|
apiKey: options.apiKey,
|
|
146
|
-
|
|
147
|
+
serverUrl: options.serverUrl
|
|
147
148
|
});
|
|
148
|
-
const apiKey =
|
|
149
|
-
const
|
|
149
|
+
const apiKey = resolved.apiKey ?? process.env.KEYSTROKE_API_KEY;
|
|
150
|
+
const serverUrl = resolved.serverUrl ?? process.env.SERVER_URL ?? "https://api.kestroke.ai";
|
|
150
151
|
const organizationId = options.org ?? process.env.KEYSTROKE_ORG_ID ?? resolved.activeOrg?.organizationId;
|
|
151
|
-
if (!apiKey || !
|
|
152
|
+
if (!apiKey || !serverUrl) throw new Error("Not authenticated. Run `keystroke auth` or pass --api-key and --server-url.");
|
|
152
153
|
return {
|
|
153
154
|
apiKey,
|
|
154
|
-
baseUrl,
|
|
155
|
+
baseUrl: serverUrl,
|
|
155
156
|
...organizationId ? { organizationId } : {}
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
159
|
async function runDeployPhase(options, projectRoot) {
|
|
159
160
|
const descriptor = await readDescriptor(projectRoot);
|
|
160
|
-
const { createDeployClient } = await import("./deploy-
|
|
161
|
+
const { createDeployClient } = await import("./deploy-CdnaZY3s.mjs");
|
|
161
162
|
const client = createDeployClient(await resolveDeployAuthOptions(options));
|
|
162
163
|
const auth = await client.public.auth.validate();
|
|
163
164
|
if (auth.organizationId !== descriptor.projectConfig.organizationId) throw new Error(`Project organization mismatch: config=${descriptor.projectConfig.organizationId} auth=${auth.organizationId}`);
|
|
164
|
-
const { deployTaskTargets } = await import("./task-target-deploy-
|
|
165
|
+
const { deployTaskTargets } = await import("./task-target-deploy-BPLlP__P.mjs");
|
|
165
166
|
const result = await deployTaskTargets({
|
|
166
167
|
preparedTasks: descriptor.preparedTasks,
|
|
167
168
|
client,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { C as CliExitError, D as throwReportedCliExit, h as toErrorMessage, t as ui } from "./keystroke.mjs";
|
|
4
|
-
import { l as resolveAuthOptions } from "./dist-
|
|
5
|
-
import { t as assertWorkflowProjectRoot } from "./project-config-
|
|
6
|
-
import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-
|
|
7
|
-
import { t as createTypedCommand } from "./commander-
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
13
|
-
import {
|
|
14
|
-
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-
|
|
15
|
-
import { n as WorkflowsRunOptionsSchema, t as RUN_OPTIONS_CONFIG } from "./options-
|
|
16
|
-
import { a as validateInputOrExit, i as resolveInput, r as pollForCompletion, t as handleWorkflowsTryDeploy } from "./try-deploy.handler-
|
|
4
|
+
import { l as resolveAuthOptions } from "./dist-BF6r1hfv.mjs";
|
|
5
|
+
import { t as assertWorkflowProjectRoot } from "./project-config-opj6DsPF.mjs";
|
|
6
|
+
import { i as writeJson, n as JsonOptionSchema, t as JSON_OPTION_CONFIG } from "./output-q4KljAhu.mjs";
|
|
7
|
+
import { t as createTypedCommand } from "./commander-DZ3F3CVq.mjs";
|
|
8
|
+
import { n as getProcessEnv } from "./env-YTZGKGIu.mjs";
|
|
9
|
+
import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-Y1f1hGYy.mjs";
|
|
10
|
+
import { a as readManifestsFromOutDir } from "./dist-C2Dq_nx3.mjs";
|
|
11
|
+
import { t as requireWorkflowsDir } from "./resolve-project-DgfftdPm.mjs";
|
|
12
|
+
import { a as registerHostedActionDispatcher, c as registerOperationCredentialResolver, f as registerOperationContext, g as getOfficialIntegrationMetadata, h as registerRuntime, n as clearHostedActionExecutionPolicy, o as registerHostedActionExecutionPolicy, p as clearRuntime, s as clearOperationCredentialResolver, t as clearHostedActionDispatcher, u as clearOperationContext } from "./hosted-action-dispatcher-registry-TOVzMhUR.mjs";
|
|
13
|
+
import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-BcaIdRR6.mjs";
|
|
14
|
+
import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-M8GEIHxv.mjs";
|
|
15
|
+
import { n as WorkflowsRunOptionsSchema, t as RUN_OPTIONS_CONFIG } from "./options-Dn9t3K4a.mjs";
|
|
16
|
+
import { a as validateInputOrExit, i as resolveInput, r as pollForCompletion, t as handleWorkflowsTryDeploy } from "./try-deploy.handler-2aX5TmLk.mjs";
|
|
17
17
|
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
18
18
|
import { tmpdir } from "node:os";
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import { z } from "zod";
|
|
21
21
|
import { pathToFileURL } from "node:url";
|
|
22
|
-
//#region ../../packages/
|
|
22
|
+
//#region ../../packages/core/src/test-runtime/credentials/env-resolver.ts
|
|
23
23
|
/**
|
|
24
24
|
* Computes the env var name for a credential key.
|
|
25
25
|
* Uses the credential set's namespace as the prefix if present, otherwise the raw id.
|
|
@@ -51,7 +51,7 @@ function resolveCredentialsFromEnv(credentialSet, options = {}) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region ../../packages/
|
|
54
|
+
//#region ../../packages/core/src/test-runtime/credentials/cache.ts
|
|
55
55
|
function createCredentialCache() {
|
|
56
56
|
const cache = /* @__PURE__ */ new Map();
|
|
57
57
|
return { async getOrCreate(key, createValue) {
|
|
@@ -66,7 +66,7 @@ function createCredentialCache() {
|
|
|
66
66
|
} };
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region ../../packages/
|
|
69
|
+
//#region ../../packages/core/src/test-runtime/credentials/server-resolver.ts
|
|
70
70
|
async function createServerCredentialResolver(options, dependencies = {
|
|
71
71
|
fetch: globalThis.fetch,
|
|
72
72
|
resolveAuthOptions
|
|
@@ -74,16 +74,16 @@ async function createServerCredentialResolver(options, dependencies = {
|
|
|
74
74
|
try {
|
|
75
75
|
const resolvedAuth = await dependencies.resolveAuthOptions({
|
|
76
76
|
apiKey: options.apiKey,
|
|
77
|
-
|
|
77
|
+
serverUrl: options.baseUrl,
|
|
78
78
|
credentialsPath: options.credentialsPath
|
|
79
79
|
});
|
|
80
|
-
if (!resolvedAuth.apiKey || !resolvedAuth.
|
|
80
|
+
if (!resolvedAuth.apiKey || !resolvedAuth.serverUrl) return;
|
|
81
81
|
const cache = createCredentialCache();
|
|
82
82
|
return { async resolveCredentialSet(credentialSet, keys) {
|
|
83
83
|
const resolvedCredentialSetId = credentialSet.resolvedCredentialSetId;
|
|
84
84
|
const cacheKey = `${resolvedCredentialSetId}:${[...keys].sort().join(",")}`;
|
|
85
85
|
return cache.getOrCreate(cacheKey, async () => {
|
|
86
|
-
const response = await dependencies.fetch(new URL("api/v1/credentials/resolve", resolvedAuth.
|
|
86
|
+
const response = await dependencies.fetch(new URL("api/v1/credentials/resolve", resolvedAuth.serverUrl).toString(), {
|
|
87
87
|
method: "POST",
|
|
88
88
|
headers: {
|
|
89
89
|
Authorization: `Bearer ${resolvedAuth.apiKey}`,
|
|
@@ -129,7 +129,7 @@ function humanizeCredentialSetLabel(credentialSet) {
|
|
|
129
129
|
return credentialSet.id.split(/[-_]/u).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
130
130
|
}
|
|
131
131
|
//#endregion
|
|
132
|
-
//#region ../../packages/
|
|
132
|
+
//#region ../../packages/core/src/test-runtime/credentials/create-test-credential-resolver.ts
|
|
133
133
|
function pickMissingCredentialSets(credentialSets, existingCredentials) {
|
|
134
134
|
return credentialSets.filter((credentialSet) => existingCredentials?.[credentialSet.id] === void 0);
|
|
135
135
|
}
|
|
@@ -188,10 +188,10 @@ async function createTestCredentialResolver(options, runtimeOptions = {}) {
|
|
|
188
188
|
} };
|
|
189
189
|
}
|
|
190
190
|
//#endregion
|
|
191
|
-
//#region ../../packages/
|
|
191
|
+
//#region ../../packages/core/src/test-runtime/credentials/options.ts
|
|
192
192
|
const DEFAULT_TEST_CREDENTIAL_MODE = "auto";
|
|
193
193
|
//#endregion
|
|
194
|
-
//#region ../../packages/
|
|
194
|
+
//#region ../../packages/core/src/shared/create-mock-hook.ts
|
|
195
195
|
/**
|
|
196
196
|
* Creates a Hook that resolves immediately when awaited.
|
|
197
197
|
*
|
|
@@ -216,7 +216,7 @@ function createMockHook() {
|
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
218
|
//#endregion
|
|
219
|
-
//#region ../../packages/
|
|
219
|
+
//#region ../../packages/core/src/test-runtime/helpers/create-test-workflow-context.ts
|
|
220
220
|
function createTestWorkflowContext(options = {}) {
|
|
221
221
|
return {
|
|
222
222
|
createHook: options.createHook ?? ((_name) => createMockHook()),
|
|
@@ -228,7 +228,7 @@ function createTestWorkflowContext(options = {}) {
|
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
//#endregion
|
|
231
|
-
//#region ../../packages/
|
|
231
|
+
//#region ../../packages/core/src/test-runtime/hosted-actions/create-test-hosted-action-dispatcher.ts
|
|
232
232
|
function createHostedDispatchError(integrationId, sourceLabel, detail, cause) {
|
|
233
233
|
const message = `Hosted integration "${integrationId}" failed in ${sourceLabel}. ${detail}`;
|
|
234
234
|
return cause instanceof Error ? new Error(message, { cause }) : new Error(message);
|
|
@@ -245,7 +245,7 @@ async function createTestHostedActionDispatcher(options, dependencies = {
|
|
|
245
245
|
try {
|
|
246
246
|
resolvedAuth = await dependencies.resolveAuthOptions({
|
|
247
247
|
apiKey: options.apiKey,
|
|
248
|
-
|
|
248
|
+
serverUrl: options.baseUrl,
|
|
249
249
|
credentialsPath: options.credentialsPath
|
|
250
250
|
});
|
|
251
251
|
} catch (error) {
|
|
@@ -256,11 +256,11 @@ async function createTestHostedActionDispatcher(options, dependencies = {
|
|
|
256
256
|
const publicCredentialSetId = (operation.credentialSets ?? [])[0]?.id ?? integrationId;
|
|
257
257
|
if (authResolutionError) throw createHostedDispatchError(integrationId, sourceLabel, "Run `keystroke auth` and ensure the Keystroke dev server URL is configured before retrying.", authResolutionError);
|
|
258
258
|
if (!resolvedAuth?.apiKey) throw createHostedDispatchError(integrationId, sourceLabel, "Run `keystroke auth` so the test runtime can authenticate hosted action dispatch.");
|
|
259
|
-
if (!resolvedAuth.
|
|
260
|
-
const { apiKey,
|
|
259
|
+
if (!resolvedAuth.serverUrl) throw createHostedDispatchError(integrationId, sourceLabel, "Configure the Keystroke dev server URL and retry.");
|
|
260
|
+
const { apiKey, serverUrl } = resolvedAuth;
|
|
261
261
|
const organizationId = resolvedAuth.activeOrg?.organizationId ?? "local";
|
|
262
262
|
try {
|
|
263
|
-
const response = await dependencies.fetch(new URL("/api/v1/hosted-actions/dispatch",
|
|
263
|
+
const response = await dependencies.fetch(new URL("/api/v1/hosted-actions/dispatch", serverUrl).toString(), {
|
|
264
264
|
method: "POST",
|
|
265
265
|
headers: {
|
|
266
266
|
Authorization: `Bearer ${apiKey}`,
|
|
@@ -299,7 +299,7 @@ async function createTestHostedActionDispatcher(options, dependencies = {
|
|
|
299
299
|
} };
|
|
300
300
|
}
|
|
301
301
|
//#endregion
|
|
302
|
-
//#region ../../packages/
|
|
302
|
+
//#region ../../packages/core/src/test-runtime/runtime/create-keystroke-test-runtime.ts
|
|
303
303
|
async function createKeystrokeTestRuntime(options = {}) {
|
|
304
304
|
clearHostedActionDispatcher();
|
|
305
305
|
clearHostedActionExecutionPolicy();
|
|
@@ -340,7 +340,7 @@ async function createKeystrokeTestRuntime(options = {}) {
|
|
|
340
340
|
} };
|
|
341
341
|
}
|
|
342
342
|
//#endregion
|
|
343
|
-
//#region ../../packages/
|
|
343
|
+
//#region ../../packages/core/src/test-runtime/tools/create-test-tool-context.ts
|
|
344
344
|
/**
|
|
345
345
|
* Builds a minimal `OperationRunContext` for tool/step unit tests.
|
|
346
346
|
*
|
|
@@ -357,7 +357,7 @@ function createTestToolContext(options = {}) {
|
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
359
|
//#endregion
|
|
360
|
-
//#region ../../packages/
|
|
360
|
+
//#region ../../packages/core/src/test-runtime/tools/run-tool.ts
|
|
361
361
|
async function runTool(tool, input, options) {
|
|
362
362
|
const ctx = createTestToolContext(options);
|
|
363
363
|
return tool.run(input, ctx);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { t as ui } from "./keystroke.mjs";
|
|
4
|
-
import { a as validateApiKey, i as requireClient } from "./context-
|
|
4
|
+
import { a as validateApiKey, i as requireClient } from "./context-Y1f1hGYy.mjs";
|
|
5
5
|
//#region src/commands/auth/test.handler.ts
|
|
6
6
|
async function handleAuthTest(_options, ctx) {
|
|
7
7
|
const result = await validateApiKey(requireClient(ctx));
|