@xopcai/xopc 0.0.187 → 0.0.188
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/demo-memory/src/index.js +1 -0
- package/dist/extensions/feishu/src/streaming/streaming-adapter.js +1 -3
- package/dist/extensions/telegram/src/adapters/streaming-adapter.js +0 -2
- package/dist/extensions/telegram/src/draft-stream.d.ts +0 -4
- package/dist/extensions/telegram/src/draft-stream.js +1 -53
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-WlR2zEvA.js → activity-store--QoUGhiS.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-RedDszrG.js → agent-avatar-dicebear-B0yweLNQ.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Df9mTa-K.js → agents-C6OV-gMm.js} +1 -1
- package/dist/gateway/static/root/assets/{api-tVOllncq.js → api-5laWqfiE.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C9hKBzaF.js → app-management-settings-panel-BXJ8Jiv_.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-5cQvq7hd.js → appearance-settings-DG9n9D1M.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Bd3tN-k2.js → apps-page-Ci14lDeO.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Ct-shK4n.js → archive-plugin-Ceh5qrZf.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CpPj3m-q.js → attachment-load-jFW7uYf7.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-Q1xmb4Rh.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BpSXZBle.js → binary-plugins-XDlkI1r4.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B8hR2tXc.js → block-editor-kyKc2IhE.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-jb5Hf-hm.js → browser-settings-page-DbowrHXD.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-D_LAXUrh.js → browser-workflow-inputs-BJa5Iz_v.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CPAs7-6s.js → browser-workflows-page-CTQQOsn5.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BjUe4raq.js → capabilities-settings-panel-DoZPFdKF.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-CKklVY2p.js → capability-presets-api-Dn-7MMEo.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-DiWIMYRr.js → capability-presets-settings-panel-Bt8Hnx0h.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-WWN-nbFL.js → channel-recipient-api-BgIkWq01.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-D8IkjMuX.js → channels-settings-Bpsebsru.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DFmdYRE5.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-CdNkVFdB.js → connector-logo-TRr9ybf6.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BT2ahw52.js → connectors-page-Tg5kl22i.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bm_IEAf3.js → desktop-pet-CSwd00CV.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-C0Ve04-G.js → desktop-pet-settings-CuNQvHGu.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-B2cvhvAI.js → directory-picker-path-field-ct0n5Rje.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DNashgGu.js → extension-debug-page-BeRBuMUU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bvo-5htX.js → extension-page-DbK-Cwao.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BBESdISV.js → extension-settings-page-C9ag5tb5.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-ClQvokMo.js → gateway-config-api-CC7EvEFp.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CIRs2QVy.js → gateway-settings-9g8uIry9.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CntXJF6W.js → gateway-startup-retry-B2DmdlwO.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CWKcZuvc.js → heartbeat-settings-fl1oC_-5.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-C59f8UJw.js → home-page-Bao9jq_z.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-DjSAQwGy.js → image-generation-api-GMTaS6eI.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cl5n1f_U.css +1 -0
- package/dist/gateway/static/root/assets/index-OJgiMh07.js +223 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ahKHpjoW.js → keyboard-shortcuts-settings-DhGYddbI.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DRB4UQBE.js → local-app-workbench-page-B69NvtvH.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-B6GKdgza.js → local-apps-page-CmnrBmWi.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Bff30u5V.js → locale-store-D6hs74o5.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CNp4XiBN.js → logs-page-Cq3cABqg.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BeNMJm_i.js → markdown-split-CZaBPOVn.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bdzrj_-6.js → media-plugins-CiKvSgCv.js} +1 -1
- package/dist/gateway/static/root/assets/messages-D02NNLCZ.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-MYIi-9S9.js → notes-page-Bisbzqlz.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-DqSkeDXX.js → notes-workbench-BOZfJFhE.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-3t88bbGx.js → page-tabs-BxlwhAbH.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Cf_BWbeE.js → preview-open-alternatives-RM8wXxfT.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CKq73c98.js → product-open-page-DdBlibek.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BrbHs4Wp.js → project-detail-page-TSKFb2tN.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-B80rtkj6.js → projects-page-BokeBrTT.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-_Q3GEznb.js → remote-access-hub-C56anxCX.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-NqOm-OG1.js → schema-form-BDKbpmXv.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-55dJOUVg.js → sessions-page-C7TQADrD.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BDOPKeAX.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DYAS8p8z.js → settings-form-section-zxo5ZGOu.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DZFhxihA.js → settings-loading-skeleton-DgIp8_S6.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BSIiMLi-.js → settings-page-BUPSIa9P.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DfFfkdED.js → settings-page-layout-97LmwrzC.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-q_yE6-H1.js → setup-status-panel-BRg766eW.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CYtrQaZN.js → share-preview-page-BH7i3g1S.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-gYkRX9Ik.js → shares-settings-DhEAviQ_.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Ct7AV8ls.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-GZHKDFSb.js → skills-page-DoVuprZm.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-BBXirAjc.js → skills-page.utils-s-a5WV9j.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DLf5YvFl.js → system-settings-panel-BxjeMT5k.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DFGkuYfl.js → task-detail-page-BahycnfW.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-y7e_tvYi.js → theme-store-BRxdsmic.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-5sHEZ5w5.js → time-picker-BGk_Tbsj.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DR12j_dr.js → typed-models-lib-39MjwPSq.js} +1 -1
- package/dist/gateway/static/root/assets/{use-save-bar-registration-BsvcJgZl.js → use-save-bar-registration-5aVSjTjO.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-q5dr8JFG.js → user-context-page-B9K41qmy.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DKADXFWD.js → voice-api-key-field-XU-7sBSg.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BC1nExf8.js → work-discovery-overlay-CJqu8UHq.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-fNvSg40M.js → work-discovery-page-BBVnRHju.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C8X5W-8k.js → workflow-run-setup-panel-DXtg8Qxl.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-YJBKmPYK.js → workflows-page-Bs_tYfst.js} +1 -1
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tool-activity.js +223 -0
- package/dist/src/agent/agent-manager.js +2 -8
- package/dist/src/agent/code-intelligence/binary.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +0 -2
- package/dist/src/agent/embedded/run-for-session.js +99 -112
- package/dist/src/agent/external-tools/composio-provider.d.ts +29 -0
- package/dist/src/agent/external-tools/composio-provider.js +307 -0
- package/dist/src/agent/external-tools/extension-provider.d.ts +20 -0
- package/dist/src/agent/external-tools/extension-provider.js +68 -0
- package/dist/src/agent/external-tools/gateway-tools.d.ts +8 -0
- package/dist/src/agent/external-tools/gateway-tools.js +89 -0
- package/dist/src/agent/external-tools/index.d.ts +24 -0
- package/dist/src/agent/external-tools/index.js +40 -0
- package/dist/src/agent/external-tools/mcp-provider.d.ts +29 -0
- package/dist/src/agent/external-tools/mcp-provider.js +118 -0
- package/dist/src/agent/external-tools/memory-provider.d.ts +21 -0
- package/dist/src/agent/external-tools/memory-provider.js +56 -0
- package/dist/src/agent/external-tools/refs.d.ts +5 -0
- package/dist/src/agent/external-tools/refs.js +18 -0
- package/dist/src/agent/external-tools/service.d.ts +26 -0
- package/dist/src/agent/external-tools/service.js +117 -0
- package/dist/src/agent/external-tools/types.d.ts +28 -0
- package/dist/src/agent/external-tools/types.js +9 -0
- package/dist/src/agent/inbound/inbound-loop.d.ts +0 -2
- package/dist/src/agent/inbound/inbound-loop.js +0 -3
- package/dist/src/agent/mcp/{bundle-mcp-materialize.d.ts → bundle-mcp-gateway.d.ts} +1 -19
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +60 -0
- package/dist/src/agent/mcp/bundle-mcp-names.d.ts +0 -8
- package/dist/src/agent/mcp/bundle-mcp-names.js +2 -29
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +4 -7
- package/dist/src/agent/mcp/bundle-mcp-policy.js +6 -20
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.d.ts +1 -2
- package/dist/src/agent/mcp/bundle-mcp-tools.js +1 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +0 -5
- package/dist/src/agent/mcp/index.d.ts +0 -2
- package/dist/src/agent/mcp/index.js +2 -5
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/memory/context/planner.d.ts +1 -0
- package/dist/src/agent/memory/context/planner.js +22 -7
- package/dist/src/agent/memory/manager.d.ts +4 -1
- package/dist/src/agent/memory/manager.js +5 -2
- package/dist/src/agent/memory/types.d.ts +2 -0
- package/dist/src/agent/messaging/stream-manager.d.ts +2 -14
- package/dist/src/agent/messaging/stream-manager.js +0 -12
- package/dist/src/agent/orchestration/agent-event-handler.d.ts +1 -3
- package/dist/src/agent/orchestration/agent-event-handler.js +0 -36
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +0 -5
- package/dist/src/agent/orchestration/agent-orchestrator.js +0 -5
- package/dist/src/agent/prompt/sections/behavior.js +6 -4
- package/dist/src/agent/service.d.ts +0 -3
- package/dist/src/agent/service.js +0 -28
- package/dist/src/agent/service.types.d.ts +0 -3
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/starter-agents.js +2 -2
- package/dist/src/agent/tools/delegate-tool.js +5 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +2 -1
- package/dist/src/agent/tools/factory.js +16 -22
- package/dist/src/agent/tools/index.d.ts +0 -1
- package/dist/src/agent/tools/index.js +1 -2
- package/dist/src/agent/workflow/workflow-child-tools.js +7 -1
- package/dist/src/browser/providers/cloakbrowser.js +1 -1
- package/dist/src/channels/channel-domain.d.ts +0 -4
- package/dist/src/channels/plugin-types.d.ts +0 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/extensions/extension-registry-impl.d.ts +3 -1
- package/dist/src/extensions/extension-registry-impl.js +7 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/types/core.d.ts +2 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.js +5 -2
- package/dist/src/gateway/chat-stream/mapper.js +16 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +4 -0
- package/dist/src/gateway/file-reference-errors.d.ts +6 -0
- package/dist/src/gateway/file-reference-errors.js +21 -0
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +34 -13
- package/dist/src/gateway/hono/routes/workflows.js +1 -1
- package/dist/src/gateway/hono/routes/workspace.js +34 -13
- package/dist/src/gateway/hono/routes/you.js +3 -3
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +4 -1
- package/dist/src/gateway/service.js +6 -6
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/storage/sqlite/memory-records-repository.js +3 -1
- package/dist/src/storage/sqlite/migrations/108_repair_user_memory_provider.sql +18 -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/schema.js +1 -1
- package/dist/src/tui/tool-summary.d.ts +1 -2
- package/dist/src/tui/tool-summary.js +2 -18
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/user-context/projection.d.ts +1 -0
- package/dist/src/user-context/projection.js +2 -1
- package/dist/src/voice/local/model-files.js +1 -1
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/automations-page-w6K9GZQ7.js +0 -6
- package/dist/gateway/static/root/assets/channels-status-swr-CySs1GQX.js +0 -1
- package/dist/gateway/static/root/assets/index-D-YfWVyS.css +0 -1
- package/dist/gateway/static/root/assets/index-vi5KlR5_.js +0 -222
- package/dist/gateway/static/root/assets/messages-CPxz48hr.js +0 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-CSFCZj14.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BoNBMKW6.js +0 -1
- package/dist/src/agent/feedback/feedback-coordinator.d.ts +0 -73
- package/dist/src/agent/feedback/feedback-coordinator.js +0 -156
- package/dist/src/agent/feedback/index.d.ts +0 -4
- package/dist/src/agent/feedback/index.js +0 -2
- package/dist/src/agent/lifecycle/progress.d.ts +0 -90
- package/dist/src/agent/lifecycle/progress.js +0 -339
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +0 -183
- package/dist/src/agent/mcp/mcp-tool-meta.d.ts +0 -8
- package/dist/src/agent/mcp/mcp-tool-meta.js +0 -13
- package/dist/src/agent/mcp/resolve-embedded-mcp-tools.d.ts +0 -14
- package/dist/src/agent/mcp/resolve-embedded-mcp-tools.js +0 -48
- package/dist/src/agent/tools/composio-tool.d.ts +0 -21
- package/dist/src/agent/tools/composio-tool.js +0 -261
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
10
10
|
import type { Model, Api } from '@earendil-works/pi-ai';
|
|
11
11
|
import type { Config } from '../../config/schema.js';
|
|
12
|
+
import type { ExtensionRegistry } from '../../extensions/types/index.js';
|
|
12
13
|
import type { MessageBus } from '../../infra/bus/index.js';
|
|
13
14
|
import { type SkillInstallToolOptions, type SkillInstallToolResult, type MarketplaceSkillInstallToolOptions, type MarketplaceSkillInstallToolResult } from './index.js';
|
|
14
15
|
import type { MemoryManager } from '../memory/manager.js';
|
|
@@ -25,7 +26,7 @@ import { type ToolExecutorConfig } from './executor.js';
|
|
|
25
26
|
import type { CodeIntelligenceRuntimeLike } from '../code-intelligence/index.js';
|
|
26
27
|
export interface ToolFactoryDeps {
|
|
27
28
|
workspace: string;
|
|
28
|
-
extensionRegistry?:
|
|
29
|
+
extensionRegistry?: ExtensionRegistry;
|
|
29
30
|
getCurrentContext: () => {
|
|
30
31
|
channel: string;
|
|
31
32
|
chatId: string;
|
|
@@ -4,6 +4,8 @@ import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
|
4
4
|
import { getSessionTaskPlan, setSessionTaskPlan } from "../../storage/sqlite/session-task-plan-repository.js";
|
|
5
5
|
import "../../storage/sqlite/index.js";
|
|
6
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../agent-scope.js";
|
|
7
|
+
import { wrapToolsWithProtection } from "./executor.js";
|
|
8
|
+
import { createDefaultExternalToolGatewayTools } from "../external-tools/index.js";
|
|
7
9
|
import { createReadFileTool } from "./read.js";
|
|
8
10
|
import { createWriteFileTool } from "./write.js";
|
|
9
11
|
import { createListDirTool } from "./list-dir.js";
|
|
@@ -16,7 +18,6 @@ import { createFindTool } from "./find.js";
|
|
|
16
18
|
import { createWebFetchTool, createWebSearchTool } from "./web.js";
|
|
17
19
|
import { createWebExtractTool } from "./web-extract.js";
|
|
18
20
|
import { createMessageTool } from "./communication.js";
|
|
19
|
-
import { createComposioTools } from "./composio-tool.js";
|
|
20
21
|
import { createSendMediaTool } from "./send-media.js";
|
|
21
22
|
import { createReadMediaTool } from "./media-read-tool.js";
|
|
22
23
|
import { createCreateShareTool, isShareToolAvailable } from "./create-share-tool.js";
|
|
@@ -49,7 +50,6 @@ import { createImageGenerateTool } from "./image-generate-tool.js";
|
|
|
49
50
|
import "./index.js";
|
|
50
51
|
import { createBrowserUseTool } from "./browser/tool/browser-use-tool.js";
|
|
51
52
|
import { createWorkflowCatalog } from "../workflow/catalog.js";
|
|
52
|
-
import { wrapToolsWithProtection } from "./executor.js";
|
|
53
53
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
54
54
|
import { createTextToSpeechTool } from "./tts-tool.js";
|
|
55
55
|
import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
|
|
@@ -178,15 +178,18 @@ var AgentToolsFactory = class {
|
|
|
178
178
|
const codeIntelligenceConfig = cfg?.codeIntelligence;
|
|
179
179
|
const agentId = options?.agentId;
|
|
180
180
|
const codeIntelligenceTools = isCodeIntelligenceEnabledForAgent(codeIntelligenceConfig, agentId) && this.deps.getCodeIntelligenceRuntime ? createCodeIntelligenceTools({ getRuntime: () => this.deps.getCodeIntelligenceRuntime(workspace) }) : [];
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
const externalTools = createDefaultExternalToolGatewayTools({
|
|
182
|
+
workspace,
|
|
183
|
+
getConfig: () => this.deps.getConfig?.(),
|
|
184
|
+
getCurrentContext: this.deps.getCurrentContext,
|
|
185
|
+
agentId,
|
|
186
|
+
extensionRegistry: this.deps.extensionRegistry,
|
|
187
|
+
disabledTools: disabled,
|
|
188
|
+
hookRunner: this.deps.hookRunner,
|
|
189
|
+
toolExecutorConfig: this.deps.toolExecutorConfig,
|
|
190
|
+
getMemoryManager: getMemMgr
|
|
191
|
+
});
|
|
192
|
+
const optionalTools = [imageTool, imageGenerateTool].filter((t) => t != null);
|
|
190
193
|
const readTool = createReadFileTool(workspace, { profileMarkdownRoot: options?.profileMarkdownRoot });
|
|
191
194
|
const writeTool = createWriteFileTool(workspace, { profileMarkdownRoot: options?.profileMarkdownRoot });
|
|
192
195
|
const applyPatchTool = createApplyPatchTool(workspace);
|
|
@@ -223,6 +226,7 @@ var AgentToolsFactory = class {
|
|
|
223
226
|
}
|
|
224
227
|
}),
|
|
225
228
|
createUpdatePlanTool(),
|
|
229
|
+
...externalTools,
|
|
226
230
|
...getSkillMgr ? [
|
|
227
231
|
createSkillsListTool({
|
|
228
232
|
getSkillManager: getSkillMgr,
|
|
@@ -287,7 +291,6 @@ var AgentToolsFactory = class {
|
|
|
287
291
|
...this.deps.getCurrentContext?.()?.sessionKey ? { sessionKey: this.deps.getCurrentContext().sessionKey } : {}
|
|
288
292
|
})
|
|
289
293
|
})] : [],
|
|
290
|
-
...getMemMgr?.().getAdditionalTools() ?? [],
|
|
291
294
|
...this.deps.getSessionStore && getPrimary ? [createSessionSearchTool({
|
|
292
295
|
getSessionStore: this.deps.getSessionStore,
|
|
293
296
|
getPrimaryModel: getPrimary,
|
|
@@ -341,16 +344,7 @@ var AgentToolsFactory = class {
|
|
|
341
344
|
return ["create_desktop_pet"];
|
|
342
345
|
}
|
|
343
346
|
createAllTools(coreOptions) {
|
|
344
|
-
|
|
345
|
-
const disableExtensions = coreOptions?.disabledTools?.has("extensions");
|
|
346
|
-
let bundled;
|
|
347
|
-
if (!this.deps.extensionRegistry || disableExtensions) bundled = coreTools;
|
|
348
|
-
else {
|
|
349
|
-
const extensionTools = this.deps.extensionRegistry.getAllTools();
|
|
350
|
-
log.info({ count: extensionTools.length }, "Loaded extension tools");
|
|
351
|
-
bundled = [...coreTools, ...extensionTools];
|
|
352
|
-
}
|
|
353
|
-
return wrapToolsWithProtection(bundled, this.deps.toolExecutorConfig);
|
|
347
|
+
return wrapToolsWithProtection(this.createCoreTools(coreOptions), this.deps.toolExecutorConfig);
|
|
354
348
|
}
|
|
355
349
|
};
|
|
356
350
|
function filterToolsByDisabledSet(tools, disabled) {
|
|
@@ -12,7 +12,6 @@ export { findTool, createFindTool, type FindToolInput, type FindToolDetails, } f
|
|
|
12
12
|
export { createWebSearchTool, createWebFetchTool } from './web.js';
|
|
13
13
|
export { createWebExtractTool, stripHtmlBoilerplate, DEFAULT_WEB_EXTRACT_MAX_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, } from './web-extract.js';
|
|
14
14
|
export { createMessageTool } from './communication.js';
|
|
15
|
-
export { createComposioTools } from './composio-tool.js';
|
|
16
15
|
export { createSendMediaTool } from './send-media.js';
|
|
17
16
|
export { createReadMediaTool } from './media-read-tool.js';
|
|
18
17
|
export { createCreateShareTool, isShareToolAvailable, type CreateShareToolDeps, } from './create-share-tool.js';
|
|
@@ -14,7 +14,6 @@ import { createFindTool, findTool } from "./find.js";
|
|
|
14
14
|
import { createWebFetchTool, createWebSearchTool } from "./web.js";
|
|
15
15
|
import { DEFAULT_WEB_EXTRACT_MAX_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, createWebExtractTool, stripHtmlBoilerplate } from "./web-extract.js";
|
|
16
16
|
import { createMessageTool } from "./communication.js";
|
|
17
|
-
import { createComposioTools } from "./composio-tool.js";
|
|
18
17
|
import { createSendMediaTool } from "./send-media.js";
|
|
19
18
|
import { createReadMediaTool } from "./media-read-tool.js";
|
|
20
19
|
import { createCreateShareTool, isShareToolAvailable } from "./create-share-tool.js";
|
|
@@ -43,4 +42,4 @@ import { createManagedJobTool } from "./managed-job-tool.js";
|
|
|
43
42
|
import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
|
|
44
43
|
import { createImageTool } from "./image-tool.js";
|
|
45
44
|
import { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from "./image-generate-tool.js";
|
|
46
|
-
export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createBrowserRecipeTool, createClarifyTool, createCodeIntelligenceTools,
|
|
45
|
+
export { BrowserManager, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, SANDBOX_ALLOWED_TOOLS, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, buildSandboxToolMap, createApplyPatchTool, createAutomationTool, createBrowserRecipeTool, createClarifyTool, createCodeIntelligenceTools, createCreateShareTool, createDelegateTool, createDesktopPetTool, createDreamingTool, createExecCommandTool, createExecuteCodeTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createListDirTool, createManagedJobTool, createMemoryGetTool, createMemorySearchTool, createMessageTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EXTERNAL_TOOL_NAMES } from "../external-tools/gateway-tools.js";
|
|
2
|
+
import "../external-tools/index.js";
|
|
1
3
|
import { AgentToolsFactory } from "../tools/factory.js";
|
|
2
4
|
//#region src/agent/workflow/workflow-child-tools.ts
|
|
3
5
|
/** Builds the tool set for workflow child agents (wired from gateway to avoid cycles). */
|
|
@@ -13,7 +15,11 @@ function buildWorkflowChildTools(childOptions) {
|
|
|
13
15
|
workspace: childOptions.workspace,
|
|
14
16
|
getPrimaryModel: () => childOptions.model,
|
|
15
17
|
agentId: childOptions.agentId,
|
|
16
|
-
disabledTools: new Set([
|
|
18
|
+
disabledTools: new Set([
|
|
19
|
+
EXTERNAL_TOOL_NAMES.search,
|
|
20
|
+
EXTERNAL_TOOL_NAMES.describe,
|
|
21
|
+
EXTERNAL_TOOL_NAMES.execute
|
|
22
|
+
])
|
|
17
23
|
});
|
|
18
24
|
}
|
|
19
25
|
//#endregion
|
|
@@ -11,9 +11,9 @@ import { createReadStream, createWriteStream } from "node:fs";
|
|
|
11
11
|
import { spawn } from "node:child_process";
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
13
13
|
import { mkdir, mkdtemp, rm, stat } from "node:fs/promises";
|
|
14
|
+
import { Readable, Transform } from "node:stream";
|
|
14
15
|
import AdmZip from "adm-zip";
|
|
15
16
|
import { pipeline } from "node:stream/promises";
|
|
16
|
-
import { Readable, Transform } from "node:stream";
|
|
17
17
|
//#region src/browser/providers/cloakbrowser.ts
|
|
18
18
|
/**
|
|
19
19
|
* CloakBrowser provider — anti-fingerprint Chromium with stealth capabilities.
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { MessageBus } from '../infra/bus/index.js';
|
|
5
5
|
import type { Config } from '../config/schema.js';
|
|
6
|
-
import type { ProgressStage } from '../agent/lifecycle/progress.js';
|
|
7
|
-
export type { ProgressStage } from '../agent/lifecycle/progress.js';
|
|
8
6
|
export type ChatType = 'direct' | 'group' | 'channel' | 'thread';
|
|
9
7
|
export type DmPolicy = 'pairing' | 'allowlist' | 'open' | 'disabled';
|
|
10
8
|
export type GroupPolicy = 'open' | 'disabled' | 'allowlist';
|
|
@@ -74,8 +72,6 @@ export interface ChannelSendResult {
|
|
|
74
72
|
}
|
|
75
73
|
export interface ChannelStreamHandle {
|
|
76
74
|
update: (text: string) => void;
|
|
77
|
-
updateProgress?: (text: string, stage: ProgressStage, detail?: string) => void;
|
|
78
|
-
setProgress?: (stage: ProgressStage, detail?: string) => void;
|
|
79
75
|
end: () => Promise<void>;
|
|
80
76
|
abort: () => Promise<void>;
|
|
81
77
|
messageId: () => number | undefined;
|
|
@@ -296,8 +296,6 @@ export interface ChannelPollResult {
|
|
|
296
296
|
export interface ChannelStreamHandle {
|
|
297
297
|
update: (text: string) => void;
|
|
298
298
|
updateReasoning?: (text: string) => void;
|
|
299
|
-
updateProgress?: (text: string, stage: string, detail?: string) => void;
|
|
300
|
-
setProgress?: (stage: string, detail?: string) => void;
|
|
301
299
|
end: () => Promise<void>;
|
|
302
300
|
abort: () => Promise<void>;
|
|
303
301
|
messageId: () => number | undefined;
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v108).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -3,9 +3,9 @@ import { init_loader, loadConfig } from "../../config/loader.js";
|
|
|
3
3
|
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
4
4
|
import { getContextWithOpts } from "../context.js";
|
|
5
5
|
import { getExtensionLockfileManager } from "../../extensions/lockfile.js";
|
|
6
|
+
import { fetchRegistry, findExtension, getExtensionMarketplaceStoreBaseUrl, listExtensions, searchExtensions } from "../../extensions/marketplace.js";
|
|
6
7
|
import { installFromLocal, installFromNpm, peekExtensionManifestFromStoreZip } from "../../extensions/install.js";
|
|
7
8
|
import { commitStagedExtensionInstall, finalizeStagedExtensionInstall, rollbackStagedExtensionInstall, stageExtensionStoreZip } from "../../extensions/install-transaction.js";
|
|
8
|
-
import { fetchRegistry, findExtension, getExtensionMarketplaceStoreBaseUrl, listExtensions, searchExtensions } from "../../extensions/marketplace.js";
|
|
9
9
|
import { colors } from "../utils/colors.js";
|
|
10
10
|
import { validateExtensionPackageDirectory } from "./extension-pack.js";
|
|
11
11
|
import { join, resolve } from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-materialize.js";
|
|
2
1
|
import { materializeConnectorMcpServer } from "./materialize.js";
|
|
3
2
|
import { getConnectorInstance } from "./instances.js";
|
|
4
3
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
4
|
+
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-gateway.js";
|
|
5
5
|
//#region src/connectors/health.ts
|
|
6
6
|
function classifyConnectorHealthError(error) {
|
|
7
7
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -17,6 +17,7 @@ export declare class ExtensionRegistryImpl implements ExtensionRegistry {
|
|
|
17
17
|
services: Map<string, ExtensionService>;
|
|
18
18
|
gatewayMethods: Map<string, GatewayMethodHandler>;
|
|
19
19
|
tools: Map<string, AgentTool<any, any>>;
|
|
20
|
+
private toolExtensionIds;
|
|
20
21
|
channelPlugins: ChannelPlugin[];
|
|
21
22
|
private cliRegistrations;
|
|
22
23
|
private reloadRegistrations;
|
|
@@ -36,10 +37,11 @@ export declare class ExtensionRegistryImpl implements ExtensionRegistry {
|
|
|
36
37
|
getService(id: string): ExtensionService | undefined;
|
|
37
38
|
addGatewayMethod(method: string, handler: GatewayMethodHandler): void;
|
|
38
39
|
getGatewayMethod(method: string): GatewayMethodHandler | undefined;
|
|
39
|
-
addTool(tool: any): void;
|
|
40
|
+
addTool(tool: any, extensionId: string): void;
|
|
40
41
|
removeTool(name: string): void;
|
|
41
42
|
getTools(): Map<string, any>;
|
|
42
43
|
getTool(name: string): any | undefined;
|
|
44
|
+
getToolExtensionId(name: string): string | undefined;
|
|
43
45
|
getAllTools(): any[];
|
|
44
46
|
addCliRegistration(reg: ExtensionCliRegistration): void;
|
|
45
47
|
getCliRegistrations(): readonly ExtensionCliRegistration[];
|
|
@@ -11,6 +11,7 @@ var ExtensionRegistryImpl = class {
|
|
|
11
11
|
services = /* @__PURE__ */ new Map();
|
|
12
12
|
gatewayMethods = /* @__PURE__ */ new Map();
|
|
13
13
|
tools = /* @__PURE__ */ new Map();
|
|
14
|
+
toolExtensionIds = /* @__PURE__ */ new Map();
|
|
14
15
|
channelPlugins = [];
|
|
15
16
|
cliRegistrations = [];
|
|
16
17
|
reloadRegistrations = [];
|
|
@@ -64,12 +65,14 @@ var ExtensionRegistryImpl = class {
|
|
|
64
65
|
getGatewayMethod(method) {
|
|
65
66
|
return this.gatewayMethods.get(method);
|
|
66
67
|
}
|
|
67
|
-
addTool(tool) {
|
|
68
|
+
addTool(tool, extensionId) {
|
|
68
69
|
if (this.tools.has(tool.name)) log.warn({ tool: tool.name }, `Tool already registered, overwriting`);
|
|
69
70
|
this.tools.set(tool.name, tool);
|
|
71
|
+
this.toolExtensionIds.set(tool.name, extensionId);
|
|
70
72
|
}
|
|
71
73
|
removeTool(name) {
|
|
72
74
|
this.tools.delete(name);
|
|
75
|
+
this.toolExtensionIds.delete(name);
|
|
73
76
|
}
|
|
74
77
|
getTools() {
|
|
75
78
|
return this.tools;
|
|
@@ -77,6 +80,9 @@ var ExtensionRegistryImpl = class {
|
|
|
77
80
|
getTool(name) {
|
|
78
81
|
return this.tools.get(name);
|
|
79
82
|
}
|
|
83
|
+
getToolExtensionId(name) {
|
|
84
|
+
return this.toolExtensionIds.get(name);
|
|
85
|
+
}
|
|
80
86
|
getAllTools() {
|
|
81
87
|
return Array.from(this.tools.values());
|
|
82
88
|
}
|
|
@@ -441,7 +441,7 @@ var ExtensionLoader = class {
|
|
|
441
441
|
source: config.source
|
|
442
442
|
});
|
|
443
443
|
const extensionTools = api._getTools();
|
|
444
|
-
for (const tool of extensionTools.values()) this.registry.addTool(tool);
|
|
444
|
+
for (const tool of extensionTools.values()) this.registry.addTool(tool, config.id);
|
|
445
445
|
this.extensionInstances.set(config.id, api);
|
|
446
446
|
this.cache.set(cacheKey, api);
|
|
447
447
|
this.diagnostics.info(config.id, `Loaded extension: ${manifest.name}`);
|
|
@@ -237,9 +237,10 @@ export interface ExtensionService {
|
|
|
237
237
|
stop?: () => void | Promise<void>;
|
|
238
238
|
}
|
|
239
239
|
export interface ExtensionRegistry {
|
|
240
|
-
addTool(tool: AgentTool): void;
|
|
240
|
+
addTool(tool: AgentTool, extensionId: string): void;
|
|
241
241
|
getTools(): Map<string, AgentTool>;
|
|
242
242
|
getTool(name: string): AgentTool | undefined;
|
|
243
|
+
getToolExtensionId(name: string): string | undefined;
|
|
243
244
|
getAllTools(): AgentTool[];
|
|
244
245
|
getCommand(name: string): ExtensionCommand | undefined;
|
|
245
246
|
addCliRegistration(reg: ExtensionCliRegistration): void;
|
|
@@ -4,8 +4,8 @@ import { init_paths, resolveBundledExtensionsDir, resolveExtensionsDir } from ".
|
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
6
6
|
import { getExtensionLockfileManager } from "./lockfile.js";
|
|
7
|
-
import { installExtensionFromStoreZip, installFromNpm } from "./install.js";
|
|
8
7
|
import { findExtension } from "./marketplace.js";
|
|
8
|
+
import { installExtensionFromStoreZip, installFromNpm } from "./install.js";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
11
11
|
import semver from "semver";
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Built-in agent tool `name` values for gateway admin UI (disable toggles).
|
|
3
3
|
* Extension tools are not listed; users can still add arbitrary strings in config.
|
|
4
4
|
*/
|
|
5
|
-
export declare const GATEWAY_BUILTIN_TOOL_IDS: readonly ["code_search", "code_read_symbol", "code_trace", "code_impact", "code_architecture", "read_file", "write_file", "apply_patch", "list_dir", "grep", "find", "exec_command", "update_plan", "session_status", "dreaming", "tool_manual", "clarify", "todo", "skills_list", "skill_view", "skill_manage", "skills_marketplace_search", "skill_install", "web_search", "web_fetch", "web_extract", "send_message", "send_media", "read_media", "create_share", "text_to_speech", "memory_search", "memory_get", "session_search", "automation", "workflow", "delegate_task", "execute_code", "image", "image_generate", "create_desktop_pet", "browser_use", "
|
|
5
|
+
export declare const GATEWAY_BUILTIN_TOOL_IDS: readonly ["code_search", "code_read_symbol", "code_trace", "code_impact", "code_architecture", "read_file", "write_file", "apply_patch", "list_dir", "grep", "find", "exec_command", "update_plan", "session_status", "dreaming", "tool_manual", "clarify", "todo", "skills_list", "skill_view", "skill_manage", "skills_marketplace_search", "skill_install", "web_search", "web_fetch", "web_extract", "send_message", "send_media", "read_media", "create_share", "text_to_speech", "memory_search", "memory_get", "session_search", "automation", "workflow", "delegate_task", "execute_code", "image", "image_generate", "create_desktop_pet", "browser_use", "xopc_tool_search", "xopc_tool_describe", "xopc_tool_execute"];
|
|
6
6
|
export type GatewayBuiltinToolId = (typeof GATEWAY_BUILTIN_TOOL_IDS)[number];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EXTERNAL_TOOL_NAMES } from "../agent/external-tools/gateway-tools.js";
|
|
2
|
+
import "../agent/external-tools/index.js";
|
|
1
3
|
//#region src/gateway/agent-builtin-tools.ts
|
|
2
4
|
/**
|
|
3
5
|
* Built-in agent tool `name` values for gateway admin UI (disable toggles).
|
|
@@ -46,8 +48,9 @@ const GATEWAY_BUILTIN_TOOL_IDS = [
|
|
|
46
48
|
"image_generate",
|
|
47
49
|
"create_desktop_pet",
|
|
48
50
|
"browser_use",
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
EXTERNAL_TOOL_NAMES.search,
|
|
52
|
+
EXTERNAL_TOOL_NAMES.describe,
|
|
53
|
+
EXTERNAL_TOOL_NAMES.execute
|
|
51
54
|
];
|
|
52
55
|
//#endregion
|
|
53
56
|
export { GATEWAY_BUILTIN_TOOL_IDS };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveToolActivity } from "../../../packages/gateway-contract/src/tool-activity.js";
|
|
1
2
|
import { createPetFeedback } from "./pet-feedback.js";
|
|
2
3
|
//#region src/gateway/chat-stream/mapper.ts
|
|
3
4
|
let lastTaskPlanRevision = 0;
|
|
@@ -252,6 +253,7 @@ var ChatStreamMapper = class {
|
|
|
252
253
|
}
|
|
253
254
|
events.push(this.make("assistant_message_end", {
|
|
254
255
|
messageId,
|
|
256
|
+
presentation: hasToolCall(message) ? "narration" : "answer",
|
|
255
257
|
usage: extractUsage(message)
|
|
256
258
|
}));
|
|
257
259
|
this.lastAssistantMessageId = messageId;
|
|
@@ -270,7 +272,8 @@ var ChatStreamMapper = class {
|
|
|
270
272
|
messageId,
|
|
271
273
|
toolCallId,
|
|
272
274
|
toolName,
|
|
273
|
-
args: event.args
|
|
275
|
+
args: event.args,
|
|
276
|
+
activity: resolveToolActivity(toolName, "running")
|
|
274
277
|
})];
|
|
275
278
|
if (toolName === "exec_command") {
|
|
276
279
|
const args = asRecord(event.args);
|
|
@@ -324,6 +327,7 @@ var ChatStreamMapper = class {
|
|
|
324
327
|
toolCallId,
|
|
325
328
|
toolName,
|
|
326
329
|
status: event.isError ? "error" : "success",
|
|
330
|
+
activity: resolveToolActivity(toolName, event.isError ? "failed" : "completed", result),
|
|
327
331
|
result,
|
|
328
332
|
errorMessage: event.isError ? result?.text : void 0
|
|
329
333
|
})];
|
|
@@ -431,6 +435,17 @@ function userMessageFromEvent(event) {
|
|
|
431
435
|
function extractTextFromMessage(message) {
|
|
432
436
|
return extractText(message.content);
|
|
433
437
|
}
|
|
438
|
+
function hasToolCall(message) {
|
|
439
|
+
const raw = message;
|
|
440
|
+
if (Array.isArray(raw.toolCalls) && raw.toolCalls.length > 0) return true;
|
|
441
|
+
if (Array.isArray(raw.tool_calls) && raw.tool_calls.length > 0) return true;
|
|
442
|
+
if (!Array.isArray(raw.content)) return false;
|
|
443
|
+
return raw.content.some((block) => {
|
|
444
|
+
if (!block || typeof block !== "object") return false;
|
|
445
|
+
const type = block.type;
|
|
446
|
+
return type === "toolCall" || type === "tool_call" || type === "tool_use";
|
|
447
|
+
});
|
|
448
|
+
}
|
|
434
449
|
function extractReview(message) {
|
|
435
450
|
const metadata = message.metadata;
|
|
436
451
|
const metadataReview = asRecord(metadata)?.review;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ToolActivity } from '@xopcai/gateway-contract';
|
|
1
2
|
export type ChatStreamStatus = 'success' | 'error' | 'cancelled';
|
|
2
3
|
export type PetFeedbackTaskState = 'working' | 'waiting' | 'success' | 'error';
|
|
3
4
|
export type PetFeedbackSensitivity = 'public' | 'private';
|
|
@@ -58,6 +59,7 @@ export type ToolStartEvent = ChatStreamEnvelope<'tool_start', {
|
|
|
58
59
|
toolCallId: string;
|
|
59
60
|
toolName: string;
|
|
60
61
|
args?: unknown;
|
|
62
|
+
activity: ToolActivity;
|
|
61
63
|
}>;
|
|
62
64
|
export type ToolUpdateEvent = ChatStreamEnvelope<'tool_update', {
|
|
63
65
|
messageId: string;
|
|
@@ -71,6 +73,7 @@ export type ToolEndEvent = ChatStreamEnvelope<'tool_end', {
|
|
|
71
73
|
toolCallId: string;
|
|
72
74
|
toolName: string;
|
|
73
75
|
status: ChatStreamStatus;
|
|
76
|
+
activity: ToolActivity;
|
|
74
77
|
result?: {
|
|
75
78
|
content?: unknown[];
|
|
76
79
|
details?: unknown;
|
|
@@ -163,6 +166,7 @@ export type ReviewEvent = ChatStreamEnvelope<'review', {
|
|
|
163
166
|
}>;
|
|
164
167
|
export type AssistantMessageEndEvent = ChatStreamEnvelope<'assistant_message_end', {
|
|
165
168
|
messageId: string;
|
|
169
|
+
presentation: 'narration' | 'answer';
|
|
166
170
|
usage?: {
|
|
167
171
|
inputTokens?: number;
|
|
168
172
|
outputTokens?: number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/gateway/file-reference-errors.ts
|
|
2
|
+
function classifyFileReferenceFsError(err) {
|
|
3
|
+
const code = err?.code;
|
|
4
|
+
if (code === "ENOENT" || code === "ENOTDIR") return {
|
|
5
|
+
code: "FILE_NOT_FOUND",
|
|
6
|
+
message: "File not found",
|
|
7
|
+
status: 404
|
|
8
|
+
};
|
|
9
|
+
if (code === "EACCES" || code === "EPERM") return {
|
|
10
|
+
code: "FILE_ACCESS_DENIED",
|
|
11
|
+
message: "Gateway does not have permission to access this file",
|
|
12
|
+
status: 403
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
code: "FILE_ACCESS_FAILED",
|
|
16
|
+
message: "Gateway could not access this file",
|
|
17
|
+
status: 500
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { classifyFileReferenceFsError };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
4
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
5
4
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
6
5
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
6
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
7
7
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
8
8
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -6,9 +6,9 @@ import { init_models_json, loadModelsJson } from "../../../config/models-json.js
|
|
|
6
6
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
7
7
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
8
8
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
9
|
+
import { normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
9
10
|
import { resolveShareConfig } from "../../../share/share-config.js";
|
|
10
11
|
import { maskTunnelSecretForWeb } from "../../../tunnel/env.js";
|
|
11
|
-
import { normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
12
12
|
import { resolveSessionConfigForWeb, resolveUpdateConfigForWeb } from "../../../config/web-patch.js";
|
|
13
13
|
import { GENERIC_MASKED_SECRET, maskSecretLength } from "./mask-secret-length.js";
|
|
14
14
|
import { safeToolsWebForGet } from "../../config-tools-web.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getAllModels, getAvailableModels, init_providers } from "../../../providers/index.js";
|
|
2
2
|
import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
3
3
|
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
|
-
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
5
4
|
import { buildWhenContextSnapshot } from "../../../extensions/when-context.js";
|
|
5
|
+
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
6
6
|
import { createOAuthHandler } from "../oauth.js";
|
|
7
7
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
8
8
|
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContextCompactionPolicySchema, init_config } from "../../../../user-context/config.js";
|
|
2
2
|
import { BindingsConfigSchema, BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
3
3
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
4
|
+
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
4
5
|
import { setTuiDefaultAgentConfig } from "../../../../commands/agents.config.js";
|
|
5
6
|
import { mergeTunnelConfigPatch } from "../../../../tunnel/tunnel-config.js";
|
|
6
|
-
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
7
7
|
import { mergeGatewaySkillsMarketplacePatch, mergeSessionConfigPatch, mergeUpdateConfigPatch } from "../../../../config/web-patch.js";
|
|
8
8
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../../../auth.js";
|
|
9
9
|
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { canonicalizeConfiguredMcpServer, normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
2
2
|
import { loadMergedBundleMcpConfig } from "../../../agent/mcp/bundle-mcp-config.js";
|
|
3
|
-
import { listBundleMcpServerCapabilitiesForGateway, listBundleMcpServerToolsForGateway } from "../../../agent/mcp/bundle-mcp-materialize.js";
|
|
4
3
|
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
5
4
|
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
5
|
+
import { listBundleMcpServerCapabilitiesForGateway, listBundleMcpServerToolsForGateway } from "../../../agent/mcp/bundle-mcp-gateway.js";
|
|
6
6
|
//#region src/gateway/hono/routes/mcp.ts
|
|
7
7
|
function registerMcpRoutes(authenticated, deps) {
|
|
8
8
|
authenticated.get("/api/mcp/servers", (c) => {
|
|
@@ -17,6 +17,7 @@ import "../../../projects/index.js";
|
|
|
17
17
|
import { TaskApplicationService } from "../../../tasks/task-application-service.js";
|
|
18
18
|
import { defineTaskContract } from "../../../tasks/task-contract-definition.js";
|
|
19
19
|
import "../../../tasks/index.js";
|
|
20
|
+
import { classifyFileReferenceFsError } from "../../file-reference-errors.js";
|
|
20
21
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
21
22
|
import { parseActivityIncludeRelated, parseActivityQuery } from "./activity.js";
|
|
22
23
|
import { fuzzySearchWorkspaceFiles } from "../../workspace-file-search.js";
|
|
@@ -996,6 +997,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
996
997
|
}
|
|
997
998
|
}, resolved.status);
|
|
998
999
|
let st = null;
|
|
1000
|
+
let statError = null;
|
|
999
1001
|
let absolutePath = resolved.absolutePath;
|
|
1000
1002
|
try {
|
|
1001
1003
|
absolutePath = await realpath(resolved.absolutePath);
|
|
@@ -1007,22 +1009,41 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
1007
1009
|
}
|
|
1008
1010
|
}, 400);
|
|
1009
1011
|
st = await stat(absolutePath);
|
|
1010
|
-
} catch {
|
|
1011
|
-
|
|
1012
|
+
} catch (err) {
|
|
1013
|
+
statError = err;
|
|
1012
1014
|
}
|
|
1013
1015
|
const displayName = path$1.basename(rawPath);
|
|
1014
|
-
if (!st)
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1016
|
+
if (!st) {
|
|
1017
|
+
const failure = classifyFileReferenceFsError(statError);
|
|
1018
|
+
if (failure.code !== "FILE_NOT_FOUND") {
|
|
1019
|
+
log.warn({
|
|
1020
|
+
err: statError,
|
|
1021
|
+
projectId: resolved.projectId,
|
|
1022
|
+
workspaceRoot: resolved.root,
|
|
1023
|
+
candidate: resolved.absolutePath,
|
|
1024
|
+
errorCode: failure.code
|
|
1025
|
+
}, `Project file reference access failed: ${failure.message}`);
|
|
1026
|
+
return c.json({
|
|
1027
|
+
ok: false,
|
|
1028
|
+
error: {
|
|
1029
|
+
code: failure.code,
|
|
1030
|
+
message: failure.message
|
|
1031
|
+
}
|
|
1032
|
+
}, failure.status === 403 ? 403 : 500);
|
|
1024
1033
|
}
|
|
1025
|
-
|
|
1034
|
+
return c.json({
|
|
1035
|
+
ok: true,
|
|
1036
|
+
payload: {
|
|
1037
|
+
inputPath: rawPath,
|
|
1038
|
+
displayName,
|
|
1039
|
+
scope: "missing",
|
|
1040
|
+
exists: false,
|
|
1041
|
+
absolutePath: resolved.absolutePath,
|
|
1042
|
+
capabilities: ["copyPath"],
|
|
1043
|
+
errorCode: "FILE_NOT_FOUND"
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1026
1047
|
return c.json({
|
|
1027
1048
|
ok: true,
|
|
1028
1049
|
payload: {
|
|
@@ -7,9 +7,9 @@ import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
+
import "../../../workflows/draft/index.js";
|
|
10
11
|
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
11
12
|
import "../../../workflows/authoring/index.js";
|
|
12
|
-
import "../../../workflows/draft/index.js";
|
|
13
13
|
import { basename, join } from "node:path";
|
|
14
14
|
import { readFile, stat } from "node:fs/promises";
|
|
15
15
|
//#region src/gateway/hono/routes/workflows.ts
|