@concord-ai/concord-mcp 0.14.2 → 0.15.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/README.md +41 -14
- package/dist/cli/commands/adapters.js +27 -21
- package/dist/cli/commands/adapters.js.map +1 -1
- package/dist/cli/commands/cloud-codex.js +3 -3
- package/dist/cli/commands/cloud-codex.js.map +1 -1
- package/dist/cli/commands/cloud-hooks.d.ts +22 -0
- package/dist/cli/commands/cloud-hooks.js +95 -3
- package/dist/cli/commands/cloud-hooks.js.map +1 -1
- package/dist/cli/commands/copilot-adapter.d.ts +66 -0
- package/dist/cli/commands/copilot-adapter.js +200 -0
- package/dist/cli/commands/copilot-adapter.js.map +1 -0
- package/dist/cli/commands/copilot-hooks.d.ts +49 -0
- package/dist/cli/commands/copilot-hooks.js +206 -0
- package/dist/cli/commands/copilot-hooks.js.map +1 -0
- package/dist/cli/commands/copilot-spool.d.ts +19 -0
- package/dist/cli/commands/copilot-spool.js +45 -0
- package/dist/cli/commands/copilot-spool.js.map +1 -0
- package/dist/cli/commands/doctor.js +1 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/handoff.js +1 -1
- package/dist/cli/commands/handoff.js.map +1 -1
- package/dist/cli/commands/hook.d.ts +25 -0
- package/dist/cli/commands/hook.js +208 -11
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/inbox.js +3 -10
- package/dist/cli/commands/inbox.js.map +1 -1
- package/dist/cli/commands/review-packet.js +1 -1
- package/dist/cli/commands/review-packet.js.map +1 -1
- package/dist/cli/commands/session-start-message.d.ts +8 -0
- package/dist/cli/commands/session-start-message.js +32 -12
- package/dist/cli/commands/session-start-message.js.map +1 -1
- package/dist/cli/commands/setup.js +10 -2
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/detached-host.d.ts +6 -0
- package/dist/cli/detached-host.js +19 -0
- package/dist/cli/detached-host.js.map +1 -0
- package/dist/cli/local-port.d.ts +2 -0
- package/dist/cli/local-port.js +23 -0
- package/dist/cli/local-port.js.map +1 -0
- package/dist/config/install-mode.d.ts +35 -0
- package/dist/config/install-mode.js +98 -0
- package/dist/config/install-mode.js.map +1 -0
- package/dist/db/repositories/agent-messages.d.ts +2 -0
- package/dist/db/repositories/agent-messages.js +4 -0
- package/dist/db/repositories/agent-messages.js.map +1 -1
- package/dist/domain/antigravity-monitor.d.ts +12 -0
- package/dist/domain/antigravity-monitor.js +47 -0
- package/dist/domain/antigravity-monitor.js.map +1 -0
- package/dist/domain/harness-config.d.ts +1 -1
- package/dist/domain/harness-config.js +52 -2
- package/dist/domain/harness-config.js.map +1 -1
- package/dist/domain/identity.js +23 -10
- package/dist/domain/identity.js.map +1 -1
- package/dist/domain/pull-inbox.d.ts +10 -0
- package/dist/domain/pull-inbox.js +3 -9
- package/dist/domain/pull-inbox.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/install/adapters/index.d.ts +2 -0
- package/dist/install/adapters/index.js +170 -9
- package/dist/install/adapters/index.js.map +1 -1
- package/dist/install/adapters/links.js +2 -1
- package/dist/install/adapters/links.js.map +1 -1
- package/dist/install/adapters/self-heal.d.ts +2 -0
- package/dist/install/antigravity-hooks.d.ts +51 -0
- package/dist/install/antigravity-hooks.js +164 -0
- package/dist/install/antigravity-hooks.js.map +1 -0
- package/dist/install/copilot-config.d.ts +61 -0
- package/dist/install/copilot-config.js +186 -0
- package/dist/install/copilot-config.js.map +1 -0
- package/dist/install/global-mode.js +42 -9
- package/dist/install/global-mode.js.map +1 -1
- package/dist/install/goose-config.js +10 -4
- package/dist/install/goose-config.js.map +1 -1
- package/dist/install/index.js +8 -2
- package/dist/install/index.js.map +1 -1
- package/dist/install/instructions.d.ts +5 -1
- package/dist/install/instructions.js +35 -2
- package/dist/install/instructions.js.map +1 -1
- package/dist/install/mcp-config.d.ts +14 -3
- package/dist/install/mcp-config.js +63 -9
- package/dist/install/mcp-config.js.map +1 -1
- package/dist/install/spawn-command.d.ts +14 -0
- package/dist/install/spawn-command.js +46 -0
- package/dist/install/spawn-command.js.map +1 -0
- package/dist/relay/address.d.ts +6 -1
- package/dist/relay/address.js +26 -7
- package/dist/relay/address.js.map +1 -1
- package/dist/relay/copilot-client.d.ts +41 -0
- package/dist/relay/copilot-client.js +198 -0
- package/dist/relay/copilot-client.js.map +1 -0
- package/dist/relay/server.js +2 -1
- package/dist/relay/server.js.map +1 -1
- package/dist/relay/socket-dispatcher.js +4 -1
- package/dist/relay/socket-dispatcher.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/update-notifier.d.ts +0 -1
- package/dist/update-notifier.js +3 -3
- package/dist/update-notifier.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { atLeast, executablePath, run, versionTuple } from '../../install/adapters/index.js';
|
|
3
|
+
import { relayAddress } from '../../relay/address.js';
|
|
4
|
+
import { renderPeerMessage } from '../../domain/pull-inbox.js';
|
|
5
|
+
import { PushPromptSessionAdapter } from '../../relay/adapters.js';
|
|
6
|
+
import { CopilotUiServerClient } from '../../relay/copilot-client.js';
|
|
7
|
+
import { RELAY_PROTOCOL_VERSION } from '../../relay/protocol.js';
|
|
8
|
+
import { startAgentRelay, } from '../../relay/server.js';
|
|
9
|
+
import { ensureAgentRegistered } from '../../tools/register-agent.js';
|
|
10
|
+
import { openContext } from '../context.js';
|
|
11
|
+
import { availablePort } from '../local-port.js';
|
|
12
|
+
import { deliverToSession } from './cloud-codex.js';
|
|
13
|
+
import { watchCloud } from './cloud-inbox.js';
|
|
14
|
+
/**
|
|
15
|
+
* Copilot CLI with idle wake-up (issue #261), shaped like the Codex adapter.
|
|
16
|
+
*
|
|
17
|
+
* `concord adapters copilot` starts Copilot's TUI with its embedded server
|
|
18
|
+
* (`--ui-server`) on a fresh loopback port and exports that address. Copilot's
|
|
19
|
+
* hooks inherit it, so the session-start hook starts a detached host for the
|
|
20
|
+
* session; the host resumes the session over the server and hands each Concord
|
|
21
|
+
* message to it — steering a running turn, or starting one while it is idle.
|
|
22
|
+
* Plain `copilot` sessions never see the address and keep hook delivery.
|
|
23
|
+
*/
|
|
24
|
+
/** Where the launcher tells hooks the session's embedded server listens. */
|
|
25
|
+
export const COPILOT_SERVER_ENV = 'CONCORD_COPILOT_SERVER_URL';
|
|
26
|
+
/** The release whose `--ui-server` protocol this adapter was verified against. */
|
|
27
|
+
export const COPILOT_UI_SERVER_BASELINE = [1, 0, 100];
|
|
28
|
+
const KIND = 'copilot-cli';
|
|
29
|
+
/** The address the launcher exports, when this process descends from it. */
|
|
30
|
+
export function copilotServerAddress(env = process.env) {
|
|
31
|
+
const address = env[COPILOT_SERVER_ENV]?.trim();
|
|
32
|
+
return address === undefined || address === '' ? undefined : address;
|
|
33
|
+
}
|
|
34
|
+
/** The command line and environment for one launched Copilot session. */
|
|
35
|
+
export function copilotLaunchPlan(port, args, env) {
|
|
36
|
+
return {
|
|
37
|
+
args: ['--ui-server', '--port', String(port), ...args],
|
|
38
|
+
env: { ...env, [COPILOT_SERVER_ENV]: `127.0.0.1:${String(port)}` },
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** Whether `copilot --version` output is a release this adapter supports. */
|
|
42
|
+
export function supportsUiServer(versionOutput) {
|
|
43
|
+
const version = versionTuple(versionOutput);
|
|
44
|
+
return version !== undefined && atLeast(version, COPILOT_UI_SERVER_BASELINE);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Run Copilot's TUI with its embedded server. An unverified Copilot release
|
|
48
|
+
* runs plain, with hook delivery only, rather than on a protocol Concord has
|
|
49
|
+
* not checked.
|
|
50
|
+
*/
|
|
51
|
+
export async function launchCopilot(args) {
|
|
52
|
+
const executable = executablePath('copilot', process.env);
|
|
53
|
+
if (executable === undefined)
|
|
54
|
+
throw new Error('Copilot CLI was not found on PATH.');
|
|
55
|
+
const version = run(executable, ['--version'], process.env).output;
|
|
56
|
+
let plan = { args: [...args], env: process.env };
|
|
57
|
+
if (supportsUiServer(version)) {
|
|
58
|
+
plan = copilotLaunchPlan(await availablePort(), args, process.env);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
process.stderr.write(`Concord: idle wake-up needs Copilot CLI ${COPILOT_UI_SERVER_BASELINE.join('.')} or later ` +
|
|
62
|
+
`(found "${version}"); starting Copilot with hook delivery only.\n`);
|
|
63
|
+
}
|
|
64
|
+
const tui = spawn(executable, plan.args, { env: plan.env, stdio: 'inherit' });
|
|
65
|
+
const code = await new Promise((resolve, reject) => {
|
|
66
|
+
tui.once('error', reject);
|
|
67
|
+
tui.once('exit', resolve);
|
|
68
|
+
});
|
|
69
|
+
if (code !== null && code !== 0)
|
|
70
|
+
process.exitCode = code;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Hands relay deliveries to the Copilot session. A sender's dispatcher has
|
|
74
|
+
* already framed each one with its sender and id, as hooks and the cloud host
|
|
75
|
+
* do, so Copilot can tell a peer message from the user and knows which id to
|
|
76
|
+
* answer; framing it again here would show the header twice.
|
|
77
|
+
*/
|
|
78
|
+
export class CopilotSessionAdapter {
|
|
79
|
+
session;
|
|
80
|
+
provider = KIND;
|
|
81
|
+
/** Every message handed to Copilot, so a sweep never hands one over twice. */
|
|
82
|
+
handled = new Set();
|
|
83
|
+
constructor(session) {
|
|
84
|
+
this.session = session;
|
|
85
|
+
}
|
|
86
|
+
isBusy() {
|
|
87
|
+
return this.session.isBusy();
|
|
88
|
+
}
|
|
89
|
+
steer(delivery) {
|
|
90
|
+
this.handled.add(delivery.messageId);
|
|
91
|
+
return this.session.pushPrompt(delivery.content, 'steer');
|
|
92
|
+
}
|
|
93
|
+
inject(delivery) {
|
|
94
|
+
this.handled.add(delivery.messageId);
|
|
95
|
+
return this.session.pushPrompt(delivery.content, 'inject');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** How old a pending message must be before the sweep takes it: past any push. */
|
|
99
|
+
export const SWEEP_AFTER_MS = 10_000;
|
|
100
|
+
const SWEEP_EVERY_MS = 5_000;
|
|
101
|
+
/**
|
|
102
|
+
* The live host is its session's single consumer (#261): hooks of a hosted
|
|
103
|
+
* session do not drain. A sender keeps a message pending while it pushes it
|
|
104
|
+
* here, and leaves it pending when the push fails or times out — even if the
|
|
105
|
+
* push reached Copilot late. The sweep takes messages pending past that window:
|
|
106
|
+
* one this host already handed to Copilot is only marked delivered; any other
|
|
107
|
+
* is handed over and marked delivered once Copilot accepts it. A failed handoff
|
|
108
|
+
* stays pending for the next sweep, or for the hooks once this host is gone —
|
|
109
|
+
* nothing is claimed that has not reached the session.
|
|
110
|
+
*/
|
|
111
|
+
export async function sweepStragglers(repos, agentId, adapter, now = Date.now()) {
|
|
112
|
+
const cutoff = new Date(now - SWEEP_AFTER_MS).toISOString();
|
|
113
|
+
const stragglers = repos.agentMessages
|
|
114
|
+
.listPendingForRecipient(agentId)
|
|
115
|
+
.filter((message) => message.createdAt < cutoff);
|
|
116
|
+
for (const message of stragglers) {
|
|
117
|
+
if (adapter.handled.has(message.messageId)) {
|
|
118
|
+
repos.agentMessages.markDelivered(message.messageId, KIND, null);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const delivery = {
|
|
122
|
+
version: RELAY_PROTOCOL_VERSION,
|
|
123
|
+
type: 'deliver',
|
|
124
|
+
messageId: message.messageId,
|
|
125
|
+
senderAgentId: message.senderAgentId,
|
|
126
|
+
recipientAgentId: agentId,
|
|
127
|
+
// Read straight from the store, so framed here as a dispatcher would.
|
|
128
|
+
content: renderPeerMessage(message),
|
|
129
|
+
};
|
|
130
|
+
let receipt;
|
|
131
|
+
try {
|
|
132
|
+
receipt = await (adapter.isBusy() ? adapter.steer(delivery) : adapter.inject(delivery));
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
// Not handed over: still pending, so the next sweep tries again.
|
|
136
|
+
adapter.handled.delete(message.messageId);
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
// Handed over: it stays in `handled`, so if recording this fails the next
|
|
140
|
+
// sweep only retries the record, never the handoff.
|
|
141
|
+
repos.agentMessages.markDelivered(message.messageId, KIND, receipt ?? null);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function connectSession(address, sessionId) {
|
|
145
|
+
const client = new CopilotUiServerClient(address, sessionId);
|
|
146
|
+
await client.connect();
|
|
147
|
+
return client;
|
|
148
|
+
}
|
|
149
|
+
/** Hosts one Copilot session's local relay until the TUI exits or the host is stopped. */
|
|
150
|
+
export async function hostCopilot(agentId, sessionId, address) {
|
|
151
|
+
const context = openContext(process.cwd());
|
|
152
|
+
ensureAgentRegistered(context.repos, { agentId, kind: KIND }, context.repoRoot);
|
|
153
|
+
const client = await connectSession(address, sessionId);
|
|
154
|
+
const adapter = new CopilotSessionAdapter(client);
|
|
155
|
+
const relay = await startAgentRelay({
|
|
156
|
+
repos: context.repos,
|
|
157
|
+
agentId,
|
|
158
|
+
address: relayAddress(context.concordPath, agentId),
|
|
159
|
+
adapter,
|
|
160
|
+
pullFallback: true,
|
|
161
|
+
});
|
|
162
|
+
let sweeping = false;
|
|
163
|
+
const sweeper = setInterval(() => {
|
|
164
|
+
if (sweeping)
|
|
165
|
+
return;
|
|
166
|
+
sweeping = true;
|
|
167
|
+
void sweepStragglers(context.repos, agentId, adapter)
|
|
168
|
+
.catch(() => undefined)
|
|
169
|
+
.finally(() => {
|
|
170
|
+
sweeping = false;
|
|
171
|
+
});
|
|
172
|
+
}, SWEEP_EVERY_MS);
|
|
173
|
+
await new Promise((resolve) => {
|
|
174
|
+
const stop = () => {
|
|
175
|
+
clearInterval(sweeper);
|
|
176
|
+
void relay.close().finally(() => {
|
|
177
|
+
client.close();
|
|
178
|
+
resolve();
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
client.onClosed(stop);
|
|
182
|
+
process.once('SIGINT', stop);
|
|
183
|
+
process.once('SIGTERM', stop);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/** Hosts one Copilot session's live receiver against Concord Cloud until the TUI exits. */
|
|
187
|
+
export async function hostCopilotInCloud(runtime, agentId, sessionId, address) {
|
|
188
|
+
const client = await connectSession(address, sessionId);
|
|
189
|
+
// deliverToSession frames each message before handing it over.
|
|
190
|
+
const adapter = new PushPromptSessionAdapter(KIND, client);
|
|
191
|
+
// The TUI is gone: nothing left to deliver to, and the receiver lease lapses.
|
|
192
|
+
client.onClosed(() => process.exit(0));
|
|
193
|
+
try {
|
|
194
|
+
await watchCloud(runtime, agentId, KIND, false, (messages, stop) => deliverToSession(runtime, agentId, adapter, messages, stop));
|
|
195
|
+
}
|
|
196
|
+
finally {
|
|
197
|
+
client.close();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=copilot-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-adapter.js","sourceRoot":"","sources":["../../../src/cli/commands/copilot-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAA0B,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,eAAe,GAGhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,M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C;QACL,CAAC,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAqB,EACrB,OAAe,EACf,SAAiB,EACjB,OAAe;IAEf,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxD,+DAA+D;IAC/D,MAAM,OAAO,GAAG,IAAI,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3D,8EAA8E;IAC9E,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CACjE,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAC5D,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CloudRuntime } from '../../cloud/runtime.js';
|
|
2
|
+
import type { Repositories } from '../../db/index.js';
|
|
3
|
+
import { type DeliverableMessage } from '../../domain/pull-inbox.js';
|
|
4
|
+
import type { MessageSpool } from './copilot-spool.js';
|
|
5
|
+
import { type RosterLine } from './session-start-message.js';
|
|
6
|
+
/** Where a Copilot hook's session lives and what it may do there. */
|
|
7
|
+
export interface CopilotHookBackend {
|
|
8
|
+
register(agentId: string, cwd: string): Promise<void>;
|
|
9
|
+
roster(agentId: string): Promise<RosterLine[]>;
|
|
10
|
+
drain(agentId: string): Promise<DeliverableMessage[]>;
|
|
11
|
+
/** Start a live host for a launcher session, unless one already serves it (#261). */
|
|
12
|
+
startLiveHost(agentId: string, sessionId: string, serverAddress: string): void;
|
|
13
|
+
}
|
|
14
|
+
/** The workspace a Copilot hook is for: its payload's `cwd`, else the process's. */
|
|
15
|
+
export declare function copilotWorkspace(rawJson: string): string;
|
|
16
|
+
export declare function localCopilotBackend(repos: Repositories, repoRoot: string): CopilotHookBackend;
|
|
17
|
+
export declare function cloudCopilotBackend(runtime: CloudRuntime): CopilotHookBackend;
|
|
18
|
+
/** What one hook invocation works with. */
|
|
19
|
+
export interface CopilotHookContext {
|
|
20
|
+
readonly backend: CopilotHookBackend;
|
|
21
|
+
readonly spool: MessageSpool;
|
|
22
|
+
/** The hook's environment: `CONCORD_AGENT_ID` and the launcher's address live here. */
|
|
23
|
+
readonly env: NodeJS.ProcessEnv;
|
|
24
|
+
/** The embedded server of a session `concord adapters copilot` started. */
|
|
25
|
+
readonly serverAddress?: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* sessionStart: register the session, advertise it as reachable, and tell it
|
|
29
|
+
* who it is and who else is here through `additionalContext`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function copilotSessionStart(context: CopilotHookContext, rawJson: string): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* The longest prefix of `messages` whose rendering fits `limit`. Order is kept:
|
|
34
|
+
* once one message does not fit, it and everything after it wait.
|
|
35
|
+
*/
|
|
36
|
+
export declare function fittingPrefix(messages: readonly DeliverableMessage[], limit: number): DeliverableMessage[];
|
|
37
|
+
/**
|
|
38
|
+
* postToolUse: deliver waiting messages mid-turn. Only whole messages that fit
|
|
39
|
+
* Copilot's context cap are shown; the rest are spooled for the next hook.
|
|
40
|
+
*/
|
|
41
|
+
export declare function copilotPostToolUse(context: CopilotHookContext, rawJson: string): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* agentStop: when messages are waiting — spooled, or arrived after the last
|
|
44
|
+
* tool call — block the stop so they become the next turn's prompt instead of
|
|
45
|
+
* waiting for the user. Copilot itself stops honouring blocks after eight in a row.
|
|
46
|
+
*/
|
|
47
|
+
export declare function copilotAgentStop(context: CopilotHookContext, rawJson: string): Promise<string>;
|
|
48
|
+
/** Run one Copilot hook event; unknown events are reported, never fatal to the session. */
|
|
49
|
+
export declare function runCopilotHook(context: CopilotHookContext, event: string, rawJson: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { listCloudAgents } from '../../cloud/runtime.js';
|
|
3
|
+
import { hookSessionId, resolveIdentity, UNRESOLVED_IDENTITY_MESSAGE, } from '../../domain/identity.js';
|
|
4
|
+
import { buildRoster, deriveLiveness } from '../../domain/presence.js';
|
|
5
|
+
import { renderInboxBody } from '../../domain/pull-inbox.js';
|
|
6
|
+
import { ensureAgentRegistered } from '../../tools/register-agent.js';
|
|
7
|
+
import { launchDetachedConcord } from '../detached-host.js';
|
|
8
|
+
import { drainFromCloud, registerInCloud, watching } from './cloud-inbox.js';
|
|
9
|
+
import { drainInbox, registerPullEndpoint } from './inbox.js';
|
|
10
|
+
import { sessionStartMessage } from './session-start-message.js';
|
|
11
|
+
/**
|
|
12
|
+
* GitHub Copilot CLI lifecycle hooks.
|
|
13
|
+
*
|
|
14
|
+
* Every Copilot hook receives `{ sessionId, cwd, ... }` on stdin, and the MCP
|
|
15
|
+
* server receives the same id as `COPILOT_AGENT_SESSION_ID`, so both derive one
|
|
16
|
+
* agent id — or both use `CONCORD_AGENT_ID` when the operator set it in the
|
|
17
|
+
* environment Copilot was started from. Hooks run with the session's project
|
|
18
|
+
* as `cwd`, but the payload's `cwd` is used because user-level hooks are the
|
|
19
|
+
* ones Concord installs.
|
|
20
|
+
*/
|
|
21
|
+
const KIND = 'copilot-cli';
|
|
22
|
+
/** Copilot caps `additionalContext` from postToolUse at 10 KB. */
|
|
23
|
+
const POST_TOOL_CONTEXT_LIMIT = 9_000;
|
|
24
|
+
const POST_TOOL_HEADER = '[concord] Incoming message(s):\n\n';
|
|
25
|
+
const payloadSchema = z.object({ cwd: z.string().optional() }).loose();
|
|
26
|
+
function hostArgs(agentId, sessionId, serverAddress) {
|
|
27
|
+
return [
|
|
28
|
+
'adapters',
|
|
29
|
+
'host-copilot',
|
|
30
|
+
'--agent',
|
|
31
|
+
agentId,
|
|
32
|
+
'--session',
|
|
33
|
+
sessionId,
|
|
34
|
+
'--server',
|
|
35
|
+
serverAddress,
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
/** The workspace a Copilot hook is for: its payload's `cwd`, else the process's. */
|
|
39
|
+
export function copilotWorkspace(rawJson) {
|
|
40
|
+
try {
|
|
41
|
+
const raw = JSON.parse(rawJson);
|
|
42
|
+
const parsed = payloadSchema.safeParse(raw);
|
|
43
|
+
return (parsed.success ? parsed.data.cwd : undefined) ?? process.cwd();
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return process.cwd();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function localCopilotBackend(repos, repoRoot) {
|
|
50
|
+
const hosted = (agentId) => {
|
|
51
|
+
const endpoint = repos.agentEndpoints.getByAgent(agentId);
|
|
52
|
+
return (endpoint?.transport === 'local-ipc' &&
|
|
53
|
+
endpoint.status === 'connected' &&
|
|
54
|
+
(endpoint.expiresAt === null || Date.parse(endpoint.expiresAt) > Date.now()));
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
register: (agentId, cwd) => {
|
|
58
|
+
ensureAgentRegistered(repos, { agentId, kind: KIND }, cwd);
|
|
59
|
+
registerPullEndpoint(repos, agentId, KIND);
|
|
60
|
+
return Promise.resolve();
|
|
61
|
+
},
|
|
62
|
+
roster: (agentId) => Promise.resolve(buildRoster(repos.agents.list(), Date.now()).filter((entry) => entry.agentId !== agentId)),
|
|
63
|
+
drain: (agentId) => {
|
|
64
|
+
// A live host is the session's single consumer: it pushes, and sweeps up
|
|
65
|
+
// anything a push missed. Draining here too could show a message twice.
|
|
66
|
+
if (hosted(agentId)) {
|
|
67
|
+
repos.agents.touch(agentId);
|
|
68
|
+
return Promise.resolve([]);
|
|
69
|
+
}
|
|
70
|
+
return Promise.resolve(drainInbox(repos, agentId, KIND));
|
|
71
|
+
},
|
|
72
|
+
startLiveHost: (agentId, sessionId, serverAddress) => {
|
|
73
|
+
if (!hosted(agentId)) {
|
|
74
|
+
launchDetachedConcord(repoRoot, hostArgs(agentId, sessionId, serverAddress));
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export function cloudCopilotBackend(runtime) {
|
|
80
|
+
return {
|
|
81
|
+
register: async (agentId, cwd) => {
|
|
82
|
+
await registerInCloud(runtime, agentId, KIND, cwd);
|
|
83
|
+
},
|
|
84
|
+
roster: async (agentId) => {
|
|
85
|
+
const now = Date.now();
|
|
86
|
+
return (await listCloudAgents(runtime))
|
|
87
|
+
.filter((agent) => agent.agentKey !== agentId)
|
|
88
|
+
.map((agent) => ({
|
|
89
|
+
agentId: agent.agentKey,
|
|
90
|
+
liveness: deriveLiveness(agent.lastSeenAt, now),
|
|
91
|
+
status: agent.status,
|
|
92
|
+
summary: agent.summary,
|
|
93
|
+
}))
|
|
94
|
+
.filter((peer) => peer.liveness !== 'archived');
|
|
95
|
+
},
|
|
96
|
+
drain: (agentId) => drainFromCloud(runtime, agentId, KIND),
|
|
97
|
+
startLiveHost: (agentId, sessionId, serverAddress) => {
|
|
98
|
+
if (!watching(runtime, agentId)) {
|
|
99
|
+
launchDetachedConcord(runtime.repoRoot, hostArgs(agentId, sessionId, serverAddress));
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/** The same identity rules the MCP server applies: operator id, then the session. */
|
|
105
|
+
function agentIdFor(rawJson, env) {
|
|
106
|
+
return resolveIdentity(env, { kind: KIND, hookPayload: rawJson })?.agentId;
|
|
107
|
+
}
|
|
108
|
+
function describe(error) {
|
|
109
|
+
return error instanceof Error ? error.message : String(error);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* sessionStart: register the session, advertise it as reachable, and tell it
|
|
113
|
+
* who it is and who else is here through `additionalContext`.
|
|
114
|
+
*/
|
|
115
|
+
export async function copilotSessionStart(context, rawJson) {
|
|
116
|
+
const sessionId = hookSessionId(rawJson);
|
|
117
|
+
const agentId = agentIdFor(rawJson, context.env);
|
|
118
|
+
if (sessionId === undefined || agentId === undefined) {
|
|
119
|
+
return JSON.stringify({ additionalContext: `Concord: ${UNRESOLVED_IDENTITY_MESSAGE}` });
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
await context.backend.register(agentId, copilotWorkspace(rawJson));
|
|
123
|
+
// Started by `concord adapters copilot`: a host can reach the idle session.
|
|
124
|
+
if (context.serverAddress !== undefined) {
|
|
125
|
+
context.backend.startLiveHost(agentId, sessionId, context.serverAddress);
|
|
126
|
+
}
|
|
127
|
+
const others = await context.backend.roster(agentId);
|
|
128
|
+
return JSON.stringify({ additionalContext: sessionStartMessage(agentId, others) });
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
return JSON.stringify({ additionalContext: `Concord could not register: ${describe(error)}` });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Spooled messages first, then any newly drained, in arrival order. */
|
|
135
|
+
async function waiting(context, agentId) {
|
|
136
|
+
const spooled = context.spool.take(agentId);
|
|
137
|
+
try {
|
|
138
|
+
return [...spooled, ...(await context.backend.drain(agentId))];
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return spooled;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The longest prefix of `messages` whose rendering fits `limit`. Order is kept:
|
|
146
|
+
* once one message does not fit, it and everything after it wait.
|
|
147
|
+
*/
|
|
148
|
+
export function fittingPrefix(messages, limit) {
|
|
149
|
+
const fit = [];
|
|
150
|
+
for (const message of messages) {
|
|
151
|
+
if (POST_TOOL_HEADER.length + renderInboxBody([...fit, message]).length > limit)
|
|
152
|
+
break;
|
|
153
|
+
fit.push(message);
|
|
154
|
+
}
|
|
155
|
+
return fit;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* postToolUse: deliver waiting messages mid-turn. Only whole messages that fit
|
|
159
|
+
* Copilot's context cap are shown; the rest are spooled for the next hook.
|
|
160
|
+
*/
|
|
161
|
+
export async function copilotPostToolUse(context, rawJson) {
|
|
162
|
+
const agentId = agentIdFor(rawJson, context.env);
|
|
163
|
+
if (agentId === undefined)
|
|
164
|
+
return '{}';
|
|
165
|
+
const messages = await waiting(context, agentId);
|
|
166
|
+
if (messages.length === 0)
|
|
167
|
+
return '{}';
|
|
168
|
+
const shown = fittingPrefix(messages, POST_TOOL_CONTEXT_LIMIT);
|
|
169
|
+
context.spool.put(agentId, messages.slice(shown.length));
|
|
170
|
+
return JSON.stringify({
|
|
171
|
+
additionalContext: shown.length > 0
|
|
172
|
+
? `${POST_TOOL_HEADER}${renderInboxBody(shown)}`
|
|
173
|
+
: '[concord] A message too long to show here is waiting; it arrives when this turn ends.',
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* agentStop: when messages are waiting — spooled, or arrived after the last
|
|
178
|
+
* tool call — block the stop so they become the next turn's prompt instead of
|
|
179
|
+
* waiting for the user. Copilot itself stops honouring blocks after eight in a row.
|
|
180
|
+
*/
|
|
181
|
+
export async function copilotAgentStop(context, rawJson) {
|
|
182
|
+
const agentId = agentIdFor(rawJson, context.env);
|
|
183
|
+
if (agentId === undefined)
|
|
184
|
+
return '{}';
|
|
185
|
+
const messages = await waiting(context, agentId);
|
|
186
|
+
if (messages.length === 0)
|
|
187
|
+
return '{}';
|
|
188
|
+
return JSON.stringify({
|
|
189
|
+
decision: 'block',
|
|
190
|
+
reason: `New Concord message(s) arrived before this turn ended.\n\n${renderInboxBody(messages)}`,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/** Run one Copilot hook event; unknown events are reported, never fatal to the session. */
|
|
194
|
+
export async function runCopilotHook(context, event, rawJson) {
|
|
195
|
+
switch (event) {
|
|
196
|
+
case 'session-start':
|
|
197
|
+
return copilotSessionStart(context, rawJson);
|
|
198
|
+
case 'post-tool-use':
|
|
199
|
+
return copilotPostToolUse(context, rawJson);
|
|
200
|
+
case 'stop':
|
|
201
|
+
return copilotAgentStop(context, rawJson);
|
|
202
|
+
default:
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=copilot-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-hooks.js","sourceRoot":"","sources":["../../../src/cli/commands/copilot-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EACL,aAAa,EACb,eAAe,EACf,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,eAAe,EAA2B,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAmB,MAAM,4BAA4B,CAAC;AAElF;;;;;;;;;GASG;AAEH,MAAM,IAAI,GAAG,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AC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeliverableMessage } from '../../domain/pull-inbox.js';
|
|
2
|
+
/**
|
|
3
|
+
* Messages a Copilot hook drained but could not show yet.
|
|
4
|
+
*
|
|
5
|
+
* A drain marks every message it takes as delivered, while Copilot caps a tool
|
|
6
|
+
* hook's context at 10 KB. Rather than cut a message short, the hook shows the
|
|
7
|
+
* whole messages that fit and keeps the rest here; the session's next hook
|
|
8
|
+
* shows them first, and its stop hook — which has no cap — shows everything.
|
|
9
|
+
* Only a session's hooks use its file, and they run one at a time.
|
|
10
|
+
*/
|
|
11
|
+
export interface MessageSpool {
|
|
12
|
+
take(agentId: string): DeliverableMessage[];
|
|
13
|
+
put(agentId: string, messages: readonly DeliverableMessage[]): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The spool under `~/.concord/copilot-spool`, one file per agent per
|
|
17
|
+
* repository: an operator-chosen id such as `alpha` may run in several.
|
|
18
|
+
*/
|
|
19
|
+
export declare function fileSpool(repoRoot: string, env?: NodeJS.ProcessEnv): MessageSpool;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { userHome } from '../../config/paths.js';
|
|
6
|
+
const spooledSchema = z.array(z.object({
|
|
7
|
+
messageId: z.string(),
|
|
8
|
+
senderAgentId: z.string(),
|
|
9
|
+
taskId: z.string().nullable(),
|
|
10
|
+
content: z.string(),
|
|
11
|
+
messageKind: z.enum(['prompt', 'reply']),
|
|
12
|
+
deliveryLatencyMs: z.number().nullable(),
|
|
13
|
+
}));
|
|
14
|
+
/**
|
|
15
|
+
* The spool under `~/.concord/copilot-spool`, one file per agent per
|
|
16
|
+
* repository: an operator-chosen id such as `alpha` may run in several.
|
|
17
|
+
*/
|
|
18
|
+
export function fileSpool(repoRoot, env = process.env) {
|
|
19
|
+
const dir = join(userHome(env), '.concord', 'copilot-spool');
|
|
20
|
+
const pathFor = (agentId) => join(dir, `${createHash('sha256').update(`${repoRoot}\0${agentId}`).digest('hex').slice(0, 16)}.json`);
|
|
21
|
+
return {
|
|
22
|
+
take: (agentId) => {
|
|
23
|
+
const path = pathFor(agentId);
|
|
24
|
+
if (!existsSync(path))
|
|
25
|
+
return [];
|
|
26
|
+
try {
|
|
27
|
+
const raw = JSON.parse(readFileSync(path, 'utf8'));
|
|
28
|
+
return spooledSchema.parse(raw);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
rmSync(path, { force: true });
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
put: (agentId, messages) => {
|
|
38
|
+
if (messages.length === 0)
|
|
39
|
+
return;
|
|
40
|
+
mkdirSync(dir, { recursive: true });
|
|
41
|
+
writeFileSync(pathFor(agentId), JSON.stringify(messages), { mode: 0o600 });
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=copilot-spool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-spool.js","sourceRoot":"","sources":["../../../src/cli/commands/copilot-spool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAiBjD,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAC3B,CAA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AAC;gBACT,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QACD,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;YACzB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YAClC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACpC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -15,6 +15,7 @@ const instructionTargets = [
|
|
|
15
15
|
'AGENTS.md',
|
|
16
16
|
join('.codex', 'concord.md'),
|
|
17
17
|
join('.cursor', 'rules', 'concord.mdc'),
|
|
18
|
+
join('.agents', 'rules', 'concord.md'),
|
|
18
19
|
];
|
|
19
20
|
/** Summarize outdated or unreadable generated Concord instruction blocks. */
|
|
20
21
|
function instructionStatus(repoRoot) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO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AAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,OAAO,EAAE,iEAAiE,CAAC;SAClF,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;QAChE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE;YAChE,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;SACjD,CAAC,CAAC;QACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -9,7 +9,7 @@ export function runHandoffPacket(cwd, taskId) {
|
|
|
9
9
|
}
|
|
10
10
|
const handoff = ctx.repos.handoffs.latestForTask(taskId);
|
|
11
11
|
if (handoff === undefined) {
|
|
12
|
-
return `No handoff recorded for ${taskId}. Ask the agent to call
|
|
12
|
+
return `No handoff recorded for ${taskId}. Ask the agent to call finish_work with outcome: "handoff".`;
|
|
13
13
|
}
|
|
14
14
|
return renderHandoffMarkdown(task, handoff);
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../../src/cli/commands/handoff.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5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AC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,QAAQ,CAAC,UAAU,EAAE,gCAAgC,CAAC;SACtD,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -33,4 +33,29 @@ export interface SessionStartResult {
|
|
|
33
33
|
* SessionStart JSON payload.
|
|
34
34
|
*/
|
|
35
35
|
export declare function handleSessionStart(repos: Repositories, rawJson: string, env?: NodeJS.ProcessEnv): SessionStartResult;
|
|
36
|
+
/** The workspace an Antigravity hook is for: its payload's first workspace path, else cwd. */
|
|
37
|
+
export declare function antigravityWorkspace(rawJson: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Handle Antigravity SessionStart hook: extracts conversationId, registers
|
|
40
|
+
* presence, and returns a persistent system message with the derived agent id.
|
|
41
|
+
*/
|
|
42
|
+
export declare function handleAntigravitySessionStart(repos: Repositories, rawJson: string, workspace?: string): {
|
|
43
|
+
agentId: string | undefined;
|
|
44
|
+
output: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Handle Antigravity PreInvocation hook: extracts conversationId, registers
|
|
48
|
+
* presence, drains pending inbox messages, and injects them as userMessages,
|
|
49
|
+
* asking the agent to start its idle monitor when none is watching.
|
|
50
|
+
*/
|
|
51
|
+
export declare function handleAntigravityPreInvocation(repos: Repositories, rawJson: string, workspace?: string): {
|
|
52
|
+
output: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Handle Antigravity Stop hook: checks if pending inbox messages exist;
|
|
56
|
+
* if so, drains them and tells Antigravity to continue the turn.
|
|
57
|
+
*/
|
|
58
|
+
export declare function handleAntigravityStop(repos: Repositories, rawJson: string): {
|
|
59
|
+
output: string;
|
|
60
|
+
};
|
|
36
61
|
export declare function registerHookCommand(program: Command, telemetry?: TelemetryRecorder): void;
|