@undefineds.co/xpod 0.4.31 → 0.4.32

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.
@@ -616,7 +616,10 @@ class AiGatewayService {
616
616
  && !explicitCredentialIdFor(request);
617
617
  }
618
618
  builtinRoute(model) {
619
- const requested = model?.trim() || DeploymentBuiltinConnection_1.DEPLOYMENT_BUILTIN_CONNECTION_ID;
619
+ // Route evidence carries the BARE canonical model: a client that followed
620
+ // the advertised `xpod-builtin` provider namespace must not leak that
621
+ // qualified form into the route or the upstream request.
622
+ const requested = this.builtin.canonicalModel(model) ?? model?.trim() ?? DeploymentBuiltinConnection_1.DEPLOYMENT_BUILTIN_CONNECTION_ID;
620
623
  const provider = {
621
624
  id: this.builtin.id,
622
625
  label: this.builtin.label,
@@ -32,6 +32,17 @@ export declare class DeploymentBuiltinConnection {
32
32
  fetch?: typeof fetch;
33
33
  });
34
34
  get modelIds(): readonly string[];
35
+ /**
36
+ * Bare canonical id for a model this connection owns, else undefined.
37
+ *
38
+ * The provider pool advertises this built-in as `xpod-builtin`, so a client
39
+ * following that provider/model reference sends `xpod-builtin/linx`. Its OWN
40
+ * prefix is stripped once; a bare declared id is returned as-is. Anything
41
+ * else (another provider's prefix, `custom/linx`, an undeclared id, empty)
42
+ * yields undefined so callers leave the reference untouched.
43
+ */
44
+ canonicalModel(model: string | undefined): string | undefined;
45
+ /** True only for this connection's bare ids or its own qualified namespace. */
35
46
  owns(model: string | undefined): boolean;
36
47
  /** Static projection: listing never depends on upstream reachability or the caller's Pod. */
37
48
  listModels(): GatewayModelProjection[];
@@ -67,9 +67,29 @@ class DeploymentBuiltinConnection {
67
67
  get modelIds() {
68
68
  return exports.DEPLOYMENT_BUILTIN_MODEL_IDS;
69
69
  }
70
+ /**
71
+ * Bare canonical id for a model this connection owns, else undefined.
72
+ *
73
+ * The provider pool advertises this built-in as `xpod-builtin`, so a client
74
+ * following that provider/model reference sends `xpod-builtin/linx`. Its OWN
75
+ * prefix is stripped once; a bare declared id is returned as-is. Anything
76
+ * else (another provider's prefix, `custom/linx`, an undeclared id, empty)
77
+ * yields undefined so callers leave the reference untouched.
78
+ */
79
+ canonicalModel(model) {
80
+ if (typeof model !== 'string')
81
+ return undefined;
82
+ const trimmed = model.trim();
83
+ if (!trimmed)
84
+ return undefined;
85
+ const prefix = `${this.id}/`;
86
+ // Only declared ids qualify; `xpod-builtin/other` must not become `other`.
87
+ const bare = trimmed.startsWith(prefix) ? trimmed.slice(prefix.length) : trimmed;
88
+ return exports.DEPLOYMENT_BUILTIN_MODEL_IDS.includes(bare) ? bare : undefined;
89
+ }
90
+ /** True only for this connection's bare ids or its own qualified namespace. */
70
91
  owns(model) {
71
- return typeof model === 'string'
72
- && exports.DEPLOYMENT_BUILTIN_MODEL_IDS.includes(model.trim());
92
+ return this.canonicalModel(model) !== undefined;
73
93
  }
74
94
  /** Static projection: listing never depends on upstream reachability or the caller's Pod. */
75
95
  listModels() {
@@ -91,7 +111,11 @@ class DeploymentBuiltinConnection {
91
111
  if (!body || typeof body !== 'object' || Array.isArray(body))
92
112
  return body;
93
113
  const record = { ...body };
94
- const model = typeof record.model === 'string' ? record.model.trim() : '';
114
+ // Normalize the caller's own-qualified reference to the bare canonical id
115
+ // BEFORE the deployment model map, so the upstream receives the configured
116
+ // physical model and never `xpod-builtin/linx`.
117
+ const model = this.canonicalModel(typeof record.model === 'string' ? record.model : undefined)
118
+ ?? (typeof record.model === 'string' ? record.model.trim() : '');
95
119
  record.model = this.modelMap[model] ?? model;
96
120
  // Attribution for the ai-gateway (LiteLLM treats `user` as the end user): the verified WebID.
97
121
  const webId = (0, AuthContext_1.getWebId)(auth);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "4194795915ac5f956cd593131647ece7049be24d",
4
+ "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "85f739d81735baf4e1263e55c2542335233393872ee761179ff0b9fa4411879e",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "4194795915ac5f956cd593131647ece7049be24d",
4
+ "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "85f739d81735baf4e1263e55c2542335233393872ee761179ff0b9fa4411879e",
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "path": "build-provenance.json",
14
14
  "bytes": 1727,
15
- "sha256": "988246ea946941ec55c1bd1ab46ce4c518dad9634adc3803e8183ffec8d3e5af"
15
+ "sha256": "dee7e8e0129abe6b67a3848d8bc0413e6db0ea9bdcefa3589933d0e4a6e89e0b"
16
16
  },
17
17
  {
18
18
  "path": "generated/provider-catalog/index.json",
@@ -322,7 +322,7 @@
322
322
  {
323
323
  "path": "source-inventory.json",
324
324
  "bytes": 4713,
325
- "sha256": "866f7c5086422a4542e4d0c5ad4b366720e3f0758dfe5f1adb3288b18ffd9684"
325
+ "sha256": "70c3db163597a7e5b6d3f5aaadbc58cc089c4156cbd60625b7abff008af55a8e"
326
326
  }
327
327
  ]
328
328
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "4194795915ac5f956cd593131647ece7049be24d",
4
+ "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "85f739d81735baf4e1263e55c2542335233393872ee761179ff0b9fa4411879e",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "4194795915ac5f956cd593131647ece7049be24d",
4
+ "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "c3b65827fdfc0e13c743cd5129b9db7626ec2419e12b06d8478d97fc859e851a",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "4194795915ac5f956cd593131647ece7049be24d",
4
+ "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "c3b65827fdfc0e13c743cd5129b9db7626ec2419e12b06d8478d97fc859e851a",
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "path": "build-provenance.json",
14
14
  "bytes": 398,
15
- "sha256": "f2844f6367e35d1e9657767a86fe7a63965765235a95ad971dea9997ae9de081"
15
+ "sha256": "83a33120bc17de14d8b5b7ea28fd9d932cfa5d10da693d0471a449d0e084b74a"
16
16
  },
17
17
  {
18
18
  "path": "source/LICENSE",
@@ -52,7 +52,7 @@
52
52
  {
53
53
  "path": "source-inventory.json",
54
54
  "bytes": 1585,
55
- "sha256": "8ed9730d08da1e0665c0b9faadc6db66cc376a2fd6576e236e4fbef5a26d55cf"
55
+ "sha256": "767f0ee730e5408d03c5d62dec8cccf7b9761108268a8ca7ef430182c6a3aa24"
56
56
  }
57
57
  ]
58
58
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "4194795915ac5f956cd593131647ece7049be24d",
4
+ "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "c3b65827fdfc0e13c743cd5129b9db7626ec2419e12b06d8478d97fc859e851a",
@@ -5,7 +5,7 @@
5
5
  "version": "0.1.0-preview.2",
6
6
  "bunVersion": "1.4.2"
7
7
  },
8
- "indexSHA256": "bc49acbcdc248ed2116be614447d7ebfb40f6445b90b681b3448b6c437df6eca",
8
+ "indexSHA256": "77f607c06fd91dc53fb4f7e4de18ff7bcdadc97edc988cc6c77cff74c959fcd4",
9
9
  "outputPayloads": {
10
10
  "esmSHA256": "7f610395a47a79acd1bb2181a71a16e887272fa4e5522fa095db78625f3c8eb0"
11
11
  }
@@ -159,7 +159,7 @@
159
159
  }
160
160
  ],
161
161
  "sourceAuthority": {
162
- "sourceCommit": "4194795915ac5f956cd593131647ece7049be24d",
162
+ "sourceCommit": "326cdab7c29a107ce566bdc6ea543c5abaf88b6b",
163
163
  "dirty": false,
164
164
  "snapshotSHA256": "a198c5f28999d0c763c3bb5d166823a5a5eb0eff8e7e4557b7b8d299200198a9",
165
165
  "scope": "CLI source plus explicitly mapped canonical host and runtime-client source; no claim of release acceptance or external dependency closure."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undefineds.co/xpod",
3
- "version": "0.4.31",
3
+ "version": "0.4.32",
4
4
  "description": "Xpod is an extended Community Solid Server, offering rich-feature, production-level Solid Pod and identity management.",
5
5
  "repository": "https://github.com/undefinedsco/xpod",
6
6
  "author": "developer@undefineds.co",
@@ -388,7 +388,7 @@
388
388
  }
389
389
  },
390
390
  "optionalDependencies": {
391
- "@undefineds.co/xpod-darwin-arm64": "0.4.31",
391
+ "@undefineds.co/xpod-darwin-arm64": "0.4.32",
392
392
  "@undefineds.co/drizzle-solid": "0.3.26",
393
393
  "@undefineds.co/extensions": "0.1.0",
394
394
  "@undefineds.co/ai-connections": "0.1.6",