@cotal-ai/workspace 0.106.1 → 0.108.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.
@@ -3,7 +3,7 @@
3
3
  "platform": "darwin",
4
4
  "arch": "arm64",
5
5
  "nodeApi": 8,
6
- "source": "ed49a8f9f118e5ca41d0796d635629122944f0b5",
6
+ "source": "8d84309c9a6a516ebbaa0533c00c8d29f0323077",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -3,7 +3,7 @@
3
3
  "platform": "darwin",
4
4
  "arch": "x64",
5
5
  "nodeApi": 8,
6
- "source": "ed49a8f9f118e5ca41d0796d635629122944f0b5",
6
+ "source": "8d84309c9a6a516ebbaa0533c00c8d29f0323077",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -3,7 +3,7 @@
3
3
  "platform": "win32",
4
4
  "arch": "arm64",
5
5
  "nodeApi": 8,
6
- "source": "ed49a8f9f118e5ca41d0796d635629122944f0b5",
6
+ "source": "8d84309c9a6a516ebbaa0533c00c8d29f0323077",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -3,7 +3,7 @@
3
3
  "platform": "win32",
4
4
  "arch": "x64",
5
5
  "nodeApi": 8,
6
- "source": "ed49a8f9f118e5ca41d0796d635629122944f0b5",
6
+ "source": "8d84309c9a6a516ebbaa0533c00c8d29f0323077",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -1,5 +1,5 @@
1
1
  import type { Command, ParsedArgs } from "@cotal-ai/core";
2
- /** The release that removes the deprecated daemon entries. One value for all three, recorded under
2
+ /** The release that removes the deprecated daemon entries. One value for all four, recorded under
3
3
  * "Deprecated daemon entries" in docs/UPGRADING.md. */
4
4
  export declare const DAEMON_ENTRY_REMOVAL_RELEASE = "1.0.0";
5
5
  /** Each deprecated daemon entry and the service preset that replaces it. */
@@ -8,22 +8,31 @@ export declare const DEPRECATED_DAEMON_PRESETS: {
8
8
  readonly "auth-service": "auth-service";
9
9
  readonly "feedback-intake": "feedback-intake";
10
10
  };
11
- /** The hidden twin `up` launches for each deprecated entry it still starts. A twin is the entry's own
12
- * declaration and runner without the warning, so only a persisted caller sees the warning. */
11
+ /** The manager's daemon entry. A manager has its own commands, so `cotal manager start` replaces it
12
+ * rather than a bare preset. */
13
+ export declare const DEPRECATED_MANAGER_ENTRY = "supervise";
14
+ /** The `supervise` flags `cotal manager start` has no form for yet. A run that names one is told
15
+ * to keep `supervise` for it, not pointed at a replacement that would drop the flag. */
16
+ export declare const SUPERVISE_ONLY_FLAGS: readonly ["execution", "spawn", "seat-cap", "resume-attempt", "resume-commit-token", "resume-commit-file", "resume-commit-sha256"];
17
+ /** The hidden twin `up` launches for each deprecated entry it still starts, and the manager's daemon
18
+ * entry. A twin is the entry's own declaration and runner without the warning, so only a persisted
19
+ * caller sees the warning. */
13
20
  export declare const DAEMON_ENTRY_TWINS: {
14
21
  readonly deliver: "__daemon-deliver";
15
22
  readonly "auth-service": "__daemon-auth-service";
23
+ readonly supervise: "__daemon-manager";
16
24
  };
17
25
  /** A deprecated daemon entry, or the `deliver pending` read the `deliver` entry also carries. */
18
- export type DeprecatedDaemonEntry = keyof typeof DEPRECATED_DAEMON_PRESETS | "deliver pending";
26
+ export type DeprecatedDaemonEntry = keyof typeof DEPRECATED_DAEMON_PRESETS | typeof DEPRECATED_MANAGER_ENTRY | "deliver pending";
19
27
  /** The line a deprecated daemon entry prints on every run. It names the replacement and the removal
20
- * release; the entry keeps its argv, behavior and exit code. */
21
- export declare function deprecatedDaemonEntryWarning(entry: DeprecatedDaemonEntry): string;
28
+ * release; the entry keeps its argv, behavior and exit code. `kept` names the flags of this run the
29
+ * replacement has no form for, so the line says to keep the entry for them instead. */
30
+ export declare function deprecatedDaemonEntryWarning(entry: DeprecatedDaemonEntry, kept?: readonly string[]): string;
22
31
  /** The summary the entry's own help shows: marked deprecated, with its removal release and the
23
32
  * service preset that replaces it. */
24
- export declare function deprecatedDaemonEntrySummary(entry: keyof typeof DEPRECATED_DAEMON_PRESETS, summary: string): string;
33
+ export declare function deprecatedDaemonEntrySummary(entry: keyof typeof DEPRECATED_DAEMON_PRESETS | typeof DEPRECATED_MANAGER_ENTRY, summary: string): string;
25
34
  /** Print {@link deprecatedDaemonEntryWarning} to stderr, leaving stdout to the entry itself. */
26
- export declare function warnDeprecatedDaemonEntry(entry: DeprecatedDaemonEntry): void;
35
+ export declare function warnDeprecatedDaemonEntry(entry: DeprecatedDaemonEntry, kept?: readonly string[]): void;
27
36
  /** The deprecated public entry over its hidden twin: the twin's declaration under the entry's name,
28
37
  * with a run that warns once and then calls the twin's runner. `warning` picks the line for a mode
29
38
  * that names its own replacement, such as `deliver pending`. */
@@ -1 +1 @@
1
- {"version":3,"file":"deprecated-daemon-entries.d.ts","sourceRoot":"","sources":["../src/deprecated-daemon-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG1D;wDACwD;AACxD,eAAO,MAAM,4BAA4B,UAAU,CAAC;AAEpD,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX;+FAC+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,EAAO,GAAG,MAAM,CAQ/G;AAED;uCACuC;AACvC,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,OAAO,yBAAyB,GAAG,OAAO,wBAAwB,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrJ;AAED,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,IAAI,CAE1G;AAED;;iEAEiE;AACjE,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,OAAO,kBAAkB,EACtC,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,CAAC,IAAI,EAAE,UAAU,KAAK,qBAAmC,GACjE,OAAO,CAMT"}
@@ -1,5 +1,5 @@
1
1
  import { c } from "./colors.js";
2
- /** The release that removes the deprecated daemon entries. One value for all three, recorded under
2
+ /** The release that removes the deprecated daemon entries. One value for all four, recorded under
3
3
  * "Deprecated daemon entries" in docs/UPGRADING.md. */
4
4
  export const DAEMON_ENTRY_REMOVAL_RELEASE = "1.0.0";
5
5
  /** Each deprecated daemon entry and the service preset that replaces it. */
@@ -8,33 +8,51 @@ export const DEPRECATED_DAEMON_PRESETS = {
8
8
  "auth-service": "auth-service",
9
9
  "feedback-intake": "feedback-intake",
10
10
  };
11
- /** The hidden twin `up` launches for each deprecated entry it still starts. A twin is the entry's own
12
- * declaration and runner without the warning, so only a persisted caller sees the warning. */
11
+ /** The manager's daemon entry. A manager has its own commands, so `cotal manager start` replaces it
12
+ * rather than a bare preset. */
13
+ export const DEPRECATED_MANAGER_ENTRY = "supervise";
14
+ /** The `supervise` flags `cotal manager start` has no form for yet. A run that names one is told
15
+ * to keep `supervise` for it, not pointed at a replacement that would drop the flag. */
16
+ export const SUPERVISE_ONLY_FLAGS = ["execution", "spawn", "seat-cap", "resume-attempt", "resume-commit-token", "resume-commit-file", "resume-commit-sha256"];
17
+ /** The hidden twin `up` launches for each deprecated entry it still starts, and the manager's daemon
18
+ * entry. A twin is the entry's own declaration and runner without the warning, so only a persisted
19
+ * caller sees the warning. */
13
20
  export const DAEMON_ENTRY_TWINS = {
14
21
  deliver: "__daemon-deliver",
15
22
  "auth-service": "__daemon-auth-service",
23
+ [DEPRECATED_MANAGER_ENTRY]: "__daemon-manager",
16
24
  };
17
25
  /** The line a deprecated daemon entry prints on every run. It names the replacement and the removal
18
- * release; the entry keeps its argv, behavior and exit code. */
19
- export function deprecatedDaemonEntryWarning(entry) {
26
+ * release; the entry keeps its argv, behavior and exit code. `kept` names the flags of this run the
27
+ * replacement has no form for, so the line says to keep the entry for them instead. */
28
+ export function deprecatedDaemonEntryWarning(entry, kept = []) {
29
+ if (kept.length)
30
+ return `! cotal ${entry} is deprecated and will be removed in ${DAEMON_ENTRY_REMOVAL_RELEASE}. cotal manager start has no ${kept.map((flag) => `--${flag}`).join(", ")} yet, so keep cotal ${entry} for this run until it does.`;
20
31
  const replacement = entry === "deliver pending"
21
32
  ? "cotal pending <agent>"
22
- : `cotal service add <name> --preset ${DEPRECATED_DAEMON_PRESETS[entry]} --help, then cotal service start <name>`;
33
+ : entry === DEPRECATED_MANAGER_ENTRY
34
+ ? "cotal manager start, or cotal manager start --foreground to keep it in this terminal"
35
+ : `cotal service start ${DEPRECATED_DAEMON_PRESETS[entry]}, which names any option it needs`;
23
36
  return `! cotal ${entry} is deprecated and will be removed in ${DAEMON_ENTRY_REMOVAL_RELEASE}. Use ${replacement}.`;
24
37
  }
25
38
  /** The summary the entry's own help shows: marked deprecated, with its removal release and the
26
39
  * service preset that replaces it. */
27
40
  export function deprecatedDaemonEntrySummary(entry, summary) {
28
- return `(deprecated, removed in ${DAEMON_ENTRY_REMOVAL_RELEASE}; use the ${DEPRECATED_DAEMON_PRESETS[entry]} service preset) ${summary}`;
41
+ const use = entry === DEPRECATED_MANAGER_ENTRY ? "cotal manager start" : `the ${DEPRECATED_DAEMON_PRESETS[entry]} service preset`;
42
+ return `(deprecated, removed in ${DAEMON_ENTRY_REMOVAL_RELEASE}; use ${use}) ${summary}`;
29
43
  }
30
44
  /** Print {@link deprecatedDaemonEntryWarning} to stderr, leaving stdout to the entry itself. */
31
- export function warnDeprecatedDaemonEntry(entry) {
32
- console.error(c.yellow(deprecatedDaemonEntryWarning(entry)));
45
+ export function warnDeprecatedDaemonEntry(entry, kept = []) {
46
+ console.error(c.yellow(deprecatedDaemonEntryWarning(entry, kept)));
33
47
  }
34
48
  /** The deprecated public entry over its hidden twin: the twin's declaration under the entry's name,
35
49
  * with a run that warns once and then calls the twin's runner. `warning` picks the line for a mode
36
50
  * that names its own replacement, such as `deliver pending`. */
37
51
  export function deprecatedDaemonEntry(entry, twin, warning = () => entry) {
38
- return { ...twin, name: entry, summary: deprecatedDaemonEntrySummary(entry, twin.summary), run: (args) => { warnDeprecatedDaemonEntry(warning(args)); return twin.run(args); } };
52
+ return { ...twin, name: entry, summary: deprecatedDaemonEntrySummary(entry, twin.summary), run: (args) => {
53
+ const kept = entry === DEPRECATED_MANAGER_ENTRY ? SUPERVISE_ONLY_FLAGS.filter((flag) => args.values[flag] !== undefined) : [];
54
+ warnDeprecatedDaemonEntry(warning(args), kept);
55
+ return twin.run(args);
56
+ } };
39
57
  }
40
58
  //# sourceMappingURL=deprecated-daemon-entries.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deprecated-daemon-entries.js","sourceRoot":"","sources":["../src/deprecated-daemon-entries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC;wDACwD;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE,UAAU;IACnB,cAAc,EAAE,cAAc;IAC9B,iBAAiB,EAAE,iBAAiB;CAC5B,CAAC;AAEX;+FAC+F;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,kBAAkB;IAC3B,cAA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CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,OAAO,yBAAyB,CAAC,KAAK,CAAC,iBAAiB,CAAC;IAClI,OAAO,2BAA2B,4BAA4B,SAAS,GAAG,KAAK,OAAO,EAAE,CAAC;AAC3F,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,yBAAyB,CAAC,KAA4B,EAAE,OAA0B,EAAE;IAClG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,4BAA4B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;iEAEiE;AACjE,MAAM,UAAU,qBAAqB,CACnC,KAAsC,EACtC,IAAa,EACb,UAAuD,GAAG,EAAE,CAAC,KAAK;IAElE,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,4BAA4B,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACvG,MAAM,IAAI,GAAG,KAAK,KAAK,wBAAwB,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9H,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,EAAE,CAAC;AACN,CAAC"}
@@ -1,12 +1,27 @@
1
1
  import type { Extension } from "@cotal-ai/core";
2
+ /** Where a preset option's value comes from when the person names none: a literal, or a fact of
3
+ * the selected space. `root` is its registered root, `server` its registered broker, and
4
+ * `material` the space's own private file of that kind under the root's `.cotal`. A default never
5
+ * names a secret value; a file default names where the space already keeps one. */
6
+ export type ServicePresetDefault = {
7
+ readonly value: string | number | boolean;
8
+ } | {
9
+ readonly space: "root" | "server";
10
+ } | {
11
+ readonly space: "material";
12
+ readonly kind: string;
13
+ };
2
14
  /** A declarative factory for an adapter definition. It starts nothing and supplies no credentials.
3
- * Options and their CLI flags derive from the adapter's one closed schema, not another copy. */
15
+ * Options and their CLI flags derive from the adapter's one closed schema, not another copy.
16
+ * `defaults` lets `service start <preset>` and `service add --preset` fill an option the person
17
+ * did not give; an option with no default that the schema requires is still asked for by name. */
4
18
  export interface ServicePreset extends Extension {
5
19
  readonly kind: "service-preset";
6
20
  readonly name: string;
7
21
  readonly summary: string;
8
22
  readonly adapter: string;
9
23
  readonly timeoutMs: number;
24
+ readonly defaults?: Readonly<Record<string, ServicePresetDefault>>;
10
25
  }
11
26
  export declare function cacheServicePreset(input: ServicePreset): ServicePreset;
12
27
  //# sourceMappingURL=service-preset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-preset.d.ts","sourceRoot":"","sources":["../src/service-preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD;iGACiG;AACjG,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAKtE"}
1
+ {"version":3,"file":"service-preset.d.ts","sourceRoot":"","sources":["../src/service-preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD;;;oFAGoF;AACpF,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GACrC;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D;;;mGAGmG;AACnG,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC;CACpE;AAgBD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAUtE"}
@@ -1,9 +1,30 @@
1
1
  import { CommandFailure } from "./output.js";
2
2
  import { serviceMetadataDigest } from "./service-adapter.js";
3
+ const controls = /[\u0000-\u001f\u007f]/u;
4
+ function cacheDefault(input) {
5
+ const row = input;
6
+ if (row && typeof row === "object" && !Array.isArray(row)) {
7
+ const keys = Object.keys(row).sort().join(",");
8
+ const value = row.value;
9
+ if (keys === "value" && (typeof value === "boolean" || typeof value === "number" && Number.isFinite(value) || typeof value === "string" && value.length <= 4096 && !controls.test(value)))
10
+ return { value };
11
+ if (keys === "space" && (row.space === "root" || row.space === "server"))
12
+ return { space: row.space };
13
+ if (keys === "kind,space" && row.space === "material" && typeof row.kind === "string" && /^[a-z0-9][a-z0-9.-]{0,63}$/.test(row.kind))
14
+ return { space: "material", kind: row.kind };
15
+ }
16
+ throw new CommandFailure("refused", "SCHEMA_INVALID", "a service preset declares an unsupported option default; no provider was loaded to repair it");
17
+ }
3
18
  export function cacheServicePreset(input) {
4
- if (!input || input.kind !== "service-preset" || !/^[a-z][a-z0-9-]{0,63}$/.test(input.name) || typeof input.summary !== "string" || !input.summary || input.summary.length > 300 || /[\u0000-\u001f\u007f]/u.test(input.summary) || typeof input.adapter !== "string" || !input.adapter || input.adapter.length > 200 || /[\u0000-\u001f\u007f]/u.test(input.adapter) || !Number.isSafeInteger(input.timeoutMs) || input.timeoutMs <= 0 || input.timeoutMs > 120000 || Object.keys(input).some((key) => !["kind", "name", "summary", "adapter", "timeoutMs"].includes(key)))
19
+ if (!input || input.kind !== "service-preset" || !/^[a-z][a-z0-9-]{0,63}$/.test(input.name) || typeof input.summary !== "string" || !input.summary || input.summary.length > 300 || controls.test(input.summary) || typeof input.adapter !== "string" || !input.adapter || input.adapter.length > 200 || controls.test(input.adapter) || !Number.isSafeInteger(input.timeoutMs) || input.timeoutMs <= 0 || input.timeoutMs > 120000 || Object.keys(input).some((key) => !["kind", "name", "summary", "adapter", "timeoutMs", "defaults"].includes(key)))
5
20
  throw new CommandFailure("refused", "SCHEMA_INVALID", "a service preset has an unsupported closed declaration; no provider was loaded to repair it");
6
- const value = { kind: "service-preset", name: input.name, summary: input.summary, adapter: input.adapter, timeoutMs: input.timeoutMs };
21
+ let defaults;
22
+ if (input.defaults !== undefined) {
23
+ if (!input.defaults || typeof input.defaults !== "object" || Array.isArray(input.defaults) || Object.keys(input.defaults).length > 64 || Object.keys(input.defaults).some((name) => !/^[a-z][a-z0-9-]{0,63}$/.test(name)))
24
+ throw new CommandFailure("refused", "SCHEMA_INVALID", "a service preset declares an unsupported option default; no provider was loaded to repair it");
25
+ defaults = Object.fromEntries(Object.keys(input.defaults).sort().map((name) => [name, cacheDefault(input.defaults[name])]));
26
+ }
27
+ const value = { kind: "service-preset", name: input.name, summary: input.summary, adapter: input.adapter, timeoutMs: input.timeoutMs, ...(defaults ? { defaults } : {}) };
7
28
  serviceMetadataDigest(value);
8
29
  return value;
9
30
  }
@@ -1 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{
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.106.1",
4
+ "version": "0.108.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@cotal-ai/core": "0.106.1",
25
+ "@cotal-ai/core": "0.108.0",
26
26
  "ajv": "^8.20.0",
27
27
  "string-width": "^8.2.1",
28
28
  "yaml": "^2.9.0",