@fml-inc/panopticon 0.1.0 → 0.1.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/README.md CHANGED
@@ -121,18 +121,15 @@ Once installed, these tools are available to the AI coding tool via MCP:
121
121
 
122
122
  | Tool | Description |
123
123
  |------|-------------|
124
- | `panopticon_sessions` | List recent sessions with stats (event count, tools used, cost) |
125
- | `panopticon_session_timeline` | Chronological events for a session (hooks + OTel merged) |
126
- | `panopticon_tool_stats` | Per-tool aggregates: call count, success/failure |
127
- | `panopticon_costs` | Token/cost breakdowns by session, model, or day |
128
- | `panopticon_summary` | Activity summary for a time window (sessions, prompts, tools, files, costs) |
129
- | `panopticon_plans` | Plans created via ExitPlanMode with full markdown content |
130
- | `panopticon_search` | Full-text search across hook payloads (FTS5) and OTel log bodies |
131
- | `panopticon_get_event` | Fetch full untruncated details for a specific event by source and ID |
132
- | `panopticon_query` | Raw read-only SQL against the database |
133
- | `panopticon_status` | Database row counts |
134
- | `panopticon_permissions_show` | Show current permission approvals and allowed tools/commands |
135
- | `panopticon_permissions_apply` | Apply permission rules (allowed tools/commands via PreToolUse hook) |
124
+ | `sessions` | List recent sessions with stats (tokens, cost, model, project) |
125
+ | `timeline` | Messages and tool calls for a session, including child sessions (forks, subagents) |
126
+ | `costs` | Token usage and cost breakdowns by session, model, or day |
127
+ | `summary` | Activity summary sessions, prompts, tools, files, costs. Ideal for standup updates |
128
+ | `plans` | Plans created via ExitPlanMode with full markdown content |
129
+ | `search` | Full-text search across events and messages (FTS5) |
130
+ | `get` | Fetch full untruncated details for a record by source and ID |
131
+ | `query` | Raw read-only SQL against the database |
132
+ | `status` | Database row counts |
136
133
 
137
134
  ## CLI
138
135
 
@@ -153,28 +150,30 @@ panopticon stop Stop the server
153
150
  panopticon status Show server status and database stats
154
151
  panopticon doctor Check system health, server, database, and configuration
155
152
 
156
- panopticon logs [daemon] View daemon logs (server, otlp, mcp, proxy)
153
+ panopticon logs [daemon] View daemon logs (otlp, mcp)
157
154
  -f, --follow Follow log output (like tail -f)
158
155
  -n <lines> Number of lines to show (default 50)
159
156
 
160
157
  panopticon sessions List recent sessions with stats
161
158
  --limit <n> Max sessions to return (default 20)
162
159
  --since <duration> Time filter (e.g. "24h", "7d")
163
- panopticon timeline <id> Chronological events for a session
164
- panopticon tools Per-tool usage aggregates
160
+ panopticon timeline <id> Get messages and tool calls for a session
161
+ --limit <n> Max messages to return (default 50)
162
+ --offset <n> Number of messages to skip
163
+ --full Return full content instead of truncated
165
164
  panopticon costs Token usage and cost breakdowns
166
165
  --group-by <g> Group by session, model, or day
167
166
  panopticon summary Activity summary
168
167
  panopticon plans List plans from ExitPlanMode events
169
- panopticon search <query> Full-text search across all events
170
- panopticon event <src> <id> Get full details for a specific event
168
+ panopticon search <query> Full-text search across events and messages
169
+ panopticon print <src> <id> Get full details for a record by source and ID
171
170
  panopticon query <sql> Raw read-only SQL query
172
171
  panopticon db-stats Show database row counts
173
172
 
174
- panopticon scan Scan local session files (incremental)
175
- panopticon scan reset Reset scanner and re-scan from scratch
176
- [source] Optionally reset only: claude, codex, gemini
177
- panopticon scan compare Compare scanner data against hooks/OTLP data
173
+ panopticon sync add <name> <url> Add or update a sync target
174
+ panopticon sync remove <name> Remove a sync target
175
+ panopticon sync list List sync targets
176
+ panopticon sync reset [target] Reset sync watermarks (re-syncs all data)
178
177
 
179
178
  panopticon prune Delete old data from the database
180
179
  --older-than 30d Max age (default: 30d)
@@ -182,7 +181,7 @@ panopticon prune Delete old data from the database
182
181
  --vacuum Reclaim disk space after pruning
183
182
  --yes Skip confirmation prompt
184
183
 
185
- panopticon refresh-pricing Fetch latest model pricing from OpenRouter
184
+ panopticon refresh-pricing Fetch latest model pricing from LiteLLM
186
185
  panopticon permissions show Show current approval rules
187
186
  panopticon permissions apply Apply permission rules (JSON from stdin)
188
187
  ```
@@ -199,7 +198,7 @@ Daemon stdout/stderr is written to platform-specific log directories:
199
198
  | Linux | `~/.local/state/panopticon/logs/` |
200
199
  | Windows | `%LOCALAPPDATA%/panopticon/logs/` |
201
200
 
202
- Log files: `server.log`, `mcp-server.log`, `hook-handler.log`, `proxy.log`.
201
+ Log files: `server.log`, `otlp-receiver.log`, `mcp-server.log`, `proxy.log`, `hook-handler.log`.
203
202
 
204
203
  ## Configuration
205
204
 
@@ -250,17 +249,21 @@ SQLite with WAL mode. Location depends on platform (see data directory above).
250
249
  | Table | Description |
251
250
  |-------|-------------|
252
251
  | `sessions` | Unified session metadata — aggregated from hooks, OTel, and scanner |
252
+ | `messages` | Parsed messages (user, assistant, system) with token usage and DAG metadata |
253
+ | `tool_calls` | Tool invocations extracted from messages, with inputs, results, and durations |
253
254
  | `otel_logs` | OTel log records (api_request, tool_result, user_prompt, etc.) |
254
255
  | `otel_metrics` | OTel metric data points (token usage, cost, active time, etc.) |
256
+ | `otel_spans` | OTel trace spans |
255
257
  | `hook_events` | Plugin hook events with full payloads (tool inputs/outputs, tool results) |
256
- | `hook_events_fts` | FTS5 full-text search index on hook payloads |
257
258
  | `scanner_turns` | Per-turn token usage from session files (input, output, cache, reasoning) |
258
259
  | `scanner_events` | Tool calls, errors, reasoning, file snapshots from session files |
259
260
  | `scanner_file_watermarks` | Byte offsets for incremental session file parsing |
260
261
  | `session_repositories` | Maps sessions to GitHub repositories |
261
262
  | `session_cwds` | Maps sessions to working directories |
262
- | `model_pricing` | Cached model pricing from OpenRouter |
263
- | `schema_meta` | Internal schema version tracking |
263
+ | `session_summary_deltas` | Incremental session summaries |
264
+ | `model_pricing` | Cached model pricing from LiteLLM |
265
+ | `watermarks` | Sync watermarks for OTLP export targets |
266
+ | `target_session_sync` | Per-target session sync state |
264
267
 
265
268
  Query directly with `panopticon query` or via the `panopticon_query` MCP tool.
266
269
 
@@ -290,9 +293,18 @@ src/
290
293
  ├── server.ts Unified HTTP server (hooks, OTLP, proxy — single port)
291
294
  ├── sdk.ts SDK shim (observe() wrapper)
292
295
  ├── config.ts Panopticon paths, ports, defaults
296
+ ├── setup.ts Install/uninstall logic
293
297
  ├── log.ts Log file paths (macOS/Linux/Windows)
294
298
  ├── repo.ts Git repository detection
295
299
  ├── toml.ts TOML read/write (for Codex config)
300
+ ├── doctor.ts System health checks
301
+ ├── sentry.ts Error reporting
302
+ ├── eventConfig.ts Event type configuration
303
+ ├── unified-config.ts Unified config management
304
+ ├── api/
305
+ │ ├── client.ts API client for CLI/MCP queries via server
306
+ │ ├── routes.ts Server-side API route handlers
307
+ │ └── util.ts API utilities
296
308
  ├── targets/
297
309
  │ ├── types.ts TargetAdapter interface (config, hooks, events, detect, proxy)
298
310
  │ ├── registry.ts Map-based target registry (register, get, all)
@@ -306,13 +318,16 @@ src/
306
318
  │ ├── query.ts Query helpers for MCP tools and CLI
307
319
  │ ├── store.ts Data storage (insert hooks, OTel, upsert sessions)
308
320
  │ ├── prune.ts Data retention / pruning
309
- └── pricing.ts Model pricing cache (OpenRouter)
321
+ ├── sync-prune.ts Sync-aware pruning
322
+ │ └── pricing.ts Model pricing cache (LiteLLM)
310
323
  ├── scanner/
311
324
  │ ├── index.ts Public API (createScannerLoop, scanOnce)
312
325
  │ ├── loop.ts Poll loop — discovers files via target adapters, incremental parse
313
326
  │ ├── reader.ts Byte-offset file reader (only reads new lines)
314
327
  │ ├── store.ts Scanner DB operations (turns, events, watermarks, session upsert)
315
328
  │ ├── reconcile.ts Compare scanner vs hooks/OTLP token data per session
329
+ │ ├── reparse.ts Re-parse session files from scratch
330
+ │ ├── categories.ts Tool call categorization
316
331
  │ └── types.ts ScannerHandle, ScannerOptions
317
332
  ├── hooks/
318
333
  │ ├── handler.ts Hook event handler (stdin JSON → server)
@@ -325,19 +340,34 @@ src/
325
340
  │ ├── server.ts HTTP OTLP receiver (protobuf + JSON)
326
341
  │ ├── decode-logs.ts OTel log record decoding
327
342
  │ ├── decode-metrics.ts OTel metric decoding
343
+ │ ├── decode-traces.ts OTel trace/span decoding
328
344
  │ └── proto.ts Protocol buffer definitions
329
345
  ├── sync/
330
346
  │ ├── index.ts Public API (createSyncLoop, resetWatermarks)
331
347
  │ ├── types.ts Interfaces (SyncTarget, SyncOptions, MergedEvent, OTLP types)
348
+ │ ├── config.ts Sync target configuration
349
+ │ ├── registry.ts Sync target registry
332
350
  │ ├── loop.ts Poll loop with debounced scheduling
333
351
  │ ├── reader.ts Batch reads from SQLite + hook/OTLP dedup
334
- │ ├── serialize.ts Convert rows → OTLP JSON (resourceLogs, resourceMetrics)
335
- │ ├── watermark.ts Watermark persistence (sync-watermarks.db)
352
+ │ ├── watermark.ts Watermark persistence
336
353
  │ └── post.ts HTTP POST with retry + exponential backoff
354
+ ├── summary/
355
+ │ ├── index.ts Session summary public API
356
+ │ ├── llm.ts LLM-powered summary generation
357
+ │ └── loop.ts Background summary generation loop
358
+ ├── archive/
359
+ │ ├── index.ts Archive public API
360
+ │ ├── backend.ts Archive backend interface
361
+ │ └── local.ts Local filesystem archive
362
+ ├── workspaces/
363
+ │ ├── index.ts Workspace detection
364
+ │ ├── superset.ts Workspace superset logic
365
+ │ └── types.ts Workspace types
337
366
  └── proxy/
338
367
  ├── server.ts API proxy — routes built from target registry
339
368
  ├── emit.ts Event emission from proxy captures
340
369
  ├── streaming.ts SSE stream accumulation (Anthropic + OpenAI)
370
+ ├── ws-capture.ts WebSocket traffic capture
341
371
  ├── sessions.ts Proxy session tracking
342
372
  └── formats/
343
373
  ├── types.ts Format parser interface
package/bin/hook-handler CHANGED
File without changes
package/bin/mcp-server CHANGED
File without changes
package/bin/proxy CHANGED
File without changes
package/bin/server CHANGED
File without changes
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  addBreadcrumb,
23
23
  captureException
24
- } from "./chunk-CF4GPWLI.js";
24
+ } from "./chunk-XO5NQRTD.js";
25
25
  import {
26
26
  log
27
27
  } from "./chunk-7Q3BJMLG.js";
@@ -1696,4 +1696,4 @@ export {
1696
1696
  handleProxyRequest,
1697
1697
  createProxyServer
1698
1698
  };
1699
- //# sourceMappingURL=chunk-RX2RXHBH.js.map
1699
+ //# sourceMappingURL=chunk-KLXRBD4N.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-BVOE7A2Z.js";
7
7
  import {
8
8
  captureException
9
- } from "./chunk-CF4GPWLI.js";
9
+ } from "./chunk-XO5NQRTD.js";
10
10
  import {
11
11
  log
12
12
  } from "./chunk-7Q3BJMLG.js";
@@ -1069,4 +1069,4 @@ export {
1069
1069
  handleOtlpRequest,
1070
1070
  createOtlpServer
1071
1071
  };
1072
- //# sourceMappingURL=chunk-XLTCUH5A.js.map
1072
+ //# sourceMappingURL=chunk-TCKL7E4K.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  handleOtlpRequest
3
- } from "./chunk-XLTCUH5A.js";
3
+ } from "./chunk-TCKL7E4K.js";
4
4
  import {
5
5
  handleProxyRequest,
6
6
  processHookEvent,
7
7
  tunnelWebSocket
8
- } from "./chunk-RX2RXHBH.js";
8
+ } from "./chunk-KLXRBD4N.js";
9
9
  import {
10
10
  addTarget,
11
11
  createSyncLoop,
12
12
  listTargets,
13
13
  removeTarget
14
- } from "./chunk-HQCY722C.js";
14
+ } from "./chunk-YZBYEULL.js";
15
15
  import {
16
16
  createScannerLoop
17
17
  } from "./chunk-NXH7AONS.js";
@@ -26,7 +26,7 @@ import {
26
26
  flushSentry,
27
27
  initSentry,
28
28
  setTag
29
- } from "./chunk-CF4GPWLI.js";
29
+ } from "./chunk-XO5NQRTD.js";
30
30
  import {
31
31
  log
32
32
  } from "./chunk-7Q3BJMLG.js";
@@ -444,4 +444,4 @@ export {
444
444
  syncAwarePrune,
445
445
  createUnifiedServer
446
446
  };
447
- //# sourceMappingURL=chunk-WLBNFVIG.js.map
447
+ //# sourceMappingURL=chunk-VXQ33OYT.js.map
@@ -19,7 +19,7 @@ import {
19
19
  } from "@sentry/core";
20
20
  var initialized = false;
21
21
  function getVersion() {
22
- return true ? "0.1.0+2aee981" : "dev";
22
+ return true ? "0.1.1+29c570b" : "dev";
23
23
  }
24
24
  var SCRUBBED_BREADCRUMB_FIELDS = [
25
25
  "prompt",
@@ -167,4 +167,4 @@ export {
167
167
  setTag,
168
168
  flushSentry
169
169
  };
170
- //# sourceMappingURL=chunk-CF4GPWLI.js.map
170
+ //# sourceMappingURL=chunk-XO5NQRTD.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  captureException
3
- } from "./chunk-CF4GPWLI.js";
3
+ } from "./chunk-XO5NQRTD.js";
4
4
  import {
5
5
  log
6
6
  } from "./chunk-7Q3BJMLG.js";
@@ -182,7 +182,7 @@ function createSyncLoop(opts) {
182
182
  const postBatchSize = opts.postBatchSize ?? DEFAULT_POST_BATCH_SIZE;
183
183
  const idleMs = opts.idleIntervalMs ?? DEFAULT_IDLE_MS;
184
184
  const catchUpMs = opts.catchUpIntervalMs ?? DEFAULT_CATCHUP_MS;
185
- const panopticonVersion = true ? "0.1.0+2aee981" : "dev";
185
+ const panopticonVersion = true ? "0.1.1+29c570b" : "dev";
186
186
  function resolveHeaders(target) {
187
187
  const headers = { ...target.headers };
188
188
  headers["X-Panopticon-Version"] = panopticonVersion;
@@ -425,4 +425,4 @@ export {
425
425
  listTargets,
426
426
  createSyncLoop
427
427
  };
428
- //# sourceMappingURL=chunk-HQCY722C.js.map
428
+ //# sourceMappingURL=chunk-YZBYEULL.js.map
package/dist/cli.js CHANGED
@@ -334,7 +334,7 @@ function removeShellEnv() {
334
334
  }
335
335
  var program = new Command();
336
336
  program.name("panopticon").description("Observability for Claude Code").version(
337
- true ? "0.1.0+2aee981" : "dev"
337
+ true ? "0.1.1+29c570b" : "dev"
338
338
  );
339
339
  program.command("install").alias("setup").description("Build, register plugin, init DB, configure shell").option(
340
340
  "--target <target>",
@@ -462,7 +462,7 @@ program.command("uninstall").description("Remove panopticon hooks, shell config,
462
462
  }
463
463
  });
464
464
  program.command("update").description("Update panopticon to the latest version").action(async () => {
465
- const currentVersion = true ? "0.1.0+2aee981" : "unknown";
465
+ const currentVersion = true ? "0.1.1+29c570b" : "unknown";
466
466
  console.log(`Current: ${currentVersion}`);
467
467
  console.log(
468
468
  "To update, re-run the install command for your package manager:\n"
@@ -3,7 +3,7 @@ import {
3
3
  addBreadcrumb,
4
4
  captureException,
5
5
  initSentry
6
- } from "../chunk-CF4GPWLI.js";
6
+ } from "../chunk-XO5NQRTD.js";
7
7
  import {
8
8
  logPaths,
9
9
  openLogFd
@@ -80,7 +80,7 @@ async function waitForServer(port, timeoutMs = 3e3) {
80
80
 
81
81
  // src/hooks/handler.ts
82
82
  function getAgentVersion() {
83
- return true ? "0.1.0+2aee981" : void 0;
83
+ return true ? "0.1.1+29c570b" : void 0;
84
84
  }
85
85
  function logHook(message, meta) {
86
86
  try {
package/dist/index.js CHANGED
@@ -5,10 +5,10 @@ import {
5
5
  import {
6
6
  createUnifiedServer,
7
7
  syncAwarePrune
8
- } from "./chunk-WLBNFVIG.js";
9
- import "./chunk-XLTCUH5A.js";
10
- import "./chunk-RX2RXHBH.js";
11
- import "./chunk-HQCY722C.js";
8
+ } from "./chunk-VXQ33OYT.js";
9
+ import "./chunk-TCKL7E4K.js";
10
+ import "./chunk-KLXRBD4N.js";
11
+ import "./chunk-YZBYEULL.js";
12
12
  import "./chunk-NXH7AONS.js";
13
13
  import "./chunk-BVOE7A2Z.js";
14
14
  import {
@@ -24,7 +24,7 @@ import {
24
24
  writeFile,
25
25
  writeSettings
26
26
  } from "./chunk-3BUJ7URA.js";
27
- import "./chunk-CF4GPWLI.js";
27
+ import "./chunk-XO5NQRTD.js";
28
28
  import "./chunk-7Q3BJMLG.js";
29
29
  import {
30
30
  configureShellEnv,
File without changes
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createOtlpServer,
3
3
  handleOtlpRequest
4
- } from "../chunk-XLTCUH5A.js";
4
+ } from "../chunk-TCKL7E4K.js";
5
5
  import "../chunk-BVOE7A2Z.js";
6
- import "../chunk-CF4GPWLI.js";
6
+ import "../chunk-XO5NQRTD.js";
7
7
  import "../chunk-7Q3BJMLG.js";
8
8
  import "../chunk-3TZAKV3M.js";
9
9
  import "../chunk-ZEC4LRKS.js";
@@ -2,11 +2,11 @@ import {
2
2
  createProxyServer,
3
3
  handleProxyRequest,
4
4
  tunnelWebSocket
5
- } from "../chunk-RX2RXHBH.js";
5
+ } from "../chunk-KLXRBD4N.js";
6
6
  import "../chunk-BVOE7A2Z.js";
7
7
  import "../chunk-YVRWVDIA.js";
8
8
  import "../chunk-3BUJ7URA.js";
9
- import "../chunk-CF4GPWLI.js";
9
+ import "../chunk-XO5NQRTD.js";
10
10
  import "../chunk-7Q3BJMLG.js";
11
11
  import "../chunk-ZEC4LRKS.js";
12
12
  import "../chunk-QVK6VGCV.js";
package/dist/server.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  createUnifiedServer
3
- } from "./chunk-WLBNFVIG.js";
4
- import "./chunk-XLTCUH5A.js";
5
- import "./chunk-RX2RXHBH.js";
6
- import "./chunk-HQCY722C.js";
3
+ } from "./chunk-VXQ33OYT.js";
4
+ import "./chunk-TCKL7E4K.js";
5
+ import "./chunk-KLXRBD4N.js";
6
+ import "./chunk-YZBYEULL.js";
7
7
  import "./chunk-NXH7AONS.js";
8
8
  import "./chunk-BVOE7A2Z.js";
9
9
  import "./chunk-YVRWVDIA.js";
10
10
  import "./chunk-HRCEIYKU.js";
11
11
  import "./chunk-3BUJ7URA.js";
12
- import "./chunk-CF4GPWLI.js";
12
+ import "./chunk-XO5NQRTD.js";
13
13
  import "./chunk-7Q3BJMLG.js";
14
14
  import "./chunk-3TZAKV3M.js";
15
15
  import "./chunk-SEXU2WYG.js";
@@ -5,8 +5,8 @@ import {
5
5
  loadSyncConfig,
6
6
  removeTarget,
7
7
  saveSyncConfig
8
- } from "../chunk-HQCY722C.js";
9
- import "../chunk-CF4GPWLI.js";
8
+ } from "../chunk-YZBYEULL.js";
9
+ import "../chunk-XO5NQRTD.js";
10
10
  import "../chunk-7Q3BJMLG.js";
11
11
  import {
12
12
  TABLE_SYNC_REGISTRY,
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@fml-inc/panopticon",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Observability for Claude Code — captures OTel signals and hook events, queryable via MCP",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=22.0.0"
8
8
  },
9
+ "packageManager": "pnpm@10.17.1",
9
10
  "publishConfig": {
10
11
  "registry": "https://registry.npmjs.org",
11
12
  "access": "public"
@@ -90,6 +91,18 @@
90
91
  "import": "./dist/targets.js"
91
92
  }
92
93
  },
94
+ "scripts": {
95
+ "build": "tsup",
96
+ "dev": "tsup --watch",
97
+ "check": "biome check src/",
98
+ "check:fix": "biome check --write src/",
99
+ "format": "biome format --write src/",
100
+ "test": "vitest run --exclude '.claude/**'",
101
+ "test:watch": "vitest --exclude '.claude/**'",
102
+ "typecheck": "tsc --noEmit",
103
+ "pack:local": "pnpm build && pnpm pack",
104
+ "postinstall": "node ./bin/panopticon install && claude plugin update panopticon@local-plugins 2>/dev/null || true"
105
+ },
93
106
  "dependencies": {
94
107
  "@modelcontextprotocol/sdk": "^1.0.0",
95
108
  "@sentry/core": "^10.46.0",
@@ -109,16 +122,11 @@
109
122
  "typescript": "^5",
110
123
  "vitest": "^4.1.0"
111
124
  },
112
- "scripts": {
113
- "build": "tsup",
114
- "dev": "tsup --watch",
115
- "check": "biome check src/",
116
- "check:fix": "biome check --write src/",
117
- "format": "biome format --write src/",
118
- "test": "vitest run --exclude '.claude/**'",
119
- "test:watch": "vitest --exclude '.claude/**'",
120
- "typecheck": "tsc --noEmit",
121
- "pack:local": "pnpm build && pnpm pack",
122
- "postinstall": "node ./bin/panopticon install && claude plugin update panopticon@local-plugins 2>/dev/null || true"
125
+ "pnpm": {
126
+ "onlyBuiltDependencies": [
127
+ "better-sqlite3",
128
+ "esbuild",
129
+ "lefthook"
130
+ ]
123
131
  }
124
- }
132
+ }