@xopcai/xopc 0.0.163 → 0.0.165
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-Xj95LzTv.js → activity-store-DkALQFJT.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C-QeUFwU.js → agent-avatar-dicebear-CKVX2TyD.js} +1 -1
- package/dist/gateway/static/root/assets/agents-F8749KZ_.js +2 -0
- package/dist/gateway/static/root/assets/{api-BTLmAm1_.js → api-DPIXEcIq.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-zc6Gf-S5.js → app-management-settings-panel-ClToHdDF.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-0fMLnOWn.js → appearance-settings-Ci2jWAkQ.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DCow0nte.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DOiR_E21.js → archive-plugin-CKv5A1_M.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BxmYl1D1.js → attachment-load-LgoN-Vwo.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-BhZOirad.js → automation-suggestion-card-BwnZqDQE.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-DWWHMqCZ.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DTTKsvgk.js → binary-plugins-WwMRnBdP.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C7se7iqg.js → block-editor-CThEfJSn.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-7x8rKLOl.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-kxmStCcv.js → browser-workflow-inputs-DCj9DG0A.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CwYf9OM_.js → browser-workflows-page-C1k2vHLV.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DIwGIpuS.js +2 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BZKh2cWX.js → capability-presets-api-C_NVbV7o.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DBdvIcV0.js +2 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-r7tdbnJE.js → channel-recipient-api-B5rLegwk.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-DU93p9RZ.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DZZq0upi.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-BpnQYAxA.js → connector-logo-au5xzRMl.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-B9sD56hT.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-CaTO9bAV.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-uv8Grtgk.js → desktop-pet-settings-CORq2BIE.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C4TTvf7p.js → directory-picker-path-field-Daf0tqrN.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CzJAUPvM.js → dreaming-settings-CJqJpvgc.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-Ci2mOYUt.js → extension-debug-page-0XmiUqsm.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DeXdmhXQ.js → extension-page-C_9HSvyu.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-C93vaOsU.js → extension-settings-page-DcmUCmOu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C31Hlblp.js → gateway-config-api-CZqfsxJf.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-D3zS6RZh.js → gateway-settings-CzX8TVmO.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CSRvCqxh.js → gateway-startup-retry-ulwTJovP.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-Dbj_sgV-.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-BdkiZwW-.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-D4wYNRrf.js → goals-config-api-Cvlq3jyf.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BD9ztXNA.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-Bx2jVvhQ.js → goals-settings-CSGvHJDi.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BEIF1eXy.js → heartbeat-settings-BvXA7oNN.js} +1 -1
- package/dist/gateway/static/root/assets/{index-HZdBKfk_.js → index-CfOzvGDb.js} +70 -70
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DOEDpvTM.js → keyboard-shortcuts-settings-xb6mna1C.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DH4nglP_.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-B0OpGpxv.js → local-apps-page-BScdXqMo.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Ys6RP7Be.js → locale-store-C_ax27uc.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BBpAWjyF.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-CEZwysCH.js → markdown-split-8hnAS25m.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CpGKE7B0.js → media-plugins-DzlHseMD.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-BzI9Wx30.js → messages-C96Zjb0V.js} +2 -2
- package/dist/gateway/static/root/assets/{notes-page-CdiuDZ5a.js → notes-page-DbDHFPiI.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-B-A9whbg.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BkH5AVV2.js → page-tabs-CXJiygUJ.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CQai8f9D.js → preview-open-alternatives-Cq6aue5a.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-B2kSdB2b.js → product-open-page-nP8vuNlJ.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BXrscUbq.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-m0EKUeaY.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-B16uQSY5.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-NGYnO7n7.js → save-bar-controls-BPgnLY1p.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-nLOphnv3.js → schedule-field-rHWpueWl.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-D0e90ndE.js → schema-form-CHKIUrzk.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-C5_qtznc.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DQlbm1mA.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-X2Sl-EAk.js → settings-form-section-CR4J0N4X.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DOnUabm7.js → settings-loading-skeleton-B8v-lHKT.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C4UUNi1n.js → settings-page-BcLf8Rd5.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-C1yYqbT6.js → settings-page-layout-Co31Becn.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BFLA1Fsj.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-Cfy_pH7V.js → share-preview-page-B5vMe8DY.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DL2tKPq6.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-C8jkuLob.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DAOZXlp5.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Da81RJ6G.js → system-settings-panel-CHt3FXI8.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DflSp9o4.js → theme-store-D37XLD_C.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-BIkOW-2L.js → time-picker-C9Rr1IUV.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib--HptwFcD.js → typed-models-lib-QMF30Yvh.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CMHY4ZfW.js → use-channel-catalog-DBh0dOC9.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-D6EEhj-e.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-nvIZerol.js → voice-api-key-field-Gjjs3qih.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CDnL9daG.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-BCoT4p1E.js +1 -0
- package/dist/gateway/static/root/assets/work-page-l8h2Y50w.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D96MHABy.js → workflow-run-setup-panel-DnOfronD.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-IVbQ83CW.js +11 -0
- package/dist/gateway/static/root/index.html +6 -6
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +3 -3
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/model-runtime.d.ts +4 -0
- package/dist/src/agent/embedded/model-runtime.js +49 -0
- package/dist/src/agent/embedded/run-turn.js +9 -2
- package/dist/src/agent/embedded/session-runner.js +3 -3
- package/dist/src/agent/goals/post-turn.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/memory/dreaming/config.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/auth/credentials.js +46 -3
- package/dist/src/auth/index.js +2 -1
- package/dist/src/auth/oauth/anthropic.js +27 -24
- package/dist/src/auth/oauth/github-copilot.js +20 -15
- package/dist/src/auth/oauth/google-antigravity.js +9 -2
- package/dist/src/auth/oauth/google-gemini-cli.js +9 -2
- package/dist/src/auth/oauth/google-oauth/google-antigravity.js +47 -40
- package/dist/src/auth/oauth/google-oauth/google-gemini-cli.js +48 -41
- package/dist/src/auth/oauth/google-oauth/oauth-page.js +7 -2
- package/dist/src/auth/oauth/google-oauth/pkce.js +4 -1
- package/dist/src/auth/oauth/index.d.ts +2 -0
- package/dist/src/auth/oauth/index.js +24 -10
- package/dist/src/auth/oauth/kimi-coding.js +76 -71
- package/dist/src/auth/oauth/minimax-cn.js +78 -73
- package/dist/src/auth/oauth/minimax.js +78 -73
- package/dist/src/auth/oauth/openai-codex.js +31 -25
- package/dist/src/auth/oauth/pkce.js +4 -1
- package/dist/src/auth/oauth/registry.d.ts +13 -0
- package/dist/src/auth/oauth/registry.js +65 -0
- package/dist/src/auth/oauth/xopc-cloud.d.ts +2 -0
- package/dist/src/auth/oauth/xopc-cloud.js +101 -0
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +6 -1
- 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 +2 -2
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- 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/cli/commands/update.js +1 -1
- package/dist/src/cli/utils/oauth-providers.d.ts +3 -26
- package/dist/src/cli/utils/oauth-providers.js +6 -80
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +9 -1
- package/dist/src/connectors/connector-memory-sync.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- 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/oauth-async.js +3 -19
- package/dist/src/gateway/hono/oauth.js +3 -19
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +2 -56
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +6 -6
- package/dist/src/goals/goal-workflow-judge.js +1 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/domestic-presets.d.ts +0 -20
- package/dist/src/providers/domestic-presets.js +0 -25
- package/dist/src/providers/index.js +10 -1
- package/dist/src/providers/model-catalog-store.d.ts +20 -58
- package/dist/src/providers/model-catalog-store.js +18 -57
- package/dist/src/providers/model-catalog-sync-service.d.ts +3 -4
- package/dist/src/providers/model-catalog-sync-service.js +3 -13
- package/dist/src/providers/model-registry.js +1 -3
- package/dist/src/providers/xopc-cloud-model-source.d.ts +30 -0
- package/dist/src/providers/xopc-cloud-model-source.js +68 -0
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/work-discovery/analyzer.js +27 -14
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-DVKlWKJE.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-BZXEJDIV.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-B8CnkoXv.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BCPWKI9V.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C7lr_mX2.js +0 -2
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Ble9kHRu.js +0 -2
- package/dist/gateway/static/root/assets/channels-settings-CtQQQHrv.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-_VirfMKW.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BXWJSJeY.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-B86W4a5c.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-CWp2b7__.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-Dtm29FxD.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-jMzBJs6e.js +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-CseW9jD3.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-DVqPbth5.js +0 -7
- package/dist/gateway/static/root/assets/notes-workbench-mrc3xtpn.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CfhPJLkH.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BfMoKjdm.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CrDtcsZ9.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-D3DbF3dV.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BZp0O2dH.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-84iao4DZ.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DtcwQvRG.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-L7j5Gc8Z.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-1Ps8PjsP.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-BYAAs2iW.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-J35JkJ7_.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-C4wYDYqV.js +0 -1
- package/dist/gateway/static/root/assets/work-page-DMvitV6c.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-JMN0nMbM.js +0 -11
- package/dist/src/agent/embedded/xopc-auth-storage.d.ts +0 -19
- package/dist/src/agent/embedded/xopc-auth-storage.js +0 -40
- package/dist/src/providers/xopc-cloud-connection.d.ts +0 -51
- package/dist/src/providers/xopc-cloud-connection.js +0 -196
|
@@ -3,8 +3,8 @@ import "../storage/sqlite/index.js";
|
|
|
3
3
|
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
4
4
|
import { scopeForComposioAction } from "./composio.js";
|
|
5
5
|
import { getConnectorDefinition } from "./catalog.js";
|
|
6
|
-
import { getConnectorInstance } from "./instances.js";
|
|
7
6
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
7
|
+
import { getConnectorInstance } from "./instances.js";
|
|
8
8
|
import { KnowledgeIngestionService } from "../knowledge/ingestion-service.js";
|
|
9
9
|
import { ConnectedKnowledgePipeline } from "../knowledge/connected-knowledge-pipeline.js";
|
|
10
10
|
import { LocalFolderKnowledgeSourceAdapter } from "../knowledge/local-folder-adapter.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-materialize.js";
|
|
2
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
2
3
|
import { materializeConnectorMcpServer } from "./materialize.js";
|
|
3
4
|
import { getConnectorInstance } from "./instances.js";
|
|
4
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
5
5
|
//#region src/connectors/health.ts
|
|
6
6
|
function classifyConnectorHealthError(error) {
|
|
7
7
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
1
|
import { resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
|
-
import {
|
|
2
|
+
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
4
3
|
import { WORKSPACE_FILES, init_paths, resolveUserProfilePath } from "../config/paths.js";
|
|
4
|
+
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
5
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { applyAgentConfig, findAgentEntryIndex, getAgentDeleteBlocker, pruneAgentConfig, removeAgentDirsFromDisk } from "../commands/agents.config.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
3
|
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
|
+
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
5
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
6
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
@@ -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";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
2
2
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
3
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
4
3
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
5
4
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
5
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
6
6
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
7
7
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
8
8
|
import { resolveShareConfig } from "../../../share/share-config.js";
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { getOAuthProviderInterfaces, init_registry } from "../../auth/oauth/registry.js";
|
|
3
4
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
4
5
|
import { isLoopbackHost } from "../host.js";
|
|
5
6
|
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
6
|
-
import { anthropicOAuthProvider } from "../../auth/oauth/anthropic.js";
|
|
7
|
-
import { minimaxOAuthProvider } from "../../auth/oauth/minimax.js";
|
|
8
|
-
import { minimaxCnOAuthProvider } from "../../auth/oauth/minimax-cn.js";
|
|
9
|
-
import { kimiCodingOAuthProvider } from "../../auth/oauth/kimi-coding.js";
|
|
10
|
-
import { githubCopilotOAuthProvider } from "../../auth/oauth/github-copilot.js";
|
|
11
|
-
import { geminiCliOAuthProvider } from "../../auth/oauth/google-oauth/google-gemini-cli.js";
|
|
12
|
-
import { antigravityOAuthProvider } from "../../auth/oauth/google-oauth/google-antigravity.js";
|
|
13
|
-
import { openaiCodexOAuthProvider } from "../../auth/oauth/openai-codex.js";
|
|
14
|
-
import "../../auth/oauth/index.js";
|
|
15
7
|
import { Hono } from "hono";
|
|
16
8
|
//#region src/gateway/hono/oauth-async.ts
|
|
17
9
|
/**
|
|
@@ -21,6 +13,7 @@ import { Hono } from "hono";
|
|
|
21
13
|
* This allows OAuth flows that require user interaction (browser login)
|
|
22
14
|
* without blocking the HTTP request.
|
|
23
15
|
*/
|
|
16
|
+
init_registry();
|
|
24
17
|
init_credentials();
|
|
25
18
|
init_logger();
|
|
26
19
|
const log = createLogger("OAuthAsync");
|
|
@@ -32,16 +25,7 @@ function formatOAuthAsyncError(err) {
|
|
|
32
25
|
if (/^fetch failed$/i.test(base) || base.includes("fetch failed")) return `Network request failed${detail}. If the browser opened on another device, the redirect goes to that device's localhost — copy the full URL from the browser address bar after sign-in (starts with http://127.0.0.1 or http://localhost) and paste it below. Otherwise check VPN/proxy/DNS/firewall access to Google OAuth.`;
|
|
33
26
|
return base;
|
|
34
27
|
}
|
|
35
|
-
const OAUTH_PROVIDERS =
|
|
36
|
-
"kimi-coding": kimiCodingOAuthProvider,
|
|
37
|
-
"minimax": minimaxOAuthProvider,
|
|
38
|
-
"minimax-cn": minimaxCnOAuthProvider,
|
|
39
|
-
"anthropic": anthropicOAuthProvider,
|
|
40
|
-
"github-copilot": githubCopilotOAuthProvider,
|
|
41
|
-
"google-gemini-cli": geminiCliOAuthProvider,
|
|
42
|
-
"google-antigravity": antigravityOAuthProvider,
|
|
43
|
-
"openai-codex": openaiCodexOAuthProvider
|
|
44
|
-
};
|
|
28
|
+
const OAUTH_PROVIDERS = getOAuthProviderInterfaces();
|
|
45
29
|
const oauthSessions = /* @__PURE__ */ new Map();
|
|
46
30
|
const SESSION_TTL_MS = 600 * 1e3;
|
|
47
31
|
setInterval(() => {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
+
import { getOAuthProviderInterfaces, init_registry } from "../../auth/oauth/registry.js";
|
|
1
2
|
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
2
3
|
import { getProviderAuthState, init_providers, isProviderConfigured } from "../../providers/index.js";
|
|
3
|
-
import { anthropicOAuthProvider } from "../../auth/oauth/anthropic.js";
|
|
4
|
-
import { minimaxOAuthProvider } from "../../auth/oauth/minimax.js";
|
|
5
|
-
import { minimaxCnOAuthProvider } from "../../auth/oauth/minimax-cn.js";
|
|
6
|
-
import { kimiCodingOAuthProvider } from "../../auth/oauth/kimi-coding.js";
|
|
7
|
-
import { githubCopilotOAuthProvider } from "../../auth/oauth/github-copilot.js";
|
|
8
|
-
import { geminiCliOAuthProvider } from "../../auth/oauth/google-oauth/google-gemini-cli.js";
|
|
9
|
-
import { antigravityOAuthProvider } from "../../auth/oauth/google-oauth/google-antigravity.js";
|
|
10
|
-
import { openaiCodexOAuthProvider } from "../../auth/oauth/openai-codex.js";
|
|
11
|
-
import "../../auth/oauth/index.js";
|
|
12
4
|
import { Hono } from "hono";
|
|
13
5
|
//#region src/gateway/hono/oauth.ts
|
|
14
6
|
/**
|
|
@@ -16,18 +8,10 @@ import { Hono } from "hono";
|
|
|
16
8
|
*
|
|
17
9
|
* Provides HTTP endpoints for OAuth login flow.
|
|
18
10
|
*/
|
|
11
|
+
init_registry();
|
|
19
12
|
init_credentials();
|
|
20
13
|
init_providers();
|
|
21
|
-
const OAUTH_PROVIDERS =
|
|
22
|
-
"kimi-coding": kimiCodingOAuthProvider,
|
|
23
|
-
"minimax": minimaxOAuthProvider,
|
|
24
|
-
"minimax-cn": minimaxCnOAuthProvider,
|
|
25
|
-
"anthropic": anthropicOAuthProvider,
|
|
26
|
-
"github-copilot": githubCopilotOAuthProvider,
|
|
27
|
-
"google-gemini-cli": geminiCliOAuthProvider,
|
|
28
|
-
"google-antigravity": antigravityOAuthProvider,
|
|
29
|
-
"openai-codex": openaiCodexOAuthProvider
|
|
30
|
-
};
|
|
14
|
+
const OAUTH_PROVIDERS = getOAuthProviderInterfaces();
|
|
31
15
|
const oauthCredentialsCache = /* @__PURE__ */ new Map();
|
|
32
16
|
function getOAuthCredentialsFromCache(provider) {
|
|
33
17
|
return oauthCredentialsCache.get(provider);
|
|
@@ -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
3
|
import { listBundleMcpServerCapabilitiesForGateway, listBundleMcpServerToolsForGateway } from "../../../agent/mcp/bundle-mcp-materialize.js";
|
|
4
|
-
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
5
4
|
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
5
|
+
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
6
6
|
//#region src/gateway/hono/routes/mcp.ts
|
|
7
7
|
function registerMcpRoutes(authenticated, deps) {
|
|
8
8
|
authenticated.get("/api/mcp/servers", (c) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
1
|
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
2
|
+
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
3
3
|
import { init_models_json, loadModelsJson, saveModelsJson, validateModelsConfig } from "../../../config/models-json.js";
|
|
4
4
|
import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
|
|
5
5
|
import { getModelRegistry } from "../../../providers/model-registry.js";
|
|
@@ -12,7 +12,6 @@ import { getDomesticProviderPreset, getDomesticProviderPresetIds } from "../../.
|
|
|
12
12
|
import { getOnboardingFeaturedProviders, getProviderHint, getRecommendedModelsForProvider, isRecommendedModel, sortModelsForPicker, sortProvidersForPicker } from "../../../providers/presentation.js";
|
|
13
13
|
import { getAgentImageGenerationConfig, getImageGenerationCatalog, prepareImageGenerationSetup, verifyImageGenerationCredential } from "../../image-generation-setup.js";
|
|
14
14
|
import { discoverProviderModels, isProviderApiDiscoverable } from "../../../providers/model-discovery.js";
|
|
15
|
-
import { XopcCloudHttpError } from "../../../providers/xopc-cloud-connection.js";
|
|
16
15
|
import { respondStartupUnavailable } from "../lib/startup-unavailable.js";
|
|
17
16
|
import { auditModelReferences } from "../../../providers/model-reference-auditor.js";
|
|
18
17
|
//#region src/gateway/hono/routes/models.ts
|
|
@@ -63,61 +62,8 @@ function mapPluginModel(providerId, model, available) {
|
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
64
|
function registerModelsRoutes(authenticated, deps) {
|
|
66
|
-
const { service, strictRateLimitMiddleware
|
|
65
|
+
const { service, strictRateLimitMiddleware } = deps;
|
|
67
66
|
const catalogSync = service.getModelCatalogSync();
|
|
68
|
-
const xopcCloud = catalogSync.getXopcCloudConnection();
|
|
69
|
-
authenticated.post("/api/models/xopc-cloud/connect", strictRateLimitMiddleware, async (c) => {
|
|
70
|
-
const body = await c.req.json().catch(() => ({}));
|
|
71
|
-
const clientType = body.clientType === "electron" || body.clientType === "cli" ? body.clientType : "web";
|
|
72
|
-
try {
|
|
73
|
-
return c.json({
|
|
74
|
-
ok: true,
|
|
75
|
-
payload: await xopcCloud.start(clientType)
|
|
76
|
-
}, 201);
|
|
77
|
-
} catch (error) {
|
|
78
|
-
return c.json({
|
|
79
|
-
ok: false,
|
|
80
|
-
error: { message: error instanceof Error ? error.message : "Connection failed" }
|
|
81
|
-
}, 502);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
authenticated.post("/api/models/xopc-cloud/connect/:requestId/poll", xopcCloudPollRateLimitMiddleware, async (c) => {
|
|
85
|
-
try {
|
|
86
|
-
const result = await xopcCloud.poll(c.req.param("requestId"));
|
|
87
|
-
if (result.status === "pending") return c.json({
|
|
88
|
-
ok: true,
|
|
89
|
-
payload: result
|
|
90
|
-
}, 202);
|
|
91
|
-
service.emit("model-catalog.updated", { modelCount: getModelRegistry().getAll().length });
|
|
92
|
-
return c.json({
|
|
93
|
-
ok: true,
|
|
94
|
-
payload: result
|
|
95
|
-
});
|
|
96
|
-
} catch (error) {
|
|
97
|
-
return c.json({
|
|
98
|
-
ok: false,
|
|
99
|
-
error: { message: error instanceof Error ? error.message : "Connection failed" }
|
|
100
|
-
}, 400);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
authenticated.post("/api/models/xopc-cloud/refresh", strictRateLimitMiddleware, async (c) => {
|
|
104
|
-
try {
|
|
105
|
-
const result = await catalogSync.refreshNow();
|
|
106
|
-
return c.json({
|
|
107
|
-
ok: true,
|
|
108
|
-
payload: result
|
|
109
|
-
});
|
|
110
|
-
} catch (error) {
|
|
111
|
-
const status = error instanceof XopcCloudHttpError && error.status === 401 ? 401 : error instanceof XopcCloudHttpError && error.status === 403 ? 403 : 502;
|
|
112
|
-
return c.json({
|
|
113
|
-
ok: false,
|
|
114
|
-
error: {
|
|
115
|
-
message: error instanceof Error ? error.message : "Refresh failed",
|
|
116
|
-
...error instanceof XopcCloudHttpError && error.code ? { code: error.code } : {}
|
|
117
|
-
}
|
|
118
|
-
}, status);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
67
|
authenticated.get("/api/models/catalog/status", (c) => c.json({
|
|
122
68
|
ok: true,
|
|
123
69
|
payload: catalogSync.getStatus()
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../../../package-version.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
5
4
|
import { normalizeUpdateChannel } from "../../../infra/update-channels.js";
|
|
5
|
+
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
6
|
+
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
6
7
|
import { getUpdateAvailable, runGatewayUpdateCheck } from "../../../infra/update-startup.js";
|
|
7
8
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
8
|
-
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
9
9
|
import { streamSSE } from "hono/streaming";
|
|
10
10
|
//#region src/gateway/hono/routes/update.ts
|
|
11
11
|
init_package_version();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buildDefaultCorsOrigins, isAllInterfacesHost, isLoopbackHost, resolveEffectiveGatewayPort, resolveGatewayServiceListenPort } from "./host.js";
|
|
2
2
|
import { defaultGatewayBindMode, isContainerEnvironment, resolveGatewayBindHost, resolveGatewayBindHostSync, resolveGatewayBindMode, resolveGatewayEffectiveHost } from "../config/gateway-bind.js";
|
|
3
|
+
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
3
4
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
4
5
|
import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
|
|
5
6
|
import { buckets } from "./rate-limit/buckets.js";
|
|
@@ -13,7 +14,6 @@ import { createHonoApp } from "./hono/app.js";
|
|
|
13
14
|
import { GatewayServer } from "./server.js";
|
|
14
15
|
import { GatewayLockError, acquireGatewayLock } from "./lock.js";
|
|
15
16
|
import { runGatewayLoop } from "./run-loop.js";
|
|
16
|
-
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
17
17
|
import { apiError, apiOk } from "./protocol.js";
|
|
18
18
|
import "./hono/index.js";
|
|
19
19
|
import { assertSecureGatewayHttpUrl, assertSecureWebSocketUrl, isInsecurePrivateWsAllowed, isSecureWebSocketUrl } from "./ws-security.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { loadConfig } from "../config/loader.js";
|
|
2
2
|
import "../config/index.js";
|
|
3
3
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
4
|
+
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
4
5
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
5
6
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
6
7
|
import { acquireGatewayLock } from "./lock.js";
|
|
7
|
-
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
8
8
|
//#region src/gateway/run-loop.ts
|
|
9
9
|
/**
|
|
10
10
|
* Gateway Run Loop - Core run loop for gateway process management
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
3
|
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
6
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
7
7
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
@@ -8,14 +8,14 @@ import { closeXopcDatabase, openXopcDatabase } from "../storage/sqlite/connectio
|
|
|
8
8
|
import "../storage/sqlite/index.js";
|
|
9
9
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
10
10
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
11
|
-
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
12
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
13
11
|
import { init_paths, resolveAgentDir, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
12
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
14
13
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
15
14
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
16
15
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
17
16
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
18
|
-
import {
|
|
17
|
+
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
18
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
19
19
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
20
20
|
import { onAutomationProductEvent, publishAutomationProductEvent } from "../automations/product-events.js";
|
|
21
21
|
import { GoalRunner } from "../goals/goal-runner.js";
|
|
@@ -37,15 +37,16 @@ import { AgentService } from "../agent/service.js";
|
|
|
37
37
|
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
38
38
|
import { AutomationService } from "../automations/service/automation-service.js";
|
|
39
39
|
import "../automations/index.js";
|
|
40
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
41
|
+
import "../config/index.js";
|
|
40
42
|
import { setPairingBroadcastSink } from "../channels/pairing/pairing-events.js";
|
|
41
43
|
import { registerClarifyBridge } from "./clarify-runtime.js";
|
|
42
44
|
import { ChannelManager } from "../channels/manager.js";
|
|
43
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
44
|
-
import "../config/index.js";
|
|
45
45
|
import { startConnectedKnowledgeCoordinator } from "../knowledge/coordinator.js";
|
|
46
46
|
import "../knowledge/index.js";
|
|
47
47
|
import { startConnectorMemorySyncCoordinator } from "../connectors/memory-sync-coordinator.js";
|
|
48
48
|
import { startConnectorSupervisor } from "../connectors/supervisor.js";
|
|
49
|
+
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
49
50
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
50
51
|
import { reconcileDreamingAutomations } from "./dreaming-automation-reconciler.js";
|
|
51
52
|
import { FocusService } from "../proactive/focus-service.js";
|
|
@@ -81,7 +82,6 @@ import { LocalAppService } from "../local-apps/service.js";
|
|
|
81
82
|
import "../local-apps/index.js";
|
|
82
83
|
import { createRuntimeBrowserRecipeService } from "../browser/recipes/runtime-service.js";
|
|
83
84
|
import "../browser/recipes/index.js";
|
|
84
|
-
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
85
85
|
import { resolveChannelConnectDeferSet } from "./resolve-channel-connect-defer.js";
|
|
86
86
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
87
87
|
import { GatewaySessionsApi } from "./service/sessions-api.js";
|
|
@@ -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 { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
4
|
+
import { resolveGoalUiLocale } from "../agent/goals/goal-locale.js";
|
|
4
5
|
import { GoalService } from "./goal-service.js";
|
|
5
6
|
import { renderWorkflowText } from "../agent/workflow/snapshot.js";
|
|
6
|
-
import { resolveGoalUiLocale } from "../agent/goals/goal-locale.js";
|
|
7
7
|
import { evaluateAfterTurnHermesLike } from "../agent/goals/evaluate-turn.js";
|
|
8
8
|
import { runViewToSnapshot } from "../workflows/service/run-view-to-snapshot.js";
|
|
9
9
|
//#region src/goals/goal-workflow-judge.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { listPortListeners } from "../gateway/ports.js";
|
|
2
1
|
import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
|
|
2
|
+
import { listPortListeners } from "../gateway/ports.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
//#region src/infra/gateway-processes.ts
|
|
@@ -4,8 +4,8 @@ import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
6
6
|
import { resolveGatewayService } from "../daemon/service.js";
|
|
7
|
-
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
8
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
|
|
8
|
+
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
9
9
|
import { refreshGatewayServiceAfterUpdate } from "./update-service-refresh.js";
|
|
10
10
|
//#region src/infra/update-restart.ts
|
|
11
11
|
init_loader();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
2
|
-
import "./update-channels.js";
|
|
3
|
-
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
4
2
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
5
3
|
import { createDefaultCommandRunner, runCommandWithTimeout } from "./run-command.js";
|
|
6
4
|
import { XOPC_PACKAGE_NAME, cleanupGlobalRenameDirs, createGlobalInstallEnv, detectGlobalInstallManagerForRoot, resolveGlobalInstallSpec, resolveGlobalInstallTarget } from "./update-global.js";
|
|
7
5
|
import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
8
6
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
7
|
+
import "./update-channels.js";
|
|
8
|
+
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
9
9
|
import { trimLogTail } from "./update-log.js";
|
|
10
10
|
import { maybeRestartGatewayAfterUpdate } from "./update-restart.js";
|
|
11
11
|
import path from "node:path";
|
|
@@ -3,9 +3,9 @@ import { init_paths_state, resolveUpdateCheckStatePath } from "../config/paths-s
|
|
|
3
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
4
|
import { init_logger } from "../utils/logger.js";
|
|
5
5
|
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
6
|
-
import { acquireUpdateLock } from "./update-lock.js";
|
|
7
6
|
import { normalizeUpdateChannel } from "./update-channels.js";
|
|
8
7
|
import { compareSemver, detectInstallKind, resolveNpmChannelTag, resolvePackageRoot } from "./update-check.js";
|
|
8
|
+
import { acquireUpdateLock } from "./update-lock.js";
|
|
9
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
//#region src/infra/update-startup.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
4
|
-
import { gatewayCredentialAuthorization } from "../gateway/credential.js";
|
|
5
4
|
import { loadUndiciRuntimeDeps } from "../infra/undici-fetch.js";
|
|
5
|
+
import { gatewayCredentialAuthorization } from "../gateway/credential.js";
|
|
6
6
|
import { toConversation } from "./channel-shared.js";
|
|
7
7
|
import { createGatewayHttpClientFromConfig, resolveGatewayHttpBaseUrl } from "./gateway-http-client.js";
|
|
8
8
|
//#region src/mcp/channel-bridge.ts
|
|
@@ -4,8 +4,8 @@ import { buildNoteAttachmentRef } from "./attachment-ref.js";
|
|
|
4
4
|
import { parseNoteMarkdown } from "./note-markdown.js";
|
|
5
5
|
import { changedFieldsFromPatch, emitActivity, previewText, systemActivityActor, systemActivitySource } from "../activity/emitter.js";
|
|
6
6
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
7
|
-
import { publishAutomationProductEvent } from "../automations/product-events.js";
|
|
8
7
|
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
8
|
+
import { publishAutomationProductEvent } from "../automations/product-events.js";
|
|
9
9
|
import { NotesStore } from "./store.js";
|
|
10
10
|
import { partitionAttachmentsByReference } from "./note-attachment-sync.js";
|
|
11
11
|
import { buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact } from "./agent-context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
1
|
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
|
+
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -34,26 +34,6 @@ export interface DomesticProviderPreset {
|
|
|
34
34
|
requiresModelDiscovery?: boolean;
|
|
35
35
|
}
|
|
36
36
|
export declare const DOMESTIC_PROVIDER_PRESETS: readonly [{
|
|
37
|
-
readonly id: "xopc-cloud";
|
|
38
|
-
readonly displayName: "XOPC Model Service";
|
|
39
|
-
readonly description: "Official XOPC OpenAI-compatible model service. Available models are loaded from your account.";
|
|
40
|
-
readonly docsUrl: "https://console.xopc.ai/models";
|
|
41
|
-
readonly apiKeyUrl: "https://console.xopc.ai/models";
|
|
42
|
-
readonly envVars: ["XOPC_MODEL_API_KEY"];
|
|
43
|
-
readonly api: "openai-completions";
|
|
44
|
-
readonly baseUrlPresets: [{
|
|
45
|
-
readonly id: "official";
|
|
46
|
-
readonly label: "XOPC Official";
|
|
47
|
-
readonly baseUrl: "https://router.xopc.ai/v1";
|
|
48
|
-
}];
|
|
49
|
-
readonly defaultBaseUrlPreset: "official";
|
|
50
|
-
readonly defaultModel: "";
|
|
51
|
-
readonly models: [];
|
|
52
|
-
readonly aliases: ["xopc", "xopc cloud", "xopc models"];
|
|
53
|
-
readonly onboardingIcon: "☁️";
|
|
54
|
-
readonly requiresModelDiscovery: true;
|
|
55
|
-
readonly quirks: ["Connect through XOPC Console; credentials and available models are configured automatically."];
|
|
56
|
-
}, {
|
|
57
37
|
readonly id: "dashscope-cn";
|
|
58
38
|
readonly displayName: "Alibaba Bailian / DashScope China";
|
|
59
39
|
readonly description: "Alibaba Bailian Qwen models through the China DashScope OpenAI-compatible endpoint.";
|
|
@@ -87,31 +87,6 @@ const MINIMAX_MODELS = [
|
|
|
87
87
|
}
|
|
88
88
|
];
|
|
89
89
|
const DOMESTIC_PROVIDER_PRESETS = [
|
|
90
|
-
{
|
|
91
|
-
id: "xopc-cloud",
|
|
92
|
-
displayName: "XOPC Model Service",
|
|
93
|
-
description: "Official XOPC OpenAI-compatible model service. Available models are loaded from your account.",
|
|
94
|
-
docsUrl: "https://console.xopc.ai/models",
|
|
95
|
-
apiKeyUrl: "https://console.xopc.ai/models",
|
|
96
|
-
envVars: ["XOPC_MODEL_API_KEY"],
|
|
97
|
-
api: "openai-completions",
|
|
98
|
-
baseUrlPresets: [{
|
|
99
|
-
id: "official",
|
|
100
|
-
label: "XOPC Official",
|
|
101
|
-
baseUrl: "https://router.xopc.ai/v1"
|
|
102
|
-
}],
|
|
103
|
-
defaultBaseUrlPreset: "official",
|
|
104
|
-
defaultModel: "",
|
|
105
|
-
models: [],
|
|
106
|
-
aliases: [
|
|
107
|
-
"xopc",
|
|
108
|
-
"xopc cloud",
|
|
109
|
-
"xopc models"
|
|
110
|
-
],
|
|
111
|
-
onboardingIcon: "☁️",
|
|
112
|
-
requiresModelDiscovery: true,
|
|
113
|
-
quirks: ["Connect through XOPC Console; credentials and available models are configured automatically."]
|
|
114
|
-
},
|
|
115
90
|
{
|
|
116
91
|
id: "dashscope-cn",
|
|
117
92
|
displayName: "Alibaba Bailian / DashScope China",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
4
3
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
5
4
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
5
|
+
import { getOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
6
6
|
import { CredentialResolver, hasCredentials, init_credentials, resolveApiKey } from "../auth/credentials.js";
|
|
7
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
7
8
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
8
9
|
import { getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
9
10
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -136,6 +137,7 @@ function getAllProviders() {
|
|
|
136
137
|
for (const p of getProviders()) providers.add(p);
|
|
137
138
|
for (const m of registry.getAll()) providers.add(m.provider);
|
|
138
139
|
for (const plugin of getProviderRegistry().listAll()) providers.add(plugin.id);
|
|
140
|
+
for (const provider of getOAuthProviderIds()) providers.add(provider);
|
|
139
141
|
return Array.from(providers);
|
|
140
142
|
}
|
|
141
143
|
async function getApiKey(provider, credentialOptions) {
|
|
@@ -310,12 +312,19 @@ var init_providers = __esmMin((() => {
|
|
|
310
312
|
init_model_registry();
|
|
311
313
|
init_credentials();
|
|
312
314
|
init_sync_provider_auth();
|
|
315
|
+
init_registry();
|
|
313
316
|
init_env_keys();
|
|
314
317
|
init_constants();
|
|
315
318
|
init_model_supplements();
|
|
316
319
|
init_plugin_registry();
|
|
317
320
|
OPENAI_CODEX_CANONICAL_BASE_URL = "https://chatgpt.com/backend-api/codex";
|
|
318
321
|
PROVIDER_META = {
|
|
322
|
+
"xopc-cloud": {
|
|
323
|
+
name: "XOPC Model Service",
|
|
324
|
+
category: "oauth",
|
|
325
|
+
supportsOAuth: true,
|
|
326
|
+
supportsApiKey: false
|
|
327
|
+
},
|
|
319
328
|
"openai": {
|
|
320
329
|
name: "OpenAI",
|
|
321
330
|
category: "common",
|