@odori/cli 0.0.9 → 0.0.10

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.
@@ -870,7 +870,11 @@ var elevenlabs = {
870
870
  signal: AbortSignal.timeout(1e4)
871
871
  });
872
872
  if (response.ok) return true;
873
- if (response.status === 401 || response.status === 403) return false;
873
+ if (response.status === 401 || response.status === 403) {
874
+ const detail = await response.text().catch(() => "");
875
+ if (/missing_permissions|permission/i.test(detail)) return true;
876
+ return false;
877
+ }
874
878
  throw new Error(`ElevenLabs answered ${response.status} to a key check.`);
875
879
  },
876
880
  async generate({ prompt, seconds, apiKey }) {
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  checkFlags,
3
3
  parseArgs,
4
4
  run
5
- } from "./chunk-TDM65HRW.js";
5
+ } from "./chunk-AJBK4XRB.js";
6
6
  export {
7
7
  checkFlags,
8
8
  parseArgs,
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ import {
75
75
  withServer,
76
76
  writeGenerated,
77
77
  writePrepareCache
78
- } from "./chunk-TDM65HRW.js";
78
+ } from "./chunk-AJBK4XRB.js";
79
79
  export {
80
80
  CHROME_BUILD,
81
81
  FORMATS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odori/cli",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "description": "The odori command line: discovery, Studio, component installation, stills, tests, and export jobs.",
6
6
  "license": "Apache-2.0",
@@ -28,7 +28,7 @@
28
28
  "playwright-core": "1.55.0",
29
29
  "tsx": "4.20.5",
30
30
  "vite": "7.3.0",
31
- "odori": "0.0.9"
31
+ "odori": "0.0.10"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "22.19.0",
@@ -36,7 +36,7 @@
36
36
  "@types/react-dom": "19.2.3",
37
37
  "tsup": "^8.5.1",
38
38
  "typescript": "5.9.3",
39
- "@odori/registry": "0.0.8"
39
+ "@odori/registry": "0.0.9"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -309,6 +309,8 @@ export const devCommand = async (options: {port?: number; root?: string; open?:
309
309
  verified = null;
310
310
  }
311
311
  if (verified === false) {
312
+ // The provider's check accepts a valid key regardless of its
313
+ // scoping, so a rejection here means the key itself.
312
314
  json(response, 400, {error: `${provider.title} rejected that key.`});
313
315
  return;
314
316
  }
package/src/providers.ts CHANGED
@@ -45,7 +45,20 @@ const elevenlabs: MusicProvider = {
45
45
  signal: AbortSignal.timeout(10_000),
46
46
  });
47
47
  if (response.ok) return true;
48
- if (response.status === 401 || response.status === 403) return false;
48
+ if (response.status === 401 || response.status === 403) {
49
+ /*
50
+ * A restricted key opts in to endpoints one by one, and this probe's
51
+ * endpoint is one of them: a real key scoped to something else answers
52
+ * 401 here exactly like a wrong key does. The error body tells them
53
+ * apart, an invalid key names itself invalid, a valid one names the
54
+ * permission it lacks, and a key that is real but scoped elsewhere is
55
+ * a pass. Whether it can reach the integration's own endpoint is the
56
+ * generate call's problem, which reports it properly.
57
+ */
58
+ const detail = await response.text().catch(() => "");
59
+ if (/missing_permissions|permission/i.test(detail)) return true;
60
+ return false;
61
+ }
49
62
  throw new Error(`ElevenLabs answered ${response.status} to a key check.`);
50
63
  },
51
64
  async generate({prompt, seconds, apiKey}) {