simple-agents-wasm 0.4.0 → 0.5.1

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: MessageInput[];
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 (!Array.isArray(request.messages) || request.messages.length === 0) {
15
- throw configError("messages must be a non-empty array");
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
- input.messages = request.messages;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-agents-wasm",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Browser-compatible SimpleAgents client for OpenAI-compatible providers",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -43,5 +43,8 @@
43
43
  "engines": {
44
44
  "node": ">=18"
45
45
  },
46
+ "simpleagentsDependencyPolicy": {
47
+ "minimumReleaseAge": "182 days"
48
+ },
46
49
  "license": "MIT OR Apache-2.0"
47
50
  }
@@ -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 wasm_bindgen__convert__closures_____invoke__h5cfabd7a8f920681: (a: number, b: number, c: any) => void;
41
+ readonly wasm_bindgen__convert__closures_____invoke__h80994942f88eb1f9: (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, wasm_bindgen__convert__closures_____invoke__h5cfabd7a8f920681);
418
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h80994942f88eb1f9);
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 wasm_bindgen__convert__closures_____invoke__h5cfabd7a8f920681(arg0, arg1, arg2) {
458
- wasm.wasm_bindgen__convert__closures_____invoke__h5cfabd7a8f920681(arg0, arg1, arg2);
457
+ function wasm_bindgen__convert__closures_____invoke__h80994942f88eb1f9(arg0, arg1, arg2) {
458
+ wasm.wasm_bindgen__convert__closures_____invoke__h80994942f88eb1f9(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 wasm_bindgen__convert__closures_____invoke__h5cfabd7a8f920681: (a: number, b: number, c: any) => void;
14
+ export const wasm_bindgen__convert__closures_____invoke__h80994942f88eb1f9: (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;
package/rust/Cargo.toml CHANGED
@@ -1,19 +1,22 @@
1
1
  [package]
2
2
  name = "simple-agents-wasm-rust"
3
- version = "0.4.0"
3
+ version = "0.5.1"
4
4
  edition = "2021"
5
5
  license = "MIT OR Apache-2.0"
6
6
 
7
+ [package.metadata.simpleagents.dependency-policy]
8
+ minimum-release-age = "182 days"
9
+
7
10
  [lib]
8
11
  crate-type = ["cdylib"]
9
12
 
10
13
  [workspace]
11
14
 
12
15
  [dependencies]
13
- wasm-bindgen = "0.2"
14
- wasm-bindgen-futures = "0.4"
15
- js-sys = "0.3"
16
- serde = { version = "1.0", features = ["derive"] }
17
- serde_json = "1.0"
18
- serde_yaml = "0.9"
19
- serde-wasm-bindgen = "0.6"
16
+ wasm-bindgen = "=0.2.117"
17
+ wasm-bindgen-futures = "=0.4.67"
18
+ js-sys = "=0.3.94"
19
+ serde = { version = "=1.0.228", features = ["derive"] }
20
+ serde_json = "=1.0.149"
21
+ serde-wasm-bindgen = "=0.6.5"
22
+ serde_yaml = "=0.9.34"