@xopcai/xopc 0.0.374 → 0.0.375
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/{agent-avatar-dicebear-BrA20N2m.js → agent-avatar-dicebear-B2Popl59.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BZrOdxou.js → agent-defaults-settings-panel-BnF3HrHY.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-B3ux1AhY.js → agent-plugin-dialog-CwP6OrUs.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CXlXFU6M.js → agents-n3IremKl.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BXahEVPm.js → app-management-settings-panel-DNkXIPxK.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CE2qJMkD.js → appearance-settings-p1_NpH8a.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DGVOnCxZ.js → apps-page-CP2u5iEh.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BWL7eT4_.js → automations-page-CjYiGOov.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-BxIShhkZ.js → automations-workspace-BAHiUQbe.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-3n446-mX.js → block-editor-DiOou1HO.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BmTK7Gtn.js → browser-automations-page-nArl2uwX.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DBQ-WETQ.js → browser-settings-page-Bd8tF-gg.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-D-nQ6Zzi.js → capabilities-page-Cx4cdgse.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-Dx1fpBmH.js → capabilities-settings-panel-DpWceNd0.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-BRMqvQVb.js → capability-header-actions-AeBubNQK.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-DXfEP1FR.js → channels-Cd1Rf0Vk.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BRdzCjWO.js → chat-terminal-dock-DrVlbq_P.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-BhCHMRpD.js → computer-settings-page-TUzZnurj.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BXE8Z-Ll.js → connector-service-page-BlpwjGW7.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-D9RZjhw8.js → connectors-page-j8VFMD4o.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BJ7N92wm.js → date-picker-CjKRpA8X.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-gyxCM-hb.js → dependency-picker-J9_0obij.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-B-WM4l-L.js → desktop-pet-DySwgreF.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-usJqcew5.js → desktop-pet-settings-B1-oyKBG.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DoSR4DGk.js → device-pairing-wizard-C5rjPAyc.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DqVlV2YH.js → directory-picker-path-field-BY7MwiZd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CUule9SU.js → extension-page-JoSFhfb6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-_OFukkEJ.js → extension-settings-page-B7LtTNx7.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-CiSc3h8i.js → fallback-models-DKSWcBt_.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-qSUrpS1h.js → gateway-settings-CGm-lbsX.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-COjDsuzg.js → home-page-CX3uWkyH.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DdvIj-ZL.js → imports-page-DS_RFtWf.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DEaVabvo.js → index-CgvOIDy_.js} +5 -5
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DbqFlNsF.js → keyboard-shortcuts-settings-BxwXR2qA.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-REowUzkp.js → local-app-workbench-page-BWd4RMBE.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DdCMNn_z.js → local-apps-page-BsgcA6-N.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-B_6fHDoi.js → logs-page-CLP5pu2j.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-D4vcSRE3.js → management-settings-CZAZwCpE.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-B7U6EbAi.js → note-detail-panel-BeAHgdtw.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-BzHVaH8j.js → notes-page-MP21Zf_R.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-D7Y4vFRN.js → page-context-capture-button-BZADmKcV.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-E6huhFk4.js → personal-page-BbaTGmE-.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CK_czbBx.js → product-open-page-CBnKsW4p.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CU6KlaVP.js → product-preview-content-B0gGexdG.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-c3ye2bdq.js → project-detail-page-ZjQSv_NG.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BA1UuuRF.js → projects-page-Bf7Sd_Ck.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-D_FLVZAm.js → remote-access-hub-Bl8aPuXU.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Cxjmwdyf.js → runtime-tools-settings-panel-CQZ1c-re.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-Av47PHdM.js → scenes-page-1xGRBOJO.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-IM7QeSm3.js → schema-form-BYqugMox.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-Bol3ScEc.js → sessions-page-DjMSVXU3.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BJuMTtyI.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-BeVtwwVd.js → settings-page-CSqi5fmN.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-zTmrMwMm.js → setup-status-panel-D5bM0TvA.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bkhkt_6M.js → shares-settings-C-V9WllF.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-Dgwc707w.js → skill-api-CFtEHy5e.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CFIte-vM.js → skills-page-B-olXUVH.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Ck6zGDHb.js → system-settings-panel-DBMR9ks_.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-C3ZPEZqw.js → task-detail-page-CGe34vxR.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CjxMpAm2.js → tunnel-api-CzNIlgdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Dnhp9xQ4.js → usage-page-O3abwewp.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-Bx2JlCpj.js +2 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CVd_y3K2.js → work-discovery-overlay-D967-fVj.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dwg40uGK.js → workflow-run-setup-panel-BJ945m7G.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BQR4JdXB.js → workflows-page-DUpVeIuw.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CaKc_J7j.js → xopc-cloud-account-card-Bq9ubffP.js} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +2 -7
- package/dist/src/agent/agent-manager.js +24 -53
- package/dist/src/agent/background-review/coordinator.js +1 -1
- package/dist/src/agent/background-review/prompts.d.ts +6 -0
- package/dist/src/agent/background-review/prompts.js +7 -1
- package/dist/src/agent/background-review/run-background-review.d.ts +3 -0
- package/dist/src/agent/background-review/run-background-review.js +184 -16
- package/dist/src/agent/context/coordinator.d.ts +1 -0
- package/dist/src/agent/context/coordinator.js +11 -2
- package/dist/src/agent/context/execution-context.js +40 -4
- package/dist/src/agent/context/project-context.js +11 -3
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +2 -2
- package/dist/src/agent/embedded/run-turn.js +5 -5
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/memory/compaction-promotion.d.ts +2 -0
- package/dist/src/agent/memory/compaction-promotion.js +33 -2
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.js +7 -7
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/knowledge-memory-tool.js +14 -6
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent/workspace-runtime/registry.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/model-credential-store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/service/action-executor.js +1 -1
- package/dist/src/bootstrap/application-state.js +2 -2
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/chat-commands/context.js +1 -1
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/image-providers.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/model.js +4 -4
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-model-intents.js +1 -1
- package/dist/src/config/agent-profile.js +2 -2
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/schema.d.ts +5 -0
- package/dist/src/config/schema.js +5 -5
- package/dist/src/connectors/connected-source-ingestion.js +45 -7
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -0
- package/dist/src/connectors/connected-source-understanding.js +59 -67
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/learning-coordinator.js +2 -2
- package/dist/src/extensions/activation-context.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.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/hono/lib/config-payload.d.ts +5 -0
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +6 -6
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +2 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -0
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.d.ts +3 -0
- package/dist/src/gateway/hono/routes/memory-learning.js +76 -0
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/observability.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +5 -3
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +13 -13
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/inventory.js +1 -1
- package/dist/src/knowledge/chunks.d.ts +10 -0
- package/dist/src/knowledge/chunks.js +28 -0
- package/dist/src/knowledge/connected-knowledge-pipeline.js +67 -33
- package/dist/src/knowledge/index.js +1 -1
- package/dist/src/knowledge/ingestion-service.js +5 -1
- package/dist/src/knowledge/local-folder-adapter.d.ts +2 -1
- package/dist/src/knowledge/local-folder-adapter.js +22 -13
- package/dist/src/knowledge-memory/domain.d.ts +4 -0
- package/dist/src/knowledge-memory/index.d.ts +1 -0
- package/dist/src/knowledge-memory/index.js +2 -1
- package/dist/src/knowledge-memory/repair-evidence.d.ts +2 -0
- package/dist/src/knowledge-memory/repair-evidence.js +57 -0
- package/dist/src/knowledge-memory/repository.d.ts +8 -0
- package/dist/src/knowledge-memory/repository.js +48 -27
- package/dist/src/knowledge-memory/search-text.d.ts +3 -0
- package/dist/src/knowledge-memory/search-text.js +32 -0
- package/dist/src/knowledge-memory/usage-policy.d.ts +6 -0
- package/dist/src/knowledge-memory/usage-policy.js +61 -0
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/memory-learning/repository.d.ts +24 -0
- package/dist/src/memory-learning/repository.js +96 -0
- package/dist/src/memory-learning/service.d.ts +17 -0
- package/dist/src/memory-learning/service.js +105 -0
- package/dist/src/memory-learning/source-learning.d.ts +7 -0
- package/dist/src/memory-learning/source-learning.js +235 -0
- package/dist/src/memory-learning/task-receipts.d.ts +3 -0
- package/dist/src/memory-learning/task-receipts.js +95 -0
- package/dist/src/memory-learning/work-capture.d.ts +51 -0
- package/dist/src/memory-learning/work-capture.js +140 -0
- package/dist/src/memory-maintenance/service.js +5 -5
- package/dist/src/notes/service.js +1 -1
- package/dist/src/observability/runtime.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +3 -3
- package/dist/src/personal-agent/prompt-context.js +4 -4
- package/dist/src/personal-agent/reply-composer.js +2 -2
- package/dist/src/personal-agent/service.js +2 -2
- package/dist/src/platform/index.js +1 -1
- package/dist/src/providers/index.js +4 -4
- package/dist/src/providers/local-model.d.ts +2 -0
- package/dist/src/providers/local-model.js +16 -0
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-registry.js +2 -2
- package/dist/src/providers/provider-auth-service.js +1 -1
- package/dist/src/providers/provider-disconnect-core.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-catalog-coordinator.js +1 -1
- package/dist/src/routing/resolve-route.js +1 -1
- package/dist/src/routing/resolve-tui-session-key.js +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +1 -1
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +2 -1
- package/dist/src/storage/sqlite/knowledge-repository.js +6 -0
- package/dist/src/storage/sqlite/migrations/245_memory_learning.sql +125 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +6 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +5 -5
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -1
- package/dist/src/user-context/config.d.ts +10 -0
- package/dist/src/user-context/config.js +5 -0
- package/dist/src/user-context/extraction/registry.d.ts +1 -1
- package/dist/src/user-context/extraction/registry.js +10 -0
- package/dist/src/user-context/identity-bindings.d.ts +10 -0
- package/dist/src/user-context/identity-bindings.js +24 -0
- package/dist/src/user-context/sources/consent-fields.d.ts +2 -0
- package/dist/src/user-context/sources/consent-fields.js +66 -0
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +1 -1
- package/dist/src/user-model/capture/semantic.d.ts +3 -1
- package/dist/src/user-model/capture/semantic.js +14 -6
- package/dist/src/user-model/index.js +1 -1
- package/dist/src/user-model/usage-policy.js +34 -0
- package/dist/src/voice/platform-streams.js +1 -0
- package/dist/src/voice/realtime/memory-context.js +19 -5
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/service.js +6 -6
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +38 -10
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-DpCanqrD.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-sx1lNWKf.js +0 -2
|
@@ -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 { init_paths, resolveExtensionsDir } from "../../config/paths.js";
|
|
4
|
+
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
4
5
|
import { ExtensionLoader } from "../../extensions/loader.js";
|
|
5
6
|
import { loadConfig } from "../../config/loader.js";
|
|
6
|
-
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
7
7
|
import "../../config/index.js";
|
|
8
8
|
//#region src/tui/extension-host/load-extensions.ts
|
|
9
9
|
init_paths();
|
|
@@ -2,8 +2,8 @@ import { closeXopcDatabase, isXopcDatabaseOpen, openXopcDatabase } from "../stor
|
|
|
2
2
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
3
3
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
5
|
-
import { resolveConfigPath } from "../config/paths.js";
|
|
6
5
|
import { init_agent_session_key, isValidAgentId, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
6
|
+
import { resolveConfigPath } from "../config/paths.js";
|
|
7
7
|
import { init_providers, providerSupportsOAuth } from "../providers/index.js";
|
|
8
8
|
import { ProjectService } from "../projects/project-service.js";
|
|
9
9
|
import { isValidProjectAgentId, normalizeProjectAgentId } from "../projects/project-agent.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
3
4
|
import { loadSkills } from "../agent/skills/index.js";
|
|
4
5
|
import { loadConfig } from "../config/loader.js";
|
|
5
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
6
6
|
import "../config/index.js";
|
|
7
7
|
//#region src/tui/tui-skills-autocomplete.ts
|
|
8
8
|
init_paths();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
2
|
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
|
+
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
4
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
4
5
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
6
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
6
7
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
7
8
|
import { loadSkills } from "../agent/skills/index.js";
|
|
8
9
|
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
9
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
10
10
|
import "../config/index.js";
|
|
11
11
|
import { basename } from "node:path";
|
|
12
12
|
//#region src/tui/tui-startup-resources.ts
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { version } from "../../package.js";
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
|
-
import { init_paths } from "../config/paths.js";
|
|
4
3
|
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
5
4
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
|
+
import { init_paths } from "../config/paths.js";
|
|
6
6
|
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
7
7
|
import { isTerminalWorkflowRunStatus } from "../workflows/domain/run.js";
|
|
8
8
|
import "../workflows/domain/index.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
2
|
+
import { isOwnerIdentity } from "./identity-bindings.js";
|
|
2
3
|
import { init_config, resolveKnowledgeReadPolicy } from "./config.js";
|
|
3
4
|
import { getConversationRouting } from "../storage/sqlite/conversation-repository.js";
|
|
4
5
|
import { init_session_key } from "../routing/session-key.js";
|
|
@@ -20,7 +21,7 @@ function resolveUserContextSessionAccess(config, conversationId) {
|
|
|
20
21
|
};
|
|
21
22
|
const session = getConversationRouting(conversationId);
|
|
22
23
|
const mode = getSessionConfig(conversationId)?.userContextMode ?? "enabled";
|
|
23
|
-
const enabled = Boolean(config.userContext.enabled && session?.peerKind === "direct" && mode === "enabled");
|
|
24
|
+
const enabled = Boolean(config.userContext.enabled && session?.peerKind === "direct" && isOwnerIdentity(session) && mode === "enabled");
|
|
24
25
|
return {
|
|
25
26
|
enabled,
|
|
26
27
|
userModel: enabled && config.userContext.userModel.enabled,
|
|
@@ -115,6 +115,11 @@ export declare const KnowledgeMemoryConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
115
115
|
allow: "allow";
|
|
116
116
|
deny: "deny";
|
|
117
117
|
}>>;
|
|
118
|
+
learning: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
idleFlushMs: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
maxBatchChars: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
maxDailyBatches: z.ZodDefault<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
118
123
|
readScopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
119
124
|
project: "project";
|
|
120
125
|
session: "session";
|
|
@@ -244,6 +249,11 @@ export declare const UserContextConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
244
249
|
allow: "allow";
|
|
245
250
|
deny: "deny";
|
|
246
251
|
}>>;
|
|
252
|
+
learning: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
idleFlushMs: z.ZodDefault<z.ZodNumber>;
|
|
254
|
+
maxBatchChars: z.ZodDefault<z.ZodNumber>;
|
|
255
|
+
maxDailyBatches: z.ZodDefault<z.ZodNumber>;
|
|
256
|
+
}, z.core.$strict>>;
|
|
247
257
|
readScopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
248
258
|
project: "project";
|
|
249
259
|
session: "session";
|
|
@@ -150,6 +150,11 @@ var init_config = __esmMin((() => {
|
|
|
150
150
|
KnowledgeMemoryConfigSchema = z.object({
|
|
151
151
|
enabled: z.boolean().default(true),
|
|
152
152
|
writePolicy: z.enum(["deny", "allow"]).default("allow"),
|
|
153
|
+
learning: z.object({
|
|
154
|
+
idleFlushMs: z.number().int().min(1e3).max(6e5).default(6e4),
|
|
155
|
+
maxBatchChars: z.number().int().min(4e3).max(12e4).default(3e4),
|
|
156
|
+
maxDailyBatches: z.number().int().min(1).max(1e4).default(100)
|
|
157
|
+
}).strict().optional(),
|
|
153
158
|
readScopes: z.array(z.enum([
|
|
154
159
|
"global",
|
|
155
160
|
"agent",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ContextExtractionRun } from '../../storage/sqlite/index.js';
|
|
2
2
|
import type { UnderstandingKind } from '../domain.js';
|
|
3
|
-
export type ExtractorId = 'turn-semantics' | 'transcript-synthesis' | 'connector-semantic';
|
|
3
|
+
export type ExtractorId = 'turn-semantics' | 'transcript-synthesis' | 'source-work-synthesis' | 'connector-semantic';
|
|
4
4
|
export type ExtractorDefinition = {
|
|
5
5
|
id: ExtractorId;
|
|
6
6
|
version: string;
|
|
@@ -15,6 +15,16 @@ const UNDERSTANDING_KINDS = [
|
|
|
15
15
|
"derived_insight"
|
|
16
16
|
];
|
|
17
17
|
const DEFINITIONS = {
|
|
18
|
+
"source-work-synthesis": {
|
|
19
|
+
id: "source-work-synthesis",
|
|
20
|
+
version: "1",
|
|
21
|
+
inputKinds: ["file", "connector"],
|
|
22
|
+
requiredProcessingPolicy: "local_only",
|
|
23
|
+
authorityCeiling: "external_untrusted",
|
|
24
|
+
candidateKinds: ["project_context", "task_lesson"],
|
|
25
|
+
maxAutomaticStatus: "active",
|
|
26
|
+
timeoutMs: 3e4
|
|
27
|
+
},
|
|
18
28
|
"turn-semantics": {
|
|
19
29
|
id: "turn-semantics",
|
|
20
30
|
version: "1",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
//#region src/user-context/identity-bindings.ts
|
|
3
|
+
init_transaction();
|
|
4
|
+
function bindOwnerIdentity(input) {
|
|
5
|
+
if (![
|
|
6
|
+
input.channel,
|
|
7
|
+
input.accountId,
|
|
8
|
+
input.peerId
|
|
9
|
+
].every((value) => value.trim())) throw new Error("Identity fields are required.");
|
|
10
|
+
getSqliteDatabase().prepare(`INSERT INTO owner_identity_bindings(principal_id, channel, account_id, peer_id, verified_at)
|
|
11
|
+
VALUES ('local-owner', ?, ?, ?, ?) ON CONFLICT(channel, account_id, peer_id) DO UPDATE
|
|
12
|
+
SET verified_at = excluded.verified_at, revoked_at = NULL`).run(input.channel, input.accountId, input.peerId, Date.now());
|
|
13
|
+
}
|
|
14
|
+
function isOwnerIdentity(input) {
|
|
15
|
+
if ([
|
|
16
|
+
"webchat",
|
|
17
|
+
"cli",
|
|
18
|
+
"tui"
|
|
19
|
+
].includes(input.source)) return true;
|
|
20
|
+
return Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM owner_identity_bindings
|
|
21
|
+
WHERE principal_id = 'local-owner' AND channel = ? AND account_id = ? AND peer_id = ? AND revoked_at IS NULL`).get(input.source, input.accountId, input.peerId));
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { bindOwnerIdentity, isOwnerIdentity };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region src/user-context/sources/consent-fields.ts
|
|
2
|
+
const FIELD_KEYS = {
|
|
3
|
+
title: [
|
|
4
|
+
"title",
|
|
5
|
+
"subject",
|
|
6
|
+
"name",
|
|
7
|
+
"fullName",
|
|
8
|
+
"repository"
|
|
9
|
+
],
|
|
10
|
+
content: [
|
|
11
|
+
"content",
|
|
12
|
+
"body",
|
|
13
|
+
"text",
|
|
14
|
+
"snippet",
|
|
15
|
+
"description",
|
|
16
|
+
"summary"
|
|
17
|
+
],
|
|
18
|
+
participants: [
|
|
19
|
+
"from",
|
|
20
|
+
"to",
|
|
21
|
+
"cc",
|
|
22
|
+
"bcc",
|
|
23
|
+
"sender",
|
|
24
|
+
"author",
|
|
25
|
+
"organizer",
|
|
26
|
+
"attendees",
|
|
27
|
+
"participants",
|
|
28
|
+
"assignee",
|
|
29
|
+
"owners"
|
|
30
|
+
],
|
|
31
|
+
status: [
|
|
32
|
+
"status",
|
|
33
|
+
"state",
|
|
34
|
+
"labels"
|
|
35
|
+
],
|
|
36
|
+
timestamps: [
|
|
37
|
+
"createdAt",
|
|
38
|
+
"updatedAt",
|
|
39
|
+
"modifiedAt",
|
|
40
|
+
"start",
|
|
41
|
+
"end",
|
|
42
|
+
"created_at",
|
|
43
|
+
"updated_at",
|
|
44
|
+
"modified_at"
|
|
45
|
+
],
|
|
46
|
+
owner_activity: [
|
|
47
|
+
"user",
|
|
48
|
+
"username",
|
|
49
|
+
"owner"
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
/** Restrict source fields before either model processing or searchable chunk persistence. */
|
|
53
|
+
function consentFilteredText(value, allowedFields) {
|
|
54
|
+
if (!value) return;
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(value);
|
|
57
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return;
|
|
58
|
+
const keys = new Set([...allowedFields].flatMap((field) => FIELD_KEYS[field] ?? []));
|
|
59
|
+
const selected = Object.entries(parsed).filter(([key]) => keys.has(key));
|
|
60
|
+
return selected.length ? JSON.stringify(Object.fromEntries(selected)) : void 0;
|
|
61
|
+
} catch {
|
|
62
|
+
return !/^\s*[\[{]/.test(value) && allowedFields.has("content") ? value : void 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { consentFilteredText };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createCollaborationRule, init_collaboration_rule_repository, listCollaborationRules } from "../storage/sqlite/collaboration-rule-repository.js";
|
|
2
|
-
import { reconcileAssertion } from "./repository.js";
|
|
3
2
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals } from "./goals.js";
|
|
3
|
+
import { reconcileAssertion } from "./repository.js";
|
|
4
4
|
import { applyUserProfilePatch } from "./profile.js";
|
|
5
5
|
//#region src/user-model/bootstrap.ts
|
|
6
6
|
init_collaboration_rule_repository();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCollaborationRule, init_collaboration_rule_repository, listCollaborationRules } from "../../storage/sqlite/collaboration-rule-repository.js";
|
|
2
2
|
import { createContextEvidence, init_context_evidence_repository } from "../../storage/sqlite/context-evidence-repository.js";
|
|
3
|
-
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, linkAssertionEvidence, mergeAssertionObservation, reconcileAssertion, setAssertionStatus } from "../repository.js";
|
|
4
3
|
import { createUserGoal, listUserGoals } from "../goals.js";
|
|
4
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, linkAssertionEvidence, mergeAssertionObservation, reconcileAssertion, setAssertionStatus } from "../repository.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region src/user-model/capture/executor.ts
|
|
7
7
|
init_context_evidence_repository();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { type WorkCandidate } from '../../memory-learning/work-capture.js';
|
|
1
2
|
import type { AssertionCandidate } from '../domain.js';
|
|
2
3
|
export declare const USER_MODEL_CAPTURE_INTENTS: readonly ["remember", "query", "confirm", "correct", "forget", "user_assertion", "task", "none"];
|
|
3
4
|
export type UserModelCaptureIntent = typeof USER_MODEL_CAPTURE_INTENTS[number];
|
|
4
5
|
export interface CaptureEvidence {
|
|
5
6
|
ref: string;
|
|
6
|
-
role: 'user' | 'assistant';
|
|
7
|
+
role: 'user' | 'assistant' | 'toolResult';
|
|
7
8
|
text: string;
|
|
8
9
|
createdAt: number;
|
|
9
10
|
}
|
|
@@ -32,6 +33,7 @@ export interface ParsedCollaborationRuleCandidate {
|
|
|
32
33
|
evidenceRefs: string[];
|
|
33
34
|
}
|
|
34
35
|
export interface UserModelInterpretation {
|
|
36
|
+
knowledge?: WorkCandidate[];
|
|
35
37
|
intent: UserModelCaptureIntent;
|
|
36
38
|
assertions: ParsedAssertionOperation[];
|
|
37
39
|
goals?: ParsedGoalCandidate[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WorkCandidateSchema } from "../../memory-learning/work-capture.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
//#region src/user-model/capture/semantic.ts
|
|
3
4
|
const USER_MODEL_CAPTURE_INTENTS = [
|
|
@@ -30,6 +31,7 @@ const ScopeSchema = z.object({
|
|
|
30
31
|
});
|
|
31
32
|
});
|
|
32
33
|
const AssertionOperationSchema = z.object({
|
|
34
|
+
intent: z.enum(USER_MODEL_CAPTURE_INTENTS).optional(),
|
|
33
35
|
action: z.enum([
|
|
34
36
|
"create",
|
|
35
37
|
"merge",
|
|
@@ -122,6 +124,7 @@ const AssertionOperationSchema = z.object({
|
|
|
122
124
|
});
|
|
123
125
|
});
|
|
124
126
|
const GroundingSchema = z.object({
|
|
127
|
+
intent: z.enum(USER_MODEL_CAPTURE_INTENTS).optional(),
|
|
125
128
|
evidence: z.array(z.object({
|
|
126
129
|
ref: z.string().min(1),
|
|
127
130
|
quote: z.string().min(1)
|
|
@@ -150,6 +153,7 @@ const CollaborationRuleSchema = z.object({
|
|
|
150
153
|
statement: z.string().min(4).max(600)
|
|
151
154
|
}).merge(GroundingSchema).strict();
|
|
152
155
|
const InterpretationSchema = z.object({
|
|
156
|
+
knowledge: z.array(WorkCandidateSchema).max(8).default([]),
|
|
153
157
|
intent: z.enum(USER_MODEL_CAPTURE_INTENTS),
|
|
154
158
|
assertions: z.array(AssertionOperationSchema).max(8),
|
|
155
159
|
goals: z.array(GoalSchema).max(4).default([]),
|
|
@@ -198,7 +202,8 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
198
202
|
]);
|
|
199
203
|
const allowed = new Set(allowedTargetIds);
|
|
200
204
|
const assertions = [];
|
|
201
|
-
|
|
205
|
+
for (const item of parsed.assertions) {
|
|
206
|
+
if (!assertionIntents.has(item.intent ?? parsed.intent)) continue;
|
|
202
207
|
const evidenceRefs = groundedEvidenceRefs(item, evidenceByRef);
|
|
203
208
|
if (!evidenceRefs) continue;
|
|
204
209
|
if (item.action !== "create" && (!item.targetAssertionId || !allowed.has(item.targetAssertionId))) continue;
|
|
@@ -214,7 +219,7 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
214
219
|
value: item.value,
|
|
215
220
|
normalizedValue: item.normalizedValue,
|
|
216
221
|
statement: item.statement,
|
|
217
|
-
authority: effectiveAuthority(parsed.intent, item.authority),
|
|
222
|
+
authority: effectiveAuthority(item.intent ?? parsed.intent, item.authority),
|
|
218
223
|
confidence: item.confidence,
|
|
219
224
|
...item.declaredImportance === void 0 ? {} : { declaredImportance: item.declaredImportance },
|
|
220
225
|
inferredImportance: item.inferredImportance,
|
|
@@ -242,7 +247,8 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
242
247
|
"correct",
|
|
243
248
|
"user_assertion"
|
|
244
249
|
]);
|
|
245
|
-
const goals =
|
|
250
|
+
const goals = parsed.goals.flatMap((item) => {
|
|
251
|
+
if (!structuredIntents.has(item.intent ?? parsed.intent)) return [];
|
|
246
252
|
const evidenceRefs = groundedEvidenceRefs(item, evidenceByRef);
|
|
247
253
|
if (!evidenceRefs) return [];
|
|
248
254
|
return [{
|
|
@@ -253,8 +259,9 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
253
259
|
...item.targetAt === void 0 ? {} : { targetAt: parseTime(item.targetAt) },
|
|
254
260
|
evidenceRefs
|
|
255
261
|
}];
|
|
256
|
-
})
|
|
257
|
-
const collaborationRules =
|
|
262
|
+
});
|
|
263
|
+
const collaborationRules = parsed.collaborationRules.flatMap((item) => {
|
|
264
|
+
if (!structuredIntents.has(item.intent ?? parsed.intent)) return [];
|
|
258
265
|
const evidenceRefs = groundedEvidenceRefs(item, evidenceByRef);
|
|
259
266
|
if (!evidenceRefs || item.scope.type === "agent") return [];
|
|
260
267
|
return [{
|
|
@@ -265,8 +272,9 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
265
272
|
statement: item.statement,
|
|
266
273
|
evidenceRefs
|
|
267
274
|
}];
|
|
268
|
-
})
|
|
275
|
+
});
|
|
269
276
|
return {
|
|
277
|
+
knowledge: parsed.knowledge,
|
|
270
278
|
intent: parsed.intent,
|
|
271
279
|
assertions,
|
|
272
280
|
goals,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PERSONAL_DOMAINS, USER_MODEL_PRINCIPAL_ID, defaultAssertionDomain, defaultAssertionLayer, init_domain, validateCandidate, validateScope } from "./domain.js";
|
|
2
|
+
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "./goals.js";
|
|
2
3
|
import { defaultReviewAt, isAssertionValidAt, requiresBoundedValidity, resolveCurrentAssertion } from "./temporal.js";
|
|
3
4
|
import { deleteUserAssertion, getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserTimezone, linkAssertionEvidence, listSlotAssertions, listUserAssertionSources, listUserAssertions, mergeAssertionObservation, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "./repository.js";
|
|
4
5
|
import { listActionRuleSuggestions } from "./action-rule-suggestions.js";
|
|
5
6
|
import { calculateExecutionValue } from "./importance.js";
|
|
6
|
-
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "./goals.js";
|
|
7
7
|
import { deleteUserModelObservationsForGrant, linkUserAssertions, listUserAssertionEdges, listUserModelObservations, recordUserModelObservation } from "./observation-repository.js";
|
|
8
8
|
import { applyUserProfilePatch, getUserProfileSnapshot } from "./profile.js";
|
|
9
9
|
import { bootstrapUserModel } from "./bootstrap.js";
|
|
@@ -1,9 +1,43 @@
|
|
|
1
|
+
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
3
|
+
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
4
|
+
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
5
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
6
|
+
import { getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
|
|
7
|
+
import { isOwnerIdentity } from "../user-context/identity-bindings.js";
|
|
1
8
|
//#region src/user-model/usage-policy.ts
|
|
9
|
+
init_sqlite();
|
|
10
|
+
init_transaction();
|
|
11
|
+
init_session_repository();
|
|
2
12
|
/** Automatic personalization never grants execution authority. */
|
|
3
13
|
function isWorkingAssumption(assertion) {
|
|
4
14
|
return (assertion.status === "candidate" || assertion.status === "active") && (assertion.authority === "user_observed" || assertion.authority === "system_inferred") && assertion.confidence >= .7 && (assertion.consequence === "low" || assertion.consequence === "medium") && assertion.sensitivity === "normal" && assertion.disclosurePolicy !== "ask_before_reference";
|
|
5
15
|
}
|
|
6
16
|
function canUseAssertion(assertion, asOf = Date.now(), context = {}) {
|
|
17
|
+
if (assertion.consentReceiptId) {
|
|
18
|
+
if (!isXopcDatabaseOpen()) return false;
|
|
19
|
+
const consent = getUnderstandingConsent(assertion.consentReceiptId);
|
|
20
|
+
if (!consent || consent.revokedAt !== void 0 || !consent.allowedDomains.includes(assertion.domain)) return false;
|
|
21
|
+
if (!getSqliteDatabase().prepare("SELECT 1 FROM understanding_source_grants WHERE grant_id = ? AND status = 'active'").get(consent.grantId)) return false;
|
|
22
|
+
}
|
|
23
|
+
if (isXopcDatabaseOpen() && assertion.id) {
|
|
24
|
+
const db = getSqliteDatabase();
|
|
25
|
+
const evidence = db.prepare(`SELECT e.source_type, e.source_item_id, e.conversation_id, e.content_hash,
|
|
26
|
+
link.content_hash AS linked_hash FROM user_assertion_evidence link JOIN context_evidence e ON e.evidence_id = link.evidence_id
|
|
27
|
+
WHERE link.assertion_id = ? AND link.relation = 'supports'`).all(assertion.id);
|
|
28
|
+
if (assertion.createdBy === "connector" && (!assertion.consentReceiptId || !evidence.length)) return false;
|
|
29
|
+
for (const link of evidence) {
|
|
30
|
+
if (link.conversation_id) {
|
|
31
|
+
const session = getSessionMetadata(link.conversation_id);
|
|
32
|
+
if (!session?.routing || session.routing.peerKind !== "direct" || !isOwnerIdentity(session.routing)) return false;
|
|
33
|
+
}
|
|
34
|
+
if (link.source_type === "connector") {
|
|
35
|
+
if (!link.source_item_id || !link.linked_hash || link.linked_hash !== link.content_hash) return false;
|
|
36
|
+
const source = db.prepare("SELECT content_hash, deleted_at FROM knowledge_source_items WHERE item_id = ?").get(link.source_item_id);
|
|
37
|
+
if (!source || source.deleted_at || source.content_hash !== link.linked_hash) return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
7
41
|
return (assertion.validFrom === void 0 || assertion.validFrom <= asOf) && (assertion.validTo === void 0 || assertion.validTo >= asOf) && (assertion.deleteAfter === void 0 || assertion.deleteAfter > asOf) && (assertion.reviewAt === void 0 || assertion.reviewAt > asOf) && (!context.use || !assertion.allowedUses || assertion.allowedUses.includes(context.use)) && (!assertion.allowedAgentIds || Boolean(context.agentId && assertion.allowedAgentIds.includes(context.agentId))) && assertion.sensitivity !== "secret" && assertion.sensitivity !== "regulated" && assertion.disclosurePolicy !== "ask_before_reference" && (assertion.status === "active" && assertion.authority === "user_explicit" || isWorkingAssumption(assertion));
|
|
8
42
|
}
|
|
9
43
|
//#endregion
|
|
@@ -10,6 +10,7 @@ var PlatformVoiceError = class extends Error {
|
|
|
10
10
|
this.name = "PlatformVoiceError";
|
|
11
11
|
}
|
|
12
12
|
get clientMessage() {
|
|
13
|
+
if (this.code === "realtime_quota_session_limit") return "The funded transcription duration has been reached. Start a new voice session to continue.";
|
|
13
14
|
if (this.code === "realtime_quota_workspace_budget") return "XOPC Cloud voice workspace budget is exhausted. Increase the workspace budget or choose another voice provider.";
|
|
14
15
|
if (this.status === 402 || this.code === "realtime_quota_user_credits") return "XOPC Cloud voice has insufficient Credit or quota. Check your Cloud balance and workspace budget, or choose another voice provider.";
|
|
15
16
|
if (this.status === 401 || this.status === 403) return "XOPC Cloud voice authorization failed. Sign in again and check your access to this voice model.";
|
|
@@ -3,16 +3,20 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
5
5
|
import { getSessionConfig, init_config_repository } from "../../storage/sqlite/config-repository.js";
|
|
6
|
+
import { canUseKnowledge } from "../../knowledge-memory/usage-policy.js";
|
|
7
|
+
import { getKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
8
|
+
import { init_config, resolveKnowledgeReadPolicy } from "../../user-context/config.js";
|
|
6
9
|
import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
|
|
7
10
|
import { getConversation } from "../../routing/agent-session-key.js";
|
|
8
11
|
import { init_session_key } from "../../routing/session-key.js";
|
|
9
|
-
import {
|
|
12
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
10
13
|
import "../../knowledge-memory/index.js";
|
|
14
|
+
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
11
15
|
import { getUserAssertion } from "../../user-model/repository.js";
|
|
12
16
|
import "../../user-model/index.js";
|
|
13
|
-
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
14
17
|
import { buildExecutionContext } from "../../agent/context/execution-context.js";
|
|
15
18
|
//#region src/voice/realtime/memory-context.ts
|
|
19
|
+
init_config();
|
|
16
20
|
init_session_key();
|
|
17
21
|
init_config_repository();
|
|
18
22
|
init_session_repository();
|
|
@@ -35,7 +39,7 @@ function buildVoiceMemoryContext(input) {
|
|
|
35
39
|
const started = performance.now();
|
|
36
40
|
try {
|
|
37
41
|
const config = input.getConfig();
|
|
38
|
-
if (!voiceMemoryEnabled(config, input.conversationId) || input.maxChars < 128) return;
|
|
42
|
+
if (!resolveUserContextSessionAccess(config, input.conversationId).userModel || !voiceMemoryEnabled(config, input.conversationId) || input.maxChars < 128) return;
|
|
39
43
|
const session = getSessionMetadata(input.conversationId);
|
|
40
44
|
const context = buildExecutionContext({
|
|
41
45
|
query: voiceMemoryQuery(input.history),
|
|
@@ -44,7 +48,9 @@ function buildVoiceMemoryContext(input) {
|
|
|
44
48
|
projectId: input.projectId,
|
|
45
49
|
conversationId: input.conversationId,
|
|
46
50
|
maxAssertions: 6,
|
|
47
|
-
maxKnowledge: 3
|
|
51
|
+
maxKnowledge: 3,
|
|
52
|
+
includeKnowledge: resolveUserContextSessionAccess(config, input.conversationId).knowledge,
|
|
53
|
+
knowledgePolicy: resolveKnowledgeReadPolicy(config.userContext.knowledgeMemory)
|
|
48
54
|
});
|
|
49
55
|
const block = JSON.stringify({ backgroundMemory: {
|
|
50
56
|
userFacts: context.assertions.map((item) => item.assertion.statement),
|
|
@@ -64,7 +70,15 @@ function buildVoiceMemoryContext(input) {
|
|
|
64
70
|
const configVersion = JSON.stringify(config.userContext);
|
|
65
71
|
const isCurrent = () => {
|
|
66
72
|
if (!voiceMemoryEnabled(input.getConfig(), input.conversationId) || JSON.stringify(input.getConfig().userContext) !== configVersion) return false;
|
|
67
|
-
return references.every((reference) => reference.kind === "assertion" ? getUserAssertion(reference.id)?.recordedAt === reference.updatedAt :
|
|
73
|
+
return references.every((reference) => reference.kind === "assertion" ? getUserAssertion(reference.id)?.recordedAt === reference.updatedAt : (() => {
|
|
74
|
+
const item = getKnowledgeItem(reference.id);
|
|
75
|
+
return Boolean(item && item.updatedAt === reference.updatedAt && canUseKnowledge(item, {
|
|
76
|
+
agentId: session?.routing?.agentId ?? "main",
|
|
77
|
+
workspaceId: input.workspaceId,
|
|
78
|
+
projectId: input.projectId,
|
|
79
|
+
conversationId: input.conversationId
|
|
80
|
+
}, resolveKnowledgeReadPolicy(input.getConfig().userContext.knowledgeMemory)));
|
|
81
|
+
})());
|
|
68
82
|
};
|
|
69
83
|
log.debug({
|
|
70
84
|
conversationId: input.conversationId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
2
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
|
+
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
4
4
|
import { loadProfileBootstrapFiles } from "../../agent/bootstrap/load-bootstrap-files.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getWorkDiscoveryRun } from "./repository.js";
|
|
2
1
|
import { createUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, updateUnderstandingSourceRun } from "../user-context/sources/repository.js";
|
|
2
|
+
import { getWorkDiscoveryRun } from "./repository.js";
|
|
3
3
|
import { workDiscoveryFingerprintsEqual } from "./incremental.js";
|
|
4
4
|
//#region src/work-discovery/incremental-repository.ts
|
|
5
5
|
function refreshFromRun(run) {
|
|
@@ -5,19 +5,19 @@ import { createContextEvidence, init_context_evidence_repository } from "../stor
|
|
|
5
5
|
import { ensureSessionRecord, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
6
6
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
7
7
|
import { ActivityService } from "../activity/service.js";
|
|
8
|
-
import {
|
|
8
|
+
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
9
|
+
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
9
10
|
import { init_session_key, resolveConversationId } from "../routing/session-key.js";
|
|
11
|
+
import "../knowledge-memory/index.js";
|
|
10
12
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
11
13
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
14
|
+
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
12
15
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
13
|
-
import {
|
|
14
|
-
import "../knowledge-memory/index.js";
|
|
15
|
-
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
16
|
+
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
16
17
|
import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
18
|
+
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
17
19
|
import "../user-model/index.js";
|
|
18
20
|
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
19
|
-
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
20
|
-
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
21
21
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
22
22
|
import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
23
23
|
import { clusterActivityTopics } from "../user-context/sources/activity-clustering.js";
|
|
@@ -3,6 +3,7 @@ import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-ru
|
|
|
3
3
|
import { init_conversation_repository, resolveRoutedConversation } from "../../storage/sqlite/conversation-repository.js";
|
|
4
4
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
5
5
|
import { extractProfileAgentId, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
|
+
import { resolveModelSelector } from "../../config/agent-model-intents.js";
|
|
6
7
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
7
8
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
|
8
9
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
@@ -12,7 +13,6 @@ import { validateWorkflowJsonSchema } from "../domain/schema-validation.js";
|
|
|
12
13
|
import "../domain/index.js";
|
|
13
14
|
import { TaskContextRepository } from "../../tasks/task-context-repository.js";
|
|
14
15
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
15
|
-
import { resolveModelSelector } from "../../config/agent-model-intents.js";
|
|
16
16
|
import { DelegateSubagentRunner } from "../../agent/workflow/subagent-runner.js";
|
|
17
17
|
import { preflightWorkflowConnectors } from "../../connectors/workflow-preflight.js";
|
|
18
18
|
import { CatalogWorkflowDefinitionRegistry } from "../registry/catalog-workflow-definition-registry.js";
|