codex-agent-framework 0.1.12__tar.gz → 0.1.14__tar.gz

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.
Files changed (98) hide show
  1. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/CHANGELOG.md +28 -0
  2. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/MANIFEST.in +2 -0
  3. {codex_agent_framework-0.1.12/codex_agent_framework.egg-info → codex_agent_framework-0.1.14}/PKG-INFO +35 -5
  4. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/README.md +32 -4
  5. codex_agent_framework-0.1.14/codex_agent/__init__.py +138 -0
  6. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/__main__.py +54 -5
  7. codex_agent_framework-0.1.14/codex_agent/agent.py +433 -0
  8. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/agent_runtime.py +60 -24
  9. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/ai.py +29 -6
  10. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/builtin_commands.py +6 -5
  11. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/__init__.py +10 -0
  12. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/browser/__init__.py +216 -0
  13. codex_agent_framework-0.1.12/codex_agent/browser.py → codex_agent_framework-0.1.14/codex_agent/builtin_plugins/browser/controller.py +101 -22
  14. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/desktop/__init__.py +417 -0
  15. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/desktop/controller.py +434 -0
  16. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/desktop/screenshot.py +44 -0
  17. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/memory/__init__.py +214 -0
  18. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/planner/__init__.py +266 -0
  19. codex_agent_framework-0.1.14/codex_agent/builtin_plugins/scheduler/__init__.py +163 -0
  20. codex_agent_framework-0.1.14/codex_agent/builtin_providers.py +17 -0
  21. codex_agent_framework-0.1.14/codex_agent/builtin_tools/__init__.py +58 -0
  22. codex_agent_framework-0.1.14/codex_agent/builtin_tools/files.py +295 -0
  23. codex_agent_framework-0.1.14/codex_agent/builtin_tools/server_tools.py +4 -0
  24. codex_agent_framework-0.1.14/codex_agent/builtin_tools/shell.py +61 -0
  25. codex_agent_framework-0.1.14/codex_agent/builtin_tools/system.py +72 -0
  26. codex_agent_framework-0.1.14/codex_agent/builtin_tools/vision.py +206 -0
  27. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/chat.py +68 -26
  28. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/client.py +11 -4
  29. codex_agent_framework-0.1.14/codex_agent/command.py +240 -0
  30. codex_agent_framework-0.1.14/codex_agent/config.py +137 -0
  31. codex_agent_framework-0.1.14/codex_agent/context.py +236 -0
  32. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/event.py +13 -0
  33. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/get_text/get_text.py +10 -10
  34. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/get_text/simpler_get_text.py +0 -1
  35. codex_agent_framework-0.1.14/codex_agent/hooks.py +71 -0
  36. codex_agent_framework-0.1.14/codex_agent/mainloop.py +400 -0
  37. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/message.py +6 -0
  38. codex_agent_framework-0.1.14/codex_agent/plugin.py +116 -0
  39. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/prompts/system_prompt.txt +1 -14
  40. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/provider.py +4 -1
  41. codex_agent_framework-0.1.14/codex_agent/registry.py +197 -0
  42. codex_agent_framework-0.1.14/codex_agent/runtime.py +34 -0
  43. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/scheduler.py +20 -11
  44. codex_agent_framework-0.1.14/codex_agent/scripts/install-system-dependencies.sh +149 -0
  45. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/server.py +34 -12
  46. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/service.py +3 -2
  47. codex_agent_framework-0.1.14/codex_agent/sessions.py +396 -0
  48. codex_agent_framework-0.1.14/codex_agent/status.py +257 -0
  49. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/stream_utils.py +26 -10
  50. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/tool.py +20 -1
  51. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/tray.py +62 -1
  52. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/utils.py +35 -8
  53. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/voice.py +13 -25
  54. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14/codex_agent_framework.egg-info}/PKG-INFO +35 -5
  55. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent_framework.egg-info/SOURCES.txt +29 -2
  56. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent_framework.egg-info/requires.txt +2 -0
  57. codex_agent_framework-0.1.14/dependencies.txt +88 -0
  58. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/pyproject.toml +4 -2
  59. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_agent.py +995 -82
  60. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_browser.py +64 -3
  61. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_chat.py +83 -23
  62. codex_agent_framework-0.1.14/tests/test_cli.py +139 -0
  63. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_client.py +22 -4
  64. codex_agent_framework-0.1.14/tests/test_hooks.py +188 -0
  65. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_image_message.py +25 -36
  66. codex_agent_framework-0.1.14/tests/test_local_desktop.py +147 -0
  67. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_memory.py +106 -8
  68. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_messages.py +21 -5
  69. codex_agent_framework-0.1.14/tests/test_planner.py +133 -0
  70. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_scheduler.py +6 -5
  71. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_server.py +123 -19
  72. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_service.py +3 -1
  73. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_tray.py +35 -0
  74. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_utils.py +48 -2
  75. codex_agent_framework-0.1.12/codex_agent/__init__.py +0 -51
  76. codex_agent_framework-0.1.12/codex_agent/agent.py +0 -1965
  77. codex_agent_framework-0.1.12/codex_agent/builtin_providers.py +0 -74
  78. codex_agent_framework-0.1.12/codex_agent/builtin_tools.py +0 -770
  79. codex_agent_framework-0.1.12/codex_agent/command.py +0 -19
  80. codex_agent_framework-0.1.12/tests/test_cli.py +0 -65
  81. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/LICENSE +0 -0
  82. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/get_text/__init__.py +0 -0
  83. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/get_text/default_gitignore +0 -0
  84. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/image.py +0 -0
  85. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/latex.py +0 -0
  86. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/memory.py +0 -0
  87. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/prompts/image_generation_system_prompt.txt +0 -0
  88. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/tui.py +0 -0
  89. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent/worker.py +0 -0
  90. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent_framework.egg-info/dependency_links.txt +0 -0
  91. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent_framework.egg-info/entry_points.txt +0 -0
  92. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/codex_agent_framework.egg-info/top_level.txt +0 -0
  93. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/setup.cfg +0 -0
  94. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_ai.py +0 -0
  95. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_events.py +0 -0
  96. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_get_text_browser.py +0 -0
  97. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_tui.py +0 -0
  98. {codex_agent_framework-0.1.12 → codex_agent_framework-0.1.14}/tests/test_worker.py +0 -0
@@ -4,6 +4,34 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This project loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and uses semantic versioning where practical.
6
6
 
7
+ ## [0.1.14] - 2026-05-07
8
+ ### Added
9
+ - Add a general `HookManager` with compatibility helpers and hook sites around message submission, commands, context/provider calls, runtime module loading, tool calls, shell execution, and file write/edit operations.
10
+ - Add planner and scheduler built-in plugins with atomic JSON persistence safeguards.
11
+ - Add `dependencies.txt` documenting non-Python system dependencies for browser, desktop, tray, service, TUI terminal, and audio features.
12
+ - Add packaged system dependency installation via `codex-agent install-system-deps` and a higher-level `codex-agent bootstrap` command that can install system dependencies then install/start the user services.
13
+
14
+ ### Changed
15
+ - Improve TUI SSE replay/reconnect handling so replayed deltas are rendered as a compact catch-up while live deltas continue streaming normally.
16
+ - Keep the TUI reconnection status concise by reporting one offline message per outage and a connected message on recovery.
17
+
18
+ ### Fixed
19
+ - Fix SSE cursor tracking so client replay state advances only from real sequenced events, avoiding missed events after reconnects.
20
+ - Surface asynchronous memory archive failures through `MemoryArchiveErrorEvent` instead of swallowing them silently.
21
+ - Clarify scheduler wakeup trigger event data around `turn_id` while preserving backward compatibility.
22
+
23
+ ### Tests
24
+ - Expand regression coverage for hooks, planner schema/loading, scheduler persistence, TUI reconnect/replay behavior, CLI bootstrap/system dependency commands, and memory archive errors.
25
+ - Validate the full suite at 412 passing tests.
26
+
27
+ ## [0.1.13] - 2026-05-07
28
+ ### Changed
29
+ - Reorganize built-in tools into a `codex_agent.builtin_tools` package with separate modules for file, shell, vision, system, and server-tool responsibilities.
30
+ - Keep the public `codex_agent.builtin_tools` import surface compatible by re-exporting the existing built-in tools and helpers from the package initializer.
31
+
32
+ ### Tests
33
+ - Update built-in tool regression coverage for the package layout and validate the full suite at 376 passing tests.
34
+
7
35
  ## [0.1.12] - 2026-05-05
8
36
  ### Added
9
37
  - Add a persistent Playwright/Chromium browser controller with tools to open/close the browser, select tabs, navigate, click, fill, select options, press keys, inspect action snapshots, and capture screenshots.
@@ -3,5 +3,7 @@ include LICENSE
3
3
  include CHANGELOG.md
4
4
  recursive-include codex_agent/prompts *.txt
5
5
  include codex_agent/get_text/default_gitignore
6
+ recursive-include codex_agent/scripts *.sh
7
+ include dependencies.txt
6
8
  recursive-exclude * __pycache__
7
9
  recursive-exclude * *.py[co]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codex-agent-framework
3
- Version: 0.1.12
3
+ Version: 0.1.14
4
4
  Summary: A lightweight event-driven Codex agent runtime.
5
5
  Author: Baptiste
6
6
  License-Expression: MIT
@@ -21,6 +21,7 @@ Requires-Dist: codex-backend-sdk
21
21
  Requires-Dist: fastapi
22
22
  Requires-Dist: filetype
23
23
  Requires-Dist: modict
24
+ Requires-Dist: mss
24
25
  Requires-Dist: numpy
25
26
  Requires-Dist: odfpy
26
27
  Requires-Dist: openai
@@ -31,6 +32,7 @@ Requires-Dist: playwright
31
32
  Requires-Dist: pydub
32
33
  Requires-Dist: pypdf
33
34
  Requires-Dist: pynteract
35
+ Requires-Dist: pywinctl
34
36
  Requires-Dist: python-docx
35
37
  Requires-Dist: PyYAML
36
38
  Requires-Dist: regex
@@ -72,7 +74,9 @@ It provides a reusable `Agent` abstraction with persistent sessions, local tools
72
74
  - Python 3.10 or newer.
73
75
  - A working model backend configuration compatible with `codex-backend-sdk` / OpenAI usage.
74
76
  - GTK 3 plus Ayatana AppIndicator or AppIndicator bindings are needed for the tray controller on Linux.
75
- - Playwright's managed Chromium browser is used for rendered web extraction when static fetching is insufficient. Install it with `python -m playwright install chromium` if needed.
77
+ - Desktop automation on Linux/X11 uses explicit system tools: `wmctrl`, `xdotool`, and `xclip`.
78
+ - Playwright's managed Chromium browser is used for rendered web extraction when static fetching is insufficient.
79
+ - See `dependencies.txt` for the full list of optional non-Python system dependencies.
76
80
 
77
81
  ## Installation
78
82
 
@@ -88,6 +92,26 @@ For development:
88
92
  python -m pip install -e '.[dev]'
89
93
  ```
90
94
 
95
+ Install optional Linux system dependencies for browser, desktop, tray, service, terminal, and audio features:
96
+
97
+ ```bash
98
+ codex-agent install-system-deps -- -y
99
+ ```
100
+
101
+ Or bootstrap a local desktop setup by installing system dependencies and then installing/starting the user services:
102
+
103
+ ```bash
104
+ codex-agent bootstrap -- -y
105
+ ```
106
+
107
+ Useful bootstrap variants:
108
+
109
+ ```bash
110
+ codex-agent bootstrap --no-system-deps
111
+ codex-agent bootstrap --no-start-service -- -y
112
+ codex-agent install-system-deps -- --dry-run --no-tray --no-audio
113
+ ```
114
+
91
115
  ## Quick start
92
116
 
93
117
  Run the local server plus terminal TUI:
@@ -120,6 +144,8 @@ Install the user services for the server and tray controller:
120
144
  codex-agent install-service
121
145
  ```
122
146
 
147
+ For a first-time Linux desktop setup, `codex-agent bootstrap -- -y` combines optional system dependency installation with service installation/startup. The command forwards arguments after `--` to the system dependency installer.
148
+
123
149
  Or use the agent from Python:
124
150
 
125
151
  ```python
@@ -361,9 +387,11 @@ Configuration is persisted to `agent_config.json` in the runtime directory when
361
387
  ```text
362
388
  codex_agent/ Python package
363
389
  codex_agent/agent.py Agent, AgentConfig, AgentSession
364
- codex_agent/builtin_tools.py Built-in local tools
390
+ codex_agent/plugin.py Stateful plugin base class
391
+ codex_agent/builtin_tools/ Built-in local tools package
365
392
  codex_agent/builtin_commands.py Built-in slash commands
366
393
  codex_agent/builtin_providers.py Built-in context providers
394
+ codex_agent/builtin_plugins/ Auto-loaded stateful plugin packages
367
395
  codex_agent/prompts/ Packaged prompt templates
368
396
  codex_agent/get_text/ Document extraction helpers
369
397
  tests/ Test suite
@@ -384,7 +412,7 @@ The tests isolate `AGENT_RUNTIME_DIR` automatically, so they should not create o
384
412
  Current baseline:
385
413
 
386
414
  ```text
387
- 293 passed
415
+ 412 passed
388
416
  ```
389
417
 
390
418
  ## Packaging
@@ -396,9 +424,11 @@ python -m pip install build
396
424
  python -m build
397
425
  ```
398
426
 
399
- The distribution includes prompt text files and `codex_agent/get_text/default_gitignore` through package data and `MANIFEST.in`.
427
+ The distribution includes prompt text files, `codex_agent/get_text/default_gitignore`, and the packaged Linux system dependency installer through package data and `MANIFEST.in`.
400
428
 
401
429
  ## Recent changes
430
+ - `0.1.14`: add HookManager infrastructure, planner/scheduler robustness fixes, documented system dependencies, `codex-agent install-system-deps`, `codex-agent bootstrap`, and improved TUI SSE reconnect/replay handling.
431
+ - `0.1.13`: reorganize built-in tools into a `codex_agent.builtin_tools` package, keeping the public import surface compatible while separating file, shell, vision, system, and server-tool modules.
402
432
  - `0.1.12`: add a persistent Playwright/Chromium browser controller with tab navigation, DOM/action snapshots, screenshots, form/click/key tools, and `browser_goto(url)` for active-tab navigation.
403
433
  - `0.1.11`: split strict line-numbered UTF-8 `read` from unnumbered extracted `view`, preserve blank lines in read snippets, and show persistent+temporary message counts in the TUI status bar.
404
434
  - `0.1.10`: persist only backend compaction summaries, drop bulky compacted conversation payloads, and refresh context status after compaction.
@@ -25,7 +25,9 @@ It provides a reusable `Agent` abstraction with persistent sessions, local tools
25
25
  - Python 3.10 or newer.
26
26
  - A working model backend configuration compatible with `codex-backend-sdk` / OpenAI usage.
27
27
  - GTK 3 plus Ayatana AppIndicator or AppIndicator bindings are needed for the tray controller on Linux.
28
- - Playwright's managed Chromium browser is used for rendered web extraction when static fetching is insufficient. Install it with `python -m playwright install chromium` if needed.
28
+ - Desktop automation on Linux/X11 uses explicit system tools: `wmctrl`, `xdotool`, and `xclip`.
29
+ - Playwright's managed Chromium browser is used for rendered web extraction when static fetching is insufficient.
30
+ - See `dependencies.txt` for the full list of optional non-Python system dependencies.
29
31
 
30
32
  ## Installation
31
33
 
@@ -41,6 +43,26 @@ For development:
41
43
  python -m pip install -e '.[dev]'
42
44
  ```
43
45
 
46
+ Install optional Linux system dependencies for browser, desktop, tray, service, terminal, and audio features:
47
+
48
+ ```bash
49
+ codex-agent install-system-deps -- -y
50
+ ```
51
+
52
+ Or bootstrap a local desktop setup by installing system dependencies and then installing/starting the user services:
53
+
54
+ ```bash
55
+ codex-agent bootstrap -- -y
56
+ ```
57
+
58
+ Useful bootstrap variants:
59
+
60
+ ```bash
61
+ codex-agent bootstrap --no-system-deps
62
+ codex-agent bootstrap --no-start-service -- -y
63
+ codex-agent install-system-deps -- --dry-run --no-tray --no-audio
64
+ ```
65
+
44
66
  ## Quick start
45
67
 
46
68
  Run the local server plus terminal TUI:
@@ -73,6 +95,8 @@ Install the user services for the server and tray controller:
73
95
  codex-agent install-service
74
96
  ```
75
97
 
98
+ For a first-time Linux desktop setup, `codex-agent bootstrap -- -y` combines optional system dependency installation with service installation/startup. The command forwards arguments after `--` to the system dependency installer.
99
+
76
100
  Or use the agent from Python:
77
101
 
78
102
  ```python
@@ -314,9 +338,11 @@ Configuration is persisted to `agent_config.json` in the runtime directory when
314
338
  ```text
315
339
  codex_agent/ Python package
316
340
  codex_agent/agent.py Agent, AgentConfig, AgentSession
317
- codex_agent/builtin_tools.py Built-in local tools
341
+ codex_agent/plugin.py Stateful plugin base class
342
+ codex_agent/builtin_tools/ Built-in local tools package
318
343
  codex_agent/builtin_commands.py Built-in slash commands
319
344
  codex_agent/builtin_providers.py Built-in context providers
345
+ codex_agent/builtin_plugins/ Auto-loaded stateful plugin packages
320
346
  codex_agent/prompts/ Packaged prompt templates
321
347
  codex_agent/get_text/ Document extraction helpers
322
348
  tests/ Test suite
@@ -337,7 +363,7 @@ The tests isolate `AGENT_RUNTIME_DIR` automatically, so they should not create o
337
363
  Current baseline:
338
364
 
339
365
  ```text
340
- 293 passed
366
+ 412 passed
341
367
  ```
342
368
 
343
369
  ## Packaging
@@ -349,9 +375,11 @@ python -m pip install build
349
375
  python -m build
350
376
  ```
351
377
 
352
- The distribution includes prompt text files and `codex_agent/get_text/default_gitignore` through package data and `MANIFEST.in`.
378
+ The distribution includes prompt text files, `codex_agent/get_text/default_gitignore`, and the packaged Linux system dependency installer through package data and `MANIFEST.in`.
353
379
 
354
380
  ## Recent changes
381
+ - `0.1.14`: add HookManager infrastructure, planner/scheduler robustness fixes, documented system dependencies, `codex-agent install-system-deps`, `codex-agent bootstrap`, and improved TUI SSE reconnect/replay handling.
382
+ - `0.1.13`: reorganize built-in tools into a `codex_agent.builtin_tools` package, keeping the public import surface compatible while separating file, shell, vision, system, and server-tool modules.
355
383
  - `0.1.12`: add a persistent Playwright/Chromium browser controller with tab navigation, DOM/action snapshots, screenshots, form/click/key tools, and `browser_goto(url)` for active-tab navigation.
356
384
  - `0.1.11`: split strict line-numbered UTF-8 `read` from unnumbered extracted `view`, preserve blank lines in read snippets, and show persistent+temporary message counts in the TUI status bar.
357
385
  - `0.1.10`: persist only backend compaction summaries, drop bulky compacted conversation payloads, and refresh context status after compaction.
@@ -0,0 +1,138 @@
1
+ from .agent import Agent
2
+ from .client import AgentClient
3
+ from .config import AgentConfig, ConfigManager, DEFAULT_SYSTEM_PROMPT
4
+ from .context import ContextManager
5
+ from .event import (
6
+ AgentInterruptRequestedEvent,
7
+ AgentInterrupted,
8
+ AgentInterruptedEvent,
9
+ AgentTurnEndEvent,
10
+ AgentTurnErrorEvent,
11
+ AgentTurnStartEvent,
12
+ AssistantStepEndEvent,
13
+ AssistantStepStartEvent,
14
+ AssistantTurnEndEvent,
15
+ AssistantTurnStartEvent,
16
+ AudioPlaybackEvent,
17
+ CompactionCompletedEvent,
18
+ CompactionRequestedEvent,
19
+ Event,
20
+ EventBus,
21
+ MessageAddedEvent,
22
+ MessageSubmittedEvent,
23
+ ResponseContentDeltaEvent,
24
+ ResponseDoneEvent,
25
+ ResponseMessageDeltaEvent,
26
+ ResponseOutputItemEvent,
27
+ ResponseReasoningDeltaEvent,
28
+ ResponseStartEvent,
29
+ ResponseToolCallsDeltaEvent,
30
+ ServerToolCallEvent,
31
+ SessionDeletedEvent,
32
+ SessionLoadedEvent,
33
+ ToolCallDoneEvent,
34
+ ToolCallStartEvent,
35
+ )
36
+ from .message import (
37
+ AssistantMessage,
38
+ CompactionMessage,
39
+ DeveloperMessage,
40
+ InterruptMessage,
41
+ Message,
42
+ MessageChunk,
43
+ ProviderMessage,
44
+ ServerToolResponseMessage,
45
+ SystemMessage,
46
+ ToolResultMessage,
47
+ ToolResultWrapper,
48
+ UserMessage,
49
+ )
50
+ from .image import ImageMessage
51
+ from .mainloop import MainLoopManager
52
+ from .memory import MemoryEntry, RAGMemory, RAGMemoryConfig
53
+ from .plugin import Plugin, PluginsManager
54
+ from .registry import RegistryManager
55
+ from .command import AgentCommand, AgentFuture, CommandManager, command
56
+ from .provider import provider
57
+ from .runtime import RuntimeManager
58
+ from .sessions import AgentSession, SessionsManager
59
+ from .status import StatusManager
60
+ from .tool import ImageGenerationTool, ServerTool, Tool, WebSearchTool, get_agent, get_current_call_id, tool
61
+ from .worker import SummarizerWorker, TurnSummaryWorker, Worker
62
+
63
+ __all__ = [
64
+ "Agent",
65
+ "AgentClient",
66
+ "AgentConfig",
67
+ "ConfigManager",
68
+ "DEFAULT_SYSTEM_PROMPT",
69
+ "ContextManager",
70
+ "AgentInterruptRequestedEvent",
71
+ "AgentInterrupted",
72
+ "AgentInterruptedEvent",
73
+ "AgentTurnEndEvent",
74
+ "AgentTurnErrorEvent",
75
+ "AgentTurnStartEvent",
76
+ "AssistantStepEndEvent",
77
+ "AssistantStepStartEvent",
78
+ "AssistantTurnEndEvent",
79
+ "AssistantTurnStartEvent",
80
+ "AudioPlaybackEvent",
81
+ "CompactionCompletedEvent",
82
+ "CompactionRequestedEvent",
83
+ "Event",
84
+ "EventBus",
85
+ "MessageAddedEvent",
86
+ "MessageSubmittedEvent",
87
+ "ResponseContentDeltaEvent",
88
+ "ResponseDoneEvent",
89
+ "ResponseMessageDeltaEvent",
90
+ "ResponseOutputItemEvent",
91
+ "ResponseReasoningDeltaEvent",
92
+ "ResponseStartEvent",
93
+ "ResponseToolCallsDeltaEvent",
94
+ "ServerToolCallEvent",
95
+ "SessionDeletedEvent",
96
+ "SessionLoadedEvent",
97
+ "ToolCallDoneEvent",
98
+ "ToolCallStartEvent",
99
+ "AssistantMessage",
100
+ "CompactionMessage",
101
+ "DeveloperMessage",
102
+ "InterruptMessage",
103
+ "Message",
104
+ "MessageChunk",
105
+ "ProviderMessage",
106
+ "ServerToolResponseMessage",
107
+ "SystemMessage",
108
+ "ToolResultMessage",
109
+ "ToolResultWrapper",
110
+ "UserMessage",
111
+ "ImageMessage",
112
+ "MainLoopManager",
113
+ "MemoryEntry",
114
+ "RAGMemory",
115
+ "RAGMemoryConfig",
116
+ "Plugin",
117
+ "PluginsManager",
118
+ "RegistryManager",
119
+ "AgentCommand",
120
+ "AgentFuture",
121
+ "CommandManager",
122
+ "command",
123
+ "provider",
124
+ "RuntimeManager",
125
+ "AgentSession",
126
+ "SessionsManager",
127
+ "StatusManager",
128
+ "ImageGenerationTool",
129
+ "ServerTool",
130
+ "Tool",
131
+ "WebSearchTool",
132
+ "get_agent",
133
+ "get_current_call_id",
134
+ "tool",
135
+ "SummarizerWorker",
136
+ "TurnSummaryWorker",
137
+ "Worker",
138
+ ]
@@ -1,4 +1,5 @@
1
1
  from pathlib import Path
2
+ import subprocess
2
3
 
3
4
  from . import Agent
4
5
  from .chat import Chat
@@ -26,8 +27,7 @@ def default_agent():
26
27
 
27
28
 
28
29
  def configure_server_url(agent, host, port):
29
- if hasattr(agent, "update_config"):
30
- agent.update_config(server_url=f"http://{host}:{port}", save=False)
30
+ agent.config_manager.update(server_url=f"http://{host}:{port}", save=False)
31
31
  return agent
32
32
 
33
33
 
@@ -48,6 +48,33 @@ def run_tray_mode(base_url="http://127.0.0.1:8765"):
48
48
  run_tray(base_url=base_url)
49
49
 
50
50
 
51
+ def run_system_deps_installer(extra_args=None):
52
+ script = Path(__file__).parent / "scripts" / "install-system-dependencies.sh"
53
+ if not script.is_file():
54
+ raise RuntimeError(f"System dependency installer not found: {script}")
55
+ return subprocess.call([str(script), *(extra_args or [])])
56
+
57
+
58
+ def run_bootstrap(
59
+ host="127.0.0.1",
60
+ port=8765,
61
+ *,
62
+ system_deps_args=None,
63
+ install_system_deps=True,
64
+ install_service=True,
65
+ start_service=True,
66
+ ):
67
+ if install_system_deps:
68
+ code = run_system_deps_installer(system_deps_args or [])
69
+ if code:
70
+ return code
71
+ if install_service:
72
+ path = install_user_service(host=host, port=port, enable=True, start=start_service)
73
+ action = "Installed and started" if start_service else "Installed"
74
+ print(f"{action} user services: {path}")
75
+ return 0
76
+
77
+
51
78
  def run_local(host="127.0.0.1", port=8765):
52
79
  import threading
53
80
  import time
@@ -78,14 +105,19 @@ def main(argv=None):
78
105
  parser.add_argument(
79
106
  "mode",
80
107
  nargs="?",
81
- choices=["local", "server", "chat", "tray", "install-service", "uninstall-service"],
108
+ choices=["local", "server", "chat", "tray", "install-service", "uninstall-service", "install-system-deps", "bootstrap"],
82
109
  default="local",
83
- help="local starts an embedded server then the TUI client; server runs only the API; chat connects to an existing API; tray starts the desktop tray controller; install-service installs a user systemd service.",
110
+ help="local starts an embedded server then the TUI client; server runs only the API; chat connects to an existing API; tray starts the desktop tray controller; install-service installs a user systemd service; install-system-deps installs optional OS packages; bootstrap installs system deps then user services.",
84
111
  )
85
112
  parser.add_argument("--host", default="127.0.0.1")
86
113
  parser.add_argument("--port", type=int, default=8765)
87
114
  parser.add_argument("--url", default=None, help="Base URL for chat mode, e.g. http://127.0.0.1:8765")
88
- args = parser.parse_args(argv)
115
+ parser.add_argument("--no-system-deps", action="store_true", help="With bootstrap, skip OS dependency installation.")
116
+ parser.add_argument("--no-service", action="store_true", help="With bootstrap, skip user service installation.")
117
+ parser.add_argument("--no-start-service", action="store_true", help="With bootstrap, install services but do not start them.")
118
+ args, extra_args = parser.parse_known_args(argv)
119
+ if args.mode not in {"install-system-deps", "bootstrap"} and extra_args:
120
+ parser.error(f"unrecognized arguments: {' '.join(extra_args)}")
89
121
 
90
122
  if args.mode == "server":
91
123
  run_server(args.host, args.port)
@@ -99,6 +131,23 @@ def main(argv=None):
99
131
  elif args.mode == "uninstall-service":
100
132
  path = uninstall_user_service(disable=True, stop=True)
101
133
  print(f"Uninstalled user service: {path}")
134
+ elif args.mode == "install-system-deps":
135
+ installer_args = extra_args
136
+ if installer_args and installer_args[0] == "--":
137
+ installer_args = installer_args[1:]
138
+ raise SystemExit(run_system_deps_installer(installer_args))
139
+ elif args.mode == "bootstrap":
140
+ installer_args = extra_args
141
+ if installer_args and installer_args[0] == "--":
142
+ installer_args = installer_args[1:]
143
+ raise SystemExit(run_bootstrap(
144
+ host=args.host,
145
+ port=args.port,
146
+ system_deps_args=installer_args,
147
+ install_system_deps=not args.no_system_deps,
148
+ install_service=not args.no_service,
149
+ start_service=not args.no_start_service,
150
+ ))
102
151
  else:
103
152
  run_local(args.host, args.port)
104
153