@cotal-ai/workspace 0.36.0 → 0.37.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"bin-path.d.ts","sourceRoot":"","sources":["../src/bin-path.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAmDnG"}
1
+ {"version":3,"file":"bin-path.d.ts","sourceRoot":"","sources":["../src/bin-path.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAsDnG"}
package/dist/bin-path.js CHANGED
@@ -73,7 +73,10 @@ export function resolveOnPath(bin, env = process.env) {
73
73
  for (const cand of candidates(base)) {
74
74
  try {
75
75
  accessSync(cand, constants.X_OK);
76
- return cand;
76
+ // A relative PATH entry is resolved against this process's cwd during lookup. Return that
77
+ // exact ABSOLUTE executable: a managed launch may use a different cwd, where replaying the
78
+ // relative spelling would select another file or fail after boot had declared it available.
79
+ return resolve(cand);
77
80
  }
78
81
  catch {
79
82
  // not this candidate — keep trying
@@ -1 +1 @@
1
- {"version":3,"file":"bin-path.js","sourceRoot":"","sources":["../src/bin-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAE9C;;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AC,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,CAAC,IAAY,EAAsB,EAAE;QACjD,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC;gBACH,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;gBACjC,0FAA0F;gBAC1F,2FAA2F;gBAC3F,4FAA4F;gBAC5F,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;YAAC,MAAM,CAAC;gBACP,mCAAmC;YACrC,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,2FAA2F;IAC3F,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAExE,KAAK,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/D,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAClC,IAAI,GAAG;YAAE,OAAO,GAAG,CAAC;IACtB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Command, Extension, ExtensionRef, FlagSpec } from "@cotal-ai/core";
1
+ import type { Command, Connector, Extension, ExtensionRef, FlagSpec } from "@cotal-ai/core";
2
2
  import { type LocalProcess } from "./local-process.js";
3
3
  /**
4
4
  * Operator-installed extensions (`cotal ext add <npm-package>`): the workstation state.
@@ -26,6 +26,12 @@ export interface CachedCommand {
26
26
  readonly flags?: readonly FlagSpec[];
27
27
  readonly positionals?: string;
28
28
  }
29
+ /** Connector boot metadata cached at install time so the manager can inspect harness availability
30
+ * without importing every connector package and defeating lazy materialization. */
31
+ export interface CachedConnector {
32
+ readonly name: string;
33
+ readonly requires: readonly string[];
34
+ }
29
35
  export interface InstalledExtension {
30
36
  /** The npm package name (the import + `node_modules` key). */
31
37
  readonly pkg: string;
@@ -40,6 +46,8 @@ export interface InstalledExtension {
40
46
  * loader derives `command:<name>` entries from `commands` for compatibility. */
41
47
  readonly provides?: readonly ExtensionRef[];
42
48
  readonly commands: readonly CachedCommand[];
49
+ /** Declarative connector harness metadata used at manager boot without importing package code. */
50
+ readonly connectors?: readonly CachedConnector[];
43
51
  /** Declarative process metadata used without importing package code. */
44
52
  readonly localProcesses?: readonly LocalProcess[];
45
53
  }
@@ -71,6 +79,10 @@ export declare function saveExtensionsManifest(m: ExtensionsManifest): void;
71
79
  export declare function quarantineExtensionsManifest(): string | undefined;
72
80
  /** Strip a live {@link Command} down to its serializable display surface for the cache. */
73
81
  export declare function cacheCommand(cmd: Command): CachedCommand;
82
+ export declare function cacheConnector(connector: Connector): CachedConnector;
83
+ /** Connector boot metadata from one installed package. An older manifest that advertised a
84
+ * connector but lacks this cache is loud and repairable, never silently treated as requirement-free. */
85
+ export declare function extensionConnectors(ext: InstalledExtension): readonly CachedConnector[];
74
86
  /** Stable, serializable registry keys contributed by one imported package. */
75
87
  export declare function cacheExtension(ext: Extension): ExtensionRef;
76
88
  export declare function cacheLocalProcess(component: LocalProcess): LocalProcess;
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGjF,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE;;;;;;;;;;;;;GAaG;AAEH;;q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,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,YAAY,CAE3D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,YAAY,GAAG,YAAY,CAqBvE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,kBAAkB,GAAG,SAAS,YAAY,EAAE,CAExF;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,GAAG,SAAS,YAAY,EAAE,CAElF;AAED,8DAA8D;AAC9D,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;yGACyG;AACzG,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASnD;AAED,yGAAyG;AACzG,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7B,SAAS,kBAAkB,EAAE,CA6C/B;AAED,8FAA8F;AAC9F,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKzE"}
@@ -72,6 +72,22 @@ export function cacheCommand(cmd) {
72
72
  positionals: cmd.positionals,
73
73
  };
74
74
  }
75
+ export function cacheConnector(connector) {
76
+ return { name: connector.name, requires: [...(connector.requires ?? [])] };
77
+ }
78
+ /** Connector boot metadata from one installed package. An older manifest that advertised a
79
+ * connector but lacks this cache is loud and repairable, never silently treated as requirement-free. */
80
+ export function extensionConnectors(ext) {
81
+ const advertised = extensionProvides(ext).filter((ref) => ref.kind === "connector");
82
+ if (!advertised.length)
83
+ return [];
84
+ if (!ext.connectors)
85
+ throw new Error(`installed extension ${ext.pkg}@${ext.version} has no cached connector requirements - re-run \`cotal ext add ${ext.pkg}\``);
86
+ for (const ref of advertised)
87
+ if (!ext.connectors.some((connector) => connector.name === ref.name))
88
+ throw new Error(`installed extension ${ext.pkg}@${ext.version} advertises connector ${ref.name} without cached requirements - re-run \`cotal ext add ${ext.pkg}\``);
89
+ return ext.connectors;
90
+ }
75
91
  /** Stable, serializable registry keys contributed by one imported package. */
76
92
  export function cacheExtension(ext) {
77
93
  return { kind: ext.kind, name: ext.name };
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5H,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,oBAAoB,CAAC;AAoDzE,0FAA0F;AAC1F,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE,iBAAiB,CAAC,CAAC;AAClD,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,yBAAyB;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,E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AG,YAAY,mBAAmB,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5G,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,yBAAyB,CAAC,GAAW;IACnD,MAAM,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC;IACzD,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,CAAC,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAA0B,CAAC,OAAO,CAAC;IAChF,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -26,4 +26,5 @@ export * from "./space-segmentation.js";
26
26
  export * from "./system-rotation.js";
27
27
  export * from "./win-cmd.js";
28
28
  export * from "./pid.js";
29
+ export * from "./progress.js";
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc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,5 @@ export * from "./space-segmentation.js";
26
26
  export * from "./system-rotation.js";
27
27
  export * from "./win-cmd.js";
28
28
  export * from "./pid.js";
29
+ export * from "./progress.js";
29
30
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
@@ -34,7 +34,117 @@ export interface LocalProcess extends Extension {
34
34
  * cwd-only stop would miss the live process. Bare whole-stack sweeps stay folder-scoped. */
35
35
  readonly rootedAt?: "target";
36
36
  }
37
- /** Resolve a declarative local-process path, rejecting absolute/traversal templates. */
37
+ /** `.cotal/manager.<spaceKey>.pid` the running manager's record, KEYED BY SPACE.
38
+ *
39
+ * The NAME lives in this tier because both the CLI (which reads it to decide whether to start one)
40
+ * and the manager daemon (which writes it on start) already depend on it, and a file written under
41
+ * one constant and read under another is the same defect as no record at all.
42
+ *
43
+ * It is a `{space}` TEMPLATE rather than a bare name because the record is per-tenant in meaning: a
44
+ * root-scoped `manager.pid` gave one workspace root exactly one manager BY FILENAME, so a second
45
+ * space booting in that root overwrote the first space's record and every reader then answered
46
+ * about the wrong process. `auth-service.{space}.pid` was already templated; these were not. */
47
+ export declare const MANAGER_PIDFILE = "manager.{space}.pid";
48
+ /** `.cotal/manager.<spaceKey>.log` — where a detached manager's output goes. Per-space for the same
49
+ * reason the pidfile is: two spaces' managers sharing one log interleave two meshes' console URLs
50
+ * (each a standing credential) into one 0600 file that neither tenant alone owns. */
51
+ export declare const MANAGER_LOGFILE = "manager.{space}.log";
52
+ /** `.cotal/manager.<spaceKey>.delivery-aware` — the sibling marker proving the live manager is a
53
+ * build that does NOT host Plane-3. Written and removed with the pidfile; it carries the pid it was
54
+ * written for, so a stale marker cannot be paired with a different manager. Per-space because the
55
+ * pid it names is, and a marker that could be paired with ANOTHER space's manager would answer the
56
+ * delivery cutover preflight about the wrong process. */
57
+ export declare const MANAGER_DELIVERY_AWARE_MARKER = "manager.{space}.delivery-aware";
58
+ /** `.cotal/delivery.<spaceKey>.pid` — the Plane-3 delivery daemon's record. Per-space: the daemon is
59
+ * minted a space-scoped cred and binds that space's durables, so two spaces need two daemons. */
60
+ export declare const DELIVERY_PIDFILE = "delivery.{space}.pid";
61
+ /** `.cotal/delivery.<spaceKey>.log` — the delivery daemon's output. See {@link MANAGER_LOGFILE}. */
62
+ export declare const DELIVERY_LOGFILE = "delivery.{space}.log";
63
+ /**
64
+ * The ROOT-SCOPED name each per-space RECORD was written under before segmentation — the one place
65
+ * that history is spelled.
66
+ *
67
+ * WHY A READ SHIM AND NOT A MIGRATION. `space-segmentation.ts` moves legacy material on first touch
68
+ * because those kinds have absent-means-mint writers, so a canonical read on an unmigrated root
69
+ * would mint a SECOND live credential. A pidfile has no such writer: it fronts a process that is
70
+ * either running or not. What an upgrade must not do is stop FINDING that process — a `cotal down`
71
+ * that skips a pre-upgrade record exits 0 leaving a live manager and a live delivery daemon behind,
72
+ * which is the customer-update-path invariant AGENTS.md calls load-bearing. So the pre-upgrade name
73
+ * is ADMITTED for reading; nothing is moved, and the start paths always WRITE the canonical name
74
+ * (a degraded write mode would keep minting the very records this ends).
75
+ *
76
+ * RECORDS ONLY — no logs. A log holds text, not a pid, so a pre-upgrade `manager.log` sitting beside
77
+ * the new `manager.<hex>.log` is an ordinary state rather than a contradiction, and the ambiguity
78
+ * rule below must never fire on it. Nothing sweeps the old log, which is what `clean` already did
79
+ * with logs before this change.
80
+ */
81
+ export declare const PRE_SEGMENTATION_RUNTIME_RECORDS: ReadonlyMap<string, string>;
82
+ /** The location a start WRITES: the canonical, space-keyed path, whatever else is on disk. Rejects
83
+ * absolute/traversal templates. Every writer takes this; readers take {@link localProcessPath}. */
84
+ export declare function canonicalLocalProcessPath(template: string, context: LocalProcessContext): string;
85
+ /**
86
+ * Every name this record has been written under, CANONICAL FIRST, whether or not each exists.
87
+ *
88
+ * Two pre-upgrade spellings are possible and both are historical fact rather than guesswork:
89
+ * - the PRE-HEX one, for a `{space}` template written before the hex re-key
90
+ * (`auth-service.<encodeURIComponent(space)>.pid`);
91
+ * - the PRE-SEGMENTATION root-scoped one, for the runtime records above.
92
+ *
93
+ * Exported for the SWEEPERS (`clean`, the `down` inventory), which must name every spelling they are
94
+ * about to remove and must NOT go through {@link localProcessPath} — a deleter that resolved through
95
+ * the ambiguity rule would refuse on exactly the half-upgraded root it exists to tidy.
96
+ */
97
+ export declare function localProcessPathCandidates(template: string, context: LocalProcessContext): string[];
98
+ /**
99
+ * The record to READ: the canonical space-keyed path, or a pre-upgrade one when that is the only
100
+ * spelling present.
101
+ *
102
+ * `down`/`status`/`up` read this to FIND and stop a live process, so a pre-upgrade record must stay
103
+ * findable across the upgrade or the daemon behind it is silently orphaned. BYTE-EXACT (a bare
104
+ * `existsSync` case-folds on macOS/Windows and would match another space's file); both spellings
105
+ * present is ambiguous and fails LOUD rather than picking one, mirroring the state-dir and registry
106
+ * legacy shims. The start paths reclaim a provably dead pre-upgrade record before writing the
107
+ * canonical one, so an ordinary upgrade never reaches that refusal.
108
+ */
38
109
  export declare function localProcessPath(template: string, context: LocalProcessContext): string;
110
+ /**
111
+ * Reclaim a provably DEAD pre-upgrade record before a start claims the canonical slot.
112
+ *
113
+ * Without this an ordinary upgrade wedges the root: a pre-segmentation crash leaves `manager.pid`,
114
+ * the next start writes `manager.<hex>.pid`, BOTH then exist, and {@link localProcessPath} correctly
115
+ * refuses every later status/down as ambiguous.
116
+ *
117
+ * It reclaims ONLY what a canonical claim would: an empty slot (a pre-protocol crash) or a pid
118
+ * proven dead by ESRCH. It NEVER deletes an unattributable record, a still-LIVE holder, or one whose
119
+ * liveness the kernel would not answer — those are precisely the live pre-upgrade daemon this path
120
+ * exists not to orphan, so they THROW and the start aborts loud rather than deleting the record and
121
+ * launching a competitor. Byte-exact, no case-fold. RECORDS only: a log holds text, not a pid.
122
+ */
123
+ export declare function reclaimDeadPreUpgradeRecord(template: string, context: LocalProcessContext): void;
124
+ /** A space this root holds a runtime record for, with the one fact a caller has to act on. */
125
+ export interface RecordedRuntimeSpace {
126
+ readonly space: string;
127
+ /** False only when EVERY record for this space is provably not a process (empty husk, or a pid
128
+ * ESRCH-proven dead). An unparsable record or a pid the kernel will not answer for counts as
129
+ * possibly running: the same fail-closed direction `down`'s dependant guard takes, because the
130
+ * cost of the other reading is walking past a live daemon. */
131
+ readonly mayBeRunning: boolean;
132
+ }
133
+ /**
134
+ * The spaces whose runtime daemons THIS ROOT has recorded, read off the record filenames.
135
+ *
136
+ * A root's space is otherwise derived from its `.cotal/auth` account records, and an OPEN mesh
137
+ * (`broker: { auth: false }`) has none — so that derivation answers with the default space while the
138
+ * mesh runs under its own name. A root-scoped `manager.pid` was space-blind and hid that; a
139
+ * per-space record does not, and a `cotal down` that cannot name the space walks past a live manager
140
+ * and exits 0. The records themselves are the one source that always knows: `spaceKey` is injective
141
+ * UTF-8 hex, so the name a start wrote decodes back to the space it wrote it for.
142
+ *
143
+ * THE PID RECORDS ONLY. They are what "a daemon is running here" means; the log and the
144
+ * delivery-aware marker are siblings of a record rather than evidence of their own. A
145
+ * PRE-SEGMENTATION root-scoped record names no space and contributes none — the folder's own space
146
+ * still resolves it, through the candidate list in {@link localProcessPath}.
147
+ */
148
+ export declare function recordedRuntimeSpaces(root: string): RecordedRuntimeSpace[];
39
149
  export declare function localProcessVisible(process: LocalProcess, context: LocalProcessContext): boolean;
40
150
  //# sourceMappingURL=local-process.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-process.d.ts","sourceRoot":"","sources":["../src/local-process.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,uGAAuG;AACvG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;4FAI4F;AAC5F,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;iGAC6F;IAC7F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gGAAgG;IAChG,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,iGAAiG;IACjG,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC;;;;iGAI6F;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CAC9B;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA2BvF;AAaD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEhG"}
1
+ {"version":3,"file":"local-process.d.ts","sourceRoot":"","sources":["../src/local-process.ts"],"names":[],"mappings":"A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MAAM,gCAAgC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAIvE,CAAC;AAEH;oGACoG;AACpG,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAOhG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,EAAE,CAUnG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAavF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAyBhG;AAED,8FAA8F;AAC9F,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;mEAG+D;IAC/D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAgB1E;AA2CD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEhG"}
@@ -1,36 +1,217 @@
1
- import { readdirSync } from "node:fs";
1
+ import { readdirSync, readFileSync, rmSync } from "node:fs";
2
2
  import { isAbsolute, join, normalize, dirname, basename } from "node:path";
3
3
  import { spaceKey } from "./auth-paths.js";
4
- /** Resolve a declarative local-process path, rejecting absolute/traversal templates. */
5
- export function localProcessPath(template, context) {
4
+ import { parsePid, probeLiveness } from "./pid.js";
5
+ // ---- the runtime records, per space -------------------------------------------------------------
6
+ /** `.cotal/manager.<spaceKey>.pid` — the running manager's record, KEYED BY SPACE.
7
+ *
8
+ * The NAME lives in this tier because both the CLI (which reads it to decide whether to start one)
9
+ * and the manager daemon (which writes it on start) already depend on it, and a file written under
10
+ * one constant and read under another is the same defect as no record at all.
11
+ *
12
+ * It is a `{space}` TEMPLATE rather than a bare name because the record is per-tenant in meaning: a
13
+ * root-scoped `manager.pid` gave one workspace root exactly one manager BY FILENAME, so a second
14
+ * space booting in that root overwrote the first space's record and every reader then answered
15
+ * about the wrong process. `auth-service.{space}.pid` was already templated; these were not. */
16
+ export const MANAGER_PIDFILE = "manager.{space}.pid";
17
+ /** `.cotal/manager.<spaceKey>.log` — where a detached manager's output goes. Per-space for the same
18
+ * reason the pidfile is: two spaces' managers sharing one log interleave two meshes' console URLs
19
+ * (each a standing credential) into one 0600 file that neither tenant alone owns. */
20
+ export const MANAGER_LOGFILE = "manager.{space}.log";
21
+ /** `.cotal/manager.<spaceKey>.delivery-aware` — the sibling marker proving the live manager is a
22
+ * build that does NOT host Plane-3. Written and removed with the pidfile; it carries the pid it was
23
+ * written for, so a stale marker cannot be paired with a different manager. Per-space because the
24
+ * pid it names is, and a marker that could be paired with ANOTHER space's manager would answer the
25
+ * delivery cutover preflight about the wrong process. */
26
+ export const MANAGER_DELIVERY_AWARE_MARKER = "manager.{space}.delivery-aware";
27
+ /** `.cotal/delivery.<spaceKey>.pid` — the Plane-3 delivery daemon's record. Per-space: the daemon is
28
+ * minted a space-scoped cred and binds that space's durables, so two spaces need two daemons. */
29
+ export const DELIVERY_PIDFILE = "delivery.{space}.pid";
30
+ /** `.cotal/delivery.<spaceKey>.log` — the delivery daemon's output. See {@link MANAGER_LOGFILE}. */
31
+ export const DELIVERY_LOGFILE = "delivery.{space}.log";
32
+ /**
33
+ * The ROOT-SCOPED name each per-space RECORD was written under before segmentation — the one place
34
+ * that history is spelled.
35
+ *
36
+ * WHY A READ SHIM AND NOT A MIGRATION. `space-segmentation.ts` moves legacy material on first touch
37
+ * because those kinds have absent-means-mint writers, so a canonical read on an unmigrated root
38
+ * would mint a SECOND live credential. A pidfile has no such writer: it fronts a process that is
39
+ * either running or not. What an upgrade must not do is stop FINDING that process — a `cotal down`
40
+ * that skips a pre-upgrade record exits 0 leaving a live manager and a live delivery daemon behind,
41
+ * which is the customer-update-path invariant AGENTS.md calls load-bearing. So the pre-upgrade name
42
+ * is ADMITTED for reading; nothing is moved, and the start paths always WRITE the canonical name
43
+ * (a degraded write mode would keep minting the very records this ends).
44
+ *
45
+ * RECORDS ONLY — no logs. A log holds text, not a pid, so a pre-upgrade `manager.log` sitting beside
46
+ * the new `manager.<hex>.log` is an ordinary state rather than a contradiction, and the ambiguity
47
+ * rule below must never fire on it. Nothing sweeps the old log, which is what `clean` already did
48
+ * with logs before this change.
49
+ */
50
+ export const PRE_SEGMENTATION_RUNTIME_RECORDS = new Map([
51
+ [MANAGER_PIDFILE, "manager.pid"],
52
+ [MANAGER_DELIVERY_AWARE_MARKER, "manager.delivery-aware"],
53
+ [DELIVERY_PIDFILE, "delivery.pid"],
54
+ ]);
55
+ /** The location a start WRITES: the canonical, space-keyed path, whatever else is on disk. Rejects
56
+ * absolute/traversal templates. Every writer takes this; readers take {@link localProcessPath}. */
57
+ export function canonicalLocalProcessPath(template, context) {
6
58
  if (!template.trim())
7
59
  throw new Error("local-process path must not be empty");
8
60
  const expanded = template.replaceAll("{space}", spaceKey(context.space));
9
61
  const normalized = normalize(expanded);
10
62
  if (normalized === "." || isAbsolute(expanded) || normalized === ".." || normalized.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`))
11
63
  throw new Error(`local-process path must stay under .cotal: ${JSON.stringify(template)}`);
12
- const canonical = join(context.root, ".cotal", normalized);
13
- // A `{space}`-keyed file (the user-auth service pid/log) was written `auth-service.<encoded>.pid`
14
- // before the hex re-key. `down`/`status` READ this path to find and stop the process; if only the
15
- // canonical hex name is checked, a pre-upgrade auth-service - a callout SIGNER - is a live process
16
- // whose legacy pidfile is skipped, so `down` exits 0 leaving it running (the customer-update-path
17
- // invariant AGENTS.md calls load-bearing: an upgrade must never silently orphan a signer). Admit
18
- // the legacy name too, BYTE-EXACT (a bare `existsSync` would case-fold on macOS/Windows and match
19
- // another space's legacy file); both present is ambiguous and fails loud, mirroring the state-dir
20
- // and registry legacy shims.
21
- if (template.includes("{space}")) {
22
- const legacy = join(context.root, ".cotal", normalize(template.replaceAll("{space}", encodeURIComponent(context.space))));
23
- if (legacy !== canonical) {
24
- const has = (p) => existsByteExact(p);
25
- const canonicalExists = has(canonical);
26
- const legacyExists = has(legacy);
27
- if (legacyExists && canonicalExists)
28
- throw new Error(`both ${canonical} and the pre-hex ${legacy} exist for space "${context.space}" - ambiguous process record; remove the stale one`);
29
- if (legacyExists)
30
- return legacy;
64
+ return join(context.root, ".cotal", normalized);
65
+ }
66
+ /**
67
+ * Every name this record has been written under, CANONICAL FIRST, whether or not each exists.
68
+ *
69
+ * Two pre-upgrade spellings are possible and both are historical fact rather than guesswork:
70
+ * - the PRE-HEX one, for a `{space}` template written before the hex re-key
71
+ * (`auth-service.<encodeURIComponent(space)>.pid`);
72
+ * - the PRE-SEGMENTATION root-scoped one, for the runtime records above.
73
+ *
74
+ * Exported for the SWEEPERS (`clean`, the `down` inventory), which must name every spelling they are
75
+ * about to remove and must NOT go through {@link localProcessPath} — a deleter that resolved through
76
+ * the ambiguity rule would refuse on exactly the half-upgraded root it exists to tidy.
77
+ */
78
+ export function localProcessPathCandidates(template, context) {
79
+ const paths = [canonicalLocalProcessPath(template, context)];
80
+ const add = (name) => {
81
+ const p = join(context.root, ".cotal", normalize(name));
82
+ if (!paths.includes(p))
83
+ paths.push(p);
84
+ };
85
+ if (template.includes("{space}"))
86
+ add(template.replaceAll("{space}", encodeURIComponent(context.space)));
87
+ const preSegmentation = PRE_SEGMENTATION_RUNTIME_RECORDS.get(template);
88
+ if (preSegmentation !== undefined)
89
+ add(preSegmentation);
90
+ return paths;
91
+ }
92
+ /**
93
+ * The record to READ: the canonical space-keyed path, or a pre-upgrade one when that is the only
94
+ * spelling present.
95
+ *
96
+ * `down`/`status`/`up` read this to FIND and stop a live process, so a pre-upgrade record must stay
97
+ * findable across the upgrade or the daemon behind it is silently orphaned. BYTE-EXACT (a bare
98
+ * `existsSync` case-folds on macOS/Windows and would match another space's file); both spellings
99
+ * present is ambiguous and fails LOUD rather than picking one, mirroring the state-dir and registry
100
+ * legacy shims. The start paths reclaim a provably dead pre-upgrade record before writing the
101
+ * canonical one, so an ordinary upgrade never reaches that refusal.
102
+ */
103
+ export function localProcessPath(template, context) {
104
+ const [canonical, ...legacy] = localProcessPathCandidates(template, context);
105
+ const present = legacy.filter(existsByteExact);
106
+ if (present.length === 0)
107
+ return canonical;
108
+ if (existsByteExact(canonical))
109
+ throw new Error(`both ${canonical} and the pre-upgrade ${present.join(" and ")} exist for space "${context.space}" - ambiguous process record; remove the stale one`);
110
+ if (present.length > 1)
111
+ throw new Error(`several pre-upgrade records (${present.join(", ")}) exist for space "${context.space}" - ambiguous process record; remove the stale one`);
112
+ return present[0];
113
+ }
114
+ /**
115
+ * Reclaim a provably DEAD pre-upgrade record before a start claims the canonical slot.
116
+ *
117
+ * Without this an ordinary upgrade wedges the root: a pre-segmentation crash leaves `manager.pid`,
118
+ * the next start writes `manager.<hex>.pid`, BOTH then exist, and {@link localProcessPath} correctly
119
+ * refuses every later status/down as ambiguous.
120
+ *
121
+ * It reclaims ONLY what a canonical claim would: an empty slot (a pre-protocol crash) or a pid
122
+ * proven dead by ESRCH. It NEVER deletes an unattributable record, a still-LIVE holder, or one whose
123
+ * liveness the kernel would not answer — those are precisely the live pre-upgrade daemon this path
124
+ * exists not to orphan, so they THROW and the start aborts loud rather than deleting the record and
125
+ * launching a competitor. Byte-exact, no case-fold. RECORDS only: a log holds text, not a pid.
126
+ */
127
+ export function reclaimDeadPreUpgradeRecord(template, context) {
128
+ const [, ...legacy] = localProcessPathCandidates(template, context);
129
+ for (const path of legacy) {
130
+ if (!existsByteExact(path))
131
+ continue;
132
+ const raw = readFileSync(path, "utf8").trim();
133
+ if (raw === "") {
134
+ rmSync(path, { force: true }); // empty husk: nothing is behind it, as the canonical claim treats it
135
+ continue;
31
136
  }
137
+ const pid = parsePid(raw);
138
+ if (pid === undefined)
139
+ throw new Error(`the pre-upgrade record ${path} holds unattributable content ${JSON.stringify(raw)} - refusing to reclaim it or start a competing process; inspect or remove it manually`);
140
+ const state = probeLiveness(pid);
141
+ if (state === "alive")
142
+ throw new Error(`a pre-upgrade process is already running (pid ${pid}) at ${path} - refusing to start a second; run \`cotal down\` to stop it, then retry`);
143
+ if (state === "unknown")
144
+ throw new Error(`cannot determine whether pid ${pid} in ${path} is alive - refusing to reclaim an unattributable record or start a competing process; inspect or remove it manually`);
145
+ rmSync(path, { force: true }); // ESRCH-proven dead
146
+ }
147
+ }
148
+ /**
149
+ * The spaces whose runtime daemons THIS ROOT has recorded, read off the record filenames.
150
+ *
151
+ * A root's space is otherwise derived from its `.cotal/auth` account records, and an OPEN mesh
152
+ * (`broker: { auth: false }`) has none — so that derivation answers with the default space while the
153
+ * mesh runs under its own name. A root-scoped `manager.pid` was space-blind and hid that; a
154
+ * per-space record does not, and a `cotal down` that cannot name the space walks past a live manager
155
+ * and exits 0. The records themselves are the one source that always knows: `spaceKey` is injective
156
+ * UTF-8 hex, so the name a start wrote decodes back to the space it wrote it for.
157
+ *
158
+ * THE PID RECORDS ONLY. They are what "a daemon is running here" means; the log and the
159
+ * delivery-aware marker are siblings of a record rather than evidence of their own. A
160
+ * PRE-SEGMENTATION root-scoped record names no space and contributes none — the folder's own space
161
+ * still resolves it, through the candidate list in {@link localProcessPath}.
162
+ */
163
+ export function recordedRuntimeSpaces(root) {
164
+ const dir = join(root, ".cotal");
165
+ let names;
166
+ try {
167
+ names = readdirSync(dir);
168
+ }
169
+ catch {
170
+ return []; // no `.cotal` → nothing is recorded here
171
+ }
172
+ const found = new Map();
173
+ for (const name of names)
174
+ for (const template of [MANAGER_PIDFILE, DELIVERY_PIDFILE]) {
175
+ const space = spaceFromRecordName(template, name);
176
+ if (space === undefined)
177
+ continue;
178
+ found.set(space, (found.get(space) ?? false) || recordMayBeRunning(join(dir, name)));
179
+ }
180
+ return [...found].map(([space, mayBeRunning]) => ({ space, mayBeRunning })).sort((a, b) => a.space.localeCompare(b.space));
181
+ }
182
+ /** The space a canonical record filename encodes, or undefined when the name is not one
183
+ * {@link canonicalLocalProcessPath} wrote for this template (wrong fixed parts, non-hex body, or a
184
+ * body that does not round-trip back to the same name). Same predicate as the account-file and
185
+ * path-segment decoders: enumeration must never read a stray as a tenant. */
186
+ function spaceFromRecordName(template, name) {
187
+ const at = template.indexOf("{space}");
188
+ if (at < 0)
189
+ return undefined;
190
+ const prefix = template.slice(0, at), suffix = template.slice(at + "{space}".length);
191
+ if (!name.startsWith(prefix) || !name.endsWith(suffix) || name.length <= prefix.length + suffix.length)
192
+ return undefined;
193
+ const key = name.slice(prefix.length, name.length - suffix.length);
194
+ if (key.length % 2 !== 0 || !/^[0-9a-f]+$/.test(key))
195
+ return undefined;
196
+ const space = Buffer.from(key, "hex").toString("utf8");
197
+ return space.length > 0 && spaceKey(space) === key ? space : undefined;
198
+ }
199
+ /** Whether a record file might still front a process. See {@link RecordedRuntimeSpace.mayBeRunning}
200
+ * for the direction and why it is that one. */
201
+ function recordMayBeRunning(path) {
202
+ let raw;
203
+ try {
204
+ raw = readFileSync(path, "utf8").trim();
205
+ }
206
+ catch {
207
+ return false; // removed under us → nothing to address
32
208
  }
33
- return canonical;
209
+ if (raw === "")
210
+ return false; // pre-protocol husk: no process behind it
211
+ const pid = parsePid(raw);
212
+ if (pid === undefined)
213
+ return true; // unattributable: cannot prove it gone
214
+ return probeLiveness(pid) !== "dead"; // alive OR unknown; only ESRCH clears it
34
215
  }
35
216
  /** Byte-exact existence: an entry named exactly `basename(p)` in its parent dir. `existsSync` on a
36
217
  * case-insensitive filesystem reports a case-folded sibling as present, which for a legacy pidfile
@@ -1 +1 @@
1
- {"version":3,"file":"local-process.js","sourceRoot":"","sources":["../src/local-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA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IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC,CAAC,wCAAwC;IACxD,CAAC;IACD,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC,CAAC,0CAA0C;IACxE,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,CAAC,uCAAuC;IAC3E,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC,yCAAyC;AACjF,CAAC;AAED;;qFAEqF;AACrF,SAAS,eAAe,CAAC,CAAS;IAChC,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC,CAAC,8BAA8B;IAC9C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAqB,EAAE,OAA4B;IACrF,OAAO,OAAO,CAAC,WAAW,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC;AAC1E,CAAC"}
package/dist/pid.d.ts CHANGED
@@ -46,15 +46,6 @@ export declare function livenessFromErrno(code: string | undefined): "alive" | "
46
46
  * this so that branch can be driven directly. Production passes nothing and gets the real one. */
47
47
  export type LivenessProbe = (pid: number) => "alive" | "dead" | "unknown";
48
48
  export declare function probeLiveness(pid: number): "alive" | "dead" | "unknown";
49
- /** `.cotal/manager.pid` — the running manager's pid. The NAME lives here, in the tier both the CLI
50
- * (which reads it to decide whether to start one) and the manager daemon (which writes it on
51
- * start) already depend on, because a file written under one constant and read under another is
52
- * the same defect as no record at all. */
53
- export declare const MANAGER_PIDFILE = "manager.pid";
54
- /** `.cotal/manager.delivery-aware` — the sibling marker proving the live manager is a build that
55
- * does NOT host Plane-3. Written and removed with the pidfile; it carries the pid it was written
56
- * for, so a stale marker cannot be paired with a different manager. */
57
- export declare const MANAGER_DELIVERY_AWARE_MARKER = "manager.delivery-aware";
58
49
  /** What was read about ONE pid's command line, three-valued for the same reason liveness is:
59
50
  * "it is something else" and "I could not look" are different facts and only the first may be
60
51
  * acted on. */
package/dist/pid.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pid.d.ts","sourceRoot":"","sources":["../src/pid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH;;;wCAGwC;AACxC,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGxD;AAED;;;;;;;;sDAQsD;AACtD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAIxF;AAED;;;;;;;2BAO2B;AAC3B;;;mGAGmG;AACnG,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1E,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAOvE;AAID;;;2CAG2C;AAC3C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;wEAEwE;AACxE,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AAItE;;gBAEgB;AAChB,MAAM,MAAM,cAAc;AACxB,gDAAgD;AAC9C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;AACtC,iGAAiG;GAC/F;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;AAClB,oFAAoF;GAClF;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC;;6CAE6C;AAC7C,MAAM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kB9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEjE"}
package/dist/pid.js CHANGED
@@ -52,16 +52,6 @@ export function probeLiveness(pid) {
52
52
  return livenessFromErrno(e.code);
53
53
  }
54
54
  }
55
- // ---- the manager's own record ------------------------------------------------------------------
56
- /** `.cotal/manager.pid` — the running manager's pid. The NAME lives here, in the tier both the CLI
57
- * (which reads it to decide whether to start one) and the manager daemon (which writes it on
58
- * start) already depend on, because a file written under one constant and read under another is
59
- * the same defect as no record at all. */
60
- export const MANAGER_PIDFILE = "manager.pid";
61
- /** `.cotal/manager.delivery-aware` — the sibling marker proving the live manager is a build that
62
- * does NOT host Plane-3. Written and removed with the pidfile; it carries the pid it was written
63
- * for, so a stale marker cannot be paired with a different manager. */
64
- export const MANAGER_DELIVERY_AWARE_MARKER = "manager.delivery-aware";
65
55
  /**
66
56
  * Read one pid's command line.
67
57
  *
package/dist/pid.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pid.js","sourceRoot":"","sources":["../src/pid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;wCAGwC;AACxC,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACzE,CAAC;AAED;;;;;;;;sDAQsD;AACtD,MAAM,UAAU,iBAAiB,CAAC,IAAwB;IACxD,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,MA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YG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,OAAO,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,18 @@
1
+ /** Progress is an outside observation of work product, not the seat's presence heartbeat. */
2
+ export declare const PROGRESS_STALL_MS: number;
3
+ export interface ProgressObservation {
4
+ /** Epoch ms of the last assistant message in the seat's session store. */
5
+ lastAssistantTs: number;
6
+ }
7
+ /** Render-agnostic operator signal. Human wording belongs to each presentation surface. */
8
+ export type ProgressSignal = {
9
+ kind: "unknown";
10
+ } | {
11
+ kind: "fresh";
12
+ ageMs: number;
13
+ } | {
14
+ kind: "stalled";
15
+ ageMs: number;
16
+ };
17
+ export declare function progressSignal(observation: ProgressObservation | undefined, now: number, stallMs?: number): ProgressSignal;
18
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,QAAa,CAAC;AAE5C,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,2FAA2F;AAC3F,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,wBAAgB,cAAc,CAC5B,WAAW,EAAE,mBAAmB,GAAG,SAAS,EAC5C,GAAG,EAAE,MAAM,EACX,OAAO,SAAoB,GAC1B,cAAc,CAIhB"}
@@ -0,0 +1,9 @@
1
+ /** Progress is an outside observation of work product, not the seat's presence heartbeat. */
2
+ export const PROGRESS_STALL_MS = 5 * 60_000;
3
+ export function progressSignal(observation, now, stallMs = PROGRESS_STALL_MS) {
4
+ if (observation === undefined)
5
+ return { kind: "unknown" };
6
+ const ageMs = Math.max(0, now - observation.lastAssistantTs);
7
+ return ageMs > stallMs ? { kind: "stalled", ageMs } : { kind: "fresh", ageMs };
8
+ }
9
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAG,MAAM,CAAC;AAa5C,MAAM,UAAU,cAAc,CAC5B,WAA4C,EAC5C,GAAW,EACX,OAAO,GAAG,iBAAiB;IAE3B,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7D,OAAO,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjF,CAAC"}
@@ -6,9 +6,17 @@ export declare function cotalDir(root: string): string;
6
6
  *
7
7
  * {@link spaceSegment}'s collision guarantee was written against the reserved siblings of the AUTH
8
8
  * dir. P7 puts a segment directly under `.cotal/`, which is a WIDER namespace, so the guarantee has
9
- * to hold there too. It does today — no `.cotal` child begins with `space.`, the nearest being
10
- * `auth-service.<spaceKey>.pid` — but it held by ACCIDENT until something asserted it, which is what
11
- * `smoke:space-segmentation` now does.
9
+ * to hold there too. It does today — no `.cotal` child begins with `space.` but it held by
10
+ * ACCIDENT until something asserted it, which is what `smoke:space-segmentation` now does.
11
+ *
12
+ * LITERAL children only. The space-KEYED children (`manager.<spaceKey>.pid`, its log and
13
+ * delivery-aware marker, `delivery.<spaceKey>.pid`, its log, `auth-service.<spaceKey>.pid`) are not
14
+ * listed because they are not fixed names; they are the nearest miss to a canonical segment, sharing
15
+ * the `<prefix>.<spaceKey>` shape, and the guard suite checks their real expansions directly. Their
16
+ * root-scoped spellings USED to be listed here — the runtime pid/log namespace was root-scoped, so
17
+ * one root hosted one manager and one delivery daemon by filename — and the records among them are
18
+ * now `PRE_SEGMENTATION_RUNTIME_RECORDS` in `local-process.ts`, which is where the readers and
19
+ * sweepers take them from.
12
20
  *
13
21
  * Keep in sync with the writers of `.cotal/` children (`cotalPath(...)` in `up.ts`, the raw removal
14
22
  * list at `clean.ts:272-279`). A name added here that starts with `space.` is a real collision and
@@ -1 +1 @@
1
- {"version":3,"file":"space-segmentation.d.ts","sourceRoot":"","sources":["../src/space-segmentation.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG/D,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAMpD,CAAC;AAEF;;;;;+BAK+B;AAC/B,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAEpD;;2DAE2D;AAC3D,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D;;;;;;2EAM2E;AAC3E,eAAO,MAAM,8BAA8B,8BAA8B,CAAC;AAE1E;;;;;;qFAMqF;AACrF,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE;;;cAGc;AACd,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD;;;uFAGuF;AACvF,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAG/C,CAAC;AAEF;;mFAEmF;AACnF,MAAM,WAAW,6BAA6B;IAC5C,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,MAAM,EAAE,MAAM,CAAC;CAChB;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WAAW,GACnB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA0BlD"}
@@ -32,9 +32,17 @@ export function cotalDir(root) {
32
32
  *
33
33
  * {@link spaceSegment}'s collision guarantee was written against the reserved siblings of the AUTH
34
34
  * dir. P7 puts a segment directly under `.cotal/`, which is a WIDER namespace, so the guarantee has
35
- * to hold there too. It does today — no `.cotal` child begins with `space.`, the nearest being
36
- * `auth-service.<spaceKey>.pid` — but it held by ACCIDENT until something asserted it, which is what
37
- * `smoke:space-segmentation` now does.
35
+ * to hold there too. It does today — no `.cotal` child begins with `space.` but it held by
36
+ * ACCIDENT until something asserted it, which is what `smoke:space-segmentation` now does.
37
+ *
38
+ * LITERAL children only. The space-KEYED children (`manager.<spaceKey>.pid`, its log and
39
+ * delivery-aware marker, `delivery.<spaceKey>.pid`, its log, `auth-service.<spaceKey>.pid`) are not
40
+ * listed because they are not fixed names; they are the nearest miss to a canonical segment, sharing
41
+ * the `<prefix>.<spaceKey>` shape, and the guard suite checks their real expansions directly. Their
42
+ * root-scoped spellings USED to be listed here — the runtime pid/log namespace was root-scoped, so
43
+ * one root hosted one manager and one delivery daemon by filename — and the records among them are
44
+ * now `PRE_SEGMENTATION_RUNTIME_RECORDS` in `local-process.ts`, which is where the readers and
45
+ * sweepers take them from.
38
46
  *
39
47
  * Keep in sync with the writers of `.cotal/` children (`cotalPath(...)` in `up.ts`, the raw removal
40
48
  * list at `clean.ts:272-279`). A name added here that starts with `space.` is a real collision and
@@ -42,8 +50,7 @@ export function cotalDir(root) {
42
50
  */
43
51
  export const RESERVED_COTAL_CHILDREN = [
44
52
  "agents", "auth", "auth-service.json", "broker-policy.json", "channels.json", "config.json",
45
- "connection-evictor.creds", "delivery.creds", "delivery.log", "delivery.pid", "maintenance",
46
- "manager.delivery-aware", "manager.log", "manager.pid", "manifests", "membership.json",
53
+ "connection-evictor.creds", "delivery.creds", "maintenance", "manifests", "membership.json",
47
54
  "membership-observer.creds", "membership-rw.creds", "meshes", "nats", "nats.log", "nats.pid",
48
55
  "setup.log",
49
56
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"space-segmentation.js","sourceRoot":"","sources":["../src/space-segmentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1E,oFAAoF;AACpF,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,QAAQ,EAAE,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa;IAC3F,0BAA0B,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa;IAC3F,wBAAwB,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB;IACtF,2BAA2B,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;IAC5F,WAAW;CACZ,CAAC;AAEF;;;;;+BAK+B;AAC/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEpD;;2DAE2D;AAC3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D;;;;;;2EAM2E;AAC3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,2BAA2B,CAAC;AAE1E;;;;;;qFAMqF;AACrF,MA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,KAAK,CAAC,KAAK,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC"}
package/dist/space.d.ts CHANGED
@@ -4,4 +4,23 @@
4
4
  * ambiguous, and {@link soleSpaceOf} fails loud there rather than picking one - such a caller has
5
5
  * to name its space (`--space`). */
6
6
  export declare function resolveSpace(cwd: string): string;
7
+ /**
8
+ * The space THIS FOLDER'S LOCAL DAEMONS belong to: the one its runtime records name, else
9
+ * {@link resolveSpace}.
10
+ *
11
+ * `down`, `status` and every "is the manager up" helper ask this. They must not inherit
12
+ * {@link resolveSpace}'s blind spot: it reads the space from the `.cotal/auth` account records, an
13
+ * OPEN mesh has none, and the default it then answers with is not the space the daemons here run
14
+ * under. The records are consulted FIRST because they are the only source that always knows - a
15
+ * daemon started by a container entrypoint or by `cotal supervise` typed by hand has one, whatever
16
+ * else the root does or does not hold.
17
+ *
18
+ * RESIDUE NEVER WEDGES THE FOLDER, and TWO LIVE STACKS ARE REFUSED. A record left by a crash names
19
+ * a space whose daemon is gone; if another space is running here, the running one is the answer, and
20
+ * a dead record alone still names its space so a stop can clear it. Two spaces running under one
21
+ * root is a state this cannot arbitrate - the broker, its store and this folder's stack are shared,
22
+ * so no single answer is right - and it throws rather than picking one, the same refusal
23
+ * `assertSingleSpaceBroker` makes for the tenants it can see.
24
+ */
25
+ export declare function resolveRuntimeSpace(cwd: string): string;
7
26
  //# sourceMappingURL=space.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../src/space.ts"],"names":[],"mappings":"AAGA;;;;qCAIqC;AACrC,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD"}
1
+ {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../src/space.ts"],"names":[],"mappings":"AAIA;;;;qCAIqC;AACrC,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWvD"}
package/dist/space.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { DEFAULT_SPACE } from "@cotal-ai/core";
2
2
  import { authDir, findCotalRoot, soleSpaceOf } from "./auth-paths.js";
3
+ import { recordedRuntimeSpaces } from "./local-process.js";
3
4
  /** The space this folder operates on: its `.cotal/auth` space if set up, else the default.
4
5
  * Commands resolve it through here so they always match the folder's mesh instead of assuming the
5
6
  * global default. A root that has grown to hold SEVERAL space accounts makes this question
@@ -8,4 +9,34 @@ import { authDir, findCotalRoot, soleSpaceOf } from "./auth-paths.js";
8
9
  export function resolveSpace(cwd) {
9
10
  return soleSpaceOf(authDir(findCotalRoot(cwd))) ?? DEFAULT_SPACE;
10
11
  }
12
+ /**
13
+ * The space THIS FOLDER'S LOCAL DAEMONS belong to: the one its runtime records name, else
14
+ * {@link resolveSpace}.
15
+ *
16
+ * `down`, `status` and every "is the manager up" helper ask this. They must not inherit
17
+ * {@link resolveSpace}'s blind spot: it reads the space from the `.cotal/auth` account records, an
18
+ * OPEN mesh has none, and the default it then answers with is not the space the daemons here run
19
+ * under. The records are consulted FIRST because they are the only source that always knows - a
20
+ * daemon started by a container entrypoint or by `cotal supervise` typed by hand has one, whatever
21
+ * else the root does or does not hold.
22
+ *
23
+ * RESIDUE NEVER WEDGES THE FOLDER, and TWO LIVE STACKS ARE REFUSED. A record left by a crash names
24
+ * a space whose daemon is gone; if another space is running here, the running one is the answer, and
25
+ * a dead record alone still names its space so a stop can clear it. Two spaces running under one
26
+ * root is a state this cannot arbitrate - the broker, its store and this folder's stack are shared,
27
+ * so no single answer is right - and it throws rather than picking one, the same refusal
28
+ * `assertSingleSpaceBroker` makes for the tenants it can see.
29
+ */
30
+ export function resolveRuntimeSpace(cwd) {
31
+ const root = findCotalRoot(cwd);
32
+ const recorded = recordedRuntimeSpaces(root);
33
+ const running = recorded.filter((r) => r.mayBeRunning);
34
+ if (running.length > 1)
35
+ throw new Error(`${root}/.cotal records running daemons for ${running.length} spaces (${running.map((r) => r.space).join(", ")}) - this folder's stack is not one mesh and a folder-wide command cannot scope to one; stop them by name (\`cotal down\` in each mesh's own root) or remove the record of the one that is gone`);
36
+ if (running.length === 1)
37
+ return running[0].space;
38
+ if (recorded.length === 1)
39
+ return recorded[0].space; // dead residue, unambiguous: still this folder's space
40
+ return resolveSpace(cwd);
41
+ }
11
42
  //# sourceMappingURL=space.js.map
package/dist/space.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"space.js","sourceRoot":"","sources":["../src/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;;;qCAIqC;AACrC,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC;AACnE,CAAC"}
1
+ {"version":3,"file":"space.js","sourceRoot":"","sources":["../src/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;qCAIqC;AACrC,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACvD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,uCAAuC,OAAO,CAAC,MAAM,YAAY,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,gMAAgM,CAC/S,CAAC;IACJ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAClD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uDAAuD;IAC5G,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/workspace",
3
3
  "description": "Cotal machine-local workstation layer: the ~/.cotal mesh registry, target resolution, preflight, on-disk auth-path I/O, and the command-copy renderer — operator concerns over a local checkout, kept separate from the wire protocol in @cotal-ai/core.",
4
- "version": "0.36.0",
4
+ "version": "0.37.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@cotal-ai/core": "0.36.0"
21
+ "@cotal-ai/core": "0.37.0"
22
22
  },
23
23
  "files": [
24
24
  "dist"