@xopcai/xopc 0.0.369 → 0.0.370
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 +59 -174
- package/README.zh-CN.md +59 -174
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js +131 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js +30 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js +252 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js +16 -0
- package/dist/.pnpm/@noble_hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js +66 -0
- package/dist/browser-ext/dist/sidepanel.js +21 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Stj17S9u.js → agent-avatar-dicebear-C61i1QbX.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-0fCR1DHx.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-Di99mUTT.js +1 -0
- package/dist/gateway/static/root/assets/agents-BRZZmYH_.js +66 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-pJFe6M6c.js → app-management-settings-panel-noqqxkds.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BrxSpBWa.js → appearance-settings-DG8QN0gR.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DegSl5Lh.js → apps-page-CgiyzFYo.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BZQ_VHjp.js → automations-page-CgAcRFDS.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BIkxIpab.js +6 -0
- package/dist/gateway/static/root/assets/{block-editor-3XjFv3kK.js → block-editor-B1VE-jAe.js} +3 -3
- package/dist/gateway/static/root/assets/browser-automations-page-CIjyMS6f.js +3 -0
- package/dist/gateway/static/root/assets/{browser-settings-page-ch2_bQF0.js → browser-settings-page-BMAivBfp.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-DO-vfNKI.js → capabilities-CY4SiHcP.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-B48r0DDa.js → capabilities-gjQtMhKu.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-DRdcfo68.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-NckMsJ5N.js → capabilities-settings-panel-ZuL6pWjM.js} +4 -4
- package/dist/gateway/static/root/assets/{capability-header-actions-CY8KCO9j.js → capability-header-actions-D0GC1FEv.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CHOS2CGa.js → channels-CgE22Pzd.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Bwknnb4c.js → chat-terminal-dock-CEjh1utz.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-B2xeFCSt.js → computer-settings-page-vFHJAmQr.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-C83DnAqK.js → connector-service-page-DTrwZ4kV.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DRcMiTWu.js +1 -0
- package/dist/gateway/static/root/assets/copy-text-row-C1gaJwlZ.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-Bq9GR-DU.js → date-picker-NfGIPSYY.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-CqguveUi.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BwsbQw8V.js → desktop-pet-CTx1zkJm.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-sL9i44pP.js → desktop-pet-settings-BRDS3EGc.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-Du4Ciuyw.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BFlDmsS5.js → directory-picker-path-field-CjstlxFl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-7Z1Tp7-w.js → extension-debug-page-BfAtjhoK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-uGqvb8QX.js → extension-page-BJmudejr.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-xlSyz4Z6.js → extension-provider-Br6LXyIj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CKHgrjOs.js → extension-settings-page-UvmHniyz.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-BwQg0G1D.js → fallback-models-euw9MGdt.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-F6D4A7N5.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-BAQnSEMJ.js → gateway-settings-C7roPHh1.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BGNCTtM3.js +2 -0
- package/dist/gateway/static/root/assets/{imports-page-re1_Nh64.js → imports-page-DxCoT0VV.js} +1 -1
- package/dist/gateway/static/root/assets/index-BGBkIIzM.css +1 -0
- package/dist/gateway/static/root/assets/index-FCEE325-.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B_xja9LN.js → keyboard-shortcuts-settings-CnLln9Ds.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CErdCrPX.js → local-app-workbench-page-yXRkSrEj.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BPL2RXdK.js → local-apps-page-D46buzTk.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-pox8evDV.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-DmcCHnH0.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-khN1ThNL.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C_t58yha.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BJ0QS6xx.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-tf77xIz3.js → page-context-capture-button-DfRODHv1.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CiiXwwQE.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Dc3Y-Y7J.js → product-open-page-_Bp6HRmm.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-MG_hmVA3.js → product-preview-content-BUdiO0Ct.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Clb-fXYk.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-MllfNLGA.js → projects-page-D9JEEqhh.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Bs-C70el.js → remote-access-hub-CmyTq3_l.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DpJ5jNzR.js → runtime-tools-settings-panel-B1_inj8L.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-Dpxamkw6.js → scenes-page-CUNAZN2_.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DUeyQ1zh.js → schema-form-CfT-9UVw.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-Dgn4BRk_.js → send-session-input-BW40VHiL.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BqlvrjPE.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-CXZKScvu.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B2vKXmzg.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DouHuBXt.js → settings-page-1h3vyueg.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Cqc7UlZy.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-DJTabLAM.js → share-link-dialog-HCHM8qnf.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-jw7h4t_B.js → share-preview-page-Ce6FNWt1.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Dh5jisCK.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CfyX_0zN.js → skill-api-deDZeQS8.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DZozl9U_.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DWf256TE.js → system-settings-panel-CtzyMxqq.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DE6N1ZQe.js → task-detail-page-5f_V0h-p.js} +2 -2
- package/dist/gateway/static/root/assets/{tunnel-api-BBm9esrY.js → tunnel-api-vMtlbJ-m.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-C93x89uW.js → usage-page-B1-BCW8U.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-C7Gaaai1.js → use-composer-attachments-DJya1hIL.js} +1 -1
- package/dist/gateway/static/root/assets/use-file-preview-expanded-C5ONO7sF.js +2 -0
- package/dist/gateway/static/root/assets/user-model-page-D4BSq9HJ.js +2 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Bs2MKiTv.js → work-discovery-overlay-CjiNYJV5.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BR_U_snV.js → workflow-run-setup-panel-DJOetXvm.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CcAPFh2R.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-Si2o3inw.js → workspace-api-WhbMvdBE.js} +2 -2
- package/dist/gateway/static/root/index.html +18 -20
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-client/src/index.js +189 -0
- package/dist/packages/endpoint-tools-protocol/src/bridge.js +105 -0
- package/dist/packages/endpoint-tools-protocol/src/index.js +93 -2
- package/dist/packages/endpoint-tools-protocol/src/location.js +109 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +30 -5
- package/dist/src/agent/agent-manager.js +22 -26
- package/dist/src/agent/embedded/codemode-extension.d.ts +7 -0
- package/dist/src/agent/embedded/codemode-extension.js +232 -0
- package/dist/src/agent/embedded/codemode-output.d.ts +2 -0
- package/dist/src/agent/embedded/codemode-output.js +34 -0
- package/dist/src/agent/embedded/external-tool-discovery.d.ts +6 -0
- package/dist/src/agent/embedded/external-tool-discovery.js +60 -0
- package/dist/src/agent/embedded/model-runtime.js +5 -2
- package/dist/src/agent/embedded/run-for-session.js +10 -1
- package/dist/src/agent/embedded/run-turn.js +10 -3
- package/dist/src/agent/embedded/session-runner.d.ts +9 -1
- package/dist/src/agent/embedded/session-runner.js +111 -23
- package/dist/src/agent/embedded/session-tool-result-guard.d.ts +2 -0
- package/dist/src/agent/embedded/session-tool-result-guard.js +17 -0
- package/dist/src/agent/embedded/subscribe-session.js +14 -4
- package/dist/src/agent/embedded/tool-metadata.d.ts +15 -0
- package/dist/src/agent/embedded/tool-metadata.js +38 -0
- package/dist/src/agent/embedded/tool-search-extension.d.ts +5 -0
- package/dist/src/agent/embedded/tool-search-extension.js +31 -0
- package/dist/src/agent/embedded/types.d.ts +7 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +6 -0
- package/dist/src/agent/external-tools/endpoint-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +148 -56
- package/dist/src/agent/external-tools/extension-provider.js +8 -1
- package/dist/src/agent/external-tools/gateway-tools.d.ts +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +45 -22
- package/dist/src/agent/external-tools/index.js +46 -14
- package/dist/src/agent/external-tools/memory-provider.js +8 -1
- package/dist/src/agent/external-tools/read-policy.js +2 -1
- package/dist/src/agent/external-tools/service.d.ts +2 -0
- package/dist/src/agent/external-tools/service.js +25 -3
- package/dist/src/agent/external-tools/tool-registry.d.ts +14 -0
- package/dist/src/agent/external-tools/tool-registry.js +14 -0
- package/dist/src/agent/external-tools/types.d.ts +8 -1
- package/dist/src/agent/external-tools/types.js +0 -1
- package/dist/src/agent/mcp/config.d.ts +18 -0
- package/dist/src/agent/mcp/{bundle-mcp-config.js → config.js} +8 -25
- package/dist/src/agent/mcp/native-mcp.d.ts +6 -0
- package/dist/src/agent/mcp/native-mcp.js +73 -0
- package/dist/src/agent/service.js +2 -5
- package/dist/src/agent/skills/installer.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +1 -1
- package/dist/src/agent/source-context/index.d.ts +0 -1
- package/dist/src/agent/source-context/index.js +1 -2
- package/dist/src/agent/source-context/injector.js +1 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tools/cli-clarify.js +1 -1
- package/dist/src/agent/tools/codemode-permissions.d.ts +4 -0
- package/dist/src/agent/tools/codemode-permissions.js +23 -0
- package/dist/src/agent/tools/dataBatch.js +3 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +1 -4
- package/dist/src/agent/tools/factory.js +4 -3
- package/dist/src/agent/transcript/provider-capabilities.js +0 -1
- package/dist/src/agent/transcript/transcript-policy.js +1 -2
- package/dist/src/agent-config/schema.d.ts +28 -0
- package/dist/src/agent-config/schema.js +7 -0
- package/dist/src/auth/credentials.js +7 -20
- package/dist/src/auth/model-credential-store.js +11 -4
- package/dist/src/auth/oauth/index.d.ts +1 -1
- package/dist/src/auth/oauth/index.js +3 -3
- package/dist/src/auth/oauth/openai.d.ts +2 -0
- package/dist/src/auth/oauth/openai.js +90 -0
- package/dist/src/auth/oauth/registry.js +3 -3
- package/dist/src/auth/oauth/types.d.ts +1 -0
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +5 -0
- package/dist/src/chat-commands/builtins/model.js +2 -2
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +0 -19
- package/dist/src/cli/commands/mcp.js +36 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/utils/oauth-login.js +2 -2
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/mcp-config-normalize.d.ts +0 -3
- package/dist/src/config/mcp-config-normalize.js +2 -22
- package/dist/src/config/models-json.d.ts +0 -5
- package/dist/src/config/models-json.js +13 -4
- package/dist/src/config/paths.d.ts +0 -1
- package/dist/src/config/paths.js +1 -4
- package/dist/src/config/schema.d.ts +130 -36
- package/dist/src/config/schema.js +52 -35
- package/dist/src/connectors/auth-provider-registry.d.ts +1 -1
- package/dist/src/connectors/auth-provider-registry.js +1 -21
- package/dist/src/connectors/china-catalog.js +5 -5
- package/dist/src/connectors/connection-recovery-service.d.ts +1 -6
- package/dist/src/connectors/connection-recovery-service.js +3 -105
- package/dist/src/connectors/health.d.ts +1 -2
- package/dist/src/connectors/health.js +2 -101
- package/dist/src/connectors/types.d.ts +1 -1
- package/dist/src/endpoint-tools/binding-service.d.ts +2 -0
- package/dist/src/endpoint-tools/binding-service.js +14 -2
- package/dist/src/endpoint-tools/bridge-host.d.ts +15 -0
- package/dist/src/endpoint-tools/bridge-host.js +166 -0
- package/dist/src/endpoint-tools/bridge.d.ts +27 -0
- package/dist/src/endpoint-tools/bridge.js +88 -0
- package/dist/src/endpoint-tools/capability-catalog.d.ts +2 -0
- package/dist/src/endpoint-tools/capability-catalog.js +8 -0
- package/dist/src/endpoint-tools/grant-service.d.ts +69 -0
- package/dist/src/endpoint-tools/grant-service.js +113 -0
- package/dist/src/endpoint-tools/index.js +1 -1
- package/dist/src/endpoint-tools/invocation-service.js +6 -2
- package/dist/src/endpoint-tools/location-task.d.ts +22 -0
- package/dist/src/endpoint-tools/location-task.js +114 -0
- package/dist/src/endpoint-tools/policy.js +16 -1
- package/dist/src/endpoint-tools/registry.d.ts +2 -0
- package/dist/src/endpoint-tools/registry.js +9 -0
- package/dist/src/endpoint-tools/result-projector.d.ts +15 -0
- package/dist/src/endpoint-tools/result-projector.js +31 -0
- package/dist/src/endpoint-tools/runtime.d.ts +2 -0
- package/dist/src/endpoint-tools/runtime.js +15 -2
- package/dist/src/endpoint-tools/target-resolver.d.ts +12 -0
- package/dist/src/endpoint-tools/target-resolver.js +27 -0
- package/dist/src/endpoint-tools/turn-context.d.ts +6 -0
- package/dist/src/endpoint-tools/turn-context.js +29 -0
- package/dist/src/extensions/agent-plugins/auth.d.ts +0 -2
- package/dist/src/extensions/agent-plugins/auth.js +2 -19
- package/dist/src/extensions/agent-plugins/credentials.js +3 -19
- package/dist/src/extensions/agent-plugins/inventory.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +1 -5
- package/dist/src/extensions/agent-plugins/source-http-fetch.d.ts +2 -0
- package/dist/src/{agent/mcp/plugin-http-fetch.js → extensions/agent-plugins/source-http-fetch.js} +7 -7
- package/dist/src/extensions/agent-plugins/sources.js +2 -2
- package/dist/src/extensions/agent-plugins/store.js +1 -3
- package/dist/src/extensions/agent-plugins/validation.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/validation.js +13 -20
- package/dist/src/gateway/agents-admin.d.ts +5 -0
- package/dist/src/gateway/agents-admin.js +56 -1
- package/dist/src/gateway/chat-stream/mapper.js +9 -0
- package/dist/src/gateway/chat-stream/protocol.d.ts +4 -4
- package/dist/src/gateway/hono/lib/config-payload.d.ts +9 -4
- package/dist/src/gateway/hono/lib/config-payload.js +2 -5
- package/dist/src/gateway/hono/oauth-async.js +9 -2
- package/dist/src/gateway/hono/routes/agent-plugins.js +4 -9
- package/dist/src/gateway/hono/routes/agents.js +4 -3
- package/dist/src/gateway/hono/routes/connection-waits.js +2 -5
- package/dist/src/gateway/hono/routes/connectors.js +5 -60
- package/dist/src/gateway/hono/routes/device-authorizations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-authorizations.js +74 -0
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +7 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.d.ts +1 -0
- package/dist/src/gateway/hono/routes/endpoint-tools.js +53 -3
- package/dist/src/gateway/hono/routes/lazy-bundles.js +17 -1
- package/dist/src/gateway/hono/routes/mcp.d.ts +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +11 -237
- package/dist/src/gateway/hono/routes/session-command-handler.js +11 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +8 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +25 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -5
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +13 -5
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/session-input-coordinator.js +29 -9
- package/dist/src/gateway/service/sessions-api.js +0 -6
- package/dist/src/gateway/service.js +3 -12
- package/dist/src/gateway/session-reset-service.js +0 -6
- package/dist/src/imports/compatibility.js +12 -10
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/providers/env-keys.js +1 -1
- package/dist/src/providers/index.js +26 -24
- package/dist/src/providers/model-call.d.ts +0 -2
- package/dist/src/providers/model-call.js +2 -6
- package/dist/src/providers/model-registry.js +4 -2
- package/dist/src/providers/model-supplements.d.ts +3 -3
- package/dist/src/providers/model-supplements.js +6 -27
- package/dist/src/providers/presentation.js +3 -8
- package/dist/src/providers/prompt-cache-plan.js +1 -1
- package/dist/src/providers/provider-auth-service.d.ts +1 -1
- package/dist/src/providers/provider-auth-service.js +7 -2
- package/dist/src/providers/provider-policy.d.ts +3 -0
- package/dist/src/providers/provider-policy.js +14 -0
- package/dist/src/providers/register-runtime-providers.js +6 -1
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/session/store.js +7 -1
- package/dist/src/session/transcript-events.d.ts +5 -0
- package/dist/src/session/transcript-events.js +1 -0
- package/dist/src/session/types.d.ts +2 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.d.ts +11 -0
- package/dist/src/storage/sqlite/device-grant-audit-repository.js +10 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.d.ts +7 -0
- package/dist/src/storage/sqlite/endpoint-device-settings-repository.js +17 -0
- package/dist/src/storage/sqlite/migrations/240_device_settings.sql +5 -0
- package/dist/src/storage/sqlite/migrations/241_device_grant_audit.sql +13 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/session-input-repository.js +5 -1
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/xopc-tui-keybindings.d.ts +4 -4
- package/package.json +19 -8
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CCRfvuov.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CRlzd8El.js +0 -1
- package/dist/gateway/static/root/assets/agents-_ug2LCQb.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BQywN6nG.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-yiEuG1v7.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-BEnFt_dj.js +0 -2
- package/dist/gateway/static/root/assets/connectors-page-D6wTmWA6.js +0 -2
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BTERkA9X.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DI2bqaKO.js +0 -1
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DDWymi-o.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BZDjvwet.js +0 -2
- package/dist/gateway/static/root/assets/index-BB1z8QxA.js +0 -106
- package/dist/gateway/static/root/assets/index-D9R6tU7r.css +0 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-DRPsDCj1.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-DL-BM0xq.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BOVRHhXk.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DJJK2yL4.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-oCxO7ZTv.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-DOk9gUK5.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-3uAzbW4T.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-LInoZ_Yi.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-BCVlNHtq.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Bz-ue9fZ.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-B5BoZ-1y.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BlnlzGjH.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-DjdTeYzm.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-Db2VYg1b.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-B74LkVbp.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-Crk4SxtC.js +0 -6
- package/dist/src/agent/embedded/system-prompt-override.d.ts +0 -2
- package/dist/src/agent/embedded/system-prompt-override.js +0 -21
- package/dist/src/agent/external-tools/mcp-provider.d.ts +0 -32
- package/dist/src/agent/external-tools/mcp-provider.js +0 -208
- package/dist/src/agent/mcp/bundle-mcp-config.d.ts +0 -20
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +0 -79
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +0 -93
- package/dist/src/agent/mcp/bundle-mcp-names.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-names.js +0 -25
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +0 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.js +0 -6
- package/dist/src/agent/mcp/bundle-mcp-runtime.d.ts +0 -46
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +0 -571
- package/dist/src/agent/mcp/bundle-mcp-tools.d.ts +0 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.js +0 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +0 -76
- package/dist/src/agent/mcp/bundle-mcp-types.js +0 -1
- package/dist/src/agent/mcp/embedded-mcp.d.ts +0 -10
- package/dist/src/agent/mcp/embedded-mcp.js +0 -14
- package/dist/src/agent/mcp/index.d.ts +0 -5
- package/dist/src/agent/mcp/index.js +0 -12
- package/dist/src/agent/mcp/mcp-config-shared.d.ts +0 -8
- package/dist/src/agent/mcp/mcp-config-shared.js +0 -39
- package/dist/src/agent/mcp/mcp-http.d.ts +0 -23
- package/dist/src/agent/mcp/mcp-http.js +0 -67
- package/dist/src/agent/mcp/mcp-resource-id.d.ts +0 -6
- package/dist/src/agent/mcp/mcp-resource-id.js +0 -19
- package/dist/src/agent/mcp/mcp-stdio-transport.d.ts +0 -26
- package/dist/src/agent/mcp/mcp-stdio-transport.js +0 -120
- package/dist/src/agent/mcp/mcp-stdio.d.ts +0 -18
- package/dist/src/agent/mcp/mcp-stdio.js +0 -35
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +0 -28
- package/dist/src/agent/mcp/mcp-transport-config.js +0 -91
- package/dist/src/agent/mcp/mcp-transport.d.ts +0 -17
- package/dist/src/agent/mcp/mcp-transport.js +0 -141
- package/dist/src/agent/mcp/oauth/index.d.ts +0 -6
- package/dist/src/agent/mcp/oauth/index.js +0 -6
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.d.ts +0 -5
- package/dist/src/agent/mcp/oauth/mcp-oauth-errors.js +0 -14
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.d.ts +0 -30
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +0 -276
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.d.ts +0 -33
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +0 -103
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.d.ts +0 -31
- package/dist/src/agent/mcp/oauth/mcp-oauth-session.js +0 -181
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.d.ts +0 -12
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +0 -91
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.d.ts +0 -22
- package/dist/src/agent/mcp/oauth/mcp-oauth-types.js +0 -1
- package/dist/src/agent/mcp/plugin-http-fetch.d.ts +0 -2
- package/dist/src/agent/source-context/mcp-resource-context.d.ts +0 -8
- package/dist/src/agent/source-context/mcp-resource-context.js +0 -30
- package/dist/src/auth/oauth/openai-codex.d.ts +0 -9
- package/dist/src/auth/oauth/openai-codex.js +0 -414
- package/dist/src/connectors/plugin-mcp-recovery.d.ts +0 -28
- package/dist/src/connectors/plugin-mcp-recovery.js +0 -90
- package/dist/src/extensions/agent-plugins/connection.d.ts +0 -8
- package/dist/src/extensions/agent-plugins/connection.js +0 -41
- package/dist/src/extensions/agent-plugins/health.d.ts +0 -4
- package/dist/src/extensions/agent-plugins/health.js +0 -48
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.d.ts +0 -1
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.js +0 -8
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Hash, abytes, aexists, aoutput, clean, createView, toBytes } from "./utils.js";
|
|
2
|
+
//#region .pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
|
|
3
|
+
/**
|
|
4
|
+
* Internal Merkle-Damgard hash utils.
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */
|
|
8
|
+
function setBigUint64(view, byteOffset, value, isLE) {
|
|
9
|
+
if (typeof view.setBigUint64 === "function") return view.setBigUint64(byteOffset, value, isLE);
|
|
10
|
+
const _32n = BigInt(32);
|
|
11
|
+
const _u32_max = BigInt(4294967295);
|
|
12
|
+
const wh = Number(value >> _32n & _u32_max);
|
|
13
|
+
const wl = Number(value & _u32_max);
|
|
14
|
+
const h = isLE ? 4 : 0;
|
|
15
|
+
const l = isLE ? 0 : 4;
|
|
16
|
+
view.setUint32(byteOffset + h, wh, isLE);
|
|
17
|
+
view.setUint32(byteOffset + l, wl, isLE);
|
|
18
|
+
}
|
|
19
|
+
/** Choice: a ? b : c */
|
|
20
|
+
function Chi(a, b, c) {
|
|
21
|
+
return a & b ^ ~a & c;
|
|
22
|
+
}
|
|
23
|
+
/** Majority function, true if any two inputs is true. */
|
|
24
|
+
function Maj(a, b, c) {
|
|
25
|
+
return a & b ^ a & c ^ b & c;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Merkle-Damgard hash construction base class.
|
|
29
|
+
* Could be used to create MD5, RIPEMD, SHA1, SHA2.
|
|
30
|
+
*/
|
|
31
|
+
var HashMD = class extends Hash {
|
|
32
|
+
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
33
|
+
super();
|
|
34
|
+
this.finished = false;
|
|
35
|
+
this.length = 0;
|
|
36
|
+
this.pos = 0;
|
|
37
|
+
this.destroyed = false;
|
|
38
|
+
this.blockLen = blockLen;
|
|
39
|
+
this.outputLen = outputLen;
|
|
40
|
+
this.padOffset = padOffset;
|
|
41
|
+
this.isLE = isLE;
|
|
42
|
+
this.buffer = new Uint8Array(blockLen);
|
|
43
|
+
this.view = createView(this.buffer);
|
|
44
|
+
}
|
|
45
|
+
update(data) {
|
|
46
|
+
aexists(this);
|
|
47
|
+
data = toBytes(data);
|
|
48
|
+
abytes(data);
|
|
49
|
+
const { view, buffer, blockLen } = this;
|
|
50
|
+
const len = data.length;
|
|
51
|
+
for (let pos = 0; pos < len;) {
|
|
52
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
53
|
+
if (take === blockLen) {
|
|
54
|
+
const dataView = createView(data);
|
|
55
|
+
for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
59
|
+
this.pos += take;
|
|
60
|
+
pos += take;
|
|
61
|
+
if (this.pos === blockLen) {
|
|
62
|
+
this.process(view, 0);
|
|
63
|
+
this.pos = 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
this.length += data.length;
|
|
67
|
+
this.roundClean();
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
digestInto(out) {
|
|
71
|
+
aexists(this);
|
|
72
|
+
aoutput(out, this);
|
|
73
|
+
this.finished = true;
|
|
74
|
+
const { buffer, view, blockLen, isLE } = this;
|
|
75
|
+
let { pos } = this;
|
|
76
|
+
buffer[pos++] = 128;
|
|
77
|
+
clean(this.buffer.subarray(pos));
|
|
78
|
+
if (this.padOffset > blockLen - pos) {
|
|
79
|
+
this.process(view, 0);
|
|
80
|
+
pos = 0;
|
|
81
|
+
}
|
|
82
|
+
for (let i = pos; i < blockLen; i++) buffer[i] = 0;
|
|
83
|
+
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
|
84
|
+
this.process(view, 0);
|
|
85
|
+
const oview = createView(out);
|
|
86
|
+
const len = this.outputLen;
|
|
87
|
+
if (len % 4) throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
88
|
+
const outLen = len / 4;
|
|
89
|
+
const state = this.get();
|
|
90
|
+
if (outLen > state.length) throw new Error("_sha2: outputLen bigger than state");
|
|
91
|
+
for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
|
|
92
|
+
}
|
|
93
|
+
digest() {
|
|
94
|
+
const { buffer, outputLen } = this;
|
|
95
|
+
this.digestInto(buffer);
|
|
96
|
+
const res = buffer.slice(0, outputLen);
|
|
97
|
+
this.destroy();
|
|
98
|
+
return res;
|
|
99
|
+
}
|
|
100
|
+
_cloneInto(to) {
|
|
101
|
+
to || (to = new this.constructor());
|
|
102
|
+
to.set(...this.get());
|
|
103
|
+
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
104
|
+
to.destroyed = destroyed;
|
|
105
|
+
to.finished = finished;
|
|
106
|
+
to.length = length;
|
|
107
|
+
to.pos = pos;
|
|
108
|
+
if (length % blockLen) to.buffer.set(buffer);
|
|
109
|
+
return to;
|
|
110
|
+
}
|
|
111
|
+
clone() {
|
|
112
|
+
return this._cloneInto();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
|
|
117
|
+
* Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
|
|
118
|
+
*/
|
|
119
|
+
/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */
|
|
120
|
+
const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
121
|
+
1779033703,
|
|
122
|
+
3144134277,
|
|
123
|
+
1013904242,
|
|
124
|
+
2773480762,
|
|
125
|
+
1359893119,
|
|
126
|
+
2600822924,
|
|
127
|
+
528734635,
|
|
128
|
+
1541459225
|
|
129
|
+
]);
|
|
130
|
+
//#endregion
|
|
131
|
+
export { Chi, HashMD, Maj, SHA256_IV };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region .pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js
|
|
2
|
+
/**
|
|
3
|
+
* Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.
|
|
4
|
+
* @todo re-check https://issues.chromium.org/issues/42212588
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
8
|
+
const _32n = /* @__PURE__ */ BigInt(32);
|
|
9
|
+
function fromBig(n, le = false) {
|
|
10
|
+
if (le) return {
|
|
11
|
+
h: Number(n & U32_MASK64),
|
|
12
|
+
l: Number(n >> _32n & U32_MASK64)
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
h: Number(n >> _32n & U32_MASK64) | 0,
|
|
16
|
+
l: Number(n & U32_MASK64) | 0
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function split(lst, le = false) {
|
|
20
|
+
const len = lst.length;
|
|
21
|
+
let Ah = new Uint32Array(len);
|
|
22
|
+
let Al = new Uint32Array(len);
|
|
23
|
+
for (let i = 0; i < len; i++) {
|
|
24
|
+
const { h, l } = fromBig(lst[i], le);
|
|
25
|
+
[Ah[i], Al[i]] = [h, l];
|
|
26
|
+
}
|
|
27
|
+
return [Ah, Al];
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { split };
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { clean, createHasher, rotr } from "./utils.js";
|
|
2
|
+
import { Chi, HashMD, Maj, SHA256_IV } from "./_md.js";
|
|
3
|
+
import { split } from "./_u64.js";
|
|
4
|
+
//#region .pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
|
|
5
|
+
/**
|
|
6
|
+
* SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.
|
|
7
|
+
* SHA256 is the fastest hash implementable in JS, even faster than Blake3.
|
|
8
|
+
* Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and
|
|
9
|
+
* [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Round constants:
|
|
14
|
+
* First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)
|
|
15
|
+
*/
|
|
16
|
+
const SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
17
|
+
1116352408,
|
|
18
|
+
1899447441,
|
|
19
|
+
3049323471,
|
|
20
|
+
3921009573,
|
|
21
|
+
961987163,
|
|
22
|
+
1508970993,
|
|
23
|
+
2453635748,
|
|
24
|
+
2870763221,
|
|
25
|
+
3624381080,
|
|
26
|
+
310598401,
|
|
27
|
+
607225278,
|
|
28
|
+
1426881987,
|
|
29
|
+
1925078388,
|
|
30
|
+
2162078206,
|
|
31
|
+
2614888103,
|
|
32
|
+
3248222580,
|
|
33
|
+
3835390401,
|
|
34
|
+
4022224774,
|
|
35
|
+
264347078,
|
|
36
|
+
604807628,
|
|
37
|
+
770255983,
|
|
38
|
+
1249150122,
|
|
39
|
+
1555081692,
|
|
40
|
+
1996064986,
|
|
41
|
+
2554220882,
|
|
42
|
+
2821834349,
|
|
43
|
+
2952996808,
|
|
44
|
+
3210313671,
|
|
45
|
+
3336571891,
|
|
46
|
+
3584528711,
|
|
47
|
+
113926993,
|
|
48
|
+
338241895,
|
|
49
|
+
666307205,
|
|
50
|
+
773529912,
|
|
51
|
+
1294757372,
|
|
52
|
+
1396182291,
|
|
53
|
+
1695183700,
|
|
54
|
+
1986661051,
|
|
55
|
+
2177026350,
|
|
56
|
+
2456956037,
|
|
57
|
+
2730485921,
|
|
58
|
+
2820302411,
|
|
59
|
+
3259730800,
|
|
60
|
+
3345764771,
|
|
61
|
+
3516065817,
|
|
62
|
+
3600352804,
|
|
63
|
+
4094571909,
|
|
64
|
+
275423344,
|
|
65
|
+
430227734,
|
|
66
|
+
506948616,
|
|
67
|
+
659060556,
|
|
68
|
+
883997877,
|
|
69
|
+
958139571,
|
|
70
|
+
1322822218,
|
|
71
|
+
1537002063,
|
|
72
|
+
1747873779,
|
|
73
|
+
1955562222,
|
|
74
|
+
2024104815,
|
|
75
|
+
2227730452,
|
|
76
|
+
2361852424,
|
|
77
|
+
2428436474,
|
|
78
|
+
2756734187,
|
|
79
|
+
3204031479,
|
|
80
|
+
3329325298
|
|
81
|
+
]);
|
|
82
|
+
/** Reusable temporary buffer. "W" comes straight from spec. */
|
|
83
|
+
const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
84
|
+
var SHA256 = class extends HashMD {
|
|
85
|
+
constructor(outputLen = 32) {
|
|
86
|
+
super(64, outputLen, 8, false);
|
|
87
|
+
this.A = SHA256_IV[0] | 0;
|
|
88
|
+
this.B = SHA256_IV[1] | 0;
|
|
89
|
+
this.C = SHA256_IV[2] | 0;
|
|
90
|
+
this.D = SHA256_IV[3] | 0;
|
|
91
|
+
this.E = SHA256_IV[4] | 0;
|
|
92
|
+
this.F = SHA256_IV[5] | 0;
|
|
93
|
+
this.G = SHA256_IV[6] | 0;
|
|
94
|
+
this.H = SHA256_IV[7] | 0;
|
|
95
|
+
}
|
|
96
|
+
get() {
|
|
97
|
+
const { A, B, C, D, E, F, G, H } = this;
|
|
98
|
+
return [
|
|
99
|
+
A,
|
|
100
|
+
B,
|
|
101
|
+
C,
|
|
102
|
+
D,
|
|
103
|
+
E,
|
|
104
|
+
F,
|
|
105
|
+
G,
|
|
106
|
+
H
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
set(A, B, C, D, E, F, G, H) {
|
|
110
|
+
this.A = A | 0;
|
|
111
|
+
this.B = B | 0;
|
|
112
|
+
this.C = C | 0;
|
|
113
|
+
this.D = D | 0;
|
|
114
|
+
this.E = E | 0;
|
|
115
|
+
this.F = F | 0;
|
|
116
|
+
this.G = G | 0;
|
|
117
|
+
this.H = H | 0;
|
|
118
|
+
}
|
|
119
|
+
process(view, offset) {
|
|
120
|
+
for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
|
|
121
|
+
for (let i = 16; i < 64; i++) {
|
|
122
|
+
const W15 = SHA256_W[i - 15];
|
|
123
|
+
const W2 = SHA256_W[i - 2];
|
|
124
|
+
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
125
|
+
SHA256_W[i] = (rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10) + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
126
|
+
}
|
|
127
|
+
let { A, B, C, D, E, F, G, H } = this;
|
|
128
|
+
for (let i = 0; i < 64; i++) {
|
|
129
|
+
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
130
|
+
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
131
|
+
const T2 = (rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22)) + Maj(A, B, C) | 0;
|
|
132
|
+
H = G;
|
|
133
|
+
G = F;
|
|
134
|
+
F = E;
|
|
135
|
+
E = D + T1 | 0;
|
|
136
|
+
D = C;
|
|
137
|
+
C = B;
|
|
138
|
+
B = A;
|
|
139
|
+
A = T1 + T2 | 0;
|
|
140
|
+
}
|
|
141
|
+
A = A + this.A | 0;
|
|
142
|
+
B = B + this.B | 0;
|
|
143
|
+
C = C + this.C | 0;
|
|
144
|
+
D = D + this.D | 0;
|
|
145
|
+
E = E + this.E | 0;
|
|
146
|
+
F = F + this.F | 0;
|
|
147
|
+
G = G + this.G | 0;
|
|
148
|
+
H = H + this.H | 0;
|
|
149
|
+
this.set(A, B, C, D, E, F, G, H);
|
|
150
|
+
}
|
|
151
|
+
roundClean() {
|
|
152
|
+
clean(SHA256_W);
|
|
153
|
+
}
|
|
154
|
+
destroy() {
|
|
155
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
156
|
+
clean(this.buffer);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const K512 = split([
|
|
160
|
+
"0x428a2f98d728ae22",
|
|
161
|
+
"0x7137449123ef65cd",
|
|
162
|
+
"0xb5c0fbcfec4d3b2f",
|
|
163
|
+
"0xe9b5dba58189dbbc",
|
|
164
|
+
"0x3956c25bf348b538",
|
|
165
|
+
"0x59f111f1b605d019",
|
|
166
|
+
"0x923f82a4af194f9b",
|
|
167
|
+
"0xab1c5ed5da6d8118",
|
|
168
|
+
"0xd807aa98a3030242",
|
|
169
|
+
"0x12835b0145706fbe",
|
|
170
|
+
"0x243185be4ee4b28c",
|
|
171
|
+
"0x550c7dc3d5ffb4e2",
|
|
172
|
+
"0x72be5d74f27b896f",
|
|
173
|
+
"0x80deb1fe3b1696b1",
|
|
174
|
+
"0x9bdc06a725c71235",
|
|
175
|
+
"0xc19bf174cf692694",
|
|
176
|
+
"0xe49b69c19ef14ad2",
|
|
177
|
+
"0xefbe4786384f25e3",
|
|
178
|
+
"0x0fc19dc68b8cd5b5",
|
|
179
|
+
"0x240ca1cc77ac9c65",
|
|
180
|
+
"0x2de92c6f592b0275",
|
|
181
|
+
"0x4a7484aa6ea6e483",
|
|
182
|
+
"0x5cb0a9dcbd41fbd4",
|
|
183
|
+
"0x76f988da831153b5",
|
|
184
|
+
"0x983e5152ee66dfab",
|
|
185
|
+
"0xa831c66d2db43210",
|
|
186
|
+
"0xb00327c898fb213f",
|
|
187
|
+
"0xbf597fc7beef0ee4",
|
|
188
|
+
"0xc6e00bf33da88fc2",
|
|
189
|
+
"0xd5a79147930aa725",
|
|
190
|
+
"0x06ca6351e003826f",
|
|
191
|
+
"0x142929670a0e6e70",
|
|
192
|
+
"0x27b70a8546d22ffc",
|
|
193
|
+
"0x2e1b21385c26c926",
|
|
194
|
+
"0x4d2c6dfc5ac42aed",
|
|
195
|
+
"0x53380d139d95b3df",
|
|
196
|
+
"0x650a73548baf63de",
|
|
197
|
+
"0x766a0abb3c77b2a8",
|
|
198
|
+
"0x81c2c92e47edaee6",
|
|
199
|
+
"0x92722c851482353b",
|
|
200
|
+
"0xa2bfe8a14cf10364",
|
|
201
|
+
"0xa81a664bbc423001",
|
|
202
|
+
"0xc24b8b70d0f89791",
|
|
203
|
+
"0xc76c51a30654be30",
|
|
204
|
+
"0xd192e819d6ef5218",
|
|
205
|
+
"0xd69906245565a910",
|
|
206
|
+
"0xf40e35855771202a",
|
|
207
|
+
"0x106aa07032bbd1b8",
|
|
208
|
+
"0x19a4c116b8d2d0c8",
|
|
209
|
+
"0x1e376c085141ab53",
|
|
210
|
+
"0x2748774cdf8eeb99",
|
|
211
|
+
"0x34b0bcb5e19b48a8",
|
|
212
|
+
"0x391c0cb3c5c95a63",
|
|
213
|
+
"0x4ed8aa4ae3418acb",
|
|
214
|
+
"0x5b9cca4f7763e373",
|
|
215
|
+
"0x682e6ff3d6b2b8a3",
|
|
216
|
+
"0x748f82ee5defb2fc",
|
|
217
|
+
"0x78a5636f43172f60",
|
|
218
|
+
"0x84c87814a1f0ab72",
|
|
219
|
+
"0x8cc702081a6439ec",
|
|
220
|
+
"0x90befffa23631e28",
|
|
221
|
+
"0xa4506cebde82bde9",
|
|
222
|
+
"0xbef9a3f7b2c67915",
|
|
223
|
+
"0xc67178f2e372532b",
|
|
224
|
+
"0xca273eceea26619c",
|
|
225
|
+
"0xd186b8c721c0c207",
|
|
226
|
+
"0xeada7dd6cde0eb1e",
|
|
227
|
+
"0xf57d4f7fee6ed178",
|
|
228
|
+
"0x06f067aa72176fba",
|
|
229
|
+
"0x0a637dc5a2c898a6",
|
|
230
|
+
"0x113f9804bef90dae",
|
|
231
|
+
"0x1b710b35131c471b",
|
|
232
|
+
"0x28db77f523047d84",
|
|
233
|
+
"0x32caab7b40c72493",
|
|
234
|
+
"0x3c9ebe0a15c9bebc",
|
|
235
|
+
"0x431d67c49c100d4c",
|
|
236
|
+
"0x4cc5d4becb3e42b6",
|
|
237
|
+
"0x597f299cfc657e2a",
|
|
238
|
+
"0x5fcb6fab3ad6faec",
|
|
239
|
+
"0x6c44198c4a475817"
|
|
240
|
+
].map((n) => BigInt(n)));
|
|
241
|
+
K512[0];
|
|
242
|
+
K512[1];
|
|
243
|
+
/**
|
|
244
|
+
* SHA2-256 hash function from RFC 4634.
|
|
245
|
+
*
|
|
246
|
+
* It is the fastest JS hash, even faster than Blake3.
|
|
247
|
+
* To break sha256 using birthday attack, attackers need to try 2^128 hashes.
|
|
248
|
+
* BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
|
|
249
|
+
*/
|
|
250
|
+
const sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
|
|
251
|
+
//#endregion
|
|
252
|
+
export { sha256 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sha256 as sha256$1 } from "./sha2.js";
|
|
2
|
+
//#region .pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js
|
|
3
|
+
/**
|
|
4
|
+
* SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.
|
|
5
|
+
*
|
|
6
|
+
* To break sha256 using birthday attack, attackers need to try 2^128 hashes.
|
|
7
|
+
* BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
|
|
8
|
+
*
|
|
9
|
+
* Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).
|
|
10
|
+
* @module
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
13
|
+
/** @deprecated Use import from `noble/hashes/sha2` module */
|
|
14
|
+
const sha256 = sha256$1;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { sha256 };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region .pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
2
|
+
/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */
|
|
3
|
+
function isBytes(a) {
|
|
4
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
5
|
+
}
|
|
6
|
+
/** Asserts something is Uint8Array. */
|
|
7
|
+
function abytes(b, ...lengths) {
|
|
8
|
+
if (!isBytes(b)) throw new Error("Uint8Array expected");
|
|
9
|
+
if (lengths.length > 0 && !lengths.includes(b.length)) throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
10
|
+
}
|
|
11
|
+
/** Asserts a hash instance has not been destroyed / finished */
|
|
12
|
+
function aexists(instance, checkFinished = true) {
|
|
13
|
+
if (instance.destroyed) throw new Error("Hash instance has been destroyed");
|
|
14
|
+
if (checkFinished && instance.finished) throw new Error("Hash#digest() has already been called");
|
|
15
|
+
}
|
|
16
|
+
/** Asserts output is properly-sized byte array */
|
|
17
|
+
function aoutput(out, instance) {
|
|
18
|
+
abytes(out);
|
|
19
|
+
const min = instance.outputLen;
|
|
20
|
+
if (out.length < min) throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
21
|
+
}
|
|
22
|
+
/** Zeroize a byte array. Warning: JS provides no guarantees. */
|
|
23
|
+
function clean(...arrays) {
|
|
24
|
+
for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
|
|
25
|
+
}
|
|
26
|
+
/** Create DataView of an array for easy byte-level manipulation. */
|
|
27
|
+
function createView(arr) {
|
|
28
|
+
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
29
|
+
}
|
|
30
|
+
/** The rotate right (circular right shift) operation for uint32 */
|
|
31
|
+
function rotr(word, shift) {
|
|
32
|
+
return word << 32 - shift | word >>> shift;
|
|
33
|
+
}
|
|
34
|
+
new Uint8Array(new Uint32Array([287454020]).buffer)[0];
|
|
35
|
+
typeof Uint8Array.from([]).toHex === "function" && Uint8Array.fromHex;
|
|
36
|
+
/**
|
|
37
|
+
* Converts string to bytes using UTF8 encoding.
|
|
38
|
+
* @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])
|
|
39
|
+
*/
|
|
40
|
+
function utf8ToBytes(str) {
|
|
41
|
+
if (typeof str !== "string") throw new Error("string expected");
|
|
42
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Normalizes (non-hex) string or Uint8Array to Uint8Array.
|
|
46
|
+
* Warning: when Uint8Array is passed, it would NOT get copied.
|
|
47
|
+
* Keep in mind for future mutable operations.
|
|
48
|
+
*/
|
|
49
|
+
function toBytes(data) {
|
|
50
|
+
if (typeof data === "string") data = utf8ToBytes(data);
|
|
51
|
+
abytes(data);
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
/** For runtime check if class implements interface */
|
|
55
|
+
var Hash = class {};
|
|
56
|
+
/** Wraps hash function, creating an interface on top of it */
|
|
57
|
+
function createHasher(hashCons) {
|
|
58
|
+
const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
|
|
59
|
+
const tmp = hashCons();
|
|
60
|
+
hashC.outputLen = tmp.outputLen;
|
|
61
|
+
hashC.blockLen = tmp.blockLen;
|
|
62
|
+
hashC.create = () => hashCons();
|
|
63
|
+
return hashC;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { Hash, abytes, aexists, aoutput, clean, createHasher, createView, rotr, toBytes };
|
|
@@ -51,11 +51,31 @@ const attachmentSchema = strictObject({
|
|
|
51
51
|
workspaceRelativePath: string().optional(),
|
|
52
52
|
durationSeconds: number().nonnegative().optional()
|
|
53
53
|
});
|
|
54
|
+
const endpointContextSchema = strictObject({
|
|
55
|
+
version: literal(1),
|
|
56
|
+
capturedAt: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
57
|
+
timezone: string().min(1).max(80).refine((value) => {
|
|
58
|
+
try {
|
|
59
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
60
|
+
return true;
|
|
61
|
+
} catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}, "Invalid timezone"),
|
|
65
|
+
locale: string().min(1).max(80).refine((value) => {
|
|
66
|
+
try {
|
|
67
|
+
return Intl.getCanonicalLocales(value).length === 1;
|
|
68
|
+
} catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}, "Invalid locale")
|
|
72
|
+
});
|
|
54
73
|
const sessionInputContentSchema = strictObject({
|
|
55
74
|
content: string(),
|
|
75
|
+
endpointContext: endpointContextSchema.optional(),
|
|
56
76
|
attachments: array(attachmentSchema).optional(),
|
|
57
77
|
contextRefs: array(strictObject({
|
|
58
|
-
kind: _enum(["note", "task", "file", "session", "browser_tab", "
|
|
78
|
+
kind: _enum(["note", "task", "file", "session", "browser_tab", "user_assertion"]),
|
|
59
79
|
sourceId: string().trim().min(1),
|
|
60
80
|
refId: string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional(),
|
|
61
81
|
expectedVersion: string().optional()
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"minimum_chrome_version": "120",
|
|
4
4
|
"default_locale": "en",
|
|
5
5
|
"name": "__MSG_appName__",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.370",
|
|
7
7
|
"description": "__MSG_appDescription__",
|
|
8
8
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqnpr4vpLC/nmvy+wiOWk3SWlp2nEZkFijfk8ivGw7StNZgCK90nOMvwhdEtlkk3GOWDvdVnq8HxCsM3UNQ8FnGUyerpH1FJXqXuradxeHf8ZxFjiQU/mIWfnKbUuONWQORon3/pigyoXoK/VUXgg0Wbm/rbVwsS0bv+25R6m+mZgBspOLeKuoH7ivhL+48WV6POtMBsFPZweY26477EM7ukh+56Ff5ENevB8ymxBBn7qK5ZoeZd2a23U8ioX5TsHfe6fnrjitPWjIxD8G0NoKQxcaa/Mo+xs+T6UiLKxP0wjz5bm7jB5H+CXtkRJqzBWUB0h+RSLJckzZfA8BAJrRwIDAQAB",
|
|
9
9
|
"permissions": [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "telegram",
|
|
3
3
|
"name": "Telegram Channel",
|
|
4
4
|
"description": "Bundled Telegram Bot channel (private workspace sources; ships inside @xopcai/xopc dist/)",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.370",
|
|
6
6
|
"kind": "channel",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"channels": [
|