@xopcai/xopc 0.0.410 → 0.0.412
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 +12 -6
- package/README.zh-CN.md +12 -6
- package/dist/browser-ext/dist/assets/{page-context-A5RCibM_.js → page-context-MuzjMBlJ.js} +1 -1
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/gateway-setup.js +9 -3
- package/dist/extensions/feishu/src/plugin.d.ts +0 -3
- package/dist/extensions/feishu/src/plugin.js +1 -11
- package/dist/extensions/feishu/src/schema/config-schema.d.ts +0 -2
- package/dist/extensions/feishu/src/schema/config-schema.js +9 -21
- package/dist/extensions/feishu/src/state/accounts.js +3 -7
- package/dist/extensions/telegram/src/plugin.d.ts +0 -3
- package/dist/extensions/telegram/src/plugin.js +0 -9
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/plugin.d.ts +0 -3
- package/dist/extensions/weixin/src/plugin.js +1 -12
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-BrGZdh5N.js +1 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BjZpom5V.js +1 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-D0UyB0Y_.js → agents-admin-api-uGDeJR1f.js} +1 -1
- package/dist/gateway/static/root/assets/agents-s3ws5Qi-.js +77 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-C6DHuX0L.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-byEnJz9H.js → appearance-settings-DYGY92Yr.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-PpT_YMmD.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BXssEuq3.js → archive-plugin-DAmsio91.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-display-DCkjVzA0.js → automation-display-BFN7zWBg.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C-puATkS.js → automations-page-BVutrwON.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-G6-9IYbR.js +8 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DBz_2AhG.js → binary-plugins-41QCRAxz.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BOO5kjIl.js → block-editor-BQ8AA-Ot.js} +40 -40
- package/dist/gateway/static/root/assets/{browser-automation-inputs-D8bZ9iz2.js → browser-automation-inputs-D4-vQc4g.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-o3jNFlCb.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-G0dVwiX4.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-B9b5KCBb.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-BZQanmZY.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D-YadSx_.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-yfPUz5Wt.js → capability-header-actions-CDgI-YZF.js} +1 -1
- package/dist/gateway/static/root/assets/channels-3WX3f0bR.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dlzn80cK.js → chat-terminal-dock-CUkCx_9x.js} +2 -2
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-B2HK1psj.js → chunk-KS7C4IRE-BvcCCgTW.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-CuZrL9gL.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-49mgdRET.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-Bjj2wAeG.js +1 -0
- package/dist/gateway/static/root/assets/date-formatters-DukWSVwc.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-DGjpqOKx.js → date-picker-BpBjADAk.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-R8kdHLr3.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-BpiosRqb.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-9h6evrKB.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-CZ5lwiLE.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CwT1LcLR.js → directory-picker-path-field-DwXqp_iu.js} +1 -1
- package/dist/gateway/static/root/assets/electron-env-Dit0bHgy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DX-hX_d0.js → extension-debug-page-Bj93A2Gn.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Cji87mN9.js → extension-page-Bri62YsN.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BulzpwBD.js → extension-settings-page-BSo6vRhS.js} +1 -1
- package/dist/gateway/static/root/assets/files-Bw4SBGdM.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-CTXr917C.js → gateway-config-swr-BVqYVaGy.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CY1LBGBS.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-Dafw95ol.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DgEwWJwz.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DD2fsxdd.js → gateway-startup-retry-CPKGkr6D.js} +1 -1
- package/dist/gateway/static/root/assets/highlight-code-CSFBakwF.js +1 -0
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-BgTqMa_d.js → highlighted-body-KQOG7T2V-Ci1QpkBn.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BKj-aPsL.js +2 -0
- package/dist/gateway/static/root/assets/image-generation-api-N5MYXlxr.js +1 -0
- package/dist/gateway/static/root/assets/imports-page-YfaRnpk1.js +1 -0
- package/dist/gateway/static/root/assets/index-CiDVRMmX.js +710 -0
- package/dist/gateway/static/root/assets/index-caRW34rg.css +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-BTQcPOix.js +1 -0
- package/dist/gateway/static/root/assets/languages-byq_L2Ae.js +2 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-kCZ_fbSZ.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-BjzaB1ls.js +1 -0
- package/dist/gateway/static/root/assets/{local-session-drafts-TqLFKwYo.js → local-session-drafts-BCaC-1rH.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-DAgpZxAS.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-5Jt3uqYt.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-DOQMLPrI.js +1 -0
- package/dist/gateway/static/root/assets/markdown-editor-phTQ0mox.js +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-DQJXvbr_.js → media-plugins-8mlDAjD6.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-B4nztFE4.js +1 -0
- package/dist/gateway/static/root/assets/messages-DMXSIJUO.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-1wsKlkk3.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-B82cToeV.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-DKREWOku.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-oSJIFF3E.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-CoqQTkkS.js +1 -0
- package/dist/gateway/static/root/assets/personal-settings-panel-BgcJLmZN.js +1 -0
- package/dist/gateway/static/root/assets/plugin-details-dialog-CdOJ3Tir.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-n6Shdp3u.js +1 -0
- package/dist/gateway/static/root/assets/product-delivery-BqNm-8S5.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Bfqez8Je.js → product-open-page-BPF5rRTI.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-content-BOsGPNbw.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-ZADyvA7-.js +7 -0
- package/dist/gateway/static/root/assets/projects-page-BkRe6Z8S.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-4NZOh0iz.js → registry-api-B6kqbuw8.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CCGf5kF4.js +1 -0
- package/dist/gateway/static/root/assets/runtime-tools-api-CY3R7unQ.js +5 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DSsANtha.js → runtime-tools-settings-panel-BxaxVlwM.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-vbhv4JE6.js → schema-form-cXD1BC02.js} +1 -1
- package/dist/gateway/static/root/assets/session-api-D6-Vz8xK.js +1 -0
- package/dist/gateway/static/root/assets/{session-manager-D2sLfkw-.js → session-manager-DWbcMHcj.js} +3 -3
- package/dist/gateway/static/root/assets/sessions-page-B81rRu2-.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DLHGV-I-.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-4nn0sb6v.js → settings-form-section-BXeszXR7.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-_HB9FC08.js → settings-page-CNmh4YmR.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-gEqkJWyw.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-CS9cOCgX.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-D9Ul96XW.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CyO89DKl.js → skill-api-B5lDCuOH.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-NLAaNaDn.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-dWeFt-6J.js +2 -0
- package/dist/gateway/static/root/assets/source-workspace-editor-BIvi89Zx.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-DdDsFdCh.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DO3FM--W.js +2 -0
- package/dist/gateway/static/root/assets/task-result-evidence-HJO1BlJm.js +1 -0
- package/dist/gateway/static/root/assets/tasks-TVRjEggr.js +1 -0
- package/dist/gateway/static/root/assets/tracing-settings-page-Dm3yToJ1.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DOUyF9Ew.js → tunnel-api-DXU94F2Y.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Bv3fdfw1.js → usage-page-DJJhACRJ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-D0MhLMD2.js → use-autosave-B1z_TIBu.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DnZ4qFaO.js +2 -0
- package/dist/gateway/static/root/assets/{vendor-codemirror-DFxP3B9T.js → vendor-codemirror-Qdcjid65.js} +16 -16
- package/dist/gateway/static/root/assets/{voice-api-key-field-Ds_ADBQH.js → voice-api-key-field-HOLjEhh3.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-4yGMrp7J.js → voice-config-api-CPKzUb4R.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-C9RklDaR.js +1 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Di-oEpCt.js → xopc-cloud-account-card-CWwGTBib.js} +1 -1
- package/dist/gateway/static/root/index.html +27 -35
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/index.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +0 -12
- package/dist/packages/gateway-contract/src/home.js +3 -3
- package/dist/packages/gateway-contract/src/product-delivery.js +0 -4
- package/dist/packages/gateway-contract/src/project-operating.js +0 -6
- package/dist/packages/gateway-contract/src/session-identity.js +0 -1
- package/dist/packages/gateway-contract/src/task-runs.js +0 -1
- package/dist/packages/gateway-contract/src/tasks.js +0 -6
- package/dist/src/activity/types.d.ts +4 -4
- package/dist/src/agent/agent-manager.d.ts +0 -3
- package/dist/src/agent/agent-manager.js +0 -43
- package/dist/src/agent/background-review/run-background-review.js +2 -2
- package/dist/src/agent/capabilities/definitions.d.ts +2 -18
- package/dist/src/agent/capabilities/definitions.js +0 -17
- package/dist/src/agent/child-agent-factory.d.ts +1 -1
- package/dist/src/agent/client-error-format.d.ts +1 -1
- package/dist/src/agent/client-error-format.js +1 -1
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/context/execution-scope.d.ts +2 -8
- package/dist/src/agent/context/execution-scope.js +6 -23
- package/dist/src/agent/embedded/index.d.ts +0 -1
- package/dist/src/agent/embedded/index.js +1 -2
- package/dist/src/agent/embedded/run-turn.js +25 -2
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +0 -2
- package/dist/src/agent/external-tools/gateway-tools.js +6 -6
- package/dist/src/agent/mcp/connection-setup.js +2 -2
- package/dist/src/agent/memory/compaction-ledger.d.ts +1 -1
- package/dist/src/agent/memory/compaction-ledger.js +1 -1
- package/dist/src/agent/memory/compaction-promotion.js +1 -1
- package/dist/src/agent/memory/source-origin.js +1 -5
- package/dist/src/agent/memory/turn-provenance.js +1 -3
- package/dist/src/agent/memory/types.d.ts +1 -1
- package/dist/src/agent/messaging/command-handler.d.ts +0 -3
- package/dist/src/agent/messaging/command-handler.js +1 -4
- package/dist/src/agent/prompt/sections/behavior.js +2 -2
- package/dist/src/agent/prompt/sections/tooling.js +1 -5
- package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
- package/dist/src/agent/prompt/voice-presentation.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +0 -6
- package/dist/src/agent/service.d.ts +0 -2
- package/dist/src/agent/service.js +0 -11
- package/dist/src/agent/service.types.d.ts +0 -2
- package/dist/src/agent/session/session-config-service.d.ts +0 -2
- package/dist/src/agent/session/session-config-service.js +1 -1
- package/dist/src/agent/session/session-inspector.d.ts +0 -1
- package/dist/src/agent/session/session-inspector.js +0 -1
- package/dist/src/agent/skills/required-env-vars.d.ts +1 -1
- package/dist/src/agent/skills/required-env-vars.js +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +2 -5
- package/dist/src/agent/tools/automation-tool.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +0 -3
- package/dist/src/agent/tools/factory.js +6 -9
- package/dist/src/agent/tools/index.d.ts +0 -2
- package/dist/src/agent/tools/index.js +1 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +1 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +13 -4
- package/dist/src/agent/tools/personal-task-tool.js +8 -22
- package/dist/src/agent/tools/search/errors.js +2 -2
- package/dist/src/agent/tools/session-recall-tool.js +5 -1
- package/dist/src/agent/tools/user-context-tool.js +7 -1
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/agent-catalog/index.d.ts +0 -1
- package/dist/src/agent-catalog/index.js +1 -2
- package/dist/src/agent-catalog/repository.js +4 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/resolver.js +0 -6
- package/dist/src/agent-config/schema.d.ts +0 -16
- package/dist/src/agent-config/schema.js +2 -9
- package/dist/src/agent-matching/selection-repository.d.ts +1 -1
- package/dist/src/agent-matching/selection-repository.js +1 -1
- package/dist/src/agent-matching/service.d.ts +1 -2
- package/dist/src/agent-matching/service.js +3 -7
- package/dist/src/ai-assist/text-assist.d.ts +1 -1
- package/dist/src/ai-assist/text-assist.js +0 -72
- package/dist/src/automations/capabilities/write.d.ts +0 -40
- package/dist/src/automations/domain/types.d.ts +0 -15
- package/dist/src/automations/domain/validation.d.ts +0 -80
- package/dist/src/automations/domain/validation.js +0 -17
- package/dist/src/automations/draft/automation-draft-prompt.js +0 -3
- package/dist/src/automations/draft/automation-draft-validator.d.ts +0 -20
- package/dist/src/automations/draft/automation-draft-validator.js +0 -1
- package/dist/src/automations/events/event-catalog.js +0 -6
- package/dist/src/automations/service/action-executor.d.ts +0 -1
- package/dist/src/automations/service/action-executor.js +1 -110
- package/dist/src/automations/service/automation-service.js +0 -2
- package/dist/src/automations/storage/automation-run-repository.js +6 -7
- package/dist/src/backup/archive.js +1 -1
- package/dist/src/bootstrap/application-state.d.ts +2 -10
- package/dist/src/bootstrap/application-state.js +5 -18
- package/dist/src/channels/manager.d.ts +0 -2
- package/dist/src/channels/manager.js +0 -4
- package/dist/src/channels/pairing/index.d.ts +2 -1
- package/dist/src/channels/pairing/pairing-service.d.ts +0 -1
- package/dist/src/chat-commands/context.d.ts +0 -3
- package/dist/src/chat-commands/context.js +0 -5
- package/dist/src/chat-commands/index.d.ts +0 -1
- package/dist/src/chat-commands/index.js +1 -3
- package/dist/src/chat-commands/types.d.ts +0 -5
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/config.js +2 -10
- package/dist/src/cli/commands/doctor/checks/database-relations.js +0 -3
- package/dist/src/cli/commands/doctor/checks/database-schema.js +4 -25
- package/dist/src/cli/commands/gateway/run-foreground.js +1 -1
- package/dist/src/cli/commands/setup-shared/prompts.d.ts +2 -2
- package/dist/src/cli/commands/setup-shared/prompts.js +2 -2
- package/dist/src/cli/commands/tui-runner.js +2 -2
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/index.d.ts +0 -1
- package/dist/src/cli/index.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +8 -9
- package/dist/src/config/config-file.d.ts +6 -0
- package/dist/src/config/config-file.js +35 -0
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/loader.d.ts +0 -1
- package/dist/src/config/loader.js +6 -17
- package/dist/src/config/paths.d.ts +1 -1
- package/dist/src/config/paths.js +1 -1
- package/dist/src/connectors/composio-catalog.js +1 -3
- package/dist/src/connectors/composio.js +1 -2
- package/dist/src/connectors/connected-source-ingestion.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +1 -1
- package/dist/src/connectors/learning-coordinator.js +1 -1
- package/dist/src/connectors/principal.js +1 -22
- package/dist/src/connectors/{workflow-preflight.d.ts → requirements-preflight.d.ts} +9 -8
- package/dist/src/connectors/{workflow-preflight.js → requirements-preflight.js} +2 -10
- package/dist/src/connectors/types.d.ts +1 -1
- package/dist/src/daemon/types.d.ts +0 -9
- package/dist/src/discussions/long-review.js +0 -11
- package/dist/src/endpoint-tools/policy.js +13 -14
- package/dist/src/extensions/agent-plugins/auth.js +1 -3
- package/dist/src/extensions/agent-plugins/formats.js +2 -4
- package/dist/src/extensions/agent-plugins/mcp-format.d.ts +1 -1
- package/dist/src/extensions/agent-plugins/mcp-format.js +2 -2
- package/dist/src/extensions/bundled-extension-activation.d.ts +0 -2
- package/dist/src/extensions/bundled-extension-activation.js +1 -3
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/types/tui.d.ts +1 -2
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -7
- package/dist/src/gateway/agent-builtin-tools.js +0 -7
- package/dist/src/gateway/agents-admin.d.ts +0 -1
- package/dist/src/gateway/agents-admin.js +0 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +0 -8
- package/dist/src/gateway/hono/lib/config-payload.js +1 -2
- package/dist/src/gateway/hono/lib/config-write-lock.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-write-lock.js +1 -1
- package/dist/src/gateway/hono/middleware/auth.js +2 -2
- package/dist/src/gateway/hono/routes/activity.js +0 -1
- package/dist/src/gateway/hono/routes/agents.js +2 -9
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +0 -22
- package/dist/src/gateway/hono/routes/chat-model-config.d.ts +0 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -3
- package/dist/src/gateway/hono/routes/config.js +2 -21
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/devices.js +2 -2
- package/dist/src/gateway/hono/routes/home.js +3 -20
- package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -8
- package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +0 -16
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +0 -3
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +1 -1
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +2 -2
- package/dist/src/gateway/security/device-request-proof.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +0 -1
- package/dist/src/gateway/service/active-execution.d.ts +1 -1
- package/dist/src/gateway/service/active-execution.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/sessions-api.d.ts +1 -2
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service/task-conversation-query-service.d.ts +0 -4
- package/dist/src/gateway/service/types.d.ts +2 -0
- package/dist/src/gateway/service.d.ts +1 -8
- package/dist/src/gateway/service.js +13 -60
- package/dist/src/history/ctx/format.js +1 -1
- package/dist/src/home-intelligence/capability-preflight.js +1 -1
- package/dist/src/infra/unhandled-rejections.js +2 -2
- package/dist/src/infra/update-runner.d.ts +1 -2
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
- package/dist/src/knowledge/local-folder-adapter.js +2 -5
- package/dist/src/knowledge-memory/usage-policy.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/memory-learning/forget-capture.js +3 -2
- package/dist/src/memory-learning/forgotten-history.d.ts +10 -0
- package/dist/src/memory-learning/forgotten-history.js +117 -13
- package/dist/src/memory-learning/owner-directive.d.ts +2 -0
- package/dist/src/memory-learning/owner-directive.js +10 -0
- package/dist/src/memory-learning/service.js +0 -2
- package/dist/src/memory-learning/source-learning.js +1 -1
- package/dist/src/memory-learning/task-receipts.js +1 -1
- package/dist/src/migrations/index.js +2 -2
- package/dist/src/migrations/runner.d.ts +1 -2
- package/dist/src/migrations/runner.js +2 -5
- package/dist/src/notes/service.js +3 -3
- package/dist/src/notes/types.d.ts +1 -2
- package/dist/src/personal-agent/communication.d.ts +0 -3
- package/dist/src/personal-agent/communication.js +1 -12
- package/dist/src/personal-agent/persona.d.ts +0 -4
- package/dist/src/personal-agent/persona.js +1 -5
- package/dist/src/personal-agent/proactivity/repository.js +2 -6
- package/dist/src/personal-agent/prompt-context.js +1 -1
- package/dist/src/personal-agent/prompts.d.ts +0 -3
- package/dist/src/personal-agent/prompts.js +7 -146
- package/dist/src/personal-agent/reply-composer.js +3 -3
- package/dist/src/personal-agent/reply-style.d.ts +1 -13
- package/dist/src/personal-agent/reply-style.js +3 -123
- package/dist/src/personal-agent/request-delivery.d.ts +1 -1
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +2 -2
- package/dist/src/personal-agent/specialist-capabilities.js +0 -1
- package/dist/src/personal-agent/task-cancel.js +2 -1
- package/dist/src/platform/client.d.ts +0 -1
- package/dist/src/platform/contracts.d.ts +0 -1
- package/dist/src/platform/contracts.js +1 -4
- package/dist/src/projects/index.d.ts +0 -1
- package/dist/src/projects/index.js +1 -2
- package/dist/src/projects/project-loop.d.ts +2 -12
- package/dist/src/projects/project-loop.js +19 -42
- package/dist/src/projects/project-store.d.ts +0 -1
- package/dist/src/projects/project-store.js +0 -11
- package/dist/src/projects/types.d.ts +0 -6
- package/dist/src/providers/model-usage.js +0 -5
- package/dist/src/realtime/runtime.js +0 -1
- package/dist/src/routing/agent-session-key.js +1 -1
- package/dist/src/session/manager.js +1 -1
- package/dist/src/session/types.d.ts +2 -6
- package/dist/src/storage/sqlite/connection-wait-repository.js +0 -33
- package/dist/src/storage/sqlite/connection.js +2 -2
- package/dist/src/storage/sqlite/device-access-repository.d.ts +2 -2
- package/dist/src/storage/sqlite/device-access-repository.js +4 -8
- package/dist/src/storage/sqlite/home-attention-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/index.d.ts +1 -3
- package/dist/src/storage/sqlite/index.js +4 -8
- package/dist/src/storage/sqlite/{migrations/conversation-backup.d.ts → offline-access.d.ts} +1 -4
- package/dist/src/storage/sqlite/{migrations/conversation-backup.js → offline-access.js} +6 -25
- package/dist/src/storage/sqlite/row-mappers.d.ts +0 -8
- package/dist/src/storage/sqlite/row-mappers.js +0 -8
- package/dist/src/storage/sqlite/{migrations/errors.d.ts → schema-errors.d.ts} +0 -6
- package/dist/src/storage/sqlite/schema-errors.js +28 -0
- package/dist/src/storage/sqlite/schema.d.ts +4 -5
- package/dist/src/storage/sqlite/schema.js +23 -19
- package/dist/src/storage/sqlite/schema.sql +1099 -427
- package/dist/src/storage/sqlite/session-identity-sql.js +1 -2
- package/dist/src/storage/sqlite/session-read-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-read-repository.js +1 -2
- package/dist/src/storage/sqlite/session-repository.js +4 -33
- package/dist/src/storage/sqlite/{migrations/conversation-windows-owners.js → windows-database-owners.js} +3 -3
- package/dist/src/tasks/attention-governor.d.ts +1 -0
- package/dist/src/tasks/attention-governor.js +2 -2
- package/dist/src/tasks/capabilities/management.d.ts +0 -1
- package/dist/src/tasks/capabilities/relations.d.ts +2 -2
- package/dist/src/tasks/execution-context.d.ts +1 -1
- package/dist/src/tasks/execution-context.js +0 -2
- package/dist/src/tasks/home-query-service.d.ts +2 -16
- package/dist/src/tasks/home-query-service.js +37 -67
- package/dist/src/tasks/index.d.ts +0 -1
- package/dist/src/tasks/index.js +1 -2
- package/dist/src/tasks/project-operating-view-service.js +0 -1
- package/dist/src/tasks/task-application-service.js +0 -5
- package/dist/src/tasks/task-repository.d.ts +1 -1
- package/dist/src/tasks/task-run-coordinator.js +4 -2
- package/dist/src/tui/backends/embedded-backend.d.ts +1 -4
- package/dist/src/tui/backends/embedded-backend.js +3 -59
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +1 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -27
- package/dist/src/tui/components/chat-log.d.ts +0 -2
- package/dist/src/tui/components/chat-log.js +0 -18
- package/dist/src/tui/extension-host/runtime-context.js +0 -1
- package/dist/src/tui/tui-backend.d.ts +0 -15
- package/dist/src/tui/tui-command-formatters.d.ts +0 -3
- package/dist/src/tui/tui-command-formatters.js +1 -28
- package/dist/src/tui/tui-commands.d.ts +1 -14
- package/dist/src/tui/tui-commands.js +4 -89
- package/dist/src/tui/tui-startup-resources.js +0 -2
- package/dist/src/tui/tui-startup-text.js +2 -3
- package/dist/src/tui/tui.js +1 -49
- package/dist/src/user-context/trust-policy.js +1 -1
- package/dist/src/user-model/usage-policy.js +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/logger/index.js +1 -1
- package/dist/src/utils/logger.js +1 -1
- package/dist/src/voice/realtime/agentBroker.js +2 -3
- package/dist/src/voice/realtime/memory-context.js +2 -2
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/service.js +2 -2
- package/package.json +5 -6
- package/dist/extensions/feishu/src/workflow-progress.d.ts +0 -27
- package/dist/extensions/feishu/src/workflow-progress.js +0 -98
- package/dist/extensions/telegram/src/workflow-progress.d.ts +0 -24
- package/dist/extensions/telegram/src/workflow-progress.js +0 -72
- package/dist/extensions/weixin/src/workflow-progress.d.ts +0 -26
- package/dist/extensions/weixin/src/workflow-progress.js +0 -98
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-ColV_Z1C.js +0 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-rgRXzBCX.js +0 -1
- package/dist/gateway/static/root/assets/agents-C1rSl_yE.js +0 -77
- package/dist/gateway/static/root/assets/app-link-BV_eGr7l.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-B-Cl1lzt.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BfVMfjkC.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-b7MTHd-X.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-DMqDOJgO.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-KZStwhX7.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-CD6PzNK7.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-DeJuO2rf.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DPxL_3Km.js +0 -8
- package/dist/gateway/static/root/assets/channels-Cp4F9zPz.js +0 -1
- package/dist/gateway/static/root/assets/code-editor-CXIH8jQw.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-BXhmUWbA.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-B1oJCj74.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Da_M7h3m.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BfWUD3LG.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-CPEi55Vt.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-CmQ_H-nM.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-BeTjXc3C.js +0 -1
- package/dist/gateway/static/root/assets/dist-BGTk37IG.js +0 -1
- package/dist/gateway/static/root/assets/file-archive-DanfQJNe.js +0 -1
- package/dist/gateway/static/root/assets/file-braces-BoAMI_k9.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CP6L2jIR.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-yXB4a40_.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CIdEroWr.js +0 -1
- package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BSbYrVda.js +0 -2
- package/dist/gateway/static/root/assets/image-generation-api-BfPYnMoc.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DYSOfHfw.js +0 -1
- package/dist/gateway/static/root/assets/index-D2hEKnTM.js +0 -267
- package/dist/gateway/static/root/assets/index-SmKNPEmJ.css +0 -1
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-BwsGM6Yd.js +0 -1
- package/dist/gateway/static/root/assets/languages-BFe8nIOO.js +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-K6UR6cAx.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-page-gkdwtjDE.js +0 -1
- package/dist/gateway/static/root/assets/locale-store-D_migb9R.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BAQNYk0e.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-CMVRLGox.js +0 -1
- package/dist/gateway/static/root/assets/markdown-editor-BhBJANcx.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-Ljt0bhfF.js +0 -324
- package/dist/gateway/static/root/assets/markdown-view-ixUWAmoy.css +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Cx0bXBqu.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-render-604gISVe.js +0 -134
- package/dist/gateway/static/root/assets/messages-D__oW2yE.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-1GCqp26U.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-B7RA-WsY.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-DnjlEdzM.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-BAwI_3uh.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-XoLrcR0U.js +0 -1
- package/dist/gateway/static/root/assets/personal-settings-panel-DzubCRqj.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-BjzIp3T5.js +0 -1
- package/dist/gateway/static/root/assets/plus-Q2yW6OE7.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-2YjwlRHu.js +0 -1
- package/dist/gateway/static/root/assets/product-delivery-DwmnNJvk.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-D7wLwrqj.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-1ueRCmXg.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CDQycMPo.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-YvVmZA4K.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-api-CmEWVrOg.js +0 -5
- package/dist/gateway/static/root/assets/session-api-aQLptIs9.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B3rPljgr.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Ch20Ptzp.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-L1HHrvzi.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-C4lC0W3d.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-DtHZ9z5K.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Drg356Pb.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-XhCLHKlK.js +0 -2
- package/dist/gateway/static/root/assets/source-workspace-editor-DunRD1gY.js +0 -1
- package/dist/gateway/static/root/assets/style-DTLpCnuA.js +0 -7
- package/dist/gateway/static/root/assets/system-settings-panel-bSogz4S-.js +0 -1
- package/dist/gateway/static/root/assets/tab-completion-input.utils-BP3NH_du.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CSv2x4q-.js +0 -2
- package/dist/gateway/static/root/assets/task-expandable-content-4s_FTl-9.js +0 -1
- package/dist/gateway/static/root/assets/tasks-B4bZpO6O.js +0 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-CZ5XLQmX.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-BD7WvhI0.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-CDJp2_l2.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CR4fRhZZ.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-BeJw5liC.js +0 -6
- package/dist/gateway/static/root/assets/x-B_N4OPjy.js +0 -1
- package/dist/gateway/static/root/assets/xml-_d7dTN2Q.js +0 -3
- package/dist/src/agent/embedded/session-manager-init.d.ts +0 -4
- package/dist/src/agent/embedded/session-manager-init.js +0 -48
- package/dist/src/agent/tools/workflow-manage-tool.d.ts +0 -2
- package/dist/src/agent/tools/workflow-manage-tool.js +0 -225
- package/dist/src/agent/tools/workflow-tool.d.ts +0 -20
- package/dist/src/agent/tools/workflow-tool.js +0 -155
- package/dist/src/agent/workflow/agent-progress.d.ts +0 -5
- package/dist/src/agent/workflow/agent-progress.js +0 -65
- package/dist/src/agent/workflow/builtins/index.d.ts +0 -2
- package/dist/src/agent/workflow/builtins/index.js +0 -374
- package/dist/src/agent/workflow/catalog.d.ts +0 -52
- package/dist/src/agent/workflow/catalog.js +0 -150
- package/dist/src/agent/workflow/channel-capability.d.ts +0 -76
- package/dist/src/agent/workflow/channel-capability.js +0 -1
- package/dist/src/agent/workflow/index.d.ts +0 -10
- package/dist/src/agent/workflow/index.js +0 -9
- package/dist/src/agent/workflow/progress-broker.d.ts +0 -80
- package/dist/src/agent/workflow/progress-broker.js +0 -261
- package/dist/src/agent/workflow/snapshot-empty.d.ts +0 -2
- package/dist/src/agent/workflow/snapshot-empty.js +0 -17
- package/dist/src/agent/workflow/snapshot.d.ts +0 -28
- package/dist/src/agent/workflow/snapshot.js +0 -267
- package/dist/src/agent/workflow/step-labels.d.ts +0 -8
- package/dist/src/agent/workflow/step-labels.js +0 -50
- package/dist/src/agent/workflow/structured-output-tool.d.ts +0 -33
- package/dist/src/agent/workflow/structured-output-tool.js +0 -56
- package/dist/src/agent/workflow/subagent-runner.d.ts +0 -46
- package/dist/src/agent/workflow/subagent-runner.js +0 -221
- package/dist/src/agent/workflow/types.d.ts +0 -252
- package/dist/src/agent/workflow/types.js +0 -1
- package/dist/src/agent/workflow/workflow-child-tools.d.ts +0 -4
- package/dist/src/agent/workflow/workflow-child-tools.js +0 -38
- package/dist/src/agent-catalog/migrations/identity-markdown-cutover.d.ts +0 -5
- package/dist/src/agent-catalog/migrations/identity-markdown-cutover.js +0 -94
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.d.ts +0 -11
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +0 -194
- package/dist/src/chat-commands/builtins/workflow.d.ts +0 -18
- package/dist/src/chat-commands/builtins/workflow.js +0 -249
- package/dist/src/gateway/gateway-workflow-host.types.d.ts +0 -23
- package/dist/src/gateway/gateway-workflow-host.types.js +0 -1
- package/dist/src/gateway/hono/routes/workflows.d.ts +0 -3
- package/dist/src/gateway/hono/routes/workflows.js +0 -572
- package/dist/src/knowledge-memory/repair-evidence.d.ts +0 -2
- package/dist/src/knowledge-memory/repair-evidence.js +0 -57
- package/dist/src/migrations/cloud-public-models.d.ts +0 -7
- package/dist/src/migrations/cloud-public-models.js +0 -157
- package/dist/src/migrations/memory-config.d.ts +0 -2
- package/dist/src/migrations/memory-config.js +0 -76
- package/dist/src/migrations/retired-local-stt.d.ts +0 -2
- package/dist/src/migrations/retired-local-stt.js +0 -52
- package/dist/src/projects/workflow-bind.d.ts +0 -1
- package/dist/src/projects/workflow-bind.js +0 -15
- package/dist/src/storage/sqlite/migrations/218_core_relation_indexes.sql +0 -26
- package/dist/src/storage/sqlite/migrations/219_json_contracts.sql +0 -123
- package/dist/src/storage/sqlite/migrations/220_normalize_timestamps.sql +0 -339
- package/dist/src/storage/sqlite/migrations/221_ai_usage_retention_index.sql +0 -2
- package/dist/src/storage/sqlite/migrations/222_session_config_authority.sql +0 -13
- package/dist/src/storage/sqlite/migrations/223_session_creation_receipts.sql +0 -59
- package/dist/src/storage/sqlite/migrations/224_task_origin_links.sql +0 -8
- package/dist/src/storage/sqlite/migrations/225_task_collaboration.sql +0 -32
- package/dist/src/storage/sqlite/migrations/226_task_main_updates.sql +0 -9
- package/dist/src/storage/sqlite/migrations/227_task_main_update_decisions.sql +0 -8
- package/dist/src/storage/sqlite/migrations/228_task_main_agent_links.sql +0 -14
- package/dist/src/storage/sqlite/migrations/229_task_criterion_reviews.sql +0 -12
- package/dist/src/storage/sqlite/migrations/230_personal_agent_onboarding.sql +0 -8
- package/dist/src/storage/sqlite/migrations/231_task_result_deliveries.sql +0 -32
- package/dist/src/storage/sqlite/migrations/232_personal_requests.sql +0 -28
- package/dist/src/storage/sqlite/migrations/233_observability_usage_links.sql +0 -3
- package/dist/src/storage/sqlite/migrations/234_task_result_reply.sql +0 -14
- package/dist/src/storage/sqlite/migrations/235_personal_conversation_priority.sql +0 -3
- package/dist/src/storage/sqlite/migrations/236_personal_proactivity.sql +0 -53
- package/dist/src/storage/sqlite/migrations/237_personal_strategy_versions.sql +0 -18
- package/dist/src/storage/sqlite/migrations/238_browser_record_replay.sql +0 -45
- package/dist/src/storage/sqlite/migrations/239_clarification_notifications.sql +0 -26
- package/dist/src/storage/sqlite/migrations/240_device_settings.sql +0 -5
- package/dist/src/storage/sqlite/migrations/241_device_grant_audit.sql +0 -13
- package/dist/src/storage/sqlite/migrations/242_cloud_usage_receipts.sql +0 -5
- package/dist/src/storage/sqlite/migrations/243_voice_opening_greetings.sql +0 -12
- package/dist/src/storage/sqlite/migrations/244_device_request_proofs.sql +0 -8
- package/dist/src/storage/sqlite/migrations/245_memory_learning.sql +0 -125
- package/dist/src/storage/sqlite/migrations/246_personal_session_thinking.sql +0 -22
- package/dist/src/storage/sqlite/migrations/247_agent_selection_records.sql +0 -32
- package/dist/src/storage/sqlite/migrations/248_next_turn_suggestions.sql +0 -20
- package/dist/src/storage/sqlite/migrations/249_task_allocations.sql +0 -17
- package/dist/src/storage/sqlite/migrations/250_research_checkpoints.sql +0 -15
- package/dist/src/storage/sqlite/migrations/251_personal_result_reads.sql +0 -40
- package/dist/src/storage/sqlite/migrations/252_task_work_revisions.sql +0 -15
- package/dist/src/storage/sqlite/migrations/253_discussion_processing_recovery.sql +0 -20
- package/dist/src/storage/sqlite/migrations/254_discussion_annotations.sql +0 -17
- package/dist/src/storage/sqlite/migrations/255_discussion_chapter_progress.sql +0 -10
- package/dist/src/storage/sqlite/migrations/256_task_main_update_retries.sql +0 -21
- package/dist/src/storage/sqlite/migrations/257_session_composer_history.sql +0 -11
- package/dist/src/storage/sqlite/migrations/258_task_phase_changes.sql +0 -20
- package/dist/src/storage/sqlite/migrations/259_personal_default_style.sql +0 -10
- package/dist/src/storage/sqlite/migrations/discover.d.ts +0 -4
- package/dist/src/storage/sqlite/migrations/discover.js +0 -40
- package/dist/src/storage/sqlite/migrations/errors.js +0 -40
- package/dist/src/storage/sqlite/migrations/runner.d.ts +0 -22
- package/dist/src/storage/sqlite/migrations/runner.js +0 -112
- package/dist/src/storage/sqlite/migrations/types.d.ts +0 -12
- package/dist/src/storage/sqlite/migrations/types.js +0 -1
- package/dist/src/tasks/task-workflow-coordinator.d.ts +0 -5
- package/dist/src/tasks/task-workflow-coordinator.js +0 -55
- package/dist/src/tui/tui-workflow-slash.d.ts +0 -29
- package/dist/src/tui/tui-workflow-slash.js +0 -58
- package/dist/src/workflows/authoring/index.d.ts +0 -2
- package/dist/src/workflows/authoring/index.js +0 -3
- package/dist/src/workflows/authoring/workflow-draft-defaults.d.ts +0 -3
- package/dist/src/workflows/authoring/workflow-draft-defaults.js +0 -63
- package/dist/src/workflows/authoring/workflow-draft-store.d.ts +0 -29
- package/dist/src/workflows/authoring/workflow-draft-store.js +0 -52
- package/dist/src/workflows/context/workflow-context-snapshot-repository.d.ts +0 -21
- package/dist/src/workflows/context/workflow-context-snapshot-repository.js +0 -41
- package/dist/src/workflows/context/workflow-context.d.ts +0 -18
- package/dist/src/workflows/context/workflow-context.js +0 -164
- package/dist/src/workflows/domain/command.d.ts +0 -19
- package/dist/src/workflows/domain/command.js +0 -1
- package/dist/src/workflows/domain/definition-utils.d.ts +0 -18
- package/dist/src/workflows/domain/definition-utils.js +0 -90
- package/dist/src/workflows/domain/definition.d.ts +0 -164
- package/dist/src/workflows/domain/definition.js +0 -1
- package/dist/src/workflows/domain/event.d.ts +0 -88
- package/dist/src/workflows/domain/event.js +0 -1
- package/dist/src/workflows/domain/index.d.ts +0 -8
- package/dist/src/workflows/domain/index.js +0 -5
- package/dist/src/workflows/domain/result.d.ts +0 -68
- package/dist/src/workflows/domain/result.js +0 -1
- package/dist/src/workflows/domain/run.d.ts +0 -257
- package/dist/src/workflows/domain/run.js +0 -12
- package/dist/src/workflows/domain/schema-validation.d.ts +0 -8
- package/dist/src/workflows/domain/schema-validation.js +0 -26
- package/dist/src/workflows/domain/validation.d.ts +0 -22
- package/dist/src/workflows/domain/validation.js +0 -318
- package/dist/src/workflows/engine/index.d.ts +0 -2
- package/dist/src/workflows/engine/index.js +0 -3
- package/dist/src/workflows/engine/projector.d.ts +0 -3
- package/dist/src/workflows/engine/projector.js +0 -276
- package/dist/src/workflows/engine/workflow-engine.d.ts +0 -88
- package/dist/src/workflows/engine/workflow-engine.js +0 -719
- package/dist/src/workflows/index.d.ts +0 -11
- package/dist/src/workflows/index.js +0 -19
- package/dist/src/workflows/project-presets/project-workflow-preset-repository.d.ts +0 -20
- package/dist/src/workflows/project-presets/project-workflow-preset-repository.js +0 -39
- package/dist/src/workflows/registry/catalog-workflow-definition-registry.d.ts +0 -9
- package/dist/src/workflows/registry/catalog-workflow-definition-registry.js +0 -30
- package/dist/src/workflows/registry/index.d.ts +0 -2
- package/dist/src/workflows/registry/index.js +0 -2
- package/dist/src/workflows/registry/workflow-definition-registry.d.ts +0 -15
- package/dist/src/workflows/registry/workflow-definition-registry.js +0 -1
- package/dist/src/workflows/runtime/graph-workflow-runtime.d.ts +0 -10
- package/dist/src/workflows/runtime/graph-workflow-runtime.js +0 -289
- package/dist/src/workflows/runtime/index.d.ts +0 -2
- package/dist/src/workflows/runtime/index.js +0 -2
- package/dist/src/workflows/runtime/workflow-runtime-port.d.ts +0 -13
- package/dist/src/workflows/runtime/workflow-runtime-port.js +0 -1
- package/dist/src/workflows/service/run-view-to-snapshot.d.ts +0 -4
- package/dist/src/workflows/service/run-view-to-snapshot.js +0 -64
- package/dist/src/workflows/service/workflow-run-service.d.ts +0 -63
- package/dist/src/workflows/service/workflow-run-service.js +0 -892
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +0 -62
- package/dist/src/workflows/service/workflow-run-service.types.js +0 -1
- package/dist/src/workflows/service/workflow-session-bridge.d.ts +0 -33
- package/dist/src/workflows/service/workflow-session-bridge.js +0 -244
- package/dist/src/workflows/service/workflow-session-key.d.ts +0 -3
- package/dist/src/workflows/service/workflow-session-key.js +0 -19
- package/dist/src/workflows/service/workflow-writeback-service.d.ts +0 -9
- package/dist/src/workflows/service/workflow-writeback-service.js +0 -107
- package/dist/src/workflows/store/event-store.d.ts +0 -16
- package/dist/src/workflows/store/event-store.js +0 -38
- package/dist/src/workflows/store/paths.d.ts +0 -5
- package/dist/src/workflows/store/paths.js +0 -18
- package/dist/src/workflows/store/run-index-store.d.ts +0 -9
- package/dist/src/workflows/store/run-index-store.js +0 -64
- package/dist/src/workflows/store/run-store.d.ts +0 -16
- package/dist/src/workflows/store/run-store.js +0 -40
- package/skills/engineering/workflow-authoring/SKILL.md +0 -32
- /package/dist/gateway/static/root/assets/{style-DLioOiRN.css → project-detail-page-DLioOiRN.css} +0 -0
- /package/dist/src/storage/sqlite/{migrations/conversation-windows-owners.d.ts → windows-database-owners.d.ts} +0 -0
package/dist/src/tui/tui.js
CHANGED
|
@@ -5,14 +5,10 @@ import { init_agent_session_key, normalizeAgentId } from "../routing/agent-sessi
|
|
|
5
5
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
6
6
|
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
7
7
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
8
|
-
import { isTerminalWorkflowRunStatus } from "../workflows/domain/run.js";
|
|
9
|
-
import "../workflows/domain/index.js";
|
|
10
8
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
11
9
|
import { loadConfig } from "../config/loader.js";
|
|
12
|
-
import { renderWorkflowFinalSummary, renderWorkflowPanel } from "../agent/workflow/snapshot.js";
|
|
13
10
|
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
14
11
|
import "../config/index.js";
|
|
15
|
-
import { runViewToSnapshot } from "../workflows/service/run-view-to-snapshot.js";
|
|
16
12
|
import { resolveTuiConversationId, resolveTuiStartupConversationId } from "../routing/resolve-tui-session-key.js";
|
|
17
13
|
import { applyThemeById, getBashExcludeBorderColor, getBashModeBorderColor, getCustomThemesDir, getThemeExports, getThinkingBorderColor, initTuiTheme, listAvailableThemeIds, resolveThemePalette } from "./theme-manager.js";
|
|
18
14
|
import { editorTheme, theme } from "./theme.js";
|
|
@@ -516,8 +512,6 @@ async function runTui(opts) {
|
|
|
516
512
|
const slashCommands = getSlashCommands(isLocalMode, keybindings);
|
|
517
513
|
const resourceSlashCommands = [];
|
|
518
514
|
const skillSlashCommands = [];
|
|
519
|
-
const workflowSlashCommands = [];
|
|
520
|
-
const visibleWorkflowRunIds = /* @__PURE__ */ new Set();
|
|
521
515
|
const syncResourceSlashCommands = (resources) => {
|
|
522
516
|
resourceSlashCommands.length = 0;
|
|
523
517
|
skillSlashCommands.length = 0;
|
|
@@ -531,17 +525,6 @@ async function runTui(opts) {
|
|
|
531
525
|
skillSlashCommands.push(command);
|
|
532
526
|
resourceSlashCommands.push(command);
|
|
533
527
|
}
|
|
534
|
-
workflowSlashCommands.length = 0;
|
|
535
|
-
for (const name of resources?.workflows ?? []) {
|
|
536
|
-
const workflowName = name.trim();
|
|
537
|
-
if (!workflowName) continue;
|
|
538
|
-
const command = {
|
|
539
|
-
name: `workflow:${workflowName}`,
|
|
540
|
-
description: "Run workflow"
|
|
541
|
-
};
|
|
542
|
-
workflowSlashCommands.push(command);
|
|
543
|
-
resourceSlashCommands.push(command);
|
|
544
|
-
}
|
|
545
528
|
};
|
|
546
529
|
let extensionWorkingMessage;
|
|
547
530
|
let extensionWorkingVisible = true;
|
|
@@ -1190,7 +1173,7 @@ async function runTui(opts) {
|
|
|
1190
1173
|
};
|
|
1191
1174
|
const setReasoningLevel = async (level) => {
|
|
1192
1175
|
try {
|
|
1193
|
-
await client.patchSession(state.currentConversationId, {
|
|
1176
|
+
await client.patchSession(state.currentConversationId, { activityDetailLevel: level });
|
|
1194
1177
|
state.sessionInfo.reasoningLevel = level;
|
|
1195
1178
|
await refreshSessionInfoWithBorder();
|
|
1196
1179
|
updateFooter();
|
|
@@ -1380,17 +1363,6 @@ async function runTui(opts) {
|
|
|
1380
1363
|
tui.requestRender();
|
|
1381
1364
|
}
|
|
1382
1365
|
};
|
|
1383
|
-
const startWorkflowRun = async (request) => {
|
|
1384
|
-
if (!client.startWorkflowRun) throw new Error("Workflow runs are not available in this mode.");
|
|
1385
|
-
const result = await client.startWorkflowRun({
|
|
1386
|
-
conversationId: state.currentConversationId,
|
|
1387
|
-
definitionId: request.definitionId,
|
|
1388
|
-
agentId: currentAgentId,
|
|
1389
|
-
goal: request.goal
|
|
1390
|
-
});
|
|
1391
|
-
visibleWorkflowRunIds.add(result.runId);
|
|
1392
|
-
return result;
|
|
1393
|
-
};
|
|
1394
1366
|
const runBtwQuery = async (question) => {
|
|
1395
1367
|
const previousStatus = state.activityStatus;
|
|
1396
1368
|
const runId = `btw-${randomUUID()}`;
|
|
@@ -1782,12 +1754,10 @@ async function runTui(opts) {
|
|
|
1782
1754
|
exportSession: exportCurrentSession,
|
|
1783
1755
|
importSession: importSessionExport,
|
|
1784
1756
|
createShare: createShareLink,
|
|
1785
|
-
startWorkflowRun,
|
|
1786
1757
|
runBtwQuery,
|
|
1787
1758
|
forkSession: forkCurrentSession,
|
|
1788
1759
|
extensionSlashCommands: extensionRuntime.slashCommands,
|
|
1789
1760
|
skillSlashCommands,
|
|
1790
|
-
workflowSlashCommands,
|
|
1791
1761
|
extensionShortcuts: extensionRuntime.shortcuts,
|
|
1792
1762
|
currentAgentId,
|
|
1793
1763
|
setSession: async (rawKey) => {
|
|
@@ -2238,23 +2208,6 @@ async function runTui(opts) {
|
|
|
2238
2208
|
tui.requestRender();
|
|
2239
2209
|
});
|
|
2240
2210
|
};
|
|
2241
|
-
const handleWorkflowRunUpdated = (data) => {
|
|
2242
|
-
const runId = typeof data.runId === "string" ? data.runId : "";
|
|
2243
|
-
const view = data.view && typeof data.view === "object" ? data.view : null;
|
|
2244
|
-
if (!runId || !view || !visibleWorkflowRunIds.has(runId)) return false;
|
|
2245
|
-
const snapshot = runViewToSnapshot(view);
|
|
2246
|
-
const completed = isTerminalWorkflowRunStatus(view.run.status);
|
|
2247
|
-
chatLog.updateWorkflowRun(runId, renderWorkflowPanel(snapshot, { status: view.run.status }));
|
|
2248
|
-
if (completed) {
|
|
2249
|
-
chatLog.addSystem(renderWorkflowFinalSummary(snapshot, { status: view.run.status }));
|
|
2250
|
-
visibleWorkflowRunIds.delete(runId);
|
|
2251
|
-
refreshSessionInfoWithBorder().finally(() => {
|
|
2252
|
-
updateFooter();
|
|
2253
|
-
});
|
|
2254
|
-
}
|
|
2255
|
-
tui.requestRender();
|
|
2256
|
-
return true;
|
|
2257
|
-
};
|
|
2258
2211
|
client.onEvent = (evt) => {
|
|
2259
2212
|
const data = evt.data ?? {};
|
|
2260
2213
|
if (evt.event === "session.input-state") {
|
|
@@ -2269,7 +2222,6 @@ async function runTui(opts) {
|
|
|
2269
2222
|
if (typeof data.conversationId === "string") composerHistory.clear(data.conversationId);
|
|
2270
2223
|
return;
|
|
2271
2224
|
}
|
|
2272
|
-
if (evt.event === "workflow.run.updated" && handleWorkflowRunUpdated(data)) return;
|
|
2273
2225
|
dispatchAgentEvent(evt.event, data, state, chatLog, tui, setActivityStatus, touchStreamingActivity, onAgentRunEnded, (message) => sessionSnapshot.appendMessage("assistant", assistantMessagePlainText(message)), evt.source);
|
|
2274
2226
|
};
|
|
2275
2227
|
let startupSessionPickerOpened = false;
|
|
@@ -13,7 +13,7 @@ function buildActionTrustPrompt(level) {
|
|
|
13
13
|
"## Action Trust Boundary",
|
|
14
14
|
`Current default: ${level}.`,
|
|
15
15
|
"- This controls agent-initiated or proactive actions. A direct user request in the current turn is explicit approval to carry out that request within existing safety and permission boundaries.",
|
|
16
|
-
"- Never expand connector permissions,
|
|
16
|
+
"- Never expand connector permissions, execution scope, credentials, or access because of this setting.",
|
|
17
17
|
"- Irreversible, destructive, financial, permission-expanding, or public external actions still require explicit confirmation."
|
|
18
18
|
];
|
|
19
19
|
const instruction = level === "observe" ? "- For proactive work, observe and build context only; do not prepare or initiate actions." : level === "suggest" ? "- For proactive work, explain the recommendation and rationale, then let the user decide whether to proceed." : level === "confirm" ? "- For proactive work, prepare the action, but request approval before executing any mutating or external step." : "- For proactive work, you may execute within already-authorized, recoverable boundaries without asking each time.";
|
|
@@ -3,8 +3,8 @@ import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transacti
|
|
|
3
3
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
5
5
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
6
|
-
import { getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
|
|
7
6
|
import { isOwnerIdentity } from "../user-context/identity-bindings.js";
|
|
7
|
+
import { getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
|
|
8
8
|
//#region src/user-model/usage-policy.ts
|
|
9
9
|
init_sqlite();
|
|
10
10
|
init_transaction();
|
package/dist/src/utils/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getAsyncLogContext, inboundCorrelationMetadataFromAsyncLogContext, runWithLogContext, updateAsyncLogContext } from "./logger/context.js";
|
|
2
|
+
import { isLogRedactionEnabled, redactObject, redactPemBlock, redactSecret, redactSensitiveInfo, redactSensitiveOutput } from "./logger/redact.js";
|
|
2
3
|
import { getLogDir, getLoggerConfig } from "./logger/config.js";
|
|
3
4
|
import { getRuntimeLogStats } from "./logger/stats.js";
|
|
4
5
|
import { flushAndClose, isLoggerShuttingDown, setShuttingDown } from "./logger/shutdown.js";
|
|
5
6
|
import { cleanOldLogs, rotateLogs } from "./logger/rotation.js";
|
|
6
|
-
import { isLogRedactionEnabled, redactObject, redactPemBlock, redactSecret, redactSensitiveInfo, redactSensitiveOutput } from "./logger/redact.js";
|
|
7
7
|
import { exportLog, flushExporters, getExporters, initializeExporters } from "./logger/exporters.js";
|
|
8
8
|
import { configureAuditLog, getAuditConfig, logAuditEvent, logAuthEvent, logConfigChange, logDataAccess, logPermissionChange } from "./logger/audit.js";
|
|
9
9
|
import { Pino as pino, baseLogger as logger, createExtensionLogger, createLogger, createModuleLogger, createServiceLogger, getLogLevel, isLevelEnabled, setLogLevel, withLogLevel } from "./logger/index.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { PACKAGE_VERSION, init_package_version } from "../../package-version.js";
|
|
3
3
|
import { getAsyncLogContext, getAsyncLogCorrelationKeys, inboundCorrelationMetadataFromAsyncLogContext, init_context, mergeContext, runWithLogContext, updateAsyncLogContext } from "./context.js";
|
|
4
|
+
import { init_redact, isLogRedactionEnabled, redactLogRecord, redactObject, redactPemBlock, redactSecret, redactSensitiveInfo, redactSensitiveOutput } from "./redact.js";
|
|
4
5
|
import { config, getLogDir, getLoggerConfig, init_config } from "./config.js";
|
|
5
6
|
import { init_streams, initializeStreams } from "./streams.js";
|
|
6
7
|
import { getRuntimeLogStats, incrementStats, init_stats } from "./stats.js";
|
|
7
8
|
import { flushAndClose, init_shutdown, isLoggerShuttingDown, setShuttingDown } from "./shutdown.js";
|
|
8
9
|
import { cleanOldLogs, init_rotation, rotateLogs } from "./rotation.js";
|
|
9
|
-
import { init_redact, isLogRedactionEnabled, redactLogRecord, redactObject, redactPemBlock, redactSecret, redactSensitiveInfo, redactSensitiveOutput } from "./redact.js";
|
|
10
10
|
import { exportLog, flushExporters, getExporters, init_exporters, initializeExporters } from "./exporters.js";
|
|
11
11
|
import { configureAuditLog, getAuditConfig, init_audit, logAuditEvent, logAuthEvent, logConfigChange, logDataAccess, logPermissionChange } from "./audit.js";
|
|
12
12
|
import pino from "pino";
|
package/dist/src/utils/logger.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAsyncLogContext, inboundCorrelationMetadataFromAsyncLogContext, runWithLogContext, updateAsyncLogContext } from "./logger/context.js";
|
|
3
|
+
import { isLogRedactionEnabled, redactObject, redactPemBlock, redactSecret, redactSensitiveInfo, redactSensitiveOutput } from "./logger/redact.js";
|
|
3
4
|
import { getLogDir, getLoggerConfig } from "./logger/config.js";
|
|
4
5
|
import { getRuntimeLogStats } from "./logger/stats.js";
|
|
5
6
|
import { flushAndClose, isLoggerShuttingDown, setShuttingDown } from "./logger/shutdown.js";
|
|
6
7
|
import { cleanOldLogs, rotateLogs } from "./logger/rotation.js";
|
|
7
|
-
import { isLogRedactionEnabled, redactObject, redactPemBlock, redactSecret, redactSensitiveInfo, redactSensitiveOutput } from "./logger/redact.js";
|
|
8
8
|
import { exportLog, flushExporters, getExporters, initializeExporters } from "./logger/exporters.js";
|
|
9
9
|
import { configureAuditLog, getAuditConfig, logAuditEvent, logAuthEvent, logConfigChange, logDataAccess, logPermissionChange } from "./logger/audit.js";
|
|
10
10
|
import { Pino as pino, baseLogger as logger, createExtensionLogger, createLogger, createModuleLogger, createServiceLogger, getLogLevel, init_logger as init_logger$1, isLevelEnabled, setLogLevel, withLogLevel } from "./logger/index.js";
|
|
@@ -102,8 +102,7 @@ var DurableVoiceAgentBroker = class {
|
|
|
102
102
|
signal.addEventListener("abort", abort, { once: true });
|
|
103
103
|
try {
|
|
104
104
|
if (ended && !subscription.initial.some((delivery) => {
|
|
105
|
-
|
|
106
|
-
return event?.type === "run_end" || event?.type === "stream_end";
|
|
105
|
+
return eventData(delivery)?.type === "run_end";
|
|
107
106
|
})) throw new Error("Completed voice task event history is unavailable");
|
|
108
107
|
while (!signal.aborted) {
|
|
109
108
|
if (!queued.length) await new Promise((resolve) => {
|
|
@@ -116,7 +115,7 @@ var DurableVoiceAgentBroker = class {
|
|
|
116
115
|
const event = eventData(delivery);
|
|
117
116
|
if (!event) continue;
|
|
118
117
|
yield event;
|
|
119
|
-
if (event.type === "run_end"
|
|
118
|
+
if (event.type === "run_end") {
|
|
120
119
|
this.runByTask.delete(taskId);
|
|
121
120
|
return;
|
|
122
121
|
}
|
|
@@ -4,12 +4,12 @@ import { getSessionMetadata } from "../../storage/sqlite/session-read-repository
|
|
|
4
4
|
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
5
5
|
import { getSessionConfig, init_config_repository } from "../../storage/sqlite/config-repository.js";
|
|
6
6
|
import { init_config, resolveKnowledgeReadPolicy } from "../../user-context/config.js";
|
|
7
|
-
import { canUseKnowledge } from "../../knowledge-memory/usage-policy.js";
|
|
8
|
-
import { getKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
9
7
|
import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
|
|
10
8
|
import { getConversation } from "../../routing/agent-session-key.js";
|
|
11
9
|
import { init_session_key } from "../../routing/session-key.js";
|
|
12
10
|
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
11
|
+
import { canUseKnowledge } from "../../knowledge-memory/usage-policy.js";
|
|
12
|
+
import { getKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
13
13
|
import "../../knowledge-memory/index.js";
|
|
14
14
|
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
15
15
|
import { getUserAssertion } from "../../user-model/repository.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, updateUnderstandingSourceRun } from "../user-context/sources/repository.js";
|
|
2
1
|
import { getWorkDiscoveryRun } from "./repository.js";
|
|
2
|
+
import { createUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, updateUnderstandingSourceRun } from "../user-context/sources/repository.js";
|
|
3
3
|
import { workDiscoveryFingerprintsEqual } from "./incremental.js";
|
|
4
4
|
//#region src/work-discovery/incremental-repository.ts
|
|
5
5
|
function refreshFromRun(run) {
|
|
@@ -6,9 +6,8 @@ import { ensureSessionRecord, patchSessionMetadata } from "../storage/sqlite/ses
|
|
|
6
6
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
7
7
|
import { ActivityService } from "../activity/service.js";
|
|
8
8
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
9
|
-
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
10
|
-
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
11
9
|
import { init_session_key, resolveConversationId } from "../routing/session-key.js";
|
|
10
|
+
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
12
11
|
import "../knowledge-memory/index.js";
|
|
13
12
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
14
13
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
@@ -18,6 +17,7 @@ import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
|
18
17
|
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
19
18
|
import "../user-model/index.js";
|
|
20
19
|
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
20
|
+
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
21
21
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
22
22
|
import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
23
23
|
import { clusterActivityTopics } from "../user-context/sources/activity-clustering.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Local-first personal AI with Ada, task delegation, files, projects
|
|
3
|
+
"version": "0.0.412",
|
|
4
|
+
"description": "Local-first personal AI with Ada, task delegation, files, projects and automations. Use cloud or local models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
@@ -49,8 +49,7 @@
|
|
|
49
49
|
"personal-ai",
|
|
50
50
|
"self-hosted",
|
|
51
51
|
"task-management",
|
|
52
|
-
"typescript"
|
|
53
|
-
"workflow-automation"
|
|
52
|
+
"typescript"
|
|
54
53
|
],
|
|
55
54
|
"author": "xopcai <lyxopc.ai@gmail.com>",
|
|
56
55
|
"license": "MIT",
|
|
@@ -170,12 +169,12 @@
|
|
|
170
169
|
"xlsx": "file:web/vendor/xlsx-0.20.3.tgz",
|
|
171
170
|
"@xopcai/browser-control-contract": "0.1.0",
|
|
172
171
|
"@xopcai/computer-control-contract": "0.1.0",
|
|
172
|
+
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
173
173
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
174
174
|
"@xopcai/gateway-contract": "0.0.0",
|
|
175
175
|
"@xopcai/image-providers": "0.1.0",
|
|
176
|
-
"@xopcai/realtime-client": "0.0.0",
|
|
177
176
|
"@xopcai/realtime-protocol": "0.0.0",
|
|
178
|
-
"@xopcai/
|
|
177
|
+
"@xopcai/realtime-client": "0.0.0"
|
|
179
178
|
},
|
|
180
179
|
"scripts": {
|
|
181
180
|
"generate:device-tools": "tsx scripts/devices/generate-mobile-tools.mts",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Feishu/Lark capability for the workflow progress broker.
|
|
3
|
-
*
|
|
4
|
-
* Feishu exposes `im.v1.message.update`, so we get the same edit-in-place UX
|
|
5
|
-
* as Telegram: send the first snapshot, then update the same message on
|
|
6
|
-
* every subsequent throttled tick. Key events (phase change / new error /
|
|
7
|
-
* tool_end) bypass the throttle so milestones land promptly.
|
|
8
|
-
*
|
|
9
|
-
* Per-bot send rate ~5 msg/sec/account (Feishu open API limit); a 5-second
|
|
10
|
-
* default throttle leaves comfortable headroom even when several workflows
|
|
11
|
-
* run concurrently.
|
|
12
|
-
*
|
|
13
|
-
* Routing: conversationId `main:feishu:<accountId>:<dm|group|channel>:<peerId>`.
|
|
14
|
-
* - DM peerId is an `open_id` (starts with `ou_`) → use `receive_id_type=open_id`.
|
|
15
|
-
* - Group / channel peerId is a `chat_id` → use `receive_id_type=chat_id`.
|
|
16
|
-
*
|
|
17
|
-
* Failure handling:
|
|
18
|
-
* - "edit must not modify same content" / "message_not_modified" → swallow, keep id.
|
|
19
|
-
* - Edit target gone (deleted / 410-class errors) → fall back to a fresh send.
|
|
20
|
-
* - Other errors → rethrow so the broker logs and drops the update; the next
|
|
21
|
-
* key event (or the next throttle tick) retries.
|
|
22
|
-
*/
|
|
23
|
-
import type { ChannelProgressCapability } from '@xopcai/xopc/agent/workflow/channel-capability.js';
|
|
24
|
-
import type { Config } from '@xopcai/xopc/config/schema.js';
|
|
25
|
-
export declare function createFeishuWorkflowProgressCapability(opts: {
|
|
26
|
-
getConfig: () => Config | undefined;
|
|
27
|
-
}): ChannelProgressCapability;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../../../src/utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../../../src/utils/logger.js";
|
|
3
|
-
import { getConversationRouting } from "../../../src/storage/sqlite/conversation-repository.js";
|
|
4
|
-
import { init_session_key } from "../../../src/routing/session-key.js";
|
|
5
|
-
import { resolveFeishuAccount } from "./state/accounts.js";
|
|
6
|
-
//#region extensions/feishu/src/workflow-progress.ts
|
|
7
|
-
init_session_key();
|
|
8
|
-
init_logger();
|
|
9
|
-
const log = createLogger("FeishuWorkflowProgress");
|
|
10
|
-
const FEISHU_TEXT_MAX = 4e3;
|
|
11
|
-
const DEFAULT_THROTTLE_MS = 5e3;
|
|
12
|
-
function createFeishuWorkflowProgressCapability(opts) {
|
|
13
|
-
return {
|
|
14
|
-
channelId: "feishu",
|
|
15
|
-
supportsEdit: true,
|
|
16
|
-
defaultThrottleMs: DEFAULT_THROTTLE_MS,
|
|
17
|
-
defaultMode: "edit",
|
|
18
|
-
async postProgress(input) {
|
|
19
|
-
const cfg = opts.getConfig();
|
|
20
|
-
if (!cfg) throw new Error("feishu workflow progress: no config loaded");
|
|
21
|
-
const target = resolveTarget(input.conversationId);
|
|
22
|
-
if (!target) throw new Error(`feishu workflow progress: cannot route conversationId "${input.conversationId}"`);
|
|
23
|
-
const account = resolveFeishuAccount(cfg, target.accountId);
|
|
24
|
-
if (!account.configured) throw new Error(`feishu workflow progress: account "${target.accountId}" not configured (conversationId "${input.conversationId}")`);
|
|
25
|
-
const text = clampForFeishu(input.text);
|
|
26
|
-
if (input.previousMessageId && !input.isFinal) try {
|
|
27
|
-
const { editMessageFeishu } = await import("./outbound/actions.js");
|
|
28
|
-
await editMessageFeishu({
|
|
29
|
-
cfg,
|
|
30
|
-
accountId: target.accountId,
|
|
31
|
-
messageId: input.previousMessageId,
|
|
32
|
-
text
|
|
33
|
-
});
|
|
34
|
-
return { messageId: input.previousMessageId };
|
|
35
|
-
} catch (err) {
|
|
36
|
-
if (isMessageNotModified(err)) return { messageId: input.previousMessageId };
|
|
37
|
-
if (isEditTargetGone(err)) log.debug({
|
|
38
|
-
conversationId: input.conversationId,
|
|
39
|
-
previousMessageId: input.previousMessageId
|
|
40
|
-
}, "edit target gone; falling back to fresh send");
|
|
41
|
-
else throw err;
|
|
42
|
-
}
|
|
43
|
-
const { createFeishuClient } = await import("./transport/client/client.js");
|
|
44
|
-
const { api } = createFeishuClient(account);
|
|
45
|
-
const receiveIdType = isOpenId(target.peerId) ? "open_id" : "chat_id";
|
|
46
|
-
const messageId = extractMessageId(await api.im.message.create({
|
|
47
|
-
params: { receive_id_type: receiveIdType },
|
|
48
|
-
data: {
|
|
49
|
-
receive_id: target.peerId,
|
|
50
|
-
msg_type: "text",
|
|
51
|
-
content: JSON.stringify({ text })
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
if (!messageId) throw new Error("feishu workflow progress: send succeeded but no message_id returned");
|
|
55
|
-
return { messageId };
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function resolveTarget(conversationId) {
|
|
60
|
-
const parsed = getConversationRouting(conversationId);
|
|
61
|
-
if (!parsed) return null;
|
|
62
|
-
if (parsed.source !== "feishu") return null;
|
|
63
|
-
if (!parsed.peerId) return null;
|
|
64
|
-
return {
|
|
65
|
-
accountId: parsed.accountId || "default",
|
|
66
|
-
peerId: parsed.peerId
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function clampForFeishu(text) {
|
|
70
|
-
if (text.length <= FEISHU_TEXT_MAX) return text;
|
|
71
|
-
return `${text.slice(0, FEISHU_TEXT_MAX - 1)}…`;
|
|
72
|
-
}
|
|
73
|
-
function isOpenId(peerId) {
|
|
74
|
-
return peerId.toLowerCase().startsWith("ou_");
|
|
75
|
-
}
|
|
76
|
-
function extractMessageId(res) {
|
|
77
|
-
if (!res || typeof res !== "object") return void 0;
|
|
78
|
-
const rec = res;
|
|
79
|
-
const data = rec.data;
|
|
80
|
-
const fromData = typeof data?.message_id === "string" ? data.message_id : void 0;
|
|
81
|
-
if (fromData) return fromData;
|
|
82
|
-
return typeof rec.message_id === "string" ? rec.message_id : void 0;
|
|
83
|
-
}
|
|
84
|
-
function isMessageNotModified(err) {
|
|
85
|
-
const msg = errorMessage(err).toLowerCase();
|
|
86
|
-
return msg.includes("not_modified") || msg.includes("not modified");
|
|
87
|
-
}
|
|
88
|
-
function isEditTargetGone(err) {
|
|
89
|
-
const msg = errorMessage(err).toLowerCase();
|
|
90
|
-
return msg.includes("message_not_found") || msg.includes("message not found") || msg.includes("not exist");
|
|
91
|
-
}
|
|
92
|
-
function errorMessage(err) {
|
|
93
|
-
if (!err) return "";
|
|
94
|
-
if (err instanceof Error) return err.message;
|
|
95
|
-
return String(err);
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { createFeishuWorkflowProgressCapability };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Telegram capability for the {@link WorkflowProgressBroker}.
|
|
3
|
-
*
|
|
4
|
-
* Strategy: send the first progress update as a fresh message, then edit it in
|
|
5
|
-
* place on every subsequent update. The broker enforces per-channel throttle
|
|
6
|
-
* (default 5 s) and bypasses it for key events (phase change / new error /
|
|
7
|
-
* tool_end), so users always see milestones promptly without us hammering
|
|
8
|
-
* Telegram's edit rate limit.
|
|
9
|
-
*
|
|
10
|
-
* Failure handling is intentionally narrow:
|
|
11
|
-
* - `message is not modified` from `editMessageText` → swallow (it's a
|
|
12
|
-
* no-op the broker shouldn't retry).
|
|
13
|
-
* - Lost / inaccessible message during edit → fall back to a new send so
|
|
14
|
-
* the user always sees the latest snapshot.
|
|
15
|
-
* - 429 / network → bubble up, broker logs and drops the update; the next
|
|
16
|
-
* scheduled (or key) tick will retry.
|
|
17
|
-
*
|
|
18
|
-
* We deliberately use plain text (no parse_mode) — the snapshot renderer
|
|
19
|
-
* emits ASCII-friendly output and we don't want HTML/markdown surprises with
|
|
20
|
-
* `<` in agent labels or shell-style payloads.
|
|
21
|
-
*/
|
|
22
|
-
import type { ChannelProgressCapability } from '@xopcai/xopc/agent/workflow/channel-capability.js';
|
|
23
|
-
import type { TelegramAccountManager } from './account-manager.js';
|
|
24
|
-
export declare function createTelegramWorkflowProgressCapability(accountManager: TelegramAccountManager): ChannelProgressCapability;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../../../src/utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../../../src/utils/logger.js";
|
|
3
|
-
import { getConversationRouting } from "../../../src/storage/sqlite/conversation-repository.js";
|
|
4
|
-
import { init_session_key } from "../../../src/routing/session-key.js";
|
|
5
|
-
//#region extensions/telegram/src/workflow-progress.ts
|
|
6
|
-
init_session_key();
|
|
7
|
-
init_logger();
|
|
8
|
-
const log = createLogger("TelegramWorkflowProgress");
|
|
9
|
-
/** Telegram bot API: 4096 char hard cap; leave 96 chars of headroom for re-renders. */
|
|
10
|
-
const TELEGRAM_TEXT_MAX = 4e3;
|
|
11
|
-
/** Telegram bot edit rate ≈ 1/s per chat; broker default 5 s leaves ample headroom. */
|
|
12
|
-
const DEFAULT_THROTTLE_MS = 5e3;
|
|
13
|
-
function createTelegramWorkflowProgressCapability(accountManager) {
|
|
14
|
-
return {
|
|
15
|
-
channelId: "telegram",
|
|
16
|
-
supportsEdit: true,
|
|
17
|
-
defaultThrottleMs: DEFAULT_THROTTLE_MS,
|
|
18
|
-
defaultMode: "edit",
|
|
19
|
-
async postProgress(input) {
|
|
20
|
-
const target = resolveTarget(input.conversationId);
|
|
21
|
-
if (!target) throw new Error(`telegram workflow progress: cannot route conversationId "${input.conversationId}"`);
|
|
22
|
-
const bot = accountManager.getBot(target.accountId);
|
|
23
|
-
if (!bot) throw new Error(`telegram workflow progress: no bot for accountId "${target.accountId}" (conversationId "${input.conversationId}")`);
|
|
24
|
-
const text = clampForTelegram(input.text);
|
|
25
|
-
if (input.previousMessageId && !input.isFinal) try {
|
|
26
|
-
await bot.api.editMessageText(target.chatId, Number(input.previousMessageId), text);
|
|
27
|
-
return { messageId: input.previousMessageId };
|
|
28
|
-
} catch (err) {
|
|
29
|
-
if (isMessageNotModified(err)) return { messageId: input.previousMessageId };
|
|
30
|
-
if (isEditTargetGone(err)) log.debug({
|
|
31
|
-
conversationId: input.conversationId,
|
|
32
|
-
previousMessageId: input.previousMessageId
|
|
33
|
-
}, "edit target gone; falling back to sendMessage");
|
|
34
|
-
else throw err;
|
|
35
|
-
}
|
|
36
|
-
const sent = await bot.api.sendMessage(target.chatId, text, {
|
|
37
|
-
message_thread_id: target.threadId ? Number(target.threadId) : void 0,
|
|
38
|
-
disable_notification: !input.isFinal
|
|
39
|
-
});
|
|
40
|
-
return { messageId: String(sent.message_id) };
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function resolveTarget(conversationId) {
|
|
45
|
-
const parsed = getConversationRouting(conversationId);
|
|
46
|
-
if (!parsed) return null;
|
|
47
|
-
if (parsed.source !== "telegram") return null;
|
|
48
|
-
if (!parsed.peerId) return null;
|
|
49
|
-
return {
|
|
50
|
-
accountId: parsed.accountId,
|
|
51
|
-
chatId: parsed.peerId,
|
|
52
|
-
threadId: parsed.threadId
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function clampForTelegram(text) {
|
|
56
|
-
if (text.length <= TELEGRAM_TEXT_MAX) return text;
|
|
57
|
-
return `${text.slice(0, TELEGRAM_TEXT_MAX - 1)}…`;
|
|
58
|
-
}
|
|
59
|
-
function isMessageNotModified(err) {
|
|
60
|
-
return errorMessage(err).toLowerCase().includes("message is not modified");
|
|
61
|
-
}
|
|
62
|
-
function isEditTargetGone(err) {
|
|
63
|
-
const msg = errorMessage(err).toLowerCase();
|
|
64
|
-
return msg.includes("message to edit not found") || msg.includes("message can't be edited") || msg.includes("chat not found");
|
|
65
|
-
}
|
|
66
|
-
function errorMessage(err) {
|
|
67
|
-
if (!err) return "";
|
|
68
|
-
if (err instanceof Error) return err.message;
|
|
69
|
-
return String(err);
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
export { createTelegramWorkflowProgressCapability };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WeChat capability for the workflow progress broker.
|
|
3
|
-
*
|
|
4
|
-
* WeChat (ilink/personal account) does not expose an "edit message" API for
|
|
5
|
-
* bot replies, so live edit-in-place — what Telegram and Feishu do — is
|
|
6
|
-
* structurally impossible. Trying to fake it with a `append` mode would
|
|
7
|
-
* spam the chat with one message per tick, which violates the social
|
|
8
|
-
* properties of the surface ("Don't @ me twenty times").
|
|
9
|
-
*
|
|
10
|
-
* Strategy: **final-only**. The broker silently drops every mid-run update;
|
|
11
|
-
* when `tool_end` fires, the broker calls us once with `isFinal: true` and
|
|
12
|
-
* the full final snapshot rendered as text. The user sees a single
|
|
13
|
-
* tasteful summary at the end.
|
|
14
|
-
*
|
|
15
|
-
* Routing: conversationId `agent:main:weixin:<accountId>:direct:<ilinkUserId>`. We need a
|
|
16
|
-
* valid `contextToken` for the recipient — which requires the user to have
|
|
17
|
-
* recently messaged the bot (the token is harvested from inbound). If
|
|
18
|
-
* missing, we throw and the broker logs; the run still completes, just
|
|
19
|
-
* without a WeChat notification. This is consistent with how other WeChat
|
|
20
|
-
* outbound paths behave.
|
|
21
|
-
*/
|
|
22
|
-
import type { ChannelProgressCapability } from '@xopcai/xopc/agent/workflow/channel-capability.js';
|
|
23
|
-
import type { Config } from '@xopcai/xopc/config/schema.js';
|
|
24
|
-
export declare function createWeixinWorkflowProgressCapability(opts: {
|
|
25
|
-
getConfig: () => Config | undefined;
|
|
26
|
-
}): ChannelProgressCapability;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../../../src/utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../../../src/utils/logger.js";
|
|
3
|
-
import { getConversationRouting } from "../../../src/storage/sqlite/conversation-repository.js";
|
|
4
|
-
import { init_session_key } from "../../../src/routing/session-key.js";
|
|
5
|
-
import { getContextToken } from "./messaging/inbound.js";
|
|
6
|
-
import { resolveWeixinAccount } from "./auth/accounts.js";
|
|
7
|
-
import { sendMessageWeixin } from "./messaging/send.js";
|
|
8
|
-
import { ensureWeixinContextTokenForOutbound } from "./messaging/context-token-init.js";
|
|
9
|
-
//#region extensions/weixin/src/workflow-progress.ts
|
|
10
|
-
init_session_key();
|
|
11
|
-
init_logger();
|
|
12
|
-
const log = createLogger("WeixinWorkflowProgress");
|
|
13
|
-
const WEIXIN_TEXT_MAX = 4e3;
|
|
14
|
-
/**
|
|
15
|
-
* Conservative throttle — only enforced when the user overrides the default
|
|
16
|
-
* `final-only` mode to `append`. Set so back-to-back workflows can't spam.
|
|
17
|
-
*/
|
|
18
|
-
const DEFAULT_THROTTLE_MS = 6e4;
|
|
19
|
-
function createWeixinWorkflowProgressCapability(opts) {
|
|
20
|
-
return {
|
|
21
|
-
channelId: "weixin",
|
|
22
|
-
supportsEdit: false,
|
|
23
|
-
defaultThrottleMs: DEFAULT_THROTTLE_MS,
|
|
24
|
-
defaultMode: "final-only",
|
|
25
|
-
async postProgress(input) {
|
|
26
|
-
const cfg = opts.getConfig();
|
|
27
|
-
if (!cfg) throw new Error("weixin workflow progress: no config loaded");
|
|
28
|
-
const target = resolveTarget(input.conversationId);
|
|
29
|
-
if (!target) throw new Error(`weixin workflow progress: cannot route conversationId "${input.conversationId}"`);
|
|
30
|
-
let account;
|
|
31
|
-
try {
|
|
32
|
-
account = resolveWeixinAccount(cfg, target.accountId);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
throw new Error(`weixin workflow progress: cannot resolve account "${target.accountId}": ${errorMessage(err)}`);
|
|
35
|
-
}
|
|
36
|
-
if (!account.configured || !account.token) throw new Error(`weixin workflow progress: account "${target.accountId}" not configured / logged in`);
|
|
37
|
-
let ctxTok = getContextToken(account.accountId, target.to)?.trim();
|
|
38
|
-
if (!ctxTok) ctxTok = (await ensureWeixinContextTokenForOutbound(account.accountId, target.to, account))?.trim();
|
|
39
|
-
if (!ctxTok) {
|
|
40
|
-
log.debug({
|
|
41
|
-
conversationId: input.conversationId,
|
|
42
|
-
accountId: account.accountId
|
|
43
|
-
}, "no context token for recipient; skipping workflow progress send");
|
|
44
|
-
return { messageId: "" };
|
|
45
|
-
}
|
|
46
|
-
const text = clampForWeixin(decorateForWeixin(input.text, input.mode, input.isFinal));
|
|
47
|
-
return { messageId: (await sendMessageWeixin({
|
|
48
|
-
to: target.to,
|
|
49
|
-
text,
|
|
50
|
-
opts: {
|
|
51
|
-
baseUrl: account.baseUrl,
|
|
52
|
-
token: account.token,
|
|
53
|
-
routeTag: account.routeTag,
|
|
54
|
-
contextToken: ctxTok
|
|
55
|
-
}
|
|
56
|
-
})).messageId };
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function resolveTarget(conversationId) {
|
|
61
|
-
const parsed = getConversationRouting(conversationId);
|
|
62
|
-
if (!parsed) return null;
|
|
63
|
-
if (parsed.source !== "weixin") return null;
|
|
64
|
-
if (!parsed.peerId) return null;
|
|
65
|
-
return {
|
|
66
|
-
accountId: parsed.accountId || "default",
|
|
67
|
-
to: parsed.peerId
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
function clampForWeixin(text) {
|
|
71
|
-
if (text.length <= WEIXIN_TEXT_MAX) return text;
|
|
72
|
-
return `${text.slice(0, WEIXIN_TEXT_MAX - 1)}…`;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Add a one-line header on append-mode messages so the user can tell mid-run
|
|
76
|
-
* snapshots apart from the final summary — WeChat has no editMessage, so they
|
|
77
|
-
* pile up as separate messages and look identical without a marker.
|
|
78
|
-
*
|
|
79
|
-
* - `final-only` mode: no header (default; one summary message per run).
|
|
80
|
-
* - `append` mode + mid-run: "▾ 工作流进展" header so the user knows more
|
|
81
|
-
* updates are coming.
|
|
82
|
-
* - `append` mode + final: "✓ 工作流完成" header to mark the conclusion.
|
|
83
|
-
*
|
|
84
|
-
* `edit` mode is never reached on WeChat (`supportsEdit: false`), so we don't
|
|
85
|
-
* branch on it. Unknown / missing mode falls through to no header — safe
|
|
86
|
-
* default for hand-rolled callers and tests.
|
|
87
|
-
*/
|
|
88
|
-
function decorateForWeixin(text, mode, isFinal) {
|
|
89
|
-
if (mode !== "append") return text;
|
|
90
|
-
return `${isFinal ? "✓ 工作流完成" : "▾ 工作流进展"}\n${text}`;
|
|
91
|
-
}
|
|
92
|
-
function errorMessage(err) {
|
|
93
|
-
if (!err) return "";
|
|
94
|
-
if (err instanceof Error) return err.message;
|
|
95
|
-
return String(err);
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { createWeixinWorkflowProgressCapability };
|