abstractcode 0.1.0__py3-none-any.whl → 0.3.0__py3-none-any.whl
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.
- abstractcode/__init__.py +6 -37
- abstractcode/cli.py +401 -0
- abstractcode/flow_cli.py +1413 -0
- abstractcode/fullscreen_ui.py +1453 -0
- abstractcode/input_handler.py +81 -0
- abstractcode/py.typed +1 -0
- abstractcode/react_shell.py +6440 -0
- abstractcode/recall.py +384 -0
- abstractcode/remember.py +184 -0
- abstractcode/terminal_markdown.py +168 -0
- abstractcode/workflow_agent.py +894 -0
- abstractcode-0.3.0.dist-info/METADATA +270 -0
- abstractcode-0.3.0.dist-info/RECORD +17 -0
- abstractcode-0.1.0.dist-info/METADATA +0 -114
- abstractcode-0.1.0.dist-info/RECORD +0 -7
- {abstractcode-0.1.0.dist-info → abstractcode-0.3.0.dist-info}/WHEEL +0 -0
- {abstractcode-0.1.0.dist-info → abstractcode-0.3.0.dist-info}/entry_points.txt +0 -0
- {abstractcode-0.1.0.dist-info → abstractcode-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {abstractcode-0.1.0.dist-info → abstractcode-0.3.0.dist-info}/top_level.txt +0 -0
abstractcode/__init__.py
CHANGED
|
@@ -9,46 +9,15 @@ Email: contact@abstractcore.ai
|
|
|
9
9
|
Website: https://abstractcore.ai
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
__version__ = "0.
|
|
12
|
+
__version__ = "0.2.0"
|
|
13
13
|
__author__ = "Laurent-Philippe Albou"
|
|
14
14
|
__email__ = "contact@abstractcore.ai"
|
|
15
15
|
__license__ = "MIT"
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"__author__",
|
|
21
|
-
"__email__",
|
|
22
|
-
"__license__",
|
|
23
|
-
"main",
|
|
24
|
-
]
|
|
17
|
+
def main(argv=None):
|
|
18
|
+
"""Console entrypoint for `abstractcode`."""
|
|
19
|
+
from .cli import main as _main
|
|
25
20
|
|
|
21
|
+
return _main(argv)
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
"""
|
|
29
|
-
Main entry point for the AbstractCode CLI.
|
|
30
|
-
|
|
31
|
-
This is a placeholder implementation. Full functionality coming soon.
|
|
32
|
-
"""
|
|
33
|
-
print(f"AbstractCode v{__version__}")
|
|
34
|
-
print("=" * 50)
|
|
35
|
-
print("🚧 Under Development")
|
|
36
|
-
print("=" * 50)
|
|
37
|
-
print()
|
|
38
|
-
print("AbstractCode is currently under active development.")
|
|
39
|
-
print("This is a placeholder release.")
|
|
40
|
-
print()
|
|
41
|
-
print("Stay tuned for updates!")
|
|
42
|
-
print()
|
|
43
|
-
print("Built on the Abstract Framework:")
|
|
44
|
-
print(" • AbstractCore: https://github.com/lpalbou/abstractcore")
|
|
45
|
-
print(" • AbstractRuntime: https://github.com/lpalbou/abstractruntime")
|
|
46
|
-
print(" • AbstractAgent: https://github.com/lpalbou/abstractagent")
|
|
47
|
-
print()
|
|
48
|
-
print(f"Contact: {__email__}")
|
|
49
|
-
print("Website: https://abstractcore.ai")
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if __name__ == "__main__":
|
|
53
|
-
main()
|
|
54
|
-
|
|
23
|
+
__all__ = ["__version__", "__author__", "__email__", "__license__", "main"]
|
abstractcode/cli.py
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Optional, Sequence
|
|
8
|
+
|
|
9
|
+
from .react_shell import ReactShell
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _default_state_file() -> str:
|
|
13
|
+
env = os.getenv("ABSTRACTCODE_STATE_FILE")
|
|
14
|
+
if env:
|
|
15
|
+
return env
|
|
16
|
+
return str(Path.home() / ".abstractcode" / "state.json")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _default_max_iterations() -> int:
|
|
20
|
+
env = os.getenv("ABSTRACTCODE_MAX_ITERATIONS")
|
|
21
|
+
if env:
|
|
22
|
+
try:
|
|
23
|
+
value = int(env)
|
|
24
|
+
except ValueError:
|
|
25
|
+
raise SystemExit("ABSTRACTCODE_MAX_ITERATIONS must be an integer.")
|
|
26
|
+
if value < 1:
|
|
27
|
+
raise SystemExit("ABSTRACTCODE_MAX_ITERATIONS must be >= 1.")
|
|
28
|
+
return value
|
|
29
|
+
return 25
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _default_max_tokens() -> Optional[int]:
|
|
33
|
+
env = os.getenv("ABSTRACTCODE_MAX_TOKENS")
|
|
34
|
+
if env:
|
|
35
|
+
try:
|
|
36
|
+
value = int(env)
|
|
37
|
+
except ValueError:
|
|
38
|
+
raise SystemExit("ABSTRACTCODE_MAX_TOKENS must be an integer.")
|
|
39
|
+
if value != -1 and value < 1024:
|
|
40
|
+
raise SystemExit("ABSTRACTCODE_MAX_TOKENS must be -1 (auto) or >= 1024.")
|
|
41
|
+
return value
|
|
42
|
+
return -1 # Auto (use model capabilities)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def build_agent_parser() -> argparse.ArgumentParser:
|
|
46
|
+
parser = argparse.ArgumentParser(
|
|
47
|
+
prog="abstractcode",
|
|
48
|
+
description="AbstractCode: an interactive terminal shell for AbstractFramework (agents + workflows).",
|
|
49
|
+
epilog=(
|
|
50
|
+
"Workflows:\n"
|
|
51
|
+
" abstractcode flow --help Run AbstractFlow workflows from the terminal\n"
|
|
52
|
+
"REPL:\n"
|
|
53
|
+
" Use /flow inside the REPL to run workflows while keeping chat context.\n"
|
|
54
|
+
),
|
|
55
|
+
formatter_class=argparse.RawTextHelpFormatter,
|
|
56
|
+
)
|
|
57
|
+
parser.add_argument(
|
|
58
|
+
"--agent",
|
|
59
|
+
default=os.getenv("ABSTRACTCODE_AGENT", "react"),
|
|
60
|
+
help=(
|
|
61
|
+
"Agent selector:\n"
|
|
62
|
+
" - Built-ins: react | codeact | memact\n"
|
|
63
|
+
" - Workflow agent: <flow_id> | <flow_name> | </path/to/flow.json>\n"
|
|
64
|
+
" (must implement interface 'abstractcode.agent.v1')"
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
parser.add_argument("--provider", default="ollama", help="LLM provider (e.g. ollama, openai)")
|
|
68
|
+
parser.add_argument("--model", default="qwen3:1.7b-q4_K_M", help="Model name")
|
|
69
|
+
parser.add_argument(
|
|
70
|
+
"--base-url",
|
|
71
|
+
default=os.getenv("ABSTRACTCODE_BASE_URL"),
|
|
72
|
+
help="Provider base URL (e.g. http://localhost:1234/v1). Also supports ABSTRACTCODE_BASE_URL.",
|
|
73
|
+
)
|
|
74
|
+
parser.add_argument(
|
|
75
|
+
"--state-file",
|
|
76
|
+
default=_default_state_file(),
|
|
77
|
+
help="Path to save the current run reference (enables durable file-backed stores).",
|
|
78
|
+
)
|
|
79
|
+
parser.add_argument(
|
|
80
|
+
"--no-state",
|
|
81
|
+
action="store_true",
|
|
82
|
+
help="Disable persistence (keeps run state in memory; cannot resume after quitting).",
|
|
83
|
+
)
|
|
84
|
+
parser.add_argument(
|
|
85
|
+
"--auto-approve",
|
|
86
|
+
"--auto-accept",
|
|
87
|
+
action="store_true",
|
|
88
|
+
dest="auto_approve",
|
|
89
|
+
help="Automatically approve tool calls (unsafe; disables interactive approvals).",
|
|
90
|
+
)
|
|
91
|
+
parser.add_argument(
|
|
92
|
+
"--plan",
|
|
93
|
+
action="store_true",
|
|
94
|
+
help="Enable Plan mode (agent generates a TODO plan before acting).",
|
|
95
|
+
)
|
|
96
|
+
parser.add_argument(
|
|
97
|
+
"--review",
|
|
98
|
+
action="store_true",
|
|
99
|
+
dest="review",
|
|
100
|
+
help="Enable verifier mode (default: enabled).",
|
|
101
|
+
)
|
|
102
|
+
parser.add_argument(
|
|
103
|
+
"--no-review",
|
|
104
|
+
action="store_false",
|
|
105
|
+
dest="review",
|
|
106
|
+
help="Disable verifier mode (not recommended).",
|
|
107
|
+
)
|
|
108
|
+
parser.set_defaults(review=True)
|
|
109
|
+
parser.add_argument(
|
|
110
|
+
"--review-max-rounds",
|
|
111
|
+
type=int,
|
|
112
|
+
default=3,
|
|
113
|
+
help="Max verifier rounds per task (default: 3).",
|
|
114
|
+
)
|
|
115
|
+
parser.add_argument(
|
|
116
|
+
"--max-iterations",
|
|
117
|
+
type=int,
|
|
118
|
+
default=_default_max_iterations(),
|
|
119
|
+
help="Maximum ReAct reasoning iterations per task (default: 25).",
|
|
120
|
+
)
|
|
121
|
+
parser.add_argument(
|
|
122
|
+
"--max-tokens",
|
|
123
|
+
type=int,
|
|
124
|
+
default=_default_max_tokens(),
|
|
125
|
+
help="Maximum context tokens for LLM calls (-1 = auto from model capabilities).",
|
|
126
|
+
)
|
|
127
|
+
parser.add_argument("--no-color", action="store_true", help="Disable ANSI colors")
|
|
128
|
+
return parser
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def build_flow_parser() -> argparse.ArgumentParser:
|
|
132
|
+
parser = argparse.ArgumentParser(
|
|
133
|
+
prog="abstractcode flow",
|
|
134
|
+
description="Run AbstractFlow visual workflows from AbstractCode.",
|
|
135
|
+
)
|
|
136
|
+
sub = parser.add_subparsers(dest="command")
|
|
137
|
+
|
|
138
|
+
run = sub.add_parser("run", help="Start a new flow run")
|
|
139
|
+
run.add_argument("flow", help="Flow id (from flows dir) or path to a VisualFlow .json file")
|
|
140
|
+
run.add_argument("--flows-dir", default=None, help="Directory containing VisualFlow JSON files")
|
|
141
|
+
run.add_argument(
|
|
142
|
+
"--input-json",
|
|
143
|
+
default=None,
|
|
144
|
+
help='JSON object string passed to the flow entry (e.g. \'{"query":"..."}\')',
|
|
145
|
+
)
|
|
146
|
+
run.add_argument(
|
|
147
|
+
"--input-file",
|
|
148
|
+
"--input-json-file",
|
|
149
|
+
dest="input_file",
|
|
150
|
+
default=None,
|
|
151
|
+
help="Path to a JSON file (object) passed to the flow entry",
|
|
152
|
+
)
|
|
153
|
+
run.add_argument(
|
|
154
|
+
"--param",
|
|
155
|
+
action="append",
|
|
156
|
+
default=[],
|
|
157
|
+
help="Set an input param as key=value (repeatable). Example: --param max_web_search=15",
|
|
158
|
+
)
|
|
159
|
+
run.add_argument(
|
|
160
|
+
"--flow-state-file",
|
|
161
|
+
default=None,
|
|
162
|
+
help="Path to store the last flow run reference (default: ~/.abstractcode/flow_state.json).",
|
|
163
|
+
)
|
|
164
|
+
run.add_argument("--no-state", action="store_true", help="Disable persistence (cannot resume after quitting).")
|
|
165
|
+
run.add_argument(
|
|
166
|
+
"--auto-approve",
|
|
167
|
+
"--accept-tools",
|
|
168
|
+
"--auto-accept",
|
|
169
|
+
action="store_true",
|
|
170
|
+
dest="auto_approve",
|
|
171
|
+
help="Automatically approve tool calls (unsafe; disables interactive approvals).",
|
|
172
|
+
)
|
|
173
|
+
run.add_argument(
|
|
174
|
+
"--verbosity",
|
|
175
|
+
choices=("none", "default", "full"),
|
|
176
|
+
default="default",
|
|
177
|
+
help="Observability level: none|default|full (default: default).",
|
|
178
|
+
)
|
|
179
|
+
run.add_argument(
|
|
180
|
+
"--wait-until",
|
|
181
|
+
action="store_true",
|
|
182
|
+
help="If waiting on a time-based event (WAIT_UNTIL), keep sleeping and resuming automatically.",
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
resume = sub.add_parser("resume", help="Resume the last saved flow run and drive until it blocks again")
|
|
186
|
+
resume.add_argument(
|
|
187
|
+
"--flow-state-file",
|
|
188
|
+
default=None,
|
|
189
|
+
help="Path to the saved run reference (default: ~/.abstractcode/flow_state.json).",
|
|
190
|
+
)
|
|
191
|
+
resume.add_argument(
|
|
192
|
+
"--auto-approve",
|
|
193
|
+
"--accept-tools",
|
|
194
|
+
"--auto-accept",
|
|
195
|
+
action="store_true",
|
|
196
|
+
dest="auto_approve",
|
|
197
|
+
help="Automatically approve tool calls (unsafe; disables interactive approvals).",
|
|
198
|
+
)
|
|
199
|
+
resume.add_argument(
|
|
200
|
+
"--verbosity",
|
|
201
|
+
choices=("none", "default", "full"),
|
|
202
|
+
default="default",
|
|
203
|
+
help="Observability level: none|default|full (default: default).",
|
|
204
|
+
)
|
|
205
|
+
resume.add_argument(
|
|
206
|
+
"--wait-until",
|
|
207
|
+
action="store_true",
|
|
208
|
+
help="If waiting on a time-based event (WAIT_UNTIL), keep sleeping and resuming automatically.",
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
pause = sub.add_parser("pause", help="Pause the last saved flow run (best-effort includes descendants)")
|
|
212
|
+
pause.add_argument(
|
|
213
|
+
"--flow-state-file",
|
|
214
|
+
default=None,
|
|
215
|
+
help="Path to the saved run reference (default: ~/.abstractcode/flow_state.json).",
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
resume_run = sub.add_parser("resume-run", help="Resume a previously paused run (does not advance execution)")
|
|
219
|
+
resume_run.add_argument(
|
|
220
|
+
"--flow-state-file",
|
|
221
|
+
default=None,
|
|
222
|
+
help="Path to the saved run reference (default: ~/.abstractcode/flow_state.json).",
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
cancel = sub.add_parser("cancel", help="Cancel the last saved flow run (best-effort includes descendants)")
|
|
226
|
+
cancel.add_argument(
|
|
227
|
+
"--flow-state-file",
|
|
228
|
+
default=None,
|
|
229
|
+
help="Path to the saved run reference (default: ~/.abstractcode/flow_state.json).",
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
runs = sub.add_parser("runs", help="List recent flow runs from the flow store")
|
|
233
|
+
runs.add_argument(
|
|
234
|
+
"--flow-state-file",
|
|
235
|
+
default=None,
|
|
236
|
+
help="Path to the saved run reference (default: ~/.abstractcode/flow_state.json).",
|
|
237
|
+
)
|
|
238
|
+
runs.add_argument("--limit", type=int, default=20, help="Maximum runs to show (default: 20)")
|
|
239
|
+
|
|
240
|
+
attach = sub.add_parser("attach", help="Attach to an existing flow run_id (sets the current flow_state.json ref)")
|
|
241
|
+
attach.add_argument("run_id", help="Existing run_id to attach to")
|
|
242
|
+
attach.add_argument("--flows-dir", default=None, help="Directory containing VisualFlow JSON files")
|
|
243
|
+
attach.add_argument(
|
|
244
|
+
"--flow-state-file",
|
|
245
|
+
default=None,
|
|
246
|
+
help="Path to the saved run reference (default: ~/.abstractcode/flow_state.json).",
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
emit = sub.add_parser("emit", help="Emit a custom event (or resume a raw wait_key) for the current flow session")
|
|
250
|
+
emit.add_argument("--name", default=None, help="Custom event name to emit")
|
|
251
|
+
emit.add_argument("--wait-key", default=None, help="Raw wait_key to resume (advanced)")
|
|
252
|
+
emit.add_argument("--scope", default="session", help="Event scope: session|workflow|run|global (default: session)")
|
|
253
|
+
emit.add_argument("--payload-json", default=None, help="Event payload as JSON (object preferred)")
|
|
254
|
+
emit.add_argument(
|
|
255
|
+
"--payload-file",
|
|
256
|
+
default=None,
|
|
257
|
+
help="Path to a JSON file containing the event payload",
|
|
258
|
+
)
|
|
259
|
+
emit.add_argument(
|
|
260
|
+
"--session-id",
|
|
261
|
+
default=None,
|
|
262
|
+
help="Target session id (defaults to current root run_id for session scope)",
|
|
263
|
+
)
|
|
264
|
+
emit.add_argument(
|
|
265
|
+
"--max-steps",
|
|
266
|
+
type=int,
|
|
267
|
+
default=0,
|
|
268
|
+
help="Tick budget per resumed run (default: 0; host drives execution)",
|
|
269
|
+
)
|
|
270
|
+
emit.add_argument("--flows-dir", default=None, help="Directory containing VisualFlow JSON files")
|
|
271
|
+
emit.add_argument(
|
|
272
|
+
"--flow-state-file",
|
|
273
|
+
default=None,
|
|
274
|
+
help="Path to the saved run reference (default: ~/.abstractcode/flow_state.json).",
|
|
275
|
+
)
|
|
276
|
+
emit.add_argument(
|
|
277
|
+
"--auto-approve",
|
|
278
|
+
"--accept-tools",
|
|
279
|
+
"--auto-accept",
|
|
280
|
+
action="store_true",
|
|
281
|
+
dest="auto_approve",
|
|
282
|
+
help="Automatically approve tool calls (unsafe; disables interactive approvals).",
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
return parser
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def main(argv: Optional[Sequence[str]] = None) -> int:
|
|
289
|
+
argv_list = list(argv) if argv is not None else sys.argv[1:]
|
|
290
|
+
|
|
291
|
+
if argv_list and argv_list[0] == "flow":
|
|
292
|
+
parser = build_flow_parser()
|
|
293
|
+
args, unknown = parser.parse_known_args(argv_list[1:])
|
|
294
|
+
from .flow_cli import (
|
|
295
|
+
attach_flow_run_command,
|
|
296
|
+
control_flow_command,
|
|
297
|
+
emit_flow_event_command,
|
|
298
|
+
list_flow_runs_command,
|
|
299
|
+
resume_flow_command,
|
|
300
|
+
run_flow_command,
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
cmd = getattr(args, "command", None)
|
|
304
|
+
if cmd == "run":
|
|
305
|
+
run_flow_command(
|
|
306
|
+
flow_ref=str(args.flow),
|
|
307
|
+
flows_dir=args.flows_dir,
|
|
308
|
+
input_json=args.input_json,
|
|
309
|
+
input_file=args.input_file,
|
|
310
|
+
params=list(getattr(args, "param", []) or []),
|
|
311
|
+
extra_args=list(unknown or []),
|
|
312
|
+
flow_state_file=args.flow_state_file,
|
|
313
|
+
no_state=bool(args.no_state),
|
|
314
|
+
auto_approve=bool(args.auto_approve),
|
|
315
|
+
wait_until=bool(args.wait_until),
|
|
316
|
+
verbosity=str(getattr(args, "verbosity", "default") or "default"),
|
|
317
|
+
)
|
|
318
|
+
return 0
|
|
319
|
+
if cmd == "resume":
|
|
320
|
+
if unknown:
|
|
321
|
+
parser.error(f"Unknown arguments: {' '.join(unknown)}")
|
|
322
|
+
resume_flow_command(
|
|
323
|
+
flow_state_file=args.flow_state_file,
|
|
324
|
+
no_state=False,
|
|
325
|
+
auto_approve=bool(args.auto_approve),
|
|
326
|
+
wait_until=bool(args.wait_until),
|
|
327
|
+
verbosity=str(getattr(args, "verbosity", "default") or "default"),
|
|
328
|
+
)
|
|
329
|
+
return 0
|
|
330
|
+
if cmd == "pause":
|
|
331
|
+
if unknown:
|
|
332
|
+
parser.error(f"Unknown arguments: {' '.join(unknown)}")
|
|
333
|
+
control_flow_command(action="pause", flow_state_file=args.flow_state_file)
|
|
334
|
+
return 0
|
|
335
|
+
if cmd == "resume-run":
|
|
336
|
+
if unknown:
|
|
337
|
+
parser.error(f"Unknown arguments: {' '.join(unknown)}")
|
|
338
|
+
control_flow_command(action="resume", flow_state_file=args.flow_state_file)
|
|
339
|
+
return 0
|
|
340
|
+
if cmd == "cancel":
|
|
341
|
+
if unknown:
|
|
342
|
+
parser.error(f"Unknown arguments: {' '.join(unknown)}")
|
|
343
|
+
control_flow_command(action="cancel", flow_state_file=args.flow_state_file)
|
|
344
|
+
return 0
|
|
345
|
+
if cmd == "runs":
|
|
346
|
+
if unknown:
|
|
347
|
+
parser.error(f"Unknown arguments: {' '.join(unknown)}")
|
|
348
|
+
list_flow_runs_command(flow_state_file=args.flow_state_file, limit=int(args.limit or 20))
|
|
349
|
+
return 0
|
|
350
|
+
if cmd == "attach":
|
|
351
|
+
if unknown:
|
|
352
|
+
parser.error(f"Unknown arguments: {' '.join(unknown)}")
|
|
353
|
+
attach_flow_run_command(
|
|
354
|
+
run_id=str(args.run_id),
|
|
355
|
+
flows_dir=args.flows_dir,
|
|
356
|
+
flow_state_file=args.flow_state_file,
|
|
357
|
+
)
|
|
358
|
+
return 0
|
|
359
|
+
if cmd == "emit":
|
|
360
|
+
if unknown:
|
|
361
|
+
parser.error(f"Unknown arguments: {' '.join(unknown)}")
|
|
362
|
+
emit_flow_event_command(
|
|
363
|
+
name=args.name,
|
|
364
|
+
wait_key=args.wait_key,
|
|
365
|
+
scope=args.scope,
|
|
366
|
+
payload_json=args.payload_json,
|
|
367
|
+
payload_file=args.payload_file,
|
|
368
|
+
session_id=args.session_id,
|
|
369
|
+
max_steps=int(args.max_steps or 0),
|
|
370
|
+
flows_dir=args.flows_dir,
|
|
371
|
+
flow_state_file=args.flow_state_file,
|
|
372
|
+
auto_approve=bool(args.auto_approve),
|
|
373
|
+
)
|
|
374
|
+
return 0
|
|
375
|
+
|
|
376
|
+
build_flow_parser().print_help()
|
|
377
|
+
return 2
|
|
378
|
+
|
|
379
|
+
args = build_agent_parser().parse_args(argv_list)
|
|
380
|
+
state_file = None if args.no_state else args.state_file
|
|
381
|
+
|
|
382
|
+
shell = ReactShell(
|
|
383
|
+
agent=str(args.agent),
|
|
384
|
+
provider=args.provider,
|
|
385
|
+
model=args.model,
|
|
386
|
+
base_url=getattr(args, "base_url", None),
|
|
387
|
+
state_file=state_file,
|
|
388
|
+
auto_approve=bool(args.auto_approve),
|
|
389
|
+
plan_mode=bool(args.plan),
|
|
390
|
+
review_mode=bool(args.review),
|
|
391
|
+
review_max_rounds=int(args.review_max_rounds),
|
|
392
|
+
max_iterations=int(args.max_iterations),
|
|
393
|
+
max_tokens=args.max_tokens,
|
|
394
|
+
color=not bool(args.no_color),
|
|
395
|
+
)
|
|
396
|
+
shell.run()
|
|
397
|
+
return 0
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
if __name__ == "__main__":
|
|
401
|
+
raise SystemExit(main(sys.argv[1:]))
|