volute 0.45.1 → 0.45.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.
Files changed (108) hide show
  1. package/dist/{activity-events-OMCSM7XW.js → activity-events-BUR2RYTJ.js} +2 -2
  2. package/dist/{ai-service-534WUSDL.js → ai-service-UODCCE4O.js} +3 -3
  3. package/dist/{archive-6R4TZMYI.js → archive-WS2L2VIQ.js} +2 -2
  4. package/dist/{auth-FRZJVQCS.js → auth-FLAEXXZK.js} +3 -3
  5. package/dist/{avatar-image-BNWEXSA2.js → avatar-image-6KY6UU4D.js} +3 -3
  6. package/dist/{backup-OZXHL3JS.js → backup-TST5C2YN.js} +7 -7
  7. package/dist/{chat-I4EDDIQC.js → chat-76MRWWQX.js} +2 -2
  8. package/dist/{chunk-ZIR7HSAX.js → chunk-4JOQZPCE.js} +1 -1
  9. package/dist/{chunk-2BONPXAF.js → chunk-6EMWJZBK.js} +1 -1
  10. package/dist/{chunk-ZMIMSIIT.js → chunk-7C44R625.js} +1 -1
  11. package/dist/{chunk-Y6OPHHGM.js → chunk-7ZUB63PS.js} +4 -4
  12. package/dist/{chunk-LAXUUY7O.js → chunk-A7WQZKOU.js} +2 -2
  13. package/dist/{chunk-H7IYFRAL.js → chunk-ALKYQULU.js} +10 -5
  14. package/dist/{chunk-KP3KWNG6.js → chunk-CDPBTTZO.js} +2 -2
  15. package/dist/{chunk-SQL7M4HJ.js → chunk-DRJ24GXK.js} +2 -2
  16. package/dist/{chunk-HVU45COX.js → chunk-EJVPTVTI.js} +1 -1
  17. package/dist/{chunk-322KE457.js → chunk-F7H6ATM4.js} +1 -1
  18. package/dist/{chunk-5AUKCNPE.js → chunk-FR6S2KNN.js} +8 -8
  19. package/dist/{chunk-KVKP6VQ5.js → chunk-FXORA5JG.js} +12 -3
  20. package/dist/{chunk-3ERIL673.js → chunk-H2X54EHC.js} +1 -1
  21. package/dist/{chunk-TSK5PI4L.js → chunk-IHKGWTGT.js} +1 -1
  22. package/dist/{chunk-OXXTPILE.js → chunk-JZ62SYWR.js} +1 -1
  23. package/dist/{chunk-77BVGCTZ.js → chunk-NYC5U6K7.js} +9 -9
  24. package/dist/{chunk-JSRMEY52.js → chunk-OP4JG2BS.js} +5 -4
  25. package/dist/{chunk-CU6OFXMM.js → chunk-PFZBNKUH.js} +9 -0
  26. package/dist/{chunk-QMJJWTNL.js → chunk-QCN24XEN.js} +1 -1
  27. package/dist/{chunk-IUXTYXFI.js → chunk-QNQMSWZE.js} +3 -3
  28. package/dist/{chunk-UMI4UIJG.js → chunk-R77O2WMK.js} +1 -1
  29. package/dist/{chunk-IEWZ7VD7.js → chunk-RRNXJOKB.js} +2 -2
  30. package/dist/{chunk-FHWUQZXE.js → chunk-RXEEYDIB.js} +1 -1
  31. package/dist/{chunk-CYI534DJ.js → chunk-T6HYVHPG.js} +2 -2
  32. package/dist/{chunk-Q2XBKQ2D.js → chunk-TQJ6ZYVY.js} +2 -2
  33. package/dist/{chunk-V4GYPD5L.js → chunk-UYLGEDVD.js} +4 -4
  34. package/dist/{chunk-U4FNXDEJ.js → chunk-YT7PEESJ.js} +231 -98
  35. package/dist/{chunk-5GT7URXJ.js → chunk-ZDZISKCL.js} +1 -1
  36. package/dist/cli.js +16 -16
  37. package/dist/{cloud-sync-Y7LQPRE3.js → cloud-sync-3OJOPZRT.js} +16 -16
  38. package/dist/{conversations-G4LYMHAA.js → conversations-JZTD6KLR.js} +3 -3
  39. package/dist/{create-2YY7IPMS.js → create-IOV4GCRX.js} +1 -1
  40. package/dist/{daemon-restart-ABP54YN6.js → daemon-restart-TIHKVVVA.js} +6 -6
  41. package/dist/daemon.js +180 -137
  42. package/dist/{db-JFLCJCUG.js → db-MF2JNRUW.js} +1 -1
  43. package/dist/delivery-manager-VDVKVA46.js +32 -0
  44. package/dist/{delivery-router-6DE3BPHO.js → delivery-router-N4A7ZC5T.js} +2 -2
  45. package/dist/{down-XCAZXWLB.js → down-U2CZ23M4.js} +4 -4
  46. package/dist/echo-text-6JJOPUD4.js +32 -0
  47. package/dist/{exec-4GWHAHS3.js → exec-G3ZRST4Z.js} +2 -2
  48. package/dist/{export-ID7YUSLZ.js → export-GGIVO76O.js} +2 -2
  49. package/dist/{extensions-AYSPKE33.js → extensions-JONTW2HF.js} +16 -16
  50. package/dist/{files-BQ2WB5KC.js → files-4LN3EN7Q.js} +2 -2
  51. package/dist/{import-SKID37QX.js → import-42YNQBF4.js} +5 -5
  52. package/dist/{isolation-5MB3J73F.js → isolation-YMGZZ4E5.js} +2 -2
  53. package/dist/{join-RXPXGV4L.js → join-ZJV7W6MO.js} +4 -0
  54. package/dist/{login-LM4NF4ZB.js → login-M6OJUPQ2.js} +1 -1
  55. package/dist/{logout-CTJVIZGA.js → logout-WQBWO77G.js} +1 -1
  56. package/dist/message-delivery-3C65ZI6L.js +34 -0
  57. package/dist/{mind-KLHC7XYR.js → mind-DWB6XYCH.js} +6 -6
  58. package/dist/{mind-activity-tracker-BGHJE7XA.js → mind-activity-tracker-POBLU3LC.js} +3 -3
  59. package/dist/mind-service-3F4I46CI.js +36 -0
  60. package/dist/{package-BMHV7UHN.js → package-A7KXT67Q.js} +1 -1
  61. package/dist/{registry-NUJAGLQJ.js → registry-OUZBZ3Q4.js} +5 -1
  62. package/dist/{sandbox-72MWV4JL.js → sandbox-ZJ7QA6Z6.js} +3 -3
  63. package/dist/scheduler-P6DXLLXI.js +30 -0
  64. package/dist/{seed-4MKQ5QKG.js → seed-HCP5NYKH.js} +1 -1
  65. package/dist/{seed-cmd-LCXMR7VV.js → seed-cmd-ILOGNIFB.js} +2 -2
  66. package/dist/{seed-create-N2BF5LQX.js → seed-create-OURS2LS4.js} +3 -3
  67. package/dist/{seed-sprout-6ZDP23YI.js → seed-sprout-ELDFDAN6.js} +7 -7
  68. package/dist/{send-O6W53VBM.js → send-AAIOPJAV.js} +2 -2
  69. package/dist/{service-AQVPUANO.js → service-UOCLXDWR.js} +3 -3
  70. package/dist/{service-install-4QNUDKLM.js → service-install-4HHFDDWY.js} +4 -4
  71. package/dist/{setup-3O6O2JZ7.js → setup-DQM5VPY4.js} +6 -6
  72. package/dist/{setup-73YBJZQL.js → setup-Y2EJI3GG.js} +2 -2
  73. package/dist/skills/imagegen/scripts/imagegen.ts +100 -40
  74. package/dist/skills/volute-mind/SKILL.md +5 -1
  75. package/dist/{skills-ND4ZFYUW.js → skills-BKINFL7W.js} +4 -4
  76. package/dist/sleep-manager-HCUH4PM4.js +34 -0
  77. package/dist/{spirit-II3HOERM.js → spirit-DBTIW7P4.js} +7 -7
  78. package/dist/{sprout-4KUG76AQ.js → sprout-W3KC7UGK.js} +1 -1
  79. package/dist/{src-XFY3XDD6.js → src-OJHARHTF.js} +28 -17
  80. package/dist/{status-E5DQNCAO.js → status-SWRVGXBI.js} +4 -4
  81. package/dist/system-chat-XOALE2RD.js +36 -0
  82. package/dist/{tailscale-QAWVKQKU.js → tailscale-3XOKOW7T.js} +1 -1
  83. package/dist/{turn-tracker-QQIVVXBI.js → turn-tracker-2W6Q2NSR.js} +4 -4
  84. package/dist/{up-LG56MPBI.js → up-FTK7CTO3.js} +5 -5
  85. package/dist/{update-7TYVH5FM.js → update-SWAYZRWJ.js} +4 -4
  86. package/dist/{update-check-VSCSJ7KX.js → update-check-PQ2MZ47K.js} +2 -2
  87. package/dist/{version-notify-CODJOUW2.js → version-notify-3XMAIQTE.js} +17 -17
  88. package/dist/{volute-config-TS62GS6A.js → volute-config-A52FHWKM.js} +5 -1
  89. package/dist/web-assets/assets/{index-Dac11sKB.js → index-Bc2m8gRC.js} +15 -15
  90. package/dist/web-assets/index.html +1 -1
  91. package/package.json +1 -1
  92. package/templates/_base/src/lib/file-handler.ts +3 -3
  93. package/templates/_base/src/lib/router.ts +21 -25
  94. package/templates/_base/src/lib/startup.ts +2 -0
  95. package/templates/_base/src/lib/types.ts +2 -2
  96. package/templates/claude/src/agent.ts +75 -10
  97. package/templates/claude/src/lib/message-channel.ts +23 -0
  98. package/templates/claude/src/lib/session-reaper.ts +37 -0
  99. package/templates/claude/src/server.ts +1 -0
  100. package/templates/codex/src/agent.ts +18 -6
  101. package/templates/pi/src/agent.ts +18 -7
  102. package/dist/delivery-manager-R5STGLXB.js +0 -32
  103. package/dist/echo-text-NQXYYYCU.js +0 -32
  104. package/dist/message-delivery-IUAXRPFE.js +0 -34
  105. package/dist/mind-service-BF2LUQMH.js +0 -36
  106. package/dist/scheduler-YHJRRV6E.js +0 -30
  107. package/dist/sleep-manager-YAHDOIU5.js +0 -34
  108. package/dist/system-chat-E65T2HSW.js +0 -34
@@ -44,14 +44,65 @@ function getDaemonToken(): string | undefined {
44
44
  return process.env.VOLUTE_MIND_TOKEN;
45
45
  }
46
46
 
47
- /** Returns null only when the daemon is unreachable or imagegen is not configured. */
48
- async function generateViaDaemon(model: string, prompt: string): Promise<Buffer | null> {
47
+ /**
48
+ * Outcome of a daemon call, distinguishing the failure modes so the mind gets an
49
+ * accurate diagnosis instead of a misleading "not configured" message:
50
+ * - no-env — not running under a Volute mind environment (env vars unset)
51
+ * - unreachable — daemon env is set but the connection failed (daemon down)
52
+ * - auth — daemon rejected the mind's token (401/403)
53
+ * - fallback — daemon can't serve this (imagegen not configured, or old daemon)
54
+ */
55
+ export type DaemonFailure =
56
+ | { ok: false; reason: "no-env" }
57
+ | { ok: false; reason: "unreachable"; detail: string }
58
+ | { ok: false; reason: "auth"; status: number; detail: string }
59
+ | { ok: false; reason: "fallback" };
60
+ export type DaemonResult<T> = { ok: true; value: T } | DaemonFailure;
61
+
62
+ async function readDaemonError(res: Response): Promise<string> {
63
+ const body = (await res.json().catch(() => null)) as { error?: string } | null;
64
+ return body?.error || `HTTP ${res.status}`;
65
+ }
66
+
67
+ /**
68
+ * Acts on a daemon failure: prints an informational note and returns when the
69
+ * caller should fall back to a direct provider (no-env / fallback), or throws a
70
+ * clear diagnosis for local problems that direct fallback would only mask
71
+ * (unreachable / auth).
72
+ */
73
+ export function handleDaemonFailure(failure: DaemonFailure): void {
74
+ switch (failure.reason) {
75
+ case "no-env":
76
+ console.error(
77
+ "Not running under a Volute mind environment; falling back to direct provider.",
78
+ );
79
+ return;
80
+ case "unreachable":
81
+ throw new Error(
82
+ `Could not reach the Volute daemon at ${getDaemonUrl()}: ${failure.detail}. ` +
83
+ "The daemon may be down — this is a local connection problem, not a provider-configuration issue.",
84
+ );
85
+ case "auth":
86
+ throw new Error(
87
+ `The Volute daemon rejected this mind's token (HTTP ${failure.status}: ${failure.detail}). ` +
88
+ "Check VOLUTE_MIND_TOKEN — this is an authentication problem, not a provider-configuration issue.",
89
+ );
90
+ case "fallback":
91
+ return;
92
+ }
93
+ }
94
+
95
+ export async function generateViaDaemon(
96
+ model: string,
97
+ prompt: string,
98
+ ): Promise<DaemonResult<Buffer>> {
49
99
  const base = getDaemonUrl();
50
100
  const token = getDaemonToken();
51
- if (!base || !token) return null;
101
+ if (!base || !token) return { ok: false, reason: "no-env" };
52
102
 
103
+ let res: Response;
53
104
  try {
54
- const res = await fetch(`${base}/api/v1/system/imagegen/generate`, {
105
+ res = await fetch(`${base}/api/v1/system/imagegen/generate`, {
55
106
  method: "POST",
56
107
  headers: {
57
108
  "Content-Type": "application/json",
@@ -59,49 +110,51 @@ async function generateViaDaemon(model: string, prompt: string): Promise<Buffer
59
110
  },
60
111
  body: JSON.stringify({ model, prompt }),
61
112
  });
62
- if (!res.ok) {
63
- const err = (await res.json().catch(() => ({ error: `HTTP ${res.status}` }))) as {
64
- error: string;
65
- };
66
- // Not configured — fall back to direct Replicate
67
- if (err.error?.includes("not configured") || err.error?.match(/No .* API key/)) return null;
68
- throw new Error(err.error || `Daemon returned ${res.status}`);
69
- }
70
- return Buffer.from(await res.arrayBuffer());
71
113
  } catch (err) {
72
- // Connection failure daemon unreachable, fall back to direct
73
- if (err instanceof TypeError) return null;
114
+ if (err instanceof TypeError) {
115
+ return { ok: false, reason: "unreachable", detail: err.message };
116
+ }
74
117
  throw err;
75
118
  }
119
+
120
+ if (res.status === 401 || res.status === 403) {
121
+ return { ok: false, reason: "auth", status: res.status, detail: await readDaemonError(res) };
122
+ }
123
+ if (!res.ok) {
124
+ const err = await readDaemonError(res);
125
+ // Genuinely not configured — fall back to direct provider.
126
+ if (/not configured/i.test(err) || /No .* API key/i.test(err)) {
127
+ return { ok: false, reason: "fallback" };
128
+ }
129
+ throw new Error(err);
130
+ }
131
+ return { ok: true, value: Buffer.from(await res.arrayBuffer()) };
76
132
  }
77
133
 
78
- /** Returns null only when the daemon is unreachable or endpoint doesn't exist. */
79
- async function searchViaDaemon(query: string): Promise<unknown[] | null> {
134
+ export async function searchViaDaemon(query: string): Promise<DaemonResult<unknown[]>> {
80
135
  const base = getDaemonUrl();
81
136
  const token = getDaemonToken();
82
- if (!base || !token) return null;
137
+ if (!base || !token) return { ok: false, reason: "no-env" };
83
138
 
139
+ let res: Response;
84
140
  try {
85
- const res = await fetch(
141
+ res = await fetch(
86
142
  `${base}/api/v1/system/imagegen/models/search?q=${encodeURIComponent(query)}`,
87
143
  { headers: { Authorization: `Bearer ${token}` } },
88
144
  );
89
- if (!res.ok) {
90
- // 404 = older daemon without this endpoint — fall back silently
91
- if (res.status === 404) return null;
92
- const body = (await res.json().catch(() => ({ error: `HTTP ${res.status}` }))) as {
93
- error: string;
94
- };
95
- console.error(`daemon model search failed: ${body.error || res.status}`);
96
- return null;
97
- }
98
- return (await res.json()) as unknown[];
99
145
  } catch (err) {
100
- // Connection failure daemon unreachable
101
- if (err instanceof TypeError) return null;
102
- console.error(`daemon model search error: ${err instanceof Error ? err.message : err}`);
103
- return null;
146
+ if (err instanceof TypeError) {
147
+ return { ok: false, reason: "unreachable", detail: err.message };
148
+ }
149
+ throw err;
104
150
  }
151
+
152
+ if (res.status === 401 || res.status === 403) {
153
+ return { ok: false, reason: "auth", status: res.status, detail: await readDaemonError(res) };
154
+ }
155
+ // 404 = older daemon without this endpoint; other non-ok — fall back to direct search.
156
+ if (!res.ok) return { ok: false, reason: "fallback" };
157
+ return { ok: true, value: (await res.json()) as unknown[] };
105
158
  }
106
159
 
107
160
  async function generateDirect(model: string, prompt: string): Promise<Buffer> {
@@ -169,9 +222,13 @@ async function generate(args: string[]): Promise<void> {
169
222
 
170
223
  console.log(`generating image with ${model}...`);
171
224
 
172
- // Try daemon first, fall back to direct Replicate
173
- let buf = await generateViaDaemon(model, prompt);
174
- if (!buf) {
225
+ // Try daemon first, fall back to direct Replicate.
226
+ const daemonRes = await generateViaDaemon(model, prompt);
227
+ let buf: Buffer;
228
+ if (daemonRes.ok) {
229
+ buf = daemonRes.value;
230
+ } else {
231
+ handleDaemonFailure(daemonRes); // throws for unreachable/auth; returns to fall back otherwise
175
232
  buf = await generateDirect(model, prompt);
176
233
  }
177
234
 
@@ -190,15 +247,18 @@ async function models(args: string[]): Promise<void> {
190
247
  process.exit(1);
191
248
  }
192
249
 
193
- // Try daemon first
194
- const daemonResults = await searchViaDaemon(query);
195
- if (daemonResults && daemonResults.length > 0) {
196
- for (const m of daemonResults as Array<{ id: string; description?: string }>) {
250
+ // Try daemon first.
251
+ const daemonRes = await searchViaDaemon(query);
252
+ if (daemonRes.ok && daemonRes.value.length > 0) {
253
+ for (const m of daemonRes.value as Array<{ id: string; description?: string }>) {
197
254
  const desc = m.description ? ` — ${m.description.slice(0, 100)}` : "";
198
255
  console.log(`${m.id}${desc}`);
199
256
  }
200
257
  return;
201
258
  }
259
+ if (!daemonRes.ok) {
260
+ handleDaemonFailure(daemonRes); // throws for unreachable/auth; returns to fall back otherwise
261
+ }
202
262
 
203
263
  // Fall back to direct Replicate
204
264
  if (!process.env.REPLICATE_API_TOKEN) {
@@ -81,9 +81,13 @@ volute clock add --id morning-check --cron "0 9 * * *" --message "morning check"
81
81
  ```
82
82
 
83
83
  - `skip` — silently skip when sleeping
84
- - `queue` — queue for delivery on wake
84
+ - `queue` — queue for delivery on wake (**default** when `--while-sleeping` is unset)
85
85
  - `trigger-wake` — briefly wake you, then return to sleep when idle
86
86
 
87
+ By default a schedule that fires while you sleep is queued and delivered when you wake — it won't wake you. Set `--while-sleeping trigger-wake` on a schedule if you want it to wake you.
88
+
89
+ Schedule messages arrive from sender `volute` with the schedule id as a `[prefix]` in the text (e.g. `[dream] dream time`), so a `wakeTriggers.senders` glob can never match a schedule id — that's dead config. Use `--while-sleeping trigger-wake` on the schedule instead.
90
+
87
91
  ## Sleep
88
92
 
89
93
  Sleep lets you follow a rest cycle — your process stops, sessions are archived, and you wake fresh. During sleep, incoming messages are queued and delivered when you wake.
@@ -27,11 +27,11 @@ import {
27
27
  syncBuiltinSkills,
28
28
  uninstallSkill,
29
29
  updateSkill
30
- } from "./chunk-Y6OPHHGM.js";
31
- import "./chunk-3ERIL673.js";
32
- import "./chunk-322KE457.js";
30
+ } from "./chunk-7ZUB63PS.js";
31
+ import "./chunk-H2X54EHC.js";
32
+ import "./chunk-F7H6ATM4.js";
33
33
  import "./chunk-T2TP6ZC6.js";
34
- import "./chunk-H7IYFRAL.js";
34
+ import "./chunk-ALKYQULU.js";
35
35
  import "./chunk-ZV7MFISX.js";
36
36
  import "./chunk-K3NQKI34.js";
37
37
  export {
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ SleepManager,
4
+ getSleepManager,
5
+ getSleepManagerIfReady,
6
+ initSleepManager,
7
+ matchesGlob
8
+ } from "./chunk-YT7PEESJ.js";
9
+ import "./chunk-ZDZISKCL.js";
10
+ import "./chunk-FR6S2KNN.js";
11
+ import "./chunk-QLWG3C2Z.js";
12
+ import "./chunk-7ZUB63PS.js";
13
+ import "./chunk-OP4JG2BS.js";
14
+ import "./chunk-PFZBNKUH.js";
15
+ import "./chunk-JZ62SYWR.js";
16
+ import "./chunk-EJVPTVTI.js";
17
+ import "./chunk-4JOQZPCE.js";
18
+ import "./chunk-UYLGEDVD.js";
19
+ import "./chunk-H2X54EHC.js";
20
+ import "./chunk-IHKGWTGT.js";
21
+ import "./chunk-F7H6ATM4.js";
22
+ import "./chunk-T6HYVHPG.js";
23
+ import "./chunk-7C44R625.js";
24
+ import "./chunk-T2TP6ZC6.js";
25
+ import "./chunk-ALKYQULU.js";
26
+ import "./chunk-ZV7MFISX.js";
27
+ import "./chunk-K3NQKI34.js";
28
+ export {
29
+ SleepManager,
30
+ getSleepManager,
31
+ getSleepManagerIfReady,
32
+ initSleepManager,
33
+ matchesGlob
34
+ };
@@ -4,15 +4,15 @@ import {
4
4
  getSpiritModel,
5
5
  spiritDir,
6
6
  syncSpiritTemplate
7
- } from "./chunk-5AUKCNPE.js";
7
+ } from "./chunk-FR6S2KNN.js";
8
8
  import "./chunk-QLWG3C2Z.js";
9
- import "./chunk-Y6OPHHGM.js";
10
- import "./chunk-CU6OFXMM.js";
11
- import "./chunk-3ERIL673.js";
12
- import "./chunk-TSK5PI4L.js";
13
- import "./chunk-322KE457.js";
9
+ import "./chunk-7ZUB63PS.js";
10
+ import "./chunk-PFZBNKUH.js";
11
+ import "./chunk-H2X54EHC.js";
12
+ import "./chunk-IHKGWTGT.js";
13
+ import "./chunk-F7H6ATM4.js";
14
14
  import "./chunk-T2TP6ZC6.js";
15
- import "./chunk-H7IYFRAL.js";
15
+ import "./chunk-ALKYQULU.js";
16
16
  import "./chunk-ZV7MFISX.js";
17
17
  import "./chunk-K3NQKI34.js";
18
18
  export {
@@ -4,7 +4,7 @@ import "./chunk-K3NQKI34.js";
4
4
  // packages/cli/src/commands/sprout.ts
5
5
  async function run(args) {
6
6
  console.error("Note: `volute mind sprout` is now `volute seed sprout`");
7
- await import("./seed-sprout-6ZDP23YI.js").then((m) => m.run(args));
7
+ await import("./seed-sprout-ELDFDAN6.js").then((m) => m.run(args));
8
8
  }
9
9
  export {
10
10
  run
@@ -45,8 +45,12 @@ function execAsync(cmd, args) {
45
45
  });
46
46
  });
47
47
  }
48
+ var IDENTITY_ARGS = ["-c", "user.name=volute", "-c", "user.email=volute@localhost"];
48
49
  function gitExec(args, opts, isolation) {
49
- const fullArgs = isolation?.isIsolationEnabled() ? ["-c", "safe.directory=*", ...args] : args;
50
+ const prefix = [];
51
+ if (isolation?.isIsolationEnabled()) prefix.push("-c", "safe.directory=*");
52
+ if (args[0] === "commit") prefix.push(...IDENTITY_ARGS);
53
+ const fullArgs = prefix.length ? [...prefix, ...args] : args;
50
54
  return new Promise((resolve6, reject) => {
51
55
  execFileCb("git", fullArgs, { cwd: opts.cwd }, (err, stdout, stderr) => {
52
56
  if (err) {
@@ -83,22 +87,21 @@ function pagesIsolationChownPaths(mindDir, wtGitDir) {
83
87
  if (wtGitDir) paths.push(wtGitDir);
84
88
  return paths;
85
89
  }
90
+ async function isRepoValid(dir, isolation) {
91
+ try {
92
+ await gitExec(["rev-parse", "HEAD"], { cwd: dir }, isolation);
93
+ return true;
94
+ } catch {
95
+ return false;
96
+ }
97
+ }
86
98
  async function ensurePagesRepo(dataDir, isolation) {
87
99
  const dir = pagesRepoDir(dataDir);
88
100
  mkdirSync(dir, { recursive: true });
89
101
  if (existsSync(resolve(dir, ".git"))) {
90
- try {
91
- await gitExec(["rev-parse", "HEAD"], { cwd: dir }, isolation);
92
- return;
93
- } catch (err) {
94
- const msg = err instanceof Error ? err.message : String(err);
95
- if (msg.includes("unknown revision") || msg.includes("bad default revision")) {
96
- console.warn("[pages] repo has no commits, re-initializing");
97
- rmSync(resolve(dir, ".git"), { recursive: true, force: true });
98
- } else {
99
- throw err;
100
- }
101
- }
102
+ if (await isRepoValid(dir, isolation)) return;
103
+ console.warn("[pages] repo invalid or incomplete, re-initializing");
104
+ rmSync(resolve(dir, ".git"), { recursive: true, force: true });
102
105
  }
103
106
  const isIso = isolation?.isIsolationEnabled() ?? false;
104
107
  const initArgs = isIso ? ["init", "--shared=group"] : ["init"];
@@ -118,7 +121,10 @@ async function ensurePagesRepo(dataDir, isolation) {
118
121
  }
119
122
  async function addPagesWorktree(mindName, mindDir, dataDir, isolation) {
120
123
  const dir = pagesRepoDir(dataDir);
121
- if (!existsSync(resolve(dir, ".git"))) return;
124
+ if (!await isRepoValid(dir, isolation)) {
125
+ console.warn(`[pages] repo not usable, skipping worktree for ${mindName}`);
126
+ return;
127
+ }
122
128
  const wt = worktreePath(mindDir);
123
129
  if (existsSync(wt)) return;
124
130
  mkdirSync(resolve(mindDir, "home", "pages"), { recursive: true });
@@ -2143,6 +2149,7 @@ function createPublicRoutes(ctx) {
2143
2149
  // packages/extensions/pages/src/index.ts
2144
2150
  var assetsDir = resolve5(import.meta.dirname, "../dist/ui");
2145
2151
  var skillsDir = resolve5(import.meta.dirname, "../skills");
2152
+ var repoReady = null;
2146
2153
  var src_default = createExtension({
2147
2154
  id: "pages",
2148
2155
  name: "Pages",
@@ -2170,7 +2177,8 @@ var src_default = createExtension({
2170
2177
  }
2171
2178
  },
2172
2179
  onDaemonStart(ctx) {
2173
- ensurePagesRepo(ctx.dataDir, isolationFrom(ctx)).then(() => {
2180
+ repoReady = ensurePagesRepo(ctx.dataDir, isolationFrom(ctx));
2181
+ repoReady.then(() => {
2174
2182
  if (ctx.db) {
2175
2183
  const repoDir = resolve5(ctx.dataDir, "repo");
2176
2184
  try {
@@ -2186,8 +2194,11 @@ var src_default = createExtension({
2186
2194
  onMindStart(mindName, ctx) {
2187
2195
  const mindDir = ctx.getMindDir(mindName);
2188
2196
  if (!mindDir) return;
2189
- addPagesWorktree(mindName, mindDir, ctx.dataDir, isolationFrom(ctx)).catch((err) => {
2190
- console.error(`[pages] failed to add pages worktree for ${mindName}:`, err);
2197
+ (repoReady ?? Promise.resolve()).catch(() => {
2198
+ }).then(() => addPagesWorktree(mindName, mindDir, ctx.dataDir, isolationFrom(ctx))).catch((err) => {
2199
+ console.warn(
2200
+ `[pages] failed to add pages worktree for ${mindName}: ${err.message}`
2201
+ );
2191
2202
  });
2192
2203
  }
2193
2204
  });
@@ -8,7 +8,7 @@ import {
8
8
  import "./chunk-O7IGP7ZW.js";
9
9
  import {
10
10
  checkForUpdate
11
- } from "./chunk-2BONPXAF.js";
11
+ } from "./chunk-6EMWJZBK.js";
12
12
  import {
13
13
  LAUNCHD_PLIST_LABEL,
14
14
  LAUNCHD_PLIST_PATH,
@@ -19,9 +19,9 @@ import {
19
19
  getServiceMode,
20
20
  modeLabel,
21
21
  readDaemonConfig
22
- } from "./chunk-Q2XBKQ2D.js";
23
- import "./chunk-3ERIL673.js";
24
- import "./chunk-H7IYFRAL.js";
22
+ } from "./chunk-TQJ6ZYVY.js";
23
+ import "./chunk-H2X54EHC.js";
24
+ import "./chunk-ALKYQULU.js";
25
25
  import "./chunk-ZV7MFISX.js";
26
26
  import "./chunk-K3NQKI34.js";
27
27
 
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ensureSystemDM,
4
+ generateSystemFallbackReply,
5
+ resetSystemDMCache,
6
+ sendSystemMessage,
7
+ sendSystemMessageDirect,
8
+ shouldGenerateSystemFallback
9
+ } from "./chunk-YT7PEESJ.js";
10
+ import "./chunk-ZDZISKCL.js";
11
+ import "./chunk-FR6S2KNN.js";
12
+ import "./chunk-QLWG3C2Z.js";
13
+ import "./chunk-7ZUB63PS.js";
14
+ import "./chunk-OP4JG2BS.js";
15
+ import "./chunk-PFZBNKUH.js";
16
+ import "./chunk-JZ62SYWR.js";
17
+ import "./chunk-EJVPTVTI.js";
18
+ import "./chunk-4JOQZPCE.js";
19
+ import "./chunk-UYLGEDVD.js";
20
+ import "./chunk-H2X54EHC.js";
21
+ import "./chunk-IHKGWTGT.js";
22
+ import "./chunk-F7H6ATM4.js";
23
+ import "./chunk-T6HYVHPG.js";
24
+ import "./chunk-7C44R625.js";
25
+ import "./chunk-T2TP6ZC6.js";
26
+ import "./chunk-ALKYQULU.js";
27
+ import "./chunk-ZV7MFISX.js";
28
+ import "./chunk-K3NQKI34.js";
29
+ export {
30
+ ensureSystemDM,
31
+ generateSystemFallbackReply,
32
+ resetSystemDMCache,
33
+ sendSystemMessage,
34
+ sendSystemMessageDirect,
35
+ shouldGenerateSystemFallback
36
+ };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-T2TP6ZC6.js";
5
5
  import {
6
6
  voluteHome
7
- } from "./chunk-H7IYFRAL.js";
7
+ } from "./chunk-ALKYQULU.js";
8
8
  import "./chunk-ZV7MFISX.js";
9
9
  import "./chunk-K3NQKI34.js";
10
10
 
@@ -14,11 +14,11 @@ import {
14
14
  sweepWedgedTurns,
15
15
  takeErrored,
16
16
  trackToolUse
17
- } from "./chunk-V4GYPD5L.js";
18
- import "./chunk-TSK5PI4L.js";
19
- import "./chunk-322KE457.js";
17
+ } from "./chunk-UYLGEDVD.js";
18
+ import "./chunk-IHKGWTGT.js";
19
+ import "./chunk-F7H6ATM4.js";
20
20
  import "./chunk-T2TP6ZC6.js";
21
- import "./chunk-H7IYFRAL.js";
21
+ import "./chunk-ALKYQULU.js";
22
22
  import "./chunk-ZV7MFISX.js";
23
23
  import "./chunk-K3NQKI34.js";
24
24
  export {
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  run
4
- } from "./chunk-IUXTYXFI.js";
4
+ } from "./chunk-QNQMSWZE.js";
5
5
  import "./chunk-TXSA4Q3V.js";
6
6
  import "./chunk-O7IGP7ZW.js";
7
- import "./chunk-Q2XBKQ2D.js";
8
- import "./chunk-3ERIL673.js";
7
+ import "./chunk-TQJ6ZYVY.js";
8
+ import "./chunk-H2X54EHC.js";
9
9
  import {
10
10
  readGlobalConfig
11
- } from "./chunk-322KE457.js";
12
- import "./chunk-H7IYFRAL.js";
11
+ } from "./chunk-F7H6ATM4.js";
12
+ import "./chunk-ALKYQULU.js";
13
13
  import "./chunk-ZV7MFISX.js";
14
14
  import "./chunk-K3NQKI34.js";
15
15
  export {
@@ -7,22 +7,22 @@ import {
7
7
  checkForUpdate,
8
8
  getResolvedVersion,
9
9
  resolveVoluteInstall
10
- } from "./chunk-2BONPXAF.js";
10
+ } from "./chunk-6EMWJZBK.js";
11
11
  import {
12
12
  getServiceMode,
13
13
  modeLabel,
14
14
  pollHealth,
15
15
  readDaemonConfig,
16
16
  restartService
17
- } from "./chunk-Q2XBKQ2D.js";
17
+ } from "./chunk-TQJ6ZYVY.js";
18
18
  import {
19
19
  exec,
20
20
  execInherit,
21
21
  resolveVoluteBin
22
- } from "./chunk-3ERIL673.js";
22
+ } from "./chunk-H2X54EHC.js";
23
23
  import {
24
24
  voluteSystemDir
25
- } from "./chunk-H7IYFRAL.js";
25
+ } from "./chunk-ALKYQULU.js";
26
26
  import "./chunk-ZV7MFISX.js";
27
27
  import "./chunk-K3NQKI34.js";
28
28
 
@@ -8,8 +8,8 @@ import {
8
8
  getResolvedVersion,
9
9
  isNewer,
10
10
  resolveVoluteInstall
11
- } from "./chunk-2BONPXAF.js";
12
- import "./chunk-H7IYFRAL.js";
11
+ } from "./chunk-6EMWJZBK.js";
12
+ import "./chunk-ALKYQULU.js";
13
13
  import "./chunk-ZV7MFISX.js";
14
14
  import "./chunk-K3NQKI34.js";
15
15
  export {
@@ -1,28 +1,28 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getCurrentVersion
4
- } from "./chunk-2BONPXAF.js";
4
+ } from "./chunk-6EMWJZBK.js";
5
5
  import {
6
6
  computeTemplateHash
7
7
  } from "./chunk-QMJCNZ6C.js";
8
8
  import {
9
9
  sendSystemMessage
10
- } from "./chunk-U4FNXDEJ.js";
11
- import "./chunk-5GT7URXJ.js";
12
- import "./chunk-5AUKCNPE.js";
10
+ } from "./chunk-YT7PEESJ.js";
11
+ import "./chunk-ZDZISKCL.js";
12
+ import "./chunk-FR6S2KNN.js";
13
13
  import "./chunk-QLWG3C2Z.js";
14
- import "./chunk-Y6OPHHGM.js";
15
- import "./chunk-JSRMEY52.js";
16
- import "./chunk-CU6OFXMM.js";
17
- import "./chunk-OXXTPILE.js";
18
- import "./chunk-HVU45COX.js";
19
- import "./chunk-ZIR7HSAX.js";
20
- import "./chunk-V4GYPD5L.js";
21
- import "./chunk-3ERIL673.js";
22
- import "./chunk-TSK5PI4L.js";
23
- import "./chunk-322KE457.js";
24
- import "./chunk-CYI534DJ.js";
25
- import "./chunk-ZMIMSIIT.js";
14
+ import "./chunk-7ZUB63PS.js";
15
+ import "./chunk-OP4JG2BS.js";
16
+ import "./chunk-PFZBNKUH.js";
17
+ import "./chunk-JZ62SYWR.js";
18
+ import "./chunk-EJVPTVTI.js";
19
+ import "./chunk-4JOQZPCE.js";
20
+ import "./chunk-UYLGEDVD.js";
21
+ import "./chunk-H2X54EHC.js";
22
+ import "./chunk-IHKGWTGT.js";
23
+ import "./chunk-F7H6ATM4.js";
24
+ import "./chunk-T6HYVHPG.js";
25
+ import "./chunk-7C44R625.js";
26
26
  import {
27
27
  logger_default
28
28
  } from "./chunk-T2TP6ZC6.js";
@@ -30,7 +30,7 @@ import {
30
30
  readRegistry,
31
31
  setMindTemplateHash,
32
32
  voluteSystemDir
33
- } from "./chunk-H7IYFRAL.js";
33
+ } from "./chunk-ALKYQULU.js";
34
34
  import "./chunk-ZV7MFISX.js";
35
35
  import "./chunk-K3NQKI34.js";
36
36
 
@@ -1,10 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ WAKE_TRIGGER_DEFAULTS,
3
4
  readVoluteConfig,
5
+ resolveWakeTriggers,
4
6
  writeVoluteConfig
5
- } from "./chunk-CU6OFXMM.js";
7
+ } from "./chunk-PFZBNKUH.js";
6
8
  import "./chunk-K3NQKI34.js";
7
9
  export {
10
+ WAKE_TRIGGER_DEFAULTS,
8
11
  readVoluteConfig,
12
+ resolveWakeTriggers,
9
13
  writeVoluteConfig
10
14
  };