@agentdeck/bridge 1.0.20 → 1.0.22
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/adapters/openclaw.d.ts +55 -1
- package/dist/adapters/openclaw.d.ts.map +1 -1
- package/dist/adapters/openclaw.js +278 -45
- package/dist/adapters/openclaw.js.map +1 -1
- package/dist/adb-reverse.d.ts +26 -3
- package/dist/adb-reverse.d.ts.map +1 -1
- package/dist/adb-reverse.js +26 -5
- package/dist/adb-reverse.js.map +1 -1
- package/dist/apme/adapters/openclaw-hook.d.ts +45 -1
- package/dist/apme/adapters/openclaw-hook.d.ts.map +1 -1
- package/dist/apme/adapters/openclaw-hook.js +84 -4
- package/dist/apme/adapters/openclaw-hook.js.map +1 -1
- package/dist/apme/claude-transcript-reader.d.ts +54 -0
- package/dist/apme/claude-transcript-reader.d.ts.map +1 -1
- package/dist/apme/claude-transcript-reader.js +77 -0
- package/dist/apme/claude-transcript-reader.js.map +1 -1
- package/dist/apme/collector.d.ts +63 -5
- package/dist/apme/collector.d.ts.map +1 -1
- package/dist/apme/collector.js +147 -10
- package/dist/apme/collector.js.map +1 -1
- package/dist/apme/store.d.ts +23 -1
- package/dist/apme/store.d.ts.map +1 -1
- package/dist/apme/store.js +81 -2
- package/dist/apme/store.js.map +1 -1
- package/dist/apme/types.d.ts +1 -1
- package/dist/apme/types.d.ts.map +1 -1
- package/dist/apme/types.js.map +1 -1
- package/dist/auth.d.ts +37 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +23 -0
- package/dist/auth.js.map +1 -1
- package/dist/ble-sync-spawn.d.ts +27 -0
- package/dist/ble-sync-spawn.d.ts.map +1 -1
- package/dist/ble-sync-spawn.js +32 -0
- package/dist/ble-sync-spawn.js.map +1 -1
- package/dist/bridge-core.d.ts +21 -4
- package/dist/bridge-core.d.ts.map +1 -1
- package/dist/bridge-core.js +52 -23
- package/dist/bridge-core.js.map +1 -1
- package/dist/claude-interrupt-marker.d.ts +31 -0
- package/dist/claude-interrupt-marker.d.ts.map +1 -0
- package/dist/claude-interrupt-marker.js +58 -0
- package/dist/claude-interrupt-marker.js.map +1 -0
- package/dist/claude-turn-watchdog.d.ts +23 -0
- package/dist/claude-turn-watchdog.d.ts.map +1 -1
- package/dist/claude-turn-watchdog.js +30 -4
- package/dist/claude-turn-watchdog.js.map +1 -1
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +411 -115
- package/dist/cli.js.map +1 -1
- package/dist/codex-rate-limits-live.d.ts +58 -9
- package/dist/codex-rate-limits-live.d.ts.map +1 -1
- package/dist/codex-rate-limits-live.js +64 -15
- package/dist/codex-rate-limits-live.js.map +1 -1
- package/dist/codex-rate-limits.d.ts +2 -2
- package/dist/codex-rate-limits.d.ts.map +1 -1
- package/dist/codex-rate-limits.js +34 -16
- package/dist/codex-rate-limits.js.map +1 -1
- package/dist/daemon-port.d.ts +90 -0
- package/dist/daemon-port.d.ts.map +1 -0
- package/dist/daemon-port.js +119 -0
- package/dist/daemon-port.js.map +1 -0
- package/dist/daemon-server.d.ts +60 -3
- package/dist/daemon-server.d.ts.map +1 -1
- package/dist/daemon-server.js +362 -109
- package/dist/daemon-server.js.map +1 -1
- package/dist/daemon-settings.d.ts +46 -0
- package/dist/daemon-settings.d.ts.map +1 -0
- package/dist/daemon-settings.js +85 -0
- package/dist/daemon-settings.js.map +1 -0
- package/dist/daemon-takeover.d.ts +75 -0
- package/dist/daemon-takeover.d.ts.map +1 -0
- package/dist/daemon-takeover.js +137 -0
- package/dist/daemon-takeover.js.map +1 -0
- package/dist/daemon.js +1 -1
- package/dist/hook-server.d.ts.map +1 -1
- package/dist/hook-server.js +17 -0
- package/dist/hook-server.js.map +1 -1
- package/dist/idotmatrix/idotmatrix-daemon-sync.d.ts.map +1 -1
- package/dist/idotmatrix/idotmatrix-daemon-sync.js +13 -1
- package/dist/idotmatrix/idotmatrix-daemon-sync.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -12
- package/dist/index.js.map +1 -1
- package/dist/kiro-diagnostics.d.ts +90 -0
- package/dist/kiro-diagnostics.d.ts.map +1 -0
- package/dist/kiro-diagnostics.js +278 -0
- package/dist/kiro-diagnostics.js.map +1 -0
- package/dist/kiro-session.d.ts +113 -0
- package/dist/kiro-session.d.ts.map +1 -0
- package/dist/kiro-session.js +688 -0
- package/dist/kiro-session.js.map +1 -0
- package/dist/kiro-timeline-feed.d.ts +45 -0
- package/dist/kiro-timeline-feed.d.ts.map +1 -0
- package/dist/kiro-timeline-feed.js +116 -0
- package/dist/kiro-timeline-feed.js.map +1 -0
- package/dist/kiro-transcript-timeline.d.ts +57 -0
- package/dist/kiro-transcript-timeline.d.ts.map +1 -0
- package/dist/kiro-transcript-timeline.js +183 -0
- package/dist/kiro-transcript-timeline.js.map +1 -0
- package/dist/linux-service.d.ts +2 -1
- package/dist/linux-service.d.ts.map +1 -1
- package/dist/linux-service.js +8 -3
- package/dist/linux-service.js.map +1 -1
- package/dist/mdns-discover.d.ts +27 -0
- package/dist/mdns-discover.d.ts.map +1 -1
- package/dist/mdns-discover.js +60 -7
- package/dist/mdns-discover.js.map +1 -1
- package/dist/mdns.d.ts.map +1 -1
- package/dist/mdns.js +16 -3
- package/dist/mdns.js.map +1 -1
- package/dist/modules/adb-module.d.ts.map +1 -1
- package/dist/modules/adb-module.js +5 -2
- package/dist/modules/adb-module.js.map +1 -1
- package/dist/modules/index.d.ts +2 -1
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +1 -0
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/types.d.ts +34 -9
- package/dist/modules/types.d.ts.map +1 -1
- package/dist/modules/types.js +34 -1
- package/dist/modules/types.js.map +1 -1
- package/dist/network-posture.d.ts +67 -0
- package/dist/network-posture.d.ts.map +1 -0
- package/dist/network-posture.js +100 -0
- package/dist/network-posture.js.map +1 -0
- package/dist/observed-steering.d.ts +14 -0
- package/dist/observed-steering.d.ts.map +1 -1
- package/dist/observed-steering.js +18 -0
- package/dist/observed-steering.js.map +1 -1
- package/dist/observed-turn-watchdogs.d.ts +84 -0
- package/dist/observed-turn-watchdogs.d.ts.map +1 -0
- package/dist/observed-turn-watchdogs.js +134 -0
- package/dist/observed-turn-watchdogs.js.map +1 -0
- package/dist/openclaw-session.d.ts +10 -0
- package/dist/openclaw-session.d.ts.map +1 -1
- package/dist/openclaw-session.js +12 -0
- package/dist/openclaw-session.js.map +1 -1
- package/dist/passive-observer.d.ts +19 -0
- package/dist/passive-observer.d.ts.map +1 -1
- package/dist/passive-observer.js +208 -24
- package/dist/passive-observer.js.map +1 -1
- package/dist/pixoo/micro-glyphs.d.ts +1 -1
- package/dist/pixoo/micro-glyphs.d.ts.map +1 -1
- package/dist/pixoo/micro-glyphs.js +2 -0
- package/dist/pixoo/micro-glyphs.js.map +1 -1
- package/dist/pixoo/official-dot-glyphs.generated.d.ts +1 -1
- package/dist/pixoo/official-dot-glyphs.generated.d.ts.map +1 -1
- package/dist/pixoo/official-dot-glyphs.generated.js +47 -0
- package/dist/pixoo/official-dot-glyphs.generated.js.map +1 -1
- package/dist/pixoo/pixoo-discover.d.ts +8 -1
- package/dist/pixoo/pixoo-discover.d.ts.map +1 -1
- package/dist/pixoo/pixoo-discover.js +15 -8
- package/dist/pixoo/pixoo-discover.js.map +1 -1
- package/dist/pixoo/pixoo-renderer.d.ts +4 -2
- package/dist/pixoo/pixoo-renderer.d.ts.map +1 -1
- package/dist/pixoo/pixoo-renderer.js +105 -36
- package/dist/pixoo/pixoo-renderer.js.map +1 -1
- package/dist/pixoo/pixoo-settings.d.ts +19 -2
- package/dist/pixoo/pixoo-settings.d.ts.map +1 -1
- package/dist/pixoo/pixoo-settings.js +22 -4
- package/dist/pixoo/pixoo-settings.js.map +1 -1
- package/dist/pixoo/pixoo-sprites.d.ts.map +1 -1
- package/dist/pixoo/pixoo-sprites.js +2 -0
- package/dist/pixoo/pixoo-sprites.js.map +1 -1
- package/dist/python-ble-runtime.d.ts +2 -0
- package/dist/python-ble-runtime.d.ts.map +1 -1
- package/dist/python-ble-runtime.js +101 -7
- package/dist/python-ble-runtime.js.map +1 -1
- package/dist/session-aggregator.d.ts +9 -1
- package/dist/session-aggregator.d.ts.map +1 -1
- package/dist/session-aggregator.js +1 -1
- package/dist/session-aggregator.js.map +1 -1
- package/dist/session-registry.d.ts +71 -3
- package/dist/session-registry.d.ts.map +1 -1
- package/dist/session-registry.js +126 -19
- package/dist/session-registry.js.map +1 -1
- package/dist/subagent-timeline.d.ts +38 -7
- package/dist/subagent-timeline.d.ts.map +1 -1
- package/dist/subagent-timeline.js +154 -23
- package/dist/subagent-timeline.js.map +1 -1
- package/dist/timebox/timebox-daemon-sync.d.ts.map +1 -1
- package/dist/timebox/timebox-daemon-sync.js +11 -1
- package/dist/timebox/timebox-daemon-sync.js.map +1 -1
- package/dist/timeline-store.d.ts.map +1 -1
- package/dist/timeline-store.js +26 -1
- package/dist/timeline-store.js.map +1 -1
- package/dist/tui/renderer.d.ts.map +1 -1
- package/dist/tui/renderer.js +13 -1
- package/dist/tui/renderer.js.map +1 -1
- package/dist/tui/terrarium.d.ts.map +1 -1
- package/dist/tui/terrarium.js +10 -5
- package/dist/tui/terrarium.js.map +1 -1
- package/dist/usage-api.d.ts +28 -1
- package/dist/usage-api.d.ts.map +1 -1
- package/dist/usage-api.js +74 -33
- package/dist/usage-api.js.map +1 -1
- package/dist/usage-event.d.ts.map +1 -1
- package/dist/usage-event.js +2 -17
- package/dist/usage-event.js.map +1 -1
- package/dist/utils/redact-secrets.d.ts +3 -0
- package/dist/utils/redact-secrets.d.ts.map +1 -0
- package/dist/utils/redact-secrets.js +29 -0
- package/dist/utils/redact-secrets.js.map +1 -0
- package/dist/windows-service.d.ts +2 -1
- package/dist/windows-service.d.ts.map +1 -1
- package/dist/windows-service.js +6 -3
- package/dist/windows-service.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI daemon's **preferred port** — the port it intends to serve, as
|
|
3
|
+
* opposed to the port it ended up on.
|
|
4
|
+
*
|
|
5
|
+
* Roadmap item 11 (docs/ENTERPRISE-ROADMAP.md §1.5) asks for a persistent
|
|
6
|
+
* `daemonPort` for the CLI to match the macOS app's `AppPreferences.daemonPort`.
|
|
7
|
+
* The reason it matters is not configurability for its own sake — it is that
|
|
8
|
+
* without a recorded intent, a daemon that landed on a fallback port has no way
|
|
9
|
+
* to know it is on the wrong one.
|
|
10
|
+
*
|
|
11
|
+
* ## Intent is persisted; the outcome never is
|
|
12
|
+
*
|
|
13
|
+
* This is the rule the whole module exists to enforce. `daemon.json` records
|
|
14
|
+
* where the daemon *is*, and every client resolves through it. This setting
|
|
15
|
+
* records where the daemon *wants to be*. Persisting the outcome instead would
|
|
16
|
+
* be self-reinforcing: a daemon bumped to 9121 by a transient hold would write
|
|
17
|
+
* 9121 down and start there forever, turning a 14-second kernel reservation
|
|
18
|
+
* into a permanent move. So nothing in the daemon's startup path ever writes
|
|
19
|
+
* this value — only the user does, via `agentdeck daemon port <n>`.
|
|
20
|
+
*
|
|
21
|
+
* ## Sources
|
|
22
|
+
*
|
|
23
|
+
* `-p/--port` › `AGENTDECK_DAEMON_PORT` › `settings.json` `daemonPort` › 9120.
|
|
24
|
+
* All four are statements of intent; they differ only in precedence and in how
|
|
25
|
+
* long they last. The resolved `source` is carried alongside the number because
|
|
26
|
+
* one caller needs it: `daemon start` treats a port the user typed on THIS
|
|
27
|
+
* invocation differently from one it merely defaulted to (an explicit choice
|
|
28
|
+
* fails loudly rather than quietly binding a different port).
|
|
29
|
+
*/
|
|
30
|
+
import { loadDaemonSettings } from './daemon-settings.js';
|
|
31
|
+
import { DAEMON_DEFAULT_PORT } from './session-registry.js';
|
|
32
|
+
/** `settings.json` key. Same name as the macOS app's `prefs.daemonPort`. */
|
|
33
|
+
export const DAEMON_PORT_SETTING_KEY = 'daemonPort';
|
|
34
|
+
/** Environment override, for a shell or MDM profile that cannot edit files. */
|
|
35
|
+
export const DAEMON_PORT_ENV_VAR = 'AGENTDECK_DAEMON_PORT';
|
|
36
|
+
/**
|
|
37
|
+
* Accepted range, mirroring `AppPreferences.clampPort` (1024–65535). Below 1024
|
|
38
|
+
* needs root on every platform we support, which the daemon never has.
|
|
39
|
+
*/
|
|
40
|
+
export const DAEMON_PORT_MIN = 1024;
|
|
41
|
+
export const DAEMON_PORT_MAX = 65535;
|
|
42
|
+
/**
|
|
43
|
+
* How long the daemon waits for its preferred port to come free before
|
|
44
|
+
* conceding to a fallback, when nothing answers `/health` on it.
|
|
45
|
+
*
|
|
46
|
+
* Sized from a measurement, not a guess: cancelling a listener on macOS leaves
|
|
47
|
+
* a NECP reservation on the port for ~14s (bindable at ~17s, measured
|
|
48
|
+
* 2026-08-06 — `lsof` shows zero sockets for the whole interval and `bind()`
|
|
49
|
+
* still returns EADDRINUSE). 20s clears that with margin.
|
|
50
|
+
*
|
|
51
|
+
* The wait polls, so it costs only as long as the port is actually held. The
|
|
52
|
+
* full budget is paid only when something outside AgentDeck really is
|
|
53
|
+
* listening there — once per daemon start, with a log line saying so.
|
|
54
|
+
*/
|
|
55
|
+
export const PREFERRED_PORT_RECLAIM_MS = 20_000;
|
|
56
|
+
/** True when `value` is a port this daemon may be asked to bind. */
|
|
57
|
+
export function isValidDaemonPort(value) {
|
|
58
|
+
return typeof value === 'number'
|
|
59
|
+
&& Number.isInteger(value)
|
|
60
|
+
&& value >= DAEMON_PORT_MIN
|
|
61
|
+
&& value <= DAEMON_PORT_MAX;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse a port written as text (a flag value, an env var). Returns null for
|
|
65
|
+
* anything that is not a valid port — including `"9120abc"`, which `parseInt`
|
|
66
|
+
* would happily read as 9120.
|
|
67
|
+
*/
|
|
68
|
+
export function parseDaemonPort(raw) {
|
|
69
|
+
const text = raw?.trim();
|
|
70
|
+
if (!text || !/^\d+$/.test(text))
|
|
71
|
+
return null;
|
|
72
|
+
const value = Number(text);
|
|
73
|
+
return isValidDaemonPort(value) ? value : null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The persisted preference, or null when absent or unusable.
|
|
77
|
+
*
|
|
78
|
+
* Lenient on purpose: a malformed `daemonPort` must fall through to the
|
|
79
|
+
* default rather than stop the daemon from starting. The *setter* is the strict
|
|
80
|
+
* half — it rejects out-of-range input with a message, so a typo is caught
|
|
81
|
+
* where the user can see it instead of silently reverting six weeks later.
|
|
82
|
+
*/
|
|
83
|
+
export function preferredDaemonPortFrom(settings) {
|
|
84
|
+
const value = settings[DAEMON_PORT_SETTING_KEY];
|
|
85
|
+
if (isValidDaemonPort(value))
|
|
86
|
+
return value;
|
|
87
|
+
// A port stored as a string is a plausible hand-edit of settings.json.
|
|
88
|
+
if (typeof value === 'string')
|
|
89
|
+
return parseDaemonPort(value);
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Resolve the preferred port and where it came from. Pure — every input is
|
|
94
|
+
* injectable so the precedence order can be pinned without touching the real
|
|
95
|
+
* environment or the real settings file.
|
|
96
|
+
*/
|
|
97
|
+
export function resolveDaemonPort(input = {}) {
|
|
98
|
+
const flag = typeof input.flag === 'number' ? input.flag : parseDaemonPort(input.flag ?? undefined);
|
|
99
|
+
if (isValidDaemonPort(flag))
|
|
100
|
+
return { port: flag, source: 'flag' };
|
|
101
|
+
const env = input.env ?? process.env;
|
|
102
|
+
const fromEnv = parseDaemonPort(env[DAEMON_PORT_ENV_VAR]);
|
|
103
|
+
if (fromEnv !== null)
|
|
104
|
+
return { port: fromEnv, source: 'env' };
|
|
105
|
+
const fromSettings = preferredDaemonPortFrom(input.settings ?? loadDaemonSettings());
|
|
106
|
+
if (fromSettings !== null)
|
|
107
|
+
return { port: fromSettings, source: 'settings' };
|
|
108
|
+
return { port: DAEMON_DEFAULT_PORT, source: 'default' };
|
|
109
|
+
}
|
|
110
|
+
/** Human-readable provenance, for `daemon port` and the startup log. */
|
|
111
|
+
export function describeDaemonPortSource(source) {
|
|
112
|
+
switch (source) {
|
|
113
|
+
case 'flag': return '--port';
|
|
114
|
+
case 'env': return DAEMON_PORT_ENV_VAR;
|
|
115
|
+
case 'settings': return `settings.json ${DAEMON_PORT_SETTING_KEY}`;
|
|
116
|
+
case 'default': return 'built-in default';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=daemon-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-port.js","sourceRoot":"","sources":["../src/daemon-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAEpD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAShD,oEAAoE;AACpE,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ;WAC3B,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;WACvB,KAAK,IAAI,eAAe;WACxB,KAAK,IAAI,eAAe,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,GAA8B;IAC5D,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC;IACzB,IAAI,CAAC,IAAI,IAAI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AAY,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAE7E,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC1D,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,wBAAwB,CAAC,MAAwB;IAC/D,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAC;QAC7B,KAAK,KAAK,CAAC,CAAC,OAAO,mBAAmB,CAAC;QACvC,KAAK,UAAU,CAAC,CAAC,OAAO,iBAAiB,uBAAuB,EAAE,CAAC;QACnE,KAAK,SAAS,CAAC,CAAC,OAAO,kBAAkB,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
package/dist/daemon-server.d.ts
CHANGED
|
@@ -12,7 +12,47 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import WebSocket from 'ws';
|
|
14
14
|
import { BridgeCore } from './bridge-core.js';
|
|
15
|
-
import { type
|
|
15
|
+
import { type DaemonPortSource } from './daemon-port.js';
|
|
16
|
+
import { type UsageFetchResult } from './usage-api.js';
|
|
17
|
+
import { FeedPullTracker } from './card-feed.js';
|
|
18
|
+
/** Resolve a stage target (canonical board, registry key, or IP) to the board
|
|
19
|
+
* string the advert is keyed on.
|
|
20
|
+
*
|
|
21
|
+
* This map is read back by `stagedFwAdvert(device_info.board)`, so anything
|
|
22
|
+
* else stored as the key is an advert that can never fire. Staging with an IP
|
|
23
|
+
* is not a misuse to reject — it is the documented way to name one unit when
|
|
24
|
+
* two share a `board` string (see esp32-ota's ambiguity error) — so normalize
|
|
25
|
+
* it here instead. Consequence worth stating: the feed pull carries only a
|
|
26
|
+
* board, so a stage aimed at one unit adverts to every unit of that board.
|
|
27
|
+
* They run the same image, so that is correct rather than merely tolerable.
|
|
28
|
+
*
|
|
29
|
+
* Unlike `findWifiOtaTarget` this must NOT require an open socket: a
|
|
30
|
+
* wake-sync-sleep board holds none by design, which is the entire reason
|
|
31
|
+
* staging exists. An unrecognized target is kept verbatim — staging for a
|
|
32
|
+
* board this daemon has not met yet is legitimate. */
|
|
33
|
+
declare function resolveStagedFwBoard(target: string): string;
|
|
34
|
+
/** Stage a build for a board. Reads the file once to fingerprint it; the file
|
|
35
|
+
* itself is re-read at device download time (a rebuild at the same path is
|
|
36
|
+
* re-fingerprinted by re-staging).
|
|
37
|
+
*
|
|
38
|
+
* `pullSeen` reports whether this daemon has actually observed a feed pull
|
|
39
|
+
* from the board, because "staged" proves neither transfer nor install and a
|
|
40
|
+
* bare success reads as if it did. Only pull-sync firmware fetches a staged
|
|
41
|
+
* image; a board that holds a live WS never asks, so its stage sits forever
|
|
42
|
+
* while the CLI says it is handled. It is daemon-lifetime state, so `false`
|
|
43
|
+
* means "not seen since this daemon started" — not "cannot pull". */
|
|
44
|
+
declare function stageEsp32Fw(target: string, firmwarePath: string): {
|
|
45
|
+
board: string;
|
|
46
|
+
bytes: number;
|
|
47
|
+
md5: string;
|
|
48
|
+
pullSeen: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** The staged advert for a feed response, re-validated against the file on
|
|
51
|
+
* disk so a rebuilt-in-place binary never adverts a stale md5. */
|
|
52
|
+
declare function stagedFwAdvert(board: string | undefined): {
|
|
53
|
+
size: number;
|
|
54
|
+
md5: string;
|
|
55
|
+
} | undefined;
|
|
16
56
|
/**
|
|
17
57
|
* Single-path transport dedup. A physical ESP32 can be reachable over BOTH a
|
|
18
58
|
* USB serial connection and a WiFi WebSocket at once (e.g. inkdeck/ttgo/tc001
|
|
@@ -50,10 +90,15 @@ export declare const __wifiOtaTestApi: {
|
|
|
50
90
|
unregisterWifiEsp32Socket: typeof unregisterWifiEsp32Socket;
|
|
51
91
|
handleEsp32OtaReply: typeof handleEsp32OtaReply;
|
|
52
92
|
performWifiEsp32Ota: typeof performWifiEsp32Ota;
|
|
93
|
+
resolveStagedFwBoard: typeof resolveStagedFwBoard;
|
|
94
|
+
stageEsp32Fw: typeof stageEsp32Fw;
|
|
95
|
+
stagedFwAdvert: typeof stagedFwAdvert;
|
|
96
|
+
feedPulls: FeedPullTracker;
|
|
97
|
+
clearStagedFwForTest: () => void;
|
|
53
98
|
};
|
|
54
99
|
declare function performWifiEsp32Ota(core: BridgeCore, target: string, firmwarePath: string): Promise<Record<string, unknown>>;
|
|
55
100
|
/** @internal Exported for the relay-fallback regression test. */
|
|
56
|
-
export declare function fetchUsageRelayed(selfPort: number): Promise<
|
|
101
|
+
export declare function fetchUsageRelayed(selfPort: number): Promise<UsageFetchResult | null>;
|
|
57
102
|
/**
|
|
58
103
|
* Stamp OpenClaw origin onto a timeline entry emitted by the Gateway adapter.
|
|
59
104
|
*
|
|
@@ -96,12 +141,24 @@ export declare function enrichGatewayTimelineEntry<T extends {
|
|
|
96
141
|
*/
|
|
97
142
|
export declare function classifyObservedHookEvent(eventName: string, mapped: string): {
|
|
98
143
|
boundary: string;
|
|
99
|
-
agentType: 'claude-code' | 'codex-cli' | 'opencode' | 'antigravity';
|
|
144
|
+
agentType: 'claude-code' | 'codex-cli' | 'opencode' | 'antigravity' | 'kiro-cli' | 'kiro-ide';
|
|
100
145
|
};
|
|
101
146
|
export interface DaemonOptions {
|
|
147
|
+
/** The preferred port — already resolved by the caller when present. */
|
|
102
148
|
port?: number;
|
|
149
|
+
/**
|
|
150
|
+
* Where `port` came from. Carried so the fallback log can name the real
|
|
151
|
+
* source: the CLI resolves the port itself (so the parent's singleton guard
|
|
152
|
+
* and the forked child cannot aim at different ports), which would otherwise
|
|
153
|
+
* make every port look like it was typed as `--port`.
|
|
154
|
+
*/
|
|
155
|
+
portSource?: DaemonPortSource;
|
|
103
156
|
debug?: boolean;
|
|
104
157
|
wakeWord?: boolean;
|
|
158
|
+
/** `--local`: every device module off, USB serial included. */
|
|
159
|
+
local?: boolean;
|
|
160
|
+
/** `--loopback`: bind 127.0.0.1 and emit nothing onto the LAN. */
|
|
161
|
+
loopback?: boolean;
|
|
105
162
|
}
|
|
106
163
|
export declare function startDaemon(opts: DaemonOptions): Promise<void>;
|
|
107
164
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-server.d.ts","sourceRoot":"","sources":["../src/daemon-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,UAAU,EAA8B,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"daemon-server.d.ts","sourceRoot":"","sources":["../src/daemon-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,UAAU,EAA8B,MAAM,kBAAkB,CAAC;AAyH1E,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAiF,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAuDtI,OAAO,EAC6C,eAAe,EAElE,MAAM,gBAAgB,CAAC;AAkKxB;;;;;;;;;;;;;;uDAcuD;AACvD,iBAAS,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;;;;;;;;sEASsE;AACtE,iBAAS,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAU5H;AAED;mEACmE;AACnE,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAgB5F;AAoBD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE;IAAE,KAAK,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