@workglow/cactus 0.3.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.
- package/README.md +16 -0
- package/dist/ai/CactusProvider.d.ts +23 -0
- package/dist/ai/CactusProvider.d.ts.map +1 -0
- package/dist/ai/CactusQueuedProvider.d.ts +23 -0
- package/dist/ai/CactusQueuedProvider.d.ts.map +1 -0
- package/dist/ai/common/Cactus_Capabilities.d.ts +19 -0
- package/dist/ai/common/Cactus_Capabilities.d.ts.map +1 -0
- package/dist/ai/common/Cactus_CapabilitySets.d.ts +12 -0
- package/dist/ai/common/Cactus_CapabilitySets.d.ts.map +1 -0
- package/dist/ai/common/Cactus_Constants.d.ts +14 -0
- package/dist/ai/common/Cactus_Constants.d.ts.map +1 -0
- package/dist/ai/common/Cactus_Download.d.ts +9 -0
- package/dist/ai/common/Cactus_Download.d.ts.map +1 -0
- package/dist/ai/common/Cactus_DownloadRemove.d.ts +9 -0
- package/dist/ai/common/Cactus_DownloadRemove.d.ts.map +1 -0
- package/dist/ai/common/Cactus_JobRunFns.d.ts +12 -0
- package/dist/ai/common/Cactus_JobRunFns.d.ts.map +1 -0
- package/dist/ai/common/Cactus_ModelCatalog.d.ts +23 -0
- package/dist/ai/common/Cactus_ModelCatalog.d.ts.map +1 -0
- package/dist/ai/common/Cactus_ModelInfo.d.ts +9 -0
- package/dist/ai/common/Cactus_ModelInfo.d.ts.map +1 -0
- package/dist/ai/common/Cactus_ModelSchema.d.ts +140 -0
- package/dist/ai/common/Cactus_ModelSchema.d.ts.map +1 -0
- package/dist/ai/common/Cactus_ModelSearch.d.ts +8 -0
- package/dist/ai/common/Cactus_ModelSearch.d.ts.map +1 -0
- package/dist/ai/common/Cactus_Runtime.browser.d.ts +30 -0
- package/dist/ai/common/Cactus_Runtime.browser.d.ts.map +1 -0
- package/dist/ai/common/Cactus_Runtime.d.ts +30 -0
- package/dist/ai/common/Cactus_Runtime.d.ts.map +1 -0
- package/dist/ai/common/Cactus_ToolCalling.d.ts +9 -0
- package/dist/ai/common/Cactus_ToolCalling.d.ts.map +1 -0
- package/dist/ai/index.d.ts +45 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/registerCactus.d.ts +10 -0
- package/dist/ai/registerCactus.d.ts.map +1 -0
- package/dist/ai/registerCactusInline.d.ts +8 -0
- package/dist/ai/registerCactusInline.d.ts.map +1 -0
- package/dist/ai/registerCactusWorker.d.ts +7 -0
- package/dist/ai/registerCactusWorker.d.ts.map +1 -0
- package/dist/ai/runtime.browser.d.ts +9 -0
- package/dist/ai/runtime.browser.d.ts.map +1 -0
- package/dist/ai/runtime.d.ts +9 -0
- package/dist/ai/runtime.d.ts.map +1 -0
- package/dist/ai-runtime.browser.d.ts +7 -0
- package/dist/ai-runtime.browser.d.ts.map +1 -0
- package/dist/ai-runtime.browser.js +603 -0
- package/dist/ai-runtime.browser.js.map +25 -0
- package/dist/ai-runtime.d.ts +7 -0
- package/dist/ai-runtime.d.ts.map +1 -0
- package/dist/ai-runtime.js +480 -0
- package/dist/ai-runtime.js.map +24 -0
- package/dist/ai.d.ts +7 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +524 -0
- package/dist/ai.js.map +25 -0
- package/package.json +80 -0
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @workglow/cactus
|
|
2
|
+
|
|
3
|
+
[needle-rs](https://github.com/Geekgineer/needle-rs) tool-calling provider for [@workglow/ai](https://www.npmjs.com/package/@workglow/ai).
|
|
4
|
+
|
|
5
|
+
Wraps the 258 KB needle-rs WASM runtime and the 22 MB INT4 SafeTensors **Needle 26M** model from [`Abdalrahman/needle-rs-safetensors`](https://huggingface.co/Abdalrahman/needle-rs-safetensors). Runs in browser (Cache Storage) and Node/Bun (filesystem). Specialized tool-routing only — no free-form chat.
|
|
6
|
+
|
|
7
|
+
## Capabilities
|
|
8
|
+
|
|
9
|
+
- `tool-use` — function/tool calling via `engine.run` / `engine.run_stream`
|
|
10
|
+
- `model.search`, `model.info` — single-model catalog (Needle 26M)
|
|
11
|
+
- `model.download`, `model.download-remove` — fetch + cache the three model files
|
|
12
|
+
|
|
13
|
+
## Entry points
|
|
14
|
+
|
|
15
|
+
- `@workglow/cactus/ai` — main-thread shell: `registerCactus`, schema, constants, provider classes
|
|
16
|
+
- `@workglow/cactus/ai-runtime` — worker server and inline runtime: `registerCactusWorker`, `registerCactusInline`, runtime helpers
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderPreviewRunFn, AiProviderRunFnRegistration, Capability, ModelConfig, ModelRecord } from "@workglow/ai/worker";
|
|
7
|
+
import { AiProvider } from "@workglow/ai/worker";
|
|
8
|
+
import type { CactusModelConfig } from "./common/Cactus_ModelSchema";
|
|
9
|
+
/** Worker-server registration for Cactus (browser + Node/Bun via WASM). */
|
|
10
|
+
export declare class CactusProvider extends AiProvider<CactusModelConfig> {
|
|
11
|
+
readonly name = "LOCAL_CACTUS";
|
|
12
|
+
readonly displayName = "Cactus (Needle)";
|
|
13
|
+
readonly isLocal = true;
|
|
14
|
+
readonly supportsBrowser = true;
|
|
15
|
+
constructor(promiseRunFns?: readonly AiProviderRunFnRegistration<any, any, CactusModelConfig>[], previewTasks?: Record<string, AiProviderPreviewRunFn<any, any, CactusModelConfig>>);
|
|
16
|
+
inferCapabilities(model: ModelRecord): readonly Capability[];
|
|
17
|
+
protected workerRunFnSpecs(): readonly {
|
|
18
|
+
serves: readonly Capability[];
|
|
19
|
+
}[];
|
|
20
|
+
createSession(_model: ModelConfig): string;
|
|
21
|
+
disposeSession(sessionId: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CactusProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CactusProvider.d.ts","sourceRoot":"","sources":["../../src/ai/CactusProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,UAAU,EACV,WAAW,EACX,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,2EAA2E;AAC3E,qBAAa,cAAe,SAAQ,UAAU,CAAC,iBAAiB,CAAC;IAC/D,QAAQ,CAAC,IAAI,kBAAgB;IAC7B,QAAQ,CAAC,WAAW,qBAAqB;IACzC,QAAQ,CAAC,OAAO,QAAQ;IACxB,QAAQ,CAAC,eAAe,QAAQ;IAEhC,YACE,aAAa,CAAC,EAAE,SAAS,2BAA2B,CAElD,GAAG,EAEH,GAAG,EACH,iBAAiB,CAClB,EAAE,EACH,YAAY,CAAC,EAAE,MAAM,CACnB,MAAM,EAEN,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CACpD,EAGF;IAEQ,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;IAEQ,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAElD;IAEc,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderPreviewRunFn, AiProviderRunFnRegistration, Capability, ModelConfig, ModelRecord } from "@workglow/ai";
|
|
7
|
+
import { QueuedAiProvider } from "@workglow/ai";
|
|
8
|
+
import type { CactusModelConfig } from "./common/Cactus_ModelSchema";
|
|
9
|
+
/** Main-thread registration (inline or worker-backed); creates the default job queue. */
|
|
10
|
+
export declare class CactusQueuedProvider extends QueuedAiProvider<CactusModelConfig> {
|
|
11
|
+
readonly name = "LOCAL_CACTUS";
|
|
12
|
+
readonly displayName = "Cactus (Needle)";
|
|
13
|
+
readonly isLocal = true;
|
|
14
|
+
readonly supportsBrowser = true;
|
|
15
|
+
constructor(promiseRunFns?: readonly AiProviderRunFnRegistration<any, any, CactusModelConfig>[], previewTasks?: Record<string, AiProviderPreviewRunFn<any, any, CactusModelConfig>>);
|
|
16
|
+
inferCapabilities(model: ModelRecord): readonly Capability[];
|
|
17
|
+
protected workerRunFnSpecs(): readonly {
|
|
18
|
+
serves: readonly Capability[];
|
|
19
|
+
}[];
|
|
20
|
+
createSession(_model: ModelConfig): string;
|
|
21
|
+
disposeSession(sessionId: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CactusQueuedProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CactusQueuedProvider.d.ts","sourceRoot":"","sources":["../../src/ai/CactusQueuedProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,UAAU,EACV,WAAW,EACX,WAAW,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,yFAAyF;AACzF,qBAAa,oBAAqB,SAAQ,gBAAgB,CAAC,iBAAiB,CAAC;IAC3E,QAAQ,CAAC,IAAI,kBAAgB;IAC7B,QAAQ,CAAC,WAAW,qBAAqB;IACzC,QAAQ,CAAC,OAAO,QAAQ;IACxB,QAAQ,CAAC,eAAe,QAAQ;IAEhC,YACE,aAAa,CAAC,EAAE,SAAS,2BAA2B,CAElD,GAAG,EAEH,GAAG,EACH,iBAAiB,CAClB,EAAE,EACH,YAAY,CAAC,EAAE,MAAM,CACnB,MAAM,EAEN,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CACpD,EAGF;IAEQ,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;IAEQ,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAElD;IAEc,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Capability, ModelRecord } from "@workglow/ai/worker";
|
|
7
|
+
export declare const CACTUS_RUN_FN_SPECS: {
|
|
8
|
+
serves: ["model.download"] | ["model.download-remove"] | ["model.info"] | ["model.search"] | ["tool-use"];
|
|
9
|
+
}[];
|
|
10
|
+
export declare function cactusWorkerRunFnSpecs(): readonly {
|
|
11
|
+
readonly serves: readonly Capability[];
|
|
12
|
+
}[];
|
|
13
|
+
type CapabilityHints = Pick<ModelRecord, "model_id" | "provider_config" | "capabilities">;
|
|
14
|
+
/**
|
|
15
|
+
* needle-rs ships a single model architecture; capability inference is constant.
|
|
16
|
+
*/
|
|
17
|
+
export declare function inferCactusCapabilities(_model: CapabilityHints): readonly Capability[];
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=Cactus_Capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_Capabilities.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_Capabilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGnE,eAAO,MAAM,mBAAmB;;GAAuD,CAAC;AAExF,wBAAgB,sBAAsB,IAAI,SAAS;IACjD,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;CACxC,EAAE,CAEF;AAED,KAAK,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,iBAAiB,GAAG,cAAc,CAAC,CAAC;AAE1F;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,UAAU,EAAE,CAEtF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const CACTUS_TOOL_USE: ["tool-use"];
|
|
7
|
+
export declare const CACTUS_MODEL_DOWNLOAD: ["model.download"];
|
|
8
|
+
export declare const CACTUS_MODEL_DOWNLOAD_REMOVE: ["model.download-remove"];
|
|
9
|
+
export declare const CACTUS_MODEL_SEARCH: ["model.search"];
|
|
10
|
+
export declare const CACTUS_MODEL_INFO: ["model.info"];
|
|
11
|
+
export declare const CACTUS_CAPABILITY_SETS: readonly [["tool-use"], ["model.download"], ["model.download-remove"], ["model.search"], ["model.info"]];
|
|
12
|
+
//# sourceMappingURL=Cactus_CapabilitySets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_CapabilitySets.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_CapabilitySets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,eAAe,cAA+C,CAAC;AAC5E,eAAO,MAAM,qBAAqB,oBAAqD,CAAC;AACxF,eAAO,MAAM,4BAA4B,2BAER,CAAC;AAClC,eAAO,MAAM,mBAAmB,kBAAmD,CAAC;AACpF,eAAO,MAAM,iBAAiB,gBAAiD,CAAC;AAEhF,eAAO,MAAM,sBAAsB,0GAMzB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const LOCAL_CACTUS = "LOCAL_CACTUS";
|
|
7
|
+
export declare const CACTUS_NEEDLE_26M = "needle-26m";
|
|
8
|
+
export declare const CACTUS_DEFAULT_HF_REPO = "Abdalrahman/needle-rs-safetensors";
|
|
9
|
+
export declare const CACTUS_DEFAULT_REVISION = "main";
|
|
10
|
+
/** Browser Cache Storage name used by `fetchAssetBytes` and `removeCachedAssets`. */
|
|
11
|
+
export declare const CACTUS_CACHE_NAME = "cactus-models-v1";
|
|
12
|
+
/** Node/Bun on-disk cache root. */
|
|
13
|
+
export declare const CACTUS_DEFAULT_MODELS_DIR = "~/.cache/cactus-models";
|
|
14
|
+
//# sourceMappingURL=Cactus_Constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_Constants.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_Constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,sBAAsB,sCAAsC,CAAC;AAC1E,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAE9C,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,mCAAmC;AACnC,eAAO,MAAM,yBAAyB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRunFn, ModelDownloadTaskRunInput, ModelDownloadTaskRunOutput } from "@workglow/ai";
|
|
7
|
+
import type { CactusModelConfig } from "./Cactus_ModelSchema";
|
|
8
|
+
export declare const Cactus_Download: AiProviderRunFn<ModelDownloadTaskRunInput, ModelDownloadTaskRunOutput, CactusModelConfig>;
|
|
9
|
+
//# sourceMappingURL=Cactus_Download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_Download.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_Download.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,CAkBlB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRunFn, ModelDownloadRemoveTaskRunInput, ModelDownloadRemoveTaskRunOutput } from "@workglow/ai";
|
|
7
|
+
import type { CactusModelConfig } from "./Cactus_ModelSchema";
|
|
8
|
+
export declare const Cactus_DownloadRemove: AiProviderRunFn<ModelDownloadRemoveTaskRunInput, ModelDownloadRemoveTaskRunOutput, CactusModelConfig>;
|
|
9
|
+
//# sourceMappingURL=Cactus_DownloadRemove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_DownloadRemove.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_DownloadRemove.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,+BAA+B,EAC/B,gCAAgC,EAChC,iBAAiB,CAKlB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRunFnRegistration } from "@workglow/ai";
|
|
7
|
+
import type { CactusModelConfig } from "./Cactus_ModelSchema";
|
|
8
|
+
export { cactusConfigJson, cactusEngines, deleteCactusSession, disposeCactusResources, getOrLoadEngine, loadSdk, removeCachedAssets, } from "./Cactus_Runtime";
|
|
9
|
+
export declare const CACTUS_RUN_FNS: readonly AiProviderRunFnRegistration<any, any, CactusModelConfig>[];
|
|
10
|
+
/** No preview-only tasks for Cactus today. */
|
|
11
|
+
export declare const CACTUS_PREVIEW_TASKS: {};
|
|
12
|
+
//# sourceMappingURL=Cactus_JobRunFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAWhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAI9D,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,OAAO,EACP,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,cAAc,EAAE,SAAS,2BAA2B,CAE/D,GAAG,EAEH,GAAG,EACH,iBAAiB,CAClB,EAMA,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,oBAAoB,IAAc,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Capability } from "@workglow/ai/worker";
|
|
7
|
+
export interface CactusCatalogEntry {
|
|
8
|
+
readonly model_id: string;
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly description: string;
|
|
11
|
+
readonly hf_repo: string;
|
|
12
|
+
readonly revision: string;
|
|
13
|
+
readonly assets: {
|
|
14
|
+
readonly weights: string;
|
|
15
|
+
readonly vocab: string;
|
|
16
|
+
readonly config: string;
|
|
17
|
+
};
|
|
18
|
+
readonly capabilities: readonly Capability[];
|
|
19
|
+
}
|
|
20
|
+
export declare const CACTUS_CATALOG: readonly CactusCatalogEntry[];
|
|
21
|
+
export declare function getCactusCatalogEntry(model_id: string): CactusCatalogEntry | undefined;
|
|
22
|
+
export declare function cactusAssetUrl(entry: CactusCatalogEntry, filename: string): string;
|
|
23
|
+
//# sourceMappingURL=Cactus_ModelCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_ModelCatalog.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_ModelCatalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAOtD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,QAAQ,CAAC,YAAY,EAAE,SAAS,UAAU,EAAE,CAAC;CAC9C;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,kBAAkB,EAe9C,CAAC;AAEX,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAEtF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRunFn, ModelInfoTaskInput, ModelInfoTaskOutput } from "@workglow/ai";
|
|
7
|
+
import type { CactusModelConfig } from "./Cactus_ModelSchema";
|
|
8
|
+
export declare const Cactus_ModelInfo: AiProviderRunFn<ModelInfoTaskInput, ModelInfoTaskOutput, CactusModelConfig>;
|
|
9
|
+
//# sourceMappingURL=Cactus_ModelInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_ModelInfo.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_ModelInfo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAC5C,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,CAuBlB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FromSchema } from "@workglow/util/schema";
|
|
7
|
+
export declare const CactusModelSchema: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly provider: {
|
|
11
|
+
readonly const: "LOCAL_CACTUS";
|
|
12
|
+
readonly description: "Discriminator: local needle-rs (Cactus) model.";
|
|
13
|
+
};
|
|
14
|
+
readonly provider_config: {
|
|
15
|
+
readonly type: "object";
|
|
16
|
+
readonly description: "Cactus-specific configuration.";
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly model_id: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly enum: readonly ["needle-26m"];
|
|
21
|
+
readonly description: "Catalog id of the Cactus model.";
|
|
22
|
+
};
|
|
23
|
+
readonly models_dir: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly description: "Node/Bun on-disk cache directory. Ignored in the browser (Cache Storage is used).";
|
|
26
|
+
readonly default: "~/.cache/cactus-models";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly required: readonly ["model_id"];
|
|
30
|
+
readonly additionalProperties: false;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly required: readonly ["provider", "provider_config"];
|
|
34
|
+
readonly additionalProperties: true;
|
|
35
|
+
};
|
|
36
|
+
export declare const CactusModelRecordSchema: {
|
|
37
|
+
readonly type: "object";
|
|
38
|
+
readonly properties: {
|
|
39
|
+
readonly model_id: {
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
};
|
|
42
|
+
readonly capabilities: {
|
|
43
|
+
readonly type: "array";
|
|
44
|
+
readonly items: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
};
|
|
47
|
+
readonly "x-ui-editor": "multiselect";
|
|
48
|
+
};
|
|
49
|
+
readonly title: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
};
|
|
52
|
+
readonly description: {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
readonly "x-ui-editor": "textarea";
|
|
55
|
+
};
|
|
56
|
+
readonly metadata: {
|
|
57
|
+
readonly type: "object";
|
|
58
|
+
readonly default: {};
|
|
59
|
+
readonly "x-ui-hidden": true;
|
|
60
|
+
};
|
|
61
|
+
readonly provider: {
|
|
62
|
+
readonly const: "LOCAL_CACTUS";
|
|
63
|
+
readonly description: "Discriminator: local needle-rs (Cactus) model.";
|
|
64
|
+
};
|
|
65
|
+
readonly provider_config: {
|
|
66
|
+
readonly type: "object";
|
|
67
|
+
readonly description: "Cactus-specific configuration.";
|
|
68
|
+
readonly properties: {
|
|
69
|
+
readonly model_id: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
readonly enum: readonly ["needle-26m"];
|
|
72
|
+
readonly description: "Catalog id of the Cactus model.";
|
|
73
|
+
};
|
|
74
|
+
readonly models_dir: {
|
|
75
|
+
readonly type: "string";
|
|
76
|
+
readonly description: "Node/Bun on-disk cache directory. Ignored in the browser (Cache Storage is used).";
|
|
77
|
+
readonly default: "~/.cache/cactus-models";
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
readonly required: readonly ["model_id"];
|
|
81
|
+
readonly additionalProperties: false;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
readonly required: readonly ["model_id", "capabilities", "provider", "title", "description", "provider_config", "metadata", "provider", "provider_config"];
|
|
85
|
+
readonly additionalProperties: false;
|
|
86
|
+
};
|
|
87
|
+
export type CactusModelRecord = FromSchema<typeof CactusModelRecordSchema>;
|
|
88
|
+
export declare const CactusModelConfigSchema: {
|
|
89
|
+
readonly type: "object";
|
|
90
|
+
readonly properties: {
|
|
91
|
+
readonly model_id: {
|
|
92
|
+
readonly type: "string";
|
|
93
|
+
};
|
|
94
|
+
readonly capabilities: {
|
|
95
|
+
readonly type: "array";
|
|
96
|
+
readonly items: {
|
|
97
|
+
readonly type: "string";
|
|
98
|
+
};
|
|
99
|
+
readonly "x-ui-editor": "multiselect";
|
|
100
|
+
};
|
|
101
|
+
readonly title: {
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
};
|
|
104
|
+
readonly description: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly "x-ui-editor": "textarea";
|
|
107
|
+
};
|
|
108
|
+
readonly metadata: {
|
|
109
|
+
readonly type: "object";
|
|
110
|
+
readonly default: {};
|
|
111
|
+
readonly "x-ui-hidden": true;
|
|
112
|
+
};
|
|
113
|
+
readonly provider: {
|
|
114
|
+
readonly const: "LOCAL_CACTUS";
|
|
115
|
+
readonly description: "Discriminator: local needle-rs (Cactus) model.";
|
|
116
|
+
};
|
|
117
|
+
readonly provider_config: {
|
|
118
|
+
readonly type: "object";
|
|
119
|
+
readonly description: "Cactus-specific configuration.";
|
|
120
|
+
readonly properties: {
|
|
121
|
+
readonly model_id: {
|
|
122
|
+
readonly type: "string";
|
|
123
|
+
readonly enum: readonly ["needle-26m"];
|
|
124
|
+
readonly description: "Catalog id of the Cactus model.";
|
|
125
|
+
};
|
|
126
|
+
readonly models_dir: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly description: "Node/Bun on-disk cache directory. Ignored in the browser (Cache Storage is used).";
|
|
129
|
+
readonly default: "~/.cache/cactus-models";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly required: readonly ["model_id"];
|
|
133
|
+
readonly additionalProperties: false;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
readonly required: readonly ["provider", "provider_config", "provider", "provider_config"];
|
|
137
|
+
readonly additionalProperties: false;
|
|
138
|
+
};
|
|
139
|
+
export type CactusModelConfig = FromSchema<typeof CactusModelConfigSchema>;
|
|
140
|
+
//# sourceMappingURL=Cactus_ModelSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_ModelSchema.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_ModelSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,eAAO,MAAM,iBAAiB;mBACtB,QAAQ;;iBAEZ,QAAQ;qBACN,KAAK;qBACL,WAAW,EAAE,gDAAgD;;iBAE/D,eAAe;qBACb,IAAI,EAAE,QAAQ;qBACd,WAAW,EAAE,gCAAgC;qBAC7C,UAAU;yBACR,QAAQ;6BACN,IAAI,EAAE,QAAQ;6BACd,IAAI;6BACJ,WAAW,EAAE,iCAAiC;;yBAEhD,UAAU;6BACR,IAAI,EAAE,QAAQ;6BACd,WAAW,EACT,mFAAmF;6BACrF,OAAO;;;qBAGX,QAAQ;qBACR,oBAAoB;;;;;CAKe,CAAC;AAE1C,eAAO,MAAM,uBAAuB;mBAC5B,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;qBA5BV,KAAK;qBACL,WAAW,EAAE,gDAAgD;;;qBAG7D,IAAI,EAAE,QAAQ;qBACd,WAAW,EAAE,gCAAgC;qBAC7C,UAAU;yBACR,QAAQ;6BACN,IAAI,EAAE,QAAQ;6BACd,IAAI;6BACJ,WAAW,EAAE,iCAAiC;;yBAEhD,UAAU;6BACR,IAAI,EAAE,QAAQ;6BACd,WAAW,EACT,mFAAmF;6BACrF,OAAO;;;qBAGX,QAAQ;qBACR,oBAAoB;;;;;CAee,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,uBAAuB;mBAC5B,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;qBAxCV,KAAK;qBACL,WAAW,EAAE,gDAAgD;;;qBAG7D,IAAI,EAAE,QAAQ;qBACd,WAAW,EAAE,gCAAgC;qBAC7C,UAAU;yBACR,QAAQ;6BACN,IAAI,EAAE,QAAQ;6BACd,IAAI;6BACJ,WAAW,EAAE,iCAAiC;;yBAEhD,UAAU;6BACR,IAAI,EAAE,QAAQ;6BACd,WAAW,EACT,mFAAmF;6BACrF,OAAO;;;qBAGX,QAAQ;qBACR,oBAAoB;;;;;CA2Be,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRunFn, ModelSearchTaskInput, ModelSearchTaskOutput } from "@workglow/ai";
|
|
7
|
+
export declare const Cactus_ModelSearch: AiProviderRunFn<ModelSearchTaskInput, ModelSearchTaskOutput>;
|
|
8
|
+
//# sourceMappingURL=Cactus_ModelSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_ModelSearch.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_ModelSearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAItB,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,CAsBtB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { CactusModelConfig } from "./Cactus_ModelSchema";
|
|
7
|
+
type NeedleSdkModule = typeof import("needle-rs");
|
|
8
|
+
type NeedleEngine = NonNullable<ReturnType<NeedleSdkModule["NeedleWasm"]["load"]>>;
|
|
9
|
+
/** Lazily load needle-rs and run its WASM `init()` exactly once. */
|
|
10
|
+
export declare function loadSdk(): Promise<NeedleSdkModule>;
|
|
11
|
+
export declare function getCactusSdk(): NeedleSdkModule;
|
|
12
|
+
export declare function fetchAssetBytes(model: CactusModelConfig, filename: string): Promise<Uint8Array>;
|
|
13
|
+
/** @internal Exported for tests. */
|
|
14
|
+
export declare const cactusEngines: Map<string, NeedleEngine>;
|
|
15
|
+
/** @internal Exported for tests. */
|
|
16
|
+
export declare const cactusConfigJson: Map<string, unknown>;
|
|
17
|
+
export declare function getOrLoadEngine(model: CactusModelConfig): Promise<NeedleEngine>;
|
|
18
|
+
export declare function isModelLoaded(model_id: string): boolean;
|
|
19
|
+
/** Mark a model_id as having its assets persisted in Cache Storage. */
|
|
20
|
+
export declare function markModelCached(model_id: string): void;
|
|
21
|
+
/** Returns true if the model's assets have been downloaded or the engine is currently loaded. */
|
|
22
|
+
export declare function isModelCached(model_id: string): boolean;
|
|
23
|
+
/** @internal Exported for tests. */
|
|
24
|
+
export declare const cactusSessions: Map<string, Record<string, never>>;
|
|
25
|
+
export declare function deleteCactusSession(id: string): Promise<boolean>;
|
|
26
|
+
export declare function removeCachedAssets(model: CactusModelConfig): Promise<void>;
|
|
27
|
+
/** Best-effort cleanup on shutdown. */
|
|
28
|
+
export declare function disposeCactusResources(): Promise<void>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=Cactus_Runtime.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_Runtime.browser.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_Runtime.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,KAAK,eAAe,GAAG,cAAc,WAAW,CAAC,CAAC;AAGlD,KAAK,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAKnF,oEAAoE;AACpE,wBAAsB,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,CAkBxD;AAED,wBAAgB,YAAY,IAAI,eAAe,CAG9C;AAoBD,wBAAsB,eAAe,CACnC,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CAMrB;AAMD,oCAAoC;AACpC,eAAO,MAAM,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAa,CAAC;AAClE,oCAAoC;AACpC,eAAO,MAAM,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAa,CAAC;AAMhE,wBAAsB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAwCrF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAMD,oCAAoC;AACpC,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAa,CAAC;AAE5E,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE;AAiCD,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhF;AAED,uCAAuC;AACvC,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ5D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { CactusModelConfig } from "./Cactus_ModelSchema";
|
|
7
|
+
type NeedleSdkModule = typeof import("needle-rs");
|
|
8
|
+
type NeedleEngine = NonNullable<ReturnType<NeedleSdkModule["NeedleWasm"]["load"]>>;
|
|
9
|
+
/** Lazily load needle-rs and run its WASM `init()` exactly once. */
|
|
10
|
+
export declare function loadSdk(): Promise<NeedleSdkModule>;
|
|
11
|
+
export declare function getCactusSdk(): NeedleSdkModule;
|
|
12
|
+
export declare function fetchAssetBytes(model: CactusModelConfig, filename: string): Promise<Uint8Array>;
|
|
13
|
+
/** @internal Exported for tests. */
|
|
14
|
+
export declare const cactusEngines: Map<string, NeedleEngine>;
|
|
15
|
+
/** @internal Exported for tests. */
|
|
16
|
+
export declare const cactusConfigJson: Map<string, unknown>;
|
|
17
|
+
export declare function getOrLoadEngine(model: CactusModelConfig): Promise<NeedleEngine>;
|
|
18
|
+
export declare function isModelLoaded(model_id: string): boolean;
|
|
19
|
+
/** Mark a model_id as having its assets persisted on disk / in Cache Storage. */
|
|
20
|
+
export declare function markModelCached(model_id: string): void;
|
|
21
|
+
/** Returns true if the model's assets have been downloaded or the engine is currently loaded. */
|
|
22
|
+
export declare function isModelCached(model_id: string): boolean;
|
|
23
|
+
/** @internal Exported for tests. */
|
|
24
|
+
export declare const cactusSessions: Map<string, Record<string, never>>;
|
|
25
|
+
export declare function deleteCactusSession(id: string): Promise<boolean>;
|
|
26
|
+
export declare function removeCachedAssets(model: CactusModelConfig): Promise<void>;
|
|
27
|
+
/** Best-effort cleanup on shutdown. */
|
|
28
|
+
export declare function disposeCactusResources(): Promise<void>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=Cactus_Runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_Runtime.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_Runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,KAAK,eAAe,GAAG,cAAc,WAAW,CAAC,CAAC;AAGlD,KAAK,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAKnF,oEAAoE;AACpE,wBAAsB,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,CAkBxD;AAED,wBAAgB,YAAY,IAAI,eAAe,CAG9C;AA4DD,wBAAsB,eAAe,CACnC,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CASrB;AAMD,oCAAoC;AACpC,eAAO,MAAM,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAa,CAAC;AAClE,oCAAoC;AACpC,eAAO,MAAM,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAa,CAAC;AAMhE,wBAAsB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAwCrF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAMD,oCAAoC;AACpC,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAa,CAAC;AAE5E,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE;AA6CD,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhF;AAED,uCAAuC;AACvC,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ5D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRunFn, ToolCallingTaskInput, ToolCallingTaskOutput } from "@workglow/ai";
|
|
7
|
+
import type { CactusModelConfig } from "./Cactus_ModelSchema";
|
|
8
|
+
export declare const Cactus_ToolCalling: AiProviderRunFn<ToolCallingTaskInput, ToolCallingTaskOutput, CactusModelConfig>;
|
|
9
|
+
//# sourceMappingURL=Cactus_ToolCalling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cactus_ToolCalling.d.ts","sourceRoot":"","sources":["../../../src/ai/common/Cactus_ToolCalling.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EAGtB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiD9D,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CA8BlB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export * from "./common/Cactus_Constants";
|
|
7
|
+
export * from "./common/Cactus_ModelCatalog";
|
|
8
|
+
export * from "./common/Cactus_ModelSchema";
|
|
9
|
+
export * from "./CactusProvider";
|
|
10
|
+
export * from "./CactusQueuedProvider";
|
|
11
|
+
export * from "./registerCactus";
|
|
12
|
+
import { CactusQueuedProvider } from "./CactusQueuedProvider";
|
|
13
|
+
/**
|
|
14
|
+
* @internal Symbols exported only for use by `@workglow/test`. Not part of the stable public API.
|
|
15
|
+
*
|
|
16
|
+
* `cactusEngines` and `cactusConfigJson` are re-exported here so that tests can
|
|
17
|
+
* seed and inspect the runtime state used by the run-fns bundled into the `./ai`
|
|
18
|
+
* entry point. The `./ai` and `./ai-runtime` entry points are bundled separately
|
|
19
|
+
* — their copies of `Cactus_Runtime.ts` are distinct module instances. Reading
|
|
20
|
+
* the runtime state via `_testOnly` (rather than `@workglow/cactus/ai-runtime`)
|
|
21
|
+
* guarantees the test observes the same Map that the run-fns mutate.
|
|
22
|
+
*/
|
|
23
|
+
export declare const _testOnly: {
|
|
24
|
+
readonly CactusQueuedProvider: typeof CactusQueuedProvider;
|
|
25
|
+
readonly CACTUS_RUN_FN_SPECS: {
|
|
26
|
+
serves: ["model.download"] | ["model.download-remove"] | ["model.info"] | ["model.search"] | ["tool-use"];
|
|
27
|
+
}[];
|
|
28
|
+
readonly CACTUS_RUN_FNS: readonly import("@workglow/ai").AiProviderRunFnRegistration<any, any, {
|
|
29
|
+
capabilities?: string[] | undefined;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
metadata?: {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
} | undefined;
|
|
34
|
+
model_id?: string | undefined;
|
|
35
|
+
provider: "LOCAL_CACTUS";
|
|
36
|
+
provider_config: {
|
|
37
|
+
model_id: "needle-26m";
|
|
38
|
+
models_dir?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
title?: string | undefined;
|
|
41
|
+
}>[];
|
|
42
|
+
readonly cactusEngines: Map<string, import("needle-rs").NeedleWasm>;
|
|
43
|
+
readonly cactusConfigJson: Map<string, unknown>;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAO5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AAKjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;CAMZ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRegisterOptions } from "@workglow/ai";
|
|
7
|
+
export declare function registerCactus(options: AiProviderRegisterOptions & {
|
|
8
|
+
worker: Worker | (() => Worker);
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=registerCactus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerCactus.d.ts","sourceRoot":"","sources":["../../src/ai/registerCactus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAI9D,wBAAsB,cAAc,CAClC,OAAO,EAAE,yBAAyB,GAAG;IACnC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;CACjC,GACA,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRegisterOptions } from "@workglow/ai";
|
|
7
|
+
export declare function registerCactusInline(options?: AiProviderRegisterOptions): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=registerCactusInline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerCactusInline.d.ts","sourceRoot":"","sources":["../../src/ai/registerCactusInline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAK9D,wBAAsB,oBAAoB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAM7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerCactusWorker.d.ts","sourceRoot":"","sources":["../../src/ai/registerCactusWorker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAK1D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export * from "./common/Cactus_Runtime.browser";
|
|
7
|
+
export * from "./registerCactusInline";
|
|
8
|
+
export * from "./registerCactusWorker";
|
|
9
|
+
//# sourceMappingURL=runtime.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.browser.d.ts","sourceRoot":"","sources":["../../src/ai/runtime.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export * from "./common/Cactus_Runtime";
|
|
7
|
+
export * from "./registerCactusInline";
|
|
8
|
+
export * from "./registerCactusWorker";
|
|
9
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/ai/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-runtime.browser.d.ts","sourceRoot":"","sources":["../src/ai-runtime.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,sBAAsB,CAAC"}
|