@vibesdotdev/client 0.1.1 → 1.0.0-rc.2

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 (238) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -15
  3. package/dist/api-client-plugin.d.ts +4 -0
  4. package/dist/api-client-plugin.d.ts.map +1 -0
  5. package/dist/api-client-plugin.js +20 -0
  6. package/dist/api-client-plugin.js.map +1 -0
  7. package/dist/api-client.impl.d.ts +23 -0
  8. package/dist/api-client.impl.d.ts.map +1 -0
  9. package/dist/api-client.impl.js +47 -0
  10. package/dist/api-client.impl.js.map +1 -0
  11. package/dist/client.consumer.plugin.d.ts +3 -0
  12. package/dist/client.consumer.plugin.d.ts.map +1 -0
  13. package/dist/client.consumer.plugin.js +10 -0
  14. package/dist/client.consumer.plugin.js.map +1 -0
  15. package/dist/cloud.plugin.d.ts +3 -0
  16. package/dist/cloud.plugin.d.ts.map +1 -0
  17. package/dist/cloud.plugin.js +10 -0
  18. package/dist/cloud.plugin.js.map +1 -0
  19. package/dist/config/client.config.descriptor.d.ts +4 -0
  20. package/dist/config/client.config.descriptor.d.ts.map +1 -0
  21. package/dist/config/client.config.descriptor.js +32 -0
  22. package/dist/config/client.config.descriptor.js.map +1 -0
  23. package/dist/config/index.d.ts +3 -0
  24. package/dist/config/index.d.ts.map +1 -0
  25. package/dist/config/index.js +3 -0
  26. package/dist/config/index.js.map +1 -0
  27. package/dist/config/settings.d.ts +9 -0
  28. package/dist/config/settings.d.ts.map +1 -0
  29. package/dist/config/settings.js +25 -0
  30. package/dist/config/settings.js.map +1 -0
  31. package/dist/docs/client.api-request.docs.descriptor.d.ts +4 -0
  32. package/dist/docs/client.api-request.docs.descriptor.d.ts.map +1 -0
  33. package/dist/docs/client.api-request.docs.descriptor.js +71 -0
  34. package/dist/docs/client.api-request.docs.descriptor.js.map +1 -0
  35. package/dist/events/auth-rejected.event.d.ts +35 -0
  36. package/dist/events/auth-rejected.event.d.ts.map +1 -0
  37. package/dist/events/auth-rejected.event.js +36 -0
  38. package/dist/events/auth-rejected.event.js.map +1 -0
  39. package/dist/factory.d.ts +5 -1
  40. package/dist/factory.d.ts.map +1 -1
  41. package/dist/factory.js +16 -17
  42. package/dist/factory.js.map +1 -1
  43. package/dist/index.d.ts +3 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +2 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/kind-augment.d.ts +11 -0
  48. package/dist/kind-augment.d.ts.map +1 -0
  49. package/dist/kind-augment.js +2 -0
  50. package/dist/kind-augment.js.map +1 -0
  51. package/dist/lib/client/api-diagnostics.d.ts +79 -0
  52. package/dist/lib/client/api-diagnostics.d.ts.map +1 -0
  53. package/dist/lib/client/api-diagnostics.js +111 -0
  54. package/dist/lib/client/api-diagnostics.js.map +1 -0
  55. package/dist/lib/client/configured.d.ts +78 -0
  56. package/dist/lib/client/configured.d.ts.map +1 -0
  57. package/dist/lib/client/configured.js +261 -0
  58. package/dist/lib/client/configured.js.map +1 -0
  59. package/dist/lib/client/internal/auth-headers.d.ts +11 -0
  60. package/dist/lib/client/internal/auth-headers.d.ts.map +1 -0
  61. package/dist/lib/client/internal/auth-headers.js +35 -0
  62. package/dist/lib/client/internal/auth-headers.js.map +1 -0
  63. package/dist/lib/client/internal/base-client.d.ts +5 -2
  64. package/dist/lib/client/internal/base-client.d.ts.map +1 -1
  65. package/dist/lib/client/internal/base-client.js +42 -22
  66. package/dist/lib/client/internal/base-client.js.map +1 -1
  67. package/dist/lib/client/internal/base-helpers.d.ts.map +1 -1
  68. package/dist/lib/client/internal/base-helpers.js +20 -20
  69. package/dist/lib/client/internal/base-helpers.js.map +1 -1
  70. package/dist/lib/client/internal/base-types.d.ts +10 -5
  71. package/dist/lib/client/internal/base-types.d.ts.map +1 -1
  72. package/dist/lib/client/internal/base-types.js +5 -3
  73. package/dist/lib/client/internal/base-types.js.map +1 -1
  74. package/dist/lib/client/internal/client-values.d.ts +43 -0
  75. package/dist/lib/client/internal/client-values.d.ts.map +1 -0
  76. package/dist/lib/client/internal/client-values.js +76 -0
  77. package/dist/lib/client/internal/client-values.js.map +1 -0
  78. package/dist/lib/client/internal/endpoint.d.ts +6 -5
  79. package/dist/lib/client/internal/endpoint.d.ts.map +1 -1
  80. package/dist/lib/client/internal/endpoint.js +3 -0
  81. package/dist/lib/client/internal/endpoint.js.map +1 -1
  82. package/dist/lib/client/internal/generator.d.ts +98 -9
  83. package/dist/lib/client/internal/generator.d.ts.map +1 -1
  84. package/dist/lib/client/internal/generator.js +92 -140
  85. package/dist/lib/client/internal/generator.js.map +1 -1
  86. package/dist/lib/client/internal/request-builder.d.ts +5 -2
  87. package/dist/lib/client/internal/request-builder.d.ts.map +1 -1
  88. package/dist/lib/client/internal/request-builder.js +105 -65
  89. package/dist/lib/client/internal/request-builder.js.map +1 -1
  90. package/dist/lib/client/internal/sse-stream.d.ts +9 -5
  91. package/dist/lib/client/internal/sse-stream.d.ts.map +1 -1
  92. package/dist/lib/client/internal/sse-stream.js +96 -94
  93. package/dist/lib/client/internal/sse-stream.js.map +1 -1
  94. package/dist/lib/client/internal/timeout-signal.d.ts +8 -0
  95. package/dist/lib/client/internal/timeout-signal.d.ts.map +1 -0
  96. package/dist/lib/client/internal/timeout-signal.js +17 -0
  97. package/dist/lib/client/internal/timeout-signal.js.map +1 -0
  98. package/dist/lib/client/internal/transport/http2-fetch.d.ts +8 -0
  99. package/dist/lib/client/internal/transport/http2-fetch.d.ts.map +1 -0
  100. package/dist/lib/client/internal/transport/http2-fetch.js +17 -0
  101. package/dist/lib/client/internal/transport/http2-fetch.js.map +1 -0
  102. package/dist/lib/client/internal/vibes-client.d.ts +17 -8
  103. package/dist/lib/client/internal/vibes-client.d.ts.map +1 -1
  104. package/dist/lib/client/internal/vibes-client.js +127 -67
  105. package/dist/lib/client/internal/vibes-client.js.map +1 -1
  106. package/dist/lib/client/internal/wrap-fetch.d.ts +3 -2
  107. package/dist/lib/client/internal/wrap-fetch.d.ts.map +1 -1
  108. package/dist/lib/client/internal/wrap-fetch.js +14 -33
  109. package/dist/lib/client/internal/wrap-fetch.js.map +1 -1
  110. package/dist/lib/client/runtime-fetch.d.ts +14 -0
  111. package/dist/lib/client/runtime-fetch.d.ts.map +1 -0
  112. package/dist/lib/client/runtime-fetch.js +25 -0
  113. package/dist/lib/client/runtime-fetch.js.map +1 -0
  114. package/dist/lib/client/types.d.ts +18 -9
  115. package/dist/lib/client/types.d.ts.map +1 -1
  116. package/dist/lib/client/types.js +22 -3
  117. package/dist/lib/client/types.js.map +1 -1
  118. package/dist/plugin.d.ts +2 -18
  119. package/dist/plugin.d.ts.map +1 -1
  120. package/dist/plugin.js +7 -74
  121. package/dist/plugin.js.map +1 -1
  122. package/dist/runtime-client.d.ts +10 -0
  123. package/dist/runtime-client.d.ts.map +1 -0
  124. package/dist/runtime-client.js +14 -0
  125. package/dist/runtime-client.js.map +1 -0
  126. package/dist/schemas/auth-rejected.d.ts +12 -0
  127. package/dist/schemas/auth-rejected.d.ts.map +1 -0
  128. package/dist/schemas/auth-rejected.js +11 -0
  129. package/dist/schemas/auth-rejected.js.map +1 -0
  130. package/dist/schemas/sdk-languages.d.ts +47 -0
  131. package/dist/schemas/sdk-languages.d.ts.map +1 -0
  132. package/dist/schemas/sdk-languages.js +75 -0
  133. package/dist/schemas/sdk-languages.js.map +1 -0
  134. package/dist/schemas/settings.d.ts +14 -0
  135. package/dist/schemas/settings.d.ts.map +1 -0
  136. package/dist/schemas/settings.js +10 -0
  137. package/dist/schemas/settings.js.map +1 -0
  138. package/dist/schemas/validated-request.d.ts +19 -0
  139. package/dist/schemas/validated-request.d.ts.map +1 -0
  140. package/dist/schemas/validated-request.js +2 -0
  141. package/dist/schemas/validated-request.js.map +1 -0
  142. package/dist/schemas.d.ts +23 -8
  143. package/dist/schemas.d.ts.map +1 -1
  144. package/dist/schemas.js +8 -2
  145. package/dist/schemas.js.map +1 -1
  146. package/dist/sse-client.d.ts +17 -15
  147. package/dist/sse-client.d.ts.map +1 -1
  148. package/dist/sse-client.js +111 -91
  149. package/dist/sse-client.js.map +1 -1
  150. package/dist/svelte/client-svelte.plugin.d.ts +3 -0
  151. package/dist/svelte/client-svelte.plugin.d.ts.map +1 -0
  152. package/dist/svelte/client-svelte.plugin.js +35 -0
  153. package/dist/svelte/index.d.ts +3 -0
  154. package/dist/svelte/index.d.ts.map +1 -0
  155. package/dist/svelte/index.js +2 -0
  156. package/dist/svelte/styles.css +8 -0
  157. package/dist/svelte/tool-widgets/ApiRequestToolCard.svelte +53 -0
  158. package/dist/svelte/tool-widgets/ApiRequestToolCard.svelte.d.ts +5 -0
  159. package/dist/svelte/tool-widgets/ApiRequestToolCard.svelte.d.ts.map +1 -0
  160. package/dist/svelte/tool-widgets/index.d.ts +2 -0
  161. package/dist/svelte/tool-widgets/index.d.ts.map +1 -0
  162. package/dist/svelte/tool-widgets/index.js +1 -0
  163. package/dist/tools/api-request/api-request.contract.d.ts +19 -0
  164. package/dist/tools/api-request/api-request.contract.d.ts.map +1 -0
  165. package/dist/tools/api-request/api-request.contract.js +110 -0
  166. package/dist/tools/api-request/api-request.contract.js.map +1 -0
  167. package/dist/tools/api-request/api-request.descriptor.d.ts +11 -4
  168. package/dist/tools/api-request/api-request.descriptor.d.ts.map +1 -1
  169. package/dist/tools/api-request/api-request.descriptor.js +8 -5
  170. package/dist/tools/api-request/api-request.descriptor.js.map +1 -1
  171. package/dist/tools/api-request/api-request.impl.cloud.d.ts +15 -0
  172. package/dist/tools/api-request/api-request.impl.cloud.d.ts.map +1 -0
  173. package/dist/tools/api-request/api-request.impl.cloud.js +75 -0
  174. package/dist/tools/api-request/api-request.impl.cloud.js.map +1 -0
  175. package/dist/tools/api-request/api-request.impl.consumer.d.ts +5 -3
  176. package/dist/tools/api-request/api-request.impl.consumer.d.ts.map +1 -1
  177. package/dist/tools/api-request/api-request.impl.consumer.js +27 -33
  178. package/dist/tools/api-request/api-request.impl.consumer.js.map +1 -1
  179. package/dist/tools/api-request/api-request.view.d.ts +29 -0
  180. package/dist/tools/api-request/api-request.view.d.ts.map +1 -0
  181. package/dist/tools/api-request/api-request.view.js +62 -0
  182. package/dist/tools/api-request/api-request.view.js.map +1 -0
  183. package/dist/tools/api-request/schemas/index.d.ts +12 -5
  184. package/dist/tools/api-request/schemas/index.d.ts.map +1 -1
  185. package/dist/tools/api-request/schemas/index.js +24 -6
  186. package/dist/tools/api-request/schemas/index.js.map +1 -1
  187. package/dist/tui/client-tui.plugin.d.ts +3 -0
  188. package/dist/tui/client-tui.plugin.d.ts.map +1 -0
  189. package/dist/tui/client-tui.plugin.js +32 -0
  190. package/dist/tui/client-tui.plugin.js.map +1 -0
  191. package/dist/tui/index.d.ts +2 -0
  192. package/dist/tui/index.d.ts.map +1 -0
  193. package/dist/tui/index.js +2 -0
  194. package/dist/tui/index.js.map +1 -0
  195. package/dist/tui/tool-widgets/ApiRequestToolWidget.impl.tui.d.ts +17 -0
  196. package/dist/tui/tool-widgets/ApiRequestToolWidget.impl.tui.d.ts.map +1 -0
  197. package/dist/tui/tool-widgets/ApiRequestToolWidget.impl.tui.js +28 -0
  198. package/dist/tui/tool-widgets/ApiRequestToolWidget.impl.tui.js.map +1 -0
  199. package/dist/validated-request.d.ts +27 -0
  200. package/dist/validated-request.d.ts.map +1 -0
  201. package/dist/validated-request.js +119 -0
  202. package/dist/validated-request.js.map +1 -0
  203. package/package.json +188 -41
  204. package/dist/lib/client/internal/node/http2-fetch.node.d.ts +0 -2
  205. package/dist/lib/client/internal/node/http2-fetch.node.d.ts.map +0 -1
  206. package/dist/lib/client/internal/node/http2-fetch.node.js +0 -131
  207. package/dist/lib/client/internal/node/http2-fetch.node.js.map +0 -1
  208. package/dist/lib/client/node.d.ts +0 -5
  209. package/dist/lib/client/node.d.ts.map +0 -1
  210. package/dist/lib/client/node.js +0 -33
  211. package/dist/lib/client/node.js.map +0 -1
  212. package/dist/tools/api-request/index.d.ts +0 -5
  213. package/dist/tools/api-request/index.d.ts.map +0 -1
  214. package/dist/tools/api-request/index.js +0 -4
  215. package/dist/tools/api-request/index.js.map +0 -1
  216. package/src/factory.ts +0 -114
  217. package/src/index.ts +0 -15
  218. package/src/lib/client/core.ts +0 -13
  219. package/src/lib/client/internal/base-client.ts +0 -107
  220. package/src/lib/client/internal/base-helpers.ts +0 -74
  221. package/src/lib/client/internal/base-types.ts +0 -42
  222. package/src/lib/client/internal/endpoint.ts +0 -51
  223. package/src/lib/client/internal/generator.ts +0 -181
  224. package/src/lib/client/internal/index.ts +0 -4
  225. package/src/lib/client/internal/node/http2-fetch.node.ts +0 -138
  226. package/src/lib/client/internal/request-builder.ts +0 -147
  227. package/src/lib/client/internal/sse-stream.ts +0 -130
  228. package/src/lib/client/internal/vibes-client.ts +0 -167
  229. package/src/lib/client/internal/wrap-fetch.ts +0 -59
  230. package/src/lib/client/node.ts +0 -36
  231. package/src/lib/client/types.ts +0 -156
  232. package/src/plugin.ts +0 -104
  233. package/src/schemas.ts +0 -91
  234. package/src/sse-client.ts +0 -155
  235. package/src/tools/api-request/api-request.descriptor.ts +0 -28
  236. package/src/tools/api-request/api-request.impl.consumer.ts +0 -66
  237. package/src/tools/api-request/index.ts +0 -4
  238. package/src/tools/api-request/schemas/index.ts +0 -29
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VIBES DEV LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,22 +1,31 @@
1
1
  # @vibesdotdev/client
2
2
 
3
- Base API client utilities with Vibes runtime integration.
4
-
5
- This package is part of the public Vibes framework package set. The source repository is private while the public repository split is being prepared, so package documentation is published on the Vibes docs site.
6
-
7
- ## Install
3
+ Public MIT HTTP clients, streaming helpers and runtime integration.
8
4
 
9
5
  ```sh
10
6
  bun add @vibesdotdev/client
11
- # or
12
- npm install @vibesdotdev/client
13
7
  ```
14
8
 
15
- ## Documentation
16
-
17
- - Package guide: https://docs.vibes.dev/packages/client
18
- - Vibes docs: https://docs.vibes.dev
19
-
20
- ## License
21
-
22
- MIT
9
+ Compose `@vibesdotdev/client/api-client-plugin` for the API kind and semantic
10
+ client. Resolve `runtime/client#client` with
11
+ `getVibesClient<RuntimeApiClient>('client', runtime)`; its `resolve(id)` and
12
+ `descriptors()` use the live `api/client` catalog.
13
+
14
+ `@vibesdotdev/client/plugin` adds the universal tool contract and discovery
15
+ topic. Tool execution now requires the explicit `./consumer.plugin` or
16
+ `./cloud.plugin` composition plus the Tools kind owner. These slices load only
17
+ their respective implementations. UI plugins remain at `./svelte/plugin`
18
+ and `./tui/plugin`.
19
+
20
+ Factories, core HTTP methods and streaming remain available. `./config`
21
+ preserves the settings descriptor, schema and loader: defaults, runtime manifest,
22
+ then explicit caller overrides. Portable `./runtime-fetch`, `./configured`
23
+ and `./api-diagnostics` retain all three historical `./node*` aliases; their
24
+ three source files are the package's declared `vibes.compositionRoots`, so
25
+ nothing else is reachable behind a `./node*` door.
26
+
27
+ Run `bun run check`, `bun run test` and `bun run build` for type, in-process
28
+ runtime and production build checks. These commands do not prove release delivery.
29
+ See [SPEC.md](SPEC.md) for the public contract and [package guide](https://docs.vibes.dev/client).
30
+
31
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,4 @@
1
+ import './kind-augment.ts';
2
+ declare const apiClientPlugin: import("@vibesdotdev/kernel").RuntimePlugin;
3
+ export default apiClientPlugin;
4
+ //# sourceMappingURL=api-client-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client-plugin.d.ts","sourceRoot":"","sources":["../src/api-client-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAQ3B,QAAA,MAAM,eAAe,6CAUnB,CAAC;AACH,eAAe,eAAe,CAAC"}
@@ -0,0 +1,20 @@
1
+ import "./kind-augment.js";
2
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel';
3
+ import { runtimeClientPlugin } from '@vibesdotdev/kernel/client';
4
+ import { ApiClientDescriptorSchema } from "./schemas.js";
5
+ import DefaultApiClient from "./api-client.impl.js";
6
+ import clientConfigDescriptor from "./config/client.config.descriptor.js";
7
+ import clientAuthRejectedEvent from "./events/auth-rejected.event.js";
8
+ const apiClientPlugin = createRuntimePlugin({
9
+ id: 'client.api-client',
10
+ name: 'API client contract',
11
+ kinds: [{ id: 'api/client', descriptorSchema: ApiClientDescriptorSchema, defaultImplementation: DefaultApiClient }],
12
+ descriptors: [
13
+ clientConfigDescriptor, clientAuthRejectedEvent,
14
+ { kind: 'runtime/client', id: 'client', description: 'Runtime-owned access to registered API clients' }
15
+ ],
16
+ loaders: [loader('client', { kind: 'runtime/client' }, () => import("./runtime-client.js"))],
17
+ onRegister: async (runtime) => { await runtime.registerPlugin(runtimeClientPlugin); }
18
+ });
19
+ export default apiClientPlugin;
20
+ //# sourceMappingURL=api-client-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client-plugin.js","sourceRoot":"","sources":["../src/api-client-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,sBAAsB,MAAM,sCAAsC,CAAC;AAC1E,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AAEtE,MAAM,eAAe,GAAG,mBAAmB,CAAC;IAC3C,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC;IACnH,WAAW,EAAE;QACZ,sBAAsB,EAAE,uBAAuB;QAC/C,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,gDAAgD,EAAE;KACvG;IACD,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC5F,UAAU,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACnF,CAAC,CAAC;AACH,eAAe,eAAe,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type RequestBody } from './lib/client/internal/client-values.ts';
2
+ import './kind-augment.ts';
3
+ import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
4
+ import { type ApiClientImplementation, type ApiStreamEvent } from './schemas.ts';
5
+ import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
6
+ /**
7
+ * Default API client implementation.
8
+ *
9
+ * When no specific client implementation is registered for a descriptor,
10
+ * this default constructs a client using the descriptor's baseUrl.
11
+ */
12
+ export default class DefaultApiClient implements ApiClientImplementation {
13
+ private client;
14
+ constructor(descriptor: RuntimeDescriptor, context: KindContext);
15
+ get<T = unknown>(endpoint: string, options?: Parameters<ApiClientImplementation['get']>[1]): Promise<T>;
16
+ post<T = unknown>(endpoint: string, body?: RequestBody, options?: Parameters<ApiClientImplementation['post']>[2]): Promise<T>;
17
+ put<T = unknown>(endpoint: string, body?: RequestBody, options?: Parameters<ApiClientImplementation['put']>[2]): Promise<T>;
18
+ patch<T = unknown>(endpoint: string, body?: RequestBody, options?: Parameters<ApiClientImplementation['patch']>[2]): Promise<T>;
19
+ delete<T = unknown>(endpoint: string, options?: Parameters<ApiClientImplementation['delete']>[1]): Promise<T>;
20
+ request<T = unknown>(endpoint: string, options?: Parameters<ApiClientImplementation['request']>[1]): Promise<T>;
21
+ stream<T = unknown>(endpoint: string, options?: Parameters<ApiClientImplementation['stream']>[1]): AsyncIterableIterator<ApiStreamEvent<T>>;
22
+ }
23
+ //# sourceMappingURL=api-client.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.impl.d.ts","sourceRoot":"","sources":["../src/api-client.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAG3F,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAEN,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,uBAAuB;IACvE,OAAO,CAAC,MAAM,CAA0B;gBAE5B,UAA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O,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,UAAU,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GACxD,qBAAqB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;CAG3C"}
@@ -0,0 +1,47 @@
1
+ import { readClientValue } from "./lib/client/internal/client-values.js";
2
+ // The plugin subpath is the owner surface for `api/client`; loading it must
3
+ // install the kind's runtime query types without requiring a root import.
4
+ import "./kind-augment.js";
5
+ import { ApiClientDescriptorSchema } from "./schemas.js";
6
+ import { vibesApiClient } from "./factory.js";
7
+ /**
8
+ * Default API client implementation.
9
+ *
10
+ * When no specific client implementation is registered for a descriptor,
11
+ * this default constructs a client using the descriptor's baseUrl.
12
+ */
13
+ export default class DefaultApiClient {
14
+ client;
15
+ constructor(descriptor, context) {
16
+ const parsed = readClientValue(ApiClientDescriptorSchema, descriptor, 'api-client-descriptor-invalid');
17
+ this.client = vibesApiClient({
18
+ id: parsed.id,
19
+ baseUrl: parsed.baseUrl,
20
+ timeout: parsed.timeout,
21
+ debug: parsed.debug,
22
+ runtime: context.runtime
23
+ });
24
+ }
25
+ get(endpoint, options) {
26
+ return this.client.get(endpoint, options);
27
+ }
28
+ post(endpoint, body, options) {
29
+ return this.client.post(endpoint, body, options);
30
+ }
31
+ put(endpoint, body, options) {
32
+ return this.client.put(endpoint, body, options);
33
+ }
34
+ patch(endpoint, body, options) {
35
+ return this.client.patch(endpoint, body, options);
36
+ }
37
+ delete(endpoint, options) {
38
+ return this.client.delete(endpoint, options);
39
+ }
40
+ request(endpoint, options) {
41
+ return this.client.request(endpoint, options);
42
+ }
43
+ stream(endpoint, options) {
44
+ return this.client.stream(endpoint, options);
45
+ }
46
+ }
47
+ //# sourceMappingURL=api-client.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.impl.js","sourceRoot":"","sources":["../src/api-client.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,E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M,CACL,QAAgB,EAChB,OAA0D;QAE1D,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAI,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,CACN,QAAgB,EAChB,OAA2D;QAE3D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAI,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CACL,QAAgB,EAChB,OAA0D;QAE1D,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAI,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACD"}
@@ -0,0 +1,3 @@
1
+ declare const plugin: import("@vibesdotdev/kernel").RuntimePlugin;
2
+ export default plugin;
3
+ //# sourceMappingURL=client.consumer.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.consumer.plugin.d.ts","sourceRoot":"","sources":["../src/client.consumer.plugin.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,6CAMV,CAAC;AACH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel';
2
+ import clientPlugin from "./plugin.js";
3
+ const plugin = createRuntimePlugin({
4
+ id: 'client.consumer',
5
+ name: 'Client consumer tools',
6
+ loaders: [loader('api-request', { kind: 'tools/tool', scope: 'consumer' }, () => import("./tools/api-request/api-request.impl.consumer.js"))],
7
+ onRegister: async (runtime) => { await runtime.registerPlugin(clientPlugin); }
8
+ });
9
+ export default plugin;
10
+ //# sourceMappingURL=client.consumer.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.consumer.plugin.js","sourceRoot":"","sources":["../src/client.consumer.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,YAAY,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,GAAG,mBAAmB,CAAC;IAClC,EAAE,EAAE,iBAAiB;IACrB,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,EACxE,GAAG,EAAE,CAAC,MAAM,CAAC,kDAAkD,CAAC,CAAC,CAAC;IACnE,UAAU,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAC5E,CAAC,CAAC;AACH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const plugin: import("@vibesdotdev/kernel").RuntimePlugin;
2
+ export default plugin;
3
+ //# sourceMappingURL=cloud.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud.plugin.d.ts","sourceRoot":"","sources":["../src/cloud.plugin.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,6CAMV,CAAC;AACH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel';
2
+ import clientPlugin from "./plugin.js";
3
+ const plugin = createRuntimePlugin({
4
+ id: 'client.cloud',
5
+ name: 'Client cloud tools',
6
+ loaders: [loader('api-request', { kind: 'tools/tool', scope: 'cloud' }, () => import("./tools/api-request/api-request.impl.cloud.js"))],
7
+ onRegister: async (runtime) => { await runtime.registerPlugin(clientPlugin); }
8
+ });
9
+ export default plugin;
10
+ //# sourceMappingURL=cloud.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud.plugin.js","sourceRoot":"","sources":["../src/cloud.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,YAAY,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,GAAG,mBAAmB,CAAC;IAClC,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EACrE,GAAG,EAAE,CAAC,MAAM,CAAC,+CAA+C,CAAC,CAAC,CAAC;IAChE,UAAU,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAC5E,CAAC,CAAC;AACH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ConfigManifestDescriptor } from '@vibesdotdev/config';
2
+ declare const descriptor: ConfigManifestDescriptor;
3
+ export default descriptor;
4
+ //# sourceMappingURL=client.config.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.config.descriptor.d.ts","sourceRoot":"","sources":["../../src/config/client.config.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGpE,QAAA,MAAM,UAAU,EAAE,wBA4BjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ClientSettingsSchema, CLIENT_MANIFEST_ID } from "../schemas/settings.js";
2
+ const descriptor = {
3
+ kind: 'config/manifest',
4
+ id: CLIENT_MANIFEST_ID,
5
+ name: 'API client',
6
+ description: 'HTTP client timeout, debug, and local TLS verification settings.',
7
+ namespace: 'client',
8
+ schema: ClientSettingsSchema,
9
+ storedLayer: 'none',
10
+ allowedAdapters: ['storage.json', 'storage.localdb'],
11
+ scope: 'global',
12
+ customTables: false,
13
+ version: 1,
14
+ internal: false,
15
+ tier: 'user',
16
+ category: 'client',
17
+ fields: {
18
+ timeoutMs: { ui: { label: 'Request timeout (ms)' } },
19
+ debug: { ui: { label: 'Debug logging', component: 'switch' } },
20
+ warnOas: { ui: { label: 'Warn on OpenAPI load failure', component: 'switch' } },
21
+ allowInsecureLocalTls: {
22
+ ui: {
23
+ label: 'Allow insecure local TLS',
24
+ description: 'Skip certificate verification (local development only).',
25
+ component: 'switch'
26
+ }
27
+ }
28
+ },
29
+ enabled: true
30
+ };
31
+ export default descriptor;
32
+ //# sourceMappingURL=client.config.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.config.descriptor.js","sourceRoot":"","sources":["../../src/config/client.config.descriptor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAElF,MAAM,UAAU,GAA6B;IAC5C,IAAI,EAAE,iBAAiB;IACvB,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,kEAAkE;IAC/E,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,oBAAoB;IAC5B,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,CAAC,cAAc,EAAE,iBAAiB,CAAC;IACpD,KAAK,EAAE,QAAQ;IACf,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE;QACP,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE;QACpD,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;QAC9D,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;QAC/E,qBAAqB,EAAE;YACtB,EAAE,EAAE;gBACH,KAAK,EAAE,0BAA0B;gBACjC,WAAW,EAAE,yDAAyD;gBACtE,SAAS,EAAE,QAAQ;aACnB;SACD;KACD;IACD,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from './client.config.descriptor.ts';
2
+ export * from './settings.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from "./client.config.descriptor.js";
2
+ export * from "./settings.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,cAAc,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type ClientSettings, type ClientSettingsRuntime } from '../schemas/settings.ts';
2
+ import type { ClientConfig } from '../lib/client/types.ts';
3
+ export { ClientSettingsSchema, CLIENT_MANIFEST_ID } from '../schemas/settings.ts';
4
+ export type { ClientSettings, ClientSettingsRuntime } from '../schemas/settings.ts';
5
+ /**
6
+ * Schema defaults, then the `client` manifest, then an explicit caller overlay.
7
+ */
8
+ export declare function loadClientSettings(runtime: ClientSettingsRuntime | undefined, overlay?: Pick<ClientConfig, 'timeout' | 'debug'>): Promise<ClientSettings>;
9
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/config/settings.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4C,KAAK,cAAc,EAA4B,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC7J,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAClF,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAUpF;;MAEG;AACH,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,qBAAqB,GAAG,SAAS,EAC1C,OAAO,GAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,OAAO,CAAM,GACnD,OAAO,CAAC,cAAc,CAAC,CAOzB"}
@@ -0,0 +1,25 @@
1
+ import { ConfigManifest } from '@vibesdotdev/config/manifest/config-manifest';
2
+ import { readClientFields, readClientValue } from "../lib/client/internal/client-values.js";
3
+ import { ClientSettingsSchema, CLIENT_MANIFEST_ID } from "../schemas/settings.js";
4
+ export { ClientSettingsSchema, CLIENT_MANIFEST_ID } from "../schemas/settings.js";
5
+ function callerLayer(overlay) {
6
+ const { timeout, debug } = overlay;
7
+ const layer = {};
8
+ if (timeout !== undefined)
9
+ layer.timeoutMs = timeout;
10
+ if (debug !== undefined)
11
+ layer.debug = debug;
12
+ return layer;
13
+ }
14
+ /**
15
+ * Schema defaults, then the `client` manifest, then an explicit caller overlay.
16
+ */
17
+ export async function loadClientSettings(runtime, overlay = {}) {
18
+ const caller = readClientFields(() => callerLayer(overlay), 'client-config-unreadable');
19
+ if (runtime && ConfigManifest.isRegistered(runtime, CLIENT_MANIFEST_ID)) {
20
+ const loaded = await ConfigManifest.forRuntime(runtime, CLIENT_MANIFEST_ID).load();
21
+ return readClientValue(ClientSettingsSchema, readClientFields(() => ({ ...loaded, ...caller }), 'client-config-unreadable'), 'client-config-invalid');
22
+ }
23
+ return readClientValue(ClientSettingsSchema, caller, 'client-config-invalid');
24
+ }
25
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/config/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAA6E,MAAM,wBAAwB,CAAC;AAE7J,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGlF,SAAS,WAAW,CAAC,OAAgD;IACpE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IACnC,MAAM,KAAK,GAAwB,EAAE,CAAC;IACtC,IAAI,OAAO,KAAK,SAAS;QAAE,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC;IACrD,IAAI,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7C,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;MAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,OAA0C,EAC1C,UAAmD,EAAE;IAErD,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,0BAA0B,CAAC,CAAC;IACxF,IAAI,OAAO,IAAI,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE,CAAC;QACzE,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,UAAU,CAAiB,OAAO,EAAE,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAC;QACnG,OAAO,eAAe,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,0BAA0B,CAAC,EAAE,uBAAuB,CAAC,CAAC;IACvJ,CAAC;IACD,OAAO,eAAe,CAAC,oBAAoB,EAAE,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DocsTopicDescriptor } from '@vibesdotdev/docs-contracts';
2
+ declare const descriptor: DocsTopicDescriptor;
3
+ export default descriptor;
4
+ //# sourceMappingURL=client.api-request.docs.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.api-request.docs.descriptor.d.ts","sourceRoot":"","sources":["../../src/docs/client.api-request.docs.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA8CvE,QAAA,MAAM,UAAU,EAAE,mBA0BjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,71 @@
1
+ const source = `---
2
+ title: Authenticated cross-app API requests
3
+ summary: Call a named Vibes app through catalog-owned origins and caller-scoped auth
4
+ tags: [api, tools, runtime, auth, agents]
5
+ parent: cli
6
+ order: 36
7
+ surfaces: [cli, in-app]
8
+ hardware: [consumer, cloud]
9
+ ---
10
+
11
+ # Authenticated cross-app API requests
12
+
13
+ The \`api-request\` runtime tool calls one explicitly named Vibes app. The app
14
+ must be declared as an \`infra/service\` in the configured service
15
+ environment; callers provide a relative path, never an origin. This makes the
16
+ service catalog—not hostname guessing or tool input—the source of routing
17
+ truth.
18
+
19
+ \`\`\`json
20
+ {
21
+ "app": "platform",
22
+ "method": "GET",
23
+ "path": "/api/projects",
24
+ "query": { "limit": 20 }
25
+ }
26
+ \`\`\`
27
+
28
+ ## Auth boundary
29
+
30
+ - Consumer execution resolves the explicitly registered authenticated
31
+ \`api/client#auth\`; it does not read credentials directly.
32
+ - Cloud agent/worker execution requires a caller-scoped JWT or canonical Better
33
+ Auth session cookie in \`ToolCallContext\` metadata. Only the auth cookie is
34
+ forwarded; unrelated host cookies are discarded.
35
+ - Input \`Authorization\`, \`Cookie\`, \`X-Api-Key\`, and equivalent auth
36
+ headers are rejected.
37
+ - MCP discovery is intentionally disabled until the MCP adapter threads a
38
+ verified caller principal into \`ToolCallContext\`. A safe tool that always
39
+ fails is not a shipped MCP capability.
40
+
41
+ Errors preserve a stable contract code and, when the transport supplies one,
42
+ the upstream HTTP status. An unavailable app is not reported as an empty result.
43
+ `;
44
+ const descriptor = {
45
+ kind: 'docs/topic',
46
+ id: 'client.api-request',
47
+ title: 'Authenticated cross-app API requests',
48
+ summary: 'Call a named Vibes app through catalog-owned origins and caller-scoped auth',
49
+ body: { type: 'markdown', sourceType: 'raw', source },
50
+ parent: 'cli',
51
+ order: 36,
52
+ tags: ['api', 'tools', 'runtime', 'auth', 'agents'],
53
+ surfaces: ['cli', 'in-app'],
54
+ hardware: ['consumer', 'cloud'],
55
+ enabled: true,
56
+ man: {
57
+ name: 'client.api-request - authenticated Vibes app requests',
58
+ section: 1,
59
+ synopsis: 'vibes docs show client.api-request',
60
+ options: [],
61
+ examples: [
62
+ {
63
+ description: 'Read projects through the named platform app',
64
+ command: 'vibes tools run api-request --input \'{"app":"platform","method":"GET","path":"/api/projects"}\''
65
+ }
66
+ ],
67
+ seeAlso: ['cli.commands', 'docs.cli']
68
+ }
69
+ };
70
+ export default descriptor;
71
+ //# sourceMappingURL=client.api-request.docs.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.api-request.docs.descriptor.js","sourceRoot":"","sources":["../../src/docs/client.api-request.docs.descriptor.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Cd,CAAC;AAEF,MAAM,UAAU,GAAwB;IACvC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,sCAAsC;IAC7C,OAAO,EAAE,6EAA6E;IACtF,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE;IACrD,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC;IACnD,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;IAC3B,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,IAAI;IACb,GAAG,EAAE;QACJ,IAAI,EAAE,uDAAuD;QAC7D,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,oCAAoC;QAC9C,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE;YACT;gBACC,WAAW,EAAE,8CAA8C;gBAC3D,OAAO,EACN,kGAAkG;aACnG;SACD;QACD,OAAO,EAAE,CAAC,cAAc,EAAE,UAAU,CAAC;KACrC;CACD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `client.auth-rejected`: an origin answered a client request 401 or 403.
3
+ *
4
+ * A runtime-native `runtime/event`. The client emits it for every refused
5
+ * request, after any session refresh it attempted; owners of a credential the
6
+ * request may have carried subscribe (`runtime/subscription`) and drop what
7
+ * they cached about it, so a server-side revocation surfaces on the next call.
8
+ * The payload is the answering origin and the status only
9
+ * (`ClientAuthRejectedPayloadSchema`, declared as this event's
10
+ * `payloadSchema`).
11
+ */
12
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
13
+ import { type ClientAuthRejectedPayload } from '../schemas/auth-rejected.ts';
14
+ /** Hook-bus namespace (the event `source`). */
15
+ export declare const CLIENT_AUTH_REJECTED_NAMESPACE = "client";
16
+ /** Hook-bus event name (the trailing id segment). */
17
+ export declare const CLIENT_AUTH_REJECTED_EVENT_NAME = "auth-rejected";
18
+ /** The `runtime/event` id subscriptions reference. */
19
+ export declare const CLIENT_AUTH_REJECTED_EVENT_ID = "client.auth-rejected";
20
+ export declare const clientAuthRejectedEvent: {
21
+ kind: "runtime/event";
22
+ id: string;
23
+ source: string;
24
+ name: string;
25
+ description: string;
26
+ trigger: string;
27
+ payloadSchema: import("zod/v4").ZodObject<{
28
+ origin: import("zod/v4").ZodString;
29
+ status: import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodLiteral<401>, import("zod/v4").ZodLiteral<403>]>;
30
+ }, import("zod/v4/core").$strict>;
31
+ };
32
+ /** Publish `client.auth-rejected` on the runtime's hook bus. */
33
+ export declare function emitClientAuthRejected(runtime: RuntimeRef, payload: ClientAuthRejectedPayload): Promise<void>;
34
+ export default clientAuthRejectedEvent;
35
+ //# sourceMappingURL=auth-rejected.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-rejected.event.d.ts","sourceRoot":"","sources":["../../src/events/auth-rejected.event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAmC,KAAK,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE9G,+CAA+C;AAC/C,eAAO,MAAM,8BAA8B,WAAW,CAAC;AACvD,qDAAqD;AACrD,eAAO,MAAM,+BAA+B,kBAAkB,CAAC;AAC/D,sDAAsD;AACtD,eAAO,MAAM,6BAA6B,yBAAyB,CAAC;AAEpE,eAAO,MAAM,uBAAuB;;;;;;;;;;;CAQlC,CAAC;AAEH,gEAAgE;AAChE,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAInH;AAED,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `client.auth-rejected`: an origin answered a client request 401 or 403.
3
+ *
4
+ * A runtime-native `runtime/event`. The client emits it for every refused
5
+ * request, after any session refresh it attempted; owners of a credential the
6
+ * request may have carried subscribe (`runtime/subscription`) and drop what
7
+ * they cached about it, so a server-side revocation surfaces on the next call.
8
+ * The payload is the answering origin and the status only
9
+ * (`ClientAuthRejectedPayloadSchema`, declared as this event's
10
+ * `payloadSchema`).
11
+ */
12
+ import { createRuntimeAsset } from '@vibesdotdev/kernel';
13
+ import { ClientAuthRejectedPayloadSchema } from "../schemas/auth-rejected.js";
14
+ /** Hook-bus namespace (the event `source`). */
15
+ export const CLIENT_AUTH_REJECTED_NAMESPACE = 'client';
16
+ /** Hook-bus event name (the trailing id segment). */
17
+ export const CLIENT_AUTH_REJECTED_EVENT_NAME = 'auth-rejected';
18
+ /** The `runtime/event` id subscriptions reference. */
19
+ export const CLIENT_AUTH_REJECTED_EVENT_ID = 'client.auth-rejected';
20
+ export const clientAuthRejectedEvent = createRuntimeAsset({
21
+ kind: 'runtime/event',
22
+ id: CLIENT_AUTH_REJECTED_EVENT_ID,
23
+ source: CLIENT_AUTH_REJECTED_NAMESPACE,
24
+ name: 'Client Auth Rejected',
25
+ description: 'An origin answered a client request 401 or 403; carries the origin and the status only.',
26
+ trigger: 'custom',
27
+ payloadSchema: ClientAuthRejectedPayloadSchema
28
+ });
29
+ /** Publish `client.auth-rejected` on the runtime's hook bus. */
30
+ export async function emitClientAuthRejected(runtime, payload) {
31
+ await runtime
32
+ .hooks(CLIENT_AUTH_REJECTED_NAMESPACE)
33
+ .emit(CLIENT_AUTH_REJECTED_EVENT_NAME, ClientAuthRejectedPayloadSchema.parse(payload));
34
+ }
35
+ export default clientAuthRejectedEvent;
36
+ //# sourceMappingURL=auth-rejected.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-rejected.event.js","sourceRoot":"","sources":["../../src/events/auth-rejected.event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,kBAAkB,EAAmB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,+BAA+B,EAAkC,MAAM,6BAA6B,CAAC;AAE9G,+CAA+C;AAC/C,MAAM,CAAC,MAAM,8BAA8B,GAAG,QAAQ,CAAC;AACvD,qDAAqD;AACrD,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAAC;AAC/D,sDAAsD;AACtD,MAAM,CAAC,MAAM,6BAA6B,GAAG,sBAAsB,CAAC;AAEpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;IACzD,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,6BAA6B;IACjC,MAAM,EAAE,8BAA8B;IACtC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,yFAAyF;IACtG,OAAO,EAAE,QAAQ;IACjB,aAAa,EAAE,+BAA+B;CAC9C,CAAC,CAAC;AAEH,gEAAgE;AAChE,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,OAAmB,EAAE,OAAkC;IACnG,MAAM,OAAO;SACX,KAAK,CAAmE,8BAA8B,CAAC;SACvG,IAAI,CAAC,+BAA+B,EAAE,+BAA+B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,eAAe,uBAAuB,CAAC"}
package/dist/factory.d.ts CHANGED
@@ -1,5 +1,7 @@
1
+ import type { RuntimeRef } from '@vibesdotdev/kernel';
1
2
  import { VibesClient } from './lib/client/core.ts';
2
3
  import type { AuthConfig } from './lib/client/types.ts';
4
+ import type { ClientFetch } from './lib/client/types.ts';
3
5
  import type { ApiClientImplementation } from './schemas.ts';
4
6
  export interface ApiClientConfig {
5
7
  /** Unique identifier for this client instance */
@@ -9,13 +11,15 @@ export interface ApiClientConfig {
9
11
  /** Authentication configuration */
10
12
  auth?: AuthConfig;
11
13
  /** Custom fetch implementation */
12
- fetch?: typeof fetch;
14
+ fetch?: ClientFetch;
13
15
  /** Request timeout in milliseconds */
14
16
  timeout?: number;
15
17
  /** Enable debug logging */
16
18
  debug?: boolean;
17
19
  /** Custom headers applied to all requests */
18
20
  headers?: Record<string, string>;
21
+ /** Runtime whose lifecycle owns request deadlines; optional for hosts without one (browser SDK use). */
22
+ runtime?: RuntimeRef;
19
23
  }
20
24
  /**
21
25
  * Create an API client instance.
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EACX,uBAAuB,EAIvB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW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