@ai-devkit/agent-manager 0.33.0 → 0.33.1
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/AgentManager.d.ts +11 -2
- package/dist/AgentManager.d.ts.map +1 -1
- package/dist/AgentManager.js +37 -6
- package/dist/AgentManager.js.map +1 -1
- package/dist/__tests__/AgentManager.test.js +212 -5
- package/dist/__tests__/AgentManager.test.js.map +1 -1
- package/dist/__tests__/adapters/OpenCodeAdapter.test.js +1 -0
- package/dist/__tests__/adapters/OpenCodeAdapter.test.js.map +1 -1
- package/dist/__tests__/{adapters → providers/copilot}/CopilotAdapter.test.js +19 -14
- package/dist/__tests__/providers/copilot/CopilotAdapter.test.js.map +1 -0
- package/dist/__tests__/{adapters → providers/gemini}/GeminiCliAdapter.test.js +37 -29
- package/dist/__tests__/providers/gemini/GeminiCliAdapter.test.js.map +1 -0
- package/dist/__tests__/runtime/HerdrAgentDiscovery.test.js +164 -0
- package/dist/__tests__/runtime/HerdrAgentDiscovery.test.js.map +1 -0
- package/dist/__tests__/runtime/HerdrAgentRuntime.test.js +37 -1
- package/dist/__tests__/runtime/HerdrAgentRuntime.test.js.map +1 -1
- package/dist/__tests__/utils/AgentRegistry.test.js +20 -13
- package/dist/__tests__/utils/AgentRegistry.test.js.map +1 -1
- package/dist/adapters/OpenCodeAdapter.d.ts +1 -0
- package/dist/adapters/OpenCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/OpenCodeAdapter.js +7 -4
- package/dist/adapters/OpenCodeAdapter.js.map +1 -1
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/index.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/{adapters → providers/copilot}/CopilotAdapter.d.ts +11 -25
- package/dist/providers/copilot/CopilotAdapter.d.ts.map +1 -0
- package/dist/providers/copilot/CopilotAdapter.js +108 -0
- package/dist/providers/copilot/CopilotAdapter.js.map +1 -0
- package/dist/providers/copilot/CopilotAgentMapper.d.ts +9 -0
- package/dist/providers/copilot/CopilotAgentMapper.d.ts.map +1 -0
- package/dist/providers/copilot/CopilotAgentMapper.js +37 -0
- package/dist/providers/copilot/CopilotAgentMapper.js.map +1 -0
- package/dist/providers/copilot/CopilotSessionLocator.d.ts +19 -0
- package/dist/providers/copilot/CopilotSessionLocator.d.ts.map +1 -0
- package/dist/providers/copilot/CopilotSessionLocator.js +41 -0
- package/dist/providers/copilot/CopilotSessionLocator.js.map +1 -0
- package/dist/providers/copilot/CopilotSessionParser.d.ts +30 -0
- package/dist/providers/copilot/CopilotSessionParser.d.ts.map +1 -0
- package/dist/providers/copilot/CopilotSessionParser.js +181 -0
- package/dist/providers/copilot/CopilotSessionParser.js.map +1 -0
- package/dist/providers/gemini/GeminiAgentMapper.d.ts +9 -0
- package/dist/providers/gemini/GeminiAgentMapper.d.ts.map +1 -0
- package/dist/providers/gemini/GeminiAgentMapper.js +37 -0
- package/dist/providers/gemini/GeminiAgentMapper.js.map +1 -0
- package/dist/providers/gemini/GeminiCliAdapter.d.ts +52 -0
- package/dist/providers/gemini/GeminiCliAdapter.d.ts.map +1 -0
- package/dist/providers/gemini/GeminiCliAdapter.js +188 -0
- package/dist/providers/gemini/GeminiCliAdapter.js.map +1 -0
- package/dist/providers/gemini/GeminiSessionLocator.d.ts +30 -0
- package/dist/providers/gemini/GeminiSessionLocator.d.ts.map +1 -0
- package/dist/providers/gemini/GeminiSessionLocator.js +142 -0
- package/dist/providers/gemini/GeminiSessionLocator.js.map +1 -0
- package/dist/providers/gemini/GeminiSessionParser.d.ts +94 -0
- package/dist/providers/gemini/GeminiSessionParser.d.ts.map +1 -0
- package/dist/providers/gemini/GeminiSessionParser.js +166 -0
- package/dist/providers/gemini/GeminiSessionParser.js.map +1 -0
- package/dist/runtime/herdr/HerdrAgentDiscovery.d.ts +18 -0
- package/dist/runtime/herdr/HerdrAgentDiscovery.d.ts.map +1 -0
- package/dist/runtime/herdr/HerdrAgentDiscovery.js +183 -0
- package/dist/runtime/herdr/HerdrAgentDiscovery.js.map +1 -0
- package/dist/runtime/herdr/HerdrAgentRuntime.d.ts +5 -0
- package/dist/runtime/herdr/HerdrAgentRuntime.d.ts.map +1 -1
- package/dist/runtime/herdr/HerdrAgentRuntime.js +26 -8
- package/dist/runtime/herdr/HerdrAgentRuntime.js.map +1 -1
- package/dist/runtime/herdr/HerdrResponseParsers.d.ts +2 -0
- package/dist/runtime/herdr/HerdrResponseParsers.d.ts.map +1 -1
- package/dist/runtime/herdr/HerdrResponseParsers.js +12 -1
- package/dist/runtime/herdr/HerdrResponseParsers.js.map +1 -1
- package/dist/utils/AgentRegistry.d.ts.map +1 -1
- package/dist/utils/AgentRegistry.js +5 -5
- package/dist/utils/AgentRegistry.js.map +1 -1
- package/package.json +1 -1
- package/src/AgentManager.ts +67 -5
- package/src/__tests__/AgentManager.test.ts +231 -5
- package/src/__tests__/adapters/OpenCodeAdapter.test.ts +1 -0
- package/src/__tests__/{adapters → providers/copilot}/CopilotAdapter.test.ts +13 -16
- package/src/__tests__/{adapters → providers/gemini}/GeminiCliAdapter.test.ts +39 -31
- package/src/__tests__/runtime/HerdrAgentDiscovery.test.ts +131 -0
- package/src/__tests__/runtime/HerdrAgentRuntime.test.ts +20 -1
- package/src/__tests__/utils/AgentRegistry.test.ts +20 -10
- package/src/adapters/OpenCodeAdapter.ts +8 -4
- package/src/adapters/index.ts +2 -2
- package/src/index.ts +10 -3
- package/src/providers/copilot/CopilotAdapter.ts +145 -0
- package/src/providers/copilot/CopilotAgentMapper.ts +36 -0
- package/src/providers/copilot/CopilotSessionLocator.ts +57 -0
- package/src/providers/copilot/CopilotSessionParser.ts +289 -0
- package/src/providers/gemini/GeminiAgentMapper.ts +36 -0
- package/src/providers/gemini/GeminiCliAdapter.ts +266 -0
- package/src/providers/gemini/GeminiSessionLocator.ts +183 -0
- package/src/providers/gemini/GeminiSessionParser.ts +271 -0
- package/src/runtime/herdr/HerdrAgentDiscovery.ts +178 -0
- package/src/runtime/herdr/HerdrAgentRuntime.ts +33 -7
- package/src/runtime/herdr/HerdrResponseParsers.ts +11 -1
- package/src/utils/AgentRegistry.ts +8 -6
- package/dist/__tests__/adapters/CopilotAdapter.test.js.map +0 -1
- package/dist/__tests__/adapters/GeminiCliAdapter.test.js.map +0 -1
- package/dist/adapters/CopilotAdapter.d.ts.map +0 -1
- package/dist/adapters/CopilotAdapter.js +0 -329
- package/dist/adapters/CopilotAdapter.js.map +0 -1
- package/dist/adapters/GeminiCliAdapter.d.ts +0 -98
- package/dist/adapters/GeminiCliAdapter.d.ts.map +0 -1
- package/dist/adapters/GeminiCliAdapter.js +0 -513
- package/dist/adapters/GeminiCliAdapter.js.map +0 -1
- package/src/adapters/CopilotAdapter.ts +0 -483
- package/src/adapters/GeminiCliAdapter.ts +0 -699
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copilot Adapter
|
|
3
|
-
*
|
|
4
|
-
* Detects running GitHub Copilot CLI agents by:
|
|
5
|
-
* 1. Filtering Copilot processes from a shared asynchronous process snapshot
|
|
6
|
-
* 2. Using snapshot CWD and start-time enrichment
|
|
7
|
-
* 3. Mapping active ~/.copilot/session-state/{sessionId}/inuse.{pid}.lock files to processes
|
|
8
|
-
* 4. Reading events.jsonl as the primary session/conversation source
|
|
9
|
-
* 5. Reading workspace.yaml as a flat fallback metadata source
|
|
10
|
-
*/ import * as path from "path";
|
|
11
|
-
import { AgentStatus } from "./AgentAdapter.js";
|
|
12
|
-
import { captureProcessSnapshot, executableBasename, filterByProcessNames, findWrapperProcess, findWrapperProcessPids } from "../utils/process.js";
|
|
13
|
-
import { generateAgentName } from "../utils/matching.js";
|
|
14
|
-
import { isDirectory, safeReadFile, safeReaddir, safeStat } from "../utils/session.js";
|
|
15
|
-
import { AgentRegistry } from "../utils/AgentRegistry.js";
|
|
16
|
-
export class CopilotAdapter {
|
|
17
|
-
type = "copilot";
|
|
18
|
-
processNames = [
|
|
19
|
-
"copilot"
|
|
20
|
-
];
|
|
21
|
-
static IDLE_THRESHOLD_MINUTES = 5;
|
|
22
|
-
static VERBOSE_SYSTEM_EVENTS = new Set([
|
|
23
|
-
"system.message",
|
|
24
|
-
"session.info",
|
|
25
|
-
"session.warning",
|
|
26
|
-
"tool.execution_start",
|
|
27
|
-
"tool.execution_complete",
|
|
28
|
-
"function",
|
|
29
|
-
"abort"
|
|
30
|
-
]);
|
|
31
|
-
static WAITING_EVENTS = new Set([
|
|
32
|
-
"assistant.message",
|
|
33
|
-
"assistant.turn_end",
|
|
34
|
-
"session.shutdown",
|
|
35
|
-
"abort"
|
|
36
|
-
]);
|
|
37
|
-
sessionStateDir;
|
|
38
|
-
registry;
|
|
39
|
-
constructor(registry = AgentRegistry.default()){
|
|
40
|
-
const homeDir = process.env.HOME || process.env.USERPROFILE || "";
|
|
41
|
-
this.sessionStateDir = path.join(homeDir, ".copilot", "session-state");
|
|
42
|
-
this.registry = registry;
|
|
43
|
-
}
|
|
44
|
-
canHandle(processInfo) {
|
|
45
|
-
return this.isCopilotExecutable(processInfo.command);
|
|
46
|
-
}
|
|
47
|
-
async detectAgents(context) {
|
|
48
|
-
const snapshot = context?.processes ?? await captureProcessSnapshot(this.processNames);
|
|
49
|
-
const relevant = filterByProcessNames(snapshot, this.processNames);
|
|
50
|
-
const processes = relevant.filter((process1)=>this.canHandle(process1));
|
|
51
|
-
if (processes.length === 0) return [];
|
|
52
|
-
const processByPid = new Map(processes.map((proc)=>[
|
|
53
|
-
proc.pid,
|
|
54
|
-
proc
|
|
55
|
-
]));
|
|
56
|
-
const registryEntriesByPid = new Map(this.registry.list().map((entry)=>[
|
|
57
|
-
entry.pid,
|
|
58
|
-
entry
|
|
59
|
-
]));
|
|
60
|
-
const matchedPids = new Set();
|
|
61
|
-
const matchedProcesses = [];
|
|
62
|
-
const agents = [];
|
|
63
|
-
for (const lock of this.discoverActiveLocks()){
|
|
64
|
-
const proc = processByPid.get(lock.pid);
|
|
65
|
-
if (!proc) continue;
|
|
66
|
-
const session = this.readSessionDir(lock.sessionDir, lock.sessionId);
|
|
67
|
-
if (!session) continue;
|
|
68
|
-
const agent = this.mapSessionToAgent(session, proc);
|
|
69
|
-
this.applyWrapperRegistryName(agent, proc, processes, registryEntriesByPid);
|
|
70
|
-
agents.push(agent);
|
|
71
|
-
matchedPids.add(proc.pid);
|
|
72
|
-
matchedProcesses.push(proc);
|
|
73
|
-
}
|
|
74
|
-
const wrapperPids = findWrapperProcessPids(processes, matchedProcesses);
|
|
75
|
-
for (const proc of processes){
|
|
76
|
-
if (!matchedPids.has(proc.pid) && !wrapperPids.has(proc.pid)) {
|
|
77
|
-
const agent = this.mapProcessOnlyAgent(proc);
|
|
78
|
-
this.applyWrapperRegistryName(agent, proc, processes, registryEntriesByPid);
|
|
79
|
-
agents.push(agent);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return agents;
|
|
83
|
-
}
|
|
84
|
-
applyWrapperRegistryName(agent, processInfo, processes, registryEntriesByPid) {
|
|
85
|
-
const wrapper = findWrapperProcess(processes, processInfo);
|
|
86
|
-
const wrapperEntry = wrapper ? registryEntriesByPid.get(wrapper.pid) : undefined;
|
|
87
|
-
if (wrapperEntry?.type === this.type) {
|
|
88
|
-
agent.name = wrapperEntry.name;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
getConversation(sessionFilePath, options) {
|
|
92
|
-
const verbose = options?.verbose ?? false;
|
|
93
|
-
const content = safeReadFile(sessionFilePath);
|
|
94
|
-
if (content === undefined) return [];
|
|
95
|
-
const messages = [];
|
|
96
|
-
for (const entry of this.parseEventLines(content)){
|
|
97
|
-
const role = this.roleForEvent(entry.type, verbose);
|
|
98
|
-
if (!role) continue;
|
|
99
|
-
const text = this.extractEventText(entry, verbose);
|
|
100
|
-
if (!text) continue;
|
|
101
|
-
messages.push({
|
|
102
|
-
role,
|
|
103
|
-
content: text,
|
|
104
|
-
timestamp: entry.timestamp
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return messages;
|
|
108
|
-
}
|
|
109
|
-
async listSessions(opts) {
|
|
110
|
-
const summaries = [];
|
|
111
|
-
for (const { sessionDir, sessionId } of this.listSessionDirs()){
|
|
112
|
-
const session = this.readSessionDir(sessionDir, sessionId);
|
|
113
|
-
if (!session) continue;
|
|
114
|
-
if (opts?.cwd !== undefined && session.projectPath !== opts.cwd) continue;
|
|
115
|
-
summaries.push({
|
|
116
|
-
type: this.type,
|
|
117
|
-
sessionId: session.sessionId,
|
|
118
|
-
cwd: session.projectPath,
|
|
119
|
-
firstUserMessage: session.firstUserMessage,
|
|
120
|
-
lastActive: session.lastActive,
|
|
121
|
-
startedAt: session.sessionStart,
|
|
122
|
-
sessionFilePath: session.eventsFilePath
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
return summaries;
|
|
126
|
-
}
|
|
127
|
-
listSessionDirs() {
|
|
128
|
-
if (!isDirectory(this.sessionStateDir)) return [];
|
|
129
|
-
const sessionDirs = [];
|
|
130
|
-
for (const sessionId of safeReaddir(this.sessionStateDir)){
|
|
131
|
-
const sessionDir = path.join(this.sessionStateDir, sessionId);
|
|
132
|
-
if (!isDirectory(sessionDir)) continue;
|
|
133
|
-
sessionDirs.push({
|
|
134
|
-
sessionDir,
|
|
135
|
-
sessionId
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
return sessionDirs;
|
|
139
|
-
}
|
|
140
|
-
discoverActiveLocks() {
|
|
141
|
-
const locks = [];
|
|
142
|
-
for (const { sessionDir, sessionId } of this.listSessionDirs()){
|
|
143
|
-
for (const entry of safeReaddir(sessionDir)){
|
|
144
|
-
const match = entry.match(/^inuse\.(\d+)\.lock$/);
|
|
145
|
-
if (!match) continue;
|
|
146
|
-
const pid = Number.parseInt(match[1], 10);
|
|
147
|
-
if (!Number.isFinite(pid)) continue;
|
|
148
|
-
locks.push({
|
|
149
|
-
sessionDir,
|
|
150
|
-
sessionId,
|
|
151
|
-
pid
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return locks;
|
|
156
|
-
}
|
|
157
|
-
readSessionDir(sessionDir, fallbackSessionId) {
|
|
158
|
-
const eventsFilePath = path.join(sessionDir, "events.jsonl");
|
|
159
|
-
const workspace = this.readWorkspace(path.join(sessionDir, "workspace.yaml"));
|
|
160
|
-
const entries = this.readEvents(eventsFilePath);
|
|
161
|
-
if (entries.length === 0 && !this.hasWorkspaceMetadata(workspace)) {
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
const fileStat = safeStat(eventsFilePath);
|
|
165
|
-
const sessionStart = workspace.createdAt || fileStat?.birthtime || new Date();
|
|
166
|
-
const eventSummary = this.summarizeEvents(entries, {
|
|
167
|
-
sessionId: workspace.id || fallbackSessionId,
|
|
168
|
-
projectPath: workspace.cwd || "",
|
|
169
|
-
sessionStart,
|
|
170
|
-
lastActive: workspace.updatedAt || fileStat?.mtime || sessionStart,
|
|
171
|
-
firstUserMessage: "",
|
|
172
|
-
lastText: ""
|
|
173
|
-
});
|
|
174
|
-
const summary = eventSummary.firstUserMessage || eventSummary.lastText || workspace.name || "Copilot session active";
|
|
175
|
-
return {
|
|
176
|
-
sessionId: eventSummary.sessionId,
|
|
177
|
-
projectPath: eventSummary.projectPath,
|
|
178
|
-
summary: this.truncate(summary, 120),
|
|
179
|
-
sessionStart: eventSummary.sessionStart,
|
|
180
|
-
lastActive: eventSummary.lastActive,
|
|
181
|
-
lastEventType: eventSummary.lastEventType,
|
|
182
|
-
firstUserMessage: eventSummary.firstUserMessage,
|
|
183
|
-
eventsFilePath
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
readEvents(eventsFilePath) {
|
|
187
|
-
const content = safeReadFile(eventsFilePath);
|
|
188
|
-
return content === undefined ? [] : this.parseEventLines(content);
|
|
189
|
-
}
|
|
190
|
-
summarizeEvents(entries, initial) {
|
|
191
|
-
const summary = {
|
|
192
|
-
...initial
|
|
193
|
-
};
|
|
194
|
-
for (const entry of entries){
|
|
195
|
-
const timestamp = this.parseTimestamp(entry.timestamp);
|
|
196
|
-
if (timestamp) {
|
|
197
|
-
summary.lastActive = timestamp;
|
|
198
|
-
}
|
|
199
|
-
if (entry.type) {
|
|
200
|
-
summary.lastEventType = entry.type;
|
|
201
|
-
}
|
|
202
|
-
if (entry.type === "session.start") {
|
|
203
|
-
summary.sessionId = entry.data?.sessionId || summary.sessionId;
|
|
204
|
-
summary.projectPath = entry.data?.context?.cwd || summary.projectPath;
|
|
205
|
-
summary.sessionStart = this.parseTimestamp(entry.data?.startTime) || timestamp || summary.sessionStart;
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
const text = this.extractEventText(entry, false);
|
|
209
|
-
if (!text) continue;
|
|
210
|
-
if (!summary.firstUserMessage && entry.type === "user.message") {
|
|
211
|
-
summary.firstUserMessage = text;
|
|
212
|
-
}
|
|
213
|
-
if (entry.type === "user.message" || entry.type === "assistant.message") {
|
|
214
|
-
summary.lastText = text;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
return summary;
|
|
218
|
-
}
|
|
219
|
-
hasWorkspaceMetadata(workspace) {
|
|
220
|
-
return Boolean(workspace.id || workspace.cwd || workspace.name || workspace.createdAt || workspace.updatedAt);
|
|
221
|
-
}
|
|
222
|
-
readWorkspace(filePath) {
|
|
223
|
-
const content = safeReadFile(filePath);
|
|
224
|
-
if (content === undefined) return {};
|
|
225
|
-
const values = new Map();
|
|
226
|
-
for (const rawLine of content.split("\n")){
|
|
227
|
-
const line = rawLine.trim();
|
|
228
|
-
if (!line || line.startsWith("#")) continue;
|
|
229
|
-
const idx = line.indexOf(":");
|
|
230
|
-
if (idx === -1) continue;
|
|
231
|
-
const key = line.slice(0, idx).trim();
|
|
232
|
-
const value = this.stripYamlScalar(line.slice(idx + 1).trim());
|
|
233
|
-
values.set(key, value);
|
|
234
|
-
}
|
|
235
|
-
return {
|
|
236
|
-
id: values.get("id"),
|
|
237
|
-
cwd: values.get("cwd"),
|
|
238
|
-
name: values.get("name"),
|
|
239
|
-
createdAt: this.parseTimestamp(values.get("created_at")) || undefined,
|
|
240
|
-
updatedAt: this.parseTimestamp(values.get("updated_at")) || undefined
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
stripYamlScalar(value) {
|
|
244
|
-
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
245
|
-
return value.slice(1, -1);
|
|
246
|
-
}
|
|
247
|
-
return value;
|
|
248
|
-
}
|
|
249
|
-
parseEventLines(content) {
|
|
250
|
-
const entries = [];
|
|
251
|
-
for (const line of content.trim().split("\n")){
|
|
252
|
-
const trimmed = line.trim();
|
|
253
|
-
if (!trimmed) continue;
|
|
254
|
-
try {
|
|
255
|
-
entries.push(JSON.parse(trimmed));
|
|
256
|
-
} catch {
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return entries;
|
|
261
|
-
}
|
|
262
|
-
roleForEvent(type, verbose) {
|
|
263
|
-
if (type === "user.message") return "user";
|
|
264
|
-
if (type === "assistant.message") return "assistant";
|
|
265
|
-
if (verbose && type !== undefined && CopilotAdapter.VERBOSE_SYSTEM_EVENTS.has(type)) {
|
|
266
|
-
return "system";
|
|
267
|
-
}
|
|
268
|
-
return null;
|
|
269
|
-
}
|
|
270
|
-
extractEventText(entry, verbose) {
|
|
271
|
-
const data = entry.data;
|
|
272
|
-
if (!data) return "";
|
|
273
|
-
const raw = data.content || data.message || data.text || data.result?.content || data.result?.detailedContent || (verbose ? data.output : "") || "";
|
|
274
|
-
if (typeof raw !== "string") return "";
|
|
275
|
-
return raw.trim();
|
|
276
|
-
}
|
|
277
|
-
mapSessionToAgent(session, proc) {
|
|
278
|
-
const projectPath = session.projectPath || proc.cwd || "";
|
|
279
|
-
return {
|
|
280
|
-
name: generateAgentName(projectPath, proc.pid),
|
|
281
|
-
type: this.type,
|
|
282
|
-
status: this.determineStatus(session),
|
|
283
|
-
summary: session.summary || "Copilot session active",
|
|
284
|
-
pid: proc.pid,
|
|
285
|
-
projectPath,
|
|
286
|
-
sessionId: session.sessionId,
|
|
287
|
-
lastActive: session.lastActive,
|
|
288
|
-
sessionFilePath: session.eventsFilePath
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
mapProcessOnlyAgent(proc) {
|
|
292
|
-
return {
|
|
293
|
-
name: generateAgentName(proc.cwd || "", proc.pid),
|
|
294
|
-
type: this.type,
|
|
295
|
-
status: AgentStatus.RUNNING,
|
|
296
|
-
summary: "Copilot process running",
|
|
297
|
-
pid: proc.pid,
|
|
298
|
-
projectPath: proc.cwd || "",
|
|
299
|
-
sessionId: `pid-${proc.pid}`,
|
|
300
|
-
lastActive: new Date()
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
determineStatus(session) {
|
|
304
|
-
const diffMs = Date.now() - session.lastActive.getTime();
|
|
305
|
-
const diffMinutes = diffMs / 60000;
|
|
306
|
-
if (diffMinutes > CopilotAdapter.IDLE_THRESHOLD_MINUTES) {
|
|
307
|
-
return AgentStatus.IDLE;
|
|
308
|
-
}
|
|
309
|
-
if (session.lastEventType !== undefined && CopilotAdapter.WAITING_EVENTS.has(session.lastEventType)) {
|
|
310
|
-
return AgentStatus.WAITING;
|
|
311
|
-
}
|
|
312
|
-
return AgentStatus.RUNNING;
|
|
313
|
-
}
|
|
314
|
-
parseTimestamp(value) {
|
|
315
|
-
if (!value) return null;
|
|
316
|
-
const timestamp = new Date(value);
|
|
317
|
-
return Number.isNaN(timestamp.getTime()) ? null : timestamp;
|
|
318
|
-
}
|
|
319
|
-
truncate(value, maxLength) {
|
|
320
|
-
if (value.length <= maxLength) return value;
|
|
321
|
-
return `${value.slice(0, maxLength - 3)}...`;
|
|
322
|
-
}
|
|
323
|
-
isCopilotExecutable(command) {
|
|
324
|
-
const base = executableBasename(command);
|
|
325
|
-
return base === "copilot" || base === "copilot.exe";
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
//# sourceMappingURL=CopilotAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/adapters/CopilotAdapter.ts"],"sourcesContent":["/**\n * Copilot Adapter\n *\n * Detects running GitHub Copilot CLI agents by:\n * 1. Filtering Copilot processes from a shared asynchronous process snapshot\n * 2. Using snapshot CWD and start-time enrichment\n * 3. Mapping active ~/.copilot/session-state/{sessionId}/inuse.{pid}.lock files to processes\n * 4. Reading events.jsonl as the primary session/conversation source\n * 5. Reading workspace.yaml as a flat fallback metadata source\n */\n\nimport * as path from \"path\";\nimport type {\n AgentAdapter,\n AgentInfo,\n ConversationMessage,\n ListSessionsOptions,\n ProcessInfo,\n SessionSummary,\n AgentDetectionContext,\n} from \"./AgentAdapter.js\";\nimport { AgentStatus } from \"./AgentAdapter.js\";\nimport {\n captureProcessSnapshot,\n executableBasename,\n filterByProcessNames,\n findWrapperProcess,\n findWrapperProcessPids,\n} from \"../utils/process.js\";\nimport { generateAgentName } from \"../utils/matching.js\";\nimport { isDirectory, safeReadFile, safeReaddir, safeStat } from \"../utils/session.js\";\nimport { AgentRegistry, type RegistryEntry } from \"../utils/AgentRegistry.js\";\n\ninterface CopilotEventEntry {\n type?: string;\n data?: {\n sessionId?: string;\n startTime?: string;\n context?: {\n cwd?: string;\n gitRoot?: string;\n branch?: string;\n };\n content?: string;\n transformedContent?: string;\n message?: string;\n text?: string;\n result?: {\n content?: string;\n detailedContent?: string;\n };\n output?: string;\n };\n timestamp?: string;\n}\n\ninterface CopilotWorkspace {\n id?: string;\n cwd?: string;\n name?: string;\n createdAt?: Date;\n updatedAt?: Date;\n}\n\ninterface CopilotSession {\n sessionId: string;\n projectPath: string;\n summary: string;\n sessionStart: Date;\n lastActive: Date;\n lastEventType?: string;\n firstUserMessage: string;\n eventsFilePath: string;\n}\n\ninterface CopilotLock {\n sessionDir: string;\n sessionId: string;\n pid: number;\n}\n\ninterface CopilotSessionDir {\n sessionDir: string;\n sessionId: string;\n}\n\ninterface CopilotEventSummary {\n sessionId: string;\n projectPath: string;\n sessionStart: Date;\n lastActive: Date;\n firstUserMessage: string;\n lastText: string;\n lastEventType?: string;\n}\n\nexport class CopilotAdapter implements AgentAdapter {\n readonly type = \"copilot\" as const;\n readonly processNames = [\"copilot\"] as const;\n\n private static readonly IDLE_THRESHOLD_MINUTES = 5;\n private static readonly VERBOSE_SYSTEM_EVENTS = new Set([\n \"system.message\",\n \"session.info\",\n \"session.warning\",\n \"tool.execution_start\",\n \"tool.execution_complete\",\n \"function\",\n \"abort\",\n ]);\n private static readonly WAITING_EVENTS = new Set([\n \"assistant.message\",\n \"assistant.turn_end\",\n \"session.shutdown\",\n \"abort\",\n ]);\n\n private sessionStateDir: string;\n private registry: AgentRegistry;\n\n constructor(registry: AgentRegistry = AgentRegistry.default()) {\n const homeDir = process.env.HOME || process.env.USERPROFILE || \"\";\n this.sessionStateDir = path.join(homeDir, \".copilot\", \"session-state\");\n this.registry = registry;\n }\n\n canHandle(processInfo: ProcessInfo): boolean {\n return this.isCopilotExecutable(processInfo.command);\n }\n\n async detectAgents(context?: AgentDetectionContext): Promise<AgentInfo[]> {\n const snapshot = context?.processes ?? (await captureProcessSnapshot(this.processNames));\n const relevant = filterByProcessNames(snapshot, this.processNames);\n const processes = relevant.filter((process) => this.canHandle(process));\n if (processes.length === 0) return [];\n\n const processByPid = new Map(processes.map((proc) => [proc.pid, proc]));\n const registryEntriesByPid = new Map(this.registry.list().map((entry) => [entry.pid, entry]));\n const matchedPids = new Set<number>();\n const matchedProcesses: ProcessInfo[] = [];\n const agents: AgentInfo[] = [];\n\n for (const lock of this.discoverActiveLocks()) {\n const proc = processByPid.get(lock.pid);\n if (!proc) continue;\n\n const session = this.readSessionDir(lock.sessionDir, lock.sessionId);\n if (!session) continue;\n\n const agent = this.mapSessionToAgent(session, proc);\n this.applyWrapperRegistryName(agent, proc, processes, registryEntriesByPid);\n agents.push(agent);\n matchedPids.add(proc.pid);\n matchedProcesses.push(proc);\n }\n\n const wrapperPids = findWrapperProcessPids(processes, matchedProcesses);\n for (const proc of processes) {\n if (!matchedPids.has(proc.pid) && !wrapperPids.has(proc.pid)) {\n const agent = this.mapProcessOnlyAgent(proc);\n this.applyWrapperRegistryName(agent, proc, processes, registryEntriesByPid);\n agents.push(agent);\n }\n }\n\n return agents;\n }\n\n private applyWrapperRegistryName(\n agent: AgentInfo,\n processInfo: ProcessInfo,\n processes: ProcessInfo[],\n registryEntriesByPid: Map<number, RegistryEntry>,\n ): void {\n const wrapper = findWrapperProcess(processes, processInfo);\n const wrapperEntry = wrapper ? registryEntriesByPid.get(wrapper.pid) : undefined;\n if (wrapperEntry?.type === this.type) {\n agent.name = wrapperEntry.name;\n }\n }\n\n getConversation(sessionFilePath: string, options?: { verbose?: boolean }): ConversationMessage[] {\n const verbose = options?.verbose ?? false;\n const content = safeReadFile(sessionFilePath);\n if (content === undefined) return [];\n\n const messages: ConversationMessage[] = [];\n\n for (const entry of this.parseEventLines(content)) {\n const role = this.roleForEvent(entry.type, verbose);\n if (!role) continue;\n\n const text = this.extractEventText(entry, verbose);\n if (!text) continue;\n\n messages.push({\n role,\n content: text,\n timestamp: entry.timestamp,\n });\n }\n\n return messages;\n }\n\n async listSessions(opts?: ListSessionsOptions): Promise<SessionSummary[]> {\n const summaries: SessionSummary[] = [];\n\n for (const { sessionDir, sessionId } of this.listSessionDirs()) {\n const session = this.readSessionDir(sessionDir, sessionId);\n if (!session) continue;\n if (opts?.cwd !== undefined && session.projectPath !== opts.cwd) continue;\n\n summaries.push({\n type: this.type,\n sessionId: session.sessionId,\n cwd: session.projectPath,\n firstUserMessage: session.firstUserMessage,\n lastActive: session.lastActive,\n startedAt: session.sessionStart,\n sessionFilePath: session.eventsFilePath,\n });\n }\n\n return summaries;\n }\n\n private listSessionDirs(): CopilotSessionDir[] {\n if (!isDirectory(this.sessionStateDir)) return [];\n\n const sessionDirs: CopilotSessionDir[] = [];\n for (const sessionId of safeReaddir(this.sessionStateDir)) {\n const sessionDir = path.join(this.sessionStateDir, sessionId);\n if (!isDirectory(sessionDir)) continue;\n\n sessionDirs.push({ sessionDir, sessionId });\n }\n\n return sessionDirs;\n }\n\n private discoverActiveLocks(): CopilotLock[] {\n const locks: CopilotLock[] = [];\n for (const { sessionDir, sessionId } of this.listSessionDirs()) {\n for (const entry of safeReaddir(sessionDir)) {\n const match = entry.match(/^inuse\\.(\\d+)\\.lock$/);\n if (!match) continue;\n\n const pid = Number.parseInt(match[1], 10);\n if (!Number.isFinite(pid)) continue;\n locks.push({ sessionDir, sessionId, pid });\n }\n }\n\n return locks;\n }\n\n private readSessionDir(sessionDir: string, fallbackSessionId: string): CopilotSession | null {\n const eventsFilePath = path.join(sessionDir, \"events.jsonl\");\n const workspace = this.readWorkspace(path.join(sessionDir, \"workspace.yaml\"));\n const entries = this.readEvents(eventsFilePath);\n if (entries.length === 0 && !this.hasWorkspaceMetadata(workspace)) {\n return null;\n }\n\n const fileStat = safeStat(eventsFilePath);\n const sessionStart = workspace.createdAt || fileStat?.birthtime || new Date();\n const eventSummary = this.summarizeEvents(entries, {\n sessionId: workspace.id || fallbackSessionId,\n projectPath: workspace.cwd || \"\",\n sessionStart,\n lastActive: workspace.updatedAt || fileStat?.mtime || sessionStart,\n firstUserMessage: \"\",\n lastText: \"\",\n });\n\n const summary =\n eventSummary.firstUserMessage ||\n eventSummary.lastText ||\n workspace.name ||\n \"Copilot session active\";\n\n return {\n sessionId: eventSummary.sessionId,\n projectPath: eventSummary.projectPath,\n summary: this.truncate(summary, 120),\n sessionStart: eventSummary.sessionStart,\n lastActive: eventSummary.lastActive,\n lastEventType: eventSummary.lastEventType,\n firstUserMessage: eventSummary.firstUserMessage,\n eventsFilePath,\n };\n }\n\n private readEvents(eventsFilePath: string): CopilotEventEntry[] {\n const content = safeReadFile(eventsFilePath);\n return content === undefined ? [] : this.parseEventLines(content);\n }\n\n private summarizeEvents(\n entries: CopilotEventEntry[],\n initial: CopilotEventSummary,\n ): CopilotEventSummary {\n const summary = { ...initial };\n for (const entry of entries) {\n const timestamp = this.parseTimestamp(entry.timestamp);\n if (timestamp) {\n summary.lastActive = timestamp;\n }\n if (entry.type) {\n summary.lastEventType = entry.type;\n }\n\n if (entry.type === \"session.start\") {\n summary.sessionId = entry.data?.sessionId || summary.sessionId;\n summary.projectPath = entry.data?.context?.cwd || summary.projectPath;\n summary.sessionStart =\n this.parseTimestamp(entry.data?.startTime) || timestamp || summary.sessionStart;\n continue;\n }\n\n const text = this.extractEventText(entry, false);\n if (!text) continue;\n\n if (!summary.firstUserMessage && entry.type === \"user.message\") {\n summary.firstUserMessage = text;\n }\n\n if (entry.type === \"user.message\" || entry.type === \"assistant.message\") {\n summary.lastText = text;\n }\n }\n\n return summary;\n }\n\n private hasWorkspaceMetadata(workspace: CopilotWorkspace): boolean {\n return Boolean(\n workspace.id || workspace.cwd || workspace.name || workspace.createdAt || workspace.updatedAt,\n );\n }\n\n private readWorkspace(filePath: string): CopilotWorkspace {\n const content = safeReadFile(filePath);\n if (content === undefined) return {};\n\n const values = new Map<string, string>();\n for (const rawLine of content.split(\"\\n\")) {\n const line = rawLine.trim();\n if (!line || line.startsWith(\"#\")) continue;\n\n const idx = line.indexOf(\":\");\n if (idx === -1) continue;\n\n const key = line.slice(0, idx).trim();\n const value = this.stripYamlScalar(line.slice(idx + 1).trim());\n values.set(key, value);\n }\n\n return {\n id: values.get(\"id\"),\n cwd: values.get(\"cwd\"),\n name: values.get(\"name\"),\n createdAt: this.parseTimestamp(values.get(\"created_at\")) || undefined,\n updatedAt: this.parseTimestamp(values.get(\"updated_at\")) || undefined,\n };\n }\n\n private stripYamlScalar(value: string): string {\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n return value.slice(1, -1);\n }\n return value;\n }\n\n private parseEventLines(content: string): CopilotEventEntry[] {\n const entries: CopilotEventEntry[] = [];\n for (const line of content.trim().split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n\n try {\n entries.push(JSON.parse(trimmed) as CopilotEventEntry);\n } catch {\n continue;\n }\n }\n return entries;\n }\n\n private roleForEvent(\n type: string | undefined,\n verbose: boolean,\n ): ConversationMessage[\"role\"] | null {\n if (type === \"user.message\") return \"user\";\n if (type === \"assistant.message\") return \"assistant\";\n if (verbose && type !== undefined && CopilotAdapter.VERBOSE_SYSTEM_EVENTS.has(type)) {\n return \"system\";\n }\n return null;\n }\n\n private extractEventText(entry: CopilotEventEntry, verbose: boolean): string {\n const data = entry.data;\n if (!data) return \"\";\n\n const raw =\n data.content ||\n data.message ||\n data.text ||\n data.result?.content ||\n data.result?.detailedContent ||\n (verbose ? data.output : \"\") ||\n \"\";\n\n if (typeof raw !== \"string\") return \"\";\n return raw.trim();\n }\n\n private mapSessionToAgent(session: CopilotSession, proc: ProcessInfo): AgentInfo {\n const projectPath = session.projectPath || proc.cwd || \"\";\n return {\n name: generateAgentName(projectPath, proc.pid),\n type: this.type,\n status: this.determineStatus(session),\n summary: session.summary || \"Copilot session active\",\n pid: proc.pid,\n projectPath,\n sessionId: session.sessionId,\n lastActive: session.lastActive,\n sessionFilePath: session.eventsFilePath,\n };\n }\n\n private mapProcessOnlyAgent(proc: ProcessInfo): AgentInfo {\n return {\n name: generateAgentName(proc.cwd || \"\", proc.pid),\n type: this.type,\n status: AgentStatus.RUNNING,\n summary: \"Copilot process running\",\n pid: proc.pid,\n projectPath: proc.cwd || \"\",\n sessionId: `pid-${proc.pid}`,\n lastActive: new Date(),\n };\n }\n\n private determineStatus(session: CopilotSession): AgentStatus {\n const diffMs = Date.now() - session.lastActive.getTime();\n const diffMinutes = diffMs / 60000;\n if (diffMinutes > CopilotAdapter.IDLE_THRESHOLD_MINUTES) {\n return AgentStatus.IDLE;\n }\n\n if (\n session.lastEventType !== undefined &&\n CopilotAdapter.WAITING_EVENTS.has(session.lastEventType)\n ) {\n return AgentStatus.WAITING;\n }\n\n return AgentStatus.RUNNING;\n }\n\n private parseTimestamp(value?: string): Date | null {\n if (!value) return null;\n const timestamp = new Date(value);\n return Number.isNaN(timestamp.getTime()) ? null : timestamp;\n }\n\n private truncate(value: string, maxLength: number): string {\n if (value.length <= maxLength) return value;\n return `${value.slice(0, maxLength - 3)}...`;\n }\n\n private isCopilotExecutable(command: string): boolean {\n const base = executableBasename(command);\n return base === \"copilot\" || base === \"copilot.exe\";\n }\n}\n"],"names":["path","AgentStatus","captureProcessSnapshot","executableBasename","filterByProcessNames","findWrapperProcess","findWrapperProcessPids","generateAgentName","isDirectory","safeReadFile","safeReaddir","safeStat","AgentRegistry","CopilotAdapter","type","processNames","IDLE_THRESHOLD_MINUTES","VERBOSE_SYSTEM_EVENTS","Set","WAITING_EVENTS","sessionStateDir","registry","default","homeDir","process","env","HOME","USERPROFILE","join","canHandle","processInfo","isCopilotExecutable","command","detectAgents","context","snapshot","processes","relevant","filter","length","processByPid","Map","map","proc","pid","registryEntriesByPid","list","entry","matchedPids","matchedProcesses","agents","lock","discoverActiveLocks","get","session","readSessionDir","sessionDir","sessionId","agent","mapSessionToAgent","applyWrapperRegistryName","push","add","wrapperPids","has","mapProcessOnlyAgent","wrapper","wrapperEntry","undefined","name","getConversation","sessionFilePath","options","verbose","content","messages","parseEventLines","role","roleForEvent","text","extractEventText","timestamp","listSessions","opts","summaries","listSessionDirs","cwd","projectPath","firstUserMessage","lastActive","startedAt","sessionStart","eventsFilePath","sessionDirs","locks","match","Number","parseInt","isFinite","fallbackSessionId","workspace","readWorkspace","entries","readEvents","hasWorkspaceMetadata","fileStat","createdAt","birthtime","Date","eventSummary","summarizeEvents","id","updatedAt","mtime","lastText","summary","truncate","lastEventType","initial","parseTimestamp","data","startTime","Boolean","filePath","values","rawLine","split","line","trim","startsWith","idx","indexOf","key","slice","value","stripYamlScalar","set","endsWith","trimmed","JSON","parse","raw","message","result","detailedContent","output","status","determineStatus","RUNNING","diffMs","now","getTime","diffMinutes","IDLE","WAITING","isNaN","maxLength","base"],"mappings":"AAAA;;;;;;;;;CASC,GAED,YAAYA,UAAU,OAAO;AAU7B,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SACEC,sBAAsB,EACtBC,kBAAkB,EAClBC,oBAAoB,EACpBC,kBAAkB,EAClBC,sBAAsB,QACjB,sBAAsB;AAC7B,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,WAAW,EAAEC,YAAY,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,sBAAsB;AACvF,SAASC,aAAa,QAA4B,4BAA4B;AAiE9E,OAAO,MAAMC;IACFC,OAAO,UAAmB;IAC1BC,eAAe;QAAC;KAAU,CAAU;IAE7C,OAAwBC,yBAAyB,EAAE;IACnD,OAAwBC,wBAAwB,IAAIC,IAAI;QACtD;QACA;QACA;QACA;QACA;QACA;QACA;KACD,EAAE;IACH,OAAwBC,iBAAiB,IAAID,IAAI;QAC/C;QACA;QACA;QACA;KACD,EAAE;IAEKE,gBAAwB;IACxBC,SAAwB;IAEhC,YAAYA,WAA0BT,cAAcU,OAAO,EAAE,CAAE;QAC7D,MAAMC,UAAUC,QAAQC,GAAG,CAACC,IAAI,IAAIF,QAAQC,GAAG,CAACE,WAAW,IAAI;QAC/D,IAAI,CAACP,eAAe,GAAGpB,KAAK4B,IAAI,CAACL,SAAS,YAAY;QACtD,IAAI,CAACF,QAAQ,GAAGA;IAClB;IAEAQ,UAAUC,WAAwB,EAAW;QAC3C,OAAO,IAAI,CAACC,mBAAmB,CAACD,YAAYE,OAAO;IACrD;IAEA,MAAMC,aAAaC,OAA+B,EAAwB;QACxE,MAAMC,WAAWD,SAASE,aAAc,MAAMlC,uBAAuB,IAAI,CAACa,YAAY;QACtF,MAAMsB,WAAWjC,qBAAqB+B,UAAU,IAAI,CAACpB,YAAY;QACjE,MAAMqB,YAAYC,SAASC,MAAM,CAAC,CAACd,WAAY,IAAI,CAACK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,CAAC6C,GAAG,CAACV,QAAQ+D,aAAa,GACvD;YACA,OAAOpH,YAAYyJ,OAAO;QAC5B;QAEA,OAAOzJ,YAAYmJ,OAAO;IAC5B;IAEQ7B,eAAee,KAAc,EAAe;QAClD,IAAI,CAACA,OAAO,OAAO;QACnB,MAAMrD,YAAY,IAAI2B,KAAK0B;QAC3B,OAAOtC,OAAO2D,KAAK,CAAC1E,UAAUsE,OAAO,MAAM,OAAOtE;IACpD;IAEQmC,SAASkB,KAAa,EAAEsB,SAAiB,EAAU;QACzD,IAAItB,MAAM/F,MAAM,IAAIqH,WAAW,OAAOtB;QACtC,OAAO,GAAGA,MAAMD,KAAK,CAAC,GAAGuB,YAAY,GAAG,GAAG,CAAC;IAC9C;IAEQ7H,oBAAoBC,OAAe,EAAW;QACpD,MAAM6H,OAAO1J,mBAAmB6B;QAChC,OAAO6H,SAAS,aAAaA,SAAS;IACxC;AACF"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI Adapter
|
|
3
|
-
*
|
|
4
|
-
* Detects running Gemini CLI agents by:
|
|
5
|
-
* 1. Filtering Gemini Node processes from a shared asynchronous process snapshot
|
|
6
|
-
* 2. Using snapshot CWD and start-time enrichment
|
|
7
|
-
* 3. Discovering session files from ~/.gemini/tmp/<shortId>/chats/session-*.json
|
|
8
|
-
* 4. Matching sessions to processes via shared matchProcessesToSessions()
|
|
9
|
-
* using sha256(cwd) === session.projectHash as the resolvedCwd source
|
|
10
|
-
* 5. Extracting summary from the most recent user message in the session JSON
|
|
11
|
-
*/
|
|
12
|
-
import type { AgentAdapter, AgentInfo, ProcessInfo, ConversationMessage, SessionSummary, ListSessionsOptions, AgentDetectionContext } from "./AgentAdapter.js";
|
|
13
|
-
import { AgentRegistry } from "../utils/AgentRegistry.js";
|
|
14
|
-
export declare class GeminiCliAdapter implements AgentAdapter {
|
|
15
|
-
readonly type: "gemini_cli";
|
|
16
|
-
readonly processNames: readonly ["node"];
|
|
17
|
-
private static readonly IDLE_THRESHOLD_MINUTES;
|
|
18
|
-
private static readonly SESSION_FILE_PREFIX;
|
|
19
|
-
private static readonly CHATS_DIR_NAME;
|
|
20
|
-
private static readonly TMP_DIR_NAME;
|
|
21
|
-
private geminiTmpDir;
|
|
22
|
-
private registry;
|
|
23
|
-
constructor(registry?: AgentRegistry);
|
|
24
|
-
canHandle(processInfo: ProcessInfo): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Detect running Gemini CLI agents.
|
|
27
|
-
*
|
|
28
|
-
* Gemini CLI ships as a Node script (`bundle/gemini.js` with shebang
|
|
29
|
-
* `#!/usr/bin/env node`) — unlike Claude Code (native binary per
|
|
30
|
-
* platform) or Codex CLI (Node wrapper that execs a native Rust
|
|
31
|
-
* binary). The primary running process is therefore the Node runtime
|
|
32
|
-
* itself, and `ps aux` lists it as `node /path/to/gemini ...` with
|
|
33
|
-
* argv[0] = `node`. We scan the Node process pool via the shared
|
|
34
|
-
* snapshot and keep only those whose command line references the gemini
|
|
35
|
-
* executable or script via isGeminiExecutable().
|
|
36
|
-
*/
|
|
37
|
-
detectAgents(context?: AgentDetectionContext): Promise<AgentInfo[]>;
|
|
38
|
-
private applyWrapperRegistryName;
|
|
39
|
-
private deduplicateSessionAgents;
|
|
40
|
-
private sessionDeduplicationKey;
|
|
41
|
-
private tryRegistryCache;
|
|
42
|
-
/**
|
|
43
|
-
* Discover session files for the given processes.
|
|
44
|
-
*
|
|
45
|
-
* Gemini CLI writes sessions to ~/.gemini/tmp/<shortId>/chats/session-*.json
|
|
46
|
-
* where <shortId> is opaque (managed by a project registry). We scan every
|
|
47
|
-
* shortId directory and filter by matching session.projectHash against
|
|
48
|
-
* sha256(process.cwd) to bind each session to a candidate process CWD.
|
|
49
|
-
*/
|
|
50
|
-
private discoverSessions;
|
|
51
|
-
private buildCwdHashMap;
|
|
52
|
-
private candidateProjectRoots;
|
|
53
|
-
private hashProjectRoot;
|
|
54
|
-
/**
|
|
55
|
-
* Parse session file content into GeminiSession.
|
|
56
|
-
* Uses cached content if available, otherwise reads from disk.
|
|
57
|
-
*/
|
|
58
|
-
private parseSession;
|
|
59
|
-
private mapSessionToAgent;
|
|
60
|
-
private mapProcessOnlyAgent;
|
|
61
|
-
private parseTimestamp;
|
|
62
|
-
private determineStatus;
|
|
63
|
-
private extractSummary;
|
|
64
|
-
/**
|
|
65
|
-
* Normalize an entry's content/displayContent into a plain string.
|
|
66
|
-
* Prefers displayContent when both are present (matches Gemini CLI's
|
|
67
|
-
* own rendering priority for the /chat UI).
|
|
68
|
-
*/
|
|
69
|
-
private messageText;
|
|
70
|
-
/**
|
|
71
|
-
* Collapse a Gemini message content field into plain text.
|
|
72
|
-
* Accepts either a pre-joined string (assistant turns) or a Part[]
|
|
73
|
-
* list (user turns carrying `[{text: "..."}]`). Non-text part
|
|
74
|
-
* variants (data, file) are dropped since this helper is only used
|
|
75
|
-
* for summary/conversation rendering.
|
|
76
|
-
*/
|
|
77
|
-
private resolveContent;
|
|
78
|
-
private truncate;
|
|
79
|
-
private isGeminiExecutable;
|
|
80
|
-
/**
|
|
81
|
-
* Read the full conversation from a Gemini CLI session JSON file.
|
|
82
|
-
*
|
|
83
|
-
* Gemini sessions store messages in an array with `type` field — typically
|
|
84
|
-
* 'user' or 'gemini' for visible turns, with tool and system entries mixed in.
|
|
85
|
-
*/
|
|
86
|
-
getConversation(sessionFilePath: string, options?: {
|
|
87
|
-
verbose?: boolean;
|
|
88
|
-
}): ConversationMessage[];
|
|
89
|
-
listSessions(opts?: ListSessionsOptions): Promise<SessionSummary[]>;
|
|
90
|
-
/**
|
|
91
|
-
* Read a Gemini session JSON file and produce a {@link SessionSummary}.
|
|
92
|
-
* Returns null when the file is unreadable, the JSON doesn't parse,
|
|
93
|
-
* or the body lacks a sessionId.
|
|
94
|
-
*/
|
|
95
|
-
private fileToSessionSummary;
|
|
96
|
-
private extractFirstUserMessage;
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=GeminiCliAdapter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