@cotal-ai/workspace 0.62.0 → 0.63.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.
@@ -0,0 +1,10 @@
1
+ import { type McpServerSpec } from "@cotal-ai/core";
2
+ /** Record `servers` as what `connector` shares, in the operator-level cotal config, unless that file
3
+ * already declares a list for it: an existing list, even an empty one, is the operator's choice and
4
+ * is kept. Every other key in the file is preserved. Returns whether it wrote.
5
+ *
6
+ * The file is global, so setups run from two folders can seed at once. A lock held from the read to
7
+ * the rename makes the second one find the first one's list, and the rename means a spawn reading the
8
+ * file never sees it half-written. */
9
+ export declare function seedConnectorServers(connector: string, servers: Record<string, McpServerSpec>): boolean;
10
+ //# sourceMappingURL=cotal-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cotal-config.d.ts","sourceRoot":"","sources":["../src/cotal-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG3F;;;;;;uCAMuC;AACvC,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,OAAO,CAcvG"}
@@ -0,0 +1,29 @@
1
+ import { randomBytes } from "node:crypto";
2
+ import { renameSync, writeFileSync } from "node:fs";
3
+ import { globalConfigPath, readCotalConfigFile } from "@cotal-ai/core";
4
+ import { acquireLock } from "./advisory-lock.js";
5
+ /** Record `servers` as what `connector` shares, in the operator-level cotal config, unless that file
6
+ * already declares a list for it: an existing list, even an empty one, is the operator's choice and
7
+ * is kept. Every other key in the file is preserved. Returns whether it wrote.
8
+ *
9
+ * The file is global, so setups run from two folders can seed at once. A lock held from the read to
10
+ * the rename makes the second one find the first one's list, and the rename means a spawn reading the
11
+ * file never sees it half-written. */
12
+ export function seedConnectorServers(connector, servers) {
13
+ const path = globalConfigPath();
14
+ const held = acquireLock(`${path}.lock`, { label: `the seed lock for ${path}`, waitMs: 30_000, pollMs: 20 });
15
+ try {
16
+ const config = readCotalConfigFile(path);
17
+ if (config.connectors?.[connector]?.mcpServers !== undefined)
18
+ return false;
19
+ const connectors = { ...config.connectors, [connector]: { ...config.connectors?.[connector], mcpServers: servers } };
20
+ const tmp = `${path}.${randomBytes(6).toString("hex")}.tmp`;
21
+ writeFileSync(tmp, `${JSON.stringify({ ...config, connectors }, null, 2)}\n`, { flag: "wx" });
22
+ renameSync(tmp, path);
23
+ return true;
24
+ }
25
+ finally {
26
+ held.release();
27
+ }
28
+ }
29
+ //# sourceMappingURL=cotal-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cotal-config.js","sourceRoot":"","sources":["../src/cotal-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;;;uCAMuC;AACvC,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,OAAsC;IAC5F,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,IAAI,OAAO,EAAE,EAAE,KAAK,EAAE,qBAAqB,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7G,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAC3E,MAAM,UAAU,GAAG,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;QACrH,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;QAC5D,aAAa,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9F,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from "./agent-health.js";
6
6
  export * from "./bin-path.js";
7
7
  export * from "./colors.js";
8
8
  export * from "./connect.js";
9
+ export * from "./cotal-config.js";
9
10
  export * from "./control-target.js";
10
11
  export * from "./default-agent.js";
11
12
  export * from "./official-connectors.js";
@@ -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,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB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AAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,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"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export * from "./agent-health.js";
6
6
  export * from "./bin-path.js";
7
7
  export * from "./colors.js";
8
8
  export * from "./connect.js";
9
+ export * from "./cotal-config.js";
9
10
  export * from "./control-target.js";
10
11
  export * from "./default-agent.js";
11
12
  export * from "./official-connectors.js";
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,qBAAqB,CAAC;AACpC,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,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/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AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,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.62.0",
4
+ "version": "0.63.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.62.0"
21
+ "@cotal-ai/core": "0.63.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@cotal-ai/smoke-kit": "0.0.0"