@xenosystem/agent-interface-host 0.1.124 → 0.1.126

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.
@@ -0,0 +1,43 @@
1
+ import type { AgentSkillSummary, AgentSkillsOperation, AgentSkillsResult } from '@xenosystem/agent-interface-contract';
2
+ import type { XenoWorkspaceSkill, XenoWorkspaceSkillsOptions } from '@xenosystem/agent-sdk/skills';
3
+ import { type PluginMcpManagerService } from '../pluginMcp/PluginMcpManagerService.js';
4
+ /**
5
+ * `skills.*` served by the host (ADE §9 step 5, slice 1).
6
+ *
7
+ * The skill set itself is the SDK's (`@xenosystem/agent-sdk/skills`, `loadXenoWorkspaceSkills`): one
8
+ * implementation for the host, its turns and the CLI, so a skill turned on in one surface is on in
9
+ * every other. This service only resolves where to look and answers the protocol.
10
+ *
11
+ * Skill files are read, never written: they are the person's own work (Corpus D235). The one write
12
+ * is `setEnabled`, which updates the project's `.xeno/skills.json` — the file the CLI already writes.
13
+ */
14
+ type SkillsSdk = typeof import('@xenosystem/agent-sdk/skills');
15
+ export interface SkillsHostServiceOptions {
16
+ /** The person's home folder. */
17
+ homeDirectory: string;
18
+ /**
19
+ * The folder holding the person's own XENO skills and their enablement. Absent means the SDK's
20
+ * default (`defaultXenoUserSkillsHome`: `XENO_SKILLS_HOME`, else the agent config folder), the same
21
+ * answer the CLI uses, so skills the CLI has always used appear here too. XENO's own skill store will
22
+ * live in the `knowledge` area owned by the Corpus engine (XENO LOCAL HOME §5); until that area
23
+ * defines it, nothing here creates one.
24
+ */
25
+ userSkillsHome?: string;
26
+ pluginMcp?: Pick<PluginMcpManagerService, 'installedPlugins' | 'pluginDirectory'>;
27
+ loadSdk?: () => Promise<SkillsSdk>;
28
+ }
29
+ export interface SkillsHostRequest {
30
+ /** Project folder, already authorized against a granted root by the coordinator. */
31
+ cwd?: string;
32
+ ref?: string;
33
+ enabled?: boolean;
34
+ }
35
+ /** What a surface may see of a skill: its identity and state, never its instruction body. */
36
+ export declare function toAgentSkillSummary(skill: XenoWorkspaceSkill): AgentSkillSummary;
37
+ export declare function createSkillsHostService(options: SkillsHostServiceOptions): {
38
+ request: (operation: AgentSkillsOperation, input: SkillsHostRequest) => Promise<AgentSkillsResult>;
39
+ workspace: (cwd: string | undefined) => Promise<XenoWorkspaceSkillsOptions>;
40
+ };
41
+ export type SkillsHostService = ReturnType<typeof createSkillsHostService>;
42
+ export {};
43
+ //# sourceMappingURL=skillsHostService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillsHostService.d.ts","sourceRoot":"","sources":["../../src/skills/skillsHostService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAClG,OAAO,EAA8B,KAAK,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AAElH;;;;;;;;;GASG;AAEH,KAAK,SAAS,GAAG,cAAc,8BAA8B,CAAC,CAAA;AAE9D,MAAM,WAAW,wBAAwB;IACvC,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,IAAI,CAAC,uBAAuB,EAAE,kBAAkB,GAAG,iBAAiB,CAAC,CAAA;IACjF,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,CAiBhF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB;yBAkBrC,oBAAoB,SAAS,iBAAiB,KAAG,OAAO,CAAC,iBAAiB,CAAC;qBAb/E,MAAM,GAAG,SAAS,KAAG,OAAO,CAAC,0BAA0B,CAAC;EA0CvF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,71 @@
1
+ import { getPluginMcpManagerService } from '../pluginMcp/PluginMcpManagerService.js';
2
+ /** What a surface may see of a skill: its identity and state, never its instruction body. */
3
+ export function toAgentSkillSummary(skill) {
4
+ return {
5
+ key: skill.key,
6
+ id: skill.id,
7
+ name: skill.name,
8
+ ...(skill.description ? { description: skill.description } : {}),
9
+ source: skill.source,
10
+ format: skill.format,
11
+ enabled: skill.enabled,
12
+ defaultEnabled: skill.defaultEnabled,
13
+ ...(skill.path ? { path: skill.path } : {}),
14
+ ...(skill.pluginName ? { pluginName: skill.pluginName } : {}),
15
+ visibility: skill.visibility,
16
+ modelInvocable: skill.modelInvocable,
17
+ userInvocable: skill.userInvocable,
18
+ estimatedTokens: skill.estimatedTokens,
19
+ };
20
+ }
21
+ export function createSkillsHostService(options) {
22
+ const loadSdk = options.loadSdk ?? (() => import('@xenosystem/agent-sdk/skills'));
23
+ const pluginMcp = options.pluginMcp ?? getPluginMcpManagerService();
24
+ /** The skill set for one folder. With no folder, only the person's own skills and the built-ins. */
25
+ async function workspace(cwd) {
26
+ const sdk = await loadSdk();
27
+ const plugins = await pluginMcp.installedPlugins();
28
+ const userSkillsHome = options.userSkillsHome ?? sdk.defaultXenoUserSkillsHome();
29
+ return {
30
+ cwd: cwd ?? userSkillsHome,
31
+ homeDirectory: options.homeDirectory,
32
+ userSkillsHome,
33
+ listPlugins: () => plugins,
34
+ pluginDirectory: pluginMcp.pluginDirectory,
35
+ };
36
+ }
37
+ async function request(operation, input) {
38
+ const sdk = await loadSdk();
39
+ const ws = await workspace(input.cwd);
40
+ if (operation === 'list') {
41
+ const loaded = sdk.loadXenoWorkspaceSkillsWithDiagnostics(ws);
42
+ return {
43
+ success: true,
44
+ skills: loaded.skills.map(toAgentSkillSummary),
45
+ diagnostics: loaded.diagnostics.map((diagnostic) => ({ severity: diagnostic.severity, code: diagnostic.code, message: diagnostic.message })),
46
+ };
47
+ }
48
+ const ref = typeof input.ref === 'string' ? input.ref.trim() : '';
49
+ if (!ref)
50
+ return { success: false, error: 'A skill name or key is required.' };
51
+ if (operation === 'get') {
52
+ const skill = sdk.findXenoWorkspaceSkill(sdk.loadXenoWorkspaceSkills(ws), ref);
53
+ if (!skill)
54
+ return { success: false, error: `Skill not found or ambiguous: ${ref}` };
55
+ return { success: true, skill: toAgentSkillSummary(skill), instructions: sdk.loadXenoWorkspaceSkill(skill).instructions };
56
+ }
57
+ if (operation === 'setEnabled') {
58
+ if (typeof input.enabled !== 'boolean')
59
+ return { success: false, error: 'enabled must be true or false.' };
60
+ if (!input.cwd)
61
+ return { success: false, error: 'Turning a skill on or off needs a project folder; it is recorded in that project.' };
62
+ const result = await sdk.setXenoWorkspaceSkillEnabled(ws, ref, input.enabled);
63
+ if (!result.skill)
64
+ return { success: false, error: result.error ?? `Skill not found or ambiguous: ${ref}` };
65
+ return { success: true, skill: toAgentSkillSummary(result.skill) };
66
+ }
67
+ return { success: false, error: `Unknown skills operation: ${String(operation)}` };
68
+ }
69
+ return { request, workspace };
70
+ }
71
+ //# sourceMappingURL=skillsHostService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillsHostService.js","sourceRoot":"","sources":["../../src/skills/skillsHostService.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAgC,MAAM,yCAAyC,CAAA;AAqClH,6FAA6F;AAC7F,MAAM,UAAU,mBAAmB,CAAC,KAAyB;IAC3D,OAAO;QACL,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,G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iCAAiC,GAAG,EAAE,EAAE,CAAA;YACpF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,CAAA;QAC3H,CAAC;QACD,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YAC/B,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS;gBAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAA;YAC1G,IAAI,CAAC,KAAK,CAAC,GAAG;gBAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mFAAmF,EAAE,CAAA;YACrI,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,4BAA4B,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAC7E,IAAI,CAAC,MAAM,CAAC,KAAK;gBAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,iCAAiC,GAAG,EAAE,EAAE,CAAA;YAC3G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;QACpE,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,CAAA;IACpF,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAA;AAC/B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/agent-interface-host",
3
- "version": "0.1.124",
3
+ "version": "0.1.126",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,17 +33,17 @@
33
33
  "dependencies": {
34
34
  "@xenosystem/acp-core": "0.2.25",
35
35
  "@xenosystem/acp-provider-manager": "0.2.25",
36
- "@xenosystem/agent-sdk": "0.10.80",
36
+ "@xenosystem/agent-sdk": "0.10.83",
37
37
  "@xenosystem/capability-sdk": "0.1.1",
38
38
  "@xenosystem/primitives": "0.3.1",
39
39
  "zod": "4.6.7",
40
- "@xenosystem/agent-interface-contract": "0.1.124",
41
- "@xenosystem/capability-mcp": "0.1.124",
42
- "@xenosystem/agent-interface-core": "0.1.124"
40
+ "@xenosystem/agent-interface-contract": "0.1.126",
41
+ "@xenosystem/agent-interface-core": "0.1.126",
42
+ "@xenosystem/capability-mcp": "0.1.126"
43
43
  },
44
44
  "optionalDependencies": {
45
45
  "@xenosystem/acp-agent": "0.2.25",
46
- "@xenosystem/agent-interface-client": "0.1.124"
46
+ "@xenosystem/agent-interface-client": "0.1.126"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@xeno-corporation/account": "0.4.1",
@@ -66,8 +66,8 @@
66
66
  "better-sqlite3": "13.0.3",
67
67
  "node-pty": "^1.1.0",
68
68
  "fflate": "^0.8.3",
69
- "@xenosystem/agent-interface-client": "0.1.124"
69
+ "@xenosystem/agent-interface-client": "0.1.126"
70
70
  },
71
71
  "scripts": {},
72
- "gitHead": "2039dda5b8e7aae4e94655bbd6165387d1f63a09"
72
+ "gitHead": "49b99d82e170519c64d2b172e455caed354578d6"
73
73
  }