@fugood/buttress-server 2.25.1-beta.0 → 2.25.1-beta.2

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.
@@ -5,6 +5,7 @@
5
5
  * POST /functions/:name run one; add ?stream=1 for SSE progress.
6
6
  * multipart bodies stage file fields inline and
7
7
  * inject their server paths into the input
8
+ * GET /functions/:name run one with the query string as its input
8
9
  * POST /functions/mcp MCP (Streamable HTTP, stateless)
9
10
  * GET /functions/files/* download a file a function wrote (context.fileUrl)
10
11
  * POST /functions/upload stage an input file for a function call
@@ -32,6 +32,21 @@ export type GeneratorCacheOptions = {
32
32
  /** Post-start preparation (typically `initContext`). */
33
33
  prepare: (backend: any, entry: GeneratorCacheEntry) => Promise<void>;
34
34
  };
35
+ type ConfiguredGeneratorResolverOptions = {
36
+ family: string;
37
+ types: readonly string[];
38
+ };
39
+ /**
40
+ * Model identity shared by local generators whose repository can contain
41
+ * several weight files.
42
+ */
43
+ export declare const configuredGeneratorModelId: (generatorConfig: any) => string;
44
+ /**
45
+ * Build a resolver for generator families that must use an explicitly
46
+ * configured model. STT and TTS intentionally reject unknown models instead
47
+ * of silently loading different weights or voices.
48
+ */
49
+ export declare const createConfiguredGeneratorResolver: ({ family, types }: ConfiguredGeneratorResolverOptions) => (config: any, requestedModel?: string) => ResolvedGeneratorRequest;
35
50
  export declare const createGeneratorCache: ({ max, resolve, prepare }: GeneratorCacheOptions) => {
36
51
  getOrCreate: (backend: any, config: any, requestedModel: string | undefined, logPrefix: string) => Promise<GeneratorCacheEntry>;
37
52
  release: (backend: any, entry: GeneratorCacheEntry | null | undefined, logPrefix: string) => Promise<void>;
@@ -40,3 +55,4 @@ export declare const createGeneratorCache: ({ max, resolve, prepare }: Generator
40
55
  export declare function cancelReaderBestEffort(reader: {
41
56
  cancel: () => Promise<unknown>;
42
57
  }): void;
58
+ export {};
@@ -11,8 +11,6 @@ import type { GeneratorCacheEntry } from './generator-cache';
11
11
  export declare const STT_TYPES: string[];
12
12
  /** Get the STT backend API for a generator type. */
13
13
  export declare function getSttBackend(backend: any, type: string): any;
14
- /** Model identity for an STT generator config: `repo_id` plus `filename`. */
15
- export declare function sttModelId(generatorConfig: any): string;
16
14
  export declare function getOrCreateSttGenerator(backend: any, config: any, requestedModel?: string, logPrefix?: string): Promise<GeneratorCacheEntry>;
17
15
  export declare function releaseSttGenerator(backend: any, entry: GeneratorCacheEntry | null | undefined, logPrefix?: string): Promise<void>;
18
16
  /**
@@ -10,8 +10,6 @@ import type { GeneratorCacheEntry } from './generator-cache';
10
10
  export declare const TTS_TYPES: string[];
11
11
  /** Get the TTS backend API for a generator type (only onnx-tts today). */
12
12
  export declare function getTtsBackend(backend: any, _type: string): any;
13
- /** Model identity for a TTS generator config: `repo_id` plus `filename`. */
14
- export declare function ttsModelId(generatorConfig: any): string;
15
13
  export declare function getOrCreateTtsGenerator(backend: any, config: any, requestedModel?: string, logPrefix?: string): Promise<GeneratorCacheEntry>;
16
14
  export declare function releaseTtsGenerator(backend: any, entry: GeneratorCacheEntry | null | undefined, logPrefix?: string): Promise<void>;
17
15
  export type SynthesizeRequest = {
@@ -1,5 +1,17 @@
1
- import { schemas, type Service } from './create-llm-service';
2
- export { schemas };
3
- export type { Service };
1
+ import { z } from 'zod';
2
+ import { type Service as LlmService } from './create-llm-service';
3
+ import type { ServiceContext } from '../types';
4
+ export declare const schemas: {
5
+ initContext: z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodAny>], null>;
6
+ completion: z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodAny>], null>;
7
+ tokenize: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
8
+ detokenize: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
9
+ applyChatTemplate: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
10
+ releaseContext: z.ZodTuple<[z.ZodString], null>;
11
+ embedding: z.ZodTuple<[z.ZodString, z.ZodAny], null>;
12
+ };
13
+ export interface Service extends LlmService {
14
+ embedding: (ctx: ServiceContext, ...args: z.infer<typeof schemas.embedding>) => Promise<any>;
15
+ }
4
16
  declare const _default: Service;
5
17
  export default _default;
@@ -19,7 +19,7 @@ declare const services: {
19
19
  }, id: any, audioData: any, options: any): Promise<any>;
20
20
  releaseContext: ({ backend, session }: ServiceContext, id: any, force: any) => Promise<any>;
21
21
  };
22
- mlxLlm: GgmlLlmService;
22
+ mlxLlm: MlxLlmService;
23
23
  onnxStt: OnnxSttService;
24
24
  onnxTts: OnnxTtsService;
25
25
  };
@@ -0,0 +1,38 @@
1
+ export declare const isWindows: boolean;
2
+ export type InstallMethod = 'binary' | 'npm' | 'bun' | 'pnpm' | 'yarn' | 'unknown';
3
+ export interface DetectedInstall {
4
+ method: InstallMethod;
5
+ execPath?: string;
6
+ installDir?: string;
7
+ installRoot?: string;
8
+ scriptPath?: string;
9
+ }
10
+ export declare const compareVersions: (current: string, latest: string) => boolean;
11
+ export declare const detectChannel: ({ version }?: {
12
+ version?: string;
13
+ }) => "beta" | "release";
14
+ export declare const detectInstallMethod: ({ execPath, scriptPath, homeDir, realpath, }?: {
15
+ execPath?: string;
16
+ scriptPath?: string;
17
+ homeDir?: string;
18
+ realpath?: (p?: string) => string | undefined;
19
+ }) => DetectedInstall;
20
+ export declare const fetchVersionInfo: (channel: string) => Promise<{
21
+ version: string;
22
+ }>;
23
+ export declare const fetchNpmVersionInfo: (channel: string) => Promise<{
24
+ version: string;
25
+ }>;
26
+ export declare const fetchLatestVersionInfo: (channel: string, method: InstallMethod) => Promise<{
27
+ version: string;
28
+ }>;
29
+ export declare const updateNpm: (channel: string) => void;
30
+ export declare const updateBun: (channel: string) => void;
31
+ export interface BinaryUpdateOptions {
32
+ installDir?: string;
33
+ ggmlVariant?: string;
34
+ }
35
+ export declare const updateBinary: (channel: string, { installDir, ggmlVariant }?: BinaryUpdateOptions) => Promise<void>;
36
+ export declare const runUpdateForMethod: (method: InstallMethod, channel: string, detected?: DetectedInstall, options?: {
37
+ ggmlVariant?: string;
38
+ }) => Promise<void>;
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@fugood/buttress-server",
3
- "version": "2.25.1-beta.0",
3
+ "version": "2.25.1-beta.2",
4
4
  "main": "lib/index.mjs",
5
5
  "types": "lib/index.d.ts",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "bricks-buttress": "./bin/bricks-buttress"
9
9
  },
10
+ "s3url": {
11
+ "release": "https://cdn.bricks.tools/bricks-buttress/release",
12
+ "beta": "https://cdn.bricks.tools/bricks-buttress/beta"
13
+ },
10
14
  "files": [
11
15
  "lib",
12
16
  "bin",
@@ -16,6 +20,11 @@
16
20
  "scripts": {
17
21
  "typecheck": "tsc --noEmit",
18
22
  "build": "tsdown -c rolldown.config.js --config-loader native && tsc --noCheck --emitDeclarationOnly",
23
+ "build:dist": "$npm_execpath scripts/build-distribution.js",
24
+ "release": "$npm_execpath scripts/build-distribution.js",
25
+ "release-beta": "$npm_execpath scripts/build-distribution.js --beta",
26
+ "upload-release": "node scripts/upload-release.js",
27
+ "upload-beta": "node scripts/upload-release.js --beta",
19
28
  "prepublish": "bun run build",
20
29
  "dev": "bun src/index.ts",
21
30
  "start": "bun lib/index.mjs",
@@ -30,7 +39,7 @@
30
39
  "dependencies": {
31
40
  "@elysiajs/cors": "^1.1.1",
32
41
  "@elysiajs/node": "^1.4.2",
33
- "@fugood/llama.node": "1.7.11",
42
+ "@fugood/llama.node": "1.7.14",
34
43
  "@fugood/whisper.node": "^1.1.1",
35
44
  "@huggingface/gguf": "^0.3.2",
36
45
  "@iarna/toml": "^3.0.0",
@@ -51,6 +60,8 @@
51
60
  "oxc-transform": "^0.105.0",
52
61
  "qs": "^6.15.0",
53
62
  "sharp": "^0.34.1",
63
+ "sqlite-vec": "0.1.9",
64
+ "sqlite3": "5.1.7",
54
65
  "voca": "^1.4.1",
55
66
  "zod": "^3.25.76"
56
67
  },
@@ -58,5 +69,5 @@
58
69
  "tsdown": "^0.22.4",
59
70
  "typescript": "^7.0.2"
60
71
  },
61
- "gitHead": "95e3bdbcf4d433d89c5ef7ddc67f046458bfc240"
72
+ "gitHead": "681321c58a5484c661e9feae0b2c3cf2cbea5c16"
62
73
  }