@haywoodmarx/agent-pager 0.1.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 +21 -0
- package/README.md +63 -0
- package/dist/src/broker/address.d.ts +49 -0
- package/dist/src/broker/address.js +110 -0
- package/dist/src/broker/broker.d.ts +665 -0
- package/dist/src/broker/broker.js +2270 -0
- package/dist/src/broker/database.d.ts +81 -0
- package/dist/src/broker/database.js +69 -0
- package/dist/src/broker/operator-projection.d.ts +291 -0
- package/dist/src/broker/operator-projection.js +722 -0
- package/dist/src/broker/protocol.d.ts +237 -0
- package/dist/src/broker/protocol.js +311 -0
- package/dist/src/broker/schema.d.ts +94 -0
- package/dist/src/broker/schema.js +454 -0
- package/dist/src/broker/snapshot.d.ts +171 -0
- package/dist/src/broker/snapshot.js +78 -0
- package/dist/src/configuration-defaults.d.ts +64 -0
- package/dist/src/configuration-defaults.js +48 -0
- package/dist/src/configuration.d.ts +76 -0
- package/dist/src/configuration.js +156 -0
- package/dist/src/implementations/claude/environment.d.ts +8 -0
- package/dist/src/implementations/claude/environment.js +9 -0
- package/dist/src/implementations/claude/gateway-cli.d.ts +2 -0
- package/dist/src/implementations/claude/gateway-cli.js +136 -0
- package/dist/src/implementations/claude/gateway-identity.d.ts +134 -0
- package/dist/src/implementations/claude/gateway-identity.js +103 -0
- package/dist/src/implementations/claude/gateway.d.ts +148 -0
- package/dist/src/implementations/claude/gateway.js +236 -0
- package/dist/src/implementations/claude/instructions.d.ts +33 -0
- package/dist/src/implementations/claude/instructions.js +64 -0
- package/dist/src/implementations/claude/manifest.d.ts +33 -0
- package/dist/src/implementations/claude/manifest.js +108 -0
- package/dist/src/implementations/claude/plugin-directory.d.ts +80 -0
- package/dist/src/implementations/claude/plugin-directory.js +137 -0
- package/dist/src/implementations/claude/session-continuation.d.ts +25 -0
- package/dist/src/implementations/claude/session-continuation.js +125 -0
- package/dist/src/implementations/claude/session-identity.d.ts +25 -0
- package/dist/src/implementations/claude/session-identity.js +31 -0
- package/dist/src/implementations/claude/session-start-cli.d.ts +2 -0
- package/dist/src/implementations/claude/session-start-cli.js +16 -0
- package/dist/src/implementations/claude/socket-delivery.d.ts +52 -0
- package/dist/src/implementations/claude/socket-delivery.js +159 -0
- package/dist/src/implementations/model.d.ts +162 -0
- package/dist/src/implementations/model.js +1 -0
- package/dist/src/implementations/opencode/adapter.d.ts +71 -0
- package/dist/src/implementations/opencode/adapter.js +94 -0
- package/dist/src/implementations/opencode/environment.d.ts +8 -0
- package/dist/src/implementations/opencode/environment.js +9 -0
- package/dist/src/implementations/opencode/manifest.d.ts +30 -0
- package/dist/src/implementations/opencode/manifest.js +93 -0
- package/dist/src/implementations/opencode/plugin-api.d.ts +120 -0
- package/dist/src/implementations/opencode/plugin-api.js +1 -0
- package/dist/src/implementations/opencode/plugin.d.ts +38 -0
- package/dist/src/implementations/opencode/plugin.js +303 -0
- package/dist/src/implementations/opencode/self-close-tool.d.ts +9 -0
- package/dist/src/implementations/opencode/self-close-tool.js +31 -0
- package/dist/src/implementations/orca/terminal.d.ts +48 -0
- package/dist/src/implementations/orca/terminal.js +154 -0
- package/dist/src/implementations/pi/broker-client.d.ts +56 -0
- package/dist/src/implementations/pi/broker-client.js +156 -0
- package/dist/src/implementations/pi/environment.d.ts +8 -0
- package/dist/src/implementations/pi/environment.js +9 -0
- package/dist/src/implementations/pi/extension.d.ts +57 -0
- package/dist/src/implementations/pi/extension.js +253 -0
- package/dist/src/implementations/pi/host-slots.d.ts +18 -0
- package/dist/src/implementations/pi/host-slots.js +27 -0
- package/dist/src/implementations/pi/manifest.d.ts +11 -0
- package/dist/src/implementations/pi/manifest.js +61 -0
- package/dist/src/implementations/pi/self-close-tool.d.ts +7 -0
- package/dist/src/implementations/pi/self-close-tool.js +27 -0
- package/dist/src/implementations/registry.d.ts +47 -0
- package/dist/src/implementations/registry.js +157 -0
- package/dist/src/implementations/session-key.d.ts +13 -0
- package/dist/src/implementations/session-key.js +19 -0
- package/dist/src/index.d.ts +27 -0
- package/dist/src/index.js +26 -0
- package/dist/src/launch/broker-lock.d.ts +257 -0
- package/dist/src/launch/broker-lock.js +644 -0
- package/dist/src/launch/cli.d.ts +37 -0
- package/dist/src/launch/cli.js +317 -0
- package/dist/src/launch/environment.d.ts +45 -0
- package/dist/src/launch/environment.js +48 -0
- package/dist/src/launch/launch.d.ts +235 -0
- package/dist/src/launch/launch.js +223 -0
- package/dist/src/launch/on-demand.d.ts +202 -0
- package/dist/src/launch/on-demand.js +435 -0
- package/dist/src/launch/runtime-composition.d.ts +88 -0
- package/dist/src/launch/runtime-composition.js +253 -0
- package/dist/src/launch/runtime.d.ts +79 -0
- package/dist/src/launch/runtime.js +196 -0
- package/dist/src/launch/service-system.d.ts +11 -0
- package/dist/src/launch/service-system.js +39 -0
- package/dist/src/launch/service.d.ts +173 -0
- package/dist/src/launch/service.js +492 -0
- package/dist/src/launch/skill.d.ts +57 -0
- package/dist/src/launch/skill.js +81 -0
- package/dist/src/launch/terminal.d.ts +26 -0
- package/dist/src/launch/terminal.js +43 -0
- package/dist/src/launch/workspace-branch.d.ts +10 -0
- package/dist/src/launch/workspace-branch.js +29 -0
- package/dist/src/messaging/delivery-client.d.ts +144 -0
- package/dist/src/messaging/delivery-client.js +261 -0
- package/dist/src/messaging/delivery.d.ts +75 -0
- package/dist/src/messaging/delivery.js +22 -0
- package/dist/src/messaging/inbox-socket.d.ts +98 -0
- package/dist/src/messaging/inbox-socket.js +278 -0
- package/dist/src/messaging/mcp.d.ts +53 -0
- package/dist/src/messaging/mcp.js +501 -0
- package/dist/src/messaging/notifications.d.ts +231 -0
- package/dist/src/messaging/notifications.js +489 -0
- package/dist/src/messaging/push-delivery.d.ts +77 -0
- package/dist/src/messaging/push-delivery.js +187 -0
- package/dist/src/messaging/tools.d.ts +11 -0
- package/dist/src/messaging/tools.js +102 -0
- package/dist/src/messaging/wake.d.ts +23 -0
- package/dist/src/messaging/wake.js +39 -0
- package/dist/src/operator/agent-projection.d.ts +102 -0
- package/dist/src/operator/agent-projection.js +249 -0
- package/dist/src/operator/commands.d.ts +50 -0
- package/dist/src/operator/commands.js +199 -0
- package/dist/src/operator/diagnostics.d.ts +21 -0
- package/dist/src/operator/diagnostics.js +22 -0
- package/dist/src/operator/protocol.d.ts +511 -0
- package/dist/src/operator/protocol.js +49 -0
- package/dist/src/operator/repository-system.d.ts +14 -0
- package/dist/src/operator/repository-system.js +150 -0
- package/dist/src/operator/repository.d.ts +79 -0
- package/dist/src/operator/repository.js +72 -0
- package/dist/src/operator/traffic-projection.d.ts +19 -0
- package/dist/src/operator/traffic-projection.js +229 -0
- package/dist/src/operator/transport.d.ts +87 -0
- package/dist/src/operator/transport.js +549 -0
- package/dist/src/operator/update-store.d.ts +53 -0
- package/dist/src/operator/update-store.js +162 -0
- package/dist/src/operator/updates.d.ts +94 -0
- package/dist/src/operator/updates.js +280 -0
- package/dist/src/operator/validation.d.ts +114 -0
- package/dist/src/operator/validation.js +916 -0
- package/dist/src/shared/guards.d.ts +59 -0
- package/dist/src/shared/guards.js +119 -0
- package/dist/src/shared/http.d.ts +30 -0
- package/dist/src/shared/http.js +50 -0
- package/dist/src/shared/row.d.ts +2 -0
- package/dist/src/shared/row.js +1 -0
- package/dist/src/shared/shell.d.ts +6 -0
- package/dist/src/shared/shell.js +8 -0
- package/dist/src/tui/actions.d.ts +166 -0
- package/dist/src/tui/actions.js +253 -0
- package/dist/src/tui/agent-tree.d.ts +125 -0
- package/dist/src/tui/agent-tree.js +663 -0
- package/dist/src/tui/app.d.ts +38 -0
- package/dist/src/tui/app.js +378 -0
- package/dist/src/tui/chrome.d.ts +86 -0
- package/dist/src/tui/chrome.js +85 -0
- package/dist/src/tui/client.d.ts +41 -0
- package/dist/src/tui/client.js +279 -0
- package/dist/src/tui/composition.d.ts +41 -0
- package/dist/src/tui/composition.js +146 -0
- package/dist/src/tui/message-views.d.ts +94 -0
- package/dist/src/tui/message-views.js +515 -0
- package/dist/src/tui/model.d.ts +414 -0
- package/dist/src/tui/model.js +758 -0
- package/dist/src/tui/presentation.d.ts +350 -0
- package/dist/src/tui/presentation.js +541 -0
- package/dist/src/tui/production.d.ts +79 -0
- package/dist/src/tui/production.js +253 -0
- package/dist/src/tui/run-terminal.d.ts +32 -0
- package/dist/src/tui/run-terminal.js +54 -0
- package/dist/src/tui/runtime.d.ts +113 -0
- package/dist/src/tui/runtime.js +189 -0
- package/dist/src/tui/theme.d.ts +49 -0
- package/dist/src/tui/theme.js +55 -0
- package/dist/src/tui/transport.d.ts +31 -0
- package/dist/src/tui/transport.js +255 -0
- package/dist/src/version.d.ts +11 -0
- package/dist/src/version.js +52 -0
- package/package.json +142 -0
- package/skills/pager/SKILL.md +112 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type DeliveryAddress, type DeliveryReach } from "../../messaging/delivery.js";
|
|
2
|
+
import type { HostWake, KnownValue } from "../model.js";
|
|
3
|
+
/** Names this integration as the sender Claude Code shows on every delivered message. */
|
|
4
|
+
export declare const CLAUDE_INBOX_SENDER = "pager";
|
|
5
|
+
/**
|
|
6
|
+
* Bounds one connection to the inbox socket. Claude Code closes a connection that has not sent a
|
|
7
|
+
* complete line within its own deadline, so a connection that cannot finish well inside that is
|
|
8
|
+
* reported as undelivered rather than left to be dropped silently.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CLAUDE_INBOX_WRITE_TIMEOUT_MS = 10000;
|
|
11
|
+
/**
|
|
12
|
+
* Writes complete lines to one inbox socket and resolves once the host has taken them.
|
|
13
|
+
*
|
|
14
|
+
* Injected so the provider's own test observes the exact lines written, and the real connection is
|
|
15
|
+
* tested on its own against a listening Unix socket.
|
|
16
|
+
*/
|
|
17
|
+
export type ClaudeInboxWriter = (socketPath: string, lines: readonly string[]) => Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Read the inbox address Claude Code exported to this process, for the gateway to register.
|
|
20
|
+
* @param environment - Environment Claude Code exported to its stdio child.
|
|
21
|
+
* @returns - Opaque address text for the broker to hold, or not known when either part is absent.
|
|
22
|
+
*/
|
|
23
|
+
export declare function claudeDeliveryAddress(environment: Readonly<NodeJS.ProcessEnv>): KnownValue<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Accept an address a Claude session registered, refusing anything not shaped like an inbox socket.
|
|
26
|
+
*
|
|
27
|
+
* The socket path must be absolute and end in `.sock`, which is the only shape Claude Code binds,
|
|
28
|
+
* so a value that is not one cannot be an inbox and is not worth connecting to.
|
|
29
|
+
* @param raw - Untrusted address text exactly as the session supplied it.
|
|
30
|
+
* @returns - The branded address when it is well formed, otherwise not known.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseClaudeDeliveryAddress(raw: string): KnownValue<DeliveryAddress>;
|
|
33
|
+
/**
|
|
34
|
+
* Write one wake into a Claude session's inbox and report how far it reached.
|
|
35
|
+
*
|
|
36
|
+
* The first line authenticates as the session's own child, which is what lets a session that
|
|
37
|
+
* bypasses permission prompts deliver the message without holding it for approval. The second
|
|
38
|
+
* carries the wake as a user message.
|
|
39
|
+
* @param write - Connection to the inbox socket.
|
|
40
|
+
* @param address - Address this provider accepted for the recipient's session.
|
|
41
|
+
* @param wake - Claims to hand over, or a body-free operator ping.
|
|
42
|
+
* @returns - Claimed for a claim-carrying wake, notified for a ping, or undelivered with the cause.
|
|
43
|
+
*/
|
|
44
|
+
export declare function deliverToClaudeInbox(write: ClaudeInboxWriter, address: DeliveryAddress, wake: HostWake): Promise<DeliveryReach>;
|
|
45
|
+
/**
|
|
46
|
+
* Connect to an inbox socket, write every line, then end the connection.
|
|
47
|
+
* @param socketPath - Unix domain socket bound by the Claude session.
|
|
48
|
+
* @param lines - Complete lines to write, without trailing newlines.
|
|
49
|
+
* @returns - Resolves once the final write has flushed; rejects on a socket error or when the socket
|
|
50
|
+
* sits idle past `CLAUDE_INBOX_WRITE_TIMEOUT_MS`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function writeClaudeInboxLines(socketPath: string, lines: readonly string[]): Promise<void>;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { connect } from "node:net";
|
|
2
|
+
import { isAbsolute } from "node:path";
|
|
3
|
+
import { publicEpoch } from "../../broker/snapshot.js";
|
|
4
|
+
import { claimsWakeContent, } from "../../messaging/delivery.js";
|
|
5
|
+
import { wakeLine } from "../../messaging/wake.js";
|
|
6
|
+
import { CLAUDE_INBOX_SOCKET_ENVIRONMENT, CLAUDE_INBOX_TOKEN_ENVIRONMENT } from "./environment.js";
|
|
7
|
+
/** Names this integration as the sender Claude Code shows on every delivered message. */
|
|
8
|
+
export const CLAUDE_INBOX_SENDER = "pager";
|
|
9
|
+
/**
|
|
10
|
+
* Bounds one connection to the inbox socket. Claude Code closes a connection that has not sent a
|
|
11
|
+
* complete line within its own deadline, so a connection that cannot finish well inside that is
|
|
12
|
+
* reported as undelivered rather than left to be dropped silently.
|
|
13
|
+
*/
|
|
14
|
+
export const CLAUDE_INBOX_WRITE_TIMEOUT_MS = 10_000;
|
|
15
|
+
/** Names the envelope element Claude Code parses as a message from another session. */
|
|
16
|
+
const CROSS_SESSION_MESSAGE_TAG = "cross-session-message";
|
|
17
|
+
/**
|
|
18
|
+
* Accepts a peer address the envelope can carry verbatim.
|
|
19
|
+
*
|
|
20
|
+
* Narrower than what the host tolerates: it strips some characters and truncates a long name, and
|
|
21
|
+
* an attribute altered that way fails the host's own round-trip check and renders the delivery in
|
|
22
|
+
* full instead.
|
|
23
|
+
*/
|
|
24
|
+
const NAMEABLE_PEER = /^[A-Za-z0-9._:@/-]{1,64}$/u;
|
|
25
|
+
/**
|
|
26
|
+
* Read the inbox address Claude Code exported to this process, for the gateway to register.
|
|
27
|
+
* @param environment - Environment Claude Code exported to its stdio child.
|
|
28
|
+
* @returns - Opaque address text for the broker to hold, or not known when either part is absent.
|
|
29
|
+
*/
|
|
30
|
+
export function claudeDeliveryAddress(environment) {
|
|
31
|
+
const socketPath = environment[CLAUDE_INBOX_SOCKET_ENVIRONMENT];
|
|
32
|
+
const token = environment[CLAUDE_INBOX_TOKEN_ENVIRONMENT];
|
|
33
|
+
if (!socketPath || !token)
|
|
34
|
+
return { known: false };
|
|
35
|
+
const address = { socketPath, token };
|
|
36
|
+
return { known: true, value: JSON.stringify(address) };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Accept an address a Claude session registered, refusing anything not shaped like an inbox socket.
|
|
40
|
+
*
|
|
41
|
+
* The socket path must be absolute and end in `.sock`, which is the only shape Claude Code binds,
|
|
42
|
+
* so a value that is not one cannot be an inbox and is not worth connecting to.
|
|
43
|
+
* @param raw - Untrusted address text exactly as the session supplied it.
|
|
44
|
+
* @returns - The branded address when it is well formed, otherwise not known.
|
|
45
|
+
*/
|
|
46
|
+
export function parseClaudeDeliveryAddress(raw) {
|
|
47
|
+
const address = decodeAddress(raw);
|
|
48
|
+
if (!address)
|
|
49
|
+
return { known: false };
|
|
50
|
+
return { known: true, value: raw };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Write one wake into a Claude session's inbox and report how far it reached.
|
|
54
|
+
*
|
|
55
|
+
* The first line authenticates as the session's own child, which is what lets a session that
|
|
56
|
+
* bypasses permission prompts deliver the message without holding it for approval. The second
|
|
57
|
+
* carries the wake as a user message.
|
|
58
|
+
* @param write - Connection to the inbox socket.
|
|
59
|
+
* @param address - Address this provider accepted for the recipient's session.
|
|
60
|
+
* @param wake - Claims to hand over, or a body-free operator ping.
|
|
61
|
+
* @returns - Claimed for a claim-carrying wake, notified for a ping, or undelivered with the cause.
|
|
62
|
+
*/
|
|
63
|
+
export async function deliverToClaudeInbox(write, address, wake) {
|
|
64
|
+
const decoded = decodeAddress(address);
|
|
65
|
+
if (!decoded)
|
|
66
|
+
return { reach: "undelivered", cause: "delivery address is malformed" };
|
|
67
|
+
const content = wake.type === "claims_delivered"
|
|
68
|
+
? crossSessionMessage(claimsWakeContent(wake), peerName(wake.claims))
|
|
69
|
+
: wakeLine(wake, publicEpoch(wake.epoch));
|
|
70
|
+
const lines = [
|
|
71
|
+
JSON.stringify({ type: "auth", token: decoded.token }),
|
|
72
|
+
JSON.stringify({
|
|
73
|
+
type: "user",
|
|
74
|
+
message: { role: "user", content },
|
|
75
|
+
from: CLAUDE_INBOX_SENDER,
|
|
76
|
+
}),
|
|
77
|
+
];
|
|
78
|
+
try {
|
|
79
|
+
await write(decoded.socketPath, lines);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return { reach: "undelivered", cause: error instanceof Error ? error.message : String(error) };
|
|
83
|
+
}
|
|
84
|
+
return wake.type === "claims_delivered" ? { reach: "claimed" } : { reach: "notified" };
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Connect to an inbox socket, write every line, then end the connection.
|
|
88
|
+
* @param socketPath - Unix domain socket bound by the Claude session.
|
|
89
|
+
* @param lines - Complete lines to write, without trailing newlines.
|
|
90
|
+
* @returns - Resolves once the final write has flushed; rejects on a socket error or when the socket
|
|
91
|
+
* sits idle past `CLAUDE_INBOX_WRITE_TIMEOUT_MS`.
|
|
92
|
+
*/
|
|
93
|
+
export function writeClaudeInboxLines(socketPath, lines) {
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
95
|
+
const socket = connect({ path: socketPath });
|
|
96
|
+
let settled = false;
|
|
97
|
+
const settle = (error) => {
|
|
98
|
+
if (settled)
|
|
99
|
+
return;
|
|
100
|
+
settled = true;
|
|
101
|
+
socket.destroy();
|
|
102
|
+
if (error)
|
|
103
|
+
reject(error);
|
|
104
|
+
else
|
|
105
|
+
resolve();
|
|
106
|
+
};
|
|
107
|
+
socket.setTimeout(CLAUDE_INBOX_WRITE_TIMEOUT_MS, () => {
|
|
108
|
+
settle(new Error(`inbox socket write timed out after ${String(CLAUDE_INBOX_WRITE_TIMEOUT_MS)} ms`));
|
|
109
|
+
});
|
|
110
|
+
socket.once("error", (error) => {
|
|
111
|
+
settle(error);
|
|
112
|
+
});
|
|
113
|
+
socket.once("connect", () => {
|
|
114
|
+
socket.end(`${lines.join("\n")}\n`, () => {
|
|
115
|
+
settle();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Wrap delivered text in the envelope Claude Code recognises as a message from another session.
|
|
122
|
+
*
|
|
123
|
+
* A session collapses a recognised envelope to a single line the reader can expand, which is the
|
|
124
|
+
* only reason to emit one; unrecognised text renders in full. The host re-serialises what it parses
|
|
125
|
+
* and rejects anything that does not match byte for byte, so the attribute is emitted only when it
|
|
126
|
+
* survives that comparison unchanged, and the body must sit on its own lines.
|
|
127
|
+
* @param body - Text to carry, rendered by the shared claim renderer.
|
|
128
|
+
* @param name - Sender to label the collapsed line with, or nothing when no single sender owns it.
|
|
129
|
+
* @returns - Envelope text for the host, wrapping the body unaltered.
|
|
130
|
+
*/
|
|
131
|
+
function crossSessionMessage(body, name) {
|
|
132
|
+
const attribute = name === undefined ? "" : ` from-name="${name}"`;
|
|
133
|
+
return `<${CROSS_SESSION_MESSAGE_TAG}${attribute}>\n${body}\n</${CROSS_SESSION_MESSAGE_TAG}>`;
|
|
134
|
+
}
|
|
135
|
+
function peerName(claims) {
|
|
136
|
+
const [first] = claims;
|
|
137
|
+
if (!first || claims.some((claim) => claim.fromAddress !== first.fromAddress))
|
|
138
|
+
return undefined;
|
|
139
|
+
return NAMEABLE_PEER.test(first.fromAddress) ? first.fromAddress : undefined;
|
|
140
|
+
}
|
|
141
|
+
function decodeAddress(raw) {
|
|
142
|
+
let decoded;
|
|
143
|
+
try {
|
|
144
|
+
decoded = JSON.parse(raw);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
if (typeof decoded !== "object" || decoded === null || Array.isArray(decoded))
|
|
150
|
+
return undefined;
|
|
151
|
+
const { socketPath, token } = decoded;
|
|
152
|
+
if (typeof socketPath !== "string" || !isAbsolute(socketPath) || !socketPath.endsWith(".sock"))
|
|
153
|
+
return undefined;
|
|
154
|
+
if (typeof token !== "string" || token.length === 0)
|
|
155
|
+
return undefined;
|
|
156
|
+
if (Object.keys(decoded).length !== 2)
|
|
157
|
+
return undefined;
|
|
158
|
+
return { socketPath, token };
|
|
159
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { AgentId } from "../broker/protocol.js";
|
|
2
|
+
import type { ClaimsDelivered, DeliveryAddress, DeliveryReach } from "../messaging/delivery.js";
|
|
3
|
+
import type { OperatorPingChanged } from "../messaging/notifications.js";
|
|
4
|
+
/** Brands an open implementation identifier after boundary validation. */
|
|
5
|
+
declare const implementationIdBrand: unique symbol;
|
|
6
|
+
/** Identifies an agent implementation without enumerating installed providers. */
|
|
7
|
+
export type ImplementationId = string & {
|
|
8
|
+
readonly [implementationIdBrand]: true;
|
|
9
|
+
};
|
|
10
|
+
/** Reports whether a value is known at the current boundary. */
|
|
11
|
+
export type KnownValue<T> = {
|
|
12
|
+
known: true; /** Supplies the value. */
|
|
13
|
+
value: T;
|
|
14
|
+
} | {
|
|
15
|
+
known: false;
|
|
16
|
+
};
|
|
17
|
+
/** Names a capability an implementation may advertise. */
|
|
18
|
+
export type ImplementationCapabilityName = "launch" | "notification" | "session-identity" | "host-registration";
|
|
19
|
+
/** Describes public implementation metadata and declared capabilities. */
|
|
20
|
+
export type ImplementationDescriptor = {
|
|
21
|
+
/** Identifies the implementation with an open validated value. */
|
|
22
|
+
id: ImplementationId;
|
|
23
|
+
/** Supplies a human-readable label owned by the implementation. */
|
|
24
|
+
displayName: string;
|
|
25
|
+
/** Reports the installed implementation version when known. */
|
|
26
|
+
version: KnownValue<string>;
|
|
27
|
+
/** Lists the capabilities implemented by this provider. */
|
|
28
|
+
capabilities: readonly ImplementationCapabilityName[];
|
|
29
|
+
};
|
|
30
|
+
/** Supplies neutral values from which an implementation builds a launch plan. */
|
|
31
|
+
export type ImplementationLaunchRequest = {
|
|
32
|
+
/** Identifies the reserved broker agent. */
|
|
33
|
+
agentId: AgentId;
|
|
34
|
+
/** Supplies the shared broker endpoint. */
|
|
35
|
+
brokerUrl: string;
|
|
36
|
+
/** Supplies the launch attachment reservation environment value. */
|
|
37
|
+
reservation: string;
|
|
38
|
+
/** Supplies the delivery attachment reservation environment value. */
|
|
39
|
+
deliveryReservation: string;
|
|
40
|
+
/** Supplies caller arguments forwarded to the implementation. */
|
|
41
|
+
passthroughArgs: readonly string[];
|
|
42
|
+
/** Supplies the workspace in which the process starts. */
|
|
43
|
+
workspacePath: string;
|
|
44
|
+
};
|
|
45
|
+
/** Describes an implementation-owned process invocation consumed by terminal providers. */
|
|
46
|
+
export type ImplementationLaunchPlan = {
|
|
47
|
+
/** Names the executable to start. */
|
|
48
|
+
command: string;
|
|
49
|
+
/** Supplies ordered executable arguments. */
|
|
50
|
+
args: readonly string[];
|
|
51
|
+
/** Supplies non-sensitive implementation-owned environment additions. */
|
|
52
|
+
environment: Readonly<Record<string, string>>;
|
|
53
|
+
/** Supplies process-binding environment values that terminal providers must not expose. */
|
|
54
|
+
sensitiveEnvironment: Readonly<Record<string, string>>;
|
|
55
|
+
/** Supplies the process working directory. */
|
|
56
|
+
workspacePath: string;
|
|
57
|
+
/** Supplies a terminal title. */
|
|
58
|
+
title: string;
|
|
59
|
+
};
|
|
60
|
+
/** Represents a capability the implementation does not provide. */
|
|
61
|
+
export type UnsupportedImplementationCapability = {
|
|
62
|
+
/** Reports that the capability is unavailable. */ supported: false;
|
|
63
|
+
};
|
|
64
|
+
/** Builds implementation-owned launch plans. */
|
|
65
|
+
export type LaunchImplementationCapability = UnsupportedImplementationCapability | {
|
|
66
|
+
/** Reports that process launch is available. */
|
|
67
|
+
supported: true;
|
|
68
|
+
/** Builds one process plan from neutral launch inputs. */
|
|
69
|
+
buildPlan(request: ImplementationLaunchRequest): Promise<ImplementationLaunchPlan>;
|
|
70
|
+
};
|
|
71
|
+
/** A wake the broker pushes to a host: claims for its messages, or a body-free operator ping. */
|
|
72
|
+
export type HostWake = ClaimsDelivered | OperatorPingChanged;
|
|
73
|
+
/**
|
|
74
|
+
* Describes how an implementation's sessions learn their inbox changed.
|
|
75
|
+
*
|
|
76
|
+
* A supported implementation receives its claims inside the wake: the broker claims on the
|
|
77
|
+
* session's behalf when it writes to the address the session registered.
|
|
78
|
+
*/
|
|
79
|
+
export type NotificationImplementationCapability = UnsupportedImplementationCapability | HostPushNotificationCapability;
|
|
80
|
+
/** Notification capability of an implementation whose sessions accept claims the broker pushes. */
|
|
81
|
+
export type HostPushNotificationCapability = {
|
|
82
|
+
/** Reports that the broker delivers wakes to an address the session registers. */
|
|
83
|
+
supported: true;
|
|
84
|
+
/** Reports that the implementation accepts claims pushed into its host session. */
|
|
85
|
+
mode: "host-push";
|
|
86
|
+
/**
|
|
87
|
+
* Accept or reject an address a session registered, before the broker holds it.
|
|
88
|
+
* @param raw - Untrusted address text exactly as the session supplied it.
|
|
89
|
+
* @returns - The branded address when it is well formed, otherwise not known.
|
|
90
|
+
*/
|
|
91
|
+
parseAddress(raw: string): KnownValue<DeliveryAddress>;
|
|
92
|
+
/**
|
|
93
|
+
* Write one wake to a host address and report how far it reached. Never rejects: a transport
|
|
94
|
+
* failure is the undelivered reach, so the caller can release what it claimed.
|
|
95
|
+
* @param address - Address this implementation accepted for the recipient's session.
|
|
96
|
+
* @param wake - Claims to hand over, or a body-free operator ping.
|
|
97
|
+
* @returns - Highest rung of delivery the transport can vouch for.
|
|
98
|
+
*/
|
|
99
|
+
deliver(address: DeliveryAddress, wake: HostWake): Promise<DeliveryReach>;
|
|
100
|
+
};
|
|
101
|
+
/** Reads the value an implementation uses to recognise one of its own conversations. */
|
|
102
|
+
export type SessionIdentityInput = {
|
|
103
|
+
/** Supplies the process environment visible to the implementation's in-process code. */
|
|
104
|
+
environment: Readonly<NodeJS.ProcessEnv>;
|
|
105
|
+
/** Supplies the conversation identity the implementation's own host API reported, when it has one. */
|
|
106
|
+
hostSessionId?: string;
|
|
107
|
+
};
|
|
108
|
+
/** Recognises the harness conversation a process belongs to, across restarts of that process. */
|
|
109
|
+
export type SessionIdentityImplementationCapability = UnsupportedImplementationCapability | {
|
|
110
|
+
/** Reports that resumable session identity is available. */
|
|
111
|
+
supported: true;
|
|
112
|
+
/**
|
|
113
|
+
* Resolve the key that stays the same when this conversation is resumed in a new process, and
|
|
114
|
+
* that differs between two conversations of the same implementation in one workspace. Returning
|
|
115
|
+
* nothing means this process cannot prove which conversation it is, so it must register anew.
|
|
116
|
+
*/
|
|
117
|
+
sessionKey(input: SessionIdentityInput): string | undefined;
|
|
118
|
+
};
|
|
119
|
+
/** Names the child process that registers an implementation with its host. */
|
|
120
|
+
export type HostRegistrationCommand = {
|
|
121
|
+
/** Executable to run. */
|
|
122
|
+
command: string;
|
|
123
|
+
/** Arguments passed to the executable. */
|
|
124
|
+
args: readonly string[];
|
|
125
|
+
/**
|
|
126
|
+
* The same command as an operator would type it.
|
|
127
|
+
*
|
|
128
|
+
* Shown before the child runs, and copied on request. A command needing a shell to sequence its
|
|
129
|
+
* steps is spawned through one, and this is the script that shell is given, without the wrapper.
|
|
130
|
+
*/
|
|
131
|
+
display: string;
|
|
132
|
+
};
|
|
133
|
+
/** Declares whether an implementation can register itself with its host for every session. */
|
|
134
|
+
export type HostRegistrationImplementationCapability = {
|
|
135
|
+
/** Reports that this implementation registers nothing with its host. */
|
|
136
|
+
supported: false;
|
|
137
|
+
} | {
|
|
138
|
+
/** Reports that this implementation can register itself with its host. */
|
|
139
|
+
supported: true;
|
|
140
|
+
/**
|
|
141
|
+
* Name the command that registers this implementation, so sessions nobody launched connect.
|
|
142
|
+
*
|
|
143
|
+
* The command is handed back rather than run, because the host owns its own installation: it
|
|
144
|
+
* decides what to write and where, and it may ask the operator before doing either.
|
|
145
|
+
* @returns - Command to run in a terminal the operator can answer prompts in.
|
|
146
|
+
*/
|
|
147
|
+
registrationCommand(): HostRegistrationCommand;
|
|
148
|
+
};
|
|
149
|
+
/** Defines one implementation behind capability-specific neutral ports. */
|
|
150
|
+
export interface ImplementationProvider {
|
|
151
|
+
/** Describes this implementation without exposing its concrete type. */
|
|
152
|
+
readonly descriptor: ImplementationDescriptor;
|
|
153
|
+
/** Builds process launch plans when supported. */
|
|
154
|
+
readonly launch: LaunchImplementationCapability;
|
|
155
|
+
/** Describes how its sessions learn their inbox changed, when supported. */
|
|
156
|
+
readonly notification: NotificationImplementationCapability;
|
|
157
|
+
/** Recognises its own resumed conversations when supported. */
|
|
158
|
+
readonly sessionIdentity: SessionIdentityImplementationCapability;
|
|
159
|
+
/** Names the command that registers it with its host, when supported. */
|
|
160
|
+
readonly hostRegistration: HostRegistrationImplementationCapability;
|
|
161
|
+
}
|
|
162
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** Name OpenCode gives the acknowledgement tool of the MCP server the plugin registers as `pager`. */
|
|
2
|
+
export declare const OPENCODE_ACK_TOOL = "pager_ack_agent_messages";
|
|
3
|
+
/** Sends one delivery into an OpenCode session as a prompt carrying a system addition. */
|
|
4
|
+
export type OpenCodePrompt = (sessionId: string, system: string, text: string) => Promise<void>;
|
|
5
|
+
/** Describes the session fields needed to select a top-level OpenCode target. */
|
|
6
|
+
export type OpenCodeSessionInfo = {
|
|
7
|
+
/** Identifies the OpenCode session. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Identifies the parent session when this session is a child. */
|
|
10
|
+
parentID?: string;
|
|
11
|
+
/** Reports the session status when supplied by OpenCode. */
|
|
12
|
+
status?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Resolves an OpenCode session by its identifier. */
|
|
15
|
+
export type OpenCodeSessionResolver = (sessionId: string) => Promise<OpenCodeSessionInfo | undefined>;
|
|
16
|
+
/** Defines collaborators and recovery state used by an OpenCode adapter. */
|
|
17
|
+
export type OpenCodeAdapterOptions = {
|
|
18
|
+
/** Sends deliveries to the selected OpenCode session. */
|
|
19
|
+
prompt: OpenCodePrompt;
|
|
20
|
+
/** Resolves sessions to determine whether they are top-level targets. */
|
|
21
|
+
resolveSession: OpenCodeSessionResolver;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Track only top-level OpenCode sessions, selecting the first whose resolution completed.
|
|
25
|
+
* @param resolveSession - Lookup used to distinguish top-level from child sessions.
|
|
26
|
+
* @returns - Session tracking controls whose selection is the first tracked top-level session still present;
|
|
27
|
+
* concurrent `track` calls are ordered by when `resolveSession` settles, not by call order.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createBrokeredOpenCodeTargets(resolveSession: OpenCodeSessionResolver): {
|
|
30
|
+
current: () => string | undefined;
|
|
31
|
+
remove: (sessionId: string) => void;
|
|
32
|
+
track: (sessionId: string) => Promise<void>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Build the system addition every pushed delivery carries, so the session learns how to settle it.
|
|
36
|
+
* @returns - Standing Pager guidance naming the acknowledgement tool as OpenCode exposes it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function opencodeDeliverySystem(): string;
|
|
39
|
+
/** Injects deliveries the broker pushed to the plugin's inbox into the selected OpenCode session. */
|
|
40
|
+
export declare class OpenCodeInboundAdapter {
|
|
41
|
+
#private;
|
|
42
|
+
/**
|
|
43
|
+
* Constructs an OpenCode adapter over its prompt sender and session resolver.
|
|
44
|
+
* @param options - Prompt sender and session resolver; both required.
|
|
45
|
+
*/
|
|
46
|
+
constructor(options: OpenCodeAdapterOptions);
|
|
47
|
+
/**
|
|
48
|
+
* Track an OpenCode session if it is a top-level delivery target.
|
|
49
|
+
* @param sessionId - OpenCode session id to evaluate and, if top-level, track.
|
|
50
|
+
*/
|
|
51
|
+
trackSession(sessionId: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Remove a deleted OpenCode session from delivery target selection.
|
|
54
|
+
* @param sessionId - OpenCode session id to drop from tracking.
|
|
55
|
+
*/
|
|
56
|
+
removeSession(sessionId: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Return the selected top-level OpenCode session id.
|
|
59
|
+
* @returns - First tracked top-level session still present, ordered by when its resolution settled, when one is available.
|
|
60
|
+
*/
|
|
61
|
+
currentSession(): string | undefined;
|
|
62
|
+
/** Refuse every later delivery, so the broker releases what it pushed and offers it again. */
|
|
63
|
+
stop(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Inject one pushed delivery through OpenCode promptAsync, serialized to avoid OpenCode concurrent FIFO loss.
|
|
66
|
+
* @param content - Rendered delivery text, carrying claims or an operator ping.
|
|
67
|
+
* @returns - Resolves once OpenCode accepted the prompt; rejects when no session can take it, which
|
|
68
|
+
* the inbox reports to the broker as a refused delivery.
|
|
69
|
+
*/
|
|
70
|
+
deliver(content: string): Promise<void>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ProtocolError } from "../../broker/protocol.js";
|
|
2
|
+
import { pagerInboxGuidance } from "../../messaging/inbox-socket.js";
|
|
3
|
+
/** Name OpenCode gives the acknowledgement tool of the MCP server the plugin registers as `pager`. */
|
|
4
|
+
export const OPENCODE_ACK_TOOL = "pager_ack_agent_messages";
|
|
5
|
+
/**
|
|
6
|
+
* Track only top-level OpenCode sessions, selecting the first whose resolution completed.
|
|
7
|
+
* @param resolveSession - Lookup used to distinguish top-level from child sessions.
|
|
8
|
+
* @returns - Session tracking controls whose selection is the first tracked top-level session still present;
|
|
9
|
+
* concurrent `track` calls are ordered by when `resolveSession` settles, not by call order.
|
|
10
|
+
*/
|
|
11
|
+
export function createBrokeredOpenCodeTargets(resolveSession) {
|
|
12
|
+
const sessionIds = [];
|
|
13
|
+
return {
|
|
14
|
+
current: () => sessionIds[0],
|
|
15
|
+
remove: (sessionId) => {
|
|
16
|
+
const index = sessionIds.indexOf(sessionId);
|
|
17
|
+
if (index !== -1)
|
|
18
|
+
sessionIds.splice(index, 1);
|
|
19
|
+
},
|
|
20
|
+
track: async (sessionId) => {
|
|
21
|
+
if (sessionIds.includes(sessionId))
|
|
22
|
+
return;
|
|
23
|
+
const session = await resolveSession(sessionId);
|
|
24
|
+
if (session && !session.parentID)
|
|
25
|
+
sessionIds.push(sessionId);
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build the system addition every pushed delivery carries, so the session learns how to settle it.
|
|
31
|
+
* @returns - Standing Pager guidance naming the acknowledgement tool as OpenCode exposes it.
|
|
32
|
+
*/
|
|
33
|
+
export function opencodeDeliverySystem() {
|
|
34
|
+
return ["Pager is active in this session.", ...pagerInboxGuidance(OPENCODE_ACK_TOOL)].join("\n");
|
|
35
|
+
}
|
|
36
|
+
/** Injects deliveries the broker pushed to the plugin's inbox into the selected OpenCode session. */
|
|
37
|
+
export class OpenCodeInboundAdapter {
|
|
38
|
+
#prompt;
|
|
39
|
+
#targets;
|
|
40
|
+
#deliveryChain = Promise.resolve();
|
|
41
|
+
#draining = false;
|
|
42
|
+
/**
|
|
43
|
+
* Constructs an OpenCode adapter over its prompt sender and session resolver.
|
|
44
|
+
* @param options - Prompt sender and session resolver; both required.
|
|
45
|
+
*/
|
|
46
|
+
constructor(options) {
|
|
47
|
+
this.#prompt = options.prompt;
|
|
48
|
+
this.#targets = createBrokeredOpenCodeTargets(options.resolveSession);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Track an OpenCode session if it is a top-level delivery target.
|
|
52
|
+
* @param sessionId - OpenCode session id to evaluate and, if top-level, track.
|
|
53
|
+
*/
|
|
54
|
+
async trackSession(sessionId) {
|
|
55
|
+
await this.#targets.track(sessionId);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Remove a deleted OpenCode session from delivery target selection.
|
|
59
|
+
* @param sessionId - OpenCode session id to drop from tracking.
|
|
60
|
+
*/
|
|
61
|
+
removeSession(sessionId) {
|
|
62
|
+
this.#targets.remove(sessionId);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Return the selected top-level OpenCode session id.
|
|
66
|
+
* @returns - First tracked top-level session still present, ordered by when its resolution settled, when one is available.
|
|
67
|
+
*/
|
|
68
|
+
currentSession() {
|
|
69
|
+
return this.#targets.current();
|
|
70
|
+
}
|
|
71
|
+
/** Refuse every later delivery, so the broker releases what it pushed and offers it again. */
|
|
72
|
+
stop() {
|
|
73
|
+
this.#draining = true;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Inject one pushed delivery through OpenCode promptAsync, serialized to avoid OpenCode concurrent FIFO loss.
|
|
77
|
+
* @param content - Rendered delivery text, carrying claims or an operator ping.
|
|
78
|
+
* @returns - Resolves once OpenCode accepted the prompt; rejects when no session can take it, which
|
|
79
|
+
* the inbox reports to the broker as a refused delivery.
|
|
80
|
+
*/
|
|
81
|
+
async deliver(content) {
|
|
82
|
+
const run = this.#deliveryChain.then(() => this.#deliverNow(content));
|
|
83
|
+
this.#deliveryChain = run.catch(() => { });
|
|
84
|
+
await run;
|
|
85
|
+
}
|
|
86
|
+
async #deliverNow(content) {
|
|
87
|
+
if (this.#draining)
|
|
88
|
+
throw new ProtocolError("conflict", "The OpenCode adapter has stopped");
|
|
89
|
+
const sessionId = this.#targets.current();
|
|
90
|
+
if (!sessionId)
|
|
91
|
+
throw new ProtocolError("conflict", "No top-level OpenCode session is available");
|
|
92
|
+
await this.#prompt(sessionId, opencodeDeliverySystem(), content);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Names the broker endpoint supplied to the launched OpenCode process. */
|
|
2
|
+
export declare const OPENCODE_BROKER_URL_ENVIRONMENT = "PAGER_MCP_URL";
|
|
3
|
+
/** Names the reserved broker identity supplied to the launched OpenCode process. */
|
|
4
|
+
export declare const OPENCODE_AGENT_ID_ENVIRONMENT = "PAGER_AGENT_ID";
|
|
5
|
+
/** Names the single-use messaging attachment consumed by the MCP config's attach header. */
|
|
6
|
+
export declare const OPENCODE_MESSAGING_RESERVATION_ENVIRONMENT = "PAGER_ATTACH_RESERVATION";
|
|
7
|
+
/** Names the single-use delivery attachment supplied to the OpenCode plugin. */
|
|
8
|
+
export declare const OPENCODE_DELIVERY_RESERVATION_ENVIRONMENT = "PAGER_PLUGIN_ATTACH_RESERVATION";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PAGER_AGENT_ID_ENVIRONMENT, PAGER_ATTACH_RESERVATION_ENVIRONMENT, PAGER_MCP_URL_ENVIRONMENT, } from "../../launch/environment.js";
|
|
2
|
+
/** Names the broker endpoint supplied to the launched OpenCode process. */
|
|
3
|
+
export const OPENCODE_BROKER_URL_ENVIRONMENT = PAGER_MCP_URL_ENVIRONMENT;
|
|
4
|
+
/** Names the reserved broker identity supplied to the launched OpenCode process. */
|
|
5
|
+
export const OPENCODE_AGENT_ID_ENVIRONMENT = PAGER_AGENT_ID_ENVIRONMENT;
|
|
6
|
+
/** Names the single-use messaging attachment consumed by the MCP config's attach header. */
|
|
7
|
+
export const OPENCODE_MESSAGING_RESERVATION_ENVIRONMENT = PAGER_ATTACH_RESERVATION_ENVIRONMENT;
|
|
8
|
+
/** Names the single-use delivery attachment supplied to the OpenCode plugin. */
|
|
9
|
+
export const OPENCODE_DELIVERY_RESERVATION_ENVIRONMENT = "PAGER_PLUGIN_ATTACH_RESERVATION";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PagerInboxWriter } from "../../messaging/inbox-socket.js";
|
|
2
|
+
import type { ImplementationProvider } from "../model.js";
|
|
3
|
+
/** Resolves and writes what one OpenCode launch needs beyond its plan. */
|
|
4
|
+
export type OpenCodeLaunchFilesPort = {
|
|
5
|
+
/** Names the Bun executable the launched session pins into its environment. */
|
|
6
|
+
runtimePath(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Write one launch's MCP configuration where the launched process can read it.
|
|
9
|
+
* @param content - Serialised configuration document.
|
|
10
|
+
* @returns - Path of the written file, handed to OpenCode as `OPENCODE_CONFIG`.
|
|
11
|
+
*/
|
|
12
|
+
writeLaunchConfig(content: string): string;
|
|
13
|
+
};
|
|
14
|
+
/** Ports {@link createOpenCodeImplementationProvider} composes its provider from. */
|
|
15
|
+
export type OpenCodeImplementationProviderPorts = {
|
|
16
|
+
/** Injected installed-version reader. */
|
|
17
|
+
readVersion: () => string | null;
|
|
18
|
+
/** Runtime resolution and configuration file each launch plan depends on. */
|
|
19
|
+
launchFiles: OpenCodeLaunchFilesPort;
|
|
20
|
+
/** Connection that writes one delivery into a session's inbox. */
|
|
21
|
+
writeInbox: PagerInboxWriter;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Construct the built-in OpenCode implementation provider.
|
|
25
|
+
* @param ports - Version reader, launch-file, and inbox ports.
|
|
26
|
+
* @returns - Provider owning OpenCode integration behavior.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createOpenCodeImplementationProvider({ readVersion, launchFiles, writeInbox, }: OpenCodeImplementationProviderPorts): ImplementationProvider;
|
|
29
|
+
declare const _default: ImplementationProvider;
|
|
30
|
+
export default _default;
|