my-durable 0.0.41 → 0.0.42

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-DMb-n4O-.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-D6ClJqd8.css">
10
+ <script type="module" crossorigin src="/assets/index-o6Rn26ft.js"></script>
11
+ <link rel="stylesheet" crossorigin href="/assets/index-DaurAPEn.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="app"></div>
@@ -0,0 +1,268 @@
1
+ <script setup lang="ts">
2
+ // Env-var management (Wave 2): the DEVICE's own env file — the one loadConfig
3
+ // reads at boot. orca edits a host's default agent environment the same way.
4
+ //
5
+ // Guardrails from the backend, mirrored here: managed keys and process-only
6
+ // vars are read-only, secret values arrive masked and stay masked. Every
7
+ // change needs a daemon restart to apply — the panel says so, it does not
8
+ // pretend otherwise.
9
+ import { computed, ref, watch } from "vue";
10
+ import { RefreshCw, Plus, Pencil, Trash2, FileCog } from "lucide-vue-next";
11
+ import type { EnvFileView, EnvVarView } from "@sdk/api";
12
+ import { deviceClient, message } from "../client/hub";
13
+ import { notify, selected, ui } from "../client/store";
14
+
15
+ const view = ref<EnvFileView | null>(null);
16
+ const loading = ref(false);
17
+ const error = ref("");
18
+ const busy = ref("");
19
+ const deviceId = computed(() => selected.value?.deviceId);
20
+ const client = () => deviceClient(deviceId.value ?? "");
21
+
22
+ const adding = ref(false);
23
+ const draft = ref({ key: "", value: "" });
24
+
25
+ async function load() {
26
+ if (!deviceId.value) return void (view.value = null);
27
+ loading.value = true;
28
+ error.value = "";
29
+ try {
30
+ view.value = await client().envView();
31
+ } catch (e) {
32
+ const text = message(e);
33
+ error.value =
34
+ (e as { code?: string }).code === "not_found" || /allowlist/i.test(text)
35
+ ? "This device runs an older build: update it (`dpi update`) to edit env vars."
36
+ : text.slice(0, 160);
37
+ } finally {
38
+ loading.value = false;
39
+ }
40
+ }
41
+ watch(deviceId, load, { immediate: true });
42
+
43
+ const editable = (v: EnvVarView) => v.source === "file" && !v.managed;
44
+
45
+ async function add() {
46
+ const key = draft.value.key.trim().toUpperCase();
47
+ if (!key || !draft.value.value) return;
48
+ busy.value = "new";
49
+ try {
50
+ await client().setEnvVar(key, draft.value.value);
51
+ adding.value = false;
52
+ draft.value = { key: "", value: "" };
53
+ await load();
54
+ notify(`${key} saved — restart the device to apply it.`);
55
+ } catch (e) {
56
+ notify(message(e).slice(0, 160));
57
+ } finally {
58
+ busy.value = "";
59
+ }
60
+ }
61
+
62
+ function edit(v: EnvVarView) {
63
+ ui.dialog = {
64
+ kind: "prompt",
65
+ title: `Set ${v.key}`,
66
+ label: "Value",
67
+ hint: v.secret
68
+ ? "The current value is secret and stays masked. Type a new value to replace it."
69
+ : "Single line. Applies after the next device restart.",
70
+ value: v.secret ? "" : v.masked,
71
+ placeholder: v.secret ? v.masked : "",
72
+ submit: "Save value",
73
+ run: async (value) => {
74
+ if (!value) throw Error("A value is required");
75
+ await client().setEnvVar(v.key, value);
76
+ await load();
77
+ notify(`${v.key} saved — restart the device to apply it.`);
78
+ },
79
+ };
80
+ }
81
+
82
+ function remove(v: EnvVarView) {
83
+ ui.dialog = {
84
+ kind: "prompt",
85
+ title: `Remove ${v.key} from the env file?`,
86
+ hint: "The line is deleted from the file. Restart the device to apply it.",
87
+ submit: "Remove",
88
+ danger: true,
89
+ run: async () => {
90
+ await client().removeEnvVar(v.key);
91
+ await load();
92
+ notify(`${v.key} removed — restart the device to apply it.`);
93
+ },
94
+ };
95
+ }
96
+ </script>
97
+
98
+ <template>
99
+ <section class="env-panel" aria-label="Device environment">
100
+ <header class="panel-heading">
101
+ <span><FileCog :size="16" />ENV</span>
102
+ <button class="icon-button" :disabled="loading || !deviceId" aria-label="Refresh env" title="Refresh" @click="load">
103
+ <RefreshCw :size="15" :class="{ spin: loading }" />
104
+ </button>
105
+ <button
106
+ class="icon-button"
107
+ :disabled="!deviceId || !!error"
108
+ aria-label="Add an env var"
109
+ title="Add an env var to the device's env file"
110
+ @click="adding = !adding"
111
+ >
112
+ <Plus :size="15" />
113
+ </button>
114
+ </header>
115
+
116
+ <p class="hint">
117
+ The device's env file — loaded once at boot. Keys here reach the daemon and its sessions.
118
+ </p>
119
+ <p v-if="!deviceId" class="hint">Select a session to see its device.</p>
120
+ <p v-else-if="error" class="message-error">{{ error }}</p>
121
+ <p v-else-if="view?.restartRequired" class="message-restart">
122
+ Changed since boot — restart the device (<code>dpi device stop &amp;&amp; dpi device start</code>) to apply.
123
+ </p>
124
+
125
+ <form v-if="adding" class="add-form" @submit.prevent="add">
126
+ <label
127
+ >Key (UPPER_SNAKE_CASE)<input v-model="draft.key" placeholder="DPI_NOTIFY_ALLOW_PRIVATE" required />
128
+ </label>
129
+ <label>Value<input v-model="draft.value" placeholder="1" required /></label>
130
+ <div class="row">
131
+ <button class="primary small" type="submit" :disabled="busy === 'new'">
132
+ {{ busy === "new" ? "saving…" : "Save to env file" }}
133
+ </button>
134
+ <button class="small" type="button" @click="adding = false">Cancel</button>
135
+ </div>
136
+ <p class="hint">
137
+ Managed keys (DPI_TOKEN, DPI_PORT, start dirs…) have their own settings and are refused here.
138
+ </p>
139
+ </form>
140
+
141
+ <p v-if="!adding && view && !view.vars.length && !error" class="hint">
142
+ No vars in the env file yet.
143
+ </p>
144
+
145
+ <ul v-if="view?.vars.length" class="var-list">
146
+ <li v-for="v in view.vars" :key="v.key" class="var" :class="{ ro: !editable(v) }">
147
+ <div class="head">
148
+ <code class="key">{{ v.key }}</code>
149
+ <span class="tag">{{ v.source === "process" ? "process" : "file" }}</span>
150
+ <span v-if="v.managed" class="tag" title="Has its own setting; edit that instead">managed</span>
151
+ <span class="spacer" />
152
+ <button
153
+ v-if="editable(v)"
154
+ class="icon-button"
155
+ :aria-label="`Edit ${v.key}`"
156
+ :title="v.secret ? 'Replace the value' : 'Edit the value'"
157
+ @click="edit(v)"
158
+ >
159
+ <Pencil :size="13" />
160
+ </button>
161
+ <button
162
+ v-if="editable(v)"
163
+ class="icon-button"
164
+ :aria-label="`Remove ${v.key}`"
165
+ title="Remove from the env file"
166
+ @click="remove(v)"
167
+ >
168
+ <Trash2 :size="13" />
169
+ </button>
170
+ </div>
171
+ <code class="value" :title="v.secret ? 'secret — masked' : v.masked">{{ v.masked }}</code>
172
+ </li>
173
+ </ul>
174
+
175
+ <p v-if="view" class="hint path">{{ view.envFile }}</p>
176
+ </section>
177
+ </template>
178
+
179
+ <style scoped>
180
+ .env-panel {
181
+ display: flex;
182
+ flex-direction: column;
183
+ gap: 10px;
184
+ padding: 4px 2px 12px;
185
+ font-size: 16px;
186
+ }
187
+ .var-list {
188
+ display: flex;
189
+ flex-direction: column;
190
+ gap: 6px;
191
+ margin: 0;
192
+ padding: 0;
193
+ list-style: none;
194
+ }
195
+ .var {
196
+ display: flex;
197
+ flex-direction: column;
198
+ gap: 3px;
199
+ padding: 7px 10px;
200
+ border: 1px solid var(--line);
201
+ border-radius: 10px;
202
+ }
203
+ .var.ro {
204
+ opacity: 0.72;
205
+ }
206
+ .var .head {
207
+ display: flex;
208
+ align-items: center;
209
+ gap: 6px;
210
+ flex-wrap: wrap;
211
+ }
212
+ .var .spacer {
213
+ margin-left: auto;
214
+ }
215
+ .var .key {
216
+ font-size: 15px;
217
+ }
218
+ .var .value {
219
+ font-size: 13px;
220
+ opacity: 0.75;
221
+ word-break: break-all;
222
+ }
223
+ .add-form {
224
+ display: flex;
225
+ flex-direction: column;
226
+ gap: 8px;
227
+ padding: 10px;
228
+ border: 1px solid var(--line);
229
+ border-radius: 10px;
230
+ }
231
+ .add-form label {
232
+ display: flex;
233
+ flex-direction: column;
234
+ gap: 3px;
235
+ font-size: 13px;
236
+ opacity: 0.85;
237
+ }
238
+ .add-form input {
239
+ font: inherit;
240
+ font-size: 15px;
241
+ padding: 5px 8px;
242
+ color: var(--fg);
243
+ background: transparent;
244
+ border: 1px solid var(--line);
245
+ border-radius: 8px;
246
+ }
247
+ .add-form .row {
248
+ display: flex;
249
+ gap: 6px;
250
+ }
251
+ .message-restart {
252
+ font-size: 14px;
253
+ color: var(--warn, #e5a50a);
254
+ }
255
+ .hint.path {
256
+ font-size: 12px;
257
+ opacity: 0.55;
258
+ word-break: break-all;
259
+ }
260
+ .spin {
261
+ animation: spin 1s linear infinite;
262
+ }
263
+ @keyframes spin {
264
+ to {
265
+ transform: rotate(360deg);
266
+ }
267
+ }
268
+ </style>
@@ -8,6 +8,7 @@ import {
8
8
  PiggyBank,
9
9
  CalendarClock,
10
10
  Bell,
11
+ FileCog,
11
12
  GitBranch,
12
13
  ChevronDown,
13
14
  FolderOpen,
@@ -30,6 +31,7 @@ import HostPanel from "./HostPanel.vue";
30
31
  import UsagePanel from "./UsagePanel.vue";
31
32
  import SchedulesPanel from "./SchedulesPanel.vue";
32
33
  import NotifyPanel from "./NotifyPanel.vue";
34
+ import EnvPanel from "./EnvPanel.vue";
33
35
  import ExtensionsPanel from "./ExtensionsPanel.vue";
34
36
  import ContextBar from "./ContextBar.vue";
35
37
  import { deviceClient, message } from "../client/hub";
@@ -73,6 +75,7 @@ const tabs = [
73
75
  { id: "usage", label: "Usage", icon: PiggyBank },
74
76
  { id: "auto", label: "Auto", icon: CalendarClock },
75
77
  { id: "notify", label: "Notify", icon: Bell },
78
+ { id: "env", label: "Env", icon: FileCog },
76
79
  { id: "state", label: "State", icon: Braces },
77
80
  { id: "tasks", label: "Tasks", icon: Activity },
78
81
  { id: "tools", label: "Tools", icon: Wrench },
@@ -445,6 +448,7 @@ const offeredTools = computed(() => detail.value?.tools.filter((t) => t.offered)
445
448
  <UsagePanel v-if="ui.tab === 'usage'" />
446
449
  <SchedulesPanel v-if="ui.tab === 'auto'" />
447
450
  <NotifyPanel v-if="ui.tab === 'notify'" />
451
+ <EnvPanel v-if="ui.tab === 'env'" />
448
452
  <ExtensionsPanel v-if="ui.tab === 'extensions'" />
449
453
  <template v-if="ui.tab === 'tools'"
450
454
  ><div class="panel-heading">
@@ -63,6 +63,43 @@ const rememberCwd = (devId: string, cwd: string) => {
63
63
  const pending = ref(false);
64
64
  const error = ref("");
65
65
 
66
+ /**
67
+ * Per-project default model (Wave 2): once the cwd names a registered project,
68
+ * the picker follows that project's choice. Longest registered root wins, the
69
+ * same rule the device applies on create — the prefill just makes it visible
70
+ * before the session exists.
71
+ */
72
+ const projectModels = ref<Record<string, { provider: string; modelId: string }>>({});
73
+ watch(
74
+ deviceId,
75
+ async (id) => {
76
+ projectModels.value = {};
77
+ if (!id) return;
78
+ try {
79
+ const { projects } = await deviceClient(id).projects(true);
80
+ projectModels.value = Object.fromEntries(
81
+ projects.filter((p) => p.model).map((p) => [p.rootPath, p.model!]),
82
+ );
83
+ } catch {
84
+ /* older device: no project defaults, the device default stays */
85
+ }
86
+ },
87
+ { immediate: true },
88
+ );
89
+ watch(
90
+ [() => draft.value.cwd, projectModels],
91
+ () => {
92
+ const cwd = draft.value.cwd;
93
+ if (!cwd) return;
94
+ const roots = Object.keys(projectModels.value)
95
+ .filter((root) => cwd === root || cwd.startsWith(`${root}/`))
96
+ .sort((a, b) => b.length - a.length);
97
+ const model = roots.length ? projectModels.value[roots[0]] : undefined;
98
+ if (model) draft.value.model = `${model.provider}/${model.modelId}`;
99
+ },
100
+ { immediate: true },
101
+ );
102
+
66
103
  watch(
67
104
  device,
68
105
  (d) => {
@@ -5,7 +5,7 @@
5
5
  // The bar is a filter: click a project to narrow the tree to its sessions.
6
6
  // Chips load once per online device (asked for, never polled).
7
7
  import { computed, ref, watch } from "vue";
8
- import { FolderGit2, Folder, Tag, Pencil, Archive, ArchiveRestore, X } from "lucide-vue-next";
8
+ import { FolderGit2, Folder, Tag, Pencil, Archive, ArchiveRestore, X, Cpu } from "lucide-vue-next";
9
9
  import type { ProjectRecord } from "@sdk/api";
10
10
  import { deviceClient, message } from "../client/hub";
11
11
  import { network, notify, ui } from "../client/store";
@@ -110,6 +110,43 @@ function labels(item: Listed) {
110
110
  };
111
111
  }
112
112
 
113
+ /**
114
+ * Per-project default model (Wave 2: per-project settings). The prompt is a
115
+ * plain "provider/modelId" text — validation happens against the device's real
116
+ * catalog in `run`, so a typo keeps the dialog open with the device's answer.
117
+ */
118
+ function defaultModel(item: Listed) {
119
+ const project = item.project;
120
+ const catalog = network.devices.value.find((d) => d.id === item.deviceId)?.info?.models ?? [];
121
+ ui.dialog = {
122
+ kind: "prompt",
123
+ title: `Default model for ${display(project)}`,
124
+ label: "Model (provider/modelId)",
125
+ hint: catalog.length
126
+ ? `New sessions in this project start on this model instead of the device default. Leave empty to use the device default. E.g. ${catalog[0].provider}/${catalog[0].id}`
127
+ : "New sessions in this project start on this model. Leave empty to use the device default.",
128
+ value: project.model ? `${project.model.provider}/${project.model.modelId}` : "",
129
+ placeholder: "device default",
130
+ submit: "Save default model",
131
+ run: async (value) => {
132
+ if (!value.trim()) {
133
+ await deviceClient(item.deviceId).updateProject(project.id, { model: "" });
134
+ notify(`Default model cleared on ${display(project)}.`);
135
+ await load();
136
+ return;
137
+ }
138
+ const [provider, ...rest] = value.trim().split("/");
139
+ const modelId = rest.join("/");
140
+ const known = catalog.some((m) => m.provider === provider && m.id === modelId);
141
+ if (!provider || !modelId) throw Error("Format: provider/modelId");
142
+ if (!known) throw Error(`${value.trim()} is not in this device's catalog`);
143
+ await deviceClient(item.deviceId).updateProject(project.id, { model: { provider, modelId } });
144
+ notify(`New sessions in ${display(project)} start on ${modelId}.`);
145
+ await load();
146
+ },
147
+ };
148
+ }
149
+
113
150
  function archive(item: Listed) {
114
151
  const project = item.project;
115
152
  const archived = project.archivedAt !== null;
@@ -177,6 +214,9 @@ defineExpose({ reload: load });
177
214
  <template v-for="item in items.filter(isActive)" :key="item.project.id">
178
215
  <button class="small" @click="rename(item)"><Pencil :size="12" />name</button>
179
216
  <button class="small" @click="labels(item)"><Tag :size="12" />labels</button>
217
+ <button class="small" @click="defaultModel(item)" title="Default model for new sessions in this project">
218
+ <Cpu :size="12" />{{ item.project.model ? "model ✓" : "model" }}
219
+ </button>
180
220
  <button class="small" @click="archive(item)">
181
221
  <ArchiveRestore v-if="item.project.archivedAt" :size="12" />
182
222
  <Archive v-else :size="12" />
@@ -204,6 +204,8 @@ export interface ProjectRecord {
204
204
  customName?: string;
205
205
  /** Free-form filters, lowercase; at most 12 per project. */
206
206
  labels: string[];
207
+ /** Default model for sessions started under this project. */
208
+ model?: { provider: string; modelId: string };
207
209
  kind: ProjectKind;
208
210
  createdAt: string;
209
211
  updatedAt: string;
@@ -213,6 +215,27 @@ export interface ProjectRecord {
213
215
  export interface ProjectPatchBody {
214
216
  customName?: string;
215
217
  labels?: string[];
218
+ /** Default model for new sessions in this project; "" clears it. */
219
+ model?: { provider: string; modelId: string } | "";
220
+ }
221
+
222
+ /** One row of the device's env-file view. Secrets arrive masked, never verbatim. */
223
+ export interface EnvVarView {
224
+ key: string;
225
+ masked: string;
226
+ secret: boolean;
227
+ /** "file" = editable; "process" = inherited from systemd/shell, read-only. */
228
+ source: "file" | "process";
229
+ /** Managed keys (DPI_TOKEN, DPI_PORT, …) have a dedicated setting; read-only. */
230
+ managed: boolean;
231
+ }
232
+
233
+ export interface EnvFileView {
234
+ envFile: string;
235
+ exists: boolean;
236
+ /** True once something changed since boot — restart to apply. */
237
+ restartRequired: boolean;
238
+ vars: EnvVarView[];
216
239
  }
217
240
 
218
241
  /** What a live model probe found. `status` is what a picker can show as a hint. */
@@ -440,7 +463,8 @@ export interface AgentDetail extends AgentSummary {
440
463
  export interface CreateSessionBody {
441
464
  name: string;
442
465
  cwd: string;
443
- model: { provider: string; modelId: string };
466
+ /** Optional since per-project defaults: absent = the project's model, else the device says so. */
467
+ model?: { provider: string; modelId: string };
444
468
  thinkingLevel?: ThinkingLevel;
445
469
  }
446
470
 
@@ -4,6 +4,8 @@ import type {
4
4
  AgentExtensions,
5
5
  AgentSummary,
6
6
  CompactionSettings,
7
+ EnvFileView,
8
+ EnvVarView,
7
9
  CreateAgentBody,
8
10
  CreateSessionBody,
9
11
  DeviceInfo,
@@ -246,6 +248,16 @@ export class DpiClient {
246
248
  testNotifySinks() {
247
249
  return this.request<{ results: NotifyDelivery[] }>("POST", "/v1/notify/test", {});
248
250
  }
251
+ /** The device's env file (managed keys read-only, secrets masked). */
252
+ envView() {
253
+ return this.request<EnvFileView>("GET", "/v1/device/env");
254
+ }
255
+ setEnvVar(key: string, value: string) {
256
+ return this.request<EnvVarView>("POST", "/v1/device/env", { key, value });
257
+ }
258
+ removeEnvVar(key: string) {
259
+ return this.request<{ removed: boolean }>("DELETE", `/v1/device/env/${enc(key)}`);
260
+ }
249
261
  /** Scheduled sessions on this device (device-owned clock). */
250
262
  schedules() {
251
263
  return this.request<{ schedules: ScheduleView[] }>("GET", "/v1/schedules");
@@ -12,6 +12,9 @@
12
12
  const ROUTES: readonly (readonly [method: string, pattern: string])[] = [
13
13
  ["GET", "/device"],
14
14
  ["GET", "/device/vitals"],
15
+ ["GET", "/device/env"],
16
+ ["POST", "/device/env"],
17
+ ["DELETE", "/device/env/:key"],
15
18
  ["GET", "/device/usage"],
16
19
  ["GET", "/tree"],
17
20
  ["GET", "/fs/dirs"],
package/bin/dpi.mjs CHANGED
@@ -6,6 +6,7 @@
6
6
  // dpi schedule [list|add|enable|disable|run|remove] scheduled sessions
7
7
  // dpi notify [list|add|enable|disable|remove|test] outbound notifications
8
8
  // dpi gc --closed-before 30d [--dry-run|--yes] retention (dry-run default)
9
+ // dpi backup [create|list|restore] whole-home snapshots
9
10
  // dpi doctor [--json] [--quiet] one-shot device health check
10
11
  // Every subcommand runs the TypeScript entry through tsx, so no build step is needed.
11
12
  import { access } from "node:fs/promises";
@@ -160,6 +161,13 @@ if (command === "update" || command === "upgrade") {
160
161
  register();
161
162
  const { gcCli } = await import("../apps/dpi-backend/src/gc-cli.ts");
162
163
  process.exit(await gcCli({ argv: commandRest }));
164
+ } else if (command === "backup") {
165
+ // Whole-home snapshots: create/list, restore is plan-first and refuses while
166
+ // the daemon runs. Nothing is ever deleted — the old home becomes a .bak.
167
+ const { register } = await loadTsx();
168
+ register();
169
+ const { backupCli } = await import("../apps/dpi-backend/src/backup-cli.ts");
170
+ process.exit(await backupCli({ argv: commandRest }));
163
171
  } else if (command === "doctor") {
164
172
  // One-shot health check. The logic lives in the backend as TS (testable with
165
173
  // injected fakes); this is only the tsx loader + the exit code.
@@ -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: **Waves 1a+1b+2 ADOPTED (0.0.41 — 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).** Remaining: env UI, backup/restore, per-project settings (Wave 2 SHOULDs) and Wave 3. Policy gates #1/#2/#4 are still open; #3 is implemented as manual-only GC (no defaults, no timer). 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: **Waves 1a+1b+2 ADOPTED IN FULL (0.0.42 — 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 is now complete (env UI, backup/restore and per-project defaults shipped in 0.0.42). Remaining: Wave 3. Policy gates #1/#2/#4 are still open; #3 is implemented as manual-only GC (no defaults, no timer). 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
 
@@ -137,12 +137,12 @@ None of them blocks Wave 1.
137
137
  | MUST | Scheduled sessions (device-side) | orca `automations/service.ts:186-211` (scheduled trigger, precheck, completion watcher; separate drift report) | ✅ (`0.0.40`) | `schedules.ts` registry + a 30 s unref'd device loop (`store.ts`): a run creates a **fresh session** (`<name> · <time>`), sends the prompt, records the outcome. `dpi schedule list/add/enable/disable/run/remove`; Inspector **Auto** tab. Live: run → `ok`, next run computed |
138
138
  | 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
139
  | 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
- | SHOULD | Env-var management UI | orca `settings/HostAgentEnvironmentEditor.tsx` + `agent-default-env-draft.ts` | ❌ | edit the `env`/`env_keys` blocks of `dpi-network.yaml` (the file that generates `backend.env`, `dpi-network.example.yaml:23-30`) |
140
+ | 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
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) |
142
142
  | 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
- | SHOULD | Backup/restore of session data | orca `rolling-file-backup.ts`; paseo `migrations/` (schema side) | ❌ | rolling copies of registry + device store ahead of schema migrations |
143
+ | 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
144
  | 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 |
145
- | SHOULD | Per-project settings/instructions | orca `settings/RepositoryPane.tsx` | ❌ | after the project entity: per-project model/env defaults |
145
+ | SHOULD | Per-project settings/instructions | orca `settings/RepositoryPane.tsx` | ✅ (`0.0.42`) | `model` on the project record (`""` clears): a session created with no model under a project uses the project's model — device-side (`store.create` via longest-registered-root lookup, so schedules/spawns inherit too) and visible in the FE (ProjectBar "model ✓" editor validating against the catalog; NewSessionDialog prefills the picker once the cwd names the project). Per-project ENV defaults were deliberately not built: sessions have no per-session env surface to plug into. Live: curl-created session in gitdemo landed on `zai/glm-4.7` with no model in the body; picker prefill verified in Chrome |
146
146
 
147
147
  ## Wave 3 — differentiators / later
148
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-durable",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
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": {