@cerebriline/core 4.100.270 → 4.100.272
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/assets/prompt-templates/claude.md +3 -0
- package/assets/prompt-templates/deepseek.md +3 -0
- package/assets/prompt-templates/default.md +13 -0
- package/assets/prompt-templates/gemma.md +3 -0
- package/assets/prompt-templates/glm.md +3 -0
- package/assets/prompt-templates/kimi-k3.md +3 -0
- package/assets/prompt-templates/kimi.md +3 -0
- package/assets/prompt-templates/minimax-m3.1-flash.md +3 -0
- package/assets/prompt-templates/minimax.md +3 -0
- package/assets/prompt-templates/nemotron.md +3 -0
- package/assets/prompt-templates/qwen.md +3 -0
- package/assets/skills/media-audio/SKILL.md +22 -7
- package/dist/cloud/index.js +1 -1
- package/dist/extensions/tools/audio-tools.d.ts +55 -8
- package/dist/extensions/tools/image-edit.d.ts +1 -1
- package/dist/extensions/tools/image-generation.d.ts +1 -1
- package/dist/extensions/tools/media-endpoint.d.ts +32 -7
- package/dist/extensions/tools/media-tools.d.ts +10 -4
- package/dist/hub/daemon/entry.js +495 -495
- package/dist/hub/index.js +465 -465
- package/dist/index.d.ts +1 -1
- package/dist/index.js +749 -729
- package/dist/remote/remote-helper-entry.js +1 -1
- package/dist/remote/remote-helper.js +1 -1
- package/dist/services/retrieval/embedding-client.d.ts +4 -1
- package/package.json +4 -4
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Three kinds of server answer these routes, and they say different amounts:
|
|
10
10
|
* - **opencoti** names what is loaded in `features` on `/props`
|
|
11
11
|
* (`images_generate_v1`, `images_edit_v1`, `audio_transcriptions_v1`,
|
|
12
|
-
* `audio_speech_v1`, `videos_generate_v1`), and its `/v1/models` rows carry
|
|
12
|
+
* `audio_speech_v1`, `videos_generate_v1`, `audio_generations_v1`), and its `/v1/models` rows carry
|
|
13
13
|
* `capabilities`. One process can serve the LLM and every media kind.
|
|
14
14
|
* - **xOllama** answers `/api/xollama`, and its `/v1/models` rows carry
|
|
15
15
|
* `input_modalities` / `output_modalities` for models with media.
|
|
@@ -28,8 +28,12 @@
|
|
|
28
28
|
* start stays out for the whole session. The tab's own switch is how a user
|
|
29
29
|
* says they do not want the tool. What the probe found is a warning, not a
|
|
30
30
|
* gate.
|
|
31
|
+
*
|
|
32
|
+
* A base URL is a server's address, but the settings say `POST <endpoint>/
|
|
33
|
+
* audio/speech`, so the whole route gets pasted. Nothing is lost by taking it
|
|
34
|
+
* back off: a route under a route is never what anyone meant.
|
|
31
35
|
*/
|
|
32
|
-
export type MediaKind = "image_generation" | "image_edit" | "transcription" | "speech" | "video";
|
|
36
|
+
export type MediaKind = "image_generation" | "image_edit" | "transcription" | "speech" | "video" | "sound_effects";
|
|
33
37
|
export declare const MEDIA_KINDS: readonly MediaKind[];
|
|
34
38
|
export type MediaServer = "opencoti" | "xollama" | "openai";
|
|
35
39
|
export interface MediaEndpoint {
|
|
@@ -56,7 +60,16 @@ export interface MediaEndpointProbe {
|
|
|
56
60
|
*/
|
|
57
61
|
kinds: Partial<Record<MediaKind, boolean>>;
|
|
58
62
|
models: MediaModel[];
|
|
63
|
+
/**
|
|
64
|
+
* Set when something replied at this address and none of it read as a
|
|
65
|
+
* server of ours or a model list: the status its `/models` gave. Such a
|
|
66
|
+
* probe has `server: "openai"` and no models. A server that lists nothing
|
|
67
|
+
* can still take a request, so this is not a dead endpoint.
|
|
68
|
+
*/
|
|
69
|
+
unrecognizedStatus?: number;
|
|
59
70
|
}
|
|
71
|
+
/** A base URL without its trailing slashes or a pasted route. */
|
|
72
|
+
export declare function withoutPastedRoute(baseUrl: string): string;
|
|
60
73
|
/** `.../v1`, whether or not the user typed it. */
|
|
61
74
|
export declare function normalizeBaseUrl(baseUrl: string): string;
|
|
62
75
|
/** The server's root, under which `/props` and `/api/xollama` live. */
|
|
@@ -66,7 +79,8 @@ export declare function mediaServerOrigin(baseUrl: string): string;
|
|
|
66
79
|
*
|
|
67
80
|
* Capabilities are exact and win. Modalities are xOllama's listing and need
|
|
68
81
|
* reading: an edit model takes an image and returns one, a transcription model
|
|
69
|
-
* takes audio and returns text.
|
|
82
|
+
* takes audio and returns text. Sound effects are never read from them: speech
|
|
83
|
+
* returns audio too, and only the capability tells the two apart.
|
|
70
84
|
*/
|
|
71
85
|
export declare function mediaKindsOfModelRow(row: unknown): MediaKind[] | undefined;
|
|
72
86
|
export interface MediaProbeOptions {
|
|
@@ -111,8 +125,11 @@ export interface ResolveMediaEndpointInput {
|
|
|
111
125
|
export type ResolvedMediaEndpoint = {
|
|
112
126
|
endpoint: MediaEndpoint;
|
|
113
127
|
source: "provider" | "typed";
|
|
114
|
-
/**
|
|
115
|
-
|
|
128
|
+
/**
|
|
129
|
+
* `unknown` is a typed endpoint that did not answer the probe,
|
|
130
|
+
* `unrecognized` one that answered and said nothing of use.
|
|
131
|
+
*/
|
|
132
|
+
server: MediaServer | "unknown" | "unrecognized";
|
|
116
133
|
/** Why a call may fail right now. The tool is offered all the same. */
|
|
117
134
|
warning?: string;
|
|
118
135
|
} | {
|
|
@@ -121,13 +138,21 @@ export type ResolvedMediaEndpoint = {
|
|
|
121
138
|
export declare function resolveMediaEndpoint(input: ResolveMediaEndpointInput): Promise<ResolvedMediaEndpoint>;
|
|
122
139
|
/** `Retry-After` in milliseconds: seconds or a date, bounded, 5 s by default. */
|
|
123
140
|
export declare function retryAfterMs(header: string | null, now?: number): number;
|
|
141
|
+
/**
|
|
142
|
+
* How long xOllama may hold a request before it starts or answers `503`: its
|
|
143
|
+
* `mediaQueueWait`. The wait happens inside one attempt, so a tool's limit is
|
|
144
|
+
* this plus the time the work itself may take. Without it a queued request is
|
|
145
|
+
* abandoned, and reported as stopped, before the server has answered at all.
|
|
146
|
+
*/
|
|
147
|
+
export declare const MEDIA_QUEUE_WAIT_MS: number;
|
|
124
148
|
export interface MediaRequestOptions {
|
|
125
149
|
fetchImpl?: typeof fetch;
|
|
126
150
|
/** The caller's cancellation. The only thing that ends the waiting. */
|
|
127
151
|
signal?: AbortSignal;
|
|
128
152
|
/**
|
|
129
|
-
* Milliseconds one attempt may take. Waiting on a busy
|
|
130
|
-
*
|
|
153
|
+
* Milliseconds one attempt may take. Waiting between attempts on a busy
|
|
154
|
+
* engine is not counted, but a server's own queue is: see
|
|
155
|
+
* `MEDIA_QUEUE_WAIT_MS`.
|
|
131
156
|
*/
|
|
132
157
|
attemptTimeoutMs?: number;
|
|
133
158
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The media tools as one set, built from one configuration.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `synthesize_speech`, `generate_video` -- share one rule for where a request
|
|
4
|
+
* Six tools -- `generate_image`, `edit_image`, `transcribe_audio`,
|
|
5
|
+
* `synthesize_speech`, `generate_sound_effect`, `generate_video` -- share one rule for where a request
|
|
6
6
|
* goes (see `media-endpoint.ts`), and two hosts offer them: the extension from
|
|
7
7
|
* its settings tabs and the CLI from a file. If each host wrote its own
|
|
8
8
|
* "which tools, pointed where", the two would drift the first time one of them
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* soon as it names somewhere to go, whether or not that server answers now.
|
|
15
15
|
*/
|
|
16
16
|
import type { AgentTool } from "@cerebriline/shared";
|
|
17
|
-
import { type SpeechEndpoint, type TranscriptionEndpoint } from "./audio-tools";
|
|
17
|
+
import { type SoundEffectEndpoint, type SpeechEndpoint, type TranscriptionEndpoint } from "./audio-tools";
|
|
18
18
|
import { type ImageGenerationEndpoint } from "./image-generation";
|
|
19
19
|
import { type MediaEndpointProbe, type MediaSessionProvider, type ResolvedMediaEndpoint } from "./media-endpoint";
|
|
20
20
|
import type { RenderDriver } from "./render-image";
|
|
@@ -49,6 +49,10 @@ export interface MediaToolsConfig {
|
|
|
49
49
|
voice?: string;
|
|
50
50
|
format?: string;
|
|
51
51
|
};
|
|
52
|
+
/** `generate_sound_effect`. */
|
|
53
|
+
soundEffects?: MediaSectionSettings & {
|
|
54
|
+
format?: string;
|
|
55
|
+
};
|
|
52
56
|
/** `generate_video`. */
|
|
53
57
|
video?: MediaSectionSettings & {
|
|
54
58
|
size?: string;
|
|
@@ -56,13 +60,14 @@ export interface MediaToolsConfig {
|
|
|
56
60
|
format?: string;
|
|
57
61
|
};
|
|
58
62
|
}
|
|
59
|
-
export declare const MEDIA_TOOL_NAMES: readonly ["generate_image", "edit_image", "transcribe_audio", "synthesize_speech", "generate_video"];
|
|
63
|
+
export declare const MEDIA_TOOL_NAMES: readonly ["generate_image", "edit_image", "transcribe_audio", "synthesize_speech", "generate_sound_effect", "generate_video"];
|
|
60
64
|
export type MediaToolName = (typeof MEDIA_TOOL_NAMES)[number];
|
|
61
65
|
interface MediaToolEndpoints {
|
|
62
66
|
generate_image: ImageGenerationEndpoint;
|
|
63
67
|
edit_image: ImageGenerationEndpoint;
|
|
64
68
|
transcribe_audio: TranscriptionEndpoint;
|
|
65
69
|
synthesize_speech: SpeechEndpoint;
|
|
70
|
+
generate_sound_effect: SoundEffectEndpoint;
|
|
66
71
|
generate_video: VideoGenerationEndpoint;
|
|
67
72
|
}
|
|
68
73
|
export type ResolvedMediaTool<T extends MediaToolName = MediaToolName> = (Omit<Exclude<ResolvedMediaEndpoint, {
|
|
@@ -131,6 +136,7 @@ export declare function createMediaTools(options: CreateMediaToolsOptions): Prom
|
|
|
131
136
|
* "image": { "model": "flux2-klein", "size": "1024x1024" },
|
|
132
137
|
* "transcription": true,
|
|
133
138
|
* "speech": { "voice": "alloy" },
|
|
139
|
+
* "soundEffects": { "model": "mannix/stable-audio:3-small-sfx-q8_0" },
|
|
134
140
|
* "video": { "baseUrl": "http://other:8090", "model": "wan2.1" }
|
|
135
141
|
* }
|
|
136
142
|
* ```
|