@kodycodes/cli 1.26.3 → 1.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +175 -167
  2. package/dist/add-mcp-install.d.ts +1 -1
  3. package/dist/api-token.d.ts +1 -1
  4. package/dist/{auth-4FW6GCLG.js → auth-6ZE6QQXA.js} +13 -8
  5. package/dist/auth-bootstrap.d.ts +1 -1
  6. package/dist/auth.d.ts +27 -3
  7. package/dist/bin.js +18 -18
  8. package/dist/capability-proxy.d.ts +1 -1
  9. package/dist/{chunk-64XN367G.js → chunk-2EQJQJA3.js} +66 -44
  10. package/dist/chunk-2EQJQJA3.js.map +6 -0
  11. package/dist/{chunk-D55XPY3T.js → chunk-2IHISXHN.js} +58 -27
  12. package/dist/chunk-2IHISXHN.js.map +6 -0
  13. package/dist/{chunk-SMURF26I.js → chunk-2XPH7L2P.js} +1 -1
  14. package/dist/chunk-2XPH7L2P.js.map +6 -0
  15. package/dist/{chunk-RM34N3KI.js → chunk-3H72XY5R.js} +16 -6
  16. package/dist/chunk-3H72XY5R.js.map +6 -0
  17. package/dist/{chunk-G4YN6XP5.js → chunk-4GIFJVGT.js} +1 -1
  18. package/dist/chunk-4GIFJVGT.js.map +6 -0
  19. package/dist/{chunk-R4IUV5P5.js → chunk-5JIRHJQP.js} +397 -45
  20. package/dist/chunk-5JIRHJQP.js.map +6 -0
  21. package/dist/{chunk-TIL35OWA.js → chunk-5YQBD7PN.js} +238 -146
  22. package/dist/chunk-5YQBD7PN.js.map +6 -0
  23. package/dist/chunk-5ZBJAP6G.js +2005 -0
  24. package/dist/chunk-5ZBJAP6G.js.map +6 -0
  25. package/dist/{chunk-6XQP5SWX.js → chunk-6ZYUGXVW.js} +1 -1
  26. package/dist/chunk-6ZYUGXVW.js.map +6 -0
  27. package/dist/{chunk-OVGXPRSY.js → chunk-7PRJ36I5.js} +4 -1
  28. package/dist/{chunk-OVGXPRSY.js.map → chunk-7PRJ36I5.js.map} +1 -1
  29. package/dist/{chunk-IHP6PV6X.js → chunk-BTL3PJ2H.js} +1 -12
  30. package/dist/chunk-BTL3PJ2H.js.map +6 -0
  31. package/dist/{chunk-VQS5YSCI.js → chunk-CPS7HW4T.js} +8 -6
  32. package/dist/{chunk-VQS5YSCI.js.map → chunk-CPS7HW4T.js.map} +1 -1
  33. package/dist/{chunk-BISUL7CE.js → chunk-DW5UTJ6T.js} +14 -5
  34. package/dist/chunk-DW5UTJ6T.js.map +6 -0
  35. package/dist/{target-3QHY7JT4.js → chunk-EJXEVGWF.js} +8 -6
  36. package/dist/chunk-EJXEVGWF.js.map +6 -0
  37. package/dist/{chunk-SXHULGL4.js → chunk-JOMBXQOS.js} +18 -9
  38. package/dist/chunk-JOMBXQOS.js.map +6 -0
  39. package/dist/{chunk-EOCV74B2.js → chunk-OZDWOZLV.js} +41 -25
  40. package/dist/chunk-OZDWOZLV.js.map +6 -0
  41. package/dist/{chunk-75RZUXQL.js → chunk-SLNAWWQK.js} +4 -2
  42. package/dist/{chunk-75RZUXQL.js.map → chunk-SLNAWWQK.js.map} +1 -1
  43. package/dist/{chunk-XDCOWU5R.js → chunk-SPEP3DUT.js} +64 -14
  44. package/dist/chunk-SPEP3DUT.js.map +6 -0
  45. package/dist/{chunk-64IM6G4Z.js → chunk-TUUFQYWP.js} +13 -6
  46. package/dist/chunk-TUUFQYWP.js.map +6 -0
  47. package/dist/{chunk-QHBCP4OB.js → chunk-UW6AWLXX.js} +6 -7
  48. package/dist/chunk-W2SAFAT4.js +1563 -0
  49. package/dist/chunk-W2SAFAT4.js.map +6 -0
  50. package/dist/{chunk-XOPPGRUP.js → chunk-WMROAVLX.js} +14 -6
  51. package/dist/chunk-WMROAVLX.js.map +6 -0
  52. package/dist/{chunk-BPGY4IE7.js → chunk-XV6D6HSG.js} +1 -1
  53. package/dist/chunk-XV6D6HSG.js.map +6 -0
  54. package/dist/{chunk-PDWCKWQF.js → chunk-YDWTXEKQ.js} +26 -10
  55. package/dist/chunk-YDWTXEKQ.js.map +6 -0
  56. package/dist/{chunk-JWEFKKAD.js → chunk-ZILB2HWE.js} +1 -1
  57. package/dist/chunk-ZILB2HWE.js.map +6 -0
  58. package/dist/cli.js +19 -19
  59. package/dist/defaults.d.ts +1 -1
  60. package/dist/detect-running-hosts.d.ts +1 -1
  61. package/dist/dev/dev-assets.d.ts +1 -1
  62. package/dist/dev/dev-registry.d.ts +1 -1
  63. package/dist/dev/error-page.d.ts +1 -1
  64. package/dist/dev/live-reload.d.ts +2 -2
  65. package/dist/{dev-command-3LX234N6.js → dev-command-TZ2EB4J3.js} +236 -111
  66. package/dist/dev-command-TZ2EB4J3.js.map +6 -0
  67. package/dist/dev-command.d.ts +1 -1
  68. package/dist/discover-login-identity.d.ts +6 -7
  69. package/dist/discover-org.d.ts +2 -3
  70. package/dist/generated/openapi-routes.d.ts +6 -0
  71. package/dist/{git-credential-FUE3JE3T.js → git-credential-INB2UV4C.js} +32 -25
  72. package/dist/git-credential-INB2UV4C.js.map +6 -0
  73. package/dist/{install-ZML2TCDG.js → install-ONEJRYZ3.js} +147 -113
  74. package/dist/install-ONEJRYZ3.js.map +6 -0
  75. package/dist/install.d.ts +1 -1
  76. package/dist/{local-execute-SZV6XN4T.js → local-execute-YCXHVAVM.js} +81 -54
  77. package/dist/local-execute-YCXHVAVM.js.map +6 -0
  78. package/dist/local-execute-auth.d.ts +2 -2
  79. package/dist/local-execute.d.ts +1 -1
  80. package/dist/local-gateway-fetch-forward.d.ts +2 -2
  81. package/dist/local-package-run-WZVZAHK3.js +23 -0
  82. package/dist/local-package-run.d.ts +2 -2
  83. package/dist/mock/ensure-msw.d.ts +9 -1
  84. package/dist/mock/load-package-mocks.d.ts +1 -2
  85. package/dist/mock/mock-fetch-gateway.d.ts +4 -5
  86. package/dist/mock/mock-supported.d.ts +1 -1
  87. package/dist/{mock-dep-resolve-TVABDNR7.js → mock-dep-resolve-B5ZH4U3H.js} +14 -6
  88. package/dist/mock-dep-resolve-B5ZH4U3H.js.map +6 -0
  89. package/dist/{mock-fetch-gateway-B5TFGGQS.js → mock-fetch-gateway-FWVNTLP2.js} +7 -6
  90. package/dist/{mock-local-deps-5SZT3PWT.js → mock-local-deps-2VVNJLFF.js} +20 -17
  91. package/dist/mock-local-deps-2VVNJLFF.js.map +6 -0
  92. package/dist/mock-local-deps.d.ts +1 -1
  93. package/dist/{mock-server-SV2IKC4I.js → mock-server-6BWDQQBE.js} +8 -7
  94. package/dist/oauth-browser.d.ts +42 -0
  95. package/dist/oauth-provider.d.ts +14 -19
  96. package/dist/{open-api-client-DVVMLY7P.js → open-api-client-SR4B7265.js} +11 -10
  97. package/dist/open-api-client.d.ts +2 -1
  98. package/dist/{org-X7B5BI4R.js → org-535LB4PD.js} +8 -6
  99. package/dist/org-535LB4PD.js.map +6 -0
  100. package/dist/org-resolve.d.ts +2 -0
  101. package/dist/package-app-dev.d.ts +2 -2
  102. package/dist/{package-manifest-QH2RU64C.js → package-manifest-DFF6XCPV.js} +5 -4
  103. package/dist/{remote-execute-QMQDVHOY.js → remote-execute-JN6DRFEU.js} +49 -30
  104. package/dist/remote-execute-JN6DRFEU.js.map +6 -0
  105. package/dist/remote-execute.d.ts +3 -3
  106. package/dist/{setup-git-5KCUBYPB.js → setup-git-MHK563LB.js} +11 -12
  107. package/dist/setup-git.d.ts +1 -1
  108. package/dist/{skill-ENPATRIW.js → skill-D74XVI6T.js} +26 -8
  109. package/dist/skill-D74XVI6T.js.map +6 -0
  110. package/dist/{store-WTMRH527.js → store-27J4CQZ2.js} +4 -4
  111. package/dist/{structured-error-C65GQ53Z.js → structured-error-5MLWXYR3.js} +4 -3
  112. package/dist/structured-error.d.ts +1 -1
  113. package/dist/target-33ATHDUF.js +17 -0
  114. package/package.json +6 -5
  115. package/skills/kody/SKILL.md +53 -50
  116. package/dist/chunk-4D6ORNXY.js +0 -24404
  117. package/dist/chunk-4D6ORNXY.js.map +0 -6
  118. package/dist/chunk-64IM6G4Z.js.map +0 -6
  119. package/dist/chunk-64XN367G.js.map +0 -6
  120. package/dist/chunk-6XQP5SWX.js.map +0 -6
  121. package/dist/chunk-BISUL7CE.js.map +0 -6
  122. package/dist/chunk-BPGY4IE7.js.map +0 -6
  123. package/dist/chunk-D55XPY3T.js.map +0 -6
  124. package/dist/chunk-EOCV74B2.js.map +0 -6
  125. package/dist/chunk-FBVNFWR6.js +0 -437
  126. package/dist/chunk-FBVNFWR6.js.map +0 -6
  127. package/dist/chunk-G4YN6XP5.js.map +0 -6
  128. package/dist/chunk-G6LJWROP.js +0 -18
  129. package/dist/chunk-G6LJWROP.js.map +0 -6
  130. package/dist/chunk-IHP6PV6X.js.map +0 -6
  131. package/dist/chunk-JWEFKKAD.js.map +0 -6
  132. package/dist/chunk-LWNB26KO.js +0 -147
  133. package/dist/chunk-LWNB26KO.js.map +0 -6
  134. package/dist/chunk-PDWCKWQF.js.map +0 -6
  135. package/dist/chunk-R4IUV5P5.js.map +0 -6
  136. package/dist/chunk-RM34N3KI.js.map +0 -6
  137. package/dist/chunk-RTWUNV76.js +0 -309
  138. package/dist/chunk-RTWUNV76.js.map +0 -6
  139. package/dist/chunk-SMURF26I.js.map +0 -6
  140. package/dist/chunk-SXHULGL4.js.map +0 -6
  141. package/dist/chunk-TIL35OWA.js.map +0 -6
  142. package/dist/chunk-XDCOWU5R.js.map +0 -6
  143. package/dist/chunk-XOPPGRUP.js.map +0 -6
  144. package/dist/dev-command-3LX234N6.js.map +0 -6
  145. package/dist/git-credential-FUE3JE3T.js.map +0 -6
  146. package/dist/install-ZML2TCDG.js.map +0 -6
  147. package/dist/local-execute-SZV6XN4T.js.map +0 -6
  148. package/dist/local-package-run-2TMCAZZ2.js +0 -23
  149. package/dist/mcp-G2AWTIXR.js +0 -21
  150. package/dist/mcp.d.ts +0 -34
  151. package/dist/mock-dep-resolve-TVABDNR7.js.map +0 -6
  152. package/dist/mock-local-deps-5SZT3PWT.js.map +0 -6
  153. package/dist/org-X7B5BI4R.js.map +0 -6
  154. package/dist/remote-execute-QMQDVHOY.js.map +0 -6
  155. package/dist/skill-ENPATRIW.js.map +0 -6
  156. package/dist/target-3QHY7JT4.js.map +0 -6
  157. package/dist/webapi-NTVP4BO3.js +0 -2482
  158. package/dist/webapi-NTVP4BO3.js.map +0 -6
  159. /package/dist/{auth-4FW6GCLG.js.map → auth-6ZE6QQXA.js.map} +0 -0
  160. /package/dist/{chunk-QHBCP4OB.js.map → chunk-UW6AWLXX.js.map} +0 -0
  161. /package/dist/{local-package-run-2TMCAZZ2.js.map → local-package-run-WZVZAHK3.js.map} +0 -0
  162. /package/dist/{mcp-G2AWTIXR.js.map → mock-fetch-gateway-FWVNTLP2.js.map} +0 -0
  163. /package/dist/{mock-fetch-gateway-B5TFGGQS.js.map → mock-server-6BWDQQBE.js.map} +0 -0
  164. /package/dist/{mock-server-SV2IKC4I.js.map → open-api-client-SR4B7265.js.map} +0 -0
  165. /package/dist/{open-api-client-DVVMLY7P.js.map → package-manifest-DFF6XCPV.js.map} +0 -0
  166. /package/dist/{package-manifest-QH2RU64C.js.map → setup-git-MHK563LB.js.map} +0 -0
  167. /package/dist/{setup-git-5KCUBYPB.js.map → store-27J4CQZ2.js.map} +0 -0
  168. /package/dist/{store-WTMRH527.js.map → structured-error-5MLWXYR3.js.map} +0 -0
  169. /package/dist/{structured-error-C65GQ53Z.js.map → target-33ATHDUF.js.map} +0 -0
@@ -1,16 +1,18 @@
1
1
  ---
2
2
  name: kody
3
3
  description: >
4
- Install Kody as a remote MCP server, then use `search` / MCP tools and
5
- prefer `kody execute --local` when the CLI and Node are available. Use
6
- when the user mentions Kody, kody.codes, durable agent tasks, or wants
7
- to search/execute via Kody.
4
+ Install Kody as a remote MCP server, then use `search` / MCP tools and prefer
5
+ `kody execute --local` when the CLI and Node are available. Use when the user
6
+ mentions Kody, kody.codes, durable agent tasks, or wants to search/execute via
7
+ Kody.
8
8
  ---
9
9
 
10
10
  # Kody
11
11
 
12
12
  Kody is a remote MCP personal assistant. Install it as an MCP server in this
13
- agent for `search`, `api`, and discovery. Prefer local CLI execute when Node ≥22 and `@kodycodes/cli` are available. Use MCP / hosted paths when the CLI or Node cannot run.
13
+ agent for `search`, `api`, and discovery. Prefer local CLI execute when Node ≥22
14
+ and `@kodycodes/cli` are available. Use MCP / hosted paths when the CLI or Node
15
+ cannot run.
14
16
 
15
17
  `@kodycodes/cli` installs host MCP config and runs local execute against real
16
18
  secrets while keeping `kody:runtime` hops on CapabilityProxy.
@@ -21,9 +23,9 @@ secrets while keeping `kody:runtime` hops on CapabilityProxy.
21
23
  npx @kodycodes/cli install
22
24
  ```
23
25
 
24
- That command lists **running local** agents and writes each host's remote
25
- MCP entry for `https://kody.codes/mcp`. Host OAuth stays in that client —
26
- do not run `kody login` for the host connection.
26
+ That command lists **running local** agents and writes each host's remote MCP
27
+ entry for `https://kody.codes/mcp`. Host OAuth stays in that client — do not run
28
+ `kody login` for the host connection.
27
29
 
28
30
  After install, use the Kody MCP tools in this agent for discovery and Open API:
29
31
 
@@ -31,11 +33,11 @@ After install, use the Kody MCP tools in this agent for discovery and Open API:
31
33
  - `api` — call one Open API operation directly (no sandbox)
32
34
  - Prefer `search` before composing work
33
35
 
34
- For one-off modules, smoke tests, and composition: when Node ≥22 and the CLI
35
- are available, prefer `npx @kodycodes/cli execute --local` (see
36
- [Local CLI execute](https://kody.codes/docs/local-execute)). If `--local`
37
- cannot run, use Open API / MCP `api`, or fix the environment — do **not** use
38
- hosted MCP `execute` for agent work when a local or Open API path exists.
36
+ For one-off modules, smoke tests, and composition: when Node ≥22 and the CLI are
37
+ available, prefer `npx @kodycodes/cli execute --local` (see
38
+ [Local CLI execute](https://kody.codes/docs/local-execute)). If `--local` cannot
39
+ run, use Open API / MCP `api`, or fix the environment — do **not** use hosted
40
+ MCP `execute` for agent work when a local or Open API path exists.
39
41
 
40
42
  For web-based clients (ChatGPT, Claude.ai, Grok), point the user at
41
43
  https://kody.codes/onboarding.
@@ -61,12 +63,11 @@ kody whoami
61
63
  kody logout
62
64
  ```
63
65
 
64
- The CLI opens a browser for Kody OAuth (PKCE + Client ID Metadata Documents).
65
- If a browser cannot open, it prints the URL. Tokens (access + refresh) are
66
- stored in the OS keychain on macOS, Windows, and Linux (Secret Service).
67
- Linux without Secret Service — including headless machines that only have an
68
- in-memory kernel keyring — falls back to a `0600` file under
69
- `$XDG_CONFIG_HOME/kody`.
66
+ The CLI opens a browser for Kody OAuth (PKCE + Client ID Metadata Documents). If
67
+ a browser cannot open, it prints the URL. Tokens (access + refresh) are stored
68
+ in the OS keychain on macOS, Windows, and Linux (Secret Service). Linux without
69
+ Secret Service — including headless machines that only have an in-memory kernel
70
+ keyring — falls back to a `0600` file under `$XDG_CONFIG_HOME/kody`.
70
71
 
71
72
  Never ask the user to paste tokens into chat.
72
73
 
@@ -80,45 +81,47 @@ machine instead (Node.js 22 or newer; older Node fails before workerd starts).
80
81
  Modules with static `kody:@…` imports keep `--local`: the CLI fetches stamped
81
82
  package modules via `POST /v1/local-execute/package-graph` and embeds them in
82
83
  local workerd (CapabilityProxy only for per-call `kody:runtime` hops — not a
83
- whole-module cloud defer). If that package-graph API is missing, `--local`
84
- fails clearly rather than silently billing a remote execute. `--file`
85
- entries are bundled (relative imports and npm packages; `kody:*` external)
86
- before workerd loads them, matching hosted execute / publish.
87
- `--code` and stdin are not rewritten.
84
+ whole-module cloud defer). If that package-graph API is missing, `--local` fails
85
+ clearly rather than silently billing a remote execute. `--file` entries are
86
+ bundled (relative imports and npm packages; `kody:*` external) before workerd
87
+ loads them, matching hosted execute / publish. `--code` and stdin are not
88
+ rewritten.
88
89
 
89
90
  For `execute --local` auth: `--token` / `KODY_API_TOKEN` wins when set;
90
91
  otherwise a stored token from `kody auth bootstrap --code` (after MCP
91
- `cliCredentialBootstrap`); otherwise a valid `kody login` session (OAuth
92
- access token as Bearer only when the API and MCP URLs are paired — never print
93
- it, never mint via `tokenCreate` under the hood). The default pair is
94
- `https://api.kody.codes` and `https://kody.codes/mcp`; preview workers pair
95
- when the API worker name adds `-api`, and loopback hosts pair at any port.
96
- For another API origin, use `auth bootstrap --api-url <origin>` or set
92
+ `cliCredentialBootstrap`); otherwise a valid `kody login` session (OAuth access
93
+ token as Bearer only when the API and MCP URLs are paired — never print it,
94
+ never mint via `tokenCreate` under the hood). The default pair is
95
+ `https://api.kody.codes` and `https://kody.codes/mcp`; preview workers pair when
96
+ the API worker name adds `-api`, and loopback hosts pair at any port. For
97
+ another API origin, use `auth bootstrap --api-url <origin>` or set
97
98
  `KODY_API_TOKEN`. A PR preview's API host is
98
99
  `https://kody-pr-<n>-api.<subdomain>.workers.dev`, not the app origin
99
- `kody-pr-<n>` (which 404s `/v1/*` with HTML). Prefer bootstrap over `tokenCreate` for agents already on
100
- MCP so `kody_at_…` never appears in chat. Until the Open API accepts MCP OAuth on
101
- CapabilityProxy / package-graph
102
- (https://github.com/kentcdodds/kody/issues/2812), use bootstrap or mint a
103
- scoped token with the MCP `api` tool `tokenCreate` — include `local-execute`
104
- plus the capability scopes the module calls — and pass `--token` or
105
- `KODY_API_TOKEN`. If none of those are available, the CLI error says that
106
- (bootstrap → login → tokenCreate for CI). `insufficient_scope` names the
107
- missing scope and prints the exact command to mint a token that adds it:
100
+ `kody-pr-<n>` (which 404s `/v1/*` with HTML). Prefer bootstrap over
101
+ `tokenCreate` for agents already on MCP so `kody_at_…` never appears in chat.
102
+ Until the Open API accepts MCP OAuth on CapabilityProxy / package-graph
103
+ (https://github.com/kentcdodds/kody/issues/2812), use bootstrap or mint a scoped
104
+ token with the MCP `api` tool `tokenCreate` — include `local-execute` plus the
105
+ capability scopes the module calls — and pass `--token` or `KODY_API_TOKEN`. If
106
+ none of those are available, the CLI error says that (bootstrap → login →
107
+ tokenCreate for CI). `insufficient_scope` names the missing scope and prints the
108
+ exact command to mint a token that adds it:
108
109
  `npx @kodycodes/cli auth bootstrap --lifetime short|long --scopes <list>` after
109
- `kody login`, or `cliCredentialBootstrap({ lifetime: "short"|"long", scopes: [...] })`
110
- from MCP (hints preserve the current token's lifetime class when known).
111
- Default bootstrap scopes stay least-privilege (no `package:write`),
112
- and `--scopes` replaces them, so list every scope you need.
113
- Publish a package after `packageGetGitRemote` clone/push with
110
+ `kody login`, or
111
+ `cliCredentialBootstrap({ lifetime: "short"|"long", scopes: [...] })` from MCP
112
+ (hints preserve the current token's lifetime class when known). Default
113
+ bootstrap scopes stay least-privilege (no `package:write`), and `--scopes`
114
+ replaces them, so list every scope you need. Publish a package after
115
+ `packageGetGitRemote` clone/push with
114
116
  `kody package publish <@owner/leaf|package_id>` (thin
115
- `packagePublishExternalPush` wrapper; same auth as `kody api`).
116
- See and change who can use a package (teams and org members of the `--org`
117
- org) with `kody package collaborators <package>`,
117
+ `packagePublishExternalPush` wrapper; same auth as `kody api`). See and change
118
+ who can use a package (teams and org members of the `--org` org) with
119
+ `kody package collaborators <package>`,
118
120
  `kody package grant <package> --team <slug>|--user <username> --preset use|contribute|manage`,
119
- and `kody package revoke <package> --team <slug>|--user <username>|--grant <id>`.
120
- These need a token with `package:manage_access`.
121
- `feature_disabled` means the account `local-execute` flag is off. Never read MCP OAuth tokens from the host.
121
+ and
122
+ `kody package revoke <package> --team <slug>|--user <username>|--grant <id>`.
123
+ These need a token with `package:manage_access`. `feature_disabled` means the
124
+ account `local-execute` flag is off. Never read MCP OAuth tokens from the host.
122
125
 
123
126
  ```bash
124
127
  # Agents on MCP: