@shogo-ai/voice 1.10.0 → 2.4.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.
Files changed (68) hide show
  1. package/README.md +89 -0
  2. package/dist/{chunk-S3S2RNO6.js → chunk-BI6SL35K.js} +1 -184
  3. package/dist/chunk-CLF25CZC.js +987 -0
  4. package/dist/chunk-KMSL5PWK.js +540 -0
  5. package/dist/chunk-ME3SIZZU.js +581 -0
  6. package/dist/chunk-TQOBJMEK.js +17 -0
  7. package/dist/{chunk-T3T4EBWY.js → chunk-UH75UVM2.js} +6 -2
  8. package/dist/chunk-UW7VQ3S6.js +148 -0
  9. package/dist/chunk-XE4LLC7Z.js +1067 -0
  10. package/dist/chunk-ZAW6F3YT.js +172 -0
  11. package/dist/index.cjs +735 -25
  12. package/dist/index.d.cts +373 -3
  13. package/dist/index.d.ts +373 -3
  14. package/dist/index.js +59 -3
  15. package/dist/live/client.cjs +173 -0
  16. package/dist/live/client.d.cts +132 -0
  17. package/dist/live/client.d.ts +132 -0
  18. package/dist/live/client.js +9 -0
  19. package/dist/native/index.d.cts +5 -2
  20. package/dist/native/index.d.ts +5 -2
  21. package/dist/native/index.js +15 -11
  22. package/dist/{organicParticlesShaders-DIva0vBO.d.ts → organicParticlesShaders-seZq7jYX.d.cts} +1 -421
  23. package/dist/{organicParticlesShaders-DIva0vBO.d.cts → organicParticlesShaders-seZq7jYX.d.ts} +1 -421
  24. package/dist/particlesConfig-0YbdPOdY.d.cts +223 -0
  25. package/dist/particlesConfig-0YbdPOdY.d.ts +223 -0
  26. package/dist/react/conversation.cjs +789 -0
  27. package/dist/react/conversation.d.cts +134 -0
  28. package/dist/react/conversation.d.ts +134 -0
  29. package/dist/react/conversation.js +13 -0
  30. package/dist/react/index.cjs +374 -36
  31. package/dist/react/index.d.cts +10 -141
  32. package/dist/react/index.d.ts +10 -141
  33. package/dist/react/index.js +23 -770
  34. package/dist/react/visuals.cjs +1048 -0
  35. package/dist/react/visuals.d.cts +70 -0
  36. package/dist/react/visuals.d.ts +70 -0
  37. package/dist/react/visuals.js +10 -0
  38. package/dist/route/agent.cjs +1038 -85
  39. package/dist/route/agent.js +3 -3
  40. package/dist/route/audio-tags.cjs +1038 -85
  41. package/dist/route/audio-tags.js +3 -3
  42. package/dist/route/index.cjs +1042 -85
  43. package/dist/route/index.d.cts +19 -3
  44. package/dist/route/index.d.ts +19 -3
  45. package/dist/route/index.js +3 -3
  46. package/dist/route/music.cjs +1038 -85
  47. package/dist/route/music.js +3 -3
  48. package/dist/route/op.cjs +2118 -0
  49. package/dist/route/op.d.cts +43 -0
  50. package/dist/route/op.d.ts +43 -0
  51. package/dist/route/op.js +27 -0
  52. package/dist/route/signed-url.cjs +1038 -85
  53. package/dist/route/signed-url.js +3 -3
  54. package/dist/route/tts-preview.cjs +1038 -85
  55. package/dist/route/tts-preview.d.cts +6 -4
  56. package/dist/route/tts-preview.d.ts +6 -4
  57. package/dist/route/tts-preview.js +3 -3
  58. package/dist/server.cjs +1038 -85
  59. package/dist/server.d.cts +40 -8
  60. package/dist/server.d.ts +40 -8
  61. package/dist/server.js +2 -2
  62. package/dist/types-Bfhu-aQH.d.cts +199 -0
  63. package/dist/types-Bfhu-aQH.d.ts +199 -0
  64. package/dist/{types-W9y6eMj3.d.ts → types-CadjTXNH.d.cts} +193 -12
  65. package/dist/{types-W9y6eMj3.d.cts → types-CadjTXNH.d.ts} +193 -12
  66. package/package.json +21 -1
  67. package/dist/chunk-B4JC3DK2.js +0 -529
  68. package/dist/chunk-O362EJQR.js +0 -524
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Drop-in handler for every voice op in the registry.
3
+ *
4
+ * One route file mounts every op — `/api/voice/op/<opId>` — because the id
5
+ * comes from the URL (or `?op=`). Nothing here lists the ops: adding a row to
6
+ * `VOICE_OPS` makes it reachable, in BYO mode and in runtime-token proxy mode.
7
+ *
8
+ * @example Expo Router — mount once, serve every op (present and future)
9
+ * ```ts
10
+ * // app/api/voice/op/[opId]+api.ts
11
+ * export { GET, POST } from '@shogo-ai/sdk/voice/route/op'
12
+ * ```
13
+ *
14
+ * @example Next.js App Router
15
+ * ```ts
16
+ * // app/api/voice/op/[opId]/route.ts
17
+ * export { GET, POST } from '@shogo-ai/sdk/voice/route/op'
18
+ * ```
19
+ *
20
+ * @example Hono / Bun / Deno (no dynamic file convention)
21
+ * ```ts
22
+ * import { defaultHandlers } from '@shogo-ai/sdk/voice/route'
23
+ * app.all('/voice/op/:opId', (c) => defaultHandlers().op(c.req.raw, c.req.param('opId')))
24
+ * ```
25
+ *
26
+ * `voiceOpRoutes` is the same handlers keyed by op id, for the frameworks
27
+ * that want one route file per op:
28
+ * ```ts
29
+ * import { voiceOpRoutes } from '@shogo-ai/sdk/voice/route/op'
30
+ * export const { POST } = voiceOpRoutes['speech-to-speech']
31
+ * ```
32
+ */
33
+ /** `GET` — for the listing ops (`voices`, `models`). */
34
+ declare const GET: (req: Request) => Promise<Response>;
35
+ /** `POST` — for every media op (`speech-to-speech`, `sound-generation`, …). */
36
+ declare const POST: (req: Request) => Promise<Response>;
37
+ /** Per-op handlers keyed by registry id, built from {@link VOICE_OPS}. */
38
+ declare const voiceOpRoutes: Readonly<Record<string, {
39
+ GET: (req: Request) => Promise<Response>;
40
+ POST: (req: Request) => Promise<Response>;
41
+ }>>;
42
+
43
+ export { GET, POST, voiceOpRoutes };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Drop-in handler for every voice op in the registry.
3
+ *
4
+ * One route file mounts every op — `/api/voice/op/<opId>` — because the id
5
+ * comes from the URL (or `?op=`). Nothing here lists the ops: adding a row to
6
+ * `VOICE_OPS` makes it reachable, in BYO mode and in runtime-token proxy mode.
7
+ *
8
+ * @example Expo Router — mount once, serve every op (present and future)
9
+ * ```ts
10
+ * // app/api/voice/op/[opId]+api.ts
11
+ * export { GET, POST } from '@shogo-ai/sdk/voice/route/op'
12
+ * ```
13
+ *
14
+ * @example Next.js App Router
15
+ * ```ts
16
+ * // app/api/voice/op/[opId]/route.ts
17
+ * export { GET, POST } from '@shogo-ai/sdk/voice/route/op'
18
+ * ```
19
+ *
20
+ * @example Hono / Bun / Deno (no dynamic file convention)
21
+ * ```ts
22
+ * import { defaultHandlers } from '@shogo-ai/sdk/voice/route'
23
+ * app.all('/voice/op/:opId', (c) => defaultHandlers().op(c.req.raw, c.req.param('opId')))
24
+ * ```
25
+ *
26
+ * `voiceOpRoutes` is the same handlers keyed by op id, for the frameworks
27
+ * that want one route file per op:
28
+ * ```ts
29
+ * import { voiceOpRoutes } from '@shogo-ai/sdk/voice/route/op'
30
+ * export const { POST } = voiceOpRoutes['speech-to-speech']
31
+ * ```
32
+ */
33
+ /** `GET` — for the listing ops (`voices`, `models`). */
34
+ declare const GET: (req: Request) => Promise<Response>;
35
+ /** `POST` — for every media op (`speech-to-speech`, `sound-generation`, …). */
36
+ declare const POST: (req: Request) => Promise<Response>;
37
+ /** Per-op handlers keyed by registry id, built from {@link VOICE_OPS}. */
38
+ declare const voiceOpRoutes: Readonly<Record<string, {
39
+ GET: (req: Request) => Promise<Response>;
40
+ POST: (req: Request) => Promise<Response>;
41
+ }>>;
42
+
43
+ export { GET, POST, voiceOpRoutes };
@@ -0,0 +1,27 @@
1
+ import {
2
+ defaultHandlers
3
+ } from "../chunk-UH75UVM2.js";
4
+ import "../chunk-CLF25CZC.js";
5
+ import {
6
+ VOICE_OPS
7
+ } from "../chunk-XE4LLC7Z.js";
8
+ import "../chunk-Q3TJAJ54.js";
9
+
10
+ // src/route/op.ts
11
+ var GET = (req) => defaultHandlers().op(req);
12
+ var POST = (req) => defaultHandlers().op(req);
13
+ var voiceOpRoutes = Object.fromEntries(
14
+ VOICE_OPS.map((op) => [
15
+ op.id,
16
+ {
17
+ GET: (req) => defaultHandlers().op(req, op.id),
18
+ POST: (req) => defaultHandlers().op(req, op.id)
19
+ }
20
+ ])
21
+ );
22
+ export {
23
+ GET,
24
+ POST,
25
+ voiceOpRoutes
26
+ };
27
+ //# sourceMappingURL=op.js.map