@kodycodes/cli 3.22.7 → 3.22.9

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.
Files changed (214) hide show
  1. package/README.md +8 -7
  2. package/dist/add-mcp-install.d.ts +1 -1
  3. package/dist/api-token-store.d.ts +0 -2
  4. package/dist/api-token.d.ts +6 -21
  5. package/dist/{auth-W5RWT6IP.js → auth-EEGVQLUH.js} +10 -9
  6. package/dist/auth-bootstrap.d.ts +4 -19
  7. package/dist/bin.js +15 -16
  8. package/dist/bin.js.map +1 -1
  9. package/dist/capability-proxy.d.ts +6 -36
  10. package/dist/{chunk-XV6D6HSG.js → chunk-42R5NM3P.js} +1 -2
  11. package/dist/chunk-42R5NM3P.js.map +6 -0
  12. package/dist/{chunk-ZUROJOJ2.js → chunk-4AKERLPX.js} +3 -5
  13. package/dist/chunk-4AKERLPX.js.map +6 -0
  14. package/dist/{chunk-FPYLVYHC.js → chunk-4Q5BFP2W.js} +64 -249
  15. package/dist/chunk-4Q5BFP2W.js.map +6 -0
  16. package/dist/{chunk-FHLTB67D.js → chunk-5W34SXJW.js} +8 -119
  17. package/dist/chunk-5W34SXJW.js.map +6 -0
  18. package/dist/{chunk-K2G6GYKA.js → chunk-62N7DN7L.js} +1 -1
  19. package/dist/{chunk-K2G6GYKA.js.map → chunk-62N7DN7L.js.map} +1 -1
  20. package/dist/{chunk-DBNNDB7I.js → chunk-7CKXJKIA.js} +9 -9
  21. package/dist/{chunk-DBNNDB7I.js.map → chunk-7CKXJKIA.js.map} +1 -1
  22. package/dist/{chunk-OKM2QMOV.js → chunk-7JU4GNCS.js} +16 -116
  23. package/dist/chunk-7JU4GNCS.js.map +6 -0
  24. package/dist/chunk-BKUM4PLI.js +220 -0
  25. package/dist/chunk-BKUM4PLI.js.map +6 -0
  26. package/dist/{chunk-2FU3OO7F.js → chunk-BWZ3ZIQO.js} +5 -19
  27. package/dist/chunk-BWZ3ZIQO.js.map +6 -0
  28. package/dist/{chunk-4LAKIU3Y.js → chunk-C7GRF5V5.js} +2 -2
  29. package/dist/{chunk-SLNAWWQK.js → chunk-E4R3Y6MM.js} +1 -1
  30. package/dist/{chunk-SLNAWWQK.js.map → chunk-E4R3Y6MM.js.map} +1 -1
  31. package/dist/{chunk-G7GRULRW.js → chunk-EMEUJKXR.js} +2 -2
  32. package/dist/{chunk-5E2HSGBZ.js → chunk-FY4SRIOG.js} +4 -5
  33. package/dist/chunk-FY4SRIOG.js.map +6 -0
  34. package/dist/{chunk-F3XGCTRQ.js → chunk-IIGF3ZWU.js} +137 -82
  35. package/dist/chunk-IIGF3ZWU.js.map +6 -0
  36. package/dist/{chunk-OXBMXZ6S.js → chunk-JSNRL2K6.js} +3 -167
  37. package/dist/{chunk-OXBMXZ6S.js.map → chunk-JSNRL2K6.js.map} +3 -3
  38. package/dist/{chunk-RD6ZJU2N.js → chunk-KZQLRBP2.js} +5 -5
  39. package/dist/{chunk-76OYRT4A.js → chunk-LQNGII7U.js} +1 -1
  40. package/dist/{chunk-76OYRT4A.js.map → chunk-LQNGII7U.js.map} +1 -1
  41. package/dist/{chunk-2XPH7L2P.js → chunk-MIT3TUWB.js} +1 -1
  42. package/dist/{chunk-2XPH7L2P.js.map → chunk-MIT3TUWB.js.map} +1 -1
  43. package/dist/{chunk-VP2O3HLT.js → chunk-NKH2L5RA.js} +17 -1
  44. package/dist/chunk-NKH2L5RA.js.map +6 -0
  45. package/dist/{chunk-M7PRSUCC.js → chunk-NKQRWYSY.js} +4 -2
  46. package/dist/chunk-NKQRWYSY.js.map +6 -0
  47. package/dist/{chunk-D6XME4RY.js → chunk-RE7LNPRO.js} +2 -5
  48. package/dist/{chunk-D6XME4RY.js.map → chunk-RE7LNPRO.js.map} +1 -1
  49. package/dist/chunk-SLHFID52.js +107 -0
  50. package/dist/chunk-SLHFID52.js.map +6 -0
  51. package/dist/{chunk-YQRMKXCC.js → chunk-V4SN6Y7O.js} +4 -6
  52. package/dist/chunk-V4SN6Y7O.js.map +6 -0
  53. package/dist/{chunk-DEI4SMFK.js → chunk-XXCAGPVV.js} +7 -9
  54. package/dist/chunk-XXCAGPVV.js.map +6 -0
  55. package/dist/chunk-YFNQZPEP.js +124 -0
  56. package/dist/chunk-YFNQZPEP.js.map +6 -0
  57. package/dist/{chunk-ZXNYKFSN.js → chunk-YLDI65PR.js} +153 -153
  58. package/dist/chunk-YLDI65PR.js.map +6 -0
  59. package/dist/{chunk-NPQ2XAK5.js → chunk-YYCR2HQJ.js} +3 -3
  60. package/dist/chunk-YYCR2HQJ.js.map +6 -0
  61. package/dist/cli.d.ts +10 -1
  62. package/dist/cli.js +17 -16
  63. package/dist/{commands-MZMI3MEY.js → commands-ZJNROANP.js} +1158 -73
  64. package/dist/commands-ZJNROANP.js.map +6 -0
  65. package/dist/credential-call-map.d.ts +0 -6
  66. package/dist/credential-dir.d.ts +0 -2
  67. package/dist/credentialed-fetch-scan.d.ts +2 -2
  68. package/dist/defaults.d.ts +5 -5
  69. package/dist/detect-running-hosts.d.ts +1 -1
  70. package/dist/dev/dev-assets.d.ts +1 -3
  71. package/dist/dev/dev-bundler.d.ts +0 -5
  72. package/dist/dev/dev-events.d.ts +2 -2
  73. package/dist/dev/dev-proxy-origin.d.ts +1 -1
  74. package/dist/dev/dev-registry.d.ts +1 -1
  75. package/dist/dev/error-page.d.ts +3 -5
  76. package/dist/dev/live-reload.d.ts +4 -3
  77. package/dist/dev/workerd-process.d.ts +0 -1
  78. package/dist/{dev-command-XIQY56LW.js → dev-command-TDLNJ7ZA.js} +22 -23
  79. package/dist/dev-command-TDLNJ7ZA.js.map +6 -0
  80. package/dist/dev-command.d.ts +1 -10
  81. package/dist/discover-login-identity.d.ts +1 -1
  82. package/dist/execution-context/auto-update.d.ts +1 -66
  83. package/dist/execution-context/client.d.ts +2 -3
  84. package/dist/execution-context/commands.d.ts +0 -11
  85. package/dist/execution-context/daemon.d.ts +2 -7
  86. package/dist/execution-context/fs-access.d.ts +5 -4
  87. package/dist/execution-context/host-commands.d.ts +3 -47
  88. package/dist/execution-context/host-fs-bridge.d.ts +0 -2
  89. package/dist/execution-context/keystore.d.ts +0 -1
  90. package/dist/execution-context/package-graph-cache.d.ts +1 -1
  91. package/dist/execution-context/run-executor.d.ts +6 -6
  92. package/dist/execution-context/runner-lock.d.ts +0 -8
  93. package/dist/execution-context/service-commands.d.ts +17 -8
  94. package/dist/execution-context/service.d.ts +3 -13
  95. package/dist/execution-context/windows-command.d.ts +0 -2
  96. package/dist/fetch-body-secret-resolution.d.ts +0 -1
  97. package/dist/{git-credential-BT363OJQ.js → git-credential-QEMS2OZF.js} +11 -10
  98. package/dist/git-credential-QEMS2OZF.js.map +6 -0
  99. package/dist/help.d.ts +0 -6
  100. package/dist/host-catalog.d.ts +2 -5
  101. package/dist/host-config.d.ts +2 -3
  102. package/dist/{install-NTS5BOCR.js → install-MPB5WEG4.js} +3 -5
  103. package/dist/{install-NTS5BOCR.js.map → install-MPB5WEG4.js.map} +1 -1
  104. package/dist/install-hosts.d.ts +2 -1
  105. package/dist/install.d.ts +1 -6
  106. package/dist/invoke-passthrough.d.ts +0 -1
  107. package/dist/local-egress.d.ts +2 -1
  108. package/dist/{chunk-SLBG76VX.js → local-execute-3I5YDMM5.js} +30 -16
  109. package/dist/local-execute-3I5YDMM5.js.map +6 -0
  110. package/dist/local-execute-auth.d.ts +2 -2
  111. package/dist/local-execute.d.ts +4 -4
  112. package/dist/local-gateway-fetch-forward.d.ts +2 -2
  113. package/dist/{local-package-graph-WFDNSNOJ.js → local-package-graph-PMZQD7WF.js} +9 -18
  114. package/dist/local-package-graph.d.ts +0 -34
  115. package/dist/local-package-run-SJIAEVMD.js +34 -0
  116. package/dist/local-package-run.d.ts +2 -2
  117. package/dist/local-runtime-bridge.d.ts +2 -5
  118. package/dist/local-runtime-source.d.ts +0 -2
  119. package/dist/login-callback-page.d.ts +3 -2
  120. package/dist/mock/install-mock-fetch-shim.d.ts +1 -1
  121. package/dist/mock/load-package-mocks.d.ts +0 -1
  122. package/dist/mock/mock-fetch-gateway.d.ts +1 -4
  123. package/dist/mock/mock-server.d.ts +0 -1
  124. package/dist/mock/mock-storage.d.ts +2 -2
  125. package/dist/mock/mock-supported.d.ts +2 -1
  126. package/dist/{mock-dep-resolve-G7TA4CJB.js → mock-dep-resolve-4WSWOQHT.js} +7 -14
  127. package/dist/mock-dep-resolve-4WSWOQHT.js.map +6 -0
  128. package/dist/{mock-fetch-gateway-QNUFNYAH.js → mock-fetch-gateway-5K7STXZQ.js} +5 -10
  129. package/dist/{mock-local-deps-K2NARQ7F.js → mock-local-deps-7GS6RPYL.js} +12 -14
  130. package/dist/mock-local-deps.d.ts +0 -4
  131. package/dist/{mock-server-2FMSQMBT.js → mock-server-WOSXMC2L.js} +6 -9
  132. package/dist/node-engine.d.ts +0 -2
  133. package/dist/oauth-browser.d.ts +0 -3
  134. package/dist/oauth-provider.d.ts +1 -1
  135. package/dist/{open-api-client-DJL2PE7P.js → open-api-client-A26G263D.js} +9 -16
  136. package/dist/open-api-client.d.ts +1 -7
  137. package/dist/{org-SGFIXD42.js → org-NWSSC7L7.js} +3 -10
  138. package/dist/org-NWSSC7L7.js.map +6 -0
  139. package/dist/org.d.ts +0 -2
  140. package/dist/package-app-dev.d.ts +1 -1
  141. package/dist/package-collaborators.d.ts +2 -4
  142. package/dist/package-local-runtime-source.d.ts +2 -2
  143. package/dist/{package-manifest-KCLPIMOZ.js → package-manifest-OFJ5PRA2.js} +3 -4
  144. package/dist/package-manifest.d.ts +7 -6
  145. package/dist/process-info.d.ts +0 -2
  146. package/dist/publish-exit.d.ts +0 -11
  147. package/dist/{remote-execute-KUSUI6UT.js → remote-execute-PDSZBGQ7.js} +10 -9
  148. package/dist/remote-execute-PDSZBGQ7.js.map +6 -0
  149. package/dist/remote-execute.d.ts +2 -2
  150. package/dist/{run-executor-4TY5KNQQ.js → run-executor-6HMXYWQ5.js} +3 -21
  151. package/dist/run-executor-6HMXYWQ5.js.map +6 -0
  152. package/dist/{setup-git-KBH7GA6E.js → setup-git-7PQUU6JB.js} +10 -39
  153. package/dist/setup-git.d.ts +6 -60
  154. package/dist/{skill-IY263IXV.js → skill-QM3N6H55.js} +3 -3
  155. package/dist/skill-refresh.js +2 -2
  156. package/dist/{store-ZPBJTYRI.js → store-4G2J5DRZ.js} +3 -9
  157. package/dist/store.d.ts +2 -6
  158. package/dist/{structured-error-QYNRZZKC.js → structured-error-D2G3PBEZ.js} +2 -5
  159. package/dist/structured-error.d.ts +3 -3
  160. package/dist/{chunk-MHN2FS4K.js → target-LQ247AM3.js} +4 -4
  161. package/dist/target-LQ247AM3.js.map +6 -0
  162. package/dist/{whoami-SGE7VKGY.js → whoami-JGNVG2UX.js} +7 -7
  163. package/dist/whoami-JGNVG2UX.js.map +6 -0
  164. package/dist/whoami.d.ts +0 -11
  165. package/dist/workerd-binary.d.ts +2 -3
  166. package/package.json +1 -1
  167. package/dist/chunk-2FU3OO7F.js.map +0 -6
  168. package/dist/chunk-5E2HSGBZ.js.map +0 -6
  169. package/dist/chunk-7PRJ36I5.js +0 -23
  170. package/dist/chunk-7PRJ36I5.js.map +0 -6
  171. package/dist/chunk-CWQVWIAQ.js +0 -994
  172. package/dist/chunk-CWQVWIAQ.js.map +0 -6
  173. package/dist/chunk-DEI4SMFK.js.map +0 -6
  174. package/dist/chunk-F3XGCTRQ.js.map +0 -6
  175. package/dist/chunk-FHLTB67D.js.map +0 -6
  176. package/dist/chunk-FPYLVYHC.js.map +0 -6
  177. package/dist/chunk-M7PRSUCC.js.map +0 -6
  178. package/dist/chunk-MHN2FS4K.js.map +0 -6
  179. package/dist/chunk-NPQ2XAK5.js.map +0 -6
  180. package/dist/chunk-OKM2QMOV.js.map +0 -6
  181. package/dist/chunk-SLBG76VX.js.map +0 -6
  182. package/dist/chunk-VP2O3HLT.js.map +0 -6
  183. package/dist/chunk-XV6D6HSG.js.map +0 -6
  184. package/dist/chunk-YQRMKXCC.js.map +0 -6
  185. package/dist/chunk-ZUROJOJ2.js.map +0 -6
  186. package/dist/chunk-ZXNYKFSN.js.map +0 -6
  187. package/dist/commands-MZMI3MEY.js.map +0 -6
  188. package/dist/dev-command-XIQY56LW.js.map +0 -6
  189. package/dist/git-credential-BT363OJQ.js.map +0 -6
  190. package/dist/local-execute-BI5253MQ.js +0 -39
  191. package/dist/local-package-run-RRELUZEM.js +0 -33
  192. package/dist/mock-dep-resolve-G7TA4CJB.js.map +0 -6
  193. package/dist/org-SGFIXD42.js.map +0 -6
  194. package/dist/remote-execute-KUSUI6UT.js.map +0 -6
  195. package/dist/run-executor-4TY5KNQQ.js.map +0 -6
  196. package/dist/structured-error-QYNRZZKC.js.map +0 -6
  197. package/dist/target-UQBEV64U.js +0 -15
  198. package/dist/target-UQBEV64U.js.map +0 -6
  199. package/dist/whoami-SGE7VKGY.js.map +0 -6
  200. /package/dist/{auth-W5RWT6IP.js.map → auth-EEGVQLUH.js.map} +0 -0
  201. /package/dist/{chunk-4LAKIU3Y.js.map → chunk-C7GRF5V5.js.map} +0 -0
  202. /package/dist/{chunk-G7GRULRW.js.map → chunk-EMEUJKXR.js.map} +0 -0
  203. /package/dist/{chunk-RD6ZJU2N.js.map → chunk-KZQLRBP2.js.map} +0 -0
  204. /package/dist/{local-execute-BI5253MQ.js.map → local-package-graph-PMZQD7WF.js.map} +0 -0
  205. /package/dist/{local-package-graph-WFDNSNOJ.js.map → local-package-run-SJIAEVMD.js.map} +0 -0
  206. /package/dist/{local-package-run-RRELUZEM.js.map → mock-fetch-gateway-5K7STXZQ.js.map} +0 -0
  207. /package/dist/{mock-fetch-gateway-QNUFNYAH.js.map → mock-local-deps-7GS6RPYL.js.map} +0 -0
  208. /package/dist/{mock-local-deps-K2NARQ7F.js.map → mock-server-WOSXMC2L.js.map} +0 -0
  209. /package/dist/{mock-server-2FMSQMBT.js.map → open-api-client-A26G263D.js.map} +0 -0
  210. /package/dist/{open-api-client-DJL2PE7P.js.map → package-manifest-OFJ5PRA2.js.map} +0 -0
  211. /package/dist/{package-manifest-KCLPIMOZ.js.map → setup-git-7PQUU6JB.js.map} +0 -0
  212. /package/dist/{setup-git-KBH7GA6E.js.map → skill-QM3N6H55.js.map} +0 -0
  213. /package/dist/{skill-IY263IXV.js.map → store-4G2J5DRZ.js.map} +0 -0
  214. /package/dist/{store-ZPBJTYRI.js.map → structured-error-D2G3PBEZ.js.map} +0 -0
@@ -1,4 +1,7 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ formatToolResult
4
+ } from "./chunk-46IJPEID.js";
2
5
  import {
3
6
  detectHeadlessLoginReason,
4
7
  formatDeviceLoginNotice,
@@ -7,20 +10,17 @@ import {
7
10
  formatLoginUrlNotice,
8
11
  hostIds,
9
12
  loginBrowserOpenFailedNotice
10
- } from "./chunk-M7PRSUCC.js";
11
- import {
12
- resolveOrgSlug
13
- } from "./chunk-7PRJ36I5.js";
13
+ } from "./chunk-NKQRWYSY.js";
14
14
  import {
15
15
  isPublishedPackageInvokeSpecifier,
16
16
  resolveExecuteInvokeCode
17
- } from "./chunk-SLNAWWQK.js";
17
+ } from "./chunk-E4R3Y6MM.js";
18
18
  import {
19
19
  resolveLocalExecuteBearer
20
- } from "./chunk-RD6ZJU2N.js";
20
+ } from "./chunk-KZQLRBP2.js";
21
21
  import {
22
22
  assertLocalExecuteNodeEngine
23
- } from "./chunk-2XPH7L2P.js";
23
+ } from "./chunk-MIT3TUWB.js";
24
24
  import {
25
25
  authBootstrap,
26
26
  authBootstrapWithScopes,
@@ -30,7 +30,7 @@ import {
30
30
  parseCliScopesFlag,
31
31
  refreshGitCredentialHelperPinIfNeeded,
32
32
  resolveCliTokenLifetime
33
- } from "./chunk-2FU3OO7F.js";
33
+ } from "./chunk-BWZ3ZIQO.js";
34
34
  import {
35
35
  orgEnvVar,
36
36
  orgSlugFromFlag
@@ -39,37 +39,40 @@ import {
39
39
  redactError
40
40
  } from "./chunk-CASGRYOF.js";
41
41
  import {
42
- formatToolResult
43
- } from "./chunk-46IJPEID.js";
44
- import {
45
- cliBootstrapMintCall,
46
42
  parseCredentialFlags,
47
43
  readPackageVersion
48
- } from "./chunk-FPYLVYHC.js";
44
+ } from "./chunk-4Q5BFP2W.js";
45
+ import {
46
+ cliBootstrapMintCall,
47
+ expectedPairedApiOrigin
48
+ } from "./chunk-BKUM4PLI.js";
49
49
  import {
50
- deleteStoredApiToken,
51
50
  describeCliCredential,
52
- loadStoredApiToken,
53
51
  noteActiveLoginCredential,
54
52
  replaceStoredTokenCommand,
55
53
  resetActiveCliCredential,
56
54
  resolveCliCredential
57
- } from "./chunk-FHLTB67D.js";
55
+ } from "./chunk-5W34SXJW.js";
56
+ import {
57
+ deleteStoredApiToken,
58
+ loadStoredApiToken
59
+ } from "./chunk-YFNQZPEP.js";
58
60
  import {
59
61
  deleteCredentials,
60
62
  listStoredOrgs,
61
63
  loadCredentialStore,
62
64
  loadCredentials
63
- } from "./chunk-D6XME4RY.js";
65
+ } from "./chunk-RE7LNPRO.js";
64
66
  import {
65
67
  apiTokenEnvVar,
66
68
  defaultApiUrl,
67
69
  defaultMcpUrl,
68
70
  onboardingUrl
69
- } from "./chunk-VP2O3HLT.js";
71
+ } from "./chunk-NKH2L5RA.js";
70
72
 
71
73
  // src/cli.ts
72
74
  import { parseArgs } from "node:util";
75
+ import { statSync } from "node:fs";
73
76
  import { readFile } from "node:fs/promises";
74
77
 
75
78
  // src/help.ts
@@ -510,6 +513,19 @@ Environment:
510
513
  `;
511
514
  }
512
515
 
516
+ // src/org-resolve.ts
517
+ function resolveOrgSlug(input) {
518
+ if (input.flag !== void 0) return orgSlugFromFlag(input.flag);
519
+ const fromEnv = input.env?.[orgEnvVar] ?? process.env[orgEnvVar];
520
+ if (typeof fromEnv === "string" && fromEnv.trim()) {
521
+ return orgSlugFromFlag(fromEnv);
522
+ }
523
+ if (typeof input.activeOrg === "string" && input.activeOrg.trim()) {
524
+ return orgSlugFromFlag(input.activeOrg);
525
+ }
526
+ return void 0;
527
+ }
528
+
513
529
  // src/publish-exit.ts
514
530
  function isRecord(value) {
515
531
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -592,7 +608,11 @@ var packageCollaboratorPresets = [
592
608
  "contribute",
593
609
  "manage"
594
610
  ];
595
- var packageCollaboratorActions = ["collaborators", "grant", "revoke"];
611
+ var packageCollaboratorActions = [
612
+ "collaborators",
613
+ "grant",
614
+ "revoke"
615
+ ];
596
616
  function isPackageCollaboratorAction(value) {
597
617
  return packageCollaboratorActions.includes(value);
598
618
  }
@@ -824,8 +844,12 @@ var orgScopedCommands = /* @__PURE__ */ new Set([
824
844
  function mcpUrlFrom(values) {
825
845
  return values.mcpUrl || process.env.KODY_MCP_URL || defaultMcpUrl;
826
846
  }
827
- function apiUrlFrom(values, env = process.env) {
828
- return values.apiUrl || env.KODY_API_URL || defaultApiUrl;
847
+ function apiUrlFrom(values, env = process.env, mcpUrl) {
848
+ if (values.apiUrl || env.KODY_API_URL) {
849
+ return values.apiUrl || env.KODY_API_URL;
850
+ }
851
+ const paired = mcpUrl ? expectedPairedApiOrigin(mcpUrl) : null;
852
+ return paired?.startsWith("https://") ? paired : defaultApiUrl;
829
853
  }
830
854
  var cliFlagOptions = {
831
855
  help: { type: "boolean", short: "h" },
@@ -956,7 +980,7 @@ async function runCli(argv = process.argv.slice(2), io = {}) {
956
980
  }
957
981
  const skipSkillRefresh = underNodeTest || process.env.KODY_SKIP_SKILL_REFRESH === "1" || head === "git-credential" || head === "skill" || head === "version" || head === "--version" || head === "-v" || head === "help" || head === "--help" || head === "-h" || head === void 0;
958
982
  if (!skipSkillRefresh) {
959
- void import("./skill-IY263IXV.js").then(({ scheduleDetachedSkillRefresh }) => {
983
+ void import("./skill-QM3N6H55.js").then(({ scheduleDetachedSkillRefresh }) => {
960
984
  scheduleDetachedSkillRefresh({
961
985
  origin: process.env.KODY_MCP_URL ? new URL(process.env.KODY_MCP_URL).origin : void 0
962
986
  });
@@ -1012,7 +1036,7 @@ async function dispatch(parsed, write, writeErr) {
1012
1036
  });
1013
1037
  const json = parsed.values.json === true;
1014
1038
  if (parsed.values["allow-private-network"] === true) {
1015
- const executeAllowsPrivateNetwork = parsed.command === "execute" && (parsed.values.local === true || (await import("./target-UQBEV64U.js")).resolveTarget({
1039
+ const executeAllowsPrivateNetwork = parsed.command === "execute" && (parsed.values.local === true || (await import("./target-LQ247AM3.js")).resolveTarget({
1016
1040
  command: "execute",
1017
1041
  flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
1018
1042
  }) === "mock");
@@ -1075,7 +1099,7 @@ async function dispatch(parsed, write, writeErr) {
1075
1099
  const apiUrl = apiUrlFrom({
1076
1100
  apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1077
1101
  });
1078
- const { runExecutionContextCommand } = await import("./commands-MZMI3MEY.js");
1102
+ const { runExecutionContextCommand } = await import("./commands-ZJNROANP.js");
1079
1103
  return await runExecutionContextCommand({
1080
1104
  command: parsed.command,
1081
1105
  positionals: parsed.positionals,
@@ -1105,14 +1129,18 @@ async function dispatch(parsed, write, writeErr) {
1105
1129
  });
1106
1130
  }
1107
1131
  case "login": {
1108
- const { login, loginWithDevice } = await import("./auth-W5RWT6IP.js");
1132
+ const { login, loginWithDevice } = await import("./auth-EEGVQLUH.js");
1109
1133
  const openBrowser = parsed.values["no-browser"] !== true;
1110
1134
  const lifetimeOption = typeof parsed.values.lifetime === "string" ? {
1111
1135
  lifetime: parsed.values.lifetime === "short" ? "short" : "long"
1112
1136
  } : {};
1113
- const loginApiUrl = apiUrlFrom({
1114
- apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1115
- });
1137
+ const loginApiUrl = apiUrlFrom(
1138
+ {
1139
+ apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1140
+ },
1141
+ process.env,
1142
+ mcpUrl
1143
+ );
1116
1144
  if (parsed.values.device === true) {
1117
1145
  const result2 = await loginWithDevice({
1118
1146
  mcpUrl,
@@ -1145,9 +1173,13 @@ async function dispatch(parsed, write, writeErr) {
1145
1173
  return 0;
1146
1174
  }
1147
1175
  case "logout": {
1148
- const apiUrl = apiUrlFrom({
1149
- apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1150
- });
1176
+ const apiUrl = apiUrlFrom(
1177
+ {
1178
+ apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1179
+ },
1180
+ process.env,
1181
+ mcpUrl
1182
+ );
1151
1183
  const oauth = deleteCredentials(
1152
1184
  mcpUrl,
1153
1185
  void 0,
@@ -1180,8 +1212,8 @@ async function dispatch(parsed, write, writeErr) {
1180
1212
  formatOrgListHuman,
1181
1213
  formatOrgListJson,
1182
1214
  useOrg
1183
- } = await import("./org-SGFIXD42.js");
1184
- const { listStoredOrgs: listStoredOrgs2 } = await import("./store-ZPBJTYRI.js");
1215
+ } = await import("./org-NWSSC7L7.js");
1216
+ const { listStoredOrgs: listStoredOrgs2 } = await import("./store-4G2J5DRZ.js");
1185
1217
  const action = parsed.positionals[0];
1186
1218
  if (action === "list") {
1187
1219
  const orgs = listStoredOrgs2(mcpUrl);
@@ -1206,9 +1238,13 @@ async function dispatch(parsed, write, writeErr) {
1206
1238
  throw new Error("Usage: kody org list [--json] | kody org use [<slug>]");
1207
1239
  }
1208
1240
  case "status": {
1209
- const apiUrl = apiUrlFrom({
1210
- apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1211
- });
1241
+ const apiUrl = apiUrlFrom(
1242
+ {
1243
+ apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1244
+ },
1245
+ process.env,
1246
+ mcpUrl
1247
+ );
1212
1248
  const credentials = loadCredentials(mcpUrl);
1213
1249
  const orgs = listStoredOrgs(mcpUrl);
1214
1250
  const storedApi = loadStoredApiToken(apiUrl);
@@ -1237,7 +1273,7 @@ async function dispatch(parsed, write, writeErr) {
1237
1273
  `api: ${storedApi.apiUrl}`,
1238
1274
  `stored API token: yes (${storedApi.tokenId})`,
1239
1275
  `API token scopes: ${scopes}`,
1240
- `API token expires: ${storedApi.expiresAt ?? "unknown"}`,
1276
+ `API token expires: ${storedApi.expiresAt ?? "unknown"} (saved at mint; idle tokens slide on use, \`kody whoami\` shows the live deadline)`,
1241
1277
  `API token via: ${storedApi.createdVia ?? "unknown"}`
1242
1278
  );
1243
1279
  } else {
@@ -1343,7 +1379,7 @@ async function dispatch(parsed, write, writeErr) {
1343
1379
  parseGitCredentialAction,
1344
1380
  parseGitCredentialInput,
1345
1381
  readGitCredentialStdin
1346
- } = await import("./git-credential-BT363OJQ.js");
1382
+ } = await import("./git-credential-QEMS2OZF.js");
1347
1383
  const action = parseGitCredentialAction(parsed.positionals);
1348
1384
  const raw = await readGitCredentialStdin(process.stdin);
1349
1385
  const output = await handleGitCredential({
@@ -1358,7 +1394,7 @@ async function dispatch(parsed, write, writeErr) {
1358
1394
  return 0;
1359
1395
  }
1360
1396
  case "whoami": {
1361
- const { resolveTarget } = await import("./target-UQBEV64U.js");
1397
+ const { resolveTarget } = await import("./target-LQ247AM3.js");
1362
1398
  const target = resolveTarget({
1363
1399
  command: "whoami",
1364
1400
  flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
@@ -1368,7 +1404,7 @@ async function dispatch(parsed, write, writeErr) {
1368
1404
  apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1369
1405
  });
1370
1406
  if (target === "mock") {
1371
- const { ensureMockTarget } = await import("./mock-server-2FMSQMBT.js");
1407
+ const { ensureMockTarget } = await import("./mock-server-WOSXMC2L.js");
1372
1408
  const mock = await ensureMockTarget({
1373
1409
  resetStorage: parsed.values["reset-storage"] === true,
1374
1410
  ...org ? { orgSlug: org } : {}
@@ -1403,7 +1439,7 @@ async function dispatch(parsed, write, writeErr) {
1403
1439
  if (mock.started) await mock.server.close();
1404
1440
  }
1405
1441
  }
1406
- const { runWhoami } = await import("./whoami-SGE7VKGY.js");
1442
+ const { runWhoami } = await import("./whoami-JGNVG2UX.js");
1407
1443
  return await runWhoami({
1408
1444
  tokenValues,
1409
1445
  mcpUrl,
@@ -1414,7 +1450,7 @@ async function dispatch(parsed, write, writeErr) {
1414
1450
  });
1415
1451
  }
1416
1452
  case "search": {
1417
- const { resolveTarget } = await import("./target-UQBEV64U.js");
1453
+ const { resolveTarget } = await import("./target-LQ247AM3.js");
1418
1454
  const target = resolveTarget({
1419
1455
  command: "search",
1420
1456
  flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
@@ -1427,13 +1463,13 @@ async function dispatch(parsed, write, writeErr) {
1427
1463
  let closeMock;
1428
1464
  try {
1429
1465
  if (target === "mock") {
1430
- const { ensureMockTarget } = await import("./mock-server-2FMSQMBT.js");
1466
+ const { ensureMockTarget } = await import("./mock-server-WOSXMC2L.js");
1431
1467
  const mock = await ensureMockTarget({
1432
1468
  resetStorage: parsed.values["reset-storage"] === true
1433
1469
  });
1434
1470
  apiUrl = mock.apiUrl;
1435
1471
  closeMock = mock.started ? () => mock.server.close() : void 0;
1436
- const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-DJL2PE7P.js");
1472
+ const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-A26G263D.js");
1437
1473
  const result2 = await searchWithApiToken2({
1438
1474
  token: mock.token,
1439
1475
  apiUrl,
@@ -1453,7 +1489,7 @@ async function dispatch(parsed, write, writeErr) {
1453
1489
  ...org ? { org } : {}
1454
1490
  });
1455
1491
  if (searchCredential?.token) {
1456
- const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-DJL2PE7P.js");
1492
+ const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-A26G263D.js");
1457
1493
  const result2 = await searchWithApiToken2({
1458
1494
  token: searchCredential.token,
1459
1495
  apiUrl,
@@ -1466,14 +1502,14 @@ async function dispatch(parsed, write, writeErr) {
1466
1502
  write(formatToolResult(result2, json));
1467
1503
  return result2.isError ? 1 : 0;
1468
1504
  }
1469
- const { ensureOpenApiCredentials } = await import("./auth-W5RWT6IP.js");
1505
+ const { ensureOpenApiCredentials } = await import("./auth-EEGVQLUH.js");
1470
1506
  const credentials = await ensureOpenApiCredentials({
1471
1507
  mcpUrl,
1472
1508
  org,
1473
1509
  apiUrl
1474
1510
  });
1475
1511
  noteActiveLoginCredential({ login: credentials, purpose: "session" });
1476
- const { searchWithApiToken } = await import("./open-api-client-DJL2PE7P.js");
1512
+ const { searchWithApiToken } = await import("./open-api-client-A26G263D.js");
1477
1513
  const result = await searchWithApiToken({
1478
1514
  token: credentials.accessToken,
1479
1515
  apiUrl,
@@ -1490,7 +1526,7 @@ async function dispatch(parsed, write, writeErr) {
1490
1526
  }
1491
1527
  }
1492
1528
  case "execute": {
1493
- const { resolveTarget } = await import("./target-UQBEV64U.js");
1529
+ const { resolveTarget } = await import("./target-LQ247AM3.js");
1494
1530
  const target = resolveTarget({
1495
1531
  command: "execute",
1496
1532
  flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
@@ -1523,7 +1559,8 @@ async function dispatch(parsed, write, writeErr) {
1523
1559
  );
1524
1560
  }
1525
1561
  if (local) assertLocalExecuteNodeEngine();
1526
- const fileArg = hasFileFlag ? parsed.values.file : void 0;
1562
+ const positionalFile = !hasCodeFlag && !hasFileFlag && invoke === void 0 ? positionalModuleFile(positionalModule) : void 0;
1563
+ const fileArg = hasFileFlag ? parsed.values.file : positionalFile;
1527
1564
  const modulePath = localPackageInvoke?.modulePath ?? (!hasCodeFlag && fileArg !== void 0 && fileArg !== "-" ? fileArg : void 0);
1528
1565
  const code = publishedInvokeCode !== void 0 ? publishedInvokeCode : invoke !== void 0 && !localPackageInvoke ? void 0 : hasCodeFlag ? parsed.values.code : modulePath !== void 0 && !localPackageInvoke ? await readFile(modulePath, "utf8") : localPackageInvoke ? await readFile(localPackageInvoke.modulePath, "utf8") : fileArg === "-" ? await readStdin() : positionalModule || void 0;
1529
1566
  const credentials = parseCredentialFlags(
@@ -1531,7 +1568,7 @@ async function dispatch(parsed, write, writeErr) {
1531
1568
  (value) => typeof value === "string"
1532
1569
  ) : typeof parsed.values.credential === "string" ? [parsed.values.credential] : void 0
1533
1570
  );
1534
- const executeRouting = (await import("./remote-execute-KUSUI6UT.js")).executeRoutingFromFlags(parsed.values);
1571
+ const executeRouting = (await import("./remote-execute-PDSZBGQ7.js")).executeRoutingFromFlags(parsed.values);
1535
1572
  if (executeRouting && local) {
1536
1573
  writeErr(
1537
1574
  "--context, --fallback, --requires, and --chain route cloud execute; drop --local.\n"
@@ -1550,7 +1587,7 @@ async function dispatch(parsed, write, writeErr) {
1550
1587
  apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
1551
1588
  });
1552
1589
  let apiUrl = prodApiUrl;
1553
- const { parsePassthroughHosts } = await import("./mock-fetch-gateway-QNUFNYAH.js");
1590
+ const { parsePassthroughHosts } = await import("./mock-fetch-gateway-5K7STXZQ.js");
1554
1591
  const passthroughHosts = parsePassthroughHosts(
1555
1592
  typeof parsed.values.passthrough === "string" ? parsed.values.passthrough : void 0
1556
1593
  );
@@ -1565,7 +1602,7 @@ async function dispatch(parsed, write, writeErr) {
1565
1602
  let localPackageRun = localPackageInvoke;
1566
1603
  if (!localPackageRun && local && modulePath !== void 0) {
1567
1604
  try {
1568
- const { loadPackageManifest } = await import("./package-manifest-KCLPIMOZ.js");
1605
+ const { loadPackageManifest } = await import("./package-manifest-OFJ5PRA2.js");
1569
1606
  const manifest = await loadPackageManifest(process.cwd());
1570
1607
  localPackageRun = {
1571
1608
  modulePath,
@@ -1578,7 +1615,7 @@ async function dispatch(parsed, write, writeErr) {
1578
1615
  }
1579
1616
  try {
1580
1617
  if (target === "mock") {
1581
- const { ensureMockTarget } = await import("./mock-server-2FMSQMBT.js");
1618
+ const { ensureMockTarget } = await import("./mock-server-WOSXMC2L.js");
1582
1619
  const mock = await ensureMockTarget({
1583
1620
  resetStorage: parsed.values["reset-storage"] === true,
1584
1621
  packageId: localPackageRun ? `local:${localPackageRun.kodyId}` : void 0,
@@ -1587,7 +1624,7 @@ async function dispatch(parsed, write, writeErr) {
1587
1624
  apiUrl = mock.apiUrl;
1588
1625
  mockToken = mock.token;
1589
1626
  closeMock = mock.started ? () => mock.server.close() : void 0;
1590
- const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-G7TA4CJB.js");
1627
+ const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-4WSWOQHT.js");
1591
1628
  mockDepResolve = await tryResolveMockDepResolve({
1592
1629
  tokenValues,
1593
1630
  apiUrl: prodApiUrl,
@@ -1596,7 +1633,7 @@ async function dispatch(parsed, write, writeErr) {
1596
1633
  });
1597
1634
  }
1598
1635
  if (localPackageRun) {
1599
- const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-RRELUZEM.js");
1636
+ const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-SJIAEVMD.js");
1600
1637
  const result2 = await runLocalPackageModule({
1601
1638
  modulePath: localPackageRun.modulePath,
1602
1639
  params: args.params,
@@ -1635,13 +1672,13 @@ async function dispatch(parsed, write, writeErr) {
1635
1672
  let packageRootForMocks;
1636
1673
  if (target === "mock") {
1637
1674
  try {
1638
- const { loadPackageManifest } = await import("./package-manifest-KCLPIMOZ.js");
1675
+ const { loadPackageManifest } = await import("./package-manifest-OFJ5PRA2.js");
1639
1676
  packageRootForMocks = (await loadPackageManifest(process.cwd())).root;
1640
1677
  } catch {
1641
1678
  packageRootForMocks = void 0;
1642
1679
  }
1643
1680
  }
1644
- const result = local ? await (await import("./local-execute-BI5253MQ.js")).runLocalExecute({
1681
+ const result = local ? await (await import("./local-execute-3I5YDMM5.js")).runLocalExecute({
1645
1682
  code: args.code,
1646
1683
  ...modulePath !== void 0 ? { modulePath } : {},
1647
1684
  params: args.params,
@@ -1663,7 +1700,7 @@ async function dispatch(parsed, write, writeErr) {
1663
1700
  allowPrivateNetwork: parsed.values["allow-private-network"] === true,
1664
1701
  onStatus: (message) => writeErr(`${message}
1665
1702
  `)
1666
- }) : cloudToken ? await (await import("./remote-execute-KUSUI6UT.js")).runRemoteExecuteWithToken({
1703
+ }) : cloudToken ? await (await import("./remote-execute-PDSZBGQ7.js")).runRemoteExecuteWithToken({
1667
1704
  code: typeof args.code === "string" ? args.code : void 0,
1668
1705
  params: args.params,
1669
1706
  conversationId: args.conversationId,
@@ -1673,7 +1710,7 @@ async function dispatch(parsed, write, writeErr) {
1673
1710
  apiUrl,
1674
1711
  ...org ? { org } : {}
1675
1712
  }) : await (async () => {
1676
- const { ensureOpenApiCredentials } = await import("./auth-W5RWT6IP.js");
1713
+ const { ensureOpenApiCredentials } = await import("./auth-EEGVQLUH.js");
1677
1714
  const session = await ensureOpenApiCredentials({
1678
1715
  mcpUrl,
1679
1716
  org,
@@ -1683,7 +1720,7 @@ async function dispatch(parsed, write, writeErr) {
1683
1720
  login: session,
1684
1721
  purpose: "session"
1685
1722
  });
1686
- return (await import("./remote-execute-KUSUI6UT.js")).runRemoteExecuteWithToken({
1723
+ return (await import("./remote-execute-PDSZBGQ7.js")).runRemoteExecuteWithToken({
1687
1724
  code: typeof args.code === "string" ? args.code : void 0,
1688
1725
  params: args.params,
1689
1726
  conversationId: args.conversationId,
@@ -1698,7 +1735,7 @@ async function dispatch(parsed, write, writeErr) {
1698
1735
  return result.isError ? 1 : 0;
1699
1736
  } catch (error) {
1700
1737
  if (json && local) {
1701
- const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-WFDNSNOJ.js");
1738
+ const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-PMZQD7WF.js");
1702
1739
  if (error instanceof LocalPackageGraphError) {
1703
1740
  const redacted = redactError(error).message;
1704
1741
  const result = packageGraphErrorToolResult(error);
@@ -1716,7 +1753,7 @@ async function dispatch(parsed, write, writeErr) {
1716
1753
  }
1717
1754
  }
1718
1755
  case "dev": {
1719
- const { resolveTarget } = await import("./target-UQBEV64U.js");
1756
+ const { resolveTarget } = await import("./target-LQ247AM3.js");
1720
1757
  const {
1721
1758
  parseDevPort,
1722
1759
  parseDevSubcommand,
@@ -1728,7 +1765,7 @@ async function dispatch(parsed, write, writeErr) {
1728
1765
  runDevServe,
1729
1766
  runDevWebhook,
1730
1767
  tryAttachedDevFetch
1731
- } = await import("./dev-command-XIQY56LW.js");
1768
+ } = await import("./dev-command-TDLNJ7ZA.js");
1732
1769
  const target = resolveTarget({
1733
1770
  command: "dev",
1734
1771
  flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
@@ -1754,8 +1791,8 @@ async function dispatch(parsed, write, writeErr) {
1754
1791
  { callOpenApiOperation, formatOpenApiHttpDebugLine },
1755
1792
  { parsePackageCheckResult, PublishChecksAuthError }
1756
1793
  ] = await Promise.all([
1757
- import("./open-api-client-DJL2PE7P.js"),
1758
- import("./dev-command-XIQY56LW.js")
1794
+ import("./open-api-client-A26G263D.js"),
1795
+ import("./dev-command-TDLNJ7ZA.js")
1759
1796
  ]);
1760
1797
  let token2;
1761
1798
  try {
@@ -1869,13 +1906,13 @@ async function dispatch(parsed, write, writeErr) {
1869
1906
  purpose: "kody dev",
1870
1907
  ...org ? { org } : {}
1871
1908
  }) : "mock";
1872
- const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-G7TA4CJB.js")).tryResolveMockDepResolve({
1909
+ const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-4WSWOQHT.js")).tryResolveMockDepResolve({
1873
1910
  tokenValues,
1874
1911
  apiUrl: prodApiUrl,
1875
1912
  mcpUrl,
1876
1913
  ...org ? { org } : {}
1877
1914
  }) : void 0;
1878
- const { parsePassthroughHosts } = await import("./mock-fetch-gateway-QNUFNYAH.js");
1915
+ const { parsePassthroughHosts } = await import("./mock-fetch-gateway-5K7STXZQ.js");
1879
1916
  const passthroughHosts = parsePassthroughHosts(
1880
1917
  typeof parsed.values.passthrough === "string" ? parsed.values.passthrough : void 0
1881
1918
  );
@@ -1887,7 +1924,7 @@ async function dispatch(parsed, write, writeErr) {
1887
1924
  const allowPrivateNetwork = parsed.values["allow-private-network"] === true;
1888
1925
  let packageId;
1889
1926
  try {
1890
- const { loadPackageManifest } = await import("./package-manifest-KCLPIMOZ.js");
1927
+ const { loadPackageManifest } = await import("./package-manifest-OFJ5PRA2.js");
1891
1928
  const manifest = await loadPackageManifest(process.cwd());
1892
1929
  packageId = `local:${manifest.kodyId}`;
1893
1930
  } catch {
@@ -2010,7 +2047,7 @@ async function dispatch(parsed, write, writeErr) {
2010
2047
  const params = parseApiParamsJson(
2011
2048
  typeof parsed.values.params === "string" ? parsed.values.params : void 0
2012
2049
  );
2013
- const { callOpenApiOperation } = await import("./open-api-client-DJL2PE7P.js");
2050
+ const { callOpenApiOperation } = await import("./open-api-client-A26G263D.js");
2014
2051
  const result = await callOpenApiOperation({
2015
2052
  operationId,
2016
2053
  params,
@@ -2045,7 +2082,7 @@ async function dispatch(parsed, write, writeErr) {
2045
2082
  mcpUrl,
2046
2083
  org
2047
2084
  });
2048
- const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-DJL2PE7P.js");
2085
+ const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-A26G263D.js");
2049
2086
  write(
2050
2087
  await runPackageCollaboratorPlan({
2051
2088
  plan,
@@ -2071,7 +2108,7 @@ ${packageCollaboratorUsage}`
2071
2108
  positional: parsed.positionals[1],
2072
2109
  paramsJson: typeof parsed.values.params === "string" ? parsed.values.params : void 0
2073
2110
  });
2074
- const { callOpenApiOperation } = await import("./open-api-client-DJL2PE7P.js");
2111
+ const { callOpenApiOperation } = await import("./open-api-client-A26G263D.js");
2075
2112
  const publishToken = await accessTokenForOpenApi({
2076
2113
  tokenValues,
2077
2114
  apiUrl,
@@ -2104,7 +2141,7 @@ ${packageCollaboratorUsage}`
2104
2141
  return code;
2105
2142
  }
2106
2143
  case "install": {
2107
- const { runInstall } = await import("./install-NTS5BOCR.js");
2144
+ const { runInstall } = await import("./install-MPB5WEG4.js");
2108
2145
  const result = await runInstall(
2109
2146
  {
2110
2147
  mcpUrl,
@@ -2122,7 +2159,7 @@ ${packageCollaboratorUsage}`
2122
2159
  if (action !== "install") {
2123
2160
  throw new Error("Usage: kody skill install [--project]");
2124
2161
  }
2125
- const { installSkill } = await import("./skill-IY263IXV.js");
2162
+ const { installSkill } = await import("./skill-QM3N6H55.js");
2126
2163
  const targets = await installSkill({
2127
2164
  project: parsed.values.project === true
2128
2165
  });
@@ -2150,8 +2187,8 @@ async function tryResolveLocalPackageInvoke(invoke) {
2150
2187
  const trimmed = invoke.trim();
2151
2188
  if (!trimmed) return null;
2152
2189
  if (isPublishedPackageInvokeSpecifier(trimmed)) return null;
2153
- const { loadPackageManifest, resolveExportModulePath } = await import("./package-manifest-KCLPIMOZ.js");
2154
- const { StructuredCliError } = await import("./structured-error-QYNRZZKC.js");
2190
+ const { loadPackageManifest, resolveExportModulePath } = await import("./package-manifest-OFJ5PRA2.js");
2191
+ const { StructuredCliError } = await import("./structured-error-D2G3PBEZ.js");
2155
2192
  let manifest;
2156
2193
  try {
2157
2194
  manifest = await loadPackageManifest(process.cwd());
@@ -2182,6 +2219,23 @@ async function tryResolveLocalPackageInvoke(invoke) {
2182
2219
  function executeSourcesConflict(input) {
2183
2220
  return input.invoke !== void 0 && (input.hasCodeFlag || input.hasFileFlag || input.positionalModule.length > 0);
2184
2221
  }
2222
+ var moduleFileExtension = /\.(?:[cm]?[jt]sx?)$/i;
2223
+ function positionalModuleFile(positionalModule, exists = (path) => {
2224
+ try {
2225
+ return statSync(path).isFile();
2226
+ } catch {
2227
+ return false;
2228
+ }
2229
+ }) {
2230
+ if (!positionalModule || /\s/.test(positionalModule)) return void 0;
2231
+ if (exists(positionalModule)) return positionalModule;
2232
+ if (moduleFileExtension.test(positionalModule)) {
2233
+ throw new Error(
2234
+ `No module file at ${JSON.stringify(positionalModule)}. Pass an existing path (or --file <path>), or the module source with --code.`
2235
+ );
2236
+ }
2237
+ return void 0;
2238
+ }
2185
2239
  function buildExecuteToolArgs(input) {
2186
2240
  const invoke = input.invoke;
2187
2241
  const code = input.code;
@@ -2217,7 +2271,7 @@ function attachExecuteCommonArgs(args, input) {
2217
2271
  return args;
2218
2272
  }
2219
2273
  async function runAuthSetupGit(input) {
2220
- const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-KBH7GA6E.js");
2274
+ const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-7PQUU6JB.js");
2221
2275
  const apiUrl = apiUrlFrom({
2222
2276
  apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
2223
2277
  });
@@ -2274,7 +2328,7 @@ async function runAuthSetupGit(input) {
2274
2328
  return 0;
2275
2329
  }
2276
2330
  async function runAuthRemoveGit(input) {
2277
- const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-KBH7GA6E.js");
2331
+ const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-7PQUU6JB.js");
2278
2332
  const apiUrl = apiUrlFrom({
2279
2333
  apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
2280
2334
  });
@@ -2296,7 +2350,7 @@ function bootstrapMinter(input) {
2296
2350
  });
2297
2351
  if (minter?.token) {
2298
2352
  const token = minter.token;
2299
- const { callOpenApiOperation } = await import("./open-api-client-DJL2PE7P.js");
2353
+ const { callOpenApiOperation } = await import("./open-api-client-A26G263D.js");
2300
2354
  try {
2301
2355
  return await callOpenApiOperation({
2302
2356
  token,
@@ -2315,13 +2369,13 @@ function bootstrapMinter(input) {
2315
2369
  }
2316
2370
  }
2317
2371
  if (minter) {
2318
- const { ensureOpenApiCredentials } = await import("./auth-W5RWT6IP.js");
2372
+ const { ensureOpenApiCredentials } = await import("./auth-EEGVQLUH.js");
2319
2373
  const session = await ensureOpenApiCredentials({
2320
2374
  mcpUrl: input.mcpUrl,
2321
2375
  apiUrl: input.apiUrl,
2322
2376
  ...input.org ? { org: input.org } : {}
2323
2377
  });
2324
- const { callOpenApiOperation } = await import("./open-api-client-DJL2PE7P.js");
2378
+ const { callOpenApiOperation } = await import("./open-api-client-A26G263D.js");
2325
2379
  return callOpenApiOperation({
2326
2380
  operationId: cliCredentialBootstrapOperationId,
2327
2381
  params,
@@ -2348,7 +2402,7 @@ async function accessTokenForOpenApi(input) {
2348
2402
  ...input.org ? { org: input.org } : {}
2349
2403
  });
2350
2404
  if (credential?.token) return credential.token;
2351
- const { ensureOpenApiCredentials } = await import("./auth-W5RWT6IP.js");
2405
+ const { ensureOpenApiCredentials } = await import("./auth-EEGVQLUH.js");
2352
2406
  const session = await ensureOpenApiCredentials({
2353
2407
  mcpUrl: input.mcpUrl,
2354
2408
  apiUrl: input.apiUrl,
@@ -2428,10 +2482,11 @@ export {
2428
2482
  argvIncludesJsonFlag,
2429
2483
  formatCliErrorJson,
2430
2484
  executeSourcesConflict,
2485
+ positionalModuleFile,
2431
2486
  buildExecuteToolArgs,
2432
2487
  parseApiParamsJson,
2433
2488
  packagePublishParams,
2434
2489
  resolvePackagePublishTarget,
2435
2490
  storedApiTokenAfterLoginNotice
2436
2491
  };
2437
- //# sourceMappingURL=chunk-F3XGCTRQ.js.map
2492
+ //# sourceMappingURL=chunk-IIGF3ZWU.js.map