@effect-uai/core 0.3.0 → 0.4.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/dist/{AiError-CBuPHVKA.d.mts → AiError-csR8Bhxx.d.mts} +26 -4
- package/dist/{AiError-CBuPHVKA.d.mts.map → AiError-csR8Bhxx.d.mts.map} +1 -1
- package/dist/Audio-BfCTGnH3.d.mts +61 -0
- package/dist/Audio-BfCTGnH3.d.mts.map +1 -0
- package/dist/{Image-BZmKfIdq.d.mts → Image-DxyXqzAM.d.mts} +4 -4
- package/dist/{Image-BZmKfIdq.d.mts.map → Image-DxyXqzAM.d.mts.map} +1 -1
- package/dist/{Items-CB8Bo3FI.d.mts → Items-Hg5AsYxl.d.mts} +5 -5
- package/dist/{Items-CB8Bo3FI.d.mts.map → Items-Hg5AsYxl.d.mts.map} +1 -1
- package/dist/{StructuredFormat-BWq5Hd1O.d.mts → StructuredFormat-Cl41C56K.d.mts} +1 -1
- package/dist/{StructuredFormat-BWq5Hd1O.d.mts.map → StructuredFormat-Cl41C56K.d.mts.map} +1 -1
- package/dist/{Tool-DjVufH7i.d.mts → Tool-B8B5qVEy.d.mts} +2 -2
- package/dist/{Tool-DjVufH7i.d.mts.map → Tool-B8B5qVEy.d.mts.map} +1 -1
- package/dist/{Turn-OPaILVIB.d.mts → Turn-7geUcKsf.d.mts} +4 -4
- package/dist/{Turn-OPaILVIB.d.mts.map → Turn-7geUcKsf.d.mts.map} +1 -1
- package/dist/domain/AiError.d.mts +2 -2
- package/dist/domain/AiError.mjs +18 -2
- package/dist/domain/AiError.mjs.map +1 -1
- package/dist/domain/Audio.d.mts +2 -0
- package/dist/domain/Audio.mjs +14 -0
- package/dist/domain/Audio.mjs.map +1 -0
- package/dist/domain/Image.d.mts +1 -1
- package/dist/domain/Items.d.mts +1 -1
- package/dist/domain/Music.d.mts +116 -0
- package/dist/domain/Music.d.mts.map +1 -0
- package/dist/domain/Music.mjs +29 -0
- package/dist/domain/Music.mjs.map +1 -0
- package/dist/domain/Transcript.d.mts +95 -0
- package/dist/domain/Transcript.d.mts.map +1 -0
- package/dist/domain/Transcript.mjs +22 -0
- package/dist/domain/Transcript.mjs.map +1 -0
- package/dist/domain/Turn.d.mts +1 -1
- package/dist/embedding-model/Embedding.d.mts +1 -1
- package/dist/embedding-model/EmbeddingModel.d.mts +1 -1
- package/dist/index.d.mts +13 -7
- package/dist/index.mjs +7 -1
- package/dist/language-model/LanguageModel.d.mts +5 -5
- package/dist/loop/Loop.d.mts +2 -2
- package/dist/music-generator/MusicGenerator.d.mts +77 -0
- package/dist/music-generator/MusicGenerator.d.mts.map +1 -0
- package/dist/music-generator/MusicGenerator.mjs +51 -0
- package/dist/music-generator/MusicGenerator.mjs.map +1 -0
- package/dist/music-generator/MusicGenerator.test.d.mts +1 -0
- package/dist/music-generator/MusicGenerator.test.mjs +154 -0
- package/dist/music-generator/MusicGenerator.test.mjs.map +1 -0
- package/dist/speech-synthesizer/SpeechSynthesizer.d.mts +96 -0
- package/dist/speech-synthesizer/SpeechSynthesizer.d.mts.map +1 -0
- package/dist/speech-synthesizer/SpeechSynthesizer.mjs +48 -0
- package/dist/speech-synthesizer/SpeechSynthesizer.mjs.map +1 -0
- package/dist/speech-synthesizer/SpeechSynthesizer.test.d.mts +1 -0
- package/dist/speech-synthesizer/SpeechSynthesizer.test.mjs +112 -0
- package/dist/speech-synthesizer/SpeechSynthesizer.test.mjs.map +1 -0
- package/dist/streaming/JSONL.d.mts +10 -3
- package/dist/streaming/JSONL.d.mts.map +1 -1
- package/dist/streaming/JSONL.mjs +12 -1
- package/dist/streaming/JSONL.mjs.map +1 -1
- package/dist/structured-format/StructuredFormat.d.mts +1 -1
- package/dist/testing/MockMusicGenerator.d.mts +39 -0
- package/dist/testing/MockMusicGenerator.d.mts.map +1 -0
- package/dist/testing/MockMusicGenerator.mjs +96 -0
- package/dist/testing/MockMusicGenerator.mjs.map +1 -0
- package/dist/testing/MockProvider.d.mts +2 -2
- package/dist/testing/MockSpeechSynthesizer.d.mts +37 -0
- package/dist/testing/MockSpeechSynthesizer.d.mts.map +1 -0
- package/dist/testing/MockSpeechSynthesizer.mjs +95 -0
- package/dist/testing/MockSpeechSynthesizer.mjs.map +1 -0
- package/dist/testing/MockTranscriber.d.mts +37 -0
- package/dist/testing/MockTranscriber.d.mts.map +1 -0
- package/dist/testing/MockTranscriber.mjs +77 -0
- package/dist/testing/MockTranscriber.mjs.map +1 -0
- package/dist/tool/HistoryCheck.d.mts +1 -1
- package/dist/tool/Outcome.d.mts +1 -1
- package/dist/tool/Resolvers.d.mts +1 -1
- package/dist/tool/Tool.d.mts +1 -1
- package/dist/tool/Toolkit.d.mts +2 -2
- package/dist/transcriber/Transcriber.d.mts +101 -0
- package/dist/transcriber/Transcriber.d.mts.map +1 -0
- package/dist/transcriber/Transcriber.mjs +49 -0
- package/dist/transcriber/Transcriber.mjs.map +1 -0
- package/dist/transcriber/Transcriber.test.d.mts +1 -0
- package/dist/transcriber/Transcriber.test.mjs +130 -0
- package/dist/transcriber/Transcriber.test.mjs.map +1 -0
- package/package.json +37 -1
- package/src/domain/AiError.ts +21 -0
- package/src/domain/Audio.ts +88 -0
- package/src/domain/Music.ts +121 -0
- package/src/domain/Transcript.ts +83 -0
- package/src/index.ts +6 -0
- package/src/music-generator/MusicGenerator.test.ts +170 -0
- package/src/music-generator/MusicGenerator.ts +123 -0
- package/src/speech-synthesizer/SpeechSynthesizer.test.ts +141 -0
- package/src/speech-synthesizer/SpeechSynthesizer.ts +131 -0
- package/src/streaming/JSONL.ts +12 -0
- package/src/testing/MockMusicGenerator.ts +170 -0
- package/src/testing/MockSpeechSynthesizer.ts +165 -0
- package/src/testing/MockTranscriber.ts +139 -0
- package/src/transcriber/Transcriber.test.ts +125 -0
- package/src/transcriber/Transcriber.ts +127 -0
|
@@ -4,7 +4,7 @@ import * as _$effect_Cause0 from "effect/Cause";
|
|
|
4
4
|
|
|
5
5
|
//#region src/domain/AiError.d.ts
|
|
6
6
|
declare namespace AiError_d_exports {
|
|
7
|
-
export { AiError, AuthFailed, AuthSubtype, Cancelled, ContentFiltered, ContextLengthExceeded, GenerationFailed, IncompleteTurn, InvalidRequest, RateLimited, Scope$1 as Scope, Timeout, Unavailable };
|
|
7
|
+
export { AiError, AuthFailed, AuthSubtype, Cancelled, ContentFiltered, ContextLengthExceeded, GenerationFailed, IncompleteTurn, InvalidRequest, RateLimited, Scope$1 as Scope, Timeout, Unavailable, Unsupported };
|
|
8
8
|
}
|
|
9
9
|
type Scope$1 = "rpm" | "tpm" | "rpd" | "tpd";
|
|
10
10
|
declare const RateLimited_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
@@ -104,7 +104,29 @@ declare const IncompleteTurn_base: new <A extends Record<string, any> = {}>(args
|
|
|
104
104
|
declare class IncompleteTurn extends IncompleteTurn_base<{
|
|
105
105
|
raw?: unknown;
|
|
106
106
|
}> {}
|
|
107
|
-
|
|
107
|
+
declare const Unsupported_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
108
|
+
readonly _tag: "Unsupported";
|
|
109
|
+
} & Readonly<A>;
|
|
110
|
+
/**
|
|
111
|
+
* The provider does not implement the requested capability for this
|
|
112
|
+
* specific request. Distinct from `InvalidRequest` (the request shape is
|
|
113
|
+
* malformed) and `AuthFailed` (the request was rejected).
|
|
114
|
+
*
|
|
115
|
+
* Reserved for request-data-dependent gaps where the provider supports
|
|
116
|
+
* the method in general but not for these inputs — e.g. Google's
|
|
117
|
+
* `streamSynthesisFrom` works only for Chirp 3 HD voices; calling it
|
|
118
|
+
* with a Neural2 voice ID fails `Unsupported`.
|
|
119
|
+
*
|
|
120
|
+
* Blanket provider-level gaps (e.g. OpenAI has no incremental-text-in
|
|
121
|
+
* TTS at all) are gated at compile time via capability marker tags
|
|
122
|
+
* (`TtsIncrementalText`, `SttStreaming`) on the R channel instead.
|
|
123
|
+
*/
|
|
124
|
+
declare class Unsupported extends Unsupported_base<{
|
|
125
|
+
provider: string;
|
|
126
|
+
capability: string;
|
|
127
|
+
reason?: string;
|
|
128
|
+
}> {}
|
|
129
|
+
type AiError = RateLimited | Unavailable | Timeout | ContentFiltered | ContextLengthExceeded | InvalidRequest | AuthFailed | Cancelled | IncompleteTurn | GenerationFailed | Unsupported;
|
|
108
130
|
//#endregion
|
|
109
|
-
export { Cancelled as a, GenerationFailed as c, RateLimited as d, Scope$1 as f, AuthSubtype as i, IncompleteTurn as l, Unavailable as m, AiError_d_exports as n, ContentFiltered as o, Timeout as p, AuthFailed as r, ContextLengthExceeded as s, AiError as t, InvalidRequest as u };
|
|
110
|
-
//# sourceMappingURL=AiError-
|
|
131
|
+
export { Cancelled as a, GenerationFailed as c, RateLimited as d, Scope$1 as f, Unsupported as h, AuthSubtype as i, IncompleteTurn as l, Unavailable as m, AiError_d_exports as n, ContentFiltered as o, Timeout as p, AuthFailed as r, ContextLengthExceeded as s, AiError as t, InvalidRequest as u };
|
|
132
|
+
//# sourceMappingURL=AiError-csR8Bhxx.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiError-
|
|
1
|
+
{"version":3,"file":"AiError-csR8Bhxx.d.mts","names":[],"sources":["../src/domain/AiError.ts"],"mappings":";;;;;;;;KAEY,OAAA;AAAA,cAAqC,gBAAA;;;cAEpC,WAAA,SAAoB,gBAAA;EAC/B,QAAA;EACA,UAAA,GAAa,QAAA,CAAS,QAAA;EACtB,KAAA,GAAQ,OAAA;EACR,SAAA;EACA,GAAA;AAAA;AAAA,cACG,gBAAA;;;cAEQ,WAAA,SAAoB,gBAAA;EAC/B,QAAA;EACA,UAAA,GAAa,QAAA,CAAS,QAAA;EACtB,MAAA;EACA,SAAA;EACA,GAAA;AAAA;AAAA,cACG,YAAA;;;cAEQ,OAAA,SAAgB,YAAA;EAC3B,QAAA;EACA,SAAA;EACA,GAAA;AAAA;AAAA,cACG,oBAAA;;;cAEQ,eAAA,SAAwB,oBAAA;EACnC,QAAA;EACA,MAAA;EACA,SAAA;EACA,GAAA;AAAA;AAAA,cACG,0BAAA;;;cAEQ,qBAAA,SAA8B,0BAAA;EACzC,QAAA;EACA,UAAA;EACA,SAAA;EACA,GAAA;AAAA;AAAA,cACG,mBAAA;;;cAEQ,cAAA,SAAuB,mBAAA;EAClC,QAAA;EACA,KAAA;EACA,SAAA;EACA,GAAA;AAAA;AAAA,KAGU,WAAA;AAAA,cAAyD,eAAA;;;cAExD,UAAA,SAAmB,eAAA;EAC9B,QAAA;EACA,OAAA,EAAS,WAAA;EACT,GAAA;AAAA;AAAA,cACG,cAAA;;;cAEQ,SAAA,SAAkB,cAAA;EAC7B,QAAA;AAAA;AAAA,cACG,qBAAA;;;;;;;;;cAQQ,gBAAA,SAAyB,qBAAA;EACpC,QAAA;EACA,IAAA;EACA,OAAA;EACA,SAAA;EACA,GAAA;AAAA;AAAA,cACG,mBAAA;;;;;;;;cAOQ,cAAA,SAAuB,mBAAA;EAClC,GAAA;AAAA;AAAA,cACG,gBAAA;;;;;;;;;;;;;AA9DA;;;;cA8EQ,WAAA,SAAoB,gBAAA;EAC/B,QAAA;EACA,UAAA;EACA,MAAA;AAAA;AAAA,KAGU,OAAA,GACR,WAAA,GACA,WAAA,GACA,OAAA,GACA,eAAA,GACA,qBAAA,GACA,cAAA,GACA,UAAA,GACA,SAAA,GACA,cAAA,GACA,gBAAA,GACA,WAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { i as MediaUrl, n as MediaBytes, t as MediaBase64 } from "./Media-D_CpcM1Z.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/domain/Audio.d.ts
|
|
4
|
+
declare namespace Audio_d_exports {
|
|
5
|
+
export { AudioBlob, AudioChunk, AudioFormat, AudioMimeType, AudioSource, isAudioBase64, isAudioBytes, isAudioUrl };
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* MIME types we care about across STT input and TTS output. Container-
|
|
9
|
+
* level only — sample rate / encoding flavours live on `AudioFormat`.
|
|
10
|
+
*
|
|
11
|
+
* Per-provider request types narrow this further. The `(string & {})`
|
|
12
|
+
* tail keeps autocomplete on the literals while still accepting any
|
|
13
|
+
* string, so unusual formats work without an SDK update.
|
|
14
|
+
*/
|
|
15
|
+
type AudioMimeType = "audio/mpeg" | "audio/wav" | "audio/x-wav" | "audio/ogg" | "audio/opus" | "audio/flac" | "audio/aac" | "audio/mp4" | "audio/webm" | "audio/L16" | "audio/pcm" | "audio/mulaw" | "audio/alaw" | (string & {});
|
|
16
|
+
/**
|
|
17
|
+
* Audio at rest — instantiates `MediaSource` with the audio MIME union.
|
|
18
|
+
* Used for sync STT input.
|
|
19
|
+
*
|
|
20
|
+
* URL variant is best-effort: some providers (OpenAI, Cartesia, Azure
|
|
21
|
+
* short-audio) reject URL ingestion and the adapter must upload via the
|
|
22
|
+
* `bytes` or `base64` variant instead. Adapter layers reject unsupported
|
|
23
|
+
* shapes up front with `AiError.InvalidRequest`.
|
|
24
|
+
*/
|
|
25
|
+
type AudioSource = MediaUrl<AudioMimeType> | MediaBase64<AudioMimeType> | MediaBytes<AudioMimeType>;
|
|
26
|
+
declare const isAudioUrl: (s: AudioSource) => s is MediaUrl<AudioMimeType>;
|
|
27
|
+
declare const isAudioBase64: (s: AudioSource) => s is MediaBase64<AudioMimeType>;
|
|
28
|
+
declare const isAudioBytes: (s: AudioSource) => s is MediaBytes<AudioMimeType>;
|
|
29
|
+
/**
|
|
30
|
+
* Structural audio format. Used both as TTS output spec and as STT
|
|
31
|
+
* streaming-input declaration. Providers that use compound slugs
|
|
32
|
+
* (`mp3_44100_128`, `audio-16khz-128kbitrate-mono-mp3`,
|
|
33
|
+
* `aura-2-thalia-en`) are encoded at the adapter layer.
|
|
34
|
+
*/
|
|
35
|
+
type AudioFormat = {
|
|
36
|
+
readonly container: "mp3" | "wav" | "ogg" | "opus" | "flac" | "aac" | "webm" | "raw";
|
|
37
|
+
readonly encoding: "pcm_s16le" | "pcm_f32le" | "pcm_mulaw" | "pcm_alaw" | "mp3" | "opus" | "vorbis" | "flac" | "aac";
|
|
38
|
+
readonly sampleRate: 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000; /** mp3 / opus only. */
|
|
39
|
+
readonly bitRate?: number;
|
|
40
|
+
readonly channels?: 1 | 2;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Streamed audio chunk. `bytes` carries the codec-encoded payload as
|
|
44
|
+
* declared on the stream's `AudioFormat`. No per-chunk timestamp here —
|
|
45
|
+
* providers that emit timing do so via `TranscriptEvent.words[]`.
|
|
46
|
+
*/
|
|
47
|
+
type AudioChunk = {
|
|
48
|
+
readonly bytes: Uint8Array;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Full audio result for sync TTS. Format mirrors the request; provider
|
|
52
|
+
* layers normalize.
|
|
53
|
+
*/
|
|
54
|
+
type AudioBlob = {
|
|
55
|
+
readonly format: AudioFormat;
|
|
56
|
+
readonly bytes: Uint8Array;
|
|
57
|
+
readonly durationSeconds?: number;
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { AudioSource as a, isAudioBytes as c, AudioMimeType as i, isAudioUrl as l, AudioChunk as n, Audio_d_exports as o, AudioFormat as r, isAudioBase64 as s, AudioBlob as t };
|
|
61
|
+
//# sourceMappingURL=Audio-BfCTGnH3.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Audio-BfCTGnH3.d.mts","names":[],"sources":["../src/domain/Audio.ts"],"mappings":";;;;;;;;;;;;;;KAUY,aAAA;;;;;AAAZ;;;;;KA0BY,WAAA,GACR,QAAA,CAAS,aAAA,IACT,WAAA,CAAY,aAAA,IACZ,UAAA,CAAW,aAAA;AAAA,cAEF,UAAA,GAAc,CAAA,EAAG,WAAA,KAAc,CAAA,IAAK,QAAA,CAAS,aAAA;AAAA,cAC7C,aAAA,GAAiB,CAAA,EAAG,WAAA,KAAc,CAAA,IAAK,WAAA,CAAY,aAAA;AAAA,cAEnD,YAAA,GAAgB,CAAA,EAAG,WAAA,KAAc,CAAA,IAAK,UAAA,CAAW,aAAA;;;;;;;KAQlD,WAAA;EAAA,SACD,SAAA;EAAA,SACA,QAAA;EAAA,SAUA,UAAA,wDA1BK;EAAA,SA4BL,OAAA;EAAA,SACA,QAAA;AAAA;;AA1BX;;;;KAkCY,UAAA;EAAA,SACD,KAAA,EAAO,UAAA;AAAA;;;;;KAON,SAAA;EAAA,SACD,MAAA,EAAQ,WAAA;EAAA,SACR,KAAA,EAAO,UAAA;EAAA,SACP,eAAA;AAAA"}
|
|
@@ -42,20 +42,20 @@ declare const imageUrl: (url: string, mimeType?: ImageMimeType) => ImageUrlSourc
|
|
|
42
42
|
declare const imageBase64: (base64: string, mimeType: ImageMimeType) => ImageBase64Source;
|
|
43
43
|
declare const imageBytes: (bytes: Uint8Array, mimeType: ImageMimeType) => ImageBytesSource;
|
|
44
44
|
declare const isImageUrl: <I>(input: I) => input is I & {
|
|
45
|
-
readonly _tag: "url";
|
|
46
45
|
readonly url: string;
|
|
46
|
+
readonly _tag: "url";
|
|
47
47
|
readonly mimeType?: ImageMimeType | undefined;
|
|
48
48
|
};
|
|
49
49
|
declare const isImageBase64: <I>(input: I) => input is I & {
|
|
50
|
-
readonly _tag: "base64";
|
|
51
50
|
readonly mimeType: ImageMimeType;
|
|
52
51
|
readonly base64: string;
|
|
52
|
+
readonly _tag: "base64";
|
|
53
53
|
};
|
|
54
54
|
declare const isImageBytes: <I>(input: I) => input is I & {
|
|
55
|
-
readonly _tag: "bytes";
|
|
56
55
|
readonly mimeType: ImageMimeType;
|
|
57
56
|
readonly bytes: Uint8Array<ArrayBufferLike>;
|
|
57
|
+
readonly _tag: "bytes";
|
|
58
58
|
};
|
|
59
59
|
//#endregion
|
|
60
60
|
export { ImageUrlSource as a, imageBytes as c, isImageBytes as d, isImageUrl as f, ImageSource as i, imageUrl as l, ImageBytesSource as n, Image_d_exports as o, ImageMimeType as r, imageBase64 as s, ImageBase64Source as t, isImageBase64 as u };
|
|
61
|
-
//# sourceMappingURL=Image-
|
|
61
|
+
//# sourceMappingURL=Image-DxyXqzAM.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image-
|
|
1
|
+
{"version":3,"file":"Image-DxyXqzAM.d.mts","names":[],"sources":["../src/domain/Image.ts"],"mappings":";;;;;;;;;;;;;;;KAWY,aAAA;AAAA,KAYA,cAAA,GAAiB,QAAA,CAAS,aAAA;AAAA,KAC1B,iBAAA,GAAoB,WAAA,CAAY,aAAA;AAAA,KAChC,gBAAA,GAAmB,UAAA,CAAW,aAAA;;;;;AAd1C;;;KAuBY,WAAA,GAAc,WAAA,CAAY,aAAA;AAAA,cAEzB,cAAA,EAAc,MAAA,CAAA,YAAA;EAAA;;;cAKd,iBAAA,EAAiB,MAAA,CAAA,YAAA;EAAA;;;cAKjB,gBAAA,EAAgB,MAAA,CAAA,YAAA;EAAA;;;cAKhB,WAAA,EAAa,MAAA,CAAO,MAAA,CAAO,WAAA;AAAA,cAM3B,QAAA,GAAY,GAAA,UAAa,QAAA,GAAW,aAAA,KAAgB,cAAA;AAAA,cAGpD,WAAA,GAAe,MAAA,UAAgB,QAAA,EAAU,aAAA,KAAgB,iBAAA;AAAA,cAMzD,UAAA,GAAc,KAAA,EAAO,UAAA,EAAY,QAAA,EAAU,aAAA,KAAgB,gBAAA;AAAA,cAM3D,UAAA,MAAU,KAAA,EAAA,CAAA,KAAA,KAAA,IAAA,CAAA;EAAA;;;;cACV,aAAA,MAAa,KAAA,EAAA,CAAA,KAAA,KAAA,IAAA,CAAA;EAAA;;;;cACb,YAAA,MAAY,KAAA,EAAA,CAAA,KAAA,KAAA,IAAA,CAAA;EAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ImageSource } from "./Image-
|
|
1
|
+
import { i as ImageSource } from "./Image-DxyXqzAM.mjs";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
|
|
4
4
|
//#region src/domain/Items.d.ts
|
|
@@ -74,8 +74,8 @@ declare const Annotation: Schema.Union<readonly [Schema.Struct<{
|
|
|
74
74
|
}>]>;
|
|
75
75
|
type Annotation = typeof Annotation.Type;
|
|
76
76
|
declare const isUrlCitation: <I>(input: I) => input is I & {
|
|
77
|
-
readonly type: "url_citation";
|
|
78
77
|
readonly url: string;
|
|
78
|
+
readonly type: "url_citation";
|
|
79
79
|
readonly start_index: number;
|
|
80
80
|
readonly end_index: number;
|
|
81
81
|
readonly title: string;
|
|
@@ -309,8 +309,8 @@ declare const isOutputText: <I>(input: I) => input is I & {
|
|
|
309
309
|
readonly type: "output_text";
|
|
310
310
|
readonly text: string;
|
|
311
311
|
readonly annotations?: readonly ({
|
|
312
|
-
readonly type: "url_citation";
|
|
313
312
|
readonly url: string;
|
|
313
|
+
readonly type: "url_citation";
|
|
314
314
|
readonly start_index: number;
|
|
315
315
|
readonly end_index: number;
|
|
316
316
|
readonly title: string;
|
|
@@ -346,8 +346,8 @@ declare const isMessage: <I>(input: I) => input is I & {
|
|
|
346
346
|
readonly type: "output_text";
|
|
347
347
|
readonly text: string;
|
|
348
348
|
readonly annotations?: readonly ({
|
|
349
|
-
readonly type: "url_citation";
|
|
350
349
|
readonly url: string;
|
|
350
|
+
readonly type: "url_citation";
|
|
351
351
|
readonly start_index: number;
|
|
352
352
|
readonly end_index: number;
|
|
353
353
|
readonly title: string;
|
|
@@ -421,4 +421,4 @@ declare const assistantText: (text: string) => Message;
|
|
|
421
421
|
declare const functionCallOutput: (call_id: string, output: string) => FunctionCallOutput;
|
|
422
422
|
//#endregion
|
|
423
423
|
export { isInputText as A, functionCallOutput as C, isFunctionCall as D, isFilePath as E, isUrlCitation as F, systemText as I, userText as L, isOutputText as M, isReasoning as N, isFunctionCallOutput as O, isRefusal as P, assistantText as S, isFileCitation as T, Refusal as _, FilePath as a, UrlCitation as b, InputImage as c, Item as d, Items_d_exports as f, Reasoning as g, OutputTokensDetails as h, FileCitation as i, isMessage as j, isInputImage as k, InputText as l, OutputText as m, ContainerFileCitation as n, FunctionCall as o, Message as p, ContentBlock as r, FunctionCallOutput as s, Annotation as t, InputTokensDetails as u, Role as v, isContainerFileCitation as w, Usage as x, StopReason as y };
|
|
424
|
-
//# sourceMappingURL=Items-
|
|
424
|
+
//# sourceMappingURL=Items-Hg5AsYxl.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Items-
|
|
1
|
+
{"version":3,"file":"Items-Hg5AsYxl.d.mts","names":[],"sources":["../src/domain/Items.ts"],"mappings":";;;;;;;cAOa,SAAA,EAAS,MAAA,CAAA,MAAA;EAAA;;;KAIV,SAAA,UAAmB,SAAA,CAAU,IAAA;;;;;;;;;cAU5B,UAAA,EAAU,MAAA,CAAA,MAAA;EAAA;;;KAIX,UAAA,UAAoB,UAAA,CAAW,IAAA;AAAA,cAQ9B,WAAA,EAAW,MAAA,CAAA,MAAA;EAAA;;;;;;KAOZ,WAAA,UAAqB,WAAA,CAAY,IAAA;AAAA,cAEhC,YAAA,EAAY,MAAA,CAAA,MAAA;EAAA;;;;KAKb,YAAA,UAAsB,YAAA,CAAa,IAAA;AAAA,cAElC,qBAAA,EAAqB,MAAA,CAAA,MAAA;EAAA;;;;;;KAOtB,qBAAA,UAA+B,qBAAA,CAAsB,IAAA;AAAA,cAEpD,QAAA,EAAQ,MAAA,CAAA,MAAA;EAAA;;;;KAKT,QAAA,UAAkB,QAAA,CAAS,IAAA;AAAA,cAE1B,UAAA,EAAU,MAAA,CAAA,KAAA,WAAA,MAAA,CAAA,MAAA;EAAA;;;;;;;;;;;;;;;;;;;;KACX,UAAA,UAAoB,UAAA,CAAW,IAAA;AAAA,cAE9B,aAAA,MAAa,KAAA,EAAA,CAAA,KAA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@@ -85,4 +85,4 @@ declare const parseJson: <A>(format: StructuredFormat<A>) => (raw: string) => Ef
|
|
|
85
85
|
declare const decodeJsonLines: <A>(format: StructuredFormat<A>) => <E, R>(self: Stream.Stream<string, E, R>) => Stream.Stream<A, E | JsonParseError | StructuredDecodeError, R>;
|
|
86
86
|
//#endregion
|
|
87
87
|
export { StructuredFormat_d_exports as a, decodeJsonLines as c, StructuredFormat as i, fromEffectSchema as l, JsonParseError as n, StructuredSchema as o, StructuredDecodeError as r, decode as s, DecodeIssue as t, parseJson as u };
|
|
88
|
-
//# sourceMappingURL=StructuredFormat-
|
|
88
|
+
//# sourceMappingURL=StructuredFormat-Cl41C56K.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructuredFormat-
|
|
1
|
+
{"version":3,"file":"StructuredFormat-Cl41C56K.d.mts","names":[],"sources":["../src/structured-format/StructuredFormat.ts"],"mappings":";;;;;;;;;;;;;;;KAaY,gBAAA,qBAAqC,gBAAA,UAA0B,MAAA,IACzE,oBAAA,UAA8B,MAAA;;;;;;KAOpB,gBAAA;EAAA,SACD,IAAA;EAAA,SACA,WAAA;EAAA,SACA,MAAA,EAAQ,gBAAA,CAAiB,CAAA;EAXxB;;;;EAAA,SAgBD,MAAA;AAAA;;KAIC,WAAA;EAAA,SACD,IAAA,EAAM,aAAA;EAAA,SACN,OAAA;AAAA;AAAA,cACV,0BAAA;;;;;AAfD;;cAyBa,qBAAA,SAA8B,0BAAA;EAAA,SAChC,GAAA;EAAA,SACA,MAAA,EAAQ,aAAA,CAAc,WAAA;AAAA;AAAA,cAC5B,mBAAA;;;;;;AAhBL;cAsBa,cAAA,SAAuB,mBAAA;EAAA,SACzB,GAAA;EAAA,SACA,KAAA;AAAA;;;;AArBV;;cAiCY,gBAAA,aAA8B,MAAA,CAAO,KAAA,wBAChD,MAAA,EAAQ,CAAA,EACR,OAAA;EAAA,SACW,IAAA;EAAA,SACA,WAAA;EAAA,SACA,MAAA;AAAA,MAEV,gBAAA,CAAiB,CAAA;;;;;;cAyCP,MAAA,MACP,MAAA,EAAQ,gBAAA,CAAiB,CAAA,OAC5B,GAAA,cAAe,MAAA,CAAO,MAAA,CAAO,CAAA,EAAG,qBAAA;;;;;;cAoBtB,SAAA,MACP,MAAA,EAAQ,gBAAA,CAAiB,CAAA,OAC5B,GAAA,aAAc,MAAA,CAAO,MAAA,CAAO,CAAA,EAAG,cAAA,GAAiB,qBAAA;;;;;cAatC,eAAA,MACP,MAAA,EAAQ,gBAAA,CAAiB,CAAA,aAE3B,IAAA,EAAM,MAAA,CAAO,MAAA,SAAe,CAAA,EAAG,CAAA,MAC9B,MAAA,CAAO,MAAA,CAAO,CAAA,EAAG,CAAA,GAAI,cAAA,GAAiB,qBAAA,EAAuB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as FunctionCall, s as FunctionCallOutput } from "./Items-
|
|
1
|
+
import { o as FunctionCall, s as FunctionCallOutput } from "./Items-Hg5AsYxl.mjs";
|
|
2
2
|
import { Effect, Schema, Stream } from "effect";
|
|
3
3
|
import * as _$effect_Cause0 from "effect/Cause";
|
|
4
4
|
import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
@@ -83,4 +83,4 @@ declare const toDescriptors: <R>(tools: ReadonlyArray<AnyKindTool<R>>) => Readon
|
|
|
83
83
|
declare const execute: <Name extends string, Input, Output, R>(tool: Tool<Name, Input, Output, R>, call: FunctionCall) => Effect.Effect<FunctionCallOutput, ToolError, R>;
|
|
84
84
|
//#endregion
|
|
85
85
|
export { Tool as a, ToolInputSchema as c, fromEffectSchema as d, isStreamingTool as f, toDescriptors as h, StreamingTool as i, Tool_d_exports as l, streaming as m, AnyPlainTool as n, ToolDescriptor as o, make as p, AnyStreamingTool as r, ToolError as s, AnyKindTool as t, execute as u };
|
|
86
|
-
//# sourceMappingURL=Tool-
|
|
86
|
+
//# sourceMappingURL=Tool-B8B5qVEy.d.mts.map
|
|
@@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A,EAAM,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,CAAA,gBACpD,aAAA,CAAc,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,CAAA;AAAA,KAEjC,gBAAA,YAA4B,aAAA,wBAAqC,CAAA;AAAA,KACjE,YAAA,YAAwB,IAAA,mBAAuB,CAAA;AAAA,KAC/C,WAAA,YAAuB,gBAAA,CAAiB,CAAA,IAAK,YAAA,CAAa,CAAA;AAAA,cAEzD,eAAA,MAAsB,CAAA,EAAG,WAAA,CAAY,CAAA,MAAK,CAAA,IAAK,gBAAA,CAAiB,CAAA;;;;;;cAQhE,aAAA,MACX,KAAA,EAAO,aAAA,CAAc,WAAA,CAAY,CAAA,OAChC,aAAA,CAAc,cAAA;;;;;;cAkBJ,OAAA,0CACX,IAAA,EAAM,IAAA,CAAK,IAAA,EAAM,KAAA,EAAO,MAAA,EAAQ,CAAA,GAChC,IAAA,EAAM,YAAA,KACL,MAAA,CAAO,MAAA,CAAO,kBAAA,EAAoB,SAAA,EAAW,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as ImageSource } from "./Image-
|
|
2
|
-
import { d as Item, g as Reasoning, o as FunctionCall, p as Message, s as FunctionCallOutput, x as Usage } from "./Items-
|
|
3
|
-
import { i as StructuredFormat, n as JsonParseError, r as StructuredDecodeError } from "./StructuredFormat-
|
|
1
|
+
import { i as ImageSource } from "./Image-DxyXqzAM.mjs";
|
|
2
|
+
import { d as Item, g as Reasoning, o as FunctionCall, p as Message, s as FunctionCallOutput, x as Usage } from "./Items-Hg5AsYxl.mjs";
|
|
3
|
+
import { i as StructuredFormat, n as JsonParseError, r as StructuredDecodeError } from "./StructuredFormat-Cl41C56K.mjs";
|
|
4
4
|
import { Effect, Schema, Stream } from "effect";
|
|
5
5
|
import * as _$effect_Types0 from "effect/Types";
|
|
6
6
|
import * as _$effect_Cause0 from "effect/Cause";
|
|
@@ -191,4 +191,4 @@ declare class RefusalRejected extends RefusalRejected_base<{
|
|
|
191
191
|
declare const toStructured: <A>(turn: Turn, format: StructuredFormat<A>) => Effect.Effect<A, RefusalRejected | JsonParseError | StructuredDecodeError>;
|
|
192
192
|
//#endregion
|
|
193
193
|
export { Turn_d_exports as a, functionCalls as c, textDeltas as d, toStructured as f, TurnEvent as i, isTurnComplete as l, RefusalRejected as n, appendTurn as o, Turn as r, assistantMessages as s, InteractionEvent as t, reasonings as u };
|
|
194
|
-
//# sourceMappingURL=Turn-
|
|
194
|
+
//# sourceMappingURL=Turn-7geUcKsf.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Turn-
|
|
1
|
+
{"version":3,"file":"Turn-7geUcKsf.d.mts","names":[],"sources":["../src/domain/Turn.ts"],"mappings":";;;;;;;;;;;;;;;;cAmBa,IAAA,EAAI,MAAA,CAAA,MAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKL,IAAA,UAAc,IAAA,CAAK,IAAA;;;;;;;KAQnB,SAAA;EAAA,SACG,IAAA;EAAA,SAA6B,IAAA;AAAA;EAAA,SAE7B,IAAA;EAAA,SACA,IAAA;;;;;;;;WAQA,IAAA;AAAA;;;;;;;;;WASA,IAAA;EAAA,SAAgC,IAAA;AAAA;EAAA,SAChC,IAAA;EAAA,SAAkC,OAAA;EAAA,SAA0B,IAAA;AAAA;EAAA,SAC5D,IAAA;EAAA,SAAuC,OAAA;EAAA,SAA0B,KAAA;AAAA;;;;;;;;;;WASjE,IAAA;EAAA,SAA+B,KAAA,EAAO,KAAA;AAAA;EAAA,SACtC,IAAA;EAAA,SAAgC,IAAA,EAAM,IAAA;AAAA;;;;;;;KAQzC,gBAAA,GAAmB,SAAA,GAAY,kBAAA;AAAA,cAE9B,cAAA,GAAkB,CAAA,EAAG,SAAA,KAAY,CAAA,IAAK,OAAA,CAAQ,SAAA;EAAa,IAAA;AAAA;AAAA,cAG3D,aAAA,GAAiB,IAAA,EAAM,IAAA,KAAO,aAAA,CAAc,YAAA;AAAA,cAG5C,UAAA,GAAc,IAAA,EAAM,IAAA,KAAO,aAAA,CAAc,SAAA;AAAA,cAGzC,iBAAA,GAAqB,IAAA,EAAM,IAAA,KAAO,aAAA,CAAc,OAAA;;;;;;cAQhD,UAAA;EAAA,SAAmC,OAAA,EAAS,aAAA,CAAc,IAAA;AAAA,GACrE,KAAA,EAAO,CAAA,EACP,IAAA,EAAM,IAAA,EACN,KAAA,GAAO,aAAA,CAAc,IAAA,MACpB,CAAA;;;;;;cAcU,UAAA,SACX,IAAA,EAAM,MAAA,CAAO,MAAA,CAAO,SAAA,EAAW,CAAA,EAAG,CAAA,MACjC,MAAA,CAAO,MAAA,SAAe,CAAA,EAAG,CAAA;AAAA,cAKzB,oBAAA;;;;;;;;cAWU,eAAA,SAAwB,oBAAA;EAAA,SAC1B,IAAA,EAAM,IAAA;AAAA;;;;;;;;;;;cAyBJ,YAAA,MACX,IAAA,EAAM,IAAA,EACN,MAAA,EAAQ,gBAAA,CAAkC,CAAA,MACzC,MAAA,CAAO,MAAA,CACR,CAAA,EACA,eAAA,GAAkB,cAAA,GAAkC,qBAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Cancelled, c as GenerationFailed, d as RateLimited, f as Scope, i as AuthSubtype, l as IncompleteTurn, m as Unavailable, o as ContentFiltered, p as Timeout, r as AuthFailed, s as ContextLengthExceeded, t as AiError, u as InvalidRequest } from "../AiError-
|
|
2
|
-
export { AiError, AuthFailed, AuthSubtype, Cancelled, ContentFiltered, ContextLengthExceeded, GenerationFailed, IncompleteTurn, InvalidRequest, RateLimited, Scope, Timeout, Unavailable };
|
|
1
|
+
import { a as Cancelled, c as GenerationFailed, d as RateLimited, f as Scope, h as Unsupported, i as AuthSubtype, l as IncompleteTurn, m as Unavailable, o as ContentFiltered, p as Timeout, r as AuthFailed, s as ContextLengthExceeded, t as AiError, u as InvalidRequest } from "../AiError-csR8Bhxx.mjs";
|
|
2
|
+
export { AiError, AuthFailed, AuthSubtype, Cancelled, ContentFiltered, ContextLengthExceeded, GenerationFailed, IncompleteTurn, InvalidRequest, RateLimited, Scope, Timeout, Unavailable, Unsupported };
|
package/dist/domain/AiError.mjs
CHANGED
|
@@ -11,7 +11,8 @@ var AiError_exports = /* @__PURE__ */ __exportAll({
|
|
|
11
11
|
InvalidRequest: () => InvalidRequest,
|
|
12
12
|
RateLimited: () => RateLimited,
|
|
13
13
|
Timeout: () => Timeout,
|
|
14
|
-
Unavailable: () => Unavailable
|
|
14
|
+
Unavailable: () => Unavailable,
|
|
15
|
+
Unsupported: () => Unsupported
|
|
15
16
|
});
|
|
16
17
|
var RateLimited = class extends Data.TaggedError("RateLimited") {};
|
|
17
18
|
var Unavailable = class extends Data.TaggedError("Unavailable") {};
|
|
@@ -34,7 +35,22 @@ var GenerationFailed = class extends Data.TaggedError("GenerationFailed") {};
|
|
|
34
35
|
* Non-terminal deltas seen so far have already been emitted downstream.
|
|
35
36
|
*/
|
|
36
37
|
var IncompleteTurn = class extends Data.TaggedError("IncompleteTurn") {};
|
|
38
|
+
/**
|
|
39
|
+
* The provider does not implement the requested capability for this
|
|
40
|
+
* specific request. Distinct from `InvalidRequest` (the request shape is
|
|
41
|
+
* malformed) and `AuthFailed` (the request was rejected).
|
|
42
|
+
*
|
|
43
|
+
* Reserved for request-data-dependent gaps where the provider supports
|
|
44
|
+
* the method in general but not for these inputs — e.g. Google's
|
|
45
|
+
* `streamSynthesisFrom` works only for Chirp 3 HD voices; calling it
|
|
46
|
+
* with a Neural2 voice ID fails `Unsupported`.
|
|
47
|
+
*
|
|
48
|
+
* Blanket provider-level gaps (e.g. OpenAI has no incremental-text-in
|
|
49
|
+
* TTS at all) are gated at compile time via capability marker tags
|
|
50
|
+
* (`TtsIncrementalText`, `SttStreaming`) on the R channel instead.
|
|
51
|
+
*/
|
|
52
|
+
var Unsupported = class extends Data.TaggedError("Unsupported") {};
|
|
37
53
|
//#endregion
|
|
38
|
-
export { AuthFailed, Cancelled, ContentFiltered, ContextLengthExceeded, GenerationFailed, IncompleteTurn, InvalidRequest, RateLimited, Timeout, Unavailable, AiError_exports as t };
|
|
54
|
+
export { AuthFailed, Cancelled, ContentFiltered, ContextLengthExceeded, GenerationFailed, IncompleteTurn, InvalidRequest, RateLimited, Timeout, Unavailable, Unsupported, AiError_exports as t };
|
|
39
55
|
|
|
40
56
|
//# sourceMappingURL=AiError.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiError.mjs","names":[],"sources":["../../src/domain/AiError.ts"],"sourcesContent":["import { Data, Duration } from \"effect\"\n\nexport type Scope = \"rpm\" | \"tpm\" | \"rpd\" | \"tpd\"\n\nexport class RateLimited extends Data.TaggedError(\"RateLimited\")<{\n provider: string\n retryAfter?: Duration.Duration\n scope?: Scope\n requestId?: string\n raw: unknown\n}> {}\n\nexport class Unavailable extends Data.TaggedError(\"Unavailable\")<{\n provider: string\n retryAfter?: Duration.Duration\n status?: number\n requestId?: string\n raw: unknown\n}> {}\n\nexport class Timeout extends Data.TaggedError(\"Timeout\")<{\n provider: string\n requestId?: string\n raw: unknown\n}> {}\n\nexport class ContentFiltered extends Data.TaggedError(\"ContentFiltered\")<{\n provider: string\n reason?: string\n requestId?: string\n raw: unknown\n}> {}\n\nexport class ContextLengthExceeded extends Data.TaggedError(\"ContextLengthExceeded\")<{\n provider: string\n modelLimit?: number\n requested?: number\n raw: unknown\n}> {}\n\nexport class InvalidRequest extends Data.TaggedError(\"InvalidRequest\")<{\n provider: string\n param?: string\n requestId?: string\n raw: unknown\n}> {}\n\nexport type AuthSubtype = \"auth\" | \"permission\" | \"billing\" | \"quota\"\n\nexport class AuthFailed extends Data.TaggedError(\"AuthFailed\")<{\n provider: string\n subtype: AuthSubtype\n raw: unknown\n}> {}\n\nexport class Cancelled extends Data.TaggedError(\"Cancelled\")<{\n provider: string\n}> {}\n\n/**\n * The model errored mid-generation. Distinct from `Unavailable` (transport\n * problem before generation started) and from `IncompleteTurn` (provider\n * stream ended without a terminal event). The provider's own error message,\n * if any, is on `message`.\n */\nexport class GenerationFailed extends Data.TaggedError(\"GenerationFailed\")<{\n provider: string\n code?: string\n message?: string\n requestId?: string\n raw: unknown\n}> {}\n\n/**\n * The provider's delta stream ended without a terminal `turn_complete`.\n * Indicates a misbehaving provider or a connection that dropped mid-flight.\n * Non-terminal deltas seen so far have already been emitted downstream.\n */\nexport class IncompleteTurn extends Data.TaggedError(\"IncompleteTurn\")<{\n raw?: unknown\n}> {}\n\nexport type AiError =\n | RateLimited\n | Unavailable\n | Timeout\n | ContentFiltered\n | ContextLengthExceeded\n | InvalidRequest\n | AuthFailed\n | Cancelled\n | IncompleteTurn\n | GenerationFailed\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AiError.mjs","names":[],"sources":["../../src/domain/AiError.ts"],"sourcesContent":["import { Data, Duration } from \"effect\"\n\nexport type Scope = \"rpm\" | \"tpm\" | \"rpd\" | \"tpd\"\n\nexport class RateLimited extends Data.TaggedError(\"RateLimited\")<{\n provider: string\n retryAfter?: Duration.Duration\n scope?: Scope\n requestId?: string\n raw: unknown\n}> {}\n\nexport class Unavailable extends Data.TaggedError(\"Unavailable\")<{\n provider: string\n retryAfter?: Duration.Duration\n status?: number\n requestId?: string\n raw: unknown\n}> {}\n\nexport class Timeout extends Data.TaggedError(\"Timeout\")<{\n provider: string\n requestId?: string\n raw: unknown\n}> {}\n\nexport class ContentFiltered extends Data.TaggedError(\"ContentFiltered\")<{\n provider: string\n reason?: string\n requestId?: string\n raw: unknown\n}> {}\n\nexport class ContextLengthExceeded extends Data.TaggedError(\"ContextLengthExceeded\")<{\n provider: string\n modelLimit?: number\n requested?: number\n raw: unknown\n}> {}\n\nexport class InvalidRequest extends Data.TaggedError(\"InvalidRequest\")<{\n provider: string\n param?: string\n requestId?: string\n raw: unknown\n}> {}\n\nexport type AuthSubtype = \"auth\" | \"permission\" | \"billing\" | \"quota\"\n\nexport class AuthFailed extends Data.TaggedError(\"AuthFailed\")<{\n provider: string\n subtype: AuthSubtype\n raw: unknown\n}> {}\n\nexport class Cancelled extends Data.TaggedError(\"Cancelled\")<{\n provider: string\n}> {}\n\n/**\n * The model errored mid-generation. Distinct from `Unavailable` (transport\n * problem before generation started) and from `IncompleteTurn` (provider\n * stream ended without a terminal event). The provider's own error message,\n * if any, is on `message`.\n */\nexport class GenerationFailed extends Data.TaggedError(\"GenerationFailed\")<{\n provider: string\n code?: string\n message?: string\n requestId?: string\n raw: unknown\n}> {}\n\n/**\n * The provider's delta stream ended without a terminal `turn_complete`.\n * Indicates a misbehaving provider or a connection that dropped mid-flight.\n * Non-terminal deltas seen so far have already been emitted downstream.\n */\nexport class IncompleteTurn extends Data.TaggedError(\"IncompleteTurn\")<{\n raw?: unknown\n}> {}\n\n/**\n * The provider does not implement the requested capability for this\n * specific request. Distinct from `InvalidRequest` (the request shape is\n * malformed) and `AuthFailed` (the request was rejected).\n *\n * Reserved for request-data-dependent gaps where the provider supports\n * the method in general but not for these inputs — e.g. Google's\n * `streamSynthesisFrom` works only for Chirp 3 HD voices; calling it\n * with a Neural2 voice ID fails `Unsupported`.\n *\n * Blanket provider-level gaps (e.g. OpenAI has no incremental-text-in\n * TTS at all) are gated at compile time via capability marker tags\n * (`TtsIncrementalText`, `SttStreaming`) on the R channel instead.\n */\nexport class Unsupported extends Data.TaggedError(\"Unsupported\")<{\n provider: string\n capability: string\n reason?: string\n}> {}\n\nexport type AiError =\n | RateLimited\n | Unavailable\n | Timeout\n | ContentFiltered\n | ContextLengthExceeded\n | InvalidRequest\n | AuthFailed\n | Cancelled\n | IncompleteTurn\n | GenerationFailed\n | Unsupported\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAa,cAAb,cAAiC,KAAK,YAAY,cAAc,CAM7D;AAEH,IAAa,cAAb,cAAiC,KAAK,YAAY,cAAc,CAM7D;AAEH,IAAa,UAAb,cAA6B,KAAK,YAAY,UAAU,CAIrD;AAEH,IAAa,kBAAb,cAAqC,KAAK,YAAY,kBAAkB,CAKrE;AAEH,IAAa,wBAAb,cAA2C,KAAK,YAAY,wBAAwB,CAKjF;AAEH,IAAa,iBAAb,cAAoC,KAAK,YAAY,iBAAiB,CAKnE;AAIH,IAAa,aAAb,cAAgC,KAAK,YAAY,aAAa,CAI3D;AAEH,IAAa,YAAb,cAA+B,KAAK,YAAY,YAAY,CAEzD;;;;;;;AAQH,IAAa,mBAAb,cAAsC,KAAK,YAAY,mBAAmB,CAMvE;;;;;;AAOH,IAAa,iBAAb,cAAoC,KAAK,YAAY,iBAAiB,CAEnE;;;;;;;;;;;;;;;AAgBH,IAAa,cAAb,cAAiC,KAAK,YAAY,cAAc,CAI7D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as AudioSource, c as isAudioBytes, i as AudioMimeType, l as isAudioUrl, n as AudioChunk, r as AudioFormat, s as isAudioBase64, t as AudioBlob } from "../Audio-BfCTGnH3.mjs";
|
|
2
|
+
export { AudioBlob, AudioChunk, AudioFormat, AudioMimeType, AudioSource, isAudioBase64, isAudioBytes, isAudioUrl };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
//#region src/domain/Audio.ts
|
|
3
|
+
var Audio_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
isAudioBase64: () => isAudioBase64,
|
|
5
|
+
isAudioBytes: () => isAudioBytes,
|
|
6
|
+
isAudioUrl: () => isAudioUrl
|
|
7
|
+
});
|
|
8
|
+
const isAudioUrl = (s) => s._tag === "url";
|
|
9
|
+
const isAudioBase64 = (s) => s._tag === "base64";
|
|
10
|
+
const isAudioBytes = (s) => s._tag === "bytes";
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isAudioBase64, isAudioBytes, isAudioUrl, Audio_exports as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=Audio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Audio.mjs","names":[],"sources":["../../src/domain/Audio.ts"],"sourcesContent":["import type { MediaBase64, MediaBytes, MediaUrl } from \"./Media.js\"\n\n/**\n * MIME types we care about across STT input and TTS output. Container-\n * level only — sample rate / encoding flavours live on `AudioFormat`.\n *\n * Per-provider request types narrow this further. The `(string & {})`\n * tail keeps autocomplete on the literals while still accepting any\n * string, so unusual formats work without an SDK update.\n */\nexport type AudioMimeType =\n | \"audio/mpeg\"\n | \"audio/wav\"\n | \"audio/x-wav\"\n | \"audio/ogg\"\n | \"audio/opus\"\n | \"audio/flac\"\n | \"audio/aac\"\n | \"audio/mp4\"\n | \"audio/webm\"\n | \"audio/L16\"\n | \"audio/pcm\"\n | \"audio/mulaw\"\n | \"audio/alaw\"\n // eslint-disable-next-line @typescript-eslint/ban-types\n | (string & {})\n\n/**\n * Audio at rest — instantiates `MediaSource` with the audio MIME union.\n * Used for sync STT input.\n *\n * URL variant is best-effort: some providers (OpenAI, Cartesia, Azure\n * short-audio) reject URL ingestion and the adapter must upload via the\n * `bytes` or `base64` variant instead. Adapter layers reject unsupported\n * shapes up front with `AiError.InvalidRequest`.\n */\nexport type AudioSource =\n | MediaUrl<AudioMimeType>\n | MediaBase64<AudioMimeType>\n | MediaBytes<AudioMimeType>\n\nexport const isAudioUrl = (s: AudioSource): s is MediaUrl<AudioMimeType> => s._tag === \"url\"\nexport const isAudioBase64 = (s: AudioSource): s is MediaBase64<AudioMimeType> =>\n s._tag === \"base64\"\nexport const isAudioBytes = (s: AudioSource): s is MediaBytes<AudioMimeType> => s._tag === \"bytes\"\n\n/**\n * Structural audio format. Used both as TTS output spec and as STT\n * streaming-input declaration. Providers that use compound slugs\n * (`mp3_44100_128`, `audio-16khz-128kbitrate-mono-mp3`,\n * `aura-2-thalia-en`) are encoded at the adapter layer.\n */\nexport type AudioFormat = {\n readonly container: \"mp3\" | \"wav\" | \"ogg\" | \"opus\" | \"flac\" | \"aac\" | \"webm\" | \"raw\"\n readonly encoding:\n | \"pcm_s16le\"\n | \"pcm_f32le\"\n | \"pcm_mulaw\"\n | \"pcm_alaw\"\n | \"mp3\"\n | \"opus\"\n | \"vorbis\"\n | \"flac\"\n | \"aac\"\n readonly sampleRate: 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000\n /** mp3 / opus only. */\n readonly bitRate?: number\n readonly channels?: 1 | 2\n}\n\n/**\n * Streamed audio chunk. `bytes` carries the codec-encoded payload as\n * declared on the stream's `AudioFormat`. No per-chunk timestamp here —\n * providers that emit timing do so via `TranscriptEvent.words[]`.\n */\nexport type AudioChunk = {\n readonly bytes: Uint8Array\n}\n\n/**\n * Full audio result for sync TTS. Format mirrors the request; provider\n * layers normalize.\n */\nexport type AudioBlob = {\n readonly format: AudioFormat\n readonly bytes: Uint8Array\n readonly durationSeconds?: number\n}\n"],"mappings":";;;;;;;AAyCA,MAAa,cAAc,MAAiD,EAAE,SAAS;AACvF,MAAa,iBAAiB,MAC5B,EAAE,SAAS;AACb,MAAa,gBAAgB,MAAmD,EAAE,SAAS"}
|
package/dist/domain/Image.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ImageUrlSource, c as imageBytes, d as isImageBytes, f as isImageUrl, i as ImageSource, l as imageUrl, n as ImageBytesSource, r as ImageMimeType, s as imageBase64, t as ImageBase64Source, u as isImageBase64 } from "../Image-
|
|
1
|
+
import { a as ImageUrlSource, c as imageBytes, d as isImageBytes, f as isImageUrl, i as ImageSource, l as imageUrl, n as ImageBytesSource, r as ImageMimeType, s as imageBase64, t as ImageBase64Source, u as isImageBase64 } from "../Image-DxyXqzAM.mjs";
|
|
2
2
|
export { ImageBase64Source, ImageBytesSource, ImageMimeType, ImageSource, ImageUrlSource, imageBase64, imageBytes, imageUrl, isImageBase64, isImageBytes, isImageUrl };
|
package/dist/domain/Items.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as isInputText, C as functionCallOutput, D as isFunctionCall, E as isFilePath, F as isUrlCitation, I as systemText, L as userText, M as isOutputText, N as isReasoning, O as isFunctionCallOutput, P as isRefusal, S as assistantText, T as isFileCitation, _ as Refusal, a as FilePath, b as UrlCitation, c as InputImage, d as Item, g as Reasoning, h as OutputTokensDetails, i as FileCitation, j as isMessage, k as isInputImage, l as InputText, m as OutputText, n as ContainerFileCitation, o as FunctionCall, p as Message, r as ContentBlock, s as FunctionCallOutput, t as Annotation, u as InputTokensDetails, v as Role, w as isContainerFileCitation, x as Usage, y as StopReason } from "../Items-
|
|
1
|
+
import { A as isInputText, C as functionCallOutput, D as isFunctionCall, E as isFilePath, F as isUrlCitation, I as systemText, L as userText, M as isOutputText, N as isReasoning, O as isFunctionCallOutput, P as isRefusal, S as assistantText, T as isFileCitation, _ as Refusal, a as FilePath, b as UrlCitation, c as InputImage, d as Item, g as Reasoning, h as OutputTokensDetails, i as FileCitation, j as isMessage, k as isInputImage, l as InputText, m as OutputText, n as ContainerFileCitation, o as FunctionCall, p as Message, r as ContentBlock, s as FunctionCallOutput, t as Annotation, u as InputTokensDetails, v as Role, w as isContainerFileCitation, x as Usage, y as StopReason } from "../Items-Hg5AsYxl.mjs";
|
|
2
2
|
export { Annotation, ContainerFileCitation, ContentBlock, FileCitation, FilePath, FunctionCall, FunctionCallOutput, InputImage, InputText, InputTokensDetails, Item, Message, OutputText, OutputTokensDetails, Reasoning, Refusal, Role, StopReason, UrlCitation, Usage, assistantText, functionCallOutput, isContainerFileCitation, isFileCitation, isFilePath, isFunctionCall, isFunctionCallOutput, isInputImage, isInputText, isMessage, isOutputText, isReasoning, isRefusal, isUrlCitation, systemText, userText };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { r as AudioFormat, t as AudioBlob } from "../Audio-BfCTGnH3.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/domain/Music.d.ts
|
|
4
|
+
declare namespace Music_d_exports {
|
|
5
|
+
export { CommonGenerateMusicRequest, CommonStreamGenerateMusicRequest, MusicResult, MusicSessionInput, WeightedPrompt, configInput, controlInput, isConfigInput, isControlInput, isPromptsInput, promptsInput };
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Prompt fragment with a relative weight. Native to Lyria RealTime
|
|
9
|
+
* (`{ text, weight }` pairs blended in the model). Single-prompt
|
|
10
|
+
* providers (Suno, Mureka, MiniMax) flatten to text at the adapter
|
|
11
|
+
* layer.
|
|
12
|
+
*/
|
|
13
|
+
type WeightedPrompt = {
|
|
14
|
+
readonly text: string; /** Default `1.0`. Range typically `[0, 1]`; provider-dependent. */
|
|
15
|
+
readonly weight?: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Cross-provider music-generation request. Provider-specific extras
|
|
19
|
+
* (Lyria `mode`, ElevenLabs `composition_plan`, Suno custom-mode `title`,
|
|
20
|
+
* MiniMax `lyrics_optimizer`) live on each provider's typed request
|
|
21
|
+
* which extends this and narrows `model`.
|
|
22
|
+
*/
|
|
23
|
+
type CommonGenerateMusicRequest = {
|
|
24
|
+
/** Model identifier. Each provider narrows. */readonly model: string; /** Single prompt string or weighted-prompt list (blended where supported). */
|
|
25
|
+
readonly prompts: string | ReadonlyArray<WeightedPrompt>;
|
|
26
|
+
/**
|
|
27
|
+
* Lyrics text, optionally with section tags like `[Verse]` / `[Chorus]` /
|
|
28
|
+
* `[Bridge]` / `[Outro]`. Ignored for instrumental-only providers or
|
|
29
|
+
* when `instrumental: true`.
|
|
30
|
+
*/
|
|
31
|
+
readonly lyrics?: string; /** Target duration in seconds. Provider may treat as a hint or hard limit. */
|
|
32
|
+
readonly durationSeconds?: number; /** Beats per minute (60–200 typical). */
|
|
33
|
+
readonly bpm?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Musical key/mode hint. Provider-specific vocabulary (e.g. Lyria
|
|
36
|
+
* RealTime uses enum values like `"C_MAJOR"`, `"A_MINOR"`).
|
|
37
|
+
*/
|
|
38
|
+
readonly scale?: string; /** Skip vocals / lyrics. */
|
|
39
|
+
readonly instrumental?: boolean; /** Preferred output format. Provider may override. */
|
|
40
|
+
readonly outputFormat?: AudioFormat;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Streamed-output request. Same shape as the sync request — the
|
|
44
|
+
* streaming variant only differs in how the response is delivered.
|
|
45
|
+
*/
|
|
46
|
+
type CommonStreamGenerateMusicRequest = CommonGenerateMusicRequest;
|
|
47
|
+
/**
|
|
48
|
+
* Bidirectional-session input. The user pushes one of these per
|
|
49
|
+
* change: a new prompt blend, a config delta, or a playback control.
|
|
50
|
+
* Lyria RealTime is the only provider currently surfacing these.
|
|
51
|
+
*/
|
|
52
|
+
type MusicSessionInput = {
|
|
53
|
+
readonly _tag: "prompts";
|
|
54
|
+
readonly prompts: ReadonlyArray<WeightedPrompt>;
|
|
55
|
+
} | {
|
|
56
|
+
readonly _tag: "config";
|
|
57
|
+
readonly config: {
|
|
58
|
+
readonly bpm?: number;
|
|
59
|
+
readonly scale?: string;
|
|
60
|
+
readonly density?: number;
|
|
61
|
+
readonly brightness?: number;
|
|
62
|
+
readonly guidance?: number;
|
|
63
|
+
readonly temperature?: number;
|
|
64
|
+
readonly topK?: number;
|
|
65
|
+
readonly seed?: number;
|
|
66
|
+
readonly muteBass?: boolean;
|
|
67
|
+
readonly muteDrums?: boolean;
|
|
68
|
+
readonly onlyBassAndDrums?: boolean;
|
|
69
|
+
};
|
|
70
|
+
} | {
|
|
71
|
+
readonly _tag: "control";
|
|
72
|
+
readonly action: "play" | "pause" | "stop" | "reset_context";
|
|
73
|
+
};
|
|
74
|
+
declare const promptsInput: (prompts: ReadonlyArray<WeightedPrompt>) => MusicSessionInput;
|
|
75
|
+
declare const configInput: (config: (MusicSessionInput & {
|
|
76
|
+
_tag: "config";
|
|
77
|
+
})["config"]) => MusicSessionInput;
|
|
78
|
+
declare const controlInput: (action: (MusicSessionInput & {
|
|
79
|
+
_tag: "control";
|
|
80
|
+
})["action"]) => MusicSessionInput;
|
|
81
|
+
/**
|
|
82
|
+
* Sync-generation result. Extends `AudioBlob` with provider-side
|
|
83
|
+
* metadata that's common across music providers:
|
|
84
|
+
*
|
|
85
|
+
* - `songId` — Suno task id, ElevenLabs `song_id`, etc. Used for
|
|
86
|
+
* back-reference (re-download, stem export, follow-up edits).
|
|
87
|
+
* - `lyrics` — generated lyrics when the model returned them (Lyria
|
|
88
|
+
* text part, Mureka, Suno).
|
|
89
|
+
* - `sections` — structured section markers (Lyria optional JSON
|
|
90
|
+
* structure response).
|
|
91
|
+
* - `watermark` — presence marker (Lyria SynthID is always set).
|
|
92
|
+
*/
|
|
93
|
+
type MusicResult = AudioBlob & {
|
|
94
|
+
readonly songId?: string;
|
|
95
|
+
readonly lyrics?: string;
|
|
96
|
+
readonly sections?: ReadonlyArray<{
|
|
97
|
+
readonly label: string;
|
|
98
|
+
readonly startSeconds: number;
|
|
99
|
+
readonly endSeconds: number;
|
|
100
|
+
}>;
|
|
101
|
+
readonly watermark?: {
|
|
102
|
+
readonly kind: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
declare const isPromptsInput: (i: MusicSessionInput) => i is MusicSessionInput & {
|
|
106
|
+
_tag: "prompts";
|
|
107
|
+
};
|
|
108
|
+
declare const isConfigInput: (i: MusicSessionInput) => i is MusicSessionInput & {
|
|
109
|
+
_tag: "config";
|
|
110
|
+
};
|
|
111
|
+
declare const isControlInput: (i: MusicSessionInput) => i is MusicSessionInput & {
|
|
112
|
+
_tag: "control";
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
export { CommonGenerateMusicRequest, CommonStreamGenerateMusicRequest, MusicResult, MusicSessionInput, WeightedPrompt, configInput, controlInput, isConfigInput, isControlInput, isPromptsInput, promptsInput, Music_d_exports as t };
|
|
116
|
+
//# sourceMappingURL=Music.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Music.d.mts","names":[],"sources":["../../src/domain/Music.ts"],"mappings":";;;;;;;;;;;;KAQY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sB,IAAA;AAAA;AAAA,cACjB,aAAA,GAAiB,CAAA,EAAG,iBAAA,KAAoB,CAAA,IAAK,iBAAA;EAAsB,IAAA;AAAA;AAAA,cAEnE,cAAA,GACX,CAAA,EAAG,iBAAA,KACF,CAAA,IAAK,iBAAA;EAAsB,IAAA;AAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { n as __exportAll } from "../chunk-uyGKjUfl.mjs";
|
|
2
|
+
//#region src/domain/Music.ts
|
|
3
|
+
var Music_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
configInput: () => configInput,
|
|
5
|
+
controlInput: () => controlInput,
|
|
6
|
+
isConfigInput: () => isConfigInput,
|
|
7
|
+
isControlInput: () => isControlInput,
|
|
8
|
+
isPromptsInput: () => isPromptsInput,
|
|
9
|
+
promptsInput: () => promptsInput
|
|
10
|
+
});
|
|
11
|
+
const promptsInput = (prompts) => ({
|
|
12
|
+
_tag: "prompts",
|
|
13
|
+
prompts
|
|
14
|
+
});
|
|
15
|
+
const configInput = (config) => ({
|
|
16
|
+
_tag: "config",
|
|
17
|
+
config
|
|
18
|
+
});
|
|
19
|
+
const controlInput = (action) => ({
|
|
20
|
+
_tag: "control",
|
|
21
|
+
action
|
|
22
|
+
});
|
|
23
|
+
const isPromptsInput = (i) => i._tag === "prompts";
|
|
24
|
+
const isConfigInput = (i) => i._tag === "config";
|
|
25
|
+
const isControlInput = (i) => i._tag === "control";
|
|
26
|
+
//#endregion
|
|
27
|
+
export { configInput, controlInput, isConfigInput, isControlInput, isPromptsInput, promptsInput, Music_exports as t };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=Music.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Music.mjs","names":[],"sources":["../../src/domain/Music.ts"],"sourcesContent":["import type { AudioBlob, AudioFormat } from \"./Audio.js\"\n\n/**\n * Prompt fragment with a relative weight. Native to Lyria RealTime\n * (`{ text, weight }` pairs blended in the model). Single-prompt\n * providers (Suno, Mureka, MiniMax) flatten to text at the adapter\n * layer.\n */\nexport type WeightedPrompt = {\n readonly text: string\n /** Default `1.0`. Range typically `[0, 1]`; provider-dependent. */\n readonly weight?: number\n}\n\n/**\n * Cross-provider music-generation request. Provider-specific extras\n * (Lyria `mode`, ElevenLabs `composition_plan`, Suno custom-mode `title`,\n * MiniMax `lyrics_optimizer`) live on each provider's typed request\n * which extends this and narrows `model`.\n */\nexport type CommonGenerateMusicRequest = {\n /** Model identifier. Each provider narrows. */\n readonly model: string\n /** Single prompt string or weighted-prompt list (blended where supported). */\n readonly prompts: string | ReadonlyArray<WeightedPrompt>\n /**\n * Lyrics text, optionally with section tags like `[Verse]` / `[Chorus]` /\n * `[Bridge]` / `[Outro]`. Ignored for instrumental-only providers or\n * when `instrumental: true`.\n */\n readonly lyrics?: string\n /** Target duration in seconds. Provider may treat as a hint or hard limit. */\n readonly durationSeconds?: number\n /** Beats per minute (60–200 typical). */\n readonly bpm?: number\n /**\n * Musical key/mode hint. Provider-specific vocabulary (e.g. Lyria\n * RealTime uses enum values like `\"C_MAJOR\"`, `\"A_MINOR\"`).\n */\n readonly scale?: string\n /** Skip vocals / lyrics. */\n readonly instrumental?: boolean\n /** Preferred output format. Provider may override. */\n readonly outputFormat?: AudioFormat\n}\n\n/**\n * Streamed-output request. Same shape as the sync request — the\n * streaming variant only differs in how the response is delivered.\n */\nexport type CommonStreamGenerateMusicRequest = CommonGenerateMusicRequest\n\n/**\n * Bidirectional-session input. The user pushes one of these per\n * change: a new prompt blend, a config delta, or a playback control.\n * Lyria RealTime is the only provider currently surfacing these.\n */\nexport type MusicSessionInput =\n | { readonly _tag: \"prompts\"; readonly prompts: ReadonlyArray<WeightedPrompt> }\n | {\n readonly _tag: \"config\"\n readonly config: {\n readonly bpm?: number\n readonly scale?: string\n readonly density?: number\n readonly brightness?: number\n readonly guidance?: number\n readonly temperature?: number\n readonly topK?: number\n readonly seed?: number\n readonly muteBass?: boolean\n readonly muteDrums?: boolean\n readonly onlyBassAndDrums?: boolean\n }\n }\n | { readonly _tag: \"control\"; readonly action: \"play\" | \"pause\" | \"stop\" | \"reset_context\" }\n\nexport const promptsInput = (prompts: ReadonlyArray<WeightedPrompt>): MusicSessionInput => ({\n _tag: \"prompts\",\n prompts,\n})\n\nexport const configInput = (\n config: (MusicSessionInput & { _tag: \"config\" })[\"config\"],\n): MusicSessionInput => ({ _tag: \"config\", config })\n\nexport const controlInput = (\n action: (MusicSessionInput & { _tag: \"control\" })[\"action\"],\n): MusicSessionInput => ({ _tag: \"control\", action })\n\n/**\n * Sync-generation result. Extends `AudioBlob` with provider-side\n * metadata that's common across music providers:\n *\n * - `songId` — Suno task id, ElevenLabs `song_id`, etc. Used for\n * back-reference (re-download, stem export, follow-up edits).\n * - `lyrics` — generated lyrics when the model returned them (Lyria\n * text part, Mureka, Suno).\n * - `sections` — structured section markers (Lyria optional JSON\n * structure response).\n * - `watermark` — presence marker (Lyria SynthID is always set).\n */\nexport type MusicResult = AudioBlob & {\n readonly songId?: string\n readonly lyrics?: string\n readonly sections?: ReadonlyArray<{\n readonly label: string\n readonly startSeconds: number\n readonly endSeconds: number\n }>\n readonly watermark?: { readonly kind: string }\n}\n\nexport const isPromptsInput = (\n i: MusicSessionInput,\n): i is MusicSessionInput & { _tag: \"prompts\" } => i._tag === \"prompts\"\nexport const isConfigInput = (i: MusicSessionInput): i is MusicSessionInput & { _tag: \"config\" } =>\n i._tag === \"config\"\nexport const isControlInput = (\n i: MusicSessionInput,\n): i is MusicSessionInput & { _tag: \"control\" } => i._tag === \"control\"\n"],"mappings":";;;;;;;;;;AA6EA,MAAa,gBAAgB,aAA+D;CAC1F,MAAM;CACN;CACD;AAED,MAAa,eACX,YACuB;CAAE,MAAM;CAAU;CAAQ;AAEnD,MAAa,gBACX,YACuB;CAAE,MAAM;CAAW;CAAQ;AAyBpD,MAAa,kBACX,MACiD,EAAE,SAAS;AAC9D,MAAa,iBAAiB,MAC5B,EAAE,SAAS;AACb,MAAa,kBACX,MACiD,EAAE,SAAS"}
|