@kodycodes/cli 3.34.5 → 3.34.6

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 (84) hide show
  1. package/README.md +40 -60
  2. package/dist/{auth-DWGWWITD.js → auth-AKQHOHID.js} +8 -8
  3. package/dist/auth-bootstrap.d.ts +9 -2
  4. package/dist/bin.js +11 -11
  5. package/dist/{chunk-5SC7O2PH.js → chunk-2G4GTBVS.js} +6 -6
  6. package/dist/{chunk-GD7ZK2TS.js → chunk-2JLWI6S6.js} +1 -1
  7. package/dist/{chunk-GD7ZK2TS.js.map → chunk-2JLWI6S6.js.map} +1 -1
  8. package/dist/{chunk-RHMKQBDF.js → chunk-3VTBNHOP.js} +6 -6
  9. package/dist/{chunk-3Y5ORFHI.js → chunk-6UKNLM4J.js} +2 -2
  10. package/dist/{chunk-ONR2NQSZ.js → chunk-DXPSBREX.js} +95 -155
  11. package/dist/chunk-DXPSBREX.js.map +6 -0
  12. package/dist/{chunk-DJD2F7UG.js → chunk-FHCZOUMK.js} +85 -104
  13. package/dist/chunk-FHCZOUMK.js.map +6 -0
  14. package/dist/{chunk-UL7FYAAL.js → chunk-FSPB2VOI.js} +2 -2
  15. package/dist/{chunk-D6UGXUT4.js → chunk-LMECHWQG.js} +4 -4
  16. package/dist/chunk-LMECHWQG.js.map +6 -0
  17. package/dist/{chunk-PIQVCGBG.js → chunk-P4UANZGD.js} +4 -4
  18. package/dist/{chunk-6JZQOHFG.js → chunk-RNKUXPIV.js} +2 -17
  19. package/dist/{chunk-6JZQOHFG.js.map → chunk-RNKUXPIV.js.map} +1 -1
  20. package/dist/chunk-S25OT7WN.js +170 -0
  21. package/dist/chunk-S25OT7WN.js.map +6 -0
  22. package/dist/{chunk-FKRK4KX2.js → chunk-UUTWW4WZ.js} +10 -5
  23. package/dist/chunk-UUTWW4WZ.js.map +6 -0
  24. package/dist/{chunk-XMSOSYDJ.js → chunk-VTHFAAAB.js} +3 -3
  25. package/dist/{chunk-IQT3CSAH.js → chunk-WXIZWY7D.js} +3 -3
  26. package/dist/{chunk-WAGPHHLE.js → chunk-XLPWBRJA.js} +4 -4
  27. package/dist/{chunk-KIE2IYSQ.js → chunk-Z4F75LW4.js} +4 -4
  28. package/dist/cli-credential.d.ts +24 -25
  29. package/dist/cli.d.ts +2 -2
  30. package/dist/cli.js +11 -11
  31. package/dist/{commands-5SON3UIU.js → commands-DV433NZC.js} +6 -6
  32. package/dist/{dev-command-C6KQGDDX.js → dev-command-SOYWO5CC.js} +19 -19
  33. package/dist/{git-credential-CJU5XPLS.js → git-credential-DILZVB7K.js} +39 -52
  34. package/dist/git-credential-DILZVB7K.js.map +6 -0
  35. package/dist/git-credential.d.ts +13 -15
  36. package/dist/{local-execute-NDTHSGUJ.js → local-execute-3XA7PDHO.js} +10 -10
  37. package/dist/{local-package-graph-2O57E4YF.js → local-package-graph-52VMEXXB.js} +7 -7
  38. package/dist/{local-package-run-D5D2MBEV.js → local-package-run-XSD5MFQ2.js} +12 -12
  39. package/dist/{local-secrets-6WYNC5RH.js → local-secrets-7TZHJCJW.js} +7 -7
  40. package/dist/{mock-dep-resolve-YOTBQODM.js → mock-dep-resolve-RXRPPUHG.js} +6 -6
  41. package/dist/{mock-local-deps-AE2JUMC3.js → mock-local-deps-S4I2PI7H.js} +9 -9
  42. package/dist/{open-api-client-6L6KSSK6.js → open-api-client-G2UW7AMN.js} +7 -7
  43. package/dist/{org-JE67J3U4.js → org-FYDBV6R3.js} +2 -2
  44. package/dist/{remote-execute-Z6NGBM3M.js → remote-execute-7FSFBBYD.js} +7 -7
  45. package/dist/{run-executor-6GE3P4S4.js → run-executor-LYSUFLSL.js} +2 -2
  46. package/dist/{setup-git-4UECBTVV.js → setup-git-PRMZHUIC.js} +8 -8
  47. package/dist/setup-git.d.ts +8 -11
  48. package/dist/{store-XUB5AFUP.js → store-3MBFGTTB.js} +2 -2
  49. package/dist/store.d.ts +2 -0
  50. package/dist/{whoami-DVDBA3FV.js → whoami-JN7ACJMO.js} +8 -14
  51. package/dist/whoami-JN7ACJMO.js.map +6 -0
  52. package/package.json +1 -1
  53. package/dist/chunk-D6UGXUT4.js.map +0 -6
  54. package/dist/chunk-DJD2F7UG.js.map +0 -6
  55. package/dist/chunk-FKRK4KX2.js.map +0 -6
  56. package/dist/chunk-LZMFWQGZ.js +0 -175
  57. package/dist/chunk-LZMFWQGZ.js.map +0 -6
  58. package/dist/chunk-ONR2NQSZ.js.map +0 -6
  59. package/dist/git-credential-CJU5XPLS.js.map +0 -6
  60. package/dist/whoami-DVDBA3FV.js.map +0 -6
  61. /package/dist/{auth-DWGWWITD.js.map → auth-AKQHOHID.js.map} +0 -0
  62. /package/dist/{chunk-5SC7O2PH.js.map → chunk-2G4GTBVS.js.map} +0 -0
  63. /package/dist/{chunk-RHMKQBDF.js.map → chunk-3VTBNHOP.js.map} +0 -0
  64. /package/dist/{chunk-3Y5ORFHI.js.map → chunk-6UKNLM4J.js.map} +0 -0
  65. /package/dist/{chunk-UL7FYAAL.js.map → chunk-FSPB2VOI.js.map} +0 -0
  66. /package/dist/{chunk-PIQVCGBG.js.map → chunk-P4UANZGD.js.map} +0 -0
  67. /package/dist/{chunk-XMSOSYDJ.js.map → chunk-VTHFAAAB.js.map} +0 -0
  68. /package/dist/{chunk-IQT3CSAH.js.map → chunk-WXIZWY7D.js.map} +0 -0
  69. /package/dist/{chunk-WAGPHHLE.js.map → chunk-XLPWBRJA.js.map} +0 -0
  70. /package/dist/{chunk-KIE2IYSQ.js.map → chunk-Z4F75LW4.js.map} +0 -0
  71. /package/dist/{commands-5SON3UIU.js.map → commands-DV433NZC.js.map} +0 -0
  72. /package/dist/{dev-command-C6KQGDDX.js.map → dev-command-SOYWO5CC.js.map} +0 -0
  73. /package/dist/{local-execute-NDTHSGUJ.js.map → local-execute-3XA7PDHO.js.map} +0 -0
  74. /package/dist/{local-package-graph-2O57E4YF.js.map → local-package-graph-52VMEXXB.js.map} +0 -0
  75. /package/dist/{local-package-run-D5D2MBEV.js.map → local-package-run-XSD5MFQ2.js.map} +0 -0
  76. /package/dist/{local-secrets-6WYNC5RH.js.map → local-secrets-7TZHJCJW.js.map} +0 -0
  77. /package/dist/{mock-dep-resolve-YOTBQODM.js.map → mock-dep-resolve-RXRPPUHG.js.map} +0 -0
  78. /package/dist/{mock-local-deps-AE2JUMC3.js.map → mock-local-deps-S4I2PI7H.js.map} +0 -0
  79. /package/dist/{open-api-client-6L6KSSK6.js.map → open-api-client-G2UW7AMN.js.map} +0 -0
  80. /package/dist/{org-JE67J3U4.js.map → org-FYDBV6R3.js.map} +0 -0
  81. /package/dist/{remote-execute-Z6NGBM3M.js.map → remote-execute-7FSFBBYD.js.map} +0 -0
  82. /package/dist/{run-executor-6GE3P4S4.js.map → run-executor-LYSUFLSL.js.map} +0 -0
  83. /package/dist/{setup-git-4UECBTVV.js.map → setup-git-PRMZHUIC.js.map} +0 -0
  84. /package/dist/{store-XUB5AFUP.js.map → store-3MBFGTTB.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-E4R3Y6MM.js";
6
6
  import {
7
7
  resolveLocalExecuteBearer
8
- } from "./chunk-FKRK4KX2.js";
8
+ } from "./chunk-UUTWW4WZ.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-PIQVCGBG.js";
26
+ } from "./chunk-P4UANZGD.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-DJD2F7UG.js";
36
+ } from "./chunk-FHCZOUMK.js";
37
37
  import {
38
38
  orgEnvVar,
39
39
  orgSlugFromFlag
@@ -44,28 +44,27 @@ import {
44
44
  import {
45
45
  parseCredentialFlags,
46
46
  readPackageVersion
47
- } from "./chunk-UL7FYAAL.js";
47
+ } from "./chunk-FSPB2VOI.js";
48
48
  import {
49
49
  cliBootstrapMintCall,
50
50
  expectedPairedApiOrigin
51
- } from "./chunk-D6UGXUT4.js";
51
+ } from "./chunk-LMECHWQG.js";
52
52
  import {
53
53
  describeCliCredential,
54
54
  noteActiveLoginCredential,
55
- replaceStoredTokenCommand,
56
55
  resetActiveCliCredential,
57
56
  resolveCliCredential
58
- } from "./chunk-LZMFWQGZ.js";
57
+ } from "./chunk-S25OT7WN.js";
59
58
  import {
60
59
  deleteStoredApiToken,
61
60
  loadStoredApiToken
62
- } from "./chunk-6JZQOHFG.js";
61
+ } from "./chunk-RNKUXPIV.js";
63
62
  import {
64
63
  deleteCredentials,
65
64
  listStoredOrgs,
66
65
  loadCredentialStore,
67
66
  loadCredentials
68
- } from "./chunk-GD7ZK2TS.js";
67
+ } from "./chunk-2JLWI6S6.js";
69
68
  import {
70
69
  apiTokenEnvVar,
71
70
  defaultApiUrl,
@@ -175,14 +174,14 @@ var commandHelpTree = [
175
174
  },
176
175
  {
177
176
  name: "auth",
178
- summary: "Store scoped API tokens and set up Git credentials",
177
+ summary: "Save the CLI credential and set up Git credentials",
179
178
  usage: ["kody auth <command> [flags]"],
180
179
  subcommands: [
181
180
  {
182
181
  name: "bootstrap",
183
- summary: "Redeem a kody_bc_\u2026 code (or mint one with --scopes) and store the token",
182
+ summary: "Redeem a kody_bc_\u2026 code (or mint a narrower one with --scopes) into the saved CLI credential",
184
183
  usage: [
185
- "kody auth bootstrap (--code <kody_bc_\u2026> | --scopes <list>) (--lifetime short|long | --idle-ttl-seconds <n> --max-lifetime-seconds <n>)",
184
+ "kody auth bootstrap (--code <kody_bc_\u2026> | --scopes <list>) [--lifetime short|long | --idle-ttl-seconds <n> --max-lifetime-seconds <n>]",
186
185
  " [--token <token>] [--mcp-url <url>] [--api-url <url>]"
187
186
  ],
188
187
  flags: [
@@ -192,7 +191,7 @@ var commandHelpTree = [
192
191
  ],
193
192
  [
194
193
  "--scopes <list>",
195
- "Mint a code with exactly these scopes (replaces the defaults)"
194
+ "Mint a narrower code with exactly these scopes (replaces the login-equivalent default)"
196
195
  ],
197
196
  [
198
197
  "--lifetime short|long",
@@ -214,26 +213,12 @@ var commandHelpTree = [
214
213
  {
215
214
  name: "setup-git",
216
215
  summary: "Install a Git credential helper for https://kody.codes/@owner/name.git",
217
- usage: [
218
- "kody auth setup-git [--lifetime long|short] [--scopes <list>] [--token <token>] [--mcp-url <url>] [--api-url <url>]"
219
- ],
220
- flags: [
221
- [
222
- "--lifetime long|short",
223
- "Lifetime of the minted token (default long)"
224
- ],
225
- [
226
- "--scopes <list>",
227
- "Extra scopes beyond package:read and package:write"
228
- ],
229
- tokenFlag,
230
- mcpUrlFlag,
231
- apiUrlFlag
232
- ]
216
+ usage: ["kody auth setup-git [--mcp-url <url>] [--api-url <url>]"],
217
+ flags: [mcpUrlFlag, apiUrlFlag]
233
218
  },
234
219
  {
235
220
  name: "remove-git",
236
- summary: "Remove the Git credential helper and revoke its stored token",
221
+ summary: "Remove the Git credential helper and revoke any old-slot token",
237
222
  usage: ["kody auth remove-git [--mcp-url <url>] [--api-url <url>]"],
238
223
  flags: [mcpUrlFlag, apiUrlFlag]
239
224
  }
@@ -1093,9 +1078,9 @@ Usage:
1093
1078
  kody org list [--json] [--mcp-url <url>]
1094
1079
  kody org use [<slug>] [--mcp-url <url>]
1095
1080
  kody status [--mcp-url <url>] [--api-url <url>]
1096
- kody auth bootstrap (--code <kody_bc_\u2026> | --scopes <list>) (--lifetime short|long | --idle-ttl-seconds <n> --max-lifetime-seconds <n>)
1081
+ kody auth bootstrap (--code <kody_bc_\u2026> | --scopes <list>) [--lifetime short|long | --idle-ttl-seconds <n> --max-lifetime-seconds <n>]
1097
1082
  [--token <token>] [--mcp-url <url>] [--api-url <url>]
1098
- kody auth setup-git [--lifetime long|short] [--scopes <list>] [--token <token>] [--mcp-url <url>] [--api-url <url>]
1083
+ kody auth setup-git [--mcp-url <url>] [--api-url <url>]
1099
1084
  kody auth remove-git [--mcp-url <url>] [--api-url <url>]
1100
1085
  kody git-credential <get|store|erase>
1101
1086
  kody whoami [--org <slug>] [--target prod|mock] [--mcp-url <url>] [--token <token>] [--api-url <url>] [--json]
@@ -1201,41 +1186,30 @@ ${orgBlock}
1201
1186
  (never ask a human to paste a token). Humans: \`kody login\`.
1202
1187
  This command redeems a one-shot \`kody_bc_\u2026\` (POST
1203
1188
  /v1/tokens/bootstrap/redeem, no Authorization header).
1204
- Lifetime is required: \`--lifetime short|long\` (\`short\` = 1h
1205
- idle / 24h max; \`long\` = 14d idle / 3mo max), or both
1206
- \`--idle-ttl-seconds\` and \`--max-lifetime-seconds\`.
1207
- Single-task agents should use \`--lifetime short\`.
1208
- Stores the resulting \`kody_at_\u2026\` for \`execute --local\`,
1209
- search, whoami, api, and token-auth cloud execute without
1210
- printing the token. Do not call
1211
- \`kody api cliCredentialBootstrapRedeem\` (that would print the
1212
- token).
1189
+ Saves the same credential \`kody login\` saves (every scope
1190
+ your org role grants, 14d idle / 3mo max) in the same slot;
1191
+ every command, including git, uses it. \`--lifetime short|long\`
1192
+ or \`--idle-ttl-seconds\` + \`--max-lifetime-seconds\` are
1193
+ optional and default to the code's lifetime. Never prints the
1194
+ token. Do not call \`kody api cliCredentialBootstrapRedeem\`
1195
+ (that would print the token).
1213
1196
 
1214
1197
  --scopes <list>
1215
- Opt in to scopes beyond the cliCredentialBootstrap defaults
1216
- (comma- or space-separated, e.g.
1217
- \`--scopes org:execute,org:read,package:read,package:write\`).
1218
- The list replaces the defaults, so include every scope you
1219
- need. Instead of \`--code\`, the CLI mints the code itself by
1220
- passing \`scopes\` to cliCredentialBootstrap, then redeems and
1221
- stores it. It mints with \`--token\` if given, else the
1222
- \`kody login\` session (any scope your org role grants), else
1223
- ${apiTokenEnvVar} / a stored token (only scopes that token
1224
- already holds). A bootstrap code's scopes are fixed when it is
1225
- minted, so \`--code\` with \`--scopes\` is an error. Defaults
1226
- stay least-privilege; \`insufficient_scope\` errors print the
1227
- exact \`--scopes\` command to run.
1198
+ Save a deliberately narrower credential (comma- or
1199
+ space-separated). The list replaces the login-equivalent
1200
+ default. Instead of \`--code\`, the CLI mints the code itself
1201
+ with \`--token\`, else ${apiTokenEnvVar}, else the saved
1202
+ credential, then redeems and saves it. A child never exceeds
1203
+ its parent's scopes or expiry. \`--code\` with \`--scopes\` is
1204
+ an error.
1228
1205
 
1229
1206
  auth setup-git
1230
1207
  Install a Git credential helper for HTTPS clones/fetches/pushes
1231
1208
  at \`https://kody.codes/@owner/name.git\` (see guide:auth_setup_git).
1232
- Uses a \`kody login\` session (or \`--token\` / ${apiTokenEnvVar} /
1233
- stored bootstrap token) to mint a user-owned \`kody_at_\u2026\` with
1234
- at least \`package:read\` and \`package:write\` (default
1235
- \`--lifetime long\`; reuses a suitable stored token). That token
1236
- authorizes every repo you can access across all orgs \u2014 login
1237
- \`--org\` only scopes the MCP mint session, not git. User-wide:
1238
- one setup covers every org. Requires a server that advertises
1209
+ Never mints: uses the saved CLI credential (\`kody login\` or
1210
+ \`kody auth bootstrap\`), which must be user-owned and hold
1211
+ \`package:read\` and \`package:write\`. It authorizes every repo
1212
+ you can access across all orgs. Requires a server that advertises
1239
1213
  \`org_binding\`. Configures a stable
1240
1214
  \`credential.https://<host>.helper\` (global \`kody\` only when
1241
1215
  its version supports \`git-credential\`, else
@@ -1249,18 +1223,16 @@ ${orgBlock}
1249
1223
  Inverse of \`auth setup-git\`: removes every
1250
1224
  \`credential.https://<host>.*\` helper entry setup-git may have
1251
1225
  written (global and local; including stale \`~/.npm/_npx\` and
1252
- major-only \`@1\` pins), revokes the stored API token on the
1253
- server (\`token:delete\` / DELETE /v1/tokens/current), and
1254
- deletes it from the OS keychain. Idempotent when nothing is
1255
- set up; prints what it removed. Leaves \`kody login\` sessions
1256
- alone.
1226
+ major-only \`@1\` pins) and revokes any token an older CLI left
1227
+ in the old API-token slot. Idempotent when nothing is set up;
1228
+ prints what it removed. Leaves the saved credential alone.
1257
1229
 
1258
1230
  git-credential
1259
1231
  Git credential helper invoked by git after \`auth setup-git\`
1260
1232
  (\`get\` returns username=x / password=kody_at_\u2026 for the Kody
1261
- host with no network while the stored token is still valid;
1262
- silently remints via \`kody login\` only when expired or near
1263
- expiry; \`store\`/\`erase\` are no-ops). Not meant for interactive
1233
+ host: ${apiTokenEnvVar} when set, else the saved CLI credential,
1234
+ refreshed like any command; never mints; \`store\`/\`erase\` are
1235
+ no-ops). Not meant for interactive
1264
1236
  use.
1265
1237
 
1266
1238
  api Call one Open API operation by operationId + flat --params
@@ -1314,16 +1286,10 @@ ${orgBlock}
1314
1286
  --token / ${apiTokenEnvVar}
1315
1287
  Scoped API token (preferred via env). One resolver picks the
1316
1288
  credential, and \`kody whoami\` reports that pick:
1317
- whoami, api, package, execute --local, context, daemon, dev:
1318
- --token, ${apiTokenEnvVar}, stored API token, kody login.
1319
- search and cloud execute: --token, kody login (MCP),
1320
- ${apiTokenEnvVar}, stored API token.
1321
- \`kody login\` does not replace a stored API token; replace it
1322
- with \`kody auth bootstrap --lifetime short --scopes <list>\`
1323
- or clear it with \`kody logout\`.
1324
- Prefer \`cliCredentialBootstrap\` then \`auth bootstrap\`
1325
- (\`--lifetime short|long\`). CI/headless: \`tokenCreate\` with
1326
- \`org:execute\` plus the capability scopes you need.
1289
+ every command: --token, ${apiTokenEnvVar}, then the saved CLI
1290
+ credential (\`kody login\` / \`kody auth bootstrap\`).
1291
+ CI/headless: \`tokenCreate\` with \`org:execute\` plus the
1292
+ capability scopes you need.
1327
1293
  Profiles: \`tokenCreate\` with \`profile_id\`, or
1328
1294
  \`profileHandoff\` for a new sub-profile, mints a token
1329
1295
  that acts as that profile (not accepted by /mcp).
@@ -2170,7 +2136,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2170
2136
  case "connect":
2171
2137
  case "update": {
2172
2138
  const apiUrl = earlyApiUrl;
2173
- const { runExecutionContextCommand } = await import("./commands-5SON3UIU.js");
2139
+ const { runExecutionContextCommand } = await import("./commands-DV433NZC.js");
2174
2140
  return await runExecutionContextCommand({
2175
2141
  command: parsed.command,
2176
2142
  positionals: parsed.positionals,
@@ -2204,7 +2170,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2204
2170
  });
2205
2171
  }
2206
2172
  case "login": {
2207
- const { login, loginWithDevice } = await import("./auth-DWGWWITD.js");
2173
+ const { login, loginWithDevice } = await import("./auth-AKQHOHID.js");
2208
2174
  const openBrowser = parsed.values["no-browser"] !== true;
2209
2175
  const lifetimeOption = typeof parsed.values.lifetime === "string" ? {
2210
2176
  lifetime: parsed.values.lifetime === "short" ? "short" : "long"
@@ -2287,8 +2253,8 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2287
2253
  formatOrgListHuman,
2288
2254
  formatOrgListJson,
2289
2255
  useOrg
2290
- } = await import("./org-JE67J3U4.js");
2291
- const { listStoredOrgs: listStoredOrgs2 } = await import("./store-XUB5AFUP.js");
2256
+ } = await import("./org-FYDBV6R3.js");
2257
+ const { listStoredOrgs: listStoredOrgs2 } = await import("./store-3MBFGTTB.js");
2292
2258
  const action = parsed.positionals[0];
2293
2259
  if (action === "list") {
2294
2260
  const orgs = listStoredOrgs2(mcpUrl);
@@ -2395,8 +2361,9 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2395
2361
  "Provide --code <kody_bc_\u2026> from cliCredentialBootstrap (MCP api tool), or --scopes <list> to mint one with the current kody login session or API token."
2396
2362
  );
2397
2363
  }
2364
+ const lifetimeGiven = typeof parsed.values.lifetime === "string" || typeof parsed.values["idle-ttl-seconds"] === "string" || typeof parsed.values["max-lifetime-seconds"] === "string";
2398
2365
  const lifetime = resolveCliTokenLifetime({
2399
- lifetime: typeof parsed.values.lifetime === "string" ? parsed.values.lifetime : void 0,
2366
+ lifetime: typeof parsed.values.lifetime === "string" ? parsed.values.lifetime : lifetimeGiven ? void 0 : "long",
2400
2367
  idleTtlSeconds: parseCliLifetimeSecondsFlag(
2401
2368
  typeof parsed.values["idle-ttl-seconds"] === "string" ? parsed.values["idle-ttl-seconds"] : void 0,
2402
2369
  "--idle-ttl-seconds"
@@ -2418,6 +2385,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2418
2385
  scopes,
2419
2386
  lifetime,
2420
2387
  apiUrl,
2388
+ mcpUrl,
2421
2389
  mint: bootstrapMinter({
2422
2390
  scopes,
2423
2391
  lifetime,
@@ -2429,7 +2397,8 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2429
2397
  }) : await authBootstrap({
2430
2398
  code,
2431
2399
  apiUrl,
2432
- ...lifetime.kind === "alias" ? { lifetime: lifetime.lifetime } : {
2400
+ mcpUrl,
2401
+ ...!lifetimeGiven ? {} : lifetime.kind === "alias" ? { lifetime: lifetime.lifetime } : {
2433
2402
  idleTtlSeconds: lifetime.idleTtlSeconds,
2434
2403
  maxLifetimeSeconds: lifetime.maxLifetimeSeconds
2435
2404
  }
@@ -2437,7 +2406,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2437
2406
  const storedScopes = result.stored.scopes?.join(", ") || "(none)";
2438
2407
  write(
2439
2408
  [
2440
- `Bootstrap API token stored for execute --local, search, whoami, api, and token-auth cloud execute.`,
2409
+ `Saved as the CLI credential (the same slot \`kody login\` uses). Every command, including git, uses it.`,
2441
2410
  `api: ${result.stored.apiUrl}`,
2442
2411
  `token id: ${result.stored.tokenId}`,
2443
2412
  `scopes: ${storedScopes}`,
@@ -2454,7 +2423,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2454
2423
  parseGitCredentialAction,
2455
2424
  parseGitCredentialInput,
2456
2425
  readGitCredentialStdin
2457
- } = await import("./git-credential-CJU5XPLS.js");
2426
+ } = await import("./git-credential-DILZVB7K.js");
2458
2427
  const action = parseGitCredentialAction(parsed.positionals);
2459
2428
  const raw = await readGitCredentialStdin(process.stdin);
2460
2429
  const output = await handleGitCredential({
@@ -2514,7 +2483,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2514
2483
  if (mock.started) await mock.server.close();
2515
2484
  }
2516
2485
  }
2517
- const { runWhoami } = await import("./whoami-DVDBA3FV.js");
2486
+ const { runWhoami } = await import("./whoami-JN7ACJMO.js");
2518
2487
  return await runWhoami({
2519
2488
  tokenValues,
2520
2489
  mcpUrl,
@@ -2544,7 +2513,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2544
2513
  });
2545
2514
  apiUrl = mock.apiUrl;
2546
2515
  closeMock = mock.started ? () => mock.server.close() : void 0;
2547
- const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-6L6KSSK6.js");
2516
+ const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-G2UW7AMN.js");
2548
2517
  const result2 = await searchWithApiToken2({
2549
2518
  token: mock.token,
2550
2519
  apiUrl,
@@ -2564,7 +2533,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2564
2533
  ...org ? { org } : {}
2565
2534
  });
2566
2535
  if (searchCredential?.token) {
2567
- const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-6L6KSSK6.js");
2536
+ const { searchWithApiToken: searchWithApiToken2 } = await import("./open-api-client-G2UW7AMN.js");
2568
2537
  const result2 = await searchWithApiToken2({
2569
2538
  token: searchCredential.token,
2570
2539
  apiUrl,
@@ -2577,14 +2546,14 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2577
2546
  write(formatToolResult(result2, json));
2578
2547
  return result2.isError ? 1 : 0;
2579
2548
  }
2580
- const { ensureOpenApiCredentials } = await import("./auth-DWGWWITD.js");
2549
+ const { ensureOpenApiCredentials } = await import("./auth-AKQHOHID.js");
2581
2550
  const credentials = await ensureOpenApiCredentials({
2582
2551
  mcpUrl,
2583
2552
  org,
2584
2553
  apiUrl
2585
2554
  });
2586
2555
  noteActiveLoginCredential({ login: credentials, purpose: "session" });
2587
- const { searchWithApiToken } = await import("./open-api-client-6L6KSSK6.js");
2556
+ const { searchWithApiToken } = await import("./open-api-client-G2UW7AMN.js");
2588
2557
  const result = await searchWithApiToken({
2589
2558
  token: credentials.accessToken,
2590
2559
  apiUrl,
@@ -2643,7 +2612,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2643
2612
  (value) => typeof value === "string"
2644
2613
  ) : typeof parsed.values.credential === "string" ? [parsed.values.credential] : void 0
2645
2614
  );
2646
- const executeRouting = (await import("./remote-execute-Z6NGBM3M.js")).executeRoutingFromFlags(parsed.values);
2615
+ const executeRouting = (await import("./remote-execute-7FSFBBYD.js")).executeRoutingFromFlags(parsed.values);
2647
2616
  if (executeRouting && local) {
2648
2617
  writeErr(
2649
2618
  "--context, --fallback, --requires, and --chain route cloud execute; drop --local.\n"
@@ -2699,7 +2668,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2699
2668
  apiUrl = mock.apiUrl;
2700
2669
  mockToken = mock.token;
2701
2670
  closeMock = mock.started ? () => mock.server.close() : void 0;
2702
- const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-YOTBQODM.js");
2671
+ const { tryResolveMockDepResolve } = await import("./mock-dep-resolve-RXRPPUHG.js");
2703
2672
  mockDepResolve = await tryResolveMockDepResolve({
2704
2673
  tokenValues,
2705
2674
  apiUrl: prodApiUrl,
@@ -2708,7 +2677,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2708
2677
  });
2709
2678
  }
2710
2679
  if (localPackageRun) {
2711
- const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-D5D2MBEV.js");
2680
+ const { buildLocalPackageContext, runLocalPackageModule } = await import("./local-package-run-XSD5MFQ2.js");
2712
2681
  const result2 = await runLocalPackageModule({
2713
2682
  modulePath: localPackageRun.modulePath,
2714
2683
  params: args.params,
@@ -2753,7 +2722,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2753
2722
  packageRootForMocks = void 0;
2754
2723
  }
2755
2724
  }
2756
- const result = local ? await (await import("./local-execute-NDTHSGUJ.js")).runLocalExecute({
2725
+ const result = local ? await (await import("./local-execute-3XA7PDHO.js")).runLocalExecute({
2757
2726
  code: args.code,
2758
2727
  ...modulePath !== void 0 ? { modulePath } : {},
2759
2728
  params: args.params,
@@ -2775,7 +2744,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2775
2744
  allowPrivateNetwork: parsed.values["allow-private-network"] === true,
2776
2745
  onStatus: (message) => writeErr(`${message}
2777
2746
  `)
2778
- }) : cloudToken ? await (await import("./remote-execute-Z6NGBM3M.js")).runRemoteExecuteWithToken({
2747
+ }) : cloudToken ? await (await import("./remote-execute-7FSFBBYD.js")).runRemoteExecuteWithToken({
2779
2748
  code: typeof args.code === "string" ? args.code : void 0,
2780
2749
  params: args.params,
2781
2750
  conversationId: args.conversationId,
@@ -2785,7 +2754,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2785
2754
  apiUrl,
2786
2755
  ...org ? { org } : {}
2787
2756
  }) : await (async () => {
2788
- const { ensureOpenApiCredentials } = await import("./auth-DWGWWITD.js");
2757
+ const { ensureOpenApiCredentials } = await import("./auth-AKQHOHID.js");
2789
2758
  const session = await ensureOpenApiCredentials({
2790
2759
  mcpUrl,
2791
2760
  org,
@@ -2795,7 +2764,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2795
2764
  login: session,
2796
2765
  purpose: "session"
2797
2766
  });
2798
- return (await import("./remote-execute-Z6NGBM3M.js")).runRemoteExecuteWithToken({
2767
+ return (await import("./remote-execute-7FSFBBYD.js")).runRemoteExecuteWithToken({
2799
2768
  code: typeof args.code === "string" ? args.code : void 0,
2800
2769
  params: args.params,
2801
2770
  conversationId: args.conversationId,
@@ -2810,7 +2779,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2810
2779
  return result.isError ? 1 : 0;
2811
2780
  } catch (error) {
2812
2781
  if (json && local) {
2813
- const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-2O57E4YF.js");
2782
+ const { LocalPackageGraphError, packageGraphErrorToolResult } = await import("./local-package-graph-52VMEXXB.js");
2814
2783
  if (error instanceof LocalPackageGraphError) {
2815
2784
  const redacted = redactError(error).message;
2816
2785
  const result = packageGraphErrorToolResult(error);
@@ -2841,7 +2810,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2841
2810
  runDevServe,
2842
2811
  runDevWebhook,
2843
2812
  tryAttachedDevFetch
2844
- } = await import("./dev-command-C6KQGDDX.js");
2813
+ } = await import("./dev-command-SOYWO5CC.js");
2845
2814
  const target = resolveTarget({
2846
2815
  command: "dev",
2847
2816
  flag: typeof parsed.values.target === "string" ? parsed.values.target : void 0
@@ -2884,8 +2853,8 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
2884
2853
  { callOpenApiOperation, formatOpenApiHttpDebugLine },
2885
2854
  { parsePackageCheckResult, PublishChecksAuthError }
2886
2855
  ] = await Promise.all([
2887
- import("./open-api-client-6L6KSSK6.js"),
2888
- import("./dev-command-C6KQGDDX.js")
2856
+ import("./open-api-client-G2UW7AMN.js"),
2857
+ import("./dev-command-SOYWO5CC.js")
2889
2858
  ]);
2890
2859
  let token2;
2891
2860
  try {
@@ -3002,7 +2971,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
3002
2971
  purpose: "kody dev",
3003
2972
  ...org ? { org } : {}
3004
2973
  }) : "mock";
3005
- const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-YOTBQODM.js")).tryResolveMockDepResolve({
2974
+ const mockDepResolve = target === "mock" ? await (await import("./mock-dep-resolve-RXRPPUHG.js")).tryResolveMockDepResolve({
3006
2975
  tokenValues,
3007
2976
  apiUrl: prodApiUrl,
3008
2977
  mcpUrl,
@@ -3135,7 +3104,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
3135
3104
  const apiUrl = apiUrlFrom({
3136
3105
  apiUrl: typeof parsed.values["api-url"] === "string" ? parsed.values["api-url"] : void 0
3137
3106
  });
3138
- const local = await import("./local-secrets-6WYNC5RH.js");
3107
+ const local = await import("./local-secrets-7TZHJCJW.js");
3139
3108
  const token = () => accessTokenForOpenApi({
3140
3109
  tokenValues: tokenFlagValues(parsed.values),
3141
3110
  apiUrl,
@@ -3210,7 +3179,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
3210
3179
  const params = parseApiParamsJson(
3211
3180
  typeof parsed.values.params === "string" ? parsed.values.params : void 0
3212
3181
  );
3213
- const { callOpenApiOperation } = await import("./open-api-client-6L6KSSK6.js");
3182
+ const { callOpenApiOperation } = await import("./open-api-client-G2UW7AMN.js");
3214
3183
  const result = await callOpenApiOperation({
3215
3184
  operationId,
3216
3185
  params,
@@ -3245,7 +3214,7 @@ async function dispatch(parsed, write, writeErr, stdoutIsTTY) {
3245
3214
  mcpUrl,
3246
3215
  org
3247
3216
  });
3248
- const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-6L6KSSK6.js");
3217
+ const { callOpenApiOperation: callOpenApiOperation2 } = await import("./open-api-client-G2UW7AMN.js");
3249
3218
  write(
3250
3219
  await runPackageCollaboratorPlan({
3251
3220
  plan,
@@ -3271,7 +3240,7 @@ ${packageCollaboratorUsage}`
3271
3240
  positional: parsed.positionals[1],
3272
3241
  paramsJson: typeof parsed.values.params === "string" ? parsed.values.params : void 0
3273
3242
  });
3274
- const { callOpenApiOperation } = await import("./open-api-client-6L6KSSK6.js");
3243
+ const { callOpenApiOperation } = await import("./open-api-client-G2UW7AMN.js");
3275
3244
  const publishToken = await accessTokenForOpenApi({
3276
3245
  tokenValues,
3277
3246
  apiUrl,
@@ -3443,55 +3412,30 @@ function attachExecuteCommonArgs(args, input) {
3443
3412
  return args;
3444
3413
  }
3445
3414
  async function runAuthSetupGit(input) {
3446
- const { authSetupGit, setupGitDefaultScopes } = await import("./setup-git-4UECBTVV.js");
3415
+ const { authSetupGit } = await import("./setup-git-PRMZHUIC.js");
3447
3416
  const apiUrl = apiUrlFrom({
3448
3417
  apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
3449
3418
  });
3450
- const scopes = parseCliScopesFlag(
3451
- typeof input.values.scopes === "string" ? input.values.scopes : void 0
3452
- );
3453
- const lifetime = resolveCliTokenLifetime({
3454
- lifetime: typeof input.values.lifetime === "string" ? input.values.lifetime : "long",
3455
- idleTtlSeconds: parseCliLifetimeSecondsFlag(
3456
- typeof input.values["idle-ttl-seconds"] === "string" ? input.values["idle-ttl-seconds"] : void 0,
3457
- "--idle-ttl-seconds"
3458
- ),
3459
- maxLifetimeSeconds: parseCliLifetimeSecondsFlag(
3460
- typeof input.values["max-lifetime-seconds"] === "string" ? input.values["max-lifetime-seconds"] : void 0,
3461
- "--max-lifetime-seconds"
3462
- )
3463
- });
3419
+ if (typeof input.values.scopes === "string" || typeof input.values.lifetime === "string") {
3420
+ throw new Error(
3421
+ "auth setup-git no longer mints a token, so --scopes and --lifetime do not apply. It uses the saved CLI credential from `kody login` or `kody auth bootstrap`."
3422
+ );
3423
+ }
3464
3424
  const tokenValues = tokenFlagValues(input.values);
3465
- const mintScopes = scopes ?? setupGitDefaultScopes;
3466
- const hasLoginSession = loadCredentials(input.mcpUrl, void 0, void 0, {
3467
- org: input.org
3468
- }) != null;
3469
3425
  const result = await authSetupGit({
3470
3426
  apiUrl,
3471
3427
  mcpUrl: input.mcpUrl,
3472
- token: tokenValues.token,
3473
- hasLoginSession,
3474
- ...scopes ? { scopesOverride: scopes } : {},
3475
- lifetime,
3476
- mint: bootstrapMinter({
3477
- scopes: mintScopes,
3478
- lifetime,
3479
- mcpUrl: input.mcpUrl,
3480
- apiUrl,
3481
- tokenValues,
3482
- ...input.org ? { org: input.org } : {}
3483
- })
3428
+ token: tokenValues.token
3484
3429
  });
3485
3430
  input.write(
3486
3431
  [
3487
3432
  `Git HTTPS credential helper installed for https://${result.host}/`,
3488
3433
  `helper: ${result.helperCommand}`,
3489
- `token: ${result.minted ? "minted" : "reused"} ${result.tokenId} (org_binding=user)`,
3434
+ `credential: saved CLI credential ${result.tokenId} (org_binding=user)`,
3490
3435
  `scopes: ${result.scopes.join(", ") || "(none)"}`,
3491
3436
  `expires: ${result.expiresAt ?? "unknown"}`,
3492
- result.backendKind === "file" && result.backendPath ? `OS keychain was unavailable; token saved at ${result.backendPath} (mode 0600).` : result.minted ? "Token stored in the OS keychain (or existing store)." : "Using the existing stored API token.",
3493
3437
  "",
3494
- "This user-owned token authorizes every @owner/name.git you can access (all orgs).",
3438
+ "This user-owned credential authorizes every @owner/name.git you can access (all orgs).",
3495
3439
  "Try: git clone https://kody.codes/@owner/name.git",
3496
3440
  "Undo later: kody auth remove-git",
3497
3441
  ""
@@ -3500,7 +3444,7 @@ async function runAuthSetupGit(input) {
3500
3444
  return 0;
3501
3445
  }
3502
3446
  async function runAuthRemoveGit(input) {
3503
- const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-4UECBTVV.js");
3447
+ const { authRemoveGit, formatAuthRemoveGitReport } = await import("./setup-git-PRMZHUIC.js");
3504
3448
  const apiUrl = apiUrlFrom({
3505
3449
  apiUrl: typeof input.values["api-url"] === "string" ? input.values["api-url"] : void 0
3506
3450
  });
@@ -3522,7 +3466,7 @@ function bootstrapMinter(input) {
3522
3466
  });
3523
3467
  if (minter?.token) {
3524
3468
  const token = minter.token;
3525
- const { callOpenApiOperation } = await import("./open-api-client-6L6KSSK6.js");
3469
+ const { callOpenApiOperation } = await import("./open-api-client-G2UW7AMN.js");
3526
3470
  try {
3527
3471
  return await callOpenApiOperation({
3528
3472
  token,
@@ -3541,13 +3485,13 @@ function bootstrapMinter(input) {
3541
3485
  }
3542
3486
  }
3543
3487
  if (minter) {
3544
- const { ensureOpenApiCredentials } = await import("./auth-DWGWWITD.js");
3488
+ const { ensureOpenApiCredentials } = await import("./auth-AKQHOHID.js");
3545
3489
  const session = await ensureOpenApiCredentials({
3546
3490
  mcpUrl: input.mcpUrl,
3547
3491
  apiUrl: input.apiUrl,
3548
3492
  ...input.org ? { org: input.org } : {}
3549
3493
  });
3550
- const { callOpenApiOperation } = await import("./open-api-client-6L6KSSK6.js");
3494
+ const { callOpenApiOperation } = await import("./open-api-client-G2UW7AMN.js");
3551
3495
  return callOpenApiOperation({
3552
3496
  operationId: cliCredentialBootstrapOperationId,
3553
3497
  params,
@@ -3574,7 +3518,7 @@ async function accessTokenForOpenApi(input) {
3574
3518
  ...input.org ? { org: input.org } : {}
3575
3519
  });
3576
3520
  if (credential?.token) return credential.token;
3577
- const { ensureOpenApiCredentials } = await import("./auth-DWGWWITD.js");
3521
+ const { ensureOpenApiCredentials } = await import("./auth-AKQHOHID.js");
3578
3522
  const session = await ensureOpenApiCredentials({
3579
3523
  mcpUrl: input.mcpUrl,
3580
3524
  apiUrl: input.apiUrl,
@@ -3639,11 +3583,7 @@ function supersedeStoredApiTokenAfterLogin(apiUrl, deps = {}) {
3639
3583
  return envTokenNote;
3640
3584
  }
3641
3585
  if (!stored) return envTokenNote;
3642
- const label = describeCliCredential({
3643
- source: "stored-api-token",
3644
- token: stored.token,
3645
- stored
3646
- });
3586
+ const label = `old stored API token ${stored.tokenId}`;
3647
3587
  const scopes = stored.scopes?.join(", ") || "unknown";
3648
3588
  let deleted = false;
3649
3589
  try {
@@ -3652,10 +3592,10 @@ function supersedeStoredApiTokenAfterLogin(apiUrl, deps = {}) {
3652
3592
  deleted = false;
3653
3593
  }
3654
3594
  if (!deleted) {
3655
- 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.
3595
+ return `${envTokenNote}Note: could not remove the ${label} (scopes: ${scopes}). It is ignored: every command, including git, uses this login.
3656
3596
  `;
3657
3597
  }
3658
- 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)}\`.
3598
+ return `${envTokenNote}Removed the ${label} (scopes: ${scopes}); every command, including git, uses this login.
3659
3599
  `;
3660
3600
  }
3661
3601
 
@@ -3676,4 +3616,4 @@ export {
3676
3616
  resolvePackagePublishTarget,
3677
3617
  supersedeStoredApiTokenAfterLogin
3678
3618
  };
3679
- //# sourceMappingURL=chunk-ONR2NQSZ.js.map
3619
+ //# sourceMappingURL=chunk-DXPSBREX.js.map