@xopcai/xopc 0.0.225 → 0.0.227
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-CtTYnku4.js → activity-store-BevwE16n.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-dizuqu_4.js → agent-avatar-dicebear-BggVQrEZ.js} +1 -1
- package/dist/gateway/static/root/assets/agents-TJpjRHnr.js +68 -0
- package/dist/gateway/static/root/assets/{api-CLRMz2BT.js → api-Bx_BpIt8.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Cnk-DtQh.js → app-management-settings-panel-BtKP9n2r.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-wP0rogVI.js → appearance-settings-BoH2NAUX.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CZ4Da51l.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Cpzsm-DM.js → archive-plugin-DnceUyxm.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Bd2OOoEK.js → attachment-load-Bh8_9gkr.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DNqhguyk.js → automations-page-ZKeAAVxD.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-2Y00PvJU.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Dcma5HdI.js → binary-plugins-Cy9er6w-.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D-B8ThwK.js → block-editor-Cc0wWvNX.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-CbJD27_j.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BAPZIXrs.js → browser-workflow-inputs-BS7rpLLl.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DHtaSKEh.js → browser-workflows-page-BdBVUZXm.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Dv8y6OuP.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-zsZQ7im3.js → capability-presets-api-D1Lqz0Tt.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-TZmjzWzt.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-Cp8iaaXp.js → channel-recipient-api-CGuEl-l2.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-CFW7zBoT.js → channels-settings-g-68dutA.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-D7KsAeWh.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dr6Rq2ln.js → chat-terminal-dock-CdX_7aQh.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DXA0rAvQ.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BiXrpzmo.js → cron-expression-BnSQc4Ek.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-BPuRtwKt.js → date-picker-BbuG7zQ_.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BNC_W7wI.js → dependency-picker-snZeqOmG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DzOpt5nI.js → desktop-pet-DJQ8JoR1.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BW0brCvH.js → desktop-pet-settings-B9txsRtv.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Baml0uTS.js → directory-picker-path-field-D7WKWkNB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CBXyKmfS.js → extension-debug-page-D_7cOCj2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BBhcr_SZ.js → extension-page-Bwu47iUb.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-4rwWpN9_.js → extension-settings-page-Dwg4dSZM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Dg-BlBe4.js → gateway-config-api-jURUSte_.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Du0MvK9s.js → gateway-config-swr-6SQXF1yR.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BOuYZOYe.js → gateway-settings-UklJOMLX.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-JbjcHCaN.js → gateway-startup-retry-DqWaxyvZ.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-Djs_nduD.js +1 -0
- package/dist/gateway/static/root/assets/{home-page-BIXkO0Ck.js → home-page-i6bXCHdo.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-G2tfPvKP.js → image-generation-api-Bxmt6LEr.js} +1 -1
- package/dist/gateway/static/root/assets/index-BBBE89vm.css +2 -0
- package/dist/gateway/static/root/assets/index-BsD5wygl.js +74 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-L1Vtxgp9.js → keyboard-shortcuts-settings-ByVsCH3d.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-D-eacBcO.js → local-app-workbench-page-BCKEDMlP.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page--thlkBLS.js → local-apps-page-D19R-xsz.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DqJz-cOR.js → locale-store-Ci1Qi0Q-.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BRCglHvd.js → logs-page-Cy9YQK7j.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-p55fR4XO.js → management-settings-G0y7zmfY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-DwMcRlBR.js → markdown-split-B69d2HWt.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CTB9u15e.js → markdown-view-CBM-v2ph.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-O6H3GZn7.js → media-plugins-6TWEQgN_.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CtOJwGW3.js +3 -0
- package/dist/gateway/static/root/assets/{notes-api-CrjQbmk1.js → notes-api-DLsnnZCS.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-miO9ig9C.js → notes-page-CkRJJKDm.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-B10T3hGX.js +4 -0
- package/dist/gateway/static/root/assets/{product-open-page-BOu07nXf.js → product-open-page-HxArIvoN.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DsqRlgsy.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-CY03RxVr.js → projects-page-Bu2PN8OK.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Bf_HDLUJ.js → registry-api-lEar5FOV.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CXACdJ2f.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DthuRqUH.js → runtime-tools-settings-panel-Bf03UNGD.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-8W8PhXxa.js → schema-form-CIXMBgx5.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CS2knWDT.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByFGk0q_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CrsKGYiG.js → settings-form-section-DgdB26mE.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-WJtI0AAq.js → settings-loading-skeleton-efk5W6lG.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-PCjwRF47.js → settings-page-BHVf4gEP.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-D65CwlNC.js → setup-status-panel-WK0dGNMv.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BGtvLLeZ.js → share-preview-page-Cod-w2qm.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CUqQ31gt.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DweAPjI8.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-C_npyryI.js → skills-page-DwCcipqK.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-C46Sd78k.js → skills-page.utils-3WSbtl3S.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DomTLwki.js → system-settings-panel-C5VxqC_s.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DEj-BFMP.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Ce7wq__X.js → theme-store-Dd89g_ki.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Do9mCRcY.js → use-autosave-CeV8VJh2.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-f7yh7aD5.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bc5p-0tX.js → voice-api-key-field-EmJ-8aZu.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BieqsmT1.js → work-discovery-overlay-zsk6E3Mi.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CBAYvm3G.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-BN0JmHrG.js +5 -0
- package/dist/gateway/static/root/index.html +11 -11
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +3 -1
- package/dist/src/agent/agent-manager.js +22 -5
- package/dist/src/agent/memory/understanding/service.js +1 -0
- package/dist/src/agent/memory/understanding/types.d.ts +1 -0
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +6 -0
- package/dist/src/agent/skills/index.d.ts +22 -2
- package/dist/src/agent/skills/index.js +74 -32
- package/dist/src/agent/skills/skill-sources.d.ts +0 -1
- package/dist/src/agent/skills/skill-sources.js +1 -11
- 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/connectors/connected-source-understanding.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +18 -16
- package/dist/src/gateway/hono/routes/project-skills.js +30 -2
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/hono/routes/you.js +52 -0
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.js +12 -3
- package/dist/src/knowledge/index.d.ts +0 -1
- package/dist/src/knowledge/index.js +1 -2
- package/dist/src/projects/project-skill-service.d.ts +28 -6
- package/dist/src/projects/project-skill-service.js +76 -29
- 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/135_user_people.sql +59 -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/user-people-repository.d.ts +32 -0
- package/dist/src/storage/sqlite/user-people-repository.js +246 -0
- package/dist/src/user-context/relationships/indexer.d.ts +13 -0
- package/dist/src/user-context/relationships/indexer.js +185 -0
- package/dist/src/user-context/relationships/service.d.ts +22 -0
- package/dist/src/user-context/relationships/service.js +50 -0
- package/dist/src/user-context/relationships/types.d.ts +55 -0
- package/dist/src/user-context/relationships/types.js +10 -0
- package/dist/src/user-context/sources/repository.d.ts +1 -1
- package/dist/src/user-context/sources/repository.js +8 -2
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-DeEEFZJ4.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-Db5YNHVM.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CNT05YTb.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-UbDj3LIq.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CiO152QS.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Bc_hRwfL.js +0 -3
- package/dist/gateway/static/root/assets/channels-status-swr-5rNVq7iI.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DLBr5nre.js +0 -2
- package/dist/gateway/static/root/assets/heartbeat-settings-Dq4YAlSx.js +0 -1
- package/dist/gateway/static/root/assets/index-Csccu8sa.js +0 -74
- package/dist/gateway/static/root/assets/index-D3_xSYKd.css +0 -2
- package/dist/gateway/static/root/assets/messages-CeydamsI.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-_13lmvmF.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-BStRkOQr.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B19llkld.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BDA2qbTd.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BONIDX4v.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CdzVKrBl.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CsRWid5h.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-B6YFX7kK.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-CiCQA40E.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DVj8iYvm.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-AG04TTuH.js +0 -5
- package/dist/src/knowledge/people-graph.d.ts +0 -25
- package/dist/src/knowledge/people-graph.js +0 -92
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { type ResolveSkillSourcesOptions } from './skill-sources.js';
|
|
2
2
|
import type { Skill, SkillConfig, SkillDiagnostic, LoadSkillsResult } from './types.js';
|
|
3
|
+
export type WorkspaceSkillSourceState = 'active' | 'missing' | 'disabled' | 'untrusted' | 'invalid';
|
|
4
|
+
export interface WorkspaceSkillSourceStatus {
|
|
5
|
+
origin: 'xopc-workspace' | 'agents-workspace';
|
|
6
|
+
rootDir: string;
|
|
7
|
+
managed: boolean;
|
|
8
|
+
writable: boolean;
|
|
9
|
+
state: WorkspaceSkillSourceState;
|
|
10
|
+
}
|
|
11
|
+
export interface WorkspaceSkillInventoryEntry {
|
|
12
|
+
skill: Skill;
|
|
13
|
+
effective: boolean;
|
|
14
|
+
shadowedBy?: Skill['origin']['id'];
|
|
15
|
+
}
|
|
16
|
+
export interface WorkspaceSkillInventoryResult {
|
|
17
|
+
entries: WorkspaceSkillInventoryEntry[];
|
|
18
|
+
sources: WorkspaceSkillSourceStatus[];
|
|
19
|
+
diagnostics: SkillDiagnostic[];
|
|
20
|
+
}
|
|
3
21
|
export declare function loadSkills(options: ResolveSkillSourcesOptions & {
|
|
4
22
|
/** Dependency-injection override for the ~/.agents/skills compatibility root. */
|
|
5
23
|
agentsDir?: string;
|
|
6
24
|
}): LoadSkillsResult;
|
|
7
|
-
/** Discover
|
|
8
|
-
export declare function
|
|
25
|
+
/** Discover project-owned XOPC and Agents skills with runtime-equivalent trust and precedence. */
|
|
26
|
+
export declare function loadWorkspaceSkillInventory(workspaceDir: string, options: {
|
|
27
|
+
workspaceTrust: 'trusted' | 'untrusted';
|
|
28
|
+
}): WorkspaceSkillInventoryResult;
|
|
9
29
|
export interface SkillLoader {
|
|
10
30
|
init: (workspace: string, builtin: string | null) => LoadSkillsResult;
|
|
11
31
|
load: () => LoadSkillsResult;
|
|
@@ -9,7 +9,8 @@ import { parseSkillToolConditions } from "./skill-tool-gating.js";
|
|
|
9
9
|
import { formatSkillsForPrompt } from "./format-skills-prompt.js";
|
|
10
10
|
import { parseRequiredEnvVarNames } from "./required-env-vars.js";
|
|
11
11
|
import { parseSkillMetadata } from "./parse-skill-metadata.js";
|
|
12
|
-
import {
|
|
12
|
+
import { resolveWorkspaceSkillsDir } from "./workspace-skills-dir.js";
|
|
13
|
+
import { resolveSkillSources, resolveWorkspaceAgentsSkillsDir } from "./skill-sources.js";
|
|
13
14
|
import { collectSkillInstallWarnings, formatScanSummary, scanSkillDirectory } from "./scanner.js";
|
|
14
15
|
import { SkillTestFramework, SkillTestRunner, formatTestResults, formatTestResultsJson, formatTestResultsTap } from "./test-framework.js";
|
|
15
16
|
import { basename, dirname, join, relative, sep } from "path";
|
|
@@ -119,6 +120,45 @@ function discoverSkills(source, maxSkillFileBytes) {
|
|
|
119
120
|
diagnostics
|
|
120
121
|
};
|
|
121
122
|
}
|
|
123
|
+
function discoverAndMergeSkills(sources, maxSkillFileBytes, initialDiagnostics = []) {
|
|
124
|
+
const skillMap = /* @__PURE__ */ new Map();
|
|
125
|
+
const discoveredSkills = [];
|
|
126
|
+
const diagnostics = [...initialDiagnostics];
|
|
127
|
+
for (const source of sources) {
|
|
128
|
+
const discovered = discoverSkills(source, maxSkillFileBytes);
|
|
129
|
+
diagnostics.push(...discovered.diagnostics);
|
|
130
|
+
for (const skill of discovered.skills) {
|
|
131
|
+
discoveredSkills.push(skill);
|
|
132
|
+
const previous = skillMap.get(skill.name);
|
|
133
|
+
if (previous) {
|
|
134
|
+
const winner = skill.origin.priority > previous.origin.priority ? skill : previous;
|
|
135
|
+
const shadowed = winner === skill ? previous : skill;
|
|
136
|
+
diagnostics.push({
|
|
137
|
+
type: "collision",
|
|
138
|
+
skillName: skill.name,
|
|
139
|
+
path: winner.filePath,
|
|
140
|
+
message: `Skill "${skill.name}" from ${winner.origin.id} (${winner.filePath}) shadows ${shadowed.origin.id} (${shadowed.filePath})`
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (!previous || skill.origin.priority > previous.origin.priority) skillMap.set(skill.name, skill);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
skills: [...skillMap.values()],
|
|
148
|
+
entries: discoveredSkills.map((skill) => {
|
|
149
|
+
const winner = skillMap.get(skill.name);
|
|
150
|
+
return winner === skill ? {
|
|
151
|
+
skill,
|
|
152
|
+
effective: true
|
|
153
|
+
} : {
|
|
154
|
+
skill,
|
|
155
|
+
effective: false,
|
|
156
|
+
shadowedBy: winner.origin.id
|
|
157
|
+
};
|
|
158
|
+
}),
|
|
159
|
+
diagnostics
|
|
160
|
+
};
|
|
161
|
+
}
|
|
122
162
|
function deriveDescriptionFromMarkdown(content) {
|
|
123
163
|
let fallbackHeading = "";
|
|
124
164
|
for (const rawLine of content.split(/\r?\n/)) {
|
|
@@ -197,40 +237,42 @@ function loadSkills(options) {
|
|
|
197
237
|
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
198
238
|
const resolvedSources = resolveSkillSources(options, skillsConfig);
|
|
199
239
|
const maxSkillFileBytes = resolveMaxSkillFileBytes(skillsConfig);
|
|
200
|
-
const
|
|
201
|
-
const diagnostics = [...resolvedSources.diagnostics];
|
|
202
|
-
for (const source of resolvedSources.sources) {
|
|
203
|
-
const discovered = discoverSkills(source, maxSkillFileBytes);
|
|
204
|
-
diagnostics.push(...discovered.diagnostics);
|
|
205
|
-
for (const skill of discovered.skills) {
|
|
206
|
-
const previous = skillMap.get(skill.name);
|
|
207
|
-
if (previous) {
|
|
208
|
-
const winner = skill.origin.priority > previous.origin.priority ? skill : previous;
|
|
209
|
-
const shadowed = winner === skill ? previous : skill;
|
|
210
|
-
diagnostics.push({
|
|
211
|
-
type: "collision",
|
|
212
|
-
skillName: skill.name,
|
|
213
|
-
path: winner.filePath,
|
|
214
|
-
message: `Skill "${skill.name}" from ${winner.origin.id} (${winner.filePath}) shadows ${shadowed.origin.id} (${shadowed.filePath})`
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
if (!previous || skill.origin.priority > previous.origin.priority) skillMap.set(skill.name, skill);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
const merged = Array.from(skillMap.values());
|
|
240
|
+
const merged = discoverAndMergeSkills(resolvedSources.sources, maxSkillFileBytes, resolvedSources.diagnostics);
|
|
221
241
|
return {
|
|
222
|
-
skills: merged,
|
|
223
|
-
prompt: formatSkillsForPrompt(merged, skillsConfig),
|
|
224
|
-
diagnostics
|
|
242
|
+
skills: merged.skills,
|
|
243
|
+
prompt: formatSkillsForPrompt(merged.skills, skillsConfig),
|
|
244
|
+
diagnostics: merged.diagnostics
|
|
225
245
|
};
|
|
226
246
|
}
|
|
227
|
-
/** Discover
|
|
228
|
-
function
|
|
229
|
-
const
|
|
230
|
-
const
|
|
247
|
+
/** Discover project-owned XOPC and Agents skills with runtime-equivalent trust and precedence. */
|
|
248
|
+
function loadWorkspaceSkillInventory(workspaceDir, options) {
|
|
249
|
+
const skillsConfig = createSkillConfigManager(resolveStateDir()).load();
|
|
250
|
+
const resolved = resolveSkillSources({
|
|
251
|
+
workspaceDir,
|
|
252
|
+
workspaceTrust: options.workspaceTrust
|
|
253
|
+
}, skillsConfig);
|
|
254
|
+
const maxSkillFileBytes = resolveMaxSkillFileBytes(skillsConfig);
|
|
255
|
+
const workspaceSources = resolved.sources.filter((source) => source.id === "xopc-workspace" || source.id === "agents-workspace");
|
|
256
|
+
const discovered = discoverAndMergeSkills(workspaceSources, maxSkillFileBytes, resolved.diagnostics);
|
|
257
|
+
const agentsRoot = resolveWorkspaceAgentsSkillsDir(workspaceDir);
|
|
258
|
+
const agentsDiagnostic = resolved.diagnostics.find((diagnostic) => diagnostic.type === "warning" && diagnostic.message.includes("agents-workspace"));
|
|
259
|
+
const agentsEnabled = skillsConfig.load?.sources?.agentsWorkspace?.enabled !== false;
|
|
260
|
+
const agentsSource = workspaceSources.find((source) => source.id === "agents-workspace");
|
|
231
261
|
return {
|
|
232
|
-
|
|
233
|
-
|
|
262
|
+
entries: discovered.entries,
|
|
263
|
+
sources: [{
|
|
264
|
+
origin: "xopc-workspace",
|
|
265
|
+
rootDir: resolveWorkspaceSkillsDir(workspaceDir),
|
|
266
|
+
managed: true,
|
|
267
|
+
writable: true,
|
|
268
|
+
state: "active"
|
|
269
|
+
}, {
|
|
270
|
+
origin: "agents-workspace",
|
|
271
|
+
rootDir: agentsRoot,
|
|
272
|
+
managed: false,
|
|
273
|
+
writable: false,
|
|
274
|
+
state: !agentsEnabled ? "disabled" : !existsSync(agentsRoot) ? "missing" : agentsSource ? "active" : agentsDiagnostic?.type === "warning" ? "invalid" : "untrusted"
|
|
275
|
+
}],
|
|
234
276
|
diagnostics: discovered.diagnostics
|
|
235
277
|
};
|
|
236
278
|
}
|
|
@@ -288,4 +330,4 @@ function createSkillLoader(options = {}) {
|
|
|
288
330
|
};
|
|
289
331
|
}
|
|
290
332
|
//#endregion
|
|
291
|
-
export { SkillTestFramework, SkillTestRunner, applySkillEnvOverrides, collectSkillInstallWarnings, createSkillConfigManager, createSkillLoader, findInstallSpec, formatScanSummary, formatTestResults, formatTestResultsJson, formatTestResultsTap, getSkillEnvironment, hasBinary, installSkill, isSkillEnabled, loadSkills,
|
|
333
|
+
export { SkillTestFramework, SkillTestRunner, applySkillEnvOverrides, collectSkillInstallWarnings, createSkillConfigManager, createSkillLoader, findInstallSpec, formatScanSummary, formatTestResults, formatTestResultsJson, formatTestResultsTap, getSkillEnvironment, hasBinary, installSkill, isSkillEnabled, loadSkills, loadWorkspaceSkillInventory, resolveSkillConfig, scanSkillDirectory, validateSkillConfig };
|
|
@@ -15,4 +15,3 @@ export interface ResolveSkillSourcesResult {
|
|
|
15
15
|
export declare function resolveSkillSources(options: ResolveSkillSourcesOptions, skillsConfig: SkillsConfig): ResolveSkillSourcesResult;
|
|
16
16
|
export declare function resolveAgentsSkillsDir(env?: NodeJS.ProcessEnv): string;
|
|
17
17
|
export declare function resolveWorkspaceAgentsSkillsDir(workspaceDir: string): string;
|
|
18
|
-
export declare function resolveWorkspaceSkillSource(workspaceDir: string): SkillSourceDescriptor;
|
|
@@ -129,15 +129,5 @@ function resolveAgentsSkillsDir(env = process.env) {
|
|
|
129
129
|
function resolveWorkspaceAgentsSkillsDir(workspaceDir) {
|
|
130
130
|
return join(workspaceDir, ".agents", "skills");
|
|
131
131
|
}
|
|
132
|
-
function resolveWorkspaceSkillSource(workspaceDir) {
|
|
133
|
-
return descriptor({
|
|
134
|
-
id: "xopc-workspace",
|
|
135
|
-
rootDir: resolveWorkspaceSkillsDir(workspaceDir),
|
|
136
|
-
priority: PRIORITY.xopcWorkspace,
|
|
137
|
-
scope: "workspace",
|
|
138
|
-
managed: true,
|
|
139
|
-
writable: true
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
132
|
//#endregion
|
|
143
|
-
export { resolveAgentsSkillsDir, resolveSkillSources, resolveWorkspaceAgentsSkillsDir
|
|
133
|
+
export { resolveAgentsSkillsDir, resolveSkillSources, resolveWorkspaceAgentsSkillsDir };
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v135).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveConfigPath } from "../../../config/paths.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
5
4
|
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
5
|
+
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
6
6
|
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
7
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
8
8
|
import { runServiceRestart, runServiceStop } from "./lifecycle-core.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { finishContextExtractionRun } from "../storage/sqlite/context-extraction-repository.js";
|
|
2
2
|
import { listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
3
3
|
import "../storage/sqlite/index.js";
|
|
4
|
+
import { focusLifecycle } from "../user-context/focus-lifecycle.js";
|
|
4
5
|
import { upsertUserFocus } from "../user-context/sources/repository.js";
|
|
5
6
|
import { claimRegisteredExtraction } from "../user-context/extraction/registry.js";
|
|
6
|
-
import { focusLifecycle } from "../user-context/focus-lifecycle.js";
|
|
7
7
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
8
8
|
import { analyzeUnderstandingSources } from "../work-discovery/analyzer.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { shouldSilence, stripHeartbeatToken } from "../../heartbeat/tokens.js";
|
|
4
|
-
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
5
4
|
import { isWithinActiveHours } from "../../heartbeat/active-hours.js";
|
|
6
5
|
import { isHeartbeatContentEmpty } from "../../heartbeat/content-check.js";
|
|
6
|
+
import { appendCronEventLines } from "../../heartbeat/event-prompt.js";
|
|
7
7
|
import { createHeartbeatWake } from "../../heartbeat/wake.js";
|
|
8
8
|
import { resolveHeartbeatMdPath } from "../workspace-heartbeat-path.js";
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -15,18 +15,17 @@ import { listUnderstandingSourceGrants, revokeUnderstandingSourceGrant } from ".
|
|
|
15
15
|
import { recordConnectorHealthUsage } from "../../../connectors/usage.js";
|
|
16
16
|
import { getConnectorInstance, getInstalledConnectorDefinition, listConnectorInstances } from "../../../connectors/instances.js";
|
|
17
17
|
import { installConnector, installConnectorDefinition, uninstallConnector, updateConnectorConfig } from "../../../connectors/install.js";
|
|
18
|
+
import { ConfigPersistenceError, persistConfigMutation } from "../../../config/config-mutation.js";
|
|
18
19
|
import { getMcpOAuthManager } from "../../../agent/mcp/oauth/mcp-oauth-manager.js";
|
|
19
20
|
import { startConnectorAuthorization } from "../../../connectors/auth-provider-registry.js";
|
|
20
21
|
import { composioLogoResponse } from "../../../connectors/composio-logo.js";
|
|
21
22
|
import { inspectManagedComposioStatus } from "../../../connectors/composio-managed-client.js";
|
|
22
23
|
import { appendComposioTriggerEvent, listComposioTriggerEvents } from "../../../connectors/composio-triggers.js";
|
|
23
|
-
import { buildConnectedPeopleGraph } from "../../../knowledge/people-graph.js";
|
|
24
|
-
import "../../../knowledge/index.js";
|
|
25
24
|
import { ingestLocalFolderSource } from "../../../connectors/connected-source-ingestion.js";
|
|
26
25
|
import { previewConnectorDefinition, testConnectorInstance } from "../../../connectors/health.js";
|
|
27
26
|
import { setConnectorEnabled } from "../../../connectors/lifecycle.js";
|
|
28
27
|
import { projectComposioConnectionStatus } from "../../../connectors/runtime-status.js";
|
|
29
|
-
import {
|
|
28
|
+
import { applySourceRevocationChoices, sourceRevocationImpact } from "./understanding-sources.js";
|
|
30
29
|
//#region src/gateway/hono/routes/connectors.ts
|
|
31
30
|
init_agent_scope();
|
|
32
31
|
function errorMessage(error) {
|
|
@@ -196,7 +195,14 @@ function registerConnectorRoutes(authenticated, deps) {
|
|
|
196
195
|
if (connectionId && !policy.scanEnabled) {
|
|
197
196
|
service.setConnectorLearningPaused(connectionId, true);
|
|
198
197
|
const grant = listUnderstandingSourceGrants().find((item) => item.sourceKey === `connector-account:${account.id}`);
|
|
199
|
-
if (grant)
|
|
198
|
+
if (grant) {
|
|
199
|
+
const impact = sourceRevocationImpact(grant.id);
|
|
200
|
+
revokeUnderstandingSourceGrant(grant.id);
|
|
201
|
+
if (impact) applySourceRevocationChoices(impact, {
|
|
202
|
+
derived: "retain",
|
|
203
|
+
raw: "retain"
|
|
204
|
+
});
|
|
205
|
+
}
|
|
200
206
|
} else if (connectionId && previous?.scanEnabled === false) {
|
|
201
207
|
if (service.setConnectorLearningPaused(connectionId, false) === 0) service.requestConnectorLearning(connectionId, {
|
|
202
208
|
mode: "incremental",
|
|
@@ -288,7 +294,14 @@ function registerConnectorRoutes(authenticated, deps) {
|
|
|
288
294
|
await revokeComposioConnection(connectionId);
|
|
289
295
|
if (connection?.accountId) {
|
|
290
296
|
const grant = listUnderstandingSourceGrants().find((item) => item.sourceKey === `connector-account:${connection.accountId}`);
|
|
291
|
-
if (grant)
|
|
297
|
+
if (grant) {
|
|
298
|
+
const impact = sourceRevocationImpact(grant.id);
|
|
299
|
+
revokeUnderstandingSourceGrant(grant.id);
|
|
300
|
+
if (impact) applySourceRevocationChoices(impact, {
|
|
301
|
+
derived: "retain",
|
|
302
|
+
raw: "retain"
|
|
303
|
+
});
|
|
304
|
+
}
|
|
292
305
|
}
|
|
293
306
|
return c.json({
|
|
294
307
|
ok: true,
|
|
@@ -450,17 +463,6 @@ function registerConnectorRoutes(authenticated, deps) {
|
|
|
450
463
|
}, 400);
|
|
451
464
|
}
|
|
452
465
|
});
|
|
453
|
-
authenticated.get("/api/connectors/people", (c) => {
|
|
454
|
-
const query = c.req.query("q") ?? "";
|
|
455
|
-
const limit = Number(c.req.query("limit") ?? "100");
|
|
456
|
-
return c.json({
|
|
457
|
-
ok: true,
|
|
458
|
-
payload: buildConnectedPeopleGraph({
|
|
459
|
-
query,
|
|
460
|
-
limit
|
|
461
|
-
})
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
466
|
authenticated.get("/api/connectors/:id", (c) => {
|
|
465
467
|
const connectorId = c.req.param("id");
|
|
466
468
|
const connector = getConnectorDefinition(connectorId);
|
|
@@ -5,6 +5,8 @@ function projectSkills(deps) {
|
|
|
5
5
|
return new ProjectSkillService({
|
|
6
6
|
projects: deps.service.projects,
|
|
7
7
|
getConfig: () => deps.service.currentConfig,
|
|
8
|
+
getWorkspaceTrust: (workspaceRoot) => deps.service.agentService.getWorkspaceTrust(workspaceRoot),
|
|
9
|
+
setWorkspaceTrust: (workspaceRoot, trusted) => deps.service.agentService.setWorkspaceTrust(workspaceRoot, trusted),
|
|
8
10
|
refreshSkills: () => deps.service.agentService.refreshSkillsAfterDiskChange()
|
|
9
11
|
});
|
|
10
12
|
}
|
|
@@ -31,11 +33,37 @@ function registerProjectSkillRoutes(authenticated, deps) {
|
|
|
31
33
|
return errorResponse(c, error);
|
|
32
34
|
}
|
|
33
35
|
});
|
|
34
|
-
authenticated.get("/api/projects/:projectId/
|
|
36
|
+
authenticated.get("/api/projects/:projectId/workspace-trust", (c) => {
|
|
35
37
|
try {
|
|
36
38
|
return c.json({
|
|
37
39
|
ok: true,
|
|
38
|
-
|
|
40
|
+
trust: projectSkills(deps).getWorkspaceTrust(c.req.param("projectId"))
|
|
41
|
+
});
|
|
42
|
+
} catch (error) {
|
|
43
|
+
return errorResponse(c, error);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
authenticated.patch("/api/projects/:projectId/workspace-trust", async (c) => {
|
|
47
|
+
try {
|
|
48
|
+
const body = await c.req.json();
|
|
49
|
+
if (typeof body.trusted !== "boolean") return c.json({
|
|
50
|
+
ok: false,
|
|
51
|
+
error: "Expected { trusted: boolean }"
|
|
52
|
+
}, 400);
|
|
53
|
+
const trust = projectSkills(deps).setWorkspaceTrust(c.req.param("projectId"), body.trusted);
|
|
54
|
+
return c.json({
|
|
55
|
+
ok: true,
|
|
56
|
+
trust
|
|
57
|
+
});
|
|
58
|
+
} catch (error) {
|
|
59
|
+
return errorResponse(c, error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
authenticated.get("/api/projects/:projectId/skills/:skillKey", (c) => {
|
|
63
|
+
try {
|
|
64
|
+
return c.json({
|
|
65
|
+
ok: true,
|
|
66
|
+
skill: projectSkills(deps).getContent(c.req.param("projectId"), c.req.param("skillKey"))
|
|
39
67
|
});
|
|
40
68
|
} catch (error) {
|
|
41
69
|
return errorResponse(c, error);
|
|
@@ -14,8 +14,8 @@ import "../../../voice/stt/index.js";
|
|
|
14
14
|
import { listSttProvidersForApi } from "../../../voice/stt/list-providers.js";
|
|
15
15
|
import "../../../voice/tts/index.js";
|
|
16
16
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
17
|
-
import { listTtsProvidersForApi } from "../../../voice/tts/list-providers.js";
|
|
18
17
|
import { listLocalVoiceModelStatuses, removeLocalVoiceModel, startLocalVoiceModelInstall } from "../../../voice/local/model-manager.js";
|
|
18
|
+
import { listTtsProvidersForApi } from "../../../voice/tts/list-providers.js";
|
|
19
19
|
//#region src/gateway/hono/routes/voice.ts
|
|
20
20
|
init_providers();
|
|
21
21
|
const log = createGatewayRouteLogger("Voice");
|
|
@@ -7,6 +7,8 @@ import { listUserFocuses, updateUserFocus } from "../../../user-context/sources/
|
|
|
7
7
|
import { canonicalUnderstandingKey, findDuplicateUnderstanding } from "../../../user-context/understanding.js";
|
|
8
8
|
import { listContextObjects } from "../../../user-context/context-objects.js";
|
|
9
9
|
import { repairExtractedContext } from "../../../user-context/extraction/repair.js";
|
|
10
|
+
import { getUserRelationship, listUserRelationships, mergeUserRelationships, patchUserRelationship } from "../../../user-context/relationships/service.js";
|
|
11
|
+
import { USER_PERSON_KINDS } from "../../../user-context/relationships/types.js";
|
|
10
12
|
import { userInfo } from "node:os";
|
|
11
13
|
//#region src/gateway/hono/routes/you.ts
|
|
12
14
|
const UNDERSTANDING_KIND_SET = new Set(UNDERSTANDING_KINDS);
|
|
@@ -42,6 +44,7 @@ const CONTEXT_OBJECT_VIEWS = new Set([
|
|
|
42
44
|
"review",
|
|
43
45
|
"history"
|
|
44
46
|
]);
|
|
47
|
+
const USER_PERSON_KIND_SET = new Set(USER_PERSON_KINDS);
|
|
45
48
|
function asRecord(value) {
|
|
46
49
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
47
50
|
}
|
|
@@ -99,6 +102,55 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
99
102
|
rules: listCollaborationRules(),
|
|
100
103
|
consolidation: { lastRun: listContextConsolidationRuns(1)[0] ?? null }
|
|
101
104
|
}));
|
|
105
|
+
authenticated.get("/api/you/relationships", (c) => {
|
|
106
|
+
const kind = c.req.query("kind");
|
|
107
|
+
if (kind && !USER_PERSON_KIND_SET.has(kind)) return c.json({ error: "Invalid relationship kind" }, 400);
|
|
108
|
+
const requestedLimit = Number(c.req.query("limit") ?? "30");
|
|
109
|
+
if (!Number.isInteger(requestedLimit) || requestedLimit < 1 || requestedLimit > 100) return c.json({ error: "limit must be an integer from 1 to 100" }, 400);
|
|
110
|
+
const cursor = c.req.query("cursor");
|
|
111
|
+
if (cursor && !/^\d+$/.test(cursor)) return c.json({ error: "Invalid cursor" }, 400);
|
|
112
|
+
return c.json(listUserRelationships({
|
|
113
|
+
query: c.req.query("q") ?? "",
|
|
114
|
+
...kind ? { kind } : {},
|
|
115
|
+
...c.req.query("source") ? { sourceInstanceId: c.req.query("source") } : {},
|
|
116
|
+
includeHidden: c.req.query("includeHidden") === "true",
|
|
117
|
+
hiddenOnly: c.req.query("hidden") === "true",
|
|
118
|
+
...cursor ? { cursor } : {},
|
|
119
|
+
limit: requestedLimit
|
|
120
|
+
}));
|
|
121
|
+
});
|
|
122
|
+
authenticated.get("/api/you/relationships/:id", (c) => {
|
|
123
|
+
const person = getUserRelationship(c.req.param("id"));
|
|
124
|
+
return person ? c.json({ person }) : c.json({ error: "Relationship not found" }, 404);
|
|
125
|
+
});
|
|
126
|
+
authenticated.patch("/api/you/relationships/:id", write, async (c) => {
|
|
127
|
+
const body = await readBody(c);
|
|
128
|
+
if (!body) return c.json({ error: "Invalid JSON" }, 400);
|
|
129
|
+
const patch = {};
|
|
130
|
+
if (body.displayName !== void 0) {
|
|
131
|
+
if (body.displayName !== null && (typeof body.displayName !== "string" || body.displayName.trim().length > 160)) return c.json({ error: "displayName must be null or a string of at most 160 characters" }, 400);
|
|
132
|
+
patch.displayName = typeof body.displayName === "string" && body.displayName.trim() ? body.displayName.trim() : null;
|
|
133
|
+
}
|
|
134
|
+
if (body.kind !== void 0) {
|
|
135
|
+
if (body.kind !== null && !USER_PERSON_KIND_SET.has(body.kind)) return c.json({ error: "Invalid relationship kind" }, 400);
|
|
136
|
+
patch.kind = body.kind;
|
|
137
|
+
}
|
|
138
|
+
if (body.hidden !== void 0) {
|
|
139
|
+
if (typeof body.hidden !== "boolean") return c.json({ error: "hidden must be a boolean" }, 400);
|
|
140
|
+
patch.hidden = body.hidden;
|
|
141
|
+
}
|
|
142
|
+
if (!Object.keys(patch).length) return c.json({ error: "No relationship fields provided" }, 400);
|
|
143
|
+
const person = patchUserRelationship(c.req.param("id"), patch);
|
|
144
|
+
return person ? c.json({ person }) : c.json({ error: "Relationship not found" }, 404);
|
|
145
|
+
});
|
|
146
|
+
authenticated.post("/api/you/relationships/merge", write, async (c) => {
|
|
147
|
+
const body = await readBody(c);
|
|
148
|
+
const sourcePersonId = nonEmptyString(body?.sourcePersonId, 200);
|
|
149
|
+
const targetPersonId = nonEmptyString(body?.targetPersonId, 200);
|
|
150
|
+
if (!sourcePersonId || !targetPersonId || sourcePersonId === targetPersonId) return c.json({ error: "Distinct sourcePersonId and targetPersonId are required" }, 400);
|
|
151
|
+
const person = mergeUserRelationships(sourcePersonId, targetPersonId);
|
|
152
|
+
return person ? c.json({ person }) : c.json({ error: "Relationship not found" }, 404);
|
|
153
|
+
});
|
|
102
154
|
authenticated.get("/api/you/context-objects", (c) => {
|
|
103
155
|
const view = c.req.query("view") ?? "current";
|
|
104
156
|
if (!CONTEXT_OBJECT_VIEWS.has(view)) return c.json({ error: "Invalid context object view" }, 400);
|
|
@@ -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,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 { resolveGatewayService } from "../daemon/service.js";
|
|
6
5
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
6
|
+
import { resolveGatewayService } from "../daemon/service.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
|
import { listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
2
2
|
import "../storage/sqlite/index.js";
|
|
3
3
|
import { clusterUnderstandingSignals } from "../user-context/sources/signal-clustering.js";
|
|
4
|
+
import { personIdForIdentity, personIdentityKey, rebuildUserPeopleIndex } from "../user-context/relationships/indexer.js";
|
|
4
5
|
//#region src/knowledge/connected-understanding-pipeline.ts
|
|
5
6
|
function logicalEventKey(item) {
|
|
6
7
|
const value = item.metadata.logicalEventKey;
|
|
@@ -96,9 +97,12 @@ function relationshipObservations(items) {
|
|
|
96
97
|
const strongIdentity = (signal.email ?? signal.username)?.toLowerCase();
|
|
97
98
|
if (strongIdentity && owners.has(strongIdentity)) continue;
|
|
98
99
|
const label = signal.name ?? signal.email ?? signal.username;
|
|
99
|
-
const identityKey = signal
|
|
100
|
+
const identityKey = personIdentityKey(signal, item.sourceInstanceId);
|
|
101
|
+
const personId = personIdForIdentity(signal, item.sourceInstanceId);
|
|
102
|
+
if (!identityKey || !personId) continue;
|
|
100
103
|
const entry = grouped.get(identityKey) ?? {
|
|
101
104
|
label,
|
|
105
|
+
personId,
|
|
102
106
|
events: /* @__PURE__ */ new Map()
|
|
103
107
|
};
|
|
104
108
|
const eventKey = logicalEventKey(item);
|
|
@@ -108,8 +112,11 @@ function relationshipObservations(items) {
|
|
|
108
112
|
}
|
|
109
113
|
return [...grouped.values()].sort((left, right) => right.events.size - left.events.size).slice(0, 8).map((entry) => ({
|
|
110
114
|
class: "relationship",
|
|
111
|
-
key: `person:${entry.
|
|
112
|
-
value: {
|
|
115
|
+
key: `person:${entry.personId}`,
|
|
116
|
+
value: {
|
|
117
|
+
label: entry.label,
|
|
118
|
+
personId: entry.personId
|
|
119
|
+
},
|
|
113
120
|
items: [...entry.events.values()],
|
|
114
121
|
windowDays: 90
|
|
115
122
|
}));
|
|
@@ -182,6 +189,7 @@ function renderConnectedObservation(observation) {
|
|
|
182
189
|
kind: "relationship",
|
|
183
190
|
content: `Frequently collaborates with ${label}.`,
|
|
184
191
|
canonicalKey: `connected:${observation.key}`,
|
|
192
|
+
payload: typeof observation.value.personId === "string" ? { personId: observation.value.personId } : void 0,
|
|
185
193
|
confidence,
|
|
186
194
|
importance: .65,
|
|
187
195
|
explicitness: "inferred",
|
|
@@ -227,6 +235,7 @@ var ConnectedUnderstandingPipeline = class {
|
|
|
227
235
|
this.memoryManager = memoryManager;
|
|
228
236
|
}
|
|
229
237
|
async process(agentId, extractionRunId) {
|
|
238
|
+
rebuildUserPeopleIndex();
|
|
230
239
|
const observations = deriveConnectedClaimObservations(listKnowledgeSourceItems({
|
|
231
240
|
agentId,
|
|
232
241
|
includeDeleted: false,
|
|
@@ -3,5 +3,4 @@ import { ConnectedKnowledgePipeline } from "./connected-knowledge-pipeline.js";
|
|
|
3
3
|
import { ConnectedUnderstandingPipeline, deriveConnectedClaimObservations, renderConnectedObservation } from "./connected-understanding-pipeline.js";
|
|
4
4
|
import { startConnectedKnowledgeCoordinator } from "./coordinator.js";
|
|
5
5
|
import { LocalFolderKnowledgeSourceAdapter } from "./local-folder-adapter.js";
|
|
6
|
-
|
|
7
|
-
export { ConnectedKnowledgePipeline, ConnectedUnderstandingPipeline, KnowledgeIngestionService, LocalFolderKnowledgeSourceAdapter, SqliteKnowledgeSourceStateStore, buildConnectedPeopleGraph, deriveConnectedClaimObservations, renderConnectedObservation, startConnectedKnowledgeCoordinator };
|
|
6
|
+
export { ConnectedKnowledgePipeline, ConnectedUnderstandingPipeline, KnowledgeIngestionService, LocalFolderKnowledgeSourceAdapter, SqliteKnowledgeSourceStateStore, deriveConnectedClaimObservations, renderConnectedObservation, startConnectedKnowledgeCoordinator };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
|
-
import
|
|
2
|
+
import { type WorkspaceSkillSourceStatus } from '../agent/skills/index.js';
|
|
3
|
+
import type { Skill, SkillDiagnostic, SkillMetadata, SkillToolConditions } from '../agent/skills/types.js';
|
|
3
4
|
import type { ProjectService } from './project-service.js';
|
|
4
5
|
export type ProjectSkillErrorCode = 'project_not_found' | 'project_workspace_required' | 'project_workspace_missing' | 'project_workspace_not_writable' | 'skill_not_found' | 'invalid_skill_id';
|
|
5
6
|
export declare class ProjectSkillError extends Error {
|
|
@@ -8,33 +9,53 @@ export declare class ProjectSkillError extends Error {
|
|
|
8
9
|
constructor(code: ProjectSkillErrorCode, status: 400 | 403 | 404 | 409, message: string);
|
|
9
10
|
}
|
|
10
11
|
export interface ProjectSkillSummary {
|
|
11
|
-
|
|
12
|
+
key: string;
|
|
13
|
+
directoryId: string;
|
|
12
14
|
name: string;
|
|
13
15
|
description: string;
|
|
14
16
|
category?: string;
|
|
17
|
+
origin: Skill['origin']['id'];
|
|
18
|
+
path: string;
|
|
19
|
+
managed: boolean;
|
|
20
|
+
writable: boolean;
|
|
21
|
+
removable: boolean;
|
|
22
|
+
effective: boolean;
|
|
23
|
+
shadowedBy?: Skill['origin']['id'];
|
|
15
24
|
disableModelInvocation: boolean;
|
|
16
25
|
metadata: SkillMetadata;
|
|
17
26
|
toolConditions?: SkillToolConditions;
|
|
18
27
|
requiredEnvVarNames?: string[];
|
|
19
28
|
}
|
|
29
|
+
export interface ProjectWorkspaceTrustState {
|
|
30
|
+
workspacePath: string;
|
|
31
|
+
required: boolean;
|
|
32
|
+
decision: boolean | null;
|
|
33
|
+
trusted: boolean;
|
|
34
|
+
}
|
|
20
35
|
export interface ProjectSkillListResult {
|
|
21
36
|
workspaceRoot: string;
|
|
22
|
-
|
|
37
|
+
sources: WorkspaceSkillSourceStatus[];
|
|
38
|
+
trust: ProjectWorkspaceTrustState;
|
|
23
39
|
items: ProjectSkillSummary[];
|
|
40
|
+
inheritedItems: ProjectSkillSummary[];
|
|
24
41
|
diagnostics: SkillDiagnostic[];
|
|
25
42
|
}
|
|
26
43
|
interface ProjectSkillServiceOptions {
|
|
27
44
|
projects: ProjectService;
|
|
28
45
|
getConfig: () => Config;
|
|
46
|
+
getWorkspaceTrust: (workspaceRoot: string) => ProjectWorkspaceTrustState;
|
|
47
|
+
setWorkspaceTrust: (workspaceRoot: string, trusted: boolean) => ProjectWorkspaceTrustState;
|
|
29
48
|
refreshSkills: () => void | Promise<void>;
|
|
30
49
|
}
|
|
31
50
|
export declare class ProjectSkillService {
|
|
32
51
|
private readonly options;
|
|
33
52
|
constructor(options: ProjectSkillServiceOptions);
|
|
34
53
|
list(projectId: string): ProjectSkillListResult;
|
|
35
|
-
getContent(projectId: string,
|
|
54
|
+
getContent(projectId: string, skillKey: string): ProjectSkillSummary & {
|
|
36
55
|
bodyMarkdown: string;
|
|
37
56
|
};
|
|
57
|
+
getWorkspaceTrust(projectId: string): ProjectWorkspaceTrustState;
|
|
58
|
+
setWorkspaceTrust(projectId: string, trusted: boolean): ProjectWorkspaceTrustState;
|
|
38
59
|
installZip(projectId: string, buffer: Buffer, input?: {
|
|
39
60
|
skillId?: string;
|
|
40
61
|
overwrite?: boolean;
|
|
@@ -59,9 +80,10 @@ export declare class ProjectSkillService {
|
|
|
59
80
|
bodyMarkdown: string;
|
|
60
81
|
}>;
|
|
61
82
|
remove(projectId: string, skillId: string): Promise<void>;
|
|
62
|
-
private findSkill;
|
|
63
83
|
private resolveLocation;
|
|
64
|
-
private
|
|
84
|
+
private loadCatalog;
|
|
85
|
+
private skillKey;
|
|
86
|
+
private encodeSkillKey;
|
|
65
87
|
private toSummary;
|
|
66
88
|
}
|
|
67
89
|
export {};
|