@xopcai/xopc 0.0.174 → 0.0.175
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/{activity-store-CyEDJeIt.js → activity-store-CM6mQUS2.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DF7Bol6I.js → agent-avatar-dicebear-eckyE9AY.js} +1 -1
- package/dist/gateway/static/root/assets/agents-D-OIB_r0.js +2 -0
- package/dist/gateway/static/root/assets/{api-DwyUxpgY.js → api-2SLLStKp.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DYunqroX.js → api-BfMRS6FX.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B4xJyvDu.js → app-management-settings-panel-DYkzZQzZ.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B2PQxRiu.js → appearance-settings-CDXXN57j.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CuvFyvuu.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DWhBmmjD.js → archive-plugin-k909a76t.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BOpZfa_I.js → attachment-load-CqNzyhdJ.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Byu3I7Rs.js → automation-suggestion-card-snNG6u0v.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-DetGVTjI.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-6AG1qatz.js → binary-plugins-PfQ9ZHDF.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CJhrn98_.js → block-editor-Xrw-DnE_.js} +6 -6
- package/dist/gateway/static/root/assets/browser-settings-page-G92AdEnX.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CBVb4mt9.js → browser-workflow-inputs-DJPF2lUY.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Cq4XUKbu.js → browser-workflows-page-BoXs4pgc.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-nS_AMN1K.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-hbW4NAKO.js → capability-presets-api-BgY-Ysmi.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DIO8ZNHW.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CzMjHb17.js → channel-recipient-api-D32T1EJM.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-4Im3vtnO.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-CMctpuqb.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-B9Au6gMZ.js → connector-logo-C-l8haIK.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-vL3SjHSc.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-CwOI_Hei.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CNff5TFb.js → desktop-pet-settings-Cldo_pA3.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Bf956uo-.js → directory-picker-path-field-CMASXbgJ.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CHM8FE1g.js → dreaming-settings-BnMx02w0.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-ZqM_0eUs.js → extension-debug-page-mUFs3ign.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D4hvXOMM.js → extension-page-BsFBOZ5N.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-GsqxaJjA.js → extension-settings-page-CTEoovnV.js} +1 -1
- package/dist/gateway/static/root/assets/{focus-detail-page-CE6uwrl1.js → focus-detail-page-CCaZthpU.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-B4THmgnS.js → gateway-config-api-Bwx-EetD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CPv-MxGE.js → gateway-settings-CvgyqhR_.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-MP3K71pP.js → gateway-startup-retry-C8f5KwkT.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-Bhynl9LN.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-ChS2rU0w.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-DCcDuIjG.js → goals-config-api-CUnfbgHa.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BAS_liXl.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-o9QMXvNq.js → goals-settings-Bkk-tOcf.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DixwpXnH.js → heartbeat-settings-D9Pldf5E.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BOGH9FGi.js → image-generation-api-D7aCMgOv.js} +1 -1
- package/dist/gateway/static/root/assets/index-DJ5vdaHk.css +1 -0
- package/dist/gateway/static/root/assets/{index-eyttVNS_.js → index-TnouSpay.js} +7 -7
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D4o4ZPF6.js → keyboard-shortcuts-settings-CBhtXhHb.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-HQeu_F1C.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-GzMmpO7G.js → local-apps-page-BtJGF3M8.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CAuhEGCn.js → locale-store-DO-u1yS7.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-0lvwfLAA.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-CIX8D1pv.js → markdown-split-BGPaeTch.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bp3eIA45.js → media-plugins-C_Cx8v6u.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-BiBdO1-O.js → messages-BP8aQX-5.js} +2 -2
- package/dist/gateway/static/root/assets/{notes-page-RVFiYAoO.js → notes-page-CIYy5BKF.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-_FgNPlOx.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BGAYH3Ef.js → page-tabs-C2vsdfJO.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BM6pDkHp.js → preview-open-alternatives-D_VT83bW.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BiMetEmn.js → product-open-page-BNP9kZ3Q.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-MNi-3mZU.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-xx8nUKZO.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-H5DSn2bR.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BdjV8MK5.js → save-bar-controls-BJL6Xb-F.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-ChlqXU46.js → schedule-field-CxCPSLbu.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DDKf5ZSH.js → schema-form-Cao1wGbk.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CMQsupwM.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-OBUdG6bV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CPG0KGVs.js → settings-form-section-9pgClEud.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DRSDHucM.js → settings-loading-skeleton-CQz0gEUK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CeB7_xD0.js → settings-page-DgsMzZLm.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BENrkwd0.js → settings-page-layout-BhqupMfG.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-B7BsWxJt.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DIzczJkG.js → share-preview-page-CC4dQsQN.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bhz21P05.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CBP-UB88.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-A0rNObNB.js +2 -0
- package/dist/gateway/static/root/assets/skills-page.utils-CF4AYPQg.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Dp4d5Q1B.js → system-settings-panel-CzZHWI4u.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CbGc1laW.js → theme-store-BZWNdSZC.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-BC922Mdg.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-DwPk3OPL.js → typed-models-lib-C1S-B1pk.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CXrEu2dw.js → use-channel-catalog-DTiLxcLF.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-8XdpiAyP.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DFoA79LB.js → voice-api-key-field-CtIYRNfI.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-DBer86NF.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-BUPyfYaq.js +1 -0
- package/dist/gateway/static/root/assets/work-page-G8phwwI1.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BuniGPO0.js → workflow-run-setup-panel-IKxqDAXw.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CNls7g6v.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.d.ts +2 -0
- package/dist/src/agent/skills/index.js +14 -5
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/test-framework.js +1 -1
- package/dist/src/automations/domain/defaults.d.ts +1 -0
- package/dist/src/automations/domain/defaults.js +4 -0
- package/dist/src/automations/domain/index.d.ts +1 -0
- package/dist/src/automations/domain/index.js +2 -1
- package/dist/src/automations/index.js +2 -1
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/home.d.ts +16 -3
- package/dist/src/gateway/hono/routes/home.js +98 -25
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/project-skills.d.ts +3 -0
- package/dist/src/gateway/hono/routes/project-skills.js +119 -0
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/projects/index.d.ts +1 -0
- package/dist/src/projects/index.js +2 -1
- package/dist/src/projects/project-skill-service.d.ts +67 -0
- package/dist/src/projects/project-skill-service.js +131 -0
- package/dist/src/storage/sqlite/home-attention-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/home-attention-repository.js +21 -0
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/067_home_attention_acknowledgements.sql +9 -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/schema.sql +10 -0
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-BVxEFPQ5.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-BtIgd82S.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-CG_SCH5b.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CfLqPWZC.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DCJmm6cR.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CnkAYvWI.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-DtqqFpDn.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-C-5yHbc0.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CaHfs8YF.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-CvFMKYdb.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DAeb82xP.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-CwLSp01r.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-DvJQ6_4M.js +0 -2
- package/dist/gateway/static/root/assets/index-CfXiRNN5.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CPcfqn_A.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-DXABWCZp.js +0 -7
- package/dist/gateway/static/root/assets/notes-workbench-DgJzZRX3.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-DF7F70Vg.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Cw3jyi5s.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-ChAJsaNY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BxZIxt7z.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DcDLS0xV.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-4Xa9NA7v.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BpN0o5Cf.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DvF2UAaL.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CGKXpNfy.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-BhgCeDuO.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Dy_fKAK_.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BWkjb1NK.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DLBNFse5.js +0 -1
- package/dist/gateway/static/root/assets/work-page-Bn5RXMIE.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-_vFhRrAl.js +0 -11
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ProjectSkillError, ProjectSkillService } from "../../../projects/project-skill-service.js";
|
|
2
|
+
import "../../../projects/index.js";
|
|
3
|
+
//#region src/gateway/hono/routes/project-skills.ts
|
|
4
|
+
function projectSkills(deps) {
|
|
5
|
+
return new ProjectSkillService({
|
|
6
|
+
projects: deps.service.projects,
|
|
7
|
+
getConfig: () => deps.service.currentConfig,
|
|
8
|
+
refreshSkills: () => deps.service.agentService.refreshSkillsAfterDiskChange()
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function errorResponse(c, error) {
|
|
12
|
+
if (error instanceof ProjectSkillError) return c.json({
|
|
13
|
+
ok: false,
|
|
14
|
+
code: error.code,
|
|
15
|
+
error: error.message
|
|
16
|
+
}, error.status);
|
|
17
|
+
return c.json({
|
|
18
|
+
ok: false,
|
|
19
|
+
code: "project_skill_operation_failed",
|
|
20
|
+
error: error instanceof Error ? error.message : String(error)
|
|
21
|
+
}, 400);
|
|
22
|
+
}
|
|
23
|
+
function registerProjectSkillRoutes(authenticated, deps) {
|
|
24
|
+
authenticated.get("/api/projects/:projectId/skills", (c) => {
|
|
25
|
+
try {
|
|
26
|
+
return c.json({
|
|
27
|
+
ok: true,
|
|
28
|
+
...projectSkills(deps).list(c.req.param("projectId"))
|
|
29
|
+
});
|
|
30
|
+
} catch (error) {
|
|
31
|
+
return errorResponse(c, error);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
authenticated.get("/api/projects/:projectId/skills/:skillId", (c) => {
|
|
35
|
+
try {
|
|
36
|
+
return c.json({
|
|
37
|
+
ok: true,
|
|
38
|
+
skill: projectSkills(deps).getContent(c.req.param("projectId"), c.req.param("skillId"))
|
|
39
|
+
});
|
|
40
|
+
} catch (error) {
|
|
41
|
+
return errorResponse(c, error);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
authenticated.post("/api/projects/:projectId/skills/upload", async (c) => {
|
|
45
|
+
try {
|
|
46
|
+
const body = await c.req.parseBody();
|
|
47
|
+
const file = body.file;
|
|
48
|
+
if (!(file instanceof File)) return c.json({
|
|
49
|
+
ok: false,
|
|
50
|
+
error: "Skill zip file is required"
|
|
51
|
+
}, 400);
|
|
52
|
+
const skill = await projectSkills(deps).installZip(c.req.param("projectId"), Buffer.from(await file.arrayBuffer()), {
|
|
53
|
+
skillId: typeof body.skillId === "string" ? body.skillId : void 0,
|
|
54
|
+
overwrite: body.overwrite === "true"
|
|
55
|
+
});
|
|
56
|
+
return c.json({
|
|
57
|
+
ok: true,
|
|
58
|
+
skill
|
|
59
|
+
}, 201);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
return errorResponse(c, error);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
authenticated.post("/api/projects/:projectId/skills/marketplace/install", async (c) => {
|
|
65
|
+
try {
|
|
66
|
+
const body = await c.req.json();
|
|
67
|
+
const name = typeof body.name === "string" ? body.name.trim() : "";
|
|
68
|
+
if (!name) return c.json({
|
|
69
|
+
ok: false,
|
|
70
|
+
error: "Marketplace skill name is required"
|
|
71
|
+
}, 400);
|
|
72
|
+
const skill = await projectSkills(deps).installMarketplace(c.req.param("projectId"), {
|
|
73
|
+
name,
|
|
74
|
+
version: typeof body.version === "string" ? body.version : void 0,
|
|
75
|
+
provider: typeof body.provider === "string" ? body.provider : void 0,
|
|
76
|
+
overwrite: body.overwrite === true
|
|
77
|
+
});
|
|
78
|
+
return c.json({
|
|
79
|
+
ok: true,
|
|
80
|
+
skill
|
|
81
|
+
}, 201);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
return errorResponse(c, error);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
authenticated.post("/api/projects/:projectId/skills/source/install", async (c) => {
|
|
87
|
+
try {
|
|
88
|
+
const body = await c.req.json();
|
|
89
|
+
const source = typeof body.source === "string" ? body.source.trim() : "";
|
|
90
|
+
if (!source) return c.json({
|
|
91
|
+
ok: false,
|
|
92
|
+
error: "Skill source is required"
|
|
93
|
+
}, 400);
|
|
94
|
+
const skill = await projectSkills(deps).installSource(c.req.param("projectId"), {
|
|
95
|
+
source,
|
|
96
|
+
skillId: typeof body.skillId === "string" ? body.skillId : void 0,
|
|
97
|
+
ref: typeof body.ref === "string" ? body.ref : void 0,
|
|
98
|
+
subpath: typeof body.subpath === "string" ? body.subpath : void 0,
|
|
99
|
+
force: body.force === true
|
|
100
|
+
});
|
|
101
|
+
return c.json({
|
|
102
|
+
ok: true,
|
|
103
|
+
skill
|
|
104
|
+
}, 201);
|
|
105
|
+
} catch (error) {
|
|
106
|
+
return errorResponse(c, error);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
authenticated.delete("/api/projects/:projectId/skills/:skillId", async (c) => {
|
|
110
|
+
try {
|
|
111
|
+
await projectSkills(deps).remove(c.req.param("projectId"), c.req.param("skillId"));
|
|
112
|
+
return c.json({ ok: true });
|
|
113
|
+
} catch (error) {
|
|
114
|
+
return errorResponse(c, error);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { registerProjectSkillRoutes };
|
|
@@ -2,8 +2,8 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
|
-
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
6
5
|
import { resolveGatewayService } from "../daemon/service.js";
|
|
6
|
+
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
7
7
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
8
8
|
import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
|
|
9
9
|
import { refreshGatewayServiceAfterUpdate } from "./update-service-refresh.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
export * from './project-store.js';
|
|
3
3
|
export * from './project-service.js';
|
|
4
|
+
export * from './project-skill-service.js';
|
|
4
5
|
export * from './project-agent.js';
|
|
5
6
|
export * from './project-agent-suggestion.js';
|
|
6
7
|
export * from './project-kind.js';
|
|
@@ -4,6 +4,7 @@ import { bindGoalToProject, bindGoalsToProject, listProjectGoalIds, unbindGoalFr
|
|
|
4
4
|
import { bindSessionToProject, bindSessionsToProject, listProjectSessionKeys, moveSessionToProject, unbindSessionFromProject } from "./session-bind.js";
|
|
5
5
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError, canonicalWorkspacePath, ensureWorkspaceDirectory, inferProjectNameFromWorkspaceRoot, isPathSameOrInsideWorkspace, isSafeAutoCreateWorkspaceRoot, resolveWorkspaceProjectRoot, workspaceDirectoryExists } from "./workspace-project.js";
|
|
6
6
|
import { ProjectService } from "./project-service.js";
|
|
7
|
+
import { ProjectSkillError, ProjectSkillService } from "./project-skill-service.js";
|
|
7
8
|
import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId } from "./project-agent.js";
|
|
8
9
|
import { inferProjectKind } from "./project-kind.js";
|
|
9
10
|
import { CODING_PROJECT_AGENT_ID, inferSuggestedProjectDefaultAgentId, suggestProjectDefaultAgentId } from "./project-agent-suggestion.js";
|
|
@@ -11,4 +12,4 @@ import { buildProjectLoopOverview } from "./project-loop.js";
|
|
|
11
12
|
import { bindWorkflowRunToProject } from "./workflow-bind.js";
|
|
12
13
|
import { bindAutomationToProject } from "./automation-bind.js";
|
|
13
14
|
import { bindMemoryRecordToProject } from "./memory-bind.js";
|
|
14
|
-
export { CODING_PROJECT_AGENT_ID, ProjectService, ProjectStore, ProjectWorkspaceConflictError, ProjectWorkspaceMissingError, bindAutomationToProject, bindGoalToProject, bindGoalsToProject, bindMemoryRecordToProject, bindSessionToProject, bindSessionsToProject, bindWorkflowRunToProject, buildProjectLoopOverview, canonicalWorkspacePath, ensureWorkspaceDirectory, getProjectForSession, getProjectWorkspacePathForSession, inferProjectKind, inferProjectNameFromWorkspaceRoot, inferSuggestedProjectDefaultAgentId, isPathSameOrInsideWorkspace, isSafeAutoCreateWorkspaceRoot, isValidProjectAgentId, listProjectGoalIds, listProjectSessionKeys, moveSessionToProject, normalizeProjectAgentId, resolveProjectAgentId, resolveProjectWorkspacePath, resolveWorkspaceProjectRoot, slugifyProjectName, suggestProjectDefaultAgentId, unbindGoalFromProject, unbindSessionFromProject, workspaceDirectoryExists };
|
|
15
|
+
export { CODING_PROJECT_AGENT_ID, ProjectService, ProjectSkillError, ProjectSkillService, ProjectStore, ProjectWorkspaceConflictError, ProjectWorkspaceMissingError, bindAutomationToProject, bindGoalToProject, bindGoalsToProject, bindMemoryRecordToProject, bindSessionToProject, bindSessionsToProject, bindWorkflowRunToProject, buildProjectLoopOverview, canonicalWorkspacePath, ensureWorkspaceDirectory, getProjectForSession, getProjectWorkspacePathForSession, inferProjectKind, inferProjectNameFromWorkspaceRoot, inferSuggestedProjectDefaultAgentId, isPathSameOrInsideWorkspace, isSafeAutoCreateWorkspaceRoot, isValidProjectAgentId, listProjectGoalIds, listProjectSessionKeys, moveSessionToProject, normalizeProjectAgentId, resolveProjectAgentId, resolveProjectWorkspacePath, resolveWorkspaceProjectRoot, slugifyProjectName, suggestProjectDefaultAgentId, unbindGoalFromProject, unbindSessionFromProject, workspaceDirectoryExists };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Config } from '../config/schema.js';
|
|
2
|
+
import type { SkillDiagnostic, SkillMetadata, SkillToolConditions } from '../agent/skills/types.js';
|
|
3
|
+
import type { ProjectService } from './project-service.js';
|
|
4
|
+
export type ProjectSkillErrorCode = 'project_not_found' | 'project_workspace_required' | 'project_workspace_missing' | 'project_workspace_not_writable' | 'skill_not_found' | 'invalid_skill_id';
|
|
5
|
+
export declare class ProjectSkillError extends Error {
|
|
6
|
+
readonly code: ProjectSkillErrorCode;
|
|
7
|
+
readonly status: 400 | 403 | 404 | 409;
|
|
8
|
+
constructor(code: ProjectSkillErrorCode, status: 400 | 403 | 404 | 409, message: string);
|
|
9
|
+
}
|
|
10
|
+
export interface ProjectSkillSummary {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
category?: string;
|
|
15
|
+
disableModelInvocation: boolean;
|
|
16
|
+
metadata: SkillMetadata;
|
|
17
|
+
toolConditions?: SkillToolConditions;
|
|
18
|
+
requiredEnvVarNames?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface ProjectSkillListResult {
|
|
21
|
+
workspaceRoot: string;
|
|
22
|
+
skillsRoot: string;
|
|
23
|
+
items: ProjectSkillSummary[];
|
|
24
|
+
diagnostics: SkillDiagnostic[];
|
|
25
|
+
}
|
|
26
|
+
interface ProjectSkillServiceOptions {
|
|
27
|
+
projects: ProjectService;
|
|
28
|
+
getConfig: () => Config;
|
|
29
|
+
refreshSkills: () => void | Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export declare class ProjectSkillService {
|
|
32
|
+
private readonly options;
|
|
33
|
+
constructor(options: ProjectSkillServiceOptions);
|
|
34
|
+
list(projectId: string): ProjectSkillListResult;
|
|
35
|
+
getContent(projectId: string, skillId: string): ProjectSkillSummary & {
|
|
36
|
+
bodyMarkdown: string;
|
|
37
|
+
};
|
|
38
|
+
installZip(projectId: string, buffer: Buffer, input?: {
|
|
39
|
+
skillId?: string;
|
|
40
|
+
overwrite?: boolean;
|
|
41
|
+
}): Promise<ProjectSkillSummary & {
|
|
42
|
+
bodyMarkdown: string;
|
|
43
|
+
}>;
|
|
44
|
+
installMarketplace(projectId: string, input: {
|
|
45
|
+
name: string;
|
|
46
|
+
version?: string;
|
|
47
|
+
provider?: string;
|
|
48
|
+
overwrite?: boolean;
|
|
49
|
+
}): Promise<ProjectSkillSummary & {
|
|
50
|
+
bodyMarkdown: string;
|
|
51
|
+
}>;
|
|
52
|
+
installSource(projectId: string, input: {
|
|
53
|
+
source: string;
|
|
54
|
+
skillId?: string;
|
|
55
|
+
ref?: string;
|
|
56
|
+
subpath?: string;
|
|
57
|
+
force?: boolean;
|
|
58
|
+
}): Promise<ProjectSkillSummary & {
|
|
59
|
+
bodyMarkdown: string;
|
|
60
|
+
}>;
|
|
61
|
+
remove(projectId: string, skillId: string): Promise<void>;
|
|
62
|
+
private findSkill;
|
|
63
|
+
private resolveLocation;
|
|
64
|
+
private isDirectSkill;
|
|
65
|
+
private toSummary;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "../agent/skills/workspace-skills-dir.js";
|
|
2
|
+
import { loadWorkspaceSkills } from "../agent/skills/index.js";
|
|
3
|
+
import { removeSkillsLockEntry } from "../agent/skills/hub-lock.js";
|
|
4
|
+
import { deleteManagedSkill, installSkillFromZip, isValidSkillId } from "../agent/skills/managed-store.js";
|
|
5
|
+
import { pullSkillFromSource } from "../agent/skills/hub-pull.js";
|
|
6
|
+
import { downloadFromMarketplace } from "../agent/skills/skills-marketplace.js";
|
|
7
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
8
|
+
import { accessSync, constants, existsSync, statSync } from "node:fs";
|
|
9
|
+
//#region src/projects/project-skill-service.ts
|
|
10
|
+
var ProjectSkillError = class extends Error {
|
|
11
|
+
constructor(code, status, message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.name = "ProjectSkillError";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var ProjectSkillService = class {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
}
|
|
22
|
+
list(projectId) {
|
|
23
|
+
const location = this.resolveLocation(projectId, false);
|
|
24
|
+
const loaded = loadWorkspaceSkills(location.workspaceRoot);
|
|
25
|
+
return {
|
|
26
|
+
...location,
|
|
27
|
+
items: loaded.skills.filter((skill) => this.isDirectSkill(skill, location.skillsRoot)).map((skill) => this.toSummary(skill)),
|
|
28
|
+
diagnostics: loaded.diagnostics
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
getContent(projectId, skillId) {
|
|
32
|
+
const { skill } = this.findSkill(projectId, skillId);
|
|
33
|
+
return {
|
|
34
|
+
...this.toSummary(skill),
|
|
35
|
+
bodyMarkdown: skill.content
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async installZip(projectId, buffer, input = {}) {
|
|
39
|
+
const location = this.resolveLocation(projectId, true);
|
|
40
|
+
const installed = installSkillFromZip(buffer, {
|
|
41
|
+
skillId: input.skillId,
|
|
42
|
+
overwrite: input.overwrite,
|
|
43
|
+
rootDir: location.skillsRoot
|
|
44
|
+
});
|
|
45
|
+
removeSkillsLockEntry(installed.skillId, resolveWorkspaceSkillsLockPath(location.workspaceRoot));
|
|
46
|
+
await this.options.refreshSkills();
|
|
47
|
+
return this.getContent(projectId, installed.skillId);
|
|
48
|
+
}
|
|
49
|
+
async installMarketplace(projectId, input) {
|
|
50
|
+
const downloaded = await downloadFromMarketplace(this.options.getConfig(), input.name, input.version, input.provider);
|
|
51
|
+
return this.installZip(projectId, downloaded.buffer, {
|
|
52
|
+
skillId: downloaded.skillId,
|
|
53
|
+
overwrite: input.overwrite
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async installSource(projectId, input) {
|
|
57
|
+
const location = this.resolveLocation(projectId, true);
|
|
58
|
+
const installed = await pullSkillFromSource(input.source, {
|
|
59
|
+
skillId: input.skillId,
|
|
60
|
+
ref: input.ref,
|
|
61
|
+
subpath: input.subpath,
|
|
62
|
+
force: input.force,
|
|
63
|
+
installRoot: location.skillsRoot,
|
|
64
|
+
lockPath: resolveWorkspaceSkillsLockPath(location.workspaceRoot)
|
|
65
|
+
});
|
|
66
|
+
await this.options.refreshSkills();
|
|
67
|
+
return this.getContent(projectId, installed.skillId);
|
|
68
|
+
}
|
|
69
|
+
async remove(projectId, skillId) {
|
|
70
|
+
const location = this.resolveLocation(projectId, true);
|
|
71
|
+
if (!isValidSkillId(skillId)) throw new ProjectSkillError("invalid_skill_id", 400, "Invalid skill id");
|
|
72
|
+
if (!existsSync(join(location.skillsRoot, skillId, "SKILL.md"))) throw new ProjectSkillError("skill_not_found", 404, "Project skill not found");
|
|
73
|
+
deleteManagedSkill(skillId, location.skillsRoot);
|
|
74
|
+
removeSkillsLockEntry(skillId, resolveWorkspaceSkillsLockPath(location.workspaceRoot));
|
|
75
|
+
await this.options.refreshSkills();
|
|
76
|
+
}
|
|
77
|
+
findSkill(projectId, skillId) {
|
|
78
|
+
if (!isValidSkillId(skillId)) throw new ProjectSkillError("invalid_skill_id", 400, "Invalid skill id");
|
|
79
|
+
const location = this.resolveLocation(projectId, false);
|
|
80
|
+
const skill = loadWorkspaceSkills(location.workspaceRoot).skills.find((item) => {
|
|
81
|
+
return !relative(location.skillsRoot, item.baseDir).includes(sep) && basename(item.baseDir) === skillId;
|
|
82
|
+
});
|
|
83
|
+
if (!skill) throw new ProjectSkillError("skill_not_found", 404, "Project skill not found");
|
|
84
|
+
return {
|
|
85
|
+
skill,
|
|
86
|
+
skillsRoot: location.skillsRoot
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
resolveLocation(projectId, requireWritable) {
|
|
90
|
+
const project = this.options.projects.get(projectId);
|
|
91
|
+
if (!project) throw new ProjectSkillError("project_not_found", 404, "Project not found");
|
|
92
|
+
const configuredRoot = project.workspaceRoot?.trim();
|
|
93
|
+
if (!configuredRoot) throw new ProjectSkillError("project_workspace_required", 409, "Project workspace is required");
|
|
94
|
+
const workspaceRoot = resolve(configuredRoot);
|
|
95
|
+
try {
|
|
96
|
+
if (!existsSync(workspaceRoot) || !statSync(workspaceRoot).isDirectory()) throw new ProjectSkillError("project_workspace_missing", 409, "Project workspace does not exist");
|
|
97
|
+
} catch (error) {
|
|
98
|
+
if (error instanceof ProjectSkillError) throw error;
|
|
99
|
+
throw new ProjectSkillError("project_workspace_missing", 409, "Project workspace does not exist");
|
|
100
|
+
}
|
|
101
|
+
const skillsRoot = resolveWorkspaceSkillsDir(workspaceRoot);
|
|
102
|
+
if (requireWritable) try {
|
|
103
|
+
const xopcRoot = dirname(skillsRoot);
|
|
104
|
+
accessSync(existsSync(skillsRoot) ? skillsRoot : existsSync(xopcRoot) ? xopcRoot : workspaceRoot, constants.W_OK);
|
|
105
|
+
} catch {
|
|
106
|
+
throw new ProjectSkillError("project_workspace_not_writable", 403, "Project workspace is not writable");
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
workspaceRoot,
|
|
110
|
+
skillsRoot
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
isDirectSkill(skill, skillsRoot) {
|
|
114
|
+
const rel = relative(skillsRoot, skill.baseDir);
|
|
115
|
+
return Boolean(rel) && !rel.includes(sep) && isValidSkillId(basename(skill.baseDir));
|
|
116
|
+
}
|
|
117
|
+
toSummary(skill) {
|
|
118
|
+
return {
|
|
119
|
+
id: basename(skill.baseDir),
|
|
120
|
+
name: skill.name,
|
|
121
|
+
description: skill.description,
|
|
122
|
+
category: skill.category,
|
|
123
|
+
disableModelInvocation: skill.disableModelInvocation,
|
|
124
|
+
metadata: skill.metadata,
|
|
125
|
+
toolConditions: skill.toolConditions,
|
|
126
|
+
requiredEnvVarNames: skill.requiredEnvVarNames
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
//#endregion
|
|
131
|
+
export { ProjectSkillError, ProjectSkillService };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type HomeAttentionSubjectKind = 'automation_run' | 'workflow_run';
|
|
2
|
+
export declare function acknowledgeHomeAttention(subjectKind: HomeAttentionSubjectKind, subjectId: string, acknowledgedAt?: number): void;
|
|
3
|
+
export declare function isHomeAttentionAcknowledged(subjectKind: HomeAttentionSubjectKind, subjectId: string): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
//#region src/storage/sqlite/home-attention-repository.ts
|
|
3
|
+
function acknowledgeHomeAttention(subjectKind, subjectId, acknowledgedAt = Date.now()) {
|
|
4
|
+
runSqliteWriteTransaction((db) => {
|
|
5
|
+
db.prepare(`
|
|
6
|
+
INSERT INTO home_attention_acknowledgements (subject_kind, subject_id, acknowledged_at)
|
|
7
|
+
VALUES (?, ?, ?)
|
|
8
|
+
ON CONFLICT(subject_kind, subject_id) DO UPDATE SET
|
|
9
|
+
acknowledged_at = excluded.acknowledged_at
|
|
10
|
+
`).run(subjectKind, subjectId, acknowledgedAt);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function isHomeAttentionAcknowledged(subjectKind, subjectId) {
|
|
14
|
+
return getSqliteDatabase().prepare(`
|
|
15
|
+
SELECT 1
|
|
16
|
+
FROM home_attention_acknowledgements
|
|
17
|
+
WHERE subject_kind = ? AND subject_id = ?
|
|
18
|
+
`).get(subjectKind, subjectId) !== void 0;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { acknowledgeHomeAttention, isHomeAttentionAcknowledged };
|
|
@@ -5,6 +5,7 @@ export { DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, } from './m
|
|
|
5
5
|
export { discoverSqlMigrations, listRegisteredMigrationTargets } from './migrations/discover.js';
|
|
6
6
|
export { closeXopcDatabase, getXopcDatabase, isXopcDatabaseOpen, openXopcDatabase, requireXopcDatabase, resetXopcDatabaseSingletonForTest, type OpenXopcDatabaseOptions, type XopcDatabase, } from './connection.js';
|
|
7
7
|
export { getSqliteDatabase, runSqliteWriteTransaction } from './transaction.js';
|
|
8
|
+
export { acknowledgeHomeAttention, isHomeAttentionAcknowledged, type HomeAttentionSubjectKind, } from './home-attention-repository.js';
|
|
8
9
|
export { getUserClaim, linkUserClaimMemoryRecord, listUserClaimEvidence, listUserClaimStatsBySource, listUserClaims, listUserPeopleGraphRows, removeUserClaimEvidenceForSource, reinforceUserClaim, resolveUserEntity, setUserClaimDecision, type UserClaim, type UserClaimClass, type UserClaimState, type UserEntity, } from './user-claims-repository.js';
|
|
9
10
|
export { claimNextConnectorLearningJob, enqueueConnectorLearningJob, listConnectorLearningJobs, recoverStaleConnectorLearningJobs, setConnectorLearningPaused, updateConnectorLearningJob, type ConnectorLearningJob, type ConnectorLearningMode, type ConnectorLearningPhase, type ConnectorLearningStatus, } from './connector-learning-repository.js';
|
|
10
11
|
export { appendComposerInputHistory, clearComposerInputHistory, listComposerInputHistory, COMPOSER_INPUT_HISTORY_LIMIT, type ComposerInputHistoryItem, } from './composer-input-history-repository.js';
|
|
@@ -6,6 +6,7 @@ import { XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, applyPendingMi
|
|
|
6
6
|
import { ensureXopcDatabaseSchema } from "./schema.js";
|
|
7
7
|
import { closeXopcDatabase, getXopcDatabase, isXopcDatabaseOpen, openXopcDatabase, requireXopcDatabase, resetXopcDatabaseSingletonForTest } from "./connection.js";
|
|
8
8
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
9
|
+
import { acknowledgeHomeAttention, isHomeAttentionAcknowledged } from "./home-attention-repository.js";
|
|
9
10
|
import { getUserClaim, linkUserClaimMemoryRecord, listUserClaimEvidence, listUserClaimStatsBySource, listUserClaims, listUserPeopleGraphRows, reinforceUserClaim, removeUserClaimEvidenceForSource, resolveUserEntity, setUserClaimDecision } from "./user-claims-repository.js";
|
|
10
11
|
import { claimNextConnectorLearningJob, enqueueConnectorLearningJob, listConnectorLearningJobs, recoverStaleConnectorLearningJobs, setConnectorLearningPaused, updateConnectorLearningJob } from "./connector-learning-repository.js";
|
|
11
12
|
import { COMPOSER_INPUT_HISTORY_LIMIT, appendComposerInputHistory, clearComposerInputHistory, listComposerInputHistory } from "./composer-input-history-repository.js";
|
|
@@ -27,4 +28,4 @@ import { appendConnectorExecutionAudit, claimConnectorWebhookDelivery, completeC
|
|
|
27
28
|
import { getUserTrustPolicy, setUserTrustPolicy } from "./user-trust-repository.js";
|
|
28
29
|
import { consumeMemoryReferenceConsent, decideMemoryReferenceConsent, ensureMemoryReferenceConsentRequest, hasMemoryReferenceConsent, listMemoryReferenceConsents, revokeMemoryReferenceConsent } from "./memory-reference-consent-repository.js";
|
|
29
30
|
import { getUserProfilePromptState, setUserProfilePromptState } from "./user-profile-setup-repository.js";
|
|
30
|
-
export { COMPOSER_INPUT_HISTORY_LIMIT, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, SCHEMA_META_SCHEMA_VERSION_KEY, USER_UNDERSTANDING_REMEDIATION_POLICY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, appendCompactionBoundary, appendComposerInputHistory, appendConnectorExecutionAudit, appendMemorySignal, appendMemoryTraceEvent, appendTranscriptEntry, applyPendingMigrations, attachMemoryEvidence, buildDefaultSessionMetadata, buildGlobalSessionStats, buildRelationshipPrompt, claimConnectorWebhookDelivery, claimKnowledgeSourceItems, claimNextConnectorLearningJob, classifyStoredRow, clearComposerInputHistory, closeXopcDatabase, completeConnectorWebhookDelivery, completeKnowledgeSourceItemSynthesis, completeTaskOutcome, consumeConnectorApproval, consumeMemoryReferenceConsent, createConnectorApproval, createObjectLinkRecord, decideConnectorApproval, decideMemoryReferenceConsent, deleteConnectorConnection, deleteConnectorInstallation, deleteMemoryEvidenceForRecord, deleteMemoryRecord, deleteNoteAgentContextRecord, deleteNoteRecord, deleteSessionConfig, deleteSessionRecord, discoverSqlMigrations, enqueueConnectorLearningJob, ensureMemoryReferenceConsentRequest, ensureSessionRecord, ensureXopcDatabaseSchema, estimateTokensFromMessages, extractFtsContent, findLatestMemoryInjectTrace, findSessionKeyBySessionId, findTaskOutcomeForAssistant, finishKnowledgeSyncRun, getActivityEventRecord, getCachedConnectorCatalogEntry, getConnectorApproval, getConnectorConnection, getConnectorInstallation, getCurrentSessionId, getGlobalSessionStats, getInteractionState, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, getMemoryProviderState, getMemoryRecord, getNoteAgentContextRecord, getNoteRecord, getRelationshipSettings, getSessionConfig, getSessionMetadata, getSessionPersistedLevels, getSqliteDatabase, getTaskOutcome, getUserClaim, getUserProfilePromptState, getUserTrustPolicy, getXopcDatabase, hasMemoryReferenceConsent, hasSessionConfig, hasUnresolvedMemoryConflict, incrementSessionStatsOnAppend, inspectSchemaMigrationStatus, isProactiveSupportAllowed, isXopcDatabaseOpen, linkUserClaimMemoryRecord, listActivityRecords, listCachedConnectorCatalogEntries, listCompactionBoundaries, listComposerInputHistory, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, listConnectorLearningJobs, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, listMemoryEvidence, listMemoryRecords, listMemoryReferenceConsents, listMemorySignals, listMemoryTraceEvents, listNoteRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, listRegisteredMigrationTargets, listSessionMetadata, listSessionsByAgent, listTaskOutcomes, listUserClaimEvidence, listUserClaimStatsBySource, listUserClaims, listUserPeopleGraphRows, loadLlmMessagesForSession, loadTranscriptHistoryRowsForSession, loadTranscriptRows, loadTranscriptRowsForSession, markMemoryRecordsConflicted, metadataToSessionInsert, openXopcDatabase, paginateTranscriptMessages, patchSessionMetadata, pruneBoundedKnowledgeSourceItems, readSchemaVersion, readSchemaVersionForTest, recordActivityEvent, recoverStaleConnectorLearningJobs, reinforceUserClaim, releaseConnectorWebhookDelivery, removeUserClaimEvidenceForSource, replaceConnectorCatalogEntries, replaceTranscriptRows, requireXopcDatabase, resetSessionRecord, resetXopcDatabaseSingletonForTest, resolveMigrationsDir, resolveSessionAgentId, resolveUserEntity, resolveXopcDatabasePath, restoreBeforeCompactionBoundary, revokeMemoryReferenceConsent, runSqliteWriteTransaction, searchMemoryIndex, searchMemoryRecords, sessionConfigRowToConfig, sessionRowToMetadata, setConnectorLearningPaused, setInteractionState, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, setLatestMemoryInjectFeedback, setMemoryProviderState, setMemoryTraceFeedback, setSessionConfig, setTaskOutcomeFeedback, setUserClaimDecision, setUserProfilePromptState, setUserTrustPolicy, startKnowledgeSyncRun, startTaskOutcome, summarizeMemoryRecallFeedback, summarizeTaskOutcomes, summarizeUserUnderstandingQuality, syncMemoryIndex, transcriptEntryRowToStoredRow, updateConnectorLearningJob, updateInteractionStateFromMessage, updateRelationshipSettings, updateSessionConfig, updateSessionStats, updateTaskOutcome, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, upsertKnowledgeSourceItems, upsertMemoryRecord, upsertNoteAgentContextRecord, upsertNoteRecord };
|
|
31
|
+
export { COMPOSER_INPUT_HISTORY_LIMIT, DatabaseSchemaMigrationGapError, DatabaseSchemaTooNewError, SCHEMA_META_SCHEMA_VERSION_KEY, USER_UNDERSTANDING_REMEDIATION_POLICY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_FILENAME, XOPC_DB_SCHEMA_VERSION, acknowledgeHomeAttention, appendCompactionBoundary, appendComposerInputHistory, appendConnectorExecutionAudit, appendMemorySignal, appendMemoryTraceEvent, appendTranscriptEntry, applyPendingMigrations, attachMemoryEvidence, buildDefaultSessionMetadata, buildGlobalSessionStats, buildRelationshipPrompt, claimConnectorWebhookDelivery, claimKnowledgeSourceItems, claimNextConnectorLearningJob, classifyStoredRow, clearComposerInputHistory, closeXopcDatabase, completeConnectorWebhookDelivery, completeKnowledgeSourceItemSynthesis, completeTaskOutcome, consumeConnectorApproval, consumeMemoryReferenceConsent, createConnectorApproval, createObjectLinkRecord, decideConnectorApproval, decideMemoryReferenceConsent, deleteConnectorConnection, deleteConnectorInstallation, deleteMemoryEvidenceForRecord, deleteMemoryRecord, deleteNoteAgentContextRecord, deleteNoteRecord, deleteSessionConfig, deleteSessionRecord, discoverSqlMigrations, enqueueConnectorLearningJob, ensureMemoryReferenceConsentRequest, ensureSessionRecord, ensureXopcDatabaseSchema, estimateTokensFromMessages, extractFtsContent, findLatestMemoryInjectTrace, findSessionKeyBySessionId, findTaskOutcomeForAssistant, finishKnowledgeSyncRun, getActivityEventRecord, getCachedConnectorCatalogEntry, getConnectorApproval, getConnectorConnection, getConnectorInstallation, getCurrentSessionId, getGlobalSessionStats, getInteractionState, getKnowledgeConsumerWatermark, getKnowledgeSourceCursor, getKnowledgeSourceItem, getMemoryProviderState, getMemoryRecord, getNoteAgentContextRecord, getNoteRecord, getRelationshipSettings, getSessionConfig, getSessionMetadata, getSessionPersistedLevels, getSqliteDatabase, getTaskOutcome, getUserClaim, getUserProfilePromptState, getUserTrustPolicy, getXopcDatabase, hasMemoryReferenceConsent, hasSessionConfig, hasUnresolvedMemoryConflict, incrementSessionStatsOnAppend, inspectSchemaMigrationStatus, isHomeAttentionAcknowledged, isProactiveSupportAllowed, isXopcDatabaseOpen, linkUserClaimMemoryRecord, listActivityRecords, listCachedConnectorCatalogEntries, listCompactionBoundaries, listComposerInputHistory, listConnectorActionMetadata, listConnectorApprovals, listConnectorConnections, listConnectorExecutionAudit, listConnectorInstallations, listConnectorLearningJobs, listKnowledgeSourceChanges, listKnowledgeSourceItems, listKnowledgeSyncRuns, listMemoryEvidence, listMemoryRecords, listMemoryReferenceConsents, listMemorySignals, listMemoryTraceEvents, listNoteRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, listRegisteredMigrationTargets, listSessionMetadata, listSessionsByAgent, listTaskOutcomes, listUserClaimEvidence, listUserClaimStatsBySource, listUserClaims, listUserPeopleGraphRows, loadLlmMessagesForSession, loadTranscriptHistoryRowsForSession, loadTranscriptRows, loadTranscriptRowsForSession, markMemoryRecordsConflicted, metadataToSessionInsert, openXopcDatabase, paginateTranscriptMessages, patchSessionMetadata, pruneBoundedKnowledgeSourceItems, readSchemaVersion, readSchemaVersionForTest, recordActivityEvent, recoverStaleConnectorLearningJobs, reinforceUserClaim, releaseConnectorWebhookDelivery, removeUserClaimEvidenceForSource, replaceConnectorCatalogEntries, replaceTranscriptRows, requireXopcDatabase, resetSessionRecord, resetXopcDatabaseSingletonForTest, resolveMigrationsDir, resolveSessionAgentId, resolveUserEntity, resolveXopcDatabasePath, restoreBeforeCompactionBoundary, revokeMemoryReferenceConsent, runSqliteWriteTransaction, searchMemoryIndex, searchMemoryRecords, sessionConfigRowToConfig, sessionRowToMetadata, setConnectorLearningPaused, setInteractionState, setKnowledgeConsumerWatermark, setKnowledgeSourceCursor, setKnowledgeSourceItemSynthesisStatus, setLatestMemoryInjectFeedback, setMemoryProviderState, setMemoryTraceFeedback, setSessionConfig, setTaskOutcomeFeedback, setUserClaimDecision, setUserProfilePromptState, setUserTrustPolicy, startKnowledgeSyncRun, startTaskOutcome, summarizeMemoryRecallFeedback, summarizeTaskOutcomes, summarizeUserUnderstandingQuality, syncMemoryIndex, transcriptEntryRowToStoredRow, updateConnectorLearningJob, updateInteractionStateFromMessage, updateRelationshipSettings, updateSessionConfig, updateSessionStats, updateTaskOutcome, upsertConnectorActionMetadata, upsertConnectorCatalogEntry, upsertConnectorConnection, upsertConnectorInstallation, upsertKnowledgeSourceItems, upsertMemoryRecord, upsertNoteAgentContextRecord, upsertNoteRecord };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS home_attention_acknowledgements (
|
|
2
|
+
subject_kind TEXT NOT NULL CHECK (subject_kind IN ('automation_run', 'workflow_run')),
|
|
3
|
+
subject_id TEXT NOT NULL,
|
|
4
|
+
acknowledged_at INTEGER NOT NULL,
|
|
5
|
+
PRIMARY KEY (subject_kind, subject_id)
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
CREATE INDEX IF NOT EXISTS idx_home_attention_acknowledged_at
|
|
9
|
+
ON home_attention_acknowledgements(acknowledged_at DESC);
|
|
@@ -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 = 11;
|
|
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 = 67;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -12,7 +12,7 @@ const log = createLogger("Sqlite:Migrations");
|
|
|
12
12
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
13
13
|
const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
14
14
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
15
|
-
const XOPC_DB_SCHEMA_VERSION =
|
|
15
|
+
const XOPC_DB_SCHEMA_VERSION = 67;
|
|
16
16
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
17
17
|
function resolveMigrationsDir(override) {
|
|
18
18
|
if (override) return override;
|
|
@@ -46,7 +46,7 @@ function applySingleMigration(db, migration) {
|
|
|
46
46
|
* Each step runs in its own transaction and updates schema_meta on success.
|
|
47
47
|
*/
|
|
48
48
|
function applyPendingMigrations(db, options = {}) {
|
|
49
|
-
const targetVersion = options.targetVersion ??
|
|
49
|
+
const targetVersion = options.targetVersion ?? 67;
|
|
50
50
|
let currentVersion = readSchemaVersion(db);
|
|
51
51
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
52
52
|
if (currentVersion >= targetVersion) return currentVersion;
|
|
@@ -62,7 +62,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
62
62
|
}
|
|
63
63
|
/** Inspect schema version without mutating the database. */
|
|
64
64
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
65
|
-
const appVersion = options.targetVersion ??
|
|
65
|
+
const appVersion = options.targetVersion ?? 67;
|
|
66
66
|
const dbVersion = readSchemaVersion(db);
|
|
67
67
|
if (dbVersion > appVersion) return {
|
|
68
68
|
dbVersion,
|
|
@@ -19,7 +19,7 @@ const log = createLogger('Sqlite:Migrations');
|
|
|
19
19
|
export const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
20
20
|
|
|
21
21
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
22
|
-
export const XOPC_DB_SCHEMA_VERSION =
|
|
22
|
+
export const XOPC_DB_SCHEMA_VERSION = 67;
|
|
23
23
|
|
|
24
24
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
31
31
|
bootstrapFreshDatabase(db);
|
|
32
32
|
currentVersion = 11;
|
|
33
33
|
}
|
|
34
|
-
applyPendingMigrations(db, { targetVersion:
|
|
34
|
+
applyPendingMigrations(db, { targetVersion: 67 });
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, ensureSchemaMetaTable, ensureXopcDatabaseSchema, readSchemaVersion, readSchemaVersionForTest, setSchemaVersion };
|
|
@@ -189,6 +189,16 @@ CREATE INDEX IF NOT EXISTS idx_workflow_runs_definition_created
|
|
|
189
189
|
CREATE INDEX IF NOT EXISTS idx_workflow_runs_created
|
|
190
190
|
ON workflow_runs(agent_id, created_at_ms DESC);
|
|
191
191
|
|
|
192
|
+
CREATE TABLE IF NOT EXISTS home_attention_acknowledgements (
|
|
193
|
+
subject_kind TEXT NOT NULL CHECK (subject_kind IN ('automation_run', 'workflow_run')),
|
|
194
|
+
subject_id TEXT NOT NULL,
|
|
195
|
+
acknowledged_at INTEGER NOT NULL,
|
|
196
|
+
PRIMARY KEY (subject_kind, subject_id)
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
CREATE INDEX IF NOT EXISTS idx_home_attention_acknowledged_at
|
|
200
|
+
ON home_attention_acknowledgements(acknowledged_at DESC);
|
|
201
|
+
|
|
192
202
|
CREATE TABLE IF NOT EXISTS notes (
|
|
193
203
|
note_id TEXT PRIMARY KEY,
|
|
194
204
|
title TEXT,
|
|
@@ -3,8 +3,8 @@ import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.
|
|
|
3
3
|
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir, resolveUserProfilePath } from "../config/paths.js";
|
|
4
4
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
5
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
|
6
|
-
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
7
6
|
import { loadSkills } from "../agent/skills/index.js";
|
|
7
|
+
import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
|
|
8
8
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
9
9
|
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
10
10
|
import "../config/index.js";
|
|
@@ -4,8 +4,8 @@ import { publishAutomationProductEvent } from "../../automations/product-events.
|
|
|
4
4
|
import { GoalService } from "../../goals/goal-service.js";
|
|
5
5
|
import "../../goals/index.js";
|
|
6
6
|
import { DelegateSubagentRunner } from "../../agent/workflow/subagent-runner.js";
|
|
7
|
-
import { resolveModelRef } from "../../config/agent-typed-models.js";
|
|
8
7
|
import { preflightWorkflowConnectors } from "../../connectors/workflow-preflight.js";
|
|
8
|
+
import { resolveModelRef } from "../../config/agent-typed-models.js";
|
|
9
9
|
import { CatalogWorkflowDefinitionRegistry } from "../registry/catalog-workflow-definition-registry.js";
|
|
10
10
|
import { validateWorkflowJsonSchema } from "../domain/schema-validation.js";
|
|
11
11
|
import { isTerminalWorkflowRunStatus } from "../domain/run.js";
|
package/package.json
CHANGED