@geohar/un-bien 0.14.0 → 0.18.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 +9 -9
- package/dist/bin/launcher.js +22 -0
- package/dist/bin/launcher.js.map +1 -1
- package/dist/client.d.ts +15 -0
- package/dist/client.js +15 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/deps.d.ts +6 -2
- package/dist/commands/lifecycle.js +5 -2
- package/dist/commands/lifecycle.js.map +1 -1
- package/dist/config.d.ts +9 -0
- package/dist/config.js.map +1 -1
- package/dist/daemon/install.d.ts +2 -2
- package/dist/daemon/install.js +8 -4
- package/dist/daemon/install.js.map +1 -1
- package/dist/index.js +37 -8
- package/dist/index.js.map +1 -1
- package/dist/launch.d.ts +5 -0
- package/dist/launch.js +16 -1
- package/dist/launch.js.map +1 -1
- package/dist/launcher/launcher.js +48 -5
- package/dist/launcher/launcher.js.map +1 -1
- package/dist/pairing/signed_allow_list.d.ts +20 -0
- package/dist/pairing/signed_allow_list.js +22 -0
- package/dist/pairing/signed_allow_list.js.map +1 -0
- package/dist/pairing/storage.d.ts +22 -0
- package/dist/pairing/storage.js +129 -0
- package/dist/pairing/storage.js.map +1 -1
- package/dist/session/relay_lifecycle.d.ts +15 -0
- package/dist/session/relay_lifecycle.js +94 -32
- package/dist/session/relay_lifecycle.js.map +1 -1
- package/dist/session/rpc_inbound.d.ts +27 -7
- package/dist/session/rpc_inbound.js +82 -10
- package/dist/session/rpc_inbound.js.map +1 -1
- package/dist/transport/relay_client.d.ts +10 -1
- package/dist/transport/relay_client.js +16 -3
- package/dist/transport/relay_client.js.map +1 -1
- package/docs/daemon.md +12 -12
- package/package.json +6 -2
|
@@ -9,14 +9,83 @@
|
|
|
9
9
|
// Command shapes: pi.dev/docs/latest/rpc. v1 surface = prompt / steer /
|
|
10
10
|
// follow_up / abort / set_model / set_thinking_level. get_state / get_entries /
|
|
11
11
|
// compact / bash follow (they need the fuller ctx.sessionManager).
|
|
12
|
-
/** Page budget for get_entries replies (design: get_entries backfill paging
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
12
|
+
/** Page budget for get_entries replies (design: get_entries backfill paging;
|
|
13
|
+
* raised 256 KiB → 1 MiB → 2 MiB after device testing, 2026-09-10).
|
|
14
|
+
* 2 MiB of entry JSON per page — 8× fewer round trips than the original,
|
|
15
|
+
* still wide margin under every cap: body ≈ 2 MiB + envelope overhead →
|
|
16
|
+
* ≈ 2.7 MiB base64 wire → decoded estimate ≈ 2 MiB, ~1.9 MiB UNDER the
|
|
17
|
+
* relay's 4 MiB ct cap (RELAY_MAX_CT_MIB) < the app's 8 MiB WS receive.
|
|
18
|
+
* A page carrying one MAX_ENTRY_JSON_BYTES (2 MiB) fitted entry alone also
|
|
19
|
+
* fits with the same margin. (The 500 KiB POST /mesh cap does NOT apply —
|
|
20
|
+
* pages ride the peer WS plane, not mesh.) Fold cost: the reader folds a
|
|
21
|
+
* page on its main actor; 2 MiB parses in ~5-10 ms — device-verified smooth.
|
|
22
|
+
* If refusals (payload_too_large) ever appear in logs, dial this back toward
|
|
23
|
+
* 1 MiB — the refusal frames make that visible now. This is chunking
|
|
24
|
+
* BEHAVIOR, not protocol — frames stay byte-faithful to pi's rpc
|
|
25
|
+
* (`success(id, "get_entries", { entries, leafId })`). */
|
|
26
|
+
export const GET_ENTRIES_PAGE_BUDGET_BYTES = 2 * 1024 * 1024;
|
|
27
|
+
/** Hard ceiling for a SINGLE entry's JSON (design: transport-fit paging). The
|
|
28
|
+
* at-least-one-entry progress rule means an entry beyond the relay's ct cap
|
|
29
|
+
* would ride alone, get refused payload_too_large, and stall the reader's
|
|
30
|
+
* walk on the same cursor FOREVER — one giant entry (a multi-MB tool result)
|
|
31
|
+
* poisoned the whole session's backfill. Fitted entries deep-truncate long
|
|
32
|
+
* strings (suffix marker) so shape + ids survive and the walk always crosses.
|
|
33
|
+
* 2 MiB JSON → ≈2.7 MiB base64 ≈ 2.7 MiB decoded estimate — half the relay
|
|
34
|
+
* cap, deliberately, so a page carrying one fitted entry still has margin. */
|
|
35
|
+
export const MAX_ENTRY_JSON_BYTES = 2 * 1024 * 1024;
|
|
36
|
+
const truncationMarker = (cut, total) => `…[transport-truncated ${total - cut}/${total} bytes]`;
|
|
37
|
+
function truncateStringsDeep(value, cap) {
|
|
38
|
+
if (typeof value === "string") {
|
|
39
|
+
return value.length > cap
|
|
40
|
+
? value.slice(0, cap) + truncationMarker(cap, value.length)
|
|
41
|
+
: value;
|
|
42
|
+
}
|
|
43
|
+
if (Array.isArray(value)) {
|
|
44
|
+
return value.map((v) => truncateStringsDeep(v, cap));
|
|
45
|
+
}
|
|
46
|
+
if (value && typeof value === "object") {
|
|
47
|
+
const out = {};
|
|
48
|
+
for (const [k, v] of Object.entries(value)) {
|
|
49
|
+
out[k] = truncateStringsDeep(v, cap);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
/** Fit one entry for transport: unchanged when small enough; string-truncated
|
|
56
|
+
* (shrinking per-string caps across passes) when oversized; ultimate fallback
|
|
57
|
+
* is a minimal content-elided stub so the walk ALWAYS crosses this entry. */
|
|
58
|
+
export function fitEntryForTransport(entry) {
|
|
59
|
+
if (JSON.stringify(entry).length <= MAX_ENTRY_JSON_BYTES)
|
|
60
|
+
return entry;
|
|
61
|
+
for (const cap of [64 * 1024, 8 * 1024, 256]) {
|
|
62
|
+
// SAFETY: SessionEntry serializes to a JSON tree; the cast only moves it
|
|
63
|
+
// into the walker's domain type.
|
|
64
|
+
const fitted = truncateStringsDeep(entry, cap);
|
|
65
|
+
// SAFETY: the deep walk only replaces string LEAVES (same keys, same
|
|
66
|
+
// structure), so the result keeps SessionEntry's shape — TS can't prove
|
|
67
|
+
// that through the JsonTree round-trip.
|
|
68
|
+
const candidate = fitted;
|
|
69
|
+
if (JSON.stringify(candidate).length <= MAX_ENTRY_JSON_BYTES)
|
|
70
|
+
return candidate;
|
|
71
|
+
}
|
|
72
|
+
// SAFETY: hand-built to the message-entry shape; the cast papers over the
|
|
73
|
+
// pi union's narrower content typing.
|
|
74
|
+
return {
|
|
75
|
+
type: "message",
|
|
76
|
+
id: entry.id,
|
|
77
|
+
parentId: entry.parentId,
|
|
78
|
+
message: {
|
|
79
|
+
role: "assistant",
|
|
80
|
+
content: [
|
|
81
|
+
{
|
|
82
|
+
type: "text",
|
|
83
|
+
text: `[entry ${entry.id} exceeds the transport ceiling — content elided]`,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
20
89
|
/** Slice the entry log into one budget-bounded page starting AFTER `since`
|
|
21
90
|
* (undefined = from the start). Handlers pre-validate `since` pi-faithfully
|
|
22
91
|
* (unknown id → `Entry not found` error); this helper stays tolerant (an
|
|
@@ -38,8 +107,11 @@ export function pageEntries(all, since, leafId, budgetBytes = GET_ENTRIES_PAGE_B
|
|
|
38
107
|
const page = [];
|
|
39
108
|
let used = 0;
|
|
40
109
|
for (const e of remaining) {
|
|
41
|
-
|
|
42
|
-
|
|
110
|
+
// Transport-fit FIRST: an oversized entry must never ride raw (it would be
|
|
111
|
+
// refused and stall the walk); budget accounting uses the FITTED size.
|
|
112
|
+
const fitted = fitEntryForTransport(e);
|
|
113
|
+
page.push(fitted);
|
|
114
|
+
used += JSON.stringify(fitted).length;
|
|
43
115
|
if (used >= budgetBytes)
|
|
44
116
|
break;
|
|
45
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_inbound.js","sourceRoot":"","sources":["../../src/session/rpc_inbound.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,gFAAgF;AAChF,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,8CAA8C;AAC9C,EAAE;AACF,wEAAwE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AAA,CAAC,6CAA6C;QAC7D,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE;YAC9B,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -35,10 +35,19 @@ export interface RoomMetaUpdateFrame {
|
|
|
35
35
|
model?: string;
|
|
36
36
|
working?: boolean;
|
|
37
37
|
thinking?: ThinkingLevel;
|
|
38
|
+
name?: string;
|
|
38
39
|
parent?: string;
|
|
39
40
|
parentSessionId?: string;
|
|
40
41
|
};
|
|
41
42
|
}
|
|
43
|
+
/** Control frame pushing this machine's ROOMS-gate allow-list to the relay
|
|
44
|
+
* (design 01M1ZE43): the set of Owner epks (relay `peer_id` encoding) permitted
|
|
45
|
+
* to list this machine's rooms. Full-set replace on connect + every change. */
|
|
46
|
+
export interface PairingSetFrame {
|
|
47
|
+
type: "pairing_set";
|
|
48
|
+
blob: string;
|
|
49
|
+
sig: string;
|
|
50
|
+
}
|
|
42
51
|
export interface ConnectOptions {
|
|
43
52
|
roomId?: string;
|
|
44
53
|
roomMeta?: RoomMeta;
|
|
@@ -104,7 +113,7 @@ export declare class RelayClient extends EventEmitter {
|
|
|
104
113
|
* the WS isn't open (best-effort: control frames are observational; we
|
|
105
114
|
* don't want them throwing inside SDK event callbacks).
|
|
106
115
|
*/
|
|
107
|
-
sendControl(frame: RoomMetaUpdateFrame): void;
|
|
116
|
+
sendControl(frame: RoomMetaUpdateFrame | PairingSetFrame): void;
|
|
108
117
|
close(): void;
|
|
109
118
|
/** Force-close the WS when no inbound frame has arrived for
|
|
110
119
|
* `LIVENESS_TIMEOUT_MS` — see the constant's doc for why. `terminate()`
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
2
|
import WebSocket from "ws";
|
|
3
3
|
import { ed25519Sign } from "../pairing/crypto.js";
|
|
4
|
+
import { envLog } from "../session/debug_log.js";
|
|
4
5
|
const AUTH_TIMEOUT_MS = 5_000;
|
|
6
|
+
/** Inbound frame cap for the `ws` socket — PINNED, not the lib's 100 MiB
|
|
7
|
+
* default: aligned with the relay's WS message limit (64 MiB). The largest
|
|
8
|
+
* LEGAL frame is a max-ct envelope ≈ 5.4 MiB, so this is pure headroom that
|
|
9
|
+
* can't drift with a `ws` upgrade. */
|
|
10
|
+
const MAX_WS_PAYLOAD_BYTES = 64 * 1024 * 1024;
|
|
5
11
|
/**
|
|
6
12
|
* Liveness watchdog. The relay sends a WS Ping every ~25s (relay `peer.rs`),
|
|
7
13
|
* so a healthy connection sees inbound frames at least that often. If NOTHING
|
|
@@ -67,7 +73,7 @@ export class RelayClient extends EventEmitter {
|
|
|
67
73
|
*/
|
|
68
74
|
async connect(options = {}) {
|
|
69
75
|
return new Promise((resolve, reject) => {
|
|
70
|
-
const ws = new WebSocket(this.url);
|
|
76
|
+
const ws = new WebSocket(this.url, { maxPayload: MAX_WS_PAYLOAD_BYTES });
|
|
71
77
|
this.ws = ws;
|
|
72
78
|
ws.on("error", (err) => reject(err));
|
|
73
79
|
ws.on("open", async () => {
|
|
@@ -82,8 +88,15 @@ export class RelayClient extends EventEmitter {
|
|
|
82
88
|
const text = Buffer.isBuffer(raw) ? raw.toString() : String(raw);
|
|
83
89
|
for (const line of text.split("\n")) {
|
|
84
90
|
const trimmed = line.trim();
|
|
85
|
-
if (trimmed)
|
|
86
|
-
|
|
91
|
+
if (!trimmed)
|
|
92
|
+
continue;
|
|
93
|
+
// Relay refusal (payload_too_large / invalid_envelope / unknown_peer):
|
|
94
|
+
// surface in the envelope debug log so an oversized send is VISIBLE
|
|
95
|
+
// instead of the message silently vanishing (silent-drop fix).
|
|
96
|
+
if (trimmed.startsWith('{"type":"error"')) {
|
|
97
|
+
envLog(`relay error frame: ${trimmed}`);
|
|
98
|
+
}
|
|
99
|
+
this.emit("message", trimmed);
|
|
87
100
|
}
|
|
88
101
|
});
|
|
89
102
|
// The relay pings every ~25s; `ws` auto-replies Pong (keeping the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relay_client.js","sourceRoot":"","sources":["../../src/transport/relay_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,SAAS,MAAM,IAAI,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"relay_client.js","sourceRoot":"","sources":["../../src/transport/relay_client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,SAAS,MAAM,IAAI,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGlD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAEhD,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B;;;uCAGuC;AACvC,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAE7C;;;;;;;;GAQG;AACH,MAAM,mBAAmB,GAAG,MAAM,CAAA,CAAC,6CAA6C;AAChF,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAiFhC,iFAAiF;AACjF,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACjB;IAA5B,YAA4B,MAA0B;QACpD,KAAK,CACH,MAAM;YACJ,CAAC,CAAC,8BAA8B,MAAM,6BAA6B;YACnE,CAAC,CAAC,8CAA8C,CACnD,CAAA;QALyB,WAAM,GAAN,MAAM,CAAoB;QAMpD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;IACpC,CAAC;CACF;AASD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,WAAY,SAAQ,YAAY;I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,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,CAAC;CACF"}
|
package/docs/daemon.md
CHANGED
|
@@ -6,7 +6,7 @@ likely causes and how to fix it.
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
## 1. `unbien install` fails
|
|
9
|
+
## 1. `unbien-admin install` fails
|
|
10
10
|
|
|
11
11
|
### "launcher script not found"
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ likely causes and how to fix it.
|
|
|
16
16
|
`npm install -g @geohar/un-bien` (prod) first.
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
You're running `unbien install` from a dev clone where `dist/` doesn't
|
|
19
|
+
You're running `unbien-admin install` from a dev clone where `dist/` doesn't
|
|
20
20
|
exist yet, or from a partial install.
|
|
21
21
|
|
|
22
22
|
```bash
|
|
@@ -25,7 +25,7 @@ cd extension && pnpm build
|
|
|
25
25
|
|
|
26
26
|
# Production install:
|
|
27
27
|
npm install -g @geohar/un-bien
|
|
28
|
-
unbien install
|
|
28
|
+
unbien-admin install
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
### "launchctl: bootstrap … already running"
|
|
@@ -38,7 +38,7 @@ new one. If it still fails:
|
|
|
38
38
|
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/dev.unbien.launcher.plist
|
|
39
39
|
launchctl unload ~/Library/LaunchAgents/dev.unbien.launcher.plist 2>/dev/null
|
|
40
40
|
rm ~/Library/LaunchAgents/dev.unbien.launcher.plist
|
|
41
|
-
unbien install
|
|
41
|
+
unbien-admin install
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### "systemctl --user … No such file or directory"
|
|
@@ -50,12 +50,12 @@ the unit survives logout:
|
|
|
50
50
|
```bash
|
|
51
51
|
loginctl enable-linger $USER
|
|
52
52
|
systemctl --user daemon-reload
|
|
53
|
-
unbien install
|
|
53
|
+
unbien-admin install
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
### Windows: the UAC prompt fails or is declined
|
|
57
57
|
|
|
58
|
-
`unbien install` needs elevation **once** — only the `schtasks /Create`
|
|
58
|
+
`unbien-admin install` needs elevation **once** — only the `schtasks /Create`
|
|
59
59
|
that registers the task requires admin. Accept the prompt when it appears.
|
|
60
60
|
Stopping/starting the task afterwards (`/End`, `/Run`) works un-elevated.
|
|
61
61
|
|
|
@@ -81,11 +81,11 @@ tail -100 ~/.local/state/un-bien/launcher.log
|
|
|
81
81
|
baked into the unit/plist no longer match where the package lives. This
|
|
82
82
|
happens when you reinstall Node via a version manager (nvm/fnm) or
|
|
83
83
|
uninstall/reinstall the package to a different location. Fix:
|
|
84
|
-
`unbien uninstall && unbien install` (install snapshots the current
|
|
84
|
+
`unbien-admin uninstall && unbien-admin install` (install snapshots the current
|
|
85
85
|
node binary and paths).
|
|
86
86
|
- **`tmux: command not found`** (at launch time, not startup) — the PATH
|
|
87
87
|
captured at install time didn't include the remote-launch backend.
|
|
88
|
-
Install tmux (or herdr), then re-run `unbien install` to refresh PATH.
|
|
88
|
+
Install tmux (or herdr), then re-run `unbien-admin install` to refresh PATH.
|
|
89
89
|
- **First connect race** — the launcher logs `initial connect failed (…)
|
|
90
90
|
— retrying every 3000ms` and retries on its own. This is normal when
|
|
91
91
|
the relay starts in the same breath; it clears once the relay is up.
|
|
@@ -103,7 +103,7 @@ node $(npm root -g)/@geohar/un-bien/dist/bin/launcher.js
|
|
|
103
103
|
|
|
104
104
|
If it prints `[un-bien launcher] listening on control room …` and stays
|
|
105
105
|
up, the daemon itself is fine — the problem is in the unit/plist
|
|
106
|
-
environment (PATH, node path). Re-run `unbien install`.
|
|
106
|
+
environment (PATH, node path). Re-run `unbien-admin install`.
|
|
107
107
|
|
|
108
108
|
---
|
|
109
109
|
|
|
@@ -149,7 +149,7 @@ tmux kill-session -t un-bien # or tmux kill-server (kills ALL sessions)
|
|
|
149
149
|
tmux new-session -d -s un-bien
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
2. **Run the launcher as a login service** (`unbien install` — launchd
|
|
152
|
+
2. **Run the launcher as a login service** (`unbien-admin install` — launchd
|
|
153
153
|
LaunchAgent / systemd `--user`), not from a detached daemon: the launcher
|
|
154
154
|
— and any tmux server it creates — stays inside your login session where
|
|
155
155
|
the keychain just works.
|
|
@@ -237,11 +237,11 @@ session on the machine and scan the QR from the app.
|
|
|
237
237
|
When you suspect everything is misconfigured:
|
|
238
238
|
|
|
239
239
|
```bash
|
|
240
|
-
unbien uninstall # removes the service, keeps config + pairing
|
|
240
|
+
unbien-admin uninstall # removes the service, keeps config + pairing
|
|
241
241
|
rm -rf ~/.local/state/un-bien # nukes pairing + identity (re-pair after this)
|
|
242
242
|
npm uninstall -g @geohar/un-bien
|
|
243
243
|
npm install -g @geohar/un-bien
|
|
244
|
-
unbien install
|
|
244
|
+
unbien-admin install
|
|
245
245
|
# Then re-pair from scratch: pi → /unbien pair
|
|
246
246
|
```
|
|
247
247
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geohar/un-bien",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Mobile remote control and local agent mesh for the Pi coding agent. Pair your phone via QR over a relay, watch tool calls in real time, run multi-Pi sessions over a local Unix Domain Socket broker, and let agents talk to each other through structured request/reply. Derived from remote-pi by Jacob Moura (https://github.com/jacobaraujo7/remote_pi), MIT.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"unbien": "dist/index.js"
|
|
9
|
+
"unbien-admin": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"types": "./dist/bin/launcher.d.ts",
|
|
18
18
|
"default": "./dist/bin/launcher.js"
|
|
19
19
|
},
|
|
20
|
+
"./client": {
|
|
21
|
+
"types": "./dist/client.d.ts",
|
|
22
|
+
"default": "./dist/client.js"
|
|
23
|
+
},
|
|
20
24
|
"./package.json": "./package.json"
|
|
21
25
|
},
|
|
22
26
|
"scripts": {
|