@kodycodes/cli 1.26.3 → 1.27.1
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 +175 -167
- package/dist/add-mcp-install.d.ts +1 -1
- package/dist/api-token.d.ts +1 -1
- package/dist/{auth-4FW6GCLG.js → auth-6ZE6QQXA.js} +13 -8
- package/dist/auth-bootstrap.d.ts +1 -1
- package/dist/auth.d.ts +27 -3
- package/dist/bin.js +18 -18
- package/dist/capability-proxy.d.ts +1 -1
- package/dist/{chunk-64XN367G.js → chunk-2EQJQJA3.js} +66 -44
- package/dist/chunk-2EQJQJA3.js.map +6 -0
- package/dist/{chunk-D55XPY3T.js → chunk-2IHISXHN.js} +58 -27
- package/dist/chunk-2IHISXHN.js.map +6 -0
- package/dist/{chunk-SMURF26I.js → chunk-2XPH7L2P.js} +1 -1
- package/dist/chunk-2XPH7L2P.js.map +6 -0
- package/dist/{chunk-RM34N3KI.js → chunk-3H72XY5R.js} +16 -6
- package/dist/chunk-3H72XY5R.js.map +6 -0
- package/dist/{chunk-G4YN6XP5.js → chunk-4GIFJVGT.js} +1 -1
- package/dist/chunk-4GIFJVGT.js.map +6 -0
- package/dist/{chunk-R4IUV5P5.js → chunk-5JIRHJQP.js} +397 -45
- package/dist/chunk-5JIRHJQP.js.map +6 -0
- package/dist/{chunk-TIL35OWA.js → chunk-5YQBD7PN.js} +238 -146
- package/dist/chunk-5YQBD7PN.js.map +6 -0
- package/dist/chunk-5ZBJAP6G.js +2005 -0
- package/dist/chunk-5ZBJAP6G.js.map +6 -0
- package/dist/{chunk-6XQP5SWX.js → chunk-6ZYUGXVW.js} +1 -1
- package/dist/chunk-6ZYUGXVW.js.map +6 -0
- package/dist/{chunk-OVGXPRSY.js → chunk-7PRJ36I5.js} +4 -1
- package/dist/{chunk-OVGXPRSY.js.map → chunk-7PRJ36I5.js.map} +1 -1
- package/dist/{chunk-IHP6PV6X.js → chunk-BTL3PJ2H.js} +1 -12
- package/dist/chunk-BTL3PJ2H.js.map +6 -0
- package/dist/{chunk-VQS5YSCI.js → chunk-CPS7HW4T.js} +8 -6
- package/dist/{chunk-VQS5YSCI.js.map → chunk-CPS7HW4T.js.map} +1 -1
- package/dist/{chunk-BISUL7CE.js → chunk-DW5UTJ6T.js} +14 -5
- package/dist/chunk-DW5UTJ6T.js.map +6 -0
- package/dist/{target-3QHY7JT4.js → chunk-EJXEVGWF.js} +8 -6
- package/dist/chunk-EJXEVGWF.js.map +6 -0
- package/dist/{chunk-SXHULGL4.js → chunk-JOMBXQOS.js} +18 -9
- package/dist/chunk-JOMBXQOS.js.map +6 -0
- package/dist/{chunk-EOCV74B2.js → chunk-OZDWOZLV.js} +41 -25
- package/dist/chunk-OZDWOZLV.js.map +6 -0
- package/dist/{chunk-75RZUXQL.js → chunk-SLNAWWQK.js} +4 -2
- package/dist/{chunk-75RZUXQL.js.map → chunk-SLNAWWQK.js.map} +1 -1
- package/dist/{chunk-XDCOWU5R.js → chunk-SPEP3DUT.js} +64 -14
- package/dist/chunk-SPEP3DUT.js.map +6 -0
- package/dist/{chunk-64IM6G4Z.js → chunk-TUUFQYWP.js} +13 -6
- package/dist/chunk-TUUFQYWP.js.map +6 -0
- package/dist/{chunk-QHBCP4OB.js → chunk-UW6AWLXX.js} +6 -7
- package/dist/chunk-W2SAFAT4.js +1563 -0
- package/dist/chunk-W2SAFAT4.js.map +6 -0
- package/dist/{chunk-XOPPGRUP.js → chunk-WMROAVLX.js} +14 -6
- package/dist/chunk-WMROAVLX.js.map +6 -0
- package/dist/{chunk-BPGY4IE7.js → chunk-XV6D6HSG.js} +1 -1
- package/dist/chunk-XV6D6HSG.js.map +6 -0
- package/dist/{chunk-PDWCKWQF.js → chunk-YDWTXEKQ.js} +26 -10
- package/dist/chunk-YDWTXEKQ.js.map +6 -0
- package/dist/{chunk-JWEFKKAD.js → chunk-ZILB2HWE.js} +1 -1
- package/dist/chunk-ZILB2HWE.js.map +6 -0
- package/dist/cli.js +19 -19
- package/dist/defaults.d.ts +1 -1
- package/dist/detect-running-hosts.d.ts +1 -1
- package/dist/dev/dev-assets.d.ts +1 -1
- package/dist/dev/dev-registry.d.ts +1 -1
- package/dist/dev/error-page.d.ts +1 -1
- package/dist/dev/live-reload.d.ts +2 -2
- package/dist/{dev-command-3LX234N6.js → dev-command-TZ2EB4J3.js} +236 -111
- package/dist/dev-command-TZ2EB4J3.js.map +6 -0
- package/dist/dev-command.d.ts +1 -1
- package/dist/discover-login-identity.d.ts +6 -7
- package/dist/discover-org.d.ts +2 -3
- package/dist/generated/openapi-routes.d.ts +6 -0
- package/dist/{git-credential-FUE3JE3T.js → git-credential-INB2UV4C.js} +32 -25
- package/dist/git-credential-INB2UV4C.js.map +6 -0
- package/dist/{install-ZML2TCDG.js → install-ONEJRYZ3.js} +147 -113
- package/dist/install-ONEJRYZ3.js.map +6 -0
- package/dist/install.d.ts +1 -1
- package/dist/{local-execute-SZV6XN4T.js → local-execute-YCXHVAVM.js} +81 -54
- package/dist/local-execute-YCXHVAVM.js.map +6 -0
- package/dist/local-execute-auth.d.ts +2 -2
- package/dist/local-execute.d.ts +1 -1
- package/dist/local-gateway-fetch-forward.d.ts +2 -2
- package/dist/local-package-run-WZVZAHK3.js +23 -0
- package/dist/local-package-run.d.ts +2 -2
- package/dist/mock/ensure-msw.d.ts +9 -1
- package/dist/mock/load-package-mocks.d.ts +1 -2
- package/dist/mock/mock-fetch-gateway.d.ts +4 -5
- package/dist/mock/mock-supported.d.ts +1 -1
- package/dist/{mock-dep-resolve-TVABDNR7.js → mock-dep-resolve-B5ZH4U3H.js} +14 -6
- package/dist/mock-dep-resolve-B5ZH4U3H.js.map +6 -0
- package/dist/{mock-fetch-gateway-B5TFGGQS.js → mock-fetch-gateway-FWVNTLP2.js} +7 -6
- package/dist/{mock-local-deps-5SZT3PWT.js → mock-local-deps-2VVNJLFF.js} +20 -17
- package/dist/mock-local-deps-2VVNJLFF.js.map +6 -0
- package/dist/mock-local-deps.d.ts +1 -1
- package/dist/{mock-server-SV2IKC4I.js → mock-server-6BWDQQBE.js} +8 -7
- package/dist/oauth-browser.d.ts +42 -0
- package/dist/oauth-provider.d.ts +14 -19
- package/dist/{open-api-client-DVVMLY7P.js → open-api-client-SR4B7265.js} +11 -10
- package/dist/open-api-client.d.ts +2 -1
- package/dist/{org-X7B5BI4R.js → org-535LB4PD.js} +8 -6
- package/dist/org-535LB4PD.js.map +6 -0
- package/dist/org-resolve.d.ts +2 -0
- package/dist/package-app-dev.d.ts +2 -2
- package/dist/{package-manifest-QH2RU64C.js → package-manifest-DFF6XCPV.js} +5 -4
- package/dist/{remote-execute-QMQDVHOY.js → remote-execute-JN6DRFEU.js} +49 -30
- package/dist/remote-execute-JN6DRFEU.js.map +6 -0
- package/dist/remote-execute.d.ts +3 -3
- package/dist/{setup-git-5KCUBYPB.js → setup-git-MHK563LB.js} +11 -12
- package/dist/setup-git.d.ts +1 -1
- package/dist/{skill-ENPATRIW.js → skill-D74XVI6T.js} +26 -8
- package/dist/skill-D74XVI6T.js.map +6 -0
- package/dist/{store-WTMRH527.js → store-27J4CQZ2.js} +4 -4
- package/dist/{structured-error-C65GQ53Z.js → structured-error-5MLWXYR3.js} +4 -3
- package/dist/structured-error.d.ts +1 -1
- package/dist/target-33ATHDUF.js +17 -0
- package/package.json +6 -5
- package/skills/kody/SKILL.md +53 -50
- package/dist/chunk-4D6ORNXY.js +0 -24404
- package/dist/chunk-4D6ORNXY.js.map +0 -6
- package/dist/chunk-64IM6G4Z.js.map +0 -6
- package/dist/chunk-64XN367G.js.map +0 -6
- package/dist/chunk-6XQP5SWX.js.map +0 -6
- package/dist/chunk-BISUL7CE.js.map +0 -6
- package/dist/chunk-BPGY4IE7.js.map +0 -6
- package/dist/chunk-D55XPY3T.js.map +0 -6
- package/dist/chunk-EOCV74B2.js.map +0 -6
- package/dist/chunk-FBVNFWR6.js +0 -437
- package/dist/chunk-FBVNFWR6.js.map +0 -6
- package/dist/chunk-G4YN6XP5.js.map +0 -6
- package/dist/chunk-G6LJWROP.js +0 -18
- package/dist/chunk-G6LJWROP.js.map +0 -6
- package/dist/chunk-IHP6PV6X.js.map +0 -6
- package/dist/chunk-JWEFKKAD.js.map +0 -6
- package/dist/chunk-LWNB26KO.js +0 -147
- package/dist/chunk-LWNB26KO.js.map +0 -6
- package/dist/chunk-PDWCKWQF.js.map +0 -6
- package/dist/chunk-R4IUV5P5.js.map +0 -6
- package/dist/chunk-RM34N3KI.js.map +0 -6
- package/dist/chunk-RTWUNV76.js +0 -309
- package/dist/chunk-RTWUNV76.js.map +0 -6
- package/dist/chunk-SMURF26I.js.map +0 -6
- package/dist/chunk-SXHULGL4.js.map +0 -6
- package/dist/chunk-TIL35OWA.js.map +0 -6
- package/dist/chunk-XDCOWU5R.js.map +0 -6
- package/dist/chunk-XOPPGRUP.js.map +0 -6
- package/dist/dev-command-3LX234N6.js.map +0 -6
- package/dist/git-credential-FUE3JE3T.js.map +0 -6
- package/dist/install-ZML2TCDG.js.map +0 -6
- package/dist/local-execute-SZV6XN4T.js.map +0 -6
- package/dist/local-package-run-2TMCAZZ2.js +0 -23
- package/dist/mcp-G2AWTIXR.js +0 -21
- package/dist/mcp.d.ts +0 -34
- package/dist/mock-dep-resolve-TVABDNR7.js.map +0 -6
- package/dist/mock-local-deps-5SZT3PWT.js.map +0 -6
- package/dist/org-X7B5BI4R.js.map +0 -6
- package/dist/remote-execute-QMQDVHOY.js.map +0 -6
- package/dist/skill-ENPATRIW.js.map +0 -6
- package/dist/target-3QHY7JT4.js.map +0 -6
- package/dist/webapi-NTVP4BO3.js +0 -2482
- package/dist/webapi-NTVP4BO3.js.map +0 -6
- /package/dist/{auth-4FW6GCLG.js.map → auth-6ZE6QQXA.js.map} +0 -0
- /package/dist/{chunk-QHBCP4OB.js.map → chunk-UW6AWLXX.js.map} +0 -0
- /package/dist/{local-package-run-2TMCAZZ2.js.map → local-package-run-WZVZAHK3.js.map} +0 -0
- /package/dist/{mcp-G2AWTIXR.js.map → mock-fetch-gateway-FWVNTLP2.js.map} +0 -0
- /package/dist/{mock-fetch-gateway-B5TFGGQS.js.map → mock-server-6BWDQQBE.js.map} +0 -0
- /package/dist/{mock-server-SV2IKC4I.js.map → open-api-client-SR4B7265.js.map} +0 -0
- /package/dist/{open-api-client-DVVMLY7P.js.map → package-manifest-DFF6XCPV.js.map} +0 -0
- /package/dist/{package-manifest-QH2RU64C.js.map → setup-git-MHK563LB.js.map} +0 -0
- /package/dist/{setup-git-5KCUBYPB.js.map → store-27J4CQZ2.js.map} +0 -0
- /package/dist/{store-WTMRH527.js.map → structured-error-5MLWXYR3.js.map} +0 -0
- /package/dist/{structured-error-C65GQ53Z.js.map → target-33ATHDUF.js.map} +0 -0
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
assertLocalExecuteNodeEngine
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2XPH7L2P.js";
|
|
5
5
|
import {
|
|
6
6
|
isPublishedPackageInvokeSpecifier,
|
|
7
7
|
resolveExecuteInvokeCode
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
formatToolResult
|
|
11
|
-
} from "./chunk-46IJPEID.js";
|
|
8
|
+
} from "./chunk-SLNAWWQK.js";
|
|
12
9
|
import {
|
|
13
10
|
hostIds
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
resolveOrgSlug
|
|
17
|
-
} from "./chunk-OVGXPRSY.js";
|
|
11
|
+
} from "./chunk-YDWTXEKQ.js";
|
|
18
12
|
import {
|
|
19
13
|
resolveLocalExecuteBearer
|
|
20
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CPS7HW4T.js";
|
|
21
15
|
import {
|
|
22
16
|
authBootstrap,
|
|
23
17
|
authBootstrapWithScopes,
|
|
@@ -27,40 +21,42 @@ import {
|
|
|
27
21
|
parseCliScopesFlag,
|
|
28
22
|
refreshGitCredentialHelperPinIfNeeded,
|
|
29
23
|
resolveCliTokenLifetime
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
parseCredentialFlags
|
|
33
|
-
} from "./chunk-R4IUV5P5.js";
|
|
24
|
+
} from "./chunk-OZDWOZLV.js";
|
|
34
25
|
import {
|
|
35
26
|
redactError
|
|
36
27
|
} from "./chunk-CASGRYOF.js";
|
|
37
28
|
import {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} from "./chunk-CWWHR4FH.js";
|
|
41
|
-
import {
|
|
42
|
-
readPackageVersion
|
|
43
|
-
} from "./chunk-G6LJWROP.js";
|
|
29
|
+
formatToolResult
|
|
30
|
+
} from "./chunk-46IJPEID.js";
|
|
44
31
|
import {
|
|
45
32
|
cliBootstrapMintCall,
|
|
46
33
|
deleteStoredApiToken,
|
|
47
34
|
hasExplicitTokenFlag,
|
|
48
35
|
loadStoredApiToken,
|
|
36
|
+
parseCredentialFlags,
|
|
37
|
+
readPackageVersion,
|
|
49
38
|
requireApiToken,
|
|
50
39
|
resolveScopedApiToken
|
|
51
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-5JIRHJQP.js";
|
|
41
|
+
import {
|
|
42
|
+
resolveOrgSlug
|
|
43
|
+
} from "./chunk-7PRJ36I5.js";
|
|
44
|
+
import {
|
|
45
|
+
orgEnvVar,
|
|
46
|
+
orgSlugFromFlag
|
|
47
|
+
} from "./chunk-CWWHR4FH.js";
|
|
52
48
|
import {
|
|
53
49
|
deleteCredentials,
|
|
54
50
|
listStoredOrgs,
|
|
51
|
+
loadCredentialStore,
|
|
55
52
|
loadCredentials
|
|
56
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-3H72XY5R.js";
|
|
57
54
|
import {
|
|
58
55
|
apiTokenEnvVar,
|
|
59
56
|
defaultApiUrl,
|
|
60
57
|
defaultMcpUrl,
|
|
61
|
-
modernMcpProtocolVersion,
|
|
62
58
|
onboardingUrl
|
|
63
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-BTL3PJ2H.js";
|
|
64
60
|
|
|
65
61
|
// src/cli.ts
|
|
66
62
|
import { parseArgs } from "node:util";
|
|
@@ -389,12 +385,12 @@ Environment:
|
|
|
389
385
|
}
|
|
390
386
|
|
|
391
387
|
// src/package-collaborators.ts
|
|
392
|
-
var packageCollaboratorPresets = [
|
|
393
|
-
|
|
394
|
-
"
|
|
395
|
-
"
|
|
396
|
-
"revoke"
|
|
388
|
+
var packageCollaboratorPresets = [
|
|
389
|
+
"use",
|
|
390
|
+
"contribute",
|
|
391
|
+
"manage"
|
|
397
392
|
];
|
|
393
|
+
var packageCollaboratorActions = ["collaborators", "grant", "revoke"];
|
|
398
394
|
function isPackageCollaboratorAction(value) {
|
|
399
395
|
return packageCollaboratorActions.includes(value);
|
|
400
396
|
}
|
|
@@ -429,7 +425,9 @@ ${packageCollaboratorUsage}`
|
|
|
429
425
|
function readPreset(value) {
|
|
430
426
|
const preset = readFlag(value, "preset") ?? "use";
|
|
431
427
|
if (!packageCollaboratorPresets.includes(preset)) {
|
|
432
|
-
throw new Error(
|
|
428
|
+
throw new Error(
|
|
429
|
+
`--preset must be one of ${packageCollaboratorPresets.join(", ")}.`
|
|
430
|
+
);
|
|
433
431
|
}
|
|
434
432
|
return preset;
|
|
435
433
|
}
|
|
@@ -453,10 +451,16 @@ function parsePackageCollaboratorCommand(input) {
|
|
|
453
451
|
}
|
|
454
452
|
case "revoke":
|
|
455
453
|
if (input.values.preset !== void 0) {
|
|
456
|
-
throw new Error(
|
|
457
|
-
|
|
454
|
+
throw new Error(
|
|
455
|
+
`--preset is only for grant.
|
|
456
|
+
${packageCollaboratorUsage}`
|
|
457
|
+
);
|
|
458
458
|
}
|
|
459
|
-
return {
|
|
459
|
+
return {
|
|
460
|
+
action: "revoke",
|
|
461
|
+
packageId,
|
|
462
|
+
target: readSubject(input.values, true)
|
|
463
|
+
};
|
|
460
464
|
default: {
|
|
461
465
|
const exhaustive = input.action;
|
|
462
466
|
throw new Error(`Unhandled package action: ${String(exhaustive)}`);
|
|
@@ -470,7 +474,8 @@ function collaboratorLabel(collaborator) {
|
|
|
470
474
|
if (collaborator.subject_type === "team") {
|
|
471
475
|
return collaborator.team_slug ? `${collaborator.team_slug}${collaborator.team_name ? ` (${collaborator.team_name})` : ""}` : collaborator.subject_id;
|
|
472
476
|
}
|
|
473
|
-
if (!collaborator.username)
|
|
477
|
+
if (!collaborator.username)
|
|
478
|
+
return collaborator.display_name ?? collaborator.subject_id;
|
|
474
479
|
return collaborator.display_name ? `@${collaborator.username} (${collaborator.display_name})` : `@${collaborator.username}`;
|
|
475
480
|
}
|
|
476
481
|
function presetLabel(collaborator) {
|
|
@@ -504,7 +509,9 @@ function findCollaborator(list, subject) {
|
|
|
504
509
|
(collaborator) => subject.kind === "team" ? collaborator.subject_type === "team" && collaborator.team_slug === subject.slug : collaborator.subject_type === "user" && collaborator.username?.toLowerCase() === subject.username.toLowerCase()
|
|
505
510
|
);
|
|
506
511
|
if (!match) {
|
|
507
|
-
throw new Error(
|
|
512
|
+
throw new Error(
|
|
513
|
+
`${describeSubject(subject)} is not a collaborator on ${list.package.name}.`
|
|
514
|
+
);
|
|
508
515
|
}
|
|
509
516
|
return match;
|
|
510
517
|
}
|
|
@@ -699,7 +706,7 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
699
706
|
});
|
|
700
707
|
const json = parsed.values.json === true;
|
|
701
708
|
if (parsed.values["allow-private-network"] === true) {
|
|
702
|
-
const executeAllowsPrivateNetwork = parsed.command === "execute" && (parsed.values.local === true || (await import("./target-
|
|
709
|
+
const executeAllowsPrivateNetwork = parsed.command === "execute" && (parsed.values.local === true || (await import("./target-33ATHDUF.js")).resolveTarget({
|
|
703
710
|
command: "execute",
|
|
704
711
|
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
705
712
|
}) === "mock");
|
|
@@ -710,7 +717,9 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
710
717
|
}
|
|
711
718
|
}
|
|
712
719
|
if (parsed.values["reset-storage"] === true && parsed.command !== "dev" && parsed.command !== "execute" && parsed.command !== "search") {
|
|
713
|
-
throw new Error(
|
|
720
|
+
throw new Error(
|
|
721
|
+
"`--reset-storage` is only used with --target mock on execute, search, or dev."
|
|
722
|
+
);
|
|
714
723
|
}
|
|
715
724
|
if (parsed.values["dry-run"] === true && parsed.command !== "dev") {
|
|
716
725
|
throw new Error(
|
|
@@ -729,7 +738,10 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
729
738
|
);
|
|
730
739
|
}
|
|
731
740
|
const orgFlagOnly = orgFlag !== void 0 ? orgSlugFromFlag(orgFlag) : void 0;
|
|
732
|
-
const org = resolveOrgSlug({
|
|
741
|
+
const org = resolveOrgSlug({
|
|
742
|
+
flag: orgFlag,
|
|
743
|
+
activeOrg: loadCredentialStore(mcpUrl)?.activeOrg
|
|
744
|
+
});
|
|
733
745
|
switch (parsed.command) {
|
|
734
746
|
case "help":
|
|
735
747
|
write(buildUsage({ mcpUrl }));
|
|
@@ -739,10 +751,14 @@ async function dispatch(parsed, write, writeErr) {
|
|
|
739
751
|
`);
|
|
740
752
|
return 0;
|
|
741
753
|
case "login": {
|
|
742
|
-
const { login } = await import("./auth-
|
|
754
|
+
const { login } = await import("./auth-6ZE6QQXA.js");
|
|
743
755
|
write("Opening the Kody login page in your browser\u2026\n");
|
|
744
756
|
const result = await login({
|
|
745
757
|
mcpUrl,
|
|
758
|
+
apiUrl: apiUrlFrom({
|
|
759
|
+
apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
|
|
760
|
+
}),
|
|
761
|
+
...typeof parsed.values.lifetime === "string" ? { lifetime: parsed.values.lifetime === "short" ? "short" : "long" } : {},
|
|
746
762
|
...orgFlagOnly ? { org: orgFlagOnly } : {},
|
|
747
763
|
openBrowser: parsed.values["no-browser"] !== true,
|
|
748
764
|
onAuthorizationUrl: (url) => {
|
|
@@ -753,8 +769,10 @@ ${url.href}
|
|
|
753
769
|
});
|
|
754
770
|
const orgLabel = result.org ? ` as org ${result.org}` : result.credentials.org ? ` as org ${result.credentials.org}` : "";
|
|
755
771
|
const accountLabel = result.account?.email ? ` (${result.account.email})` : result.account?.displayName ? ` (${result.account.displayName})` : "";
|
|
756
|
-
write(
|
|
757
|
-
`
|
|
772
|
+
write(
|
|
773
|
+
`Logged in to ${result.credentials.mcpUrl}${orgLabel}${accountLabel}.
|
|
774
|
+
`
|
|
775
|
+
);
|
|
758
776
|
if (result.backendKind === "file" && result.backendPath) {
|
|
759
777
|
write(
|
|
760
778
|
`OS keychain was unavailable; credentials saved at ${result.backendPath} (mode 0600).
|
|
@@ -801,8 +819,8 @@ ${url.href}
|
|
|
801
819
|
formatOrgListHuman,
|
|
802
820
|
formatOrgListJson,
|
|
803
821
|
useOrg
|
|
804
|
-
} = await import("./org-
|
|
805
|
-
const { listStoredOrgs: listStoredOrgs2 } = await import("./store-
|
|
822
|
+
} = await import("./org-535LB4PD.js");
|
|
823
|
+
const { listStoredOrgs: listStoredOrgs2 } = await import("./store-27J4CQZ2.js");
|
|
806
824
|
const action = parsed.positionals[0];
|
|
807
825
|
if (action === "list") {
|
|
808
826
|
const orgs = listStoredOrgs2(mcpUrl);
|
|
@@ -958,7 +976,7 @@ ${url.href}
|
|
|
958
976
|
parseGitCredentialAction,
|
|
959
977
|
parseGitCredentialInput,
|
|
960
978
|
readGitCredentialStdin
|
|
961
|
-
} = await import("./git-credential-
|
|
979
|
+
} = await import("./git-credential-INB2UV4C.js");
|
|
962
980
|
const action = parseGitCredentialAction(parsed.positionals);
|
|
963
981
|
const raw = await readGitCredentialStdin(process.stdin);
|
|
964
982
|
const output = await handleGitCredential({
|
|
@@ -973,7 +991,7 @@ ${url.href}
|
|
|
973
991
|
return 0;
|
|
974
992
|
}
|
|
975
993
|
case "whoami": {
|
|
976
|
-
const { resolveTarget } = await import("./target-
|
|
994
|
+
const { resolveTarget } = await import("./target-33ATHDUF.js");
|
|
977
995
|
const target = resolveTarget({
|
|
978
996
|
command: "whoami",
|
|
979
997
|
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
@@ -983,15 +1001,18 @@ ${url.href}
|
|
|
983
1001
|
apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
|
|
984
1002
|
});
|
|
985
1003
|
if (target === "mock") {
|
|
986
|
-
const { ensureMockTarget } = await import("./mock-server-
|
|
1004
|
+
const { ensureMockTarget } = await import("./mock-server-6BWDQQBE.js");
|
|
987
1005
|
const mock = await ensureMockTarget({
|
|
988
1006
|
resetStorage: parsed.values["reset-storage"] === true,
|
|
989
1007
|
...org ? { orgSlug: org } : {}
|
|
990
1008
|
});
|
|
991
1009
|
try {
|
|
992
|
-
const me = await fetch(
|
|
993
|
-
|
|
994
|
-
|
|
1010
|
+
const me = await fetch(
|
|
1011
|
+
`${mock.apiUrl}/v1/me${org ? `?org=${encodeURIComponent(org)}` : ""}`,
|
|
1012
|
+
{
|
|
1013
|
+
headers: { authorization: `Bearer ${mock.token}` }
|
|
1014
|
+
}
|
|
1015
|
+
);
|
|
995
1016
|
const body = await me.json();
|
|
996
1017
|
if (json) {
|
|
997
1018
|
write(`${JSON.stringify({ target: "mock", ...body }, null, 2)}
|
|
@@ -1022,46 +1043,54 @@ ${url.href}
|
|
|
1022
1043
|
allowEnvWithoutLogin: true,
|
|
1023
1044
|
...org ? { org } : {}
|
|
1024
1045
|
})) {
|
|
1025
|
-
const { whoamiWithApiToken } = await import("./open-api-client-
|
|
1026
|
-
const
|
|
1027
|
-
token: requireApiToken(tokenValues, process.env, "whoami", {
|
|
1046
|
+
const { whoamiWithApiToken: whoamiWithApiToken2 } = await import("./open-api-client-SR4B7265.js");
|
|
1047
|
+
const identity2 = await whoamiWithApiToken2({
|
|
1048
|
+
token: requireApiToken(tokenValues, process.env, "whoami", {
|
|
1049
|
+
apiUrl
|
|
1050
|
+
}),
|
|
1028
1051
|
apiUrl,
|
|
1029
1052
|
...org ? { org } : {}
|
|
1030
1053
|
});
|
|
1031
1054
|
if (json) {
|
|
1032
|
-
write(`${JSON.stringify(
|
|
1055
|
+
write(`${JSON.stringify(identity2, null, 2)}
|
|
1033
1056
|
`);
|
|
1034
1057
|
return 0;
|
|
1035
1058
|
}
|
|
1036
|
-
const scopeLine =
|
|
1037
|
-
const
|
|
1059
|
+
const scopeLine = identity2.token.scopes.join(", ") || "(none)";
|
|
1060
|
+
const userLine2 = identity2.user ? `${identity2.user.displayName} <${identity2.user.email}>` : "(account:read not on this token)";
|
|
1038
1061
|
write(
|
|
1039
1062
|
[
|
|
1040
|
-
`api: ${
|
|
1041
|
-
`auth: API token (${
|
|
1042
|
-
`user: ${
|
|
1063
|
+
`api: ${identity2.apiUrl}`,
|
|
1064
|
+
`auth: API token (${identity2.token.id})`,
|
|
1065
|
+
`user: ${userLine2}`,
|
|
1043
1066
|
`scopes: ${scopeLine}`,
|
|
1044
|
-
`expires: ${
|
|
1067
|
+
`expires: ${identity2.token.expiresAt ?? "unknown"}`,
|
|
1045
1068
|
""
|
|
1046
1069
|
].join("\n")
|
|
1047
1070
|
);
|
|
1048
1071
|
return 0;
|
|
1049
1072
|
}
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1073
|
+
const { ensureOpenApiCredentials } = await import("./auth-6ZE6QQXA.js");
|
|
1074
|
+
const credentials = await ensureOpenApiCredentials({
|
|
1075
|
+
mcpUrl,
|
|
1076
|
+
org,
|
|
1077
|
+
apiUrl
|
|
1078
|
+
});
|
|
1079
|
+
const { whoamiWithApiToken } = await import("./open-api-client-SR4B7265.js");
|
|
1080
|
+
const identity = await whoamiWithApiToken({
|
|
1081
|
+
token: credentials.accessToken,
|
|
1082
|
+
apiUrl,
|
|
1083
|
+
...org ? { org } : {}
|
|
1084
|
+
});
|
|
1056
1085
|
if (json) {
|
|
1057
1086
|
write(
|
|
1058
1087
|
`${JSON.stringify(
|
|
1059
1088
|
{
|
|
1060
|
-
|
|
1089
|
+
apiUrl: identity.apiUrl,
|
|
1061
1090
|
org: credentials.org ?? null,
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1091
|
+
scope: identity.token.scopes,
|
|
1092
|
+
token: identity.token,
|
|
1093
|
+
user: identity.user
|
|
1065
1094
|
},
|
|
1066
1095
|
null,
|
|
1067
1096
|
2
|
|
@@ -1072,15 +1101,17 @@ ${url.href}
|
|
|
1072
1101
|
}
|
|
1073
1102
|
const orgLine = credentials.org ? `
|
|
1074
1103
|
org: ${credentials.org}` : "";
|
|
1104
|
+
const userLine = identity.user ? `${identity.user.displayName} <${identity.user.email}>` : "(no profile)";
|
|
1075
1105
|
write(
|
|
1076
|
-
`
|
|
1077
|
-
|
|
1106
|
+
`Logged in at ${identity.apiUrl}${orgLine}
|
|
1107
|
+
user: ${userLine}
|
|
1108
|
+
scopes: ${identity.token.scopes.join(", ") || "(none)"}
|
|
1078
1109
|
`
|
|
1079
1110
|
);
|
|
1080
1111
|
return 0;
|
|
1081
1112
|
}
|
|
1082
1113
|
case "search": {
|
|
1083
|
-
const { resolveTarget } = await import("./target-
|
|
1114
|
+
const { resolveTarget } = await import("./target-33ATHDUF.js");
|
|
1084
1115
|
const target = resolveTarget({
|
|
1085
1116
|
command: "search",
|
|
1086
1117
|
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
@@ -1093,14 +1124,14 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1093
1124
|
let closeMock;
|
|
1094
1125
|
try {
|
|
1095
1126
|
if (target === "mock") {
|
|
1096
|
-
const { ensureMockTarget } = await import("./mock-server-
|
|
1127
|
+
const { ensureMockTarget } = await import("./mock-server-6BWDQQBE.js");
|
|
1097
1128
|
const mock = await ensureMockTarget({
|
|
1098
1129
|
resetStorage: parsed.values["reset-storage"] === true
|
|
1099
1130
|
});
|
|
1100
1131
|
apiUrl = mock.apiUrl;
|
|
1101
1132
|
closeMock = mock.started ? () => mock.server.close() : void 0;
|
|
1102
|
-
const { searchWithApiToken } = await import("./open-api-client-
|
|
1103
|
-
const result2 = await
|
|
1133
|
+
const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-SR4B7265.js");
|
|
1134
|
+
const result2 = await searchWithApiToken2({
|
|
1104
1135
|
token: mock.token,
|
|
1105
1136
|
apiUrl,
|
|
1106
1137
|
query: query || void 0,
|
|
@@ -1118,9 +1149,11 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1118
1149
|
allowEnvWithoutLogin: true,
|
|
1119
1150
|
...org ? { org } : {}
|
|
1120
1151
|
})) {
|
|
1121
|
-
const { searchWithApiToken } = await import("./open-api-client-
|
|
1122
|
-
const result2 = await
|
|
1123
|
-
token: requireApiToken(tokenValues, process.env, "search", {
|
|
1152
|
+
const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-SR4B7265.js");
|
|
1153
|
+
const result2 = await searchWithApiToken2({
|
|
1154
|
+
token: requireApiToken(tokenValues, process.env, "search", {
|
|
1155
|
+
apiUrl
|
|
1156
|
+
}),
|
|
1124
1157
|
apiUrl,
|
|
1125
1158
|
...org ? { org } : {},
|
|
1126
1159
|
query: query || void 0,
|
|
@@ -1131,17 +1164,21 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1131
1164
|
write(formatToolResult(result2, json));
|
|
1132
1165
|
return result2.isError ? 1 : 0;
|
|
1133
1166
|
}
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
if (typeof parsed.values.entity === "string") args.entity = parsed.values.entity;
|
|
1137
|
-
if (typeof parsed.values.domain === "string") args.domain = parsed.values.domain;
|
|
1138
|
-
if (typeof parsed.values.limit === "string") args.limit = Number(parsed.values.limit);
|
|
1139
|
-
const { callKodyTool } = await import("./mcp-G2AWTIXR.js");
|
|
1140
|
-
const result = await callKodyTool({
|
|
1141
|
-
name: "search",
|
|
1142
|
-
args,
|
|
1167
|
+
const { ensureOpenApiCredentials } = await import("./auth-6ZE6QQXA.js");
|
|
1168
|
+
const credentials = await ensureOpenApiCredentials({
|
|
1143
1169
|
mcpUrl,
|
|
1144
|
-
|
|
1170
|
+
org,
|
|
1171
|
+
apiUrl
|
|
1172
|
+
});
|
|
1173
|
+
const { searchWithApiToken } = await import("./open-api-client-SR4B7265.js");
|
|
1174
|
+
const result = await searchWithApiToken({
|
|
1175
|
+
token: credentials.accessToken,
|
|
1176
|
+
apiUrl,
|
|
1177
|
+
...org ? { org } : {},
|
|
1178
|
+
query: query || void 0,
|
|
1179
|
+
entity: typeof parsed.values.entity === "string" ? parsed.values.entity : void 0,
|
|
1180
|
+
domain: typeof parsed.values.domain === "string" ? parsed.values.domain : void 0,
|
|
1181
|
+
limit: typeof parsed.values.limit === "string" ? Number(parsed.values.limit) : void 0
|
|
1145
1182
|
});
|
|
1146
1183
|
write(formatToolResult(result, json));
|
|
1147
1184
|
return result.isError ? 1 : 0;
|
|
@@ -1150,7 +1187,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1150
1187
|
}
|
|
1151
1188
|
}
|
|
1152
1189
|
case "execute": {
|
|
1153
|
-
const { resolveTarget } = await import("./target-
|
|
1190
|
+
const { resolveTarget } = await import("./target-33ATHDUF.js");
|
|
1154
1191
|
const target = resolveTarget({
|
|
1155
1192
|
command: "execute",
|
|
1156
1193
|
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
@@ -1172,7 +1209,12 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1172
1209
|
);
|
|
1173
1210
|
}
|
|
1174
1211
|
}
|
|
1175
|
-
if (executeSourcesConflict({
|
|
1212
|
+
if (executeSourcesConflict({
|
|
1213
|
+
invoke,
|
|
1214
|
+
hasCodeFlag,
|
|
1215
|
+
hasFileFlag,
|
|
1216
|
+
positionalModule
|
|
1217
|
+
})) {
|
|
1176
1218
|
throw new Error(
|
|
1177
1219
|
"--invoke cannot be combined with --code, --file, or a module string."
|
|
1178
1220
|
);
|
|
@@ -1198,7 +1240,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1198
1240
|
apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
|
|
1199
1241
|
});
|
|
1200
1242
|
let apiUrl = prodApiUrl;
|
|
1201
|
-
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-
|
|
1243
|
+
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-FWVNTLP2.js");
|
|
1202
1244
|
const passthroughHosts = parsePassthroughHosts(
|
|
1203
1245
|
typeof parsed.values.passthrough === "string" ? parsed.values.passthrough : void 0
|
|
1204
1246
|
);
|
|
@@ -1213,7 +1255,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1213
1255
|
let localPackageRun = localPackageInvoke;
|
|
1214
1256
|
if (!localPackageRun && local && modulePath !== void 0) {
|
|
1215
1257
|
try {
|
|
1216
|
-
const { loadPackageManifest } = await import("./package-manifest-
|
|
1258
|
+
const { loadPackageManifest } = await import("./package-manifest-DFF6XCPV.js");
|
|
1217
1259
|
const manifest = await loadPackageManifest(process.cwd());
|
|
1218
1260
|
localPackageRun = {
|
|
1219
1261
|
modulePath,
|
|
@@ -1226,7 +1268,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1226
1268
|
}
|
|
1227
1269
|
try {
|
|
1228
1270
|
if (target === "mock") {
|
|
1229
|
-
const { ensureMockTarget } = await import("./mock-server-
|
|
1271
|
+
const { ensureMockTarget } = await import("./mock-server-6BWDQQBE.js");
|
|
1230
1272
|
const mock = await ensureMockTarget({
|
|
1231
1273
|
resetStorage: parsed.values["reset-storage"] === true,
|
|
1232
1274
|
packageId: localPackageRun ? `local:${localPackageRun.kodyId}` : void 0,
|
|
@@ -1235,7 +1277,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1235
1277
|
apiUrl = mock.apiUrl;
|
|
1236
1278
|
mockToken = mock.token;
|
|
1237
1279
|
closeMock = mock.started ? () => mock.server.close() : void 0;
|
|
1238
|
-
const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-
|
|
1280
|
+
const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-B5ZH4U3H.js");
|
|
1239
1281
|
mockDepResolve = await tryResolveMockDepResolve({
|
|
1240
1282
|
tokenValues,
|
|
1241
1283
|
apiUrl: prodApiUrl,
|
|
@@ -1244,7 +1286,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1244
1286
|
});
|
|
1245
1287
|
}
|
|
1246
1288
|
if (localPackageRun) {
|
|
1247
|
-
const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-
|
|
1289
|
+
const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-WZVZAHK3.js");
|
|
1248
1290
|
const result2 = await runLocalPackageModule({
|
|
1249
1291
|
modulePath: localPackageRun.modulePath,
|
|
1250
1292
|
params: args.params,
|
|
@@ -1282,13 +1324,13 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1282
1324
|
let packageRootForMocks;
|
|
1283
1325
|
if (target === "mock") {
|
|
1284
1326
|
try {
|
|
1285
|
-
const { loadPackageManifest } = await import("./package-manifest-
|
|
1327
|
+
const { loadPackageManifest } = await import("./package-manifest-DFF6XCPV.js");
|
|
1286
1328
|
packageRootForMocks = (await loadPackageManifest(process.cwd())).root;
|
|
1287
1329
|
} catch {
|
|
1288
1330
|
packageRootForMocks = void 0;
|
|
1289
1331
|
}
|
|
1290
1332
|
}
|
|
1291
|
-
const result = local ? await (await import("./local-execute-
|
|
1333
|
+
const result = local ? await (await import("./local-execute-YCXHVAVM.js")).runLocalExecute({
|
|
1292
1334
|
code: args.code,
|
|
1293
1335
|
...modulePath !== void 0 ? { modulePath } : {},
|
|
1294
1336
|
params: args.params,
|
|
@@ -1310,7 +1352,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1310
1352
|
allowPrivateNetwork: parsed.values["allow-private-network"] === true,
|
|
1311
1353
|
onStatus: (message) => writeErr(`${message}
|
|
1312
1354
|
`)
|
|
1313
|
-
}) : useToken ? await (await import("./remote-execute-
|
|
1355
|
+
}) : useToken ? await (await import("./remote-execute-JN6DRFEU.js")).runRemoteExecuteWithToken({
|
|
1314
1356
|
code: typeof args.code === "string" ? args.code : void 0,
|
|
1315
1357
|
invoke,
|
|
1316
1358
|
params: args.params,
|
|
@@ -1324,12 +1366,24 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1324
1366
|
),
|
|
1325
1367
|
apiUrl,
|
|
1326
1368
|
...org ? { org } : {}
|
|
1327
|
-
}) : await (
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1369
|
+
}) : await (async () => {
|
|
1370
|
+
const { ensureOpenApiCredentials } = await import("./auth-6ZE6QQXA.js");
|
|
1371
|
+
const session = await ensureOpenApiCredentials({
|
|
1372
|
+
mcpUrl,
|
|
1373
|
+
org,
|
|
1374
|
+
apiUrl
|
|
1375
|
+
});
|
|
1376
|
+
return (await import("./remote-execute-JN6DRFEU.js")).runRemoteExecuteWithToken({
|
|
1377
|
+
code: typeof args.code === "string" ? args.code : void 0,
|
|
1378
|
+
invoke,
|
|
1379
|
+
params: args.params,
|
|
1380
|
+
conversationId: args.conversationId,
|
|
1381
|
+
...credentials !== void 0 ? { credentials } : {},
|
|
1382
|
+
token: session.accessToken,
|
|
1383
|
+
apiUrl,
|
|
1384
|
+
...org ? { org } : {}
|
|
1385
|
+
});
|
|
1386
|
+
})();
|
|
1333
1387
|
write(formatToolResult(result, json));
|
|
1334
1388
|
return result.isError ? 1 : 0;
|
|
1335
1389
|
} finally {
|
|
@@ -1337,7 +1391,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1337
1391
|
}
|
|
1338
1392
|
}
|
|
1339
1393
|
case "dev": {
|
|
1340
|
-
const { resolveTarget } = await import("./target-
|
|
1394
|
+
const { resolveTarget } = await import("./target-33ATHDUF.js");
|
|
1341
1395
|
const {
|
|
1342
1396
|
parseDevPort,
|
|
1343
1397
|
parseDevSubcommand,
|
|
@@ -1349,7 +1403,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1349
1403
|
runDevServe,
|
|
1350
1404
|
runDevWebhook,
|
|
1351
1405
|
tryAttachedDevFetch
|
|
1352
|
-
} = await import("./dev-command-
|
|
1406
|
+
} = await import("./dev-command-TZ2EB4J3.js");
|
|
1353
1407
|
const target = resolveTarget({
|
|
1354
1408
|
command: "dev",
|
|
1355
1409
|
flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
|
|
@@ -1388,9 +1442,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1388
1442
|
case "webhook": {
|
|
1389
1443
|
const webhookName = rest[0];
|
|
1390
1444
|
if (!webhookName || !bodyPath) {
|
|
1391
|
-
throw new Error(
|
|
1392
|
-
"Usage: kody dev webhook <name> --body file.json"
|
|
1393
|
-
);
|
|
1445
|
+
throw new Error("Usage: kody dev webhook <name> --body file.json");
|
|
1394
1446
|
}
|
|
1395
1447
|
return await runDevWebhook({
|
|
1396
1448
|
target,
|
|
@@ -1405,9 +1457,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1405
1457
|
case "emit": {
|
|
1406
1458
|
const event = rest[0];
|
|
1407
1459
|
if (!event || !bodyPath) {
|
|
1408
|
-
throw new Error(
|
|
1409
|
-
"Usage: kody dev emit <event> --body event.json"
|
|
1410
|
-
);
|
|
1460
|
+
throw new Error("Usage: kody dev emit <event> --body event.json");
|
|
1411
1461
|
}
|
|
1412
1462
|
return await runDevEmit({
|
|
1413
1463
|
target,
|
|
@@ -1444,13 +1494,13 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1444
1494
|
purpose: "kody dev",
|
|
1445
1495
|
...org ? { org } : {}
|
|
1446
1496
|
}) : "mock";
|
|
1447
|
-
const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-
|
|
1497
|
+
const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-B5ZH4U3H.js")).tryResolveMockDepResolve({
|
|
1448
1498
|
tokenValues,
|
|
1449
1499
|
apiUrl: prodApiUrl,
|
|
1450
1500
|
mcpUrl,
|
|
1451
1501
|
...org ? { org } : {}
|
|
1452
1502
|
}) : void 0;
|
|
1453
|
-
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-
|
|
1503
|
+
const { parsePassthroughHosts } = await import("./mock-fetch-gateway-FWVNTLP2.js");
|
|
1454
1504
|
const passthroughHosts = parsePassthroughHosts(
|
|
1455
1505
|
typeof parsed.values.passthrough === "string" ? parsed.values.passthrough : void 0
|
|
1456
1506
|
);
|
|
@@ -1462,7 +1512,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1462
1512
|
const allowPrivateNetwork = parsed.values["allow-private-network"] === true;
|
|
1463
1513
|
let packageId;
|
|
1464
1514
|
try {
|
|
1465
|
-
const { loadPackageManifest } = await import("./package-manifest-
|
|
1515
|
+
const { loadPackageManifest } = await import("./package-manifest-DFF6XCPV.js");
|
|
1466
1516
|
const manifest = await loadPackageManifest(process.cwd());
|
|
1467
1517
|
packageId = `local:${manifest.kodyId}`;
|
|
1468
1518
|
} catch {
|
|
@@ -1532,9 +1582,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1532
1582
|
case "webhook": {
|
|
1533
1583
|
const webhookName = rest[0];
|
|
1534
1584
|
if (!webhookName || !bodyPath) {
|
|
1535
|
-
throw new Error(
|
|
1536
|
-
"Usage: kody dev webhook <name> --body file.json"
|
|
1537
|
-
);
|
|
1585
|
+
throw new Error("Usage: kody dev webhook <name> --body file.json");
|
|
1538
1586
|
}
|
|
1539
1587
|
return await runDevWebhook({
|
|
1540
1588
|
target,
|
|
@@ -1549,9 +1597,7 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1549
1597
|
case "emit": {
|
|
1550
1598
|
const event = rest[0];
|
|
1551
1599
|
if (!event || !bodyPath) {
|
|
1552
|
-
throw new Error(
|
|
1553
|
-
"Usage: kody dev emit <event> --body event.json"
|
|
1554
|
-
);
|
|
1600
|
+
throw new Error("Usage: kody dev emit <event> --body event.json");
|
|
1555
1601
|
}
|
|
1556
1602
|
return await runDevEmit({
|
|
1557
1603
|
target,
|
|
@@ -1589,11 +1635,16 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1589
1635
|
const params = parseApiParamsJson(
|
|
1590
1636
|
typeof parsed.values.params === "string" ? parsed.values.params : void 0
|
|
1591
1637
|
);
|
|
1592
|
-
const { callOpenApiOperation } = await import("./open-api-client-
|
|
1638
|
+
const { callOpenApiOperation } = await import("./open-api-client-SR4B7265.js");
|
|
1593
1639
|
const result = await callOpenApiOperation({
|
|
1594
1640
|
operationId,
|
|
1595
1641
|
params,
|
|
1596
|
-
token:
|
|
1642
|
+
token: await accessTokenForOpenApi({
|
|
1643
|
+
tokenValues,
|
|
1644
|
+
apiUrl,
|
|
1645
|
+
mcpUrl,
|
|
1646
|
+
org
|
|
1647
|
+
}),
|
|
1597
1648
|
apiUrl,
|
|
1598
1649
|
...org ? { org } : {}
|
|
1599
1650
|
});
|
|
@@ -1613,10 +1664,13 @@ Tools: ${tools.map((tool) => tool.name).join(", ") || "(none)"}
|
|
|
1613
1664
|
positionals: parsed.positionals.slice(1),
|
|
1614
1665
|
values: parsed.values
|
|
1615
1666
|
});
|
|
1616
|
-
const token =
|
|
1617
|
-
|
|
1667
|
+
const token = await accessTokenForOpenApi({
|
|
1668
|
+
tokenValues,
|
|
1669
|
+
apiUrl,
|
|
1670
|
+
mcpUrl,
|
|
1671
|
+
org
|
|
1618
1672
|
});
|
|
1619
|
-
const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-
|
|
1673
|
+
const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-SR4B7265.js");
|
|
1620
1674
|
write(
|
|
1621
1675
|
await runPackageCollaboratorPlan({
|
|
1622
1676
|
plan,
|
|
@@ -1642,9 +1696,12 @@ ${packageCollaboratorUsage}`
|
|
|
1642
1696
|
positional: parsed.positionals[1],
|
|
1643
1697
|
paramsJson: typeof parsed.values.params === "string" ? parsed.values.params : void 0
|
|
1644
1698
|
});
|
|
1645
|
-
const { callOpenApiOperation } = await import("./open-api-client-
|
|
1646
|
-
const publishToken =
|
|
1647
|
-
|
|
1699
|
+
const { callOpenApiOperation } = await import("./open-api-client-SR4B7265.js");
|
|
1700
|
+
const publishToken = await accessTokenForOpenApi({
|
|
1701
|
+
tokenValues,
|
|
1702
|
+
apiUrl,
|
|
1703
|
+
mcpUrl,
|
|
1704
|
+
org
|
|
1648
1705
|
});
|
|
1649
1706
|
const call = (operationId, operationParams) => callOpenApiOperation({
|
|
1650
1707
|
operationId,
|
|
@@ -1662,7 +1719,7 @@ ${packageCollaboratorUsage}`
|
|
|
1662
1719
|
return 0;
|
|
1663
1720
|
}
|
|
1664
1721
|
case "install": {
|
|
1665
|
-
const { runInstall } = await import("./install-
|
|
1722
|
+
const { runInstall } = await import("./install-ONEJRYZ3.js");
|
|
1666
1723
|
const result = await runInstall(
|
|
1667
1724
|
{
|
|
1668
1725
|
mcpUrl,
|
|
@@ -1680,8 +1737,10 @@ ${packageCollaboratorUsage}`
|
|
|
1680
1737
|
if (action !== "install") {
|
|
1681
1738
|
throw new Error("Usage: kody skill install [--project]");
|
|
1682
1739
|
}
|
|
1683
|
-
const { installSkill } = await import("./skill-
|
|
1684
|
-
const targets = await installSkill({
|
|
1740
|
+
const { installSkill } = await import("./skill-D74XVI6T.js");
|
|
1741
|
+
const targets = await installSkill({
|
|
1742
|
+
project: parsed.values.project === true
|
|
1743
|
+
});
|
|
1685
1744
|
write(
|
|
1686
1745
|
`Installed the Kody skill to:
|
|
1687
1746
|
${targets.map((target) => `- ${target.host}: ${target.path}`).join("\n")}
|
|
@@ -1706,8 +1765,8 @@ async function tryResolveLocalPackageInvoke(invoke) {
|
|
|
1706
1765
|
const trimmed = invoke.trim();
|
|
1707
1766
|
if (!trimmed) return null;
|
|
1708
1767
|
if (isPublishedPackageInvokeSpecifier(trimmed)) return null;
|
|
1709
|
-
const { loadPackageManifest, resolveExportModulePath } = await import("./package-manifest-
|
|
1710
|
-
const { StructuredCliError } = await import("./structured-error-
|
|
1768
|
+
const { loadPackageManifest, resolveExportModulePath } = await import("./package-manifest-DFF6XCPV.js");
|
|
1769
|
+
const { StructuredCliError } = await import("./structured-error-5MLWXYR3.js");
|
|
1711
1770
|
let manifest;
|
|
1712
1771
|
try {
|
|
1713
1772
|
manifest = await loadPackageManifest(process.cwd());
|
|
@@ -1742,7 +1801,9 @@ function buildExecuteToolArgs(input) {
|
|
|
1742
1801
|
const invoke = input.invoke;
|
|
1743
1802
|
const code = input.code;
|
|
1744
1803
|
if (invoke !== void 0 && code !== void 0 && code.length > 0) {
|
|
1745
|
-
throw new Error(
|
|
1804
|
+
throw new Error(
|
|
1805
|
+
"--invoke cannot be combined with --code, --file, or a module string."
|
|
1806
|
+
);
|
|
1746
1807
|
}
|
|
1747
1808
|
if (invoke !== void 0) {
|
|
1748
1809
|
if (!invoke) {
|
|
@@ -1768,7 +1829,7 @@ function attachExecuteCommonArgs(args, input) {
|
|
|
1768
1829
|
return args;
|
|
1769
1830
|
}
|
|
1770
1831
|
async function runAuthSetupGit(input) {
|
|
1771
|
-
const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-
|
|
1832
|
+
const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-MHK563LB.js");
|
|
1772
1833
|
const apiUrl = apiUrlFrom({
|
|
1773
1834
|
apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
|
|
1774
1835
|
});
|
|
@@ -1825,7 +1886,7 @@ async function runAuthSetupGit(input) {
|
|
|
1825
1886
|
return 0;
|
|
1826
1887
|
}
|
|
1827
1888
|
async function runAuthRemoveGit(input) {
|
|
1828
|
-
const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-
|
|
1889
|
+
const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-MHK563LB.js");
|
|
1829
1890
|
const apiUrl = apiUrlFrom({
|
|
1830
1891
|
apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
|
|
1831
1892
|
});
|
|
@@ -1845,10 +1906,15 @@ function bootstrapMinter(input) {
|
|
|
1845
1906
|
allowEnvWithoutLogin: true,
|
|
1846
1907
|
...input.org ? { org: input.org } : {}
|
|
1847
1908
|
})) {
|
|
1848
|
-
const token = requireApiToken(
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1909
|
+
const token = requireApiToken(
|
|
1910
|
+
input.tokenValues,
|
|
1911
|
+
process.env,
|
|
1912
|
+
"auth bootstrap --scopes",
|
|
1913
|
+
{
|
|
1914
|
+
apiUrl: input.apiUrl
|
|
1915
|
+
}
|
|
1916
|
+
);
|
|
1917
|
+
const { callOpenApiOperation } = await import("./open-api-client-SR4B7265.js");
|
|
1852
1918
|
try {
|
|
1853
1919
|
return await callOpenApiOperation({
|
|
1854
1920
|
token,
|
|
@@ -1869,10 +1935,18 @@ function bootstrapMinter(input) {
|
|
|
1869
1935
|
if (loadCredentials(input.mcpUrl, void 0, void 0, {
|
|
1870
1936
|
org: input.org
|
|
1871
1937
|
})) {
|
|
1872
|
-
|
|
1938
|
+
const { ensureOpenApiCredentials } = await import("./auth-6ZE6QQXA.js");
|
|
1939
|
+
const session = await ensureOpenApiCredentials({
|
|
1940
|
+
mcpUrl: input.mcpUrl,
|
|
1941
|
+
apiUrl: input.apiUrl,
|
|
1942
|
+
...input.org ? { org: input.org } : {}
|
|
1943
|
+
});
|
|
1944
|
+
const { callOpenApiOperation } = await import("./open-api-client-SR4B7265.js");
|
|
1945
|
+
return callOpenApiOperation({
|
|
1873
1946
|
operationId: cliCredentialBootstrapOperationId,
|
|
1874
1947
|
params,
|
|
1875
|
-
|
|
1948
|
+
token: session.accessToken,
|
|
1949
|
+
apiUrl: input.apiUrl,
|
|
1876
1950
|
...input.org ? { org: input.org } : {}
|
|
1877
1951
|
});
|
|
1878
1952
|
}
|
|
@@ -1886,6 +1960,21 @@ function tokenFlagValues(values) {
|
|
|
1886
1960
|
token: typeof values.token === "string" ? values.token : void 0
|
|
1887
1961
|
};
|
|
1888
1962
|
}
|
|
1963
|
+
async function accessTokenForOpenApi(input) {
|
|
1964
|
+
const explicit = resolveScopedApiToken({
|
|
1965
|
+
tokenValues: input.tokenValues,
|
|
1966
|
+
env: process.env,
|
|
1967
|
+
apiUrl: input.apiUrl
|
|
1968
|
+
});
|
|
1969
|
+
if (explicit) return explicit;
|
|
1970
|
+
const { ensureOpenApiCredentials } = await import("./auth-6ZE6QQXA.js");
|
|
1971
|
+
const session = await ensureOpenApiCredentials({
|
|
1972
|
+
mcpUrl: input.mcpUrl,
|
|
1973
|
+
apiUrl: input.apiUrl,
|
|
1974
|
+
...input.org ? { org: input.org } : {}
|
|
1975
|
+
});
|
|
1976
|
+
return session.accessToken;
|
|
1977
|
+
}
|
|
1889
1978
|
function parseApiParamsJson(paramsJson) {
|
|
1890
1979
|
if (paramsJson === void 0) return {};
|
|
1891
1980
|
let parsed;
|
|
@@ -1895,7 +1984,9 @@ function parseApiParamsJson(paramsJson) {
|
|
|
1895
1984
|
throw new Error("--params must be valid JSON (a flat object).");
|
|
1896
1985
|
}
|
|
1897
1986
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
1898
|
-
throw new Error(
|
|
1987
|
+
throw new Error(
|
|
1988
|
+
`--params must be a JSON object (e.g. '{"query":"email"}').`
|
|
1989
|
+
);
|
|
1899
1990
|
}
|
|
1900
1991
|
return parsed;
|
|
1901
1992
|
}
|
|
@@ -1912,7 +2003,8 @@ function packagePublishParams(input) {
|
|
|
1912
2003
|
return params;
|
|
1913
2004
|
}
|
|
1914
2005
|
async function resolvePackagePublishTarget(params, call) {
|
|
1915
|
-
if (params.package_id !== void 0 || typeof params.kody_id !== "string")
|
|
2006
|
+
if (params.package_id !== void 0 || typeof params.kody_id !== "string")
|
|
2007
|
+
return params;
|
|
1916
2008
|
const ref = params.kody_id.trim();
|
|
1917
2009
|
const listed = await call("packageList", {});
|
|
1918
2010
|
const packages = listed.packages ?? [];
|
|
@@ -1956,4 +2048,4 @@ export {
|
|
|
1956
2048
|
resolvePackagePublishTarget,
|
|
1957
2049
|
shouldUseApiToken
|
|
1958
2050
|
};
|
|
1959
|
-
//# sourceMappingURL=chunk-
|
|
2051
|
+
//# sourceMappingURL=chunk-5YQBD7PN.js.map
|