my-durable 0.0.46 → 0.0.47

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.
@@ -7,8 +7,8 @@
7
7
  <meta name="referrer" content="no-referrer" />
8
8
  <link rel="icon" type="image/svg+xml" href="/icons/durable-pi.svg" />
9
9
  <title>Durable Pi | Network</title>
10
- <script type="module" crossorigin src="/assets/index-CAtBlkjt.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-B5d1JP_j.css">
10
+ <script type="module" crossorigin src="/assets/index-BQX67D5M.js"></script>
11
+ <link rel="stylesheet" crossorigin href="/assets/index-BJ1vWSJJ.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="app"></div>
@@ -78,15 +78,22 @@ const remove = (s: ScheduleView) =>
78
78
 
79
79
  /** The model is picked from the device's own catalog, not typed from memory. */
80
80
  const models = ref<{ key: string }[]>([]);
81
+ /** While the device's model catalog loads the form must say so — a silent
82
+ * dead Create button is how live-driving caught this (tunnel first-hit lag). */
83
+ const modelsLoading = ref(false);
81
84
  async function openAdd() {
82
85
  adding.value = true;
83
- draft.value = { name: "", cwd: selected.value?.sessionId ? "" : "", prompt: "", model: "" };
86
+ draft.value = { name: "", cwd: "", prompt: "", model: "" };
87
+ models.value = [];
88
+ modelsLoading.value = true;
84
89
  try {
85
90
  const device = await client().device();
86
91
  models.value = device.models.map((m) => ({ key: `${m.provider}/${m.id}` }));
87
92
  draft.value.model = device.defaultModel;
88
93
  } catch {
89
94
  models.value = [];
95
+ } finally {
96
+ modelsLoading.value = false;
90
97
  }
91
98
  }
92
99
 
@@ -94,7 +101,11 @@ async function save() {
94
101
  const d = draft.value;
95
102
  const [provider, ...rest] = d.model.split("/");
96
103
  const modelId = rest.join("/");
97
- if (!d.name.trim() || !d.cwd.trim() || !d.prompt.trim() || !provider || !modelId) return;
104
+ if (!d.name.trim() || !d.cwd.trim() || !d.prompt.trim()) return;
105
+ if (!provider || !modelId) {
106
+ notify(modelsLoading.value ? "Still loading the model list — one moment." : "Pick a model first.");
107
+ return;
108
+ }
98
109
  busy.value = "new";
99
110
  try {
100
111
  await client().createSchedule({
@@ -138,7 +149,9 @@ async function save() {
138
149
  <label>Prompt<textarea v-model="draft.prompt" rows="3" placeholder="Run the tests and summarise failures" required /></label>
139
150
  <label
140
151
  >Model
141
- <select v-model="draft.model">
152
+ <select v-model="draft.model" :disabled="modelsLoading">
153
+ <option v-if="modelsLoading" value="">loading…</option>
154
+ <option v-else-if="!models.length" value="">(no models — check the device)</option>
142
155
  <option v-for="m in models" :key="m.key" :value="m.key">{{ m.key }}</option>
143
156
  </select>
144
157
  </label>
@@ -148,8 +161,8 @@ async function save() {
148
161
  <label class="inline">daily at <input v-model="daily" class="num time" placeholder="03:00" :disabled="!!every" /></label>
149
162
  </div>
150
163
  <div class="row">
151
- <button class="primary small" type="submit" :disabled="busy === 'new'">
152
- {{ busy === "new" ? "creating…" : "Create schedule" }}
164
+ <button class="primary small" type="submit" :disabled="busy === 'new' || modelsLoading || !draft.model">
165
+ {{ busy === "new" ? "creating…" : modelsLoading ? "loading models…" : "Create schedule" }}
153
166
  </button>
154
167
  <button class="small" type="button" @click="adding = false">Cancel</button>
155
168
  </div>
@@ -93,7 +93,10 @@ function add() {
93
93
  :disabled="disabled"
94
94
  @change="emit('change', $event)"
95
95
  />
96
- <form v-if="adding && kind === 'array'" class="state-add" @submit.prevent="add">
96
+ <!-- The add-form/button must exist for BOTH objects and arrays: live-
97
+ driving caught that the `kind === "array"` guards made object
98
+ containers (including the ROOT) unable to gain fields at all. -->
99
+ <form v-if="adding" class="state-add" @submit.prevent="add">
97
100
  <input
98
101
  v-if="kind !== 'array'"
99
102
  v-model="key"
@@ -115,7 +118,7 @@ function add() {
115
118
  <button type="button" class="text-button" @click="adding = false">Cancel</button>
116
119
  </form>
117
120
  <button
118
- v-else-if="kind === 'array'"
121
+ v-else
119
122
  class="text-button state-add-button"
120
123
  :disabled="disabled"
121
124
  :aria-label="`Add ${kind === 'array' ? 'item' : 'field'} to ${path || '/'}`"
@@ -42,12 +42,19 @@ const background = computed(() =>
42
42
  : (agent.value?.background ?? 0),
43
43
  );
44
44
  const busy = computed(() => session.value?.busy || agent.value?.busy);
45
- /** Behind the hub's build: devices self-update, this is only a hint. */
45
+ /** Behind the hub's build: devices self-update, this is only a hint. The
46
+ * oldest devices predate the rename and report `durableVersion` instead of
47
+ * `packageVersion` — they are exactly the ones the badge exists for. */
46
48
  const behind = computed(() => {
47
- const theirs = device.value?.info?.packageVersion;
49
+ const info = device.value?.info as { packageVersion?: string; durableVersion?: string } | undefined;
50
+ const theirs = info?.packageVersion ?? info?.durableVersion;
48
51
  const ours = hubVersion.value;
49
52
  return Boolean(theirs && ours && ours !== "unknown" && theirs !== ours);
50
53
  });
54
+ const theirVersion = computed(() => {
55
+ const info = device.value?.info as { packageVersion?: string; durableVersion?: string } | undefined;
56
+ return info?.packageVersion ?? info?.durableVersion ?? "?";
57
+ });
51
58
  const statusText = computed(() => {
52
59
  const d = device.value;
53
60
  if (!d) return "";
@@ -122,7 +129,7 @@ const title = computed(() => {
122
129
  <span
123
130
  v-if="behind"
124
131
  class="tag update"
125
- :title="`device runs ${device?.info?.packageVersion ?? '?'}; hub runs ${hubVersion}. Devices self-update: dpi update`"
132
+ :title="`device runs ${theirVersion}; hub runs ${hubVersion}. Devices self-update: dpi update`"
126
133
  >update</span
127
134
  >
128
135
  <span class="meta" :class="{ err: dot === 'err' }">{{ statusText }}</span>
@@ -54,7 +54,11 @@ async function load() {
54
54
  try {
55
55
  usage.value = await deviceClient(id).deviceUsage();
56
56
  } catch (e) {
57
- error.value = message(e).slice(0, 160);
57
+ const text = message(e);
58
+ error.value =
59
+ (e as { code?: string }).code === "not_found" || /allowlist|not found/i.test(text)
60
+ ? "This device runs an older build: update it (`dpi update`) to see usage."
61
+ : text.slice(0, 160);
58
62
  } finally {
59
63
  busy.value = false;
60
64
  }
@@ -1,7 +1,7 @@
1
1
  # Host / Project / Device / Session Management Feature Checklist — orca / paseo / zcode / herdr / piggery → durable-pi
2
2
 
3
3
  Run: `team_20261024143910_47d06fe8b77400d4` · Steps: 01_explore (inventory) → 02_analyze (verify/correct) → 03_write (this file)
4
- Status: **ALL WAVES ADOPTED (0.0.45 — live-verified in production Chrome: bell+panel, usage chip+total row, transcript download, prompt library, bulk select bar, recent-cwds chips; Host vitals with real uptime/load/memory/disk, tunnel-routed session search, and a bundle zip that real `unzip` opens).** Wave 2 complete (0.0.42); Wave 3 complete: diagnostics + keep-awake (0.0.43), telegram bridge + conversation share (0.0.44), task-graph DAG (0.0.45); ssh-interactivity and bulk-resume closed by design. NOTHING left on the feature list. Policy ledger: **#1 crash reporting DECIDED+SHIPPED (0.0.46, local-only)** · **#2 writable pi credentials DECIDED+SHIPPED (0.0.46, write-only)** · #3 implemented as manual-only GC (no defaults, no timer) · #4 stays hint-only badge (the hub never pushes code). Companion to `docs/git-ui-checklist.md` (CLOSED): that file covered the git panel; this one covers everything **around** the agent runtime — projects/workspaces, host/device management, session lifecycle, config/credentials, diagnostics, maintenance. Git-panel features are deliberately absent here. Every load-bearing citation below was re-read in the actual files during this run (see [Verification log](#verification-log)).
4
+ Status: **ALL WAVES ADOPTED (0.0.45 — live-verified in production Chrome: bell+panel, usage chip+total row, transcript download, prompt library, bulk select bar, recent-cwds chips; Host vitals with real uptime/load/memory/disk, tunnel-routed session search, and a bundle zip that real `unzip` opens).** Wave 2 complete (0.0.42); Wave 3 complete: diagnostics + keep-awake (0.0.43), telegram bridge + conversation share (0.0.44), task-graph DAG (0.0.45); ssh-interactivity and bulk-resume closed by design. NOTHING left on the feature list. Policy ledger: **ALL FOUR DECIDED** — #1 crash reporting local-only ✅ (0.0.46) · #2 pi credentials write-only ✅ (0.0.46) · #3 retention manual-only PERMANENTLY ✅ (user 2026-10-25: old sessions are future feature surface — nothing ever auto-deletes) · #4 remote updates hint-only badge ✅ (hub never pushes code). Companion to `docs/git-ui-checklist.md` (CLOSED): that file covered the git panel; this one covers everything **around** the agent runtime — projects/workspaces, host/device management, session lifecycle, config/credentials, diagnostics, maintenance. Git-panel features are deliberately absent here. Every load-bearing citation below was re-read in the actual files during this run (see [Verification log](#verification-log)).
5
5
 
6
6
  ## Why this doc exists
7
7
 
@@ -101,13 +101,20 @@ The analyst corrected the explorer's first draft; the writer re-verified each co
101
101
  Four rows below cannot default; they need the leader's decision before their wave enters the roadmap.
102
102
  None of them blocks Wave 1.
103
103
 
104
- 1. **Crash reporting** (Wave 3) — privacy posture: what is collected, opt-in vs opt-out.
105
- 2. **Writable provider credentials** (Wave 3) — pi owns `~/.pi/agent/auth.json`; our read-only view is
106
- deliberate (`pi-config.ts:10-11`). A write path means deciding who owns that file.
107
- 3. **Retention / auto-archive defaults** (Wave 2) — deletes user data; needs explicit defaults and a
108
- dry-run story before any automatic deletion.
109
- 4. **Hub-driven remote updates** (Wave 2) — trust boundary: the hub must never push code to devices.
110
- Badge-only (device self-updates, hub informs) is the safe shape; anything more needs a decision.
104
+ All four are DECIDED (0.0.46, user-approved):
105
+
106
+ 1. **Crash reporting — DECIDED: local-only.** One short redacted markdown file per crash under
107
+ `<home>/backend/crashes/`; no telemetry, no upload, no opt-in question — *we cannot leak what we
108
+ never send*. Human- and agent-readable fixed template; `dpi doctor` surfaces reports as a warn.
109
+ 2. **Writable provider credentials — DECIDED: write-only.** pi keeps owning `~/.pi/agent/auth.json`;
110
+ the device may set/remove exactly one `api_key` entry. Values never leave the file (masked tails
111
+ only), oauth logins and corrupt files are refused, writes atomic 0600 + `.bak`.
112
+ 3. **Retention / auto-archive — DECIDED: manual-only, permanently.** `dpi gc --closed-before 30d`
113
+ (dry-run default, `--yes` to act) stays the ONLY deletion path; nothing ever schedules itself.
114
+ Rationale (user, 2026-10-25): old sessions are a likely FEATURE surface later (search/resume/
115
+ history mining), so the device must never silently destroy them — the operator is the only deleter.
116
+ 4. **Hub-driven remote updates — DECIDED: hint-only badge.** The hub informs, the device self-updates;
117
+ the hub never pushes code to devices. If more is ever needed, that is a new decision, not a default.
111
118
 
112
119
  ## Wave 1a — FE-only, no BE change (start here)
113
120
 
@@ -138,7 +145,7 @@ None of them blocks Wave 1.
138
145
  | MUST | Usage dashboard | orca `usage/agent-token-usage.ts` + `usage-calendar-range.ts` (46-file suite incl. per-provider parsers) | ✅ (`0.0.39`) | GET `/device/usage` sums each harness's usage per session/model/project; Inspector **Usage** tab. Live: 4,307 tok → `opencode-go/claude-haiku-5-5`, attributed to its project. No calendar/persistence yet (archived sessions are closed stores) |
139
146
  | SHOULD | Notification delivery fan-out | orca `notification-delivery-service.ts:15-49` (tray→mobile→desktop, burst cooldown); piggery notify hooks desktop/herdr/ntfy (`docs/reference.md:15`) | ✅ (`0.0.41`) | `notify-sinks.ts`: webhook + ntfy sinks, per-(sink,event-kind) 10 s cooldown, SSRF guard with `DPI_NOTIFY_ALLOW_PRIVATE=1` for LAN. Events: `session.failed`, `schedule.ok`, `schedule.failed`, `test`. `dpi notify list/add/enable/disable/remove/test/events`; Inspector **Notify** tab. Live: ntfy.sh received the test sent from the panel |
140
147
  | SHOULD | Env-var management UI | orca `settings/HostAgentEnvironmentEditor.tsx` + `agent-default-env-draft.ts` | ✅ (`0.0.42`) | `env-vars.ts`: the DEVICE's env file, not the laptop's yaml — managed keys (DPI_TOKEN/port/…) refused, secret-NAMED values return masked (`••••••••t123`), process-only vars listed read-only (`loadEnvFile` never overrides them). `GET/POST/DELETE /v1/device/env`; Inspector **Env** tab with a restart-required banner (nothing pretends to hot-apply). Caught live: the hub caches the tunnel allowlist in memory, so new device routes also need a hub restart |
141
- | MUST | Retention / auto-GC — **policy #3** | orca `terminal-history-gc.ts`; piggery `gc --closed-before DURATION [--dry-run]` (`docs/reference.md:31`) | ✅ manual-only (`0.0.40`) | `gc.ts` + `dpi gc --closed-before 30d [--yes]`: **dry-run is the default and nothing schedules itself** — the retention policy stays the operator's call (gate #3 remains open for defaults) |
148
+ | MUST | Retention / auto-GC — **policy #3** | orca `terminal-history-gc.ts`; piggery `gc --closed-before DURATION [--dry-run]` (`docs/reference.md:31`) | ✅ manual-only (`0.0.40`) | `gc.ts` + `dpi gc --closed-before 30d [--yes]`: **dry-run is the default and nothing schedules itself** — and per the user's decision (2026-10-25) this is PERMANENT: no auto-archive will ever ship, because old sessions are a likely future feature surface (search/resume/history mining). The operator is the only deleter |
142
149
  | SHOULD | Remote update badge — **policy #4** | orca `ssh/managed-server-update-check.ts` + `orcad-update-plan.ts` | ✅ (`0.0.40`) | `GET /api/version` (hub walks up to the `my-durable` package.json) + device `packageVersion` in `/v1/device` → tree badge "update". Hint only: devices self-update, the hub never pushes code. Verified 0 badges when versions match, and the 1.3.0-vs-0.0.39 trap (pi-durable's version) is fixed by reporting both |
143
150
  | SHOULD | Backup/restore of session data | orca `rolling-file-backup.ts`; paseo `migrations/` (schema side) | ✅ (`0.0.42`) | `dpi backup create|list|restore` (executor module + 16 tests): whole-home zip (binary-capable writer reusing zip.ts's crc32) into a SIBLING `<home>-backups/` dir so a backup never contains itself; restore is plan-first (`--yes`), refuses while the daemon answers healthz, and never deletes — the old home becomes `home.bak-<ts>`. Live: 73 files / 5.4 MiB from the real device home, `unzip`/`zipfile`-clean, restore refused with exit 1 while running |
144
151
  | SHOULD | Rate-limit surfacing | orca `rate-limits/` | ✅ device-side (`0.0.41`) | `classifyProviderError`: 429/quota → `rate_limited` (+`retryAfterMs` from Retry-After), 401/403 → `auth`, 404 → `missing`; `probeModel` returns the provider's own words, `dpi doctor` prints "rate limited — retry in 30s" / "provider key rejected". **Not** in the web picker: `probe-model` is deliberately local-only (never tunnelled), so the FE cannot probe |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-durable",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
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": {