@pasko70/pibo 1.9.2 → 1.9.3

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.
Files changed (120) hide show
  1. package/README.md +183 -183
  2. package/context/codex-base-prompt.md +148 -148
  3. package/context/compute-worker.md +23 -23
  4. package/context/pibo-compaction-prompt.md +100 -100
  5. package/context/pibo-native-tooling.md +18 -18
  6. package/context/pibo-system-prompt.md +77 -77
  7. package/dist/apps/chat/agent-store.js +248 -248
  8. package/dist/apps/chat/data/project-service.js +168 -168
  9. package/dist/apps/chat/data/read-state-service.js +18 -18
  10. package/dist/apps/chat/data/session-query-service.js +25 -25
  11. package/dist/apps/chat/data/timeline-query-service.js +14 -14
  12. package/dist/apps/chat/static-assets.js +854 -854
  13. package/dist/apps/chat/workflow-persistence.js +255 -255
  14. package/dist/apps/chat-ui/assets/{dist-5GM30SQK.js → dist-5WHjqNrY.js} +1 -1
  15. package/dist/apps/chat-ui/assets/{dist-Cge8JklW.js → dist-BJBNSAIH.js} +1 -1
  16. package/dist/apps/chat-ui/assets/{dist-C-5u2QIS.js → dist-C3liNPZJ.js} +1 -1
  17. package/dist/apps/chat-ui/assets/{dist-BWbWIOcD.js → dist-CW6FHEaw.js} +1 -1
  18. package/dist/apps/chat-ui/assets/{dist-CjYtD7ZT.js → dist-CaNlj6v6.js} +1 -1
  19. package/dist/apps/chat-ui/assets/{dist-BYKMZlI0.js → dist-Cne74s6i.js} +1 -1
  20. package/dist/apps/chat-ui/assets/{dist-9lsp1UpA.js → dist-DvKZv20v.js} +1 -1
  21. package/dist/apps/chat-ui/assets/{dist-DFhhiR8M.js → dist-FYH7vzrh.js} +1 -1
  22. package/dist/apps/chat-ui/assets/{dist-Etxmpyxg.js → dist-f5KioIwL.js} +1 -1
  23. package/dist/apps/chat-ui/assets/{dist-2KdPXbMT.js → dist-hWrpj7SE.js} +1 -1
  24. package/dist/apps/chat-ui/assets/{dist-Idz5kzy8.js → dist-jAuO8_bV.js} +1 -1
  25. package/dist/apps/chat-ui/assets/{index-BqD_bm7z.js → index-Bf29pJph.js} +29 -29
  26. package/dist/apps/chat-ui/index.html +17 -17
  27. package/dist/apps/chat-ui/manifest.webmanifest +25 -25
  28. package/dist/apps/chat-ui/sw.js +47 -47
  29. package/dist/apps/chat-vscode-web/assets/index-BAMxIaI_.js +41 -0
  30. package/dist/apps/chat-vscode-web/index.html +13 -13
  31. package/dist/apps/cli-ui/cliSessionsCommand.js +23 -23
  32. package/dist/apps/context-files-ui/index.html +11 -11
  33. package/dist/cli.js +39 -39
  34. package/dist/compute/cli.js +54 -54
  35. package/dist/core/session-router.js +5 -2
  36. package/dist/cron/cli.js +15 -15
  37. package/dist/cron/store.js +49 -49
  38. package/dist/data/cli.js +23 -23
  39. package/dist/data/event-log.js +23 -23
  40. package/dist/data/message-store.js +20 -20
  41. package/dist/data/navigation-store.js +9 -9
  42. package/dist/data/observation-store.js +4 -4
  43. package/dist/data/payload-store.js +17 -17
  44. package/dist/data/schema.js +431 -431
  45. package/dist/data/session-store.js +4 -4
  46. package/dist/data/telemetry-queries.js +54 -54
  47. package/dist/data/telemetry.js +197 -197
  48. package/dist/debug/events.js +12 -12
  49. package/dist/debug/failures.js +6 -6
  50. package/dist/debug/index.js +227 -227
  51. package/dist/debug/messages.js +6 -6
  52. package/dist/debug/pty.js +124 -124
  53. package/dist/debug/session.js +29 -29
  54. package/dist/debug/tools.js +5 -5
  55. package/dist/debug/web-snapshot-browser-scripts.js +294 -294
  56. package/dist/debug/web-streaming-browser-library.js +925 -925
  57. package/dist/debug/web-streaming-browser-scripts.js +232 -232
  58. package/dist/debug/web-streaming-provider-telemetry.js +4 -4
  59. package/dist/debug/web.js +93 -93
  60. package/dist/gateway/cli.js +19 -19
  61. package/dist/mcp/config-command.js +53 -53
  62. package/dist/mcp/index.js +21 -21
  63. package/dist/mcp/registry.js +11 -11
  64. package/dist/pi-packages/cli.js +11 -11
  65. package/dist/plugins/context-files-store.js +110 -110
  66. package/dist/plugins/context-files.js +4 -4
  67. package/dist/ralph/cli.js +18 -18
  68. package/dist/ralph/templates.js +140 -140
  69. package/dist/reliability/store.js +226 -226
  70. package/dist/session-ui/sessionActivity.js +30 -0
  71. package/dist/sessions/pibo-data-store.js +16 -16
  72. package/dist/sessions/sqlite-store.js +53 -53
  73. package/dist/setup/cli.js +58 -58
  74. package/dist/signals/projector.js +26 -11
  75. package/dist/signals/registry.js +41 -0
  76. package/dist/tools/agent-browser-wrapper.js +80 -80
  77. package/dist/tools/browser-use-cdp.js +12 -12
  78. package/dist/tools/browser-use-wrapper.js +762 -762
  79. package/dist/tools/guides.js +538 -538
  80. package/dist/tools/index.js +99 -99
  81. package/dist/tools/runtime/node-worker-source.js +205 -205
  82. package/dist/tools/runtime/python-worker-source.js +177 -177
  83. package/dist/vscode/cli.js +9 -9
  84. package/dist/web-annotations/cdp.js +900 -900
  85. package/dist/web-annotations/store.js +96 -96
  86. package/docs/README.md +23 -23
  87. package/docs/ops/install-developer-host.md +112 -112
  88. package/docs/ops/install-user-host.md +96 -96
  89. package/docs/ops/upgrade-user-to-developer-host.md +69 -69
  90. package/docs/ops/vscode-extension-release.md +160 -160
  91. package/package.json +95 -95
  92. package/skills/builtin/graphify/SKILL.md +52 -52
  93. package/skills/builtin/pi-agent-harness/SKILL.md +319 -319
  94. package/skills/builtin/pi-agent-harness/agents/openai.yaml +4 -4
  95. package/skills/builtin/pibo-docker-system/SKILL.md +170 -170
  96. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -330
  97. package/skills/builtin/prd/SKILL.md +143 -143
  98. package/skills/builtin/ralph-loop/SKILL.md +359 -359
  99. package/skills/builtin/ralph-prd-json/SKILL.md +123 -123
  100. package/skills/builtin/skill-creator/LICENSE.txt +201 -201
  101. package/skills/builtin/skill-creator/SKILL.md +513 -513
  102. package/skills/builtin/skill-creator/agents/analyzer.md +274 -274
  103. package/skills/builtin/skill-creator/agents/comparator.md +202 -202
  104. package/skills/builtin/skill-creator/agents/grader.md +223 -223
  105. package/skills/builtin/skill-creator/assets/eval_review.html +146 -146
  106. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -471
  107. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -1325
  108. package/skills/builtin/skill-creator/references/schemas.md +430 -430
  109. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -401
  110. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -326
  111. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -247
  112. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -136
  113. package/skills/builtin/skill-creator/scripts/quick_validate.py +102 -102
  114. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -310
  115. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -328
  116. package/skills/builtin/skill-creator/scripts/utils.py +47 -47
  117. package/skills/builtin/web-annotations/SKILL.md +93 -93
  118. package/src/mcp/LICENSE.mcp-cli +21 -21
  119. package/dist/apps/chat-vscode-web/assets/index-Cst9OUkC.js +0 -41
  120. package/dist/session-ui/activeTurn.js +0 -126
@@ -1,14 +1,14 @@
1
- <!doctype html>
2
- <html lang="de" class="dark">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <meta name="theme-color" content="#101d22" />
7
- <title>Pibo</title>
8
- <script type="module" crossorigin src="/apps/chat-vscode/assets/index-Cst9OUkC.js"></script>
1
+ <!doctype html>
2
+ <html lang="de" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="theme-color" content="#101d22" />
7
+ <title>Pibo</title>
8
+ <script type="module" crossorigin src="/apps/chat-vscode/assets/index-BAMxIaI_.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/apps/chat-vscode/assets/index-B5QK07zO.css">
10
- </head>
11
- <body>
12
- <div id="root"></div>
13
- </body>
14
- </html>
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
@@ -205,28 +205,28 @@ export function terminalLineLimitFromColumns(columns) {
205
205
  return Math.max(20, Math.floor(columns) - 4);
206
206
  }
207
207
  export function cliSessionsHelpText() {
208
- return `pibo tui:sessions - reduced Web Chat-derived session UI for terminals
209
-
210
- Usage:
211
- pibo tui:sessions [options]
212
-
213
- Options:
214
- --session <id> Open a specific Pibo session id
215
- --max-rows <count> Limit rendered transcript rows (default: 20)
216
- --demo Use deterministic fake session data for smoke testing
217
- -h, --help Show this help
218
-
219
- V2 commands inside the app:
220
- ${cliCommandSummaryText()}
221
-
222
- Scope:
223
- CLI Sessions is a reduced session/chat UI for SSH, bootstrap, recovery, and quick local work.
224
- It starts only when stdin and stdout are interactive TTYs; pipes fail with a clear error.
225
- Transcript rendering uses a bounded default tail window of 20 rows and truncates narrow terminal lines.
226
- Web Chat remains the full control center for projects, workflows, Cron, Ralph, Agent Designer, settings, and context management.
227
-
228
- Related existing commands:
229
- pibo tui
230
- pibo tui:routed
208
+ return `pibo tui:sessions - reduced Web Chat-derived session UI for terminals
209
+
210
+ Usage:
211
+ pibo tui:sessions [options]
212
+
213
+ Options:
214
+ --session <id> Open a specific Pibo session id
215
+ --max-rows <count> Limit rendered transcript rows (default: 20)
216
+ --demo Use deterministic fake session data for smoke testing
217
+ -h, --help Show this help
218
+
219
+ V2 commands inside the app:
220
+ ${cliCommandSummaryText()}
221
+
222
+ Scope:
223
+ CLI Sessions is a reduced session/chat UI for SSH, bootstrap, recovery, and quick local work.
224
+ It starts only when stdin and stdout are interactive TTYs; pipes fail with a clear error.
225
+ Transcript rendering uses a bounded default tail window of 20 rows and truncates narrow terminal lines.
226
+ Web Chat remains the full control center for projects, workflows, Cron, Ralph, Agent Designer, settings, and context management.
227
+
228
+ Related existing commands:
229
+ pibo tui
230
+ pibo tui:routed
231
231
  `;
232
232
  }
@@ -1,14 +1,14 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Pibo Context Files</title>
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Pibo Context Files</title>
7
7
  <script type="module" crossorigin src="/apps/context-files/assets/index-BhAWD3dv.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="/apps/context-files/assets/dist-D1KyNDg5.js">
9
9
  <link rel="stylesheet" crossorigin href="/apps/context-files/assets/index-B92tL3Pp.css">
10
- </head>
11
- <body>
12
- <div id="root"></div>
13
- </body>
14
- </html>
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
package/dist/cli.js CHANGED
@@ -445,47 +445,47 @@ function warnIfUnsupportedGatewayNodeVersion() {
445
445
  console.warn(`[pibo] warning: ${message}`);
446
446
  }
447
447
  function printRootDiscoveryText() {
448
- return `pibo - agent-oriented CLI
449
-
450
- Commands:
451
- config Manage local pibo config
452
- mcp Discover and call configured MCP servers
453
- tools Install and inspect curated external CLI tools
454
- pi-packages Register Pi Coding Agent packages
455
- debug Inspect local Pibo data
456
- data Inspect and maintain Pibo data stores
457
- compute Manage Pibo Docker compute workers
458
- resources Inspect and safely reap managed compute and browser resources
459
- setup Plan user-host installs and developer-host upgrades
460
- skills Manage Pibo user skills
461
- cron Manage scheduled Pibo jobs
462
- ralph Manage continuous Ralph jobs
463
- vscode Manage the Pibo VS Code extension
464
- profile Inspect a pibo profile, including active saved Chat custom agents
465
- tui Start the direct Pi TUI
466
- tui:routed Start the local routed Pibo TUI
467
- tui:sessions Start the reduced Web Chat-derived session UI
468
- gateway Inspect and restart host gateways through safe CLI commands
469
- gateway:web Start a web gateway runtime (use --auth=local for loopback-only local auth)
470
-
471
- Options:
472
- --version Print the Pibo CLI version
473
-
474
- Next:
475
- pibo <command> --help
448
+ return `pibo - agent-oriented CLI
449
+
450
+ Commands:
451
+ config Manage local pibo config
452
+ mcp Discover and call configured MCP servers
453
+ tools Install and inspect curated external CLI tools
454
+ pi-packages Register Pi Coding Agent packages
455
+ debug Inspect local Pibo data
456
+ data Inspect and maintain Pibo data stores
457
+ compute Manage Pibo Docker compute workers
458
+ resources Inspect and safely reap managed compute and browser resources
459
+ setup Plan user-host installs and developer-host upgrades
460
+ skills Manage Pibo user skills
461
+ cron Manage scheduled Pibo jobs
462
+ ralph Manage continuous Ralph jobs
463
+ vscode Manage the Pibo VS Code extension
464
+ profile Inspect a pibo profile, including active saved Chat custom agents
465
+ tui Start the direct Pi TUI
466
+ tui:routed Start the local routed Pibo TUI
467
+ tui:sessions Start the reduced Web Chat-derived session UI
468
+ gateway Inspect and restart host gateways through safe CLI commands
469
+ gateway:web Start a web gateway runtime (use --auth=local for loopback-only local auth)
470
+
471
+ Options:
472
+ --version Print the Pibo CLI version
473
+
474
+ Next:
475
+ pibo <command> --help
476
476
  `;
477
477
  }
478
478
  function printConfigDiscoveryText() {
479
- return `pibo config - local config at ${getDefaultPiboConfigPath()}
480
-
481
- Commands:
482
- keys List supported config keys
483
- show Print redacted config JSON
484
- get <key> Print one redacted config value
485
- set <key> <value> Set one config value
486
- del <key> Delete one config value
487
-
488
- Next:
489
- pibo config keys
479
+ return `pibo config - local config at ${getDefaultPiboConfigPath()}
480
+
481
+ Commands:
482
+ keys List supported config keys
483
+ show Print redacted config JSON
484
+ get <key> Print one redacted config value
485
+ set <key> <value> Set one config value
486
+ del <key> Delete one config value
487
+
488
+ Next:
489
+ pibo config keys
490
490
  `;
491
491
  }
@@ -188,16 +188,16 @@ export async function runComputeCli(argv) {
188
188
  .helpOption("-h, --help", "Show help")
189
189
  .showHelpAfterError()
190
190
  .helpCommand("help [command]", "Show help for command")
191
- .addHelpText("after", `
192
- Examples:
193
- $ pibo compute spawn
194
- $ pibo compute dev spawn --worktree my-fix
195
- $ pibo compute list
196
- $ pibo compute release pibo-worker-abc123
197
-
198
- Next:
199
- $ pibo compute spawn --help
200
- $ pibo compute dev --help
191
+ .addHelpText("after", `
192
+ Examples:
193
+ $ pibo compute spawn
194
+ $ pibo compute dev spawn --worktree my-fix
195
+ $ pibo compute list
196
+ $ pibo compute release pibo-worker-abc123
197
+
198
+ Next:
199
+ $ pibo compute spawn --help
200
+ $ pibo compute dev --help
201
201
  `);
202
202
  program
203
203
  .command("spawn")
@@ -208,11 +208,11 @@ Next:
208
208
  .option("--idle-seconds <n>", "Tag the worker idle retention in seconds")
209
209
  .option("--ralph-job-id <id>", "Tag the Ralph job id when this worker is Ralph-owned")
210
210
  .option("--ralph-run-id <id>", "Tag the Ralph run id when this worker is Ralph-owned")
211
- .addHelpText("after", `
212
- Creates a worker container and starts the gateway. Prints JSON with the container id and mapped ports.
213
-
214
- Use this for quick isolated checks. For code changes, prefer:
215
- $ pibo compute dev spawn --worktree my-fix
211
+ .addHelpText("after", `
212
+ Creates a worker container and starts the gateway. Prints JSON with the container id and mapped ports.
213
+
214
+ Use this for quick isolated checks. For code changes, prefer:
215
+ $ pibo compute dev spawn --worktree my-fix
216
216
  `)
217
217
  .action(async (options) => {
218
218
  await mkdir(path.dirname(HASH_FILE), { recursive: true });
@@ -238,11 +238,11 @@ Use this for quick isolated checks. For code changes, prefer:
238
238
  .command("dev")
239
239
  .description("Manage development workers with Git worktrees")
240
240
  .helpCommand("help [command]", "Show help for command")
241
- .addHelpText("after", `
242
- Use dev workers for Pibo code changes. Each worker gets its own Git worktree and port block.
243
-
244
- Next:
245
- $ pibo compute dev spawn --help
241
+ .addHelpText("after", `
242
+ Use dev workers for Pibo code changes. Each worker gets its own Git worktree and port block.
243
+
244
+ Next:
245
+ $ pibo compute dev spawn --help
246
246
  `);
247
247
  devCmd
248
248
  .command("spawn")
@@ -254,11 +254,11 @@ Next:
254
254
  .option("--idle-seconds <n>", "Tag the worker idle retention in seconds")
255
255
  .option("--ralph-job-id <id>", "Tag the Ralph job id when this worker is Ralph-owned")
256
256
  .option("--ralph-run-id <id>", "Tag the Ralph run id when this worker is Ralph-owned")
257
- .addHelpText("after", `
258
- Creates .worktrees/<name>, starts a worker, and prints JSON with ports and the worktree path.
259
-
260
- Example:
261
- $ pibo compute dev spawn --worktree my-fix
257
+ .addHelpText("after", `
258
+ Creates .worktrees/<name>, starts a worker, and prints JSON with ports and the worktree path.
259
+
260
+ Example:
261
+ $ pibo compute dev spawn --worktree my-fix
262
262
  `)
263
263
  .action(async (options) => {
264
264
  await mkdir(path.dirname(DEP_HASH_FILE), { recursive: true });
@@ -293,8 +293,8 @@ Example:
293
293
  program
294
294
  .command("rebuild")
295
295
  .description("Rebuild the pibo:latest Docker image")
296
- .addHelpText("after", `
297
- Rebuilds from the current workspace and refreshes compute image hashes.
296
+ .addHelpText("after", `
297
+ Rebuilds from the current workspace and refreshes compute image hashes.
298
298
  `)
299
299
  .action(async () => {
300
300
  console.error(`Rebuilding ${IMAGE_NAME} from ${WORKSPACE_DIR}...`);
@@ -309,11 +309,11 @@ Rebuilds from the current workspace and refreshes compute image hashes.
309
309
  .option("--all", "Include stopped, exited, dead, and restarting Pibo workers")
310
310
  .option("--json", "Print machine-readable worker metadata")
311
311
  .option("--verbose", "Show full Docker port bindings in text output")
312
- .addHelpText("after", `
313
- Shows each worker's name, role, status, mapped ports, creation time, holder, and Ralph labels when present.
314
-
315
- Next:
316
- $ pibo compute list --all --json
312
+ .addHelpText("after", `
313
+ Shows each worker's name, role, status, mapped ports, creation time, holder, and Ralph labels when present.
314
+
315
+ Next:
316
+ $ pibo compute list --all --json
317
317
  `)
318
318
  .action(async (options) => {
319
319
  const workers = await listWorkers({ all: options.all === true });
@@ -330,14 +330,14 @@ Next:
330
330
  .option("--json", "Print machine-readable resource health")
331
331
  .option("--browser-pool-root <path>", "Browser pool root directory to scan")
332
332
  .option("--browser-use-home <path>", "Browser-use home directory to scan for stale CDP files")
333
- .addHelpText("after", `
334
- Reports browser main-process counts, active browser-pool leases, stale CDP files, dirty/OOM workers, Docker disk pressure, and reaper/timer status.
335
- The command is read-only and never reaps, prunes, stops, or removes resources.
336
-
337
- Next:
338
- $ pibo compute health --json
339
- $ pibo tools browser-use pool reap --json
340
- $ pibo compute reap --dry-run --json
333
+ .addHelpText("after", `
334
+ Reports browser main-process counts, active browser-pool leases, stale CDP files, dirty/OOM workers, Docker disk pressure, and reaper/timer status.
335
+ The command is read-only and never reaps, prunes, stops, or removes resources.
336
+
337
+ Next:
338
+ $ pibo compute health --json
339
+ $ pibo tools browser-use pool reap --json
340
+ $ pibo compute reap --dry-run --json
341
341
  `)
342
342
  .action(async (options) => {
343
343
  const health = await getComputeResourceHealth({ browserPoolRoot: options.browserPoolRoot, browserUseHome: options.browserUseHome });
@@ -352,13 +352,13 @@ Next:
352
352
  .alias("disk")
353
353
  .description("Show read-only Docker disk and build-cache diagnostics")
354
354
  .option("--json", "Print machine-readable disk diagnostics")
355
- .addHelpText("after", `
356
- Reports Docker image, container, local volume, and build-cache usage without pruning anything.
357
- Cleanup suggestions distinguish compute containers, images, build cache, and Git worktrees.
358
-
359
- Next:
360
- $ pibo compute diagnostics --json
361
- $ pibo compute reap --dry-run --json
355
+ .addHelpText("after", `
356
+ Reports Docker image, container, local volume, and build-cache usage without pruning anything.
357
+ Cleanup suggestions distinguish compute containers, images, build cache, and Git worktrees.
358
+
359
+ Next:
360
+ $ pibo compute diagnostics --json
361
+ $ pibo compute reap --dry-run --json
362
362
  `)
363
363
  .action(async (options) => {
364
364
  const diagnostics = await getComputeDiskDiagnostics();
@@ -372,9 +372,9 @@ Next:
372
372
  .command("release")
373
373
  .description("Stop and remove a worker container")
374
374
  .argument("<id>", "Container name or ID")
375
- .addHelpText("after", `
376
- Use the name or id shown by:
377
- $ pibo compute list
375
+ .addHelpText("after", `
376
+ Use the name or id shown by:
377
+ $ pibo compute list
378
378
  `)
379
379
  .action(async (id) => {
380
380
  await releaseWorker(id);
@@ -390,10 +390,10 @@ Use the name or id shown by:
390
390
  .option("--dry-run", "Preview the cleanup plan without removing containers")
391
391
  .option("--apply", "Apply the cleanup plan and remove selected containers")
392
392
  .option("--json", "Print machine-readable cleanup plan/result")
393
- .addHelpText("after", `
394
- Defaults to a dry-run plan for one-time workers. Dev workers require --include-dev.
395
- Stopped, dirty/OOM, and old workers are selected unless disabled by selector flags.
396
- Worktrees are preserved; container cleanup never deletes Git worktrees.
393
+ .addHelpText("after", `
394
+ Defaults to a dry-run plan for one-time workers. Dev workers require --include-dev.
395
+ Stopped, dirty/OOM, and old workers are selected unless disabled by selector flags.
396
+ Worktrees are preserved; container cleanup never deletes Git worktrees.
397
397
  `)
398
398
  .action(async (options) => {
399
399
  const maxAge = Number(options.maxAgeMinutes);
@@ -189,10 +189,13 @@ export class PiboSessionRouter {
189
189
  if (event.type === "message") {
190
190
  return session.enqueueMessage(event);
191
191
  }
192
- const output = await session.executeAction(event);
193
192
  if (event.action === "abort") {
194
193
  this.signalRegistry.project({ type: "session_interrupted", piboSessionId: event.piboSessionId, reason: "abort action" });
195
194
  }
195
+ else if (event.action === "dispose" || event.action === "kill" || event.action === "kill_all") {
196
+ this.signalRegistry.project({ type: "session_disposed", piboSessionId: event.piboSessionId, reason: `${event.action} action` });
197
+ }
198
+ const output = await session.executeAction(event);
196
199
  if (event.action === "dispose") {
197
200
  await this.disposeSessionSubtree(event.piboSessionId, "dispose action", { cancelRuns: true });
198
201
  }
@@ -213,12 +216,12 @@ export class PiboSessionRouter {
213
216
  const cancelledRuns = [];
214
217
  const session = this.sessions.get(piboSessionId);
215
218
  if (session) {
219
+ this.signalRegistry.project({ type: "session_disposed", piboSessionId, reason: "kill" });
216
220
  killed.push(await session.kill());
217
221
  if (options?.includeRuns) {
218
222
  const runs = this.runRegistry.cancelControllerRuns(piboSessionId);
219
223
  cancelledRuns.push(...runs.map((r) => r.runId));
220
224
  }
221
- this.signalRegistry.project({ type: "session_interrupted", piboSessionId, reason: "kill" });
222
225
  const children = await this.killChildSessions(piboSessionId, options);
223
226
  killed.push(...children.killed);
224
227
  cancelledRuns.push(...children.cancelledRuns);
package/dist/cron/cli.js CHANGED
@@ -2,21 +2,21 @@ import { Command } from "commander";
2
2
  import { parseFriendlySchedule } from "./schedule.js";
3
3
  import { createDefaultPiboCronStore } from "./store.js";
4
4
  function printDiscovery() {
5
- console.log(`pibo cron
6
-
7
- Manage scheduled Pibo agent jobs.
8
-
9
- Commands:
10
- status Show scheduler store status
11
- list List cron jobs
12
- add Create a cron job
13
- edit Update a cron job
14
- pause Disable a cron job
15
- resume Enable a cron job and recompute next run
16
- remove Delete a cron job
17
- runs List cron runs
18
-
19
- Next: pibo cron add --help
5
+ console.log(`pibo cron
6
+
7
+ Manage scheduled Pibo agent jobs.
8
+
9
+ Commands:
10
+ status Show scheduler store status
11
+ list List cron jobs
12
+ add Create a cron job
13
+ edit Update a cron job
14
+ pause Disable a cron job
15
+ resume Enable a cron job and recompute next run
16
+ remove Delete a cron job
17
+ runs List cron runs
18
+
19
+ Next: pibo cron add --help
20
20
  pibo cron edit --help`);
21
21
  }
22
22
  function printJson(value) {
@@ -172,10 +172,10 @@ export class PiboCronStore {
172
172
  const result = [];
173
173
  this.db.exec("BEGIN IMMEDIATE");
174
174
  try {
175
- const rows = this.db.prepare(`
176
- SELECT * FROM pibo_cron_jobs
177
- WHERE enabled = 1
178
- ORDER BY updated_at ASC
175
+ const rows = this.db.prepare(`
176
+ SELECT * FROM pibo_cron_jobs
177
+ WHERE enabled = 1
178
+ ORDER BY updated_at ASC
179
179
  `).all();
180
180
  for (const row of rows) {
181
181
  if (result.length >= limit)
@@ -242,10 +242,10 @@ export class PiboCronStore {
242
242
  lastPiboSessionId: input.piboSessionId ?? job.state.lastPiboSessionId,
243
243
  consecutiveErrors: input.status === "error" ? (job.state.consecutiveErrors ?? 0) + 1 : 0,
244
244
  };
245
- this.db.prepare(`
246
- UPDATE pibo_cron_runs
247
- SET status = ?, pibo_session_id = ?, reason = ?, error = ?, completed_at = ?, updated_at = ?
248
- WHERE id = ?
245
+ this.db.prepare(`
246
+ UPDATE pibo_cron_runs
247
+ SET status = ?, pibo_session_id = ?, reason = ?, error = ?, completed_at = ?, updated_at = ?
248
+ WHERE id = ?
249
249
  `).run(input.status, input.piboSessionId ?? null, input.reason ?? null, input.error ?? null, timestamp, timestamp, input.runId);
250
250
  this.db.prepare(`UPDATE pibo_cron_jobs SET enabled = ?, state_json = ?, updated_at = ? WHERE id = ?`).run(enabled ? 1 : 0, JSON.stringify(state), timestamp, job.id);
251
251
  if (job.deleteAfterRun && job.schedule.kind === "at" && input.status === "ok") {
@@ -286,50 +286,50 @@ export class PiboCronStore {
286
286
  this.createFreshSchema();
287
287
  }
288
288
  createFreshSchema() {
289
- this.db.exec(`
290
- CREATE TABLE IF NOT EXISTS pibo_cron_jobs (
291
- id TEXT PRIMARY KEY,
292
- name TEXT NOT NULL,
293
- description TEXT,
294
- enabled INTEGER NOT NULL,
295
- target_json TEXT NOT NULL,
296
- profile TEXT NOT NULL,
297
- prompt TEXT NOT NULL,
298
- schedule_json TEXT NOT NULL,
299
- schedule_ui_json TEXT,
300
- delete_after_run INTEGER NOT NULL DEFAULT 0,
301
- state_json TEXT NOT NULL,
302
- created_at TEXT NOT NULL,
303
- updated_at TEXT NOT NULL
304
- );
305
- CREATE INDEX IF NOT EXISTS idx_pibo_cron_jobs_enabled ON pibo_cron_jobs(enabled, updated_at DESC);
306
-
307
- CREATE TABLE IF NOT EXISTS pibo_cron_runs (
308
- id TEXT PRIMARY KEY,
309
- job_id TEXT NOT NULL,
310
- pibo_session_id TEXT,
311
- status TEXT NOT NULL,
312
- reason TEXT,
313
- error TEXT,
314
- started_at TEXT,
315
- completed_at TEXT,
316
- created_at TEXT NOT NULL,
317
- updated_at TEXT NOT NULL
318
- );
319
- CREATE INDEX IF NOT EXISTS idx_pibo_cron_runs_job_created ON pibo_cron_runs(job_id, created_at DESC);
289
+ this.db.exec(`
290
+ CREATE TABLE IF NOT EXISTS pibo_cron_jobs (
291
+ id TEXT PRIMARY KEY,
292
+ name TEXT NOT NULL,
293
+ description TEXT,
294
+ enabled INTEGER NOT NULL,
295
+ target_json TEXT NOT NULL,
296
+ profile TEXT NOT NULL,
297
+ prompt TEXT NOT NULL,
298
+ schedule_json TEXT NOT NULL,
299
+ schedule_ui_json TEXT,
300
+ delete_after_run INTEGER NOT NULL DEFAULT 0,
301
+ state_json TEXT NOT NULL,
302
+ created_at TEXT NOT NULL,
303
+ updated_at TEXT NOT NULL
304
+ );
305
+ CREATE INDEX IF NOT EXISTS idx_pibo_cron_jobs_enabled ON pibo_cron_jobs(enabled, updated_at DESC);
306
+
307
+ CREATE TABLE IF NOT EXISTS pibo_cron_runs (
308
+ id TEXT PRIMARY KEY,
309
+ job_id TEXT NOT NULL,
310
+ pibo_session_id TEXT,
311
+ status TEXT NOT NULL,
312
+ reason TEXT,
313
+ error TEXT,
314
+ started_at TEXT,
315
+ completed_at TEXT,
316
+ created_at TEXT NOT NULL,
317
+ updated_at TEXT NOT NULL
318
+ );
319
+ CREATE INDEX IF NOT EXISTS idx_pibo_cron_runs_job_created ON pibo_cron_runs(job_id, created_at DESC);
320
320
  `);
321
321
  }
322
322
  insertJob(job) {
323
- this.db.prepare(`
324
- INSERT INTO pibo_cron_jobs (id, name, description, enabled, target_json, profile, prompt, schedule_json, schedule_ui_json, delete_after_run, state_json, created_at, updated_at)
325
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
323
+ this.db.prepare(`
324
+ INSERT INTO pibo_cron_jobs (id, name, description, enabled, target_json, profile, prompt, schedule_json, schedule_ui_json, delete_after_run, state_json, created_at, updated_at)
325
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
326
326
  `).run(job.id, job.name, job.description ?? null, job.enabled ? 1 : 0, targetJson(job.target), job.profile, job.prompt, JSON.stringify(job.schedule), job.scheduleUi ? JSON.stringify(job.scheduleUi) : null, job.deleteAfterRun ? 1 : 0, JSON.stringify(job.state), job.createdAt, job.updatedAt);
327
327
  }
328
328
  writeJob(job) {
329
- this.db.prepare(`
330
- UPDATE pibo_cron_jobs
331
- SET name = ?, description = ?, enabled = ?, target_json = ?, profile = ?, prompt = ?, schedule_json = ?, schedule_ui_json = ?, delete_after_run = ?, state_json = ?, updated_at = ?
332
- WHERE id = ?
329
+ this.db.prepare(`
330
+ UPDATE pibo_cron_jobs
331
+ SET name = ?, description = ?, enabled = ?, target_json = ?, profile = ?, prompt = ?, schedule_json = ?, schedule_ui_json = ?, delete_after_run = ?, state_json = ?, updated_at = ?
332
+ WHERE id = ?
333
333
  `).run(job.name, job.description ?? null, job.enabled ? 1 : 0, targetJson(job.target), job.profile, job.prompt, JSON.stringify(job.schedule), job.scheduleUi ? JSON.stringify(job.scheduleUi) : null, job.deleteAfterRun ? 1 : 0, JSON.stringify(job.state), job.updatedAt, job.id);
334
334
  }
335
335
  updateJobStateLocked(id, state, updatedAt) {
@@ -337,9 +337,9 @@ export class PiboCronStore {
337
337
  }
338
338
  createRunLocked(job, timestamp, status, reason) {
339
339
  const run = { id: `crun_${randomUUID()}`, jobId: job.id, status, reason, startedAt: timestamp, createdAt: timestamp, updatedAt: timestamp };
340
- this.db.prepare(`
341
- INSERT INTO pibo_cron_runs (id, job_id, pibo_session_id, status, reason, error, started_at, completed_at, created_at, updated_at)
342
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
340
+ this.db.prepare(`
341
+ INSERT INTO pibo_cron_runs (id, job_id, pibo_session_id, status, reason, error, started_at, completed_at, created_at, updated_at)
342
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
343
343
  `).run(run.id, run.jobId, null, run.status, run.reason ?? null, null, run.startedAt ?? null, null, run.createdAt, run.updatedAt);
344
344
  return run;
345
345
  }
package/dist/data/cli.js CHANGED
@@ -102,19 +102,19 @@ function migrateSessionsToV2(input) {
102
102
  "channel", "kind", "profile", "active_model_json", "workspace", "title", "status",
103
103
  "metadata_json", "created_at", "updated_at", "last_activity_at",
104
104
  ];
105
- target.db.prepare(`
106
- INSERT INTO sessions (${columns.join(", ")})
107
- VALUES (${columns.map(() => "?").join(", ")})
105
+ target.db.prepare(`
106
+ INSERT INTO sessions (${columns.join(", ")})
107
+ VALUES (${columns.map(() => "?").join(", ")})
108
108
  `).run(row.id, row.pi_session_id, typeof metadata.chatRoomId === "string" ? metadata.chatRoomId : null, rootSessionId, row.parent_id, row.origin_id, row.channel, row.kind, row.profile, row.active_model_json, row.workspace, row.title ?? "Untitled Session", "idle", JSON.stringify(metadata), row.created_at, row.updated_at, row.updated_at);
109
109
  report.inserted++;
110
110
  }
111
111
  else if (row.updated_at > existing.updated_at) {
112
- target.db.prepare(`
113
- UPDATE sessions SET
114
- pi_session_id = ?, root_session_id = ?, parent_id = ?, origin_id = ?,
115
- channel = ?, kind = ?, profile = ?, active_model_json = ?, workspace = ?, title = ?,
116
- metadata_json = ?, updated_at = ?, last_activity_at = MAX(last_activity_at, ?)
117
- WHERE id = ?
112
+ target.db.prepare(`
113
+ UPDATE sessions SET
114
+ pi_session_id = ?, root_session_id = ?, parent_id = ?, origin_id = ?,
115
+ channel = ?, kind = ?, profile = ?, active_model_json = ?, workspace = ?, title = ?,
116
+ metadata_json = ?, updated_at = ?, last_activity_at = MAX(last_activity_at, ?)
117
+ WHERE id = ?
118
118
  `).run(row.pi_session_id, rootSessionId, row.parent_id, row.origin_id, row.channel, row.kind, row.profile, row.active_model_json, row.workspace, row.title ?? "Untitled Session", JSON.stringify(metadata), row.updated_at, row.updated_at, row.id);
119
119
  report.updated++;
120
120
  }
@@ -166,19 +166,19 @@ function printInventory(stores) {
166
166
  }
167
167
  }
168
168
  function printDataHelp() {
169
- console.log(`pibo data - inspect and maintain Pibo data stores
170
-
171
- Commands:
172
- inventory Read-only row counts, sizes, WAL sizes, and integrity checks; legacy-* rows are archived stores
173
- migrate sessions-to-v2 Import an explicit legacy pibo-sessions.sqlite into pibo.sqlite idempotently
174
-
175
- Options:
176
- --json Print machine-readable JSON
177
- --root DIR Inspect a specific Pibo home directory instead of ~/.pibo
178
- --to FILE Target pibo.sqlite path for migration or repair
179
-
180
- Next:
181
- pibo data inventory --json
182
- pibo data migrate sessions-to-v2 --from /path/to/pibo-sessions.sqlite --json
169
+ console.log(`pibo data - inspect and maintain Pibo data stores
170
+
171
+ Commands:
172
+ inventory Read-only row counts, sizes, WAL sizes, and integrity checks; legacy-* rows are archived stores
173
+ migrate sessions-to-v2 Import an explicit legacy pibo-sessions.sqlite into pibo.sqlite idempotently
174
+
175
+ Options:
176
+ --json Print machine-readable JSON
177
+ --root DIR Inspect a specific Pibo home directory instead of ~/.pibo
178
+ --to FILE Target pibo.sqlite path for migration or repair
179
+
180
+ Next:
181
+ pibo data inventory --json
182
+ pibo data migrate sessions-to-v2 --from /path/to/pibo-sessions.sqlite --json
183
183
  `);
184
184
  }