@xenosystem/agent-interface-host 0.1.89 โ 0.1.90
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/cloud/XenoCloudAgentTurnExecutionAdapter.d.ts +12 -16
- package/dist/cloud/XenoCloudAgentTurnExecutionAdapter.d.ts.map +1 -1
- package/dist/cloud/XenoCloudAgentTurnExecutionAdapter.js +17 -12
- package/dist/cloud/XenoCloudAgentTurnExecutionAdapter.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/surface/surfaceRequestIdentity.d.ts +40 -0
- package/dist/surface/surfaceRequestIdentity.d.ts.map +1 -0
- package/dist/surface/surfaceRequestIdentity.js +49 -0
- package/dist/surface/surfaceRequestIdentity.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which product a surface-account request comes from, and which build of it.
|
|
3
|
+
*
|
|
4
|
+
* A turn started by an app that lends its own account (surface-account spec ยง4.4) tells the
|
|
5
|
+
* platform two things on every request it makes: `X-Xeno-Surface` (the app's OIDC client) so usage
|
|
6
|
+
* is attributed to that product, and `X-Xeno-Client` (`<name>/<version>`) so the platform's version
|
|
7
|
+
* floor can see the build. Without them every such request is grandfathered as `legacy:xeno_api`,
|
|
8
|
+
* which is what production recorded for 99.95% of rows.
|
|
9
|
+
*
|
|
10
|
+
* ๐ด IDENTITY, NOT AUTHORITY. Both values come from what the HOST recorded for the connection โ the
|
|
11
|
+
* `providesAccount` capability and the handshake identity โ never from a turn request, so a turn
|
|
12
|
+
* cannot claim to be another product. Nothing here chooses who pays or which route serves the
|
|
13
|
+
* request; the platform decides both from the authenticated account.
|
|
14
|
+
*
|
|
15
|
+
* ๐ด Validated here against the platform's own patterns (xeno-platform `utils/requestSurface.js`
|
|
16
|
+
* and `services/clientVersion.js`, mirrored by the SDK's `normalizeXenoRequestContext`). A value
|
|
17
|
+
* that would not pass is OMITTED rather than sent: the SDK throws on a malformed context at
|
|
18
|
+
* construction, so passing one through would fail the person's turn over a label.
|
|
19
|
+
*
|
|
20
|
+
* Browser-safe on purpose (no `node:` import): the host barrel is loaded in renderers.
|
|
21
|
+
*/
|
|
22
|
+
/** Same shape as the SDK's `XenoRequestContext`, so it can be passed to the loop as-is. */
|
|
23
|
+
export interface SurfaceRequestIdentity {
|
|
24
|
+
readonly surface: string;
|
|
25
|
+
readonly client?: {
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly version: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The identity for a connection, or `undefined` when even the surface is not a valid label.
|
|
32
|
+
*
|
|
33
|
+
* @param clientId The app's OIDC client, from its `providesAccount` capability.
|
|
34
|
+
* @param clientVersion The build it declared on the handshake. Omitted from the result when absent
|
|
35
|
+
* or malformed โ the surface is still worth attributing without it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function surfaceRequestIdentity(clientId: string, clientVersion: string | undefined): SurfaceRequestIdentity | undefined;
|
|
38
|
+
/** The two headers for an identity. Empty when there is none. */
|
|
39
|
+
export declare function surfaceRequestIdentityHeaders(identity: SurfaceRequestIdentity | undefined): Record<string, string>;
|
|
40
|
+
//# sourceMappingURL=surfaceRequestIdentity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceRequestIdentity.d.ts","sourceRoot":"","sources":["../../src/surface/surfaceRequestIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,2FAA2F;AAC3F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CACtE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,sBAAsB,GAAG,SAAS,CAM9H;AAED,iEAAiE;AACjE,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,sBAAsB,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMlH"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which product a surface-account request comes from, and which build of it.
|
|
3
|
+
*
|
|
4
|
+
* A turn started by an app that lends its own account (surface-account spec ยง4.4) tells the
|
|
5
|
+
* platform two things on every request it makes: `X-Xeno-Surface` (the app's OIDC client) so usage
|
|
6
|
+
* is attributed to that product, and `X-Xeno-Client` (`<name>/<version>`) so the platform's version
|
|
7
|
+
* floor can see the build. Without them every such request is grandfathered as `legacy:xeno_api`,
|
|
8
|
+
* which is what production recorded for 99.95% of rows.
|
|
9
|
+
*
|
|
10
|
+
* ๐ด IDENTITY, NOT AUTHORITY. Both values come from what the HOST recorded for the connection โ the
|
|
11
|
+
* `providesAccount` capability and the handshake identity โ never from a turn request, so a turn
|
|
12
|
+
* cannot claim to be another product. Nothing here chooses who pays or which route serves the
|
|
13
|
+
* request; the platform decides both from the authenticated account.
|
|
14
|
+
*
|
|
15
|
+
* ๐ด Validated here against the platform's own patterns (xeno-platform `utils/requestSurface.js`
|
|
16
|
+
* and `services/clientVersion.js`, mirrored by the SDK's `normalizeXenoRequestContext`). A value
|
|
17
|
+
* that would not pass is OMITTED rather than sent: the SDK throws on a malformed context at
|
|
18
|
+
* construction, so passing one through would fail the person's turn over a label.
|
|
19
|
+
*
|
|
20
|
+
* Browser-safe on purpose (no `node:` import): the host barrel is loaded in renderers.
|
|
21
|
+
*/
|
|
22
|
+
const SURFACE = /^[A-Za-z0-9:._*-]{1,64}$/;
|
|
23
|
+
const CLIENT_NAME = /^[A-Za-z0-9_-][A-Za-z0-9 _-]{0,30}[A-Za-z0-9_-]$/;
|
|
24
|
+
const CLIENT_VERSION = /^[0-9][0-9A-Za-z.+-]{0,40}$/;
|
|
25
|
+
/**
|
|
26
|
+
* The identity for a connection, or `undefined` when even the surface is not a valid label.
|
|
27
|
+
*
|
|
28
|
+
* @param clientId The app's OIDC client, from its `providesAccount` capability.
|
|
29
|
+
* @param clientVersion The build it declared on the handshake. Omitted from the result when absent
|
|
30
|
+
* or malformed โ the surface is still worth attributing without it.
|
|
31
|
+
*/
|
|
32
|
+
export function surfaceRequestIdentity(clientId, clientVersion) {
|
|
33
|
+
if (!SURFACE.test(clientId))
|
|
34
|
+
return undefined;
|
|
35
|
+
if (clientVersion === undefined || !CLIENT_NAME.test(clientId) || !CLIENT_VERSION.test(clientVersion)) {
|
|
36
|
+
return Object.freeze({ surface: clientId });
|
|
37
|
+
}
|
|
38
|
+
return Object.freeze({ surface: clientId, client: Object.freeze({ name: clientId, version: clientVersion }) });
|
|
39
|
+
}
|
|
40
|
+
/** The two headers for an identity. Empty when there is none. */
|
|
41
|
+
export function surfaceRequestIdentityHeaders(identity) {
|
|
42
|
+
if (!identity)
|
|
43
|
+
return {};
|
|
44
|
+
return {
|
|
45
|
+
'X-Xeno-Surface': identity.surface,
|
|
46
|
+
...(identity.client ? { 'X-Xeno-Client': `${identity.client.name}/${identity.client.version}` } : {}),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=surfaceRequestIdentity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceRequestIdentity.js","sourceRoot":"","sources":["../../src/surface/surfaceRequestIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,OAAO,GAAG,0BAA0B,CAAA;AAC1C,MAAM,WAAW,GAAG,kDAAkD,CAAA;AACtE,MAAM,cAAc,GAAG,6BAA6B,CAAA;AAQpD;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB,EAAE,aAAiC;IACxF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAA;IAC7C,IAAI,aAAa,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QACtG,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC7C,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAA;AAChH,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,6BAA6B,CAAC,QAA4C;IACxF,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAA;IACxB,OAAO;QACL,gBAAgB,EAAE,QAAQ,CAAC,OAAO;QAClC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtG,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/agent-interface-host",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.90",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@xenosystem/acp-core": "0.2.17",
|
|
31
31
|
"@xenosystem/acp-provider-manager": "0.2.17",
|
|
32
|
-
"@xenosystem/agent-sdk": "0.10.
|
|
32
|
+
"@xenosystem/agent-sdk": "0.10.21",
|
|
33
33
|
"@xenosystem/capability-sdk": "0.1.1",
|
|
34
34
|
"better-sqlite3": "13.0.3",
|
|
35
35
|
"fflate": "^0.8.3",
|
|
36
36
|
"node-pty": "^1.1.0",
|
|
37
37
|
"tar": "^7.5.20",
|
|
38
38
|
"zod": "4.4.3",
|
|
39
|
-
"@xenosystem/agent-interface-contract": "0.1.
|
|
40
|
-
"@xenosystem/
|
|
41
|
-
"@xenosystem/
|
|
39
|
+
"@xenosystem/agent-interface-contract": "0.1.90",
|
|
40
|
+
"@xenosystem/capability-mcp": "0.1.90",
|
|
41
|
+
"@xenosystem/agent-interface-core": "0.1.90"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
44
|
"@xenosystem/acp-agent": "0.2.17",
|
|
45
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
45
|
+
"@xenosystem/agent-interface-client": "0.1.90"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@xeno-corporation/account": "0.2.0"
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@xenosystem/capability-host": "0.1.1",
|
|
57
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
57
|
+
"@xenosystem/agent-interface-client": "0.1.90"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "cae825774073678b88781ae3cfaf147dd136c467"
|
|
61
61
|
}
|