@memgrafter/flatagents 0.9.0 → 0.10.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/MACHINES.md CHANGED
@@ -22,7 +22,7 @@
22
22
  ```yaml
23
23
  # profiles.yml — agents reference by name
24
24
  spec: flatprofiles
25
- spec_version: "0.9.0"
25
+ spec_version: "0.10.0"
26
26
  data:
27
27
  model_profiles:
28
28
  fast: { provider: cerebras, name: zai-glm-4.6, temperature: 0.6 }
@@ -80,6 +80,28 @@ launch: background_task
80
80
  launch_input: { data: "{{ context.data }}" }
81
81
  ```
82
82
 
83
+ ## Distributed Worker Pattern
84
+
85
+ Use hook actions (e.g., `DistributedWorkerHooks`) with a `RegistrationBackend` + `WorkBackend` to build worker pools.
86
+
87
+ **Core machines**
88
+ - **Checker**: `get_pool_state` → `calculate_spawn` → `spawn_workers`
89
+ - **Worker**: `register_worker` → `claim_job` → process → `complete_job`/`fail_job` → `deregister_worker`
90
+ - **Reaper**: `list_stale_workers` → `reap_stale_workers`
91
+
92
+ `spawn_workers` expects `worker_config_path` in context (or override hooks to resolve it). Custom queues can compose the base hooks and add actions.
93
+
94
+ ```yaml
95
+ context:
96
+ worker_config_path: "./job_worker.yml"
97
+ states:
98
+ check_state: { action: get_pool_state }
99
+ calculate_spawn: { action: calculate_spawn }
100
+ spawn_workers: { action: spawn_workers }
101
+ ```
102
+
103
+ See `sdk/examples/distributed_worker/` for a full example.
104
+
83
105
  ## Context Variables
84
106
 
85
107
  `context.*` (all states), `input.*` (initial), `output.*` (in output_to_context), `item`/`as` (foreach)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memgrafter/flatagents",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "TypeScript SDK for FlatAgents - Declarative LLM orchestration with YAML",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -149,7 +149,7 @@
149
149
  * The profile field specifies which profile name to use as base.
150
150
  */
151
151
 
152
- export const SPEC_VERSION = "0.9.0";
152
+ export const SPEC_VERSION = "0.10.0";
153
153
 
154
154
  export interface AgentWrapper {
155
155
  spec: "flatagent";
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "0.9.0";
1
+ export const SPEC_VERSION = "0.10.0";
2
2
  export interface AgentWrapper {
3
3
  spec: "flatagent";
4
4
  spec_version: string;
@@ -488,7 +488,7 @@ export interface BackendConfig {
488
488
  sqlite_path?: string;
489
489
  }
490
490
 
491
- export const SPEC_VERSION = "0.9.0";
491
+ export const SPEC_VERSION = "0.10.0";
492
492
 
493
493
  /**
494
494
  * Wrapper interface for JSON schema generation.
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "spec_version": {
13
13
  "type": "string",
14
- "const": "0.9.0"
14
+ "const": "0.10.0"
15
15
  },
16
16
  "execution_lock": {
17
17
  "$ref": "#/definitions/ExecutionLock"
@@ -157,7 +157,7 @@ export interface BackendConfig {
157
157
  work?: "memory" | "sqlite" | "redis";
158
158
  sqlite_path?: string;
159
159
  }
160
- export const SPEC_VERSION = "0.9.0";
160
+ export const SPEC_VERSION = "0.10.0";
161
161
  export interface SDKRuntimeWrapper {
162
162
  spec: "flatagents-runtime";
163
163
  spec_version: typeof SPEC_VERSION;
@@ -256,7 +256,7 @@
256
256
  * pending_launches - Outbox pattern (v0.4.0)
257
257
  */
258
258
 
259
- export const SPEC_VERSION = "0.9.0";
259
+ export const SPEC_VERSION = "0.10.0";
260
260
 
261
261
  export interface MachineWrapper {
262
262
  spec: "flatmachine";
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "0.9.0";
1
+ export const SPEC_VERSION = "0.10.0";
2
2
  export interface MachineWrapper {
3
3
  spec: "flatmachine";
4
4
  spec_version: string;
@@ -105,9 +105,10 @@
105
105
  * presence_penalty - Presence penalty (-2.0 to 2.0)
106
106
  * seed - Random seed for reproducibility
107
107
  * base_url - Custom base URL for the API (e.g., for local models or proxies)
108
+ * stream - Enable streaming responses (default: false)
108
109
  */
109
110
 
110
- export const SPEC_VERSION = "0.9.0";
111
+ export const SPEC_VERSION = "0.10.0";
111
112
 
112
113
  export interface ProfilesWrapper {
113
114
  spec: "flatprofiles";
@@ -133,6 +134,7 @@ export interface ModelProfileConfig {
133
134
  presence_penalty?: number;
134
135
  seed?: number;
135
136
  base_url?: string;
137
+ stream?: boolean;
136
138
  }
137
139
 
138
140
  export type FlatprofilesConfig = ProfilesWrapper;
@@ -79,6 +79,9 @@
79
79
  },
80
80
  "base_url": {
81
81
  "type": "string"
82
+ },
83
+ "stream": {
84
+ "type": "boolean"
82
85
  }
83
86
  },
84
87
  "required": [
@@ -1,4 +1,4 @@
1
- export const SPEC_VERSION = "0.9.0";
1
+ export const SPEC_VERSION = "0.10.0";
2
2
  export interface ProfilesWrapper {
3
3
  spec: "flatprofiles";
4
4
  spec_version: string;
@@ -21,5 +21,6 @@ export interface ModelProfileConfig {
21
21
  presence_penalty?: number;
22
22
  seed?: number;
23
23
  base_url?: string;
24
+ stream?: boolean;
24
25
  }
25
26
  export type FlatprofilesConfig = ProfilesWrapper;