agent-control-plane 0.6.0 → 0.7.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/README.md +38 -5
- package/package.json +1 -1
- package/tools/bin/flow-config-lib.sh +13 -3508
- package/tools/bin/flow-execution-lib.sh +243 -0
- package/tools/bin/flow-forge-lib.sh +1770 -0
- package/tools/bin/flow-profile-lib.sh +335 -0
- package/tools/bin/flow-provider-lib.sh +981 -0
- package/tools/bin/flow-session-lib.sh +317 -0
- package/tools/dashboard/app.js +40 -3
- package/tools/dashboard/requirements.txt +3 -0
- package/tools/dashboard/server.py +250 -152
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
flow_export_execution_env() {
|
|
2
|
+
local config_file="${1:-}"
|
|
3
|
+
|
|
4
|
+
if [[ -z "${config_file}" ]]; then
|
|
5
|
+
config_file="$(resolve_flow_config_yaml "${BASH_SOURCE[1]:-${BASH_SOURCE[0]}}")"
|
|
6
|
+
fi
|
|
7
|
+
|
|
8
|
+
[[ -f "${config_file}" ]] || return 0
|
|
9
|
+
|
|
10
|
+
local repo_id=""
|
|
11
|
+
local coding_worker=""
|
|
12
|
+
local provider_quota_cooldowns=""
|
|
13
|
+
local provider_pool_order=""
|
|
14
|
+
local provider_pool_selection=""
|
|
15
|
+
local explicit_coding_worker=""
|
|
16
|
+
local active_provider_pool_name=""
|
|
17
|
+
local active_provider_backend=""
|
|
18
|
+
local active_provider_model=""
|
|
19
|
+
local active_provider_key=""
|
|
20
|
+
local active_provider_next_attempt_epoch=""
|
|
21
|
+
local active_provider_next_attempt_at=""
|
|
22
|
+
local active_provider_last_reason=""
|
|
23
|
+
local active_provider_pools_exhausted="no"
|
|
24
|
+
local active_provider_selection_reason="legacy-config"
|
|
25
|
+
local safe_profile=""
|
|
26
|
+
local bypass_profile=""
|
|
27
|
+
local claude_model=""
|
|
28
|
+
local claude_permission_mode=""
|
|
29
|
+
local claude_effort=""
|
|
30
|
+
local claude_timeout=""
|
|
31
|
+
local claude_max_attempts=""
|
|
32
|
+
local claude_retry_backoff_seconds=""
|
|
33
|
+
local openclaw_model=""
|
|
34
|
+
local openclaw_thinking=""
|
|
35
|
+
local openclaw_timeout=""
|
|
36
|
+
local openclaw_stall=""
|
|
37
|
+
local ollama_model=""
|
|
38
|
+
local ollama_base_url=""
|
|
39
|
+
local ollama_timeout=""
|
|
40
|
+
local pi_model=""
|
|
41
|
+
local pi_thinking=""
|
|
42
|
+
local pi_timeout=""
|
|
43
|
+
local opencode_model=""
|
|
44
|
+
local opencode_timeout=""
|
|
45
|
+
local kilo_model=""
|
|
46
|
+
local kilo_timeout=""
|
|
47
|
+
|
|
48
|
+
repo_id="$(flow_resolve_repo_id "${config_file}")"
|
|
49
|
+
provider_quota_cooldowns="$(flow_resolve_provider_quota_cooldowns "${config_file}")"
|
|
50
|
+
provider_pool_order="$(flow_resolve_provider_pool_order "${config_file}")"
|
|
51
|
+
explicit_coding_worker="${ACP_CODING_WORKER:-}"
|
|
52
|
+
if [[ -z "${explicit_coding_worker}" && -n "${provider_pool_order}" ]]; then
|
|
53
|
+
provider_pool_selection="$(flow_selected_provider_pool_env "${config_file}" || true)"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
if [[ -n "${provider_pool_selection}" ]]; then
|
|
57
|
+
active_provider_pool_name="$(flow_kv_get "${provider_pool_selection}" "POOL_NAME")"
|
|
58
|
+
active_provider_backend="$(flow_kv_get "${provider_pool_selection}" "BACKEND")"
|
|
59
|
+
active_provider_model="$(flow_kv_get "${provider_pool_selection}" "MODEL")"
|
|
60
|
+
active_provider_key="$(flow_kv_get "${provider_pool_selection}" "PROVIDER_KEY")"
|
|
61
|
+
active_provider_next_attempt_epoch="$(flow_kv_get "${provider_pool_selection}" "NEXT_ATTEMPT_EPOCH")"
|
|
62
|
+
active_provider_next_attempt_at="$(flow_kv_get "${provider_pool_selection}" "NEXT_ATTEMPT_AT")"
|
|
63
|
+
active_provider_last_reason="$(flow_kv_get "${provider_pool_selection}" "LAST_REASON")"
|
|
64
|
+
active_provider_pools_exhausted="$(flow_kv_get "${provider_pool_selection}" "POOLS_EXHAUSTED")"
|
|
65
|
+
active_provider_selection_reason="$(flow_kv_get "${provider_pool_selection}" "SELECTION_REASON")"
|
|
66
|
+
|
|
67
|
+
coding_worker="${active_provider_backend}"
|
|
68
|
+
safe_profile="$(flow_kv_get "${provider_pool_selection}" "SAFE_PROFILE")"
|
|
69
|
+
bypass_profile="$(flow_kv_get "${provider_pool_selection}" "BYPASS_PROFILE")"
|
|
70
|
+
claude_model="$(flow_kv_get "${provider_pool_selection}" "CLAUDE_MODEL")"
|
|
71
|
+
claude_permission_mode="$(flow_kv_get "${provider_pool_selection}" "CLAUDE_PERMISSION_MODE")"
|
|
72
|
+
claude_effort="$(flow_kv_get "${provider_pool_selection}" "CLAUDE_EFFORT")"
|
|
73
|
+
claude_timeout="$(flow_kv_get "${provider_pool_selection}" "CLAUDE_TIMEOUT_SECONDS")"
|
|
74
|
+
claude_max_attempts="$(flow_kv_get "${provider_pool_selection}" "CLAUDE_MAX_ATTEMPTS")"
|
|
75
|
+
claude_retry_backoff_seconds="$(flow_kv_get "${provider_pool_selection}" "CLAUDE_RETRY_BACKOFF_SECONDS")"
|
|
76
|
+
openclaw_model="$(flow_kv_get "${provider_pool_selection}" "OPENCLAW_MODEL")"
|
|
77
|
+
openclaw_thinking="$(flow_kv_get "${provider_pool_selection}" "OPENCLAW_THINKING")"
|
|
78
|
+
openclaw_timeout="$(flow_kv_get "${provider_pool_selection}" "OPENCLAW_TIMEOUT_SECONDS")"
|
|
79
|
+
openclaw_stall="$(flow_kv_get "${provider_pool_selection}" "OPENCLAW_STALL_SECONDS")"
|
|
80
|
+
ollama_model="$(flow_kv_get "${provider_pool_selection}" "OLLAMA_MODEL")"
|
|
81
|
+
ollama_base_url="$(flow_kv_get "${provider_pool_selection}" "OLLAMA_BASE_URL")"
|
|
82
|
+
ollama_timeout="$(flow_kv_get "${provider_pool_selection}" "OLLAMA_TIMEOUT_SECONDS")"
|
|
83
|
+
pi_model="$(flow_kv_get "${provider_pool_selection}" "PI_MODEL")"
|
|
84
|
+
pi_thinking="$(flow_kv_get "${provider_pool_selection}" "PI_THINKING")"
|
|
85
|
+
pi_timeout="$(flow_kv_get "${provider_pool_selection}" "PI_TIMEOUT_SECONDS")"
|
|
86
|
+
opencode_model="$(flow_kv_get "${provider_pool_selection}" "OPENCODE_MODEL")"
|
|
87
|
+
opencode_timeout="$(flow_kv_get "${provider_pool_selection}" "OPENCODE_TIMEOUT_SECONDS")"
|
|
88
|
+
kilo_model="$(flow_kv_get "${provider_pool_selection}" "KILO_MODEL")"
|
|
89
|
+
kilo_timeout="$(flow_kv_get "${provider_pool_selection}" "KILO_TIMEOUT_SECONDS")"
|
|
90
|
+
else
|
|
91
|
+
if [[ -n "${explicit_coding_worker}" ]]; then
|
|
92
|
+
active_provider_selection_reason="env-override"
|
|
93
|
+
fi
|
|
94
|
+
coding_worker="$(flow_env_or_config "${config_file}" "ACP_CODING_WORKER" "execution.coding_worker" "")"
|
|
95
|
+
safe_profile="$(flow_env_or_config "${config_file}" "ACP_CODEX_PROFILE_SAFE F_LOSNING_CODEX_PROFILE_SAFE" "execution.safe_profile" "")"
|
|
96
|
+
bypass_profile="$(flow_env_or_config "${config_file}" "ACP_CODEX_PROFILE_BYPASS F_LOSNING_CODEX_PROFILE_BYPASS" "execution.bypass_profile" "")"
|
|
97
|
+
claude_model="$(flow_env_or_config "${config_file}" "ACP_CLAUDE_MODEL F_LOSNING_CLAUDE_MODEL" "execution.claude.model" "")"
|
|
98
|
+
claude_permission_mode="$(flow_env_or_config "${config_file}" "ACP_CLAUDE_PERMISSION_MODE F_LOSNING_CLAUDE_PERMISSION_MODE" "execution.claude.permission_mode" "")"
|
|
99
|
+
claude_effort="$(flow_env_or_config "${config_file}" "ACP_CLAUDE_EFFORT F_LOSNING_CLAUDE_EFFORT" "execution.claude.effort" "")"
|
|
100
|
+
claude_timeout="$(flow_env_or_config "${config_file}" "ACP_CLAUDE_TIMEOUT_SECONDS F_LOSNING_CLAUDE_TIMEOUT_SECONDS" "execution.claude.timeout_seconds" "")"
|
|
101
|
+
claude_max_attempts="$(flow_env_or_config "${config_file}" "ACP_CLAUDE_MAX_ATTEMPTS F_LOSNING_CLAUDE_MAX_ATTEMPTS" "execution.claude.max_attempts" "")"
|
|
102
|
+
claude_retry_backoff_seconds="$(flow_env_or_config "${config_file}" "ACP_CLAUDE_RETRY_BACKOFF_SECONDS F_LOSNING_CLAUDE_RETRY_BACKOFF_SECONDS" "execution.claude.retry_backoff_seconds" "")"
|
|
103
|
+
openclaw_model="$(flow_env_or_config "${config_file}" "ACP_OPENCLAW_MODEL F_LOSNING_OPENCLAW_MODEL" "execution.openclaw.model" "")"
|
|
104
|
+
openclaw_thinking="$(flow_env_or_config "${config_file}" "ACP_OPENCLAW_THINKING F_LOSNING_OPENCLAW_THINKING" "execution.openclaw.thinking" "")"
|
|
105
|
+
openclaw_timeout="$(flow_env_or_config "${config_file}" "ACP_OPENCLAW_TIMEOUT_SECONDS F_LOSNING_OPENCLAW_TIMEOUT_SECONDS" "execution.openclaw.timeout_seconds" "")"
|
|
106
|
+
openclaw_stall="$(flow_env_or_config "${config_file}" "ACP_OPENCLAW_STALL_SECONDS F_LOSNING_OPENCLAW_STALL_SECONDS" "execution.openclaw.stall_seconds" "")"
|
|
107
|
+
ollama_model="$(flow_env_or_config "${config_file}" "ACP_OLLAMA_MODEL F_LOSNING_OLLAMA_MODEL" "execution.ollama.model" "")"
|
|
108
|
+
ollama_base_url="$(flow_env_or_config "${config_file}" "ACP_OLLAMA_BASE_URL F_LOSNING_OLLAMA_BASE_URL" "execution.ollama.base_url" "")"
|
|
109
|
+
ollama_timeout="$(flow_env_or_config "${config_file}" "ACP_OLLAMA_TIMEOUT_SECONDS F_LOSNING_OLLAMA_TIMEOUT_SECONDS" "execution.ollama.timeout_seconds" "")"
|
|
110
|
+
pi_model="$(flow_env_or_config "${config_file}" "ACP_PI_MODEL F_LOSNING_PI_MODEL" "execution.pi.model" "")"
|
|
111
|
+
pi_thinking="$(flow_env_or_config "${config_file}" "ACP_PI_THINKING F_LOSNING_PI_THINKING" "execution.pi.thinking" "")"
|
|
112
|
+
pi_timeout="$(flow_env_or_config "${config_file}" "ACP_PI_TIMEOUT_SECONDS F_LOSNING_PI_TIMEOUT_SECONDS" "execution.pi.timeout_seconds" "")"
|
|
113
|
+
opencode_model="$(flow_env_or_config "${config_file}" "ACP_OPENCODE_MODEL F_LOSNING_OPENCODE_MODEL" "execution.opencode.model" "")"
|
|
114
|
+
opencode_timeout="$(flow_env_or_config "${config_file}" "ACP_OPENCODE_TIMEOUT_SECONDS F_LOSNING_OPENCODE_TIMEOUT_SECONDS" "execution.opencode.timeout_seconds" "")"
|
|
115
|
+
kilo_model="$(flow_env_or_config "${config_file}" "ACP_KILO_MODEL F_LOSNING_KILO_MODEL" "execution.kilo.model" "")"
|
|
116
|
+
kilo_timeout="$(flow_env_or_config "${config_file}" "ACP_KILO_TIMEOUT_SECONDS F_LOSNING_KILO_TIMEOUT_SECONDS" "execution.kilo.timeout_seconds" "")"
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
if [[ -n "${coding_worker}" ]]; then
|
|
120
|
+
export ACP_CODING_WORKER="${coding_worker}"
|
|
121
|
+
fi
|
|
122
|
+
if [[ -n "${repo_id}" ]]; then
|
|
123
|
+
export F_LOSNING_REPO_ID="${repo_id}"
|
|
124
|
+
export ACP_REPO_ID="${repo_id}"
|
|
125
|
+
export F_LOSNING_GITHUB_REPOSITORY_ID="${repo_id}"
|
|
126
|
+
export ACP_GITHUB_REPOSITORY_ID="${repo_id}"
|
|
127
|
+
fi
|
|
128
|
+
if [[ -n "${provider_quota_cooldowns}" ]]; then
|
|
129
|
+
export F_LOSNING_PROVIDER_QUOTA_COOLDOWNS="${provider_quota_cooldowns}"
|
|
130
|
+
export ACP_PROVIDER_QUOTA_COOLDOWNS="${provider_quota_cooldowns}"
|
|
131
|
+
fi
|
|
132
|
+
export F_LOSNING_PROVIDER_POOL_ORDER="${provider_pool_order}"
|
|
133
|
+
export ACP_PROVIDER_POOL_ORDER="${provider_pool_order}"
|
|
134
|
+
export F_LOSNING_ACTIVE_PROVIDER_POOL_NAME="${active_provider_pool_name}"
|
|
135
|
+
export ACP_ACTIVE_PROVIDER_POOL_NAME="${active_provider_pool_name}"
|
|
136
|
+
export F_LOSNING_ACTIVE_PROVIDER_BACKEND="${active_provider_backend}"
|
|
137
|
+
export ACP_ACTIVE_PROVIDER_BACKEND="${active_provider_backend}"
|
|
138
|
+
export F_LOSNING_ACTIVE_PROVIDER_MODEL="${active_provider_model}"
|
|
139
|
+
export ACP_ACTIVE_PROVIDER_MODEL="${active_provider_model}"
|
|
140
|
+
export F_LOSNING_ACTIVE_PROVIDER_KEY="${active_provider_key}"
|
|
141
|
+
export ACP_ACTIVE_PROVIDER_KEY="${active_provider_key}"
|
|
142
|
+
export F_LOSNING_PROVIDER_POOLS_EXHAUSTED="${active_provider_pools_exhausted}"
|
|
143
|
+
export ACP_PROVIDER_POOLS_EXHAUSTED="${active_provider_pools_exhausted}"
|
|
144
|
+
export F_LOSNING_PROVIDER_POOL_SELECTION_REASON="${active_provider_selection_reason}"
|
|
145
|
+
export ACP_PROVIDER_POOL_SELECTION_REASON="${active_provider_selection_reason}"
|
|
146
|
+
export F_LOSNING_PROVIDER_POOL_NEXT_ATTEMPT_EPOCH="${active_provider_next_attempt_epoch}"
|
|
147
|
+
export ACP_PROVIDER_POOL_NEXT_ATTEMPT_EPOCH="${active_provider_next_attempt_epoch}"
|
|
148
|
+
export F_LOSNING_PROVIDER_POOL_NEXT_ATTEMPT_AT="${active_provider_next_attempt_at}"
|
|
149
|
+
export ACP_PROVIDER_POOL_NEXT_ATTEMPT_AT="${active_provider_next_attempt_at}"
|
|
150
|
+
export F_LOSNING_PROVIDER_POOL_LAST_REASON="${active_provider_last_reason}"
|
|
151
|
+
export ACP_PROVIDER_POOL_LAST_REASON="${active_provider_last_reason}"
|
|
152
|
+
if [[ -n "${safe_profile}" ]]; then
|
|
153
|
+
export F_LOSNING_CODEX_PROFILE_SAFE="${safe_profile}"
|
|
154
|
+
export ACP_CODEX_PROFILE_SAFE="${safe_profile}"
|
|
155
|
+
fi
|
|
156
|
+
if [[ -n "${bypass_profile}" ]]; then
|
|
157
|
+
export F_LOSNING_CODEX_PROFILE_BYPASS="${bypass_profile}"
|
|
158
|
+
export ACP_CODEX_PROFILE_BYPASS="${bypass_profile}"
|
|
159
|
+
fi
|
|
160
|
+
if [[ -n "${claude_model}" ]]; then
|
|
161
|
+
export F_LOSNING_CLAUDE_MODEL="${claude_model}"
|
|
162
|
+
export ACP_CLAUDE_MODEL="${claude_model}"
|
|
163
|
+
fi
|
|
164
|
+
if [[ -n "${claude_permission_mode}" ]]; then
|
|
165
|
+
export F_LOSNING_CLAUDE_PERMISSION_MODE="${claude_permission_mode}"
|
|
166
|
+
export ACP_CLAUDE_PERMISSION_MODE="${claude_permission_mode}"
|
|
167
|
+
fi
|
|
168
|
+
if [[ -n "${claude_effort}" ]]; then
|
|
169
|
+
export F_LOSNING_CLAUDE_EFFORT="${claude_effort}"
|
|
170
|
+
export ACP_CLAUDE_EFFORT="${claude_effort}"
|
|
171
|
+
fi
|
|
172
|
+
if [[ -n "${claude_timeout}" ]]; then
|
|
173
|
+
export F_LOSNING_CLAUDE_TIMEOUT_SECONDS="${claude_timeout}"
|
|
174
|
+
export ACP_CLAUDE_TIMEOUT_SECONDS="${claude_timeout}"
|
|
175
|
+
fi
|
|
176
|
+
if [[ -n "${claude_max_attempts}" ]]; then
|
|
177
|
+
export F_LOSNING_CLAUDE_MAX_ATTEMPTS="${claude_max_attempts}"
|
|
178
|
+
export ACP_CLAUDE_MAX_ATTEMPTS="${claude_max_attempts}"
|
|
179
|
+
fi
|
|
180
|
+
if [[ -n "${claude_retry_backoff_seconds}" ]]; then
|
|
181
|
+
export F_LOSNING_CLAUDE_RETRY_BACKOFF_SECONDS="${claude_retry_backoff_seconds}"
|
|
182
|
+
export ACP_CLAUDE_RETRY_BACKOFF_SECONDS="${claude_retry_backoff_seconds}"
|
|
183
|
+
fi
|
|
184
|
+
if [[ -n "${openclaw_model}" ]]; then
|
|
185
|
+
export F_LOSNING_OPENCLAW_MODEL="${openclaw_model}"
|
|
186
|
+
export ACP_OPENCLAW_MODEL="${openclaw_model}"
|
|
187
|
+
fi
|
|
188
|
+
if [[ -n "${openclaw_thinking}" ]]; then
|
|
189
|
+
export F_LOSNING_OPENCLAW_THINKING="${openclaw_thinking}"
|
|
190
|
+
export ACP_OPENCLAW_THINKING="${openclaw_thinking}"
|
|
191
|
+
fi
|
|
192
|
+
if [[ -n "${openclaw_timeout}" ]]; then
|
|
193
|
+
export F_LOSNING_OPENCLAW_TIMEOUT_SECONDS="${openclaw_timeout}"
|
|
194
|
+
export ACP_OPENCLAW_TIMEOUT_SECONDS="${openclaw_timeout}"
|
|
195
|
+
fi
|
|
196
|
+
if [[ -n "${openclaw_stall}" ]]; then
|
|
197
|
+
export F_LOSNING_OPENCLAW_STALL_SECONDS="${openclaw_stall}"
|
|
198
|
+
export ACP_OPENCLAW_STALL_SECONDS="${openclaw_stall}"
|
|
199
|
+
fi
|
|
200
|
+
if [[ -n "${ollama_model}" ]]; then
|
|
201
|
+
export F_LOSNING_OLLAMA_MODEL="${ollama_model}"
|
|
202
|
+
export ACP_OLLAMA_MODEL="${ollama_model}"
|
|
203
|
+
fi
|
|
204
|
+
if [[ -n "${ollama_base_url}" ]]; then
|
|
205
|
+
export F_LOSNING_OLLAMA_BASE_URL="${ollama_base_url}"
|
|
206
|
+
export ACP_OLLAMA_BASE_URL="${ollama_base_url}"
|
|
207
|
+
fi
|
|
208
|
+
if [[ -n "${ollama_timeout}" ]]; then
|
|
209
|
+
export F_LOSNING_OLLAMA_TIMEOUT_SECONDS="${ollama_timeout}"
|
|
210
|
+
export ACP_OLLAMA_TIMEOUT_SECONDS="${ollama_timeout}"
|
|
211
|
+
fi
|
|
212
|
+
if [[ -n "${pi_model}" ]]; then
|
|
213
|
+
export F_LOSNING_PI_MODEL="${pi_model}"
|
|
214
|
+
export ACP_PI_MODEL="${pi_model}"
|
|
215
|
+
fi
|
|
216
|
+
if [[ -n "${pi_thinking}" ]]; then
|
|
217
|
+
export F_LOSNING_PI_THINKING="${pi_thinking}"
|
|
218
|
+
export ACP_PI_THINKING="${pi_thinking}"
|
|
219
|
+
fi
|
|
220
|
+
if [[ -n "${pi_timeout}" ]]; then
|
|
221
|
+
export F_LOSNING_PI_TIMEOUT_SECONDS="${pi_timeout}"
|
|
222
|
+
export ACP_PI_TIMEOUT_SECONDS="${pi_timeout}"
|
|
223
|
+
fi
|
|
224
|
+
if [[ -n "${opencode_model}" ]]; then
|
|
225
|
+
export F_LOSNING_OPENCODE_MODEL="${opencode_model}"
|
|
226
|
+
export ACP_OPENCODE_MODEL="${opencode_model}"
|
|
227
|
+
fi
|
|
228
|
+
if [[ -n "${opencode_timeout}" ]]; then
|
|
229
|
+
export F_LOSNING_OPENCODE_TIMEOUT_SECONDS="${opencode_timeout}"
|
|
230
|
+
export ACP_OPENCODE_TIMEOUT_SECONDS="${opencode_timeout}"
|
|
231
|
+
fi
|
|
232
|
+
if [[ -n "${kilo_model}" ]]; then
|
|
233
|
+
export F_LOSNING_KILO_MODEL="${kilo_model}"
|
|
234
|
+
export ACP_KILO_MODEL="${kilo_model}"
|
|
235
|
+
fi
|
|
236
|
+
if [[ -n "${kilo_timeout}" ]]; then
|
|
237
|
+
export F_LOSNING_KILO_TIMEOUT_SECONDS="${kilo_timeout}"
|
|
238
|
+
export ACP_KILO_TIMEOUT_SECONDS="${kilo_timeout}"
|
|
239
|
+
fi
|
|
240
|
+
|
|
241
|
+
flow_export_github_cli_auth_env "$(flow_resolve_repo_slug "${config_file}")"
|
|
242
|
+
flow_export_project_env_aliases
|
|
243
|
+
}
|