@pasko70/pibo 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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 +142 -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/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/package.json +24 -10
- 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
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { browserStreamingBenchmarkLibrary } from "./web-streaming-browser-library.js";
|
|
2
|
+
export function streamingBenchmarkEventSourceProbeScript() {
|
|
3
|
+
return String.raw `
|
|
4
|
+
(() => {
|
|
5
|
+
if (window.__piboStreamingBenchmarkEventSourceProbeInstalled || typeof window.EventSource !== 'function') return;
|
|
6
|
+
const OriginalEventSource = window.EventSource;
|
|
7
|
+
const probe = {
|
|
8
|
+
createdAt: new Date().toISOString(),
|
|
9
|
+
openCount: 0,
|
|
10
|
+
errorCount: 0,
|
|
11
|
+
closeCount: 0,
|
|
12
|
+
forcedCloseCount: 0,
|
|
13
|
+
textDropRequested: false,
|
|
14
|
+
textDropDurationMs: undefined,
|
|
15
|
+
textDropUntil: 0,
|
|
16
|
+
textDropCount: 0,
|
|
17
|
+
textDropTextEventCount: 0,
|
|
18
|
+
events: [],
|
|
19
|
+
connections: [],
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(probe, '_instances', { value: [], enumerable: false, configurable: false });
|
|
22
|
+
function at() { return typeof performance === 'undefined' ? Date.now() : performance.now(); }
|
|
23
|
+
function isChatEventsUrl(url) { return String(url || '').includes('/api/chat/events'); }
|
|
24
|
+
function pushConnection(kind, info, extra) {
|
|
25
|
+
probe.connections.push({ t: at(), kind, url: info.url, ...(extra || {}) });
|
|
26
|
+
if (probe.connections.length > 200) probe.connections.splice(0, probe.connections.length - 200);
|
|
27
|
+
}
|
|
28
|
+
function WrappedEventSource(url, init) {
|
|
29
|
+
const events = new OriginalEventSource(url, init);
|
|
30
|
+
const info = { url: String(url), createdAt: at(), closed: false, forcedClosing: false };
|
|
31
|
+
probe._instances.push({ events, info });
|
|
32
|
+
events.addEventListener('open', () => {
|
|
33
|
+
probe.openCount += 1;
|
|
34
|
+
pushConnection('open', info, { readyState: events.readyState });
|
|
35
|
+
});
|
|
36
|
+
events.addEventListener('error', () => {
|
|
37
|
+
probe.errorCount += 1;
|
|
38
|
+
pushConnection('error', info, { readyState: events.readyState });
|
|
39
|
+
});
|
|
40
|
+
events.addEventListener('pibo', (message) => {
|
|
41
|
+
let payload;
|
|
42
|
+
try { payload = JSON.parse(message.data); } catch {}
|
|
43
|
+
const type = payload && typeof payload.type === 'string' ? payload.type : undefined;
|
|
44
|
+
const record = {
|
|
45
|
+
t: at(),
|
|
46
|
+
url: info.url,
|
|
47
|
+
lastEventId: message.lastEventId || '',
|
|
48
|
+
type: typeof type === 'string' ? type : undefined,
|
|
49
|
+
liveReplayId: payload && typeof payload.liveReplayId === 'number' && Number.isFinite(payload.liveReplayId) ? payload.liveReplayId : undefined,
|
|
50
|
+
liveReplayReplayed: payload && payload.liveReplay && typeof payload.liveReplay.replayed === 'number' && Number.isFinite(payload.liveReplay.replayed) ? payload.liveReplay.replayed : undefined,
|
|
51
|
+
liveReplayMissed: Boolean(payload && payload.liveReplay && payload.liveReplay.missed === true),
|
|
52
|
+
liveReplayEvictedBefore: payload && payload.liveReplay && typeof payload.liveReplay.evictedBefore === 'number' && Number.isFinite(payload.liveReplay.evictedBefore) ? payload.liveReplay.evictedBefore : undefined,
|
|
53
|
+
liveReplayRequestedAfter: payload && payload.liveReplay && typeof payload.liveReplay.requestedAfter === 'number' && Number.isFinite(payload.liveReplay.requestedAfter) ? payload.liveReplay.requestedAfter : undefined,
|
|
54
|
+
liveReplayNewestAvailable: payload && payload.liveReplay && typeof payload.liveReplay.newestAvailable === 'number' && Number.isFinite(payload.liveReplay.newestAvailable) ? payload.liveReplay.newestAvailable : undefined,
|
|
55
|
+
};
|
|
56
|
+
probe.events.push(record);
|
|
57
|
+
if (probe.events.length > 1000) probe.events.splice(0, probe.events.length - 1000);
|
|
58
|
+
});
|
|
59
|
+
const originalClose = events.close.bind(events);
|
|
60
|
+
events.close = () => {
|
|
61
|
+
if (!info.closed) {
|
|
62
|
+
info.closed = true;
|
|
63
|
+
probe.closeCount += 1;
|
|
64
|
+
pushConnection('close', info, { forced: Boolean(info.forcedClosing), readyState: events.readyState });
|
|
65
|
+
}
|
|
66
|
+
return originalClose();
|
|
67
|
+
};
|
|
68
|
+
return events;
|
|
69
|
+
}
|
|
70
|
+
WrappedEventSource.prototype = OriginalEventSource.prototype;
|
|
71
|
+
Object.setPrototypeOf(WrappedEventSource, OriginalEventSource);
|
|
72
|
+
window.EventSource = WrappedEventSource;
|
|
73
|
+
window.__piboStreamingBenchmarkMarkTextDropRequested = (durationMs) => {
|
|
74
|
+
const duration = Math.max(0, Number(durationMs || 0));
|
|
75
|
+
probe.textDropRequested = true;
|
|
76
|
+
probe.textDropDurationMs = duration;
|
|
77
|
+
probe.textDropUntil = at() + duration;
|
|
78
|
+
probe.textDropCount = 0;
|
|
79
|
+
probe.textDropTextEventCount = 0;
|
|
80
|
+
return { durationMs: duration };
|
|
81
|
+
};
|
|
82
|
+
window.__piboStreamingBenchmarkForceReconnect = () => {
|
|
83
|
+
let closed = 0;
|
|
84
|
+
for (const entry of probe._instances) {
|
|
85
|
+
if (!entry || !entry.events || !isChatEventsUrl(entry.info && entry.info.url)) continue;
|
|
86
|
+
if (entry.events.readyState === 2) continue;
|
|
87
|
+
entry.info.forcedClosing = true;
|
|
88
|
+
probe.forcedCloseCount += 1;
|
|
89
|
+
entry.events.close();
|
|
90
|
+
closed += 1;
|
|
91
|
+
}
|
|
92
|
+
window.dispatchEvent(new Event('online'));
|
|
93
|
+
window.dispatchEvent(new Event('focus'));
|
|
94
|
+
return closed;
|
|
95
|
+
};
|
|
96
|
+
window.__piboStreamingBenchmarkEventSourceProbe = probe;
|
|
97
|
+
window.__piboStreamingBenchmarkEventSourceProbeInstalled = true;
|
|
98
|
+
})();
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
export function streamingBenchmarkFixtureHtml(fixtureProfile, fixtureMix) {
|
|
102
|
+
return `<!doctype html>
|
|
103
|
+
<html>
|
|
104
|
+
<head>
|
|
105
|
+
<meta charset="utf-8">
|
|
106
|
+
<title>Streaming Benchmark Fixture</title>
|
|
107
|
+
<style>body{font-family:system-ui,sans-serif;margin:24px;line-height:1.4} [data-pibo-component]{white-space:pre-wrap}</style>
|
|
108
|
+
</head>
|
|
109
|
+
<body data-pibo-debug="chat-app">
|
|
110
|
+
<h1>Streaming Benchmark Fixture</h1>
|
|
111
|
+
<div data-pibo-component="MarkdownRendererHost" data-pibo-markdown-kind="assistant-message">hello</div>
|
|
112
|
+
<script>
|
|
113
|
+
(() => {
|
|
114
|
+
function nowIso() { return new Date().toISOString(); }
|
|
115
|
+
const target = document.querySelector('[data-pibo-component="MarkdownRendererHost"]');
|
|
116
|
+
const textDeltas = [' a', ' b', ' c', ' d', ' e', ' f', ' g', ' h', ' i', ' j', ' k', ' l'];
|
|
117
|
+
const markdownDeltas = [' **a**', ' **b**', ' **c**', ' **d**', ' **e**', ' **f**', ' **g**', ' **h**', ' **i**', ' **j**', ' **k**', ' **l**'];
|
|
118
|
+
const gfmMarkdownDeltas = [' ~~a~~', ' ~~b~~', ' ~~c~~', ' ~~d~~', ' ~~e~~', ' ~~f~~', ' ~~g~~', ' ~~h~~', ' ~~i~~', ' ~~j~~', ' ~~k~~', ' ~~l~~'];
|
|
119
|
+
const gfmTaskMarkdownDeltas = ['- [ ] [_**a**_](https://e.co/a)', ' [_**b**_](https://e.co/b)', ' [_**c**_](https://e.co/c)', ' [_**d**_](https://e.co/d)', ' [_**e**_](https://e.co/e)', ' [_**f**_](https://e.co/f)', ' [_**g**_](https://e.co/g)', ' [_**h**_](https://e.co/h)', ' [_**i**_](https://e.co/i)', ' [_**j**_](https://e.co/j)', ' [_**k**_](https://e.co/k)', ' [_**l**_](https://e.co/l)'];
|
|
120
|
+
const gfmFullMarkdownDeltas = ['- [ ] [_~~a~~_](https://e.co/a)', ' [_~~b~~_](https://e.co/b)', ' [_~~c~~_](https://e.co/c)', ' [_~~d~~_](https://e.co/d)', ' [_~~e~~_](https://e.co/e)', ' [_~~f~~_](https://e.co/f)', ' [_~~g~~_](https://e.co/g)', ' [_~~h~~_](https://e.co/h)', ' [_~~i~~_](https://e.co/i)', ' [_~~j~~_](https://e.co/j)', ' [_~~k~~_](https://e.co/k)', ' [_~~l~~_](https://e.co/l)'];
|
|
121
|
+
const cadenceMs = 100;
|
|
122
|
+
const profile = ${JSON.stringify(fixtureProfile)};
|
|
123
|
+
const mix = ${JSON.stringify(fixtureMix)};
|
|
124
|
+
const deltas = mix === 'markdown' ? markdownDeltas : (mix === 'gfm-markdown' ? gfmMarkdownDeltas : (mix === 'gfm-task-markdown' ? gfmTaskMarkdownDeltas : (mix === 'gfm-full-markdown' ? gfmFullMarkdownDeltas : textDeltas)));
|
|
125
|
+
const reasoningDeltas = mix === 'reasoning-text' ? [' think', ' plan', ' check', ' answer'] : [];
|
|
126
|
+
const scheduleMs = buildSchedule(deltas.length, cadenceMs, profile);
|
|
127
|
+
const reasoningScheduleMs = reasoningDeltas.map((_, index) => Math.max(10, Math.round((index + 1) * cadenceMs / 2)));
|
|
128
|
+
let timers = [];
|
|
129
|
+
function buildSchedule(count, cadence, timingProfile) {
|
|
130
|
+
const delays = [];
|
|
131
|
+
let elapsed = 0;
|
|
132
|
+
for (let index = 0; index < count; index += 1) {
|
|
133
|
+
let gap = cadence;
|
|
134
|
+
if (timingProfile === 'jitter') {
|
|
135
|
+
const jitter = [-30, 50, -20, 30, -40, 60, -10, 40, -50, 70, -20, 30][index % 12];
|
|
136
|
+
gap = Math.max(10, cadence + jitter);
|
|
137
|
+
} else if (timingProfile === 'burst') {
|
|
138
|
+
gap = index > 0 && index % 3 !== 0 ? Math.max(10, Math.round(cadence / 5)) : Math.max(cadence, Math.round(cadence * 2.5));
|
|
139
|
+
} else if (timingProfile === 'batch') {
|
|
140
|
+
gap = index % 4 === 0 ? Math.max(cadence, Math.round(cadence * 3)) : 0;
|
|
141
|
+
}
|
|
142
|
+
elapsed += gap;
|
|
143
|
+
delays.push(elapsed);
|
|
144
|
+
}
|
|
145
|
+
return delays;
|
|
146
|
+
}
|
|
147
|
+
function snapshot() {
|
|
148
|
+
const now = nowIso();
|
|
149
|
+
return {
|
|
150
|
+
startedAt: now,
|
|
151
|
+
updatedAt: now,
|
|
152
|
+
eventCount: 0,
|
|
153
|
+
textDeltaCount: 0,
|
|
154
|
+
textDeltaBytes: 0,
|
|
155
|
+
reasoningDeltaCount: 0,
|
|
156
|
+
reasoningDeltaBytes: 0,
|
|
157
|
+
enqueueCount: 0,
|
|
158
|
+
flushCount: 0,
|
|
159
|
+
flushedEventCount: 0,
|
|
160
|
+
overlayUpdateCount: 0,
|
|
161
|
+
overlayEventCount: 0,
|
|
162
|
+
traceRefreshStartedCount: 0,
|
|
163
|
+
traceRefreshCompletedCount: 0,
|
|
164
|
+
traceRefreshFailedCount: 0,
|
|
165
|
+
traceBaseUpdateCount: 0,
|
|
166
|
+
traceBaseOutputLength: 0,
|
|
167
|
+
currentOutputLength: target.textContent.length,
|
|
168
|
+
lastDurableCursor: undefined,
|
|
169
|
+
lastTransientLiveId: 'live:-1',
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
window.__piboStreamingDebugReset = () => {
|
|
173
|
+
for (const timer of timers) clearTimeout(timer);
|
|
174
|
+
timers = [];
|
|
175
|
+
target.textContent = 'hello';
|
|
176
|
+
window.__piboStreamingDebug = snapshot();
|
|
177
|
+
return window.__piboStreamingDebug;
|
|
178
|
+
};
|
|
179
|
+
window.__piboStreamingFixtureConfig = { deltaCount: deltas.length, reasoningDeltaCount: reasoningDeltas.length, cadenceMs, profile, mix, scheduleMs, reasoningScheduleMs, textBytes: deltas.join('').length, reasoningBytes: reasoningDeltas.join('').length };
|
|
180
|
+
window.__piboStreamingFixtureStart = () => {
|
|
181
|
+
window.__piboStreamingDebugReset();
|
|
182
|
+
reasoningDeltas.forEach((delta, index) => {
|
|
183
|
+
timers.push(setTimeout(() => {
|
|
184
|
+
const debug = window.__piboStreamingDebug;
|
|
185
|
+
const at = nowIso();
|
|
186
|
+
debug.eventCount += 1;
|
|
187
|
+
debug.firstEventAt ??= at;
|
|
188
|
+
debug.firstReasoningDeltaAt ??= at;
|
|
189
|
+
debug.reasoningDeltaCount += 1;
|
|
190
|
+
debug.reasoningDeltaBytes += delta.length;
|
|
191
|
+
debug.firstEnqueueAt ??= at;
|
|
192
|
+
debug.enqueueCount += 1;
|
|
193
|
+
debug.firstFlushAt ??= at;
|
|
194
|
+
debug.flushCount += 1;
|
|
195
|
+
debug.flushedEventCount += 1;
|
|
196
|
+
debug.firstOverlayUpdateAt ??= at;
|
|
197
|
+
debug.overlayUpdateCount += 1;
|
|
198
|
+
debug.overlayEventCount += 1;
|
|
199
|
+
debug.lastEventAt = at;
|
|
200
|
+
debug.updatedAt = at;
|
|
201
|
+
debug.lastTransientLiveId = 'live:reasoning-' + index;
|
|
202
|
+
}, reasoningScheduleMs[index]));
|
|
203
|
+
});
|
|
204
|
+
deltas.forEach((delta, index) => {
|
|
205
|
+
timers.push(setTimeout(() => {
|
|
206
|
+
target.textContent += delta;
|
|
207
|
+
const debug = window.__piboStreamingDebug;
|
|
208
|
+
const at = nowIso();
|
|
209
|
+
debug.eventCount += 1;
|
|
210
|
+
debug.firstEventAt ??= at;
|
|
211
|
+
debug.firstTextDeltaAt ??= at;
|
|
212
|
+
debug.textDeltaCount += 1;
|
|
213
|
+
debug.textDeltaBytes += delta.length;
|
|
214
|
+
debug.firstEnqueueAt ??= at;
|
|
215
|
+
debug.enqueueCount += 1;
|
|
216
|
+
debug.firstFlushAt ??= at;
|
|
217
|
+
debug.flushCount += 1;
|
|
218
|
+
debug.flushedEventCount += 1;
|
|
219
|
+
debug.firstOverlayUpdateAt ??= at;
|
|
220
|
+
debug.overlayUpdateCount += 1;
|
|
221
|
+
debug.overlayEventCount += 1;
|
|
222
|
+
debug.currentOutputLength = target.textContent.length;
|
|
223
|
+
debug.lastEventAt = at;
|
|
224
|
+
debug.updatedAt = at;
|
|
225
|
+
debug.lastTransientLiveId = 'live:' + index;
|
|
226
|
+
}, scheduleMs[index]));
|
|
227
|
+
});
|
|
228
|
+
return window.__piboStreamingFixtureConfig;
|
|
229
|
+
};
|
|
230
|
+
window.__piboStreamingDebugReset();
|
|
231
|
+
})();
|
|
232
|
+
</script>
|
|
233
|
+
</body>
|
|
234
|
+
</html>`;
|
|
235
|
+
}
|
|
236
|
+
export function buildStreamingBenchmarkExpression(durationMs, input = {}) {
|
|
237
|
+
return `(async () => {
|
|
238
|
+
const options = ${JSON.stringify({ durationMs, startFixture: Boolean(input.startFixture), startBackendFixture: Boolean(input.startBackendFixture), fixtureProfile: input.fixtureProfile ?? "steady", fixtureMix: input.fixtureMix ?? "text", fixturePreludeMessages: input.fixturePreludeMessages ?? 0, simulateReconnect: Boolean(input.simulateReconnect), simulateTraceCatchup: Boolean(input.simulateTraceCatchup), simulateOverlayDrop: Boolean(input.simulateOverlayDrop), reconnectAtMs: input.simulateReconnect ? 325 : undefined, traceCatchupDropMs: input.simulateTraceCatchup ? 1300 : undefined })};
|
|
239
|
+
${browserStreamingBenchmarkLibrary()}
|
|
240
|
+
return await runStreamingBenchmark(options);
|
|
241
|
+
})()`;
|
|
242
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { resolveDebugStore } from "./stores.js";
|
|
2
|
+
import { inspectTelemetryProvider, inspectTelemetryProviderEvents, inspectTelemetrySession, inspectTelemetryTurn } from "./telemetry.js";
|
|
3
|
+
export function summarizeStreamingProviderTelemetry(input) {
|
|
4
|
+
const request = input.request;
|
|
5
|
+
const startedAt = stringField(request, "startedAt");
|
|
6
|
+
const textEvents = input.events.filter(isProviderTextDeltaEvent);
|
|
7
|
+
const reasoningEvents = input.events.filter(isProviderReasoningDeltaEvent);
|
|
8
|
+
const textReceivedAt = textEvents.map((event) => stringField(event, "receivedAt")).filter((value) => Boolean(value));
|
|
9
|
+
const reasoningReceivedAt = reasoningEvents.map((event) => stringField(event, "receivedAt")).filter((value) => Boolean(value));
|
|
10
|
+
return {
|
|
11
|
+
requested: true,
|
|
12
|
+
available: true,
|
|
13
|
+
providerRequestId: input.providerRequestId ?? stringField(request, "providerRequestId") ?? "unknown",
|
|
14
|
+
piboSessionId: stringField(request, "piboSessionId"),
|
|
15
|
+
turnId: stringField(request, "turnId"),
|
|
16
|
+
provider: stringField(request, "provider"),
|
|
17
|
+
api: stringField(request, "api"),
|
|
18
|
+
model: stringField(request, "model"),
|
|
19
|
+
transport: stringField(request, "transport"),
|
|
20
|
+
status: stringField(request, "status"),
|
|
21
|
+
startedAt,
|
|
22
|
+
completedAt: stringField(request, "completedAt"),
|
|
23
|
+
httpStatus: optionalNumberField(request, "httpStatus"),
|
|
24
|
+
upstreamResponseId: stringField(request, "upstreamResponseId"),
|
|
25
|
+
rawEventCount: optionalNumberField(request, "rawEventCount"),
|
|
26
|
+
normalizedEventCount: optionalNumberField(request, "normalizedEventCount"),
|
|
27
|
+
parseErrorCount: optionalNumberField(request, "parseErrorCount"),
|
|
28
|
+
unknownEventCount: optionalNumberField(request, "unknownEventCount"),
|
|
29
|
+
firstByteLatencyMs: durationBetweenMs(startedAt, stringField(request, "firstByteAt")),
|
|
30
|
+
firstTextLatencyMs: durationBetweenMs(startedAt, textReceivedAt[0]),
|
|
31
|
+
firstReasoningLatencyMs: durationBetweenMs(startedAt, reasoningReceivedAt[0]),
|
|
32
|
+
eventTypeCounts: recordField(request, "eventTypeCounts"),
|
|
33
|
+
textDeltaCount: textEvents.length,
|
|
34
|
+
reasoningDeltaCount: reasoningEvents.length,
|
|
35
|
+
textDeltaBytes: numericStats(textEvents.map(providerDeltaBytes)),
|
|
36
|
+
reasoningDeltaBytes: numericStats(reasoningEvents.map(providerDeltaBytes)),
|
|
37
|
+
textDeltaGapsMs: numericStats(gapsBetweenIso(textReceivedAt)),
|
|
38
|
+
reasoningDeltaGapsMs: numericStats(gapsBetweenIso(reasoningReceivedAt)),
|
|
39
|
+
eventPageCount: input.eventPageCount ?? 1,
|
|
40
|
+
truncated: input.truncated === true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export async function collectStreamingProviderTelemetryFromSelectedBrowserSession(client) {
|
|
44
|
+
const selected = await client.evaluate(`(() => ({
|
|
45
|
+
piboSessionId: document.querySelector('[data-pibo-debug="chat-shell"]')?.getAttribute('data-pibo-session-id')
|
|
46
|
+
|| document.querySelector('[data-pibo-selected-session-id]')?.getAttribute('data-pibo-selected-session-id')
|
|
47
|
+
|| undefined,
|
|
48
|
+
}))()`, 5_000).catch(() => ({}));
|
|
49
|
+
const piboSessionId = isRecord(selected) && typeof selected.piboSessionId === "string" ? selected.piboSessionId : undefined;
|
|
50
|
+
if (!piboSessionId)
|
|
51
|
+
return unavailableStreamingProviderTelemetry("selected-session", "No selected Chat session was found in the current browser target.");
|
|
52
|
+
return collectStreamingProviderTelemetryFromSession(piboSessionId);
|
|
53
|
+
}
|
|
54
|
+
export function collectStreamingProviderTelemetry(providerRequestId, store = resolveDebugStore("pibo-data")) {
|
|
55
|
+
const provider = inspectTelemetryProvider(store, providerRequestId);
|
|
56
|
+
if (!provider.available)
|
|
57
|
+
return unavailableStreamingProviderTelemetry(providerRequestId, provider.message);
|
|
58
|
+
const events = [];
|
|
59
|
+
let after;
|
|
60
|
+
let pageCount = 0;
|
|
61
|
+
let truncated = false;
|
|
62
|
+
for (;;) {
|
|
63
|
+
const page = inspectTelemetryProviderEvents(store, providerRequestId, { limit: "200", after });
|
|
64
|
+
if (!page.available)
|
|
65
|
+
return unavailableStreamingProviderTelemetry(providerRequestId, page.message);
|
|
66
|
+
pageCount += 1;
|
|
67
|
+
events.push(...page.rows);
|
|
68
|
+
if (!page.page.hasMore || page.page.nextAfterSequence === undefined)
|
|
69
|
+
break;
|
|
70
|
+
if (pageCount >= 50) {
|
|
71
|
+
truncated = true;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
after = String(page.page.nextAfterSequence);
|
|
75
|
+
}
|
|
76
|
+
return summarizeStreamingProviderTelemetry({ request: provider.request, events, providerRequestId, truncated, eventPageCount: pageCount });
|
|
77
|
+
}
|
|
78
|
+
export function collectStreamingProviderTelemetryFromSession(piboSessionId) {
|
|
79
|
+
const store = resolveDebugStore("pibo-data");
|
|
80
|
+
const session = inspectTelemetrySession(store, piboSessionId, { limit: "20" });
|
|
81
|
+
if (!session.available)
|
|
82
|
+
return unavailableStreamingProviderTelemetry(`session:${piboSessionId}`, session.message);
|
|
83
|
+
const directProviderRequestId = latestProviderRequestId(session.detail.providerRequests);
|
|
84
|
+
if (directProviderRequestId)
|
|
85
|
+
return collectStreamingProviderTelemetry(directProviderRequestId, store);
|
|
86
|
+
for (const turn of session.detail.recentTurns) {
|
|
87
|
+
const timeline = inspectTelemetryTurn(store, turn.turnId, { limit: "20" });
|
|
88
|
+
if (!timeline.available)
|
|
89
|
+
continue;
|
|
90
|
+
const providerRequestId = latestProviderRequestId(timeline.timeline.providerRequests);
|
|
91
|
+
if (providerRequestId)
|
|
92
|
+
return collectStreamingProviderTelemetry(providerRequestId, store);
|
|
93
|
+
}
|
|
94
|
+
return unavailableStreamingProviderTelemetry(`session:${piboSessionId}`, `No provider request found for Pibo Session ${piboSessionId}.`);
|
|
95
|
+
}
|
|
96
|
+
export function collectStreamingProviderTelemetryFromTurn(turnIdOrEventId) {
|
|
97
|
+
const store = resolveDebugStore("pibo-data");
|
|
98
|
+
const timeline = inspectTelemetryTurn(store, turnIdOrEventId, { limit: "20" });
|
|
99
|
+
if (!timeline.available)
|
|
100
|
+
return unavailableStreamingProviderTelemetry(`turn:${turnIdOrEventId}`, timeline.message);
|
|
101
|
+
const providerRequestId = latestProviderRequestId(timeline.timeline.providerRequests);
|
|
102
|
+
if (providerRequestId)
|
|
103
|
+
return collectStreamingProviderTelemetry(providerRequestId, store);
|
|
104
|
+
return unavailableStreamingProviderTelemetry(`turn:${turnIdOrEventId}`, `No provider request found for turn or event ${turnIdOrEventId}.`);
|
|
105
|
+
}
|
|
106
|
+
function latestProviderRequestId(providerRequests) {
|
|
107
|
+
for (let index = providerRequests.length - 1; index >= 0; index--) {
|
|
108
|
+
const providerRequestId = providerRequests[index]?.providerRequestId;
|
|
109
|
+
if (providerRequestId)
|
|
110
|
+
return providerRequestId;
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
function unavailableStreamingProviderTelemetry(providerRequestId, message) {
|
|
115
|
+
return {
|
|
116
|
+
requested: true,
|
|
117
|
+
available: false,
|
|
118
|
+
providerRequestId,
|
|
119
|
+
textDeltaCount: 0,
|
|
120
|
+
reasoningDeltaCount: 0,
|
|
121
|
+
textDeltaBytes: numericStats([]),
|
|
122
|
+
reasoningDeltaBytes: numericStats([]),
|
|
123
|
+
textDeltaGapsMs: numericStats([]),
|
|
124
|
+
reasoningDeltaGapsMs: numericStats([]),
|
|
125
|
+
eventPageCount: 0,
|
|
126
|
+
truncated: false,
|
|
127
|
+
error: message,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function isProviderTextDeltaEvent(event) {
|
|
131
|
+
return stringField(event, "normalizedType") === "assistant_delta" || stringField(event, "eventType") === "pi.text_delta";
|
|
132
|
+
}
|
|
133
|
+
function isProviderReasoningDeltaEvent(event) {
|
|
134
|
+
const normalizedType = stringField(event, "normalizedType");
|
|
135
|
+
const eventType = stringField(event, "eventType") ?? "";
|
|
136
|
+
return normalizedType === "thinking_delta" || eventType === "pi.thinking_delta" || (eventType.includes("reasoning") && eventType.includes("delta"));
|
|
137
|
+
}
|
|
138
|
+
function providerDeltaBytes(event) {
|
|
139
|
+
const safeFields = recordField(event, "safeFields");
|
|
140
|
+
return optionalNumberField(safeFields, "deltaBytes") ?? optionalNumberField(safeFields, "contentBytes") ?? optionalNumberField(event, "byteSize");
|
|
141
|
+
}
|
|
142
|
+
function gapsBetweenIso(values) {
|
|
143
|
+
const gaps = [];
|
|
144
|
+
let previous;
|
|
145
|
+
for (const value of values) {
|
|
146
|
+
const current = Date.parse(value);
|
|
147
|
+
if (!Number.isFinite(current))
|
|
148
|
+
continue;
|
|
149
|
+
if (previous !== undefined)
|
|
150
|
+
gaps.push(round3(current - previous));
|
|
151
|
+
previous = current;
|
|
152
|
+
}
|
|
153
|
+
return gaps;
|
|
154
|
+
}
|
|
155
|
+
function durationBetweenMs(start, end) {
|
|
156
|
+
if (!start || !end)
|
|
157
|
+
return undefined;
|
|
158
|
+
const startMs = Date.parse(start);
|
|
159
|
+
const endMs = Date.parse(end);
|
|
160
|
+
if (!Number.isFinite(startMs) || !Number.isFinite(endMs))
|
|
161
|
+
return undefined;
|
|
162
|
+
return round3(endMs - startMs);
|
|
163
|
+
}
|
|
164
|
+
function stringField(value, key) {
|
|
165
|
+
return isRecord(value) && typeof value[key] === "string" ? value[key] : undefined;
|
|
166
|
+
}
|
|
167
|
+
function recordField(value, key) {
|
|
168
|
+
return isRecord(value) && isRecord(value[key]) ? value[key] : undefined;
|
|
169
|
+
}
|
|
170
|
+
function optionalNumberField(value, key) {
|
|
171
|
+
return isRecord(value) && typeof value[key] === "number" && Number.isFinite(value[key]) ? value[key] : undefined;
|
|
172
|
+
}
|
|
173
|
+
function numericStats(values) {
|
|
174
|
+
const nums = values.filter((value) => typeof value === "number" && Number.isFinite(value)).sort((left, right) => left - right);
|
|
175
|
+
if (!nums.length)
|
|
176
|
+
return { count: 0 };
|
|
177
|
+
const pick = (quantile) => nums[Math.min(nums.length - 1, Math.floor((nums.length - 1) * quantile))] ?? nums[nums.length - 1] ?? 0;
|
|
178
|
+
const avg = nums.reduce((total, value) => total + value, 0) / nums.length;
|
|
179
|
+
return {
|
|
180
|
+
count: nums.length,
|
|
181
|
+
min: round3(nums[0]),
|
|
182
|
+
p50: round3(pick(0.50)),
|
|
183
|
+
p90: round3(pick(0.90)),
|
|
184
|
+
p99: round3(pick(0.99)),
|
|
185
|
+
max: round3(nums[nums.length - 1]),
|
|
186
|
+
avg: round3(avg),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function round3(value) {
|
|
190
|
+
return Math.round(value * 1000) / 1000;
|
|
191
|
+
}
|
|
192
|
+
function isRecord(value) {
|
|
193
|
+
return typeof value === "object" && value !== null;
|
|
194
|
+
}
|