@cotal-ai/workspace 0.7.0 → 0.8.1

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.
@@ -37,10 +37,13 @@ export declare function preflightTarget(target: MeshTarget, probeCreds?: string)
37
37
  }>;
38
38
  /**
39
39
  * Drop registry entries whose broker is gone — a `cotal up` that crashed or was `kill -9`'d without
40
- * `cotal down` leaves a record behind. Probe each in parallel; only `unreachable` (refused/timeout)
41
- * is stale, an auth broker answering `auth-required` is alive. An EXPLICIT call (never wired into
42
- * resolution itself), so registry mutation stays opt-in: callers that act on the registry
43
- * (`spawn`/`use`/`meshes`, the manager control commands) invoke it; `<TAB>` completion must not.
40
+ * `cotal down` leaves a record behind. This is liveness-only and we hold NO creds for these meshes,
41
+ * so it uses the silent TCP+INFO {@link isReachable} probe NOT a credless `probeConnect`, whose
42
+ * auth-rejection-as-liveness would log a broker auth error on every live AUTH mesh it sweeps.
43
+ * `isReachable` is true for any live broker (open or auth, since INFO precedes auth); only a truly
44
+ * dead one (refused/timeout) prunes. An EXPLICIT call (never wired into resolution itself), so
45
+ * registry mutation stays opt-in: callers that act on the registry (`spawn`/`use`/`meshes`, the
46
+ * manager control commands) invoke it; `<TAB>` completion must not.
44
47
  */
45
48
  export declare function pruneStaleMeshes(): Promise<void>;
46
49
  //# sourceMappingURL=preflight.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../src/preflight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;;;;GAUG;AAEH;;kGAEkG;AAClG,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,yBAAyB,GACzB,wBAAwB,GACxB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB;;;;;oGAKoG;AACpG,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAC5B,MAAM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;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMtD"}
package/dist/preflight.js CHANGED
@@ -1,4 +1,4 @@
1
- import { mintCreds, newIdentity, probeConnect } from "@cotal-ai/core";
1
+ import { mintCreds, newIdentity, probeConnect, isReachable } from "@cotal-ai/core";
2
2
  import { loadMeshes, removeMesh } from "./mesh-registry.js";
3
3
  /** Pure decision tree — separated from I/O so the whole branch tree is unit-testable (it's the
4
4
  * riskiest logic: a wrong branch prunes a LIVE registry entry). Only a registry-OWNED source
@@ -37,15 +37,17 @@ export async function preflightTarget(target, probeCreds) {
37
37
  }
38
38
  /**
39
39
  * Drop registry entries whose broker is gone — a `cotal up` that crashed or was `kill -9`'d without
40
- * `cotal down` leaves a record behind. Probe each in parallel; only `unreachable` (refused/timeout)
41
- * is stale, an auth broker answering `auth-required` is alive. An EXPLICIT call (never wired into
42
- * resolution itself), so registry mutation stays opt-in: callers that act on the registry
43
- * (`spawn`/`use`/`meshes`, the manager control commands) invoke it; `<TAB>` completion must not.
40
+ * `cotal down` leaves a record behind. This is liveness-only and we hold NO creds for these meshes,
41
+ * so it uses the silent TCP+INFO {@link isReachable} probe NOT a credless `probeConnect`, whose
42
+ * auth-rejection-as-liveness would log a broker auth error on every live AUTH mesh it sweeps.
43
+ * `isReachable` is true for any live broker (open or auth, since INFO precedes auth); only a truly
44
+ * dead one (refused/timeout) prunes. An EXPLICIT call (never wired into resolution itself), so
45
+ * registry mutation stays opt-in: callers that act on the registry (`spawn`/`use`/`meshes`, the
46
+ * manager control commands) invoke it; `<TAB>` completion must not.
44
47
  */
45
48
  export async function pruneStaleMeshes() {
46
49
  await Promise.all(loadMeshes().map(async (m) => {
47
- const r = await probeConnect(m.server);
48
- if (!r.ok && r.reason === "unreachable")
50
+ if (!(await isReachable(m.server)))
49
51
  removeMesh(m.space);
50
52
  }));
51
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../src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AAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC,CAAC,CACH,CAAC;AACJ,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.7.0",
4
+ "version": "0.8.1",
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.7.0"
21
+ "@cotal-ai/core": "0.8.1"
22
22
  },
23
23
  "files": [
24
24
  "dist"