@fias/arche-sdk 1.9.0 → 1.11.0
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/README.md +1 -1
- package/dist/cli/create-plugin.js +0 -0
- package/dist/generated/permissions.d.ts +15 -0
- package/dist/generated/permissions.d.ts.map +1 -0
- package/dist/generated/permissions.js +32 -0
- package/dist/generated/permissions.js.map +1 -0
- package/dist/generated/surfaces.d.ts +267 -0
- package/dist/generated/surfaces.d.ts.map +1 -0
- package/dist/generated/surfaces.js +87 -0
- package/dist/generated/surfaces.js.map +1 -0
- package/dist/hooks.d.ts +81 -18
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +184 -50
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.test.js +232 -0
- package/dist/hooks.test.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +187 -31
- package/dist/types.d.ts +212 -54
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -1
- package/package.json +16 -16
- package/templates/default/AGENTS.md +59 -3
- package/templates/default/CLAUDE.md +59 -3
package/README.md
CHANGED
|
@@ -392,7 +392,7 @@ import type {
|
|
|
392
392
|
|
|
393
393
|
## Further Reading
|
|
394
394
|
|
|
395
|
-
- **[
|
|
395
|
+
- **[Arche Guide](../../docs/arche-guide.md)** — Step-by-step guide for external arche/plugin creation
|
|
396
396
|
- **[Developer API Reference](../../docs/api-developer.md)** — Bridge, entities, credits, and validation endpoints
|
|
397
397
|
- **[Plugin API Reference](../../docs/api-plugins.md)** — Submission, review pipeline, and production bridge
|
|
398
398
|
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by `pnpm generate:sdk-types` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* `PluginPermission` union + `VALID_PLUGIN_PERMISSIONS` const,
|
|
5
|
+
* sourced from `@fias/db-types`. Generated (not re-exported) so the
|
|
6
|
+
* SDK has no runtime dependency on db-types — the SDK ships in
|
|
7
|
+
* plugin iframes and must stay bundle-clean.
|
|
8
|
+
*
|
|
9
|
+
* `tests/architecture/sdk-permissions-match-db-types.test.ts` ensures
|
|
10
|
+
* this file stays in lockstep with the canonical source.
|
|
11
|
+
*/
|
|
12
|
+
export type PluginPermission = 'assets:read' | 'data:store' | 'entities:audio_generate' | 'entities:image_generate' | 'entities:invoke' | 'storage:sandbox' | 'store:purchase' | 'theme:read' | 'user:profile:read' | 'vault:documents:read' | 'vault:documents:write';
|
|
13
|
+
export declare const VALID_PLUGIN_PERMISSIONS: readonly PluginPermission[];
|
|
14
|
+
export declare function isValidPluginPermission(perm: string): perm is PluginPermission;
|
|
15
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/generated/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,YAAY,GACZ,yBAAyB,GACzB,yBAAyB,GACzB,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,CAAC;AAE5B,eAAO,MAAM,wBAAwB,EAAE,SAAS,gBAAgB,EAYtD,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAE9E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by `pnpm generate:sdk-types` — DO NOT EDIT BY HAND.
|
|
4
|
+
*
|
|
5
|
+
* `PluginPermission` union + `VALID_PLUGIN_PERMISSIONS` const,
|
|
6
|
+
* sourced from `@fias/db-types`. Generated (not re-exported) so the
|
|
7
|
+
* SDK has no runtime dependency on db-types — the SDK ships in
|
|
8
|
+
* plugin iframes and must stay bundle-clean.
|
|
9
|
+
*
|
|
10
|
+
* `tests/architecture/sdk-permissions-match-db-types.test.ts` ensures
|
|
11
|
+
* this file stays in lockstep with the canonical source.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.VALID_PLUGIN_PERMISSIONS = void 0;
|
|
15
|
+
exports.isValidPluginPermission = isValidPluginPermission;
|
|
16
|
+
exports.VALID_PLUGIN_PERMISSIONS = [
|
|
17
|
+
'assets:read',
|
|
18
|
+
'data:store',
|
|
19
|
+
'entities:audio_generate',
|
|
20
|
+
'entities:image_generate',
|
|
21
|
+
'entities:invoke',
|
|
22
|
+
'storage:sandbox',
|
|
23
|
+
'store:purchase',
|
|
24
|
+
'theme:read',
|
|
25
|
+
'user:profile:read',
|
|
26
|
+
'vault:documents:read',
|
|
27
|
+
'vault:documents:write',
|
|
28
|
+
];
|
|
29
|
+
function isValidPluginPermission(perm) {
|
|
30
|
+
return exports.VALID_PLUGIN_PERMISSIONS.includes(perm);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/generated/permissions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AA6BH,0DAEC;AAhBY,QAAA,wBAAwB,GAAgC;IACnE,aAAa;IACb,YAAY;IACZ,yBAAyB;IACzB,yBAAyB;IACzB,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,mBAAmB;IACnB,sBAAsB;IACtB,uBAAuB;CACf,CAAC;AAEX,SAAgB,uBAAuB,CAAC,IAAY;IAClD,OAAQ,gCAA8C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by `pnpm generate:sdk-types` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Typed convenience hooks for each registered invocation surface.
|
|
5
|
+
* Source: packages/entities/src/surfaces/.
|
|
6
|
+
*
|
|
7
|
+
* Run the generator after adding or modifying surface metadata; the
|
|
8
|
+
* `tests/architecture/sdk-generated-types-fresh.test.ts` trip-wire
|
|
9
|
+
* fails CI if this file is out of sync.
|
|
10
|
+
*/
|
|
11
|
+
export type ElevenLabsAudioIsolationParams = {
|
|
12
|
+
readonly fileId?: string;
|
|
13
|
+
readonly audioRef?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ElevenLabsAudioIsolationResult = {
|
|
16
|
+
readonly audioUrl: string;
|
|
17
|
+
readonly audioRef: string;
|
|
18
|
+
readonly fileId?: string;
|
|
19
|
+
readonly mimeType: string;
|
|
20
|
+
readonly sizeBytes: number;
|
|
21
|
+
readonly durationMinutes: number;
|
|
22
|
+
readonly costCredits?: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const AUDIO_AUDIO_ISOLATION_SURFACE_KEY: "audio.audio-isolation";
|
|
25
|
+
/**
|
|
26
|
+
* Strip background noise from a clip. Common preprocessor before transcription or voice cloning.
|
|
27
|
+
*
|
|
28
|
+
* Permission: `entities:audio_generate`
|
|
29
|
+
*/
|
|
30
|
+
export declare const useElevenLabsAudioIsolation: () => {
|
|
31
|
+
invoke: (params: ElevenLabsAudioIsolationParams) => Promise<ElevenLabsAudioIsolationResult>;
|
|
32
|
+
isLoading: boolean;
|
|
33
|
+
result: ElevenLabsAudioIsolationResult | null;
|
|
34
|
+
error: Error | null;
|
|
35
|
+
};
|
|
36
|
+
export type ElevenLabsForcedAlignmentParams = {
|
|
37
|
+
readonly text: string;
|
|
38
|
+
readonly fileId?: string;
|
|
39
|
+
readonly audioRef?: string;
|
|
40
|
+
};
|
|
41
|
+
export type ElevenLabsForcedAlignmentResult = {
|
|
42
|
+
readonly words: ReadonlyArray<{
|
|
43
|
+
readonly word: string;
|
|
44
|
+
readonly startTime: number;
|
|
45
|
+
readonly endTime: number;
|
|
46
|
+
}>;
|
|
47
|
+
readonly characters?: ReadonlyArray<{
|
|
48
|
+
readonly character: string;
|
|
49
|
+
readonly startTime: number;
|
|
50
|
+
readonly endTime: number;
|
|
51
|
+
}>;
|
|
52
|
+
readonly durationMinutes: number;
|
|
53
|
+
readonly costCredits?: number;
|
|
54
|
+
};
|
|
55
|
+
export declare const AUDIO_FORCED_ALIGNMENT_SURFACE_KEY: "audio.forced-alignment";
|
|
56
|
+
/**
|
|
57
|
+
* Align an existing transcript to audio for word- and character-level timestamps. Useful for subtitle generation and karaoke-style UIs.
|
|
58
|
+
*
|
|
59
|
+
* Permission: `entities:audio_generate`
|
|
60
|
+
*/
|
|
61
|
+
export declare const useElevenLabsForcedAlignment: () => {
|
|
62
|
+
invoke: (params: ElevenLabsForcedAlignmentParams) => Promise<ElevenLabsForcedAlignmentResult>;
|
|
63
|
+
isLoading: boolean;
|
|
64
|
+
result: ElevenLabsForcedAlignmentResult | null;
|
|
65
|
+
error: Error | null;
|
|
66
|
+
};
|
|
67
|
+
export type LyriaMusicParams = {
|
|
68
|
+
readonly prompt: string;
|
|
69
|
+
readonly negativePrompt?: string;
|
|
70
|
+
readonly seed?: number;
|
|
71
|
+
readonly sampleCount?: number;
|
|
72
|
+
readonly durationSeconds?: number;
|
|
73
|
+
};
|
|
74
|
+
export type LyriaMusicResult = {
|
|
75
|
+
readonly clips: ReadonlyArray<{
|
|
76
|
+
readonly audioUrl: string;
|
|
77
|
+
readonly audioRef: string;
|
|
78
|
+
readonly fileId?: string;
|
|
79
|
+
readonly mimeType: string;
|
|
80
|
+
readonly sampleRate: number;
|
|
81
|
+
readonly durationSeconds: number;
|
|
82
|
+
readonly sizeBytes: number;
|
|
83
|
+
}>;
|
|
84
|
+
readonly model: string;
|
|
85
|
+
readonly provider: 'google-vertex';
|
|
86
|
+
readonly totalDurationSeconds: number;
|
|
87
|
+
readonly costCredits?: number;
|
|
88
|
+
};
|
|
89
|
+
export declare const AUDIO_LYRIA_MUSIC_SURFACE_KEY: "audio.lyria-music";
|
|
90
|
+
/**
|
|
91
|
+
* Generate 1–4 music clips (30s each) from a text prompt using Google Vertex Lyria.
|
|
92
|
+
*
|
|
93
|
+
* Permission: `entities:audio_generate`
|
|
94
|
+
*/
|
|
95
|
+
export declare const useLyriaMusic: () => {
|
|
96
|
+
invoke: (params: LyriaMusicParams) => Promise<LyriaMusicResult>;
|
|
97
|
+
isLoading: boolean;
|
|
98
|
+
result: LyriaMusicResult | null;
|
|
99
|
+
error: Error | null;
|
|
100
|
+
};
|
|
101
|
+
export type ElevenLabsMusicParams = {
|
|
102
|
+
readonly text: string;
|
|
103
|
+
readonly durationSeconds: number;
|
|
104
|
+
readonly temperature?: number;
|
|
105
|
+
readonly modelId?: string;
|
|
106
|
+
};
|
|
107
|
+
export type ElevenLabsMusicResult = {
|
|
108
|
+
readonly audioUrl: string;
|
|
109
|
+
readonly audioRef: string;
|
|
110
|
+
readonly fileId?: string;
|
|
111
|
+
readonly mimeType: string;
|
|
112
|
+
readonly sizeBytes: number;
|
|
113
|
+
readonly durationSeconds: number;
|
|
114
|
+
readonly costCredits?: number;
|
|
115
|
+
};
|
|
116
|
+
export declare const AUDIO_MUSIC_SURFACE_KEY: "audio.music";
|
|
117
|
+
/**
|
|
118
|
+
* Generate original music tracks from a text prompt (10–90s).
|
|
119
|
+
*
|
|
120
|
+
* Permission: `entities:audio_generate`
|
|
121
|
+
*/
|
|
122
|
+
export declare const useElevenLabsMusic: () => {
|
|
123
|
+
invoke: (params: ElevenLabsMusicParams) => Promise<ElevenLabsMusicResult>;
|
|
124
|
+
isLoading: boolean;
|
|
125
|
+
result: ElevenLabsMusicResult | null;
|
|
126
|
+
error: Error | null;
|
|
127
|
+
};
|
|
128
|
+
export type ElevenLabsSfxParams = {
|
|
129
|
+
readonly text: string;
|
|
130
|
+
readonly durationSeconds?: number;
|
|
131
|
+
readonly promptInfluence?: number;
|
|
132
|
+
};
|
|
133
|
+
export type ElevenLabsSfxResult = {
|
|
134
|
+
readonly audioUrl: string;
|
|
135
|
+
readonly audioRef: string;
|
|
136
|
+
readonly fileId?: string;
|
|
137
|
+
readonly mimeType: string;
|
|
138
|
+
readonly sizeBytes: number;
|
|
139
|
+
readonly charactersBilled: number;
|
|
140
|
+
readonly costCredits?: number;
|
|
141
|
+
};
|
|
142
|
+
export declare const AUDIO_SOUND_EFFECTS_SURFACE_KEY: "audio.sound-effects";
|
|
143
|
+
/**
|
|
144
|
+
* Generate cinematic sound effects (foley, ambience, impacts) from a short text description.
|
|
145
|
+
*
|
|
146
|
+
* Permission: `entities:audio_generate`
|
|
147
|
+
*/
|
|
148
|
+
export declare const useElevenLabsSfx: () => {
|
|
149
|
+
invoke: (params: ElevenLabsSfxParams) => Promise<ElevenLabsSfxResult>;
|
|
150
|
+
isLoading: boolean;
|
|
151
|
+
result: ElevenLabsSfxResult | null;
|
|
152
|
+
error: Error | null;
|
|
153
|
+
};
|
|
154
|
+
export type ElevenLabsSttParams = {
|
|
155
|
+
readonly fileId?: string;
|
|
156
|
+
readonly audioRef?: string;
|
|
157
|
+
readonly language?: string;
|
|
158
|
+
readonly modelId?: string;
|
|
159
|
+
};
|
|
160
|
+
export type ElevenLabsSttResult = {
|
|
161
|
+
readonly text: string;
|
|
162
|
+
readonly words?: ReadonlyArray<{
|
|
163
|
+
readonly word: string;
|
|
164
|
+
readonly startTime: number;
|
|
165
|
+
readonly endTime: number;
|
|
166
|
+
}>;
|
|
167
|
+
readonly language?: string;
|
|
168
|
+
readonly durationMinutes: number;
|
|
169
|
+
readonly costCredits?: number;
|
|
170
|
+
};
|
|
171
|
+
export declare const AUDIO_SPEECH_TO_TEXT_SURFACE_KEY: "audio.speech-to-text";
|
|
172
|
+
/**
|
|
173
|
+
* Transcribe spoken audio to text. Supply audio via a Vault Documents documentId (from useVaultDocuments) or a Fias audioRef from a prior generation.
|
|
174
|
+
*
|
|
175
|
+
* Permission: `entities:audio_generate`
|
|
176
|
+
*/
|
|
177
|
+
export declare const useElevenLabsStt: () => {
|
|
178
|
+
invoke: (params: ElevenLabsSttParams) => Promise<ElevenLabsSttResult>;
|
|
179
|
+
isLoading: boolean;
|
|
180
|
+
result: ElevenLabsSttResult | null;
|
|
181
|
+
error: Error | null;
|
|
182
|
+
};
|
|
183
|
+
export type ElevenLabsTtsParams = {
|
|
184
|
+
readonly voiceId: string;
|
|
185
|
+
readonly text: string;
|
|
186
|
+
readonly modelId?: string;
|
|
187
|
+
readonly voiceSettings?: {
|
|
188
|
+
readonly stability?: number;
|
|
189
|
+
readonly similarityBoost?: number;
|
|
190
|
+
readonly style?: number;
|
|
191
|
+
readonly useSpeakerBoost?: boolean;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
export type ElevenLabsTtsResult = {
|
|
195
|
+
readonly audioUrl: string;
|
|
196
|
+
readonly audioRef: string;
|
|
197
|
+
readonly fileId?: string;
|
|
198
|
+
readonly mimeType: string;
|
|
199
|
+
readonly sizeBytes: number;
|
|
200
|
+
readonly charactersBilled: number;
|
|
201
|
+
readonly costCredits?: number;
|
|
202
|
+
};
|
|
203
|
+
export declare const AUDIO_TTS_SURFACE_KEY: "audio.tts";
|
|
204
|
+
/**
|
|
205
|
+
* Synthesize natural-sounding speech from text using ElevenLabs voices.
|
|
206
|
+
*
|
|
207
|
+
* Permission: `entities:audio_generate`
|
|
208
|
+
*/
|
|
209
|
+
export declare const useElevenLabsTts: () => {
|
|
210
|
+
invoke: (params: ElevenLabsTtsParams) => Promise<ElevenLabsTtsResult>;
|
|
211
|
+
isLoading: boolean;
|
|
212
|
+
result: ElevenLabsTtsResult | null;
|
|
213
|
+
error: Error | null;
|
|
214
|
+
};
|
|
215
|
+
export type ElevenLabsVoiceChangerParams = {
|
|
216
|
+
readonly voiceId: string;
|
|
217
|
+
readonly fileId?: string;
|
|
218
|
+
readonly audioRef?: string;
|
|
219
|
+
readonly modelId?: string;
|
|
220
|
+
};
|
|
221
|
+
export type ElevenLabsVoiceChangerResult = {
|
|
222
|
+
readonly audioUrl: string;
|
|
223
|
+
readonly audioRef: string;
|
|
224
|
+
readonly fileId?: string;
|
|
225
|
+
readonly mimeType: string;
|
|
226
|
+
readonly sizeBytes: number;
|
|
227
|
+
readonly charactersBilled: number;
|
|
228
|
+
readonly costCredits?: number;
|
|
229
|
+
};
|
|
230
|
+
export declare const AUDIO_VOICE_CHANGER_SURFACE_KEY: "audio.voice-changer";
|
|
231
|
+
/**
|
|
232
|
+
* Convert an existing audio clip into a different voice while preserving prosody. Supply source audio via fileId or audioRef.
|
|
233
|
+
*
|
|
234
|
+
* Permission: `entities:audio_generate`
|
|
235
|
+
*/
|
|
236
|
+
export declare const useElevenLabsVoiceChanger: () => {
|
|
237
|
+
invoke: (params: ElevenLabsVoiceChangerParams) => Promise<ElevenLabsVoiceChangerResult>;
|
|
238
|
+
isLoading: boolean;
|
|
239
|
+
result: ElevenLabsVoiceChangerResult | null;
|
|
240
|
+
error: Error | null;
|
|
241
|
+
};
|
|
242
|
+
export type ElevenLabsVoiceDesignParams = {
|
|
243
|
+
readonly description: string;
|
|
244
|
+
readonly previewText?: string;
|
|
245
|
+
readonly name?: string;
|
|
246
|
+
readonly labels?: ReadonlyArray<string>;
|
|
247
|
+
readonly accentStrength?: number;
|
|
248
|
+
};
|
|
249
|
+
export type ElevenLabsVoiceDesignResult = {
|
|
250
|
+
readonly voiceId: string;
|
|
251
|
+
readonly previewUrl: string;
|
|
252
|
+
readonly charactersBilled: number;
|
|
253
|
+
readonly costCredits?: number;
|
|
254
|
+
};
|
|
255
|
+
export declare const AUDIO_VOICE_DESIGN_SURFACE_KEY: "audio.voice-design";
|
|
256
|
+
/**
|
|
257
|
+
* Create a brand-new synthetic voice from a description and audition a preview.
|
|
258
|
+
*
|
|
259
|
+
* Permission: `entities:audio_generate`
|
|
260
|
+
*/
|
|
261
|
+
export declare const useElevenLabsVoiceDesign: () => {
|
|
262
|
+
invoke: (params: ElevenLabsVoiceDesignParams) => Promise<ElevenLabsVoiceDesignResult>;
|
|
263
|
+
isLoading: boolean;
|
|
264
|
+
result: ElevenLabsVoiceDesignResult | null;
|
|
265
|
+
error: Error | null;
|
|
266
|
+
};
|
|
267
|
+
//# sourceMappingURL=surfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../../src/generated/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAG,uBAAgC,CAAC;AAElF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;;;;CAGrC,CAAC;AAGJ,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;Q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ation surface.
|
|
6
|
+
* Source: packages/entities/src/surfaces/.
|
|
7
|
+
*
|
|
8
|
+
* Run the generator after adding or modifying surface metadata; the
|
|
9
|
+
* `tests/architecture/sdk-generated-types-fresh.test.ts` trip-wire
|
|
10
|
+
* fails CI if this file is out of sync.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.useElevenLabsVoiceDesign = exports.AUDIO_VOICE_DESIGN_SURFACE_KEY = exports.useElevenLabsVoiceChanger = exports.AUDIO_VOICE_CHANGER_SURFACE_KEY = exports.useElevenLabsTts = exports.AUDIO_TTS_SURFACE_KEY = exports.useElevenLabsStt = exports.AUDIO_SPEECH_TO_TEXT_SURFACE_KEY = exports.useElevenLabsSfx = exports.AUDIO_SOUND_EFFECTS_SURFACE_KEY = exports.useElevenLabsMusic = exports.AUDIO_MUSIC_SURFACE_KEY = exports.useLyriaMusic = exports.AUDIO_LYRIA_MUSIC_SURFACE_KEY = exports.useElevenLabsForcedAlignment = exports.AUDIO_FORCED_ALIGNMENT_SURFACE_KEY = exports.useElevenLabsAudioIsolation = exports.AUDIO_AUDIO_ISOLATION_SURFACE_KEY = void 0;
|
|
14
|
+
const hooks_1 = require("../hooks");
|
|
15
|
+
exports.AUDIO_AUDIO_ISOLATION_SURFACE_KEY = 'audio.audio-isolation';
|
|
16
|
+
/**
|
|
17
|
+
* Strip background noise from a clip. Common preprocessor before transcription or voice cloning.
|
|
18
|
+
*
|
|
19
|
+
* Permission: `entities:audio_generate`
|
|
20
|
+
*/
|
|
21
|
+
const useElevenLabsAudioIsolation = () => (0, hooks_1.useSurface)(exports.AUDIO_AUDIO_ISOLATION_SURFACE_KEY);
|
|
22
|
+
exports.useElevenLabsAudioIsolation = useElevenLabsAudioIsolation;
|
|
23
|
+
exports.AUDIO_FORCED_ALIGNMENT_SURFACE_KEY = 'audio.forced-alignment';
|
|
24
|
+
/**
|
|
25
|
+
* Align an existing transcript to audio for word- and character-level timestamps. Useful for subtitle generation and karaoke-style UIs.
|
|
26
|
+
*
|
|
27
|
+
* Permission: `entities:audio_generate`
|
|
28
|
+
*/
|
|
29
|
+
const useElevenLabsForcedAlignment = () => (0, hooks_1.useSurface)(exports.AUDIO_FORCED_ALIGNMENT_SURFACE_KEY);
|
|
30
|
+
exports.useElevenLabsForcedAlignment = useElevenLabsForcedAlignment;
|
|
31
|
+
exports.AUDIO_LYRIA_MUSIC_SURFACE_KEY = 'audio.lyria-music';
|
|
32
|
+
/**
|
|
33
|
+
* Generate 1–4 music clips (30s each) from a text prompt using Google Vertex Lyria.
|
|
34
|
+
*
|
|
35
|
+
* Permission: `entities:audio_generate`
|
|
36
|
+
*/
|
|
37
|
+
const useLyriaMusic = () => (0, hooks_1.useSurface)(exports.AUDIO_LYRIA_MUSIC_SURFACE_KEY);
|
|
38
|
+
exports.useLyriaMusic = useLyriaMusic;
|
|
39
|
+
exports.AUDIO_MUSIC_SURFACE_KEY = 'audio.music';
|
|
40
|
+
/**
|
|
41
|
+
* Generate original music tracks from a text prompt (10–90s).
|
|
42
|
+
*
|
|
43
|
+
* Permission: `entities:audio_generate`
|
|
44
|
+
*/
|
|
45
|
+
const useElevenLabsMusic = () => (0, hooks_1.useSurface)(exports.AUDIO_MUSIC_SURFACE_KEY);
|
|
46
|
+
exports.useElevenLabsMusic = useElevenLabsMusic;
|
|
47
|
+
exports.AUDIO_SOUND_EFFECTS_SURFACE_KEY = 'audio.sound-effects';
|
|
48
|
+
/**
|
|
49
|
+
* Generate cinematic sound effects (foley, ambience, impacts) from a short text description.
|
|
50
|
+
*
|
|
51
|
+
* Permission: `entities:audio_generate`
|
|
52
|
+
*/
|
|
53
|
+
const useElevenLabsSfx = () => (0, hooks_1.useSurface)(exports.AUDIO_SOUND_EFFECTS_SURFACE_KEY);
|
|
54
|
+
exports.useElevenLabsSfx = useElevenLabsSfx;
|
|
55
|
+
exports.AUDIO_SPEECH_TO_TEXT_SURFACE_KEY = 'audio.speech-to-text';
|
|
56
|
+
/**
|
|
57
|
+
* Transcribe spoken audio to text. Supply audio via a Vault Documents documentId (from useVaultDocuments) or a Fias audioRef from a prior generation.
|
|
58
|
+
*
|
|
59
|
+
* Permission: `entities:audio_generate`
|
|
60
|
+
*/
|
|
61
|
+
const useElevenLabsStt = () => (0, hooks_1.useSurface)(exports.AUDIO_SPEECH_TO_TEXT_SURFACE_KEY);
|
|
62
|
+
exports.useElevenLabsStt = useElevenLabsStt;
|
|
63
|
+
exports.AUDIO_TTS_SURFACE_KEY = 'audio.tts';
|
|
64
|
+
/**
|
|
65
|
+
* Synthesize natural-sounding speech from text using ElevenLabs voices.
|
|
66
|
+
*
|
|
67
|
+
* Permission: `entities:audio_generate`
|
|
68
|
+
*/
|
|
69
|
+
const useElevenLabsTts = () => (0, hooks_1.useSurface)(exports.AUDIO_TTS_SURFACE_KEY);
|
|
70
|
+
exports.useElevenLabsTts = useElevenLabsTts;
|
|
71
|
+
exports.AUDIO_VOICE_CHANGER_SURFACE_KEY = 'audio.voice-changer';
|
|
72
|
+
/**
|
|
73
|
+
* Convert an existing audio clip into a different voice while preserving prosody. Supply source audio via fileId or audioRef.
|
|
74
|
+
*
|
|
75
|
+
* Permission: `entities:audio_generate`
|
|
76
|
+
*/
|
|
77
|
+
const useElevenLabsVoiceChanger = () => (0, hooks_1.useSurface)(exports.AUDIO_VOICE_CHANGER_SURFACE_KEY);
|
|
78
|
+
exports.useElevenLabsVoiceChanger = useElevenLabsVoiceChanger;
|
|
79
|
+
exports.AUDIO_VOICE_DESIGN_SURFACE_KEY = 'audio.voice-design';
|
|
80
|
+
/**
|
|
81
|
+
* Create a brand-new synthetic voice from a description and audition a preview.
|
|
82
|
+
*
|
|
83
|
+
* Permission: `entities:audio_generate`
|
|
84
|
+
*/
|
|
85
|
+
const useElevenLabsVoiceDesign = () => (0, hooks_1.useSurface)(exports.AUDIO_VOICE_DESIGN_SURFACE_KEY);
|
|
86
|
+
exports.useElevenLabsVoiceDesign = useElevenLabsVoiceDesign;
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G,WAAoB,CAAC;AAE1D;;;;GAIG;AACI,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,IAAA,kBAAU,EAA2C,6BAAqB,CAAC,CAAC;AADjE,QAAA,gBAAgB,oBACiD;AAoBjE,QAAA,+BAA+B,GAAG,qBAA8B,CAAC;AAE9E;;;;GAIG;AACI,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAC5C,IAAA,kBAAU,EACR,uCAA+B,CAChC,CAAC;AAHS,QAAA,yBAAyB,6BAGlC;AAkBS,QAAA,8BAA8B,GAAG,oBAA6B,CAAC;AAE5E;;;;GAIG;AACI,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAC3C,IAAA,kBAAU,EACR,sCAA8B,CAC/B,CAAC;AAHS,QAAA,wBAAwB,4BAGjC"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FiasUser, FiasTheme, FiasStorageApi, EntityInvocationApi, ImageGenerationApi, FiasNavigationApi, StepNavigationApi, StepNavigationOptions, FiasDataStoreApi, FiasStoreApi,
|
|
1
|
+
import type { FiasUser, FiasTheme, FiasStorageApi, EntityInvocationApi, ImageGenerationApi, AudioGenerationApi, FiasNavigationApi, StepNavigationApi, StepNavigationOptions, FiasDataStoreApi, FiasStoreApi, VaultDocumentsApi, VaultDocumentDownloadUrl, ArcheAssetsApi } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Access the current user's profile information.
|
|
4
4
|
* Requires the `user:profile:read` permission in fias-plugin.json.
|
|
@@ -42,9 +42,58 @@ export declare function useEntityInvocation(): EntityInvocationApi;
|
|
|
42
42
|
* is returned for display. Uses a 2-minute timeout (image generation
|
|
43
43
|
* can take 10-60 seconds depending on the provider).
|
|
44
44
|
*
|
|
45
|
+
* @deprecated Phase 3 of the Invocation Surface Pattern migrates image
|
|
46
|
+
* generation onto the registry. Prefer the generated typed hook
|
|
47
|
+
* (`useImageGenerate()` from `@fias/arche-sdk` once the image surface
|
|
48
|
+
* registers) over this hand-written one. The legacy `image_generate`
|
|
49
|
+
* bridge op continues to work through the deprecation window. Tracking:
|
|
50
|
+
* docs/architecture/invocation-surface-pattern.md §7 Phase 3.
|
|
51
|
+
*
|
|
45
52
|
* @returns Image generation API (generate, isLoading, result, error).
|
|
46
53
|
*/
|
|
47
54
|
export declare function useImageGeneration(): ImageGenerationApi;
|
|
55
|
+
/**
|
|
56
|
+
* Generate audio (music today; future speech/SFX sub-types via the same
|
|
57
|
+
* hook) via the bridge's `audio_generate` op. Returns an array of clips
|
|
58
|
+
* with same-origin signed proxy URLs suitable for `<audio src>` playback
|
|
59
|
+
* inside the plugin iframe.
|
|
60
|
+
*
|
|
61
|
+
* Lyria 4×30 s clips can take ~90–120 s end-to-end, so the per-request
|
|
62
|
+
* timeout is 3 minutes (vs image's 2 minutes).
|
|
63
|
+
*
|
|
64
|
+
* @deprecated Phase 2 of the Invocation Surface Pattern shipped typed
|
|
65
|
+
* per-surface hooks: `useLyriaMusic()` (Lyria), `useElevenLabsTts()`,
|
|
66
|
+
* `useElevenLabsSfx()`, `useElevenLabsMusic()`, etc. They invoke through
|
|
67
|
+
* the `surface_invoke` bridge op with per-surface Zod-validated params.
|
|
68
|
+
* The legacy `audio_generate` op continues to work through the
|
|
69
|
+
* deprecation window. Tracking: docs/architecture/invocation-surface-pattern.md
|
|
70
|
+
* §7 Phase 3.
|
|
71
|
+
*
|
|
72
|
+
* @returns Audio generation API (generate, isLoading, result, error).
|
|
73
|
+
*/
|
|
74
|
+
export declare function useAudioGeneration(): AudioGenerationApi;
|
|
75
|
+
/**
|
|
76
|
+
* Generic Invocation Surface hook.
|
|
77
|
+
*
|
|
78
|
+
* Plugin code should usually call one of the **generated typed hooks**
|
|
79
|
+
* (e.g. `useElevenLabsTts()`) from `./generated/surfaces` rather than this
|
|
80
|
+
* directly — the typed hooks bake in the `surfaceKey` and infer the param
|
|
81
|
+
* and result types from the surface's Zod schemas.
|
|
82
|
+
*
|
|
83
|
+
* This hook is the hand-written substrate they delegate to. Direct use is
|
|
84
|
+
* fine when invoking a surface by dynamic key (rare).
|
|
85
|
+
*
|
|
86
|
+
* @param surfaceKey - Stable kebab-case key registered with the platform.
|
|
87
|
+
* @param timeoutMs - Per-request timeout. Defaults to 180s to cover the
|
|
88
|
+
* longest-running synchronous surfaces (TTS large texts,
|
|
89
|
+
* Lyria multi-clip generations).
|
|
90
|
+
*/
|
|
91
|
+
export declare function useSurface<TParams, TResult>(surfaceKey: string, timeoutMs?: number): {
|
|
92
|
+
invoke: (params: TParams) => Promise<TResult>;
|
|
93
|
+
isLoading: boolean;
|
|
94
|
+
result: TResult | null;
|
|
95
|
+
error: Error | null;
|
|
96
|
+
};
|
|
48
97
|
/**
|
|
49
98
|
* Navigate within the plugin's route space.
|
|
50
99
|
*
|
|
@@ -113,28 +162,42 @@ export declare function useFiasDataStore(): FiasDataStoreApi;
|
|
|
113
162
|
export declare function useFiasStore(): FiasStoreApi;
|
|
114
163
|
/**
|
|
115
164
|
* Cache-aware fetcher for a presigned download URL. Used internally by
|
|
116
|
-
* `
|
|
117
|
-
* paths (e.g. PDF export, image preloaders) can hit the same cache
|
|
118
|
-
* having to plumb a React context through.
|
|
119
|
-
*
|
|
120
|
-
* `requireBridge` argument lets callers force a fresh fetch when they
|
|
121
|
-
* already know their cached URL is stale. Default behavior re-uses any
|
|
122
|
-
* still-valid cached entry.
|
|
165
|
+
* `useVaultDocuments().getDownloadUrl()`. Exposed separately so non-React
|
|
166
|
+
* code paths (e.g. PDF export, image preloaders) can hit the same cache
|
|
167
|
+
* without having to plumb a React context through.
|
|
123
168
|
*/
|
|
124
|
-
export declare function
|
|
169
|
+
export declare function fetchVaultDocumentDownloadUrl(documentId: string): Promise<VaultDocumentDownloadUrl>;
|
|
125
170
|
/**
|
|
126
|
-
* Access the user's
|
|
171
|
+
* Access the user's Vault Documents, scoped to documents this arche owns.
|
|
127
172
|
*
|
|
128
|
-
* The most common use is `getDownloadUrl(
|
|
129
|
-
* `useImageGeneration()` — those calls return a `
|
|
130
|
-
* the plugin refresh the presigned URL after the original ~1h
|
|
131
|
-
* (so backgrounds/thumbnails persist across sessions).
|
|
173
|
+
* The most common use is `getDownloadUrl(documentId)` for images created
|
|
174
|
+
* via `useImageGeneration()` — those calls return a `documentId`, and this
|
|
175
|
+
* hook lets the plugin refresh the presigned URL after the original ~1h
|
|
176
|
+
* TTL expires (so backgrounds/thumbnails persist across sessions).
|
|
132
177
|
*
|
|
133
178
|
* Permissions:
|
|
134
|
-
* - `
|
|
135
|
-
* - `
|
|
179
|
+
* - `vault:documents:read` for list / read / getDownloadUrl
|
|
180
|
+
* - `vault:documents:write` for write / update / delete
|
|
181
|
+
*
|
|
182
|
+
* @returns Vault Documents API (list, read, getDownloadUrl, write, update,
|
|
183
|
+
* delete).
|
|
184
|
+
*/
|
|
185
|
+
export declare function useVaultDocuments(): VaultDocumentsApi;
|
|
186
|
+
/**
|
|
187
|
+
* Access the contributor-curated asset library for this arche.
|
|
136
188
|
*
|
|
137
|
-
*
|
|
189
|
+
* The library is a frozen snapshot taken at the arche's publish time —
|
|
190
|
+
* uploads the contributor makes after publish only affect future
|
|
191
|
+
* versions. Each asset has an immutable `assetId`; cache them in your
|
|
192
|
+
* datastore / state, and refresh `signedUrl` via `getUrl(assetId)`
|
|
193
|
+
* when it's about to expire.
|
|
194
|
+
*
|
|
195
|
+
* Permission: `assets:read`.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* const { list, getUrl } = useArcheAssets();
|
|
199
|
+
* const { entries } = await list({ limit: 50 });
|
|
200
|
+
* // entries[i].signedUrl is a short-lived URL you can use as <img src>
|
|
138
201
|
*/
|
|
139
|
-
export declare function
|
|
202
|
+
export declare function useArcheAssets(): ArcheAssetsApi;
|
|
140
203
|
//# sourceMappingURL=hooks.d.ts.map
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.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