observal-pi 1.1.0 → 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.
@@ -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
- return { server_url: data.server_url, access_token: data.access_token };
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "observal-pi",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Observal session telemetry for Pi — zero-dependency extension that pushes session traces to your Observal server",
5
5
  "keywords": [
6
6
  "pi-package",