@kodycodes/cli 1.26.2 → 1.27.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 (296) 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-6ZE6QQXA.js +31 -0
  5. package/dist/auth-6ZE6QQXA.js.map +6 -0
  6. package/dist/auth-bootstrap.d.ts +1 -1
  7. package/dist/auth.d.ts +27 -3
  8. package/dist/bin.js +27 -3
  9. package/dist/bin.js.map +6 -1
  10. package/dist/capability-proxy.d.ts +1 -1
  11. package/dist/chunk-2IHISXHN.js +1413 -0
  12. package/dist/chunk-2IHISXHN.js.map +6 -0
  13. package/dist/chunk-2XPH7L2P.js +23 -0
  14. package/dist/chunk-2XPH7L2P.js.map +6 -0
  15. package/dist/chunk-3H72XY5R.js +535 -0
  16. package/dist/chunk-3H72XY5R.js.map +6 -0
  17. package/dist/chunk-46IJPEID.js +30 -0
  18. package/dist/chunk-46IJPEID.js.map +6 -0
  19. package/dist/chunk-4GIFJVGT.js +14 -0
  20. package/dist/chunk-4GIFJVGT.js.map +6 -0
  21. package/dist/chunk-5JIRHJQP.js +1016 -0
  22. package/dist/chunk-5JIRHJQP.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-6ZYUGXVW.js +26 -0
  26. package/dist/chunk-6ZYUGXVW.js.map +6 -0
  27. package/dist/chunk-7PRJ36I5.js +23 -0
  28. package/dist/chunk-7PRJ36I5.js.map +6 -0
  29. package/dist/chunk-BTL3PJ2H.js +38 -0
  30. package/dist/chunk-BTL3PJ2H.js.map +6 -0
  31. package/dist/chunk-CASGRYOF.js +21 -0
  32. package/dist/chunk-CASGRYOF.js.map +6 -0
  33. package/dist/chunk-CPS7HW4T.js +56 -0
  34. package/dist/chunk-CPS7HW4T.js.map +6 -0
  35. package/dist/chunk-CWWHR4FH.js +19 -0
  36. package/dist/chunk-CWWHR4FH.js.map +6 -0
  37. package/dist/chunk-D366STO5.js +2051 -0
  38. package/dist/chunk-D366STO5.js.map +6 -0
  39. package/dist/chunk-DW5UTJ6T.js +115 -0
  40. package/dist/chunk-DW5UTJ6T.js.map +6 -0
  41. package/dist/chunk-EJXEVGWF.js +47 -0
  42. package/dist/chunk-EJXEVGWF.js.map +6 -0
  43. package/dist/chunk-FBEZ6PZ7.js +746 -0
  44. package/dist/chunk-FBEZ6PZ7.js.map +6 -0
  45. package/dist/chunk-JOMBXQOS.js +435 -0
  46. package/dist/chunk-JOMBXQOS.js.map +6 -0
  47. package/dist/{package-local-runtime-source.js → chunk-LU7I7CQ4.js} +395 -52
  48. package/dist/chunk-LU7I7CQ4.js.map +6 -0
  49. package/dist/chunk-OZDWOZLV.js +964 -0
  50. package/dist/chunk-OZDWOZLV.js.map +6 -0
  51. package/dist/chunk-SLNAWWQK.js +64 -0
  52. package/dist/chunk-SLNAWWQK.js.map +6 -0
  53. package/dist/chunk-TUUFQYWP.js +348 -0
  54. package/dist/chunk-TUUFQYWP.js.map +6 -0
  55. package/dist/chunk-UW6AWLXX.js +43 -0
  56. package/dist/chunk-UW6AWLXX.js.map +6 -0
  57. package/dist/chunk-W2SAFAT4.js +1563 -0
  58. package/dist/chunk-W2SAFAT4.js.map +6 -0
  59. package/dist/chunk-XV6D6HSG.js +57 -0
  60. package/dist/chunk-XV6D6HSG.js.map +6 -0
  61. package/dist/chunk-Y4FOJETX.js +616 -0
  62. package/dist/chunk-Y4FOJETX.js.map +6 -0
  63. package/dist/chunk-YDWTXEKQ.js +469 -0
  64. package/dist/chunk-YDWTXEKQ.js.map +6 -0
  65. package/dist/chunk-ZILB2HWE.js +24 -0
  66. package/dist/chunk-ZILB2HWE.js.map +6 -0
  67. package/dist/cli.js +74 -1500
  68. package/dist/cli.js.map +6 -1
  69. package/dist/defaults.d.ts +1 -1
  70. package/dist/detect-running-hosts.d.ts +1 -1
  71. package/dist/dev/dev-assets.d.ts +1 -1
  72. package/dist/dev/dev-registry.d.ts +1 -1
  73. package/dist/dev/error-page.d.ts +1 -1
  74. package/dist/dev/live-reload.d.ts +2 -2
  75. package/dist/dev-command-5PDEIWOC.js +5025 -0
  76. package/dist/dev-command-5PDEIWOC.js.map +6 -0
  77. package/dist/dev-command.d.ts +1 -1
  78. package/dist/discover-login-identity.d.ts +6 -7
  79. package/dist/discover-org.d.ts +2 -3
  80. package/dist/generated/openapi-routes.d.ts +6 -0
  81. package/dist/git-credential-INB2UV4C.js +170 -0
  82. package/dist/git-credential-INB2UV4C.js.map +6 -0
  83. package/dist/install-ONEJRYZ3.js +10728 -0
  84. package/dist/install-ONEJRYZ3.js.map +6 -0
  85. package/dist/install.d.ts +1 -1
  86. package/dist/local-execute-I3BP5NEQ.js +395 -0
  87. package/dist/local-execute-I3BP5NEQ.js.map +6 -0
  88. package/dist/local-execute-auth.d.ts +2 -2
  89. package/dist/local-execute.d.ts +1 -1
  90. package/dist/local-gateway-fetch-forward.d.ts +2 -2
  91. package/dist/local-package-run-JFKNSNWM.js +23 -0
  92. package/dist/local-package-run-JFKNSNWM.js.map +6 -0
  93. package/dist/local-package-run.d.ts +2 -2
  94. package/dist/mock/mock-fetch-gateway.d.ts +2 -2
  95. package/dist/mock/mock-supported.d.ts +1 -1
  96. package/dist/mock-dep-resolve-B5ZH4U3H.js +60 -0
  97. package/dist/mock-dep-resolve-B5ZH4U3H.js.map +6 -0
  98. package/dist/mock-fetch-gateway-S2ULVFAI.js +35 -0
  99. package/dist/mock-fetch-gateway-S2ULVFAI.js.map +6 -0
  100. package/dist/mock-local-deps-2VVNJLFF.js +200 -0
  101. package/dist/mock-local-deps-2VVNJLFF.js.map +6 -0
  102. package/dist/mock-local-deps.d.ts +1 -1
  103. package/dist/mock-server-TFO7Q26H.js +22 -0
  104. package/dist/mock-server-TFO7Q26H.js.map +6 -0
  105. package/dist/oauth-browser.d.ts +42 -0
  106. package/dist/oauth-provider.d.ts +14 -19
  107. package/dist/open-api-client-SR4B7265.js +43 -0
  108. package/dist/open-api-client-SR4B7265.js.map +6 -0
  109. package/dist/open-api-client.d.ts +2 -1
  110. package/dist/org-535LB4PD.js +134 -0
  111. package/dist/org-535LB4PD.js.map +6 -0
  112. package/dist/org-resolve.d.ts +2 -0
  113. package/dist/package-app-dev.d.ts +2 -2
  114. package/dist/package-manifest-DFF6XCPV.js +15 -0
  115. package/dist/package-manifest-DFF6XCPV.js.map +6 -0
  116. package/dist/remote-execute-JN6DRFEU.js +129 -0
  117. package/dist/remote-execute-JN6DRFEU.js.map +6 -0
  118. package/dist/remote-execute.d.ts +3 -3
  119. package/dist/setup-git-MHK563LB.js +87 -0
  120. package/dist/setup-git-MHK563LB.js.map +6 -0
  121. package/dist/setup-git.d.ts +1 -1
  122. package/dist/skill-D74XVI6T.js +61 -0
  123. package/dist/skill-D74XVI6T.js.map +6 -0
  124. package/dist/store-27J4CQZ2.js +48 -0
  125. package/dist/store-27J4CQZ2.js.map +6 -0
  126. package/dist/structured-error-5MLWXYR3.js +14 -0
  127. package/dist/structured-error-5MLWXYR3.js.map +6 -0
  128. package/dist/structured-error.d.ts +1 -1
  129. package/dist/target-33ATHDUF.js +17 -0
  130. package/dist/target-33ATHDUF.js.map +6 -0
  131. package/package.json +12 -11
  132. package/skills/kody/SKILL.md +53 -50
  133. package/dist/add-mcp-install.js +0 -59
  134. package/dist/add-mcp-install.js.map +0 -1
  135. package/dist/api-token-store.js +0 -120
  136. package/dist/api-token-store.js.map +0 -1
  137. package/dist/api-token.js +0 -238
  138. package/dist/api-token.js.map +0 -1
  139. package/dist/auth-bootstrap.js +0 -373
  140. package/dist/auth-bootstrap.js.map +0 -1
  141. package/dist/auth.js +0 -386
  142. package/dist/auth.js.map +0 -1
  143. package/dist/capability-proxy.js +0 -527
  144. package/dist/capability-proxy.js.map +0 -1
  145. package/dist/credential-call-map.js +0 -155
  146. package/dist/credential-call-map.js.map +0 -1
  147. package/dist/credential-client-runtime-source.js +0 -9
  148. package/dist/credential-client-runtime-source.js.map +0 -1
  149. package/dist/credentialed-fetch-scan.js +0 -98
  150. package/dist/credentialed-fetch-scan.js.map +0 -1
  151. package/dist/defaults.js +0 -34
  152. package/dist/defaults.js.map +0 -1
  153. package/dist/detect-running-hosts.js +0 -13
  154. package/dist/detect-running-hosts.js.map +0 -1
  155. package/dist/dev/dev-assets.js +0 -202
  156. package/dist/dev/dev-assets.js.map +0 -1
  157. package/dist/dev/dev-bundler.js +0 -65
  158. package/dist/dev/dev-bundler.js.map +0 -1
  159. package/dist/dev/dev-events.js +0 -94
  160. package/dist/dev/dev-events.js.map +0 -1
  161. package/dist/dev/dev-port.js +0 -80
  162. package/dist/dev/dev-port.js.map +0 -1
  163. package/dist/dev/dev-protocol.js +0 -14
  164. package/dist/dev/dev-protocol.js.map +0 -1
  165. package/dist/dev/dev-registry.js +0 -95
  166. package/dist/dev/dev-registry.js.map +0 -1
  167. package/dist/dev/dev-watcher.js +0 -162
  168. package/dist/dev/dev-watcher.js.map +0 -1
  169. package/dist/dev/error-page.js +0 -64
  170. package/dist/dev/error-page.js.map +0 -1
  171. package/dist/dev/live-reload.js +0 -151
  172. package/dist/dev/live-reload.js.map +0 -1
  173. package/dist/dev/prebuild.js +0 -102
  174. package/dist/dev/prebuild.js.map +0 -1
  175. package/dist/dev/process-reaper.js +0 -151
  176. package/dist/dev/process-reaper.js.map +0 -1
  177. package/dist/dev/stack-trace.js +0 -56
  178. package/dist/dev/stack-trace.js.map +0 -1
  179. package/dist/dev/workerd-process.js +0 -118
  180. package/dist/dev/workerd-process.js.map +0 -1
  181. package/dist/dev-command.js +0 -676
  182. package/dist/dev-command.js.map +0 -1
  183. package/dist/discover-login-identity.js +0 -77
  184. package/dist/discover-login-identity.js.map +0 -1
  185. package/dist/discover-org.js +0 -62
  186. package/dist/discover-org.js.map +0 -1
  187. package/dist/git-credential.js +0 -147
  188. package/dist/git-credential.js.map +0 -1
  189. package/dist/help.js +0 -333
  190. package/dist/help.js.map +0 -1
  191. package/dist/host-catalog.js +0 -427
  192. package/dist/host-catalog.js.map +0 -1
  193. package/dist/host-config.js +0 -80
  194. package/dist/host-config.js.map +0 -1
  195. package/dist/http-error-body.js +0 -35
  196. package/dist/http-error-body.js.map +0 -1
  197. package/dist/install-hosts.js +0 -328
  198. package/dist/install-hosts.js.map +0 -1
  199. package/dist/install.js +0 -120
  200. package/dist/install.js.map +0 -1
  201. package/dist/invoke-passthrough.js +0 -60
  202. package/dist/invoke-passthrough.js.map +0 -1
  203. package/dist/local-bundle.js +0 -200
  204. package/dist/local-bundle.js.map +0 -1
  205. package/dist/local-execute-auth.js +0 -53
  206. package/dist/local-execute-auth.js.map +0 -1
  207. package/dist/local-execute.js +0 -338
  208. package/dist/local-execute.js.map +0 -1
  209. package/dist/local-gateway-fetch-forward.js +0 -135
  210. package/dist/local-gateway-fetch-forward.js.map +0 -1
  211. package/dist/local-host-runtime-surface.js +0 -75
  212. package/dist/local-host-runtime-surface.js.map +0 -1
  213. package/dist/local-package-graph.js +0 -405
  214. package/dist/local-package-graph.js.map +0 -1
  215. package/dist/local-package-run.js +0 -307
  216. package/dist/local-package-run.js.map +0 -1
  217. package/dist/local-runtime-bridge.js +0 -132
  218. package/dist/local-runtime-bridge.js.map +0 -1
  219. package/dist/local-runtime-source.js +0 -541
  220. package/dist/local-runtime-source.js.map +0 -1
  221. package/dist/login-callback-assets.js +0 -10
  222. package/dist/login-callback-assets.js.map +0 -1
  223. package/dist/login-callback-page.js +0 -362
  224. package/dist/login-callback-page.js.map +0 -1
  225. package/dist/mcp.d.ts +0 -34
  226. package/dist/mcp.js +0 -134
  227. package/dist/mcp.js.map +0 -1
  228. package/dist/mock/ensure-msw.js +0 -215
  229. package/dist/mock/ensure-msw.js.map +0 -1
  230. package/dist/mock/install-mock-fetch-shim.js +0 -36
  231. package/dist/mock/install-mock-fetch-shim.js.map +0 -1
  232. package/dist/mock/load-package-mocks.js +0 -136
  233. package/dist/mock/load-package-mocks.js.map +0 -1
  234. package/dist/mock/mock-fetch-gateway.js +0 -343
  235. package/dist/mock/mock-fetch-gateway.js.map +0 -1
  236. package/dist/mock/mock-gateway-fetch-shim.js +0 -104
  237. package/dist/mock/mock-gateway-fetch-shim.js.map +0 -1
  238. package/dist/mock/mock-server.js +0 -499
  239. package/dist/mock/mock-server.js.map +0 -1
  240. package/dist/mock/mock-storage.js +0 -186
  241. package/dist/mock/mock-storage.js.map +0 -1
  242. package/dist/mock/mock-supported.js +0 -63
  243. package/dist/mock/mock-supported.js.map +0 -1
  244. package/dist/mock-dep-resolve.js +0 -47
  245. package/dist/mock-dep-resolve.js.map +0 -1
  246. package/dist/mock-local-deps.js +0 -207
  247. package/dist/mock-local-deps.js.map +0 -1
  248. package/dist/network-error.js +0 -11
  249. package/dist/network-error.js.map +0 -1
  250. package/dist/node-engine.js +0 -21
  251. package/dist/node-engine.js.map +0 -1
  252. package/dist/oauth-provider.js +0 -107
  253. package/dist/oauth-provider.js.map +0 -1
  254. package/dist/onboarding-prompt.js +0 -15
  255. package/dist/onboarding-prompt.js.map +0 -1
  256. package/dist/open-api-client.js +0 -432
  257. package/dist/open-api-client.js.map +0 -1
  258. package/dist/open-url.js +0 -21
  259. package/dist/open-url.js.map +0 -1
  260. package/dist/org-resolve.js +0 -16
  261. package/dist/org-resolve.js.map +0 -1
  262. package/dist/org-slug.js +0 -11
  263. package/dist/org-slug.js.map +0 -1
  264. package/dist/org.js +0 -100
  265. package/dist/org.js.map +0 -1
  266. package/dist/package-app-dev.js +0 -922
  267. package/dist/package-app-dev.js.map +0 -1
  268. package/dist/package-collaborators.js +0 -179
  269. package/dist/package-collaborators.js.map +0 -1
  270. package/dist/package-info.js +0 -19
  271. package/dist/package-info.js.map +0 -1
  272. package/dist/package-local-runtime-source.js.map +0 -1
  273. package/dist/package-manifest.js +0 -364
  274. package/dist/package-manifest.js.map +0 -1
  275. package/dist/process-info.js +0 -14
  276. package/dist/process-info.js.map +0 -1
  277. package/dist/redact.js +0 -16
  278. package/dist/redact.js.map +0 -1
  279. package/dist/remote-execute.js +0 -108
  280. package/dist/remote-execute.js.map +0 -1
  281. package/dist/setup-git.js +0 -676
  282. package/dist/setup-git.js.map +0 -1
  283. package/dist/skill.js +0 -35
  284. package/dist/skill.js.map +0 -1
  285. package/dist/store.js +0 -597
  286. package/dist/store.js.map +0 -1
  287. package/dist/structured-error.js +0 -57
  288. package/dist/structured-error.js.map +0 -1
  289. package/dist/target.js +0 -52
  290. package/dist/target.js.map +0 -1
  291. package/dist/tool-result.js +0 -19
  292. package/dist/tool-result.js.map +0 -1
  293. package/dist/which.js +0 -22
  294. package/dist/which.js.map +0 -1
  295. package/dist/workerd-binary.js +0 -98
  296. package/dist/workerd-binary.js.map +0 -1
@@ -0,0 +1,129 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ resolveExecuteInvokeCode
4
+ } from "./chunk-SLNAWWQK.js";
5
+ import {
6
+ openApiRequest
7
+ } from "./chunk-W2SAFAT4.js";
8
+ import "./chunk-46IJPEID.js";
9
+ import "./chunk-DW5UTJ6T.js";
10
+ import {
11
+ assertTokenSafeApiUrl
12
+ } from "./chunk-5JIRHJQP.js";
13
+ import "./chunk-4GIFJVGT.js";
14
+ import "./chunk-3H72XY5R.js";
15
+ import "./chunk-BTL3PJ2H.js";
16
+ import "./chunk-UW6AWLXX.js";
17
+
18
+ // src/remote-execute.ts
19
+ var credentialFlagRequiresLocalOrMcpMessage = "--credential picks a credential for this run. Cloud execute sends it on POST /v1/execute. Use `execute --local --credential \u2026` when the module must run on this machine.";
20
+ async function runRemoteExecuteWithToken(input) {
21
+ assertTokenSafeApiUrl(input.apiUrl);
22
+ const invoke = input.invoke?.trim();
23
+ const body = {};
24
+ if (invoke) {
25
+ if (input.code?.trim()) {
26
+ throw new Error(
27
+ "--invoke cannot be combined with --code, --file, or a module string."
28
+ );
29
+ }
30
+ body.invoke = invoke;
31
+ } else {
32
+ body.code = resolveRemoteExecuteCode(input);
33
+ }
34
+ if (input.params !== void 0) body.params = input.params;
35
+ if (input.conversationId !== void 0)
36
+ body.conversationId = input.conversationId;
37
+ if (input.credentials !== void 0) body.credentials = input.credentials;
38
+ const payload = await openApiRequest({
39
+ token: input.token,
40
+ apiUrl: input.apiUrl,
41
+ fetchFn: input.fetchFn,
42
+ ...input.org ? { org: input.org } : {},
43
+ method: "POST",
44
+ path: "v1/execute",
45
+ body
46
+ });
47
+ return toolResultFromExecuteBody(payload);
48
+ }
49
+ function toolResultFromExecuteBody(payload) {
50
+ if (payload && typeof payload === "object" && !Array.isArray(payload) && "content" in payload && Array.isArray(payload.content)) {
51
+ const record = payload;
52
+ return {
53
+ content: record.content,
54
+ structuredContent: record.structuredContent,
55
+ isError: record.isError === true
56
+ };
57
+ }
58
+ return formatExecuteCapabilityResult(payload);
59
+ }
60
+ function resolveRemoteExecuteCode(input) {
61
+ const code = input.code?.trim() ? input.code : void 0;
62
+ const invoke = input.invoke?.trim() ? input.invoke : void 0;
63
+ if (code && invoke) {
64
+ throw new Error(
65
+ "--invoke cannot be combined with --code, --file, or a module string."
66
+ );
67
+ }
68
+ if (invoke) return resolveExecuteInvokeCode(invoke);
69
+ if (code) return code;
70
+ throw new Error("Provide --invoke, --code, --file, or a module string.");
71
+ }
72
+ function formatExecuteCapabilityResult(payload) {
73
+ const record = isRecord(payload) ? payload : null;
74
+ if (!record) {
75
+ const text2 = typeof payload === "string" ? payload : JSON.stringify(payload, null, 2) ?? "undefined";
76
+ return {
77
+ content: [{ type: "text", text: text2 }],
78
+ structuredContent: { result: payload },
79
+ isError: false
80
+ };
81
+ }
82
+ const ok = record.ok !== false && typeof record.error !== "string";
83
+ const conversationId = typeof record.conversationId === "string" ? record.conversationId : void 0;
84
+ const logs = Array.isArray(record.logs) ? record.logs : [];
85
+ const base = {
86
+ ...conversationId !== void 0 ? { conversationId } : {},
87
+ logs
88
+ };
89
+ for (const key of [
90
+ "timing",
91
+ "runId",
92
+ "replayed",
93
+ "inProgress",
94
+ "status",
95
+ "returnedBytes",
96
+ "truncated",
97
+ "note",
98
+ "errorDetails",
99
+ "entitlement",
100
+ "serverTiming"
101
+ ]) {
102
+ if (record[key] !== void 0) base[key] = record[key];
103
+ }
104
+ if (!ok) {
105
+ const error = typeof record.error === "string" ? record.error : "Execute failed without an error message.";
106
+ return {
107
+ content: [{ type: "text", text: `Error: ${error}` }],
108
+ structuredContent: { ...base, error, result: record.result },
109
+ isError: true
110
+ };
111
+ }
112
+ const result = record.result;
113
+ const text = typeof result === "string" ? result : JSON.stringify(result, null, 2) ?? "undefined";
114
+ return {
115
+ content: [{ type: "text", text }],
116
+ structuredContent: { ...base, result },
117
+ isError: false
118
+ };
119
+ }
120
+ function isRecord(value) {
121
+ return value !== null && typeof value === "object" && !Array.isArray(value);
122
+ }
123
+ export {
124
+ credentialFlagRequiresLocalOrMcpMessage,
125
+ formatExecuteCapabilityResult,
126
+ resolveRemoteExecuteCode,
127
+ runRemoteExecuteWithToken
128
+ };
129
+ //# sourceMappingURL=remote-execute-JN6DRFEU.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/remote-execute.ts"],
4
+ "mappings": "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",
5
+ "names": ["text"]
6
+ }
@@ -1,5 +1,5 @@
1
- import type { CredentialCallMapInput } from './credential-call-map.js';
2
- import type { ToolCallResult } from './tool-result.js';
1
+ import { type CredentialCallMapInput } from './credential-call-map.js';
2
+ import { type ToolCallResult } from './tool-result.js';
3
3
  export type RemoteExecuteInput = {
4
4
  code?: string;
5
5
  invoke?: string;
@@ -16,7 +16,7 @@ export type RemoteExecuteInput = {
16
16
  /** User-owned token org selection (`?org=`). */
17
17
  org?: string;
18
18
  };
19
- export declare const credentialFlagRequiresLocalOrMcpMessage = "--credential picks a credential for this run, but token-auth cloud execute goes through CapabilityProxy \u2192 kody.execute, which does not take a call map (package code must not pick by name). Use `execute --local --credential \u2026`, or omit --token / KODY_API_TOKEN and use a `kody login` MCP session so execute receives credentials.";
19
+ export declare const credentialFlagRequiresLocalOrMcpMessage = "--credential picks a credential for this run. Cloud execute sends it on POST /v1/execute. Use `execute --local --credential \u2026` when the module must run on this machine.";
20
20
  /**
21
21
  * Cloud (non-`--local`) execute authenticated only with a scoped API token:
22
22
  * CapabilityProxy session + `kody.execute`. The module runs in Kody's cloud
@@ -0,0 +1,87 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ apiTokenNeedsRefresh,
4
+ assertUserOwnedTokensLive,
5
+ authRemoveGit,
6
+ authSetupGit,
7
+ cliExactVersionForNpx,
8
+ cliMajorVersionForNpx,
9
+ cliTokenLifetimeAliases,
10
+ cliVersionGt,
11
+ cliVersionGte,
12
+ cliVersionSupportsGitCredential,
13
+ compareCliSemver,
14
+ decideSetupGitToken,
15
+ defaultGitConfigGetRunner,
16
+ defaultGitConfigRunner,
17
+ ensureSetupGitScopes,
18
+ exactNpxHelperVersion,
19
+ fetchTokenCurrentMetadata,
20
+ formatAuthRemoveGitReport,
21
+ gitApiTokenRefreshSkewMs,
22
+ gitCredentialHelperCommand,
23
+ gitCredentialHelperNeedsRepair,
24
+ gitCredentialHelperPinFallbackVersion,
25
+ gitCredentialHostFromMcpUrl,
26
+ gitCredentialMinCliVersion,
27
+ installGitCredentialConfig,
28
+ isEphemeralNpxEntryPath,
29
+ isKodyGitCredentialHelperValue,
30
+ isMajorOnlyNpxHelper,
31
+ parseCliSemver,
32
+ readCliPackageVersion,
33
+ readVersionFromKodyBinary,
34
+ refreshGitCredentialHelperPinIfNeeded,
35
+ scopesIncludeRequired,
36
+ setupGitConfigScopes,
37
+ setupGitDefaultScopes,
38
+ setupGitRequiredScopes
39
+ } from "./chunk-OZDWOZLV.js";
40
+ import "./chunk-6ZYUGXVW.js";
41
+ import "./chunk-W2SAFAT4.js";
42
+ import "./chunk-46IJPEID.js";
43
+ import "./chunk-DW5UTJ6T.js";
44
+ import "./chunk-5JIRHJQP.js";
45
+ import "./chunk-4GIFJVGT.js";
46
+ import "./chunk-3H72XY5R.js";
47
+ import "./chunk-BTL3PJ2H.js";
48
+ import "./chunk-UW6AWLXX.js";
49
+ export {
50
+ apiTokenNeedsRefresh,
51
+ assertUserOwnedTokensLive,
52
+ authRemoveGit,
53
+ authSetupGit,
54
+ cliExactVersionForNpx,
55
+ cliMajorVersionForNpx,
56
+ cliTokenLifetimeAliases,
57
+ cliVersionGt,
58
+ cliVersionGte,
59
+ cliVersionSupportsGitCredential,
60
+ compareCliSemver,
61
+ decideSetupGitToken,
62
+ defaultGitConfigGetRunner,
63
+ defaultGitConfigRunner,
64
+ ensureSetupGitScopes,
65
+ exactNpxHelperVersion,
66
+ fetchTokenCurrentMetadata,
67
+ formatAuthRemoveGitReport,
68
+ gitApiTokenRefreshSkewMs,
69
+ gitCredentialHelperCommand,
70
+ gitCredentialHelperNeedsRepair,
71
+ gitCredentialHelperPinFallbackVersion,
72
+ gitCredentialHostFromMcpUrl,
73
+ gitCredentialMinCliVersion,
74
+ installGitCredentialConfig,
75
+ isEphemeralNpxEntryPath,
76
+ isKodyGitCredentialHelperValue,
77
+ isMajorOnlyNpxHelper,
78
+ parseCliSemver,
79
+ readCliPackageVersion,
80
+ readVersionFromKodyBinary,
81
+ refreshGitCredentialHelperPinIfNeeded,
82
+ scopesIncludeRequired,
83
+ setupGitConfigScopes,
84
+ setupGitDefaultScopes,
85
+ setupGitRequiredScopes
86
+ };
87
+ //# sourceMappingURL=setup-git-MHK563LB.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
@@ -1,6 +1,6 @@
1
1
  import { cliTokenLifetimeAliases, type ResolvedCliTokenLifetime } from './auth-bootstrap.js';
2
2
  import { type StoredApiToken } from './api-token-store.js';
3
- import type { SecretBackend, StoreResolution } from './store.js';
3
+ import { type SecretBackend, type StoreResolution } from './store.js';
4
4
  import { which as whichOnPath } from './which.js';
5
5
  /** Scopes setup-git always requires for clone/fetch (+ push). */
6
6
  export declare const setupGitRequiredScopes: readonly ["package:read", "package:write"];
@@ -0,0 +1,61 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import "./chunk-UW6AWLXX.js";
3
+
4
+ // src/skill.ts
5
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
6
+ import { dirname, join } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+ import { homedir } from "node:os";
9
+ var skillRelativePath = "skills/kody/SKILL.md";
10
+ function bundledSkillPath() {
11
+ return join(fileURLToPath(new URL("../", import.meta.url)), skillRelativePath);
12
+ }
13
+ function userSkillTargets(home = homedir()) {
14
+ return [
15
+ {
16
+ host: "Claude Code",
17
+ path: join(home, ".claude", "skills", "kody", "SKILL.md")
18
+ },
19
+ {
20
+ host: "Cursor",
21
+ path: join(home, ".cursor", "skills", "kody", "SKILL.md")
22
+ },
23
+ {
24
+ host: "Agents",
25
+ path: join(home, ".agents", "skills", "kody", "SKILL.md")
26
+ }
27
+ ];
28
+ }
29
+ function projectSkillTargets(cwd = process.cwd()) {
30
+ return [
31
+ {
32
+ host: "Agents",
33
+ path: join(cwd, ".agents", "skills", "kody", "SKILL.md")
34
+ },
35
+ {
36
+ host: "Cursor",
37
+ path: join(cwd, ".cursor", "skills", "kody", "SKILL.md")
38
+ },
39
+ {
40
+ host: "Claude Code",
41
+ path: join(cwd, ".claude", "skills", "kody", "SKILL.md")
42
+ }
43
+ ];
44
+ }
45
+ async function installSkill(input) {
46
+ const source = input.sourcePath ?? bundledSkillPath();
47
+ const body = await readFile(source, "utf8");
48
+ const targets = input.project ? projectSkillTargets(input.cwd) : userSkillTargets(input.home);
49
+ for (const target of targets) {
50
+ await mkdir(dirname(target.path), { recursive: true });
51
+ await writeFile(target.path, body, "utf8");
52
+ }
53
+ return targets;
54
+ }
55
+ export {
56
+ bundledSkillPath,
57
+ installSkill,
58
+ projectSkillTargets,
59
+ userSkillTargets
60
+ };
61
+ //# sourceMappingURL=skill-D74XVI6T.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/skill.ts"],
4
+ "mappings": ";;;;AAAA,SAAS,OAAO,UAAU,iBAAiB;AAC3C,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AAExB,IAAM,oBAAoB;AAEnB,SAAS,mBAA2B;AAC1C,SAAO,KAAK,cAAc,IAAI,IAAI,OAAO,YAAY,GAAG,CAAC,GAAG,iBAAiB;AAC9E;AAEO,SAAS,iBAAiB,OAAe,QAAQ,GAGrD;AACF,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,MACN,MAAM,KAAK,MAAM,WAAW,UAAU,QAAQ,UAAU;AAAA,IACzD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,MAAM,KAAK,MAAM,WAAW,UAAU,QAAQ,UAAU;AAAA,IACzD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,MAAM,KAAK,MAAM,WAAW,UAAU,QAAQ,UAAU;AAAA,IACzD;AAAA,EACD;AACD;AAEO,SAAS,oBAAoB,MAAc,QAAQ,IAAI,GAG3D;AACF,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,MACN,MAAM,KAAK,KAAK,WAAW,UAAU,QAAQ,UAAU;AAAA,IACxD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,MAAM,KAAK,KAAK,WAAW,UAAU,QAAQ,UAAU;AAAA,IACxD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,MAAM,KAAK,KAAK,WAAW,UAAU,QAAQ,UAAU;AAAA,IACxD;AAAA,EACD;AACD;AAEA,eAAsB,aAAa,OAKgB;AAClD,QAAM,SAAS,MAAM,cAAc,iBAAiB;AACpD,QAAM,OAAO,MAAM,SAAS,QAAQ,MAAM;AAC1C,QAAM,UAAU,MAAM,UACnB,oBAAoB,MAAM,GAAG,IAC7B,iBAAiB,MAAM,IAAI;AAC9B,aAAW,UAAU,SAAS;AAC7B,UAAM,MAAM,QAAQ,OAAO,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;AACrD,UAAM,UAAU,OAAO,MAAM,MAAM,MAAM;AAAA,EAC1C;AACA,SAAO;AACR;",
5
+ "names": []
6
+ }
@@ -0,0 +1,48 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ accountForMcpUrl,
4
+ createFileBackend,
5
+ createKeyringBackend,
6
+ deleteCredentials,
7
+ fileStorePath,
8
+ listOrgSlugs,
9
+ listStoredOrgs,
10
+ loadCredentialStore,
11
+ loadCredentials,
12
+ loadPendingCredentials,
13
+ migrateV1ToMultiOrg,
14
+ parseCredentialStore,
15
+ parseCredentials,
16
+ pickCredentialsFromStore,
17
+ promotePendingOrg,
18
+ resolveBackend,
19
+ saveCredentialStore,
20
+ saveCredentials,
21
+ secretServiceKeyringOptions,
22
+ setActiveOrg
23
+ } from "./chunk-3H72XY5R.js";
24
+ import "./chunk-BTL3PJ2H.js";
25
+ import "./chunk-UW6AWLXX.js";
26
+ export {
27
+ accountForMcpUrl,
28
+ createFileBackend,
29
+ createKeyringBackend,
30
+ deleteCredentials,
31
+ fileStorePath,
32
+ listOrgSlugs,
33
+ listStoredOrgs,
34
+ loadCredentialStore,
35
+ loadCredentials,
36
+ loadPendingCredentials,
37
+ migrateV1ToMultiOrg,
38
+ parseCredentialStore,
39
+ parseCredentials,
40
+ pickCredentialsFromStore,
41
+ promotePendingOrg,
42
+ resolveBackend,
43
+ saveCredentialStore,
44
+ saveCredentials,
45
+ secretServiceKeyringOptions,
46
+ setActiveOrg
47
+ };
48
+ //# sourceMappingURL=store-27J4CQZ2.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
@@ -0,0 +1,14 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ StructuredCliError,
4
+ formatStructuredErrorMessage,
5
+ notImplementedInMock
6
+ } from "./chunk-XV6D6HSG.js";
7
+ import "./chunk-EJXEVGWF.js";
8
+ import "./chunk-UW6AWLXX.js";
9
+ export {
10
+ StructuredCliError,
11
+ formatStructuredErrorMessage,
12
+ notImplementedInMock
13
+ };
14
+ //# sourceMappingURL=structured-error-5MLWXYR3.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
@@ -2,7 +2,7 @@
2
2
  * Agent-facing structured errors for local testing (design 2026-10-13).
3
3
  * Stable `code`, optional `where` / `fix`, and which `target` produced it.
4
4
  */
5
- import type { KodyTarget } from './target.js';
5
+ import { type KodyTarget } from './target.js';
6
6
  export type StructuredErrorCode = 'not_implemented_in_mock' | 'unmocked_request' | 'unresolved_import' | 'missing_secret' | 'bundle_failed' | 'package_manifest_invalid' | 'dev_handler_missing' | 'dev_surface_missing' | 'invalid_target' | 'invalid_port' | 'dev_port_in_use' | 'dev_already_running';
7
7
  export type StructuredErrorBody = {
8
8
  code: StructuredErrorCode | string;
@@ -0,0 +1,17 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ commandAcceptsTarget,
4
+ defaultTargetFor,
5
+ parseTargetFlag,
6
+ resolveTarget,
7
+ targetEnvVar
8
+ } from "./chunk-EJXEVGWF.js";
9
+ import "./chunk-UW6AWLXX.js";
10
+ export {
11
+ commandAcceptsTarget,
12
+ defaultTargetFor,
13
+ parseTargetFlag,
14
+ resolveTarget,
15
+ targetEnvVar
16
+ };
17
+ //# sourceMappingURL=target-33ATHDUF.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kodycodes/cli",
3
- "version": "1.26.2",
4
- "description": "Official Kody MCP client CLI: login, secure token storage, search, and execute.",
3
+ "version": "1.27.0",
4
+ "description": "Official Kody CLI: login, secure token storage, search, and execute over the OpenAPI.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "kody": "dist/bin.js"
@@ -19,7 +19,7 @@
19
19
  "skills"
20
20
  ],
21
21
  "scripts": {
22
- "build": "tsc -p tsconfig.build.json",
22
+ "build": "node scripts/build.mjs && tsc -p tsconfig.build.json",
23
23
  "bench": "node scripts/bench.mjs",
24
24
  "typecheck": "tsc --noEmit",
25
25
  "test": "tsx --test test/*.test.ts",
@@ -38,28 +38,29 @@
38
38
  "license": "MIT",
39
39
  "repository": {
40
40
  "type": "git",
41
- "url": "git+https://github.com/kody-bot/cli.git"
41
+ "url": "git+https://github.com/kentcdodds/kody.git",
42
+ "directory": "packages/cli"
42
43
  },
43
44
  "bugs": {
44
- "url": "https://github.com/kody-bot/cli/issues"
45
+ "url": "https://github.com/kentcdodds/kody/issues"
45
46
  },
46
47
  "homepage": "https://kody.codes",
47
48
  "publishConfig": {
48
49
  "access": "public"
49
50
  },
50
51
  "dependencies": {
51
- "@inquirer/checkbox": "^5.2.2",
52
- "@jridgewell/trace-mapping": "^0.3.31",
53
- "@modelcontextprotocol/client": "2.0.0",
54
52
  "@napi-rs/keyring": "^2.1.0",
55
- "add-mcp": "^2.4.0",
56
- "chokidar": "^4.0.3",
57
- "es-module-lexer": "^3.0.3",
58
53
  "esbuild": "^0.25.12",
59
54
  "ps-list": "^9.0.0"
60
55
  },
61
56
  "devDependencies": {
57
+ "@inquirer/checkbox": "^5.2.2",
58
+ "@jridgewell/trace-mapping": "^0.3.31",
62
59
  "@types/node": "^24.5.2",
60
+ "oauth4webapi": "^3.8.6",
61
+ "add-mcp": "^2.4.0",
62
+ "chokidar": "^4.0.3",
63
+ "es-module-lexer": "^3.0.3",
63
64
  "msw": "3.0.3",
64
65
  "tsx": "^4.20.5",
65
66
  "typescript": "^5.9.2"
@@ -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: