symphony-code 0.0.3__tar.gz → 0.0.4__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 (190) hide show
  1. {symphony_code-0.0.3 → symphony_code-0.0.4}/PKG-INFO +2 -2
  2. {symphony_code-0.0.3 → symphony_code-0.0.4}/README.md +1 -1
  3. {symphony_code-0.0.3 → symphony_code-0.0.4}/pyproject.toml +1 -1
  4. {symphony_code-0.0.3 → symphony_code-0.0.4}/pyproject.toml.orig +1 -1
  5. symphony_code-0.0.4/src/coding_agent/addons/artifacts/__init__.py +11 -0
  6. symphony_code-0.0.4/src/coding_agent/addons/artifacts/addon.py +153 -0
  7. symphony_code-0.0.4/src/coding_agent/addons/artifacts/capture.py +169 -0
  8. symphony_code-0.0.4/src/coding_agent/addons/artifacts/kinds.py +51 -0
  9. symphony_code-0.0.4/src/coding_agent/addons/artifacts/noise.py +48 -0
  10. symphony_code-0.0.4/src/coding_agent/addons/artifacts/store.py +212 -0
  11. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/agent.py +10 -1
  12. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/stdio/README.md +69 -2
  13. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/stdio/requests.py +33 -1
  14. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/stdio/server.py +27 -1
  15. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/stdio/transport.py +2 -2
  16. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/__init__.py +3 -1
  17. symphony_code-0.0.4/src/coding_agent/tools/save_artifact.py +39 -0
  18. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/runtime/events.py +23 -0
  19. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/history.py +21 -0
  20. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/labels.py +2 -1
  21. symphony_code-0.0.4/src/coding_agent/tui/transcript/artifact.py +42 -0
  22. symphony_code-0.0.4/src/coding_agent/tui/transcript/decision.py +35 -0
  23. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/transcript/surface.py +6 -0
  24. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/web/server.py +46 -6
  25. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/web/sessions.py +5 -0
  26. {symphony_code-0.0.3 → symphony_code-0.0.4}/LICENSE +0 -0
  27. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/__init__.py +0 -0
  28. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/_lazy.py +0 -0
  29. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/__init__.py +0 -0
  30. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/approvals.py +0 -0
  31. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/compaction/__init__.py +0 -0
  32. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/compaction/addon.py +0 -0
  33. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/compaction/compactor.py +0 -0
  34. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/compaction/prompts.py +0 -0
  35. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/compaction/transcript.py +0 -0
  36. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/evaluation/__init__.py +0 -0
  37. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/evaluation/addon.py +0 -0
  38. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/evaluation/evaluators.py +0 -0
  39. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/evaluation/handlers.py +0 -0
  40. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/evaluation/policy.py +0 -0
  41. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/evaluation/protocol.py +0 -0
  42. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/evaluation/state.py +0 -0
  43. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/langfuse/__init__.py +0 -0
  44. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/langfuse/addon.py +0 -0
  45. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/langfuse/install.py +0 -0
  46. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/langfuse/serialize.py +0 -0
  47. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/learning/__init__.py +0 -0
  48. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/learning/addon.py +0 -0
  49. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/learning/loop.py +0 -0
  50. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/learning/prompts.py +0 -0
  51. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/learning/sanitize.py +0 -0
  52. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/learning/store.py +0 -0
  53. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/manager/__init__.py +0 -0
  54. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/manager/bridge.py +0 -0
  55. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/manager/discovery.py +0 -0
  56. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/manager/report.py +0 -0
  57. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/manager/runtime.py +0 -0
  58. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/manager/tool_changes.py +0 -0
  59. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/__init__.py +0 -0
  60. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/active.py +0 -0
  61. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/artifacts.py +0 -0
  62. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/collection.py +0 -0
  63. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/compatibility.py +0 -0
  64. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/images.py +0 -0
  65. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/jsonl.py +0 -0
  66. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/persistence/presentation.py +0 -0
  67. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/plugins/__init__.py +0 -0
  68. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/plugins/install.py +0 -0
  69. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/plugins/manager.py +0 -0
  70. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/plugins/models.py +0 -0
  71. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/__init__.py +0 -0
  72. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/addon.py +0 -0
  73. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/args.py +0 -0
  74. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/addon-authoring/SKILL.md +0 -0
  75. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/context-budget/SKILL.md +0 -0
  76. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/orient-first/SKILL.md +0 -0
  77. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/security-boundary/SKILL.md +0 -0
  78. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/skill-discipline/SKILL.md +0 -0
  79. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/surgical-edit/SKILL.md +0 -0
  80. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/systematic-debug/SKILL.md +0 -0
  81. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/bundled_skills/verify-before-done/SKILL.md +0 -0
  82. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/frontmatter.py +0 -0
  83. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/models.py +0 -0
  84. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/registry.py +0 -0
  85. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/skills/tool.py +0 -0
  86. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/voice/__init__.py +0 -0
  87. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/voice/addon.py +0 -0
  88. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/voice/credentials.py +0 -0
  89. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/voice/playback.py +0 -0
  90. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/voice/speak.py +0 -0
  91. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/voice/stream.py +0 -0
  92. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/addons/voice/summary.py +0 -0
  93. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/bench/__init__.py +0 -0
  94. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/bench/cli.py +0 -0
  95. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/bench/patch.py +0 -0
  96. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/cli.py +0 -0
  97. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/commands/__init__.py +0 -0
  98. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/commands/catalog.py +0 -0
  99. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/commands/jev_argument.py +0 -0
  100. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/config/__init__.py +0 -0
  101. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/config/config.py +0 -0
  102. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/config/credentials.py +0 -0
  103. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/config/personalities.json +0 -0
  104. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/config/personalities.py +0 -0
  105. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/config/prompts.py +0 -0
  106. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/__init__.py +0 -0
  107. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/acp/README.md +0 -0
  108. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/acp/__init__.py +0 -0
  109. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/acp/mapping.py +0 -0
  110. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/acp/server.py +0 -0
  111. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/acp/transport.py +0 -0
  112. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/stdio/__init__.py +0 -0
  113. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/stdio/catalog.py +0 -0
  114. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/protocols/stdio/commands.py +0 -0
  115. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/py.typed +0 -0
  116. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/resources/__init__.py +0 -0
  117. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/resources/usage.py +0 -0
  118. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/run/__init__.py +0 -0
  119. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/run/cli.py +0 -0
  120. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/run/detach.py +0 -0
  121. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/run/interrupted.py +0 -0
  122. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/run/log_sink.py +0 -0
  123. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tls.py +0 -0
  124. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/ask_user.py +0 -0
  125. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/base.py +0 -0
  126. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/bash.py +0 -0
  127. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/bash_jobs.py +0 -0
  128. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/generate_image.py +0 -0
  129. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/memory.py +0 -0
  130. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/patch.py +0 -0
  131. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/read_file.py +0 -0
  132. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/search.py +0 -0
  133. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/summary.py +0 -0
  134. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/web_search.py +0 -0
  135. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tools/write_file.py +0 -0
  136. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/EFFICIENCY_PLAN.md +0 -0
  137. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/__init__.py +0 -0
  138. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/__main__.py +0 -0
  139. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/app.py +0 -0
  140. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/chrome/__init__.py +0 -0
  141. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/chrome/footer.py +0 -0
  142. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/chrome/topbar.py +0 -0
  143. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/commands/__init__.py +0 -0
  144. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/commands/catalog.py +0 -0
  145. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/commands/manager.py +0 -0
  146. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/composer/__init__.py +0 -0
  147. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/composer/input.py +0 -0
  148. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/composer/slash_menu.py +0 -0
  149. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/composer/surface.py +0 -0
  150. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/composer/voice.py +0 -0
  151. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/composer/voice_mode.py +0 -0
  152. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/runtime/__init__.py +0 -0
  153. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/runtime/sink.py +0 -0
  154. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/runtime/state.py +0 -0
  155. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/runtime/subagent.py +0 -0
  156. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/runtime/turn.py +0 -0
  157. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/__init__.py +0 -0
  158. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/ask.py +0 -0
  159. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/context.py +0 -0
  160. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/dashboard.py +0 -0
  161. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/diff.py +0 -0
  162. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/extensions.py +0 -0
  163. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/file_selector.py +0 -0
  164. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/langfuse.py +0 -0
  165. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/learning.py +0 -0
  166. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/modal.py +0 -0
  167. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/onboard.py +0 -0
  168. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/resume.py +0 -0
  169. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/screens/update.py +0 -0
  170. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/theme/__init__.py +0 -0
  171. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/theme/load.py +0 -0
  172. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/theme/style.py +0 -0
  173. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/theme/theme.toml +0 -0
  174. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/__init__.py +0 -0
  175. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/activity.py +0 -0
  176. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/calls.py +0 -0
  177. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/code_view.py +0 -0
  178. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/images.py +0 -0
  179. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/modal.py +0 -0
  180. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/partial_args.py +0 -0
  181. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/tools/snapshots.py +0 -0
  182. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/transcript/__init__.py +0 -0
  183. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/transcript/messages.py +0 -0
  184. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/transcript/process.py +0 -0
  185. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/tui/transcript/thinking_markdown.py +0 -0
  186. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/updates.py +0 -0
  187. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/web/__init__.py +0 -0
  188. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/web/bundle.py +0 -0
  189. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/web/worker.py +0 -0
  190. {symphony_code-0.0.3 → symphony_code-0.0.4}/src/coding_agent/widget_fields.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: symphony-code
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Symphony coding agent: workspace tools, JSONL sessions, and a Textual TUI on top of symphony-harness (import as coding_agent; run as `symphony`)
5
5
  Author: Sarthak Chauhan
6
6
  Author-email: Sarthak Chauhan <sarthakchauhann@gmail.com>
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
 
29
29
  Run an AI coding agent in your terminal, or import the coding-agent API from the Symphony workspace. Package import name: `coding_agent`.
30
30
 
31
- **Availability:** version 0.0.1 is on PyPI.
31
+ **Availability:** version 0.0.3 is on PyPI. Version 0.0.4, including session artifacts and security updates, is being prepared.
32
32
 
33
33
  ```sh
34
34
  python -m pip install symphony-code
@@ -2,7 +2,7 @@
2
2
 
3
3
  Run an AI coding agent in your terminal, or import the coding-agent API from the Symphony workspace. Package import name: `coding_agent`.
4
4
 
5
- **Availability:** version 0.0.1 is on PyPI.
5
+ **Availability:** version 0.0.3 is on PyPI. Version 0.0.4, including session artifacts and security updates, is being prepared.
6
6
 
7
7
  ```sh
8
8
  python -m pip install symphony-code
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "symphony-code"
3
- version = "0.0.3"
3
+ version = "0.0.4"
4
4
  description = "Symphony coding agent: workspace tools, JSONL sessions, and a Textual TUI on top of symphony-harness (import as coding_agent; run as `symphony`)"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "symphony-code"
3
- version = "0.0.3"
3
+ version = "0.0.4"
4
4
  description = "Symphony coding agent: workspace tools, JSONL sessions, and a Textual TUI on top of symphony-harness (import as coding_agent; run as `symphony`)"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -0,0 +1,11 @@
1
+ """Session artifacts: the images, html, csv and json a run produces, stored and versioned."""
2
+
3
+ from coding_agent.addons.artifacts.addon import ARTIFACT_CREATED, ARTIFACT_UPDATED, ArtifactsAddon
4
+ from coding_agent.addons.artifacts.capture import ArtifactError, Snapshot, snapshot_path
5
+ from coding_agent.addons.artifacts.kinds import ArtifactKind
6
+ from coding_agent.addons.artifacts.store import ArtifactStore, Manifest, Saved
7
+
8
+ __all__ = [
9
+ "ARTIFACT_CREATED", "ARTIFACT_UPDATED", "ArtifactError", "ArtifactKind", "ArtifactStore",
10
+ "ArtifactsAddon", "Manifest", "Saved", "Snapshot", "snapshot_path",
11
+ ]
@@ -0,0 +1,153 @@
1
+ """Capture the images, html, csv and json files a run produces as artifacts.
2
+
3
+ ``on_tool`` sees every successful tool call after it ran:
4
+
5
+ - ``write_file``, ``patch`` and ``generate_image`` capture the written path
6
+ when its suffix is html, csv, json or an image (see ``capture``). A file
7
+ inside a website folder (one below the workspace with ``index.html``)
8
+ versions that whole site instead. Manifests, configs, lockfiles and
9
+ anything under node_modules, .git, dist or build are skipped (``noise``),
10
+ as is a patch to an html or json file git tracks outside a website folder.
11
+ - ``save_artifact`` captures its path with the kind and title it was given.
12
+ - Any other tool except ``read_file`` captures the inline images it returned.
13
+
14
+ Each stored version is emitted through the session's harness as
15
+ ``artifact_created`` or ``artifact_updated`` (the manifest plus the absolute
16
+ ``path`` of its entry file), so it is journaled and reaches every host.
17
+ Unchanged content stores and emits nothing. Subagents inherit the add-on and
18
+ store into the parent session.
19
+ """
20
+
21
+ from __future__ import annotations
22
+
23
+ import asyncio
24
+ import logging
25
+ from collections.abc import Iterator, Mapping
26
+ from pathlib import Path
27
+ from typing import Any, Optional
28
+
29
+ from core_ai.content import normalize_content
30
+ from core_harness import Addon, CoreHarness
31
+ from core_harness.models import ToolCall, ToolResult
32
+
33
+ from coding_agent.addons.artifacts.capture import (
34
+ SITE_ENTRY,
35
+ ArtifactError,
36
+ Snapshot,
37
+ snapshot_image_part,
38
+ snapshot_path,
39
+ snapshot_site,
40
+ )
41
+ from coding_agent.addons.artifacts.kinds import ArtifactKind, kind_of
42
+ from coding_agent.addons.artifacts.noise import git_tracked, is_noise
43
+ from coding_agent.addons.artifacts.store import ArtifactStore, Saved
44
+
45
+ ARTIFACT_CREATED = "artifact_created"
46
+ ARTIFACT_UPDATED = "artifact_updated"
47
+ PATH_TOOLS = frozenset({"write_file", "patch", "generate_image"})
48
+ SAVE_TOOL = "save_artifact"
49
+ PATCH_TOOL = "patch"
50
+ TRACKED_SOURCE_KINDS = frozenset({ArtifactKind.HTML, ArtifactKind.JSON})
51
+ # Reading an image shows an existing file; it produces nothing.
52
+ READ_TOOLS = frozenset({"read_file"})
53
+
54
+ logger = logging.getLogger(__name__)
55
+
56
+
57
+ def resolve(workspace: Path, raw: str) -> Path:
58
+ """The path a workspace tool wrote, resolved the way ``WorkspaceTool`` does."""
59
+ candidate = Path(raw.strip()).expanduser()
60
+ return (candidate if candidate.is_absolute() else workspace / candidate).resolve()
61
+
62
+
63
+ def site_of(path: Path, workspace: Path) -> Path | None:
64
+ """The nearest folder below the workspace holding ``index.html`` and ``path``.
65
+
66
+ Writing any file of a website (its index.html, css, scripts or images)
67
+ versions the whole site.
68
+ """
69
+ for folder in path.parents:
70
+ if folder == workspace or not folder.is_relative_to(workspace):
71
+ return None
72
+ if (folder / SITE_ENTRY).is_file():
73
+ return folder
74
+ return None
75
+
76
+
77
+ def artifact_frame(store: ArtifactStore, session_id: str, saved: Saved) -> tuple[str, dict[str, object]]:
78
+ manifest = saved.manifest
79
+ entry = store.folder(session_id, manifest.id) / manifest.entry
80
+ return (
81
+ ARTIFACT_CREATED if saved.created else ARTIFACT_UPDATED,
82
+ {**manifest.to_json(), "path": str(entry)},
83
+ )
84
+
85
+
86
+ class ArtifactsAddon(Addon):
87
+ name = "artifacts"
88
+
89
+ def __init__(self, store: ArtifactStore, workspace: Path, owner: Optional[CoreHarness] = None) -> None:
90
+ self.store = store
91
+ self.workspace = Path(workspace).expanduser().resolve()
92
+ # The harness whose session keeps the artifacts: the parent for subagents.
93
+ self.owner = owner
94
+
95
+ def attach(self, harness: Any) -> None:
96
+ if self.owner is None and isinstance(harness, CoreHarness):
97
+ self.owner = harness
98
+
99
+ def fork_for_child(self, parent_harness: Any) -> Optional[Addon]:
100
+ del parent_harness
101
+ return ArtifactsAddon(self.store, self.workspace, self.owner)
102
+
103
+ @staticmethod
104
+ def tracked_edit(tool_name: str, kind: ArtifactKind, path: Path) -> bool:
105
+ """A patch to a git-tracked html or json file edits source, not output."""
106
+ return tool_name == PATCH_TOOL and kind in TRACKED_SOURCE_KINDS and git_tracked(path)
107
+
108
+ def snapshots(self, tool_call: ToolCall, result: ToolResult) -> Iterator[Snapshot]:
109
+ arguments: Mapping[str, Any] = tool_call.arguments
110
+ raw = arguments.get("path")
111
+ if tool_call.name == SAVE_TOOL and isinstance(raw, str):
112
+ title = arguments.get("title")
113
+ yield snapshot_path(
114
+ resolve(self.workspace, raw), self.workspace,
115
+ ArtifactKind(str(arguments.get("kind"))), title if isinstance(title, str) else "",
116
+ )
117
+ elif tool_call.name in PATH_TOOLS and isinstance(raw, str):
118
+ path = resolve(self.workspace, raw)
119
+ if is_noise(path, self.workspace):
120
+ return
121
+ site = site_of(path, self.workspace)
122
+ kind = kind_of(path)
123
+ if site is not None:
124
+ yield snapshot_site(site, self.workspace)
125
+ elif kind is not None and not self.tracked_edit(tool_call.name, kind, path):
126
+ yield snapshot_path(path, self.workspace)
127
+ elif tool_call.name not in READ_TOOLS and not isinstance(result.content, str):
128
+ for index, part in enumerate(normalize_content(result.content)):
129
+ captured = snapshot_image_part(part, tool_call.id, index)
130
+ if captured is not None:
131
+ yield captured
132
+
133
+ async def on_tool(self, **payload: Any) -> None:
134
+ tool_call, result, owner = payload.get("tool_call"), payload.get("result"), self.owner
135
+ if not isinstance(tool_call, ToolCall) or not isinstance(result, ToolResult) or owner is None:
136
+ return
137
+ if result.status != "success" or not owner.session_id:
138
+ return
139
+ session_id = owner.session_id
140
+ try:
141
+ # Reading files and asking git happen off the event loop.
142
+ captures = await asyncio.to_thread(lambda: list(self.snapshots(tool_call, result)))
143
+ for captured in captures:
144
+ saved = await asyncio.to_thread(self.store.save, session_id, captured, tool_call.id)
145
+ if saved is not None:
146
+ event, body = artifact_frame(self.store, session_id, saved)
147
+ await owner.emit(event, body)
148
+ except (ArtifactError, OSError, ValueError) as exc:
149
+ # A file that cannot be kept must not fail the run that wrote it.
150
+ logger.warning("artifact capture skipped for %s: %s", tool_call.name, exc)
151
+
152
+
153
+ __all__ = ["ARTIFACT_CREATED", "ARTIFACT_UPDATED", "ArtifactsAddon", "artifact_frame", "resolve", "site_of"]
@@ -0,0 +1,169 @@
1
+ """Turn a written path or an image result part into an artifact snapshot.
2
+
3
+ A snapshot is the complete content of one artifact version: its kind, a
4
+ stable source (the workspace path it came from), the entry file and every
5
+ file's bytes. ``ArtifactStore`` versions snapshots by sha256.
6
+
7
+ - An image (png/jpg/jpeg/webp/gif/svg), a ``.csv`` or a ``.json`` file is a
8
+ single-file artifact. CSV must be UTF-8 and JSON must parse.
9
+ - A ``.html`` file is a single-file html artifact, except ``index.html`` in a
10
+ folder below the workspace, which captures that whole folder (the site and
11
+ its assets) with ``index.html`` as the entry.
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ import base64
17
+ import binascii
18
+ import json
19
+ from collections.abc import Mapping
20
+ from dataclasses import dataclass
21
+ from pathlib import Path
22
+
23
+ from core_ai.content import sniff_image_media_type
24
+
25
+ from coding_agent.addons.artifacts.kinds import IMAGE_MIME_TYPES, TEXT_MIME_TYPES, ArtifactKind, kind_of
26
+
27
+ MAX_FILE_BYTES = 20 * 1024 * 1024
28
+ MAX_SITE_FILES = 200
29
+ MAX_SITE_BYTES = 20 * 1024 * 1024
30
+ SKIPPED_DIRS = frozenset({"node_modules", "__pycache__"})
31
+ SITE_ENTRY = "index.html"
32
+
33
+
34
+ class ArtifactError(ValueError):
35
+ """The path cannot become an artifact of the requested kind."""
36
+
37
+
38
+ @dataclass(frozen=True)
39
+ class Snapshot:
40
+ kind: ArtifactKind
41
+ source: str
42
+ title: str
43
+ entry: str
44
+ mime: str
45
+ files: tuple[tuple[str, bytes], ...]
46
+
47
+
48
+ def display_source(path: Path, workspace: Path) -> str:
49
+ """The path relative to the workspace when inside it, else absolute."""
50
+ return path.relative_to(workspace).as_posix() if path.is_relative_to(workspace) else str(path)
51
+
52
+
53
+ def _read(path: Path) -> bytes:
54
+ if path.is_symlink() or not path.is_file():
55
+ raise ArtifactError(f"not a regular file: {path}")
56
+ if path.stat().st_size > MAX_FILE_BYTES:
57
+ raise ArtifactError(f"file is over {MAX_FILE_BYTES // (1024 * 1024)} MiB: {path}")
58
+ return path.read_bytes()
59
+
60
+
61
+ def image_mime(payload: bytes, name: str) -> str:
62
+ """png/jpg/jpeg/webp/gif/svg by suffix, else by magic bytes."""
63
+ suffix = Path(name).suffix.lower()
64
+ if suffix in IMAGE_MIME_TYPES:
65
+ return IMAGE_MIME_TYPES[suffix]
66
+ sniffed = sniff_image_media_type(payload)
67
+ if sniffed not in IMAGE_MIME_TYPES.values():
68
+ raise ArtifactError(f"not a png, jpeg, webp, gif or svg image: {name}")
69
+ return sniffed
70
+
71
+
72
+ def _check_text(kind: ArtifactKind, payload: bytes, name: str) -> None:
73
+ try:
74
+ text = payload.decode("utf-8")
75
+ if kind is ArtifactKind.JSON:
76
+ json.loads(text)
77
+ except (UnicodeDecodeError, ValueError) as exc:
78
+ raise ArtifactError(f"{name} is not valid {kind.value}: {exc}") from exc
79
+
80
+
81
+ def _site_files(folder: Path) -> tuple[tuple[str, bytes], ...]:
82
+ files: list[tuple[str, bytes]] = []
83
+ total = 0
84
+ for path in sorted(folder.rglob("*")):
85
+ relative = path.relative_to(folder)
86
+ if any(part.startswith(".") or part in SKIPPED_DIRS for part in relative.parts):
87
+ continue
88
+ if path.is_symlink() or not path.is_file():
89
+ continue
90
+ payload = _read(path)
91
+ total += len(payload)
92
+ files.append((relative.as_posix(), payload))
93
+ if len(files) > MAX_SITE_FILES or total > MAX_SITE_BYTES:
94
+ raise ArtifactError(f"site folder is too large to keep as an artifact: {folder}")
95
+ return tuple(files)
96
+
97
+
98
+ def snapshot_site(folder: Path, workspace: Path, title: str = "") -> Snapshot:
99
+ """A website folder whose entry is ``index.html``."""
100
+ if not (folder / SITE_ENTRY).is_file():
101
+ raise ArtifactError(f"a website folder needs {SITE_ENTRY}: {folder}")
102
+ return Snapshot(
103
+ kind=ArtifactKind.HTML,
104
+ source=display_source(folder, workspace),
105
+ title=title or folder.name,
106
+ entry=SITE_ENTRY,
107
+ mime=TEXT_MIME_TYPES[ArtifactKind.HTML],
108
+ files=_site_files(folder),
109
+ )
110
+
111
+
112
+ def snapshot_path(path: Path, workspace: Path, kind: ArtifactKind | None = None, title: str = "") -> Snapshot:
113
+ """Snapshot a written file or folder; ``kind`` defaults to the suffix's kind."""
114
+ if path.is_dir() and not path.is_symlink():
115
+ if kind not in (None, ArtifactKind.HTML):
116
+ raise ArtifactError(f"only an html artifact can be a folder: {path}")
117
+ return snapshot_site(path, workspace, title)
118
+ chosen = kind or kind_of(path)
119
+ if chosen is None:
120
+ raise ArtifactError(f"not an html, csv, json or image file: {path}")
121
+ if chosen is ArtifactKind.HTML and path.name == SITE_ENTRY and path.parent != workspace:
122
+ return snapshot_site(path.parent, workspace, title)
123
+ payload = _read(path)
124
+ if chosen is ArtifactKind.IMAGE:
125
+ mime = image_mime(payload, path.name)
126
+ else:
127
+ _check_text(chosen, payload, path.name)
128
+ mime = TEXT_MIME_TYPES[chosen]
129
+ return Snapshot(
130
+ kind=chosen,
131
+ source=display_source(path, workspace),
132
+ title=title or path.name,
133
+ entry=path.name,
134
+ mime=mime,
135
+ files=((path.name, payload),),
136
+ )
137
+
138
+
139
+ def snapshot_image_part(part: Mapping[str, object], call_id: str, index: int) -> Snapshot | None:
140
+ """An inline image a tool returned without writing a file."""
141
+ data = part.get("data")
142
+ if part.get("type") != "image" or not isinstance(data, str):
143
+ return None
144
+ try:
145
+ payload = base64.b64decode(data, validate=True)
146
+ except (binascii.Error, ValueError):
147
+ return None
148
+ filename = part.get("filename")
149
+ name = Path(filename).name if isinstance(filename, str) and Path(filename).name else f"image-{index + 1}"
150
+ try:
151
+ mime = image_mime(payload, name)
152
+ except ArtifactError:
153
+ return None
154
+ suffix = next(key for key, value in IMAGE_MIME_TYPES.items() if value == mime)
155
+ entry = name if Path(name).suffix.lower() in IMAGE_MIME_TYPES else f"{name}{suffix}"
156
+ return Snapshot(
157
+ kind=ArtifactKind.IMAGE,
158
+ source=f"{call_id}#image-{index + 1}",
159
+ title=name,
160
+ entry=entry,
161
+ mime=mime,
162
+ files=((entry, payload),),
163
+ )
164
+
165
+
166
+ __all__ = [
167
+ "ArtifactError", "MAX_FILE_BYTES", "MAX_SITE_BYTES", "MAX_SITE_FILES", "SITE_ENTRY", "Snapshot",
168
+ "display_source", "image_mime", "snapshot_image_part", "snapshot_path", "snapshot_site",
169
+ ]
@@ -0,0 +1,51 @@
1
+ """The four artifact kinds and the file suffixes that map to them."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from enum import StrEnum
6
+ from pathlib import Path
7
+
8
+
9
+ class ArtifactKind(StrEnum):
10
+ """What an artifact holds. Hosts pick a preview from this."""
11
+
12
+ HTML = "html"
13
+ CSV = "csv"
14
+ JSON = "json"
15
+ IMAGE = "image"
16
+
17
+
18
+ IMAGE_MIME_TYPES = {
19
+ ".png": "image/png",
20
+ ".jpg": "image/jpeg",
21
+ ".jpeg": "image/jpeg",
22
+ ".webp": "image/webp",
23
+ ".gif": "image/gif",
24
+ ".svg": "image/svg+xml",
25
+ }
26
+ TEXT_MIME_TYPES = {
27
+ ArtifactKind.HTML: "text/html",
28
+ ArtifactKind.CSV: "text/csv",
29
+ ArtifactKind.JSON: "application/json",
30
+ }
31
+ SUFFIX_KINDS = {
32
+ ".html": ArtifactKind.HTML,
33
+ ".csv": ArtifactKind.CSV,
34
+ ".json": ArtifactKind.JSON,
35
+ **{suffix: ArtifactKind.IMAGE for suffix in IMAGE_MIME_TYPES},
36
+ }
37
+
38
+
39
+ def kind_of(path: Path) -> ArtifactKind | None:
40
+ """The kind auto-capture assigns to ``path``, or ``None`` for other files."""
41
+ return SUFFIX_KINDS.get(path.suffix.lower())
42
+
43
+
44
+ def mime_of(kind: ArtifactKind, entry: Path) -> str:
45
+ """The entry file's media type. An image without a known suffix is generic."""
46
+ if kind is ArtifactKind.IMAGE:
47
+ return IMAGE_MIME_TYPES.get(entry.suffix.lower(), "application/octet-stream")
48
+ return TEXT_MIME_TYPES[kind]
49
+
50
+
51
+ __all__ = ["IMAGE_MIME_TYPES", "SUFFIX_KINDS", "TEXT_MIME_TYPES", "ArtifactKind", "kind_of", "mime_of"]
@@ -0,0 +1,48 @@
1
+ """Files that match an artifact suffix but are project plumbing, not output.
2
+
3
+ Auto-capture skips them; ``save_artifact`` still keeps any of them on request.
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ import fnmatch
9
+ import subprocess
10
+ from pathlib import Path
11
+
12
+ # Any path through one of these folders is dependencies, VCS data or build output.
13
+ NOISE_DIRS = frozenset({"node_modules", ".git", "dist", "build"})
14
+ MANIFEST_NAMES = frozenset({"package.json", "package-lock.json", "npm-shrinkwrap.json"})
15
+ CONFIG_PATTERNS = ("tsconfig*.json", "*.config.json")
16
+ # Lockfiles of every package manager: yarn.lock, Cargo.lock, uv.lock,
17
+ # pnpm-lock.yaml, bun.lock(b), deno.lock, *.lock.json, ...
18
+ LOCK_PATTERNS = ("*.lock", "*.lockb", "*-lock.json", "*-lock.yaml", "*.lock.json", "*-lock.yml")
19
+ GIT_TIMEOUT_SECONDS = 5
20
+
21
+
22
+ def is_noise(path: Path, workspace: Path) -> bool:
23
+ """A manifest, config or lockfile, or anything under a noise folder."""
24
+ parts = path.relative_to(workspace).parts if path.is_relative_to(workspace) else path.parts
25
+ if any(part in NOISE_DIRS for part in parts[:-1]):
26
+ return True
27
+ name = path.name.lower()
28
+ if name in MANIFEST_NAMES:
29
+ return True
30
+ return any(fnmatch.fnmatchcase(name, pattern) for pattern in (*CONFIG_PATTERNS, *LOCK_PATTERNS))
31
+
32
+
33
+ def git_tracked(path: Path) -> bool:
34
+ """Whether git tracks ``path`` in the repository that contains it."""
35
+ try:
36
+ result = subprocess.run(
37
+ ["git", "-C", str(path.parent), "ls-files", "--error-unmatch", "--", path.name],
38
+ capture_output=True,
39
+ timeout=GIT_TIMEOUT_SECONDS,
40
+ check=False,
41
+ )
42
+ except (OSError, subprocess.TimeoutExpired):
43
+ # No git, or a hung repository: nothing proves the file is tracked.
44
+ return False
45
+ return result.returncode == 0
46
+
47
+
48
+ __all__ = ["NOISE_DIRS", "git_tracked", "is_noise"]