@vibesdotdev/runtime-client 0.0.1 → 0.0.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.
package/README.md CHANGED
@@ -1,97 +1,22 @@
1
1
  # @vibesdotdev/runtime-client
2
2
 
3
- The `runtime/client` kind and `BaseRuntimeClient`. Every module that exposes
4
- functionality across the monorepo does so through exactly one client registered
5
- under this kind.
3
+ Base client helpers for resolving module-level Vibes clients through the runtime.
6
4
 
7
- ## Authoring a new client
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.
8
6
 
9
- Mechanical recipe. No variation.
7
+ ## Install
10
8
 
11
- ### 1. Define the client class
12
-
13
- ```ts
14
- // <module>/src/lib/client/runtime-client.ts
15
- import { BaseRuntimeClient, type RuntimeClientDescriptor } from '@vibesdotdev/runtime-client';
16
- import type { VibesRuntime } from '@vibesdotdev/runtime';
17
-
18
- export class MyModuleClient extends BaseRuntimeClient {
19
- constructor(
20
- descriptor: RuntimeClientDescriptor = { id: 'my-module', kind: 'runtime/client' },
21
- context?: unknown,
22
- runtime?: VibesRuntime,
23
- ) {
24
- super(descriptor, context, runtime);
25
- }
26
-
27
- async doSomething(/* … */) {
28
- // resolve other kinds via this.runtime.query(...)
29
- }
30
- }
31
- ```
32
-
33
- ### 2. Register in the module's plugin
34
-
35
- ```ts
36
- export default createRuntimePlugin({
37
- id: 'my-module',
38
- dependencies: ['runtime-client', /* … */],
39
- onRegister(runtime) {
40
- runtime.registerDescriptor('runtime/client', {
41
- id: 'my-module',
42
- kind: 'runtime/client',
43
- description: 'Canonical MyModule client',
44
- });
45
- runtime.registerLoader('runtime/client', 'my-module', async () => {
46
- const { MyModuleClient } = await import('./client/runtime-client.js');
47
- return { impl: MyModuleClient };
48
- });
49
- },
50
- });
51
- ```
52
-
53
- ### 3. Export the ambient helper
54
-
55
- ```ts
56
- // <module>/src/lib/client/helper.ts
57
- import { getVibesClient } from '@vibesdotdev/runtime-client';
58
- import type { MyModuleClient } from './runtime-client';
59
-
60
- export async function getVibesMyModuleClient(): Promise<MyModuleClient> {
61
- return getVibesClient<MyModuleClient>('my-module');
62
- }
9
+ ```sh
10
+ bun add @vibesdotdev/runtime-client
11
+ # or
12
+ npm install @vibesdotdev/runtime-client
63
13
  ```
64
14
 
65
- ### 4. Expose via module barrel + `package.json` subpath
15
+ ## Documentation
66
16
 
67
- ```ts
68
- // <module>/src/lib/client/index.ts
69
- export { MyModuleClient } from './runtime-client';
70
- export { getVibesMyModuleClient } from './helper';
71
- export type * from './contracts';
72
- ```
73
-
74
- Add `"./client"` to the module's `package.json#exports`.
75
-
76
- ## Consuming another module's client
77
-
78
- ```ts
79
- import { getVibesToolsClient } from '@vibesdotdev/tools/client';
80
- const tools = await getVibesToolsClient();
81
- const agent = await tools.getAgent('assistant');
82
- ```
83
-
84
- If the other module exposes only kinds (no client), use `runtime.query('<kind>').…`
85
- directly. Never deep-import another module's internals.
86
-
87
- ## Test
88
-
89
- ```bash
90
- bun test src/__tests__/
91
- ```
17
+ - Package guide: https://docs.vibes.dev/packages/runtime-client
18
+ - Vibes docs: https://docs.vibes.dev
92
19
 
93
- ## Docs
20
+ ## License
94
21
 
95
- - [SPEC.md](./SPEC.md) — package contract, owned surfaces, hard rules
96
- - [runtime](../runtime/SPEC.md) — registry/query layer this builds on
97
- - [client](../client/SPEC.md) — sister `api/client` kind for HTTP clients
22
+ MIT
@@ -303,10 +303,10 @@ export const aiPlugin = createRuntimePlugin({
303
303
 
304
304
  ## Code paths
305
305
 
306
- - Base class: [\`packages/runtime-client/src/base.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/base.ts)
307
- - Contract: [\`packages/runtime-client/src/contract.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/contract.ts)
308
- - Schema: [\`packages/runtime-client/src/schema.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/schema.ts)
309
- - Kind: [\`packages/runtime-client/src/kind.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/kind.ts)
306
+ - Base class: \`packages/runtime-client/src/base.ts\`
307
+ - Contract: \`packages/runtime-client/src/contract.ts\`
308
+ - Schema: \`packages/runtime-client/src/schema.ts\`
309
+ - Kind: \`packages/runtime-client/src/kind.ts\`
310
310
 
311
311
  :::card{title="See also"}
312
312
  - [\`runtime-client.helpers\`](runtime-client.helpers) — \`getVibesClient()\` helper functions
@@ -312,9 +312,9 @@ describe('ContentGenerator', () => {
312
312
 
313
313
  ## Code paths
314
314
 
315
- - Helper implementation: [\`packages/runtime-client/src/helper.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/helper.ts)
316
- - Plugin registration: [\`packages/runtime-client/src/plugin.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/plugin.ts)
317
- - Kind definition: [\`packages/runtime-client/src/kind.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/kind.ts)
315
+ - Helper implementation: \`packages/runtime-client/src/helper.ts\`
316
+ - Plugin registration: \`packages/runtime-client/src/plugin.ts\`
317
+ - Kind definition: \`packages/runtime-client/src/kind.ts\`
318
318
 
319
319
  :::card{title="See also"}
320
320
  - [\`runtime-client.api\`](runtime-client.api) — BaseRuntimeClient and extension patterns
@@ -423,10 +423,10 @@ export class NotificationService {
423
423
 
424
424
  ## Code paths
425
425
 
426
- - CLI bootstrap: [\`packages/cli/src/bootstrap.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/cli/src/bootstrap.ts)
427
- - Runtime bootstrap: [\`packages/runtime/src/bootstrap/index.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime/src/bootstrap/index.ts)
428
- - Helper: [\`packages/runtime-client/src/helper.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/helper.ts)
429
- - Plugin: [\`packages/runtime-client/src/plugin.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/plugin.ts)
426
+ - CLI bootstrap: \`packages/cli/src/bootstrap.ts\`
427
+ - Runtime bootstrap: \`packages/runtime/src/bootstrap/index.ts\`
428
+ - Helper: \`packages/runtime-client/src/helper.ts\`
429
+ - Plugin: \`packages/runtime-client/src/plugin.ts\`
430
430
 
431
431
  :::card{title="See also"}
432
432
  - [\`runtime-client.api\`](runtime-client.api) — BaseRuntimeClient and extension patterns
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vibesdotdev/runtime-client",
3
- "version": "0.0.1",
4
- "description": "Shared base + `runtime/client` kind for module-level vibes clients (one client per module, runtime-resolved).",
3
+ "version": "0.0.2",
4
+ "description": "Base client helpers for resolving module-level Vibes clients through the runtime.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@vibesdotdev/runtime": "0.0.1"
23
+ "@vibesdotdev/runtime": "0.0.2"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "tsc -p tsconfig.json",
@@ -32,7 +32,6 @@
32
32
  "src",
33
33
  "bin",
34
34
  "README.md",
35
- "SPEC.md",
36
35
  "LICENSE",
37
36
  "!src/**/__tests__/**",
38
37
  "!src/**/__stubs__/**",
@@ -57,5 +56,9 @@
57
56
  },
58
57
  "vibes": {
59
58
  "visibility": "public-framework"
59
+ },
60
+ "homepage": "https://docs.vibes.dev/packages/runtime-client",
61
+ "bugs": {
62
+ "url": "https://docs.vibes.dev/packages/runtime-client#support"
60
63
  }
61
64
  }
@@ -305,10 +305,10 @@ export const aiPlugin = createRuntimePlugin({
305
305
 
306
306
  ## Code paths
307
307
 
308
- - Base class: [\`packages/runtime-client/src/base.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/base.ts)
309
- - Contract: [\`packages/runtime-client/src/contract.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/contract.ts)
310
- - Schema: [\`packages/runtime-client/src/schema.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/schema.ts)
311
- - Kind: [\`packages/runtime-client/src/kind.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/kind.ts)
308
+ - Base class: \`packages/runtime-client/src/base.ts\`
309
+ - Contract: \`packages/runtime-client/src/contract.ts\`
310
+ - Schema: \`packages/runtime-client/src/schema.ts\`
311
+ - Kind: \`packages/runtime-client/src/kind.ts\`
312
312
 
313
313
  :::card{title="See also"}
314
314
  - [\`runtime-client.helpers\`](runtime-client.helpers) — \`getVibesClient()\` helper functions
@@ -314,9 +314,9 @@ describe('ContentGenerator', () => {
314
314
 
315
315
  ## Code paths
316
316
 
317
- - Helper implementation: [\`packages/runtime-client/src/helper.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/helper.ts)
318
- - Plugin registration: [\`packages/runtime-client/src/plugin.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/plugin.ts)
319
- - Kind definition: [\`packages/runtime-client/src/kind.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/kind.ts)
317
+ - Helper implementation: \`packages/runtime-client/src/helper.ts\`
318
+ - Plugin registration: \`packages/runtime-client/src/plugin.ts\`
319
+ - Kind definition: \`packages/runtime-client/src/kind.ts\`
320
320
 
321
321
  :::card{title="See also"}
322
322
  - [\`runtime-client.api\`](runtime-client.api) — BaseRuntimeClient and extension patterns
@@ -425,10 +425,10 @@ export class NotificationService {
425
425
 
426
426
  ## Code paths
427
427
 
428
- - CLI bootstrap: [\`packages/cli/src/bootstrap.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/cli/src/bootstrap.ts)
429
- - Runtime bootstrap: [\`packages/runtime/src/bootstrap/index.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime/src/bootstrap/index.ts)
430
- - Helper: [\`packages/runtime-client/src/helper.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/helper.ts)
431
- - Plugin: [\`packages/runtime-client/src/plugin.ts\`](https://github.com/vibesdotdev/monorepo/tree/main/packages/runtime-client/src/plugin.ts)
428
+ - CLI bootstrap: \`packages/cli/src/bootstrap.ts\`
429
+ - Runtime bootstrap: \`packages/runtime/src/bootstrap/index.ts\`
430
+ - Helper: \`packages/runtime-client/src/helper.ts\`
431
+ - Plugin: \`packages/runtime-client/src/plugin.ts\`
432
432
 
433
433
  :::card{title="See also"}
434
434
  - [\`runtime-client.api\`](runtime-client.api) — BaseRuntimeClient and extension patterns
package/SPEC.md DELETED
@@ -1,44 +0,0 @@
1
- # @vibesdotdev/runtime-client
2
-
3
- The `runtime/client` kind + the shared base every module-level client extends. One client per module, runtime-resolved.
4
-
5
- ## Owns
6
-
7
- - `runtime/client` kind (registered via `./plugin`)
8
- - `BaseRuntimeClient` abstract class — ambient runtime acquisition, idempotent `load()`/`ensureLoaded()`, optional `config/manifest` auto-load via `descriptor.configManifestId`, `onLoad`/`onDispose` hooks, `(descriptor, context?, runtime?)` constructor signature
9
- - `RuntimeClient` interface (`./contract`)
10
- - `RuntimeClientDescriptor` zod schema (`./schema`)
11
- - `getVibesClient<T>(id)` ambient helper
12
-
13
- ## Does not own
14
-
15
- - HTTP abstraction → [`@vibesdotdev/client`](../client/SPEC.md) (`api/client` kind)
16
- - Config manager → [`@vibesdotdev/config`](../config/SPEC.md) (`config/manifest` kind)
17
- - Registry / kind resolution → [`@vibesdotdev/runtime`](../runtime/SPEC.md)
18
- - Any module's domain methods — those live on each module's subclass
19
-
20
- ## Hard rules
21
-
22
- - **One client per module.** No split HTTP-vs-in-process clients. No module-specific factories competing with the canonical one.
23
- - **All module clients extend `BaseRuntimeClient`.** They do not reimplement lifecycle, config-load, or runtime acquisition.
24
- - **Scope selection lives inside the client**, never in consumers. Consumers call `client.foo()` and never branch on hardware/connection mode.
25
- - **Cross-module access goes through (1) the other module's client, or (2) direct `runtime.query('<kind>')` for primitives.** Never deep-import another module's internals. Never duplicate another module's types.
26
- - **Two sanctioned client flavors only:** `runtime/client` (this package) and `api/client` ([`@vibesdotdev/client`](../client/SPEC.md)). New flavors require a SPEC update.
27
- - This package depends only on `@vibesdotdev/runtime` and `zod`. It does not import any module's domain code.
28
-
29
- ## Public entrypoints
30
-
31
- - `.` — `BaseRuntimeClient`, `getVibesClient`, `RuntimeClient` type, descriptor schema (barrel)
32
- - `./plugin` — `runtimeClientPlugin` (registers the kind)
33
- - `./contract` — `RuntimeClient` (type-only)
34
- - `./schema` — `RuntimeClientDescriptor` zod schema
35
- - `./base` — `BaseRuntimeClient`
36
-
37
- ## Verification
38
-
39
- `bun test src/__tests__/`. Covers kind registration, base lifecycle, `getVibesClient` resolution, descriptor schema.
40
-
41
- ## Links
42
-
43
- - [runtime/SPEC.md](../runtime/SPEC.md)
44
- - [client/SPEC.md](../client/SPEC.md) — sister `api/client` kind