observal-pi 1.1.1 → 1.2.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/extensions/observal.ts +10 -1
- package/package.json +1 -1
package/extensions/observal.ts
CHANGED
|
@@ -28,6 +28,8 @@ import * as path from "node:path";
|
|
|
28
28
|
interface ObservalConfig {
|
|
29
29
|
server_url: string;
|
|
30
30
|
access_token: string;
|
|
31
|
+
agent_id?: string;
|
|
32
|
+
agent_version?: string;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
interface CursorEntry {
|
|
@@ -137,7 +139,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
137
139
|
const raw = fs.readFileSync(CONFIG_PATH, "utf-8");
|
|
138
140
|
const data = JSON.parse(raw);
|
|
139
141
|
if (!data.server_url || !data.access_token) return null;
|
|
140
|
-
|
|
142
|
+
const config: ObservalConfig = { server_url: data.server_url, access_token: data.access_token };
|
|
143
|
+
if (data.active_agent?.id) config.agent_id = data.active_agent.id;
|
|
144
|
+
if (data.active_agent?.version) config.agent_version = data.active_agent.version;
|
|
145
|
+
return config;
|
|
141
146
|
} catch {
|
|
142
147
|
return null;
|
|
143
148
|
}
|
|
@@ -217,6 +222,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
217
222
|
const payload = JSON.stringify({
|
|
218
223
|
session_id: s.sessionId,
|
|
219
224
|
ide: "pi",
|
|
225
|
+
agent_id: s.config!.agent_id ?? null,
|
|
226
|
+
agent_version: s.config!.agent_version ?? null,
|
|
220
227
|
lines: chunk,
|
|
221
228
|
start_offset: s.lineCount + offset,
|
|
222
229
|
hook_event: opts.final && isLastChunk ? "SessionShutdown" : "AgentEnd",
|
|
@@ -342,6 +349,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
342
349
|
const payload = JSON.stringify({
|
|
343
350
|
session_id: sessionId,
|
|
344
351
|
ide: "pi",
|
|
352
|
+
agent_id: s.config?.agent_id ?? null,
|
|
353
|
+
agent_version: s.config?.agent_version ?? null,
|
|
345
354
|
lines,
|
|
346
355
|
start_offset: entry.line_count,
|
|
347
356
|
hook_event: "CrashRecovery",
|