codex-agent-framework 0.1.4__tar.gz → 0.1.6__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 (56) hide show
  1. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/CHANGELOG.md +19 -0
  2. {codex_agent_framework-0.1.4/codex_agent_framework.egg-info → codex_agent_framework-0.1.6}/PKG-INFO +4 -1
  3. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/README.md +1 -0
  4. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/__init__.py +8 -1
  5. codex_agent_framework-0.1.6/codex_agent/__main__.py +73 -0
  6. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/agent.py +334 -27
  7. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/ai.py +7 -11
  8. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/builtin_tools.py +2 -2
  9. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/chat.py +96 -52
  10. codex_agent_framework-0.1.6/codex_agent/client.py +183 -0
  11. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/event.py +31 -12
  12. codex_agent_framework-0.1.6/codex_agent/server.py +245 -0
  13. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/tool.py +56 -48
  14. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/voice.py +1 -4
  15. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6/codex_agent_framework.egg-info}/PKG-INFO +4 -1
  16. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent_framework.egg-info/SOURCES.txt +4 -0
  17. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent_framework.egg-info/requires.txt +2 -0
  18. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/pyproject.toml +3 -1
  19. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_agent.py +177 -12
  20. codex_agent_framework-0.1.6/tests/test_cli.py +55 -0
  21. codex_agent_framework-0.1.6/tests/test_client.py +87 -0
  22. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_events.py +12 -0
  23. codex_agent_framework-0.1.6/tests/test_server.py +167 -0
  24. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_worker.py +1 -1
  25. codex_agent_framework-0.1.4/codex_agent/__main__.py +0 -18
  26. codex_agent_framework-0.1.4/tests/test_cli.py +0 -22
  27. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/LICENSE +0 -0
  28. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/MANIFEST.in +0 -0
  29. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/builtin_commands.py +0 -0
  30. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/builtin_providers.py +0 -0
  31. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/command.py +0 -0
  32. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/get_text/__init__.py +0 -0
  33. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/get_text/default_gitignore +0 -0
  34. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/get_text/get_text.py +0 -0
  35. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/get_text/simpler_get_text.py +0 -0
  36. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/get_webdriver.py +0 -0
  37. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/image.py +0 -0
  38. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/latex.py +0 -0
  39. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/memory.py +0 -0
  40. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/message.py +0 -0
  41. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/prompts/image_generation_system_prompt.txt +0 -0
  42. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/prompts/system_prompt.txt +0 -0
  43. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/provider.py +0 -0
  44. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/stream_utils.py +0 -0
  45. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/utils.py +0 -0
  46. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent/worker.py +0 -0
  47. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent_framework.egg-info/dependency_links.txt +0 -0
  48. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent_framework.egg-info/entry_points.txt +0 -0
  49. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/codex_agent_framework.egg-info/top_level.txt +0 -0
  50. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/setup.cfg +0 -0
  51. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_ai.py +0 -0
  52. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_chat.py +0 -0
  53. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_image_message.py +0 -0
  54. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_memory.py +0 -0
  55. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_messages.py +0 -0
  56. {codex_agent_framework-0.1.4 → codex_agent_framework-0.1.6}/tests/test_utils.py +0 -0
@@ -3,6 +3,25 @@
3
3
  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
+ ## [0.1.6] - 2026-05-04
7
+ ### Added
8
+ - Add an async-style agent mainloop with command futures so turns and state mutations can be coordinated through one runtime.
9
+ - Add a FastAPI REST/SSE bridge and an `AgentClient` HTTP/SSE client for decoupled interfaces.
10
+ - Add CLI modes for local embedded server + TUI client, server-only, and client-only chat operation.
11
+
12
+ ### Changed
13
+ - Decouple the Textual chat UI from direct `Agent` access; the TUI now communicates with the server through HTTP and SSE.
14
+ - Stream lightweight response deltas instead of cumulative content, reducing SSE traffic and client backpressure.
15
+ - Use unbounded subscriber queues with ping events for more reliable SSE client delivery.
16
+
17
+ ### Tests
18
+ - Add coverage for the server bridge, HTTP/SSE client, async runtime behavior, CLI modes, and event lifecycle.
19
+
20
+ ## [0.1.5] - 2026-05-03
21
+ ### Changed
22
+ - Refine the default Textual chat UI with a pure black background, black multiline input area, subtler scrollbars, a smaller step-end marker, and English UI labels.
23
+
24
+
6
25
  ## [0.1.4] - 2026-05-03
7
26
  ### Added
8
27
  - Make the Textual REPL UI the default chat interface, with multiline input, subdued colors, visual speaker separators, step-end markers, and cleaner tool-call rendering.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codex-agent-framework
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: A lightweight event-driven Codex agent runtime.
5
5
  Author: Baptiste
6
6
  License-Expression: MIT
@@ -17,6 +17,7 @@ Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: beautifulsoup4
19
19
  Requires-Dist: codex-backend-sdk
20
+ Requires-Dist: fastapi
20
21
  Requires-Dist: filetype
21
22
  Requires-Dist: get-gecko-driver
22
23
  Requires-Dist: modict
@@ -38,6 +39,7 @@ Requires-Dist: selenium
38
39
  Requires-Dist: textual
39
40
  Requires-Dist: tiktoken
40
41
  Requires-Dist: trafilatura
42
+ Requires-Dist: uvicorn
41
43
  Provides-Extra: dev
42
44
  Requires-Dist: build; extra == "dev"
43
45
  Requires-Dist: pytest; extra == "dev"
@@ -342,6 +344,7 @@ python -m build
342
344
  The distribution includes prompt text files and `codex_agent/get_text/default_gitignore` through package data and `MANIFEST.in`.
343
345
 
344
346
  ## Recent changes
347
+ - `0.1.5`: refine the Textual chat UI with pure black backgrounds, subtler markers/scrollbars, and English UI labels.
345
348
  - `0.1.4`: make the Textual REPL UI the default, add multiline input, assistant turn/step events, cleaner tool-call rendering, and `/voice` configuration.
346
349
  - `0.1.3`: pass the current session id as `prompt_cache_key` to the Codex backend for prompt cache reuse.
347
350
  - `0.1.2`: add `/clear` in the terminal chat to clear the screen without changing session history.
@@ -295,6 +295,7 @@ python -m build
295
295
  The distribution includes prompt text files and `codex_agent/get_text/default_gitignore` through package data and `MANIFEST.in`.
296
296
 
297
297
  ## Recent changes
298
+ - `0.1.5`: refine the Textual chat UI with pure black backgrounds, subtler markers/scrollbars, and English UI labels.
298
299
  - `0.1.4`: make the Textual REPL UI the default, add multiline input, assistant turn/step events, cleaner tool-call rendering, and `/voice` configuration.
299
300
  - `0.1.3`: pass the current session id as `prompt_cache_key` to the Codex backend for prompt cache reuse.
300
301
  - `0.1.2`: add `/clear` in the terminal chat to clear the screen without changing session history.
@@ -1,7 +1,12 @@
1
- from .agent import Agent, AgentSession
1
+ from .agent import Agent, AgentCommand, AgentFuture, AgentSession
2
+ from .client import AgentClient
2
3
  from .event import (
4
+ AgentInterruptRequestedEvent,
3
5
  AgentInterrupted,
4
6
  AgentInterruptedEvent,
7
+ AgentTurnEndEvent,
8
+ AgentTurnErrorEvent,
9
+ AgentTurnStartEvent,
5
10
  AssistantStepEndEvent,
6
11
  AssistantStepStartEvent,
7
12
  AssistantTurnEndEvent,
@@ -18,6 +23,8 @@ from .event import (
18
23
  ResponseStartEvent,
19
24
  ResponseToolCallsDeltaEvent,
20
25
  ServerToolCallEvent,
26
+ SessionDeletedEvent,
27
+ SessionLoadedEvent,
21
28
  ToolCallDoneEvent,
22
29
  ToolCallStartEvent,
23
30
  )
@@ -0,0 +1,73 @@
1
+ from pathlib import Path
2
+
3
+ from . import Agent
4
+ from .chat import Chat
5
+ from .server import create_app
6
+
7
+
8
+ def default_agent():
9
+ package_dir = Path(__file__).parent
10
+ return Agent(
11
+ system=str(package_dir / 'prompts' / 'system_prompt.txt'),
12
+ voice_instructions="You're a lively and friendly female in her mid twenties. You speak french with a easy-going and cheerful tone.",
13
+ username="Baptiste",
14
+ userage="40",
15
+ )
16
+
17
+
18
+ def run_server(host="127.0.0.1", port=8765):
19
+ import uvicorn
20
+
21
+ app = create_app(agent=default_agent())
22
+ uvicorn.run(app, host=host, port=port)
23
+
24
+
25
+ def run_chat(base_url="http://127.0.0.1:8765"):
26
+ Chat(base_url=base_url).run()
27
+
28
+
29
+ def run_local(host="127.0.0.1", port=8765):
30
+ import threading
31
+ import time
32
+
33
+ import uvicorn
34
+
35
+ app = create_app(agent=default_agent())
36
+ config = uvicorn.Config(app, host=host, port=port, log_level="warning")
37
+ server = uvicorn.Server(config)
38
+ thread = threading.Thread(target=server.run, name="codex-agent-server", daemon=True)
39
+ thread.start()
40
+ time.sleep(0.4)
41
+ try:
42
+ run_chat(f"http://{host}:{port}")
43
+ finally:
44
+ server.should_exit = True
45
+ thread.join(timeout=1.0)
46
+
47
+
48
+ def main(argv=None):
49
+ import argparse
50
+
51
+ parser = argparse.ArgumentParser(prog="codex-agent")
52
+ parser.add_argument(
53
+ "mode",
54
+ nargs="?",
55
+ choices=["local", "server", "chat"],
56
+ default="local",
57
+ help="local starts an embedded server then the TUI client; server runs only the API; chat connects to an existing API.",
58
+ )
59
+ parser.add_argument("--host", default="127.0.0.1")
60
+ parser.add_argument("--port", type=int, default=8765)
61
+ parser.add_argument("--url", default=None, help="Base URL for chat mode, e.g. http://127.0.0.1:8765")
62
+ args = parser.parse_args(argv)
63
+
64
+ if args.mode == "server":
65
+ run_server(args.host, args.port)
66
+ elif args.mode == "chat":
67
+ run_chat(args.url or f"http://{args.host}:{args.port}")
68
+ else:
69
+ run_local(args.host, args.port)
70
+
71
+
72
+ if __name__ == '__main__':
73
+ main()