@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,223 @@
1
+ /**
2
+ * Configuration surface for the `OrganicSphere` audio-reactive
3
+ * visualization. All values are plain numbers / strings / null so the
4
+ * whole object is JSON-serializable — save it, transport it, paste it
5
+ * into a preset library.
6
+ *
7
+ * The sphere renders four eased "variations" driven by frequency bands:
8
+ *
9
+ * low → modulates time-evolution speed (drift + noise phase)
10
+ * volume → drives `uDisplacementStrength` (how far each vertex pushes
11
+ * out from the sphere surface)
12
+ * medium → drives `uFresnelMultiplier` (how bright the lighting pass
13
+ * gets near silhouette edges)
14
+ * high → drives `uDistortionStrength` (large-scale warping of the
15
+ * underlying position field before displacement)
16
+ *
17
+ * Each variation has a resting `idle` value used when audio is off, a
18
+ * `gain` multiplier applied to the band level, a `floor` minimum while
19
+ * audio is playing, and separate attack / decay easing rates.
20
+ *
21
+ * Use `resolveOrganicSphereConfig(partial)` to merge a partial override
22
+ * into the defaults; `OrganicSphere` does this internally so consumers
23
+ * can pass any subset.
24
+ */
25
+ interface BandReactivity {
26
+ /** Resting target used when no audio source is connected. */
27
+ idle: number;
28
+ /** Multiplier applied to the normalized band level (0–1) while audio plays. */
29
+ gain: number;
30
+ /** Minimum target while audio is playing, before easing. */
31
+ floor: number;
32
+ /**
33
+ * Easing rate when the target rises above `current` (snappier attack
34
+ * at higher values; per-ms-of-frame delta, not per-frame).
35
+ */
36
+ attack: number;
37
+ /** Easing rate when the target falls below `current` (per-ms). */
38
+ decay: number;
39
+ }
40
+ interface OrganicSphereConfig {
41
+ /** Color of light A (default is a deep Shogo burnt orange). */
42
+ lightAColor: string;
43
+ /** Color of light B (default is a warm Shogo amber). */
44
+ lightBColor: string;
45
+ /** Intensity multiplier for light A. Higher = brighter contribution. */
46
+ lightAIntensity: number;
47
+ /** Intensity multiplier for light B. */
48
+ lightBIntensity: number;
49
+ /**
50
+ * Rim-highlight color. `null` falls back to `lightBColor`, which keeps
51
+ * the silhouette monochromatic and impossible to wash out to white.
52
+ */
53
+ rimColor: string | null;
54
+ /**
55
+ * Fresnel value above which the rim starts contributing. Higher →
56
+ * tighter rim; lower → rim bleeds across more of the surface.
57
+ */
58
+ rimThreshold: number;
59
+ /** Exponent on the rim falloff curve. Higher → sharper edge. */
60
+ rimPower: number;
61
+ /** Spatial frequency of the distortion noise (`uDistortionFrequency`). */
62
+ distortionFrequency: number;
63
+ /** Spatial frequency of the displacement noise (`uDisplacementFrequency`). */
64
+ displacementFrequency: number;
65
+ /** Fresnel offset — shifts where the rim and lighting gradient peak. */
66
+ fresnelOffset: number;
67
+ /** Fresnel power — steepens or softens the lighting gradient. */
68
+ fresnelPower: number;
69
+ /**
70
+ * Volume variation → `uDisplacementStrength`. Driven by the loudest
71
+ * of the first three bands (`max(l0, l1, l2)`).
72
+ */
73
+ volume: BandReactivity;
74
+ /** Mid-band variation → `uFresnelMultiplier`. Driven by `l1`. */
75
+ medium: BandReactivity;
76
+ /** High-band variation → `uDistortionStrength`. Driven by `l2`. */
77
+ high: BandReactivity;
78
+ /**
79
+ * Low-band variation → time evolution speed (how fast the noise
80
+ * offset scrolls). Driven by `l0`.
81
+ */
82
+ low: BandReactivity;
83
+ /** Camera z-position. Larger = more zoomed out. */
84
+ cameraZ: number;
85
+ /** Vertical field-of-view in degrees. */
86
+ fov: number;
87
+ /**
88
+ * Seed used to derive the initial "wander" offset phase, so identical
89
+ * audio produces identical visuals across playbacks. Any integer is
90
+ * fine; change it to roll a different starting pose. When `active`
91
+ * flips from `false` → `true`, the sphere resets to this phase.
92
+ */
93
+ seed: number;
94
+ /**
95
+ * Sphere mesh subdivisions. Higher = smoother displacement, more GPU
96
+ * cost. Changing at runtime triggers a scene rebuild.
97
+ */
98
+ subdivisions: number;
99
+ /**
100
+ * Device-pixel-ratio cap. `null` picks `min(devicePixelRatio, 2)`.
101
+ * Set to `1` for lower-end devices.
102
+ */
103
+ maxPixelRatio: number | null;
104
+ /**
105
+ * Scene clear color. `null` keeps the canvas fully transparent so the
106
+ * sphere blends into the host UI.
107
+ */
108
+ backgroundColor: string | null;
109
+ }
110
+ /**
111
+ * Preset tuned for Shogo's Voice Mode hero — warm Shogo orange palette,
112
+ * rim tied to `lightBColor`, camera zoomed back so the sphere reads
113
+ * "contained" rather than "looming", reactivity values copied from
114
+ * Bruno Simon's upstream `organic-sphere` demo so silhouettes animate
115
+ * faithfully.
116
+ */
117
+ declare const DEFAULT_ORGANIC_SPHERE_CONFIG: OrganicSphereConfig;
118
+ /**
119
+ * Merge a partial override into `DEFAULT_ORGANIC_SPHERE_CONFIG`, doing a
120
+ * shallow merge on the root + per-band merge on `volume/medium/high/low`
121
+ * so consumers only need to specify what they want to change.
122
+ */
123
+ declare function resolveOrganicSphereConfig(partial?: Partial<OrganicSphereConfig>): OrganicSphereConfig;
124
+
125
+ /**
126
+ * Configuration surface for the `OrganicParticles` audio-reactive
127
+ * visualization — a particle-cloud sibling of `OrganicSphere`.
128
+ *
129
+ * Shares the same `BandReactivity` shape and four-band model
130
+ * (volume / medium / high / low) as the sphere, so audio-tuning muscle
131
+ * memory carries over. What changes is the cloud-specific fields:
132
+ *
133
+ * volume → radial displacement (how far the cloud bursts outward)
134
+ * medium → particle size boost (how puffy each point renders)
135
+ * high → swirl strength (how much the cloud twists)
136
+ * low → time evolution speed (noise phase drift)
137
+ *
138
+ * Like `OrganicSphereConfig`, everything is JSON-serializable.
139
+ */
140
+
141
+ interface OrganicParticlesConfig {
142
+ /**
143
+ * Number of particles. Changing this rebuilds the scene. Sweet spot
144
+ * for visual density without frame-drop is 20k–80k on a modern GPU.
145
+ */
146
+ count: number;
147
+ /**
148
+ * Inner / outer radius of the seeded spawn shell. Particles are
149
+ * uniformly distributed between these two radii so the cloud has
150
+ * perceptible thickness rather than sitting on a single sphere.
151
+ */
152
+ innerRadius: number;
153
+ outerRadius: number;
154
+ /** Spatial frequency of the Perlin noise warp. */
155
+ noiseFrequency: number;
156
+ /** Strength of the noise warp. */
157
+ noiseStrength: number;
158
+ /**
159
+ * Constant per-ms Y-axis rotation applied to the whole cloud,
160
+ * independent of audio. `0` (default) means the cloud is perfectly
161
+ * still when no audio plays. Positive = spin right, negative = left.
162
+ */
163
+ rotationBias: number;
164
+ /**
165
+ * Rate (per ms) at which `uTime` advances the per-particle swirl
166
+ * angle in the shader, independent of audio. `0` (default) = swirl
167
+ * only responds to audio high-band + particle height.
168
+ */
169
+ swirlTimeRate: number;
170
+ /**
171
+ * Rate (per ms) at which `uTime` advances while the cloud is idle
172
+ * (i.e. `active === false`). Lets the Perlin noise field keep
173
+ * shimmering subtly when nothing is playing so the cloud doesn't feel
174
+ * dead. `0` = fully frozen when paused. Default `0.0001` ≈ one full
175
+ * noise period every ~10 s — perceptible but not distracting.
176
+ */
177
+ idleNoiseRate: number;
178
+ /** Base particle size (before audio boost / perspective scaling). */
179
+ sizeBase: number;
180
+ /**
181
+ * Edge softness of each particle sprite, in [0, 1]. `0` = hard disc,
182
+ * `1` = heavy feather/plasma. ~0.6 reads as "nebula".
183
+ */
184
+ softness: number;
185
+ /** Overall opacity multiplier. */
186
+ opacity: number;
187
+ /** Color at the cloud core (low `vHeat`). */
188
+ colorCool: string;
189
+ /** Color at the cloud fringe (high `vHeat`). */
190
+ colorHot: string;
191
+ /** volume → radial displacement push. */
192
+ volume: BandReactivity;
193
+ /** medium → per-particle size boost. */
194
+ medium: BandReactivity;
195
+ /** high → swirl / twist amount. */
196
+ high: BandReactivity;
197
+ /** low → time evolution speed. */
198
+ low: BandReactivity;
199
+ cameraZ: number;
200
+ fov: number;
201
+ /**
202
+ * Seed used to generate the initial particle positions AND the wander
203
+ * phase. Same seed + same audio → same visual across playbacks.
204
+ */
205
+ seed: number;
206
+ /** `null` picks `min(devicePixelRatio, 2)`. */
207
+ maxPixelRatio: number | null;
208
+ /** Scene clear color. `null` = transparent. */
209
+ backgroundColor: string | null;
210
+ }
211
+ /**
212
+ * Preset tuned to match the Shogo warm-orange palette used by
213
+ * `DEFAULT_ORGANIC_SPHERE_CONFIG`, so the two modes read as siblings.
214
+ * Count/size defaults target 60fps on mid-tier GPUs.
215
+ */
216
+ declare const DEFAULT_ORGANIC_PARTICLES_CONFIG: OrganicParticlesConfig;
217
+ /**
218
+ * Merge a partial override into `DEFAULT_ORGANIC_PARTICLES_CONFIG`,
219
+ * with per-band shallow merges for `volume/medium/high/low`.
220
+ */
221
+ declare function resolveOrganicParticlesConfig(partial?: Partial<OrganicParticlesConfig>): OrganicParticlesConfig;
222
+
223
+ export { type BandReactivity as B, DEFAULT_ORGANIC_PARTICLES_CONFIG as D, type OrganicParticlesConfig as O, DEFAULT_ORGANIC_SPHERE_CONFIG as a, type OrganicSphereConfig as b, resolveOrganicSphereConfig as c, resolveOrganicParticlesConfig as r };