@xopcai/xopc 0.0.257 → 0.0.258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CcHiwo90.js → agent-avatar-dicebear-D7tpOS12.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DGHLpxj_.js +1 -0
- package/dist/gateway/static/root/assets/{agents-mRWuin4I.js → agents-DDiR9MCE.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-5kVaSzfB.js → app-management-settings-panel-xtMKAVbv.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CUBqIGU_.js → appearance-settings-Cngeu2w8.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-f6kxf54f.js → apps-page-CXiCvD0B.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CfwtYKfh.js → archive-plugin-DXKFrMNm.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BpVTMe-n.js → attachment-load-DLYGTBVf.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-dfkTIf80.js → automations-page-BTp6bGo4.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CuyEKO6M.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CPJDU5qY.js → binary-plugins-BcvVtSvZ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CqGeWU9b.js → block-editor-hZg3H6K-.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automations-page-B6onskD_.js → browser-automations-page-COsWjB_N.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-D9CfpBLt.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CEOmYG_f.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-DS3vq4cr.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-47NtjjCX.js → chat-terminal-dock-CmV1RMyj.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-C51TR-Ov.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-B4r3qBHG.js → cron-expression-DsEb7fyV.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-ClaFWvUv.js → date-picker-ChR8KQ7f.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-NMEdb127.js → dependency-picker-DGz0raEu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D9Eem9g_.js → desktop-pet-_nHlkhRg.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Bc0xgDAG.js → desktop-pet-settings-B_tVwGUL.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CS0f4Rwe.js → extension-debug-page-DJttDDUz.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DB1Yd9gB.js → extension-page-vv7-Kg1n.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DogSZfp4.js → extension-settings-page-BpsPHT1o.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BrIcafAP.js +1 -0
- package/dist/gateway/static/root/assets/heartbeat-settings-BIqk_r9f.js +1 -0
- package/dist/gateway/static/root/assets/home-page-DQxTTwVp.js +1 -0
- package/dist/gateway/static/root/assets/index-B1zcAf8-.css +2 -0
- package/dist/gateway/static/root/assets/index-DfvY-SO6.js +76 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BtReIwcC.js → keyboard-shortcuts-settings-CjUFDVZk.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Cl4VINRc.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DNc0MOE3.js → local-apps-page-DNK11iaj.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Had-beIO.js → logs-page-Cqy0hmu5.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-Dtffn9i3.js → management-settings-LejmrKSf.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DRWqSGyJ.js → media-plugins-BFQxVZ03.js} +1 -1
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-B0w0psOx.js → mobile-pairing-wizard-DfT_mH8L.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CvFzG1Bp.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-k297u-gH.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-CB9dmnXZ.js → page-tabs-CMZs-2FR.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-D-Dt5xu4.js → preview-open-alternatives-BUprGPfS.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CXcG3Su-.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BaOV7aDd.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-WY2alRLt.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D_MPP9i5.js → runtime-tools-settings-panel-BIrnrKec.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BzDq-ZuC.js → schema-form-CjQ582_7.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CUIrWSsD.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BOdZicC_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-sGMIA3ks.js → settings-form-section-d1SWWFyj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BC-zLjeS.js → settings-page-CeSoibS9.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CDs0s_bL.js → setup-status-panel-DfUt3_r7.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DsrD7e8n.js → share-preview-page-D7MJNTsV.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BS2kgw-8.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BrEpq0C1.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-C-zN0B5y.js → skills-page-DTFxG_j4.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-BxEl68ey.js → skills-page.utils-Co0GHVOk.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BgqbBWbr.js → system-settings-panel-Cu9GTXm7.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-Dg3NARt6.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DFqaGc8E.js → tunnel-api-cyxe_LpB.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BXwKb7uc.js → use-autosave-YQ_35Glb.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BZMPfbEY.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BzJcgV49.js → voice-api-key-field-1e1_bhD3.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-Ur-4XdYe.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BiN-2TYW.js → workflow-run-setup-panel-Bn8Y5Xq4.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DCh0jiOu.js +6 -0
- package/dist/gateway/static/root/index.html +2 -2
- 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 +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.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/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- 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/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +1 -4
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +22 -7
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +4 -4
- 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/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/repository.d.ts +8 -0
- package/dist/src/user-model/repository.js +89 -1
- package/dist/src/work-discovery/service.js +2 -5
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel--9gWwnRC.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DqBpAhE4.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-y0F3V4PE.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BBxe6mhG.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-Di9SHb0T.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-gnO6oteJ.js +0 -2
- package/dist/gateway/static/root/assets/gateway-settings-CaKhNsGs.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-hP1sHX8G.js +0 -1
- package/dist/gateway/static/root/assets/home-page-vaJbtRFl.js +0 -1
- package/dist/gateway/static/root/assets/index-50Kr6L6C.css +0 -2
- package/dist/gateway/static/root/assets/index-Duj4WYOB.js +0 -76
- package/dist/gateway/static/root/assets/local-app-workbench-page-B9uagY6F.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-panel-DsYO1fRI.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CHwT_ijJ.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-DKvtW-Dz.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-io37-OOk.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B_riktSI.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BzewHzkk.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-j9MLH-tY.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-C8WKRIAw.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DRWPnXzw.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-LikAblth.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-D_cuGnay.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-Dvg92rT8.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-BH8VXmPP.js +0 -6
|
@@ -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";
|
|
4
3
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
5
4
|
import { createExtensionAwareStreamFn } from "../providers/extension-stream-bridge.js";
|
|
6
5
|
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_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
4
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
6
|
-
import {
|
|
5
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
7
6
|
import { getOAuthProviderDefinition, init_registry } from "./oauth/registry.js";
|
|
7
|
+
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.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,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { generatePKCE, init_pkce } from "./pkce.js";
|
|
3
2
|
import { init_resolution, resolveConnectedPlatformEndpoint } from "../../platform/resolution.js";
|
|
3
|
+
import { generatePKCE, init_pkce } from "./pkce.js";
|
|
4
4
|
import { hostname } from "node:os";
|
|
5
5
|
import { randomBytes } from "node:crypto";
|
|
6
6
|
import http from "node:http";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
1
|
import { init_paths, resolveCredentialsDir } from "../../config/paths.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.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";
|
|
2
3
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
3
|
-
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
|
-
import {
|
|
5
|
+
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
//#region src/auth/sync-provider-auth.ts
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
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
|
-
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
5
4
|
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
5
|
+
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
6
6
|
import { assertCacheDir } from "../cache-dir-policy.js";
|
|
7
7
|
import { resolvePackageRoot } from "../../infra/update-check.js";
|
|
8
8
|
import { dirname, join } from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
2
|
-
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
3
2
|
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
3
|
+
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
//#region src/cli/commands/doctor/checks/provider-auth.ts
|
|
6
6
|
init_loader();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
2
|
-
import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
|
|
3
2
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
3
|
+
import { CredentialResolver, init_credentials } from "../../auth/credentials.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";
|
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 { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.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";
|
|
9
10
|
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";
|
|
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
11
|
import { init_loader, loadConfig, saveConfig } from "./loader.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { clearConfigValueCache, getAllowedCommands, getCacheStats, init_resolve_config_value, resolveConfigValue, resolveHeaders, testApiKeyResolution } from "./resolve-config-value.js";
|
|
13
|
+
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";
|
|
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,10 +2,10 @@ 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_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
5
|
import { init_paths, resolveConfigPath } from "./paths.js";
|
|
7
|
-
import {
|
|
6
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
8
7
|
import { assertChannelPluginConfigs, init_validate_channel_configs } from "./validate-channel-configs.js";
|
|
8
|
+
import { init_resolution, setActivePlatformDiscovery } from "../platform/resolution.js";
|
|
9
9
|
import { dirname } from "path";
|
|
10
10
|
import { existsSync, mkdirSync, promises, readFileSync } from "fs";
|
|
11
11
|
import { config } from "dotenv";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
3
2
|
import { init_paths, resolveModelsJsonPath } from "./paths.js";
|
|
3
|
+
import { init_write_file_atomic, writeTextAtomicSync } from "../infra/write-file-atomic.js";
|
|
4
4
|
import { existsSync, readFileSync } from "fs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/config/models-json.ts
|
|
@@ -116,10 +116,7 @@ async function deriveConnectedSourceUnderstanding(input) {
|
|
|
116
116
|
},
|
|
117
117
|
predicate: `${candidate.category}.connected.${candidate.factKey}`,
|
|
118
118
|
cardinality: "single",
|
|
119
|
-
scope: {
|
|
120
|
-
type: "agent",
|
|
121
|
-
id: input.agentId
|
|
122
|
-
},
|
|
119
|
+
scope: { type: "global" },
|
|
123
120
|
kind: candidate.category === "communication" ? "preference" : candidate.category,
|
|
124
121
|
value: candidate.statement,
|
|
125
122
|
normalizedValue: candidate.statement.toLocaleLowerCase(),
|
|
@@ -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_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -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 { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
3
2
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
3
|
+
import { WORKSPACE_FILES, init_paths } from "../config/paths.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,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 { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
3
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
4
|
+
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.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 { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
2
2
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
3
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
4
5
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
5
6
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
6
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
7
7
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
8
8
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
9
9
|
import { normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.js";
|
|
2
1
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
|
+
import { init_resolve_config_value, testApiKeyResolution } from "../../../config/resolve-config-value.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";
|
|
@@ -2,13 +2,14 @@ import { createCollaborationRule, getCollaborationRule, listCollaborationRules,
|
|
|
2
2
|
import { getKnowledgeItem, listKnowledgeItems, searchKnowledgeItems, setKnowledgeStatus } from "../../../knowledge-memory/repository.js";
|
|
3
3
|
import "../../../knowledge-memory/index.js";
|
|
4
4
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus } from "../../../user-model/goals.js";
|
|
5
|
-
import { getAssertionSlot, getUserAssertion, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../../user-model/repository.js";
|
|
5
|
+
import { getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../../user-model/repository.js";
|
|
6
6
|
import { applyUserProfilePatch, getUserProfileSnapshot } from "../../../user-model/profile.js";
|
|
7
7
|
import { bootstrapUserModel } from "../../../user-model/bootstrap.js";
|
|
8
8
|
import "../../../user-model/index.js";
|
|
9
9
|
import { listMemoryMaintenanceRuns } from "../../../memory-maintenance/service.js";
|
|
10
10
|
import "../../../memory-maintenance/index.js";
|
|
11
11
|
import { getExecutionContextAudit, recordExecutionContextFeedback } from "../../../agent/context/audit.js";
|
|
12
|
+
import { listUnderstandingSourceGrants } from "../../../user-context/sources/repository.js";
|
|
12
13
|
import { userInfo } from "node:os";
|
|
13
14
|
//#region src/gateway/hono/routes/user-model.ts
|
|
14
15
|
function object(value) {
|
|
@@ -102,20 +103,21 @@ const RULE_STATUSES = new Set([
|
|
|
102
103
|
"disabled",
|
|
103
104
|
"archived"
|
|
104
105
|
]);
|
|
105
|
-
function assertionView(assertion) {
|
|
106
|
+
function assertionView(assertion, sources = listUserAssertionSources([assertion.id]).get(assertion.id) ?? []) {
|
|
106
107
|
const slot = getAssertionSlot(assertion.slotId);
|
|
107
108
|
if (!slot) throw new Error(`Assertion slot not found: ${assertion.slotId}`);
|
|
108
109
|
return {
|
|
109
110
|
...assertion,
|
|
110
111
|
predicate: slot.predicate,
|
|
111
112
|
subject: slot.subject,
|
|
112
|
-
scope: slot.scope
|
|
113
|
+
scope: slot.scope,
|
|
114
|
+
sources
|
|
113
115
|
};
|
|
114
116
|
}
|
|
115
117
|
function registerUserModelRoutes(authenticated, deps) {
|
|
116
118
|
const write = deps.strictRateLimitMiddleware;
|
|
117
119
|
authenticated.get("/api/user-model", (c) => {
|
|
118
|
-
const
|
|
120
|
+
const rawAssertions = listUserAssertions({
|
|
119
121
|
statuses: [
|
|
120
122
|
"active",
|
|
121
123
|
"candidate",
|
|
@@ -124,7 +126,9 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
124
126
|
"stale"
|
|
125
127
|
],
|
|
126
128
|
limit: 1e3
|
|
127
|
-
})
|
|
129
|
+
});
|
|
130
|
+
const assertionSources = listUserAssertionSources(rawAssertions.map((item) => item.id));
|
|
131
|
+
const assertions = rawAssertions.map((item) => assertionView(item, assertionSources.get(item.id) ?? []));
|
|
128
132
|
const goals = listUserGoals();
|
|
129
133
|
const priorities = listPriorityWindows();
|
|
130
134
|
const knowledge = listKnowledgeItems({
|
|
@@ -132,6 +136,14 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
132
136
|
limit: 1e3
|
|
133
137
|
});
|
|
134
138
|
const profile = getUserProfileSnapshot();
|
|
139
|
+
const sources = listUnderstandingSourceGrants().map((source) => ({
|
|
140
|
+
id: source.id,
|
|
141
|
+
kind: source.adapterId === "local-work-folders" ? "work_folder" : source.adapterId.startsWith("connector:") ? "connector" : "local_source",
|
|
142
|
+
adapterId: source.adapterId,
|
|
143
|
+
category: source.category,
|
|
144
|
+
displayName: source.displayName,
|
|
145
|
+
...source.lastCollectedAt ? { lastCollectedAt: source.lastCollectedAt } : {}
|
|
146
|
+
}));
|
|
135
147
|
return c.json({
|
|
136
148
|
assertions,
|
|
137
149
|
goals,
|
|
@@ -140,6 +152,7 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
140
152
|
knowledge,
|
|
141
153
|
maintenance: { lastRun: listMemoryMaintenanceRuns(1)[0] ?? null },
|
|
142
154
|
profile,
|
|
155
|
+
sources,
|
|
143
156
|
suggestedCallName: profile.callName || machineCallName(),
|
|
144
157
|
counts: {
|
|
145
158
|
activeAssertions: assertions.filter((item) => item.status === "active").length,
|
|
@@ -192,10 +205,12 @@ function registerUserModelRoutes(authenticated, deps) {
|
|
|
192
205
|
authenticated.get("/api/user-model/assertions", (c) => {
|
|
193
206
|
const requested = c.req.query("status")?.split(",").filter(Boolean);
|
|
194
207
|
if (requested?.some((status) => !ASSERTION_STATUSES.has(status))) return c.json({ error: "Invalid assertion status" }, 400);
|
|
195
|
-
|
|
208
|
+
const assertions = listUserAssertions({
|
|
196
209
|
...requested ? { statuses: requested } : {},
|
|
197
210
|
limit: 1e3
|
|
198
|
-
})
|
|
211
|
+
});
|
|
212
|
+
const assertionSources = listUserAssertionSources(assertions.map((item) => item.id));
|
|
213
|
+
return c.json({ assertions: assertions.map((item) => assertionView(item, assertionSources.get(item.id) ?? [])) });
|
|
199
214
|
});
|
|
200
215
|
authenticated.get("/api/user-model/assertions/:id", (c) => {
|
|
201
216
|
const assertion = getUserAssertion(c.req.param("id"));
|
|
@@ -7,10 +7,10 @@ import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflo
|
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
-
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
11
|
-
import "../../../workflows/authoring/index.js";
|
|
12
10
|
import "../../../workflows/draft/index.js";
|
|
13
11
|
import { ProjectWorkflowPresetRepository } from "../../../workflows/project-presets/project-workflow-preset-repository.js";
|
|
12
|
+
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
13
|
+
import "../../../workflows/authoring/index.js";
|
|
14
14
|
import { basename, join } from "node:path";
|
|
15
15
|
import { readFile, stat } from "node:fs/promises";
|
|
16
16
|
//#region src/gateway/hono/routes/workflows.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 { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
3
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
|
+
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
6
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
7
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
@@ -12,16 +12,16 @@ import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
|
12
12
|
import "../storage/sqlite/index.js";
|
|
13
13
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
14
14
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
15
|
+
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
16
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
17
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
15
18
|
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
16
|
-
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
17
19
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
18
20
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
19
21
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
20
22
|
import { loadConfig, saveConfig } from "../config/loader.js";
|
|
21
|
-
import {
|
|
22
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
23
|
+
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
23
24
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
24
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
25
25
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
26
26
|
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
27
27
|
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
1
|
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
|
+
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.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();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
3
5
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
4
6
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
5
7
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
7
8
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
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_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
4
|
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
|
+
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
2
|
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
|
+
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
2
|
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
|
+
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
4
4
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
5
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
6
6
|
import { loadSkills } from "../agent/skills/index.js";
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -2,10 +2,10 @@ import { version } from "../../package.js";
|
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
3
|
import { parseAgentSessionKey } from "../routing/session-key-utils.js";
|
|
4
4
|
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
5
|
+
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
5
6
|
import { init_paths } from "../config/paths.js";
|
|
6
7
|
import { loadConfig } from "../config/loader.js";
|
|
7
8
|
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
8
|
-
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
9
9
|
import { ProjectTrustStore, hasTrustRequiringProjectResources } from "../project-trust/trust-store.js";
|
|
10
10
|
import { renderWorkflowFinalSummary, renderWorkflowPanel } from "../agent/workflow/snapshot.js";
|
|
11
11
|
import { ensureStarterAgentsInitialized } from "../agent/starter-agents.js";
|
|
@@ -14,7 +14,6 @@ import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../gateway/chat-limits.js";
|
|
|
14
14
|
import { isTerminalWorkflowRunStatus } from "../workflows/domain/run.js";
|
|
15
15
|
import "../workflows/domain/index.js";
|
|
16
16
|
import { runViewToSnapshot } from "../workflows/service/run-view-to-snapshot.js";
|
|
17
|
-
import { resolveTuiSessionKey, resolveTuiStartupSessionKey } from "../routing/resolve-tui-session-key.js";
|
|
18
17
|
import { applyThemeById, getBashExcludeBorderColor, getBashModeBorderColor, getCustomThemesDir, getThemeExports, getThinkingBorderColor, initTuiTheme, listAvailableThemeIds, resolveThemePalette } from "./theme-manager.js";
|
|
19
18
|
import { editorTheme, theme } from "./theme.js";
|
|
20
19
|
import { extensionForImageMimeType, readClipboardImage } from "./clipboard-image.js";
|
|
@@ -46,6 +45,7 @@ import { installTuiStdioFilter } from "./tui-stdio-filter.js";
|
|
|
46
45
|
import { createEditorSubmitHandler, createSubmitBurstCoalescer, shouldEnableWindowsGitBashPasteFallback } from "./tui-submit.js";
|
|
47
46
|
import { withTuiSuspended } from "./tui-suspend.js";
|
|
48
47
|
import { createInitialState } from "./tui-types.js";
|
|
48
|
+
import { resolveTuiSessionKey, resolveTuiStartupSessionKey } from "../routing/resolve-tui-session-key.js";
|
|
49
49
|
import { EmbeddedBackend } from "./backends/embedded-backend.js";
|
|
50
50
|
import { GatewayRealtimeBackend } from "./backends/gateway-realtime-backend.js";
|
|
51
51
|
import { ChatLog } from "./components/chat-log.js";
|
|
@@ -2,8 +2,8 @@ import { USER_MODEL_PRINCIPAL_ID, validateCandidate, validateScope } from "./dom
|
|
|
2
2
|
import { calculateExecutionValue } from "./importance.js";
|
|
3
3
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus } from "./goals.js";
|
|
4
4
|
import { defaultReviewAt, isAssertionValidAt, requiresBoundedValidity, resolveCurrentAssertion } from "./temporal.js";
|
|
5
|
-
import { getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserTimezone, linkAssertionEvidence, listSlotAssertions, listUserAssertions, reconcileAssertion, setAssertionStatus } from "./repository.js";
|
|
5
|
+
import { getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserTimezone, linkAssertionEvidence, listSlotAssertions, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus } from "./repository.js";
|
|
6
6
|
import { applyUserProfilePatch, getUserProfileSnapshot } from "./profile.js";
|
|
7
7
|
import { bootstrapUserModel } from "./bootstrap.js";
|
|
8
8
|
import { isWorkingAssumption } from "./usage-policy.js";
|
|
9
|
-
export { USER_MODEL_PRINCIPAL_ID, applyUserProfilePatch, bootstrapUserModel, calculateExecutionValue, createPriorityWindow, createUserGoal, defaultReviewAt, getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserProfileSnapshot, getUserTimezone, isAssertionValidAt, isWorkingAssumption, linkAssertionEvidence, listPriorityWindows, listSlotAssertions, listUserAssertions, listUserGoals, reconcileAssertion, requiresBoundedValidity, resolveCurrentAssertion, setAssertionStatus, setUserGoalStatus, validateCandidate, validateScope };
|
|
9
|
+
export { USER_MODEL_PRINCIPAL_ID, applyUserProfilePatch, bootstrapUserModel, calculateExecutionValue, createPriorityWindow, createUserGoal, defaultReviewAt, getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserProfileSnapshot, getUserTimezone, isAssertionValidAt, isWorkingAssumption, linkAssertionEvidence, listPriorityWindows, listSlotAssertions, listUserAssertionSources, listUserAssertions, listUserGoals, reconcileAssertion, requiresBoundedValidity, resolveCurrentAssertion, setAssertionStatus, setUserGoalStatus, validateCandidate, validateScope };
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type AssertionCandidate, type AssertionSlot, type AssertionStatus, type ReconciliationResult, type UserAssertion } from './domain.js';
|
|
2
|
+
export type UserAssertionSource = {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: 'user' | 'conversation' | 'connector' | 'work_folder' | 'local_source' | 'inference';
|
|
5
|
+
label?: string;
|
|
6
|
+
category?: 'files' | 'recent_documents' | 'calendar' | 'tasks' | 'notes' | 'mail' | 'messages' | 'code_activity';
|
|
7
|
+
observedAt: number;
|
|
8
|
+
};
|
|
2
9
|
export declare function reconcileAssertion(candidate: AssertionCandidate, now?: number): ReconciliationResult;
|
|
3
10
|
export declare function getUserAssertion(id: string): UserAssertion | undefined;
|
|
4
11
|
export declare function getAssertionSlot(id: string): AssertionSlot | undefined;
|
|
@@ -8,6 +15,7 @@ export declare function listUserAssertions(input?: {
|
|
|
8
15
|
statuses?: AssertionStatus[];
|
|
9
16
|
limit?: number;
|
|
10
17
|
}): UserAssertion[];
|
|
18
|
+
export declare function listUserAssertionSources(assertionIds: string[]): Map<string, UserAssertionSource[]>;
|
|
11
19
|
export declare function getActiveAssertionByPredicate(predicate: string): UserAssertion | undefined;
|
|
12
20
|
export declare function getActiveAssertionForSlot(input: {
|
|
13
21
|
subject: AssertionSlot['subject'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
2
|
import { USER_MODEL_PRINCIPAL_ID, validateCandidate, validateScope } from "./domain.js";
|
|
3
3
|
import { defaultReviewAt, requiresBoundedValidity } from "./temporal.js";
|
|
4
|
+
import { basename } from "node:path";
|
|
4
5
|
import { randomUUID } from "node:crypto";
|
|
5
6
|
//#region src/user-model/repository.ts
|
|
6
7
|
function slotFromRow(row) {
|
|
@@ -219,6 +220,93 @@ function listUserAssertions(input = {}) {
|
|
|
219
220
|
WHERE s.principal_id = ? AND a.status IN (${placeholders})
|
|
220
221
|
ORDER BY a.recorded_at DESC LIMIT ?`).all(principalId, ...statuses, limit).map(assertionFromRow);
|
|
221
222
|
}
|
|
223
|
+
function listUserAssertionSources(assertionIds) {
|
|
224
|
+
const uniqueIds = [...new Set(assertionIds.filter(Boolean))];
|
|
225
|
+
const result = /* @__PURE__ */ new Map();
|
|
226
|
+
if (!uniqueIds.length) return result;
|
|
227
|
+
const placeholders = uniqueIds.map(() => "?").join(", ");
|
|
228
|
+
const rows = getSqliteDatabase().prepare(`
|
|
229
|
+
SELECT ae.assertion_id, e.source_type, e.source_instance_id, e.source_ref, e.observed_at,
|
|
230
|
+
g.adapter_id AS grant_adapter_id, g.display_name AS grant_display_name,
|
|
231
|
+
g.category AS grant_category, w.project_id AS work_project_id, w.root_path AS work_root_path
|
|
232
|
+
FROM user_assertion_evidence ae
|
|
233
|
+
JOIN context_evidence e ON e.evidence_id = ae.evidence_id
|
|
234
|
+
LEFT JOIN understanding_source_grants g
|
|
235
|
+
ON e.source_ref LIKE ('understanding-source-grant:' || g.grant_id || ':%')
|
|
236
|
+
OR (e.source_type = 'connector' AND e.source_instance_id IS NOT NULL
|
|
237
|
+
AND json_extract(g.config_json, '$.sourceInstanceId') = e.source_instance_id)
|
|
238
|
+
LEFT JOIN work_discovery_runs w
|
|
239
|
+
ON e.source_ref LIKE ('work-discovery:' || w.id || ':%')
|
|
240
|
+
WHERE ae.assertion_id IN (${placeholders}) AND ae.relation = 'supports'
|
|
241
|
+
ORDER BY e.observed_at DESC
|
|
242
|
+
`).all(...uniqueIds);
|
|
243
|
+
const rowsByAssertion = /* @__PURE__ */ new Map();
|
|
244
|
+
for (const row of rows) rowsByAssertion.set(row.assertion_id, [...rowsByAssertion.get(row.assertion_id) ?? [], row]);
|
|
245
|
+
for (const assertionId of uniqueIds) {
|
|
246
|
+
const assertionRows = rowsByAssertion.get(assertionId) ?? [];
|
|
247
|
+
const hasSpecificUnderstandingSource = assertionRows.some((row) => row.grant_adapter_id || row.work_root_path);
|
|
248
|
+
const sources = /* @__PURE__ */ new Map();
|
|
249
|
+
for (const row of assertionRows) {
|
|
250
|
+
let source;
|
|
251
|
+
if (row.grant_adapter_id === "local-work-folders") source = {
|
|
252
|
+
id: `work-folder:${row.grant_display_name ?? row.grant_adapter_id}`,
|
|
253
|
+
kind: "work_folder",
|
|
254
|
+
label: row.grant_display_name ?? row.grant_adapter_id,
|
|
255
|
+
category: "files",
|
|
256
|
+
observedAt: row.observed_at
|
|
257
|
+
};
|
|
258
|
+
else if (row.grant_adapter_id?.startsWith("connector:")) source = {
|
|
259
|
+
id: row.grant_adapter_id,
|
|
260
|
+
kind: "connector",
|
|
261
|
+
label: row.grant_display_name ?? row.grant_adapter_id.slice(10),
|
|
262
|
+
...row.grant_category ? { category: row.grant_category } : {},
|
|
263
|
+
observedAt: row.observed_at
|
|
264
|
+
};
|
|
265
|
+
else if (row.grant_adapter_id) source = {
|
|
266
|
+
id: `source:${row.grant_adapter_id}`,
|
|
267
|
+
kind: "local_source",
|
|
268
|
+
label: row.grant_display_name ?? row.grant_adapter_id,
|
|
269
|
+
...row.grant_category ? { category: row.grant_category } : {},
|
|
270
|
+
observedAt: row.observed_at
|
|
271
|
+
};
|
|
272
|
+
else if (row.work_root_path) source = {
|
|
273
|
+
id: `work-folder:${row.work_project_id ?? basename(row.work_root_path)}`,
|
|
274
|
+
kind: "work_folder",
|
|
275
|
+
label: basename(row.work_root_path),
|
|
276
|
+
category: "files",
|
|
277
|
+
observedAt: row.observed_at
|
|
278
|
+
};
|
|
279
|
+
else if (row.source_type === "user") source = {
|
|
280
|
+
id: "user",
|
|
281
|
+
kind: "user",
|
|
282
|
+
observedAt: row.observed_at
|
|
283
|
+
};
|
|
284
|
+
else if (row.source_type === "conversation") source = {
|
|
285
|
+
id: "conversation",
|
|
286
|
+
kind: "conversation",
|
|
287
|
+
observedAt: row.observed_at
|
|
288
|
+
};
|
|
289
|
+
else if (row.source_type === "connector") source = {
|
|
290
|
+
id: `connector:${row.source_instance_id ?? row.source_ref.split(":", 1)[0]}`,
|
|
291
|
+
kind: "connector",
|
|
292
|
+
...row.source_instance_id ? { label: row.source_instance_id } : {},
|
|
293
|
+
observedAt: row.observed_at
|
|
294
|
+
};
|
|
295
|
+
else {
|
|
296
|
+
if (hasSpecificUnderstandingSource && row.source_ref.startsWith("understanding-source:onboarding:")) continue;
|
|
297
|
+
source = {
|
|
298
|
+
id: "inference",
|
|
299
|
+
kind: "inference",
|
|
300
|
+
observedAt: row.observed_at
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const existing = sources.get(source.id);
|
|
304
|
+
if (!existing || existing.observedAt < source.observedAt) sources.set(source.id, source);
|
|
305
|
+
}
|
|
306
|
+
result.set(assertionId, [...sources.values()]);
|
|
307
|
+
}
|
|
308
|
+
return result;
|
|
309
|
+
}
|
|
222
310
|
function getActiveAssertionByPredicate(predicate) {
|
|
223
311
|
const row = getSqliteDatabase().prepare(`SELECT a.* FROM user_assertions a
|
|
224
312
|
JOIN user_assertion_slots s ON s.slot_id = a.slot_id
|
|
@@ -265,4 +353,4 @@ function setAssertionStatus(assertionId, status, input) {
|
|
|
265
353
|
return getUserAssertion(assertionId);
|
|
266
354
|
}
|
|
267
355
|
//#endregion
|
|
268
|
-
export { getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserTimezone, linkAssertionEvidence, listSlotAssertions, listUserAssertions, reconcileAssertion, setAssertionStatus };
|
|
356
|
+
export { getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserTimezone, linkAssertionEvidence, listSlotAssertions, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus };
|
|
@@ -6,12 +6,12 @@ import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
|
6
6
|
import { buildSessionKey, init_session_key } from "../routing/session-key.js";
|
|
7
7
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
8
8
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
9
|
-
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
10
9
|
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
11
10
|
import "../knowledge-memory/index.js";
|
|
12
11
|
import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
13
12
|
import { getAssertionSlot, getUserAssertion, linkAssertionEvidence, reconcileAssertion, setAssertionStatus } from "../user-model/repository.js";
|
|
14
13
|
import "../user-model/index.js";
|
|
14
|
+
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
15
15
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
16
16
|
import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
17
17
|
import { createUnderstandingSourceRun, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
@@ -1051,10 +1051,7 @@ var WorkDiscoveryService = class {
|
|
|
1051
1051
|
persistProfileCandidates(run, result) {
|
|
1052
1052
|
if (!result.profileCandidates?.length) return result;
|
|
1053
1053
|
const profileCandidates = result.profileCandidates.map((candidate) => {
|
|
1054
|
-
const assertion = persistUnderstandingCandidate(candidate, {
|
|
1055
|
-
type: "project",
|
|
1056
|
-
id: run.projectId
|
|
1057
|
-
}, `work-discovery:${run.id}`);
|
|
1054
|
+
const assertion = persistUnderstandingCandidate(candidate, { type: "global" }, `work-discovery:${run.id}`);
|
|
1058
1055
|
return {
|
|
1059
1056
|
...candidate,
|
|
1060
1057
|
assertionId: assertion.id
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
2
2
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
3
|
-
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
4
3
|
import { extractProfileAgentId, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
|
+
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
5
5
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
6
6
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
7
7
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|