@xopcai/xopc 0.0.315 → 0.0.317
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BbFOF2SH.js → agent-avatar-dicebear-BmmO4j0u.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D9T-QGmd.js → agent-defaults-settings-panel-2NGwyCKB.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Ds5sQcPd.js → agents-Cb4lfXqA.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BzloAiIG.js → api-Fu9gSeAI.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BpUHskXq.js → app-management-settings-panel-BhIQOlam.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CQd5Vo6f.js → appearance-settings-DwW3wrBX.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-B7VIsfye.js → apps-page-ByLoHKiD.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BM4O6WfL.js → archive-plugin-DzQeKhMy.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Cdn9MYmI.js → attachment-load-CNWbDfHi.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DnRx-Ra4.js → automations-page-CZcaFAco.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CGTrgDlW.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-dkhUf4bm.js → binary-plugins-D5-gEs50.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BTzqEuAy.js → block-editor-DngH5soo.js} +5 -5
- package/dist/gateway/static/root/assets/{browser-automation-inputs-Bowij-nJ.js → browser-automation-inputs-DeGdfGUg.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CQ7SYTQj.js → browser-automations-page-D_vsV9Og.js} +1 -1
- package/dist/gateway/static/root/assets/browser-settings-page-DCpyjtI7.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C3clEWb3.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-Dibm8FJG.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DzgFHd6l.js → chat-terminal-dock-DyoR9vy9.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-380_vIqO.js → computer-settings-page-Dp1d7MGE.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DILFakXb.js → connector-service-page--SapHT59.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-CV2K0GsR.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-CRVun-T5.js → date-picker-BpJiursq.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BoWqt5yU.js → dependency-picker-BKLcvu4-.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DPlkBjft.js → desktop-pet-DNBeDygk.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D7FgfX_K.js → desktop-pet-settings-C1wzPZky.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-tCgXlVNO.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CT_QkSN_.js → extension-debug-page-BoG796xN.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BF1NdcKP.js → extension-page-DatEJD_W.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CKQVZ3Xc.js → extension-settings-page-cs0pcgqa.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BPsZPoAT.js → gateway-config-swr-CYa7aVok.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-3bIy7XMr.js → gateway-settings-DSxwMkLj.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-cG6EqUJw.js → gateway-startup-retry-FZix2Im1.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-3cToq8Ic.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DI_QutIx.js → image-generation-api-IDhumota.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BUG6G72F.js → imports-page-BZ-0tsFU.js} +1 -1
- package/dist/gateway/static/root/assets/index-Ca4fdHsK.css +1 -0
- package/dist/gateway/static/root/assets/index-DqxyVarz.js +89 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-qnG-4FJs.js → keyboard-shortcuts-settings-CyXLl8PE.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-B3iJWhjN.js → local-app-workbench-page-ZjNFRbSU.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-BpEGeURS.js → local-apps-page-BmcNQOEx.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BlgpZORR.js → locale-store-BrnrrtSS.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-0QPGj-5c.js → logs-page-DoaBVsR2.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-Sl0wwidS.js → management-settings-BkCC5j8K.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BzjjpL2H.js → markdown-view-DUfjxG4s.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bzkdhotn.js → media-plugins-DFNzifXX.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BoEi2k2p.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CLxgY3Xq.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-CgQEb3ks.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-CFt4hXQ6.js → page-context-capture-button-Beu5hjB5.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-Dz_x22MQ.js → page-tabs-DWppfGs6.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-C1mkgFAl.js → preview-open-alternatives-CjBsxcGv.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-DHZgzSDV.js → product-open-page-BYoaBpad.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BtiNnPuJ.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-CEr8DX9I.js → projects-page-_Qc8812P.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DMW2apOO.js → registry-api-DgKqRZl1.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-Db-B-Mf3.js → remote-access-hub-CpI6OjSj.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DEJi0BLL.js → runtime-tools-settings-panel-Dykdq60b.js} +1 -1
- package/dist/gateway/static/root/assets/scenes-page-hP1OhIG6.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-RVltVpuG.js → schema-form-BPeMGXnp.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Dmncs4GP.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CV2LhIvd.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BkBO7woF.js → settings-form-section-OfLwze5k.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-zl0XY203.js → settings-page-D-koQ_0e.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-lLvHc-zF.js → settings-page-layout-r1Q31sB_.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Difrpr4T.js → setup-status-panel-MiIbmzZu.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-NC4Gj867.js → share-preview-page-BkSzw3wN.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DPLvEcB-.js → shares-settings-BT9NIsiS.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BgxB-kmG.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CzekvBNQ.js → skills-page-CfL2BT9s.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-BLeiN245.js → skills-page.utils-BKdQtHAI.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Bp75s9nl.js → system-settings-panel-Del-7fwn.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-q8NLbitF.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-BDiaC6an.js → tunnel-api-DK9ICDPw.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C_ntK_Zu.js → use-autosave-BLZSp59v.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DPfaWuJs.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-D4cfuMp1.js → voice-api-key-field-Lzm2ik7J.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Cjvd6maH.js → voice-config-api-F6NsgxNd.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-CkC8ANVw.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C80nrmKi.js → workflow-run-setup-panel-DoevvbCd.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CZxaaUK8.js +6 -0
- package/dist/gateway/static/root/index.html +8 -8
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +14 -13
- package/dist/src/agent/embedded/run-turn.js +28 -15
- package/dist/src/agent/embedded/system-prompt-override.js +14 -3
- package/dist/src/agent/embedded/xopc-stream-bridge.js +13 -2
- package/dist/src/agent/memory/context-budget.js +1 -1
- package/dist/src/agent/orchestration/agent-turn-policy.d.ts +2 -2
- package/dist/src/agent/prompt/agent-system-prompt.d.ts +3 -0
- package/dist/src/agent/prompt/agent-system-prompt.js +16 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +1 -0
- package/dist/src/agent-config/schema.d.ts +8 -8
- package/dist/src/ai-assist/text-assist.js +2 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/schema.d.ts +5 -5
- package/dist/src/connectors/connected-source-ingestion.d.ts +1 -0
- package/dist/src/connectors/connected-source-ingestion.js +1 -0
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -0
- package/dist/src/connectors/connected-source-understanding.js +91 -31
- package/dist/src/connectors/content-enrichment.d.ts +1 -0
- package/dist/src/connectors/content-enrichment.js +3 -1
- package/dist/src/connectors/learning-coordinator.js +24 -24
- package/dist/src/gateway/chat-stream/mapper.js +9 -4
- package/dist/src/gateway/chat-stream/protocol.d.ts +2 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +2 -2
- package/dist/src/gateway/hono/routes/user-model-refresh.js +2 -2
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/service.js +6 -6
- package/dist/src/knowledge/ingestion-service.d.ts +5 -2
- package/dist/src/knowledge/ingestion-service.js +24 -15
- package/dist/src/knowledge-memory/domain.d.ts +1 -1
- package/dist/src/platform/client.d.ts +1 -1
- package/dist/src/platform/contracts.d.ts +1 -1
- package/dist/src/providers/extension-stream-bridge.js +6 -4
- package/dist/src/providers/model-call.js +3 -3
- package/dist/src/providers/presentation.js +4 -3
- package/dist/src/storage/sqlite/context-extraction-repository.d.ts +1 -2
- package/dist/src/storage/sqlite/context-extraction-repository.js +1 -9
- package/dist/src/storage/sqlite/index.d.ts +1 -2
- package/dist/src/storage/sqlite/index.js +2 -3
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +3 -0
- package/dist/src/storage/sqlite/migrations/200_connected_work_threads.sql +92 -0
- package/dist/src/storage/sqlite/migrations/201_connector_extraction_audit.sql +127 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +1 -1
- package/dist/src/user-context/domain.d.ts +0 -13
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/repository.d.ts +10 -0
- package/dist/src/user-context/sources/repository.js +19 -4
- package/dist/src/user-context/sources/types.d.ts +1 -0
- package/package.json +8 -8
- package/dist/gateway/static/root/assets/automations-workspace-B5s10G5F.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-vqLoPOOg.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DI68WGYd.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-Cimssy-S.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-COmFp9HC.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-BP6yxut8.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DFNDLFgv.js +0 -1
- package/dist/gateway/static/root/assets/index-BCi8nfxs.js +0 -89
- package/dist/gateway/static/root/assets/index-DWgd1VK2.css +0 -1
- package/dist/gateway/static/root/assets/messages-2GhUD7SC.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-BXtD71j1.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-DNY4vW-u.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-D3NhZ7ZZ.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-BUUX-PnI.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-Rm4H2okS.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-VxPItcOG.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CKdLCf_-.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-Bh8H4FYR.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-C7gFCGAV.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-Ce6ToB0O.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-CVQjo3RI.js +0 -6
- package/dist/src/storage/sqlite/context-relation-repository.d.ts +0 -50
- package/dist/src/storage/sqlite/context-relation-repository.js +0 -98
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
ALTER TABLE understanding_source_runs ADD COLUMN connector_learning_job_id TEXT;
|
|
2
|
+
|
|
3
|
+
UPDATE understanding_source_runs
|
|
4
|
+
SET connector_learning_job_id = json_extract(metadata_json, '$.connectorLearningJobId')
|
|
5
|
+
WHERE json_type(metadata_json, '$.connectorLearningJobId') = 'text';
|
|
6
|
+
|
|
7
|
+
CREATE TEMP TABLE duplicate_connector_source_runs AS
|
|
8
|
+
WITH ranked AS (
|
|
9
|
+
SELECT
|
|
10
|
+
run_id AS duplicate_id,
|
|
11
|
+
FIRST_VALUE(run_id) OVER (
|
|
12
|
+
PARTITION BY connector_learning_job_id
|
|
13
|
+
ORDER BY
|
|
14
|
+
CASE
|
|
15
|
+
WHEN json_extract(metadata_json, '$.semanticStatus') = 'completed' THEN 0
|
|
16
|
+
WHEN status = 'completed' THEN 1
|
|
17
|
+
WHEN status = 'partial' THEN 2
|
|
18
|
+
ELSE 3
|
|
19
|
+
END,
|
|
20
|
+
COALESCE(completed_at, started_at) DESC,
|
|
21
|
+
rowid DESC
|
|
22
|
+
) AS keep_id,
|
|
23
|
+
ROW_NUMBER() OVER (
|
|
24
|
+
PARTITION BY connector_learning_job_id
|
|
25
|
+
ORDER BY
|
|
26
|
+
CASE
|
|
27
|
+
WHEN json_extract(metadata_json, '$.semanticStatus') = 'completed' THEN 0
|
|
28
|
+
WHEN status = 'completed' THEN 1
|
|
29
|
+
WHEN status = 'partial' THEN 2
|
|
30
|
+
ELSE 3
|
|
31
|
+
END,
|
|
32
|
+
COALESCE(completed_at, started_at) DESC,
|
|
33
|
+
rowid DESC
|
|
34
|
+
) AS rank
|
|
35
|
+
FROM understanding_source_runs
|
|
36
|
+
WHERE connector_learning_job_id IS NOT NULL
|
|
37
|
+
)
|
|
38
|
+
SELECT duplicate_id, keep_id FROM ranked WHERE rank > 1;
|
|
39
|
+
|
|
40
|
+
UPDATE context_evidence
|
|
41
|
+
SET source_run_id = (
|
|
42
|
+
SELECT keep_id FROM duplicate_connector_source_runs
|
|
43
|
+
WHERE duplicate_id = context_evidence.source_run_id
|
|
44
|
+
)
|
|
45
|
+
WHERE source_run_id IN (SELECT duplicate_id FROM duplicate_connector_source_runs);
|
|
46
|
+
|
|
47
|
+
DELETE FROM context_extraction_runs
|
|
48
|
+
WHERE source_ref IN (
|
|
49
|
+
SELECT 'understanding-source-run:' || duplicate_id FROM duplicate_connector_source_runs
|
|
50
|
+
)
|
|
51
|
+
AND EXISTS (
|
|
52
|
+
SELECT 1
|
|
53
|
+
FROM duplicate_connector_source_runs duplicates
|
|
54
|
+
JOIN context_extraction_runs kept
|
|
55
|
+
ON kept.source_ref = 'understanding-source-run:' || duplicates.keep_id
|
|
56
|
+
AND kept.principal_id = context_extraction_runs.principal_id
|
|
57
|
+
AND kept.extractor_id = context_extraction_runs.extractor_id
|
|
58
|
+
AND kept.extractor_version = context_extraction_runs.extractor_version
|
|
59
|
+
WHERE context_extraction_runs.source_ref = 'understanding-source-run:' || duplicates.duplicate_id
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
UPDATE context_extraction_runs
|
|
63
|
+
SET source_ref = 'understanding-source-run:' || (
|
|
64
|
+
SELECT keep_id FROM duplicate_connector_source_runs
|
|
65
|
+
WHERE 'understanding-source-run:' || duplicate_id = context_extraction_runs.source_ref
|
|
66
|
+
)
|
|
67
|
+
WHERE source_ref IN (
|
|
68
|
+
SELECT 'understanding-source-run:' || duplicate_id FROM duplicate_connector_source_runs
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
UPDATE knowledge_items
|
|
72
|
+
SET source_json = json_set(
|
|
73
|
+
source_json,
|
|
74
|
+
'$.sourceRunId',
|
|
75
|
+
(
|
|
76
|
+
SELECT keep_id FROM duplicate_connector_source_runs
|
|
77
|
+
WHERE duplicate_id = json_extract(knowledge_items.source_json, '$.sourceRunId')
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
WHERE json_extract(source_json, '$.sourceRunId') IN (
|
|
81
|
+
SELECT duplicate_id FROM duplicate_connector_source_runs
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
DELETE FROM understanding_source_runs
|
|
85
|
+
WHERE run_id IN (SELECT duplicate_id FROM duplicate_connector_source_runs);
|
|
86
|
+
|
|
87
|
+
DROP TABLE duplicate_connector_source_runs;
|
|
88
|
+
|
|
89
|
+
CREATE UNIQUE INDEX idx_understanding_source_runs_connector_job
|
|
90
|
+
ON understanding_source_runs(connector_learning_job_id)
|
|
91
|
+
WHERE connector_learning_job_id IS NOT NULL;
|
|
92
|
+
|
|
93
|
+
ALTER TABLE context_extraction_outputs RENAME TO context_extraction_outputs_v200;
|
|
94
|
+
|
|
95
|
+
CREATE TABLE context_extraction_outputs (
|
|
96
|
+
output_id TEXT PRIMARY KEY,
|
|
97
|
+
extraction_run_id TEXT NOT NULL REFERENCES context_extraction_runs(extraction_run_id) ON DELETE CASCADE,
|
|
98
|
+
ordinal INTEGER NOT NULL,
|
|
99
|
+
candidate_key TEXT NOT NULL,
|
|
100
|
+
object_type TEXT CHECK (object_type IN ('assertion', 'rule', 'goal', 'knowledge')),
|
|
101
|
+
object_id TEXT,
|
|
102
|
+
version_id TEXT,
|
|
103
|
+
outcome TEXT NOT NULL CHECK (outcome IN ('created', 'deduplicated', 'rejected')),
|
|
104
|
+
created_at INTEGER NOT NULL,
|
|
105
|
+
UNIQUE (extraction_run_id, ordinal)
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
INSERT INTO context_extraction_outputs (
|
|
109
|
+
output_id, extraction_run_id, ordinal, candidate_key, object_type,
|
|
110
|
+
object_id, version_id, outcome, created_at
|
|
111
|
+
)
|
|
112
|
+
SELECT
|
|
113
|
+
output_id,
|
|
114
|
+
extraction_run_id,
|
|
115
|
+
ordinal,
|
|
116
|
+
candidate_key,
|
|
117
|
+
CASE object_type WHEN 'rule' THEN 'rule' ELSE NULL END,
|
|
118
|
+
CASE object_type WHEN 'rule' THEN object_id ELSE NULL END,
|
|
119
|
+
CASE object_type WHEN 'rule' THEN version_id ELSE NULL END,
|
|
120
|
+
outcome,
|
|
121
|
+
created_at
|
|
122
|
+
FROM context_extraction_outputs_v200;
|
|
123
|
+
|
|
124
|
+
DROP TABLE context_extraction_outputs_v200;
|
|
125
|
+
|
|
126
|
+
CREATE INDEX idx_context_extraction_outputs_object
|
|
127
|
+
ON context_extraction_outputs(object_type, object_id);
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 201;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -26,7 +26,7 @@ function applySingleMigration(db, migration, discardOldScenes = false) {
|
|
|
26
26
|
targetVersion: migration.targetVersion,
|
|
27
27
|
file: migration.filename
|
|
28
28
|
}, "Applying SQLite migration");
|
|
29
|
-
const requiresForeignKeyPause = discardOldScenes || migration.targetVersion === 179 || migration.targetVersion === 182 || migration.targetVersion === 188;
|
|
29
|
+
const requiresForeignKeyPause = discardOldScenes || migration.targetVersion === 179 || migration.targetVersion === 182 || migration.targetVersion === 188 || migration.targetVersion === 200 || migration.targetVersion === 201;
|
|
30
30
|
const foreignKeysEnabled = Number(db.prepare("PRAGMA foreign_keys").get()?.foreign_keys) === 1;
|
|
31
31
|
if (requiresForeignKeyPause) db.exec("PRAGMA foreign_keys = OFF");
|
|
32
32
|
let transactionStarted = false;
|
|
@@ -57,7 +57,7 @@ function applySingleMigration(db, migration, discardOldScenes = false) {
|
|
|
57
57
|
*/
|
|
58
58
|
function applyPendingMigrations(db, options = {}) {
|
|
59
59
|
db.function("xopc_operation_id", () => currentOperationId() ?? null);
|
|
60
|
-
const targetVersion = options.targetVersion ??
|
|
60
|
+
const targetVersion = options.targetVersion ?? 201;
|
|
61
61
|
let currentVersion = readSchemaVersion(db);
|
|
62
62
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
63
63
|
if (!options.migrationsDir && currentVersion < 165) throw new DatabaseSchemaTooOldError(currentVersion, 165);
|
|
@@ -95,7 +95,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
95
95
|
}
|
|
96
96
|
/** Inspect schema version without mutating the database. */
|
|
97
97
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
98
|
-
const appVersion = options.targetVersion ??
|
|
98
|
+
const appVersion = options.targetVersion ?? 201;
|
|
99
99
|
const dbVersion = readSchemaVersion(db);
|
|
100
100
|
if (dbVersion > appVersion) return {
|
|
101
101
|
dbVersion,
|
|
@@ -137,7 +137,7 @@ var init_runner = __esmMin((() => {
|
|
|
137
137
|
init_errors();
|
|
138
138
|
log = createLogger("Sqlite:Migrations");
|
|
139
139
|
XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
140
|
-
XOPC_DB_SCHEMA_VERSION =
|
|
140
|
+
XOPC_DB_SCHEMA_VERSION = 201;
|
|
141
141
|
}));
|
|
142
142
|
//#endregion
|
|
143
143
|
init_runner();
|
|
@@ -2275,7 +2275,7 @@ CREATE TABLE knowledge_items (
|
|
|
2275
2275
|
knowledge_id TEXT PRIMARY KEY,
|
|
2276
2276
|
principal_id TEXT NOT NULL,
|
|
2277
2277
|
kind TEXT NOT NULL CHECK(kind IN (
|
|
2278
|
-
'project_fact', 'workspace_fact', 'decision', 'task_lesson',
|
|
2278
|
+
'work_thread', 'project_fact', 'workspace_fact', 'decision', 'task_lesson',
|
|
2279
2279
|
'commitment', 'open_question', 'episode', 'note'
|
|
2280
2280
|
)),
|
|
2281
2281
|
scope_type TEXT NOT NULL CHECK(scope_type IN ('global', 'agent', 'workspace', 'project', 'session')),
|
|
@@ -52,19 +52,6 @@ export type CollaborationRule = {
|
|
|
52
52
|
createdAt: number;
|
|
53
53
|
updatedAt: number;
|
|
54
54
|
};
|
|
55
|
-
export type PersonalizationItem = {
|
|
56
|
-
objectType: 'profile' | 'rule' | 'focus' | 'understanding';
|
|
57
|
-
objectId: string;
|
|
58
|
-
versionId?: string;
|
|
59
|
-
decision: 'selected' | 'irrelevant' | 'expired' | 'scope_mismatch' | 'sensitive' | 'needs_consent' | 'budget_exceeded' | 'conflicted' | 'disabled';
|
|
60
|
-
reason: string;
|
|
61
|
-
content: string;
|
|
62
|
-
sourceLabel: string;
|
|
63
|
-
origin: 'told_by_user' | 'observed' | 'inferred' | 'connected_source';
|
|
64
|
-
rank?: number;
|
|
65
|
-
score?: number;
|
|
66
|
-
injectedChars: number;
|
|
67
|
-
};
|
|
68
55
|
export type ContextEvidence = {
|
|
69
56
|
id: string;
|
|
70
57
|
sourceType: 'conversation' | 'connector' | 'user' | 'runtime';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "./repository.js";
|
|
1
|
+
import { createUnderstandingSourceRun, getConnectorUnderstandingSourceRun, getOrCreateConnectorUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "./repository.js";
|
|
2
2
|
import { clusterUnderstandingSignals, tokenizeUnderstandingSignal } from "./signal-clustering.js";
|
|
3
3
|
import { listUnderstandingSourceDefinitions } from "./catalog.js";
|
|
4
|
-
export { clusterUnderstandingSignals, createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, listUnderstandingSourceDefinitions, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, tokenizeUnderstandingSignal, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant };
|
|
4
|
+
export { clusterUnderstandingSignals, createUnderstandingSourceRun, getConnectorUnderstandingSourceRun, getOrCreateConnectorUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, listUnderstandingSourceDefinitions, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, tokenizeUnderstandingSignal, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant };
|
|
@@ -24,10 +24,20 @@ export declare function createUnderstandingSourceRun(input: {
|
|
|
24
24
|
grantId: string;
|
|
25
25
|
kind: UnderstandingSourceRun['kind'];
|
|
26
26
|
status?: UnderstandingSourceRun['status'];
|
|
27
|
+
connectorLearningJobId?: string;
|
|
27
28
|
cursorBefore?: string;
|
|
28
29
|
metadata?: Record<string, unknown>;
|
|
29
30
|
nowMs?: number;
|
|
30
31
|
}): UnderstandingSourceRun;
|
|
32
|
+
export declare function getConnectorUnderstandingSourceRun(connectorLearningJobId: string): UnderstandingSourceRun | null;
|
|
33
|
+
export declare function getOrCreateConnectorUnderstandingSourceRun(input: {
|
|
34
|
+
grantId: string;
|
|
35
|
+
connectorLearningJobId: string;
|
|
36
|
+
kind: UnderstandingSourceRun['kind'];
|
|
37
|
+
status?: UnderstandingSourceRun['status'];
|
|
38
|
+
metadata?: Record<string, unknown>;
|
|
39
|
+
nowMs?: number;
|
|
40
|
+
}): UnderstandingSourceRun;
|
|
31
41
|
export declare function getUnderstandingSourceRun(id: string): UnderstandingSourceRun | null;
|
|
32
42
|
export declare function listUnderstandingSourceRuns(grantId: string, limit?: number): UnderstandingSourceRun[];
|
|
33
43
|
export declare function updateUnderstandingSourceRun(id: string, patch: {
|
|
@@ -35,6 +35,7 @@ function runFromRow(row) {
|
|
|
35
35
|
id: row.run_id,
|
|
36
36
|
grantId: row.grant_id,
|
|
37
37
|
kind: row.kind,
|
|
38
|
+
...row.connector_learning_job_id ? { connectorLearningJobId: row.connector_learning_job_id } : {},
|
|
38
39
|
status: row.status,
|
|
39
40
|
...row.cursor_before ? { cursorBefore: row.cursor_before } : {},
|
|
40
41
|
...row.cursor_after ? { cursorAfter: row.cursor_after } : {},
|
|
@@ -104,11 +105,25 @@ function createUnderstandingSourceRun(input) {
|
|
|
104
105
|
const now = input.nowMs ?? Date.now();
|
|
105
106
|
runSqliteWriteTransaction((db) => db.prepare(`
|
|
106
107
|
INSERT INTO understanding_source_runs (
|
|
107
|
-
run_id, grant_id, kind, status, cursor_before, metadata_json, started_at
|
|
108
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
109
|
-
`).run(id, input.grantId, input.kind, input.status ?? "running", input.cursorBefore ?? null, JSON.stringify(input.metadata ?? {}), now));
|
|
108
|
+
run_id, grant_id, connector_learning_job_id, kind, status, cursor_before, metadata_json, started_at
|
|
109
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
110
|
+
`).run(id, input.grantId, input.connectorLearningJobId ?? null, input.kind, input.status ?? "running", input.cursorBefore ?? null, JSON.stringify(input.metadata ?? {}), now));
|
|
110
111
|
return getUnderstandingSourceRun(id);
|
|
111
112
|
}
|
|
113
|
+
function getConnectorUnderstandingSourceRun(connectorLearningJobId) {
|
|
114
|
+
const row = getSqliteDatabase().prepare("SELECT * FROM understanding_source_runs WHERE connector_learning_job_id = ?").get(connectorLearningJobId);
|
|
115
|
+
return row ? runFromRow(row) : null;
|
|
116
|
+
}
|
|
117
|
+
function getOrCreateConnectorUnderstandingSourceRun(input) {
|
|
118
|
+
const id = randomUUID();
|
|
119
|
+
const now = input.nowMs ?? Date.now();
|
|
120
|
+
runSqliteWriteTransaction((db) => db.prepare(`
|
|
121
|
+
INSERT OR IGNORE INTO understanding_source_runs (
|
|
122
|
+
run_id, grant_id, connector_learning_job_id, kind, status, metadata_json, started_at
|
|
123
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
124
|
+
`).run(id, input.grantId, input.connectorLearningJobId, input.kind, input.status ?? "running", JSON.stringify(input.metadata ?? {}), now));
|
|
125
|
+
return getConnectorUnderstandingSourceRun(input.connectorLearningJobId);
|
|
126
|
+
}
|
|
112
127
|
function getUnderstandingSourceRun(id) {
|
|
113
128
|
const row = getSqliteDatabase().prepare("SELECT * FROM understanding_source_runs WHERE run_id = ?").get(id);
|
|
114
129
|
return row ? runFromRow(row) : null;
|
|
@@ -127,4 +142,4 @@ function updateUnderstandingSourceRun(id, patch) {
|
|
|
127
142
|
return getUnderstandingSourceRun(id);
|
|
128
143
|
}
|
|
129
144
|
//#endregion
|
|
130
|
-
export { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant };
|
|
145
|
+
export { createUnderstandingSourceRun, getConnectorUnderstandingSourceRun, getOrCreateConnectorUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant };
|
|
@@ -63,6 +63,7 @@ export interface UnderstandingSourceCollectionResult {
|
|
|
63
63
|
export interface UnderstandingSourceRun {
|
|
64
64
|
id: string;
|
|
65
65
|
grantId: string;
|
|
66
|
+
connectorLearningJobId?: string;
|
|
66
67
|
kind: 'preview' | 'bootstrap' | 'incremental' | 'fingerprint';
|
|
67
68
|
status: 'queued' | 'running' | 'completed' | 'partial' | 'failed' | 'canceled';
|
|
68
69
|
cursorBefore?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.317",
|
|
4
4
|
"description": "Local-first personal AI for the one-person company, with durable context, tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@composio/core": "0.18.1",
|
|
69
|
-
"@earendil-works/pi-agent-core": "0.
|
|
70
|
-
"@earendil-works/pi-ai": "0.
|
|
71
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
72
|
-
"@earendil-works/pi-tui": "0.
|
|
69
|
+
"@earendil-works/pi-agent-core": "0.87.0",
|
|
70
|
+
"@earendil-works/pi-ai": "0.87.0",
|
|
71
|
+
"@earendil-works/pi-coding-agent": "0.87.0",
|
|
72
|
+
"@earendil-works/pi-tui": "0.87.0",
|
|
73
73
|
"@grammyjs/runner": "^2.0.3",
|
|
74
74
|
"@hono/node-server": "^2.0.4",
|
|
75
75
|
"@inquirer/prompts": "^8.5.0",
|
|
@@ -171,11 +171,11 @@
|
|
|
171
171
|
"vue": "^3.5.35",
|
|
172
172
|
"@xopcai/browser-control-contract": "0.1.0",
|
|
173
173
|
"@xopcai/computer-control-contract": "0.1.0",
|
|
174
|
-
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
175
174
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
176
175
|
"@xopcai/gateway-contract": "0.0.0",
|
|
177
|
-
"@xopcai/
|
|
178
|
-
"@xopcai/realtime-client": "0.0.0"
|
|
176
|
+
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
177
|
+
"@xopcai/realtime-client": "0.0.0",
|
|
178
|
+
"@xopcai/realtime-protocol": "0.0.0"
|
|
179
179
|
},
|
|
180
180
|
"scripts": {
|
|
181
181
|
"assets:brand": "node scripts/generate-brand-assets.mjs",
|