my-durable 0.0.71 → 0.0.73
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 +2 -2
- package/apps/dpi-backend/API.md +1 -0
- package/apps/dpi-backend/src/backup.ts +25 -1
- package/apps/dpi-backend/src/git.ts +34 -2
- package/apps/dpi-backend/src/routes.ts +10 -1
- package/apps/dpi-backend/src/store.ts +149 -2
- package/apps/dpi-backend/src/telegram.ts +141 -4
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-BE-fN78Y.css +1 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-C9TcDwN6.js +82 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/index.html +2 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/src/components/NetworkSidebar.vue +43 -4
- package/apps/dpi-playground/apps/dpi-playground-hub/src/audit.ts +32 -3
- package/apps/dpi-playground/apps/dpi-playground-hub/src/monitor.ts +18 -4
- package/apps/dpi-playground/apps/dpi-playground-hub/src/mux.ts +6 -2
- package/apps/dpi-playground/apps/dpi-playground-hub/src/proxy.ts +5 -0
- package/apps/dpi-playground/apps/dpi-playground-hub/src/transport.ts +59 -3
- package/apps/dpi-playground/apps/dpi-playground-hub/src/tunnel-transport.ts +1 -1
- package/apps/dpi-sdk/src/api.ts +13 -1
- package/apps/dpi-sdk/src/client.ts +12 -5
- package/apps/dpi-sdk/src/node/config.ts +34 -5
- package/apps/dpi-sdk/src/node/drivers.ts +15 -1
- package/apps/dpi-tui/src/app.ts +8 -6
- package/apps/dpi-tui/src/commands.ts +44 -4
- package/apps/dpi-tui/src/main.ts +3 -1
- package/apps/dpi-tui/src/pairing.ts +11 -10
- package/apps/dpi-tui/src/views.ts +1 -1
- package/apps/dpi-tui/src/welcome.ts +1 -1
- package/docs/host-project-checklist.md +1 -1
- package/package.json +1 -1
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-CpNu1wqa.js +0 -81
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-DSU1QhGO.css +0 -1
|
@@ -16,6 +16,7 @@ import type { App } from "./app.ts";
|
|
|
16
16
|
import { wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
17
17
|
import { Panel } from "./pickers.ts";
|
|
18
18
|
import { c } from "./theme.ts";
|
|
19
|
+
import { sanitizeTerminal } from "./sanitize.ts";
|
|
19
20
|
|
|
20
21
|
export interface PairArgs {
|
|
21
22
|
code?: string;
|
|
@@ -151,32 +152,32 @@ export function pairingViewLines(
|
|
|
151
152
|
hubOrigin?: string,
|
|
152
153
|
): string[] {
|
|
153
154
|
const lines: string[] = [c.bold(c.accent("Pair this device"))];
|
|
154
|
-
if (hubOrigin) lines.push(c.muted(`hub: ${hubOrigin}`));
|
|
155
|
+
if (hubOrigin) lines.push(c.muted(`hub: ${sanitizeTerminal(hubOrigin)}`));
|
|
155
156
|
if (!status) {
|
|
156
|
-
lines.push(c.muted(note));
|
|
157
|
+
lines.push(c.muted(sanitizeTerminal(note)));
|
|
157
158
|
return lines.flatMap((line) => wrapTextWithAnsi(line, Math.max(1, width)));
|
|
158
159
|
}
|
|
159
|
-
lines.push(c.muted(`device: ${status.deviceName ?? status.deviceUid ?? "?"} · uid ${status.deviceUid ?? "?"}`));
|
|
160
|
+
lines.push(c.muted(sanitizeTerminal(`device: ${status.deviceName ?? status.deviceUid ?? "?"} · uid ${status.deviceUid ?? "?"}`)));
|
|
160
161
|
lines.push("");
|
|
161
162
|
lines.push(c.bold("key fingerprint (compare with the hub wizard):"));
|
|
162
|
-
for (const line of wrapFingerprint(status.fingerprint, width)) lines.push(` ${c.secondary(line)}`);
|
|
163
|
+
for (const line of wrapFingerprint(status.fingerprint, width)) lines.push(` ${c.secondary(sanitizeTerminal(line))}`);
|
|
163
164
|
lines.push("");
|
|
164
165
|
if (status.pending) {
|
|
165
166
|
lines.push(c.warn("Awaiting approval on the hub…"));
|
|
166
|
-
if (status.pending.note) lines.push(c.muted(` ${status.pending.note}`));
|
|
167
|
+
if (status.pending.note) lines.push(c.muted(` ${sanitizeTerminal(status.pending.note)}`));
|
|
167
168
|
} else if (status.lastError) {
|
|
168
|
-
lines.push(c.err(describePairingError(status.lastError)));
|
|
169
|
+
lines.push(c.err(sanitizeTerminal(describePairingError(status.lastError))));
|
|
169
170
|
if (status.state === "paired")
|
|
170
|
-
lines.push(c.muted(`Existing pairing to ${status.hubOrigin} is unchanged.`));
|
|
171
|
+
lines.push(c.muted(sanitizeTerminal(`Existing pairing to ${status.hubOrigin} is unchanged.`)));
|
|
171
172
|
} else if (status.state === "paired") {
|
|
172
|
-
lines.push(c.ok(`Paired to ${status.hubOrigin} (generation ${status.generation}).`));
|
|
173
|
+
lines.push(c.ok(sanitizeTerminal(`Paired to ${status.hubOrigin} (generation ${status.generation}).`)));
|
|
173
174
|
lines.push(c.muted("The connector keeps the tunnel up; /pair again to re-pair."));
|
|
174
175
|
} else if (status.state === "revoked") {
|
|
175
176
|
lines.push(c.warn("Revoked on the hub. /pair CODE to pair again."));
|
|
176
177
|
} else {
|
|
177
|
-
lines.push(c.muted(note));
|
|
178
|
+
lines.push(c.muted(sanitizeTerminal(note)));
|
|
178
179
|
}
|
|
179
|
-
if (note && status.state !== "pairing") lines.push(c.muted(note));
|
|
180
|
+
if (note && status.state !== "pairing") lines.push(c.muted(sanitizeTerminal(note)));
|
|
180
181
|
return lines.flatMap((line) => wrapTextWithAnsi(line, Math.max(1, width)));
|
|
181
182
|
}
|
|
182
183
|
|
|
@@ -239,7 +239,7 @@ export function renderNetwork(
|
|
|
239
239
|
const seen = d.lastSeenAt ? ageOf(d.lastSeenAt) : "never";
|
|
240
240
|
label =
|
|
241
241
|
`${dot} ${c.bold(row.label)}${row.current ? c.accent(" ▌") : ""} ${c.muted(`[${d.kind}]`)} ` +
|
|
242
|
-
`${c.muted(d.transport === "tunnel" ? "tunnel" : "lan")} ${c.muted(d.lastStatus === "online" ? seen : `${d.lastStatus} · ${seen}`)}`;
|
|
242
|
+
`${c.muted(d.transport === "tunnel" ? "tunnel" : "lan")} ${c.muted(d.lastStatus === "online" ? seen : `${sanitizeTerminal(d.lastStatus)} · ${seen}`)}`;
|
|
243
243
|
} else {
|
|
244
244
|
const selected = row.sessionId === opts.currentSessionId;
|
|
245
245
|
const marker = selected ? c.accent("▌") : " ";
|
|
@@ -426,7 +426,7 @@ async function welcomeLocal(app: App) {
|
|
|
426
426
|
const id = suggestDeviceId(probe.info.hostname, probe.info.name);
|
|
427
427
|
stepPicker(
|
|
428
428
|
app,
|
|
429
|
-
`Local backend: ${probe.info.name || probe.info.hostname || url}`,
|
|
429
|
+
`Local backend: ${sanitizeTerminal(probe.info.name || probe.info.hostname || url)}`,
|
|
430
430
|
[{ value: "open", label: `Save as "${id}" and open`, description: `${url} │ token from DPI_TOKEN / backend.env` }],
|
|
431
431
|
// local.token was read BEFORE a first boot may have written backend.env —
|
|
432
432
|
// re-resolve, the file exists now.
|
|
@@ -133,7 +133,7 @@ All four are DECIDED (0.0.46, user-approved):
|
|
|
133
133
|
|---|---|---|---|---|
|
|
134
134
|
| MUST | Device vitals endpoint + card | herdr `shared/types.ts:19` (`Device.uptime`, `since`); piggery `top` (`docs/reference.md:22`) | ✅ (`0.0.38`) | GET `/device/vitals` (`vitals.ts`: uptime, loadavg, memory, statfs free, counts) + Inspector **Host** tab (`HostPanel.vue`). On demand only — verified 0 requests until the tab opens |
|
|
135
135
|
| MUST | `dpi doctor` | piggery `check`/`doctor` (`docs/reference.md:33-34`) | ✅ (`0.0.38`) | `dpi doctor [--json] [--quiet]` (`doctor.ts`): node ≥ 22.19, healthz, start-dir writability, default-model probe, hub reachability; exit 1 only on FAIL, probe/hub are WARN |
|
|
136
|
-
| SHOULD | Session search (device-side first) | paseo `packages/server/src/server/agent-history-search.ts` | ✅ (`0.0.38`) | GET `/sessions/search?q=` matches names/cwd/models (
|
|
136
|
+
| SHOULD | Session search (device-side first) | paseo `packages/server/src/server/agent-history-search.ts` | ✅ (`0.0.38` metadata; `0.0.73` transcripts) | GET `/sessions/search?q=` matches names/cwd/models; `&scope=all` adds a bounded read-only transcript walk (100 sessions / 4k entries per agent / 50k entries total, newest first — one broken session is skipped). FTS stays the upgrade path for large fleets: the transcript DBs are engine-owned (vendored pi-durable), so no FTS tables of our own without an engine change. FE: instant local filter + debounced device call merged as "more on device" (now with transcript hit previews); TUI: `/find` |
|
|
137
137
|
| SHOULD | Session export bundle | paseo `packages/server/src/server/exports.ts` | ✅ (`0.0.38`) | GET `/sessions/:s/export` → base64 zip (`zip.ts`, zero-dep writer): manifest + session record + per-agent transcript.json/.md + config.json. Import still later |
|
|
138
138
|
|
|
139
139
|
## Wave 2 — medium
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "my-durable",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"description": "Durable Pi — the durable agent network: hub web UI, device backend daemon, TUI admin and the shared SDK, packaged as one runnable monorepo install",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|