simple-agents-wasm 0.2.28
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 +51 -0
- package/index.d.ts +155 -0
- package/index.js +734 -0
- package/package.json +28 -0
- package/pkg/simple_agents_wasm.d.ts +62 -0
- package/pkg/simple_agents_wasm.js +749 -0
- package/pkg/simple_agents_wasm_bg.wasm +0 -0
- package/pkg/simple_agents_wasm_bg.wasm.d.ts +21 -0
- package/rust/Cargo.toml +19 -0
- package/rust/src/lib.rs +1034 -0
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "simple-agents-wasm",
|
|
3
|
+
"version": "0.2.28",
|
|
4
|
+
"description": "Browser-compatible SimpleAgents client for OpenAI-compatible providers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "npm run build:rust",
|
|
10
|
+
"build:rust": "cargo build --manifest-path rust/Cargo.toml --target wasm32-unknown-unknown --release && wasm-bindgen --target web --out-dir pkg --out-name simple_agents_wasm rust/target/wasm32-unknown-unknown/release/simple_agents_wasm_rust.wasm",
|
|
11
|
+
"test": "node --test test/*.test.js"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"yaml": "^2.5.1"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.js",
|
|
18
|
+
"index.d.ts",
|
|
19
|
+
"README.md",
|
|
20
|
+
"pkg",
|
|
21
|
+
"rust/Cargo.toml",
|
|
22
|
+
"rust/src"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT OR Apache-2.0"
|
|
28
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class WasmClient {
|
|
5
|
+
free(): void;
|
|
6
|
+
[Symbol.dispose](): void;
|
|
7
|
+
complete(model: string, prompt_or_messages: any, options?: any | null): Promise<any>;
|
|
8
|
+
constructor(provider: string, config: any);
|
|
9
|
+
runWorkflowYaml(workflow_path: string, _workflow_input: any): any;
|
|
10
|
+
runWorkflowYamlString(yaml_text: string, workflow_input: any, workflow_options?: any | null): Promise<any>;
|
|
11
|
+
streamEvents(model: string, prompt_or_messages: any, on_event: Function, options?: any | null): Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function supportsRustWasm(): boolean;
|
|
15
|
+
|
|
16
|
+
export function toJsArray(value: any): Array<any>;
|
|
17
|
+
|
|
18
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
19
|
+
|
|
20
|
+
export interface InitOutput {
|
|
21
|
+
readonly memory: WebAssembly.Memory;
|
|
22
|
+
readonly __wbg_wasmclient_free: (a: number, b: number) => void;
|
|
23
|
+
readonly supportsRustWasm: () => number;
|
|
24
|
+
readonly toJsArray: (a: any) => any;
|
|
25
|
+
readonly wasmclient_complete: (a: number, b: number, c: number, d: any, e: number) => any;
|
|
26
|
+
readonly wasmclient_new: (a: number, b: number, c: any) => [number, number, number];
|
|
27
|
+
readonly wasmclient_runWorkflowYaml: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
28
|
+
readonly wasmclient_runWorkflowYamlString: (a: number, b: number, c: number, d: any, e: number) => any;
|
|
29
|
+
readonly wasmclient_streamEvents: (a: number, b: number, c: number, d: any, e: any, f: number) => any;
|
|
30
|
+
readonly wasm_bindgen__closure__destroy__h5b569a9b0c99a6ce: (a: number, b: number) => void;
|
|
31
|
+
readonly wasm_bindgen__convert__closures_____invoke__h26e23bd7929d5711: (a: number, b: number, c: any) => [number, number];
|
|
32
|
+
readonly wasm_bindgen__convert__closures_____invoke__h6589060427acb019: (a: number, b: number, c: any, d: any) => void;
|
|
33
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
34
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
35
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
36
|
+
readonly __externref_table_alloc: () => number;
|
|
37
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
38
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
39
|
+
readonly __wbindgen_start: () => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
46
|
+
* a precompiled `WebAssembly.Module`.
|
|
47
|
+
*
|
|
48
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
49
|
+
*
|
|
50
|
+
* @returns {InitOutput}
|
|
51
|
+
*/
|
|
52
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
56
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
57
|
+
*
|
|
58
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
59
|
+
*
|
|
60
|
+
* @returns {Promise<InitOutput>}
|
|
61
|
+
*/
|
|
62
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|