@xopcai/xopc 0.0.246 → 0.0.248
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/src/update-offset-store.js +17 -54
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/auth/accounts.js +3 -5
- package/dist/extensions/weixin/src/monitor/monitor.js +3 -5
- package/dist/extensions/weixin/src/storage/sync-buf.d.ts +3 -6
- package/dist/extensions/weixin/src/storage/sync-buf.js +9 -22
- package/dist/gateway/static/root/assets/{activity-store-BlxqErph.js → activity-store-etpmyV7S.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CJJzpYYS.js → agent-avatar-dicebear-BmKxSM1k.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CUXApfcE.js +1 -0
- package/dist/gateway/static/root/assets/{agents-je3sRGmk.js → agents-DNq_GKuc.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BbXzyQMj.js → api-B0-hLuZ1.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Cnn3i00c.js → app-management-settings-panel-qfwAgyhQ.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BToQaw_v.js → appearance-settings-DqQVUpCC.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-dwIqYmXk.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DD2SweEH.js → archive-plugin-BnMSgZvR.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BFtcib5t.js → attachment-load-CejsQMev.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-XS8wIl5o.js → automations-page-RC8EyoAf.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-SkdcSZ0i.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Xs7pLHxR.js → binary-plugins-DGjppLSG.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BPdSzceB.js → block-editor-CWdP4bUc.js} +44 -44
- package/dist/gateway/static/root/assets/browser-settings-page-CKCa6TvG.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BAAc151l.js → browser-workflow-inputs-BQ1Ilw_o.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DUPPvE30.js → browser-workflows-page-CJh4NyxT.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-cl9kYilL.js → capabilities-settings-panel-DSp--zIZ.js} +5 -5
- package/dist/gateway/static/root/assets/channels-settings-CMd2dDrI.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-CCBCtLDg.js → channels-status-swr-Ohhee4vm.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DKW1M6aJ.js → chat-terminal-dock-BOtoKTK3.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-udWs5Kdm.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-Bijb0ZQu.js → cron-expression-DTj1V3Sw.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BZuHw-SY.js → date-picker-Yr6OCvGL.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BsBD2JFY.js → dependency-picker-DpN3XZg9.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Ceuw3QKb.js → desktop-pet-DbGzggPF.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DctOXexM.js → desktop-pet-settings-DinCToZh.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BNlMPATK.js → extension-debug-page-DgTtk4KC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CK4Uvzge.js → extension-page-DtQeiP6f.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CpnXXemw.js → extension-settings-page-DcguCgsH.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C_mlpe-r.js → gateway-config-api-Br7lSf6H.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-826dipyU.js → gateway-config-swr-DXuXtU1w.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DSSW17ed.js → gateway-settings-CdPoDMuj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DyvcAIMm.js → gateway-startup-retry-CzBzglzQ.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-hbmIZTpg.js → heartbeat-settings-DHk1hawP.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-YGipe_W6.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D7cyfks6.js → image-generation-api-TIgsn04n.js} +1 -1
- package/dist/gateway/static/root/assets/{index-eZjksPvq.js → index-D5TQQpeb.js} +44 -44
- package/dist/gateway/static/root/assets/index-DReBaaTX.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BQrDwwgi.js → keyboard-shortcuts-settings-wsWuoa8p.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CpyvYyrb.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-D-YWD6LS.js → local-apps-page-CXrbrGo8.js} +1 -1
- package/dist/gateway/static/root/assets/local-context-graph-BjUf7fQ9.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-CBoCuIMx.js → locale-store-BJFLQY8O.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DvLc9l59.js → logs-page-CXKy6E_l.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-DsULLUUv.js → management-settings-BdJZFR7U.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CjqlP6IB.js → markdown-split-NK3ACVG2.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BXsHghJd.js → markdown-view-DTF9v1gg.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DQL029DU.js → media-plugins-F0jcUxyl.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CHNYp8EQ.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-gauprAae.js → mobile-pairing-wizard-3NKCniSp.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-nCfkBN8M.js +1 -0
- package/dist/gateway/static/root/assets/{notes-page-AsEfLZt9.js → notes-page-DuqLahi6.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-C7j9EdQk.js +5 -0
- package/dist/gateway/static/root/assets/{oauth-api-BjSUDIgq.js → oauth-api-8lP_qJpq.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CAJeUXeU.js → product-open-page-CxGGlWA8.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CfebYVX0.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-48GvzSVa.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BhGKnvLP.js → registry-api-CIsNlSBi.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-64xj_s2m.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DH6EilMV.js → runtime-tools-settings-panel-YkjhiQfA.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DYHmEZeZ.js → schema-form-oFGf3G3s.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CcwcdRN8.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BaN84CyW.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-BHwPd_M3.js → settings-page-C7VWs0IT.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DVVOCNbr.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BjwrS03F.js → share-preview-page-t5oz18rh.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DUYbYLi7.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BGyD0gB9.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-OHyK25op.js → skills-page-CjF8DTsN.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DQx9ulmg.js → skills-page.utils-DEDTYs2W.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-wO7DWv4C.js → system-settings-panel-BSYuRgFI.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-YZYSTJH7.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-hybK3oC9.js → theme-store-O597U8q_.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CVC8BHZu.js → tunnel-api-FKUi9wDL.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DMvRu2XZ.js → use-autosave-B5eUJ6Zq.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BCyiduKd.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DuBK2NDG.js → voice-api-key-field-CMKSwz4C.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CBbiF1T3.js → voice-config-api-q7B6fOFB.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B7VXWpDr.js → work-discovery-overlay-jhT2EzeH.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BokVAsWN.js → workflow-run-setup-panel-DZmvLZjb.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DQC0TpMa.js +5 -0
- package/dist/gateway/static/root/index.html +12 -12
- package/dist/package.js +1 -1
- package/dist/src/agent/commands/command-registry.d.ts +1 -0
- package/dist/src/agent/commands/command-registry.js +12 -22
- package/dist/src/agent/ipc/inbox.d.ts +8 -31
- package/dist/src/agent/ipc/inbox.js +64 -133
- package/dist/src/agent/service/process-direct-one-shot.js +15 -10
- package/dist/src/agent/workflow/catalog.d.ts +1 -8
- package/dist/src/agent/workflow/catalog.js +44 -102
- package/dist/src/agent/workflow/index.d.ts +1 -1
- package/dist/src/agent/workflow/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +1 -0
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/channels/manager.d.ts +1 -1
- package/dist/src/channels/manager.js +2 -2
- package/dist/src/channels/outbound/persist-store.d.ts +2 -8
- package/dist/src/channels/outbound/persist-store.js +11 -38
- package/dist/src/channels/outbound-sender.d.ts +1 -1
- package/dist/src/channels/outbound-sender.js +2 -2
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/schema.js +2 -2
- package/dist/src/connectors/auth-provider-registry.js +1 -1
- package/dist/src/connectors/composio-triggers.d.ts +2 -2
- package/dist/src/connectors/composio-triggers.js +8 -15
- package/dist/src/connectors/connected-source-ingestion.js +1 -1
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/gateway/automation-agent-session.js +3 -0
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/extension-store.js +8 -25
- package/dist/src/gateway/hono/routes/capabilities.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +3 -3
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/you.js +20 -4
- package/dist/src/gateway/service.js +4 -5
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/notes/index.d.ts +1 -1
- package/dist/src/notes/index.js +2 -2
- package/dist/src/notes/paths.d.ts +0 -3
- package/dist/src/notes/paths.js +1 -10
- package/dist/src/notes/service.d.ts +0 -1
- package/dist/src/notes/service.js +0 -3
- package/dist/src/notes/store.d.ts +0 -2
- package/dist/src/notes/store.js +33 -80
- package/dist/src/share/hosted-session-share.d.ts +1 -4
- package/dist/src/share/hosted-session-share.js +14 -47
- package/dist/src/share/share-auto.d.ts +1 -1
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.d.ts +2 -7
- package/dist/src/share/share-store.js +153 -195
- package/dist/src/share/share-types.d.ts +0 -4
- package/dist/src/share/site-share-store.d.ts +3 -8
- package/dist/src/share/site-share-store.js +94 -153
- package/dist/src/share/site-share-types.d.ts +0 -4
- package/dist/src/storage/sqlite/connection.d.ts +1 -2
- package/dist/src/storage/sqlite/connection.js +50 -47
- package/dist/src/storage/sqlite/durable-queue.d.ts +16 -0
- package/dist/src/storage/sqlite/durable-queue.js +52 -0
- package/dist/src/storage/sqlite/durable-state.d.ts +16 -0
- package/dist/src/storage/sqlite/durable-state.js +43 -0
- package/dist/src/storage/sqlite/migrations/146_understanding_focus_exclusions.sql +9 -0
- package/dist/src/storage/sqlite/migrations/147_durable_application_state.sql +39 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/understanding-focus-exclusions.d.ts +2 -0
- package/dist/src/storage/sqlite/understanding-focus-exclusions.js +24 -0
- package/dist/src/tui/tui-scoped-models.js +9 -6
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/voice/dashscope/streaming-tts-stream.js +49 -0
- package/dist/src/voice/realtime/agentEngine.js +63 -18
- package/dist/src/voice/realtime/conversationTurn.d.ts +20 -0
- package/dist/src/voice/realtime/conversationTurn.js +83 -0
- package/dist/src/voice/realtime/omniEngine.js +72 -18
- package/dist/src/workflows/authoring/workflow-draft-store.d.ts +1 -5
- package/dist/src/workflows/authoring/workflow-draft-store.js +23 -43
- package/dist/src/workflows/index.js +2 -2
- package/dist/src/workflows/store/event-store.d.ts +1 -2
- package/dist/src/workflows/store/event-store.js +19 -64
- package/dist/src/workflows/store/paths.d.ts +0 -2
- package/dist/src/workflows/store/paths.js +1 -7
- package/dist/src/workflows/store/run-store.d.ts +0 -1
- package/dist/src/workflows/store/run-store.js +1 -24
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-0dRjnL2s.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-EpUZsl4h.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BGQdHrip.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DJGcm7rH.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-BcIr-_GM.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DNHqaZfX.js +0 -2
- package/dist/gateway/static/root/assets/home-page-CaVvW77l.js +0 -1
- package/dist/gateway/static/root/assets/index-Dbh5SXyV.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-D3K1XmOM.js +0 -2
- package/dist/gateway/static/root/assets/messages-BbdwoxVo.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-88f4fzYS.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-CI30cDh3.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-jO_4I5zN.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BrTGFME0.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CH70D5SH.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-hbfUNtNs.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Vg3_jua6.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DkcpWSss.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BL4DEt6p.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CafhNktn.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-anyomXsu.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-BBk9YdBn.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-RUTv0yvR.js +0 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { canonicalizeConfiguredMcpServer, normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
2
2
|
import { loadMergedBundleMcpConfig } from "../../../agent/mcp/bundle-mcp-config.js";
|
|
3
|
-
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
4
3
|
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
5
4
|
import { getMcpOAuthManager } from "../../../agent/mcp/oauth/mcp-oauth-manager.js";
|
|
5
|
+
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
6
6
|
import { listBundleMcpServerCapabilitiesForGateway, listBundleMcpServerToolsForGateway } from "../../../agent/mcp/bundle-mcp-gateway.js";
|
|
7
7
|
//#region src/gateway/hono/routes/mcp.ts
|
|
8
8
|
function registerMcpRoutes(authenticated, deps) {
|
|
@@ -34,7 +34,7 @@ function parseLimit(raw, fallback = 50) {
|
|
|
34
34
|
return Number.isFinite(n) ? Math.min(500, Math.max(1, n)) : fallback;
|
|
35
35
|
}
|
|
36
36
|
function isHiddenEmptyProjectChatShell(session) {
|
|
37
|
-
return session.hiddenFromSessionList === true && session.messageCount === 0 && session.customData?.genericNewChatShell !== false && Boolean(session.routing?.peerId?.startsWith("chat_"));
|
|
37
|
+
return session.hiddenFromSessionList === true && session.messageCount === 0 && (session.customData?.origin === "automation" || session.customData?.genericNewChatShell !== false && Boolean(session.routing?.peerId?.startsWith("chat_")));
|
|
38
38
|
}
|
|
39
39
|
function textField(body, key) {
|
|
40
40
|
const value = body[key];
|
|
@@ -3,10 +3,11 @@ import { listContextExtractionRuns } from "../../../storage/sqlite/context-extra
|
|
|
3
3
|
import { listContextConsolidationRuns } from "../../../storage/sqlite/context-consolidation-repository.js";
|
|
4
4
|
import { createCollaborationRule, createUnderstanding, decideContextConsent, deleteCollaborationRule, deleteUnderstanding, getCollaborationRule, getTurnPersonalization, getUnderstanding, getUserProfile, listCollaborationRules, listUnderstandingEvidence, listUnderstandingStatusEvents, listUnderstandings, recordContextFeedback, rejectUnderstanding, reviseCollaborationRule, reviseUnderstanding, setCollaborationRuleStatus, setUnderstandingStatus, updateUserProfile } from "../../../storage/sqlite/user-context-repository.js";
|
|
5
5
|
import "../../../storage/sqlite/index.js";
|
|
6
|
-
import { listUserFocuses, updateUserFocus } from "../../../user-context/sources/repository.js";
|
|
6
|
+
import { getUserFocus, listUserFocuses, updateUserFocus } from "../../../user-context/sources/repository.js";
|
|
7
7
|
import { canonicalUnderstandingKey, findDuplicateUnderstanding } from "../../../user-context/understanding.js";
|
|
8
8
|
import { listContextObjects } from "../../../user-context/context-objects.js";
|
|
9
9
|
import { deleteUserAvatar, readUserAvatar, writeUserAvatar } from "../../../user-context/user-avatar.js";
|
|
10
|
+
import { listUnderstandingFocusExclusions, setUnderstandingFocusExclusion } from "../../../storage/sqlite/understanding-focus-exclusions.js";
|
|
10
11
|
import { repairExtractedContext } from "../../../user-context/extraction/repair.js";
|
|
11
12
|
import { getUserRelationship, listUserRelationships, mergeUserRelationships, patchUserRelationship } from "../../../user-context/relationships/service.js";
|
|
12
13
|
import { USER_PERSON_KINDS } from "../../../user-context/relationships/types.js";
|
|
@@ -121,7 +122,13 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
121
122
|
});
|
|
122
123
|
authenticated.get("/api/you", (c) => c.json({
|
|
123
124
|
profile: getUserProfile(),
|
|
124
|
-
understandings:
|
|
125
|
+
understandings: (() => {
|
|
126
|
+
const byUnderstanding = listUnderstandingFocusExclusions();
|
|
127
|
+
return listUnderstandings().map((item) => ({
|
|
128
|
+
...item,
|
|
129
|
+
excludedFocusIds: byUnderstanding.get(item.id) ?? []
|
|
130
|
+
}));
|
|
131
|
+
})(),
|
|
125
132
|
focuses: listUserFocuses(),
|
|
126
133
|
rules: listCollaborationRules(),
|
|
127
134
|
consolidation: { lastRun: listContextConsolidationRuns(1)[0] ?? null }
|
|
@@ -234,11 +241,13 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
234
241
|
});
|
|
235
242
|
return c.json({ objects });
|
|
236
243
|
});
|
|
237
|
-
authenticated.get("/api/you/profile", (c) => {
|
|
244
|
+
authenticated.get("/api/you/profile", async (c) => {
|
|
238
245
|
const profile = getUserProfile();
|
|
246
|
+
const avatar = await readUserAvatar();
|
|
239
247
|
return c.json({
|
|
240
248
|
profile,
|
|
241
|
-
suggestedCallName: profile.callName || machineCallName()
|
|
249
|
+
suggestedCallName: profile.callName || machineCallName(),
|
|
250
|
+
hasAvatar: avatar.ok
|
|
242
251
|
});
|
|
243
252
|
});
|
|
244
253
|
authenticated.patch("/api/you/profile", write, async (c) => {
|
|
@@ -297,6 +306,13 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
297
306
|
});
|
|
298
307
|
return c.json({ understanding }, 201);
|
|
299
308
|
});
|
|
309
|
+
authenticated.on(["PUT", "DELETE"], "/api/you/understandings/:id/focus-exclusions/:focusId", write, (c) => {
|
|
310
|
+
const id = c.req.param("id");
|
|
311
|
+
const focusId = c.req.param("focusId");
|
|
312
|
+
if (!getUnderstanding(id) || !getUserFocus(focusId)) return c.json({ error: "Context object not found" }, 404);
|
|
313
|
+
setUnderstandingFocusExclusion(id, focusId, c.req.method === "PUT");
|
|
314
|
+
return c.json({ ok: true });
|
|
315
|
+
});
|
|
300
316
|
authenticated.get("/api/you/understandings/:id/evidence", (c) => {
|
|
301
317
|
const understanding = getUnderstanding(c.req.param("id"));
|
|
302
318
|
if (!understanding) return c.json({ error: "Understanding not found" }, 404);
|
|
@@ -10,11 +10,11 @@ import { notifyUserContextChange } from "../user-context/changes.js";
|
|
|
10
10
|
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
11
11
|
import "../storage/sqlite/index.js";
|
|
12
12
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
13
|
-
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
13
|
+
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
14
14
|
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
15
15
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
16
16
|
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
17
|
-
import { init_paths,
|
|
17
|
+
import { init_paths, resolveConfigPath, resolveExtensionsDir } from "../config/paths.js";
|
|
18
18
|
import { areExtensionsGloballyDisabled } from "../extensions/discover-extensions.js";
|
|
19
19
|
import { buildExtensionMetadataSnapshot } from "../extensions/extension-metadata-snapshot.js";
|
|
20
20
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, init_channel_catalog_service } from "../channels/catalog/channel-catalog-service.js";
|
|
@@ -901,7 +901,7 @@ var GatewayService = class {
|
|
|
901
901
|
runMessageSending: (to, content, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSending(to, content, channel),
|
|
902
902
|
runMessageSent: (to, content, success, error, channel) => this.agentService.outboundCoordinator.invokeOutboundMessageSent(to, content, success, error, channel)
|
|
903
903
|
});
|
|
904
|
-
this.channelManager.enableOutboundPersistence(
|
|
904
|
+
this.channelManager.enableOutboundPersistence(getDefaultAgentId(this.config));
|
|
905
905
|
if (this.extensionLoader) this.extensionLoader.setRuntimeContext({
|
|
906
906
|
bus: this.bus,
|
|
907
907
|
sessionManager: this.sessionIndex,
|
|
@@ -1060,7 +1060,7 @@ var GatewayService = class {
|
|
|
1060
1060
|
triggerInProcessRestart: () => this.triggerGatewayProcessRestart()
|
|
1061
1061
|
});
|
|
1062
1062
|
wireTunnelEventsToGateway(this);
|
|
1063
|
-
import("../share/share-auto.js").then(({ runStagingSweep }) => runStagingSweep()).catch((err) => log.warn({ err }, "Share staging sweep failed"));
|
|
1063
|
+
import("../share/share-auto.js").then(({ runStagingSweep }) => runStagingSweep([...new Set([getDefaultAgentId(this.config), ...listAgentEntries(this.config).map((entry) => entry.id)])].map((agentId) => resolveAgentWorkspaceDir(this.config, agentId)))).catch((err) => log.warn({ err }, "Share staging sweep failed"));
|
|
1064
1064
|
if (this.serviceConfig.deferChannelConnectUntilAfterHttp !== true) this.markGatewayReady();
|
|
1065
1065
|
else trace.mark("service.started-awaiting-http");
|
|
1066
1066
|
log.debug("Gateway service started");
|
|
@@ -1224,7 +1224,6 @@ var GatewayService = class {
|
|
|
1224
1224
|
this.stopAutomationProductEventBridge = null;
|
|
1225
1225
|
this.stopSessionTranscriptAutomationEvents?.();
|
|
1226
1226
|
this.stopSessionTranscriptAutomationEvents = null;
|
|
1227
|
-
await this.notesService.flush();
|
|
1228
1227
|
buckets.destroyAll();
|
|
1229
1228
|
closeXopcDatabase();
|
|
1230
1229
|
log.debug("Gateway service stopped");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
|
@@ -2,5 +2,5 @@ export { NotesStore } from './store.js';
|
|
|
2
2
|
export { NotesService } from './service.js';
|
|
3
3
|
export { buildNoteAgentContext, buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact } from './agent-context.js';
|
|
4
4
|
export type { NoteAgentContextArtifact, NoteAgentAttachmentContext } from './agent-context.js';
|
|
5
|
-
export { resolveNotesDir,
|
|
5
|
+
export { resolveNotesDir, resolveNoteMediaDir } from './paths.js';
|
|
6
6
|
export type { Note, NoteKind, NoteStatus, NoteAttachment, NoteAiMeta, NoteAiDeepMeta, NoteIndexEntry, NoteSnapshot, NoteSnapshotEntry, NotesIndexFile, NotesListQuery, CaptureSource, CaptureChannel, CreateNoteParams, SnapshotTrigger, NoteTaskMeta, NoteGroup, } from './types.js';
|
package/dist/src/notes/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveNoteMediaDir, resolveNotesDir } from "./paths.js";
|
|
2
2
|
import { NotesStore } from "./store.js";
|
|
3
3
|
import { buildNoteAgentContext, buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact } from "./agent-context.js";
|
|
4
4
|
import { NotesService } from "./service.js";
|
|
5
|
-
export { NotesService, NotesStore, buildNoteAgentContext, buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact,
|
|
5
|
+
export { NotesService, NotesStore, buildNoteAgentContext, buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact, resolveNoteMediaDir, resolveNotesDir };
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
export declare function resolveNotesDir(): string;
|
|
2
|
-
export declare function resolveNotesIndexPath(): string;
|
|
3
|
-
export declare function resolveNoteItemPath(noteId: string): string;
|
|
4
2
|
export declare function resolveNoteMediaDir(noteId: string): string;
|
|
5
|
-
export declare function resolveNoteHistoryDir(noteId: string): string;
|
package/dist/src/notes/paths.js
CHANGED
|
@@ -5,17 +5,8 @@ init_paths_state();
|
|
|
5
5
|
function resolveNotesDir() {
|
|
6
6
|
return join(resolveStateDir(), "notes");
|
|
7
7
|
}
|
|
8
|
-
function resolveNotesIndexPath() {
|
|
9
|
-
return join(resolveNotesDir(), "index.json");
|
|
10
|
-
}
|
|
11
|
-
function resolveNoteItemPath(noteId) {
|
|
12
|
-
return join(resolveNotesDir(), "items", `${noteId}.json`);
|
|
13
|
-
}
|
|
14
8
|
function resolveNoteMediaDir(noteId) {
|
|
15
9
|
return join(resolveNotesDir(), "media", noteId);
|
|
16
10
|
}
|
|
17
|
-
function resolveNoteHistoryDir(noteId) {
|
|
18
|
-
return join(resolveNotesDir(), "history", noteId);
|
|
19
|
-
}
|
|
20
11
|
//#endregion
|
|
21
|
-
export {
|
|
12
|
+
export { resolveNoteMediaDir, resolveNotesDir };
|
|
@@ -63,7 +63,6 @@ export declare class NotesService {
|
|
|
63
63
|
listNoteHistory(noteId: string): Promise<NoteSnapshotEntry[]>;
|
|
64
64
|
getNoteSnapshot(noteId: string, timestamp: number): Promise<NoteSnapshot | null>;
|
|
65
65
|
restoreNoteSnapshot(noteId: string, timestamp: number): Promise<Note | null>;
|
|
66
|
-
flush(): Promise<void>;
|
|
67
66
|
moveToGroup(noteId: string, groupId: string | null): Promise<Note | null>;
|
|
68
67
|
createTask(title: string, source: CaptureSource, opts?: {
|
|
69
68
|
dueAt?: number;
|
|
@@ -25,7 +25,5 @@ export declare class NotesStore {
|
|
|
25
25
|
getSnapshot(noteId: string, timestamp: number): Promise<NoteSnapshot | null>;
|
|
26
26
|
pruneSnapshots(noteId: string, maxCount: number): Promise<void>;
|
|
27
27
|
deleteAllSnapshots(noteId: string): Promise<void>;
|
|
28
|
-
/** No-op: SQLite writes are synchronous. Kept for API compatibility with tests. */
|
|
29
|
-
flush(): Promise<void>;
|
|
30
28
|
}
|
|
31
29
|
export { buildNoteIndexMeta };
|
package/dist/src/notes/store.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
4
|
+
import { runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
4
5
|
import { buildNoteIndexMeta } from "./note-index-meta.js";
|
|
5
6
|
import { deleteNoteRecord, getNoteRecord, listNoteRecords, upsertNoteRecord } from "../storage/sqlite/notes-repository.js";
|
|
6
7
|
import { deleteNoteAgentContextRecord } from "../storage/sqlite/note-agent-context-repository.js";
|
|
7
8
|
import "../storage/sqlite/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import { resolveNoteHistoryDir, resolveNoteMediaDir } from "./paths.js";
|
|
9
|
+
import { resolveNoteMediaDir } from "./paths.js";
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
|
-
import { mkdir,
|
|
12
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
13
13
|
//#region src/notes/store.ts
|
|
14
|
-
init_write_file_atomic();
|
|
15
14
|
init_logger();
|
|
16
15
|
const log = createLogger("NotesStore");
|
|
17
16
|
var NotesStore = class {
|
|
@@ -81,91 +80,45 @@ var NotesStore = class {
|
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
82
|
async saveSnapshot(note, trigger) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
trigger,
|
|
100
|
-
timestamp: snapshot.timestamp
|
|
101
|
-
}, "Snapshot saved");
|
|
83
|
+
requireXopcDatabase();
|
|
84
|
+
runSqliteWriteTransaction((db) => {
|
|
85
|
+
const row = db.prepare("SELECT MAX(timestamp) AS timestamp FROM note_snapshots WHERE note_id = ?").get(note.id);
|
|
86
|
+
const snapshot = {
|
|
87
|
+
noteId: note.id,
|
|
88
|
+
timestamp: Math.max(Date.now(), (row.timestamp ?? 0) + 1),
|
|
89
|
+
trigger,
|
|
90
|
+
title: note.title,
|
|
91
|
+
markdown: note.markdown,
|
|
92
|
+
tags: note.tags,
|
|
93
|
+
kind: note.kind,
|
|
94
|
+
status: note.status
|
|
95
|
+
};
|
|
96
|
+
db.prepare("INSERT INTO note_snapshots(note_id, timestamp, payload) VALUES (?, ?, ?)").run(note.id, snapshot.timestamp, JSON.stringify(snapshot));
|
|
97
|
+
});
|
|
102
98
|
}
|
|
103
99
|
async listSnapshots(noteId) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
for (const file of files) {
|
|
113
|
-
if (!file.endsWith(".json")) continue;
|
|
114
|
-
const timestamp = parseInt(file.slice(0, -5), 10);
|
|
115
|
-
if (!Number.isFinite(timestamp)) continue;
|
|
116
|
-
try {
|
|
117
|
-
const content = await readFile(join(historyDir, file), "utf-8");
|
|
118
|
-
const snapshot = JSON.parse(content);
|
|
119
|
-
const rawText = snapshot.markdown ?? "";
|
|
120
|
-
entries.push({
|
|
121
|
-
timestamp: snapshot.timestamp,
|
|
122
|
-
trigger: snapshot.trigger,
|
|
123
|
-
snippet: rawText.slice(0, 80) || void 0
|
|
124
|
-
});
|
|
125
|
-
} catch {
|
|
126
|
-
log.debug({
|
|
127
|
-
noteId,
|
|
128
|
-
file
|
|
129
|
-
}, "Skipped unreadable snapshot");
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
entries.sort((a, b) => b.timestamp - a.timestamp);
|
|
133
|
-
return entries;
|
|
100
|
+
return requireXopcDatabase().db.prepare("SELECT payload FROM note_snapshots WHERE note_id = ? ORDER BY timestamp DESC").all(noteId).map((row) => {
|
|
101
|
+
const snapshot = JSON.parse(row.payload);
|
|
102
|
+
return {
|
|
103
|
+
timestamp: snapshot.timestamp,
|
|
104
|
+
trigger: snapshot.trigger,
|
|
105
|
+
snippet: snapshot.markdown?.slice(0, 80) || void 0
|
|
106
|
+
};
|
|
107
|
+
});
|
|
134
108
|
}
|
|
135
109
|
async getSnapshot(noteId, timestamp) {
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
const content = await readFile(filePath, "utf-8");
|
|
139
|
-
return JSON.parse(content);
|
|
140
|
-
} catch {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
110
|
+
const row = requireXopcDatabase().db.prepare("SELECT payload FROM note_snapshots WHERE note_id = ? AND timestamp = ?").get(noteId, timestamp);
|
|
111
|
+
return row ? JSON.parse(row.payload) : null;
|
|
143
112
|
}
|
|
144
113
|
async pruneSnapshots(noteId, maxCount) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
} catch {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const jsonFiles = files.filter((f) => f.endsWith(".json")).sort();
|
|
153
|
-
if (jsonFiles.length <= maxCount) return;
|
|
154
|
-
const toDelete = jsonFiles.slice(0, jsonFiles.length - maxCount);
|
|
155
|
-
for (const file of toDelete) await rm(join(historyDir, file), { force: true }).catch(() => void 0);
|
|
156
|
-
log.debug({
|
|
157
|
-
noteId,
|
|
158
|
-
deleted: toDelete.length
|
|
159
|
-
}, "Pruned old snapshots");
|
|
114
|
+
if (!Number.isSafeInteger(maxCount) || maxCount < 0) throw new Error("Invalid snapshot retention count");
|
|
115
|
+
requireXopcDatabase().db.prepare(`DELETE FROM note_snapshots WHERE note_id = ? AND timestamp NOT IN (
|
|
116
|
+
SELECT timestamp FROM note_snapshots WHERE note_id = ? ORDER BY timestamp DESC LIMIT ?
|
|
117
|
+
)`).run(noteId, noteId, maxCount);
|
|
160
118
|
}
|
|
161
119
|
async deleteAllSnapshots(noteId) {
|
|
162
|
-
|
|
163
|
-
recursive: true,
|
|
164
|
-
force: true
|
|
165
|
-
}).catch(() => void 0);
|
|
120
|
+
requireXopcDatabase().db.prepare("DELETE FROM note_snapshots WHERE note_id = ?").run(noteId);
|
|
166
121
|
}
|
|
167
|
-
/** No-op: SQLite writes are synchronous. Kept for API compatibility with tests. */
|
|
168
|
-
async flush() {}
|
|
169
122
|
};
|
|
170
123
|
//#endregion
|
|
171
124
|
export { NotesStore, buildNoteIndexMeta };
|
|
@@ -93,12 +93,9 @@ export interface HostedShareBinding extends HostedShareResult {
|
|
|
93
93
|
revoked: boolean;
|
|
94
94
|
}
|
|
95
95
|
export declare class HostedShareBindingStore {
|
|
96
|
-
private readonly
|
|
97
|
-
private pending;
|
|
96
|
+
private readonly state;
|
|
98
97
|
list(sessionId: string): Promise<HostedShareBinding[]>;
|
|
99
98
|
upsert(binding: HostedShareBinding): Promise<void>;
|
|
100
99
|
reconcile(remote: OwnerShare[]): Promise<void>;
|
|
101
|
-
private mutate;
|
|
102
|
-
private read;
|
|
103
100
|
}
|
|
104
101
|
export {};
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
1
|
+
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
2
|
+
import { runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
4
3
|
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
4
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
5
5
|
import { resolveMediaReference } from "../media/media-reference.js";
|
|
6
6
|
import { projectSessionShare } from "./session-share-projector.js";
|
|
7
7
|
import { SessionShareSnapshotConflictError } from "./session-share-service.js";
|
|
8
|
-
import { basename
|
|
8
|
+
import { basename } from "node:path";
|
|
9
9
|
import { createReadStream } from "node:fs";
|
|
10
10
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
11
|
-
import {
|
|
11
|
+
import { readFile, stat } from "node:fs/promises";
|
|
12
12
|
//#region src/share/hosted-session-share.ts
|
|
13
13
|
init_credentials();
|
|
14
|
-
init_paths();
|
|
15
|
-
init_write_file_atomic();
|
|
16
14
|
const DEFAULT_SHARE_URL = "https://share.xopc.ai";
|
|
17
15
|
const MAX_MESSAGES = 1e4;
|
|
18
16
|
const MAX_ATTACHMENTS = 20;
|
|
@@ -191,24 +189,20 @@ var HostedShareAuthorizationError = class extends Error {
|
|
|
191
189
|
}
|
|
192
190
|
};
|
|
193
191
|
var HostedShareBindingStore = class {
|
|
194
|
-
|
|
195
|
-
pending = Promise.resolve();
|
|
192
|
+
state = new DurableState("hosted-share-bindings");
|
|
196
193
|
async list(sessionId) {
|
|
197
|
-
return
|
|
194
|
+
return this.state.values().filter((item) => item.sessionId === sessionId).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
|
198
195
|
}
|
|
199
196
|
async upsert(binding) {
|
|
200
|
-
|
|
201
|
-
const index = file.items.findIndex((item) => item.id === binding.id);
|
|
202
|
-
if (index === -1) file.items.push(binding);
|
|
203
|
-
else file.items[index] = binding;
|
|
204
|
-
});
|
|
197
|
+
this.state.set(binding.id, binding);
|
|
205
198
|
}
|
|
206
199
|
async reconcile(remote) {
|
|
207
200
|
const byId = new Map(remote.map((item) => [item.id, item]));
|
|
208
|
-
|
|
209
|
-
|
|
201
|
+
requireXopcDatabase();
|
|
202
|
+
runSqliteWriteTransaction(() => {
|
|
203
|
+
for (const binding of this.state.values()) {
|
|
210
204
|
const item = byId.get(binding.id);
|
|
211
|
-
|
|
205
|
+
if (item) this.state.set(binding.id, {
|
|
212
206
|
...binding,
|
|
213
207
|
expiresAt: item.expiresAt,
|
|
214
208
|
maxViews: item.maxViews,
|
|
@@ -218,36 +212,9 @@ var HostedShareBindingStore = class {
|
|
|
218
212
|
description: item.description,
|
|
219
213
|
updatedAt: item.updatedAt,
|
|
220
214
|
revoked: item.status === "revoked"
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
async mutate(update) {
|
|
226
|
-
const operation = this.pending.then(async () => {
|
|
227
|
-
const file = await this.read();
|
|
228
|
-
update(file);
|
|
229
|
-
await mkdir(dirname(this.path), { recursive: true });
|
|
230
|
-
await writeTextAtomic(this.path, `${JSON.stringify(file, null, 2)}\n`);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
231
217
|
});
|
|
232
|
-
this.pending = operation.catch(() => void 0);
|
|
233
|
-
await operation;
|
|
234
|
-
}
|
|
235
|
-
async read() {
|
|
236
|
-
try {
|
|
237
|
-
const parsed = JSON.parse(await readFile(this.path, "utf8"));
|
|
238
|
-
return parsed.version === 1 && Array.isArray(parsed.items) ? {
|
|
239
|
-
version: 1,
|
|
240
|
-
items: parsed.items
|
|
241
|
-
} : {
|
|
242
|
-
version: 1,
|
|
243
|
-
items: []
|
|
244
|
-
};
|
|
245
|
-
} catch {
|
|
246
|
-
return {
|
|
247
|
-
version: 1,
|
|
248
|
-
items: []
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
218
|
}
|
|
252
219
|
};
|
|
253
220
|
function toResult(item, shareUrl) {
|
|
@@ -70,5 +70,5 @@ export declare function sweepOrphanedStagingDirs(workspaceRoot: string, liveStag
|
|
|
70
70
|
*
|
|
71
71
|
* Safe to call multiple times; idempotent. Best invoked from gateway.start().
|
|
72
72
|
*/
|
|
73
|
-
export declare function runStagingSweep(): Promise<void>;
|
|
73
|
+
export declare function runStagingSweep(workspaceRoots?: readonly string[]): Promise<void>;
|
|
74
74
|
export declare function resetStagedSiteRegistryForTests(): void;
|
|
@@ -215,11 +215,11 @@ async function sweepOrphanedStagingDirs(workspaceRoot, liveStagingDirs) {
|
|
|
215
215
|
*
|
|
216
216
|
* Safe to call multiple times; idempotent. Best invoked from gateway.start().
|
|
217
217
|
*/
|
|
218
|
-
async function runStagingSweep() {
|
|
218
|
+
async function runStagingSweep(workspaceRoots = []) {
|
|
219
219
|
const { getSiteShareStore } = await import("./site-share-store.js");
|
|
220
220
|
const store = getSiteShareStore();
|
|
221
221
|
const records = store.getActiveShares();
|
|
222
|
-
const liveByWorkspace = /* @__PURE__ */ new
|
|
222
|
+
const liveByWorkspace = new Map(workspaceRoots.map((root) => [root, /* @__PURE__ */ new Set()]));
|
|
223
223
|
for (const rec of records) {
|
|
224
224
|
if (rec.source.kind !== "static") continue;
|
|
225
225
|
const ws = rec.source.workspaceRoot;
|
|
@@ -16,15 +16,13 @@ export interface DirectoryListing {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class ShareStore {
|
|
18
18
|
private shares;
|
|
19
|
-
private tokenIndex;
|
|
20
|
-
private dirty;
|
|
21
|
-
private debounceTimer;
|
|
22
19
|
private cleanupTimer;
|
|
23
20
|
private config;
|
|
24
21
|
private listingCache;
|
|
25
22
|
/** Optional cleanup hook invoked when a share record is dropped (e.g. delete thumbnail). */
|
|
26
23
|
private onCleanup;
|
|
27
24
|
constructor(config?: Partial<ShareConfig>);
|
|
25
|
+
private saveNew;
|
|
28
26
|
updateConfig(config: Partial<ShareConfig>): void;
|
|
29
27
|
/** Register a cleanup hook (idempotent — last wins). */
|
|
30
28
|
setCleanupHook(hook: (record: ShareRecord) => void): void;
|
|
@@ -90,7 +88,7 @@ export declare class ShareStore {
|
|
|
90
88
|
valid: boolean;
|
|
91
89
|
reason?: string;
|
|
92
90
|
};
|
|
93
|
-
/** Increment download counter (used by directory & file downloads).
|
|
91
|
+
/** Increment download counter (used by directory & file downloads). Persisted before returning. */
|
|
94
92
|
incrementDownloadCount(id: string): void;
|
|
95
93
|
/** Atomically validate and consume one access in the single-threaded store. */
|
|
96
94
|
consumeAccess(id: string): {
|
|
@@ -130,9 +128,6 @@ export declare class ShareStore {
|
|
|
130
128
|
}): ShareRecord | null;
|
|
131
129
|
getActiveShares(): ShareRecord[];
|
|
132
130
|
getAllShares(): ShareRecord[];
|
|
133
|
-
private load;
|
|
134
|
-
private persistSync;
|
|
135
|
-
private scheduleDebouncedPersist;
|
|
136
131
|
private startCleanupTimer;
|
|
137
132
|
private cleanupExpired;
|
|
138
133
|
shutdown(): void;
|