@xopcai/xopc 0.0.94 → 0.0.96
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/feishu/src/workflow-progress.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/src/routing-integration.js +2 -2
- package/dist/extensions/telegram/src/workflow-progress.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
- package/dist/extensions/weixin/src/plugin.js +1 -1
- package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
- package/dist/extensions/weixin/src/workflow-progress.js +1 -1
- package/dist/gateway/static/root/assets/{agents-OqhbJkMf.js → agents-DmIuSaOE.js} +3 -3
- package/dist/gateway/static/root/assets/{apps-page-OHXW9XP8.js → apps-page-DFcHBxLw.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-4N2R-jof.js → channels-settings-DDUf55C5.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-status-swr-Bv6f9kDq.js → channels-status-swr-BxF-_nzD.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-api-BtaQaHJq.js → cron-api-DylQtnb_.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-page-Dah32HJK.js → cron-page-BO0d9Pf-.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-BJfD9Qvs.js → dist-BskF0qDS.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DnYuMzmH.js → extension-debug-page-BcZdTdjJ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CJfc-6XV.js → extension-page-D2iuDa1D.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BxdfYQMG.js → extension-settings-page-BKpQCgLc.js} +1 -1
- package/dist/gateway/static/root/assets/{fetch-B0aeeY0q.js → fetch-CtNDpjij.js} +1 -1
- package/dist/gateway/static/root/assets/{field-primitives-DOLHwowi.js → field-primitives-2PekrGZF.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-config-api-Bj2INAf5.js → heartbeat-config-api-D3D7SW8A.js} +1 -1
- package/dist/gateway/static/root/assets/index-BvEhL9RQ.css +1 -0
- package/dist/gateway/static/root/assets/{index-DuQ1XPoA.js → index-Db9fd_X4.js} +74 -74
- package/dist/gateway/static/root/assets/{logs-page-AsOgLNJE.js → logs-page-B3I1a26m.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-page-24J4mVP-.js → note-detail-page-BOizhtJ8.js} +54 -53
- package/dist/gateway/static/root/assets/{note-detail-page-B91pLkEI.css → note-detail-page-D4ZIVQbk.css} +1 -1
- package/dist/gateway/static/root/assets/{note-time-JBszYV3s.js → note-time-CjUGtqKr.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-BB8-I0Of.js +1 -0
- package/dist/gateway/static/root/assets/{sessions-page-DX9huWsA.js → sessions-page-BcH-1K9i.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-advanced-gate-DWvhsTuz.js → settings-advanced-gate-Czn8nnjN.js} +2 -2
- package/dist/gateway/static/root/assets/{settings-form-section-CxMjaMiy.js → settings-form-section-ZZWDwgVe.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-BX8c_zrN.js +3 -0
- package/dist/gateway/static/root/assets/share-preview-page-Ch3_6Qah.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page-CGKGKfwe.js → skills-page-WO0bbJ54.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Cg_SuBw0.js → theme-store-XxRFRZDX.js} +1 -1
- package/dist/gateway/static/root/assets/url-6zpynn1R.js +3 -0
- package/dist/gateway/static/root/assets/{utils-BmlcxR2j.js → utils-uTYKh54l.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DaGm2N4J.js → voice-api-key-field-BIAYHRs-.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-page.utils-D0vsIGHD.js → workflow-page.utils-BbWhqD36.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-BFCrD3nw.js → workflows-page-D4RIF7E1.js} +2 -2
- package/dist/gateway/static/root/index.html +5 -5
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +15 -9
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/agent-scope.d.ts +0 -1
- package/dist/src/agent/agent-scope.js +2 -5
- package/dist/src/agent/agent-scope.js.map +1 -1
- package/dist/src/agent/bootstrap/bootstrap-cache.d.ts +3 -0
- package/dist/src/agent/bootstrap/bootstrap-cache.js +13 -3
- package/dist/src/agent/bootstrap/bootstrap-cache.js.map +1 -1
- package/dist/src/agent/bootstrap/bootstrap-files.d.ts +6 -0
- package/dist/src/agent/bootstrap/bootstrap-files.js +35 -12
- package/dist/src/agent/bootstrap/bootstrap-files.js.map +1 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.d.ts +5 -2
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +12 -3
- package/dist/src/agent/bootstrap/load-bootstrap-files.js.map +1 -1
- package/dist/src/agent/context/workspace-seed.js +8 -4
- package/dist/src/agent/context/workspace-seed.js.map +1 -1
- package/dist/src/agent/context/workspace-state.d.ts +52 -0
- package/dist/src/agent/context/workspace-state.js +101 -0
- package/dist/src/agent/context/workspace-state.js.map +1 -0
- package/dist/src/agent/embedded/index.d.ts +2 -2
- package/dist/src/agent/embedded/index.js +3 -3
- package/dist/src/agent/embedded/run-turn.js +0 -3
- package/dist/src/agent/embedded/run-turn.js.map +1 -1
- package/dist/src/agent/embedded/session-manager-init.d.ts +0 -17
- package/dist/src/agent/embedded/session-manager-init.js +1 -36
- package/dist/src/agent/embedded/session-manager-init.js.map +1 -1
- package/dist/src/agent/embedded/session-runner.d.ts +3 -12
- package/dist/src/agent/embedded/session-runner.js +12 -26
- package/dist/src/agent/embedded/session-runner.js.map +1 -1
- package/dist/src/agent/embedded/session-tool-result-guard.js +2 -4
- package/dist/src/agent/embedded/session-tool-result-guard.js.map +1 -1
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.d.ts +10 -0
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +34 -0
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js.map +1 -0
- package/dist/src/agent/goals/goal-run-store.js +4 -4
- package/dist/src/agent/goals/persistent-goal-service.js +8 -15
- package/dist/src/agent/goals/persistent-goal-service.js.map +1 -1
- package/dist/src/agent/goals/post-turn.js +2 -2
- package/dist/src/agent/image/load-image-media.js +2 -2
- package/dist/src/agent/ipc/bus.js +1 -1
- package/dist/src/agent/ipc/inbox.js +2 -2
- package/dist/src/agent/ipc/socket.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/memory/builtin-memory-store.js +1 -1
- package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
- package/dist/src/agent/memory/dreaming/events.js +1 -1
- package/dist/src/agent/memory/dreaming/last-run.js +1 -1
- package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
- package/dist/src/agent/memory/dreaming/preview.js +1 -1
- package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
- package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
- package/dist/src/agent/memory/dreaming/utils.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -1
- package/dist/src/agent/models/manager.js +1 -1
- package/dist/src/agent/prompt/memory/index.d.ts +1 -0
- package/dist/src/agent/prompt/memory/index.js +34 -80
- package/dist/src/agent/prompt/memory/index.js.map +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/reply/post-compaction-context.js +1 -1
- package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
- package/dist/src/agent/sandbox/path-policy.js +2 -2
- package/dist/src/agent/service/build-direct-message-content.js +1 -1
- package/dist/src/agent/service/process-direct-one-shot.js +8 -17
- package/dist/src/agent/service/process-direct-one-shot.js.map +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +14 -23
- package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
- package/dist/src/agent/service.js +7 -11
- package/dist/src/agent/service.js.map +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +1 -1
- package/dist/src/agent/skills/hub-hash.js +2 -2
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +3 -3
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/scanner.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/tools/dreaming-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/index.d.ts +0 -1
- package/dist/src/agent/tools/index.js +1 -2
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/session-search-tool.d.ts +0 -1
- package/dist/src/agent/tools/session-search-tool.js +11 -6
- package/dist/src/agent/tools/session-search-tool.js.map +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/workflow/catalog.js +1 -1
- package/dist/src/auth/credentials.js +3 -3
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/browser/cache-dir-policy.js +1 -1
- package/dist/src/browser/cdp-local-launcher.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +4 -4
- package/dist/src/browser/providers/cloakbrowser.js +4 -4
- package/dist/src/browser/providers/playwright-doctor.js +1 -1
- package/dist/src/browser/stealth.js +1 -1
- package/dist/src/channels/attachments/inbound-persist.js +1 -1
- package/dist/src/channels/attachments/outbound-tts-persist.js +1 -1
- package/dist/src/channels/outbound/persist-store.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +2 -2
- package/dist/src/chat-commands/agent-edit.js +2 -2
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/context.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +32 -95
- package/dist/src/cli/commands/doctor/checks/session-integrity.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension-pack.js +1 -1
- package/dist/src/cli/commands/gateway/logs.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +5 -7
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/commands/agents.config.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/gateway-bind.js +1 -1
- package/dist/src/config/index.js +7 -8
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/paths-state.d.ts +3 -0
- package/dist/src/config/paths-state.js +7 -3
- package/dist/src/config/paths-state.js.map +1 -1
- package/dist/src/config/paths.d.ts +5 -35
- package/dist/src/config/paths.js +6 -50
- package/dist/src/config/paths.js.map +1 -1
- package/dist/src/config/profile.js +2 -2
- package/dist/src/config/schema.d.ts +15 -0
- package/dist/src/config/schema.js +11 -0
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/config/workspace-path.js +1 -1
- package/dist/src/cron/execution-types.d.ts +42 -0
- package/dist/src/cron/executor.js +2 -2
- package/dist/src/cron/persistence.js +1 -1
- package/dist/src/cron/run-log-store.d.ts +4 -8
- package/dist/src/cron/run-log-store.js +26 -78
- package/dist/src/cron/run-log-store.js.map +1 -1
- package/dist/src/cron/service.d.ts +3 -3
- package/dist/src/cron/service.js +2 -2
- package/dist/src/cron/service.js.map +1 -1
- package/dist/src/cron/types.d.ts +1 -42
- package/dist/src/daemon/constants.js +1 -1
- package/dist/src/daemon/install-plan.js +2 -2
- package/dist/src/daemon/launchd.js +2 -2
- package/dist/src/daemon/schtasks.js +2 -2
- package/dist/src/daemon/systemd.js +2 -2
- package/dist/src/extensions/bundle-mcp.js +1 -1
- package/dist/src/extensions/discover-extensions.js +1 -1
- package/dist/src/extensions/health.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +2 -2
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +8 -3
- package/dist/src/gateway/agents-admin.js.map +1 -1
- package/dist/src/gateway/file-path-classifier.d.ts +0 -1
- package/dist/src/gateway/file-path-classifier.js +2 -8
- package/dist/src/gateway/file-path-classifier.js.map +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/lib/extension-store.js +2 -2
- package/dist/src/gateway/hono/lib/static-ui.js +2 -2
- package/dist/src/gateway/hono/oauth.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/dreaming.js +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +2 -2
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/workspace.js +2 -2
- package/dist/src/gateway/lock.js +3 -3
- package/dist/src/gateway/ports.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service.js +5 -1
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/session-reset-service.d.ts +1 -1
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/session-reset-service.js.map +1 -1
- package/dist/src/gateway/workspace-fs-file-list.js +1 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/brew.js +1 -1
- package/dist/src/infra/node-sqlite.d.ts +1 -0
- package/dist/src/infra/node-sqlite.js +17 -0
- package/dist/src/infra/node-sqlite.js.map +1 -0
- package/dist/src/infra/package-json.js +1 -1
- package/dist/src/infra/package-update-steps.js +1 -1
- package/dist/src/infra/path-env.js +2 -2
- package/dist/src/infra/restart.js +2 -2
- package/dist/src/infra/sqlite-errors.d.ts +1 -0
- package/dist/src/infra/sqlite-errors.js +77 -0
- package/dist/src/infra/sqlite-errors.js.map +1 -0
- package/dist/src/infra/stable-node-path.js +1 -1
- package/dist/src/infra/unhandled-rejections.d.ts +1 -0
- package/dist/src/infra/unhandled-rejections.js +25 -0
- package/dist/src/infra/unhandled-rejections.js.map +1 -0
- package/dist/src/infra/update-check.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-lock.js +3 -3
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/infra/update-startup.js +2 -2
- package/dist/src/infra/warning-filter.d.ts +7 -0
- package/dist/src/infra/warning-filter.js +59 -0
- package/dist/src/infra/warning-filter.js.map +1 -0
- package/dist/src/infra/write-file-atomic.js +2 -2
- package/dist/src/notes/store.d.ts +3 -9
- package/dist/src/notes/store.js +22 -196
- package/dist/src/notes/store.js.map +1 -1
- package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/session/config-store.d.ts +6 -75
- package/dist/src/session/config-store.js +38 -144
- package/dist/src/session/config-store.js.map +1 -1
- package/dist/src/session/config-types.d.ts +15 -0
- package/dist/src/session/config-types.js +1 -0
- package/dist/src/session/index.d.ts +1 -3
- package/dist/src/session/index.js +3 -5
- package/dist/src/session/init-session-turn.d.ts +0 -6
- package/dist/src/session/init-session-turn.js +18 -18
- package/dist/src/session/init-session-turn.js.map +1 -1
- package/dist/src/session/lifecycle-timestamps.d.ts +5 -2
- package/dist/src/session/lifecycle-timestamps.js.map +1 -1
- package/dist/src/session/{parity/load-jsonl-entries.js → load-jsonl-entries.js} +1 -1
- package/dist/src/session/load-jsonl-entries.js.map +1 -0
- package/dist/src/session/manager.d.ts +5 -3
- package/dist/src/session/manager.js +1 -5
- package/dist/src/session/manager.js.map +1 -1
- package/dist/src/session/resolve-session.d.ts +3 -6
- package/dist/src/session/resolve-session.js +26 -31
- package/dist/src/session/resolve-session.js.map +1 -1
- package/dist/src/session/session-context-for-llm.js +5 -1
- package/dist/src/session/session-context-for-llm.js.map +1 -1
- package/dist/src/session/session-id.js +12 -0
- package/dist/src/session/session-id.js.map +1 -0
- package/dist/src/session/session-title.js +2 -2
- package/dist/src/session/session-workspace.d.ts +1 -1
- package/dist/src/session/session-workspace.js.map +1 -1
- package/dist/src/session/store.d.ts +14 -63
- package/dist/src/session/store.js +172 -847
- package/dist/src/session/store.js.map +1 -1
- package/dist/src/session/stored-rows-to-file-entries.d.ts +11 -0
- package/dist/src/session/stored-rows-to-file-entries.js +95 -0
- package/dist/src/session/stored-rows-to-file-entries.js.map +1 -0
- package/dist/src/session/transcript-events.d.ts +1 -2
- package/dist/src/session/transcript-events.js +5 -12
- package/dist/src/session/transcript-events.js.map +1 -1
- package/dist/src/session/transcript-format.d.ts +1 -1
- package/dist/src/session/transcript-format.js.map +1 -1
- package/dist/src/session/transcript-stats.d.ts +1 -0
- package/dist/src/session/transcript-stats.js +10 -0
- package/dist/src/session/transcript-stats.js.map +1 -0
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.js +3 -3
- package/dist/src/share/share-thumbnail.js +2 -2
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-share-store.js +3 -3
- package/dist/src/share/site-static-serve.js +1 -1
- package/dist/src/storage/sqlite/config-repository.d.ts +6 -0
- package/dist/src/storage/sqlite/config-repository.js +56 -0
- package/dist/src/storage/sqlite/config-repository.js.map +1 -0
- package/dist/src/storage/sqlite/connection.d.ts +38 -0
- package/dist/src/storage/sqlite/connection.js +258 -0
- package/dist/src/storage/sqlite/connection.js.map +1 -0
- package/dist/src/storage/sqlite/cron-run-repository.d.ts +5 -0
- package/dist/src/storage/sqlite/cron-run-repository.js +97 -0
- package/dist/src/storage/sqlite/cron-run-repository.js.map +1 -0
- package/dist/src/storage/sqlite/fts.d.ts +2 -0
- package/dist/src/storage/sqlite/fts.js +11 -0
- package/dist/src/storage/sqlite/fts.js.map +1 -0
- package/dist/src/storage/sqlite/index.d.ts +12 -0
- package/dist/src/storage/sqlite/index.js +13 -0
- package/dist/src/storage/sqlite/memory-index-repository.d.ts +18 -0
- package/dist/src/storage/sqlite/memory-index-repository.js +132 -0
- package/dist/src/storage/sqlite/memory-index-repository.js.map +1 -0
- package/dist/src/storage/sqlite/notes-repository.d.ts +11 -0
- package/dist/src/storage/sqlite/notes-repository.js +191 -0
- package/dist/src/storage/sqlite/notes-repository.js.map +1 -0
- package/dist/src/storage/sqlite/paths.d.ts +1 -0
- package/dist/src/storage/sqlite/paths.js +7 -0
- package/dist/src/storage/sqlite/paths.js.map +1 -0
- package/dist/src/storage/sqlite/row-mappers.d.ts +82 -0
- package/dist/src/storage/sqlite/row-mappers.js +164 -0
- package/dist/src/storage/sqlite/row-mappers.js.map +1 -0
- package/dist/src/storage/sqlite/schema.d.ts +5 -0
- package/dist/src/storage/sqlite/schema.js +43 -0
- package/dist/src/storage/sqlite/schema.js.map +1 -0
- package/dist/src/storage/sqlite/schema.sql +195 -0
- package/dist/src/storage/sqlite/session-metadata.d.ts +8 -0
- package/dist/src/storage/sqlite/session-metadata.js +83 -0
- package/dist/src/storage/sqlite/session-metadata.js.map +1 -0
- package/dist/src/storage/sqlite/session-repository.d.ts +29 -0
- package/dist/src/storage/sqlite/session-repository.js +268 -0
- package/dist/src/storage/sqlite/session-repository.js.map +1 -0
- package/dist/src/storage/sqlite/transaction.d.ts +11 -0
- package/dist/src/storage/sqlite/transaction.js +115 -0
- package/dist/src/storage/sqlite/transaction.js.map +1 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +34 -0
- package/dist/src/storage/sqlite/transcript-repository.js +241 -0
- package/dist/src/storage/sqlite/transcript-repository.js.map +1 -0
- package/dist/src/tui/clipboard-image.js +3 -3
- package/dist/src/tui/theme-manager.js +1 -1
- package/dist/src/tui/tui-keybindings-file.js +1 -1
- package/dist/src/tui/tui-scoped-models.js +2 -2
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/tunnel/frpc-binary.js +3 -3
- package/dist/src/tunnel/frpc-config.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +1 -1
- package/dist/src/tunnel/tunnel-state.js +1 -1
- package/dist/src/utils/logger/audit.js +1 -1
- package/dist/src/utils/logger/log-store.js +1 -1
- package/dist/src/utils/logger/rotation.js +1 -1
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/voice/tts/providers/edge-speech.js +2 -2
- package/dist/src/workflows/service/workflow-session-bridge.js +41 -64
- package/dist/src/workflows/service/workflow-session-bridge.js.map +1 -1
- package/dist/src/workflows/store/event-store.js +1 -1
- package/dist/src/workflows/store/run-store.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/index-Bj_l8QDp.css +0 -1
- package/dist/gateway/static/root/assets/notes-page-BApAirFB.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-4VmUTzQs.js +0 -3
- package/dist/gateway/static/root/assets/share-preview-page-IX0TJvRd.js +0 -2
- package/dist/gateway/static/root/assets/url-BHHmdJYc.js +0 -3
- package/dist/src/agent/embedded/session-manager-cache.d.ts +0 -19
- package/dist/src/agent/embedded/session-manager-cache.js +0 -48
- package/dist/src/agent/embedded/session-manager-cache.js.map +0 -1
- package/dist/src/session/parity/artifacts.d.ts +0 -16
- package/dist/src/session/parity/artifacts.js +0 -80
- package/dist/src/session/parity/artifacts.js.map +0 -1
- package/dist/src/session/parity/jsonl-transcript-io.d.ts +0 -54
- package/dist/src/session/parity/jsonl-transcript-io.js +0 -236
- package/dist/src/session/parity/jsonl-transcript-io.js.map +0 -1
- package/dist/src/session/parity/load-jsonl-entries.js.map +0 -1
- package/dist/src/session/parity/session-id.js +0 -18
- package/dist/src/session/parity/session-id.js.map +0 -1
- package/dist/src/session/parity/sessions-json-cache.d.ts +0 -14
- package/dist/src/session/parity/sessions-json-cache.js +0 -98
- package/dist/src/session/parity/sessions-json-cache.js.map +0 -1
- package/dist/src/session/parity/sessions-json-file-read.d.ts +0 -6
- package/dist/src/session/parity/sessions-json-file-read.js +0 -19
- package/dist/src/session/parity/sessions-json-file-read.js.map +0 -1
- package/dist/src/session/parity/sessions-json-file.d.ts +0 -11
- package/dist/src/session/parity/sessions-json-file.js +0 -52
- package/dist/src/session/parity/sessions-json-file.js.map +0 -1
- package/dist/src/session/parity/sessions-json-patch.d.ts +0 -14
- package/dist/src/session/parity/sessions-json-patch.js +0 -40
- package/dist/src/session/parity/sessions-json-patch.js.map +0 -1
- package/dist/src/session/parity/transcript-file-lock.d.ts +0 -22
- package/dist/src/session/parity/transcript-file-lock.js +0 -142
- package/dist/src/session/parity/transcript-file-lock.js.map +0 -1
- package/dist/src/session/parity/transcript-pagination.d.ts +0 -29
- package/dist/src/session/parity/transcript-pagination.js +0 -132
- package/dist/src/session/parity/transcript-pagination.js.map +0 -1
- package/dist/src/session/parity/transcript-paths.d.ts +0 -13
- package/dist/src/session/parity/transcript-paths.js +0 -64
- package/dist/src/session/parity/transcript-paths.js.map +0 -1
- package/dist/src/session/parity/xopc-session-disk-entry.d.ts +0 -22
- package/dist/src/session/search-index-cache.d.ts +0 -6
- package/dist/src/session/search-index-cache.js +0 -44
- package/dist/src/session/search-index-cache.js.map +0 -1
- package/dist/src/session/search-index.d.ts +0 -20
- package/dist/src/session/search-index.js +0 -124
- package/dist/src/session/search-index.js.map +0 -1
- /package/dist/src/{session/parity/xopc-session-disk-entry.js → cron/execution-types.js} +0 -0
- /package/dist/src/session/{parity/load-jsonl-entries.d.ts → load-jsonl-entries.d.ts} +0 -0
- /package/dist/src/session/{parity/session-id.d.ts → session-id.d.ts} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
2
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
4
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
5
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
5
|
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.js";
|
|
7
|
-
import {
|
|
6
|
+
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
8
7
|
import { mkdir, readFile, rm } from "fs/promises";
|
|
8
|
+
import { dirname, join } from "path";
|
|
9
9
|
//#region src/auth/credentials.ts
|
|
10
10
|
function getCredentialResolver(options) {
|
|
11
11
|
return new CredentialResolver(options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
-
import path from "node:path";
|
|
3
2
|
import { chmodSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
4
|
import { homedir } from "os";
|
|
5
5
|
//#region src/auth/profiles/store.ts
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
3
2
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
4
3
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
4
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
//#region src/auth/sync-provider-auth.ts
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
2
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
4
|
//#region src/browser/cache-dir-policy.ts
|
|
5
5
|
function expandHome(input) {
|
|
6
6
|
if (input === "~") return homedir();
|
|
@@ -2,10 +2,10 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { loadPlaywrightCoreModule } from "./providers/playwright-doctor.js";
|
|
4
4
|
import { pickFreePort } from "./free-port.js";
|
|
5
|
-
import { homedir, platform } from "node:os";
|
|
6
|
-
import { join } from "node:path";
|
|
7
5
|
import { existsSync } from "node:fs";
|
|
8
6
|
import { mkdir, rm } from "node:fs/promises";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { homedir, platform } from "node:os";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
10
|
//#region src/browser/cdp-local-launcher.ts
|
|
11
11
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../../package-version.js";
|
|
2
|
-
import {
|
|
2
|
+
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
3
3
|
import { createLogger } from "../../utils/logger/index.js";
|
|
4
4
|
import { init_logger } from "../../utils/logger.js";
|
|
5
5
|
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
6
|
-
import {
|
|
6
|
+
import { assertCacheDir, init_cache_dir_policy } from "../cache-dir-policy.js";
|
|
7
7
|
import { resolvePackageRoot } from "../../infra/update-check.js";
|
|
8
|
-
import { dirname, join } from "node:path";
|
|
9
8
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
10
9
|
import { readFile, readdir, rm } from "node:fs/promises";
|
|
11
|
-
import {
|
|
10
|
+
import { dirname, join } from "node:path";
|
|
12
11
|
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { spawn } from "node:child_process";
|
|
13
13
|
//#region src/browser/providers/browser-ext-install.ts
|
|
14
14
|
/**
|
|
15
15
|
* Install bundled Chrome extension artifacts into {resolveBinDir()}/browser-ext/.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { assertCacheDir, expandHome, init_cache_dir_policy } from "../cache-dir-policy.js";
|
|
2
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
2
|
import { init_logger } from "../../utils/logger.js";
|
|
4
3
|
import { init_paths, resolveBinDir } from "../../config/paths.js";
|
|
4
|
+
import { assertCacheDir, expandHome, init_cache_dir_policy } from "../cache-dir-policy.js";
|
|
5
5
|
import { loadPlaywrightCoreModule } from "./playwright-doctor.js";
|
|
6
6
|
import { WEBDRIVER_OVERRIDE_SCRIPT, buildStealthArgs, filterCloakBrowserExtraArgs, generateFingerprintSeed, makeExecutable, removeQuarantineAttr } from "../stealth.js";
|
|
7
7
|
import { pickFreePort } from "../free-port.js";
|
|
8
|
-
import { arch, platform, tmpdir } from "node:os";
|
|
9
|
-
import { join, resolve } from "node:path";
|
|
10
|
-
import { createReadStream, createWriteStream } from "node:fs";
|
|
11
8
|
import { createHash } from "node:crypto";
|
|
9
|
+
import { createReadStream, createWriteStream } from "node:fs";
|
|
12
10
|
import { mkdir, mkdtemp, rm, stat } from "node:fs/promises";
|
|
11
|
+
import { join, resolve } from "node:path";
|
|
12
|
+
import { arch, platform, tmpdir } from "node:os";
|
|
13
13
|
import { spawn } from "node:child_process";
|
|
14
14
|
import { Readable, Transform } from "node:stream";
|
|
15
15
|
import AdmZip from "adm-zip";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
2
|
import { existsSync } from "node:fs";
|
|
4
3
|
import { stat } from "node:fs/promises";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
//#region src/browser/providers/playwright-doctor.ts
|
|
7
7
|
/** Root directory of the `playwright-core` package (Electron extraResources or node_modules). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { platform } from "node:os";
|
|
4
3
|
import { chmod, stat } from "node:fs/promises";
|
|
4
|
+
import { platform } from "node:os";
|
|
5
5
|
import { exec } from "node:child_process";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
//#region src/browser/stealth.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 { join, resolve } from "path";
|
|
4
3
|
import { mkdir, writeFile } from "fs/promises";
|
|
4
|
+
import { join, resolve } from "path";
|
|
5
5
|
import { randomBytes } from "crypto";
|
|
6
6
|
//#region src/channels/attachments/inbound-persist.ts
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { join, resolve } from "path";
|
|
4
3
|
import { mkdir, writeFile } from "fs/promises";
|
|
4
|
+
import { join, resolve } from "path";
|
|
5
5
|
import { randomBytes } from "crypto";
|
|
6
6
|
//#region src/channels/attachments/outbound-tts-persist.ts
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init_write_file_atomic, writeTextAtomicSync } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import { join } from "path";
|
|
3
4
|
import { existsSync, mkdirSync, readFileSync } from "fs";
|
|
4
|
-
import { randomUUID } from "node:crypto";
|
|
5
5
|
//#region src/channels/outbound/persist-store.ts
|
|
6
6
|
/**
|
|
7
7
|
* Durable outbound queue (crash recovery): JSON file under agent internal dir.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { appendAllowFromIdSync } from "./allow-from-file.js";
|
|
2
2
|
import "./pairing-constants.js";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import fs from "node:fs";
|
|
5
3
|
import crypto from "node:crypto";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
6
|
//#region src/channels/pairing/pairing-store.ts
|
|
7
7
|
const PAIRING_CODE_LENGTH = 8;
|
|
8
8
|
const PAIRING_CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { init_agent_scope, normalizeAgentId, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
2
|
-
import { init_agent_session_key, resolveAgentIdFromSessionKey } from "../routing/agent-session-key.js";
|
|
3
2
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
3
|
+
import { init_agent_session_key, resolveAgentIdFromSessionKey } from "../routing/agent-session-key.js";
|
|
4
4
|
import { commandRegistry } from "./registry.js";
|
|
5
|
-
import { join } from "node:path";
|
|
6
5
|
import { readFile } from "node:fs/promises";
|
|
6
|
+
import { join } from "node:path";
|
|
7
7
|
//#region src/chat-commands/agent-edit.ts
|
|
8
8
|
/**
|
|
9
9
|
* /agent-edit — open the current chat as an agent profile editing session.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
2
|
-
import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
3
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
4
2
|
import { init_logger } from "../../utils/logger.js";
|
|
5
3
|
import { init_paths, resolveConfigPath } from "../../config/paths.js";
|
|
4
|
+
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
6
5
|
import { init_loader, loadConfig, saveConfig } from "../../config/loader.js";
|
|
6
|
+
import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
7
7
|
import { commandRegistry } from "../registry.js";
|
|
8
8
|
import { resolveAllowlistMatchSimple } from "../../channels/security.js";
|
|
9
9
|
import { parseConfigValue } from "../config-value.js";
|
|
@@ -4,8 +4,8 @@ import { init_loader, saveConfig } from "../config/loader.js";
|
|
|
4
4
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
5
5
|
import { getRoutingInfo, getSessionDisplayName } from "./session-key.js";
|
|
6
6
|
import { wrapMarkdownExportAsHtml } from "../session/chat-export.js";
|
|
7
|
-
import { join } from "path";
|
|
8
7
|
import { mkdir, writeFile } from "fs/promises";
|
|
8
|
+
import { join } from "path";
|
|
9
9
|
//#region src/chat-commands/context.ts
|
|
10
10
|
init_logger();
|
|
11
11
|
init_loader();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
2
1
|
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
2
|
+
import { ConfigSchema, init_schema } from "../../config/schema.js";
|
|
3
3
|
import { resolveGatewayLocalClientHost } from "../../config/gateway-bind.js";
|
|
4
4
|
import { formatExamples, register } from "../registry.js";
|
|
5
5
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
2
2
|
import { init_loader, loadConfig, saveConfig } from "../../../../config/loader.js";
|
|
3
|
-
import { dirname } from "node:path";
|
|
4
3
|
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
4
|
+
import { dirname } from "node:path";
|
|
5
5
|
//#region src/cli/commands/doctor/checks/config-health.ts
|
|
6
6
|
init_loader();
|
|
7
7
|
init_schema();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "../../../../providers/env-keys.js";
|
|
1
2
|
import { getAgentDefaultModelRef, init_schema, parseModelRef } from "../../../../config/schema.js";
|
|
2
3
|
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,42 +1,11 @@
|
|
|
1
|
-
import { init_agent_scope, listAgentEntries, resolveDefaultAgentId } from "../../../../agent/agent-scope.js";
|
|
2
|
-
import { init_session_key, parseSessionKey } from "../../../../routing/session-key.js";
|
|
3
|
-
import { init_transcript_paths, resolveSessionFilePath } from "../../../../session/parity/transcript-paths.js";
|
|
4
|
-
import { FILENAMES, init_paths, resolveSessionsDir } from "../../../../config/paths.js";
|
|
5
1
|
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { requireXopcDatabase } from "../../../../storage/sqlite/connection.js";
|
|
3
|
+
import { getSqliteDatabase } from "../../../../storage/sqlite/transaction.js";
|
|
4
|
+
import { getCurrentTranscriptId, listSessionMetadata } from "../../../../storage/sqlite/session-repository.js";
|
|
5
|
+
import "../../../../storage/sqlite/index.js";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
8
7
|
//#region src/cli/commands/doctor/checks/session-integrity.ts
|
|
9
|
-
init_agent_scope();
|
|
10
8
|
init_loader();
|
|
11
|
-
init_paths();
|
|
12
|
-
init_session_key();
|
|
13
|
-
init_transcript_paths();
|
|
14
|
-
function discoverSessionMapLocations(config, stateDir) {
|
|
15
|
-
const agentIds = new Set([resolveDefaultAgentId(config), ...listAgentEntries(config).map((agent) => agent.id)]);
|
|
16
|
-
const agentsRoot = join(stateDir, "agents");
|
|
17
|
-
if (existsSync(agentsRoot)) {
|
|
18
|
-
for (const entry of readdirSync(agentsRoot, { withFileTypes: true })) if (entry.isDirectory()) agentIds.add(entry.name);
|
|
19
|
-
}
|
|
20
|
-
const seenMapPaths = /* @__PURE__ */ new Set();
|
|
21
|
-
const locations = [];
|
|
22
|
-
for (const agentId of agentIds) {
|
|
23
|
-
const sessionsDir = resolveSessionsDir(config, agentId);
|
|
24
|
-
const mapPath = join(sessionsDir, FILENAMES.SESSIONS_MAP);
|
|
25
|
-
if (seenMapPaths.has(mapPath)) continue;
|
|
26
|
-
seenMapPaths.add(mapPath);
|
|
27
|
-
locations.push({
|
|
28
|
-
agentId,
|
|
29
|
-
sessionsDir,
|
|
30
|
-
mapPath
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return locations;
|
|
34
|
-
}
|
|
35
|
-
function readSessionMap(mapPath) {
|
|
36
|
-
const parsed = JSON.parse(readFileSync(mapPath, "utf-8"));
|
|
37
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("invalid sessions map");
|
|
38
|
-
return parsed;
|
|
39
|
-
}
|
|
40
9
|
async function checkSessionIntegrity(ctx) {
|
|
41
10
|
if (!ctx.options.deep) return {
|
|
42
11
|
id: "session-integrity",
|
|
@@ -52,81 +21,49 @@ async function checkSessionIntegrity(ctx) {
|
|
|
52
21
|
message: "No config file; skipped.",
|
|
53
22
|
hints: []
|
|
54
23
|
};
|
|
55
|
-
let config;
|
|
56
24
|
try {
|
|
57
|
-
|
|
25
|
+
loadConfig(ctx.configPath);
|
|
58
26
|
} catch {
|
|
59
27
|
return {
|
|
60
28
|
id: "session-integrity",
|
|
61
29
|
label: "Sessions",
|
|
62
|
-
status: "
|
|
63
|
-
message: "Config
|
|
64
|
-
hints: []
|
|
30
|
+
status: "warn",
|
|
31
|
+
message: "Config invalid; session scan skipped.",
|
|
32
|
+
hints: ["Fix xopc.json before running session integrity checks."]
|
|
65
33
|
};
|
|
66
34
|
}
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!
|
|
76
|
-
|
|
77
|
-
missingMaps.push(location.mapPath);
|
|
35
|
+
requireXopcDatabase();
|
|
36
|
+
const issues = [];
|
|
37
|
+
const db = getSqliteDatabase();
|
|
38
|
+
const integrityFailures = db.prepare("PRAGMA integrity_check").all().map((row) => row.integrity_check).filter((value) => value !== "ok");
|
|
39
|
+
for (const failure of integrityFailures) issues.push(`database integrity: ${failure}`);
|
|
40
|
+
const { items } = listSessionMetadata({ limit: 1e5 });
|
|
41
|
+
for (const session of items) {
|
|
42
|
+
const transcriptId = getCurrentTranscriptId(session.key);
|
|
43
|
+
if (!transcriptId) {
|
|
44
|
+
issues.push(`missing transcript for ${session.key}`);
|
|
78
45
|
continue;
|
|
79
46
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
map = readSessionMap(location.mapPath);
|
|
83
|
-
} catch {
|
|
84
|
-
invalidMaps.push(location.mapPath);
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
const referencedTranscriptFiles = /* @__PURE__ */ new Set();
|
|
88
|
-
for (const [sessionKey, entry] of Object.entries(map)) {
|
|
89
|
-
sessionCount++;
|
|
90
|
-
const parsed = parseSessionKey(sessionKey);
|
|
91
|
-
if (parsed && parsed.agentId !== location.agentId) agentMismatches.push(`${sessionKey} in agent ${location.agentId}`);
|
|
92
|
-
if (!entry?.sessionId) {
|
|
93
|
-
missingTranscripts.push(sessionKey);
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
try {
|
|
97
|
-
const transcriptPath = resolveSessionFilePath(entry.sessionId, entry, { sessionsDir: location.sessionsDir });
|
|
98
|
-
referencedTranscriptFiles.add(basename(transcriptPath));
|
|
99
|
-
if (!existsSync(transcriptPath)) missingTranscripts.push(sessionKey);
|
|
100
|
-
} catch {
|
|
101
|
-
missingTranscripts.push(sessionKey);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
for (const file of readdirSync(location.sessionsDir, { withFileTypes: true })) {
|
|
105
|
-
if (!file.isFile() || !file.name.endsWith(".jsonl") || file.name.includes(".checkpoint.")) continue;
|
|
106
|
-
if (!referencedTranscriptFiles.has(file.name)) orphanTranscripts.push(join(location.sessionsDir, file.name));
|
|
107
|
-
}
|
|
47
|
+
if (transcriptId !== session.transcriptId) issues.push(`transcript id mismatch for ${session.key}`);
|
|
48
|
+
if (!db.prepare(`SELECT transcript_id FROM transcripts WHERE transcript_id = ? AND status = 'active'`).get(transcriptId)?.transcript_id) issues.push(`active transcript row missing for ${session.key}`);
|
|
108
49
|
}
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
...orphanTranscripts.slice(0, 3).map((path) => `Orphan transcript: ${path}`)
|
|
115
|
-
];
|
|
116
|
-
const warningCount = missingMaps.length + invalidMaps.length + missingTranscripts.length + agentMismatches.length + orphanTranscripts.length;
|
|
117
|
-
if (warningCount > 0) return {
|
|
50
|
+
const orphanTranscripts = db.prepare(`SELECT t.transcript_id FROM transcripts t
|
|
51
|
+
LEFT JOIN sessions s ON s.current_transcript_id = t.transcript_id
|
|
52
|
+
WHERE t.status = 'active' AND s.session_key IS NULL`).all();
|
|
53
|
+
for (const row of orphanTranscripts) issues.push(`orphan active transcript ${row.transcript_id}`);
|
|
54
|
+
if (issues.length === 0) return {
|
|
118
55
|
id: "session-integrity",
|
|
119
56
|
label: "Sessions",
|
|
120
|
-
status: "
|
|
121
|
-
message: `
|
|
122
|
-
hints
|
|
57
|
+
status: "pass",
|
|
58
|
+
message: `SQLite session store OK (${items.length} session(s)).`,
|
|
59
|
+
hints: []
|
|
123
60
|
};
|
|
124
61
|
return {
|
|
125
62
|
id: "session-integrity",
|
|
126
63
|
label: "Sessions",
|
|
127
|
-
status: "
|
|
128
|
-
message:
|
|
129
|
-
hints:
|
|
64
|
+
status: "warn",
|
|
65
|
+
message: `${issues.length} session integrity issue(s).`,
|
|
66
|
+
hints: issues.slice(0, 8)
|
|
130
67
|
};
|
|
131
68
|
}
|
|
132
69
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-integrity.js","names":[],"sources":["../../../../../../src/cli/commands/doctor/checks/session-integrity.ts"],"sourcesContent":["import { existsSync
|
|
1
|
+
{"version":3,"file":"session-integrity.js","names":[],"sources":["../../../../../../src/cli/commands/doctor/checks/session-integrity.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\n\nimport { loadConfig } from '../../../../config/loader.js';\nimport {\n getCurrentTranscriptId,\n getSqliteDatabase,\n requireXopcDatabase,\n listSessionMetadata,\n} from '../../../../storage/sqlite/index.js';\nimport type { CheckResult, DoctorContext } from '../types.js';\n\nexport async function checkSessionIntegrity(ctx: DoctorContext): Promise<CheckResult> {\n if (!ctx.options.deep) {\n return {\n id: 'session-integrity',\n label: 'Sessions',\n status: 'skip',\n message: 'Deep mode off; session scan skipped.',\n hints: ['Run: xopc doctor --deep'],\n };\n }\n\n if (!existsSync(ctx.configPath)) {\n return {\n id: 'session-integrity',\n label: 'Sessions',\n status: 'skip',\n message: 'No config file; skipped.',\n hints: [],\n };\n }\n\n try {\n loadConfig(ctx.configPath);\n } catch {\n return {\n id: 'session-integrity',\n label: 'Sessions',\n status: 'warn',\n message: 'Config invalid; session scan skipped.',\n hints: ['Fix xopc.json before running session integrity checks.'],\n };\n }\n\n requireXopcDatabase();\n\n const issues: string[] = [];\n const db = getSqliteDatabase();\n\n const integrity = db.prepare('PRAGMA integrity_check').all() as Array<{ integrity_check: string }>;\n const integrityFailures = integrity\n .map((row) => row.integrity_check)\n .filter((value) => value !== 'ok');\n for (const failure of integrityFailures) {\n issues.push(`database integrity: ${failure}`);\n }\n\n const { items } = listSessionMetadata({ limit: 100_000 });\n\n for (const session of items) {\n const transcriptId = getCurrentTranscriptId(session.key);\n if (!transcriptId) {\n issues.push(`missing transcript for ${session.key}`);\n continue;\n }\n if (transcriptId !== session.transcriptId) {\n issues.push(`transcript id mismatch for ${session.key}`);\n }\n const transcript = db\n .prepare(`SELECT transcript_id FROM transcripts WHERE transcript_id = ? AND status = 'active'`)\n .get(transcriptId) as { transcript_id?: string } | undefined;\n if (!transcript?.transcript_id) {\n issues.push(`active transcript row missing for ${session.key}`);\n }\n }\n\n const orphanTranscripts = db\n .prepare(\n `SELECT t.transcript_id FROM transcripts t\n LEFT JOIN sessions s ON s.current_transcript_id = t.transcript_id\n WHERE t.status = 'active' AND s.session_key IS NULL`,\n )\n .all() as Array<{ transcript_id: string }>;\n for (const row of orphanTranscripts) {\n issues.push(`orphan active transcript ${row.transcript_id}`);\n }\n\n if (issues.length === 0) {\n return {\n id: 'session-integrity',\n label: 'Sessions',\n status: 'pass',\n message: `SQLite session store OK (${items.length} session(s)).`,\n hints: [],\n };\n }\n\n return {\n id: 'session-integrity',\n label: 'Sessions',\n status: 'warn',\n message: `${issues.length} session integrity issue(s).`,\n hints: issues.slice(0, 8),\n };\n}\n"],"mappings":";;;;;;;aAE0D;AAS1D,eAAsB,sBAAsB,KAA0C;AACpF,KAAI,CAAC,IAAI,QAAQ,KACf,QAAO;EACL,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,SAAS;EACT,OAAO,CAAC,0BAA0B;EACnC;AAGH,KAAI,CAAC,WAAW,IAAI,WAAW,CAC7B,QAAO;EACL,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,SAAS;EACT,OAAO,EAAE;EACV;AAGH,KAAI;AACF,aAAW,IAAI,WAAW;SACpB;AACN,SAAO;GACL,IAAI;GACJ,OAAO;GACP,QAAQ;GACR,SAAS;GACT,OAAO,CAAC,yDAAyD;GAClE;;AAGH,sBAAqB;CAErB,MAAM,SAAmB,EAAE;CAC3B,MAAM,KAAK,mBAAmB;CAG9B,MAAM,oBADY,GAAG,QAAQ,yBAAyB,CAAC,KACpB,CAChC,KAAK,QAAQ,IAAI,gBAAgB,CACjC,QAAQ,UAAU,UAAU,KAAK;AACpC,MAAK,MAAM,WAAW,kBACpB,QAAO,KAAK,uBAAuB,UAAU;CAG/C,MAAM,EAAE,UAAU,oBAAoB,EAAE,OAAO,KAAS,CAAC;AAEzD,MAAK,MAAM,WAAW,OAAO;EAC3B,MAAM,eAAe,uBAAuB,QAAQ,IAAI;AACxD,MAAI,CAAC,cAAc;AACjB,UAAO,KAAK,0BAA0B,QAAQ,MAAM;AACpD;;AAEF,MAAI,iBAAiB,QAAQ,aAC3B,QAAO,KAAK,8BAA8B,QAAQ,MAAM;AAK1D,MAAI,CAHe,GAChB,QAAQ,sFAAsF,CAC9F,IAAI,aACQ,EAAE,cACf,QAAO,KAAK,qCAAqC,QAAQ,MAAM;;CAInE,MAAM,oBAAoB,GACvB,QACC;;4DAGD,CACA,KAAK;AACR,MAAK,MAAM,OAAO,kBAChB,QAAO,KAAK,4BAA4B,IAAI,gBAAgB;AAG9D,KAAI,OAAO,WAAW,EACpB,QAAO;EACL,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,SAAS,4BAA4B,MAAM,OAAO;EAClD,OAAO,EAAE;EACV;AAGH,QAAO;EACL,IAAI;EACJ,OAAO;EACP,QAAQ;EACR,SAAS,GAAG,OAAO,OAAO;EAC1B,OAAO,OAAO,MAAM,GAAG,EAAE;EAC1B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../../../agent/agent-scope.js";
|
|
2
2
|
import { WORKSPACE_FILES, init_paths } from "../../../../config/paths.js";
|
|
3
3
|
import { init_loader, loadConfig } from "../../../../config/loader.js";
|
|
4
|
-
import { join } from "node:path";
|
|
5
4
|
import { existsSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
6
|
//#region src/cli/commands/doctor/checks/workspace-status.ts
|
|
7
7
|
init_agent_scope();
|
|
8
8
|
init_loader();
|
|
@@ -12,8 +12,8 @@ import { runGatewayLoop } from "../../gateway/run-loop.js";
|
|
|
12
12
|
import "../../gateway/index.js";
|
|
13
13
|
import { colors } from "../utils/colors.js";
|
|
14
14
|
import { initWorkspace } from "../utils/init-workspace.js";
|
|
15
|
-
import { join, resolve } from "node:path";
|
|
16
15
|
import { existsSync, mkdirSync, readFileSync, symlinkSync, unlinkSync, watch } from "node:fs";
|
|
16
|
+
import { join, resolve } from "node:path";
|
|
17
17
|
import { Command } from "commander";
|
|
18
18
|
//#region src/cli/commands/extension-dev.ts
|
|
19
19
|
init_loader();
|
|
@@ -7,8 +7,8 @@ import { installExtensionFromStoreZip, installFromLocal, installFromNpm, peekExt
|
|
|
7
7
|
import { fetchRegistry, findExtension, getExtensionMarketplaceStoreBaseUrl, listExtensions, searchExtensions } from "../../extensions/marketplace.js";
|
|
8
8
|
import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl } from "../../agent/skills/marketplace/adapters/store/store-api-client.js";
|
|
9
9
|
import { colors } from "../utils/colors.js";
|
|
10
|
-
import { join, resolve } from "node:path";
|
|
11
10
|
import { existsSync, readFileSync, rmSync, statSync } from "node:fs";
|
|
11
|
+
import { join, resolve } from "node:path";
|
|
12
12
|
import { execSync } from "node:child_process";
|
|
13
13
|
import { Command } from "commander";
|
|
14
14
|
import semver from "semver";
|
|
@@ -4,8 +4,8 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
4
4
|
import { normalizeExtensionManifest } from "../../extensions/normalize-manifest.js";
|
|
5
5
|
import { checkEngineCompatibility } from "../../extensions/engine-check.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
|
-
import { isAbsolute, join, resolve } from "node:path";
|
|
8
7
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync } from "node:fs";
|
|
8
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
import { Command } from "commander";
|
|
11
11
|
//#region src/cli/commands/extension-pack.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getContextWithOpts } from "../../context.js";
|
|
2
|
-
import path from "node:path";
|
|
3
2
|
import { existsSync, statSync, watch } from "node:fs";
|
|
4
3
|
import { readFile } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
//#region src/cli/commands/gateway/logs.ts
|
|
7
7
|
function parseLineCount(value) {
|
|
@@ -8,8 +8,8 @@ import { formatExamples, register } from "../registry.js";
|
|
|
8
8
|
import { getContextWithOpts } from "../context.js";
|
|
9
9
|
import "../../agent/image/index.js";
|
|
10
10
|
import { colors } from "../utils/colors.js";
|
|
11
|
-
import { join, resolve } from "node:path";
|
|
12
11
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
12
|
+
import { join, resolve } from "node:path";
|
|
13
13
|
import { Command } from "commander";
|
|
14
14
|
//#region src/cli/commands/image.ts
|
|
15
15
|
init_loader();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { resolveAgentWorkspaceDir } from "../../agent/agent-scope.js";
|
|
1
|
+
import { init_write_file_atomic, writeTextAtomic } from "../../infra/write-file-atomic.js";
|
|
3
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
4
3
|
import { init_logger } from "../../utils/logger.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { resolveStateDir } from "../../config/paths-state.js";
|
|
5
|
+
import { resolveAgentWorkspaceDir } from "../../agent/agent-scope.js";
|
|
6
|
+
import { WORKSPACE_FILES, init_paths, resolveAgentDir, resolveAgentHomeDir, resolveAgentMetadataPath, resolveAgentProfileDir, resolveBinDir, resolveConfigPath, resolveCredentialsDir, resolveCronDir, resolveExtensionsDir, resolveInboxDir, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogsDir, resolveSkillsDir, resolveToolsDir, resolveWorkspaceStateDir, resolveWorkspaceStatePath } from "../../config/paths.js";
|
|
7
7
|
import { init_loader, loadConfig, saveConfig } from "../../config/loader.js";
|
|
8
8
|
import { formatExamples, register } from "../registry.js";
|
|
9
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
9
10
|
import { join } from "path";
|
|
10
11
|
import { existsSync } from "fs";
|
|
11
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
12
12
|
import { Command } from "commander";
|
|
13
13
|
//#region src/cli/commands/init.ts
|
|
14
14
|
init_write_file_atomic();
|
|
@@ -47,8 +47,6 @@ async function initCommand(options = {}) {
|
|
|
47
47
|
const cfg = loadConfig(configPath);
|
|
48
48
|
await mkdir(resolveAgentHomeDir(cfg, agentId), { recursive: true });
|
|
49
49
|
await mkdir(resolveAgentProfileDir(cfg, agentId), { recursive: true });
|
|
50
|
-
await mkdir(resolveSessionsDir(cfg, agentId), { recursive: true });
|
|
51
|
-
await mkdir(join(resolveSessionsDir(cfg, agentId), "archive"), { recursive: true });
|
|
52
50
|
await mkdir(resolveAgentDir(cfg, agentId), { recursive: true });
|
|
53
51
|
await mkdir(join(resolveAgentDir(cfg, agentId), "credentials"), { recursive: true });
|
|
54
52
|
const wsRoot = resolveAgentWorkspaceDir(cfg, agentId);
|