@xopcai/xopc 0.0.308 → 0.0.311
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/dist/browser-ext/_locales/en/messages.json +8 -0
- package/dist/browser-ext/_locales/zh_CN/messages.json +8 -0
- package/dist/browser-ext/dist/assets/{sidepanel-BbSQr-6P.css → sidepanel-DD6GEMvc.css} +16 -0
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +537 -96
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-wgSB2HYK.js → activity-store-DVUTs1fk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-dUotwUO6.js → agent-avatar-dicebear-zKINl7UH.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D2ePZKdY.js +1 -0
- package/dist/gateway/static/root/assets/{agents-VPDIGRSS.js → agents-BiD9STyv.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BKHmTb0w.js → api-_aHQA8bd.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-BiBXVEvp.js → app-link-wamYbNUl.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-zPz0rOND.js → app-management-settings-panel-C94LAxyt.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DhvhR43G.js → appearance-settings-CP01zHvC.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-B7DmSJQj.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BQVZMreT.js → archive-plugin-SwWFt5MT.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CPE-TMPf.js → attachment-load-DdTFml9l.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C4IAy_zF.js → automations-page-Kmr5WVFp.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-bkijiu-Y.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DgTl7diZ.js → binary-plugins-47UTtDNq.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CcOVA-Gw.js → block-editor-DvzZkMG8.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BzkJog8e.js → browser-automation-inputs-C611KRBx.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page--zKAgj1k.js → browser-automations-page-DrUKNL9X.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-Dhf_MWCf.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BCubrDf8.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-e4T1DEfN.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BfLd2rIJ.js → chat-terminal-dock-Bg_m7HUE.js} +2 -2
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-Cq1tE_3b.js → chunk-KS7C4IRE-BMYIfy9x.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-CosCmVsT.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-BlC1OXX4.js → connector-service-page-BL-hSR7_.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C0WWxnxJ.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-DqYFVasF.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-CF_zYzxX.js → dependency-picker-DCyyFLKp.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CDwtLR7Z.js → desktop-pet-CFnnpRA_.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-U5wWRH4c.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-BhHxvFO1.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CX5OXxEU.js → extension-debug-page-DA8WJ3-E.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BytR1PaY.js → extension-page-C2BIB88m.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CkaMJA5F.js → extension-settings-page-kpYo979N.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B6wHa6ZI.js → gateway-config-swr-DUDX42qY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-B53R0CA4.js → gateway-realtime-CGOW0-b4.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-D4um_sV7.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CE9t1yTa.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DRzGnEV-.js → gateway-startup-retry-Cf8OxlvY.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-C7Ezx8Du.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Ck_pyDom.js → image-generation-api-D2YorS--.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DrtbjL8O.js → imports-page-NPk698vI.js} +1 -1
- package/dist/gateway/static/root/assets/index-1wIKA-kM.css +1 -0
- package/dist/gateway/static/root/assets/index-DxYitLp8.js +79 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BlZh41Xq.js → keyboard-shortcuts-settings-BhreF0_O.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CPmynb3x.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DbP7wWuh.js → local-apps-page-DOZZBdqj.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-msTfRK8P.js → locale-store-DA0Z5jM_.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-C0n66FiO.js → logs-page-M8kz26yo.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-i6GhxpGV.js → management-settings-JLqHYQvY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BInabSKf.js → markdown-view-BDpcjR_Z.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-DSjfHfaW.css +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-CnWChQ3Y.js → media-plugins-B75SWUJd.js} +1 -1
- package/dist/gateway/static/root/assets/messages-4BtQKYlM.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-B_Ft0M32.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-C32mxSD-.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-BWitjb3e.js → page-tabs-CMlQUzT6.js} +1 -1
- package/dist/gateway/static/root/assets/{popover-select-9i-ZtHXL.js → popover-select-B-GDnZO9.js} +1 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-cZ2hszQT.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-gmi5LLwM.js → product-open-page-CPoSbglF.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DYttWua0.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-D46drWbl.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BSWtko7U.js → registry-api-C0DCx3wv.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C9n9Nuhi.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CtOjKGWg.js → runtime-tools-settings-panel-bMLWRApp.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-Dw3hmHAr.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-DkyyDcl2.js → schema-form-UVJV_7AS.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C8P6ff91.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-whpUsAy3.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-C0JDGN_V.js → settings-form-section-BqzOqonM.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-DQ9RJ8-b.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-layout-D3Spald3.js +1 -0
- package/dist/gateway/static/root/assets/{settings-shell-layer-context-DCp6ykjQ.js → settings-shell-layer-context-BTQUDoJ2.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-C8u601m8.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-Bt1K657Y.js → share-preview-page-BcgYzA7y.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bv-2rZ8e.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-LM-cgWUS.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-ggmb7rCW.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-vq5Ujm03.js → skills-page.utils-ADABzrtk.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-DfkcW_Za.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DC4yqDFd.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-1SZ-HFHX.js → theme-store-CegIlB8d.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-CTuwTdMm.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-5ZDd9XKh.js +1 -0
- package/dist/gateway/static/root/assets/user-model-page-BFKFhdZ0.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-B2pZCcxY.js → voice-api-key-field-D3urfd-n.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DgJML_uM.js → voice-config-api-DTyMdGOR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Bptv7bEY.js → work-discovery-overlay-JzM3Ylbs.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BijCrNc4.js → workflow-run-setup-panel-Bn2CtRdB.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BiCmt98A.js +6 -0
- package/dist/gateway/static/root/connector-icons/SOURCES.md +0 -2
- package/dist/gateway/static/root/index.html +17 -20
- package/dist/gateway/static/root/notification-sw.js +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/notifications.js +12 -11
- package/dist/packages/gateway-contract/src/proactive.js +6 -6
- package/dist/packages/gateway-contract/src/project-monitoring.js +4 -4
- package/dist/packages/gateway-contract/src/project-operating.js +1 -4
- package/dist/packages/gateway-contract/src/sessions.js +6 -1
- package/dist/src/agent/agent-manager.d.ts +2 -6
- package/dist/src/agent/agent-manager.js +31 -5
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/child-agent-factory.d.ts +1 -0
- package/dist/src/agent/child-agent-factory.js +18 -4
- package/dist/src/agent/coding/repository-instructions.d.ts +4 -0
- package/dist/src/agent/coding/repository-instructions.js +46 -2
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/data-acquisition/git.d.ts +17 -0
- package/dist/src/agent/data-acquisition/git.js +100 -0
- package/dist/src/agent/data-acquisition/render.d.ts +7 -0
- package/dist/src/agent/data-acquisition/render.js +79 -0
- package/dist/src/agent/data-acquisition/scheduler.d.ts +12 -0
- package/dist/src/agent/data-acquisition/scheduler.js +53 -0
- package/dist/src/agent/data-acquisition/schema.d.ts +75 -0
- package/dist/src/agent/data-acquisition/schema.js +206 -0
- package/dist/src/agent/data-acquisition/service.d.ts +10 -0
- package/dist/src/agent/data-acquisition/service.js +292 -0
- package/dist/src/agent/data-acquisition/types.d.ts +37 -0
- package/dist/src/agent/data-acquisition/types.js +5 -0
- package/dist/src/agent/embedded/run-turn.js +16 -4
- package/dist/src/agent/embedded/session-runner.d.ts +1 -0
- package/dist/src/agent/embedded/session-runner.js +3 -0
- package/dist/src/agent/embedded/tool-result-truncation.js +11 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +2 -1
- package/dist/src/agent/external-tools/cliProvider.d.ts +47 -0
- package/dist/src/agent/external-tools/cliProvider.js +317 -0
- package/dist/src/agent/external-tools/composio-provider.js +15 -4
- package/dist/src/agent/external-tools/gateway-tools.js +10 -3
- package/dist/src/agent/external-tools/index.js +14 -1
- package/dist/src/agent/external-tools/read-policy.d.ts +6 -0
- package/dist/src/agent/external-tools/read-policy.js +21 -0
- package/dist/src/agent/external-tools/service.d.ts +1 -0
- package/dist/src/agent/external-tools/service.js +4 -1
- package/dist/src/agent/external-tools/types.d.ts +3 -1
- package/dist/src/agent/external-tools/types.js +1 -0
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/memory/turn-provenance.js +2 -1
- package/dist/src/agent/orchestration/agent-turn-policy.js +25 -10
- package/dist/src/agent/orchestration/delegation-scope.d.ts +9 -0
- package/dist/src/agent/orchestration/delegation-scope.js +11 -0
- package/dist/src/agent/prompt/sections/tooling.js +3 -1
- package/dist/src/agent/prompt/subagent-context.js +4 -2
- package/dist/src/agent/sandbox/fileAccess.d.ts +2 -0
- package/dist/src/agent/sandbox/fileAccess.js +31 -2
- package/dist/src/agent/service/parse-outbound-session-key.js +1 -1
- package/dist/src/agent/service.js +1 -0
- package/dist/src/agent/service.types.d.ts +2 -0
- package/dist/src/agent/tools/dataBatch.d.ts +4 -0
- package/dist/src/agent/tools/dataBatch.js +50 -0
- package/dist/src/agent/tools/delegate-tool.d.ts +6 -3
- package/dist/src/agent/tools/delegate-tool.js +65 -48
- package/dist/src/agent/tools/delegation-parent-policy.d.ts +7 -0
- package/dist/src/agent/tools/delegation-parent-policy.js +41 -0
- package/dist/src/agent/tools/delegation-policy.d.ts +16 -0
- package/dist/src/agent/tools/delegation-policy.js +93 -0
- package/dist/src/agent/tools/factory.d.ts +4 -0
- package/dist/src/agent/tools/factory.js +45 -5
- package/dist/src/agent/tools/fetch-text.d.ts +7 -0
- package/dist/src/agent/tools/fetch-text.js +86 -0
- package/dist/src/agent/tools/find.js +1 -1
- package/dist/src/agent/tools/grep.js +11 -23
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/knowledge-memory-tool.js +10 -2
- package/dist/src/agent/tools/read.js +7 -5
- package/dist/src/agent/tools/repository-search.d.ts +12 -2
- package/dist/src/agent/tools/repository-search.js +127 -74
- package/dist/src/agent/tools/search/providers/xopc-cloud.d.ts +20 -0
- package/dist/src/agent/tools/search/providers/xopc-cloud.js +56 -0
- package/dist/src/agent/tools/search/registry.d.ts +4 -2
- package/dist/src/agent/tools/search/registry.js +5 -3
- package/dist/src/agent/tools/web.js +19 -28
- package/dist/src/agent/tools/xopc-use-tool.d.ts +4 -2
- package/dist/src/agent/tools/xopc-use-tool.js +46 -43
- package/dist/src/agent/workflow/subagent-runner.js +25 -3
- package/dist/src/agent/workflow/workflow-child-tools.js +13 -8
- package/dist/src/agent-config/schema.d.ts +7 -0
- package/dist/src/agent-config/schema.js +2 -0
- package/dist/src/automations/service/automation-service.d.ts +0 -4
- package/dist/src/automations/service/automation-service.js +0 -31
- package/dist/src/capabilities/store-connector.js +46 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/config/schema.d.ts +8 -4
- package/dist/src/config/schema.js +2 -12
- package/dist/src/config/web-patch.js +0 -5
- package/dist/src/connectors/account-selection.d.ts +14 -0
- package/dist/src/connectors/account-selection.js +26 -0
- package/dist/src/connectors/china-catalog.js +93 -226
- package/dist/src/connectors/cli/adapterRegistry.d.ts +4 -0
- package/dist/src/connectors/cli/adapterRegistry.js +26 -0
- package/dist/src/connectors/cli/adapters/lark.d.ts +2 -0
- package/dist/src/connectors/cli/adapters/lark.js +143 -0
- package/dist/src/connectors/cli/adapters/larkShortcuts.d.ts +3 -0
- package/dist/src/connectors/cli/adapters/larkShortcuts.js +64 -0
- package/dist/src/connectors/cli/adapters/wecom.d.ts +2 -0
- package/dist/src/connectors/cli/adapters/wecom.js +97 -0
- package/dist/src/connectors/cli/adapters/wps365/bundle.js +575 -0
- package/dist/src/connectors/cli/adapters/wps365.d.ts +2 -0
- package/dist/src/connectors/cli/adapters/wps365.js +115 -0
- package/dist/src/connectors/cli/assets.d.ts +3 -0
- package/dist/src/connectors/cli/assets.js +44 -0
- package/dist/src/connectors/cli/authorization.d.ts +16 -0
- package/dist/src/connectors/cli/authorization.js +184 -0
- package/dist/src/connectors/cli/distributions.d.ts +4 -0
- package/dist/src/connectors/cli/distributions.js +69 -0
- package/dist/src/connectors/cli/installer.d.ts +5 -0
- package/dist/src/connectors/cli/installer.js +102 -0
- package/dist/src/connectors/cli/lifecycle.d.ts +1 -0
- package/dist/src/connectors/cli/lifecycle.js +19 -0
- package/dist/src/connectors/cli/process.d.ts +18 -0
- package/dist/src/connectors/cli/process.js +100 -0
- package/dist/src/connectors/cli/protocol.d.ts +10 -0
- package/dist/src/connectors/cli/protocol.js +63 -0
- package/dist/src/connectors/cli/runtime.d.ts +10 -0
- package/dist/src/connectors/cli/runtime.js +93 -0
- package/dist/src/connectors/cli/store.d.ts +35 -0
- package/dist/src/connectors/cli/store.js +121 -0
- package/dist/src/connectors/cli/types.d.ts +73 -0
- package/dist/src/connectors/composio-backends.js +1 -1
- package/dist/src/connectors/composio-sessions.d.ts +1 -0
- package/dist/src/connectors/composio-sessions.js +8 -3
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connection-candidates.js +22 -3
- package/dist/src/connectors/connection-recovery-service.d.ts +1 -0
- package/dist/src/connectors/connection-recovery-service.js +53 -8
- package/dist/src/connectors/health.js +52 -0
- package/dist/src/connectors/instances.js +5 -1
- package/dist/src/connectors/lifecycle.js +2 -0
- package/dist/src/connectors/principal.js +2 -1
- package/dist/src/connectors/runtime-adapter-registry.js +31 -0
- package/dist/src/connectors/types.d.ts +13 -1
- package/dist/src/connectors/usage.js +1 -1
- package/dist/src/connectors/workflow-preflight.js +8 -4
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/hono/app.d.ts +2 -0
- package/dist/src/gateway/hono/app.js +4 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +2 -15
- package/dist/src/gateway/hono/lib/config-payload.js +0 -11
- package/dist/src/gateway/hono/routes/cli-connectors.d.ts +3 -0
- package/dist/src/gateway/hono/routes/cli-connectors.js +219 -0
- package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +2 -2
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +0 -59
- package/dist/src/gateway/hono/routes/config.js +0 -16
- package/dist/src/gateway/hono/routes/connectors.js +21 -22
- package/dist/src/gateway/hono/routes/deps.d.ts +2 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +4 -17
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/public-gateway.js +0 -1
- package/dist/src/gateway/hono/routes/scenes.d.ts +3 -0
- package/dist/src/gateway/hono/routes/scenes.js +142 -0
- package/dist/src/gateway/hono/routes/sessions.js +141 -13
- package/dist/src/gateway/hono/routes/tasks.js +0 -46
- package/dist/src/gateway/hono/routes/user-model.js +54 -1
- package/dist/src/gateway/scenes/browserNotifications.d.ts +4 -0
- package/dist/src/gateway/scenes/browserNotifications.js +54 -0
- package/dist/src/gateway/scenes/host.d.ts +34 -0
- package/dist/src/gateway/scenes/host.js +129 -0
- package/dist/src/gateway/scenes/mailContext.d.ts +32 -0
- package/dist/src/gateway/scenes/mailContext.js +235 -0
- package/dist/src/gateway/security/gateway-scopes.js +0 -4
- package/dist/src/gateway/security/index.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -10
- package/dist/src/gateway/service/config-coordinator.js +0 -16
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service.d.ts +4 -25
- package/dist/src/gateway/service.js +44 -99
- package/dist/src/gateway/session-context-summary.js +2 -1
- package/dist/src/infra/unhandled-rejections.js +1 -1
- package/dist/src/migrations/runner.js +1 -4
- package/dist/src/notifications/browser-endpoint.d.ts +2 -0
- package/dist/src/notifications/browser-endpoint.js +13 -0
- package/dist/src/notifications/browserSubscriptions.d.ts +20 -0
- package/dist/src/notifications/browserSubscriptions.js +59 -0
- package/dist/src/notifications/browserTransport.d.ts +9 -0
- package/dist/src/notifications/browserTransport.js +64 -0
- package/dist/src/notifications/dispatch.d.ts +46 -0
- package/dist/src/notifications/dispatch.js +109 -0
- package/dist/src/notifications/domain-delivery.d.ts +21 -0
- package/dist/src/notifications/planner.js +0 -36
- package/dist/src/notifications/quietHours.d.ts +6 -0
- package/dist/src/notifications/quietHours.js +23 -0
- package/dist/src/notifications/resultOutbox.d.ts +23 -0
- package/dist/src/notifications/resultOutbox.js +49 -0
- package/dist/src/notifications/service.d.ts +18 -4
- package/dist/src/notifications/service.js +42 -61
- package/dist/src/notifications/store.d.ts +2 -1
- package/dist/src/notifications/store.js +7 -8
- package/dist/src/projects/project-service.d.ts +1 -4
- package/dist/src/projects/project-service.js +2 -30
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +19 -1
- package/dist/src/providers/model-catalog-store.js +1 -0
- package/dist/src/providers/model-catalog-types.d.ts +17 -0
- package/dist/src/providers/xopc-cloud-model-source.js +27 -0
- package/dist/src/scenes/agentExecutor.d.ts +8 -0
- package/dist/src/scenes/agentExecutor.js +63 -0
- package/dist/src/scenes/contracts.d.ts +118 -0
- package/dist/src/scenes/contracts.js +145 -0
- package/dist/src/scenes/execution.d.ts +56 -0
- package/dist/src/scenes/execution.js +168 -0
- package/dist/src/scenes/httpServices.d.ts +34 -0
- package/dist/src/scenes/inbox.d.ts +16 -0
- package/dist/src/scenes/inbox.js +68 -0
- package/dist/src/scenes/mailContext.d.ts +20 -0
- package/dist/src/scenes/mailContext.js +106 -0
- package/dist/src/scenes/mailObservations.d.ts +20 -0
- package/dist/src/scenes/mailObservations.js +107 -0
- package/dist/src/scenes/maintenance.d.ts +3 -0
- package/dist/src/scenes/maintenance.js +24 -0
- package/dist/src/scenes/metrics.d.ts +35 -0
- package/dist/src/scenes/metrics.js +94 -0
- package/dist/src/scenes/notificationEligibility.d.ts +17 -0
- package/dist/src/scenes/notificationEligibility.js +72 -0
- package/dist/src/scenes/notificationPublication.d.ts +7 -0
- package/dist/src/scenes/notificationPublication.js +43 -0
- package/dist/src/scenes/preferences.d.ts +40 -0
- package/dist/src/scenes/preferences.js +108 -0
- package/dist/src/scenes/readiness.d.ts +7 -0
- package/dist/src/scenes/readiness.js +20 -0
- package/dist/src/scenes/repository.d.ts +174 -0
- package/dist/src/scenes/repository.js +740 -0
- package/dist/src/scenes/resultNotifications.d.ts +17 -0
- package/dist/src/scenes/resultNotifications.js +204 -0
- package/dist/src/scenes/runtime.d.ts +25 -0
- package/dist/src/scenes/runtime.js +101 -0
- package/dist/src/scenes/schedule.d.ts +9 -0
- package/dist/src/scenes/schedule.js +45 -0
- package/dist/src/scenes/service.d.ts +29 -0
- package/dist/src/scenes/service.js +116 -0
- package/dist/src/scenes/templates.d.ts +64 -0
- package/dist/src/scenes/templates.js +76 -0
- package/dist/src/scenes/userNotes.d.ts +10 -0
- package/dist/src/scenes/userNotes.js +34 -0
- package/dist/src/session/resolve-session.js +2 -1
- package/dist/src/session/store.js +2 -1
- package/dist/src/share/share-config.js +0 -5
- package/dist/src/share/site-share-config.js +0 -5
- package/dist/src/storage/sqlite/connection-wait-repository.js +20 -7
- package/dist/src/storage/sqlite/connection.js +1 -1
- package/dist/src/storage/sqlite/connector-account-repository.js +1 -0
- package/dist/src/storage/sqlite/connector-sync-policy-repository.d.ts +0 -4
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +3 -17
- package/dist/src/storage/sqlite/conversation-repository.js +2 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +4 -2
- package/dist/src/storage/sqlite/migrations/186_sidebar_layout.sql +16 -0
- package/dist/src/storage/sqlite/migrations/187_cli_connectors.sql +34 -0
- package/dist/src/storage/sqlite/migrations/188_scene_storage.sql +2 -0
- package/dist/src/storage/sqlite/migrations/189_scene_source_health.sql +8 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +2 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +7 -3
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +20 -44
- package/dist/src/storage/sqlite/migrations/scene-reset.d.ts +5 -0
- package/dist/src/storage/sqlite/migrations/scene-reset.js +40 -0
- package/dist/src/storage/sqlite/scenes-schema.d.ts +8 -0
- package/dist/src/storage/sqlite/scenes-schema.js +61 -0
- package/dist/src/storage/sqlite/schema.js +4 -10
- package/dist/src/storage/sqlite/schemas/notifications.sql +65 -0
- package/dist/src/storage/sqlite/schemas/scenes.sql +212 -0
- package/dist/src/storage/sqlite/session-read-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/session-read-repository.js +35 -0
- package/dist/src/storage/sqlite/session-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-repository.js +2 -25
- package/dist/src/storage/sqlite/sidebar-layout-repository.d.ts +12 -0
- package/dist/src/storage/sqlite/sidebar-layout-repository.js +53 -0
- package/dist/src/storage/sqlite/sql-assets.d.ts +2 -0
- package/dist/src/storage/sqlite/sql-assets.js +18 -0
- package/dist/src/storage/sqlite/transaction.d.ts +2 -0
- package/dist/src/storage/sqlite/transaction.js +20 -1
- package/dist/src/tasks/home-query-service.d.ts +0 -2
- package/dist/src/tasks/home-query-service.js +13 -43
- package/dist/src/tasks/index.d.ts +0 -1
- package/dist/src/tasks/index.js +4 -5
- package/dist/src/tasks/project-operating-view-service.js +1 -4
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/user-model/goals.d.ts +10 -0
- package/dist/src/user-model/goals.js +29 -1
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/voice/realtime/memory-context.js +2 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +5 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C6LflMXr.js +0 -1
- package/dist/gateway/static/root/assets/api-DFOlahZv.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Pmslbzzr.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-Fx5VUJRu.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DBms6d35.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-epdDWIZy.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-B0bsDtmP.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-B2JwuTjG.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-Ckgc0Py-.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-By33-bF1.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-CqNE-nf6.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BS9ZjzYJ.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-C0djIc1J.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CDKj9LQj.js +0 -1
- package/dist/gateway/static/root/assets/external-link-DjqjBmc3.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BLDgrJ30.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-_YU-1p0z.js +0 -1
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-CVIvvm4x.js +0 -1
- package/dist/gateway/static/root/assets/home-page-COCHelcL.js +0 -1
- package/dist/gateway/static/root/assets/index-CDfcPiPb.js +0 -79
- package/dist/gateway/static/root/assets/index-CRu1p38D.css +0 -1
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-D7_Raxjw.js +0 -2
- package/dist/gateway/static/root/assets/markdown-view-Y68dCxuc.css +0 -1
- package/dist/gateway/static/root/assets/messages-F74LVAiU.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-C59d8vDW.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-C1GBPrVI.js +0 -8
- package/dist/gateway/static/root/assets/preview-open-alternatives-UaCWCxZv.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-CtSFJxoM.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-ILTmQ1YN.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-snl4rOQZ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BbaAcEN3.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DrWL71O8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BG0kl4HT.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-DiIyMQ52.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-X1x-2Cp9.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-EPazhoZO.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-g2MdRXSZ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B1DPzu98.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-Wd0uYSPG.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-Cz1P-HDH.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BG3A5gPZ.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-DQGoFuZO.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-DVDlBb95.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-qM5UiTGx.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DRy1RAYH.js +0 -6
- package/dist/gateway/static/root/connector-icons/wps-calendar.svg +0 -14
- package/dist/gateway/static/root/connector-icons/wps-mail.svg +0 -7
- package/dist/src/connectors/source-change-publisher.d.ts +0 -17
- package/dist/src/connectors/source-change-publisher.js +0 -151
- package/dist/src/gateway/heartbeat/check-store.d.ts +0 -18
- package/dist/src/gateway/heartbeat/check-store.js +0 -74
- package/dist/src/gateway/heartbeat/index.d.ts +0 -1
- package/dist/src/gateway/heartbeat/index.js +0 -2
- package/dist/src/gateway/heartbeat/service.d.ts +0 -55
- package/dist/src/gateway/heartbeat/service.js +0 -228
- package/dist/src/gateway/hono/routes/proactive-control.d.ts +0 -3
- package/dist/src/gateway/hono/routes/proactive-control.js +0 -135
- package/dist/src/gateway/hono/routes/proactive.d.ts +0 -4
- package/dist/src/gateway/hono/routes/proactive.js +0 -164
- package/dist/src/gateway/hono/routes/workspace.d.ts +0 -3
- package/dist/src/gateway/hono/routes/workspace.js +0 -62
- package/dist/src/gateway/workspace-heartbeat-path.d.ts +0 -3
- package/dist/src/gateway/workspace-heartbeat-path.js +0 -14
- package/dist/src/migrations/conversation-routing-config.d.ts +0 -2
- package/dist/src/migrations/conversation-routing-config.js +0 -42
- package/dist/src/notifications/proactive-channel.d.ts +0 -8
- package/dist/src/notifications/proactive-channel.js +0 -60
- package/dist/src/notifications/proactive-policy.d.ts +0 -3
- package/dist/src/notifications/proactive-policy.js +0 -35
- package/dist/src/notifications/web-push.d.ts +0 -19
- package/dist/src/notifications/web-push.js +0 -185
- package/dist/src/proactive/actions/service.d.ts +0 -1
- package/dist/src/proactive/actions/service.js +0 -82
- package/dist/src/proactive/events/envelope.d.ts +0 -2
- package/dist/src/proactive/events/envelope.js +0 -54
- package/dist/src/proactive/events/product-event-bridge.d.ts +0 -7
- package/dist/src/proactive/events/product-event-bridge.js +0 -87
- package/dist/src/proactive/events/publisher.d.ts +0 -4
- package/dist/src/proactive/events/repository.d.ts +0 -9
- package/dist/src/proactive/events/repository.js +0 -63
- package/dist/src/proactive/events/types.d.ts +0 -44
- package/dist/src/proactive/events/types.js +0 -15
- package/dist/src/proactive/execution/agent-executor.d.ts +0 -21
- package/dist/src/proactive/execution/agent-executor.js +0 -125
- package/dist/src/proactive/execution/authorization.d.ts +0 -7
- package/dist/src/proactive/execution/authorization.js +0 -71
- package/dist/src/proactive/execution/context.d.ts +0 -49
- package/dist/src/proactive/execution/context.js +0 -408
- package/dist/src/proactive/execution/insight.d.ts +0 -14
- package/dist/src/proactive/execution/insight.js +0 -132
- package/dist/src/proactive/execution/repository.d.ts +0 -28
- package/dist/src/proactive/execution/repository.js +0 -211
- package/dist/src/proactive/execution/types.d.ts +0 -80
- package/dist/src/proactive/execution/worker.d.ts +0 -15
- package/dist/src/proactive/execution/worker.js +0 -146
- package/dist/src/proactive/experience.d.ts +0 -89
- package/dist/src/proactive/experience.js +0 -195
- package/dist/src/proactive/follow-ups.d.ts +0 -128
- package/dist/src/proactive/follow-ups.js +0 -182
- package/dist/src/proactive/inbox/cards.d.ts +0 -21
- package/dist/src/proactive/inbox/cards.js +0 -276
- package/dist/src/proactive/inbox/delivery.d.ts +0 -6
- package/dist/src/proactive/inbox/delivery.js +0 -54
- package/dist/src/proactive/inbox/digest.d.ts +0 -8
- package/dist/src/proactive/inbox/digest.js +0 -123
- package/dist/src/proactive/inbox/lifecycle.d.ts +0 -4
- package/dist/src/proactive/inbox/lifecycle.js +0 -62
- package/dist/src/proactive/inbox/notification-policy.d.ts +0 -1
- package/dist/src/proactive/inbox/notification-policy.js +0 -25
- package/dist/src/proactive/inbox/repository.d.ts +0 -25
- package/dist/src/proactive/inbox/repository.js +0 -244
- package/dist/src/proactive/inbox/service.d.ts +0 -23
- package/dist/src/proactive/inbox/service.js +0 -46
- package/dist/src/proactive/inbox/types.d.ts +0 -64
- package/dist/src/proactive/inbox/worker.d.ts +0 -13
- package/dist/src/proactive/inbox/worker.js +0 -71
- package/dist/src/proactive/index.d.ts +0 -20
- package/dist/src/proactive/index.js +0 -14
- package/dist/src/proactive/mail-thread.d.ts +0 -13
- package/dist/src/proactive/mail-thread.js +0 -55
- package/dist/src/proactive/maintenance.d.ts +0 -4
- package/dist/src/proactive/maintenance.js +0 -28
- package/dist/src/proactive/metrics.d.ts +0 -10
- package/dist/src/proactive/metrics.js +0 -28
- package/dist/src/proactive/policy/presence.d.ts +0 -2
- package/dist/src/proactive/policy/presence.js +0 -30
- package/dist/src/proactive/policy/service.d.ts +0 -54
- package/dist/src/proactive/policy/service.js +0 -123
- package/dist/src/proactive/routing/batch-repository.d.ts +0 -27
- package/dist/src/proactive/routing/batch-repository.js +0 -57
- package/dist/src/proactive/routing/matcher.d.ts +0 -5
- package/dist/src/proactive/routing/matcher.js +0 -57
- package/dist/src/proactive/routing/types.d.ts +0 -44
- package/dist/src/proactive/routing/types.js +0 -1
- package/dist/src/proactive/scenarios/control.d.ts +0 -52
- package/dist/src/proactive/scenarios/control.js +0 -75
- package/dist/src/proactive/scenarios/prompt-composer.d.ts +0 -14
- package/dist/src/proactive/scenarios/prompt-composer.js +0 -26
- package/dist/src/proactive/scenarios/repository.d.ts +0 -23
- package/dist/src/proactive/scenarios/repository.js +0 -174
- package/dist/src/proactive/scenarios/service.d.ts +0 -15
- package/dist/src/proactive/scenarios/service.js +0 -26
- package/dist/src/proactive/scenarios/types.d.ts +0 -43
- package/dist/src/proactive/scenarios/types.js +0 -1
- package/dist/src/proactive/service.d.ts +0 -25
- package/dist/src/proactive/service.js +0 -78
- package/dist/src/proactive/source-freshness.d.ts +0 -8
- package/dist/src/proactive/source-freshness.js +0 -28
- package/dist/src/proactive/status.d.ts +0 -2
- package/dist/src/proactive/status.js +0 -22
- package/dist/src/proactive/temporal/schedule.d.ts +0 -3
- package/dist/src/proactive/temporal/schedule.js +0 -68
- package/dist/src/proactive/temporal/worker.d.ts +0 -17
- package/dist/src/proactive/temporal/worker.js +0 -129
- package/dist/src/tasks/project-monitoring-service.d.ts +0 -32
- package/dist/src/tasks/project-monitoring-service.js +0 -118
- /package/dist/src/{proactive/execution → connectors/cli}/types.js +0 -0
- /package/dist/src/{proactive/events/publisher.js → notifications/domain-delivery.js} +0 -0
- /package/dist/src/{proactive/inbox/types.js → scenes/httpServices.js} +0 -0
|
@@ -1,5 +1,132 @@
|
|
|
1
1
|
import { x as t, M as MAX_BROWSER_CONTEXTS_PER_TURN, c as browserPageContextsInputSchema, l as gatewayFetch, k as extensionLocale, o as openDatabase, a as RealtimeClient, R as REALTIME_PROTOCOL_VERSION, b as activeTabId, h as currentTabDescriptor, T as TAB_BINDING_PREFIX, m as getAccessProfile, u as runWithTabSiteAccess, P as PENDING_CONTEXT_KEY, f as captureTabWithPermission, p as pairGateway, w as setAutoConnectEnabled, r as readPendingBrowserPairing, q as readProfile, i as discoverLocalGateway, v as saveExtensionLocalePreference, t as revokeAndForgetProfile, d as cancelPendingBrowserPairing, n as loadExtensionLocalePreference } from './assets/auth-C3yV1y_l.js';
|
|
2
2
|
|
|
3
|
+
const OTHER_ACTIVITY = {
|
|
4
|
+
category: "other",
|
|
5
|
+
action: "use",
|
|
6
|
+
source: "unknown",
|
|
7
|
+
sensitivity: "normal"
|
|
8
|
+
};
|
|
9
|
+
const TOOL_ACTIVITY_CATALOG = {
|
|
10
|
+
memory_search: {
|
|
11
|
+
category: "memory",
|
|
12
|
+
action: "search",
|
|
13
|
+
source: "memory",
|
|
14
|
+
sensitivity: "personal",
|
|
15
|
+
purpose: "personal_context"
|
|
16
|
+
},
|
|
17
|
+
memory_get: {
|
|
18
|
+
category: "memory",
|
|
19
|
+
action: "read",
|
|
20
|
+
source: "memory",
|
|
21
|
+
sensitivity: "personal",
|
|
22
|
+
purpose: "personal_context"
|
|
23
|
+
},
|
|
24
|
+
knowledge_search: {
|
|
25
|
+
category: "memory",
|
|
26
|
+
action: "search",
|
|
27
|
+
source: "memory",
|
|
28
|
+
sensitivity: "personal",
|
|
29
|
+
purpose: "personal_context"
|
|
30
|
+
},
|
|
31
|
+
knowledge_get: {
|
|
32
|
+
category: "memory",
|
|
33
|
+
action: "read",
|
|
34
|
+
source: "memory",
|
|
35
|
+
sensitivity: "personal",
|
|
36
|
+
purpose: "personal_context"
|
|
37
|
+
},
|
|
38
|
+
knowledge_write: {
|
|
39
|
+
category: "memory",
|
|
40
|
+
action: "write",
|
|
41
|
+
source: "memory",
|
|
42
|
+
sensitivity: "personal",
|
|
43
|
+
purpose: "personal_context"
|
|
44
|
+
},
|
|
45
|
+
user_context_search: {
|
|
46
|
+
category: "memory",
|
|
47
|
+
action: "search",
|
|
48
|
+
source: "memory",
|
|
49
|
+
sensitivity: "personal",
|
|
50
|
+
purpose: "personal_context"
|
|
51
|
+
},
|
|
52
|
+
user_context_get: {
|
|
53
|
+
category: "memory",
|
|
54
|
+
action: "read",
|
|
55
|
+
source: "memory",
|
|
56
|
+
sensitivity: "personal",
|
|
57
|
+
purpose: "personal_context"
|
|
58
|
+
},
|
|
59
|
+
user_context_update: {
|
|
60
|
+
category: "memory",
|
|
61
|
+
action: "edit",
|
|
62
|
+
source: "memory",
|
|
63
|
+
sensitivity: "personal",
|
|
64
|
+
purpose: "personal_context"
|
|
65
|
+
},
|
|
66
|
+
web_search: { category: "web", action: "search", source: "internet", sensitivity: "normal" },
|
|
67
|
+
brave_search: { category: "web", action: "search", source: "internet", sensitivity: "normal" },
|
|
68
|
+
image_query: { category: "web", action: "search", source: "internet", sensitivity: "normal" },
|
|
69
|
+
web_fetch: { category: "web", action: "read", source: "internet", sensitivity: "normal" },
|
|
70
|
+
fetch_url: { category: "web", action: "read", source: "internet", sensitivity: "normal" },
|
|
71
|
+
open_url: { category: "navigation", action: "open", source: "internet", sensitivity: "normal" },
|
|
72
|
+
browser_use: { category: "navigation", action: "open", source: "internet", sensitivity: "normal" },
|
|
73
|
+
grep: { category: "code", action: "search", source: "workspace", sensitivity: "normal" },
|
|
74
|
+
find: { category: "code", action: "search", source: "workspace", sensitivity: "normal" },
|
|
75
|
+
glob: { category: "code", action: "search", source: "workspace", sensitivity: "normal" },
|
|
76
|
+
find_files: { category: "code", action: "search", source: "workspace", sensitivity: "normal" },
|
|
77
|
+
session_search: { category: "other", action: "search", source: "runtime", sensitivity: "normal" },
|
|
78
|
+
search: { category: "other", action: "search", source: "unknown", sensitivity: "normal" },
|
|
79
|
+
read_file: { category: "file", action: "read", source: "workspace", sensitivity: "normal" },
|
|
80
|
+
"review.prepare_diff": { category: "file", action: "read", source: "workspace", sensitivity: "normal" },
|
|
81
|
+
list_dir: { category: "file", action: "list", source: "workspace", sensitivity: "normal" },
|
|
82
|
+
ls: { category: "file", action: "list", source: "workspace", sensitivity: "normal" },
|
|
83
|
+
write_file: { category: "file", action: "write", source: "workspace", sensitivity: "normal" },
|
|
84
|
+
apply_patch: { category: "file", action: "edit", source: "workspace", sensitivity: "normal" },
|
|
85
|
+
exec_command: { category: "command", action: "execute", source: "runtime", sensitivity: "normal" },
|
|
86
|
+
run_command: { category: "command", action: "execute", source: "runtime", sensitivity: "normal" },
|
|
87
|
+
update_plan: { category: "planning", action: "plan", source: "runtime", sensitivity: "normal" }
|
|
88
|
+
};
|
|
89
|
+
function toolActivityId(name) {
|
|
90
|
+
const normalized = name.trim().toLowerCase().replace(/-/g, "_");
|
|
91
|
+
const namespaced = normalized.split("__").at(-1) ?? normalized;
|
|
92
|
+
return namespaced.split(".").at(-1) ?? namespaced;
|
|
93
|
+
}
|
|
94
|
+
function resolveToolActivityDefinition(name) {
|
|
95
|
+
const normalized = name.trim().toLowerCase().replace(/-/g, "_");
|
|
96
|
+
return TOOL_ACTIVITY_CATALOG[normalized] ?? TOOL_ACTIVITY_CATALOG[toolActivityId(normalized)] ?? OTHER_ACTIVITY;
|
|
97
|
+
}
|
|
98
|
+
function asRecord(value) {
|
|
99
|
+
if (typeof value === "string") {
|
|
100
|
+
try {
|
|
101
|
+
return asRecord(JSON.parse(value));
|
|
102
|
+
} catch {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
107
|
+
}
|
|
108
|
+
function resultCount(result) {
|
|
109
|
+
const record = asRecord(result);
|
|
110
|
+
const details = asRecord(record?.details);
|
|
111
|
+
const results = details?.results ?? record?.results;
|
|
112
|
+
return Array.isArray(results) ? results.length : void 0;
|
|
113
|
+
}
|
|
114
|
+
function resultHasError(result) {
|
|
115
|
+
const record = asRecord(result);
|
|
116
|
+
const details = asRecord(record?.details);
|
|
117
|
+
return typeof (details?.error ?? record?.error) === "string";
|
|
118
|
+
}
|
|
119
|
+
function resolveToolActivity(name, status, result) {
|
|
120
|
+
const definition = resolveToolActivityDefinition(name);
|
|
121
|
+
const count = resultCount(result);
|
|
122
|
+
const resolvedStatus = status === "completed" && resultHasError(result) ? "failed" : status === "completed" && count === 0 ? "empty" : status;
|
|
123
|
+
return {
|
|
124
|
+
...definition,
|
|
125
|
+
status: resolvedStatus,
|
|
126
|
+
...count === void 0 ? {} : { count }
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
3
130
|
true &&(function polyfill() {
|
|
4
131
|
const relList = document.createElement("link").relList;
|
|
5
132
|
if (relList && relList.supports && relList.supports("modulepreload")) {
|
|
@@ -18041,6 +18168,233 @@ function ComposerPreviewDialog({ preview, onClose }) {
|
|
|
18041
18168
|
] });
|
|
18042
18169
|
}
|
|
18043
18170
|
|
|
18171
|
+
function toolStatusLabel(tool) {
|
|
18172
|
+
if (tool.status === "running") return t("toolRunning");
|
|
18173
|
+
if (tool.status === "error") return t("toolFailed");
|
|
18174
|
+
return t("toolCompleted");
|
|
18175
|
+
}
|
|
18176
|
+
function toolDuration(tool) {
|
|
18177
|
+
if (tool.startedAt === void 0 || tool.completedAt === void 0) return "";
|
|
18178
|
+
const milliseconds = Math.max(0, tool.completedAt - tool.startedAt);
|
|
18179
|
+
return milliseconds < 1e3 ? `${milliseconds} ms` : `${(milliseconds / 1e3).toFixed(1)} s`;
|
|
18180
|
+
}
|
|
18181
|
+
function AssistantActivity({
|
|
18182
|
+
message,
|
|
18183
|
+
detail,
|
|
18184
|
+
streaming
|
|
18185
|
+
}) {
|
|
18186
|
+
const [open, setOpen] = reactExports.useState(streaming && detail === "stream");
|
|
18187
|
+
const blocks = message.blocks.filter((block) => block.type === "tool" || block.type === "thinking" && detail !== "off");
|
|
18188
|
+
if (!blocks.length) return null;
|
|
18189
|
+
const toolCount = blocks.filter((block) => block.type === "tool").length;
|
|
18190
|
+
const running = blocks.some((block) => block.type === "thinking" && block.streaming || block.type === "tool" && block.status === "running");
|
|
18191
|
+
const summary = running ? t("activityRunning") : toolCount > 0 ? t("activitySteps", String(toolCount)) : t("activityThoughts");
|
|
18192
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "assistant-activity", open, onToggle: (event) => setOpen(event.currentTarget.open), children: [
|
|
18193
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("summary", { children: [
|
|
18194
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `activity-status${running ? " running" : ""}` }),
|
|
18195
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: summary })
|
|
18196
|
+
] }),
|
|
18197
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "activity-list", children: blocks.map((block, index) => block.type === "thinking" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "activity-thinking", children: [
|
|
18198
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: block.streaming ? t("thinkingRunning") : t("thinking") }),
|
|
18199
|
+
block.text ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: block.text }) : null
|
|
18200
|
+
] }, `thinking:${index}`) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `activity-tool ${block.status}`, children: [
|
|
18201
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "tool-status-mark" }),
|
|
18202
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "tool-name", children: block.name }),
|
|
18203
|
+
block.activity?.count !== void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: block.activity.count }) : null,
|
|
18204
|
+
toolDuration(block) ? /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: toolDuration(block) }) : null,
|
|
18205
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: toolStatusLabel(block) })
|
|
18206
|
+
] }, block.toolCallId)) })
|
|
18207
|
+
] });
|
|
18208
|
+
}
|
|
18209
|
+
|
|
18210
|
+
function messageText(message) {
|
|
18211
|
+
return message.blocks.filter((block) => block.type === "text").map((block) => block.text).join("");
|
|
18212
|
+
}
|
|
18213
|
+
function hasMessageContent(message) {
|
|
18214
|
+
return message.blocks.some((block) => block.type === "tool" || block.text.trim().length > 0) || Boolean(message.attachments?.length);
|
|
18215
|
+
}
|
|
18216
|
+
function record(value) {
|
|
18217
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
18218
|
+
}
|
|
18219
|
+
function timestamp(value) {
|
|
18220
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
18221
|
+
if (typeof value !== "string") return void 0;
|
|
18222
|
+
const parsed = Date.parse(value);
|
|
18223
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
18224
|
+
}
|
|
18225
|
+
function blockId(value, index) {
|
|
18226
|
+
const id = value.toolCallId ?? value.tool_call_id ?? value.id;
|
|
18227
|
+
return typeof id === "string" && id ? id : `tool:${index}`;
|
|
18228
|
+
}
|
|
18229
|
+
function parseBlocks(value, startedAt) {
|
|
18230
|
+
if (typeof value === "string") return value ? [{ type: "text", text: value }] : [];
|
|
18231
|
+
if (!Array.isArray(value)) return [];
|
|
18232
|
+
return value.flatMap((item, index) => {
|
|
18233
|
+
const block = record(item);
|
|
18234
|
+
if (!block || typeof block.type !== "string") return [];
|
|
18235
|
+
if (block.type === "text" && typeof block.text === "string") {
|
|
18236
|
+
return [{ type: "text", text: block.text }];
|
|
18237
|
+
}
|
|
18238
|
+
if (block.type === "thinking") {
|
|
18239
|
+
const text = typeof block.thinking === "string" ? block.thinking : typeof block.text === "string" ? block.text : "";
|
|
18240
|
+
return [{ type: "thinking", text, streaming: false }];
|
|
18241
|
+
}
|
|
18242
|
+
if (block.type === "tool_use" || block.type === "tool_call" || block.type === "toolCall") {
|
|
18243
|
+
const fn = record(block.function);
|
|
18244
|
+
const name = typeof block.name === "string" ? block.name : typeof fn?.name === "string" ? fn.name : "unknown";
|
|
18245
|
+
const result = block.result;
|
|
18246
|
+
return [{
|
|
18247
|
+
type: "tool",
|
|
18248
|
+
toolCallId: blockId(block, index),
|
|
18249
|
+
name,
|
|
18250
|
+
status: block.isError === true ? "error" : "done",
|
|
18251
|
+
input: block.input ?? block.args ?? block.arguments ?? fn?.arguments,
|
|
18252
|
+
result,
|
|
18253
|
+
details: block.details,
|
|
18254
|
+
activity: resolveToolActivity(name, block.isError === true ? "failed" : "completed", result),
|
|
18255
|
+
startedAt,
|
|
18256
|
+
completedAt: startedAt
|
|
18257
|
+
}];
|
|
18258
|
+
}
|
|
18259
|
+
return [];
|
|
18260
|
+
});
|
|
18261
|
+
}
|
|
18262
|
+
function parseAttachments(value) {
|
|
18263
|
+
if (!Array.isArray(value)) return [];
|
|
18264
|
+
return value.flatMap((item) => {
|
|
18265
|
+
const media = record(item);
|
|
18266
|
+
if (!media) return [];
|
|
18267
|
+
const mimeType = typeof media.mimeType === "string" ? media.mimeType : void 0;
|
|
18268
|
+
const name = typeof media.name === "string" && media.name.trim() ? media.name.trim() : "Attachment";
|
|
18269
|
+
return [{
|
|
18270
|
+
type: media.type === "image" || media.type === "photo" || mimeType?.startsWith("image/") ? "image" : "file",
|
|
18271
|
+
name,
|
|
18272
|
+
...mimeType ? { mimeType } : {},
|
|
18273
|
+
...typeof media.size === "number" && Number.isFinite(media.size) ? { size: media.size } : {}
|
|
18274
|
+
}];
|
|
18275
|
+
});
|
|
18276
|
+
}
|
|
18277
|
+
function parseSourceContexts(value) {
|
|
18278
|
+
const metadata = record(value);
|
|
18279
|
+
if (!Array.isArray(metadata?.sourceContexts)) return void 0;
|
|
18280
|
+
const contexts = metadata.sourceContexts.flatMap((item) => {
|
|
18281
|
+
const source = record(item);
|
|
18282
|
+
if (!source || source.kind !== "note" && source.kind !== "browser_page" || typeof source.title !== "string") return [];
|
|
18283
|
+
return [{
|
|
18284
|
+
kind: source.kind,
|
|
18285
|
+
title: source.title,
|
|
18286
|
+
...typeof source.url === "string" ? { url: source.url } : {},
|
|
18287
|
+
...source.truncated === true ? { truncated: true } : {}
|
|
18288
|
+
}];
|
|
18289
|
+
});
|
|
18290
|
+
return contexts.length ? contexts : void 0;
|
|
18291
|
+
}
|
|
18292
|
+
function appendDeclaredTools(blocks, row, startedAt) {
|
|
18293
|
+
const declarations = [
|
|
18294
|
+
...Array.isArray(row.tool_calls) ? row.tool_calls : [],
|
|
18295
|
+
...Array.isArray(row.toolCalls) ? row.toolCalls : []
|
|
18296
|
+
];
|
|
18297
|
+
for (let index = 0; index < declarations.length; index += 1) {
|
|
18298
|
+
const declaration = record(declarations[index]);
|
|
18299
|
+
if (!declaration) continue;
|
|
18300
|
+
const fn = record(declaration.function);
|
|
18301
|
+
const id = blockId(declaration, index);
|
|
18302
|
+
const name = typeof declaration.name === "string" ? declaration.name : typeof fn?.name === "string" ? fn.name : "unknown";
|
|
18303
|
+
const existing = blocks.find((block) => block.type === "tool" && block.toolCallId === id);
|
|
18304
|
+
const result = declaration.result;
|
|
18305
|
+
const failed = declaration.isError === true;
|
|
18306
|
+
if (existing) {
|
|
18307
|
+
if (result !== void 0) {
|
|
18308
|
+
existing.status = failed ? "error" : "done";
|
|
18309
|
+
existing.result = result;
|
|
18310
|
+
existing.completedAt = startedAt;
|
|
18311
|
+
}
|
|
18312
|
+
existing.details = declaration.details ?? existing.details;
|
|
18313
|
+
continue;
|
|
18314
|
+
}
|
|
18315
|
+
blocks.push({
|
|
18316
|
+
type: "tool",
|
|
18317
|
+
toolCallId: id,
|
|
18318
|
+
name,
|
|
18319
|
+
input: declaration.args ?? declaration.arguments ?? fn?.arguments,
|
|
18320
|
+
status: result === void 0 ? "running" : failed ? "error" : "done",
|
|
18321
|
+
result,
|
|
18322
|
+
details: declaration.details,
|
|
18323
|
+
activity: resolveToolActivity(name, result === void 0 ? "running" : failed ? "failed" : "completed", result),
|
|
18324
|
+
startedAt,
|
|
18325
|
+
...result === void 0 ? {} : { completedAt: startedAt }
|
|
18326
|
+
});
|
|
18327
|
+
}
|
|
18328
|
+
}
|
|
18329
|
+
function mergeAssistantBlocks(target, incoming) {
|
|
18330
|
+
for (const block of incoming) {
|
|
18331
|
+
if (block.type === "tool") {
|
|
18332
|
+
const index = target.findIndex((candidate) => candidate.type === "tool" && candidate.toolCallId === block.toolCallId);
|
|
18333
|
+
if (index >= 0) {
|
|
18334
|
+
target[index] = block;
|
|
18335
|
+
continue;
|
|
18336
|
+
}
|
|
18337
|
+
}
|
|
18338
|
+
const previous = target.at(-1);
|
|
18339
|
+
if (block.type === "thinking" && previous?.type === "thinking" && previous.text === block.text) continue;
|
|
18340
|
+
target.push(block);
|
|
18341
|
+
}
|
|
18342
|
+
}
|
|
18343
|
+
function applyToolResult(messages, row) {
|
|
18344
|
+
const assistant = [...messages].reverse().find((message) => message.role === "assistant");
|
|
18345
|
+
if (!assistant) return;
|
|
18346
|
+
const id = row.toolCallId ?? row.tool_call_id;
|
|
18347
|
+
if (typeof id !== "string") return;
|
|
18348
|
+
const tool = assistant.blocks.find((block) => block.type === "tool" && block.toolCallId === id);
|
|
18349
|
+
if (!tool) return;
|
|
18350
|
+
const result = typeof row.content === "string" ? row.content : Array.isArray(row.content) ? row.content.flatMap((item) => {
|
|
18351
|
+
const block = record(item);
|
|
18352
|
+
return block?.type === "text" && typeof block.text === "string" ? [block.text] : [];
|
|
18353
|
+
}).join("") : "";
|
|
18354
|
+
const failed = row.isError === true;
|
|
18355
|
+
tool.status = failed ? "error" : "done";
|
|
18356
|
+
tool.result = result;
|
|
18357
|
+
tool.details = row.details;
|
|
18358
|
+
tool.completedAt = timestamp(row.timestamp);
|
|
18359
|
+
tool.activity = resolveToolActivity(tool.name, failed ? "failed" : "completed", { result, details: row.details });
|
|
18360
|
+
}
|
|
18361
|
+
function normalizeChatMessages(values) {
|
|
18362
|
+
const messages = [];
|
|
18363
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
18364
|
+
const row = record(values[index]);
|
|
18365
|
+
if (!row) continue;
|
|
18366
|
+
if (row.role === "tool" || row.role === "toolResult") {
|
|
18367
|
+
applyToolResult(messages, row);
|
|
18368
|
+
continue;
|
|
18369
|
+
}
|
|
18370
|
+
if (row.role !== "user" && row.role !== "assistant" && row.role !== "system") continue;
|
|
18371
|
+
const startedAt = timestamp(row.timestamp);
|
|
18372
|
+
const rawBlocks = parseBlocks(row.rawContent, startedAt);
|
|
18373
|
+
const blocks = rawBlocks.length ? rawBlocks : parseBlocks(row.content, startedAt);
|
|
18374
|
+
if (row.role === "assistant") appendDeclaredTools(blocks, row, startedAt);
|
|
18375
|
+
const attachments = [...parseAttachments(row.media), ...parseAttachments(row.attachments)];
|
|
18376
|
+
const sourceContexts = parseSourceContexts(row.metadata);
|
|
18377
|
+
const message = {
|
|
18378
|
+
id: typeof row.id === "string" ? row.id : `${row.role}:${index}`,
|
|
18379
|
+
role: row.role,
|
|
18380
|
+
blocks,
|
|
18381
|
+
...startedAt === void 0 ? {} : { timestamp: startedAt },
|
|
18382
|
+
...attachments.length ? { attachments } : {},
|
|
18383
|
+
...sourceContexts ? { sourceContexts } : {}
|
|
18384
|
+
};
|
|
18385
|
+
if (!hasMessageContent(message)) continue;
|
|
18386
|
+
const previous = messages.at(-1);
|
|
18387
|
+
if (message.role === "assistant" && previous?.role === "assistant") {
|
|
18388
|
+
mergeAssistantBlocks(previous.blocks, message.blocks);
|
|
18389
|
+
previous.timestamp = message.timestamp ?? previous.timestamp;
|
|
18390
|
+
if (message.attachments?.length) previous.attachments = [...previous.attachments ?? [], ...message.attachments];
|
|
18391
|
+
} else {
|
|
18392
|
+
messages.push(message);
|
|
18393
|
+
}
|
|
18394
|
+
}
|
|
18395
|
+
return messages;
|
|
18396
|
+
}
|
|
18397
|
+
|
|
18044
18398
|
const OUTBOX_STORE = "outbox";
|
|
18045
18399
|
function transactionResult(database, mode, createRequest) {
|
|
18046
18400
|
return new Promise((resolve, reject) => {
|
|
@@ -18085,6 +18439,121 @@ async function deleteBrowserOutbox(conversationId) {
|
|
|
18085
18439
|
}
|
|
18086
18440
|
}
|
|
18087
18441
|
|
|
18442
|
+
function appendWithOverlap(base, incoming) {
|
|
18443
|
+
if (!incoming || base.endsWith(incoming)) return base;
|
|
18444
|
+
const max = Math.min(base.length, incoming.length, 512);
|
|
18445
|
+
for (let length = max; length > 0; length -= 1) {
|
|
18446
|
+
if (base.slice(-length) === incoming.slice(0, length)) {
|
|
18447
|
+
return base + incoming.slice(length);
|
|
18448
|
+
}
|
|
18449
|
+
}
|
|
18450
|
+
return base + incoming;
|
|
18451
|
+
}
|
|
18452
|
+
function closeThinking(blocks) {
|
|
18453
|
+
const last = blocks.at(-1);
|
|
18454
|
+
if (last?.type === "thinking") last.streaming = false;
|
|
18455
|
+
}
|
|
18456
|
+
function mergeDetails(previous, next) {
|
|
18457
|
+
if (!next || typeof next !== "object" || Array.isArray(next)) return next;
|
|
18458
|
+
const incoming = next;
|
|
18459
|
+
if (typeof incoming.textDelta !== "string") return next;
|
|
18460
|
+
const current = previous && typeof previous === "object" && !Array.isArray(previous) ? previous : {};
|
|
18461
|
+
return { ...current, text: appendWithOverlap(String(current.text ?? ""), incoming.textDelta) };
|
|
18462
|
+
}
|
|
18463
|
+
function activity(value) {
|
|
18464
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
18465
|
+
return value;
|
|
18466
|
+
}
|
|
18467
|
+
function toolId(payload, fallback) {
|
|
18468
|
+
return typeof payload.toolCallId === "string" && payload.toolCallId ? payload.toolCallId : fallback;
|
|
18469
|
+
}
|
|
18470
|
+
function createStreamingMessage(runId, timestamp = Date.now()) {
|
|
18471
|
+
return { id: `stream:${runId}`, role: "assistant", blocks: [], timestamp };
|
|
18472
|
+
}
|
|
18473
|
+
function reduceRunEvent(current, input) {
|
|
18474
|
+
const message = current ? { ...current, blocks: current.blocks.map((block) => ({ ...block })) } : createStreamingMessage(input.runId, input.timestamp);
|
|
18475
|
+
const { event, payload } = input;
|
|
18476
|
+
if (event === "assistant_delta" && typeof payload.delta === "string" && payload.delta) {
|
|
18477
|
+
closeThinking(message.blocks);
|
|
18478
|
+
const messageId = typeof payload.messageId === "string" ? payload.messageId : void 0;
|
|
18479
|
+
const last = message.blocks.at(-1);
|
|
18480
|
+
if (last?.type === "text" && last.messageId === messageId) {
|
|
18481
|
+
last.text = appendWithOverlap(last.text, payload.delta);
|
|
18482
|
+
} else {
|
|
18483
|
+
message.blocks.push({ type: "text", text: payload.delta, ...messageId ? { messageId } : {} });
|
|
18484
|
+
}
|
|
18485
|
+
} else if (event === "thinking_delta" && typeof payload.delta === "string" && payload.delta) {
|
|
18486
|
+
const last = message.blocks.at(-1);
|
|
18487
|
+
if (last?.type === "thinking" && last.streaming) {
|
|
18488
|
+
last.text = appendWithOverlap(last.text, payload.delta);
|
|
18489
|
+
} else {
|
|
18490
|
+
message.blocks.push({ type: "thinking", text: payload.delta, streaming: true });
|
|
18491
|
+
}
|
|
18492
|
+
} else if (event === "thinking_end" || event === "assistant_message_end") {
|
|
18493
|
+
closeThinking(message.blocks);
|
|
18494
|
+
} else if (event === "tool_start") {
|
|
18495
|
+
closeThinking(message.blocks);
|
|
18496
|
+
const name = typeof payload.toolName === "string" && payload.toolName ? payload.toolName : "unknown";
|
|
18497
|
+
if (name !== "clarify") {
|
|
18498
|
+
const id = toolId(payload, `tool:${message.blocks.length}`);
|
|
18499
|
+
if (!message.blocks.some((block) => block.type === "tool" && block.toolCallId === id)) {
|
|
18500
|
+
message.blocks.push({
|
|
18501
|
+
type: "tool",
|
|
18502
|
+
toolCallId: id,
|
|
18503
|
+
name,
|
|
18504
|
+
status: "running",
|
|
18505
|
+
input: payload.args,
|
|
18506
|
+
activity: activity(payload.activity) ?? resolveToolActivity(name, "running"),
|
|
18507
|
+
startedAt: input.timestamp
|
|
18508
|
+
});
|
|
18509
|
+
}
|
|
18510
|
+
}
|
|
18511
|
+
} else if (event === "tool_update") {
|
|
18512
|
+
const id = toolId(payload, "");
|
|
18513
|
+
const block = [...message.blocks].reverse().find((candidate) => candidate.type === "tool" && (id ? candidate.toolCallId === id : candidate.name === payload.toolName));
|
|
18514
|
+
if (block) {
|
|
18515
|
+
if (payload.details !== void 0) block.details = mergeDetails(block.details, payload.details);
|
|
18516
|
+
if (typeof payload.textDelta === "string" && payload.textDelta) {
|
|
18517
|
+
block.details = mergeDetails(block.details, { textDelta: payload.textDelta });
|
|
18518
|
+
}
|
|
18519
|
+
}
|
|
18520
|
+
} else if (event === "tool_end") {
|
|
18521
|
+
const name = typeof payload.toolName === "string" && payload.toolName ? payload.toolName : "unknown";
|
|
18522
|
+
if (name !== "clarify") {
|
|
18523
|
+
const id = toolId(payload, `tool:${message.blocks.length}`);
|
|
18524
|
+
let block = [...message.blocks].reverse().find((candidate) => candidate.type === "tool" && candidate.toolCallId === id);
|
|
18525
|
+
if (!block) {
|
|
18526
|
+
block = { type: "tool", toolCallId: id, name, status: "running", startedAt: input.timestamp };
|
|
18527
|
+
message.blocks.push(block);
|
|
18528
|
+
}
|
|
18529
|
+
const failed = payload.status === "error" || payload.status === "cancelled";
|
|
18530
|
+
block.status = failed ? "error" : "done";
|
|
18531
|
+
block.result = payload.result;
|
|
18532
|
+
block.activity = activity(payload.activity) ?? resolveToolActivity(name, failed ? "failed" : "completed", payload.result);
|
|
18533
|
+
block.completedAt = input.timestamp;
|
|
18534
|
+
}
|
|
18535
|
+
}
|
|
18536
|
+
return message;
|
|
18537
|
+
}
|
|
18538
|
+
function finalizeStreamingMessage(message, failed = false) {
|
|
18539
|
+
return {
|
|
18540
|
+
...message,
|
|
18541
|
+
blocks: message.blocks.map((block) => {
|
|
18542
|
+
if (block.type === "thinking") {
|
|
18543
|
+
return { ...block, text: block.text.trim(), streaming: false };
|
|
18544
|
+
}
|
|
18545
|
+
if (block.type === "tool" && block.status === "running") {
|
|
18546
|
+
return {
|
|
18547
|
+
...block,
|
|
18548
|
+
status: failed ? "error" : "done",
|
|
18549
|
+
activity: resolveToolActivity(block.name, failed ? "failed" : "completed")
|
|
18550
|
+
};
|
|
18551
|
+
}
|
|
18552
|
+
return { ...block };
|
|
18553
|
+
})
|
|
18554
|
+
};
|
|
18555
|
+
}
|
|
18556
|
+
|
|
18088
18557
|
const CLIENT_ID_KEY = "xopc.browser.client-id";
|
|
18089
18558
|
const ACTIVE_CHAT_KEY = "xopc.browser.active-chat";
|
|
18090
18559
|
const CURSOR_PREFIX = "xopc.browser.cursor.";
|
|
@@ -18120,53 +18589,10 @@ async function json(response) {
|
|
|
18120
18589
|
function isRetryableDeliveryError(cause) {
|
|
18121
18590
|
return !(cause instanceof GatewayRequestError) || cause.status === 408 || cause.status === 429 || cause.status >= 500;
|
|
18122
18591
|
}
|
|
18123
|
-
function
|
|
18124
|
-
|
|
18125
|
-
|
|
18126
|
-
return value
|
|
18127
|
-
if (!block || typeof block !== "object") return [];
|
|
18128
|
-
const row = block;
|
|
18129
|
-
return row.type === "text" && typeof row.text === "string" ? [row.text] : [];
|
|
18130
|
-
}).join("");
|
|
18131
|
-
}
|
|
18132
|
-
function mapMessage(value, index) {
|
|
18133
|
-
if (!value || typeof value !== "object") return void 0;
|
|
18134
|
-
const row = value;
|
|
18135
|
-
if (row.role !== "user" && row.role !== "assistant" && row.role !== "system") return void 0;
|
|
18136
|
-
const text = textContent(row.content);
|
|
18137
|
-
const attachments = Array.isArray(row.media) ? row.media.flatMap((value2) => {
|
|
18138
|
-
if (!value2 || typeof value2 !== "object") return [];
|
|
18139
|
-
const media = value2;
|
|
18140
|
-
const mimeType = typeof media.mimeType === "string" ? media.mimeType : void 0;
|
|
18141
|
-
const name = typeof media.name === "string" && media.name.trim() ? media.name.trim() : t("attachment");
|
|
18142
|
-
return [{
|
|
18143
|
-
type: media.type === "image" || media.type === "photo" || mimeType?.startsWith("image/") ? "image" : "file",
|
|
18144
|
-
name,
|
|
18145
|
-
...mimeType ? { mimeType } : {},
|
|
18146
|
-
...typeof media.size === "number" && Number.isFinite(media.size) ? { size: media.size } : {}
|
|
18147
|
-
}];
|
|
18148
|
-
}) : [];
|
|
18149
|
-
if (!text && !attachments.length) return void 0;
|
|
18150
|
-
return {
|
|
18151
|
-
id: typeof row.id === "string" ? row.id : `${row.role}-${index}`,
|
|
18152
|
-
role: row.role,
|
|
18153
|
-
text,
|
|
18154
|
-
...typeof row.timestamp === "number" ? { timestamp: row.timestamp } : {},
|
|
18155
|
-
...attachments.length ? { attachments } : {},
|
|
18156
|
-
...row.metadata && typeof row.metadata === "object" && Array.isArray(row.metadata.sourceContexts) ? {
|
|
18157
|
-
sourceContexts: row.metadata.sourceContexts.flatMap((value2) => {
|
|
18158
|
-
if (!value2 || typeof value2 !== "object") return [];
|
|
18159
|
-
const source = value2;
|
|
18160
|
-
if (source.kind !== "note" && source.kind !== "browser_page" || typeof source.title !== "string") return [];
|
|
18161
|
-
return [{
|
|
18162
|
-
kind: source.kind,
|
|
18163
|
-
title: source.title,
|
|
18164
|
-
...typeof source.url === "string" ? { url: source.url } : {},
|
|
18165
|
-
...source.truncated === true ? { truncated: true } : {}
|
|
18166
|
-
}];
|
|
18167
|
-
})
|
|
18168
|
-
} : {}
|
|
18169
|
-
};
|
|
18592
|
+
function activityDetail(config, fallback = "on") {
|
|
18593
|
+
const detail = config.activityDetail && typeof config.activityDetail === "object" ? config.activityDetail : void 0;
|
|
18594
|
+
const value = detail?.effective ?? config.reasoningLevel;
|
|
18595
|
+
return value === "off" || value === "on" || value === "stream" ? value : fallback;
|
|
18170
18596
|
}
|
|
18171
18597
|
function mapClarification(value, conversationId) {
|
|
18172
18598
|
if (!value || typeof value !== "object") return void 0;
|
|
@@ -18219,7 +18645,6 @@ class BrowserChatClient {
|
|
|
18219
18645
|
pendingDelivery: false,
|
|
18220
18646
|
sessions: [],
|
|
18221
18647
|
messages: [],
|
|
18222
|
-
streamingText: "",
|
|
18223
18648
|
models: []
|
|
18224
18649
|
};
|
|
18225
18650
|
subscribe(listener) {
|
|
@@ -18396,7 +18821,7 @@ ${endpointId}`;
|
|
|
18396
18821
|
conversationId,
|
|
18397
18822
|
transcriptId: this.snapshot.sessions.find((candidate) => candidate.key === conversationId)?.transcriptId,
|
|
18398
18823
|
messages: [],
|
|
18399
|
-
|
|
18824
|
+
streamingMessage: void 0,
|
|
18400
18825
|
runId: void 0,
|
|
18401
18826
|
stopping: false,
|
|
18402
18827
|
sessionLoading: true,
|
|
@@ -18487,7 +18912,7 @@ ${endpointId}`;
|
|
|
18487
18912
|
messages: this.snapshot.runId ? this.snapshot.messages : [...this.snapshot.messages, {
|
|
18488
18913
|
id: clientMessageId,
|
|
18489
18914
|
role: "user",
|
|
18490
|
-
text,
|
|
18915
|
+
blocks: text ? [{ type: "text", text }] : [],
|
|
18491
18916
|
...attachments.length ? {
|
|
18492
18917
|
attachments: attachments.map((attachment) => ({
|
|
18493
18918
|
type: attachment.type,
|
|
@@ -18497,7 +18922,7 @@ ${endpointId}`;
|
|
|
18497
18922
|
}))
|
|
18498
18923
|
} : {}
|
|
18499
18924
|
}],
|
|
18500
|
-
...this.snapshot.runId ? {} : {
|
|
18925
|
+
...this.snapshot.runId ? {} : { streamingMessage: void 0 },
|
|
18501
18926
|
error: void 0
|
|
18502
18927
|
});
|
|
18503
18928
|
const response = await json(
|
|
@@ -18605,7 +19030,7 @@ ${endpointId}`;
|
|
|
18605
19030
|
else {
|
|
18606
19031
|
if (this.runTopic) this.realtime?.unsubscribe(this.runTopic);
|
|
18607
19032
|
this.runTopic = void 0;
|
|
18608
|
-
this.update({ runId: void 0,
|
|
19033
|
+
this.update({ runId: void 0, streamingMessage: void 0, stopping: false });
|
|
18609
19034
|
}
|
|
18610
19035
|
}
|
|
18611
19036
|
}
|
|
@@ -18739,7 +19164,7 @@ ${endpointId}`;
|
|
|
18739
19164
|
const stored = await chrome.storage.session.get(`${CURSOR_PREFIX}${runId}`);
|
|
18740
19165
|
if (this.snapshot.conversationId !== conversationId || this.runTopic !== topic) return;
|
|
18741
19166
|
const cursor = typeof stored[`${CURSOR_PREFIX}${runId}`] === "number" ? stored[`${CURSOR_PREFIX}${runId}`] : void 0;
|
|
18742
|
-
this.update({ runId,
|
|
19167
|
+
this.update({ runId, streamingMessage: createStreamingMessage(runId) });
|
|
18743
19168
|
this.realtime?.subscribe(topic, cursor);
|
|
18744
19169
|
}
|
|
18745
19170
|
async onRealtimeEvent(topic, seq, event, data) {
|
|
@@ -18759,12 +19184,23 @@ ${endpointId}`;
|
|
|
18759
19184
|
}
|
|
18760
19185
|
if (topic !== this.runTopic) return;
|
|
18761
19186
|
const runId = topic.slice("run:".length);
|
|
18762
|
-
|
|
18763
|
-
const payload =
|
|
18764
|
-
if (event
|
|
18765
|
-
this.update({
|
|
19187
|
+
const envelope = data && typeof data === "object" ? data : {};
|
|
19188
|
+
const payload = envelope.payload && typeof envelope.payload === "object" ? envelope.payload : {};
|
|
19189
|
+
if (event !== "run_end" && event !== "error") {
|
|
19190
|
+
this.update({ streamingMessage: reduceRunEvent(this.snapshot.streamingMessage, {
|
|
19191
|
+
event,
|
|
19192
|
+
payload,
|
|
19193
|
+
runId,
|
|
19194
|
+
timestamp: typeof envelope.timestamp === "number" ? envelope.timestamp : Date.now()
|
|
19195
|
+
}) });
|
|
18766
19196
|
}
|
|
19197
|
+
await chrome.storage.session.set({ [`${CURSOR_PREFIX}${runId}`]: seq });
|
|
18767
19198
|
if (event === "run_end" || event === "error") {
|
|
19199
|
+
if (this.snapshot.streamingMessage) {
|
|
19200
|
+
this.update({
|
|
19201
|
+
streamingMessage: finalizeStreamingMessage(this.snapshot.streamingMessage, event === "error")
|
|
19202
|
+
});
|
|
19203
|
+
}
|
|
18768
19204
|
this.realtime?.unsubscribe(topic);
|
|
18769
19205
|
this.runTopic = void 0;
|
|
18770
19206
|
await chrome.storage.session.remove(`${CURSOR_PREFIX}${runId}`);
|
|
@@ -18772,7 +19208,7 @@ ${endpointId}`;
|
|
|
18772
19208
|
await this.reloadMessages();
|
|
18773
19209
|
} finally {
|
|
18774
19210
|
if (topic === this.runTopic || this.snapshot.runId === runId) {
|
|
18775
|
-
this.update({ runId: void 0,
|
|
19211
|
+
this.update({ runId: void 0, streamingMessage: void 0, stopping: false });
|
|
18776
19212
|
}
|
|
18777
19213
|
}
|
|
18778
19214
|
}
|
|
@@ -18781,10 +19217,7 @@ ${endpointId}`;
|
|
|
18781
19217
|
const conversationId = this.snapshot.conversationId;
|
|
18782
19218
|
if (!conversationId) return;
|
|
18783
19219
|
const result = await json(await gatewayFetch(`/api/sessions/${encodeURIComponent(conversationId)}/messages?limit=200`));
|
|
18784
|
-
const messages = (result.payload.messages ?? [])
|
|
18785
|
-
const message = mapMessage(value, index);
|
|
18786
|
-
return message ? [message] : [];
|
|
18787
|
-
});
|
|
19220
|
+
const messages = normalizeChatMessages(result.payload.messages ?? []);
|
|
18788
19221
|
if (this.snapshot.conversationId !== conversationId) return;
|
|
18789
19222
|
const session = this.snapshot.sessions.find((candidate) => candidate.key === conversationId);
|
|
18790
19223
|
this.update({ messages, transcriptId: session?.transcriptId });
|
|
@@ -18824,6 +19257,7 @@ ${endpointId}`;
|
|
|
18824
19257
|
this.update({ modelConfig: {
|
|
18825
19258
|
model: config.model,
|
|
18826
19259
|
thinkingLevel: config.thinkingLevel,
|
|
19260
|
+
activityDetail: activityDetail(config),
|
|
18827
19261
|
...typeof config.configVersion === "number" ? { configVersion: config.configVersion } : {},
|
|
18828
19262
|
fixedModel: config.fixedModel === true
|
|
18829
19263
|
} });
|
|
@@ -18848,6 +19282,7 @@ ${endpointId}`;
|
|
|
18848
19282
|
this.update({ modelConfig: {
|
|
18849
19283
|
model: config.model,
|
|
18850
19284
|
thinkingLevel: config.thinkingLevel,
|
|
19285
|
+
activityDetail: activityDetail(config, current.activityDetail),
|
|
18851
19286
|
...typeof config.configVersion === "number" ? { configVersion: config.configVersion } : {},
|
|
18852
19287
|
fixedModel: config.fixedModel === true
|
|
18853
19288
|
} });
|
|
@@ -18905,7 +19340,7 @@ ${endpointId}`;
|
|
|
18905
19340
|
await this.reloadMessages();
|
|
18906
19341
|
} finally {
|
|
18907
19342
|
if (this.snapshot.conversationId === conversationId) {
|
|
18908
|
-
this.update({ runId: void 0,
|
|
19343
|
+
this.update({ runId: void 0, streamingMessage: void 0, stopping: false });
|
|
18909
19344
|
}
|
|
18910
19345
|
}
|
|
18911
19346
|
return;
|
|
@@ -27658,7 +28093,6 @@ const EMPTY = {
|
|
|
27658
28093
|
pendingDelivery: false,
|
|
27659
28094
|
sessions: [],
|
|
27660
28095
|
messages: [],
|
|
27661
|
-
streamingText: "",
|
|
27662
28096
|
models: []
|
|
27663
28097
|
};
|
|
27664
28098
|
function formatMessageTime(timestamp) {
|
|
@@ -27816,7 +28250,7 @@ function ChatPanel({ gatewayId }) {
|
|
|
27816
28250
|
}, [client]);
|
|
27817
28251
|
reactExports.useEffect(() => {
|
|
27818
28252
|
if (followingTail.current) scrollToBottom();
|
|
27819
|
-
}, [scrollToBottom, snapshot.messages, snapshot.
|
|
28253
|
+
}, [scrollToBottom, snapshot.messages, snapshot.streamingMessage]);
|
|
27820
28254
|
reactExports.useEffect(() => {
|
|
27821
28255
|
followingTail.current = true;
|
|
27822
28256
|
setAtBottom(true);
|
|
@@ -28172,7 +28606,7 @@ function ChatPanel({ gatewayId }) {
|
|
|
28172
28606
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {}),
|
|
28173
28607
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {})
|
|
28174
28608
|
] }) : null,
|
|
28175
|
-
!snapshot.sessionLoading && !snapshot.messages.length && !snapshot.
|
|
28609
|
+
!snapshot.sessionLoading && !snapshot.messages.length && !snapshot.streamingMessage ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "empty-chat", children: [
|
|
28176
28610
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "empty-mark", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SparkleIcon, {}) }),
|
|
28177
28611
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: t("emptyChatTitle") }),
|
|
28178
28612
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: t("emptyChatDescription") }),
|
|
@@ -28191,39 +28625,46 @@ function ChatPanel({ gatewayId }) {
|
|
|
28191
28625
|
] })
|
|
28192
28626
|
] })
|
|
28193
28627
|
] }) : null,
|
|
28194
|
-
snapshot.messages.map((message) =>
|
|
28195
|
-
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
28203
|
-
source.
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
28210
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28214
|
-
|
|
28215
|
-
|
|
28216
|
-
|
|
28217
|
-
|
|
28218
|
-
|
|
28219
|
-
|
|
28220
|
-
|
|
28221
|
-
|
|
28628
|
+
snapshot.messages.map((message) => {
|
|
28629
|
+
const text = messageText(message);
|
|
28630
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: `message ${message.role}`, children: [
|
|
28631
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "message-heading", children: [
|
|
28632
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "message-author", children: message.role === "user" ? t("you") : message.role === "assistant" ? "xopc" : t("system") }),
|
|
28633
|
+
formatMessageTime(message.timestamp) ? /* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: formatMessageTime(message.timestamp) }) : null
|
|
28634
|
+
] }),
|
|
28635
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "message-body", children: [
|
|
28636
|
+
message.sourceContexts?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "message-sources", children: message.sourceContexts.map((source, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "source-badge", title: source.url, children: [
|
|
28637
|
+
source.kind === "browser_page" ? /* @__PURE__ */ jsxRuntimeExports.jsx(PageIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(FileIcon, {}),
|
|
28638
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
28639
|
+
source.title,
|
|
28640
|
+
source.truncated ? ` · ${t("truncated")}` : ""
|
|
28641
|
+
] })
|
|
28642
|
+
] }, `${source.title}-${index}`)) }) : null,
|
|
28643
|
+
message.attachments?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "message-attachments", children: message.attachments.map((attachment, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "message-attachment", title: attachment.mimeType, children: [
|
|
28644
|
+
attachment.type === "image" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CameraIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(FileIcon, {}),
|
|
28645
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
28646
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: attachment.name }),
|
|
28647
|
+
formatFileSize(attachment.size) ? /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: formatFileSize(attachment.size) }) : null
|
|
28648
|
+
] })
|
|
28649
|
+
] }, `${attachment.name}-${index}`)) }) : null,
|
|
28650
|
+
message.role === "assistant" ? /* @__PURE__ */ jsxRuntimeExports.jsx(AssistantActivity, { message, detail: snapshot.modelConfig?.activityDetail ?? "on", streaming: false }) : null,
|
|
28651
|
+
text ? message.role === "assistant" ? /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownContent, { children: text }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "plain-message-content", children: text }) : null
|
|
28652
|
+
] }),
|
|
28653
|
+
message.role === "assistant" && text ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "message-actions", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", "aria-label": t("copyResponse"), title: t("copyResponse"), onClick: () => void copyMessage(message.id, text), children: [
|
|
28654
|
+
copiedMessageId === message.id ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, {}),
|
|
28655
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: copiedMessageId === message.id ? t("copied") : t("copy") })
|
|
28656
|
+
] }) }) : null
|
|
28657
|
+
] }, message.id);
|
|
28658
|
+
}),
|
|
28659
|
+
snapshot.streamingMessage ? /* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: "message assistant streaming", children: [
|
|
28222
28660
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "message-heading", children: [
|
|
28223
28661
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "message-author", children: "xopc" }),
|
|
28224
28662
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "responding-label", children: t("responding") })
|
|
28225
28663
|
] }),
|
|
28226
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
28664
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "message-body", children: [
|
|
28665
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AssistantActivity, { message: snapshot.streamingMessage, detail: snapshot.modelConfig?.activityDetail ?? "on", streaming: true }),
|
|
28666
|
+
messageText(snapshot.streamingMessage) ? /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownContent, { streaming: true, children: messageText(snapshot.streamingMessage) }) : null
|
|
28667
|
+
] })
|
|
28227
28668
|
] }) : null
|
|
28228
28669
|
] }),
|
|
28229
28670
|
!atBottom ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "scroll-bottom-button", type: "button", "aria-label": t("scrollLatest"), title: t("scrollLatest"), onClick: () => scrollToBottom(true), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowDownIcon, {}) }) : null
|
|
@@ -28468,7 +28909,7 @@ ${pageContext.context.selection ?? pageContext.context.text ?? ""}` }), children
|
|
|
28468
28909
|
const input = event.currentTarget;
|
|
28469
28910
|
const walk = historyWalk.current;
|
|
28470
28911
|
if (walk || event.key === "ArrowUp" && input.selectionStart === 0 && input.selectionEnd === 0) {
|
|
28471
|
-
const history = walk ?? { items: snapshot.messages.filter((message) => message.role === "user" && message.
|
|
28912
|
+
const history = walk ?? { items: snapshot.messages.filter((message) => message.role === "user" && messageText(message).trim()).map(messageText).reverse(), index: -1, draft };
|
|
28472
28913
|
const index = event.key === "ArrowUp" ? Math.min(history.index + 1, history.items.length - 1) : history.index - 1;
|
|
28473
28914
|
if (index >= 0 || walk) {
|
|
28474
28915
|
event.preventDefault();
|