@alienplatform/ai-gateway 3.3.0 → 3.3.1

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/binding.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Parsing for the `ALIEN_<NAME>_BINDING` env var an `ai` resource projects. The client only
3
- * routes on the binding: a BYO-key (`external`) binding is validated strictly here because the
3
+ * routes on the binding: a BYO-key (`external-ai`) binding is validated strictly here because the
4
4
  * client itself uses its fields, while every other service tag — the ambient variants, including
5
5
  * ones added to the platform after this SDK shipped — is passed through for the Rust gateway to
6
6
  * validate and serve. Mirrors the Rust `AiBinding` (serde tag "service", lowercase, camelCase
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import * as z from "zod/v4";
10
10
  declare const externalAiBindingSchema: z.ZodObject<{
11
- service: z.ZodLiteral<"external">;
11
+ service: z.ZodLiteral<"external-ai">;
12
12
  provider: z.ZodString;
13
13
  apiKey: z.ZodString;
14
14
  }, z.core.$strict>;
package/dist/gateway.js CHANGED
@@ -9,20 +9,20 @@ import { fileURLToPath } from "node:url";
9
9
  //#region src/binding.ts
10
10
  /**
11
11
  * Parsing for the `ALIEN_<NAME>_BINDING` env var an `ai` resource projects. The client only
12
- * routes on the binding: a BYO-key (`external`) binding is validated strictly here because the
12
+ * routes on the binding: a BYO-key (`external-ai`) binding is validated strictly here because the
13
13
  * client itself uses its fields, while every other service tag — the ambient variants, including
14
14
  * ones added to the platform after this SDK shipped — is passed through for the Rust gateway to
15
15
  * validate and serve. Mirrors the Rust `AiBinding` (serde tag "service", lowercase, camelCase
16
16
  * fields).
17
17
  */
18
18
  const externalAiBindingSchema = z.object({
19
- service: z.literal("external"),
19
+ service: z.literal("external-ai"),
20
20
  provider: z.string(),
21
21
  apiKey: z.string()
22
22
  }).strict();
23
23
  /** Narrow an `AiBinding` to the BYO-key variant the client handles itself. */
24
24
  function isExternalAiBinding(binding) {
25
- return binding.service === "external";
25
+ return binding.service === "external-ai";
26
26
  }
27
27
  /** The env var an `ai` binding is projected into: `ALIEN_<NAME>_BINDING` (uppercased, `-`→`_`). */
28
28
  function aiBindingEnvVarName(name) {
@@ -40,7 +40,7 @@ async function parseAiBinding(name) {
40
40
  }
41
41
  const service = parsed !== null && typeof parsed === "object" ? parsed.service : void 0;
42
42
  if (typeof service !== "string") throw new AlienError(InvalidBindingConfigError.create({ message: `AI binding '${name}' has no 'service' tag` }));
43
- if (service !== "external") return parsed;
43
+ if (service !== "external-ai") return parsed;
44
44
  const result = externalAiBindingSchema.safeParse(parsed);
45
45
  if (!result.success) throw (await AlienError.from(result.error)).withContext(InvalidBindingConfigError.create({ message: `AI binding '${name}' has an unexpected shape` }));
46
46
  return result.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alienplatform/ai-gateway",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "types": "./dist/index.d.ts",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "zod": "4.3.2",
52
- "@alienplatform/core": "^3.3.0"
52
+ "@alienplatform/core": "^3.3.1"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "openai": "^4"
@@ -60,12 +60,12 @@
60
60
  }
61
61
  },
62
62
  "optionalDependencies": {
63
- "@alienplatform/ai-gateway-darwin-arm64": "3.3.0",
64
- "@alienplatform/ai-gateway-darwin-x64": "3.3.0",
65
- "@alienplatform/ai-gateway-linux-x64-gnu": "3.3.0",
66
- "@alienplatform/ai-gateway-linux-x64-musl": "3.3.0",
67
- "@alienplatform/ai-gateway-linux-arm64-gnu": "3.3.0",
68
- "@alienplatform/ai-gateway-linux-arm64-musl": "3.3.0"
63
+ "@alienplatform/ai-gateway-darwin-arm64": "3.3.1",
64
+ "@alienplatform/ai-gateway-darwin-x64": "3.3.1",
65
+ "@alienplatform/ai-gateway-linux-x64-gnu": "3.3.1",
66
+ "@alienplatform/ai-gateway-linux-x64-musl": "3.3.1",
67
+ "@alienplatform/ai-gateway-linux-arm64-gnu": "3.3.1",
68
+ "@alienplatform/ai-gateway-linux-arm64-musl": "3.3.1"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "tsdown && tsc -p tsconfig.build.json --emitDeclarationOnly",