@xopcai/xopc 0.0.233 → 0.0.235
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/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DQ5L3PTi.js → activity-store-BzswYHcj.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Bps8fvBp.js → agent-avatar-dicebear-dvh9aEm6.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B9tkmkUj.js +1 -0
- package/dist/gateway/static/root/assets/agents-DTXYo-7z.js +1 -0
- package/dist/gateway/static/root/assets/{api-DE6tZKG0.js → api-7zOtMbaE.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BryzDVod.js → app-management-settings-panel-DXFTk7x6.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BoweLBDm.js → appearance-settings-D-FD5SOq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BT102W58.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DyujzZNu.js → archive-plugin-DawToDU8.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DmXGUWve.js → attachment-load-DmBAKvsi.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DrTVSK7o.js → automations-page-BGkF6XNH.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BRb45-_R.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-mFyeC74W.js → binary-plugins-B-6Ski7l.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D5yMFrgH.js → block-editor-BgeKQN1F.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-BkRWxC7D.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-B6rLBtua.js → browser-workflow-inputs-4ooVX-Tx.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-C74sg50f.js → browser-workflows-page-D92g81lS.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DfT-vWTA.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-C9oGpLR0.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-DowVNjNw.js → channels-status-swr-BDJvMnA_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BO6_BgjE.js → chat-terminal-dock-C_9LUs7G.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-SJKV6SHT.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CYMXfk4M.js → cron-expression-BYmr5ZuN.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DIM_OkQP.js → date-picker-FKL_b_S0.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Cp8I6rsL.js → dependency-picker-BP68vqBI.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-wzSzZ6S8.js → desktop-pet-DOXjRTqK.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-NjPiz3M_.js → desktop-pet-settings-CuG2qYoY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CoMl13ET.js → extension-debug-page-BeJ1-5ID.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CXc1Lc8x.js → extension-page-CncDndLS.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CfEWpgjl.js → extension-settings-page-BxxL0HqU.js} +1 -1
- package/dist/gateway/static/root/assets/{files-Dp8_uGTO.js → files-DQjhZjr2.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-yH4KAEkK.js → gateway-config-api-Dc6A6HyJ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-YyZJKvFf.js → gateway-config-swr-R702lNJR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BmjJIiKh.js → gateway-settings-C2XcazGD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Dnrl91pU.js → gateway-startup-retry-2rVSUvyw.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BjUEqkkC.js +1 -0
- package/dist/gateway/static/root/assets/home-page-DTSjwfAQ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BNzAAw4Y.js → image-generation-api-B28USRCK.js} +1 -1
- package/dist/gateway/static/root/assets/index-DFfvY8IN.js +70 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CfNV1ysF.js → keyboard-shortcuts-settings-Cwinks_5.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-0wntj9mK.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-MPd4Fl_l.js → local-apps-page-WeKm5vZ0.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D_dq_0LV.js → locale-store-8k4mvYGL.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DFgJr7Zx.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-DeIjN4e0.js → management-settings-8bEvKO0R.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BUAVv6Gu.js → markdown-split-B6wQhwLV.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CPkBOY3h.js → markdown-view-D02mJdoU.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DFsVnOY-.js → media-plugins-BSEPuO76.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-D4qOHT4D.js → messages-CoovNoMn.js} +2 -2
- package/dist/gateway/static/root/assets/{mobile-device-api-D9JevyCE.js → mobile-device-api-CvjVB_TB.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-CYr6LzvY.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BWSfTP1w.js → notes-api-p2Pncp2B.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CV8UJj7g.js → notes-page-CPgbeO1u.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DIXCtwhs.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-DnanEBsf.js → oauth-api-DpLONwfK.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-zNg1KOy2.js → product-open-page-DNHWn_26.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-6jgRJg4w.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Bd4nXs4y.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BeVzfRvs.js → registry-api-B7b0LJgI.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C_5-u9U-.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BxoioSvT.js → runtime-tools-settings-panel-D3TCJGy3.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-vzbmscrE.js → schema-form-DUAlwNoO.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BqYAR86S.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-a146I0uZ.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-x9k7MWD3.js → settings-form-section-D7nQ3Lfu.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BLFOD9h9.js → settings-loading-skeleton-CwGM9zKH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CwgTooar.js → settings-page-CMAkMc3I.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-rhaERxAL.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-COTrPAd-.js → share-preview-page-BzkXvuH6.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BvsM3Im5.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-u7E0gqFo.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-D9wM6_Jn.js → skills-page-DJRr5HFw.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-PtlQLM5a.js → skills-page.utils-DcrBe39q.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BR74mNEK.js → system-settings-panel-BUsykmjx.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-C9QgWfYG.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Bud54q9e.js → theme-store-CpcBI73Q.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DH47MH7s.js → use-autosave-DDEypreQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Ch0cfQfI.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-B59GaqRa.js → voice-api-key-field-BLa_vdXE.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-C0ahrZ0e.js → voice-config-api-ynE-vY6I.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DTn4RCcx.js → work-discovery-overlay-DS3w1Fyq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-yDFoEX06.js → workflow-run-setup-panel-jQl_wmYC.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DyTwkdzs.js +5 -0
- package/dist/gateway/static/root/index.html +13 -13
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +57 -8
- package/dist/src/agent/embedded/types.d.ts +5 -0
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/exec-command.d.ts +2 -0
- package/dist/src/agent/tools/exec-command.js +23 -7
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/index.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.d.ts +6 -0
- package/dist/src/agent/tools/publish-artifacts.js +55 -42
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +4 -4
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.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/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/files/file-service.d.ts +10 -2
- package/dist/src/files/file-service.js +33 -12
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +5 -0
- package/dist/src/gateway/file-path-classifier.d.ts +30 -0
- package/dist/src/gateway/file-path-classifier.js +105 -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/file-reference-registry.d.ts +34 -0
- package/dist/src/gateway/file-reference-registry.js +45 -0
- package/dist/src/gateway/file-space-service.d.ts +4 -0
- package/dist/src/gateway/file-space-service.js +19 -0
- package/dist/src/gateway/hono/app.js +3 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/file-references.d.ts +4 -0
- package/dist/src/gateway/hono/routes/file-references.js +98 -0
- package/dist/src/gateway/hono/routes/files.js +39 -17
- package/dist/src/gateway/hono/routes/html-preview.d.ts +4 -0
- package/dist/src/gateway/hono/routes/html-preview.js +45 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +18 -10
- package/dist/src/gateway/hono/routes/tasks.js +3 -3
- package/dist/src/gateway/security/csp.d.ts +1 -1
- package/dist/src/gateway/security/csp.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +0 -35
- package/dist/src/gateway/service.js +8 -8
- package/dist/src/infra/update-restart.js +1 -1
- 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/session/store.js +4 -2
- package/dist/src/session/turn-outcome-projector.d.ts +9 -0
- package/dist/src/session/turn-outcome-projector.js +209 -0
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/storage/sqlite/config-repository.d.ts +5 -0
- package/dist/src/storage/sqlite/config-repository.js +8 -1
- package/dist/src/tasks/home-query-service.js +2 -2
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +2 -2
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-JrK80PvP.js +0 -1
- package/dist/gateway/static/root/assets/agents-CJYEnz94.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Bt8_sWtU.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-86UTesz3.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DfMU7yXv.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-lsHRuBlX.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CxR_clkO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CpNLyKB4.js +0 -2
- package/dist/gateway/static/root/assets/heartbeat-settings-DGq9q4b6.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Dj4B1wb3.js +0 -1
- package/dist/gateway/static/root/assets/index-BGf-TiZj.js +0 -70
- package/dist/gateway/static/root/assets/local-app-workbench-page-IJg75WaN.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-NsfoazgK.js +0 -2
- package/dist/gateway/static/root/assets/models-hub-cache-C5y2gzMU.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-DrjMVgEI.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-tfcGYL-O.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BkjnXLdJ.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BXn-3n2d.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-MLNjrOkw.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByNLBY2q.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-bnueBZg8.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-D-v_psqL.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DJICr4wh.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-B-rmeE8t.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-B6eyxxOT.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-BOwSbfWm.js +0 -5
- package/dist/src/gateway/chat-stream/turn-outcome-collector.d.ts +0 -16
- package/dist/src/gateway/chat-stream/turn-outcome-collector.js +0 -146
|
@@ -5,16 +5,16 @@ import "../../storage/sqlite/index.js";
|
|
|
5
5
|
import { ObjectLinkService } from "../../activity/service.js";
|
|
6
6
|
import "../../activity/index.js";
|
|
7
7
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
8
|
+
import { TaskCommandSchema, TaskContextInputSchema } from "../../../packages/gateway-contract/src/tasks.js";
|
|
9
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
10
|
+
import { CreateAutomationSchema, UpdateAutomationSchema } from "../../automations/domain/validation.js";
|
|
11
|
+
import "../../automations/index.js";
|
|
8
12
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
9
13
|
import { enqueueTaskChangedEvent } from "../../tasks/task-change-events.js";
|
|
10
14
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
11
15
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
12
|
-
import { TaskCommandSchema, TaskContextInputSchema } from "../../../packages/gateway-contract/src/tasks.js";
|
|
13
|
-
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
14
16
|
import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
15
17
|
import "../../projects/index.js";
|
|
16
|
-
import { CreateAutomationSchema, UpdateAutomationSchema } from "../../automations/domain/validation.js";
|
|
17
|
-
import "../../automations/index.js";
|
|
18
18
|
import { TaskContextRepository } from "../../tasks/task-context-repository.js";
|
|
19
19
|
import { TaskDependencyError, TaskDependencyService } from "../../tasks/task-dependency-service.js";
|
|
20
20
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
3
4
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
4
5
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
5
6
|
import { isLocalModelBaseUrl, resolveModelCallApiKey, resolveModelCallOptions } from "../providers/model-call.js";
|
|
6
|
-
import { getAssistantMessageErrorReason, stripCodeFences } from "../providers/model-response.js";
|
|
7
7
|
//#region src/ai-assist/text-assist.ts
|
|
8
8
|
init_providers();
|
|
9
9
|
init_logger();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
5
4
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
|
-
import {
|
|
5
|
+
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
7
6
|
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.js";
|
|
7
|
+
import { getOAuthProviderDefinition, init_registry } from "./oauth/registry.js";
|
|
8
8
|
import { init_oauth_provider_lock, withOAuthProviderLock } from "./oauth-provider-lock.js";
|
|
9
9
|
import { dirname, join } from "path";
|
|
10
10
|
import { mkdir, readFile, readdir, rm } from "fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { chmodSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/auth/profiles/store.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
3
2
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
4
|
-
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
3
|
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
4
|
+
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
//#region src/auth/sync-provider-auth.ts
|
|
8
8
|
/**
|
|
@@ -2,8 +2,8 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { assertCacheDir, init_cache_dir_policy } from "../cache-dir-policy.js";
|
|
5
|
-
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
6
5
|
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
6
|
+
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
7
7
|
import { shouldRunExtensionBridgeServer } from "../backend-from-config.js";
|
|
8
8
|
import { resolvePackageRoot } from "../../infra/update-check.js";
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { buildChannelCatalogForConfig, init_channel_catalog_service } from "../../channels/catalog/channel-catalog-service.js";
|
|
2
2
|
import { init_loader, loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
|
+
import { formatExamples, register } from "../registry.js";
|
|
3
4
|
import { listChannelPairingState } from "../../channels/pairing/pairing-service.js";
|
|
4
5
|
import { approveChannelPairingFromCli } from "../../channels/pairing/approve-cli.js";
|
|
5
|
-
import { formatExamples, register } from "../registry.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
//#region src/cli/commands/channels.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_loader, loadConfig, saveConfig } from "../../config/loader.js";
|
|
2
2
|
import { getStoreConnectorInstallPlan, installStoreConnector, listStoreConnectors } from "../../capabilities/store-connector.js";
|
|
3
3
|
import { register } from "../registry.js";
|
|
4
|
-
import { confirm } from "@inquirer/prompts";
|
|
5
4
|
import { Command } from "commander";
|
|
5
|
+
import { confirm } from "@inquirer/prompts";
|
|
6
6
|
//#region src/cli/commands/connectors.ts
|
|
7
7
|
init_loader();
|
|
8
8
|
function parsePairs(values, option) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
2
|
-
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
3
2
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
3
|
+
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
//#region src/cli/commands/doctor/checks/provider-auth.ts
|
|
6
6
|
init_loader();
|
|
@@ -13,8 +13,8 @@ import { existsSync, readFileSync, rmSync, statSync } from "node:fs";
|
|
|
13
13
|
import { execSync } from "node:child_process";
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
15
15
|
import semver from "semver";
|
|
16
|
-
import { confirm } from "@inquirer/prompts";
|
|
17
16
|
import { Command } from "commander";
|
|
17
|
+
import { confirm } from "@inquirer/prompts";
|
|
18
18
|
//#region src/cli/commands/extension-marketplace.ts
|
|
19
19
|
init_loader();
|
|
20
20
|
init_paths();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveConfigPath } from "../../../config/paths.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
5
4
|
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
5
|
+
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
6
6
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
7
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
8
8
|
import { runServiceRestart, runServiceStop } from "./lifecycle-core.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
2
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
2
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
4
|
import { getAllModels, getAvailableModels, getConfiguredProviders, getProviderAuthState, getProviderDisplayName, init_providers, isProviderConfigured, providerSupportsApiKey, providerSupportsOAuth, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { formatExamples, register } from "../registry.js";
|
|
6
6
|
import { getContextWithOpts } from "../context.js";
|
|
@@ -9,8 +9,8 @@ import { prepareUpdateGlobalDefaults } from "../../gateway/global-defaults-admin
|
|
|
9
9
|
import { disconnectProvider } from "../../providers/provider-disconnect.js";
|
|
10
10
|
import { colors } from "../utils/colors.js";
|
|
11
11
|
import { runCliOAuthLogin } from "../utils/oauth-login.js";
|
|
12
|
-
import { input } from "@inquirer/prompts";
|
|
13
12
|
import { Command } from "commander";
|
|
13
|
+
import { input } from "@inquirer/prompts";
|
|
14
14
|
//#region src/cli/commands/models.ts
|
|
15
15
|
init_credentials();
|
|
16
16
|
init_schema();
|
|
@@ -10,8 +10,8 @@ import { initWorkspace } from "../utils/init-workspace.js";
|
|
|
10
10
|
import { setupModel } from "./onboard/model.js";
|
|
11
11
|
import { getChannelConfigurators } from "./onboard/channels/registry.js";
|
|
12
12
|
import { setupChannels } from "./onboard/channels/index.js";
|
|
13
|
-
import { select } from "@inquirer/prompts";
|
|
14
13
|
import { Command } from "commander";
|
|
14
|
+
import { select } from "@inquirer/prompts";
|
|
15
15
|
//#region src/cli/commands/onboard.ts
|
|
16
16
|
init_schema();
|
|
17
17
|
init_paths_state();
|
package/dist/src/config/index.js
CHANGED
|
@@ -2,15 +2,15 @@ import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXop
|
|
|
2
2
|
import { TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema } from "../../extensions/telegram/src/config-schema.js";
|
|
3
3
|
import { WeixinAccountConfigSchema, WeixinConfigSchema } from "../../extensions/weixin/src/config-schema.js";
|
|
4
4
|
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpOAuthConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, RuntimeToolsConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
5
|
-
import {
|
|
5
|
+
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
6
6
|
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
8
8
|
import { resolveAgentDir as resolveAgentDir$1, resolveAgentHomeDir as resolveAgentHomeDir$1, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
9
|
-
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
10
9
|
import { FILENAMES, WORKSPACE_FILES, existsSync, hasBundledExtensionManifest, init_paths, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentHomeDir, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveCredentialsDir, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveMcpOAuthPath, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStatusPath, resolveToolsDir, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath } from "./paths.js";
|
|
11
|
-
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
-
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
13
10
|
import { CustomModelSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, ModelOverrideSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProviderConfigSchema, VercelGatewayRoutingSchema, getDefaultModelValues, init_models_json, loadModelsJson, modelsJsonExists, saveModelsJson, validateModelsConfig } from "./models-json.js";
|
|
11
|
+
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
+
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
13
|
+
import { extractProfileAgentId, resolveEffectiveAgentConfigForAgent, resolveEffectiveAgentConfigForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "./agent-profile.js";
|
|
14
14
|
import { canonicalizeConfiguredMcpServer, isKnownCliMcpTypeAlias, normalizeConfiguredMcpServers, resolveXopcMcpTransportAlias } from "./mcp-config-normalize.js";
|
|
15
15
|
import { formatThinkingLevels, listThinkingLevels, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, thinkLevelToNumber } from "../agent/transcript/thinking-types.js";
|
|
16
16
|
import { getWorkspacePath } from "./workspace-path-helpers.js";
|
|
@@ -2,8 +2,8 @@ import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { ConfigSchema, init_schema } from "./schema.js";
|
|
5
|
-
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
6
5
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
|
+
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
7
7
|
import { assertChannelPluginConfigs, init_validate_channel_configs } from "./validate-channel-configs.js";
|
|
8
8
|
import { dirname } from "path";
|
|
9
9
|
import { existsSync, mkdirSync, promises, readFileSync } from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
3
2
|
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
3
|
+
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
4
4
|
import { existsSync, readFileSync } from "fs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/config/models-json.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
3
|
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
|
+
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -7,8 +7,8 @@ import { SlotRegistry, getSlotRegistry, registerSlotType } from "../slots.js";
|
|
|
7
7
|
import { ExtensionDiagnostics, ExtensionLoaderCacheImpl, getExtensionCache, getExtensionDiagnostics } from "../diagnostics.js";
|
|
8
8
|
import "../loader.js";
|
|
9
9
|
import { ExtensionHookRunner, createHookContext, isHookEvent } from "../hooks.js";
|
|
10
|
-
import { defineChannelPluginEntry } from "./channel-entry.js";
|
|
11
10
|
import { registerExtensionCliProgram } from "./channel-helpers.js";
|
|
11
|
+
import { defineChannelPluginEntry } from "./channel-entry.js";
|
|
12
12
|
import { lazyFunction, lazyModule } from "./lazy.js";
|
|
13
13
|
import { createMockExtensionApi, createTestGateway } from "./testing.js";
|
|
14
14
|
//#region src/extensions/sdk/index.ts
|
|
@@ -15,17 +15,25 @@ export declare class FileServiceError extends Error {
|
|
|
15
15
|
readonly status: 400 | 403 | 404 | 409;
|
|
16
16
|
constructor(status: 400 | 403 | 404 | 409, message: string);
|
|
17
17
|
}
|
|
18
|
-
export declare function fileResourceFromPath(space: ResolvedFileSpace, absolutePath: string): Promise<FileResource>;
|
|
18
|
+
export declare function fileResourceFromPath(space: ResolvedFileSpace, absolutePath: string, displayPath?: string): Promise<FileResource>;
|
|
19
19
|
export declare class FileSpaceService {
|
|
20
20
|
private readonly getConfig;
|
|
21
21
|
private readonly projects;
|
|
22
22
|
private readonly resolveSessionWorkspace;
|
|
23
|
+
private readonly listSessionWorkspaces;
|
|
23
24
|
private readonly dynamicSpaces;
|
|
24
25
|
private cache;
|
|
25
|
-
constructor(getConfig: () => Config, projects: ProjectService, resolveSessionWorkspace: (sessionKey: string) => string)
|
|
26
|
+
constructor(getConfig: () => Config, projects: ProjectService, resolveSessionWorkspace: (sessionKey: string) => string | Promise<string>, listSessionWorkspaces?: () => Array<{
|
|
27
|
+
sessionKey: string;
|
|
28
|
+
root: string;
|
|
29
|
+
}> | Promise<Array<{
|
|
30
|
+
sessionKey: string;
|
|
31
|
+
root: string;
|
|
32
|
+
}>>);
|
|
26
33
|
private createSpace;
|
|
27
34
|
list(): Promise<ResolvedFileSpace[]>;
|
|
28
35
|
forContext(kind: 'agent' | 'project' | 'session', id: string): Promise<ResolvedFileSpace>;
|
|
36
|
+
defaultSpace(): Promise<ResolvedFileSpace>;
|
|
29
37
|
get(id: string): Promise<ResolvedFileSpace>;
|
|
30
38
|
resource(id: string): Promise<{
|
|
31
39
|
space: ResolvedFileSpace;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
1
|
+
import { init_agent_scope, listAgentEntries, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
2
2
|
import { resolveProjectAgentId } from "../projects/project-agent.js";
|
|
3
3
|
import "../projects/index.js";
|
|
4
4
|
import { basename, dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
@@ -21,6 +21,7 @@ const TEXT_EXTENSIONS = new Set([
|
|
|
21
21
|
"json",
|
|
22
22
|
"jsx",
|
|
23
23
|
"md",
|
|
24
|
+
"markdown",
|
|
24
25
|
"mjs",
|
|
25
26
|
"cjs",
|
|
26
27
|
"svg",
|
|
@@ -40,6 +41,7 @@ const MIME_TYPES = {
|
|
|
40
41
|
webp: "image/webp",
|
|
41
42
|
svg: "image/svg+xml",
|
|
42
43
|
md: "text/markdown",
|
|
44
|
+
markdown: "text/markdown",
|
|
43
45
|
txt: "text/plain",
|
|
44
46
|
json: "application/json",
|
|
45
47
|
html: "text/html",
|
|
@@ -85,7 +87,7 @@ function mimeType(name, directory) {
|
|
|
85
87
|
return MIME_TYPES[name.includes(".") ? name.split(".").pop().toLowerCase() : ""] ?? "application/octet-stream";
|
|
86
88
|
}
|
|
87
89
|
function capabilities(name, directory, writable) {
|
|
88
|
-
if (directory) return writable ? ["upload"] : [];
|
|
90
|
+
if (directory) return writable ? ["share", "upload"] : ["share"];
|
|
89
91
|
const extension = name.includes(".") ? name.split(".").pop().toLowerCase() : "";
|
|
90
92
|
const result = ["download", "share"];
|
|
91
93
|
if (MIME_TYPES[extension] || TEXT_EXTENSIONS.has(extension)) result.unshift("preview");
|
|
@@ -135,11 +137,11 @@ var FileServiceError = class extends Error {
|
|
|
135
137
|
this.status = status;
|
|
136
138
|
}
|
|
137
139
|
};
|
|
138
|
-
async function fileResourceFromPath(space, absolutePath) {
|
|
140
|
+
async function fileResourceFromPath(space, absolutePath, displayPath = absolutePath) {
|
|
139
141
|
const info = await stat(absolutePath);
|
|
140
142
|
const revisionInfo = await stat(absolutePath, { bigint: true });
|
|
141
|
-
const relativePath = relative(await realpath(space.root),
|
|
142
|
-
const name = basename(
|
|
143
|
+
const relativePath = relative(await realpath(space.root), displayPath).split(sep).join("/");
|
|
144
|
+
const name = basename(displayPath);
|
|
143
145
|
const directory = info.isDirectory();
|
|
144
146
|
return {
|
|
145
147
|
id: fileResourceId(space.id, relativePath),
|
|
@@ -158,10 +160,11 @@ async function fileResourceFromPath(space, absolutePath) {
|
|
|
158
160
|
var FileSpaceService = class {
|
|
159
161
|
dynamicSpaces = /* @__PURE__ */ new Map();
|
|
160
162
|
cache = null;
|
|
161
|
-
constructor(getConfig, projects, resolveSessionWorkspace) {
|
|
163
|
+
constructor(getConfig, projects, resolveSessionWorkspace, listSessionWorkspaces = () => []) {
|
|
162
164
|
this.getConfig = getConfig;
|
|
163
165
|
this.projects = projects;
|
|
164
166
|
this.resolveSessionWorkspace = resolveSessionWorkspace;
|
|
167
|
+
this.listSessionWorkspaces = listSessionWorkspaces;
|
|
165
168
|
}
|
|
166
169
|
async createSpace(root, title, bindings) {
|
|
167
170
|
const canonicalRoot = await realpath(root).catch(() => null);
|
|
@@ -213,6 +216,13 @@ var FileSpaceService = class {
|
|
|
213
216
|
offset += page.items.length;
|
|
214
217
|
}
|
|
215
218
|
const merged = /* @__PURE__ */ new Map();
|
|
219
|
+
for (const { sessionKey, root } of await this.listSessionWorkspaces()) {
|
|
220
|
+
const space = await this.createSpace(root, sessionKey, [{
|
|
221
|
+
kind: "session",
|
|
222
|
+
id: sessionKey
|
|
223
|
+
}]);
|
|
224
|
+
if (space) spaces.push(space);
|
|
225
|
+
}
|
|
216
226
|
for (const space of [...spaces, ...this.dynamicSpaces.values()]) {
|
|
217
227
|
const existing = merged.get(space.id);
|
|
218
228
|
if (existing) existing.bindings = [...existing.bindings, ...space.bindings.filter((binding) => !existing.bindings.some((item) => item.kind === binding.kind && item.id === binding.id))];
|
|
@@ -245,7 +255,7 @@ var FileSpaceService = class {
|
|
|
245
255
|
}
|
|
246
256
|
title = project?.name ?? id;
|
|
247
257
|
}
|
|
248
|
-
if (kind === "session") root = this.resolveSessionWorkspace(id);
|
|
258
|
+
if (kind === "session") root = await this.resolveSessionWorkspace(id);
|
|
249
259
|
if (!root) throw new FileServiceError(404, "File space not found");
|
|
250
260
|
const space = await this.createSpace(root, title, [{
|
|
251
261
|
kind,
|
|
@@ -256,8 +266,16 @@ var FileSpaceService = class {
|
|
|
256
266
|
this.cache = null;
|
|
257
267
|
return space;
|
|
258
268
|
}
|
|
269
|
+
defaultSpace() {
|
|
270
|
+
return this.forContext("agent", resolveDefaultAgentId(this.getConfig()));
|
|
271
|
+
}
|
|
259
272
|
async get(id) {
|
|
260
|
-
const
|
|
273
|
+
const hadCache = this.cache !== null;
|
|
274
|
+
let space = (await this.list()).find((item) => item.id === id);
|
|
275
|
+
if (!space && hadCache) {
|
|
276
|
+
this.cache = null;
|
|
277
|
+
space = (await this.list()).find((item) => item.id === id);
|
|
278
|
+
}
|
|
261
279
|
if (!space) throw new FileServiceError(404, "File space not found");
|
|
262
280
|
return space;
|
|
263
281
|
}
|
|
@@ -267,7 +285,7 @@ var FileSpaceService = class {
|
|
|
267
285
|
const absolutePath = await resolveFilePath(space.root, locator.relativePath);
|
|
268
286
|
return {
|
|
269
287
|
space,
|
|
270
|
-
resource: await fileResourceFromPath(space, absolutePath),
|
|
288
|
+
resource: await fileResourceFromPath(space, absolutePath, resolve(space.root, locator.relativePath)),
|
|
271
289
|
absolutePath
|
|
272
290
|
};
|
|
273
291
|
}
|
|
@@ -280,9 +298,12 @@ var FileSpaceService = class {
|
|
|
280
298
|
for await (const entry of dir) {
|
|
281
299
|
if (SKIPPED_NAMES.has(entry.name)) continue;
|
|
282
300
|
const target = resolve(directory, entry.name);
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
301
|
+
if (!await lstat(target).catch(() => null)) continue;
|
|
302
|
+
const canonicalTarget = await resolveFilePath(space.root, target).catch(() => null);
|
|
303
|
+
if (!canonicalTarget) continue;
|
|
304
|
+
const info = await stat(canonicalTarget).catch(() => null);
|
|
305
|
+
if (!info || !info.isFile() && !info.isDirectory()) continue;
|
|
306
|
+
entries.push(await fileResourceFromPath(space, canonicalTarget, resolve(space.root, path, entry.name)));
|
|
286
307
|
}
|
|
287
308
|
return entries.sort((a, b) => a.kind === b.kind ? a.name.localeCompare(b.name) : a.kind === "directory" ? -1 : 1);
|
|
288
309
|
}
|
|
@@ -247,4 +247,4 @@ export declare const GATEWAY_BUILTIN_TOOLS: readonly [{
|
|
|
247
247
|
readonly zh: "使用已验证的参数执行选定的外部工具。";
|
|
248
248
|
};
|
|
249
249
|
}];
|
|
250
|
-
export declare const GATEWAY_BUILTIN_TOOL_IDS: ("automation" | "workflow" | "find" | "todo" | "image" | "clarify" | "dreaming" | "memory_search" | "memory_get" | "web_search" | "web_fetch" | "browser_use" | "grep" | "session_search" | "read_file" | "list_dir" | "write_file" | "apply_patch" | "exec_command" | "update_plan" | "
|
|
250
|
+
export declare const GATEWAY_BUILTIN_TOOL_IDS: ("automation" | "workflow" | "find" | "todo" | "image" | "clarify" | "dreaming" | "memory_search" | "memory_get" | "web_search" | "web_fetch" | "browser_use" | "grep" | "session_search" | "read_file" | "list_dir" | "write_file" | "apply_patch" | "exec_command" | "update_plan" | "web_extract" | "image_generate" | "skills_list" | "skill_view" | "skill_manage" | "skills_marketplace_search" | "xopc_tool_search" | "xopc_tool_describe" | "xopc_tool_execute" | "send_message" | "send_media" | "read_media" | "create_share" | "session_status" | "tool_manual" | "delegate_task" | "skill_install" | "text_to_speech" | "execute_code" | "create_desktop_pet")[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
|
-
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
3
2
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
3
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
4
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
5
5
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
6
6
|
import { seedAgentProfileMarkdownFiles } from "../agent/context/workspace-seed.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseTurnOutcome } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
1
2
|
import { resolveToolActivity } from "../../../packages/gateway-contract/src/tool-activity.js";
|
|
2
3
|
import { createPetFeedback } from "./pet-feedback.js";
|
|
3
4
|
//#region src/gateway/chat-stream/mapper.ts
|
|
@@ -126,6 +127,10 @@ var ChatStreamMapper = class {
|
|
|
126
127
|
kind
|
|
127
128
|
}] : [];
|
|
128
129
|
}) : [] })];
|
|
130
|
+
case "turn_outcome": {
|
|
131
|
+
const outcome = parseTurnOutcome(event.outcome);
|
|
132
|
+
return outcome ? [this.make("turn_outcome", outcome)] : [];
|
|
133
|
+
}
|
|
129
134
|
case "error": return [this.make("error", {
|
|
130
135
|
code: "AGENT_RUN_ERROR",
|
|
131
136
|
message: String(event.content ?? event.message ?? "Unknown error"),
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Config } from '../config/schema.js';
|
|
2
|
+
import type { FileReferenceLocationKind, FileReferenceScope } from './file-reference-registry.js';
|
|
3
|
+
export type { FileReferenceLocationKind };
|
|
4
|
+
export interface FilePathClassifierContext {
|
|
5
|
+
workspaceRoot: string;
|
|
6
|
+
profileMarkdownRoot?: string;
|
|
7
|
+
stateDir: string;
|
|
8
|
+
skillsDir: string;
|
|
9
|
+
configFilePath: string;
|
|
10
|
+
agentsHomeDir: string;
|
|
11
|
+
agentId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildFilePathClassifierContext(cfg: Config, sessionKeyRaw?: string): FilePathClassifierContext;
|
|
14
|
+
export declare function looksLikeHostAbsolutePath(pathRaw: string): boolean;
|
|
15
|
+
export declare function fileRefSessionKeysMatch(registered?: string, query?: string): boolean;
|
|
16
|
+
export interface ClassifiedFileLocation {
|
|
17
|
+
scope: FileReferenceScope;
|
|
18
|
+
locationKind?: FileReferenceLocationKind;
|
|
19
|
+
manageRoute?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function classifyFileLocation(absPath: string, ctx: FilePathClassifierContext): ClassifiedFileLocation;
|
|
22
|
+
export interface ResolveFileReferenceCandidateResult {
|
|
23
|
+
candidate: string | null;
|
|
24
|
+
invalid: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolve user path to an absolute candidate (workspace, absolute host, or profile fallback).
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveFileReferenceCandidate(rawPath: string, workspaceRoot: string, ctx: FilePathClassifierContext): Promise<ResolveFileReferenceCandidateResult>;
|
|
30
|
+
export declare function displayNameForPath(rawPath: string): string;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
|
+
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
+
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
5
|
+
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
|
+
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
|
+
import { basename, isAbsolute, resolve } from "node:path";
|
|
8
|
+
import { stat } from "node:fs/promises";
|
|
9
|
+
//#region src/gateway/file-path-classifier.ts
|
|
10
|
+
init_agent_scope();
|
|
11
|
+
init_paths();
|
|
12
|
+
init_paths_state();
|
|
13
|
+
function buildFilePathClassifierContext(cfg, sessionKeyRaw) {
|
|
14
|
+
const agentId = extractProfileAgentId(sessionKeyRaw, cfg);
|
|
15
|
+
const stateDir = resolveStateDir();
|
|
16
|
+
return {
|
|
17
|
+
workspaceRoot: "",
|
|
18
|
+
profileMarkdownRoot: resolveAgentProfileDir(cfg, agentId),
|
|
19
|
+
stateDir,
|
|
20
|
+
skillsDir: resolveSkillsDir(),
|
|
21
|
+
configFilePath: resolveConfigPath(),
|
|
22
|
+
agentsHomeDir: resolve(stateDir, "agents"),
|
|
23
|
+
agentId
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function looksLikeHostAbsolutePath(pathRaw) {
|
|
27
|
+
const p = pathRaw.trim();
|
|
28
|
+
if (!p) return false;
|
|
29
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(p) && !/^[A-Za-z]:[\\/]/.test(p)) return false;
|
|
30
|
+
return isAbsolute(p) || /^[A-Za-z]:[\\/]/.test(p) || p.startsWith("\\\\");
|
|
31
|
+
}
|
|
32
|
+
function fileRefSessionKeysMatch(registered, query) {
|
|
33
|
+
return (registered ?? "").trim() === (query ?? "").trim();
|
|
34
|
+
}
|
|
35
|
+
function classifyFileLocation(absPath, ctx) {
|
|
36
|
+
const p = resolve(absPath);
|
|
37
|
+
if (isPathUnderWorkspace(resolve(ctx.workspaceRoot), p)) return { scope: "workspace" };
|
|
38
|
+
if (ctx.profileMarkdownRoot) {
|
|
39
|
+
if (isPathUnderWorkspace(resolve(ctx.profileMarkdownRoot), p)) return {
|
|
40
|
+
scope: "agent-profile",
|
|
41
|
+
locationKind: "agent-profile",
|
|
42
|
+
manageRoute: `/agents/${encodeURIComponent(ctx.agentId)}`
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (isPathUnderWorkspace(resolve(ctx.skillsDir), p)) return {
|
|
46
|
+
scope: "external",
|
|
47
|
+
locationKind: "xopc-skills",
|
|
48
|
+
manageRoute: "/skills"
|
|
49
|
+
};
|
|
50
|
+
if (isPathUnderWorkspace(resolve(ctx.agentsHomeDir), p)) return {
|
|
51
|
+
scope: "external",
|
|
52
|
+
locationKind: "xopc-agents",
|
|
53
|
+
manageRoute: `/agents/${encodeURIComponent(ctx.agentId)}`
|
|
54
|
+
};
|
|
55
|
+
const stateRoot = resolve(ctx.stateDir);
|
|
56
|
+
if (p === resolve(ctx.configFilePath) || isPathUnderWorkspace(stateRoot, p)) return {
|
|
57
|
+
scope: "external",
|
|
58
|
+
locationKind: "xopc-config",
|
|
59
|
+
manageRoute: "/settings/gateway"
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
scope: "external",
|
|
63
|
+
locationKind: "host"
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Resolve user path to an absolute candidate (workspace, absolute host, or profile fallback).
|
|
68
|
+
*/
|
|
69
|
+
async function resolveFileReferenceCandidate(rawPath, workspaceRoot, ctx) {
|
|
70
|
+
const displayRoot = workspaceRoot;
|
|
71
|
+
ctx = {
|
|
72
|
+
...ctx,
|
|
73
|
+
workspaceRoot: displayRoot
|
|
74
|
+
};
|
|
75
|
+
if (looksLikeHostAbsolutePath(rawPath)) return {
|
|
76
|
+
candidate: resolve(rawPath),
|
|
77
|
+
invalid: false
|
|
78
|
+
};
|
|
79
|
+
const wsPath = resolveWorkspaceSafePath(workspaceRoot, rawPath);
|
|
80
|
+
if (!wsPath) return {
|
|
81
|
+
candidate: null,
|
|
82
|
+
invalid: true
|
|
83
|
+
};
|
|
84
|
+
try {
|
|
85
|
+
await stat(wsPath);
|
|
86
|
+
return {
|
|
87
|
+
candidate: wsPath,
|
|
88
|
+
invalid: false
|
|
89
|
+
};
|
|
90
|
+
} catch (e) {
|
|
91
|
+
if (e?.code === "ENOENT" && ctx.profileMarkdownRoot && isBareProfileMarkdownFileName(rawPath)) return {
|
|
92
|
+
candidate: resolveProfileMarkdownPathIfBareName(rawPath, ctx.profileMarkdownRoot),
|
|
93
|
+
invalid: false
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
candidate: wsPath,
|
|
97
|
+
invalid: false
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function displayNameForPath(rawPath) {
|
|
102
|
+
return basename(rawPath.replace(/\\/g, "/")) || rawPath;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { buildFilePathClassifierContext, classifyFileLocation, displayNameForPath, fileRefSessionKeysMatch, looksLikeHostAbsolutePath, resolveFileReferenceCandidate };
|
|
@@ -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 };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type FileReferenceScope = 'workspace' | 'external' | 'agent-profile' | 'session-artifact' | 'missing' | 'invalid';
|
|
2
|
+
/** Where an off-workspace file lives (UI badge + manage deep link). */
|
|
3
|
+
export type FileReferenceLocationKind = 'agent-profile' | 'xopc-skills' | 'xopc-config' | 'xopc-agents' | 'xopc-sessions' | 'host';
|
|
4
|
+
export type FileReferenceCapability = 'preview' | 'edit' | 'openExternal' | 'revealInFolder' | 'copyPath' | 'importToWorkspace';
|
|
5
|
+
export interface RegisteredFileReference {
|
|
6
|
+
id: string;
|
|
7
|
+
absolutePath: string;
|
|
8
|
+
sessionKey?: string;
|
|
9
|
+
scope: FileReferenceScope;
|
|
10
|
+
locationKind?: FileReferenceLocationKind;
|
|
11
|
+
capabilities: FileReferenceCapability[];
|
|
12
|
+
expiresAt: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RegisterFileReferenceInput {
|
|
15
|
+
absolutePath: string;
|
|
16
|
+
sessionKey?: string;
|
|
17
|
+
scope: FileReferenceScope;
|
|
18
|
+
locationKind?: FileReferenceLocationKind;
|
|
19
|
+
capabilities: FileReferenceCapability[];
|
|
20
|
+
ttlMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class FileReferenceRegistry {
|
|
23
|
+
private readonly refs;
|
|
24
|
+
register(input: RegisterFileReferenceInput): RegisteredFileReference;
|
|
25
|
+
resolve(id: string): RegisteredFileReference | null;
|
|
26
|
+
/**
|
|
27
|
+
* Remove a specific reference (used after a one-shot action like
|
|
28
|
+
* import-to-workspace completes so the source card can't be re-triggered).
|
|
29
|
+
* Returns true if the reference existed and was removed.
|
|
30
|
+
*/
|
|
31
|
+
expireById(id: string): boolean;
|
|
32
|
+
expire(now?: number): void;
|
|
33
|
+
}
|
|
34
|
+
export declare const fileReferenceRegistry: FileReferenceRegistry;
|