@taco-ai/shared 0.3.6 → 0.3.8
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/dist/controlNode.d.ts +5 -22
- package/dist/controlNode.d.ts.map +1 -1
- package/dist/controlNode.js +5 -22
- package/dist/controlNode.js.map +1 -1
- package/package.json +2 -2
package/dist/controlNode.d.ts
CHANGED
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* controlNode — minimal JSON-RPC client for the sidecar's control socket.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Wire format is one JSON object per line (see
|
|
6
|
-
* `packages/sidecar/src/server/controlChannel.ts`):
|
|
4
|
+
* A separate NDJSON stream from the data channel (one JSON object per line):
|
|
7
5
|
*
|
|
8
6
|
* Request: {"method": "control.X", "params"?: ..., "id": <number>}
|
|
9
7
|
* Response: {"result": ..., "id": <number>}
|
|
10
8
|
* | {"error": {"code", "message"}, "id": <number>}
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* must not be blocked by a stuck / half-closed data socket.
|
|
15
|
-
* - Both `taco status` and `taco stop` were carrying near-identical
|
|
16
|
-
* ~50-line implementations of this protocol with slightly different
|
|
17
|
-
* error formatting — extracting it keeps the wire format in one place.
|
|
10
|
+
* Separate because a stuck / half-closed data socket must not block the
|
|
11
|
+
* liveness check (`control.ping`) or shutdown (`control.shutdown`).
|
|
18
12
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* import { controlRequest } from "@taco-ai/shared/controlNode";
|
|
22
|
-
*
|
|
23
|
-
* const result = await controlRequest(socketPath, "control.ping", {
|
|
24
|
-
* timeoutMs: 2_000,
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* The helper rejects (does not throw synchronously) with an `Error`
|
|
28
|
-
* whose `.message` always includes the method name so log lines are
|
|
29
|
-
* unambiguous. Cancellation is best-effort: the timeout closes the
|
|
30
|
-
* underlying socket so a slow / unresponsive daemon does not leak
|
|
31
|
-
* file descriptors.
|
|
13
|
+
* The timeout closes the socket, so a slow / unresponsive daemon does not
|
|
14
|
+
* leak file descriptors.
|
|
32
15
|
*/
|
|
33
16
|
export interface ControlRequestOptions {
|
|
34
17
|
/** Optional RPC params payload — included as `params` in the wire frame. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlNode.d.ts","sourceRoot":"","sources":["../controlNode.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"controlNode.d.ts","sourceRoot":"","sources":["../controlNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,MAAM,WAAW,qBAAqB;IAClC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GACpC,OAAO,CAAC,OAAO,CAAC,CA6DlB"}
|
package/dist/controlNode.js
CHANGED
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* controlNode — minimal JSON-RPC client for the sidecar's control socket.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Wire format is one JSON object per line (see
|
|
6
|
-
* `packages/sidecar/src/server/controlChannel.ts`):
|
|
4
|
+
* A separate NDJSON stream from the data channel (one JSON object per line):
|
|
7
5
|
*
|
|
8
6
|
* Request: {"method": "control.X", "params"?: ..., "id": <number>}
|
|
9
7
|
* Response: {"result": ..., "id": <number>}
|
|
10
8
|
* | {"error": {"code", "message"}, "id": <number>}
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* must not be blocked by a stuck / half-closed data socket.
|
|
15
|
-
* - Both `taco status` and `taco stop` were carrying near-identical
|
|
16
|
-
* ~50-line implementations of this protocol with slightly different
|
|
17
|
-
* error formatting — extracting it keeps the wire format in one place.
|
|
10
|
+
* Separate because a stuck / half-closed data socket must not block the
|
|
11
|
+
* liveness check (`control.ping`) or shutdown (`control.shutdown`).
|
|
18
12
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* import { controlRequest } from "@taco-ai/shared/controlNode";
|
|
22
|
-
*
|
|
23
|
-
* const result = await controlRequest(socketPath, "control.ping", {
|
|
24
|
-
* timeoutMs: 2_000,
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* The helper rejects (does not throw synchronously) with an `Error`
|
|
28
|
-
* whose `.message` always includes the method name so log lines are
|
|
29
|
-
* unambiguous. Cancellation is best-effort: the timeout closes the
|
|
30
|
-
* underlying socket so a slow / unresponsive daemon does not leak
|
|
31
|
-
* file descriptors.
|
|
13
|
+
* The timeout closes the socket, so a slow / unresponsive daemon does not
|
|
14
|
+
* leak file descriptors.
|
|
32
15
|
*/
|
|
33
16
|
import { connect } from "node:net";
|
|
34
17
|
const DEFAULT_TIMEOUT_MS = 3_000;
|
package/dist/controlNode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlNode.js","sourceRoot":"","sources":["../controlNode.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"controlNode.js","sourceRoot":"","sources":["../controlNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAe,MAAM,UAAU,CAAC;AAEhD,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,UAAU,GAAG,CAAC,CAAC;AAqBrB;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC1B,UAAkB,EAClB,MAAc,EACd,OAAO,GAA0B,EAAE;IAEnC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,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M,8BAA8B,CAAC,CAAC,CAAC,CAAC;YAC7E,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAClB,IAAI,CAAC,OAAO,EAAE,CAAC;gBACX,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,8BAA8B,CAAC,CAAC,CAAC,CAAC;YAC7E,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taco-ai/shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/tacoClient.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@taco-ai/protocol": "0.3.
|
|
23
|
+
"@taco-ai/protocol": "0.3.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^22.7.0",
|