@pasko70/pibo 1.1.0 → 1.3.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/README.md +106 -254
- package/context/codex-base-prompt.md +4 -0
- package/context/compute-worker.md +23 -0
- package/context/pibo-native-tooling.md +18 -0
- package/context/pibo-system-prompt.md +69 -8
- package/dist/api/simple-agent-api.js +136 -0
- package/dist/app-context.js +4 -0
- package/dist/apps/chat/agent-profiles.js +18 -3
- package/dist/apps/chat/agent-store.js +113 -16
- package/dist/apps/chat/chat-api-routes.js +311 -0
- package/dist/apps/chat/chat-capability-routes.js +90 -0
- package/dist/apps/chat/chat-files.js +178 -0
- package/dist/apps/chat/chat-request-normalizers.js +681 -0
- package/dist/apps/chat/chat-settings-routes.js +75 -0
- package/dist/apps/chat/chat-trace-helpers.js +94 -0
- package/dist/apps/chat/chat-user-skill-routes.js +149 -0
- package/dist/apps/chat/cron-api.js +213 -0
- package/dist/apps/chat/data/chat-data-mappers.js +74 -0
- package/dist/apps/chat/data/event-command-service.js +75 -0
- package/dist/apps/chat/data/navigation-query-service.js +11 -0
- package/dist/apps/chat/data/project-service.js +844 -0
- package/dist/apps/chat/data/read-state-service.js +42 -0
- package/dist/apps/chat/data/room-service.js +52 -0
- package/dist/apps/chat/data/session-query-service.js +63 -0
- package/dist/apps/chat/data/timeline-query-service.js +96 -0
- package/dist/apps/chat/event-log.js +1 -307
- package/dist/apps/chat/model-catalog.js +7 -2
- package/dist/apps/chat/output-compactor.js +126 -0
- package/dist/apps/chat/output-event-policy.js +17 -0
- package/dist/apps/chat/project-workflow-human-actions.js +347 -0
- package/dist/apps/chat/project-workflow-sessions.js +260 -0
- package/dist/apps/chat/provider-auth-actions.js +43 -0
- package/dist/apps/chat/ralph-api.js +156 -0
- package/dist/apps/chat/read-model.js +1 -218
- package/dist/apps/chat/rooms.js +1 -321
- package/dist/apps/chat/static-assets.js +996 -0
- package/dist/apps/chat/stream.js +29 -6
- package/dist/apps/chat/trace.js +179 -1003
- package/dist/apps/chat/types/event-store.js +1 -0
- package/dist/apps/chat/types/read-model.js +1 -0
- package/dist/apps/chat/types/rooms.js +36 -0
- package/dist/apps/chat/web-app.js +3131 -1959
- package/dist/apps/chat/workflow-catalog.js +572 -0
- package/dist/apps/chat/workflow-edge-compatibility.js +51 -0
- package/dist/apps/chat/workflow-json-schema-validation.js +335 -0
- package/dist/apps/chat/workflow-persistence-model.js +140 -0
- package/dist/apps/chat/workflow-persistence.js +633 -0
- package/dist/apps/chat/workflow-registered-ref-params.js +130 -0
- package/dist/apps/chat/workflow-registered-ref-pickers.js +179 -0
- package/dist/apps/chat/workflow-registered-ref-validation.js +210 -0
- package/dist/apps/chat/workflow-v2-security-validation.js +93 -0
- package/dist/apps/chat/workflow-validation-helpers.js +114 -0
- package/dist/apps/chat-ui/assets/{dist-CNLWH2qh.js → dist-B4lw9z4F.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-8e4L8ciw.js → dist-BbTaHWON.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CMZOa5ik.js → dist-BcT_c1EJ.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-DNcnQRPF.js → dist-CGINd7XU.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CqqUC8Ce.js → dist-CrBzZkUp.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-D2N4-LIc.js → dist-CyyISotB.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CUqpST5w.js → dist-DFbnFNpX.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CspjOeBj.js → dist-DGLWQLX8.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-B7bbI3Qz.js → dist-DfcIkFSN.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-v4pjHlB7.js → dist-sKDHTwaT.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-D9L4MSRF.js → dist-y9D6la48.js} +1 -1
- package/dist/apps/chat-ui/assets/index-C25VYnyb.css +1 -0
- package/dist/apps/chat-ui/assets/index-CUkuvI3v.js +165 -0
- package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-144x144.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-192x192.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-48x48.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-512x512.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-72x72.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-96x96.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/1024.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/114.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/120.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/128.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/144.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/152.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/16.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/167.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/180.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/192.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/20.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/256.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/29.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/32.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/40.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/50.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/512.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/57.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/58.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/60.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/64.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/72.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/76.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/80.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/ios/87.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-125.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-150.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-200.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-400.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-125.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-150.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-200.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-400.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-125.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-150.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-200.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-400.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-125.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-150.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-200.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-400.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-16.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-20.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-24.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-256.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-30.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-32.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-36.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-40.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-44.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-48.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-60.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-64.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-72.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-80.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-96.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-16.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-20.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-24.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-256.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-30.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-32.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-36.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-40.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-44.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-48.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-60.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-64.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-72.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-80.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-96.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-125.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-150.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-200.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-400.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-16.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-20.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-24.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-256.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-30.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-32.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-36.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-40.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-44.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-48.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-60.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-64.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-72.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-80.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-96.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-125.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-150.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-200.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-400.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-100.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-125.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-150.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-200.png +0 -0
- package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-400.png +0 -0
- package/dist/apps/chat-ui/index.html +8 -3
- package/dist/apps/chat-ui/manifest.webmanifest +25 -0
- package/dist/apps/chat-ui/sw.js +41 -0
- package/dist/apps/chat-vscode-web/assets/index-B5QK07zO.css +2 -0
- package/dist/apps/chat-vscode-web/assets/index-C3GTPyDo.js +41 -0
- package/dist/apps/chat-vscode-web/index.html +14 -0
- package/dist/apps/cli-ui/InkSessionApp.js +1218 -0
- package/dist/apps/cli-ui/InkTerminalLine.js +53 -0
- package/dist/apps/cli-ui/InkTerminalRow.js +304 -0
- package/dist/apps/cli-ui/InkTerminalView.js +25 -0
- package/dist/apps/cli-ui/cliSessionsCommand.js +232 -0
- package/dist/apps/cli-ui/index.js +8 -0
- package/dist/apps/cli-ui/inkColors.js +67 -0
- package/dist/apps/cli-ui/inkJson.js +244 -0
- package/dist/apps/cli-ui/inkMarkdown.js +122 -0
- package/dist/apps/context-files-ui/assets/{dist-DFi2YGux.js → dist-BOiGdrG-.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-DyfSeBMu.js → dist-DK01b7x4.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-CwbH_3RN.js → dist-DPG9jOQ-.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-dTBsFYAl.js → dist-Dp5AH00p.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-CxRLRmMx.js → dist-DqYw0LH7.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-MyZgX9K2.js → dist-TF5iO5ML.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-DQXzt2Ng.js → dist-TbjAhles.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-YwR9dpb-.js → dist-ZsBbt0uY.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-CKQF1zEu.js → dist-kmsvtHkH.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dist-BJW3917N.js → dist-vnd7PMu3.js} +1 -1
- package/dist/apps/context-files-ui/assets/{index-BwRDoHMC.css → index-B92tL3Pp.css} +1 -1
- package/dist/apps/context-files-ui/assets/{index-GwvjXytt.js → index-BhAWD3dv.js} +2 -2
- package/dist/apps/context-files-ui/index.html +2 -2
- package/dist/apps/vscode-artifacts/latest.vsix +0 -0
- package/dist/apps/vscode-artifacts/pibo-vscode-1.3.0.vsix +0 -0
- package/dist/auth/better-auth.js +2 -1
- package/dist/auth/login-actions.js +251 -0
- package/dist/auth/openai-codex-usage.js +147 -0
- package/dist/bin/pibo.js +0 -0
- package/dist/bin/rg.js +15 -0
- package/dist/cli-session/fakeSessionSource.js +804 -0
- package/dist/cli-session/index.js +3 -0
- package/dist/cli-session/localSessionSource.js +1144 -0
- package/dist/cli-session/sessionSource.js +13 -0
- package/dist/cli.js +159 -14
- package/dist/compute/cli.js +415 -0
- package/dist/compute/docker.js +827 -0
- package/dist/compute/resource-health.js +333 -0
- package/dist/compute/resource-policy.js +98 -0
- package/dist/config/config.js +9 -5
- package/dist/core/context-build.js +677 -0
- package/dist/core/model-defaults.js +51 -9
- package/dist/core/pibo-home.js +8 -0
- package/dist/core/profiles.js +48 -0
- package/dist/core/provider-telemetry.js +222 -0
- package/dist/core/routed-session.js +441 -47
- package/dist/core/runtime-telemetry.js +853 -0
- package/dist/core/runtime.js +103 -15
- package/dist/core/session-errors.js +47 -0
- package/dist/core/session-model.js +39 -0
- package/dist/core/session-router.js +292 -62
- package/dist/core/shared-app.js +17 -0
- package/dist/core/skill-expansion.js +43 -0
- package/dist/core/system-prompt-template.js +9 -9
- package/dist/core/telemetry-staleness.js +128 -0
- package/dist/core/test-output-compaction.js +145 -0
- package/dist/core/user-settings.js +73 -0
- package/dist/cron/channel.js +28 -0
- package/dist/cron/cli.js +230 -0
- package/dist/cron/plugin.js +11 -0
- package/dist/cron/schedule.js +214 -0
- package/dist/cron/service.js +177 -0
- package/dist/cron/store.js +349 -0
- package/dist/cron/types.js +1 -0
- package/dist/data/cli.js +184 -0
- package/dist/data/event-log.js +106 -0
- package/dist/data/final-app-space-cutover-migration.js +728 -0
- package/dist/data/ingest-service.js +389 -0
- package/dist/data/message-store.js +62 -0
- package/dist/data/navigation-store.js +75 -0
- package/dist/data/observation-store.js +46 -0
- package/dist/data/payload-store.js +144 -0
- package/dist/data/pibo-store.js +59 -0
- package/dist/data/schema.js +434 -0
- package/dist/data/session-store.js +63 -0
- package/dist/data/shared-app-migration.js +757 -0
- package/dist/data/sqlite-schema.js +12 -0
- package/dist/data/telemetry-preview.js +65 -0
- package/dist/data/telemetry-queries.js +212 -0
- package/dist/data/telemetry-retention.js +50 -0
- package/dist/data/telemetry-rows.js +158 -0
- package/dist/data/telemetry.js +357 -0
- package/dist/debug/delta-compaction.js +99 -0
- package/dist/debug/detail-format.js +86 -0
- package/dist/debug/events.js +149 -29
- package/dist/debug/failures.js +162 -0
- package/dist/debug/index.js +655 -30
- package/dist/debug/messages.js +185 -0
- package/dist/debug/next-commands.js +6 -0
- package/dist/debug/payloads.js +123 -0
- package/dist/debug/pty.js +924 -0
- package/dist/debug/session.js +45 -15
- package/dist/debug/sql.js +1 -1
- package/dist/debug/stores.js +18 -13
- package/dist/debug/summary.js +72 -0
- package/dist/debug/telemetry.js +649 -0
- package/dist/debug/tools.js +168 -0
- package/dist/debug/trace-render-check.js +151 -0
- package/dist/debug/trace.js +152 -27
- package/dist/debug/web-artifacts.js +63 -0
- package/dist/debug/web-options.js +313 -0
- package/dist/debug/web-render-analysis.js +310 -0
- package/dist/debug/web-snapshot-browser-scripts.js +303 -0
- package/dist/debug/web-streaming-benchmark-analysis.js +605 -0
- package/dist/debug/web-streaming-browser-library.js +928 -0
- package/dist/debug/web-streaming-browser-scripts.js +242 -0
- package/dist/debug/web-streaming-provider-telemetry.js +194 -0
- package/dist/debug/web-streaming-report.js +493 -0
- package/dist/debug/web-streaming-types.js +1 -0
- package/dist/debug/web.js +574 -0
- package/dist/gateway/backup.js +83 -0
- package/dist/gateway/cli.js +511 -0
- package/dist/gateway/fallback.js +155 -0
- package/dist/gateway/pidfile.js +84 -0
- package/dist/gateway/protocol.js +16 -0
- package/dist/gateway/server.js +172 -17
- package/dist/gateway/tool.js +54 -51
- package/dist/gateway/web.js +74 -2
- package/dist/index.js +3 -1
- package/dist/local/client.js +3 -3
- package/dist/local/extension.js +8 -5
- package/dist/plugins/builtin.js +251 -49
- package/dist/plugins/chat-vscode-web.js +28 -0
- package/dist/plugins/codex-compat.js +0 -41
- package/dist/plugins/context-files.js +98 -18
- package/dist/plugins/dev-auth.js +124 -0
- package/dist/plugins/native-tooling.js +15 -0
- package/dist/plugins/registry.js +49 -1
- package/dist/plugins/web-annotations.js +27 -0
- package/dist/providers/minimax.js +70 -0
- package/dist/providers/openai-compat.js +48 -0
- package/dist/ralph/channel.js +8 -0
- package/dist/ralph/cli.js +152 -0
- package/dist/ralph/plugin.js +14 -0
- package/dist/ralph/service.js +271 -0
- package/dist/ralph/stopping.js +151 -0
- package/dist/ralph/store.js +450 -0
- package/dist/ralph/templates.js +200 -0
- package/dist/ralph/types.js +1 -0
- package/dist/reliability/store.js +42 -26
- package/dist/runs/registry.js +72 -35
- package/dist/session-ui/commandCatalog.js +193 -0
- package/dist/session-ui/commandResults.js +95 -0
- package/dist/session-ui/index.js +7 -0
- package/dist/session-ui/ownerViewModel.js +27 -0
- package/dist/session-ui/roomSessionViewModel.js +69 -0
- package/dist/session-ui/statusViewModel.js +127 -0
- package/dist/session-ui/terminalCards.js +210 -0
- package/dist/session-ui/terminalRows.js +937 -0
- package/dist/session-ui/terminalValue.js +45 -0
- package/dist/sessions/pibo-data-store.js +178 -0
- package/dist/sessions/sqlite-store.js +78 -12
- package/dist/sessions/store.js +11 -4
- package/dist/sessions/workflow-session-kind.js +20 -0
- package/dist/setup/cli.js +567 -0
- package/dist/shared/trace-async-agent-runs.js +127 -0
- package/dist/shared/trace-engine.js +96 -0
- package/dist/shared/trace-event-projection.js +679 -0
- package/dist/shared/trace-live-reducer.js +191 -0
- package/dist/shared/trace-nodes.js +76 -0
- package/dist/shared/trace-order.js +11 -10
- package/dist/shared/trace-patch-nodes.js +83 -0
- package/dist/shared/trace-run-notifications.js +69 -0
- package/dist/shared/trace-subagent-links.js +46 -0
- package/dist/shared/trace-transcript.js +303 -0
- package/dist/shared/trace-types.js +1 -0
- package/dist/shared-app.js +4 -0
- package/dist/signals/aggregate.js +65 -0
- package/dist/signals/events.js +1 -0
- package/dist/signals/projector.js +158 -0
- package/dist/signals/registry.js +513 -0
- package/dist/signals/store.js +1 -0
- package/dist/signals/types.js +1 -0
- package/dist/skills/cli.js +117 -0
- package/dist/tools/agent-browser-leases.js +219 -0
- package/dist/tools/agent-browser-wrapper.js +99 -0
- package/dist/tools/browser-pool.js +623 -0
- package/dist/tools/browser-use-cdp.js +56 -4
- package/dist/tools/browser-use-leases.js +215 -37
- package/dist/tools/browser-use-wrapper.js +508 -65
- package/dist/tools/cdp-client.js +189 -0
- package/dist/tools/guides.js +203 -4
- package/dist/tools/index.js +666 -16
- package/dist/tools/npm-runtime.js +136 -0
- package/dist/tools/registry.js +107 -8
- package/dist/tools/runtime/index.js +3 -0
- package/dist/tools/runtime/node-backend.js +225 -0
- package/dist/tools/runtime/node-worker-source.js +206 -0
- package/dist/tools/runtime/python-backend.js +227 -0
- package/dist/tools/runtime/python-worker-source.js +178 -0
- package/dist/tools/runtime/registry.js +255 -0
- package/dist/tools/runtime/tool.js +168 -0
- package/dist/tools/runtime/types.js +1 -0
- package/dist/tools/web-search.js +2 -1
- package/dist/user-skills/installer.js +39 -36
- package/dist/user-skills/store.js +50 -11
- package/dist/vscode/cli.js +90 -0
- package/dist/vscode/code-cli.js +119 -0
- package/dist/vscode/install.js +177 -0
- package/dist/vscode/status.js +80 -0
- package/dist/vscode/types.js +14 -0
- package/dist/vscode/uninstall.js +49 -0
- package/dist/vscode/vsix-fetcher.js +131 -0
- package/dist/web/auth.js +5 -1
- package/dist/web/channel.js +86 -0
- package/dist/web/http.js +79 -14
- package/dist/web-annotations/api.js +348 -0
- package/dist/web-annotations/attachments.js +201 -0
- package/dist/web-annotations/cdp.js +1107 -0
- package/dist/web-annotations/index.js +7 -0
- package/dist/web-annotations/store.js +407 -0
- package/dist/web-annotations/tools.js +350 -0
- package/dist/web-annotations/types.js +34 -0
- package/dist/web-annotations/validation.js +288 -0
- package/docs/README.md +23 -0
- package/docs/ops/install-developer-host.md +112 -0
- package/docs/ops/install-user-host.md +76 -0
- package/docs/ops/upgrade-user-to-developer-host.md +69 -0
- package/docs/ops/vscode-extension-release.md +138 -0
- package/package.json +24 -9
- package/skills/builtin/pi-agent-harness/SKILL.md +24 -24
- package/skills/builtin/pibo-docker-system/SKILL.md +170 -0
- package/skills/builtin/pibo-spec-writing/SKILL.md +330 -0
- package/skills/builtin/prd/SKILL.md +143 -0
- package/skills/builtin/ralph-loop/SKILL.md +359 -0
- package/skills/builtin/ralph-prd-json/SKILL.md +123 -0
- package/skills/builtin/skill-creator/LICENSE.txt +202 -0
- package/skills/builtin/skill-creator/SKILL.md +513 -0
- package/skills/builtin/skill-creator/agents/analyzer.md +274 -0
- package/skills/builtin/skill-creator/agents/comparator.md +202 -0
- package/skills/builtin/skill-creator/agents/grader.md +223 -0
- package/skills/builtin/skill-creator/assets/eval_review.html +146 -0
- package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/builtin/skill-creator/references/schemas.md +430 -0
- package/skills/builtin/skill-creator/scripts/__init__.py +0 -0
- package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/builtin/skill-creator/scripts/generate_report.py +326 -0
- package/skills/builtin/skill-creator/scripts/improve_description.py +247 -0
- package/skills/builtin/skill-creator/scripts/package_skill.py +136 -0
- package/skills/builtin/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/builtin/skill-creator/scripts/run_eval.py +310 -0
- package/skills/builtin/skill-creator/scripts/run_loop.py +328 -0
- package/skills/builtin/skill-creator/scripts/utils.py +47 -0
- package/skills/builtin/web-annotations/SKILL.md +93 -0
- package/dist/apps/chat-ui/assets/index-D2Qxambd.js +0 -151
- package/dist/apps/chat-ui/assets/index-DXx368XK.css +0 -1
- package/dist/env.js +0 -32
- package/dist/plugins/core-tools.js +0 -94
- package/dist/plugins/example.js +0 -67
- package/dist/plugins/remote-agent.js +0 -9
- package/dist/remote/channel.js +0 -176
- package/dist/remote/client.js +0 -92
- package/dist/remote/examples/tui-controller.js +0 -263
- package/dist/remote/protocol.js +0 -55
- package/dist/remote/session-client.js +0 -189
- package/dist/sessions/bindings.js +0 -41
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
return systemPrompt.includes(
|
|
1
|
+
export const PIBO_AVAILABLE_TOOLS_MARKER = "{{availableTools}}";
|
|
2
|
+
export const PIBO_GUIDELINES_MARKER = "{{guidelines}}";
|
|
3
|
+
export function hasPiboSystemPromptTemplateMarkers(systemPrompt) {
|
|
4
|
+
return systemPrompt.includes(PIBO_AVAILABLE_TOOLS_MARKER) || systemPrompt.includes(PIBO_GUIDELINES_MARKER);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
export function buildPiboAvailableTools(options) {
|
|
7
7
|
const tools = options.selectedTools || ["read", "bash", "edit", "write"];
|
|
8
8
|
const visibleTools = tools.filter((name) => !!options.toolSnippets?.[name]);
|
|
9
9
|
if (visibleTools.length === 0)
|
|
10
10
|
return "(none)";
|
|
11
11
|
return visibleTools.map((name) => `- ${name}: ${options.toolSnippets[name]}`).join("\n");
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
export function buildPiboGuidelines(options) {
|
|
14
14
|
const tools = options.selectedTools || ["read", "bash", "edit", "write"];
|
|
15
15
|
const guidelinesList = [];
|
|
16
16
|
const guidelinesSet = new Set();
|
|
@@ -40,11 +40,11 @@ function buildGuidelines(options) {
|
|
|
40
40
|
return guidelinesList.map((guideline) => `- ${guideline}`).join("\n");
|
|
41
41
|
}
|
|
42
42
|
export function renderPiboSystemPromptTemplate(systemPrompt, options) {
|
|
43
|
-
if (!
|
|
43
|
+
if (!hasPiboSystemPromptTemplateMarkers(systemPrompt))
|
|
44
44
|
return systemPrompt;
|
|
45
45
|
return systemPrompt
|
|
46
|
-
.replaceAll(
|
|
47
|
-
.replaceAll(
|
|
46
|
+
.replaceAll(PIBO_AVAILABLE_TOOLS_MARKER, buildPiboAvailableTools(options))
|
|
47
|
+
.replaceAll(PIBO_GUIDELINES_MARKER, buildPiboGuidelines(options));
|
|
48
48
|
}
|
|
49
49
|
export function createPiboSystemPromptTemplateExtension() {
|
|
50
50
|
return (pi) => {
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export const DEFAULT_TELEMETRY_STALE_THRESHOLD_MS = 5 * 60 * 1000;
|
|
2
|
+
export const MIN_TELEMETRY_STALE_THRESHOLD_MS = 1_000;
|
|
3
|
+
export const MAX_TELEMETRY_STALE_THRESHOLD_MS = 24 * 60 * 60 * 1000;
|
|
4
|
+
export function sanitizeTelemetryStaleThresholdSettings(value) {
|
|
5
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
6
|
+
return {};
|
|
7
|
+
const raw = value;
|
|
8
|
+
const settings = {};
|
|
9
|
+
const defaultThresholdMs = sanitizeTelemetryStaleThresholdMs(raw.defaultThresholdMs);
|
|
10
|
+
if (defaultThresholdMs !== undefined)
|
|
11
|
+
settings.defaultThresholdMs = defaultThresholdMs;
|
|
12
|
+
const providers = sanitizeThresholdMap(raw.providers);
|
|
13
|
+
if (Object.keys(providers).length > 0)
|
|
14
|
+
settings.providers = providers;
|
|
15
|
+
const profiles = sanitizeThresholdMap(raw.profiles);
|
|
16
|
+
if (Object.keys(profiles).length > 0)
|
|
17
|
+
settings.profiles = profiles;
|
|
18
|
+
return settings;
|
|
19
|
+
}
|
|
20
|
+
export function resolveTelemetryStaleThreshold(input = {}) {
|
|
21
|
+
const override = sanitizeTelemetryStaleThresholdMs(input.overrideThresholdMs);
|
|
22
|
+
if (override !== undefined)
|
|
23
|
+
return { thresholdMs: override, source: "override" };
|
|
24
|
+
const settings = sanitizeTelemetryStaleThresholdSettings(input.settings);
|
|
25
|
+
const profileKey = lookupKey(settings.profiles, input.profile);
|
|
26
|
+
if (profileKey)
|
|
27
|
+
return { thresholdMs: settings.profiles[profileKey], source: "profile", key: profileKey };
|
|
28
|
+
const providerKey = lookupKey(settings.providers, input.provider);
|
|
29
|
+
if (providerKey)
|
|
30
|
+
return { thresholdMs: settings.providers[providerKey], source: "provider", key: providerKey };
|
|
31
|
+
return {
|
|
32
|
+
thresholdMs: settings.defaultThresholdMs ?? DEFAULT_TELEMETRY_STALE_THRESHOLD_MS,
|
|
33
|
+
source: "default",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export class TelemetryStaleDetector {
|
|
37
|
+
store;
|
|
38
|
+
settings;
|
|
39
|
+
constructor(store, settings = {}) {
|
|
40
|
+
this.store = store;
|
|
41
|
+
this.settings = settings;
|
|
42
|
+
}
|
|
43
|
+
listStaleWork(options = {}) {
|
|
44
|
+
const candidates = this.store.listStaleWork({
|
|
45
|
+
limit: 200,
|
|
46
|
+
now: options.now,
|
|
47
|
+
thresholdMs: 0,
|
|
48
|
+
});
|
|
49
|
+
const limit = normalizeLimit(options.limit);
|
|
50
|
+
const rows = [];
|
|
51
|
+
for (const item of candidates) {
|
|
52
|
+
const timeline = this.store.getTurnTimeline(item.turnId);
|
|
53
|
+
if (!timeline || timeline.turn.status !== "queued" && timeline.turn.status !== "running")
|
|
54
|
+
continue;
|
|
55
|
+
const phase = item.phaseId ? timeline.phases.find((candidate) => candidate.phaseId === item.phaseId) : undefined;
|
|
56
|
+
const providerRequest = providerForStaleItem(item, timeline.providerRequests);
|
|
57
|
+
const profile = typeof timeline.turn.metadata.profile === "string" ? timeline.turn.metadata.profile : undefined;
|
|
58
|
+
const threshold = resolveTelemetryStaleThreshold({
|
|
59
|
+
provider: providerRequest?.provider,
|
|
60
|
+
profile,
|
|
61
|
+
settings: options.settings ?? this.settings,
|
|
62
|
+
overrideThresholdMs: options.thresholdMs,
|
|
63
|
+
});
|
|
64
|
+
if (item.staleForMs < threshold.thresholdMs)
|
|
65
|
+
continue;
|
|
66
|
+
rows.push({
|
|
67
|
+
...item,
|
|
68
|
+
phase: phase?.name ?? item.phase,
|
|
69
|
+
activePhase: phase?.name ?? item.phase,
|
|
70
|
+
lastProgressAt: item.lastProgressAt ?? phase?.lastProgressAt ?? phase?.startedAt,
|
|
71
|
+
thresholdMs: threshold.thresholdMs,
|
|
72
|
+
appliedThresholdMs: threshold.thresholdMs,
|
|
73
|
+
thresholdSource: threshold.source,
|
|
74
|
+
thresholdKey: threshold.key,
|
|
75
|
+
provider: providerRequest?.provider,
|
|
76
|
+
model: providerRequest?.model,
|
|
77
|
+
profile,
|
|
78
|
+
active: true,
|
|
79
|
+
nextCommands: item.nextCommands,
|
|
80
|
+
});
|
|
81
|
+
if (rows.length >= limit)
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
return rows;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function providerForStaleItem(item, providers) {
|
|
88
|
+
if (item.phaseId) {
|
|
89
|
+
const linked = providers.find((provider) => provider.phaseId === item.phaseId);
|
|
90
|
+
if (linked)
|
|
91
|
+
return linked;
|
|
92
|
+
}
|
|
93
|
+
return providers[0];
|
|
94
|
+
}
|
|
95
|
+
function sanitizeThresholdMap(value) {
|
|
96
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
97
|
+
return {};
|
|
98
|
+
const output = {};
|
|
99
|
+
for (const [rawKey, rawThreshold] of Object.entries(value)) {
|
|
100
|
+
const key = rawKey.trim().toLowerCase();
|
|
101
|
+
if (!key)
|
|
102
|
+
continue;
|
|
103
|
+
const threshold = sanitizeTelemetryStaleThresholdMs(rawThreshold);
|
|
104
|
+
if (threshold === undefined)
|
|
105
|
+
continue;
|
|
106
|
+
output[key] = threshold;
|
|
107
|
+
}
|
|
108
|
+
return output;
|
|
109
|
+
}
|
|
110
|
+
function sanitizeTelemetryStaleThresholdMs(value) {
|
|
111
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
112
|
+
return undefined;
|
|
113
|
+
const threshold = Math.floor(value);
|
|
114
|
+
if (threshold < MIN_TELEMETRY_STALE_THRESHOLD_MS || threshold > MAX_TELEMETRY_STALE_THRESHOLD_MS)
|
|
115
|
+
return undefined;
|
|
116
|
+
return threshold;
|
|
117
|
+
}
|
|
118
|
+
function lookupKey(map, value) {
|
|
119
|
+
if (!map || !value)
|
|
120
|
+
return undefined;
|
|
121
|
+
const key = value.trim().toLowerCase();
|
|
122
|
+
return Object.prototype.hasOwnProperty.call(map, key) ? key : undefined;
|
|
123
|
+
}
|
|
124
|
+
function normalizeLimit(value) {
|
|
125
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
126
|
+
return 20;
|
|
127
|
+
return Math.max(1, Math.min(200, Math.floor(value)));
|
|
128
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export const PIBO_BASH_OUTPUT_COMPACTION_DETAILS_KEY = "piboBashOutputCompaction";
|
|
2
|
+
const MAX_ERROR_CONTEXT_LINES = 120;
|
|
3
|
+
const ERROR_CONTEXT_RADIUS = 2;
|
|
4
|
+
const MIN_SUCCESS_LINES_TO_COMPACT = 12;
|
|
5
|
+
const COMPACTED_MARKER = "[Pibo compacted validation output]";
|
|
6
|
+
const VALIDATION_COMMAND_PATTERN = /(?:^|[\s;&|()])(?:(?:npm|pnpm|yarn|bun)\s+run\s+[^\s;&|()]*?(?:test|typecheck|check|lint|build)[^\s;&|()]*|(?:npm|pnpm|yarn|bun)\s+(?:test|t)\b|(?:npx\s+)?(?:vitest|jest|mocha|ava|playwright|cypress|pytest|ruff|eslint|tsc|tsc\s+--noEmit|node\s+--test|go\s+test|cargo\s+test|dotnet\s+test)\b)/i;
|
|
7
|
+
const ERROR_LINE_PATTERN = /(?:\b(?:FAIL|FAILED|Failing|failure|failed|ERROR|Error|error|ERR!|Exception|Traceback|AssertionError|assert|expected|received|not ok|timed out|Command exited with code)\b|[✕×✖])/;
|
|
8
|
+
const BENIGN_SUCCESS_LINE_PATTERN = /(?:^\s*(?:✔|✓|PASS\b)|\b(?:PASS|passed|success|successful|ok|done|completed)\b)/i;
|
|
9
|
+
export function compactValidationToolResultForContext(context) {
|
|
10
|
+
const toolName = typeof context.toolCall?.name === "string" ? context.toolCall.name : undefined;
|
|
11
|
+
if (toolName !== "bash")
|
|
12
|
+
return undefined;
|
|
13
|
+
const command = commandFromArgs(context.args);
|
|
14
|
+
if (!command || !isLikelyValidationCommand(command))
|
|
15
|
+
return undefined;
|
|
16
|
+
const output = textFromContent(context.result.content);
|
|
17
|
+
if (!output || output.includes(COMPACTED_MARKER))
|
|
18
|
+
return undefined;
|
|
19
|
+
const compaction = compactValidationOutput({ command, output, isError: context.isError });
|
|
20
|
+
if (!compaction)
|
|
21
|
+
return undefined;
|
|
22
|
+
return {
|
|
23
|
+
content: [{ type: "text", text: compaction.text }],
|
|
24
|
+
details: mergeCompactionDetails(context.result.details, compaction.details),
|
|
25
|
+
isError: context.isError,
|
|
26
|
+
terminate: context.result.terminate,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function compactValidationOutput(input) {
|
|
30
|
+
const normalizedOutput = input.output.replace(/\r\n/g, "\n").trimEnd();
|
|
31
|
+
const lines = normalizedOutput.length ? normalizedOutput.split("\n") : [];
|
|
32
|
+
if (!input.isError && lines.length < MIN_SUCCESS_LINES_TO_COMPACT)
|
|
33
|
+
return undefined;
|
|
34
|
+
const interestingRanges = collectInterestingRanges(lines);
|
|
35
|
+
const interestingLines = rangesToLines(lines, interestingRanges, MAX_ERROR_CONTEXT_LINES);
|
|
36
|
+
const displayedBody = input.isError
|
|
37
|
+
? (interestingLines.length ? interestingLines : tailLines(lines, MAX_ERROR_CONTEXT_LINES))
|
|
38
|
+
: [];
|
|
39
|
+
const statusLine = input.isError
|
|
40
|
+
? "Command failed. Showing error-looking lines only."
|
|
41
|
+
: "Command succeeded. Test output hidden by default.";
|
|
42
|
+
const omittedLines = Math.max(0, lines.length - displayedBody.length);
|
|
43
|
+
const header = [
|
|
44
|
+
COMPACTED_MARKER,
|
|
45
|
+
statusLine,
|
|
46
|
+
`Original output: ${lines.length} line${lines.length === 1 ? "" : "s"}, ${normalizedOutput.length} chars.`,
|
|
47
|
+
omittedLines > 0 ? `Hidden: ${omittedLines} line${omittedLines === 1 ? "" : "s"}. Full output omitted from model context.` : undefined,
|
|
48
|
+
].filter((line) => Boolean(line));
|
|
49
|
+
const text = displayedBody.length
|
|
50
|
+
? `${header.join("\n")}\n\n${displayedBody.join("\n")}`
|
|
51
|
+
: header.join("\n");
|
|
52
|
+
const fullOutputPath = extractFullOutputPath(normalizedOutput);
|
|
53
|
+
const details = {
|
|
54
|
+
kind: "validation-output",
|
|
55
|
+
command: input.command,
|
|
56
|
+
isError: input.isError,
|
|
57
|
+
originalLines: lines.length,
|
|
58
|
+
originalChars: normalizedOutput.length,
|
|
59
|
+
displayedLines: displayedBody.length,
|
|
60
|
+
omittedLines,
|
|
61
|
+
fullOutputPath,
|
|
62
|
+
};
|
|
63
|
+
return { text, details };
|
|
64
|
+
}
|
|
65
|
+
function commandFromArgs(args) {
|
|
66
|
+
if (!isRecord(args))
|
|
67
|
+
return undefined;
|
|
68
|
+
const command = args.command;
|
|
69
|
+
return typeof command === "string" && command.trim() ? command : undefined;
|
|
70
|
+
}
|
|
71
|
+
function isLikelyValidationCommand(command) {
|
|
72
|
+
return VALIDATION_COMMAND_PATTERN.test(command);
|
|
73
|
+
}
|
|
74
|
+
function textFromContent(content) {
|
|
75
|
+
if (!Array.isArray(content) || content.length === 0)
|
|
76
|
+
return undefined;
|
|
77
|
+
const parts = [];
|
|
78
|
+
for (const part of content) {
|
|
79
|
+
if (!part || part.type !== "text")
|
|
80
|
+
return undefined;
|
|
81
|
+
parts.push(part.text);
|
|
82
|
+
}
|
|
83
|
+
return parts.join("");
|
|
84
|
+
}
|
|
85
|
+
function collectInterestingRanges(lines) {
|
|
86
|
+
const ranges = [];
|
|
87
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
88
|
+
if (BENIGN_SUCCESS_LINE_PATTERN.test(lines[index]))
|
|
89
|
+
continue;
|
|
90
|
+
if (!ERROR_LINE_PATTERN.test(lines[index]))
|
|
91
|
+
continue;
|
|
92
|
+
ranges.push([
|
|
93
|
+
Math.max(0, index - ERROR_CONTEXT_RADIUS),
|
|
94
|
+
Math.min(lines.length - 1, index + ERROR_CONTEXT_RADIUS),
|
|
95
|
+
]);
|
|
96
|
+
}
|
|
97
|
+
return mergeRanges(ranges);
|
|
98
|
+
}
|
|
99
|
+
function mergeRanges(ranges) {
|
|
100
|
+
const merged = [];
|
|
101
|
+
for (const [start, end] of ranges.sort((left, right) => left[0] - right[0])) {
|
|
102
|
+
const previous = merged.at(-1);
|
|
103
|
+
if (!previous || start > previous[1] + 1) {
|
|
104
|
+
merged.push([start, end]);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
previous[1] = Math.max(previous[1], end);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return merged;
|
|
111
|
+
}
|
|
112
|
+
function rangesToLines(lines, ranges, maxLines) {
|
|
113
|
+
const output = [];
|
|
114
|
+
for (const [rangeIndex, [start, end]] of ranges.entries()) {
|
|
115
|
+
if (output.length >= maxLines)
|
|
116
|
+
break;
|
|
117
|
+
if (rangeIndex > 0)
|
|
118
|
+
output.push("...");
|
|
119
|
+
for (let index = start; index <= end && output.length < maxLines; index += 1) {
|
|
120
|
+
output.push(lines[index]);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (ranges.length > 0 && output.length >= maxLines)
|
|
124
|
+
output.push(`... (${ranges.length} error section${ranges.length === 1 ? "" : "s"} truncated)`);
|
|
125
|
+
return output;
|
|
126
|
+
}
|
|
127
|
+
function tailLines(lines, maxLines) {
|
|
128
|
+
return lines.slice(Math.max(0, lines.length - maxLines));
|
|
129
|
+
}
|
|
130
|
+
function mergeCompactionDetails(originalDetails, compaction) {
|
|
131
|
+
if (isRecord(originalDetails)) {
|
|
132
|
+
return { ...originalDetails, [PIBO_BASH_OUTPUT_COMPACTION_DETAILS_KEY]: compaction };
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
[PIBO_BASH_OUTPUT_COMPACTION_DETAILS_KEY]: compaction,
|
|
136
|
+
...(originalDetails === undefined ? {} : { originalDetails }),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function extractFullOutputPath(output) {
|
|
140
|
+
const match = output.match(/Full output:\s*([^\]\n]+)/);
|
|
141
|
+
return match?.[1]?.trim();
|
|
142
|
+
}
|
|
143
|
+
function isRecord(value) {
|
|
144
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
145
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
import { piboHomePath } from "./pibo-home.js";
|
|
4
|
+
import { sanitizeTelemetryStaleThresholdSettings } from "./telemetry-staleness.js";
|
|
5
|
+
export const DEFAULT_USER_TIMEZONE = "UTC";
|
|
6
|
+
export const DEFAULT_WEB_ANNOTATIONS_TOGGLE_SHORTCUT = "Alt+Shift+A";
|
|
7
|
+
export const DEFAULT_PIBO_USER_SETTINGS_PATH = "user-settings.json";
|
|
8
|
+
export function loadPiboUserSettings() {
|
|
9
|
+
return sanitizeUserSettings(readState().settings);
|
|
10
|
+
}
|
|
11
|
+
export function updatePiboUserSettings(patch) {
|
|
12
|
+
const state = readState();
|
|
13
|
+
const next = sanitizeUserSettings({ ...(state.settings ?? {}), ...patch });
|
|
14
|
+
state.settings = next;
|
|
15
|
+
writeState(state);
|
|
16
|
+
return next;
|
|
17
|
+
}
|
|
18
|
+
export function sanitizeShortcutSettings(value) {
|
|
19
|
+
const raw = value && typeof value === "object" && !Array.isArray(value)
|
|
20
|
+
? value
|
|
21
|
+
: {};
|
|
22
|
+
return { webAnnotationsToggle: sanitizeShortcut(raw.webAnnotationsToggle) ?? DEFAULT_WEB_ANNOTATIONS_TOGGLE_SHORTCUT };
|
|
23
|
+
}
|
|
24
|
+
export function sanitizeShortcut(value) {
|
|
25
|
+
if (typeof value !== "string")
|
|
26
|
+
return undefined;
|
|
27
|
+
const shortcut = value.replace(/[\u0000-\u001f\u007f]/g, "").trim();
|
|
28
|
+
return shortcut && shortcut.length <= 80 ? shortcut : undefined;
|
|
29
|
+
}
|
|
30
|
+
export function sanitizeTimezone(value) {
|
|
31
|
+
if (typeof value !== "string")
|
|
32
|
+
return undefined;
|
|
33
|
+
const timezone = value.trim();
|
|
34
|
+
if (!timezone)
|
|
35
|
+
return undefined;
|
|
36
|
+
try {
|
|
37
|
+
new Intl.DateTimeFormat("en-US", { timeZone: timezone });
|
|
38
|
+
return timezone;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function sanitizeUserSettings(value) {
|
|
45
|
+
const raw = value && typeof value === "object" && !Array.isArray(value)
|
|
46
|
+
? value
|
|
47
|
+
: {};
|
|
48
|
+
return {
|
|
49
|
+
timezone: sanitizeTimezone(raw.timezone) ?? DEFAULT_USER_TIMEZONE,
|
|
50
|
+
shortcuts: sanitizeShortcutSettings(raw.shortcuts),
|
|
51
|
+
telemetryStaleThresholds: sanitizeTelemetryStaleThresholdSettings(raw.telemetryStaleThresholds),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function readState() {
|
|
55
|
+
const path = piboHomePath(DEFAULT_PIBO_USER_SETTINGS_PATH);
|
|
56
|
+
if (!existsSync(path))
|
|
57
|
+
return {};
|
|
58
|
+
try {
|
|
59
|
+
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
60
|
+
const raw = parsed && typeof parsed === "object" && !Array.isArray(parsed)
|
|
61
|
+
? parsed
|
|
62
|
+
: {};
|
|
63
|
+
return { settings: sanitizeUserSettings(raw.settings) };
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function writeState(state) {
|
|
70
|
+
const path = piboHomePath(DEFAULT_PIBO_USER_SETTINGS_PATH);
|
|
71
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
72
|
+
writeFileSync(path, `${JSON.stringify(state, null, 2)}\n`);
|
|
73
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PiboCronService } from "./service.js";
|
|
2
|
+
import { createDefaultPiboCronStore } from "./store.js";
|
|
3
|
+
let currentCronService;
|
|
4
|
+
export function getPiboCronService() {
|
|
5
|
+
return currentCronService;
|
|
6
|
+
}
|
|
7
|
+
export function createPiboCronChannel(options = {}) {
|
|
8
|
+
return {
|
|
9
|
+
name: "pibo.cron",
|
|
10
|
+
kind: "custom",
|
|
11
|
+
description: "Runs scheduled Pibo agent jobs.",
|
|
12
|
+
auth: { mode: "required" },
|
|
13
|
+
start(context) {
|
|
14
|
+
if (currentCronService)
|
|
15
|
+
return;
|
|
16
|
+
currentCronService = new PiboCronService({
|
|
17
|
+
...options,
|
|
18
|
+
context,
|
|
19
|
+
store: createDefaultPiboCronStore({ path: options.cronStorePath }),
|
|
20
|
+
});
|
|
21
|
+
currentCronService.start();
|
|
22
|
+
},
|
|
23
|
+
stop() {
|
|
24
|
+
currentCronService?.stop();
|
|
25
|
+
currentCronService = undefined;
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
package/dist/cron/cli.js
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { parseFriendlySchedule } from "./schedule.js";
|
|
3
|
+
import { createDefaultPiboCronStore } from "./store.js";
|
|
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
|
|
20
|
+
pibo cron edit --help`);
|
|
21
|
+
}
|
|
22
|
+
function printJson(value) {
|
|
23
|
+
console.log(JSON.stringify(value, null, 2));
|
|
24
|
+
}
|
|
25
|
+
function targetFromOptions(options) {
|
|
26
|
+
if (options.room)
|
|
27
|
+
return { kind: "room", roomId: options.room };
|
|
28
|
+
if (options.defaultChat)
|
|
29
|
+
return { kind: "default-chat" };
|
|
30
|
+
throw new Error("Choose a target: --room <roomId> or --default-chat");
|
|
31
|
+
}
|
|
32
|
+
function maybeTargetFromOptions(options) {
|
|
33
|
+
if (!options.room && !options.defaultChat)
|
|
34
|
+
return undefined;
|
|
35
|
+
return targetFromOptions(options);
|
|
36
|
+
}
|
|
37
|
+
function hasScheduleOptions(options, positionalCron) {
|
|
38
|
+
return Boolean(positionalCron ||
|
|
39
|
+
typeof options.in === "string" ||
|
|
40
|
+
typeof options.at === "string" ||
|
|
41
|
+
typeof options.every === "string" ||
|
|
42
|
+
typeof options.daily === "string" ||
|
|
43
|
+
typeof options.weekly === "string" ||
|
|
44
|
+
typeof options.monthly === "string" ||
|
|
45
|
+
typeof options.monthly === "number" ||
|
|
46
|
+
typeof options.cron === "string");
|
|
47
|
+
}
|
|
48
|
+
function scheduleFromOptions(options, positionalCron) {
|
|
49
|
+
if (typeof options.in === "string")
|
|
50
|
+
return parseFriendlySchedule({ kind: "in", value: options.in });
|
|
51
|
+
if (typeof options.at === "string")
|
|
52
|
+
return parseFriendlySchedule({ kind: "at", value: options.at, tz: typeof options.tz === "string" ? options.tz : undefined });
|
|
53
|
+
if (typeof options.every === "string")
|
|
54
|
+
return parseFriendlySchedule({ kind: "every", value: options.every });
|
|
55
|
+
if (typeof options.daily === "string")
|
|
56
|
+
return parseFriendlySchedule({ kind: "daily", time: options.daily, tz: typeof options.tz === "string" ? options.tz : undefined });
|
|
57
|
+
if (typeof options.weekly === "string") {
|
|
58
|
+
const time = typeof options.time === "string" ? options.time : undefined;
|
|
59
|
+
if (!time)
|
|
60
|
+
throw new Error("--weekly requires --time HH:MM");
|
|
61
|
+
return parseFriendlySchedule({ kind: "weekly", weekdays: options.weekly, time, tz: typeof options.tz === "string" ? options.tz : undefined });
|
|
62
|
+
}
|
|
63
|
+
if (typeof options.monthly === "string" || typeof options.monthly === "number") {
|
|
64
|
+
const time = typeof options.time === "string" ? options.time : undefined;
|
|
65
|
+
if (!time)
|
|
66
|
+
throw new Error("--monthly requires --time HH:MM");
|
|
67
|
+
return parseFriendlySchedule({ kind: "monthly", dayOfMonth: Number(options.monthly), time, tz: typeof options.tz === "string" ? options.tz : undefined });
|
|
68
|
+
}
|
|
69
|
+
if (typeof options.cron === "string")
|
|
70
|
+
return parseFriendlySchedule({ kind: "cron", expr: options.cron, tz: typeof options.tz === "string" ? options.tz : undefined });
|
|
71
|
+
if (positionalCron)
|
|
72
|
+
return parseFriendlySchedule({ kind: "cron", expr: positionalCron, tz: typeof options.tz === "string" ? options.tz : undefined });
|
|
73
|
+
throw new Error("Choose a schedule: --in, --at, --every, --daily, --weekly, --monthly, --cron, or pass a quoted cron expression");
|
|
74
|
+
}
|
|
75
|
+
export async function runCronCli(argv = process.argv) {
|
|
76
|
+
if (argv.length <= 2 || argv[2] === "--help" || argv[2] === "-h") {
|
|
77
|
+
printDiscovery();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const program = new Command();
|
|
81
|
+
program.name("pibo cron").description("Manage scheduled Pibo jobs").helpOption("-h, --help");
|
|
82
|
+
program.option("--store <path>", "Cron store path");
|
|
83
|
+
program.command("status").description("Show cron store status").option("--json", "Print JSON").action((options) => {
|
|
84
|
+
const store = createDefaultPiboCronStore({ path: program.opts().store });
|
|
85
|
+
const status = store.status();
|
|
86
|
+
if (options.json)
|
|
87
|
+
printJson(status);
|
|
88
|
+
else {
|
|
89
|
+
console.log(`jobs\t${status.jobs}`);
|
|
90
|
+
console.log(`running\t${status.running}`);
|
|
91
|
+
console.log(`nextRunAt\t${status.nextRunAt ?? "-"}`);
|
|
92
|
+
}
|
|
93
|
+
store.close();
|
|
94
|
+
});
|
|
95
|
+
program.command("list").description("List cron jobs").option("--all", "Include disabled jobs").option("--json", "Print JSON").action((options) => {
|
|
96
|
+
const store = createDefaultPiboCronStore({ path: program.opts().store });
|
|
97
|
+
const jobs = store.listJobs({ includeDisabled: options.all });
|
|
98
|
+
if (options.json)
|
|
99
|
+
printJson(jobs);
|
|
100
|
+
else
|
|
101
|
+
for (const job of jobs)
|
|
102
|
+
console.log(`${job.id}\t${job.enabled ? "enabled" : "disabled"}\t${job.state.nextRunAt ?? "-"}\t${job.name}`);
|
|
103
|
+
store.close();
|
|
104
|
+
});
|
|
105
|
+
program.command("add")
|
|
106
|
+
.description("Create a cron job")
|
|
107
|
+
.argument("[cronExpr...]", "Raw 5-field cron expression, e.g. \"0 8 * * *\"")
|
|
108
|
+
.option("--room <roomId>", "Target room")
|
|
109
|
+
.option("--default-chat", "Target the shared default chat")
|
|
110
|
+
.option("--agent <profile>", "Agent/profile", "base")
|
|
111
|
+
.option("--name <name>", "Job name")
|
|
112
|
+
.requiredOption("--prompt <text>", "Prompt/task")
|
|
113
|
+
.option("--in <duration>", "Run once after duration, e.g. 20m")
|
|
114
|
+
.option("--at <iso>", "Run once at ISO timestamp")
|
|
115
|
+
.option("--every <duration>", "Run every duration, e.g. 2h")
|
|
116
|
+
.option("--daily <HH:MM>", "Run daily at time")
|
|
117
|
+
.option("--weekly <days>", "Run weekly on comma-separated days")
|
|
118
|
+
.option("--monthly <day>", "Run monthly on day of month")
|
|
119
|
+
.option("--time <HH:MM>", "Time for weekly/monthly")
|
|
120
|
+
.option("--cron <expr>", "Raw 5-field cron expression")
|
|
121
|
+
.option("--tz <timezone>", "Timezone for wall-clock schedules")
|
|
122
|
+
.option("--disabled", "Create disabled")
|
|
123
|
+
.option("--delete-after-run", "Delete successful one-shot job")
|
|
124
|
+
.option("--json", "Print JSON")
|
|
125
|
+
.action((cronExprParts, options) => {
|
|
126
|
+
const store = createDefaultPiboCronStore({ path: program.opts().store });
|
|
127
|
+
const positionalCron = Array.isArray(cronExprParts) && cronExprParts.length ? cronExprParts.join(" ") : undefined;
|
|
128
|
+
const normalized = scheduleFromOptions(options, positionalCron);
|
|
129
|
+
const job = store.createJob({
|
|
130
|
+
name: options.name,
|
|
131
|
+
enabled: options.disabled ? false : true,
|
|
132
|
+
target: targetFromOptions(options),
|
|
133
|
+
profile: options.agent,
|
|
134
|
+
prompt: options.prompt,
|
|
135
|
+
schedule: normalized.schedule,
|
|
136
|
+
scheduleUi: normalized.scheduleUi,
|
|
137
|
+
deleteAfterRun: options.deleteAfterRun === true,
|
|
138
|
+
});
|
|
139
|
+
if (options.json)
|
|
140
|
+
printJson(job);
|
|
141
|
+
else
|
|
142
|
+
console.log(`${job.id}\t${job.state.nextRunAt ?? "-"}\t${job.name}`);
|
|
143
|
+
store.close();
|
|
144
|
+
});
|
|
145
|
+
program.command("edit")
|
|
146
|
+
.description("Update a cron job")
|
|
147
|
+
.argument("<id>", "Cron job id")
|
|
148
|
+
.argument("[cronExpr...]", "Raw 5-field cron expression, e.g. \"0 8 * * *\"")
|
|
149
|
+
.option("--room <roomId>", "Target room")
|
|
150
|
+
.option("--default-chat", "Target the shared default chat")
|
|
151
|
+
.option("--agent <profile>", "Agent/profile")
|
|
152
|
+
.option("--name <name>", "Job name")
|
|
153
|
+
.option("--description <text>", "Job description")
|
|
154
|
+
.option("--prompt <text>", "Prompt/task")
|
|
155
|
+
.option("--in <duration>", "Run once after duration, e.g. 20m")
|
|
156
|
+
.option("--at <iso>", "Run once at ISO timestamp")
|
|
157
|
+
.option("--every <duration>", "Run every duration, e.g. 2h")
|
|
158
|
+
.option("--daily <HH:MM>", "Run daily at time")
|
|
159
|
+
.option("--weekly <days>", "Run weekly on comma-separated days")
|
|
160
|
+
.option("--monthly <day>", "Run monthly on day of month")
|
|
161
|
+
.option("--time <HH:MM>", "Time for weekly/monthly")
|
|
162
|
+
.option("--cron <expr>", "Raw 5-field cron expression")
|
|
163
|
+
.option("--tz <timezone>", "Timezone for wall-clock schedules")
|
|
164
|
+
.option("--enabled", "Enable the job")
|
|
165
|
+
.option("--disabled", "Disable the job")
|
|
166
|
+
.option("--delete-after-run", "Delete successful one-shot job")
|
|
167
|
+
.option("--keep-after-run", "Keep job after successful one-shot run")
|
|
168
|
+
.option("--json", "Print JSON")
|
|
169
|
+
.action((id, cronExprParts, options) => {
|
|
170
|
+
const store = createDefaultPiboCronStore({ path: program.opts().store });
|
|
171
|
+
const positionalCron = Array.isArray(cronExprParts) && cronExprParts.length ? cronExprParts.join(" ") : undefined;
|
|
172
|
+
const normalized = hasScheduleOptions(options, positionalCron) ? scheduleFromOptions(options, positionalCron) : undefined;
|
|
173
|
+
const target = maybeTargetFromOptions(options);
|
|
174
|
+
const patch = {
|
|
175
|
+
...(options.name !== undefined ? { name: options.name } : {}),
|
|
176
|
+
...(options.description !== undefined ? { description: options.description } : {}),
|
|
177
|
+
...(options.agent !== undefined ? { profile: options.agent } : {}),
|
|
178
|
+
...(options.prompt !== undefined ? { prompt: options.prompt } : {}),
|
|
179
|
+
...(target ? { target } : {}),
|
|
180
|
+
...(normalized ? { schedule: normalized.schedule, scheduleUi: normalized.scheduleUi } : {}),
|
|
181
|
+
...(options.enabled === true ? { enabled: true } : {}),
|
|
182
|
+
...(options.disabled === true ? { enabled: false } : {}),
|
|
183
|
+
...(options.deleteAfterRun === true ? { deleteAfterRun: true } : {}),
|
|
184
|
+
...(options.keepAfterRun === true ? { deleteAfterRun: false } : {}),
|
|
185
|
+
};
|
|
186
|
+
if (Object.keys(patch).length === 0)
|
|
187
|
+
throw new Error("No cron job update fields provided");
|
|
188
|
+
const job = store.updateJob(id, patch);
|
|
189
|
+
if (!job)
|
|
190
|
+
throw new Error("Cron job not found");
|
|
191
|
+
if (options.json)
|
|
192
|
+
printJson(job);
|
|
193
|
+
else
|
|
194
|
+
console.log(`${job.id}\t${job.enabled ? "enabled" : "disabled"}\t${job.state.nextRunAt ?? "-"}\t${job.name}`);
|
|
195
|
+
store.close();
|
|
196
|
+
});
|
|
197
|
+
for (const [name, enabled] of [["pause", false], ["resume", true]]) {
|
|
198
|
+
program.command(name).argument("<id>").description(enabled ? "Enable a cron job" : "Disable a cron job").option("--json", "Print JSON").action((id, options) => {
|
|
199
|
+
const store = createDefaultPiboCronStore({ path: program.opts().store });
|
|
200
|
+
const job = store.updateJob(id, { enabled });
|
|
201
|
+
if (!job)
|
|
202
|
+
throw new Error("Cron job not found");
|
|
203
|
+
if (options.json)
|
|
204
|
+
printJson(job);
|
|
205
|
+
else
|
|
206
|
+
console.log(`${job.id}\t${job.enabled ? "enabled" : "disabled"}\t${job.state.nextRunAt ?? "-"}`);
|
|
207
|
+
store.close();
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
program.command("remove").argument("<id>").description("Delete a cron job").option("--json", "Print JSON").action((id, options) => {
|
|
211
|
+
const store = createDefaultPiboCronStore({ path: program.opts().store });
|
|
212
|
+
const removed = store.removeJob(id);
|
|
213
|
+
if (options.json)
|
|
214
|
+
printJson({ removed });
|
|
215
|
+
else
|
|
216
|
+
console.log(removed ? "removed" : "not found");
|
|
217
|
+
store.close();
|
|
218
|
+
});
|
|
219
|
+
program.command("runs").description("List cron runs").option("--job <id>", "Filter by job").option("--json", "Print JSON").action((options) => {
|
|
220
|
+
const store = createDefaultPiboCronStore({ path: program.opts().store });
|
|
221
|
+
const runs = store.listRuns({ jobId: options.job });
|
|
222
|
+
if (options.json)
|
|
223
|
+
printJson(runs);
|
|
224
|
+
else
|
|
225
|
+
for (const run of runs)
|
|
226
|
+
console.log(`${run.id}\t${run.status}\t${run.createdAt}\t${run.piboSessionId ?? "-"}`);
|
|
227
|
+
store.close();
|
|
228
|
+
});
|
|
229
|
+
await program.parseAsync(argv);
|
|
230
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { definePiboPlugin } from "../plugins/registry.js";
|
|
2
|
+
import { createPiboCronChannel } from "./channel.js";
|
|
3
|
+
export function createPiboCronPlugin(options = {}) {
|
|
4
|
+
return definePiboPlugin({
|
|
5
|
+
id: "pibo.cron",
|
|
6
|
+
name: "Pibo Cron",
|
|
7
|
+
register(api) {
|
|
8
|
+
api.registerChannel(createPiboCronChannel(options));
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
}
|