@cotal-ai/acp 0.0.0-bootstrap.0 → 0.175.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.
- package/LICENSE +202 -0
- package/README.md +16 -0
- package/dist/agent.d.ts +44 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +574 -0
- package/dist/agent.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +98 -0
- package/dist/cli.js.map +1 -0
- package/dist/frames.d.ts +40 -0
- package/dist/frames.d.ts.map +1 -0
- package/dist/frames.js +100 -0
- package/dist/frames.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/live-mesh.d.ts +55 -0
- package/dist/live-mesh.d.ts.map +1 -0
- package/dist/live-mesh.js +454 -0
- package/dist/live-mesh.js.map +1 -0
- package/dist/mesh.d.ts +149 -0
- package/dist/mesh.d.ts.map +1 -0
- package/dist/mesh.js +25 -0
- package/dist/mesh.js.map +1 -0
- package/dist/options.d.ts +67 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +160 -0
- package/dist/options.js.map +1 -0
- package/package.json +40 -4
package/dist/cli.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cotal acp`: the ACP agent on stdio. stdout carries the protocol and nothing else, so every other
|
|
3
|
+
* write to it goes to stderr.
|
|
4
|
+
*/
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { closeSync, readFileSync, writeSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { Readable } from "node:stream";
|
|
9
|
+
import { ndJsonStream } from "@agentclientprotocol/sdk";
|
|
10
|
+
import { mkSecretDir, openPrivateAppend } from "@cotal-ai/core";
|
|
11
|
+
import { homeCotalDir, isConnectRefusal, resolveTargetOrThrow } from "@cotal-ai/workspace";
|
|
12
|
+
import { cotalAgent } from "./agent.js";
|
|
13
|
+
import { openLiveMesh } from "./live-mesh.js";
|
|
14
|
+
export const USAGE = "cotal acp [--space <name>] [--server <url>] | cotal acp --auth [--space <name>]";
|
|
15
|
+
const version = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
16
|
+
/** Seat runs that `session/delete` hid, one lifecycle UID per line. Every read goes to the file,
|
|
17
|
+
* because a client may run one agent process per thread and another process may have hidden one
|
|
18
|
+
* since. Each hide is one append, so two processes hiding at once both keep theirs. */
|
|
19
|
+
export function hiddenStore(dir = join(homeCotalDir(), "acp")) {
|
|
20
|
+
const path = join(dir, "hidden-runs");
|
|
21
|
+
const read = () => {
|
|
22
|
+
try {
|
|
23
|
+
return new Set(readFileSync(path, "utf8").split("\n").filter((line) => line !== ""));
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
if (e.code === "ENOENT")
|
|
27
|
+
return new Set();
|
|
28
|
+
throw e;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
read,
|
|
33
|
+
add(lifecycleUid) {
|
|
34
|
+
if (!lifecycleUid || /[\r\n]/.test(lifecycleUid))
|
|
35
|
+
throw new Error(`"${lifecycleUid}" is not a lifecycle UID`);
|
|
36
|
+
if (read().has(lifecycleUid))
|
|
37
|
+
return;
|
|
38
|
+
mkSecretDir(dir);
|
|
39
|
+
const fd = openPrivateAppend(path);
|
|
40
|
+
try {
|
|
41
|
+
writeSync(fd, `${lifecycleUid}\n`);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
closeSync(fd);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Give the protocol its own handle on stdout and send every other stdout write to stderr. */
|
|
50
|
+
function claimStdout() {
|
|
51
|
+
const write = process.stdout.write.bind(process.stdout);
|
|
52
|
+
process.stdout.write = process.stderr.write.bind(process.stderr);
|
|
53
|
+
return new WritableStream({
|
|
54
|
+
write: (chunk) => new Promise((resolve, reject) => void write(chunk, (e) => (e ? reject(e) : resolve()))),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const log = (line) => void process.stderr.write(`cotal acp: ${line}\n`);
|
|
58
|
+
/** The sign-in a client runs in a terminal: `cotal login` for a space that authenticates users,
|
|
59
|
+
* `cotal setup` when no space is recorded on this machine. */
|
|
60
|
+
function signIn(space, server) {
|
|
61
|
+
return (async () => {
|
|
62
|
+
let command;
|
|
63
|
+
try {
|
|
64
|
+
const target = await resolveTargetOrThrow({ space, server });
|
|
65
|
+
if (target.mode !== "user" || !target.userAuth) {
|
|
66
|
+
log(`${target.space} does not authenticate users, so there is nothing to sign in to.`);
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
command = ["login", "--idp", target.userAuth.idp.url];
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
if (!isConnectRefusal(e) || e.cause?.code !== "no-meshes")
|
|
73
|
+
throw e;
|
|
74
|
+
command = ["setup", ...(space ? ["--space", space] : [])];
|
|
75
|
+
}
|
|
76
|
+
const cotal = [...process.execArgv, process.argv[1]];
|
|
77
|
+
log(`running cotal ${command.join(" ")}`);
|
|
78
|
+
return spawnSync(process.execPath, [...cotal, ...command], { stdio: "inherit" }).status ?? 1;
|
|
79
|
+
})();
|
|
80
|
+
}
|
|
81
|
+
export async function acp(args) {
|
|
82
|
+
const space = typeof args.values.space === "string" ? args.values.space : undefined;
|
|
83
|
+
const server = typeof args.values.server === "string" ? args.values.server : undefined;
|
|
84
|
+
if (args.values.auth === true) {
|
|
85
|
+
process.exitCode = await signIn(space, server);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const output = claimStdout();
|
|
89
|
+
const input = Readable.toWeb(process.stdin);
|
|
90
|
+
const stop = (reason) => {
|
|
91
|
+
log(`${reason}. Stopping; start the agent again in your client.`);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
};
|
|
94
|
+
const app = cotalAgent({ mesh: () => openLiveMesh({ space, server, log, stop }), hidden: hiddenStore(), log, version });
|
|
95
|
+
const connection = app.connect(ndJsonStream(output, input));
|
|
96
|
+
await connection.closed;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAmB,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAuB,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAG,iFAAiF,CAAC;AAEvG,MAAM,OAAO,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC;AAE/H;;wFAEwF;AACxF,MAAM,UAAU,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,CAAC;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,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AAC,CAAC;IACF,MAAM,GAAG,GAAG,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACxH,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5D,MAAM,UAAU,CAAC,MAAM,CAAC;AAC1B,CAAC"}
|
package/dist/frames.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AG-UI frames from a seat's event channel, mapped to ACP `session/update` notifications.
|
|
3
|
+
*
|
|
4
|
+
* The ordinary event channel carries text and reasoning as completed messages, tool calls by name
|
|
5
|
+
* and boundary, and the `cotal.toolResult` marker for a call's end. Tool arguments and results are
|
|
6
|
+
* withheld from it (SPEC event payloads), so a tool call shows its name and its status only.
|
|
7
|
+
*/
|
|
8
|
+
import type { SessionUpdate } from "@agentclientprotocol/sdk";
|
|
9
|
+
import type { SeatFrame } from "./mesh.js";
|
|
10
|
+
/** What happened to a run, as the bridge needs it for prompt completion. */
|
|
11
|
+
export type RunSignal = {
|
|
12
|
+
readonly kind: "start";
|
|
13
|
+
readonly runId: string;
|
|
14
|
+
readonly ts: number;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: "end";
|
|
17
|
+
readonly runId: string;
|
|
18
|
+
readonly outcome: "finished" | "error" | "interrupt";
|
|
19
|
+
readonly ts: number;
|
|
20
|
+
readonly message?: string;
|
|
21
|
+
};
|
|
22
|
+
export interface Mapped {
|
|
23
|
+
readonly updates: SessionUpdate[];
|
|
24
|
+
readonly runs: RunSignal[];
|
|
25
|
+
}
|
|
26
|
+
/** Map one seat's frames in order. One mapper per ACP session, because message roles and open tool
|
|
27
|
+
* calls carry from one frame to the next. */
|
|
28
|
+
export declare class FrameMapper {
|
|
29
|
+
private readonly roles;
|
|
30
|
+
private readonly open;
|
|
31
|
+
private readonly seen;
|
|
32
|
+
/** Map one frame. A frame already mapped (same epoch and seq) maps to nothing, so a history read
|
|
33
|
+
* and a live tap can overlap. */
|
|
34
|
+
map(frame: SeatFrame): Mapped;
|
|
35
|
+
/** The tool calls still open, closed with `status`. A prompt answers only after this, so no call
|
|
36
|
+
* stays open in the client once its turn has ended. */
|
|
37
|
+
closeOpen(status: "completed" | "failed"): SessionUpdate[];
|
|
38
|
+
private event;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=frames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../src/frames.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,WAAW,CAAC;AAK1D,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3J,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;CAC5B;AAID;8CAC8C;AAC9C,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2C;IACjE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;IAClD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAE1C;sCACkC;IAClC,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAU7B;4DACwD;IACxD,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,aAAa,EAAE;IAM1D,OAAO,CAAC,KAAK;CA8Dd"}
|
package/dist/frames.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** The content-free marker a connector publishes when a tool call ends. */
|
|
2
|
+
const TOOL_RESULT = "cotal.toolResult";
|
|
3
|
+
const text = (value) => (typeof value === "string" ? value : undefined);
|
|
4
|
+
/** Map one seat's frames in order. One mapper per ACP session, because message roles and open tool
|
|
5
|
+
* calls carry from one frame to the next. */
|
|
6
|
+
export class FrameMapper {
|
|
7
|
+
roles = new Map();
|
|
8
|
+
open = new Map();
|
|
9
|
+
seen = new Set();
|
|
10
|
+
/** Map one frame. A frame already mapped (same epoch and seq) maps to nothing, so a history read
|
|
11
|
+
* and a live tap can overlap. */
|
|
12
|
+
map(frame) {
|
|
13
|
+
const key = `${frame.epoch}:${frame.seq}`;
|
|
14
|
+
if (this.seen.has(key))
|
|
15
|
+
return { updates: [], runs: [] };
|
|
16
|
+
this.seen.add(key);
|
|
17
|
+
const updates = [];
|
|
18
|
+
const runs = [];
|
|
19
|
+
for (const event of frame.events)
|
|
20
|
+
this.event(event, frame, updates, runs);
|
|
21
|
+
return { updates, runs };
|
|
22
|
+
}
|
|
23
|
+
/** The tool calls still open, closed with `status`. A prompt answers only after this, so no call
|
|
24
|
+
* stays open in the client once its turn has ended. */
|
|
25
|
+
closeOpen(status) {
|
|
26
|
+
const updates = [...this.open.keys()].map((toolCallId) => ({ sessionUpdate: "tool_call_update", toolCallId, status }));
|
|
27
|
+
this.open.clear();
|
|
28
|
+
return updates;
|
|
29
|
+
}
|
|
30
|
+
event(event, frame, updates, runs) {
|
|
31
|
+
switch (event.type) {
|
|
32
|
+
case "RUN_STARTED":
|
|
33
|
+
runs.push({ kind: "start", runId: text(event.runId) ?? frame.runId, ts: frame.ts });
|
|
34
|
+
return;
|
|
35
|
+
case "RUN_FINISHED": {
|
|
36
|
+
const outcome = event.outcome?.type === "interrupt" ? "interrupt" : "finished";
|
|
37
|
+
runs.push({ kind: "end", runId: text(event.runId) ?? frame.runId, outcome, ts: frame.ts });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
case "RUN_ERROR":
|
|
41
|
+
// RUN_ERROR names no run; the frame's run is the one that failed.
|
|
42
|
+
runs.push({ kind: "end", runId: frame.runId, outcome: "error", ts: frame.ts, ...(text(event.message) ? { message: text(event.message) } : {}) });
|
|
43
|
+
return;
|
|
44
|
+
case "TEXT_MESSAGE_START": {
|
|
45
|
+
const id = text(event.messageId);
|
|
46
|
+
if (id)
|
|
47
|
+
this.roles.set(id, event.role === "user" ? "user" : "assistant");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
case "TEXT_MESSAGE_CONTENT": {
|
|
51
|
+
const id = text(event.messageId);
|
|
52
|
+
const delta = text(event.delta);
|
|
53
|
+
if (!id || !delta)
|
|
54
|
+
return;
|
|
55
|
+
const role = this.roles.get(id) ?? "assistant";
|
|
56
|
+
updates.push({ sessionUpdate: role === "user" ? "user_message_chunk" : "agent_message_chunk", messageId: id, content: { type: "text", text: delta } });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
case "TEXT_MESSAGE_END": {
|
|
60
|
+
const id = text(event.messageId);
|
|
61
|
+
if (id)
|
|
62
|
+
this.roles.delete(id);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
case "REASONING_MESSAGE_CONTENT": {
|
|
66
|
+
const id = text(event.messageId);
|
|
67
|
+
const delta = text(event.delta);
|
|
68
|
+
if (!delta)
|
|
69
|
+
return;
|
|
70
|
+
updates.push({ sessionUpdate: "agent_thought_chunk", ...(id ? { messageId: id } : {}), content: { type: "text", text: delta } });
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
case "TOOL_CALL_START": {
|
|
74
|
+
const id = text(event.toolCallId);
|
|
75
|
+
if (!id)
|
|
76
|
+
return;
|
|
77
|
+
const name = text(event.toolCallName) ?? "tool";
|
|
78
|
+
this.open.set(id, name);
|
|
79
|
+
updates.push({ sessionUpdate: "tool_call", toolCallId: id, title: name, name, kind: "other", status: "in_progress" });
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
case "CUSTOM": {
|
|
83
|
+
if (event.name !== TOOL_RESULT)
|
|
84
|
+
return;
|
|
85
|
+
const value = event.value;
|
|
86
|
+
const id = text(value?.toolCallId);
|
|
87
|
+
if (!id || !this.open.has(id))
|
|
88
|
+
return;
|
|
89
|
+
this.open.delete(id);
|
|
90
|
+
updates.push({ sessionUpdate: "tool_call_update", toolCallId: id, status: value?.isError === true ? "failed" : "completed" });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
default:
|
|
94
|
+
// TOOL_CALL_ARGS, TOOL_CALL_END and TOOL_CALL_RESULT carry nothing the client can show from
|
|
95
|
+
// the ordinary channel; the other types are bookkeeping.
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=frames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames.js","sourceRoot":"","sources":["../src/frames.ts"],"names":[],"mappings":"AAUA,2EAA2E;AAC3E,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAYvC,MAAM,IAAI,GAAG,CAAC,KAAc,EAAsB,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAErG;8CAC8C;AAC9C,MAAM,OAAO,WAAW;IACL,K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|
+
export { cotalAgent, COMMANDS, promptText, type CotalAgentOptions, type HiddenSessions } from "./agent.js";
|
|
2
|
+
export { FrameMapper, type RunSignal } from "./frames.js";
|
|
3
|
+
export { openLiveMesh, frameOf } from "./live-mesh.js";
|
|
4
|
+
export type { Mesh, AgentCatalog, ManagerChoice, SeatRef, SeatRow, SeatFrame, SpawnRequest } from "./mesh.js";
|
|
5
|
+
export { SignInRequired } from "./mesh.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { registry } from "@cotal-ai/core";
|
|
2
|
+
import { serverFlag, spaceFlag } from "@cotal-ai/workspace";
|
|
3
|
+
import { acp, USAGE } from "./cli.js";
|
|
4
|
+
/**
|
|
5
|
+
* `@cotal-ai/acp`: Cotal as an ACP (Agent Client Protocol) agent, so an ACP client such as T3 Code,
|
|
6
|
+
* Zed or a JetBrains IDE can spawn and drive Cotal agents. `cotal ext add @cotal-ai/acp` makes
|
|
7
|
+
* `cotal acp` appear in help, completion and dispatch. Self-registers into the shared core Registry
|
|
8
|
+
* on import.
|
|
9
|
+
*/
|
|
10
|
+
const acpCommand = {
|
|
11
|
+
kind: "command",
|
|
12
|
+
name: "acp",
|
|
13
|
+
group: "Integrations",
|
|
14
|
+
summary: "serve Cotal as an ACP agent on stdio, for T3 Code, Zed and other ACP clients",
|
|
15
|
+
usage: USAGE,
|
|
16
|
+
examples: [
|
|
17
|
+
{ command: "cotal acp", note: "serve the ACP agent on stdin and stdout" },
|
|
18
|
+
{ command: "cotal acp --space <name>", note: "serve it for one space" },
|
|
19
|
+
{ command: "cotal acp --auth", note: "sign in, as an ACP client's terminal runs it" },
|
|
20
|
+
],
|
|
21
|
+
// The agent asks managers to launch and installs nothing on this machine, so the binary refreshes
|
|
22
|
+
// no connectors before it runs. A client starts this process on every provider refresh.
|
|
23
|
+
reads: true,
|
|
24
|
+
// The agent resolves its own space when the client first needs it, and never asks a question:
|
|
25
|
+
// stdin is the protocol.
|
|
26
|
+
prepareMeshTarget: false,
|
|
27
|
+
flags: [
|
|
28
|
+
{ name: "auth", type: "boolean", description: "sign in to the space, or set one up, then exit" },
|
|
29
|
+
spaceFlag,
|
|
30
|
+
serverFlag,
|
|
31
|
+
],
|
|
32
|
+
run: acp,
|
|
33
|
+
};
|
|
34
|
+
registry.register(acpCommand);
|
|
35
|
+
export { cotalAgent, COMMANDS, promptText } from "./agent.js";
|
|
36
|
+
export { FrameMapper } from "./frames.js";
|
|
37
|
+
export { openLiveMesh, frameOf } from "./live-mesh.js";
|
|
38
|
+
export { SignInRequired } from "./mesh.js";
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,GAAY;IAC1B,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,8EAA8E;IACvF,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE;QACR,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,yCAAyC,EAAE;QACzE,EAAE,OAAO,EAAE,0BAA0B,EAAE,IAAI,EAAE,wBAAwB,EAAE;QACvE,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,8CAA8C,EAAE;KACtF;IACD,kGAAkG;IAClG,wFAAwF;IACxF,KAAK,EAAE,IAAI;IACX,8FAA8F;IAC9F,yBAAyB;IACzB,iBAAiB,EAAE,KAAK;IACxB,KAAK,EAAE;QACL,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,gDAAgD,EAAE;QAChG,SAAS;QACT,UAAU;KACX;IACD,GAAG,EAAE,GAAG;CACT,CAAC;AACF,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAA+C,MAAM,YAAY,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type CotalMessage, type ManagerInstanceListing, type Presence } from "@cotal-ai/core";
|
|
2
|
+
import { type ManagerChoice, type Mesh, type SeatFrame } from "./mesh.js";
|
|
3
|
+
export interface LiveMeshOptions {
|
|
4
|
+
readonly space?: string;
|
|
5
|
+
readonly server?: string;
|
|
6
|
+
readonly log: (line: string) => void;
|
|
7
|
+
/** Ends the bridge: the person's sign-in was granted again, and its reader cannot recover. */
|
|
8
|
+
readonly stop: (reason: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Whether a reply should name the deregister command: an unanswered read of one of the person's own
|
|
11
|
+
* registered managers. The space's own manager is not theirs to remove, and a manager that answered
|
|
12
|
+
* with a refusal is not gone. */
|
|
13
|
+
export declare function namesDeregister(op: string, instanceId: string | undefined, own: ReadonlySet<string>, reply: {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
unanswered?: boolean;
|
|
16
|
+
}): boolean;
|
|
17
|
+
/** A manager as a choice, its host read from the roster's current row for it. On a space where people
|
|
18
|
+
* sign in, `owner` is the person's, and only their own manager's row counts: another member may name
|
|
19
|
+
* an agent after it. An offline row says nothing about where the manager runs now, so it is not live
|
|
20
|
+
* and not local. */
|
|
21
|
+
export declare function managerChoice(instanceId: string, roster: readonly Presence[], here: string, owner?: string): ManagerChoice;
|
|
22
|
+
/** The managers that listed their agents, and the ones that did not. A manager that did not hides
|
|
23
|
+
* only its own agents, is logged, and is named in `silent`. When none answered, the first failure is
|
|
24
|
+
* the answer. */
|
|
25
|
+
export declare function answeredReads<T>(reads: readonly ({
|
|
26
|
+
instanceId: string;
|
|
27
|
+
rows: T[];
|
|
28
|
+
} | {
|
|
29
|
+
instanceId: string;
|
|
30
|
+
error: Error;
|
|
31
|
+
})[], log: (line: string) => void): {
|
|
32
|
+
answered: {
|
|
33
|
+
instanceId: string;
|
|
34
|
+
rows: T[];
|
|
35
|
+
}[];
|
|
36
|
+
silent: string[];
|
|
37
|
+
};
|
|
38
|
+
/** Which of a person's managers, as the auth service lists them, a new thread may start on, and which
|
|
39
|
+
* the bridge reads agents from. A new thread may start on each of the person's registered managers
|
|
40
|
+
* that is live once they have registered any, else on the space's manager. That is the service's
|
|
41
|
+
* default rule for an unnamed call, except that several live managers are each offered where the
|
|
42
|
+
* service would refuse to choose. Every call names its manager, so a host's `local-primary` choice
|
|
43
|
+
* does not apply. Agents are read from every live one, so an agent left on the space's manager stays
|
|
44
|
+
* listed. `why` says why nothing may start. */
|
|
45
|
+
export declare function managerPlan(listed: readonly ManagerInstanceListing[]): {
|
|
46
|
+
launch: string[];
|
|
47
|
+
read: string[];
|
|
48
|
+
own: string[];
|
|
49
|
+
why?: string;
|
|
50
|
+
};
|
|
51
|
+
/** The frame a message carries, or undefined when it carries none. Only the agent publishes on
|
|
52
|
+
* its own event channel, so a frame from any other sender is none. */
|
|
53
|
+
export declare function frameOf(msg: CotalMessage): SeatFrame | undefined;
|
|
54
|
+
export declare function openLiveMesh(options: LiveMeshOptions): Promise<Mesh>;
|
|
55
|
+
//# sourceMappingURL=live-mesh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-mesh.d.ts","sourceRoot":"","sources":["../src/live-mesh.ts"],"names":[],"mappings":"AAOA,OAAO,EAYL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EAEd,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAgH,KAAK,aAAa,EAAE,KAAK,IAAI,EAAoB,KAAK,SAAS,EAAiD,MAAM,WAAW,CAAC;AAMzP,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAMD;;kCAEkC;AAClC,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAE3J;AAED;;;qBAGqB;AACrB,wBA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