@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
@@ -0,0 +1,1563 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ userCacheDir
4
+ } from "./chunk-DW5UTJ6T.js";
5
+ import {
6
+ assertTokenSafeApiUrl,
7
+ capabilityProxyUrl,
8
+ currentStoredTokenLifetimeAlias,
9
+ insufficientScopeMessage,
10
+ readInsufficientScopeDetails,
11
+ readPackageVersion
12
+ } from "./chunk-5JIRHJQP.js";
13
+ import {
14
+ describeNetworkError
15
+ } from "./chunk-4GIFJVGT.js";
16
+ import {
17
+ apiTokenEnvVar,
18
+ cliName,
19
+ defaultApiUrl
20
+ } from "./chunk-BTL3PJ2H.js";
21
+
22
+ // src/open-api-client.ts
23
+ import { createHash } from "node:crypto";
24
+ import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
25
+ import { join } from "node:path";
26
+
27
+ // src/generated/openapi-routes.ts
28
+ var bakedOpenApiRoutes = [
29
+ {
30
+ operationId: "accessGrant",
31
+ method: "POST",
32
+ pathTemplate: "/v1/access/grants",
33
+ pathParamNames: []
34
+ },
35
+ {
36
+ operationId: "accessList",
37
+ method: "GET",
38
+ pathTemplate: "/v1/access/grants",
39
+ pathParamNames: []
40
+ },
41
+ {
42
+ operationId: "accessRevoke",
43
+ method: "POST",
44
+ pathTemplate: "/v1/access/grants/{grant_id}/revoke",
45
+ pathParamNames: ["grant_id"]
46
+ },
47
+ {
48
+ operationId: "accountExportManifest",
49
+ method: "GET",
50
+ pathTemplate: "/v1/account/export",
51
+ pathParamNames: []
52
+ },
53
+ {
54
+ operationId: "accountExportSection",
55
+ method: "GET",
56
+ pathTemplate: "/v1/account/export/{section}",
57
+ pathParamNames: ["section"]
58
+ },
59
+ {
60
+ operationId: "approvalBundleCreate",
61
+ method: "POST",
62
+ pathTemplate: "/v1/approval-bundles",
63
+ pathParamNames: []
64
+ },
65
+ {
66
+ operationId: "approvalPendingList",
67
+ method: "GET",
68
+ pathTemplate: "/v1/approvals",
69
+ pathParamNames: []
70
+ },
71
+ {
72
+ operationId: "capabilityProxyCall",
73
+ method: "POST",
74
+ pathTemplate: "/v1/capability-proxy/call",
75
+ pathParamNames: []
76
+ },
77
+ {
78
+ operationId: "capabilityProxyGatewayFetch",
79
+ method: "POST",
80
+ pathTemplate: "/v1/capability-proxy/gateway-fetch",
81
+ pathParamNames: []
82
+ },
83
+ {
84
+ operationId: "capabilityProxySession",
85
+ method: "GET",
86
+ pathTemplate: "/v1/capability-proxy/session",
87
+ pathParamNames: []
88
+ },
89
+ {
90
+ operationId: "cliCredentialBootstrap",
91
+ method: "POST",
92
+ pathTemplate: "/v1/tokens/bootstrap",
93
+ pathParamNames: []
94
+ },
95
+ {
96
+ operationId: "cliCredentialBootstrapRedeem",
97
+ method: "POST",
98
+ pathTemplate: "/v1/tokens/bootstrap/redeem",
99
+ pathParamNames: []
100
+ },
101
+ {
102
+ operationId: "cliLoginDeviceToken",
103
+ method: "POST",
104
+ pathTemplate: "/v1/tokens/device",
105
+ pathParamNames: []
106
+ },
107
+ {
108
+ operationId: "communityFork",
109
+ method: "POST",
110
+ pathTemplate: "/v1/community/listings/{listing_id}/fork",
111
+ pathParamNames: ["listing_id"]
112
+ },
113
+ {
114
+ operationId: "communityForkAdopt",
115
+ method: "POST",
116
+ pathTemplate: "/v1/community/fork-adopt",
117
+ pathParamNames: []
118
+ },
119
+ {
120
+ operationId: "communityGet",
121
+ method: "GET",
122
+ pathTemplate: "/v1/community/listings/{listing_id}",
123
+ pathParamNames: ["listing_id"]
124
+ },
125
+ {
126
+ operationId: "communityProfileGet",
127
+ method: "GET",
128
+ pathTemplate: "/v1/community/profile",
129
+ pathParamNames: []
130
+ },
131
+ {
132
+ operationId: "communityProfileUpdate",
133
+ method: "PATCH",
134
+ pathTemplate: "/v1/community/profile",
135
+ pathParamNames: []
136
+ },
137
+ {
138
+ operationId: "communityPublish",
139
+ method: "POST",
140
+ pathTemplate: "/v1/community/listings",
141
+ pathParamNames: []
142
+ },
143
+ {
144
+ operationId: "communityRate",
145
+ method: "POST",
146
+ pathTemplate: "/v1/community/listings/{listing_id}/rate",
147
+ pathParamNames: ["listing_id"]
148
+ },
149
+ {
150
+ operationId: "communityReport",
151
+ method: "POST",
152
+ pathTemplate: "/v1/community/listings/{listing_id}/report",
153
+ pathParamNames: ["listing_id"]
154
+ },
155
+ {
156
+ operationId: "communitySearch",
157
+ method: "GET",
158
+ pathTemplate: "/v1/community/listings",
159
+ pathParamNames: []
160
+ },
161
+ {
162
+ operationId: "communityUnpublish",
163
+ method: "DELETE",
164
+ pathTemplate: "/v1/community/listings/{listing_id}",
165
+ pathParamNames: ["listing_id"]
166
+ },
167
+ {
168
+ operationId: "credentialList",
169
+ method: "GET",
170
+ pathTemplate: "/v1/credentials",
171
+ pathParamNames: []
172
+ },
173
+ {
174
+ operationId: "credentialMappingPropose",
175
+ method: "POST",
176
+ pathTemplate: "/v1/credential-proposals",
177
+ pathParamNames: []
178
+ },
179
+ {
180
+ operationId: "credentialOrgGrant",
181
+ method: "PUT",
182
+ pathTemplate: "/v1/personal-credential-grants/{credential_id}/{org}",
183
+ pathParamNames: ["credential_id", "org"]
184
+ },
185
+ {
186
+ operationId: "credentialOrgGrantList",
187
+ method: "GET",
188
+ pathTemplate: "/v1/personal-credential-grants",
189
+ pathParamNames: []
190
+ },
191
+ {
192
+ operationId: "credentialOrgRevoke",
193
+ method: "DELETE",
194
+ pathTemplate: "/v1/personal-credential-grants/{credential_id}/{org}",
195
+ pathParamNames: ["credential_id", "org"]
196
+ },
197
+ {
198
+ operationId: "credentialTriggerPickSet",
199
+ method: "PUT",
200
+ pathTemplate: "/v1/credential-trigger-picks",
201
+ pathParamNames: []
202
+ },
203
+ {
204
+ operationId: "credentialUpdate",
205
+ method: "PATCH",
206
+ pathTemplate: "/v1/credentials/{credential_id}",
207
+ pathParamNames: ["credential_id"]
208
+ },
209
+ {
210
+ operationId: "emailAttachmentGet",
211
+ method: "GET",
212
+ pathTemplate: "/v1/email/attachments/{attachment_id}",
213
+ pathParamNames: ["attachment_id"]
214
+ },
215
+ {
216
+ operationId: "emailDeliveryEventList",
217
+ method: "GET",
218
+ pathTemplate: "/v1/email/delivery-events",
219
+ pathParamNames: []
220
+ },
221
+ {
222
+ operationId: "emailDestinationAdd",
223
+ method: "POST",
224
+ pathTemplate: "/v1/email/destinations",
225
+ pathParamNames: []
226
+ },
227
+ {
228
+ operationId: "emailDestinationList",
229
+ method: "GET",
230
+ pathTemplate: "/v1/email/destinations",
231
+ pathParamNames: []
232
+ },
233
+ {
234
+ operationId: "emailDestinationRemove",
235
+ method: "DELETE",
236
+ pathTemplate: "/v1/email/destinations/{id}",
237
+ pathParamNames: ["id"]
238
+ },
239
+ {
240
+ operationId: "emailDestinationSetDefault",
241
+ method: "POST",
242
+ pathTemplate: "/v1/email/destinations/{id}/default",
243
+ pathParamNames: ["id"]
244
+ },
245
+ {
246
+ operationId: "emailInboxList",
247
+ method: "GET",
248
+ pathTemplate: "/v1/email/inboxes",
249
+ pathParamNames: []
250
+ },
251
+ {
252
+ operationId: "emailMessageClassify",
253
+ method: "POST",
254
+ pathTemplate: "/v1/email/messages/{message_id}/classify",
255
+ pathParamNames: ["message_id"]
256
+ },
257
+ {
258
+ operationId: "emailMessageDelete",
259
+ method: "DELETE",
260
+ pathTemplate: "/v1/email/messages/{message_id}",
261
+ pathParamNames: ["message_id"]
262
+ },
263
+ {
264
+ operationId: "emailMessageGet",
265
+ method: "GET",
266
+ pathTemplate: "/v1/email/messages/{message_id}",
267
+ pathParamNames: ["message_id"]
268
+ },
269
+ {
270
+ operationId: "emailMessageList",
271
+ method: "GET",
272
+ pathTemplate: "/v1/email/messages",
273
+ pathParamNames: []
274
+ },
275
+ {
276
+ operationId: "emailMessageSearch",
277
+ method: "GET",
278
+ pathTemplate: "/v1/email/messages/search",
279
+ pathParamNames: []
280
+ },
281
+ {
282
+ operationId: "emailReply",
283
+ method: "POST",
284
+ pathTemplate: "/v1/email/messages/{message_id}/reply",
285
+ pathParamNames: ["message_id"]
286
+ },
287
+ {
288
+ operationId: "emailSend",
289
+ method: "POST",
290
+ pathTemplate: "/v1/email/send",
291
+ pathParamNames: []
292
+ },
293
+ {
294
+ operationId: "emailSenderRuleDelete",
295
+ method: "DELETE",
296
+ pathTemplate: "/v1/email/sender-rules/{rule_id}",
297
+ pathParamNames: ["rule_id"]
298
+ },
299
+ {
300
+ operationId: "emailSenderRuleList",
301
+ method: "GET",
302
+ pathTemplate: "/v1/email/sender-rules",
303
+ pathParamNames: []
304
+ },
305
+ {
306
+ operationId: "emailSenderRuleSet",
307
+ method: "POST",
308
+ pathTemplate: "/v1/email/sender-rules",
309
+ pathParamNames: []
310
+ },
311
+ {
312
+ operationId: "enablementDisable",
313
+ method: "POST",
314
+ pathTemplate: "/v1/enablements/{enablementId}/disable",
315
+ pathParamNames: ["enablementId"]
316
+ },
317
+ {
318
+ operationId: "enablementEnable",
319
+ method: "POST",
320
+ pathTemplate: "/v1/enablements",
321
+ pathParamNames: []
322
+ },
323
+ {
324
+ operationId: "enablementList",
325
+ method: "GET",
326
+ pathTemplate: "/v1/enablements",
327
+ pathParamNames: []
328
+ },
329
+ {
330
+ operationId: "execute",
331
+ method: "POST",
332
+ pathTemplate: "/v1/execute",
333
+ pathParamNames: []
334
+ },
335
+ {
336
+ operationId: "followAdd",
337
+ method: "POST",
338
+ pathTemplate: "/v1/follows",
339
+ pathParamNames: []
340
+ },
341
+ {
342
+ operationId: "followList",
343
+ method: "GET",
344
+ pathTemplate: "/v1/follows",
345
+ pathParamNames: []
346
+ },
347
+ {
348
+ operationId: "followRemove",
349
+ method: "DELETE",
350
+ pathTemplate: "/v1/follows",
351
+ pathParamNames: []
352
+ },
353
+ {
354
+ operationId: "integrationDelete",
355
+ method: "DELETE",
356
+ pathTemplate: "/v1/integrations/{name}",
357
+ pathParamNames: ["name"]
358
+ },
359
+ {
360
+ operationId: "integrationGet",
361
+ method: "GET",
362
+ pathTemplate: "/v1/integrations/{name}",
363
+ pathParamNames: ["name"]
364
+ },
365
+ {
366
+ operationId: "integrationList",
367
+ method: "GET",
368
+ pathTemplate: "/v1/integrations",
369
+ pathParamNames: []
370
+ },
371
+ {
372
+ operationId: "integrationLock",
373
+ method: "POST",
374
+ pathTemplate: "/v1/integrations/{name}/lock",
375
+ pathParamNames: ["name"]
376
+ },
377
+ {
378
+ operationId: "integrationOauthAppDelete",
379
+ method: "DELETE",
380
+ pathTemplate: "/v1/oauth-apps/{slug}",
381
+ pathParamNames: ["slug"]
382
+ },
383
+ {
384
+ operationId: "integrationOauthAppList",
385
+ method: "GET",
386
+ pathTemplate: "/v1/oauth-apps",
387
+ pathParamNames: []
388
+ },
389
+ {
390
+ operationId: "integrationOauthAppRotateCredentials",
391
+ method: "POST",
392
+ pathTemplate: "/v1/oauth-apps/{slug}/rotate-credentials",
393
+ pathParamNames: ["slug"]
394
+ },
395
+ {
396
+ operationId: "integrationPlatformAppList",
397
+ method: "GET",
398
+ pathTemplate: "/v1/platform-apps",
399
+ pathParamNames: []
400
+ },
401
+ {
402
+ operationId: "integrationSave",
403
+ method: "PUT",
404
+ pathTemplate: "/v1/integrations/{name}",
405
+ pathParamNames: ["name"]
406
+ },
407
+ {
408
+ operationId: "integrationTokenRefresh",
409
+ method: "POST",
410
+ pathTemplate: "/v1/integrations/{name}/refresh",
411
+ pathParamNames: ["name"]
412
+ },
413
+ {
414
+ operationId: "inviteAccept",
415
+ method: "POST",
416
+ pathTemplate: "/v1/access/invites/accept",
417
+ pathParamNames: []
418
+ },
419
+ {
420
+ operationId: "inviteCreate",
421
+ method: "POST",
422
+ pathTemplate: "/v1/access/invites",
423
+ pathParamNames: []
424
+ },
425
+ {
426
+ operationId: "inviteRevoke",
427
+ method: "POST",
428
+ pathTemplate: "/v1/access/invites/{invite_id}/revoke",
429
+ pathParamNames: ["invite_id"]
430
+ },
431
+ {
432
+ operationId: "jobGet",
433
+ method: "GET",
434
+ pathTemplate: "/v1/jobs/{id}",
435
+ pathParamNames: ["id"]
436
+ },
437
+ {
438
+ operationId: "jobList",
439
+ method: "GET",
440
+ pathTemplate: "/v1/jobs",
441
+ pathParamNames: []
442
+ },
443
+ {
444
+ operationId: "jobRunNow",
445
+ method: "POST",
446
+ pathTemplate: "/v1/jobs/{id}/run",
447
+ pathParamNames: ["id"]
448
+ },
449
+ {
450
+ operationId: "jobUpdate",
451
+ method: "PATCH",
452
+ pathTemplate: "/v1/jobs/{id}",
453
+ pathParamNames: ["id"]
454
+ },
455
+ {
456
+ operationId: "localExecutePackageGraph",
457
+ method: "POST",
458
+ pathTemplate: "/v1/local-execute/package-graph",
459
+ pathParamNames: []
460
+ },
461
+ {
462
+ operationId: "mcpServerAdd",
463
+ method: "POST",
464
+ pathTemplate: "/v1/mcp-servers",
465
+ pathParamNames: []
466
+ },
467
+ {
468
+ operationId: "mcpServerList",
469
+ method: "GET",
470
+ pathTemplate: "/v1/mcp-servers",
471
+ pathParamNames: []
472
+ },
473
+ {
474
+ operationId: "mcpServerLock",
475
+ method: "POST",
476
+ pathTemplate: "/v1/mcp-servers/{server}/lock",
477
+ pathParamNames: ["server"]
478
+ },
479
+ {
480
+ operationId: "mcpServerReconnect",
481
+ method: "POST",
482
+ pathTemplate: "/v1/mcp-servers/{server}/reconnect",
483
+ pathParamNames: ["server"]
484
+ },
485
+ {
486
+ operationId: "mcpServerRefresh",
487
+ method: "POST",
488
+ pathTemplate: "/v1/mcp-servers/{server}/refresh",
489
+ pathParamNames: ["server"]
490
+ },
491
+ {
492
+ operationId: "mcpServerRemove",
493
+ method: "DELETE",
494
+ pathTemplate: "/v1/mcp-servers/{server}",
495
+ pathParamNames: ["server"]
496
+ },
497
+ {
498
+ operationId: "mcpServerSetEnabled",
499
+ method: "PUT",
500
+ pathTemplate: "/v1/mcp-servers/{server}/enabled",
501
+ pathParamNames: ["server"]
502
+ },
503
+ {
504
+ operationId: "metaGetCurrentUser",
505
+ method: "GET",
506
+ pathTemplate: "/v1/me",
507
+ pathParamNames: []
508
+ },
509
+ {
510
+ operationId: "metaGetMcpServerInstructions",
511
+ method: "GET",
512
+ pathTemplate: "/v1/mcp-server-instructions",
513
+ pathParamNames: []
514
+ },
515
+ {
516
+ operationId: "metaMemoryDelete",
517
+ method: "DELETE",
518
+ pathTemplate: "/v1/memories/{memory_id}",
519
+ pathParamNames: ["memory_id"]
520
+ },
521
+ {
522
+ operationId: "metaMemoryGet",
523
+ method: "GET",
524
+ pathTemplate: "/v1/memories/{memory_id}",
525
+ pathParamNames: ["memory_id"]
526
+ },
527
+ {
528
+ operationId: "metaMemorySearch",
529
+ method: "GET",
530
+ pathTemplate: "/v1/memories",
531
+ pathParamNames: []
532
+ },
533
+ {
534
+ operationId: "metaMemoryUpsert",
535
+ method: "POST",
536
+ pathTemplate: "/v1/memories",
537
+ pathParamNames: []
538
+ },
539
+ {
540
+ operationId: "metaMemoryVerify",
541
+ method: "POST",
542
+ pathTemplate: "/v1/memories/verify",
543
+ pathParamNames: []
544
+ },
545
+ {
546
+ operationId: "metaPlatformFeedbackGet",
547
+ method: "GET",
548
+ pathTemplate: "/v1/account/feedback/{feedback_id}",
549
+ pathParamNames: ["feedback_id"]
550
+ },
551
+ {
552
+ operationId: "metaPlatformFeedbackList",
553
+ method: "GET",
554
+ pathTemplate: "/v1/account/feedback",
555
+ pathParamNames: []
556
+ },
557
+ {
558
+ operationId: "metaPlatformFeedbackSubmit",
559
+ method: "POST",
560
+ pathTemplate: "/v1/account/feedback",
561
+ pathParamNames: []
562
+ },
563
+ {
564
+ operationId: "metaSetMcpServerInstructions",
565
+ method: "PUT",
566
+ pathTemplate: "/v1/mcp-server-instructions",
567
+ pathParamNames: []
568
+ },
569
+ {
570
+ operationId: "orgCreate",
571
+ method: "POST",
572
+ pathTemplate: "/v1/orgs",
573
+ pathParamNames: []
574
+ },
575
+ {
576
+ operationId: "orgMemberList",
577
+ method: "GET",
578
+ pathTemplate: "/v1/orgs/members",
579
+ pathParamNames: []
580
+ },
581
+ {
582
+ operationId: "orgMemberRemove",
583
+ method: "DELETE",
584
+ pathTemplate: "/v1/orgs/members/{user_id}",
585
+ pathParamNames: ["user_id"]
586
+ },
587
+ {
588
+ operationId: "orgMemberUpdate",
589
+ method: "PATCH",
590
+ pathTemplate: "/v1/orgs/members/{user_id}",
591
+ pathParamNames: ["user_id"]
592
+ },
593
+ {
594
+ operationId: "orgUpdate",
595
+ method: "PATCH",
596
+ pathTemplate: "/v1/orgs",
597
+ pathParamNames: []
598
+ },
599
+ {
600
+ operationId: "packageAppCustomHostnameAdd",
601
+ method: "POST",
602
+ pathTemplate: "/v1/orgs/package-app-custom-hostnames",
603
+ pathParamNames: []
604
+ },
605
+ {
606
+ operationId: "packageAppCustomHostnameDelete",
607
+ method: "DELETE",
608
+ pathTemplate: "/v1/orgs/package-app-custom-hostnames/{id}",
609
+ pathParamNames: ["id"]
610
+ },
611
+ {
612
+ operationId: "packageAppCustomHostnameList",
613
+ method: "GET",
614
+ pathTemplate: "/v1/orgs/package-app-custom-hostnames",
615
+ pathParamNames: []
616
+ },
617
+ {
618
+ operationId: "packageAppCustomHostnameSync",
619
+ method: "POST",
620
+ pathTemplate: "/v1/orgs/package-app-custom-hostnames/{id}/sync",
621
+ pathParamNames: ["id"]
622
+ },
623
+ {
624
+ operationId: "packageCollaboratorList",
625
+ method: "GET",
626
+ pathTemplate: "/v1/packages/{package_id}/collaborators",
627
+ pathParamNames: ["package_id"]
628
+ },
629
+ {
630
+ operationId: "packageCollaboratorRemove",
631
+ method: "DELETE",
632
+ pathTemplate: "/v1/packages/{package_id}/collaborators/{grant_id}",
633
+ pathParamNames: ["package_id", "grant_id"]
634
+ },
635
+ {
636
+ operationId: "packageCollaboratorSet",
637
+ method: "POST",
638
+ pathTemplate: "/v1/packages/{package_id}/collaborators",
639
+ pathParamNames: ["package_id"]
640
+ },
641
+ {
642
+ operationId: "packageDelete",
643
+ method: "DELETE",
644
+ pathTemplate: "/v1/packages/{package_id}",
645
+ pathParamNames: ["package_id"]
646
+ },
647
+ {
648
+ operationId: "packageGet",
649
+ method: "GET",
650
+ pathTemplate: "/v1/packages/{package_id}",
651
+ pathParamNames: ["package_id"]
652
+ },
653
+ {
654
+ operationId: "packageGetGitRemote",
655
+ method: "POST",
656
+ pathTemplate: "/v1/packages/{package_id}/git-remote",
657
+ pathParamNames: ["package_id"]
658
+ },
659
+ {
660
+ operationId: "packageList",
661
+ method: "GET",
662
+ pathTemplate: "/v1/packages",
663
+ pathParamNames: []
664
+ },
665
+ {
666
+ operationId: "packagePublishExternalPush",
667
+ method: "POST",
668
+ pathTemplate: "/v1/packages/{package_id}/external-push",
669
+ pathParamNames: ["package_id"]
670
+ },
671
+ {
672
+ operationId: "packageSave",
673
+ method: "POST",
674
+ pathTemplate: "/v1/packages",
675
+ pathParamNames: []
676
+ },
677
+ {
678
+ operationId: "packageSecurityAuditRecord",
679
+ method: "POST",
680
+ pathTemplate: "/v1/packages/{package_id}/security-audits",
681
+ pathParamNames: ["package_id"]
682
+ },
683
+ {
684
+ operationId: "packageSubscriptionsList",
685
+ method: "GET",
686
+ pathTemplate: "/v1/package-subscriptions",
687
+ pathParamNames: []
688
+ },
689
+ {
690
+ operationId: "packageUpdate",
691
+ method: "PATCH",
692
+ pathTemplate: "/v1/packages/{package_id}",
693
+ pathParamNames: ["package_id"]
694
+ },
695
+ {
696
+ operationId: "repoApplyPatch",
697
+ method: "POST",
698
+ pathTemplate: "/v1/repo-sessions/{session_id}/patch",
699
+ pathParamNames: ["session_id"]
700
+ },
701
+ {
702
+ operationId: "repoCommit",
703
+ method: "POST",
704
+ pathTemplate: "/v1/repo-sessions/{session_id}/commits",
705
+ pathParamNames: ["session_id"]
706
+ },
707
+ {
708
+ operationId: "repoCreate",
709
+ method: "POST",
710
+ pathTemplate: "/v1/repos",
711
+ pathParamNames: []
712
+ },
713
+ {
714
+ operationId: "repoDelete",
715
+ method: "DELETE",
716
+ pathTemplate: "/v1/repos/{repo_id}",
717
+ pathParamNames: ["repo_id"]
718
+ },
719
+ {
720
+ operationId: "repoDiff",
721
+ method: "GET",
722
+ pathTemplate: "/v1/repo-sessions/{session_id}/diff",
723
+ pathParamNames: ["session_id"]
724
+ },
725
+ {
726
+ operationId: "repoDiscardSession",
727
+ method: "DELETE",
728
+ pathTemplate: "/v1/repo-sessions/{session_id}",
729
+ pathParamNames: ["session_id"]
730
+ },
731
+ {
732
+ operationId: "repoEditFiles",
733
+ method: "POST",
734
+ pathTemplate: "/v1/repo-sessions/{session_id}/edits",
735
+ pathParamNames: ["session_id"]
736
+ },
737
+ {
738
+ operationId: "repoGet",
739
+ method: "GET",
740
+ pathTemplate: "/v1/repos/{repo_id}",
741
+ pathParamNames: ["repo_id"]
742
+ },
743
+ {
744
+ operationId: "repoGetCheckStatus",
745
+ method: "GET",
746
+ pathTemplate: "/v1/repo-sessions/{session_id}/checks",
747
+ pathParamNames: ["session_id"]
748
+ },
749
+ {
750
+ operationId: "repoGetGitRemote",
751
+ method: "POST",
752
+ pathTemplate: "/v1/repos/git-remote",
753
+ pathParamNames: []
754
+ },
755
+ {
756
+ operationId: "repoGetGitRemoteByPath",
757
+ method: "POST",
758
+ pathTemplate: "/v1/repos/{repo_id}/git-remote",
759
+ pathParamNames: ["repo_id"]
760
+ },
761
+ {
762
+ operationId: "repoGetSession",
763
+ method: "GET",
764
+ pathTemplate: "/v1/repo-sessions/{session_id}",
765
+ pathParamNames: ["session_id"]
766
+ },
767
+ {
768
+ operationId: "repoList",
769
+ method: "GET",
770
+ pathTemplate: "/v1/repos",
771
+ pathParamNames: []
772
+ },
773
+ {
774
+ operationId: "repoListSessions",
775
+ method: "GET",
776
+ pathTemplate: "/v1/repo-sessions",
777
+ pathParamNames: []
778
+ },
779
+ {
780
+ operationId: "repoLog",
781
+ method: "GET",
782
+ pathTemplate: "/v1/repo-sessions/{session_id}/log",
783
+ pathParamNames: ["session_id"]
784
+ },
785
+ {
786
+ operationId: "repoOpenSession",
787
+ method: "POST",
788
+ pathTemplate: "/v1/repo-sessions",
789
+ pathParamNames: []
790
+ },
791
+ {
792
+ operationId: "repoPromoteToPackage",
793
+ method: "POST",
794
+ pathTemplate: "/v1/repos/{repo_id}/promote",
795
+ pathParamNames: ["repo_id"]
796
+ },
797
+ {
798
+ operationId: "repoPublishSession",
799
+ method: "POST",
800
+ pathTemplate: "/v1/repo-sessions/{session_id}/publish",
801
+ pathParamNames: ["session_id"]
802
+ },
803
+ {
804
+ operationId: "repoReadFile",
805
+ method: "GET",
806
+ pathTemplate: "/v1/repo-sessions/{session_id}/file",
807
+ pathParamNames: ["session_id"]
808
+ },
809
+ {
810
+ operationId: "repoRebaseSession",
811
+ method: "POST",
812
+ pathTemplate: "/v1/repo-sessions/{session_id}/rebase",
813
+ pathParamNames: ["session_id"]
814
+ },
815
+ {
816
+ operationId: "repoRestore",
817
+ method: "POST",
818
+ pathTemplate: "/v1/repo-sessions/{session_id}/restore",
819
+ pathParamNames: ["session_id"]
820
+ },
821
+ {
822
+ operationId: "repoRunChecks",
823
+ method: "POST",
824
+ pathTemplate: "/v1/repo-sessions/{session_id}/checks",
825
+ pathParamNames: ["session_id"]
826
+ },
827
+ {
828
+ operationId: "repoSearch",
829
+ method: "GET",
830
+ pathTemplate: "/v1/repo-sessions/{session_id}/search",
831
+ pathParamNames: ["session_id"]
832
+ },
833
+ {
834
+ operationId: "repoShowPublishNote",
835
+ method: "GET",
836
+ pathTemplate: "/v1/repo-publish-note",
837
+ pathParamNames: []
838
+ },
839
+ {
840
+ operationId: "repoStatus",
841
+ method: "GET",
842
+ pathTemplate: "/v1/repo-sessions/{session_id}/status",
843
+ pathParamNames: ["session_id"]
844
+ },
845
+ {
846
+ operationId: "repoTree",
847
+ method: "GET",
848
+ pathTemplate: "/v1/repo-sessions/{session_id}/tree",
849
+ pathParamNames: ["session_id"]
850
+ },
851
+ {
852
+ operationId: "repoUpdate",
853
+ method: "PATCH",
854
+ pathTemplate: "/v1/repos/{repo_id}",
855
+ pathParamNames: ["repo_id"]
856
+ },
857
+ {
858
+ operationId: "runGet",
859
+ method: "GET",
860
+ pathTemplate: "/v1/runs/{run_id}",
861
+ pathParamNames: ["run_id"]
862
+ },
863
+ {
864
+ operationId: "runList",
865
+ method: "GET",
866
+ pathTemplate: "/v1/runs",
867
+ pathParamNames: []
868
+ },
869
+ {
870
+ operationId: "runSummary",
871
+ method: "GET",
872
+ pathTemplate: "/v1/runs/summary",
873
+ pathParamNames: []
874
+ },
875
+ {
876
+ operationId: "runUpdate",
877
+ method: "PATCH",
878
+ pathTemplate: "/v1/runs/{run_id}",
879
+ pathParamNames: ["run_id"]
880
+ },
881
+ {
882
+ operationId: "runUpdateBulk",
883
+ method: "POST",
884
+ pathTemplate: "/v1/runs/triage",
885
+ pathParamNames: []
886
+ },
887
+ {
888
+ operationId: "search",
889
+ method: "GET",
890
+ pathTemplate: "/v1/search",
891
+ pathParamNames: []
892
+ },
893
+ {
894
+ operationId: "searchTool",
895
+ method: "POST",
896
+ pathTemplate: "/v1/search/tool",
897
+ pathParamNames: []
898
+ },
899
+ {
900
+ operationId: "secretDelete",
901
+ method: "DELETE",
902
+ pathTemplate: "/v1/secrets/{scope}/{name}",
903
+ pathParamNames: ["scope", "name"]
904
+ },
905
+ {
906
+ operationId: "secretJwtSign",
907
+ method: "POST",
908
+ pathTemplate: "/v1/secrets/jwt",
909
+ pathParamNames: []
910
+ },
911
+ {
912
+ operationId: "secretList",
913
+ method: "GET",
914
+ pathTemplate: "/v1/secrets",
915
+ pathParamNames: []
916
+ },
917
+ {
918
+ operationId: "secretLock",
919
+ method: "POST",
920
+ pathTemplate: "/v1/secrets/lock",
921
+ pathParamNames: []
922
+ },
923
+ {
924
+ operationId: "secretProviderBind",
925
+ method: "PUT",
926
+ pathTemplate: "/v1/secret-providers/{provider}",
927
+ pathParamNames: ["provider"]
928
+ },
929
+ {
930
+ operationId: "secretProviderList",
931
+ method: "GET",
932
+ pathTemplate: "/v1/secret-providers",
933
+ pathParamNames: []
934
+ },
935
+ {
936
+ operationId: "secretProviderLock",
937
+ method: "POST",
938
+ pathTemplate: "/v1/secret-providers/{provider}/lock",
939
+ pathParamNames: ["provider"]
940
+ },
941
+ {
942
+ operationId: "secretProviderUnbind",
943
+ method: "DELETE",
944
+ pathTemplate: "/v1/secret-providers/{provider}",
945
+ pathParamNames: ["provider"]
946
+ },
947
+ {
948
+ operationId: "secretSet",
949
+ method: "PUT",
950
+ pathTemplate: "/v1/secrets/{scope}/{name}",
951
+ pathParamNames: ["scope", "name"]
952
+ },
953
+ {
954
+ operationId: "secretSetMany",
955
+ method: "POST",
956
+ pathTemplate: "/v1/secrets/batch",
957
+ pathParamNames: []
958
+ },
959
+ {
960
+ operationId: "storageExport",
961
+ method: "GET",
962
+ pathTemplate: "/v1/storage/{storage_id}/export",
963
+ pathParamNames: ["storage_id"]
964
+ },
965
+ {
966
+ operationId: "storageQuery",
967
+ method: "POST",
968
+ pathTemplate: "/v1/storage/{storage_id}/query",
969
+ pathParamNames: ["storage_id"]
970
+ },
971
+ {
972
+ operationId: "teamCreate",
973
+ method: "POST",
974
+ pathTemplate: "/v1/orgs/teams",
975
+ pathParamNames: []
976
+ },
977
+ {
978
+ operationId: "teamList",
979
+ method: "GET",
980
+ pathTemplate: "/v1/orgs/teams",
981
+ pathParamNames: []
982
+ },
983
+ {
984
+ operationId: "teamMemberAdd",
985
+ method: "POST",
986
+ pathTemplate: "/v1/orgs/teams/{team_id}/members",
987
+ pathParamNames: ["team_id"]
988
+ },
989
+ {
990
+ operationId: "teamMemberRemove",
991
+ method: "DELETE",
992
+ pathTemplate: "/v1/orgs/teams/{team_id}/members/{user_id}",
993
+ pathParamNames: ["team_id", "user_id"]
994
+ },
995
+ {
996
+ operationId: "tokenCreate",
997
+ method: "POST",
998
+ pathTemplate: "/v1/tokens",
999
+ pathParamNames: []
1000
+ },
1001
+ {
1002
+ operationId: "tokenGet",
1003
+ method: "GET",
1004
+ pathTemplate: "/v1/tokens/{token_id}",
1005
+ pathParamNames: ["token_id"]
1006
+ },
1007
+ {
1008
+ operationId: "tokenGetCurrent",
1009
+ method: "GET",
1010
+ pathTemplate: "/v1/tokens/current",
1011
+ pathParamNames: []
1012
+ },
1013
+ {
1014
+ operationId: "tokenList",
1015
+ method: "GET",
1016
+ pathTemplate: "/v1/tokens",
1017
+ pathParamNames: []
1018
+ },
1019
+ {
1020
+ operationId: "tokenRevoke",
1021
+ method: "DELETE",
1022
+ pathTemplate: "/v1/tokens/{token_id}",
1023
+ pathParamNames: ["token_id"]
1024
+ },
1025
+ {
1026
+ operationId: "tokenRevokeCurrent",
1027
+ method: "DELETE",
1028
+ pathTemplate: "/v1/tokens/current",
1029
+ pathParamNames: []
1030
+ },
1031
+ {
1032
+ operationId: "tokenRotate",
1033
+ method: "POST",
1034
+ pathTemplate: "/v1/tokens/{token_id}/rotate",
1035
+ pathParamNames: ["token_id"]
1036
+ },
1037
+ {
1038
+ operationId: "tokenRotateCurrent",
1039
+ method: "POST",
1040
+ pathTemplate: "/v1/tokens/current/rotate",
1041
+ pathParamNames: []
1042
+ },
1043
+ {
1044
+ operationId: "usageByPackageGet",
1045
+ method: "GET",
1046
+ pathTemplate: "/v1/account/usage/by-package",
1047
+ pathParamNames: []
1048
+ },
1049
+ {
1050
+ operationId: "usageGet",
1051
+ method: "GET",
1052
+ pathTemplate: "/v1/account/usage",
1053
+ pathParamNames: []
1054
+ },
1055
+ {
1056
+ operationId: "usageTrendGet",
1057
+ method: "GET",
1058
+ pathTemplate: "/v1/account/usage/trend",
1059
+ pathParamNames: []
1060
+ },
1061
+ {
1062
+ operationId: "waitingSummary",
1063
+ method: "GET",
1064
+ pathTemplate: "/v1/account/waiting",
1065
+ pathParamNames: []
1066
+ },
1067
+ {
1068
+ operationId: "webhookDeliveryList",
1069
+ method: "GET",
1070
+ pathTemplate: "/v1/webhooks/{webhookName}/deliveries",
1071
+ pathParamNames: ["webhookName"]
1072
+ },
1073
+ {
1074
+ operationId: "webhookDisable",
1075
+ method: "POST",
1076
+ pathTemplate: "/v1/webhooks/{webhookName}/disable",
1077
+ pathParamNames: ["webhookName"]
1078
+ },
1079
+ {
1080
+ operationId: "webhookEnable",
1081
+ method: "POST",
1082
+ pathTemplate: "/v1/webhooks/{webhookName}/enable",
1083
+ pathParamNames: ["webhookName"]
1084
+ },
1085
+ {
1086
+ operationId: "webhookList",
1087
+ method: "GET",
1088
+ pathTemplate: "/v1/webhooks",
1089
+ pathParamNames: []
1090
+ },
1091
+ {
1092
+ operationId: "webhookUrlApply",
1093
+ method: "POST",
1094
+ pathTemplate: "/v1/webhooks/apply",
1095
+ pathParamNames: []
1096
+ },
1097
+ {
1098
+ operationId: "webhookUrlMint",
1099
+ method: "POST",
1100
+ pathTemplate: "/v1/webhooks/{webhookName}/url",
1101
+ pathParamNames: ["webhookName"]
1102
+ },
1103
+ {
1104
+ operationId: "webhookUrlRotate",
1105
+ method: "POST",
1106
+ pathTemplate: "/v1/webhooks/{webhookName}/url/rotate",
1107
+ pathParamNames: ["webhookName"]
1108
+ },
1109
+ {
1110
+ operationId: "workflowRunCancel",
1111
+ method: "POST",
1112
+ pathTemplate: "/v1/workflow-runs/{id}/cancel",
1113
+ pathParamNames: ["id"]
1114
+ },
1115
+ {
1116
+ operationId: "workflowRunList",
1117
+ method: "GET",
1118
+ pathTemplate: "/v1/workflow-runs",
1119
+ pathParamNames: []
1120
+ }
1121
+ ];
1122
+
1123
+ // src/open-api-client.ts
1124
+ var OpenApiError = class extends Error {
1125
+ status;
1126
+ code;
1127
+ constructor(message, options = {}) {
1128
+ super(message);
1129
+ this.name = "OpenApiError";
1130
+ this.status = options.status ?? null;
1131
+ this.code = options.code ?? null;
1132
+ }
1133
+ };
1134
+ var openApiDocumentPath = "openapi.json";
1135
+ var cliCredentialBootstrapRedeemOperationId = "cliCredentialBootstrapRedeem";
1136
+ var openApiRouteCache = /* @__PURE__ */ new Map();
1137
+ var openApiRouteCacheVersion = 1;
1138
+ function openApiCacheDir() {
1139
+ return join(userCacheDir(), "openapi");
1140
+ }
1141
+ function sha256Hex(text) {
1142
+ return createHash("sha256").update(text).digest("hex");
1143
+ }
1144
+ function originPointerPath(origin) {
1145
+ return join(openApiCacheDir(), `${sha256Hex(origin)}.etag`);
1146
+ }
1147
+ function routeMapPath(etag) {
1148
+ return join(openApiCacheDir(), `${sha256Hex(etag)}.json`);
1149
+ }
1150
+ function isOperationRoute(value) {
1151
+ if (!value || typeof value !== "object") return false;
1152
+ const route = value;
1153
+ return typeof route.operationId === "string" && typeof route.method === "string" && typeof route.pathTemplate === "string" && Array.isArray(route.pathParamNames) && route.pathParamNames.every((name) => typeof name === "string");
1154
+ }
1155
+ async function readPersistedRoutes(origin) {
1156
+ try {
1157
+ const etag = (await readFile(originPointerPath(origin), "utf8")).trim();
1158
+ if (!etag) return null;
1159
+ const raw = JSON.parse(await readFile(routeMapPath(etag), "utf8"));
1160
+ if (!raw || typeof raw !== "object") return null;
1161
+ const entry = raw;
1162
+ if (entry.version !== openApiRouteCacheVersion || entry.etag !== etag)
1163
+ return null;
1164
+ if (!Array.isArray(entry.operations) || !entry.operations.every(isOperationRoute))
1165
+ return null;
1166
+ return {
1167
+ etag,
1168
+ operations: new Map(
1169
+ entry.operations.map((route) => [route.operationId, route])
1170
+ )
1171
+ };
1172
+ } catch {
1173
+ return null;
1174
+ }
1175
+ }
1176
+ async function persistRoutes(origin, previousEtag, entry) {
1177
+ if (!entry.etag) return;
1178
+ try {
1179
+ await mkdir(openApiCacheDir(), { recursive: true });
1180
+ await writeFile(
1181
+ routeMapPath(entry.etag),
1182
+ JSON.stringify({
1183
+ version: openApiRouteCacheVersion,
1184
+ etag: entry.etag,
1185
+ operations: [...entry.operations.values()]
1186
+ })
1187
+ );
1188
+ await writeFile(originPointerPath(origin), entry.etag);
1189
+ if (previousEtag && previousEtag !== entry.etag) {
1190
+ await rm(routeMapPath(previousEtag), { force: true });
1191
+ }
1192
+ } catch {
1193
+ }
1194
+ }
1195
+ async function openApiGet(input) {
1196
+ return openApiRequest({
1197
+ ...input,
1198
+ method: "GET",
1199
+ path: input.path,
1200
+ query: input.query
1201
+ });
1202
+ }
1203
+ async function openApiRequest(input) {
1204
+ const apiUrl = input.apiUrl || defaultApiUrl;
1205
+ assertTokenSafeApiUrl(apiUrl);
1206
+ const url = capabilityProxyUrl(apiUrl, input.path.replace(/^\//, ""));
1207
+ if (input.org) {
1208
+ url.searchParams.set("org", input.org);
1209
+ }
1210
+ if (input.query) {
1211
+ appendQueryParams(url.searchParams, input.query);
1212
+ }
1213
+ const method = input.method.toUpperCase();
1214
+ const headers = {
1215
+ accept: "application/json",
1216
+ authorization: `Bearer ${input.token}`,
1217
+ "user-agent": `${cliName}/${readPackageVersion()}`
1218
+ };
1219
+ let body;
1220
+ if (input.body !== void 0 && method !== "GET" && method !== "HEAD") {
1221
+ headers["content-type"] = "application/json";
1222
+ body = JSON.stringify(input.body);
1223
+ }
1224
+ const fetchFn = input.fetchFn ?? fetch;
1225
+ let response;
1226
+ try {
1227
+ response = await fetchFn(url, { method, headers, body });
1228
+ } catch (error) {
1229
+ const reason = describeNetworkError(error);
1230
+ throw new OpenApiError(
1231
+ `Could not reach the Kody API at ${url.origin} (${reason}). Check --api-url / KODY_API_URL and your network.`
1232
+ );
1233
+ }
1234
+ const responseBody = await readJson(response);
1235
+ if (!response.ok) {
1236
+ throw describeOpenApiFailure(response.status, responseBody, url);
1237
+ }
1238
+ return responseBody;
1239
+ }
1240
+ async function callOpenApiOperation(input) {
1241
+ const operationId = input.operationId.trim();
1242
+ if (!operationId) {
1243
+ throw new OpenApiError(
1244
+ "Provide an Open API operationId (e.g. usageGet, metaGetCurrentUser)."
1245
+ );
1246
+ }
1247
+ assertApiOperationAllowed(operationId);
1248
+ const apiUrl = input.apiUrl || defaultApiUrl;
1249
+ const operations = input.operations ?? await loadOpenApiOperations({ apiUrl, fetchFn: input.fetchFn });
1250
+ const route = operations.get(operationId);
1251
+ if (!route) {
1252
+ throw new OpenApiError(
1253
+ `Unknown operationId "${operationId}". Operation ids are listed in ${capabilityProxyUrl(apiUrl, openApiDocumentPath).href} and match Kody capability names (plus token operations such as tokenCreate).`,
1254
+ { status: 404, code: "not_found" }
1255
+ );
1256
+ }
1257
+ const built = buildOpenApiHttpRequest({
1258
+ route,
1259
+ params: input.params ?? {}
1260
+ });
1261
+ return openApiRequest({
1262
+ token: input.token,
1263
+ apiUrl,
1264
+ fetchFn: input.fetchFn,
1265
+ ...input.org ? { org: input.org } : {},
1266
+ method: built.method,
1267
+ path: built.path,
1268
+ query: built.query,
1269
+ body: built.body
1270
+ });
1271
+ }
1272
+ function assertApiOperationAllowed(operationId) {
1273
+ if (operationId === cliCredentialBootstrapRedeemOperationId) {
1274
+ throw new OpenApiError(
1275
+ `Refusing to call ${cliCredentialBootstrapRedeemOperationId}: redeem returns a kody_at_\u2026 token that must not print to stdout. Use \`kody auth bootstrap --code <kody_bc_\u2026>\` instead (stores the token; never prints it).`,
1276
+ { status: null, code: "refused" }
1277
+ );
1278
+ }
1279
+ }
1280
+ function buildOpenApiHttpRequest(input) {
1281
+ const remaining = { ...input.params };
1282
+ const pathParams = {};
1283
+ for (const name of input.route.pathParamNames) {
1284
+ if (!(name in remaining) || remaining[name] === void 0 || remaining[name] === null) {
1285
+ throw new OpenApiError(
1286
+ `Missing required path parameter "${name}" for ${input.route.operationId} (${input.route.pathTemplate}).`
1287
+ );
1288
+ }
1289
+ pathParams[name] = String(remaining[name]);
1290
+ delete remaining[name];
1291
+ }
1292
+ const path = fillPathTemplate(input.route.pathTemplate, pathParams);
1293
+ const method = input.route.method.toUpperCase();
1294
+ if (apiOperationUsesQueryInputs(method)) {
1295
+ return {
1296
+ method,
1297
+ path,
1298
+ ...Object.keys(remaining).length > 0 ? { query: remaining } : {}
1299
+ };
1300
+ }
1301
+ return {
1302
+ method,
1303
+ path,
1304
+ body: remaining
1305
+ };
1306
+ }
1307
+ function apiOperationUsesQueryInputs(method) {
1308
+ const upper = method.toUpperCase();
1309
+ return upper === "GET" || upper === "DELETE";
1310
+ }
1311
+ async function loadOpenApiOperations(input) {
1312
+ const apiUrl = input.apiUrl || defaultApiUrl;
1313
+ assertTokenSafeApiUrl(apiUrl);
1314
+ const cacheKey = new URL(apiUrl).origin;
1315
+ if (!input.bustCache) {
1316
+ const cached = openApiRouteCache.get(cacheKey);
1317
+ if (cached) return cached.operations;
1318
+ }
1319
+ const persisted = input.bustCache ? null : await readPersistedRoutes(cacheKey);
1320
+ const url = capabilityProxyUrl(apiUrl, openApiDocumentPath);
1321
+ const fetchFn = input.fetchFn ?? fetch;
1322
+ let response;
1323
+ try {
1324
+ response = await fetchFn(url, {
1325
+ method: "GET",
1326
+ headers: {
1327
+ accept: "application/json",
1328
+ "user-agent": `${cliName}/${readPackageVersion()}`,
1329
+ ...persisted?.etag ? { "if-none-match": persisted.etag } : {}
1330
+ }
1331
+ });
1332
+ } catch (error) {
1333
+ if (bakedOpenApiRoutes.length > 0) {
1334
+ return new Map(
1335
+ bakedOpenApiRoutes.map((route) => [route.operationId, route])
1336
+ );
1337
+ }
1338
+ const reason = describeNetworkError(error);
1339
+ throw new OpenApiError(
1340
+ `Could not load OpenAPI from ${url.href} (${reason}). Check --api-url / KODY_API_URL and your network.`
1341
+ );
1342
+ }
1343
+ if (response.status === 304 && persisted) {
1344
+ openApiRouteCache.set(cacheKey, persisted);
1345
+ return persisted.operations;
1346
+ }
1347
+ const body = await readJson(response);
1348
+ if (!response.ok) {
1349
+ throw new OpenApiError(
1350
+ `Could not load OpenAPI from ${url.href} (HTTP ${response.status}).`,
1351
+ { status: response.status }
1352
+ );
1353
+ }
1354
+ const entry = {
1355
+ etag: response.headers.get("etag"),
1356
+ operations: indexOpenApiOperations(body)
1357
+ };
1358
+ openApiRouteCache.set(cacheKey, entry);
1359
+ await persistRoutes(cacheKey, persisted?.etag ?? null, entry);
1360
+ return entry.operations;
1361
+ }
1362
+ function indexOpenApiOperations(document) {
1363
+ if (!isRecord(document) || !isRecord(document.paths)) {
1364
+ throw new OpenApiError("OpenAPI document is missing a paths object.");
1365
+ }
1366
+ const operations = /* @__PURE__ */ new Map();
1367
+ for (const [pathTemplate, methods] of Object.entries(document.paths)) {
1368
+ if (!isRecord(methods)) continue;
1369
+ for (const [method, operation] of Object.entries(methods)) {
1370
+ if (!isRecord(operation)) continue;
1371
+ const operationId = typeof operation.operationId === "string" ? operation.operationId : "";
1372
+ if (!operationId) continue;
1373
+ operations.set(operationId, {
1374
+ operationId,
1375
+ method: method.toUpperCase(),
1376
+ pathTemplate,
1377
+ pathParamNames: pathParamNamesFromTemplate(pathTemplate)
1378
+ });
1379
+ }
1380
+ }
1381
+ return operations;
1382
+ }
1383
+ function clearOpenApiRouteCache() {
1384
+ openApiRouteCache.clear();
1385
+ }
1386
+ function pathParamNamesFromTemplate(pathTemplate) {
1387
+ const names = [];
1388
+ for (const match of pathTemplate.matchAll(/\{([^{}/]+)\}/g)) {
1389
+ const name = match[1];
1390
+ if (name) names.push(name);
1391
+ }
1392
+ return names;
1393
+ }
1394
+ function fillPathTemplate(pathTemplate, pathParams) {
1395
+ return pathTemplate.replace(/\{([^{}/]+)\}/g, (_full, name) => {
1396
+ const value = pathParams[name];
1397
+ if (value === void 0) {
1398
+ throw new OpenApiError(
1399
+ `Missing path parameter "${name}" for ${pathTemplate}.`
1400
+ );
1401
+ }
1402
+ return encodeURIComponent(value);
1403
+ });
1404
+ }
1405
+ function appendQueryParams(searchParams, query) {
1406
+ for (const [key, value] of Object.entries(query)) {
1407
+ if (value === void 0 || value === null || value === "") continue;
1408
+ if (Array.isArray(value)) {
1409
+ for (const entry of value) {
1410
+ if (entry === void 0 || entry === null) continue;
1411
+ searchParams.append(key, stringifyQueryValue(entry));
1412
+ }
1413
+ continue;
1414
+ }
1415
+ searchParams.set(key, stringifyQueryValue(value));
1416
+ }
1417
+ }
1418
+ function stringifyQueryValue(value) {
1419
+ if (typeof value === "string") return value;
1420
+ if (typeof value === "number" || typeof value === "boolean")
1421
+ return String(value);
1422
+ return JSON.stringify(value);
1423
+ }
1424
+ async function searchWithApiToken(input) {
1425
+ const body = await openApiRequest({
1426
+ token: input.token,
1427
+ ...input.apiUrl ? { apiUrl: input.apiUrl } : {},
1428
+ ...input.fetchFn ? { fetchFn: input.fetchFn } : {},
1429
+ ...input.org ? { org: input.org } : {},
1430
+ method: "POST",
1431
+ path: "v1/search/tool",
1432
+ body: {
1433
+ ...input.query ? { query: input.query } : {},
1434
+ ...input.domain ? { domain: input.domain } : {},
1435
+ ...input.limit !== void 0 ? { limit: input.limit } : {},
1436
+ ...input.entity ? { entity: input.entity } : {}
1437
+ }
1438
+ });
1439
+ return toolResultFromHttpBody(body);
1440
+ }
1441
+ function toolResultFromHttpBody(payload) {
1442
+ if (isRecord(payload) && Array.isArray(payload.content)) {
1443
+ return {
1444
+ content: payload.content,
1445
+ structuredContent: payload.structuredContent,
1446
+ isError: payload.isError === true
1447
+ };
1448
+ }
1449
+ const text = typeof payload === "string" ? payload : JSON.stringify(payload, null, 2);
1450
+ return {
1451
+ content: [{ type: "text", text }],
1452
+ structuredContent: payload,
1453
+ isError: false
1454
+ };
1455
+ }
1456
+ async function whoamiWithApiToken(input) {
1457
+ const apiUrl = input.apiUrl || defaultApiUrl;
1458
+ const current = await openApiGet({
1459
+ ...input,
1460
+ apiUrl,
1461
+ path: "v1/tokens/current"
1462
+ });
1463
+ let user = null;
1464
+ try {
1465
+ const me = await openApiGet({
1466
+ ...input,
1467
+ apiUrl,
1468
+ path: "v1/me"
1469
+ });
1470
+ user = {
1471
+ userId: String(me.user_id ?? ""),
1472
+ email: String(me.email ?? ""),
1473
+ displayName: String(me.display_name ?? "")
1474
+ };
1475
+ } catch (error) {
1476
+ if (!(error instanceof OpenApiError && error.status === 403)) throw error;
1477
+ }
1478
+ return {
1479
+ apiUrl,
1480
+ token: {
1481
+ id: String(current.id ?? ""),
1482
+ name: typeof current.name === "string" ? current.name : null,
1483
+ scopes: Array.isArray(current.scopes) ? current.scopes.filter(
1484
+ (scope) => typeof scope === "string"
1485
+ ) : [],
1486
+ expiresAt: typeof current.expires_at === "string" ? current.expires_at : null,
1487
+ maxExpiresAt: typeof current.max_expires_at === "string" ? current.max_expires_at : null
1488
+ },
1489
+ user
1490
+ };
1491
+ }
1492
+ async function readJson(response) {
1493
+ const text = await response.text();
1494
+ if (!text) return null;
1495
+ try {
1496
+ return JSON.parse(text);
1497
+ } catch {
1498
+ return text;
1499
+ }
1500
+ }
1501
+ function readErrorBody(body) {
1502
+ if (!isRecord(body) || body.error == null) return null;
1503
+ const { error } = body;
1504
+ if (typeof error === "string") return { code: null, message: error };
1505
+ if (isRecord(error)) {
1506
+ const code = typeof error.code === "string" ? error.code : null;
1507
+ const message = typeof error.message === "string" ? error.message : code ?? JSON.stringify(error);
1508
+ return { code, message };
1509
+ }
1510
+ return { code: null, message: String(error) };
1511
+ }
1512
+ function describeOpenApiFailure(status, body, url) {
1513
+ const failure = readErrorBody(body);
1514
+ const code = failure?.code ?? null;
1515
+ const detail = failure?.message ? ` Server said: ${failure.message}` : "";
1516
+ if (status === 401) {
1517
+ return new OpenApiError(
1518
+ `Kody rejected the API token (expired, revoked, or malformed). Mint a fresh scoped token and pass it with --token or ${apiTokenEnvVar}.${detail}`,
1519
+ { status, code }
1520
+ );
1521
+ }
1522
+ if (status === 403 && code === "insufficient_scope") {
1523
+ return new OpenApiError(
1524
+ `${insufficientScopeMessage({
1525
+ ...readInsufficientScopeDetails(body),
1526
+ currentLifetime: currentStoredTokenLifetimeAlias(url.origin)
1527
+ })}${detail}`,
1528
+ { status, code }
1529
+ );
1530
+ }
1531
+ if (code === "feature_disabled") {
1532
+ return new OpenApiError(`Kody returned feature_disabled.${detail}`, {
1533
+ status,
1534
+ code
1535
+ });
1536
+ }
1537
+ return new OpenApiError(
1538
+ failure?.message ?? `Kody API request failed with HTTP ${status} (${url.pathname}).`,
1539
+ { status, code }
1540
+ );
1541
+ }
1542
+ function isRecord(value) {
1543
+ return value !== null && typeof value === "object" && !Array.isArray(value);
1544
+ }
1545
+
1546
+ export {
1547
+ OpenApiError,
1548
+ openApiDocumentPath,
1549
+ cliCredentialBootstrapRedeemOperationId,
1550
+ openApiGet,
1551
+ openApiRequest,
1552
+ callOpenApiOperation,
1553
+ assertApiOperationAllowed,
1554
+ buildOpenApiHttpRequest,
1555
+ apiOperationUsesQueryInputs,
1556
+ loadOpenApiOperations,
1557
+ indexOpenApiOperations,
1558
+ clearOpenApiRouteCache,
1559
+ searchWithApiToken,
1560
+ toolResultFromHttpBody,
1561
+ whoamiWithApiToken
1562
+ };
1563
+ //# sourceMappingURL=chunk-W2SAFAT4.js.map