@volter/supercode-teams 0.3.184 → 0.3.187

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 CHANGED
@@ -225,7 +225,10 @@ required for archived Codex metadata.
225
225
 
226
226
  Sources are keyed by harness, physical root and profile/registry selection.
227
227
  Watches precede listings, include root parents and absent-root ancestors, and
228
- share physical directories. Hourly reconciliation repairs missed events.
228
+ share physical coverage. On macOS/Windows recursive streams cover session trees
229
+ and symlink-target parents; Linux retains directory watches over inotify.
230
+ Hourly reconciliation repairs missed events. [The scale decision](../../docs/adr/0022-session-tree-watches.md)
231
+ names the native-watch failure paths and measured platform scope.
229
232
  Metadata changes and verified file offsets commit together with cursor-addressed
230
233
  row changes; unchanged warm files contribute no transcript reads. A refused
231
234
  source retains its prior rows and reports the path, error and retry deadline.
package/app-door.mjs CHANGED
@@ -214,12 +214,32 @@ export function serveAppDoor({ home, open, log = () => {} }) {
214
214
  start();
215
215
  };
216
216
 
217
- let watcher = null;
218
- try { watcher = watch(home, (_, name) => { if (name === 'app-door.json') reload(); }); } catch { /* a home that cannot be watched is read at start */ }
217
+ let watcher = null, watchRetry = null, closed = false;
218
+ const watchLost = (error) => {
219
+ if (closed) return;
220
+ watcher?.close(); watcher = null;
221
+ log({ outcome: 'failed', origin: null, detail: `app door settings watch: ${error.message}` });
222
+ clearTimeout(watchRetry);
223
+ watchRetry = setTimeout(watchSettings, LISTEN_RETRY_MS);
224
+ watchRetry.unref?.();
225
+ };
226
+ const watchSettings = () => {
227
+ if (closed) return;
228
+ watchRetry = null;
229
+ // Re-read even when watch installation fails, so revocation and turning
230
+ // the door off still take effect while native watching is unavailable.
231
+ reload();
232
+ try {
233
+ watcher = watch(home, (_, name) => { if (name == null || name === 'app-door.json') reload(); });
234
+ watcher.on('error', watchLost);
235
+ reload(); // cover a settings write between the first read and watch
236
+ } catch (error) { watchLost(error); }
237
+ };
238
+ watchSettings();
219
239
  start();
220
240
  if (!setting.enabled) report();
221
241
  return {
222
242
  state: () => ({ enabled: setting.enabled, port: setting.port, origins: setting.origins, listening, failure }),
223
- close() { watcher?.close(); stop(); wss.close(); },
243
+ close() { closed = true; clearTimeout(watchRetry); watcher?.close(); stop(); wss.close(); },
224
244
  };
225
245
  }