@bevel-software/platform-mcp-core 0.33.0 → 0.34.0

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,53 @@
1
+ /**
2
+ * What a connection's scope says about itself on the wire, and the words
3
+ * both MCP servers — the hosted proxy and the local `hexis-mcp` — build from
4
+ * it: the handshake line, the refusal of a tool the connection does not
5
+ * load, and the sentence a connection that loads nothing carries. ONE
6
+ * module, so the two servers cannot word the same connection differently.
7
+ *
8
+ * The deployment puts the wire on `GET /api/agent/all-tools` and
9
+ * `GET /api/agent/catalog-revision` as their `connection` field; absent for
10
+ * a connection made as Everything, which is told nothing new.
11
+ */
12
+ /** The `code` beside a refusal of what the caller's connection does not load. */
13
+ export declare const NOT_AVAILABLE_TO_CONNECTION = "not_available_to_connection";
14
+ /**
15
+ * Where the sentence saying why a connection loads nothing rides a
16
+ * `tools/list` answer: the listing has no description of its own, and an
17
+ * empty `tools` array alone would read as an outage.
18
+ */
19
+ export declare const CONNECTION_META_KEY = "software.bevel.hexis/connection";
20
+ /** The agent a connection was made as, by the file that defines it. */
21
+ export interface ScopeAgent {
22
+ /** Repo-relative path of the agent configuration, as the distribution records it. */
23
+ path: string;
24
+ /** Its name — the frontmatter `name`, else the file's base name; the path when the file cannot be read. */
25
+ name: string;
26
+ }
27
+ /** The `connection` field of the two deployment answers above. */
28
+ export interface ConnectionScopeWire {
29
+ agent: ScopeAgent;
30
+ /** Set when the connection loads nothing because its file cannot be used: the one sentence saying why. */
31
+ unavailable?: string;
32
+ }
33
+ /**
34
+ * The wire an answer carries, validated at the boundary: HTTP loses the
35
+ * type. A malformed one is dropped — undefined, the Everything reading —
36
+ * which serves what the answer listed, itself already narrowed by the
37
+ * deployment's agent surfaces.
38
+ */
39
+ export declare function connectionWireOf(body: unknown): ConnectionScopeWire | undefined;
40
+ /**
41
+ * The answer to a call of `toolName` that the connection described by
42
+ * `wire` does not load: names the tool and the agent, so the caller knows
43
+ * the tool was refused by the connection's choice and not missing from the
44
+ * deployment; for a file that cannot be used, the sentence that says why.
45
+ * The ONE wording — the tool route and both MCP servers answer with it.
46
+ */
47
+ export declare function connectionRefusal(toolName: string, wire: ConnectionScopeWire | undefined): string;
48
+ /**
49
+ * The one line an agent is told about its connection (the MCP handshake, the
50
+ * agent guide); null for Everything, which is told nothing new.
51
+ */
52
+ export declare function describeConnection(wire: ConnectionScopeWire | undefined): string | null;
53
+ //# sourceMappingURL=connection-scope-wire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-scope-wire.d.ts","sourceRoot":"","sources":["../src/connection-scope-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,oCAAoC,CAAC;AAErE,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,2GAA2G;IAC3G,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kEAAkE;AAClE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,UAAU,CAAC;IAClB,0GAA0G;IAC1G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAQ/E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAOjG;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAOvF"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * What a connection's scope says about itself on the wire, and the words
3
+ * both MCP servers — the hosted proxy and the local `hexis-mcp` — build from
4
+ * it: the handshake line, the refusal of a tool the connection does not
5
+ * load, and the sentence a connection that loads nothing carries. ONE
6
+ * module, so the two servers cannot word the same connection differently.
7
+ *
8
+ * The deployment puts the wire on `GET /api/agent/all-tools` and
9
+ * `GET /api/agent/catalog-revision` as their `connection` field; absent for
10
+ * a connection made as Everything, which is told nothing new.
11
+ */
12
+ /** The `code` beside a refusal of what the caller's connection does not load. */
13
+ export const NOT_AVAILABLE_TO_CONNECTION = 'not_available_to_connection';
14
+ /**
15
+ * Where the sentence saying why a connection loads nothing rides a
16
+ * `tools/list` answer: the listing has no description of its own, and an
17
+ * empty `tools` array alone would read as an outage.
18
+ */
19
+ export const CONNECTION_META_KEY = 'software.bevel.hexis/connection';
20
+ /**
21
+ * The wire an answer carries, validated at the boundary: HTTP loses the
22
+ * type. A malformed one is dropped — undefined, the Everything reading —
23
+ * which serves what the answer listed, itself already narrowed by the
24
+ * deployment's agent surfaces.
25
+ */
26
+ export function connectionWireOf(body) {
27
+ const raw = body
28
+ ?.connection;
29
+ if (!raw || typeof raw.agent?.path !== 'string' || typeof raw.agent.name !== 'string')
30
+ return undefined;
31
+ return {
32
+ agent: { path: raw.agent.path, name: raw.agent.name },
33
+ ...(typeof raw.unavailable === 'string' && raw.unavailable ? { unavailable: raw.unavailable } : {}),
34
+ };
35
+ }
36
+ /**
37
+ * The answer to a call of `toolName` that the connection described by
38
+ * `wire` does not load: names the tool and the agent, so the caller knows
39
+ * the tool was refused by the connection's choice and not missing from the
40
+ * deployment; for a file that cannot be used, the sentence that says why.
41
+ * The ONE wording — the tool route and both MCP servers answer with it.
42
+ */
43
+ export function connectionRefusal(toolName, wire) {
44
+ if (!wire)
45
+ return `The tool "${toolName}" is not available to this connection.`;
46
+ if (wire.unavailable)
47
+ return wire.unavailable;
48
+ return (`The tool "${toolName}" is not available to this connection: it is connected as the agent ` +
49
+ `"${wire.agent.name}" (\`${wire.agent.path}\`), which does not load it.`);
50
+ }
51
+ /**
52
+ * The one line an agent is told about its connection (the MCP handshake, the
53
+ * agent guide); null for Everything, which is told nothing new.
54
+ */
55
+ export function describeConnection(wire) {
56
+ if (!wire)
57
+ return null;
58
+ if (wire.unavailable)
59
+ return wire.unavailable;
60
+ return (`This connection is connected as the agent "${wire.agent.name}" (\`${wire.agent.path}\`): it loads only the ` +
61
+ 'platform tools, connectors, skills and plugins that file lists, and of those only what you may read.');
62
+ }
63
+ //# sourceMappingURL=connection-scope-wire.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-scope-wire.js","sourceRoot":"","sources":["../src/connection-scope-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iFAAiF;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG,6BAA6B,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,iCAAiC,CAAC;AAiBrE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC5C,MAAM,GAAG,GAAI,IAAsG;QACjH,EAAE,UAAU,CAAC;IACf,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,KAAK,EAAE,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxG,OAAO;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE;QACrD,GAAG,CAAC,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpG,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAgB,EAAE,IAAqC;IACvF,IAAI,CAAC,IAAI;QAAE,OAAO,aAAa,QAAQ,wCAAwC,CAAC;IAChF,IAAI,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC,WAAW,CAAC;IAC9C,OAAO,CACL,aAAa,QAAQ,sEAAsE;QAC3F,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,8BAA8B,CACzE,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAqC;IACtE,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,IAAI,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC,WAAW,CAAC;IAC9C,OAAO,CACL,8CAA8C,IAAI,CAAC,KAAK,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,yBAAyB;QAC7G,sGAAsG,CACvG,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -42,5 +42,6 @@ export { type SkillSummary, type LoadedSkill, skillPromptText, } from './skills.
42
42
  export { utcpNamespacePrefix, utcpNamespacedKey, seedBevelHostedManualVars, isPlatformHostedUrl, } from './utcp-namespace.js';
43
43
  export { sanitizeIdentifier, utcpNameToTsInterfaceName, findToolByName, findToolsByNames, AmbiguousToolNameError, } from './code-mode-names.js';
44
44
  export { printable } from './printable.js';
45
+ export { CONNECTION_META_KEY, NOT_AVAILABLE_TO_CONNECTION, connectionRefusal, connectionWireOf, describeConnection, type ConnectionScopeWire, type ScopeAgent, } from './connection-scope-wire.js';
45
46
  export { GOOGLE_SERVICE_ACCOUNT_AUTH_TYPE, GOOGLE_TOKEN_URL, GoogleAuthHttpProtocol, GoogleServiceAccountTokenSource, ServiceAccountAuthError, findUnservedGoogleServiceAccountAuth, holdsLiteralGoogleServiceAccountKey, installGoogleServiceAccountAuth, isGoogleServiceAccountAuth, type GoogleServiceAccountAuth, type IServiceAccountTokenSource, } from './google-service-account/index.js';
46
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,KAAK,YAAY,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,cAAc,EACnB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,YAAY,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,GAChC,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,KAAK,YAAY,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,cAAc,EACnB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B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,EACL,gCAAgC,EAChC,gBAAgB,EAChB,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,oCAAoC,EACpC,mCAAmC,EACnC,+BAA+B,EAC/B,0BAA0B,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,GAChC,MAAM,mCAAmC,CAAC"}
package/dist/index.js CHANGED
@@ -42,6 +42,10 @@ export { skillPromptText, } from './skills.js';
42
42
  export { utcpNamespacePrefix, utcpNamespacedKey, seedBevelHostedManualVars, isPlatformHostedUrl, } from './utcp-namespace.js';
43
43
  export { sanitizeIdentifier, utcpNameToTsInterfaceName, findToolByName, findToolsByNames, AmbiguousToolNameError, } from './code-mode-names.js';
44
44
  export { printable } from './printable.js';
45
+ // A connection made as an `.agent` file, as the deployment says it on the
46
+ // wire and as both MCP servers word it: one module, so the hosted proxy and
47
+ // the local server cannot describe or refuse the same connection differently.
48
+ export { CONNECTION_META_KEY, NOT_AVAILABLE_TO_CONNECTION, connectionRefusal, connectionWireOf, describeConnection, } from './connection-scope-wire.js';
45
49
  // Loading this package teaches UTCP `auth_type: google_service_account`, on
46
50
  // both surfaces alike: the auth type validates and the `http` protocol mints
47
51
  // the token. A side effect of the import, like the `@utcp/http` registration
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAEL,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEL,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAKlB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,cAAc,CAAC;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GL,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,yDAAyD;AACzD,OAAO,EACL,gCAAgC,EAChC,gBAAgB,EAChB,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,oCAAoC,EACpC,mCAAmC,EACnC,+BAA+B,EAC/B,0BAA0B,GAG3B,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAEL,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAEL,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAKlB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,wBAAwB,EACxB,qBAAqB,EAErB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,0BA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M,gBAAgB,CAAC;AAE3C,0EAA0E;AAC1E,4EAA4E;AAC5E,8EAA8E;AAC9E,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GAGnB,MAAM,4BAA4B,CAAC;AAEpC,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,yDAAyD;AACzD,OAAO,EACL,gCAAgC,EAChC,gBAAgB,EAChB,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,oCAAoC,EACpC,mCAAmC,EACnC,+BAA+B,EAC/B,0BAA0B,GAG3B,MAAM,mCAAmC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bevel-software/platform-mcp-core",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "The transport-agnostic half of Bevel's MCP surface: UTCP manual registration, tool discovery, MCP listing/dispatch and the code-mode meta-tools. Shared by the hosted proxy and the local stdio server.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,81 @@
1
+ /**
2
+ * What a connection's scope says about itself on the wire, and the words
3
+ * both MCP servers — the hosted proxy and the local `hexis-mcp` — build from
4
+ * it: the handshake line, the refusal of a tool the connection does not
5
+ * load, and the sentence a connection that loads nothing carries. ONE
6
+ * module, so the two servers cannot word the same connection differently.
7
+ *
8
+ * The deployment puts the wire on `GET /api/agent/all-tools` and
9
+ * `GET /api/agent/catalog-revision` as their `connection` field; absent for
10
+ * a connection made as Everything, which is told nothing new.
11
+ */
12
+
13
+ /** The `code` beside a refusal of what the caller's connection does not load. */
14
+ export const NOT_AVAILABLE_TO_CONNECTION = 'not_available_to_connection';
15
+
16
+ /**
17
+ * Where the sentence saying why a connection loads nothing rides a
18
+ * `tools/list` answer: the listing has no description of its own, and an
19
+ * empty `tools` array alone would read as an outage.
20
+ */
21
+ export const CONNECTION_META_KEY = 'software.bevel.hexis/connection';
22
+
23
+ /** The agent a connection was made as, by the file that defines it. */
24
+ export interface ScopeAgent {
25
+ /** Repo-relative path of the agent configuration, as the distribution records it. */
26
+ path: string;
27
+ /** Its name — the frontmatter `name`, else the file's base name; the path when the file cannot be read. */
28
+ name: string;
29
+ }
30
+
31
+ /** The `connection` field of the two deployment answers above. */
32
+ export interface ConnectionScopeWire {
33
+ agent: ScopeAgent;
34
+ /** Set when the connection loads nothing because its file cannot be used: the one sentence saying why. */
35
+ unavailable?: string;
36
+ }
37
+
38
+ /**
39
+ * The wire an answer carries, validated at the boundary: HTTP loses the
40
+ * type. A malformed one is dropped — undefined, the Everything reading —
41
+ * which serves what the answer listed, itself already narrowed by the
42
+ * deployment's agent surfaces.
43
+ */
44
+ export function connectionWireOf(body: unknown): ConnectionScopeWire | undefined {
45
+ const raw = (body as { connection?: { agent?: { path?: unknown; name?: unknown }; unavailable?: unknown } } | null)
46
+ ?.connection;
47
+ if (!raw || typeof raw.agent?.path !== 'string' || typeof raw.agent.name !== 'string') return undefined;
48
+ return {
49
+ agent: { path: raw.agent.path, name: raw.agent.name },
50
+ ...(typeof raw.unavailable === 'string' && raw.unavailable ? { unavailable: raw.unavailable } : {}),
51
+ };
52
+ }
53
+
54
+ /**
55
+ * The answer to a call of `toolName` that the connection described by
56
+ * `wire` does not load: names the tool and the agent, so the caller knows
57
+ * the tool was refused by the connection's choice and not missing from the
58
+ * deployment; for a file that cannot be used, the sentence that says why.
59
+ * The ONE wording — the tool route and both MCP servers answer with it.
60
+ */
61
+ export function connectionRefusal(toolName: string, wire: ConnectionScopeWire | undefined): string {
62
+ if (!wire) return `The tool "${toolName}" is not available to this connection.`;
63
+ if (wire.unavailable) return wire.unavailable;
64
+ return (
65
+ `The tool "${toolName}" is not available to this connection: it is connected as the agent ` +
66
+ `"${wire.agent.name}" (\`${wire.agent.path}\`), which does not load it.`
67
+ );
68
+ }
69
+
70
+ /**
71
+ * The one line an agent is told about its connection (the MCP handshake, the
72
+ * agent guide); null for Everything, which is told nothing new.
73
+ */
74
+ export function describeConnection(wire: ConnectionScopeWire | undefined): string | null {
75
+ if (!wire) return null;
76
+ if (wire.unavailable) return wire.unavailable;
77
+ return (
78
+ `This connection is connected as the agent "${wire.agent.name}" (\`${wire.agent.path}\`): it loads only the ` +
79
+ 'platform tools, connectors, skills and plugins that file lists, and of those only what you may read.'
80
+ );
81
+ }
package/src/index.ts CHANGED
@@ -169,6 +169,19 @@ export {
169
169
 
170
170
  export { printable } from './printable.js';
171
171
 
172
+ // A connection made as an `.agent` file, as the deployment says it on the
173
+ // wire and as both MCP servers word it: one module, so the hosted proxy and
174
+ // the local server cannot describe or refuse the same connection differently.
175
+ export {
176
+ CONNECTION_META_KEY,
177
+ NOT_AVAILABLE_TO_CONNECTION,
178
+ connectionRefusal,
179
+ connectionWireOf,
180
+ describeConnection,
181
+ type ConnectionScopeWire,
182
+ type ScopeAgent,
183
+ } from './connection-scope-wire.js';
184
+
172
185
  // Loading this package teaches UTCP `auth_type: google_service_account`, on
173
186
  // both surfaces alike: the auth type validates and the `http` protocol mints
174
187
  // the token. A side effect of the import, like the `@utcp/http` registration