@xopcai/xopc 0.0.409 → 0.0.411
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-sGJnq-SA.js +1 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BI7OTo-T.js +1 -0
- package/dist/gateway/static/root/assets/agents-RIXL0p7_.js +77 -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/app-management-settings-panel-BGzhSS6H.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-Dzhmj_ZO.js → appearance-settings-DtEZq4b2.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DZqBof2D.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D4r4P5uG.js → archive-plugin-CGdU_E5B.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-BlNe3DXU.js → automations-page-BAPZY56r.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CI-yQnSj.js +8 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DuN5L6lm.js → binary-plugins-B0ispXo2.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DUSVn51h.js → block-editor-B9Ci-prO.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-Xzdif447.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-Bhu-83eC.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-B9b5KCBb.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-BIc0Zlsw.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CQEfpLdj.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-oBPqUlbj.js → capability-header-actions-Cic05oWh.js} +1 -1
- package/dist/gateway/static/root/assets/channels-DQbEoo_o.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BLs3NaOP.js → chat-terminal-dock-Bm-IGeDe.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-C9xMfwXK.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-DcdASUU9.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-eh-xpMPK.js +1 -0
- package/dist/gateway/static/root/assets/date-formatters-DukWSVwc.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-DVlbwrYg.js → date-picker-gVLWu9R0.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-C0LARyok.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-B_-j-D4W.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-v_le3sCs.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-CxG_FcQ6.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-QZ0p-uNa.js → directory-picker-path-field-CBefVUPR.js} +1 -1
- package/dist/gateway/static/root/assets/electron-env-Dit0bHgy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DoVPUHu_.js → extension-debug-page-CTe7Molh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BNe8n3iJ.js → extension-page-C0-oP7S_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DxNpjGJD.js → extension-settings-page-DYJmgMUg.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-C13P4lQd.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-CslBKXdS.js +1 -0
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DrZq5KTj.js → highlighted-body-KQOG7T2V-CN5PNRN3.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-B_XrkGmA.js +2 -0
- package/dist/gateway/static/root/assets/image-generation-api-DRLXG9Ws.js +1 -0
- package/dist/gateway/static/root/assets/imports-page--cuF5vwU.js +1 -0
- package/dist/gateway/static/root/assets/index-6YjAt50A.js +710 -0
- package/dist/gateway/static/root/assets/index-caRW34rg.css +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-5g2PxgBs.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-B6U1HQpp.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-BChE6nUD.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-B9mq03SK.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-2W_qJsha.js +1 -0
- package/dist/gateway/static/root/assets/markdown-editor-phTQ0mox.js +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-s6EqtAUQ.js → media-plugins-BmLuWkkZ.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-61Il2HQR.js +1 -0
- package/dist/gateway/static/root/assets/messages-DMXSIJUO.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C4gZsNBL.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-XqJIaaRV.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-Chdwrjni.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-B7rDRlS7.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-mQl9BftY.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-FvwSxZPB.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-Z4NM7_Dn.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-BPWSqtRt.js → product-open-page-C5TcIaJj.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-content-5xID6jIj.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-CGOyx7zX.js +7 -0
- package/dist/gateway/static/root/assets/projects-page-Dd11tbRX.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-Bintk9nL.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-CNCx2RnO.js → runtime-tools-settings-panel-CbmiiLsq.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-nRDA2XfI.js → schema-form-DtPkiYwm.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-BBlEP7y3.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BCQUth4g.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-_ALUREPr.js → settings-form-section-DD3iD5t5.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-29ptuMYZ.js → settings-page-iLY3LRDq.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-v4P0IAkG.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-B8h9lqDL.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DMzej6z2.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-C-T0K7Oo.js → skill-api-C9RsrvOp.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B20x7EE9.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-C_ulsnv7.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-PTRGMKkq.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DEPwo4vf.js +2 -0
- package/dist/gateway/static/root/assets/task-result-evidence-DjNWPpn_.js +1 -0
- package/dist/gateway/static/root/assets/tasks-TVRjEggr.js +1 -0
- package/dist/gateway/static/root/assets/tracing-settings-page-CVJt7IXC.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DcDUSAjv.js → tunnel-api-C6XfsSWy.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Hut0SDqn.js → usage-page-DgqLD8Y5.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C4TUlpsu.js → use-autosave-DO-Twmbm.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BwK37aob.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-CMdihbPb.js → voice-api-key-field-MGe3HkS_.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-DptHqYh5.js +1 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-ClQKM2RA.js → xopc-cloud-account-card-Y_UIryBH.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/prompts.d.ts +8 -0
- package/dist/src/agent/background-review/prompts.js +9 -2
- package/dist/src/agent/background-review/run-background-review.js +73 -11
- 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/inbound/attachment-pipeline.d.ts +2 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +10 -5
- 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 +21 -10
- 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.d.ts +3 -0
- package/dist/src/agent/tools/session-recall-tool.js +7 -0
- package/dist/src/agent/tools/session-search-tool.d.ts +3 -0
- package/dist/src/agent/tools/session-search-tool.js +20 -4
- 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-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 +3 -6
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/loader.d.ts +0 -1
- package/dist/src/config/loader.js +1 -13
- 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 +20 -67
- 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/repository.d.ts +3 -1
- package/dist/src/knowledge-memory/repository.js +10 -3
- 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.d.ts +14 -0
- package/dist/src/memory-learning/forget-capture.js +101 -0
- package/dist/src/memory-learning/forgotten-history.d.ts +15 -0
- package/dist/src/memory-learning/forgotten-history.js +137 -0
- 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/memory-learning/work-capture.js +2 -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/store.d.ts +1 -0
- 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/fts.d.ts +4 -0
- package/dist/src/storage/sqlite/fts.js +13 -4
- 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 +10 -36
- package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/transcript-repository.js +14 -12
- 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/capture/semantic.d.ts +18 -1
- package/dist/src/user-model/capture/semantic.js +26 -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-lMrejpsz.js +0 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-lXwR3Rff.js +0 -1
- package/dist/gateway/static/root/assets/agents-DFwBf95X.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-Cja3eV7H.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-C3xbCdYa.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CWvHbJBK.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-BtvOURHQ.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-C_OeE79S.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-CD6PzNK7.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-BKF6q_tC.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B7qOaUZs.js +0 -8
- package/dist/gateway/static/root/assets/channels-3M9-anCN.js +0 -1
- package/dist/gateway/static/root/assets/code-editor-CXIH8jQw.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-LaekhDG6.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-DJP1n1_n.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DmQqMy6l.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BhElpD_6.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-ByvV-cDD.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BBruQu-_.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-C3zOy8PO.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-CzrFZ0lB.js +0 -1
- package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +0 -1
- package/dist/gateway/static/root/assets/home-page-cXmd8x0S.js +0 -2
- package/dist/gateway/static/root/assets/image-generation-api-C6su4n9B.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-CsXYryWS.js +0 -1
- package/dist/gateway/static/root/assets/index-BZlryZm8.css +0 -1
- package/dist/gateway/static/root/assets/index-uAJlrGvo.js +0 -267
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-GYKLt0oF.js +0 -1
- package/dist/gateway/static/root/assets/languages-BFe8nIOO.js +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dw-i6VkX.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-page-DslilwNE.js +0 -1
- package/dist/gateway/static/root/assets/locale-store-D_migb9R.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-4N8bGPIE.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-CPmxI1k0.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-Ba-WQCki.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-CjTm5gxS.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-hbSbEEfN.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-DkESStKc.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-eyzTNrCe.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-DZxbFQvF.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-BjVLbxZM.js +0 -1
- package/dist/gateway/static/root/assets/plus-Q2yW6OE7.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-7pUtUL4O.js +0 -1
- package/dist/gateway/static/root/assets/product-delivery-DwmnNJvk.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-COo4zwp9.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CrIH6nEy.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D4swvBmH.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DltfIMtv.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-CfYU53aw.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BJBoWYbO.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DZgVMRXr.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-C2LHd_Nl.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-C5MTc6t-.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BcdA9ezU.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BMw8XbKL.js +0 -2
- package/dist/gateway/static/root/assets/source-workspace-editor-DunRD1gY.js +0 -1
- package/dist/gateway/static/root/assets/style-DR0-RKaL.js +0 -7
- package/dist/gateway/static/root/assets/system-settings-panel-2Kr9Y-FJ.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-7kPco8Ys.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-D53wxq60.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-KRy50OBd.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-Bd9HLsds.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-C9mAiHBd.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-CGg4GWwt.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
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region src/agent/workflow/step-labels.ts
|
|
2
|
-
/**
|
|
3
|
-
* Human-readable labels for workflow subagent tool steps (server-side snapshot).
|
|
4
|
-
* Mirrors the web `tool-friendly-title` rules so IM/TUI and gateway stay aligned.
|
|
5
|
-
*/
|
|
6
|
-
const MAX_DETAIL_LEN = 120;
|
|
7
|
-
function workflowStepLabel(toolName, args) {
|
|
8
|
-
const n = toolName.toLowerCase().replace(/-/g, "_").trim();
|
|
9
|
-
let label = toolName.trim() || "tool";
|
|
10
|
-
if (n === "exec_command") label = "Run command";
|
|
11
|
-
else if (n === "update_plan") label = "Update plan";
|
|
12
|
-
else if (n === "list_dir" || n === "ls") label = "List directory";
|
|
13
|
-
else if (n === "write_file") label = "Write file";
|
|
14
|
-
else if (n === "apply_patch") label = "Edit file";
|
|
15
|
-
else if (n === "web_fetch") label = "Fetch URL";
|
|
16
|
-
else if (n === "open_url") label = "Open URL";
|
|
17
|
-
else if (n === "grep" || n === "rg" || n === "file_grep") label = "Search files";
|
|
18
|
-
else if (n === "web_search" || n === "brave_search" || n.includes("search")) label = "Search web";
|
|
19
|
-
else if (n === "read_file" || n.includes("read_file") || n.includes("file_read")) label = "Read file";
|
|
20
|
-
else if (n === "delegate_task" || n === "workflow") label = toolName;
|
|
21
|
-
const detail = extractStepDetail(n, args);
|
|
22
|
-
return detail ? {
|
|
23
|
-
label,
|
|
24
|
-
detail
|
|
25
|
-
} : { label };
|
|
26
|
-
}
|
|
27
|
-
function extractStepDetail(toolKey, args) {
|
|
28
|
-
for (const key of [
|
|
29
|
-
"path",
|
|
30
|
-
"file_path",
|
|
31
|
-
"filePath",
|
|
32
|
-
"target_file",
|
|
33
|
-
"targetFile"
|
|
34
|
-
]) {
|
|
35
|
-
const v = args[key];
|
|
36
|
-
if (typeof v === "string" && v.trim()) return truncate(v.trim());
|
|
37
|
-
}
|
|
38
|
-
if (toolKey === "exec_command") {
|
|
39
|
-
const command = typeof args.cmd === "string" ? args.cmd : typeof args.command === "string" ? args.command : "";
|
|
40
|
-
if (command.trim()) return truncate(command.trim());
|
|
41
|
-
}
|
|
42
|
-
if ((toolKey.includes("search") || toolKey === "grep" || toolKey === "rg" || toolKey === "file_grep") && typeof args.query === "string" && args.query.trim()) return truncate(args.query.trim());
|
|
43
|
-
if (typeof args.url === "string" && args.url.trim()) return truncate(args.url.trim());
|
|
44
|
-
}
|
|
45
|
-
function truncate(text) {
|
|
46
|
-
if (text.length <= MAX_DETAIL_LEN) return text;
|
|
47
|
-
return `${text.slice(0, MAX_DETAIL_LEN - 1)}…`;
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
export { workflowStepLabel };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `structured_output` — terminating tool used to capture a subagent's final result.
|
|
3
|
-
*
|
|
4
|
-
* Injected into a workflow agent node only when its output schema requires
|
|
5
|
-
* structured data. The subagent is instructed
|
|
6
|
-
* to invoke this tool exactly once with its final result; the tool sets
|
|
7
|
-
* `terminate: true` so the agent loop stops without paying for an extra
|
|
8
|
-
* assistant turn.
|
|
9
|
-
*
|
|
10
|
-
* Validation is done with ajv (already a xopc dep). pi-agent-core also validates
|
|
11
|
-
* arguments against `parameters` before calling `execute`, but we re-check here
|
|
12
|
-
* to (1) surface a clear error message back to the model when the schema is
|
|
13
|
-
* non-trivial, and (2) avoid trusting the upstream layer's validator strictness.
|
|
14
|
-
*
|
|
15
|
-
* Note: the file is named `structured-output-tool.ts` to avoid clashing with the
|
|
16
|
-
* existing `src/agent/tools/structured-output.ts` (an XML Element builder — a
|
|
17
|
-
* completely unrelated utility).
|
|
18
|
-
*/
|
|
19
|
-
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
20
|
-
import type { TSchema } from '@sinclair/typebox';
|
|
21
|
-
import type { JsonSchema } from './types.js';
|
|
22
|
-
export declare const STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
|
|
23
|
-
export interface StructuredOutputCapture<T = unknown> {
|
|
24
|
-
called: boolean;
|
|
25
|
-
value?: T;
|
|
26
|
-
}
|
|
27
|
-
export interface CreateStructuredOutputToolOptions<T = unknown> {
|
|
28
|
-
schema: JsonSchema;
|
|
29
|
-
capture: StructuredOutputCapture<T>;
|
|
30
|
-
/** Override the tool name (rarely needed; default `structured_output`). */
|
|
31
|
-
name?: string;
|
|
32
|
-
}
|
|
33
|
-
export declare function createStructuredOutputTool<T = unknown>(options: CreateStructuredOutputToolOptions<T>): AgentTool<TSchema, T>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import Ajv from "ajv";
|
|
2
|
-
//#region src/agent/workflow/structured-output-tool.ts
|
|
3
|
-
/**
|
|
4
|
-
* `structured_output` — terminating tool used to capture a subagent's final result.
|
|
5
|
-
*
|
|
6
|
-
* Injected into a workflow agent node only when its output schema requires
|
|
7
|
-
* structured data. The subagent is instructed
|
|
8
|
-
* to invoke this tool exactly once with its final result; the tool sets
|
|
9
|
-
* `terminate: true` so the agent loop stops without paying for an extra
|
|
10
|
-
* assistant turn.
|
|
11
|
-
*
|
|
12
|
-
* Validation is done with ajv (already a xopc dep). pi-agent-core also validates
|
|
13
|
-
* arguments against `parameters` before calling `execute`, but we re-check here
|
|
14
|
-
* to (1) surface a clear error message back to the model when the schema is
|
|
15
|
-
* non-trivial, and (2) avoid trusting the upstream layer's validator strictness.
|
|
16
|
-
*
|
|
17
|
-
* Note: the file is named `structured-output-tool.ts` to avoid clashing with the
|
|
18
|
-
* existing `src/agent/tools/structured-output.ts` (an XML Element builder — a
|
|
19
|
-
* completely unrelated utility).
|
|
20
|
-
*/
|
|
21
|
-
const STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
|
|
22
|
-
const ajv = new Ajv({
|
|
23
|
-
allErrors: true,
|
|
24
|
-
strict: false
|
|
25
|
-
});
|
|
26
|
-
function createStructuredOutputTool(options) {
|
|
27
|
-
const name = options.name ?? "structured_output";
|
|
28
|
-
const validator = ajv.compile(options.schema);
|
|
29
|
-
return {
|
|
30
|
-
name,
|
|
31
|
-
label: "Structured Output",
|
|
32
|
-
description: "Return the final machine-readable result for this subagent task. Call this tool exactly once when finished. Do not emit a prose final answer afterwards.",
|
|
33
|
-
parameters: options.schema,
|
|
34
|
-
async execute(_toolCallId, params) {
|
|
35
|
-
if (!validator(params)) return {
|
|
36
|
-
content: [{
|
|
37
|
-
type: "text",
|
|
38
|
-
text: `structured_output: invalid arguments — ${ajv.errorsText(validator.errors, { separator: "; " })}. Adjust and call structured_output again.`
|
|
39
|
-
}],
|
|
40
|
-
details: params
|
|
41
|
-
};
|
|
42
|
-
options.capture.called = true;
|
|
43
|
-
options.capture.value = params;
|
|
44
|
-
return {
|
|
45
|
-
content: [{
|
|
46
|
-
type: "text",
|
|
47
|
-
text: "Structured output received."
|
|
48
|
-
}],
|
|
49
|
-
details: params,
|
|
50
|
-
terminate: true
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
export { STRUCTURED_OUTPUT_TOOL_NAME, createStructuredOutputTool };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter: spawns one isolated child agent per `agent()` call from a workflow.
|
|
3
|
-
*
|
|
4
|
-
* Wraps the existing `createDelegateChildHandle` so the workflow runtime stays
|
|
5
|
-
* decoupled from the LLM stack (it sees only the `SubagentRunner` interface).
|
|
6
|
-
*
|
|
7
|
-
* Key behaviour:
|
|
8
|
-
* - When `opts.schema` is provided, we inject `structured_output` into the child
|
|
9
|
-
* tool set and unwrap the captured value on success. If the subagent finishes
|
|
10
|
-
* without ever calling `structured_output`, we treat it as failure (`null`).
|
|
11
|
-
* - Failures and aborts resolve to `null`. The workflow runtime continues — this
|
|
12
|
-
* matches the pi-dynamic-workflows contract and keeps fan-out pipelines robust.
|
|
13
|
-
*/
|
|
14
|
-
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
15
|
-
import type { Api, Model } from '@earendil-works/pi-ai';
|
|
16
|
-
import type { Config } from '../../config/schema.js';
|
|
17
|
-
import type { MessageBus } from '../../infra/bus/index.js';
|
|
18
|
-
import type { SessionStore } from '../../session/store.js';
|
|
19
|
-
import { type BuildChildToolsOptions } from '../child-agent-factory.js';
|
|
20
|
-
import type { ToolExecutorConfig } from '../tools/executor.js';
|
|
21
|
-
import type { SubagentRunOptions, SubagentRunner } from './types.js';
|
|
22
|
-
export interface DelegateSubagentRunnerDeps {
|
|
23
|
-
isWorkspaceTrusted?: (workspaceDir: string) => boolean | null | undefined;
|
|
24
|
-
workspace: string;
|
|
25
|
-
bus: MessageBus;
|
|
26
|
-
agentId?: string;
|
|
27
|
-
/** Resolves the default subagent model (typically the parent agent's primary model). */
|
|
28
|
-
getDefaultModel: () => Model<Api>;
|
|
29
|
-
getConfig: () => Config | undefined;
|
|
30
|
-
toolExecutorConfig?: Partial<ToolExecutorConfig>;
|
|
31
|
-
sessionStore?: SessionStore;
|
|
32
|
-
/**
|
|
33
|
-
* Provided by the workflow tool from `AgentToolsFactory` — mirrors how
|
|
34
|
-
* `delegate-tool` is wired (avoids importing `tools/factory.ts` here and
|
|
35
|
-
* breaking the existing factory ↔ delegate-tool ↔ child-agent-factory
|
|
36
|
-
* dependency contract).
|
|
37
|
-
*/
|
|
38
|
-
buildChildTools: (opts: BuildChildToolsOptions) => AgentTool<any, any>[];
|
|
39
|
-
}
|
|
40
|
-
export declare class DelegateSubagentRunner implements SubagentRunner {
|
|
41
|
-
private readonly deps;
|
|
42
|
-
constructor(deps: DelegateSubagentRunnerDeps);
|
|
43
|
-
run<T = string>(prompt: string, opts: SubagentRunOptions<T>): Promise<T | null>;
|
|
44
|
-
private preparePersistentSubagentSession;
|
|
45
|
-
}
|
|
46
|
-
export declare function resolveAllowedToolNames(requested: string[] | undefined, wantStructured: boolean): string[];
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../../utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { createSqliteTranscriptRuntime } from "../embedded/transcript-runtime.js";
|
|
4
|
-
import { createDelegateChildHandle } from "../child-agent-factory.js";
|
|
5
|
-
import { DELEGATION_TOOL_CAPABILITIES, protectDelegatedTool, resolveDelegationTools } from "../tools/delegation-policy.js";
|
|
6
|
-
import { DELEGATE_BLOCKED_TOOLS } from "../tools/delegate-tool.js";
|
|
7
|
-
import { createNoninteractiveToolPolicy } from "../tools/noninteractive-tool-policy.js";
|
|
8
|
-
import { STRUCTURED_OUTPUT_TOOL_NAME, createStructuredOutputTool } from "./structured-output-tool.js";
|
|
9
|
-
//#region src/agent/workflow/subagent-runner.ts
|
|
10
|
-
init_logger();
|
|
11
|
-
const log = createLogger("Agent:WorkflowSubagent");
|
|
12
|
-
const DEFAULT_MAX_ITERATIONS = 30;
|
|
13
|
-
var DelegateSubagentRunner = class {
|
|
14
|
-
constructor(deps) {
|
|
15
|
-
this.deps = deps;
|
|
16
|
-
}
|
|
17
|
-
async run(prompt, opts) {
|
|
18
|
-
if (opts.signal?.aborted) return null;
|
|
19
|
-
const capture = {
|
|
20
|
-
called: false,
|
|
21
|
-
value: void 0
|
|
22
|
-
};
|
|
23
|
-
const wantStructured = Boolean(opts.schema);
|
|
24
|
-
const allowed = resolveAllowedToolNames(opts.allowedToolNames, wantStructured);
|
|
25
|
-
const model = opts.model ?? safeResolveDefaultModel(this.deps.getDefaultModel);
|
|
26
|
-
if (!model) {
|
|
27
|
-
log.warn({ label: opts.label }, "subagent run skipped: no primary model resolved");
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const fullPrompt = buildPrompt(prompt, opts, wantStructured);
|
|
31
|
-
const streamMode = resolveSubagentStreamMode(this.deps.getConfig);
|
|
32
|
-
const childOptions = {
|
|
33
|
-
isWorkspaceTrusted: this.deps.isWorkspaceTrusted,
|
|
34
|
-
workspace: this.deps.workspace,
|
|
35
|
-
goal: fullPrompt,
|
|
36
|
-
requesterConversationId: opts.sessionMetadata?.parentConversationId,
|
|
37
|
-
allowedToolNames: allowed,
|
|
38
|
-
isComplete: wantStructured ? () => capture.called : void 0,
|
|
39
|
-
maxIterations: opts.maxIterations ?? DEFAULT_MAX_ITERATIONS,
|
|
40
|
-
model,
|
|
41
|
-
bus: this.deps.bus,
|
|
42
|
-
agentId: this.deps.agentId,
|
|
43
|
-
getConfig: this.deps.getConfig,
|
|
44
|
-
toolExecutorConfig: this.deps.toolExecutorConfig,
|
|
45
|
-
authorizeToolCall: createNoninteractiveToolPolicy({
|
|
46
|
-
getConfig: this.deps.getConfig,
|
|
47
|
-
agentId: this.deps.agentId
|
|
48
|
-
}).beforeToolCall,
|
|
49
|
-
buildChildTools: (childOpts) => {
|
|
50
|
-
const candidates = this.deps.buildChildTools({
|
|
51
|
-
...childOpts,
|
|
52
|
-
agentId: this.deps.agentId ?? childOpts.agentId
|
|
53
|
-
});
|
|
54
|
-
const access = resolveDelegationTools(candidates.map((tool) => tool.name), "custom", opts.allowedToolNames, [
|
|
55
|
-
"local_read",
|
|
56
|
-
"web_read",
|
|
57
|
-
"knowledge_read",
|
|
58
|
-
"skills_read",
|
|
59
|
-
"external_read",
|
|
60
|
-
...opts.allowedToolNames?.includes("browser_use") ? ["browser"] : []
|
|
61
|
-
]);
|
|
62
|
-
if (access.rejected.length) throw new Error(`Workflow delegation rejected tools: ${JSON.stringify(access.rejected)}. Use delegate_task implement for isolated writes and commands.`);
|
|
63
|
-
const granted = new Set(access.granted);
|
|
64
|
-
const base = candidates.filter((tool) => granted.has(tool.name)).map(protectDelegatedTool);
|
|
65
|
-
if (!wantStructured || !opts.schema) return base;
|
|
66
|
-
return [...base.filter((t) => t.name !== STRUCTURED_OUTPUT_TOOL_NAME), createStructuredOutputTool({
|
|
67
|
-
schema: opts.schema,
|
|
68
|
-
capture
|
|
69
|
-
})];
|
|
70
|
-
},
|
|
71
|
-
progressHooks: opts.onProgress && streamMode !== "off" ? {
|
|
72
|
-
mode: streamMode === "full" ? "full" : "steps",
|
|
73
|
-
onProgress: (event) => {
|
|
74
|
-
opts.onProgress?.(mapChildProgressEvent(event));
|
|
75
|
-
}
|
|
76
|
-
} : void 0
|
|
77
|
-
};
|
|
78
|
-
if (opts.conversationId && opts.sessionMetadata && this.deps.sessionStore) {
|
|
79
|
-
await this.preparePersistentSubagentSession(opts.conversationId, opts.sessionMetadata);
|
|
80
|
-
childOptions.conversationId = opts.conversationId;
|
|
81
|
-
childOptions.transcriptRuntime = await createSqliteTranscriptRuntime({
|
|
82
|
-
conversationId: opts.conversationId,
|
|
83
|
-
sessionStore: this.deps.sessionStore
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const handle = createDelegateChildHandle(childOptions);
|
|
87
|
-
const onAbort = () => handle.abort();
|
|
88
|
-
opts.signal?.addEventListener("abort", onAbort, { once: true });
|
|
89
|
-
try {
|
|
90
|
-
const { summary, status } = await handle.run();
|
|
91
|
-
if (status !== "success") return null;
|
|
92
|
-
if (opts.signal?.aborted) return null;
|
|
93
|
-
if (wantStructured) {
|
|
94
|
-
if (!capture.called) {
|
|
95
|
-
log.warn({ label: opts.label }, "subagent finished without calling structured_output");
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
return capture.value;
|
|
99
|
-
}
|
|
100
|
-
return summary;
|
|
101
|
-
} catch (e) {
|
|
102
|
-
if (opts.rethrow) throw e;
|
|
103
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
104
|
-
log.warn({
|
|
105
|
-
err: e,
|
|
106
|
-
label: opts.label,
|
|
107
|
-
errorMessage: msg
|
|
108
|
-
}, `subagent run failed: ${msg}`);
|
|
109
|
-
return null;
|
|
110
|
-
} finally {
|
|
111
|
-
opts.signal?.removeEventListener("abort", onAbort);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async preparePersistentSubagentSession(conversationId, metadata) {
|
|
115
|
-
const store = this.deps.sessionStore;
|
|
116
|
-
if (!store) return;
|
|
117
|
-
await store.resolveTranscriptPath(conversationId, { metadata: {
|
|
118
|
-
sessionType: "workflow-subagent",
|
|
119
|
-
hiddenFromSessionList: true,
|
|
120
|
-
parentConversationId: metadata.parentConversationId,
|
|
121
|
-
projectId: metadata.projectId,
|
|
122
|
-
workflowRunId: metadata.workflowRunId,
|
|
123
|
-
workflowDefinitionId: metadata.workflowDefinitionId,
|
|
124
|
-
workflowAgentId: metadata.workflowAgentId,
|
|
125
|
-
workflowAgentLabel: metadata.workflowAgentLabel,
|
|
126
|
-
sourceChannel: "workflow",
|
|
127
|
-
sourceChatId: metadata.workflowRunId,
|
|
128
|
-
routing: {
|
|
129
|
-
agentId: metadata.workflowAgentId || "main",
|
|
130
|
-
source: "workflow",
|
|
131
|
-
accountId: "default",
|
|
132
|
-
peerKind: "subagent",
|
|
133
|
-
peerId: metadata.workflowRunId
|
|
134
|
-
}
|
|
135
|
-
} });
|
|
136
|
-
await store.updateMetadata(conversationId, {
|
|
137
|
-
sessionType: "workflow-subagent",
|
|
138
|
-
hiddenFromSessionList: true,
|
|
139
|
-
parentConversationId: metadata.parentConversationId,
|
|
140
|
-
projectId: metadata.projectId,
|
|
141
|
-
workflowRunId: metadata.workflowRunId,
|
|
142
|
-
workflowDefinitionId: metadata.workflowDefinitionId,
|
|
143
|
-
workflowAgentId: metadata.workflowAgentId,
|
|
144
|
-
workflowAgentLabel: metadata.workflowAgentLabel,
|
|
145
|
-
name: metadata.workflowAgentLabel,
|
|
146
|
-
tags: ["workflow-subagent", metadata.workflowDefinitionId]
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
function resolveAllowedToolNames(requested, wantStructured) {
|
|
151
|
-
const filtered = (requested ?? Object.keys(DELEGATION_TOOL_CAPABILITIES).filter((name) => ![
|
|
152
|
-
"local_write",
|
|
153
|
-
"command",
|
|
154
|
-
"browser"
|
|
155
|
-
].includes(DELEGATION_TOOL_CAPABILITIES[name]))).map((s) => String(s).trim()).filter((s) => s.length > 0).filter((s) => !DELEGATE_BLOCKED_TOOLS.has(s));
|
|
156
|
-
if (wantStructured && !filtered.includes("structured_output")) filtered.push(STRUCTURED_OUTPUT_TOOL_NAME);
|
|
157
|
-
return [...new Set(filtered)];
|
|
158
|
-
}
|
|
159
|
-
function buildPrompt(prompt, opts, structured) {
|
|
160
|
-
const parts = [];
|
|
161
|
-
if (opts.instructions?.trim()) parts.push(opts.instructions.trim());
|
|
162
|
-
if (opts.label) parts.push(`Task label: ${opts.label}`);
|
|
163
|
-
if (opts.phase) parts.push(`Workflow phase: ${opts.phase}`);
|
|
164
|
-
parts.push(prompt);
|
|
165
|
-
if (structured) parts.push([
|
|
166
|
-
"Final output contract:",
|
|
167
|
-
"- Your final action MUST be a structured_output tool call.",
|
|
168
|
-
"- The structured_output arguments are the return value of this subagent.",
|
|
169
|
-
"- Do not emit a prose final answer instead of structured_output.",
|
|
170
|
-
"- If you need to inspect files or run commands first, do so, then call structured_output exactly once."
|
|
171
|
-
].join("\n"));
|
|
172
|
-
return parts.join("\n\n");
|
|
173
|
-
}
|
|
174
|
-
function safeResolveDefaultModel(get) {
|
|
175
|
-
try {
|
|
176
|
-
return get();
|
|
177
|
-
} catch (e) {
|
|
178
|
-
log.warn({ err: e }, "failed to resolve default subagent model");
|
|
179
|
-
return null;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function resolveSubagentStreamMode(_getConfig) {
|
|
183
|
-
return "steps";
|
|
184
|
-
}
|
|
185
|
-
function mapChildProgressEvent(event) {
|
|
186
|
-
switch (event.type) {
|
|
187
|
-
case "tool_start": return {
|
|
188
|
-
type: "tool_start",
|
|
189
|
-
toolCallId: event.toolCallId ?? "",
|
|
190
|
-
toolName: event.toolName ?? "tool",
|
|
191
|
-
args: event.args ?? {}
|
|
192
|
-
};
|
|
193
|
-
case "tool_end": return {
|
|
194
|
-
type: "tool_end",
|
|
195
|
-
toolCallId: event.toolCallId ?? "",
|
|
196
|
-
toolName: event.toolName ?? "tool",
|
|
197
|
-
isError: Boolean(event.isError),
|
|
198
|
-
resultPreview: event.resultPreview,
|
|
199
|
-
error: event.error
|
|
200
|
-
};
|
|
201
|
-
case "iteration": return {
|
|
202
|
-
type: "iteration",
|
|
203
|
-
count: event.count ?? 0,
|
|
204
|
-
max: event.max ?? 0
|
|
205
|
-
};
|
|
206
|
-
case "text_delta": return {
|
|
207
|
-
type: "text_delta",
|
|
208
|
-
delta: event.delta ?? ""
|
|
209
|
-
};
|
|
210
|
-
case "thinking_delta": return {
|
|
211
|
-
type: "thinking_delta",
|
|
212
|
-
delta: event.delta ?? ""
|
|
213
|
-
};
|
|
214
|
-
default: return {
|
|
215
|
-
type: "text_delta",
|
|
216
|
-
delta: ""
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
//#endregion
|
|
221
|
-
export { DelegateSubagentRunner, resolveAllowedToolNames };
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared types for the workflow runtime.
|
|
3
|
-
*
|
|
4
|
-
* The runtime depends only on `SubagentRunner` — the adapter that wraps the
|
|
5
|
-
* concrete child-agent factory lives in `subagent-runner.ts`. This keeps
|
|
6
|
-
* `runtime.ts` free of any LLM-stack imports and makes alternate runners
|
|
7
|
-
* (remote agents, test doubles) drop-in replacements.
|
|
8
|
-
*/
|
|
9
|
-
import type { Model, Api } from '@earendil-works/pi-ai';
|
|
10
|
-
/** Plain JSON Schema (no TypeBox brand). Mirrors the shape models emit verbatim. */
|
|
11
|
-
export interface JsonSchema {
|
|
12
|
-
type?: string | string[];
|
|
13
|
-
properties?: Record<string, JsonSchema>;
|
|
14
|
-
items?: JsonSchema | JsonSchema[];
|
|
15
|
-
required?: string[];
|
|
16
|
-
additionalProperties?: boolean | JsonSchema;
|
|
17
|
-
enum?: unknown[];
|
|
18
|
-
const?: unknown;
|
|
19
|
-
description?: string;
|
|
20
|
-
[key: string]: unknown;
|
|
21
|
-
}
|
|
22
|
-
export interface WorkflowSnapshotPhase {
|
|
23
|
-
title: string;
|
|
24
|
-
detail?: string;
|
|
25
|
-
/** Default model for this phase: `provider/model` or configured typed id. */
|
|
26
|
-
model?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface WorkflowEstimatedAgents {
|
|
29
|
-
min: number;
|
|
30
|
-
max: number;
|
|
31
|
-
}
|
|
32
|
-
/** One-click starter text in the gateway start dialog; `field` is `goal` or an `args` key. */
|
|
33
|
-
export interface WorkflowExamplePrompt {
|
|
34
|
-
field: string;
|
|
35
|
-
text: string;
|
|
36
|
-
}
|
|
37
|
-
/** Locale-specific display copy overrides; top-level fields provide the default copy. */
|
|
38
|
-
export interface WorkflowLocaleCopy {
|
|
39
|
-
title?: string;
|
|
40
|
-
description?: string;
|
|
41
|
-
whenToUse?: string;
|
|
42
|
-
examplePrompts?: WorkflowExamplePrompt[];
|
|
43
|
-
}
|
|
44
|
-
export interface WorkflowSnapshotDefinition {
|
|
45
|
-
name: string;
|
|
46
|
-
description: string;
|
|
47
|
-
whenToUse?: string;
|
|
48
|
-
phases?: WorkflowSnapshotPhase[];
|
|
49
|
-
/** Discovery tags, e.g. `['code-review', 'planning']`. */
|
|
50
|
-
tags?: string[];
|
|
51
|
-
/** Rough subagent count range for UX / cost hints. */
|
|
52
|
-
estimatedAgents?: WorkflowEstimatedAgents;
|
|
53
|
-
/** English-default example prompts for the gateway start dialog. */
|
|
54
|
-
examplePrompts?: WorkflowExamplePrompt[];
|
|
55
|
-
/** Locale bundles keyed by BCP-47 language tag (e.g. `zh`). */
|
|
56
|
-
i18n?: Record<string, WorkflowLocaleCopy>;
|
|
57
|
-
}
|
|
58
|
-
export type WorkflowAgentStatus = 'queued' | 'running' | 'done' | 'error' | 'skipped';
|
|
59
|
-
export type WorkflowAgentStepStatus = 'running' | 'done' | 'error';
|
|
60
|
-
export interface WorkflowAgentStep {
|
|
61
|
-
id: string;
|
|
62
|
-
kind: 'tool' | 'llm' | 'thinking';
|
|
63
|
-
/** Original tool name when `kind === 'tool'` (for chat UI reuse). */
|
|
64
|
-
toolName?: string;
|
|
65
|
-
label: string;
|
|
66
|
-
detail?: string;
|
|
67
|
-
status: WorkflowAgentStepStatus;
|
|
68
|
-
resultPreview?: string;
|
|
69
|
-
error?: string;
|
|
70
|
-
startedAtMs?: number;
|
|
71
|
-
durationMs?: number;
|
|
72
|
-
}
|
|
73
|
-
export interface WorkflowAgentSnapshot {
|
|
74
|
-
id: number;
|
|
75
|
-
label: string;
|
|
76
|
-
phase?: string;
|
|
77
|
-
prompt: string;
|
|
78
|
-
status: WorkflowAgentStatus;
|
|
79
|
-
resultPreview?: string;
|
|
80
|
-
error?: string;
|
|
81
|
-
startedAtMs?: number;
|
|
82
|
-
durationMs?: number;
|
|
83
|
-
steps?: WorkflowAgentStep[];
|
|
84
|
-
/** One-line summary for inline agent rows. */
|
|
85
|
-
currentStep?: string;
|
|
86
|
-
iteration?: number;
|
|
87
|
-
maxIterations?: number;
|
|
88
|
-
/** Accumulated assistant/thinking text when subagentStream is `full`. */
|
|
89
|
-
streamText?: string;
|
|
90
|
-
}
|
|
91
|
-
export interface WorkflowAgentInvocationSnapshot {
|
|
92
|
-
nodeId?: string;
|
|
93
|
-
prompt: string;
|
|
94
|
-
label: string;
|
|
95
|
-
phase?: string;
|
|
96
|
-
modelRef?: string;
|
|
97
|
-
resolvedModelRef?: string;
|
|
98
|
-
schema?: JsonSchema;
|
|
99
|
-
toolset?: string[];
|
|
100
|
-
maxIterations?: number;
|
|
101
|
-
}
|
|
102
|
-
export interface WorkflowSnapshot {
|
|
103
|
-
runId?: string;
|
|
104
|
-
name: string;
|
|
105
|
-
description?: string;
|
|
106
|
-
phases: string[];
|
|
107
|
-
currentPhase?: string;
|
|
108
|
-
logs: string[];
|
|
109
|
-
agents: WorkflowAgentSnapshot[];
|
|
110
|
-
agentCount: number;
|
|
111
|
-
runningCount: number;
|
|
112
|
-
doneCount: number;
|
|
113
|
-
errorCount: number;
|
|
114
|
-
skippedCount: number;
|
|
115
|
-
durationMs?: number;
|
|
116
|
-
result?: unknown;
|
|
117
|
-
}
|
|
118
|
-
export interface SubagentRunOptions<T = unknown> {
|
|
119
|
-
label: string;
|
|
120
|
-
/** When set, the subagent must return a value matching the schema (validated via ajv). */
|
|
121
|
-
schema?: JsonSchema;
|
|
122
|
-
/** Per-agent overrides; defaults filled by the runner adapter. */
|
|
123
|
-
allowedToolNames?: string[];
|
|
124
|
-
maxIterations?: number;
|
|
125
|
-
/** Resolved model. When omitted the adapter falls back to the workflow-level default. */
|
|
126
|
-
model?: Model<Api>;
|
|
127
|
-
signal?: AbortSignal;
|
|
128
|
-
/** Extra guidance prepended to the subagent prompt. */
|
|
129
|
-
instructions?: string;
|
|
130
|
-
/** When false (default), failures resolve to `null`; when true, errors propagate. */
|
|
131
|
-
rethrow?: boolean;
|
|
132
|
-
/** Hint about which phase this agent belongs to (passed through for logging). */
|
|
133
|
-
phase?: string;
|
|
134
|
-
/** Persistent hidden session for this workflow subagent. */
|
|
135
|
-
conversationId?: string;
|
|
136
|
-
sessionMetadata?: {
|
|
137
|
-
parentConversationId?: string;
|
|
138
|
-
projectId?: string;
|
|
139
|
-
workflowRunId: string;
|
|
140
|
-
workflowDefinitionId: string;
|
|
141
|
-
workflowAgentId: string;
|
|
142
|
-
workflowNodeId?: string;
|
|
143
|
-
workflowAgentLabel: string;
|
|
144
|
-
};
|
|
145
|
-
/** Live progress from the child agent loop (workflow tool binds per agent id). */
|
|
146
|
-
onProgress?: (event: SubagentProgressEvent) => void;
|
|
147
|
-
/** Pre-bound capture for structured output (internal: created by the adapter when schema present). */
|
|
148
|
-
__capture?: {
|
|
149
|
-
called: boolean;
|
|
150
|
-
value?: T;
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
export type SubagentProgressEvent = {
|
|
154
|
-
type: 'tool_start';
|
|
155
|
-
toolCallId: string;
|
|
156
|
-
toolName: string;
|
|
157
|
-
args: Record<string, unknown>;
|
|
158
|
-
} | {
|
|
159
|
-
type: 'tool_end';
|
|
160
|
-
toolCallId: string;
|
|
161
|
-
toolName: string;
|
|
162
|
-
isError: boolean;
|
|
163
|
-
resultPreview?: string;
|
|
164
|
-
error?: string;
|
|
165
|
-
} | {
|
|
166
|
-
type: 'iteration';
|
|
167
|
-
count: number;
|
|
168
|
-
max: number;
|
|
169
|
-
} | {
|
|
170
|
-
type: 'text_delta';
|
|
171
|
-
delta: string;
|
|
172
|
-
} | {
|
|
173
|
-
type: 'thinking_delta';
|
|
174
|
-
delta: string;
|
|
175
|
-
};
|
|
176
|
-
/**
|
|
177
|
-
* Spawns a single fresh subagent and returns its result.
|
|
178
|
-
*
|
|
179
|
-
* - Without `schema`: returns the final assistant text (`string`).
|
|
180
|
-
* - With `schema`: returns the value the subagent passed to the injected
|
|
181
|
-
* `structured_output` tool (validated, typed as `T`).
|
|
182
|
-
*
|
|
183
|
-
* Returns `null` when the subagent fails or aborts — runtime keeps going.
|
|
184
|
-
*/
|
|
185
|
-
export interface SubagentRunner {
|
|
186
|
-
run<T = string>(prompt: string, opts: SubagentRunOptions<T>): Promise<T | null>;
|
|
187
|
-
}
|
|
188
|
-
export interface WorkflowRunOptions {
|
|
189
|
-
args?: unknown;
|
|
190
|
-
goal?: string;
|
|
191
|
-
cwd: string;
|
|
192
|
-
signal?: AbortSignal;
|
|
193
|
-
/** Hard upper bound on concurrent subagents (default min(16, cpu-2)). */
|
|
194
|
-
concurrency?: number;
|
|
195
|
-
/** Optional total token budget for the run. `null` means unlimited. */
|
|
196
|
-
tokenBudget?: number | null;
|
|
197
|
-
/** Hard cap on total subagent count for one workflow run (default 1000). */
|
|
198
|
-
maxSubagents?: number;
|
|
199
|
-
onLog?: (message: string) => void;
|
|
200
|
-
onPhase?: (title: string) => void;
|
|
201
|
-
onNodeStart?: (event: {
|
|
202
|
-
nodeId: string;
|
|
203
|
-
kind: string;
|
|
204
|
-
title: string;
|
|
205
|
-
}) => void;
|
|
206
|
-
onNodeEnd?: (event: {
|
|
207
|
-
nodeId: string;
|
|
208
|
-
kind: string;
|
|
209
|
-
title: string;
|
|
210
|
-
status: 'done' | 'error' | 'skipped';
|
|
211
|
-
result?: unknown;
|
|
212
|
-
error?: string;
|
|
213
|
-
}) => void;
|
|
214
|
-
onAgentQueued?: (event: {
|
|
215
|
-
id: number;
|
|
216
|
-
nodeId: string;
|
|
217
|
-
label: string;
|
|
218
|
-
phase?: string;
|
|
219
|
-
prompt: string;
|
|
220
|
-
invocation: WorkflowAgentInvocationSnapshot;
|
|
221
|
-
}) => void;
|
|
222
|
-
onAgentStart?: (event: {
|
|
223
|
-
id: number;
|
|
224
|
-
nodeId: string;
|
|
225
|
-
label: string;
|
|
226
|
-
phase?: string;
|
|
227
|
-
prompt: string;
|
|
228
|
-
}) => void;
|
|
229
|
-
onAgentEnd?: (event: {
|
|
230
|
-
id: number;
|
|
231
|
-
nodeId: string;
|
|
232
|
-
label: string;
|
|
233
|
-
phase?: string;
|
|
234
|
-
result: unknown;
|
|
235
|
-
status: WorkflowAgentStatus;
|
|
236
|
-
}) => void;
|
|
237
|
-
/** Merge extra subagent run options (e.g. progress callbacks) per agent id. */
|
|
238
|
-
enhanceSubagentRun?: (ctx: {
|
|
239
|
-
id: number;
|
|
240
|
-
nodeId: string;
|
|
241
|
-
label: string;
|
|
242
|
-
phase?: string;
|
|
243
|
-
prompt: string;
|
|
244
|
-
}) => Partial<SubagentRunOptions<unknown>>;
|
|
245
|
-
}
|
|
246
|
-
export interface WorkflowRunResult<T = unknown> {
|
|
247
|
-
result: T;
|
|
248
|
-
logs: string[];
|
|
249
|
-
phases: string[];
|
|
250
|
-
agentCount: number;
|
|
251
|
-
durationMs: number;
|
|
252
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
-
import type { BuildChildToolsOptions } from '../child-agent-factory.js';
|
|
3
|
-
/** Builds the tool set for workflow child agents (wired from gateway to avoid cycles). */
|
|
4
|
-
export declare function buildWorkflowChildTools(childOptions: BuildChildToolsOptions): AgentTool<any, any>[];
|