@xenosystem/agent-interface-host 0.1.122 → 0.1.124

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,37 @@
1
+ /**
2
+ * Where the plugin/MCP store lives. The host is the `extensions` area's owner (XENO LOCAL HOME - SPEC.md section 5):
3
+ * installed plugins in data, MCP definitions and approvals in config, the approval audit log in data.
4
+ */
5
+ export interface PluginMcpStoreLocation {
6
+ /** The SDK plugin host's directory: installed plugins, plugins.json, trust.json, events.jsonl. */
7
+ pluginDir: string;
8
+ /** servers.json and sdk-approvals.json. */
9
+ mcpConfigDir: string;
10
+ /** approvals.jsonl, the approval audit history. */
11
+ mcpDataDir: string;
12
+ /** Paths a plugin's sandbox may never reach (the person's SSH keys, XENO secrets). */
13
+ protectedPaths: string[];
14
+ /** `extensions`: the primitives layout; `legacy`: the pre-0.3 `~/.xeno/{plugins,mcp}` store. */
15
+ layout: 'extensions' | 'legacy';
16
+ }
17
+ /** The pre-0.3 store under one base (`~/.xeno`); also how tests isolate a store in a temp folder. */
18
+ export declare function legacyPluginMcpStore(baseDir: string, protectedPaths?: string[]): PluginMcpStoreLocation;
19
+ /** The store in the `extensions` area of a XENO layout. */
20
+ export declare function extensionsPluginMcpStore(roots: {
21
+ data: string;
22
+ config: string;
23
+ secrets: string;
24
+ }, protectedPaths?: string[]): PluginMcpStoreLocation;
25
+ /**
26
+ * Which store to use (the 3-release legacy read fallback, XENO LOCAL HOME - SPEC.md section 11.2): the extensions store
27
+ * once it holds anything, or when nothing exists anywhere; the legacy store while it is the only one with data, so a
28
+ * person who has not run `xeno-home migrate` keeps their plugins and MCP servers. Never both at once.
29
+ */
30
+ export declare function choosePluginMcpStore(extensions: PluginMcpStoreLocation, legacy: PluginMcpStoreLocation): PluginMcpStoreLocation;
31
+ /**
32
+ * The store for a person's home: the `extensions` area of their XENO layout (from the primitives resolver), or the
33
+ * legacy `~/.xeno` store while it is the only one holding data. The home is needed only for that legacy fallback and
34
+ * for `~/.ssh`, which a plugin's sandbox may never reach.
35
+ */
36
+ export declare function pluginMcpStoreFor(home: string, env?: Readonly<Record<string, string | undefined>>): PluginMcpStoreLocation;
37
+ //# sourceMappingURL=storeLocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeLocation.d.ts","sourceRoot":"","sources":["../../src/pluginMcp/storeLocation.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,kGAAkG;IAClG,SAAS,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,gGAAgG;IAChG,MAAM,EAAE,YAAY,GAAG,QAAQ,CAAA;CAChC;AAED,qGAAqG;AACrG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,GAAE,MAAM,EAAO,GAAG,sBAAsB,CAQ3G;AAED,2DAA2D;AAC3D,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,cAAc,GAAE,MAAM,EAAO,GAAG,sBAAsB,CAQxJ;AAMD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAE/H;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,GAAG,sBAAsB,CAQvI"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Where the Agent host's plugin/MCP store lives, and nothing else: only Node built-ins and the primitives resolver, so a
3
+ * surface that is not the host (the CLI) can resolve the same store without loading the host. Published as
4
+ * `@xenosystem/agent-interface-host/store-location`; `PluginMcpManagerService` re-exports it.
5
+ */
6
+ import { existsSync } from 'fs';
7
+ import { join } from 'path';
8
+ import { createDirs } from '@xenosystem/primitives/dirs';
9
+ /** The pre-0.3 store under one base (`~/.xeno`); also how tests isolate a store in a temp folder. */
10
+ export function legacyPluginMcpStore(baseDir, protectedPaths = []) {
11
+ return {
12
+ pluginDir: join(baseDir, 'plugins'),
13
+ mcpConfigDir: join(baseDir, 'mcp'),
14
+ mcpDataDir: join(baseDir, 'mcp'),
15
+ protectedPaths: [...protectedPaths, join(baseDir, 'credentials.json')],
16
+ layout: 'legacy',
17
+ };
18
+ }
19
+ /** The store in the `extensions` area of a XENO layout. */
20
+ export function extensionsPluginMcpStore(roots, protectedPaths = []) {
21
+ return {
22
+ pluginDir: join(roots.data, 'extensions', 'plugins'),
23
+ mcpConfigDir: join(roots.config, 'extensions', 'mcp'),
24
+ mcpDataDir: join(roots.data, 'extensions', 'mcp'),
25
+ protectedPaths: [...protectedPaths, roots.secrets],
26
+ layout: 'extensions',
27
+ };
28
+ }
29
+ const storeHasData = (location) => [join(location.pluginDir, 'plugins.json'), join(location.pluginDir, 'trust.json'), join(location.mcpConfigDir, 'servers.json'), join(location.mcpConfigDir, 'sdk-approvals.json')]
30
+ .some((file) => existsSync(file));
31
+ /**
32
+ * Which store to use (the 3-release legacy read fallback, XENO LOCAL HOME - SPEC.md section 11.2): the extensions store
33
+ * once it holds anything, or when nothing exists anywhere; the legacy store while it is the only one with data, so a
34
+ * person who has not run `xeno-home migrate` keeps their plugins and MCP servers. Never both at once.
35
+ */
36
+ export function choosePluginMcpStore(extensions, legacy) {
37
+ return !storeHasData(extensions) && storeHasData(legacy) ? legacy : extensions;
38
+ }
39
+ /**
40
+ * The store for a person's home: the `extensions` area of their XENO layout (from the primitives resolver), or the
41
+ * legacy `~/.xeno` store while it is the only one holding data. The home is needed only for that legacy fallback and
42
+ * for `~/.ssh`, which a plugin's sandbox may never reach.
43
+ */
44
+ export function pluginMcpStoreFor(home, env = process.env) {
45
+ const dirs = createDirs({ home, env });
46
+ const ssh = join(home, '.ssh');
47
+ return choosePluginMcpStore(extensionsPluginMcpStore({ data: dirs.root('data'), config: dirs.root('config'), secrets: dirs.root('secrets') }, [ssh]),
48
+ // xeno-dirs-allow: the legacy read fallback of XENO LOCAL HOME - SPEC.md section 11.2, read until migrated
49
+ legacyPluginMcpStore(join(home, '.xeno'), [ssh]));
50
+ }
51
+ //# sourceMappingURL=storeLocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeLocation.js","sourceRoot":"","sources":["../../src/pluginMcp/storeLocation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAmBxD,qGAAqG;AACrG,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,iBAA2B,EAAE;IACjF,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC;QACnC,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;QAClC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;QAChC,cAAc,EAAE,CAAC,GAAG,cAAc,EAAE,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QACtE,MAAM,EAAE,QAAQ;KACjB,CAAA;AACH,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,wBAAwB,CAAC,KAAwD,EAAE,iBAA2B,EAAE;IAC9H,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC;QACpD,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,YAAY,E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AC,GAAG,CAAC,CAAC;IACxH,2GAA2G;IAC3G,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CACjD,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/agent-interface-host",
3
- "version": "0.1.122",
3
+ "version": "0.1.124",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,6 +13,10 @@
13
13
  "./node": {
14
14
  "types": "./dist/node.d.ts",
15
15
  "import": "./dist/node.js"
16
+ },
17
+ "./store-location": {
18
+ "types": "./dist/pluginMcp/storeLocation.d.ts",
19
+ "import": "./dist/pluginMcp/storeLocation.js"
16
20
  }
17
21
  },
18
22
  "files": [
@@ -33,13 +37,13 @@
33
37
  "@xenosystem/capability-sdk": "0.1.1",
34
38
  "@xenosystem/primitives": "0.3.1",
35
39
  "zod": "4.6.7",
36
- "@xenosystem/agent-interface-core": "0.1.122",
37
- "@xenosystem/agent-interface-contract": "0.1.122",
38
- "@xenosystem/capability-mcp": "0.1.122"
40
+ "@xenosystem/agent-interface-contract": "0.1.124",
41
+ "@xenosystem/capability-mcp": "0.1.124",
42
+ "@xenosystem/agent-interface-core": "0.1.124"
39
43
  },
40
44
  "optionalDependencies": {
41
45
  "@xenosystem/acp-agent": "0.2.25",
42
- "@xenosystem/agent-interface-client": "0.1.122"
46
+ "@xenosystem/agent-interface-client": "0.1.124"
43
47
  },
44
48
  "peerDependencies": {
45
49
  "@xeno-corporation/account": "0.4.1",
@@ -62,8 +66,8 @@
62
66
  "better-sqlite3": "13.0.3",
63
67
  "node-pty": "^1.1.0",
64
68
  "fflate": "^0.8.3",
65
- "@xenosystem/agent-interface-client": "0.1.122"
69
+ "@xenosystem/agent-interface-client": "0.1.124"
66
70
  },
67
71
  "scripts": {},
68
- "gitHead": "89a67fef4a90916d98ec91c3e126a9c17d2de8a2"
72
+ "gitHead": "2039dda5b8e7aae4e94655bbd6165387d1f63a09"
69
73
  }