@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 +23 -1
- package/package.json +1 -1
- package/schemas/flatagent.d.ts +1 -1
- package/schemas/flatagent.slim.d.ts +1 -1
- package/schemas/flatagents-runtime.d.ts +1 -1
- package/schemas/flatagents-runtime.schema.json +1 -1
- package/schemas/flatagents-runtime.slim.d.ts +1 -1
- package/schemas/flatmachine.d.ts +1 -1
- package/schemas/flatmachine.slim.d.ts +1 -1
- package/schemas/profiles.d.ts +3 -1
- package/schemas/profiles.schema.json +3 -0
- package/schemas/profiles.slim.d.ts +2 -1
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.
|
|
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
package/schemas/flatagent.d.ts
CHANGED
|
@@ -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.
|
|
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;
|
package/schemas/flatmachine.d.ts
CHANGED
package/schemas/profiles.d.ts
CHANGED
|
@@ -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.
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const SPEC_VERSION = "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;
|