condukt 0.3.6 → 0.5.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/dist/bridge/sse.d.ts.map +1 -1
- package/dist/bridge/sse.js +27 -4
- package/dist/bridge/sse.js.map +1 -1
- package/dist/runtimes/copilot/copilot-adapter.d.ts.map +1 -1
- package/dist/runtimes/copilot/copilot-adapter.js +1 -0
- package/dist/runtimes/copilot/copilot-adapter.js.map +1 -1
- package/dist/runtimes/copilot/copilot-backend.d.ts +51 -4
- package/dist/runtimes/copilot/copilot-backend.d.ts.map +1 -1
- package/dist/runtimes/copilot/copilot-backend.js +2 -2
- package/dist/runtimes/copilot/index.d.ts +3 -1
- package/dist/runtimes/copilot/index.d.ts.map +1 -1
- package/dist/runtimes/copilot/index.js +3 -1
- package/dist/runtimes/copilot/index.js.map +1 -1
- package/dist/runtimes/copilot/sdk-backend.d.ts +38 -0
- package/dist/runtimes/copilot/sdk-backend.d.ts.map +1 -0
- package/dist/runtimes/copilot/sdk-backend.js +599 -0
- package/dist/runtimes/copilot/sdk-backend.js.map +1 -0
- package/dist/runtimes/copilot/subprocess-backend.d.ts.map +1 -1
- package/dist/runtimes/copilot/subprocess-backend.js +39 -14
- package/dist/runtimes/copilot/subprocess-backend.js.map +1 -1
- package/dist/runtimes/mock/mock-runtime.d.ts.map +1 -1
- package/dist/runtimes/mock/mock-runtime.js +1 -1
- package/dist/runtimes/mock/mock-runtime.js.map +1 -1
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +122 -4
- package/dist/src/agent.js.map +1 -1
- package/dist/src/events.d.ts +47 -2
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +1 -1
- package/dist/src/types.d.ts +9 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/state/state-runtime.d.ts.map +1 -1
- package/dist/state/state-runtime.js +15 -3
- package/dist/state/state-runtime.js.map +1 -1
- package/dist/ui/core/index.d.ts +2 -0
- package/dist/ui/core/index.d.ts.map +1 -1
- package/dist/ui/core/index.js +5 -1
- package/dist/ui/core/index.js.map +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +5 -1
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/tool-display/ResponsePartRenderer.d.ts +25 -0
- package/dist/ui/tool-display/ResponsePartRenderer.d.ts.map +1 -0
- package/dist/ui/tool-display/ResponsePartRenderer.js +53 -0
- package/dist/ui/tool-display/ResponsePartRenderer.js.map +1 -0
- package/dist/ui/tool-display/StatusLine.d.ts +12 -0
- package/dist/ui/tool-display/StatusLine.d.ts.map +1 -0
- package/dist/ui/tool-display/StatusLine.js +24 -0
- package/dist/ui/tool-display/StatusLine.js.map +1 -0
- package/dist/ui/tool-display/ThinkingSection.d.ts +21 -0
- package/dist/ui/tool-display/ThinkingSection.d.ts.map +1 -0
- package/dist/ui/tool-display/ThinkingSection.js +186 -0
- package/dist/ui/tool-display/ThinkingSection.js.map +1 -0
- package/dist/ui/tool-display/ToolProgressLine.d.ts +18 -0
- package/dist/ui/tool-display/ToolProgressLine.d.ts.map +1 -0
- package/dist/ui/tool-display/ToolProgressLine.js +185 -0
- package/dist/ui/tool-display/ToolProgressLine.js.map +1 -0
- package/dist/ui/tool-display/debug-types.d.ts +90 -0
- package/dist/ui/tool-display/debug-types.d.ts.map +1 -0
- package/dist/ui/tool-display/debug-types.js +9 -0
- package/dist/ui/tool-display/debug-types.js.map +1 -0
- package/dist/ui/tool-display/format-utils.d.ts +68 -0
- package/dist/ui/tool-display/format-utils.d.ts.map +1 -0
- package/dist/ui/tool-display/format-utils.js +182 -0
- package/dist/ui/tool-display/format-utils.js.map +1 -0
- package/dist/ui/tool-display/formatter.d.ts +58 -0
- package/dist/ui/tool-display/formatter.d.ts.map +1 -0
- package/dist/ui/tool-display/formatter.js +430 -0
- package/dist/ui/tool-display/formatter.js.map +1 -0
- package/dist/ui/tool-display/index.d.ts +28 -0
- package/dist/ui/tool-display/index.d.ts.map +1 -0
- package/dist/ui/tool-display/index.js +59 -0
- package/dist/ui/tool-display/index.js.map +1 -0
- package/dist/ui/tool-display/response-parts.d.ts +124 -0
- package/dist/ui/tool-display/response-parts.d.ts.map +1 -0
- package/dist/ui/tool-display/response-parts.js +272 -0
- package/dist/ui/tool-display/response-parts.js.map +1 -0
- package/dist/ui/tool-display/types.d.ts +86 -0
- package/dist/ui/tool-display/types.d.ts.map +1 -0
- package/dist/ui/tool-display/types.js +36 -0
- package/dist/ui/tool-display/types.js.map +1 -0
- package/dist/ui/tool-display/view-logic.d.ts +28 -0
- package/dist/ui/tool-display/view-logic.d.ts.map +1 -0
- package/dist/ui/tool-display/view-logic.js +257 -0
- package/dist/ui/tool-display/view-logic.js.map +1 -0
- package/package.json +143 -133
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SdkBackend — CopilotBackend implementation using @github/copilot-sdk.
|
|
4
|
+
*
|
|
5
|
+
* Drop-in replacement for SubprocessBackend. Uses the SDK's CopilotClient
|
|
6
|
+
* (one CLI process per session via JSON-RPC over stdio) instead of spawning
|
|
7
|
+
* the copilot CLI directly.
|
|
8
|
+
*
|
|
9
|
+
* Event mapping matches SubprocessBackend exactly: the 7 core events
|
|
10
|
+
* (text, tool_start, tool_complete, tool_output, idle, error, reasoning)
|
|
11
|
+
* plus optional rich events (intent, usage, tool_complete_rich,
|
|
12
|
+
* subagent_start, subagent_end, permission).
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.SdkBackend = void 0;
|
|
49
|
+
const cp = __importStar(require("child_process"));
|
|
50
|
+
const fs = __importStar(require("fs"));
|
|
51
|
+
const path = __importStar(require("path"));
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// PATH hardening: shared logic with SubprocessBackend
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
/**
|
|
56
|
+
* Generic tools every agent subprocess needs for basic operation.
|
|
57
|
+
* Domain-specific tools (az, dotnet, etc.) are passed via pathTools option.
|
|
58
|
+
*/
|
|
59
|
+
const GENERIC_PATH_TOOLS = ['cmd', 'pwsh', 'powershell', 'git', 'node', 'npm'];
|
|
60
|
+
/** Known SDK event types handled by typed handlers or silently consumed. */
|
|
61
|
+
const KNOWN_EVENT_TYPES = new Set([
|
|
62
|
+
'assistant.message', 'assistant.message_delta',
|
|
63
|
+
'assistant.reasoning', 'assistant.reasoning_delta',
|
|
64
|
+
'assistant.intent', 'assistant.usage',
|
|
65
|
+
'tool.execution_start', 'tool.execution_complete',
|
|
66
|
+
'tool.execution_partial_result',
|
|
67
|
+
'session.idle', 'session.error',
|
|
68
|
+
'subagent.started', 'subagent.completed', 'subagent.failed',
|
|
69
|
+
'permission.requested', 'permission.completed',
|
|
70
|
+
// Lifecycle events silently consumed (matching SubprocessBackend)
|
|
71
|
+
'session.start', 'session.resume', 'session.shutdown', 'session.task_complete',
|
|
72
|
+
'session.info', 'session.warning', 'session.title_changed',
|
|
73
|
+
'session.context_changed', 'session.usage_info', 'session.model_change',
|
|
74
|
+
'session.compaction_start', 'session.compaction_complete',
|
|
75
|
+
'session.mode_changed', 'session.plan_changed',
|
|
76
|
+
'session.truncation', 'session.snapshot_rewind',
|
|
77
|
+
'session.workspace_file_changed', 'session.handoff',
|
|
78
|
+
'user.message', 'pending_messages.modified', 'system.message',
|
|
79
|
+
'assistant.turn_start', 'assistant.turn_end', 'assistant.streaming_delta',
|
|
80
|
+
'abort', 'skill.invoked',
|
|
81
|
+
'subagent.selected', 'subagent.deselected',
|
|
82
|
+
'user_input.requested', 'user_input.completed',
|
|
83
|
+
'elicitation.requested', 'elicitation.completed',
|
|
84
|
+
'external_tool.requested', 'external_tool.completed',
|
|
85
|
+
'command.queued', 'command.completed',
|
|
86
|
+
'exit_plan_mode.requested', 'exit_plan_mode.completed',
|
|
87
|
+
'tool.user_requested', 'tool.execution_progress',
|
|
88
|
+
]);
|
|
89
|
+
/** Cache for resolved tool directories. */
|
|
90
|
+
let _cachedToolDirs = new Map();
|
|
91
|
+
/**
|
|
92
|
+
* Dynamically resolve directories for tools that agents need on PATH.
|
|
93
|
+
* Uses `where` (Windows) or `which` to find each tool, then extracts
|
|
94
|
+
* the directory. Cached after first call.
|
|
95
|
+
*/
|
|
96
|
+
function resolveToolDirs(tools) {
|
|
97
|
+
const key = tools.join(',');
|
|
98
|
+
if (_cachedToolDirs.has(key))
|
|
99
|
+
return _cachedToolDirs.get(key);
|
|
100
|
+
const locate = process.platform === 'win32' ? 'where' : 'which';
|
|
101
|
+
const dirs = new Set();
|
|
102
|
+
for (const tool of tools) {
|
|
103
|
+
try {
|
|
104
|
+
const result = cp.spawnSync(locate, [tool], { stdio: 'pipe', encoding: 'utf-8', timeout: 3000 });
|
|
105
|
+
if (result.status === 0 && result.stdout) {
|
|
106
|
+
const toolPath = result.stdout.trim().split(/\r?\n/)[0];
|
|
107
|
+
if (toolPath)
|
|
108
|
+
dirs.add(path.dirname(toolPath));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// Tool not installed — skip
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const resolved = [...dirs];
|
|
116
|
+
_cachedToolDirs.set(key, resolved);
|
|
117
|
+
return resolved;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Extract human-readable summary from tool arguments object.
|
|
121
|
+
*/
|
|
122
|
+
function extractArgSummary(args) {
|
|
123
|
+
for (const key of ['description', 'intent', 'summary', 'command', 'query',
|
|
124
|
+
'path', 'pattern', 'glob', 'url', 'file_text']) {
|
|
125
|
+
const val = args[key];
|
|
126
|
+
if (typeof val === 'string' && val.length > 0)
|
|
127
|
+
return val;
|
|
128
|
+
}
|
|
129
|
+
const firstStr = Object.values(args).find(v => typeof v === 'string' && v.length > 0);
|
|
130
|
+
if (typeof firstStr === 'string')
|
|
131
|
+
return firstStr;
|
|
132
|
+
return '';
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Parse .copilot/mcp.json format and convert to SDK-compatible MCPServerConfig.
|
|
136
|
+
* Adds `tools: ["*"]` to each entry to enable all tools.
|
|
137
|
+
*/
|
|
138
|
+
function parseMcpConfig(configPath) {
|
|
139
|
+
try {
|
|
140
|
+
if (!fs.existsSync(configPath))
|
|
141
|
+
return null;
|
|
142
|
+
const raw = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
143
|
+
const servers = (raw.mcpServers ?? raw.servers ?? raw);
|
|
144
|
+
if (!servers || typeof servers !== 'object')
|
|
145
|
+
return null;
|
|
146
|
+
const result = {};
|
|
147
|
+
for (const [name, config] of Object.entries(servers)) {
|
|
148
|
+
if (!config || typeof config !== 'object')
|
|
149
|
+
continue;
|
|
150
|
+
const entry = config;
|
|
151
|
+
result[name] = {
|
|
152
|
+
...entry,
|
|
153
|
+
type: entry.type === 'stdio' ? 'local' : (entry.type ?? 'local'),
|
|
154
|
+
tools: ['*'],
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return Object.keys(result).length > 0 ? result : null;
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
process.stderr.write(`[SdkBackend] Failed to parse MCP config at ${configPath}: ${err}\n`);
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
// SdkBackend
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
/**
|
|
168
|
+
* CopilotBackend implementation using @github/copilot-sdk.
|
|
169
|
+
*
|
|
170
|
+
* Drop-in replacement for SubprocessBackend. Uses the SDK's CopilotClient
|
|
171
|
+
* (one CLI process per session via JSON-RPC over stdio) instead of spawning
|
|
172
|
+
* the copilot CLI directly.
|
|
173
|
+
*/
|
|
174
|
+
class SdkBackend {
|
|
175
|
+
name = 'sdk';
|
|
176
|
+
mcpConfigPath;
|
|
177
|
+
extraPathDirs;
|
|
178
|
+
pathTools;
|
|
179
|
+
constructor(options = {}) {
|
|
180
|
+
this.mcpConfigPath = options.mcpConfigPath;
|
|
181
|
+
this.extraPathDirs = options.extraPathDirs ?? [];
|
|
182
|
+
this.pathTools = options.pathTools ?? [];
|
|
183
|
+
}
|
|
184
|
+
async isAvailable() {
|
|
185
|
+
try {
|
|
186
|
+
const sdkModuleName = '@github/copilot-sdk';
|
|
187
|
+
await Promise.resolve(`${sdkModuleName}`).then(s => __importStar(require(s)));
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async createSession(config) {
|
|
195
|
+
return new SdkSession(config, this.mcpConfigPath, this.extraPathDirs, this.pathTools);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
exports.SdkBackend = SdkBackend;
|
|
199
|
+
// ---------------------------------------------------------------------------
|
|
200
|
+
// SdkSession
|
|
201
|
+
// ---------------------------------------------------------------------------
|
|
202
|
+
/**
|
|
203
|
+
* CopilotSession implementation backed by @github/copilot-sdk CopilotClient.
|
|
204
|
+
*
|
|
205
|
+
* Lifecycle:
|
|
206
|
+
* 1. Constructor stores config (no I/O)
|
|
207
|
+
* 2. send() imports the SDK, creates a CopilotClient, creates an SDK session,
|
|
208
|
+
* wires all event handlers, then sends the prompt
|
|
209
|
+
* 3. session.idle -> emit('idle'), cleanup
|
|
210
|
+
* 4. abort() -> emit('error') -> set aborted -> SDK abort -> client.stop()
|
|
211
|
+
*/
|
|
212
|
+
class SdkSession {
|
|
213
|
+
_client = null;
|
|
214
|
+
_sdkSession = null;
|
|
215
|
+
handlers = [];
|
|
216
|
+
config;
|
|
217
|
+
mcpConfigPath;
|
|
218
|
+
extraPathDirs;
|
|
219
|
+
pathTools;
|
|
220
|
+
timeoutTimer = null;
|
|
221
|
+
heartbeatTimer = null;
|
|
222
|
+
aborted = false;
|
|
223
|
+
/**
|
|
224
|
+
* Maps toolCallId -> toolName for attributing tool_complete events.
|
|
225
|
+
* Populated from assistant.message toolRequests and tool.execution_start.
|
|
226
|
+
*/
|
|
227
|
+
_toolCallNames = new Map();
|
|
228
|
+
/**
|
|
229
|
+
* Buffers partial results that arrive before their tool.execution_start.
|
|
230
|
+
*/
|
|
231
|
+
_pendingPartials = new Map();
|
|
232
|
+
get pid() {
|
|
233
|
+
// SDK manages the CLI process internally; no direct PID access
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
constructor(config, mcpConfigPath, extraPathDirs, pathTools) {
|
|
237
|
+
this.config = config;
|
|
238
|
+
this.mcpConfigPath = mcpConfigPath;
|
|
239
|
+
this.extraPathDirs = extraPathDirs;
|
|
240
|
+
this.pathTools = pathTools;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Send a prompt to the agent. Creates the SDK client and session on first call.
|
|
244
|
+
* Matches SubprocessBackend.send() contract: fire-and-forget, events stream via on().
|
|
245
|
+
*/
|
|
246
|
+
send(prompt) {
|
|
247
|
+
this._run(prompt).catch((err) => {
|
|
248
|
+
if (!this.aborted) {
|
|
249
|
+
this.emitError(err instanceof Error ? err : new Error(String(err)));
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Internal async entrypoint that creates the client, session, wires events,
|
|
255
|
+
* sends the prompt, and handles lifecycle.
|
|
256
|
+
*/
|
|
257
|
+
async _run(prompt) {
|
|
258
|
+
// Dynamic import: @github/copilot-sdk is ESM-only.
|
|
259
|
+
// Use string indirection to avoid TS2307 when the SDK is not installed
|
|
260
|
+
// (it's an optional peer dependency).
|
|
261
|
+
const sdkModuleName = '@github/copilot-sdk';
|
|
262
|
+
const { CopilotClient, approveAll } = await Promise.resolve(`${sdkModuleName}`).then(s => __importStar(require(s)));
|
|
263
|
+
// ---------------------------------------------------------------
|
|
264
|
+
// Build hardened environment (strip NODE_OPTIONS, extend PATH)
|
|
265
|
+
// ---------------------------------------------------------------
|
|
266
|
+
const env = { ...process.env };
|
|
267
|
+
delete env.NODE_OPTIONS;
|
|
268
|
+
const pathSep = process.platform === 'win32' ? ';' : ':';
|
|
269
|
+
const extraPaths = [...this.extraPathDirs];
|
|
270
|
+
for (const dir of resolveToolDirs([...GENERIC_PATH_TOOLS, ...this.pathTools])) {
|
|
271
|
+
if (!env.PATH?.includes(dir))
|
|
272
|
+
extraPaths.push(dir);
|
|
273
|
+
}
|
|
274
|
+
env.PATH = `${env.PATH ?? ''}${pathSep}${extraPaths.join(pathSep)}`;
|
|
275
|
+
// ---------------------------------------------------------------
|
|
276
|
+
// Parse MCP config
|
|
277
|
+
// ---------------------------------------------------------------
|
|
278
|
+
const mcpServers = this.mcpConfigPath
|
|
279
|
+
? parseMcpConfig(this.mcpConfigPath)
|
|
280
|
+
: null;
|
|
281
|
+
// ---------------------------------------------------------------
|
|
282
|
+
// Create CopilotClient (process-per-session: new client each time)
|
|
283
|
+
// autoRestart: false — if CLI dies, emit error immediately
|
|
284
|
+
// ---------------------------------------------------------------
|
|
285
|
+
const client = new CopilotClient({
|
|
286
|
+
useStdio: true,
|
|
287
|
+
autoRestart: false,
|
|
288
|
+
env,
|
|
289
|
+
logLevel: 'warning',
|
|
290
|
+
});
|
|
291
|
+
this._client = client;
|
|
292
|
+
// ---------------------------------------------------------------
|
|
293
|
+
// Create SDK session
|
|
294
|
+
// ---------------------------------------------------------------
|
|
295
|
+
const sessionConfig = {
|
|
296
|
+
model: this.config.model,
|
|
297
|
+
streaming: true,
|
|
298
|
+
onPermissionRequest: approveAll,
|
|
299
|
+
workingDirectory: this.config.cwd,
|
|
300
|
+
reasoningEffort: this.config.thinkingBudget,
|
|
301
|
+
};
|
|
302
|
+
if (mcpServers) {
|
|
303
|
+
sessionConfig.mcpServers = mcpServers;
|
|
304
|
+
}
|
|
305
|
+
const sdkSession = await client.createSession(sessionConfig);
|
|
306
|
+
this._sdkSession = sdkSession;
|
|
307
|
+
// ---------------------------------------------------------------
|
|
308
|
+
// Set up hard timeout
|
|
309
|
+
// ---------------------------------------------------------------
|
|
310
|
+
this.timeoutTimer = setTimeout(() => {
|
|
311
|
+
this.emitError(new Error(`Session timed out after ${this.config.timeout}s`));
|
|
312
|
+
this.abort();
|
|
313
|
+
}, this.config.timeout * 1000);
|
|
314
|
+
// Set up heartbeat timeout
|
|
315
|
+
this.resetHeartbeat();
|
|
316
|
+
// ---------------------------------------------------------------
|
|
317
|
+
// Wire SDK events -> CopilotSession events
|
|
318
|
+
// ---------------------------------------------------------------
|
|
319
|
+
this._wireEvents(sdkSession);
|
|
320
|
+
// ---------------------------------------------------------------
|
|
321
|
+
// Send the prompt (fire-and-forget; events stream via handlers)
|
|
322
|
+
// ---------------------------------------------------------------
|
|
323
|
+
await sdkSession.send({ prompt });
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Wire all SDK session events to CopilotSession event emissions.
|
|
327
|
+
*/
|
|
328
|
+
_wireEvents(sdkSession) {
|
|
329
|
+
// --- Assistant text response ---
|
|
330
|
+
sdkSession.on('assistant.message', (e) => {
|
|
331
|
+
if (this.aborted)
|
|
332
|
+
return;
|
|
333
|
+
this.resetHeartbeat();
|
|
334
|
+
const data = e.data;
|
|
335
|
+
const content = typeof data?.content === 'string' ? data.content : '';
|
|
336
|
+
if (content)
|
|
337
|
+
this.emit('text', content);
|
|
338
|
+
// Pre-seed _toolCallNames from tool requests so tool.execution_complete
|
|
339
|
+
// can resolve names even if tool.execution_start lacks a toolCallId.
|
|
340
|
+
const toolRequests = Array.isArray(data?.toolRequests) ? data.toolRequests : [];
|
|
341
|
+
for (const req of toolRequests) {
|
|
342
|
+
const name = String(req.name ?? '');
|
|
343
|
+
const callId = String(req.toolCallId ?? '');
|
|
344
|
+
if (callId && name)
|
|
345
|
+
this._toolCallNames.set(callId, name);
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
// --- Assistant text delta (streaming) ---
|
|
349
|
+
sdkSession.on('assistant.message_delta', (e) => {
|
|
350
|
+
if (this.aborted)
|
|
351
|
+
return;
|
|
352
|
+
this.resetHeartbeat();
|
|
353
|
+
const delta = typeof e.data?.deltaContent === 'string' ? e.data.deltaContent : '';
|
|
354
|
+
if (delta)
|
|
355
|
+
this.emit('text', delta);
|
|
356
|
+
});
|
|
357
|
+
// --- Reasoning ---
|
|
358
|
+
sdkSession.on('assistant.reasoning', (e) => {
|
|
359
|
+
if (this.aborted)
|
|
360
|
+
return;
|
|
361
|
+
this.resetHeartbeat();
|
|
362
|
+
const content = typeof e.data?.content === 'string' ? e.data.content : '';
|
|
363
|
+
if (content)
|
|
364
|
+
this.emit('reasoning', content);
|
|
365
|
+
});
|
|
366
|
+
sdkSession.on('assistant.reasoning_delta', (e) => {
|
|
367
|
+
if (this.aborted)
|
|
368
|
+
return;
|
|
369
|
+
this.resetHeartbeat();
|
|
370
|
+
const delta = typeof e.data?.deltaContent === 'string' ? e.data.deltaContent : '';
|
|
371
|
+
if (delta)
|
|
372
|
+
this.emit('reasoning', delta);
|
|
373
|
+
});
|
|
374
|
+
// --- Tool execution start ---
|
|
375
|
+
sdkSession.on('tool.execution_start', (e) => {
|
|
376
|
+
if (this.aborted)
|
|
377
|
+
return;
|
|
378
|
+
this.resetHeartbeat();
|
|
379
|
+
const data = e.data;
|
|
380
|
+
const toolName = String(data?.toolName ?? '');
|
|
381
|
+
const args = data?.arguments;
|
|
382
|
+
const summary = args ? extractArgSummary(args) : '';
|
|
383
|
+
const callId = String(data?.toolCallId ?? '');
|
|
384
|
+
if (callId && toolName) {
|
|
385
|
+
this._toolCallNames.set(callId, toolName);
|
|
386
|
+
// Flush any partials that arrived before this start event
|
|
387
|
+
const buffered = this._pendingPartials.get(callId);
|
|
388
|
+
if (buffered) {
|
|
389
|
+
for (const p of buffered)
|
|
390
|
+
this.emit('tool_output', toolName, p);
|
|
391
|
+
this._pendingPartials.delete(callId);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (toolName)
|
|
395
|
+
this.emit('tool_start', toolName, summary, args ?? {}, callId);
|
|
396
|
+
});
|
|
397
|
+
// --- Tool execution complete ---
|
|
398
|
+
sdkSession.on('tool.execution_complete', (e) => {
|
|
399
|
+
if (this.aborted)
|
|
400
|
+
return;
|
|
401
|
+
this.resetHeartbeat();
|
|
402
|
+
const data = e.data;
|
|
403
|
+
const callId = String(data?.toolCallId ?? '');
|
|
404
|
+
let toolName = '';
|
|
405
|
+
if (typeof data?.toolName === 'string' && data.toolName)
|
|
406
|
+
toolName = data.toolName;
|
|
407
|
+
if (!toolName && callId)
|
|
408
|
+
toolName = this._toolCallNames.get(callId) ?? '';
|
|
409
|
+
this._toolCallNames.delete(callId);
|
|
410
|
+
const result = data?.result;
|
|
411
|
+
const output = typeof result?.content === 'string'
|
|
412
|
+
? result.content
|
|
413
|
+
: typeof result?.detailedContent === 'string'
|
|
414
|
+
? result.detailedContent : '';
|
|
415
|
+
this.emit('tool_complete', toolName, output, callId);
|
|
416
|
+
// Rich event: structured content blocks for consumers that want them
|
|
417
|
+
if (result?.contents && Array.isArray(result.contents)) {
|
|
418
|
+
this.emit('tool_complete_rich', toolName, result.contents, callId);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
// --- Tool execution partial result ---
|
|
422
|
+
sdkSession.on('tool.execution_partial_result', (e) => {
|
|
423
|
+
if (this.aborted)
|
|
424
|
+
return;
|
|
425
|
+
this.resetHeartbeat();
|
|
426
|
+
const data = e.data;
|
|
427
|
+
const partial = typeof data?.partialOutput === 'string' ? data.partialOutput : '';
|
|
428
|
+
if (!partial)
|
|
429
|
+
return;
|
|
430
|
+
const callId = String(data?.toolCallId ?? '');
|
|
431
|
+
const toolName = (callId && this._toolCallNames.get(callId)) || '';
|
|
432
|
+
if (toolName) {
|
|
433
|
+
this.emit('tool_output', toolName, partial);
|
|
434
|
+
}
|
|
435
|
+
else if (callId) {
|
|
436
|
+
const buf = this._pendingPartials.get(callId) ?? [];
|
|
437
|
+
buf.push(partial);
|
|
438
|
+
this._pendingPartials.set(callId, buf);
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
this.emit('text', partial);
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
// --- Session idle (agent finished all work) ---
|
|
445
|
+
sdkSession.on('session.idle', () => {
|
|
446
|
+
if (this.aborted)
|
|
447
|
+
return;
|
|
448
|
+
this.clearTimers();
|
|
449
|
+
this.emit('idle');
|
|
450
|
+
this._cleanup();
|
|
451
|
+
});
|
|
452
|
+
// --- Session error ---
|
|
453
|
+
sdkSession.on('session.error', (e) => {
|
|
454
|
+
if (this.aborted)
|
|
455
|
+
return;
|
|
456
|
+
this.clearTimers();
|
|
457
|
+
const msg = typeof e.data?.message === 'string' ? e.data.message : 'Unknown session error';
|
|
458
|
+
this.emitError(new Error(msg));
|
|
459
|
+
});
|
|
460
|
+
// --- Subagent lifecycle (mapped to tool events for SubprocessBackend parity) ---
|
|
461
|
+
sdkSession.on('subagent.started', (e) => {
|
|
462
|
+
if (this.aborted)
|
|
463
|
+
return;
|
|
464
|
+
this.resetHeartbeat();
|
|
465
|
+
const data = e.data;
|
|
466
|
+
const name = String(data?.agentDisplayName ?? data?.agentName ?? 'agent');
|
|
467
|
+
this.emit('tool_start', `subagent:${name}`, '', {});
|
|
468
|
+
this.emit('subagent_start', name, data ?? {});
|
|
469
|
+
});
|
|
470
|
+
sdkSession.on('subagent.completed', (e) => {
|
|
471
|
+
if (this.aborted)
|
|
472
|
+
return;
|
|
473
|
+
this.resetHeartbeat();
|
|
474
|
+
const data = e.data;
|
|
475
|
+
const name = String(data?.agentDisplayName ?? data?.agentName ?? 'agent');
|
|
476
|
+
this.emit('tool_complete', `subagent:${name}`, '');
|
|
477
|
+
this.emit('subagent_end', name, data ?? {});
|
|
478
|
+
});
|
|
479
|
+
sdkSession.on('subagent.failed', (e) => {
|
|
480
|
+
if (this.aborted)
|
|
481
|
+
return;
|
|
482
|
+
this.resetHeartbeat();
|
|
483
|
+
const data = e.data;
|
|
484
|
+
const name = String(data?.agentDisplayName ?? data?.agentName ?? 'agent');
|
|
485
|
+
const error = typeof data?.error === 'string' ? data.error : '';
|
|
486
|
+
this.emit('tool_complete', `subagent:${name}`, error);
|
|
487
|
+
this.emit('subagent_end', name, data ?? {});
|
|
488
|
+
});
|
|
489
|
+
// --- Rich events (optional; consumers can subscribe or ignore) ---
|
|
490
|
+
sdkSession.on('assistant.intent', (e) => {
|
|
491
|
+
if (this.aborted)
|
|
492
|
+
return;
|
|
493
|
+
this.resetHeartbeat();
|
|
494
|
+
const intent = typeof e.data?.intent === 'string' ? e.data.intent : '';
|
|
495
|
+
if (intent)
|
|
496
|
+
this.emit('intent', intent);
|
|
497
|
+
});
|
|
498
|
+
sdkSession.on('assistant.usage', (e) => {
|
|
499
|
+
if (this.aborted)
|
|
500
|
+
return;
|
|
501
|
+
this.resetHeartbeat();
|
|
502
|
+
this.emit('usage', e.data ?? {});
|
|
503
|
+
});
|
|
504
|
+
sdkSession.on('permission.requested', (e) => {
|
|
505
|
+
if (this.aborted)
|
|
506
|
+
return;
|
|
507
|
+
this.resetHeartbeat();
|
|
508
|
+
this.emit('permission', e.data ?? {});
|
|
509
|
+
});
|
|
510
|
+
// --- Catch-all for unhandled events ---
|
|
511
|
+
sdkSession.on((e) => {
|
|
512
|
+
if (this.aborted)
|
|
513
|
+
return;
|
|
514
|
+
if (e && typeof e.type === 'string' && !KNOWN_EVENT_TYPES.has(e.type)) {
|
|
515
|
+
process.stderr.write(`[SdkBackend] Unhandled event: ${e.type}\n`);
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
on(event, handler) {
|
|
520
|
+
this.handlers.push({ event, handler });
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Abort the session.
|
|
524
|
+
* Sequence matches SubprocessBackend exactly:
|
|
525
|
+
* 1. emit error (resolves step-executor Promise)
|
|
526
|
+
* 2. set aborted = true (close handler skips)
|
|
527
|
+
* 3. SDK abort + client stop
|
|
528
|
+
*/
|
|
529
|
+
async abort() {
|
|
530
|
+
if (this.aborted)
|
|
531
|
+
return;
|
|
532
|
+
this.clearTimers();
|
|
533
|
+
this.emitError(new Error('Session aborted'));
|
|
534
|
+
this.aborted = true;
|
|
535
|
+
await this._cleanup();
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Clean up SDK resources (session disconnect + client stop).
|
|
539
|
+
* Safe to call multiple times.
|
|
540
|
+
*/
|
|
541
|
+
async _cleanup() {
|
|
542
|
+
const sdkSession = this._sdkSession;
|
|
543
|
+
const client = this._client;
|
|
544
|
+
this._sdkSession = null;
|
|
545
|
+
this._client = null;
|
|
546
|
+
if (sdkSession) {
|
|
547
|
+
try {
|
|
548
|
+
await sdkSession.abort();
|
|
549
|
+
}
|
|
550
|
+
catch { /* Session may already be disconnected */ }
|
|
551
|
+
try {
|
|
552
|
+
await sdkSession.disconnect();
|
|
553
|
+
}
|
|
554
|
+
catch { /* Ignore */ }
|
|
555
|
+
}
|
|
556
|
+
if (client) {
|
|
557
|
+
try {
|
|
558
|
+
const stopPromise = client.stop();
|
|
559
|
+
const timeout = new Promise((resolve) => setTimeout(resolve, 5000));
|
|
560
|
+
await Promise.race([stopPromise, timeout]);
|
|
561
|
+
}
|
|
562
|
+
catch { /* Graceful stop failed */ }
|
|
563
|
+
try {
|
|
564
|
+
await client.forceStop();
|
|
565
|
+
}
|
|
566
|
+
catch { /* May already be dead */ }
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
emit(event, ...args) {
|
|
570
|
+
for (const h of this.handlers) {
|
|
571
|
+
if (h.event === event) {
|
|
572
|
+
h.handler(...args);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
emitError(err) {
|
|
577
|
+
this.emit('error', err);
|
|
578
|
+
}
|
|
579
|
+
resetHeartbeat() {
|
|
580
|
+
if (this.heartbeatTimer) {
|
|
581
|
+
clearTimeout(this.heartbeatTimer);
|
|
582
|
+
}
|
|
583
|
+
this.heartbeatTimer = setTimeout(() => {
|
|
584
|
+
this.emitError(new Error(`No output for ${this.config.heartbeatTimeout}s (heartbeat timeout)`));
|
|
585
|
+
this.abort();
|
|
586
|
+
}, this.config.heartbeatTimeout * 1000);
|
|
587
|
+
}
|
|
588
|
+
clearTimers() {
|
|
589
|
+
if (this.timeoutTimer) {
|
|
590
|
+
clearTimeout(this.timeoutTimer);
|
|
591
|
+
this.timeoutTimer = null;
|
|
592
|
+
}
|
|
593
|
+
if (this.heartbeatTimer) {
|
|
594
|
+
clearTimeout(this.heartbeatTimer);
|
|
595
|
+
this.heartbeatTimer = null;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
//# sourceMappingURL=sdk-backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-backend.js","sourceRoot":"","sources":["../../../runtimes/copilot/sdk-backend.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAoC;AACpC,uCAAyB;AACzB,2CAA6B;AAyD7B,8EAA8E;AAC9E,sDAAsD;AACtD,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/E,4EAA4E;AAC5E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,mBAAmB,EAAE,yBAAyB;IAC9C,qBAAqB,EAAE,2BAA2B;IAClD,kBAAkB,EAAE,iBAAiB;IACrC,sBAAsB,EAAE,yBAAyB;IACjD,+BAA+B;IAC/B,cAAc,EAAE,eAAe;IAC/B,kBAAkB,EAAE,oBAAoB,EAAE,iBAAiB;IAC3D,sBAAsB,EAAE,sBAAsB;IAC9C,kEAAkE;IAClE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,uBAAuB;IAC9E,cAAc,EAAE,iBAAiB,EAAE,uBAAuB;IAC1D,yBAAyB,EAAE,oBAAoB,EAAE,sBAAsB;IACvE,0BAA0B,EAAE,6BAA6B;IACzD,sBAAsB,EAAE,sBAAs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MA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"subprocess-backend.d.ts","sourceRoot":"","sources":["../../../runtimes/copilot/subprocess-backend.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAA2C,MAAM,mBAAmB,CAAC;AAGhI,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,aAAa,KAAK,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;AAqCtF,MAAM,WAAW,wBAAwB;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,qEAAqE;IACrE,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAuED;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACtD,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;gBAElC,OAAO,GAAE,wBAA6B;IAM5C,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAM/B,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;CAGpE"}
|