@kodycodes/cli 3.31.5 → 3.32.0

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 (78) hide show
  1. package/README.md +8 -5
  2. package/dist/{auth-PVW2LO2U.js → auth-ESYKAKVY.js} +8 -8
  3. package/dist/bin.js +11 -11
  4. package/dist/{chunk-CQHQFF7B.js → chunk-6L5CRBRF.js} +3 -3
  5. package/dist/{chunk-HPRHOM5U.js → chunk-7F567S2U.js} +4 -4
  6. package/dist/{chunk-6KT2QEN3.js → chunk-BDEUMLZN.js} +2 -2
  7. package/dist/{chunk-327OT6ZP.js → chunk-BNXCIPN6.js} +3 -3
  8. package/dist/{chunk-H7CJBJFA.js → chunk-EATQUG3Q.js} +2 -2
  9. package/dist/{chunk-RE7LNPRO.js → chunk-EKO5KFC7.js} +79 -6
  10. package/dist/chunk-EKO5KFC7.js.map +6 -0
  11. package/dist/{chunk-6UTLL4CZ.js → chunk-FOETPC2A.js} +4 -4
  12. package/dist/{chunk-MW3RLRTO.js → chunk-KM5WHDLE.js} +3 -3
  13. package/dist/{chunk-Z2NJN47S.js → chunk-MBNCASRZ.js} +6 -10
  14. package/dist/chunk-MBNCASRZ.js.map +6 -0
  15. package/dist/{chunk-SS2SUBIJ.js → chunk-MVIEFYS4.js} +4 -4
  16. package/dist/{chunk-GMD3RXXS.js → chunk-NZEAQRCG.js} +14 -6
  17. package/dist/chunk-NZEAQRCG.js.map +6 -0
  18. package/dist/{chunk-YFNQZPEP.js → chunk-OLE7Z5JD.js} +5 -11
  19. package/dist/chunk-OLE7Z5JD.js.map +6 -0
  20. package/dist/{chunk-PQRALHYL.js → chunk-R7WIPNQ3.js} +63 -49
  21. package/dist/{chunk-PQRALHYL.js.map → chunk-R7WIPNQ3.js.map} +1 -1
  22. package/dist/{chunk-ATZXCAZA.js → chunk-ROCSDHPI.js} +2 -2
  23. package/dist/{chunk-SQKXY43O.js → chunk-SIZO3QHW.js} +6 -6
  24. package/dist/{chunk-VVXXLY65.js → chunk-SWWEXETT.js} +3 -3
  25. package/dist/cli.d.ts +12 -3
  26. package/dist/cli.js +13 -13
  27. package/dist/{commands-I5EWVOJC.js → commands-6Z23Z6BO.js} +6 -6
  28. package/dist/credential-client-runtime-source.d.ts +1 -1
  29. package/dist/{dev-command-TU2ZPP24.js → dev-command-IR63C7WI.js} +11 -11
  30. package/dist/{git-credential-FNVWEKWB.js → git-credential-HX44LBWX.js} +9 -9
  31. package/dist/keyring-entry.d.ts +43 -0
  32. package/dist/{local-execute-UTLV5UDA.js → local-execute-VIE4D4YN.js} +9 -9
  33. package/dist/{local-package-graph-F3AJFSSG.js → local-package-graph-EMGCMMA5.js} +7 -7
  34. package/dist/{local-package-run-WMGUVB3U.js → local-package-run-B2LLMGNP.js} +11 -11
  35. package/dist/{local-secrets-KZUJ2LE2.js → local-secrets-LNFSPB3M.js} +7 -7
  36. package/dist/{mock-dep-resolve-IGS3ZKEO.js → mock-dep-resolve-UELE626X.js} +6 -6
  37. package/dist/{mock-local-deps-HT5NG52P.js → mock-local-deps-X2FQXVFZ.js} +8 -8
  38. package/dist/{open-api-client-NRPF5SUW.js → open-api-client-GULJJEIG.js} +7 -7
  39. package/dist/{org-NWSSC7L7.js → org-GLCQE22A.js} +2 -2
  40. package/dist/{remote-execute-MQLJCXD7.js → remote-execute-JGISJLJU.js} +7 -7
  41. package/dist/{run-executor-N5CDFAOB.js → run-executor-7DAAYUI6.js} +2 -2
  42. package/dist/{setup-git-6NZQISC4.js → setup-git-RV7LNKRJ.js} +8 -8
  43. package/dist/{store-4G2J5DRZ.js → store-APLV3NIH.js} +2 -2
  44. package/dist/store.d.ts +1 -7
  45. package/dist/{whoami-D2WGWIBE.js → whoami-CRGPYLWQ.js} +6 -6
  46. package/package.json +1 -1
  47. package/dist/chunk-GMD3RXXS.js.map +0 -6
  48. package/dist/chunk-RE7LNPRO.js.map +0 -6
  49. package/dist/chunk-YFNQZPEP.js.map +0 -6
  50. package/dist/chunk-Z2NJN47S.js.map +0 -6
  51. /package/dist/{auth-PVW2LO2U.js.map → auth-ESYKAKVY.js.map} +0 -0
  52. /package/dist/{chunk-CQHQFF7B.js.map → chunk-6L5CRBRF.js.map} +0 -0
  53. /package/dist/{chunk-HPRHOM5U.js.map → chunk-7F567S2U.js.map} +0 -0
  54. /package/dist/{chunk-6KT2QEN3.js.map → chunk-BDEUMLZN.js.map} +0 -0
  55. /package/dist/{chunk-327OT6ZP.js.map → chunk-BNXCIPN6.js.map} +0 -0
  56. /package/dist/{chunk-H7CJBJFA.js.map → chunk-EATQUG3Q.js.map} +0 -0
  57. /package/dist/{chunk-6UTLL4CZ.js.map → chunk-FOETPC2A.js.map} +0 -0
  58. /package/dist/{chunk-MW3RLRTO.js.map → chunk-KM5WHDLE.js.map} +0 -0
  59. /package/dist/{chunk-SS2SUBIJ.js.map → chunk-MVIEFYS4.js.map} +0 -0
  60. /package/dist/{chunk-ATZXCAZA.js.map → chunk-ROCSDHPI.js.map} +0 -0
  61. /package/dist/{chunk-SQKXY43O.js.map → chunk-SIZO3QHW.js.map} +0 -0
  62. /package/dist/{chunk-VVXXLY65.js.map → chunk-SWWEXETT.js.map} +0 -0
  63. /package/dist/{commands-I5EWVOJC.js.map → commands-6Z23Z6BO.js.map} +0 -0
  64. /package/dist/{dev-command-TU2ZPP24.js.map → dev-command-IR63C7WI.js.map} +0 -0
  65. /package/dist/{git-credential-FNVWEKWB.js.map → git-credential-HX44LBWX.js.map} +0 -0
  66. /package/dist/{local-execute-UTLV5UDA.js.map → local-execute-VIE4D4YN.js.map} +0 -0
  67. /package/dist/{local-package-graph-F3AJFSSG.js.map → local-package-graph-EMGCMMA5.js.map} +0 -0
  68. /package/dist/{local-package-run-WMGUVB3U.js.map → local-package-run-B2LLMGNP.js.map} +0 -0
  69. /package/dist/{local-secrets-KZUJ2LE2.js.map → local-secrets-LNFSPB3M.js.map} +0 -0
  70. /package/dist/{mock-dep-resolve-IGS3ZKEO.js.map → mock-dep-resolve-UELE626X.js.map} +0 -0
  71. /package/dist/{mock-local-deps-HT5NG52P.js.map → mock-local-deps-X2FQXVFZ.js.map} +0 -0
  72. /package/dist/{open-api-client-NRPF5SUW.js.map → open-api-client-GULJJEIG.js.map} +0 -0
  73. /package/dist/{org-NWSSC7L7.js.map → org-GLCQE22A.js.map} +0 -0
  74. /package/dist/{remote-execute-MQLJCXD7.js.map → remote-execute-JGISJLJU.js.map} +0 -0
  75. /package/dist/{run-executor-N5CDFAOB.js.map → run-executor-7DAAYUI6.js.map} +0 -0
  76. /package/dist/{setup-git-6NZQISC4.js.map → setup-git-RV7LNKRJ.js.map} +0 -0
  77. /package/dist/{store-4G2J5DRZ.js.map → store-APLV3NIH.js.map} +0 -0
  78. /package/dist/{whoami-D2WGWIBE.js.map → whoami-CRGPYLWQ.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-E4R3Y6MM.js";
6
6
  import {
7
7
  resolveLocalExecuteBearer
8
- } from "./chunk-6UTLL4CZ.js";
8
+ } from "./chunk-FOETPC2A.js";
9
9
  import {
10
10
  formatToolResult
11
11
  } from "./chunk-46IJPEID.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-MIT3TUWB.js";
24
24
  import {
25
25
  isRemoteDaemonCommand
26
- } from "./chunk-Z2NJN47S.js";
26
+ } from "./chunk-MBNCASRZ.js";
27
27
  import {
28
28
  authBootstrap,
29
29
  authBootstrapWithScopes,
@@ -33,7 +33,7 @@ import {
33
33
  parseCliScopesFlag,
34
34
  refreshGitCredentialHelperPinIfNeeded,
35
35
  resolveCliTokenLifetime
36
- } from "./chunk-HPRHOM5U.js";
36
+ } from "./chunk-7F567S2U.js";
37
37
  import {
38
38
  orgEnvVar,
39
39
  orgSlugFromFlag
@@ -44,28 +44,28 @@ import {
44
44
  import {
45
45
  parseCredentialFlags,
46
46
  readPackageVersion
47
- } from "./chunk-H7CJBJFA.js";
47
+ } from "./chunk-EATQUG3Q.js";
48
48
  import {
49
49
  cliBootstrapMintCall,
50
50
  expectedPairedApiOrigin
51
- } from "./chunk-CQHQFF7B.js";
51
+ } from "./chunk-6L5CRBRF.js";
52
52
  import {
53
53
  describeCliCredential,
54
54
  noteActiveLoginCredential,
55
55
  replaceStoredTokenCommand,
56
56
  resetActiveCliCredential,
57
57
  resolveCliCredential
58
- } from "./chunk-MW3RLRTO.js";
58
+ } from "./chunk-KM5WHDLE.js";
59
59
  import {
60
60
  deleteStoredApiToken,
61
61
  loadStoredApiToken
62
- } from "./chunk-YFNQZPEP.js";
62
+ } from "./chunk-OLE7Z5JD.js";
63
63
  import {
64
64
  deleteCredentials,
65
65
  listStoredOrgs,
66
66
  loadCredentialStore,
67
67
  loadCredentials
68
- } from "./chunk-RE7LNPRO.js";
68
+ } from "./chunk-EKO5KFC7.js";
69
69
  import {
70
70
  apiTokenEnvVar,
71
71
  defaultApiUrl,
@@ -2142,7 +2142,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2142
2142
  case "connect":
2143
2143
  case "update": {
2144
2144
  const apiUrl = earlyApiUrl;
2145
- const { runExecutionContextCommand } = await import("./commands-I5EWVOJC.js");
2145
+ const { runExecutionContextCommand } = await import("./commands-6Z23Z6BO.js");
2146
2146
  return await runExecutionContextCommand({
2147
2147
  command: parsed.command,
2148
2148
  positionals: parsed.positionals,
@@ -2176,7 +2176,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2176
2176
  });
2177
2177
  }
2178
2178
  case "login": {
2179
- const { login, loginWithDevice } = await import("./auth-PVW2LO2U.js");
2179
+ const { login, loginWithDevice } = await import("./auth-ESYKAKVY.js");
2180
2180
  const openBrowser = parsed.values["no-browser"] !== true;
2181
2181
  const lifetimeOption = typeof parsed.values.lifetime === "string" ? {
2182
2182
  lifetime: parsed.values.lifetime === "short" ? "short" : "long"
@@ -2197,7 +2197,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2197
2197
  onDeviceCode: (prompt) => write(formatDeviceLoginNotice(prompt))
2198
2198
  });
2199
2199
  write(formatLoginSuccess(result2));
2200
- write(storedApiTokenAfterLoginNotice(loginApiUrl));
2200
+ write(supersedeStoredApiTokenAfterLogin(loginApiUrl));
2201
2201
  return 0;
2202
2202
  }
2203
2203
  const headlessReason = openBrowser ? detectHeadlessLoginReason() : null;
@@ -2216,7 +2216,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2216
2216
  }
2217
2217
  });
2218
2218
  write(formatLoginSuccess(result));
2219
- write(storedApiTokenAfterLoginNotice(loginApiUrl));
2219
+ write(supersedeStoredApiTokenAfterLogin(loginApiUrl));
2220
2220
  return 0;
2221
2221
  }
2222
2222
  case "logout": {
@@ -2259,8 +2259,8 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2259
2259
  formatOrgListHuman,
2260
2260
  formatOrgListJson,
2261
2261
  useOrg
2262
- } = await import("./org-NWSSC7L7.js");
2263
- const { listStoredOrgs: listStoredOrgs2 } = await import("./store-4G2J5DRZ.js");
2262
+ } = await import("./org-GLCQE22A.js");
2263
+ const { listStoredOrgs: listStoredOrgs2 } = await import("./store-APLV3NIH.js");
2264
2264
  const action = parsed.positionals[0];
2265
2265
  if (action === "list") {
2266
2266
  const orgs = listStoredOrgs2(mcpUrl);
@@ -2426,7 +2426,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2426
2426
  parseGitCredentialAction,
2427
2427
  parseGitCredentialInput,
2428
2428
  readGitCredentialStdin
2429
- } = await import("./git-credential-FNVWEKWB.js");
2429
+ } = await import("./git-credential-HX44LBWX.js");
2430
2430
  const action = parseGitCredentialAction(parsed.positionals);
2431
2431
  const raw = await readGitCredentialStdin(process.stdin);
2432
2432
  const output = await handleGitCredential({
@@ -2486,7 +2486,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2486
2486
  if (mock.started) await mock.server.close();
2487
2487
  }
2488
2488
  }
2489
- const { runWhoami } = await import("./whoami-D2WGWIBE.js");
2489
+ const { runWhoami } = await import("./whoami-CRGPYLWQ.js");
2490
2490
  return await runWhoami({
2491
2491
  tokenValues,
2492
2492
  mcpUrl,
@@ -2516,7 +2516,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2516
2516
  });
2517
2517
  apiUrl = mock.apiUrl;
2518
2518
  closeMock = mock.started ? () => mock.server.close() : void 0;
2519
- const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-NRPF5SUW.js");
2519
+ const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-GULJJEIG.js");
2520
2520
  const result2 = await searchWithApiToken2({
2521
2521
  token: mock.token,
2522
2522
  apiUrl,
@@ -2536,7 +2536,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2536
2536
  ...org ? { org } : {}
2537
2537
  });
2538
2538
  if (searchCredential?.token) {
2539
- const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-NRPF5SUW.js");
2539
+ const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-GULJJEIG.js");
2540
2540
  const result2 = await searchWithApiToken2({
2541
2541
  token: searchCredential.token,
2542
2542
  apiUrl,
@@ -2549,14 +2549,14 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2549
2549
  write(formatToolResult(result2, json));
2550
2550
  return result2.isError ? 1 : 0;
2551
2551
  }
2552
- const { ensureOpenApiCredentials } = await import("./auth-PVW2LO2U.js");
2552
+ const { ensureOpenApiCredentials } = await import("./auth-ESYKAKVY.js");
2553
2553
  const credentials = await ensureOpenApiCredentials({
2554
2554
  mcpUrl,
2555
2555
  org,
2556
2556
  apiUrl
2557
2557
  });
2558
2558
  noteActiveLoginCredential({ login: credentials, purpose: "session" });
2559
- const { searchWithApiToken } = await import("./open-api-client-NRPF5SUW.js");
2559
+ const { searchWithApiToken } = await import("./open-api-client-GULJJEIG.js");
2560
2560
  const result = await searchWithApiToken({
2561
2561
  token: credentials.accessToken,
2562
2562
  apiUrl,
@@ -2615,7 +2615,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2615
2615
  (value) => typeof value === "string"
2616
2616
  ) : typeof parsed.values.credential === "string" ? [parsed.values.credential] : void 0
2617
2617
  );
2618
- const executeRouting = (await import("./remote-execute-MQLJCXD7.js")).executeRoutingFromFlags(parsed.values);
2618
+ const executeRouting = (await import("./remote-execute-JGISJLJU.js")).executeRoutingFromFlags(parsed.values);
2619
2619
  if (executeRouting && local) {
2620
2620
  writeErr(
2621
2621
  "--context, --fallback, --requires, and --chain route cloud execute; drop --local.\n"
@@ -2671,7 +2671,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2671
2671
  apiUrl = mock.apiUrl;
2672
2672
  mockToken = mock.token;
2673
2673
  closeMock = mock.started ? () => mock.server.close() : void 0;
2674
- const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-IGS3ZKEO.js");
2674
+ const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-UELE626X.js");
2675
2675
  mockDepResolve = await tryResolveMockDepResolve({
2676
2676
  tokenValues,
2677
2677
  apiUrl: prodApiUrl,
@@ -2680,7 +2680,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2680
2680
  });
2681
2681
  }
2682
2682
  if (localPackageRun) {
2683
- const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-WMGUVB3U.js");
2683
+ const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-B2LLMGNP.js");
2684
2684
  const result2 = await runLocalPackageModule({
2685
2685
  modulePath: localPackageRun.modulePath,
2686
2686
  params: args.params,
@@ -2725,7 +2725,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2725
2725
  packageRootForMocks = void 0;
2726
2726
  }
2727
2727
  }
2728
- const result = local ? await (await import("./local-execute-UTLV5UDA.js")).runLocalExecute({
2728
+ const result = local ? await (await import("./local-execute-VIE4D4YN.js")).runLocalExecute({
2729
2729
  code: args.code,
2730
2730
  ...modulePath !== void 0 ? { modulePath } : {},
2731
2731
  params: args.params,
@@ -2747,7 +2747,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2747
2747
  allowPrivateNetwork: parsed.values["allow-private-network"] === true,
2748
2748
  onStatus: (message) => writeErr(`${message}
2749
2749
  `)
2750
- }) : cloudToken ? await (await import("./remote-execute-MQLJCXD7.js")).runRemoteExecuteWithToken({
2750
+ }) : cloudToken ? await (await import("./remote-execute-JGISJLJU.js")).runRemoteExecuteWithToken({
2751
2751
  code: typeof args.code === "string" ? args.code : void 0,
2752
2752
  params: args.params,
2753
2753
  conversationId: args.conversationId,
@@ -2757,7 +2757,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2757
2757
  apiUrl,
2758
2758
  ...org ? { org } : {}
2759
2759
  }) : await (async () => {
2760
- const { ensureOpenApiCredentials } = await import("./auth-PVW2LO2U.js");
2760
+ const { ensureOpenApiCredentials } = await import("./auth-ESYKAKVY.js");
2761
2761
  const session = await ensureOpenApiCredentials({
2762
2762
  mcpUrl,
2763
2763
  org,
@@ -2767,7 +2767,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2767
2767
  login: session,
2768
2768
  purpose: "session"
2769
2769
  });
2770
- return (await import("./remote-execute-MQLJCXD7.js")).runRemoteExecuteWithToken({
2770
+ return (await import("./remote-execute-JGISJLJU.js")).runRemoteExecuteWithToken({
2771
2771
  code: typeof args.code === "string" ? args.code : void 0,
2772
2772
  params: args.params,
2773
2773
  conversationId: args.conversationId,
@@ -2782,7 +2782,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2782
2782
  return result.isError ? 1 : 0;
2783
2783
  } catch (error) {
2784
2784
  if (json && local) {
2785
- const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-F3AJFSSG.js");
2785
+ const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-EMGCMMA5.js");
2786
2786
  if (error instanceof LocalPackageGraphError) {
2787
2787
  const redacted = redactError(error).message;
2788
2788
  const result = packageGraphErrorToolResult(error);
@@ -2812,7 +2812,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2812
2812
  runDevServe,
2813
2813
  runDevWebhook,
2814
2814
  tryAttachedDevFetch
2815
- } = await import("./dev-command-TU2ZPP24.js");
2815
+ } = await import("./dev-command-IR63C7WI.js");
2816
2816
  const target = resolveTarget({
2817
2817
  command: "dev",
2818
2818
  flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
@@ -2839,8 +2839,8 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2839
2839
  { callOpenApiOperation, formatOpenApiHttpDebugLine },
2840
2840
  { parsePackageCheckResult, PublishChecksAuthError }
2841
2841
  ] = await Promise.all([
2842
- import("./open-api-client-NRPF5SUW.js"),
2843
- import("./dev-command-TU2ZPP24.js")
2842
+ import("./open-api-client-GULJJEIG.js"),
2843
+ import("./dev-command-IR63C7WI.js")
2844
2844
  ]);
2845
2845
  let token2;
2846
2846
  try {
@@ -2957,7 +2957,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2957
2957
  purpose: "kody dev",
2958
2958
  ...org ? { org } : {}
2959
2959
  }) : "mock";
2960
- const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-IGS3ZKEO.js")).tryResolveMockDepResolve({
2960
+ const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-UELE626X.js")).tryResolveMockDepResolve({
2961
2961
  tokenValues,
2962
2962
  apiUrl: prodApiUrl,
2963
2963
  mcpUrl,
@@ -3089,7 +3089,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
3089
3089
  const apiUrl = apiUrlFrom({
3090
3090
  apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
3091
3091
  });
3092
- const local = await import("./local-secrets-KZUJ2LE2.js");
3092
+ const local = await import("./local-secrets-LNFSPB3M.js");
3093
3093
  const token = () => accessTokenForOpenApi({
3094
3094
  tokenValues: tokenFlagValues(parsed.values),
3095
3095
  apiUrl,
@@ -3164,7 +3164,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
3164
3164
  const params = parseApiParamsJson(
3165
3165
  typeof parsed.values.params === "string" ? parsed.values.params : void 0
3166
3166
  );
3167
- const { callOpenApiOperation } = await import("./open-api-client-NRPF5SUW.js");
3167
+ const { callOpenApiOperation } = await import("./open-api-client-GULJJEIG.js");
3168
3168
  const result = await callOpenApiOperation({
3169
3169
  operationId,
3170
3170
  params,
@@ -3199,7 +3199,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
3199
3199
  mcpUrl,
3200
3200
  org
3201
3201
  });
3202
- const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-NRPF5SUW.js");
3202
+ const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-GULJJEIG.js");
3203
3203
  write(
3204
3204
  await runPackageCollaboratorPlan({
3205
3205
  plan,
@@ -3225,7 +3225,7 @@ ${packageCollaboratorUsage}`
3225
3225
  positional: parsed.positionals[1],
3226
3226
  paramsJson: typeof parsed.values.params === "string" ? parsed.values.params : void 0
3227
3227
  });
3228
- const { callOpenApiOperation } = await import("./open-api-client-NRPF5SUW.js");
3228
+ const { callOpenApiOperation } = await import("./open-api-client-GULJJEIG.js");
3229
3229
  const publishToken = await accessTokenForOpenApi({
3230
3230
  tokenValues,
3231
3231
  apiUrl,
@@ -3397,7 +3397,7 @@ function attachExecuteCommonArgs(args, input) {
3397
3397
  return args;
3398
3398
  }
3399
3399
  async function runAuthSetupGit(input) {
3400
- const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-6NZQISC4.js");
3400
+ const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-RV7LNKRJ.js");
3401
3401
  const apiUrl = apiUrlFrom({
3402
3402
  apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
3403
3403
  });
@@ -3454,7 +3454,7 @@ async function runAuthSetupGit(input) {
3454
3454
  return 0;
3455
3455
  }
3456
3456
  async function runAuthRemoveGit(input) {
3457
- const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-6NZQISC4.js");
3457
+ const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-RV7LNKRJ.js");
3458
3458
  const apiUrl = apiUrlFrom({
3459
3459
  apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
3460
3460
  });
@@ -3476,7 +3476,7 @@ function bootstrapMinter(input) {
3476
3476
  });
3477
3477
  if (minter?.token) {
3478
3478
  const token = minter.token;
3479
- const { callOpenApiOperation } = await import("./open-api-client-NRPF5SUW.js");
3479
+ const { callOpenApiOperation } = await import("./open-api-client-GULJJEIG.js");
3480
3480
  try {
3481
3481
  return await callOpenApiOperation({
3482
3482
  token,
@@ -3495,13 +3495,13 @@ function bootstrapMinter(input) {
3495
3495
  }
3496
3496
  }
3497
3497
  if (minter) {
3498
- const { ensureOpenApiCredentials } = await import("./auth-PVW2LO2U.js");
3498
+ const { ensureOpenApiCredentials } = await import("./auth-ESYKAKVY.js");
3499
3499
  const session = await ensureOpenApiCredentials({
3500
3500
  mcpUrl: input.mcpUrl,
3501
3501
  apiUrl: input.apiUrl,
3502
3502
  ...input.org ? { org: input.org } : {}
3503
3503
  });
3504
- const { callOpenApiOperation } = await import("./open-api-client-NRPF5SUW.js");
3504
+ const { callOpenApiOperation } = await import("./open-api-client-GULJJEIG.js");
3505
3505
  return callOpenApiOperation({
3506
3506
  operationId: cliCredentialBootstrapOperationId,
3507
3507
  params,
@@ -3528,7 +3528,7 @@ async function accessTokenForOpenApi(input) {
3528
3528
  ...input.org ? { org: input.org } : {}
3529
3529
  });
3530
3530
  if (credential?.token) return credential.token;
3531
- const { ensureOpenApiCredentials } = await import("./auth-PVW2LO2U.js");
3531
+ const { ensureOpenApiCredentials } = await import("./auth-ESYKAKVY.js");
3532
3532
  const session = await ensureOpenApiCredentials({
3533
3533
  mcpUrl: input.mcpUrl,
3534
3534
  apiUrl: input.apiUrl,
@@ -3582,20 +3582,34 @@ async function resolvePackagePublishTarget(params, call) {
3582
3582
  const { kody_id: _name, ...rest } = params;
3583
3583
  return { ...rest, package_id: matches[0].package_id };
3584
3584
  }
3585
- function storedApiTokenAfterLoginNotice(apiUrl, loadApiToken = loadStoredApiToken) {
3585
+ function supersedeStoredApiTokenAfterLogin(apiUrl, deps = {}) {
3586
+ const env = deps.env ?? process.env;
3587
+ const envTokenNote = env.KODY_API_TOKEN?.trim() ? "Note: KODY_API_TOKEN is set in this shell and still takes precedence over this login. Unset it to use the login.\n" : "";
3588
+ if (env.KODY_CREDENTIAL_SOURCE?.trim()) return envTokenNote;
3586
3589
  let stored;
3587
3590
  try {
3588
- stored = loadApiToken(apiUrl);
3591
+ stored = (deps.loadApiToken ?? loadStoredApiToken)(apiUrl);
3589
3592
  } catch {
3590
- return "";
3593
+ return envTokenNote;
3591
3594
  }
3592
- if (!stored) return "";
3595
+ if (!stored) return envTokenNote;
3593
3596
  const label = describeCliCredential({
3594
3597
  source: "stored-api-token",
3595
3598
  token: stored.token,
3596
3599
  stored
3597
3600
  });
3598
- return `Note: a ${label} is still stored and \`kody login\` does not replace it. api, package, execute --local, context, daemon, and dev keep using it (scopes: ${stored.scopes?.join(", ") || "unknown"}). To change its scopes run \`${replaceStoredTokenCommand(stored.scopes)}\`, or \`kody logout\` to clear it. Check with \`kody whoami\`.
3601
+ const scopes = stored.scopes?.join(", ") || "unknown";
3602
+ let deleted = false;
3603
+ try {
3604
+ deleted = (deps.deleteApiToken ?? deleteStoredApiToken)(apiUrl).deleted;
3605
+ } catch {
3606
+ deleted = false;
3607
+ }
3608
+ if (!deleted) {
3609
+ return `${envTokenNote}Warning: could not remove the ${label} (scopes: ${scopes}), so api, package, execute --local, context, daemon, and dev keep using it instead of this login. Run \`kody logout\` and log in again.
3610
+ `;
3611
+ }
3612
+ return `${envTokenNote}Removed the ${label} (scopes: ${scopes}); api, package, execute --local, context, daemon, and dev now use this login. Git pushes mint a new token from this login. To use a scoped token again, run \`${replaceStoredTokenCommand(stored.scopes)}\`.
3599
3613
  `;
3600
3614
  }
3601
3615
 
@@ -3614,6 +3628,6 @@ export {
3614
3628
  parseApiParamsJson,
3615
3629
  packagePublishParams,
3616
3630
  resolvePackagePublishTarget,
3617
- storedApiTokenAfterLoginNotice
3631
+ supersedeStoredApiTokenAfterLogin
3618
3632
  };
3619
- //# sourceMappingURL=chunk-PQRALHYL.js.map
3633
+ //# sourceMappingURL=chunk-R7WIPNQ3.js.map