@xopcai/xopc 0.0.178 → 0.0.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-BzGX__8I.js → activity-store-DFKtQDgE.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BzxntcaZ.js → agent-avatar-dicebear-CcTvB_4W.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DgGj9bu6.js +2 -0
- package/dist/gateway/static/root/assets/{api-hi6f2Xtp.js → api-CUClAvuL.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-fTY1F7ac.js → app-management-settings-panel-Ib-cWKHM.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BZ-IxQfB.js → appearance-settings-CRSN8WuA.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-B5xahuT-.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-ZSLLG8wB.js → archive-plugin-BBF9zspN.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D4YktqIF.js → attachment-load-D3QQfA7w.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BUYrvMmD.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BIkPxfxj.js → binary-plugins-D78XOjJ3.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Q3v_YQom.js → block-editor-D_VVXlYX.js} +46 -46
- package/dist/gateway/static/root/assets/browser-settings-page-Cjw07q9h.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-M5lTEW1I.js → browser-workflow-inputs-_gu08MA4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-B3T1KYk4.js → browser-workflows-page-58DBMXgG.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D_dfVxHY.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-DE09c0VB.js → capability-presets-api-DhCn9rPv.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-LWWIYUT7.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CFR5FBfS.js → channel-recipient-api-DYtoNV5A.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-Cyj5OunL.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-TEFnV0IG.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-B1mD-3pM.js → connector-logo-CxIXnifA.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-0TobCpBB.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-CwVSLL6N.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-BOIp4q0Z.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BYQJ2XUS.js → directory-picker-path-field-C8_lsW6S.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-BXcb8fwx.js → dreaming-settings-Da9FeWQl.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-O1Xu1r4Q.js → extension-debug-page-CMNnSJP6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C2Jraq8l.js → extension-page-t0pJqLvM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DcXQDTpG.js → extension-settings-page-aiR-tKnW.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DmPIZrvg.js → gateway-config-api-CkyQBD6r.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BIZfAgfB.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BZEkOdPm.js → gateway-startup-retry-CSU7UvzG.js} +1 -1
- package/dist/gateway/static/root/assets/goals-settings-Dx9uTyWF.js +1 -0
- package/dist/gateway/static/root/assets/{heartbeat-settings-BtKu2NWT.js → heartbeat-settings-Cnr5ORXL.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-05Gg8wsU.js → image-generation-api-BR6Kb77X.js} +1 -1
- package/dist/gateway/static/root/assets/index-B0Tdge_q.css +1 -0
- package/dist/gateway/static/root/assets/index-BA56bQ68.js +224 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CfmDR9Sc.js → keyboard-shortcuts-settings-D76uYKeQ.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DSUNtLHg.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Df8BW1A_.js → local-apps-page-BsLnojTh.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CTwSy7yW.js → locale-store-BNC8HUCI.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-yI8kpQtO.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-B3FvKbaP.js → markdown-split-D6smTQWD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DsjrvvB6.js → media-plugins-D1TmMF0A.js} +1 -1
- package/dist/gateway/static/root/assets/messages-H_iJjnEM.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-tuzIwy3c.js → notes-page-Vt-diFf0.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BD297EZt.js +4 -0
- package/dist/gateway/static/root/assets/outcome-detail-page-C5i_ZR9a.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-ke9s4nYi.js → page-tabs-BnSzIjH0.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Cp1eI4S9.js → preview-open-alternatives-CF12Eqi4.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-BVG-eWQO.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-dXQCMAtH.js → product-open-page-Du0TE_CU.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-D1HGz7Dy.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-CqP2TnW-.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BXdVJLS3.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-Bl30zjHc.js → save-bar-controls-B53UNtDM.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-DqhmXQKo.js → schedule-field-C3dIMN5q.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DkUCy6vf.js → schema-form-BKvpxqof.js} +1 -1
- package/dist/gateway/static/root/assets/{schemas-DgQq6Z5S.js → schemas-C6onAggk.js} +2 -2
- package/dist/gateway/static/root/assets/sessions-page-CPAwDdl5.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-C-jGsoft.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-C6ZbNpdy.js → settings-form-section-kt6GIS32.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Bk58_cr7.js → settings-loading-skeleton-85eUPcKz.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-k8iE_NdX.js → settings-page-Di5x6Xrc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DgFSya2e.js → settings-page-layout-CkkCee_x.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-B_KDlyZA.js → setup-status-panel-uxEE6gAB.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CV7nL_J9.js → share-preview-page-BtLEstaI.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-2mcsMWgn.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-ocDwsrEt.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-9_jfsFU5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-kahBIHg0.js → skills-page.utils-C2SHvq8V.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-JV3-MG5F.js → system-settings-panel-CIJ66cUy.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DFLyzoLO.js → theme-store-ClDa_Bci.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-D0zAsHOo.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-60Aqo-UJ.js → typed-models-lib-GsmwmB40.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CnTkHDnw.js → use-channel-catalog-BQz3K7xj.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Bn4BLg4W.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CNa8qUgS.js → voice-api-key-field-Blaxsbb3.js} +1 -1
- package/dist/gateway/static/root/assets/work-copy-Cwyan9Sn.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-iJ9RBSpu.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CqTH7PQX.js +1 -0
- package/dist/gateway/static/root/assets/work-page-H3m99ccS.js +3 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-yV_x595t.js → workflow-run-setup-panel-CTG4RpRE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BxZSKMfv.js +11 -0
- package/dist/gateway/static/root/index.html +9 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/outcomes.js +137 -0
- package/dist/packages/gateway-contract/src/product-delivery.js +1 -0
- package/dist/packages/gateway-contract/src/work-intake.js +85 -0
- package/dist/src/activity/service.d.ts +1 -0
- package/dist/src/activity/service.js +4 -1
- package/dist/src/agent/agent-manager.d.ts +4 -1
- package/dist/src/agent/agent-manager.js +21 -7
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/code-intelligence/binary.js +1 -1
- package/dist/src/agent/context/execution-scope.d.ts +1 -1
- package/dist/src/agent/context/execution-scope.js +6 -4
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
- package/dist/src/agent/embedded/run-for-session.js +3 -1
- package/dist/src/agent/goals/post-turn.js +7 -6
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +6 -1
- package/dist/src/agent/inbound/turn-dispatcher.js +5 -2
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/lifecycle/timeout-wrapper.d.ts +2 -0
- package/dist/src/agent/lifecycle/timeout-wrapper.js +39 -9
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +6 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +2 -0
- package/dist/src/agent/mcp/mcp-transport-config.js +10 -3
- package/dist/src/agent/mcp/mcp-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-transport.js +5 -2
- package/dist/src/agent/memory/dreaming/config.js +1 -1
- package/dist/src/agent/memory/user-context-coordinator.d.ts +1 -0
- package/dist/src/agent/memory/user-context-coordinator.js +17 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +6 -2
- package/dist/src/agent/outcomes/{task-evaluation.d.ts → execution-evaluation.d.ts} +3 -3
- package/dist/src/agent/outcomes/{task-evaluation.js → execution-evaluation.js} +5 -5
- package/dist/src/agent/outcomes/execution-verifier.d.ts +29 -0
- package/dist/src/agent/outcomes/{task-verifier.js → execution-verifier.js} +4 -4
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -0
- package/dist/src/agent/service/process-direct-one-shot.js +4 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -1
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +6 -0
- package/dist/src/agent/skills/filesystem-watcher.d.ts +4 -0
- package/dist/src/agent/skills/filesystem-watcher.js +16 -7
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.d.ts +10 -7
- package/dist/src/agent/skills/index.js +56 -47
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.d.ts +5 -2
- package/dist/src/agent/skills/skill-manager.js +10 -5
- package/dist/src/agent/skills/skill-sources.d.ts +18 -0
- package/dist/src/agent/skills/skill-sources.js +143 -0
- package/dist/src/agent/skills/types.d.ts +25 -2
- package/dist/src/agent/tools/delegate-tool.js +2 -1
- package/dist/src/agent/tools/executor.d.ts +2 -0
- package/dist/src/agent/tools/executor.js +18 -11
- package/dist/src/agent/tools/factory.js +18 -1
- package/dist/src/agent/tools/goal-tool.js +5 -3
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/managed-job-tool.d.ts +2 -0
- package/dist/src/agent/tools/managed-job-tool.js +160 -0
- package/dist/src/agent/tools/todo-tool.d.ts +5 -0
- package/dist/src/agent/tools/todo-tool.js +16 -4
- package/dist/src/agent/tools/update-plan-tool.d.ts +1 -0
- package/dist/src/agent/tools/update-plan-tool.js +6 -0
- package/dist/src/agent/workspace-runtime/registry.d.ts +3 -0
- package/dist/src/agent/workspace-runtime/registry.js +3 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/auth/credentials.d.ts +9 -1
- package/dist/src/auth/credentials.js +112 -56
- package/dist/src/auth/model-credential-store.js +7 -22
- package/dist/src/auth/oauth-provider-lock.d.ts +5 -0
- package/dist/src/auth/oauth-provider-lock.js +91 -0
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/defaults.d.ts +8 -1
- package/dist/src/automations/domain/defaults.js +9 -2
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +33 -7
- package/dist/src/automations/domain/validation.d.ts +8 -0
- package/dist/src/automations/domain/validation.js +2 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +144 -34
- package/dist/src/automations/service/automation-service.d.ts +4 -0
- package/dist/src/automations/service/automation-service.js +197 -18
- package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
- package/dist/src/automations/storage/automation-run-repository.js +37 -7
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/browser/providers/cloakbrowser.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.d.ts +0 -3
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -24
- package/dist/src/chat-commands/builtins/goal.js +5 -4
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/goal.js +6 -5
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/cli/utils/oauth-login.js +1 -7
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +3 -0
- package/dist/src/config/schema.js +2 -1
- package/dist/src/connectors/learning-coordinator.js +7 -1
- package/dist/src/connectors/source-change-publisher.d.ts +17 -0
- package/dist/src/connectors/source-change-publisher.js +148 -0
- package/dist/src/discussions/analyzer.d.ts +35 -0
- package/dist/src/discussions/analyzer.js +127 -0
- package/dist/src/discussions/index.d.ts +7 -0
- package/dist/src/discussions/index.js +7 -0
- package/dist/src/discussions/live-worker.d.ts +33 -0
- package/dist/src/discussions/live-worker.js +148 -0
- package/dist/src/discussions/pipeline.d.ts +33 -0
- package/dist/src/discussions/pipeline.js +205 -0
- package/dist/src/discussions/project-inference.d.ts +13 -0
- package/dist/src/discussions/project-inference.js +19 -0
- package/dist/src/discussions/repository.d.ts +29 -0
- package/dist/src/discussions/repository.js +255 -0
- package/dist/src/discussions/service.d.ts +51 -0
- package/dist/src/discussions/service.js +335 -0
- package/dist/src/discussions/transcript.d.ts +3 -0
- package/dist/src/discussions/transcript.js +15 -0
- package/dist/src/discussions/types.d.ts +116 -0
- package/dist/src/discussions/types.js +10 -0
- package/dist/src/discussions/worker.d.ts +18 -0
- package/dist/src/discussions/worker.js +74 -0
- package/dist/src/extensions/activation-context.js +2 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/testing.js +1 -1
- package/dist/src/gateway/agents-admin.js +3 -3
- package/dist/src/gateway/chat-stream/mapper.js +53 -3
- package/dist/src/gateway/chat-stream/protocol.d.ts +17 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/app.js +8 -3
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/middleware/auth.js +2 -2
- package/dist/src/gateway/hono/middleware/logger.js +1 -1
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +1 -1
- package/dist/src/gateway/hono/oauth-async.js +1 -7
- package/dist/src/gateway/hono/oauth.js +1 -7
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/connectors.js +79 -0
- package/dist/src/gateway/hono/routes/discussions.d.ts +3 -0
- package/dist/src/gateway/hono/routes/discussions.js +177 -0
- package/dist/src/gateway/hono/routes/execution-receipts.d.ts +3 -0
- package/dist/src/gateway/hono/routes/execution-receipts.js +163 -0
- package/dist/src/gateway/hono/routes/exposure.js +1 -1
- package/dist/src/gateway/hono/routes/goals.js +3 -288
- package/dist/src/gateway/hono/routes/home.d.ts +2 -102
- package/dist/src/gateway/hono/routes/home.js +8 -424
- package/dist/src/gateway/hono/routes/index.js +6 -2
- package/dist/src/gateway/hono/routes/memory.js +7 -7
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +30 -0
- package/dist/src/gateway/hono/routes/projects.js +8 -152
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +2 -2
- package/dist/src/gateway/hono/routes/tunnel.js +3 -3
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/hono/routes/work.d.ts +3 -0
- package/dist/src/gateway/hono/routes/work.js +207 -0
- package/dist/src/gateway/hono/routes/you.js +13 -15
- package/dist/src/gateway/index.js +2 -2
- package/dist/src/gateway/runtime-config.js +2 -2
- package/dist/src/gateway/security/audit.js +2 -2
- package/dist/src/gateway/security/index.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +46 -51
- package/dist/src/gateway/service.d.ts +8 -1
- package/dist/src/gateway/service.js +142 -15
- package/dist/src/goals/goal-queue-store.d.ts +1 -0
- package/dist/src/goals/goal-queue-store.js +5 -1
- package/dist/src/goals/goal-queue-types.d.ts +11 -1
- package/dist/src/goals/goal-runner.js +10 -6
- package/dist/src/goals/goal-service.d.ts +2 -15
- package/dist/src/goals/goal-service.js +9 -42
- package/dist/src/goals/goal-store.d.ts +1 -18
- package/dist/src/goals/goal-store.js +25 -231
- package/dist/src/goals/goal-workflow-judge.js +1 -1
- package/dist/src/goals/index.d.ts +0 -4
- package/dist/src/goals/index.js +1 -3
- package/dist/src/goals/types.d.ts +4 -66
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/notes/service.d.ts +1 -0
- package/dist/src/notes/service.js +10 -1
- package/dist/src/notes/types.d.ts +1 -0
- package/dist/src/proactive/events/product-event-bridge.d.ts +7 -0
- package/dist/src/proactive/events/product-event-bridge.js +84 -0
- package/dist/src/proactive/execution/context.d.ts +27 -11
- package/dist/src/proactive/execution/context.js +259 -25
- package/dist/src/proactive/execution/repository.js +18 -5
- package/dist/src/proactive/execution/types.d.ts +7 -1
- package/dist/src/proactive/execution/worker.js +7 -6
- package/dist/src/proactive/inbox/repository.js +8 -2
- package/dist/src/proactive/index.d.ts +4 -2
- package/dist/src/proactive/index.js +5 -3
- package/dist/src/proactive/temporal/worker.d.ts +16 -0
- package/dist/src/proactive/temporal/worker.js +110 -0
- package/dist/src/projects/project-loop.js +3 -3
- package/dist/src/providers/auth-runtime/oauth.js +12 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/storage/sqlite/activity-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/activity-repository.js +4 -1
- package/dist/src/storage/sqlite/connector-sync-policy-repository.d.ts +20 -0
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +50 -0
- package/dist/src/storage/sqlite/execution-receipt-repository.d.ts +146 -0
- package/dist/src/storage/sqlite/execution-receipt-repository.js +235 -0
- package/dist/src/storage/sqlite/index.d.ts +4 -2
- package/dist/src/storage/sqlite/index.js +6 -4
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +9 -1
- package/dist/src/storage/sqlite/memory-records-repository.js +1 -1
- package/dist/src/storage/sqlite/migrations/075_connector_sync_policies.sql +13 -0
- package/dist/src/storage/sqlite/migrations/076_meeting_preparation_scenario.sql +29 -0
- package/dist/src/storage/sqlite/migrations/077_proactive_insight_fingerprints.sql +4 -0
- package/dist/src/storage/sqlite/migrations/078_discussion_captures.sql +64 -0
- package/dist/src/storage/sqlite/migrations/079_discussion_follow_up_scenario.sql +29 -0
- package/dist/src/storage/sqlite/migrations/080_task_outcome_context.sql +15 -0
- package/dist/src/storage/sqlite/migrations/081_project_monitoring_policies.sql +10 -0
- package/dist/src/storage/sqlite/migrations/082_one_click_live_discussions.sql +100 -0
- package/dist/src/storage/sqlite/migrations/083_session_task_plans.sql +9 -0
- package/dist/src/storage/sqlite/migrations/084_work_intake_lifecycle.sql +26 -0
- package/dist/src/storage/sqlite/migrations/085_task_outcome_projection.sql +19 -0
- package/dist/src/storage/sqlite/migrations/086_outcome_aggregates.sql +168 -0
- package/dist/src/storage/sqlite/migrations/087_context_snapshots.sql +21 -0
- package/dist/src/storage/sqlite/migrations/088_automation_execution_deadlines.sql +5 -0
- package/dist/src/storage/sqlite/migrations/089_automation_run_leases.sql +8 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/notes-repository.js +9 -0
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +89 -44
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/storage/sqlite/session-task-plan-repository.d.ts +20 -0
- package/dist/src/storage/sqlite/session-task-plan-repository.js +77 -0
- package/dist/src/tui/backends/embedded-backend.d.ts +2 -0
- package/dist/src/tui/backends/embedded-backend.js +12 -8
- package/dist/src/tui/tui-backend.d.ts +2 -0
- package/dist/src/tui/tui-oauth-login.js +1 -7
- package/dist/src/tui/tui-picker-overlay.js +1 -0
- package/dist/src/tui/tui-picker-services.d.ts +1 -0
- package/dist/src/tui/tui-skills-autocomplete.d.ts +6 -2
- package/dist/src/tui/tui-skills-autocomplete.js +10 -6
- package/dist/src/tui/tui-startup-resources.d.ts +3 -1
- package/dist/src/tui/tui-startup-resources.js +4 -3
- package/dist/src/tui/tui.js +4 -1
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +1 -1
- package/dist/src/tunnel/index.js +2 -2
- package/dist/src/user-context/context-compiler.d.ts +31 -0
- package/dist/src/user-context/context-compiler.js +51 -0
- package/dist/src/voice/local/model-files.js +1 -1
- package/dist/src/voice/stt/config.d.ts +4 -0
- package/dist/src/voice/stt/config.js +26 -0
- package/dist/src/voice/stt/index.d.ts +1 -0
- package/dist/src/voice/stt/index.js +2 -1
- package/dist/src/voice/stt/list-providers.js +1 -1
- package/dist/src/work/attention-governor.d.ts +20 -0
- package/dist/src/work/attention-governor.js +46 -0
- package/dist/src/work/execution-context.d.ts +16 -0
- package/dist/src/work/execution-context.js +66 -0
- package/dist/src/work/home-query-service.d.ts +147 -0
- package/dist/src/work/home-query-service.js +389 -0
- package/dist/src/work/index.d.ts +14 -0
- package/dist/src/work/index.js +15 -0
- package/dist/src/work/outcome-contract-definition.d.ts +8 -0
- package/dist/src/work/outcome-contract-definition.js +15 -0
- package/dist/src/work/outcome-execution-service.d.ts +27 -0
- package/dist/src/work/outcome-execution-service.js +60 -0
- package/dist/src/work/outcome-projection-service.d.ts +7 -0
- package/dist/src/work/outcome-projection-service.js +51 -0
- package/dist/src/work/outcome-receipt-service.d.ts +13 -0
- package/dist/src/work/outcome-receipt-service.js +55 -0
- package/dist/src/work/outcome-repository.d.ts +50 -0
- package/dist/src/work/outcome-repository.js +112 -0
- package/dist/src/work/outcome-run-coordinator.d.ts +25 -0
- package/dist/src/work/outcome-run-coordinator.js +117 -0
- package/dist/src/work/project-monitoring-service.d.ts +21 -0
- package/dist/src/work/project-monitoring-service.js +76 -0
- package/dist/src/work/project-operating-view-service.d.ts +10 -0
- package/dist/src/work/project-operating-view-service.js +46 -0
- package/dist/src/work/work-intake-repository.d.ts +49 -0
- package/dist/src/work/work-intake-repository.js +97 -0
- package/dist/src/work/work-intake-service.d.ts +26 -0
- package/dist/src/work/work-intake-service.js +171 -0
- package/dist/src/work/work-value-metrics-service.d.ts +4 -0
- package/dist/src/work/work-value-metrics-service.js +88 -0
- package/dist/src/work-items/work-item-service.d.ts +0 -2
- package/dist/src/work-items/work-item-service.js +0 -28
- package/dist/src/workflows/service/workflow-run-service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +3 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-DC9F12Kw.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-5bKr05Fa.js +0 -1
- package/dist/gateway/static/root/assets/automation-suggestion-card-B7mxFRtf.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Dg6dmt5g.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BHoo6Rpq.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BlsqN8Fu.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DJeT8_B4.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-C4VVjYEm.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-vdf8kB16.js +0 -1
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DNcrDThX.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-B1urphOZ.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DTL6J3EP.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DmObBx9b.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-BRhmmBe9.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-C1k7_s_O.js +0 -4
- package/dist/gateway/static/root/assets/goals-config-api-Fwu1wjEP.js +0 -1
- package/dist/gateway/static/root/assets/goals-page-hOu9uA3q.js +0 -2
- package/dist/gateway/static/root/assets/goals-settings-DY-JjvHz.js +0 -1
- package/dist/gateway/static/root/assets/index-C0CGebQ1.js +0 -212
- package/dist/gateway/static/root/assets/index-eqq25gvV.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-EjsNT7nJ.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Dswjlraa.js +0 -7
- package/dist/gateway/static/root/assets/messages-DP6tPKk-.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-DSh3-hMY.js +0 -4
- package/dist/gateway/static/root/assets/product-delivery-BTRT9kCS.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-D0QPRHR_.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CI5Vz62F.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-S1jpzBS5.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CTm66k7h.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CU52AUVD.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DK6XK95e.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Bvv_u4ii.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BGHvVbay.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-XwpxdZFr.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-DBCMk-Vn.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-C1UIdsCl.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DEAQepB8.js +0 -1
- package/dist/gateway/static/root/assets/work-page-D5qYmCTq.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-yrK17ZZ5.js +0 -11
- package/dist/src/agent/outcomes/task-verifier.d.ts +0 -29
- package/dist/src/gateway/hono/routes/task-outcomes.d.ts +0 -3
- package/dist/src/gateway/hono/routes/task-outcomes.js +0 -109
- package/dist/src/goals/goal-contract-draft.d.ts +0 -15
- package/dist/src/goals/goal-contract-draft.js +0 -112
- package/dist/src/goals/goal-evidence-review.d.ts +0 -15
- package/dist/src/goals/goal-evidence-review.js +0 -89
- package/dist/src/storage/sqlite/task-outcome-repository.d.ts +0 -90
- package/dist/src/storage/sqlite/task-outcome-repository.js +0 -138
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
extraDirs?: string[];
|
|
1
|
+
import { type ResolveSkillSourcesOptions } from './skill-sources.js';
|
|
2
|
+
import type { Skill, SkillConfig, SkillDiagnostic, LoadSkillsResult } from './types.js';
|
|
3
|
+
export declare function loadSkills(options: ResolveSkillSourcesOptions & {
|
|
4
|
+
/** Dependency-injection override for the ~/.agents/skills compatibility root. */
|
|
5
|
+
agentsDir?: string;
|
|
7
6
|
}): LoadSkillsResult;
|
|
8
7
|
/** Discover only skills owned by a workspace, without global or bundled skills. */
|
|
9
8
|
export declare function loadWorkspaceSkills(workspaceDir: string): LoadSkillsResult;
|
|
@@ -20,7 +19,11 @@ export interface SkillLoader {
|
|
|
20
19
|
getSkillByName: (name: string) => Skill | undefined;
|
|
21
20
|
getEnabledSkills: (config?: Record<string, SkillConfig>) => Skill[];
|
|
22
21
|
}
|
|
23
|
-
export
|
|
22
|
+
export interface SkillLoaderOptions {
|
|
23
|
+
/** Re-evaluated on every load so trust changes take effect without recreating the runtime. */
|
|
24
|
+
isWorkspaceTrusted?: (workspaceDir: string) => boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function createSkillLoader(options?: SkillLoaderOptions): SkillLoader;
|
|
24
27
|
export type { Skill, SkillMetadata, SkillConfig, SkillInstallSpec, SkillInstallResult, SkillInstallRequest, LoadSkillsResult, SkillSnapshot, } from './types.js';
|
|
25
28
|
export { installSkill, findInstallSpec, hasBinary, getDefaultInstallerPreferences, type InstallerPreferences, type InstallContext, } from './installer.js';
|
|
26
29
|
export { scanSkillDirectory, formatScanSummary, collectSkillInstallWarnings, type ScanSummary, type SecurityFinding, type Severity, } from './scanner.js';
|
|
@@ -9,11 +9,11 @@ import { parseSkillToolConditions } from "./skill-tool-gating.js";
|
|
|
9
9
|
import { formatSkillsForPrompt } from "./format-skills-prompt.js";
|
|
10
10
|
import { parseRequiredEnvVarNames } from "./required-env-vars.js";
|
|
11
11
|
import { parseSkillMetadata } from "./parse-skill-metadata.js";
|
|
12
|
-
import {
|
|
12
|
+
import { resolveSkillSources, resolveWorkspaceSkillSource } from "./skill-sources.js";
|
|
13
13
|
import { collectSkillInstallWarnings, formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
14
14
|
import { SkillTestFramework, SkillTestRunner, formatTestResults, formatTestResultsJson, formatTestResultsTap } from "./test-framework.js";
|
|
15
15
|
import { basename, dirname, join, relative, sep } from "path";
|
|
16
|
-
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
16
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
17
17
|
//#region src/agent/skills/index.ts
|
|
18
18
|
init_paths();
|
|
19
19
|
init_logger();
|
|
@@ -23,6 +23,11 @@ const IGNORE_FILES = [
|
|
|
23
23
|
".ignore",
|
|
24
24
|
".fdignore"
|
|
25
25
|
];
|
|
26
|
+
const DEFAULT_MAX_SKILL_FILE_BYTES = 1024 * 1024;
|
|
27
|
+
function resolveMaxSkillFileBytes(skillsConfig) {
|
|
28
|
+
const configured = skillsConfig.limits?.maxSkillFileBytes;
|
|
29
|
+
return typeof configured === "number" && Number.isFinite(configured) && configured > 0 ? configured : DEFAULT_MAX_SKILL_FILE_BYTES;
|
|
30
|
+
}
|
|
26
31
|
function toPosixPath(p) {
|
|
27
32
|
return p.split(sep).join("/");
|
|
28
33
|
}
|
|
@@ -67,7 +72,8 @@ function shouldIgnore(path, ignoredPaths) {
|
|
|
67
72
|
} else if (path === pattern || path.startsWith(`${pattern}/`)) return true;
|
|
68
73
|
return false;
|
|
69
74
|
}
|
|
70
|
-
function discoverSkills(
|
|
75
|
+
function discoverSkills(source, maxSkillFileBytes) {
|
|
76
|
+
const dir = source.rootDir;
|
|
71
77
|
const skills = [];
|
|
72
78
|
const diagnostics = [];
|
|
73
79
|
if (!existsSync(dir)) return {
|
|
@@ -91,7 +97,7 @@ function discoverSkills(dir, source) {
|
|
|
91
97
|
for (const rule of subRules) subIgnoredPaths.add(`${skillRelPath}${rule}`);
|
|
92
98
|
}
|
|
93
99
|
if (existsSync(skillMdPath) && !shouldIgnore(skillRelPath, currentIgnoredPaths)) {
|
|
94
|
-
const { skill, diagnostic } = loadSkillFromFile(skillMdPath, source, dir);
|
|
100
|
+
const { skill, diagnostic } = loadSkillFromFile(skillMdPath, source, dir, maxSkillFileBytes);
|
|
95
101
|
if (diagnostic) diagnostics.push(diagnostic);
|
|
96
102
|
if (skill) skills.push(skill);
|
|
97
103
|
}
|
|
@@ -127,8 +133,17 @@ function deriveDescriptionFromMarkdown(content) {
|
|
|
127
133
|
}
|
|
128
134
|
return fallbackHeading || void 0;
|
|
129
135
|
}
|
|
130
|
-
function loadSkillFromFile(filePath, source, rootDir) {
|
|
136
|
+
function loadSkillFromFile(filePath, source, rootDir, maxSkillFileBytes = DEFAULT_MAX_SKILL_FILE_BYTES) {
|
|
131
137
|
try {
|
|
138
|
+
const fileSize = statSync(filePath).size;
|
|
139
|
+
if (fileSize > maxSkillFileBytes) return {
|
|
140
|
+
skill: null,
|
|
141
|
+
diagnostic: {
|
|
142
|
+
type: "error",
|
|
143
|
+
message: `Skill file exceeds size limit (${fileSize} > ${maxSkillFileBytes} bytes)`,
|
|
144
|
+
path: filePath
|
|
145
|
+
}
|
|
146
|
+
};
|
|
132
147
|
const { frontmatter, content } = parseFrontmatter(readFileSync(filePath, "utf-8"));
|
|
133
148
|
const skillDir = dirname(filePath);
|
|
134
149
|
const parentDirName = basename(skillDir);
|
|
@@ -159,7 +174,8 @@ function loadSkillFromFile(filePath, source, rootDir) {
|
|
|
159
174
|
category,
|
|
160
175
|
filePath,
|
|
161
176
|
baseDir: skillDir,
|
|
162
|
-
source,
|
|
177
|
+
source: source.scope,
|
|
178
|
+
origin: source,
|
|
163
179
|
disableModelInvocation: frontmatter["disable-model-invocation"] === true,
|
|
164
180
|
metadata,
|
|
165
181
|
toolConditions,
|
|
@@ -178,32 +194,29 @@ function loadSkillFromFile(filePath, source, rootDir) {
|
|
|
178
194
|
}
|
|
179
195
|
}
|
|
180
196
|
function loadSkills(options) {
|
|
181
|
-
const
|
|
197
|
+
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
198
|
+
const resolvedSources = resolveSkillSources(options, skillsConfig);
|
|
199
|
+
const maxSkillFileBytes = resolveMaxSkillFileBytes(skillsConfig);
|
|
182
200
|
const skillMap = /* @__PURE__ */ new Map();
|
|
183
|
-
const diagnostics = [];
|
|
184
|
-
|
|
185
|
-
const discovered = discoverSkills(
|
|
201
|
+
const diagnostics = [...resolvedSources.diagnostics];
|
|
202
|
+
for (const source of resolvedSources.sources) {
|
|
203
|
+
const discovered = discoverSkills(source, maxSkillFileBytes);
|
|
186
204
|
diagnostics.push(...discovered.diagnostics);
|
|
187
|
-
for (const skill of discovered.skills)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
for (const extraDir of extraDirs) if (existsSync(extraDir)) {
|
|
202
|
-
const discovered = discoverSkills(extraDir, "global");
|
|
203
|
-
diagnostics.push(...discovered.diagnostics);
|
|
204
|
-
for (const skill of discovered.skills) if (!skillMap.has(skill.name)) skillMap.set(skill.name, skill);
|
|
205
|
+
for (const skill of discovered.skills) {
|
|
206
|
+
const previous = skillMap.get(skill.name);
|
|
207
|
+
if (previous) {
|
|
208
|
+
const winner = skill.origin.priority > previous.origin.priority ? skill : previous;
|
|
209
|
+
const shadowed = winner === skill ? previous : skill;
|
|
210
|
+
diagnostics.push({
|
|
211
|
+
type: "collision",
|
|
212
|
+
skillName: skill.name,
|
|
213
|
+
path: winner.filePath,
|
|
214
|
+
message: `Skill "${skill.name}" from ${winner.origin.id} (${winner.filePath}) shadows ${shadowed.origin.id} (${shadowed.filePath})`
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
if (!previous || skill.origin.priority > previous.origin.priority) skillMap.set(skill.name, skill);
|
|
218
|
+
}
|
|
205
219
|
}
|
|
206
|
-
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
207
220
|
const merged = Array.from(skillMap.values());
|
|
208
221
|
return {
|
|
209
222
|
skills: merged,
|
|
@@ -213,21 +226,21 @@ function loadSkills(options) {
|
|
|
213
226
|
}
|
|
214
227
|
/** Discover only skills owned by a workspace, without global or bundled skills. */
|
|
215
228
|
function loadWorkspaceSkills(workspaceDir) {
|
|
216
|
-
const
|
|
229
|
+
const maxSkillFileBytes = resolveMaxSkillFileBytes(createSkillConfigManager(resolveStateDir()).load());
|
|
230
|
+
const discovered = discoverSkills(resolveWorkspaceSkillSource(workspaceDir), maxSkillFileBytes);
|
|
217
231
|
return {
|
|
218
232
|
skills: discovered.skills,
|
|
219
233
|
prompt: formatSkillsForPrompt(discovered.skills),
|
|
220
234
|
diagnostics: discovered.diagnostics
|
|
221
235
|
};
|
|
222
236
|
}
|
|
223
|
-
function createSkillLoader() {
|
|
237
|
+
function createSkillLoader(options = {}) {
|
|
224
238
|
let cachedSkills = [];
|
|
225
239
|
let cachedPrompt = "";
|
|
226
240
|
let cachedDiagnostics = [];
|
|
227
241
|
let lastLoadTime = 0;
|
|
228
242
|
let workspaceDir;
|
|
229
243
|
let builtinDir;
|
|
230
|
-
let extraDirs = [];
|
|
231
244
|
function updateCache(result) {
|
|
232
245
|
cachedSkills = result.skills;
|
|
233
246
|
cachedPrompt = result.prompt;
|
|
@@ -235,30 +248,26 @@ function createSkillLoader() {
|
|
|
235
248
|
lastLoadTime = Date.now();
|
|
236
249
|
return result;
|
|
237
250
|
}
|
|
251
|
+
function loadCurrentSkills() {
|
|
252
|
+
const workspaceTrust = workspaceDir && options.isWorkspaceTrusted?.(workspaceDir) === true ? "trusted" : "untrusted";
|
|
253
|
+
return loadSkills({
|
|
254
|
+
workspaceDir,
|
|
255
|
+
builtinDir,
|
|
256
|
+
workspaceTrust
|
|
257
|
+
});
|
|
258
|
+
}
|
|
238
259
|
return {
|
|
239
260
|
init: (workspace, builtin) => {
|
|
240
261
|
workspaceDir = workspace;
|
|
241
262
|
builtinDir = builtin || void 0;
|
|
242
|
-
return updateCache(
|
|
243
|
-
workspaceDir,
|
|
244
|
-
builtinDir,
|
|
245
|
-
extraDirs
|
|
246
|
-
}));
|
|
263
|
+
return updateCache(loadCurrentSkills());
|
|
247
264
|
},
|
|
248
265
|
load: () => {
|
|
249
|
-
return updateCache(
|
|
250
|
-
workspaceDir,
|
|
251
|
-
builtinDir,
|
|
252
|
-
extraDirs
|
|
253
|
-
}));
|
|
266
|
+
return updateCache(loadCurrentSkills());
|
|
254
267
|
},
|
|
255
268
|
reload: () => {
|
|
256
269
|
log.info("Reloading skills");
|
|
257
|
-
return updateCache(
|
|
258
|
-
workspaceDir,
|
|
259
|
-
builtinDir,
|
|
260
|
-
extraDirs
|
|
261
|
-
}));
|
|
270
|
+
return updateCache(loadCurrentSkills());
|
|
262
271
|
},
|
|
263
272
|
refreshPromptFromConfig: () => {
|
|
264
273
|
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
@@ -116,7 +116,7 @@ function canWriteToPath(skillBaseDir, workspace, policy) {
|
|
|
116
116
|
}
|
|
117
117
|
function mutatableSkillOrNull(skill, workspace, policy) {
|
|
118
118
|
if (!skill) return null;
|
|
119
|
-
if (skill.
|
|
119
|
+
if (!skill.origin?.managed || !skill.origin.writable) return null;
|
|
120
120
|
if (!canWriteToPath(skill.baseDir, workspace, policy)) return null;
|
|
121
121
|
return skill;
|
|
122
122
|
}
|
|
@@ -9,6 +9,9 @@ export interface SkillLoadResult {
|
|
|
9
9
|
prompt: string;
|
|
10
10
|
diagnostics: SkillDiagnostic[];
|
|
11
11
|
}
|
|
12
|
+
export interface SkillManagerOptions {
|
|
13
|
+
isWorkspaceTrusted?: (workspaceDir: string) => boolean;
|
|
14
|
+
}
|
|
12
15
|
export declare class SkillManager {
|
|
13
16
|
private skillPrompt;
|
|
14
17
|
private skills;
|
|
@@ -24,7 +27,7 @@ export declare class SkillManager {
|
|
|
24
27
|
private lastReloadReason;
|
|
25
28
|
private lastReloadOk;
|
|
26
29
|
private lastReloadError;
|
|
27
|
-
constructor(workspace: string, bundledSkillsDir?: string);
|
|
30
|
+
constructor(workspace: string, bundledSkillsDir?: string, options?: SkillManagerOptions);
|
|
28
31
|
/**
|
|
29
32
|
* Initialize skills from workspace and bundled directories
|
|
30
33
|
*/
|
|
@@ -36,7 +39,7 @@ export declare class SkillManager {
|
|
|
36
39
|
/**
|
|
37
40
|
* Reload skills from disk
|
|
38
41
|
*/
|
|
39
|
-
reload(): void;
|
|
42
|
+
reload(reason?: 'disk' | 'trust'): void;
|
|
40
43
|
private runReload;
|
|
41
44
|
private applyLoadResult;
|
|
42
45
|
/**
|
|
@@ -18,7 +18,7 @@ const SKILL_TOKEN_RE = /\/skill:([A-Za-z0-9][A-Za-z0-9._-]*)/g;
|
|
|
18
18
|
var SkillManager = class {
|
|
19
19
|
skillPrompt = "";
|
|
20
20
|
skills = [];
|
|
21
|
-
skillLoader
|
|
21
|
+
skillLoader;
|
|
22
22
|
workspace;
|
|
23
23
|
bundledSkillsDir;
|
|
24
24
|
version = 0;
|
|
@@ -30,9 +30,10 @@ var SkillManager = class {
|
|
|
30
30
|
lastReloadReason;
|
|
31
31
|
lastReloadOk;
|
|
32
32
|
lastReloadError;
|
|
33
|
-
constructor(workspace, bundledSkillsDir) {
|
|
33
|
+
constructor(workspace, bundledSkillsDir, options = {}) {
|
|
34
34
|
this.workspace = workspace;
|
|
35
35
|
this.bundledSkillsDir = bundledSkillsDir || resolveBundledSkillsDir();
|
|
36
|
+
this.skillLoader = createSkillLoader({ isWorkspaceTrusted: options.isWorkspaceTrusted });
|
|
36
37
|
this.initialize();
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
@@ -56,8 +57,8 @@ var SkillManager = class {
|
|
|
56
57
|
/**
|
|
57
58
|
* Reload skills from disk
|
|
58
59
|
*/
|
|
59
|
-
reload() {
|
|
60
|
-
this.runReload(
|
|
60
|
+
reload(reason = "disk") {
|
|
61
|
+
this.runReload(reason, () => this.skillLoader.reload());
|
|
61
62
|
}
|
|
62
63
|
runReload(reason, load) {
|
|
63
64
|
if (this.reloadInProgress) {
|
|
@@ -97,7 +98,11 @@ var SkillManager = class {
|
|
|
97
98
|
this.skills = result.skills;
|
|
98
99
|
this.version += 1;
|
|
99
100
|
this.loadedAt = Date.now();
|
|
100
|
-
for (const diag of result.diagnostics) if (diag.type === "
|
|
101
|
+
for (const diag of result.diagnostics) if (diag.type === "skipped") log.debug({
|
|
102
|
+
path: diag.path,
|
|
103
|
+
message: diag.message
|
|
104
|
+
}, "Skill source skipped");
|
|
105
|
+
else if (diag.type === "warning" || diag.type === "collision") log.warn({
|
|
101
106
|
skill: diag.skillName,
|
|
102
107
|
path: diag.path,
|
|
103
108
|
message: diag.message
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SkillDiagnostic, SkillSourceDescriptor, SkillsConfig } from './types.js';
|
|
2
|
+
export interface ResolveSkillSourcesOptions {
|
|
3
|
+
workspaceDir?: string;
|
|
4
|
+
globalDir?: string;
|
|
5
|
+
builtinDir?: string;
|
|
6
|
+
agentsDir?: string;
|
|
7
|
+
extraDirs?: string[];
|
|
8
|
+
/** Project compatibility sources fail closed unless trust is explicitly granted. */
|
|
9
|
+
workspaceTrust?: 'trusted' | 'untrusted';
|
|
10
|
+
}
|
|
11
|
+
export interface ResolveSkillSourcesResult {
|
|
12
|
+
sources: SkillSourceDescriptor[];
|
|
13
|
+
diagnostics: SkillDiagnostic[];
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveSkillSources(options: ResolveSkillSourcesOptions, skillsConfig: SkillsConfig): ResolveSkillSourcesResult;
|
|
16
|
+
export declare function resolveAgentsSkillsDir(env?: NodeJS.ProcessEnv): string;
|
|
17
|
+
export declare function resolveWorkspaceAgentsSkillsDir(workspaceDir: string): string;
|
|
18
|
+
export declare function resolveWorkspaceSkillSource(workspaceDir: string): SkillSourceDescriptor;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { init_paths, resolveSkillsDir } from "../../config/paths.js";
|
|
2
|
+
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
5
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
6
|
+
//#region src/agent/skills/skill-sources.ts
|
|
7
|
+
init_paths();
|
|
8
|
+
const PRIORITY = {
|
|
9
|
+
extra: 100,
|
|
10
|
+
bundled: 200,
|
|
11
|
+
agentsGlobal: 300,
|
|
12
|
+
xopcGlobalCustom: 390,
|
|
13
|
+
xopcGlobal: 400,
|
|
14
|
+
agentsWorkspace: 450,
|
|
15
|
+
xopcWorkspace: 500
|
|
16
|
+
};
|
|
17
|
+
function canonicalRoot(rootDir) {
|
|
18
|
+
const absolute = resolve(rootDir);
|
|
19
|
+
if (!existsSync(absolute)) return absolute;
|
|
20
|
+
try {
|
|
21
|
+
return realpathSync(absolute);
|
|
22
|
+
} catch {
|
|
23
|
+
return absolute;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function descriptor(options) {
|
|
27
|
+
return {
|
|
28
|
+
...options,
|
|
29
|
+
rootDir: canonicalRoot(options.rootDir)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function dedupeSources(sources) {
|
|
33
|
+
const byRoot = /* @__PURE__ */ new Map();
|
|
34
|
+
for (const source of sources) {
|
|
35
|
+
const existing = byRoot.get(source.rootDir);
|
|
36
|
+
if (!existing || source.priority > existing.priority) byRoot.set(source.rootDir, source);
|
|
37
|
+
}
|
|
38
|
+
return [...byRoot.values()].sort((a, b) => a.priority - b.priority);
|
|
39
|
+
}
|
|
40
|
+
function isSameOrInside(parent, child) {
|
|
41
|
+
const rel = relative(parent, child);
|
|
42
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
|
|
43
|
+
}
|
|
44
|
+
function resolveSkillSources(options, skillsConfig) {
|
|
45
|
+
const configuredExtraDirs = Array.isArray(skillsConfig.load?.extraDirs) ? skillsConfig.load.extraDirs.filter((dir) => typeof dir === "string" && dir.trim().length > 0) : [];
|
|
46
|
+
const optionExtraDirs = Array.isArray(options.extraDirs) ? options.extraDirs.filter((dir) => typeof dir === "string" && dir.trim().length > 0) : [];
|
|
47
|
+
const extraDirs = [...configuredExtraDirs, ...optionExtraDirs];
|
|
48
|
+
const sources = [];
|
|
49
|
+
const diagnostics = [];
|
|
50
|
+
for (const rootDir of extraDirs) sources.push(descriptor({
|
|
51
|
+
id: "extra",
|
|
52
|
+
rootDir,
|
|
53
|
+
priority: PRIORITY.extra,
|
|
54
|
+
scope: "extra",
|
|
55
|
+
managed: false,
|
|
56
|
+
writable: false
|
|
57
|
+
}));
|
|
58
|
+
if (options.builtinDir) sources.push(descriptor({
|
|
59
|
+
id: "bundled",
|
|
60
|
+
rootDir: options.builtinDir,
|
|
61
|
+
priority: PRIORITY.bundled,
|
|
62
|
+
scope: "builtin",
|
|
63
|
+
managed: false,
|
|
64
|
+
writable: false
|
|
65
|
+
}));
|
|
66
|
+
if (skillsConfig.load?.sources?.agentsGlobal?.enabled !== false) sources.push(descriptor({
|
|
67
|
+
id: "agents-global",
|
|
68
|
+
rootDir: options.agentsDir ?? resolveAgentsSkillsDir(),
|
|
69
|
+
priority: PRIORITY.agentsGlobal,
|
|
70
|
+
scope: "global",
|
|
71
|
+
managed: false,
|
|
72
|
+
writable: false
|
|
73
|
+
}));
|
|
74
|
+
if (options.globalDir) sources.push(descriptor({
|
|
75
|
+
id: "custom-global",
|
|
76
|
+
rootDir: options.globalDir,
|
|
77
|
+
priority: PRIORITY.xopcGlobalCustom,
|
|
78
|
+
scope: "global",
|
|
79
|
+
managed: false,
|
|
80
|
+
writable: false
|
|
81
|
+
}));
|
|
82
|
+
sources.push(descriptor({
|
|
83
|
+
id: "xopc-global",
|
|
84
|
+
rootDir: resolveSkillsDir(),
|
|
85
|
+
priority: PRIORITY.xopcGlobal,
|
|
86
|
+
scope: "global",
|
|
87
|
+
managed: true,
|
|
88
|
+
writable: true
|
|
89
|
+
}));
|
|
90
|
+
if (options.workspaceDir) {
|
|
91
|
+
const canonicalWorkspace = canonicalRoot(options.workspaceDir);
|
|
92
|
+
const agentsGlobalRoot = canonicalRoot(options.agentsDir ?? resolveAgentsSkillsDir());
|
|
93
|
+
const workspaceAgentsRoot = canonicalRoot(resolveWorkspaceAgentsSkillsDir(options.workspaceDir));
|
|
94
|
+
if (skillsConfig.load?.sources?.agentsWorkspace?.enabled !== false && workspaceAgentsRoot !== agentsGlobalRoot && existsSync(workspaceAgentsRoot)) if (!isSameOrInside(canonicalWorkspace, workspaceAgentsRoot)) diagnostics.push({
|
|
95
|
+
type: "warning",
|
|
96
|
+
path: workspaceAgentsRoot,
|
|
97
|
+
message: `Skipped agents-workspace skill source outside workspace: ${workspaceAgentsRoot}`
|
|
98
|
+
});
|
|
99
|
+
else if (options.workspaceTrust !== "trusted") diagnostics.push({
|
|
100
|
+
type: "skipped",
|
|
101
|
+
path: workspaceAgentsRoot,
|
|
102
|
+
message: `Skipped agents-workspace skill source because workspace is not trusted: ${workspaceAgentsRoot}`
|
|
103
|
+
});
|
|
104
|
+
else sources.push(descriptor({
|
|
105
|
+
id: "agents-workspace",
|
|
106
|
+
rootDir: workspaceAgentsRoot,
|
|
107
|
+
priority: PRIORITY.agentsWorkspace,
|
|
108
|
+
scope: "workspace",
|
|
109
|
+
managed: false,
|
|
110
|
+
writable: false
|
|
111
|
+
}));
|
|
112
|
+
sources.push(descriptor({
|
|
113
|
+
id: "xopc-workspace",
|
|
114
|
+
rootDir: resolveWorkspaceSkillsDir(options.workspaceDir),
|
|
115
|
+
priority: PRIORITY.xopcWorkspace,
|
|
116
|
+
scope: "workspace",
|
|
117
|
+
managed: true,
|
|
118
|
+
writable: true
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
sources: dedupeSources(sources),
|
|
123
|
+
diagnostics
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function resolveAgentsSkillsDir(env = process.env) {
|
|
127
|
+
return join(env.HOME || homedir(), ".agents", "skills");
|
|
128
|
+
}
|
|
129
|
+
function resolveWorkspaceAgentsSkillsDir(workspaceDir) {
|
|
130
|
+
return join(workspaceDir, ".agents", "skills");
|
|
131
|
+
}
|
|
132
|
+
function resolveWorkspaceSkillSource(workspaceDir) {
|
|
133
|
+
return descriptor({
|
|
134
|
+
id: "xopc-workspace",
|
|
135
|
+
rootDir: resolveWorkspaceSkillsDir(workspaceDir),
|
|
136
|
+
priority: PRIORITY.xopcWorkspace,
|
|
137
|
+
scope: "workspace",
|
|
138
|
+
managed: true,
|
|
139
|
+
writable: true
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
export { resolveAgentsSkillsDir, resolveSkillSources, resolveWorkspaceAgentsSkillsDir, resolveWorkspaceSkillSource };
|
|
@@ -80,11 +80,32 @@ export interface SkillConfig {
|
|
|
80
80
|
export interface SkillsLoadConfig {
|
|
81
81
|
/** Additional skill folders to scan */
|
|
82
82
|
extraDirs?: string[];
|
|
83
|
+
/** Built-in compatibility sources. */
|
|
84
|
+
sources?: {
|
|
85
|
+
/** Read user-installed skills from ~/.agents/skills. Defaults to enabled. */
|
|
86
|
+
agentsGlobal?: {
|
|
87
|
+
enabled?: boolean;
|
|
88
|
+
};
|
|
89
|
+
/** Read project skills from <workspace>/.agents/skills. Defaults to enabled for trusted workspaces. */
|
|
90
|
+
agentsWorkspace?: {
|
|
91
|
+
enabled?: boolean;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
83
94
|
/** Watch skill folders for changes */
|
|
84
95
|
watch?: boolean;
|
|
85
96
|
/** Debounce for the skills watcher (ms) */
|
|
86
97
|
watchDebounceMs?: number;
|
|
87
98
|
}
|
|
99
|
+
export type SkillOriginId = 'extra' | 'bundled' | 'agents-global' | 'agents-workspace' | 'custom-global' | 'xopc-global' | 'xopc-workspace';
|
|
100
|
+
export interface SkillSourceDescriptor {
|
|
101
|
+
id: SkillOriginId;
|
|
102
|
+
rootDir: string;
|
|
103
|
+
priority: number;
|
|
104
|
+
scope: 'builtin' | 'workspace' | 'global' | 'extra';
|
|
105
|
+
managed: boolean;
|
|
106
|
+
writable: boolean;
|
|
107
|
+
}
|
|
108
|
+
export type SkillOrigin = SkillSourceDescriptor;
|
|
88
109
|
export interface SkillsInstallConfig {
|
|
89
110
|
/** Prefer brew for package installation */
|
|
90
111
|
preferBrew?: boolean;
|
|
@@ -137,6 +158,8 @@ export interface Skill {
|
|
|
137
158
|
baseDir: string;
|
|
138
159
|
/** Source of the skill */
|
|
139
160
|
source: 'builtin' | 'workspace' | 'global' | 'extra';
|
|
161
|
+
/** Concrete source root and its management policy. */
|
|
162
|
+
origin: SkillOrigin;
|
|
140
163
|
/** Disable model invocation for this skill */
|
|
141
164
|
disableModelInvocation: boolean;
|
|
142
165
|
/** Parsed metadata */
|
|
@@ -207,7 +230,7 @@ export interface LoadSkillsResult {
|
|
|
207
230
|
diagnostics: SkillDiagnostic[];
|
|
208
231
|
}
|
|
209
232
|
export interface SkillDiagnostic {
|
|
210
|
-
type: 'warning' | 'collision' | 'error';
|
|
233
|
+
type: 'skipped' | 'warning' | 'collision' | 'error';
|
|
211
234
|
skillName?: string;
|
|
212
235
|
message: string;
|
|
213
236
|
path?: string;
|
|
@@ -219,7 +242,7 @@ export interface SkillRuntimeStatus {
|
|
|
219
242
|
reloadPending: boolean;
|
|
220
243
|
lastReloadStartedAt?: number;
|
|
221
244
|
lastReloadFinishedAt?: number;
|
|
222
|
-
lastReloadReason?: 'initial' | 'disk' | 'config';
|
|
245
|
+
lastReloadReason?: 'initial' | 'disk' | 'config' | 'trust';
|
|
223
246
|
lastReloadOk?: boolean;
|
|
224
247
|
lastReloadError?: string;
|
|
225
248
|
}
|
|
@@ -30,7 +30,8 @@ const DELEGATE_BLOCKED_TOOLS = new Set([
|
|
|
30
30
|
"skill_manage",
|
|
31
31
|
"skills_marketplace_search",
|
|
32
32
|
"skill_install",
|
|
33
|
-
"bundle-mcp"
|
|
33
|
+
"bundle-mcp",
|
|
34
|
+
"managed_job"
|
|
34
35
|
]);
|
|
35
36
|
const DelegateTaskSchema = Type.Object({
|
|
36
37
|
goal: Type.String({ description: "Clear description of what the sub-agent should accomplish" }),
|
|
@@ -18,6 +18,8 @@ import type { ToolConcurrencyController as ToolConcurrencyControllerType } from
|
|
|
18
18
|
export interface ToolExecutorConfig {
|
|
19
19
|
/** Default per-tool timeout when the tool does not declare its own `timeoutMs`. */
|
|
20
20
|
defaultTimeoutMs: number;
|
|
21
|
+
/** Per-session policy override resolved from the effective agent manifest. */
|
|
22
|
+
resolveTimeoutMs?: (toolName: string) => number | undefined;
|
|
21
23
|
/** Max retry attempts for tools opted into retry via `idempotent: true`. */
|
|
22
24
|
maxRetries: number;
|
|
23
25
|
/** Initial backoff between retries (passed straight to `withRetry`). */
|
|
@@ -21,7 +21,9 @@ function readToolHints(tool) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
function resolveTimeoutMs(tool, config) {
|
|
24
|
-
|
|
24
|
+
const hints = readToolHints(tool);
|
|
25
|
+
const policyTimeoutMs = config.resolveTimeoutMs?.(tool.name);
|
|
26
|
+
return policyTimeoutMs && policyTimeoutMs > 0 ? policyTimeoutMs : hints.timeoutMs ?? config.defaultTimeoutMs;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Execute tool with timeout (always) and retry (only for idempotent tools).
|
|
@@ -34,22 +36,27 @@ async function executeToolWithProtection(tool, toolCallId, params, signal, onUpd
|
|
|
34
36
|
};
|
|
35
37
|
const toolName = tool.name;
|
|
36
38
|
const hints = readToolHints(tool);
|
|
37
|
-
const runOnce = () =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const runOnce = () => {
|
|
40
|
+
const controller = new AbortController();
|
|
41
|
+
const onParentAbort = () => controller.abort(signal?.reason);
|
|
42
|
+
if (signal?.aborted) onParentAbort();
|
|
43
|
+
else signal?.addEventListener("abort", onParentAbort, { once: true });
|
|
44
|
+
const execute = () => tool.execute(toolCallId, params, controller.signal, onUpdate);
|
|
45
|
+
return (fullConfig.enableTimeout ? executeWithTimeout(execute, {
|
|
43
46
|
toolName,
|
|
44
|
-
timeoutMs,
|
|
45
|
-
description: `Executing ${toolName}
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
timeoutMs: resolveTimeoutMs(tool, fullConfig),
|
|
48
|
+
description: `Executing ${toolName}`,
|
|
49
|
+
signal,
|
|
50
|
+
onTimeout: (error) => controller.abort(error)
|
|
51
|
+
}) : execute()).finally(() => signal?.removeEventListener("abort", onParentAbort));
|
|
52
|
+
};
|
|
53
|
+
let operation = runOnce;
|
|
48
54
|
if (fullConfig.enableRetry && fullConfig.maxRetries > 0 && hints.idempotent) {
|
|
49
55
|
const inner = operation;
|
|
50
56
|
operation = () => withRetry(inner, {
|
|
51
57
|
attempts: fullConfig.maxRetries + 1,
|
|
52
58
|
minDelayMs: fullConfig.retryDelayMs,
|
|
59
|
+
shouldRetry: (error) => !signal?.aborted && error?.name !== "AbortError",
|
|
53
60
|
onRetry: (info) => {
|
|
54
61
|
log.warn({
|
|
55
62
|
tool: toolName,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
4
|
+
import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
|
|
5
|
+
import "../../storage/sqlite/index.js";
|
|
3
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
4
7
|
import { createReadFileTool } from "./read.js";
|
|
5
8
|
import { createWriteFileTool } from "./write.js";
|
|
@@ -43,6 +46,7 @@ import { createSkillInstallTool } from "./skill-install-tool.js";
|
|
|
43
46
|
import { createToolManualTool } from "./tool-manual-tool.js";
|
|
44
47
|
import { createDesktopPetTool } from "./desktop-pet-tool.js";
|
|
45
48
|
import { createCodeIntelligenceTools } from "../code-intelligence/tools.js";
|
|
49
|
+
import { createManagedJobTool } from "./managed-job-tool.js";
|
|
46
50
|
import { createImageTool } from "./image-tool.js";
|
|
47
51
|
import { createImageGenerateTool } from "./image-generate-tool.js";
|
|
48
52
|
import "./index.js";
|
|
@@ -217,7 +221,19 @@ var AgentToolsFactory = class {
|
|
|
217
221
|
if (!CLARIFY_SUPPORTED_CHANNELS.has(ctx.channel)) return null;
|
|
218
222
|
return (r) => req(ctx.sessionKey, r);
|
|
219
223
|
} }),
|
|
220
|
-
createTodoTool({
|
|
224
|
+
createTodoTool({
|
|
225
|
+
getSessionKey: () => this.deps.getCurrentContext()?.sessionKey,
|
|
226
|
+
repository: {
|
|
227
|
+
isAvailable: isXopcDatabaseOpen,
|
|
228
|
+
read: (sessionKey) => getSessionTaskPlan(sessionKey)?.items ?? [],
|
|
229
|
+
write: (sessionKey, items) => {
|
|
230
|
+
setSessionTaskPlan({
|
|
231
|
+
sessionKey,
|
|
232
|
+
items
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}),
|
|
221
237
|
createUpdatePlanTool(),
|
|
222
238
|
...getSkillMgr ? [
|
|
223
239
|
createSkillsListTool({
|
|
@@ -255,6 +271,7 @@ var AgentToolsFactory = class {
|
|
|
255
271
|
getSkillPassthroughEnvVarNames: this.deps.getSkillPassthroughEnvVarNames,
|
|
256
272
|
recordGoalEvidence
|
|
257
273
|
}),
|
|
274
|
+
createManagedJobTool(workspace, () => this.deps.getCurrentContext()?.sessionKey, this.deps.getSkillPassthroughEnvVarNames),
|
|
258
275
|
createWebSearchTool(() => this.deps.getConfig?.()),
|
|
259
276
|
createWebFetchTool(() => this.deps.getConfig?.()),
|
|
260
277
|
createWebExtractTool({ getConfig: () => this.deps.getConfig?.() }),
|
|
@@ -3,6 +3,8 @@ import "../../storage/sqlite/index.js";
|
|
|
3
3
|
import { GoalService } from "../../goals/goal-service.js";
|
|
4
4
|
import "../../goals/index.js";
|
|
5
5
|
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
6
|
+
import { OutcomeExecutionService } from "../../work/outcome-execution-service.js";
|
|
7
|
+
import "../../work/index.js";
|
|
6
8
|
import { Type } from "@sinclair/typebox";
|
|
7
9
|
//#region src/agent/tools/goal-tool.ts
|
|
8
10
|
const GoalToolSchema = Type.Object({
|
|
@@ -92,8 +94,8 @@ function createGoalTool(options = {}) {
|
|
|
92
94
|
if (!title) return textResult("Error: title is required.");
|
|
93
95
|
const sessionKey = params.sessionKey?.trim() || options.getCurrentSessionKey?.()?.trim();
|
|
94
96
|
const projectId = params.projectId?.trim() || (sessionKey ? getSessionMetadata(sessionKey)?.projectId : void 0);
|
|
95
|
-
const goal =
|
|
96
|
-
title,
|
|
97
|
+
const goal = new OutcomeExecutionService().create({
|
|
98
|
+
objective: title,
|
|
97
99
|
description: params.description,
|
|
98
100
|
agentId: params.agentId,
|
|
99
101
|
sessionKey,
|
|
@@ -103,7 +105,7 @@ function createGoalTool(options = {}) {
|
|
|
103
105
|
judgeModelRef: params.judgeModelRef,
|
|
104
106
|
maxTurns: params.maxTurns,
|
|
105
107
|
source: "workflow"
|
|
106
|
-
});
|
|
108
|
+
}).goal;
|
|
107
109
|
return textResult(`Created goal ${goal.id}\n${goal.title}`, {
|
|
108
110
|
goal,
|
|
109
111
|
delivery: goalDelivery(goal, "created")
|