@cotal-ai/manager 0.164.11 → 0.164.13
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/dist/manager.d.ts +2 -0
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +69 -14
- package/dist/manager.js.map +1 -1
- package/dist/runtime/pty.d.ts.map +1 -1
- package/dist/runtime/pty.js +73 -37
- package/dist/runtime/pty.js.map +1 -1
- package/dist/runtime/windows-stop.d.ts +20 -0
- package/dist/runtime/windows-stop.d.ts.map +1 -0
- package/dist/runtime/windows-stop.js +139 -0
- package/dist/runtime/windows-stop.js.map +1 -0
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pty.d.ts","sourceRoot":"","sources":["../../src/runtime/pty.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,WAAW,EAAsB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"pty.d.ts","sourceRoot":"","sources":["../../src/runtime/pty.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,WAAW,EAAsB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAc1I;;;;;GAKG;AACH,qBAAa,gBAAiB,YAAW,OAAO;IAC9C,QAAQ,CAAC,IAAI,EAAG,KAAK,CAAU;IAC/B,QAAQ,CAAC,eAAe,QAAQ;IAChC,QAAQ,CAAC,qBAAqB,QAAQ;IAEtC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW;IA6O/D,KAAK,CAAC,UAAU,EAAE,gBAAgB,GAAG,WAAW;CAGjD;AAED,2FAA2F;AAC3F,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,CAAC"}
|
package/dist/runtime/pty.js
CHANGED
|
@@ -4,6 +4,7 @@ import { SerializeAddon } from "@xterm/addon-serialize";
|
|
|
4
4
|
import { SpawnRefused } from "@cotal-ai/core";
|
|
5
5
|
import { ConnectorDiagnosticReader, DEFAULT_COLS, DEFAULT_ROWS, GRACE_MS, SCROLLBACK_ROWS, StartupConfirmGate, unsupportedTransport, preferSeatForOomKill, } from "@cotal-ai/seat";
|
|
6
6
|
import { preparePtyLaunch } from "./windows-launch.js";
|
|
7
|
+
import { WindowsSeatStop } from "./windows-stop.js";
|
|
7
8
|
/**
|
|
8
9
|
* In-process node-pty ownership. The worker is the child's parent, so killing
|
|
9
10
|
* the worker kills the seat. `createRuntime("pty")` spawns here on every
|
|
@@ -49,6 +50,26 @@ export class LegacyPtyRuntime {
|
|
|
49
50
|
}
|
|
50
51
|
const dataSubs = new Set();
|
|
51
52
|
const exitSubs = new Set();
|
|
53
|
+
const windowsStop = process.platform === "win32" ? new WindowsSeatStop(() => proc.pid) : undefined;
|
|
54
|
+
let stopRequested = false;
|
|
55
|
+
let stopProof;
|
|
56
|
+
let stopVerified = false;
|
|
57
|
+
const rawExitSubs = new Set();
|
|
58
|
+
const rawExit = () => alive
|
|
59
|
+
? new Promise((resolve) => {
|
|
60
|
+
const done = () => { rawExitSubs.delete(done); resolve(); };
|
|
61
|
+
rawExitSubs.add(done);
|
|
62
|
+
if (!alive)
|
|
63
|
+
done();
|
|
64
|
+
})
|
|
65
|
+
: Promise.resolve();
|
|
66
|
+
const exitWaiters = new Set();
|
|
67
|
+
const fireExitSubs = () => {
|
|
68
|
+
for (const fn of [...exitSubs]) {
|
|
69
|
+
exitSubs.delete(fn);
|
|
70
|
+
fn();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
52
73
|
// Mirror the child's PTY into a headless terminal, so on attach we hand the new client a
|
|
53
74
|
// reconstructed screen image — the alternate-screen buffer of a full-screen TUI, or the
|
|
54
75
|
// scrollback of an inline one — instead of a raw byte replay. A raw replay can't rebuild an
|
|
@@ -73,6 +94,7 @@ export class LegacyPtyRuntime {
|
|
|
73
94
|
// reap line and a launch failure can name it.
|
|
74
95
|
const diagnostic = new ConnectorDiagnosticReader();
|
|
75
96
|
proc.onData((d) => {
|
|
97
|
+
windowsStop?.capture();
|
|
76
98
|
term.write(d); // mirror into the screen model for attach-time reconstruction
|
|
77
99
|
diagnostic.push(d);
|
|
78
100
|
const b = Buffer.from(d, "utf8");
|
|
@@ -83,13 +105,22 @@ export class LegacyPtyRuntime {
|
|
|
83
105
|
});
|
|
84
106
|
proc.onExit(({ exitCode, signal }) => {
|
|
85
107
|
alive = false;
|
|
108
|
+
windowsStop?.onProcessExit();
|
|
86
109
|
// `signal` is absent on an ordinary exit and 0 is a real exit code, so both are recorded as
|
|
87
110
|
// present-or-absent rather than coalesced into one number.
|
|
88
111
|
const last = diagnostic.read();
|
|
89
112
|
exit = { code: exitCode, ...(signal === undefined ? {} : { signal }), ...(last ? { diagnostic: last } : {}) };
|
|
90
113
|
confirmGate?.disarm();
|
|
91
|
-
for (const fn of
|
|
114
|
+
for (const fn of rawExitSubs)
|
|
92
115
|
fn();
|
|
116
|
+
if (!stopRequested) {
|
|
117
|
+
windowsStop?.close();
|
|
118
|
+
for (const w of [...exitWaiters]) {
|
|
119
|
+
exitWaiters.delete(w);
|
|
120
|
+
w.resolve();
|
|
121
|
+
}
|
|
122
|
+
fireExitSubs();
|
|
123
|
+
}
|
|
93
124
|
});
|
|
94
125
|
const handle = {
|
|
95
126
|
name,
|
|
@@ -99,37 +130,42 @@ export class LegacyPtyRuntime {
|
|
|
99
130
|
get pid() {
|
|
100
131
|
return proc.pid > 0 ? proc.pid : undefined;
|
|
101
132
|
},
|
|
102
|
-
status: () => (alive ? "running" : "exited"),
|
|
133
|
+
status: () => (alive || (stopRequested && !stopVerified) ? "running" : "exited"),
|
|
103
134
|
exitInfo: () => exit,
|
|
104
135
|
startupOutcome: () => confirmGate?.outcome ?? "pending",
|
|
105
136
|
stop: (opts) => {
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// pseudoconsole can't deliver SIGTERM for a graceful mesh-leave. The manager instead sends a
|
|
110
|
-
// cooperative `{op:"shutdown"}` over the agent's control endpoint BEFORE a graceful stop, so
|
|
111
|
-
// here we just give the agent a window to run its exit handlers (leave the mesh, publish
|
|
112
|
-
// offline) and exit on its own, then hard-kill (ConPTY close) as a fallback. A hard stop
|
|
113
|
-
// (graceful:false — emergency reap) skips the window and kills immediately.
|
|
114
|
-
if (process.platform === "win32") {
|
|
115
|
-
if (opts?.graceful === false) {
|
|
116
|
-
proc.kill();
|
|
137
|
+
if (windowsStop) {
|
|
138
|
+
if (stopVerified || (!alive && !stopRequested)) {
|
|
139
|
+
windowsStop.close();
|
|
117
140
|
return;
|
|
118
141
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
stopRequested = true;
|
|
143
|
+
const next = windowsStop.stop(opts?.graceful === false ? 0 : GRACE_MS, 9_000, rawExit);
|
|
144
|
+
if (stopProof !== next) {
|
|
145
|
+
stopProof = next;
|
|
146
|
+
void next.then(() => {
|
|
147
|
+
if (stopVerified)
|
|
148
|
+
return;
|
|
149
|
+
stopVerified = true;
|
|
150
|
+
windowsStop.close();
|
|
151
|
+
for (const w of [...exitWaiters]) {
|
|
152
|
+
exitWaiters.delete(w);
|
|
153
|
+
w.resolve();
|
|
154
|
+
}
|
|
155
|
+
fireExitSubs();
|
|
156
|
+
}, (err) => {
|
|
157
|
+
if (stopProof === next) {
|
|
158
|
+
for (const w of [...exitWaiters]) {
|
|
159
|
+
exitWaiters.delete(w);
|
|
160
|
+
w.reject(err);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
131
165
|
return;
|
|
132
166
|
}
|
|
167
|
+
if (!alive)
|
|
168
|
+
return;
|
|
133
169
|
if (opts?.graceful === false) {
|
|
134
170
|
proc.kill("SIGKILL");
|
|
135
171
|
return;
|
|
@@ -139,17 +175,17 @@ export class LegacyPtyRuntime {
|
|
|
139
175
|
proc.kill("SIGTERM");
|
|
140
176
|
setTimeout(() => alive && proc.kill("SIGKILL"), GRACE_MS);
|
|
141
177
|
},
|
|
142
|
-
waitForExit: () =>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
})
|
|
152
|
-
|
|
178
|
+
waitForExit: () => {
|
|
179
|
+
if (!windowsStop)
|
|
180
|
+
return rawExit();
|
|
181
|
+
if (stopVerified || (!alive && !stopRequested))
|
|
182
|
+
return Promise.resolve();
|
|
183
|
+
if (stopProof)
|
|
184
|
+
return stopProof;
|
|
185
|
+
return new Promise((resolve, reject) => {
|
|
186
|
+
exitWaiters.add({ resolve, reject });
|
|
187
|
+
});
|
|
188
|
+
},
|
|
153
189
|
interrupt: () => {
|
|
154
190
|
if (alive)
|
|
155
191
|
proc.write("\x03");
|
|
@@ -186,7 +222,7 @@ export class LegacyPtyRuntime {
|
|
|
186
222
|
// bridge surfaces a `process-exit` end frame instead of a silent zombie. proc.onExit fired
|
|
187
223
|
// ONCE before this listener existed, so a late subscriber would otherwise never hear it
|
|
188
224
|
// (waitForExit carries the same already-dead guard).
|
|
189
|
-
if (!alive) {
|
|
225
|
+
if (!alive && (!stopRequested || stopVerified)) {
|
|
190
226
|
queueMicrotask(fn);
|
|
191
227
|
return () => { };
|
|
192
228
|
}
|
package/dist/runtime/pty.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pty.js","sourceRoot":"","sources":["../../src/runtime/pty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OA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 @@
|
|
|
1
|
+
import { type Win32ProcessBinding } from "@cotal-ai/workspace";
|
|
2
|
+
export type WindowsProcessStopBinding = Pick<Win32ProcessBinding, "pinProcess" | "processTree">;
|
|
3
|
+
/** One stop-time snapshot, not launch-time custody of detached or future work. */
|
|
4
|
+
export declare class WindowsSeatStop {
|
|
5
|
+
private readonly pid;
|
|
6
|
+
private readonly binding;
|
|
7
|
+
private root?;
|
|
8
|
+
private rootPid?;
|
|
9
|
+
private captureError?;
|
|
10
|
+
private exitedBeforePin;
|
|
11
|
+
private pending?;
|
|
12
|
+
private succeeded;
|
|
13
|
+
private readonly startup;
|
|
14
|
+
constructor(pid: () => number, binding?: () => WindowsProcessStopBinding);
|
|
15
|
+
capture(): void;
|
|
16
|
+
onProcessExit(): void;
|
|
17
|
+
stop(graceMs: number, timeoutMs: number, ptyExit: () => Promise<void>): Promise<void>;
|
|
18
|
+
close(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=windows-stop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-stop.d.ts","sourceRoot":"","sources":["../../src/runtime/windows-stop.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,mBAAmB,EAA2C,MAAM,qBAAqB,CAAC;AAE7H,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;AAEhG,kFAAkF;AAClF,qBAAa,eAAe;IAUxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAV1B,OAAO,CAAC,IAAI,CAAC,CAAkB;IAC/B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,OAAO,CAAC,CAAgB;IAChC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;gBAGtC,GAAG,EAAE,MAAM,MAAM,EACjB,OAAO,GAAE,MAAM,yBAA+C;IAOjF,OAAO,IAAI,IAAI;IAcf,aAAa,IAAI,IAAI;IAQrB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA0ErF,KAAK,IAAI,IAAI;CAcd"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
2
|
+
import { win32ProcessBinding } from "@cotal-ai/workspace";
|
|
3
|
+
/** One stop-time snapshot, not launch-time custody of detached or future work. */
|
|
4
|
+
export class WindowsSeatStop {
|
|
5
|
+
pid;
|
|
6
|
+
binding;
|
|
7
|
+
root;
|
|
8
|
+
rootPid;
|
|
9
|
+
captureError;
|
|
10
|
+
exitedBeforePin = false;
|
|
11
|
+
pending;
|
|
12
|
+
succeeded = false;
|
|
13
|
+
startup;
|
|
14
|
+
constructor(pid, binding = win32ProcessBinding) {
|
|
15
|
+
this.pid = pid;
|
|
16
|
+
this.binding = binding;
|
|
17
|
+
this.startup = setInterval(() => this.capture(), 5);
|
|
18
|
+
this.startup.unref();
|
|
19
|
+
this.capture();
|
|
20
|
+
}
|
|
21
|
+
capture() {
|
|
22
|
+
if (this.root || this.captureError || this.exitedBeforePin)
|
|
23
|
+
return;
|
|
24
|
+
const pid = this.pid();
|
|
25
|
+
if (pid <= 0)
|
|
26
|
+
return;
|
|
27
|
+
try {
|
|
28
|
+
this.root = this.binding().pinProcess(pid);
|
|
29
|
+
this.rootPid = pid;
|
|
30
|
+
clearInterval(this.startup);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
this.captureError = error instanceof Error ? error : new Error(String(error));
|
|
34
|
+
clearInterval(this.startup);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
onProcessExit() {
|
|
38
|
+
clearInterval(this.startup);
|
|
39
|
+
if (!this.root && !this.captureError) {
|
|
40
|
+
this.exitedBeforePin = true;
|
|
41
|
+
this.captureError = new Error("the Windows seat exited before its launch process identity could be pinned");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
stop(graceMs, timeoutMs, ptyExit) {
|
|
45
|
+
if (this.pending)
|
|
46
|
+
return this.pending;
|
|
47
|
+
if (this.succeeded)
|
|
48
|
+
return Promise.resolve();
|
|
49
|
+
this.capture();
|
|
50
|
+
const task = async () => {
|
|
51
|
+
const deadline = Date.now() + timeoutMs;
|
|
52
|
+
while (!this.root && !this.captureError) {
|
|
53
|
+
if (Date.now() >= deadline) {
|
|
54
|
+
clearInterval(this.startup);
|
|
55
|
+
throw new Error("the Windows seat has no retained launch process identity");
|
|
56
|
+
}
|
|
57
|
+
await delay(5);
|
|
58
|
+
this.capture();
|
|
59
|
+
}
|
|
60
|
+
clearInterval(this.startup);
|
|
61
|
+
if (this.captureError)
|
|
62
|
+
throw this.captureError;
|
|
63
|
+
if (!this.root || !this.rootPid)
|
|
64
|
+
throw new Error("the Windows seat has no retained launch process identity");
|
|
65
|
+
let tree = [];
|
|
66
|
+
try {
|
|
67
|
+
tree = this.binding().processTree(this.rootPid, this.root.token);
|
|
68
|
+
if (graceMs > 0) {
|
|
69
|
+
const graceEnd = Math.min(deadline, Date.now() + graceMs);
|
|
70
|
+
while (Date.now() < graceEnd && !tree.every((member) => member.exited())) {
|
|
71
|
+
await delay(Math.min(20, Math.max(1, graceEnd - Date.now())));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Kill through the captured kernel handles, never by a reusable child PID.
|
|
75
|
+
// A naturally exited root does not exempt surviving captured descendants.
|
|
76
|
+
for (const member of [...tree].reverse()) {
|
|
77
|
+
if (!member.exited())
|
|
78
|
+
member.terminate();
|
|
79
|
+
}
|
|
80
|
+
while (!tree.every((member) => member.exited())) {
|
|
81
|
+
if (Date.now() >= deadline)
|
|
82
|
+
throw new Error("Windows seat stop could not prove every captured process exited");
|
|
83
|
+
await delay(20);
|
|
84
|
+
}
|
|
85
|
+
let timer;
|
|
86
|
+
try {
|
|
87
|
+
await Promise.race([
|
|
88
|
+
ptyExit(),
|
|
89
|
+
new Promise((_, reject) => {
|
|
90
|
+
timer = setTimeout(() => reject(new Error("Windows seat processes exited but the PTY did not report exit")), Math.max(0, deadline - Date.now()));
|
|
91
|
+
}),
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
clearTimeout(timer);
|
|
96
|
+
}
|
|
97
|
+
this.succeeded = true;
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
for (const member of tree) {
|
|
101
|
+
try {
|
|
102
|
+
member.close();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
/* close every retained member */
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const run = task();
|
|
111
|
+
this.pending = run;
|
|
112
|
+
// Some stop doors observe later through waitForExit. Keep rejection handled now.
|
|
113
|
+
void run.then(() => {
|
|
114
|
+
this.close();
|
|
115
|
+
}, () => {
|
|
116
|
+
if (this.pending === run)
|
|
117
|
+
this.pending = undefined;
|
|
118
|
+
});
|
|
119
|
+
return run;
|
|
120
|
+
}
|
|
121
|
+
close() {
|
|
122
|
+
clearInterval(this.startup);
|
|
123
|
+
// A stop task can still be using its original root identity after PTY exit.
|
|
124
|
+
const release = () => {
|
|
125
|
+
try {
|
|
126
|
+
this.root?.close();
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
/* repeated close is a no-op */
|
|
130
|
+
}
|
|
131
|
+
this.root = undefined;
|
|
132
|
+
};
|
|
133
|
+
if (this.pending && !this.succeeded)
|
|
134
|
+
void this.pending.then(release, () => { });
|
|
135
|
+
else
|
|
136
|
+
release();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=windows-stop.js.map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,MAAM,OAAO,GAAG,GAAS,EAAE;YACzB,IAAI,CAAC;gBACH,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;YACrB,CAAC;YAAC,MAAM,CAAC;gBACP,+BAA+B;YACjC,CAAC;YACD,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACxB,CAAC,CAAC;QACF,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;;YAC1E,OAAO,EAAE,CAAC;IACjB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/manager",
|
|
3
3
|
"description": "Cotal agent supervisor: spawns and manages mesh nodes via a pluggable runtime (pty/tmux/cmux/orca/herdr).",
|
|
4
|
-
"version": "0.164.
|
|
4
|
+
"version": "0.164.13",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@clack/prompts": "^1.0.0",
|
|
22
|
-
"@cotal-ai/core": "0.164.
|
|
23
|
-
"@cotal-ai/seat": "0.164.
|
|
24
|
-
"@cotal-ai/workspace": "0.164.
|
|
22
|
+
"@cotal-ai/core": "0.164.13",
|
|
23
|
+
"@cotal-ai/seat": "0.164.13",
|
|
24
|
+
"@cotal-ai/workspace": "0.164.13",
|
|
25
25
|
"@lydell/node-pty": "1.2.0-beta.12",
|
|
26
26
|
"@nats-io/jetstream": "^3.4.0",
|
|
27
27
|
"@nats-io/kv": "^3.4.0",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"zod": "^4.4.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@cotal-ai/auth": "0.164.
|
|
41
|
-
"@cotal-ai/connector-claude-code": "0.164.
|
|
42
|
-
"@cotal-ai/connector-codex": "0.164.
|
|
43
|
-
"@cotal-ai/connector-core": "0.164.
|
|
44
|
-
"@cotal-ai/connector-hermes": "0.164.
|
|
45
|
-
"@cotal-ai/connector-opencode": "0.164.
|
|
46
|
-
"@cotal-ai/delivery": "0.164.
|
|
47
|
-
"@cotal-ai/runtime": "0.164.
|
|
40
|
+
"@cotal-ai/auth": "0.164.13",
|
|
41
|
+
"@cotal-ai/connector-claude-code": "0.164.13",
|
|
42
|
+
"@cotal-ai/connector-codex": "0.164.13",
|
|
43
|
+
"@cotal-ai/connector-core": "0.164.13",
|
|
44
|
+
"@cotal-ai/connector-hermes": "0.164.13",
|
|
45
|
+
"@cotal-ai/connector-opencode": "0.164.13",
|
|
46
|
+
"@cotal-ai/delivery": "0.164.13",
|
|
47
|
+
"@cotal-ai/runtime": "0.164.13",
|
|
48
48
|
"@cotal-ai/smoke-kit": "0.0.0",
|
|
49
49
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
50
50
|
"@types/ws": "^8.18.1",
|