@nimbus-dev/client 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +32 -10
- package/dist/ask-stream.d.ts.map +1 -1
- package/dist/ask-stream.js +110 -72
- package/dist/ask-stream.js.map +1 -1
- package/dist/index.cjs +364 -95
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ipc-transport.d.ts +15 -1
- package/dist/ipc-transport.d.ts.map +1 -1
- package/dist/ipc-transport.js +50 -6
- package/dist/ipc-transport.js.map +1 -1
- package/dist/mock-client.d.ts +13 -15
- package/dist/mock-client.d.ts.map +1 -1
- package/dist/mock-client.js +4 -3
- package/dist/mock-client.js.map +1 -1
- package/dist/nimbus-client.d.ts +65 -2
- package/dist/nimbus-client.d.ts.map +1 -1
- package/dist/nimbus-client.js +25 -13
- package/dist/nimbus-client.js.map +1 -1
- package/dist/paths.js.map +1 -1
- package/dist/validate.d.ts +51 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +218 -0
- package/dist/validate.js.map +1 -0
- package/package.json +16 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nimbus Contributors
|
|
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
|
@@ -17,12 +17,35 @@ Run `bun run build` in this package before publishing (`prepublishOnly` does thi
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { NimbusClient, IPCClient } from "@nimbus-dev/client";
|
|
19
19
|
|
|
20
|
-
const client = await NimbusClient.open({
|
|
20
|
+
const client = await NimbusClient.open({
|
|
21
|
+
socketPath: "/tmp/nimbus-gateway.sock",
|
|
22
|
+
requestTimeoutMs: 30_000, // optional; per-request timeout, 0 disables. Default 30s.
|
|
23
|
+
});
|
|
21
24
|
const out = await client.queryItems({ services: ["github"], limit: 10 });
|
|
22
25
|
await client.close();
|
|
23
26
|
```
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
`NimbusClient` and `MockClient` both implement `NimbusClientLike`, so you can type
|
|
29
|
+
against the interface and swap the in-memory `MockClient` into unit tests when no
|
|
30
|
+
Gateway process is available.
|
|
31
|
+
|
|
32
|
+
### Validated responses
|
|
33
|
+
|
|
34
|
+
Every `NimbusClient` method validates the Gateway's JSON-RPC result before
|
|
35
|
+
returning it. A malformed or version-skewed response throws an `IpcResponseError`
|
|
36
|
+
at the call site rather than silently returning mistyped data:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { IpcResponseError } from "@nimbus-dev/client";
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const head = await client.egressHead();
|
|
43
|
+
} catch (err) {
|
|
44
|
+
if (err instanceof IpcResponseError) {
|
|
45
|
+
// The gateway returned a shape this client version doesn't understand.
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
26
49
|
|
|
27
50
|
### Egress ledger (provable locality)
|
|
28
51
|
|
|
@@ -40,14 +63,13 @@ const proof = await client.egressProveWindow({ since: Date.now() - 3_600_000 });
|
|
|
40
63
|
|
|
41
64
|
## Publishing (maintainers)
|
|
42
65
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```
|
|
66
|
+
Releases are automated by [release-please](https://github.com/googleapis/release-please).
|
|
67
|
+
Merged [Conventional Commits](https://www.conventionalcommits.org/) on `main` open a
|
|
68
|
+
release PR; merging it tags the release and triggers `.github/workflows/release.yml`,
|
|
69
|
+
which publishes `@nimbus-dev/client` to npm with `npm publish --provenance` via GitHub
|
|
70
|
+
Actions OIDC / npm **trusted-publisher**. There is **no long-lived npm token** — the
|
|
71
|
+
trusted-publisher binding authenticates the workflow and attaches a verifiable provenance
|
|
72
|
+
attestation (see [`SECURITY.md`](./SECURITY.md)).
|
|
51
73
|
|
|
52
74
|
## See also
|
|
53
75
|
|
package/dist/ask-stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-stream.d.ts","sourceRoot":"","sources":["../src/ask-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAIzF,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,gBAAqB,GAC1B,eAAe,
|
|
1
|
+
{"version":3,"file":"ask-stream.d.ts","sourceRoot":"","sources":["../src/ask-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAIzF,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,gBAAqB,GAC1B,eAAe,CAgNjB"}
|
package/dist/ask-stream.js
CHANGED
|
@@ -5,6 +5,11 @@ export function createAskStream(ipc, input, opts = {}) {
|
|
|
5
5
|
let streamIdResolved;
|
|
6
6
|
let cancelled = false;
|
|
7
7
|
let unsubscribers = [];
|
|
8
|
+
// Notifications that arrive before engine.askStream resolves the streamId are
|
|
9
|
+
// buffered here and replayed once the id is known (see the subscribe-before-send
|
|
10
|
+
// note below), so tokens pipelined in the same socket chunk as the RPC response
|
|
11
|
+
// are not lost.
|
|
12
|
+
let early = [];
|
|
8
13
|
const push = (ev) => {
|
|
9
14
|
if (done)
|
|
10
15
|
return;
|
|
@@ -19,6 +24,7 @@ export function createAskStream(ipc, input, opts = {}) {
|
|
|
19
24
|
if (done)
|
|
20
25
|
return;
|
|
21
26
|
done = true;
|
|
27
|
+
early = [];
|
|
22
28
|
for (const u of unsubscribers)
|
|
23
29
|
u();
|
|
24
30
|
unsubscribers = [];
|
|
@@ -27,72 +33,85 @@ export function createAskStream(ipc, input, opts = {}) {
|
|
|
27
33
|
w.resolve({ value: undefined, done: true });
|
|
28
34
|
}
|
|
29
35
|
};
|
|
36
|
+
const cancelUpstream = async (sid) => {
|
|
37
|
+
await ipc.call("engine.cancelStream", { streamId: sid }).catch(() => undefined);
|
|
38
|
+
};
|
|
30
39
|
const matchesStream = (params) => {
|
|
31
40
|
return (typeof params === "object" &&
|
|
32
41
|
params !== null &&
|
|
33
42
|
typeof params.streamId === "string");
|
|
34
43
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
push({ type: "token", text });
|
|
42
|
-
};
|
|
43
|
-
const onDone = (params) => {
|
|
44
|
-
if (!matchesStream(params) || params.streamId !== streamId)
|
|
45
|
-
return;
|
|
46
|
-
const meta = params.meta ?? {};
|
|
47
|
-
const reply = typeof meta.reply === "string" ? meta.reply : "";
|
|
48
|
-
const sessionId = typeof meta.sessionId === "string" ? meta.sessionId : "";
|
|
49
|
-
push({ type: "done", reply, sessionId });
|
|
50
|
-
finish();
|
|
51
|
-
};
|
|
52
|
-
const onError = (params) => {
|
|
53
|
-
if (!matchesStream(params) || params.streamId !== streamId)
|
|
54
|
-
return;
|
|
55
|
-
const code = typeof params.code === "string"
|
|
56
|
-
? params.code
|
|
57
|
-
: "stream_error";
|
|
58
|
-
const message = typeof params.error === "string"
|
|
59
|
-
? params.error
|
|
60
|
-
: "Stream error";
|
|
61
|
-
push({ type: "error", code, message });
|
|
62
|
-
finish();
|
|
63
|
-
};
|
|
64
|
-
const onSubTask = (params) => {
|
|
65
|
-
if (!matchesStream(params) || params.streamId !== streamId)
|
|
66
|
-
return;
|
|
67
|
-
const p = params;
|
|
68
|
-
if (typeof p.subTaskId !== "string" || typeof p.status !== "string")
|
|
69
|
-
return;
|
|
70
|
-
const ev = typeof p.progress === "number"
|
|
71
|
-
? {
|
|
72
|
-
type: "subTaskProgress",
|
|
73
|
-
subTaskId: p.subTaskId,
|
|
74
|
-
status: p.status,
|
|
75
|
-
progress: p.progress,
|
|
76
|
-
}
|
|
77
|
-
: { type: "subTaskProgress", subTaskId: p.subTaskId, status: p.status };
|
|
78
|
-
push(ev);
|
|
79
|
-
};
|
|
80
|
-
const onHitl = (params) => {
|
|
81
|
-
if (!matchesStream(params) || params.streamId !== streamId)
|
|
82
|
-
return;
|
|
83
|
-
const p = params;
|
|
84
|
-
if (typeof p.requestId !== "string" || typeof p.prompt !== "string")
|
|
85
|
-
return;
|
|
86
|
-
push({ type: "hitlBatch", requestId: p.requestId, prompt: p.prompt, details: p.details });
|
|
44
|
+
// Wrap a typed handler so it (a) buffers events that arrive before the streamId
|
|
45
|
+
// is known and (b) only fires for events tagged with *our* streamId.
|
|
46
|
+
const whenMatched = (handler) => (params) => {
|
|
47
|
+
const run = () => {
|
|
48
|
+
if (matchesStream(params) && params.streamId === streamIdResolved)
|
|
49
|
+
handler(params);
|
|
87
50
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
51
|
+
if (streamIdResolved === undefined) {
|
|
52
|
+
early.push(run);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
run();
|
|
56
|
+
};
|
|
57
|
+
const onToken = whenMatched((params) => {
|
|
58
|
+
const text = params.text;
|
|
59
|
+
if (typeof text === "string")
|
|
60
|
+
push({ type: "token", text });
|
|
61
|
+
});
|
|
62
|
+
const onDone = whenMatched((params) => {
|
|
63
|
+
const meta = params.meta ?? {};
|
|
64
|
+
const reply = typeof meta.reply === "string" ? meta.reply : "";
|
|
65
|
+
const sessionId = typeof meta.sessionId === "string" ? meta.sessionId : "";
|
|
66
|
+
push({ type: "done", reply, sessionId });
|
|
67
|
+
finish();
|
|
68
|
+
});
|
|
69
|
+
const onError = whenMatched((params) => {
|
|
70
|
+
const p = params;
|
|
71
|
+
const code = typeof p.code === "string" ? p.code : "stream_error";
|
|
72
|
+
const message = typeof p.error === "string" ? p.error : "Stream error";
|
|
73
|
+
push({ type: "error", code, message });
|
|
74
|
+
finish();
|
|
75
|
+
});
|
|
76
|
+
const onSubTask = whenMatched((params) => {
|
|
77
|
+
const p = params;
|
|
78
|
+
if (typeof p.subTaskId !== "string" || typeof p.status !== "string")
|
|
79
|
+
return;
|
|
80
|
+
const ev = typeof p.progress === "number"
|
|
81
|
+
? {
|
|
82
|
+
type: "subTaskProgress",
|
|
83
|
+
subTaskId: p.subTaskId,
|
|
84
|
+
status: p.status,
|
|
85
|
+
progress: p.progress,
|
|
86
|
+
}
|
|
87
|
+
: { type: "subTaskProgress", subTaskId: p.subTaskId, status: p.status };
|
|
88
|
+
push(ev);
|
|
89
|
+
});
|
|
90
|
+
const onHitl = whenMatched((params) => {
|
|
91
|
+
const p = params;
|
|
92
|
+
if (typeof p.requestId !== "string" || typeof p.prompt !== "string")
|
|
93
|
+
return;
|
|
94
|
+
push({ type: "hitlBatch", requestId: p.requestId, prompt: p.prompt, details: p.details });
|
|
95
|
+
});
|
|
96
|
+
// Register notification handlers *before* sending engine.askStream. The RPC
|
|
97
|
+
// response and the first stream notifications flow over the same socket and are
|
|
98
|
+
// dispatched synchronously line-by-line, so a handler attached only after the
|
|
99
|
+
// awaited response would miss tokens delivered in the same chunk.
|
|
100
|
+
const register = (method, handler) => {
|
|
101
|
+
ipc.onNotification(method, handler);
|
|
102
|
+
unsubscribers.push(() => ipc.offNotification(method, handler));
|
|
103
|
+
};
|
|
104
|
+
register("engine.streamToken", onToken);
|
|
105
|
+
register("engine.streamDone", onDone);
|
|
106
|
+
register("engine.streamError", onError);
|
|
107
|
+
register("agent.subTaskProgress", onSubTask);
|
|
108
|
+
register("agent.hitlBatch", onHitl);
|
|
109
|
+
const onAbort = () => {
|
|
110
|
+
cancelled = true;
|
|
111
|
+
const sid = streamIdResolved;
|
|
112
|
+
if (sid !== undefined)
|
|
113
|
+
void cancelUpstream(sid);
|
|
114
|
+
finish();
|
|
96
115
|
};
|
|
97
116
|
const startPromise = (async () => {
|
|
98
117
|
const params = { input };
|
|
@@ -108,27 +127,42 @@ export function createAskStream(ipc, input, opts = {}) {
|
|
|
108
127
|
throw new Error("no_stream_id");
|
|
109
128
|
}
|
|
110
129
|
streamIdResolved = sid;
|
|
130
|
+
// Replay notifications that arrived before the streamId was known.
|
|
131
|
+
const buffered = early;
|
|
132
|
+
early = [];
|
|
133
|
+
for (const run of buffered)
|
|
134
|
+
run();
|
|
135
|
+
// A cancel/return that fired before the id resolved still needs to reach the
|
|
136
|
+
// gateway now that we know the streamId — check this before the `done` guard.
|
|
111
137
|
if (cancelled) {
|
|
112
|
-
await
|
|
138
|
+
await cancelUpstream(sid);
|
|
113
139
|
finish();
|
|
114
140
|
return sid;
|
|
115
141
|
}
|
|
116
|
-
|
|
142
|
+
if (done)
|
|
143
|
+
return sid;
|
|
117
144
|
if (opts.signal !== undefined) {
|
|
118
|
-
|
|
119
|
-
|
|
145
|
+
const signal = opts.signal;
|
|
146
|
+
if (signal.aborted) {
|
|
147
|
+
await cancelUpstream(sid);
|
|
120
148
|
finish();
|
|
121
149
|
}
|
|
122
150
|
else {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
finish();
|
|
126
|
-
});
|
|
151
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
152
|
+
unsubscribers.push(() => signal.removeEventListener("abort", onAbort));
|
|
127
153
|
}
|
|
128
154
|
}
|
|
129
155
|
return sid;
|
|
130
156
|
})();
|
|
131
|
-
startPromise.catch(() => {
|
|
157
|
+
startPromise.catch((err) => {
|
|
158
|
+
// A failed stream start (transport/RPC rejection) surfaces as an error event
|
|
159
|
+
// so a `for await` consumer can distinguish it from a clean empty stream.
|
|
160
|
+
// No-op if the stream already finished (e.g. the no_stream_id path above).
|
|
161
|
+
push({
|
|
162
|
+
type: "error",
|
|
163
|
+
code: "stream_start_failed",
|
|
164
|
+
message: err instanceof Error ? err.message : String(err),
|
|
165
|
+
});
|
|
132
166
|
finish();
|
|
133
167
|
});
|
|
134
168
|
const handle = {
|
|
@@ -139,9 +173,8 @@ export function createAskStream(ipc, input, opts = {}) {
|
|
|
139
173
|
async cancel() {
|
|
140
174
|
cancelled = true;
|
|
141
175
|
const sid = streamIdResolved;
|
|
142
|
-
if (sid !== undefined)
|
|
143
|
-
await
|
|
144
|
-
}
|
|
176
|
+
if (sid !== undefined)
|
|
177
|
+
await cancelUpstream(sid);
|
|
145
178
|
finish();
|
|
146
179
|
},
|
|
147
180
|
[Symbol.asyncIterator]() {
|
|
@@ -159,6 +192,11 @@ export function createAskStream(ipc, input, opts = {}) {
|
|
|
159
192
|
});
|
|
160
193
|
},
|
|
161
194
|
return() {
|
|
195
|
+
// Breaking out of `for await` must also tell the gateway to stop.
|
|
196
|
+
cancelled = true;
|
|
197
|
+
const sid = streamIdResolved;
|
|
198
|
+
if (sid !== undefined)
|
|
199
|
+
void cancelUpstream(sid);
|
|
162
200
|
finish();
|
|
163
201
|
return Promise.resolve({ value: undefined, done: true });
|
|
164
202
|
},
|
package/dist/ask-stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-stream.js","sourceRoot":"","sources":["../src/ask-stream.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,eAAe,CAC7B,GAAc,EACd,KAAa,EACb,
|
|
1
|
+
{"version":3,"file":"ask-stream.js","sourceRoot":"","sources":["../src/ask-stream.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,eAAe,CAC7B,GAAc,EACd,KAAa,EACb,IAAI,GAAqB,EAAE;IAE3B,MAAM,KAAK,GAAkB,EAAE,CAAC;IAChC,MAAM,OAAO,GAAc,EAAE,CAAC;IAC9B,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,gBAAoC,CAAC;IACzC,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,aAAa,GAAsB,EAAE,CAAC;IAC1C,8EAA8E;IAC9E,iFAAiF;IACjF,gFAAgF;IAChF,gBAAgB;IAChB,IAAI,KAAK,GAAsB,EAAE,CAAC;IAElC,MAAM,IAAI,GAAG,CAAC,EAAe,EAAQ,EAAE;QACrC,IAAI,IAAI;YAAE,OAAO;QACjB,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,EAAa,CAAC;YACrC,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CA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