simple-agents-wasm 0.4.0 → 0.5.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/index.d.ts
CHANGED
|
@@ -201,9 +201,10 @@ export interface WorkflowRunEvent {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
export interface WorkflowRunResult {
|
|
204
|
-
status: "ok";
|
|
204
|
+
status: "ok" | "completed" | "awaiting_human_input";
|
|
205
205
|
context: Record<string, unknown>;
|
|
206
206
|
output?: unknown;
|
|
207
|
+
human_request?: Record<string, unknown>;
|
|
207
208
|
events: WorkflowRunEvent[];
|
|
208
209
|
}
|
|
209
210
|
|
|
@@ -218,10 +219,12 @@ export interface WorkflowExecutionFlags {
|
|
|
218
219
|
|
|
219
220
|
export interface WorkflowExecutionRequest {
|
|
220
221
|
workflow_yaml: string;
|
|
221
|
-
messages
|
|
222
|
+
messages?: MessageInput[];
|
|
222
223
|
context?: Record<string, unknown>;
|
|
223
224
|
media?: Record<string, unknown>;
|
|
224
225
|
input?: WorkflowInputFields;
|
|
226
|
+
resume?: Record<string, unknown>;
|
|
227
|
+
human_response?: unknown;
|
|
225
228
|
execution?: WorkflowExecutionFlags;
|
|
226
229
|
workflow_options?: WorkflowRunOptions;
|
|
227
230
|
}
|
package/index.js
CHANGED
|
@@ -11,12 +11,17 @@ function buildWorkflowInputFromExecutionRequest(request) {
|
|
|
11
11
|
if (typeof request.workflow_yaml !== "string" || request.workflow_yaml.trim().length === 0) {
|
|
12
12
|
throw configError("workflow_yaml must be a non-empty string");
|
|
13
13
|
}
|
|
14
|
-
if (
|
|
15
|
-
|
|
14
|
+
if (
|
|
15
|
+
(!Array.isArray(request.messages) || request.messages.length === 0)
|
|
16
|
+
&& (request.resume === null || request.resume === undefined)
|
|
17
|
+
) {
|
|
18
|
+
throw configError("messages must be a non-empty array unless resume is provided");
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
const input = request.input && typeof request.input === "object" ? { ...request.input } : {};
|
|
19
|
-
|
|
22
|
+
if (Array.isArray(request.messages) && request.messages.length > 0) {
|
|
23
|
+
input.messages = request.messages;
|
|
24
|
+
}
|
|
20
25
|
if (request.context && typeof request.context === "object") {
|
|
21
26
|
input.context = request.context;
|
|
22
27
|
}
|
|
@@ -36,6 +41,12 @@ function buildWorkflowOptionsFromExecutionRequest(request, onEvent) {
|
|
|
36
41
|
if (typeof execution.model === "string" && execution.model.trim().length > 0) {
|
|
37
42
|
options.model = execution.model;
|
|
38
43
|
}
|
|
44
|
+
if (request.resume !== undefined) {
|
|
45
|
+
options.resume = request.resume;
|
|
46
|
+
}
|
|
47
|
+
if (request.human_response !== undefined) {
|
|
48
|
+
options.human_response = request.human_response;
|
|
49
|
+
}
|
|
39
50
|
if (typeof onEvent === "function") {
|
|
40
51
|
options.onEvent = onEvent;
|
|
41
52
|
}
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ export interface InitOutput {
|
|
|
38
38
|
readonly wasmclient_streamEvents: (a: number, b: number, c: number, d: any, e: any, f: number) => any;
|
|
39
39
|
readonly wasm_bindgen__convert__closures_____invoke__h327a4c82efcf6931: (a: number, b: number, c: any) => [number, number];
|
|
40
40
|
readonly wasm_bindgen__convert__closures_____invoke__h67e61867e7d8792e: (a: number, b: number, c: any, d: any) => void;
|
|
41
|
-
readonly
|
|
41
|
+
readonly wasm_bindgen__convert__closures_____invoke__hf4fbcd5ad57ab169: (a: number, b: number, c: any) => void;
|
|
42
42
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
43
43
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
44
44
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
@@ -415,7 +415,7 @@ function __wbg_get_imports() {
|
|
|
415
415
|
},
|
|
416
416
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
417
417
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 68, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
418
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
418
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hf4fbcd5ad57ab169);
|
|
419
419
|
return ret;
|
|
420
420
|
},
|
|
421
421
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -454,8 +454,8 @@ function __wbg_get_imports() {
|
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
function
|
|
458
|
-
wasm.
|
|
457
|
+
function wasm_bindgen__convert__closures_____invoke__hf4fbcd5ad57ab169(arg0, arg1, arg2) {
|
|
458
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hf4fbcd5ad57ab169(arg0, arg1, arg2);
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
function wasm_bindgen__convert__closures_____invoke__h327a4c82efcf6931(arg0, arg1, arg2) {
|
|
Binary file
|
|
@@ -11,7 +11,7 @@ export const wasmclient_runYamlString: (a: number, b: number, c: number, d: any,
|
|
|
11
11
|
export const wasmclient_streamEvents: (a: number, b: number, c: number, d: any, e: any, f: number) => any;
|
|
12
12
|
export const wasm_bindgen__convert__closures_____invoke__h327a4c82efcf6931: (a: number, b: number, c: any) => [number, number];
|
|
13
13
|
export const wasm_bindgen__convert__closures_____invoke__h67e61867e7d8792e: (a: number, b: number, c: any, d: any) => void;
|
|
14
|
-
export const
|
|
14
|
+
export const wasm_bindgen__convert__closures_____invoke__hf4fbcd5ad57ab169: (a: number, b: number, c: any) => void;
|
|
15
15
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
16
16
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
17
17
|
export const __wbindgen_exn_store: (a: number) => void;
|