symphony-code 0.0.5__tar.gz → 0.0.7__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 (230) hide show
  1. {symphony_code-0.0.5 → symphony_code-0.0.7}/PKG-INFO +4 -3
  2. {symphony_code-0.0.5 → symphony_code-0.0.7}/pyproject.toml +4 -3
  3. {symphony_code-0.0.5 → symphony_code-0.0.7}/pyproject.toml.orig +5 -3
  4. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/__init__.py +0 -2
  5. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/learning/addon.py +2 -2
  6. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/learning/loop.py +10 -2
  7. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/manager/discovery.py +10 -5
  8. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/jsonl.py +44 -11
  9. symphony_code-0.0.7/src/coding_agent/addons/plugins/__init__.py +43 -0
  10. symphony_code-0.0.7/src/coding_agent/addons/plugins/install.py +140 -0
  11. symphony_code-0.0.7/src/coding_agent/addons/plugins/manifest.py +142 -0
  12. symphony_code-0.0.7/src/coding_agent/addons/plugins/marketplace.py +115 -0
  13. symphony_code-0.0.7/src/coding_agent/addons/plugins/marketplaces.py +103 -0
  14. symphony_code-0.0.7/src/coding_agent/addons/plugins/resolve.py +164 -0
  15. symphony_code-0.0.7/src/coding_agent/addons/plugins/state.py +96 -0
  16. symphony_code-0.0.7/src/coding_agent/addons/plugins/themes.py +143 -0
  17. symphony_code-0.0.7/src/coding_agent/addons/skills/__init__.py +37 -0
  18. symphony_code-0.0.7/src/coding_agent/addons/skills/catalog.py +111 -0
  19. symphony_code-0.0.7/src/coding_agent/addons/skills/discovery.py +56 -0
  20. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/frontmatter.py +7 -2
  21. symphony_code-0.0.7/src/coding_agent/addons/skills/install.py +167 -0
  22. symphony_code-0.0.7/src/coding_agent/addons/skills/models.py +47 -0
  23. symphony_code-0.0.7/src/coding_agent/addons/skills/registry.py +112 -0
  24. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/voice/addon.py +5 -0
  25. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/voice/credentials.py +1 -1
  26. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/agent.py +66 -68
  27. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/cli.py +16 -1
  28. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/commands/catalog.py +5 -1
  29. symphony_code-0.0.7/src/coding_agent/commands/cli_support.py +78 -0
  30. symphony_code-0.0.7/src/coding_agent/commands/extension_slash.py +38 -0
  31. symphony_code-0.0.7/src/coding_agent/commands/installed.py +92 -0
  32. symphony_code-0.0.7/src/coding_agent/commands/plugins_cli.py +121 -0
  33. symphony_code-0.0.7/src/coding_agent/commands/skills_cli.py +78 -0
  34. symphony_code-0.0.7/src/coding_agent/commands/themes_cli.py +75 -0
  35. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/config/__init__.py +8 -0
  36. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/config/config.py +44 -5
  37. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/config/credentials.py +1 -1
  38. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/config/prompts.py +1 -1
  39. symphony_code-0.0.7/src/coding_agent/extensions/__init__.py +10 -0
  40. symphony_code-0.0.7/src/coding_agent/extensions/diagnostics.py +25 -0
  41. symphony_code-0.0.7/src/coding_agent/extensions/roots.py +71 -0
  42. symphony_code-0.0.7/src/coding_agent/extensions/source.py +156 -0
  43. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/stdio/commands.py +9 -4
  44. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/run/cli.py +6 -3
  45. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/search.py +18 -5
  46. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/EFFICIENCY_PLAN.md +3 -2
  47. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/app.py +110 -35
  48. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/chrome/__init__.py +5 -0
  49. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/chrome/footer.py +6 -4
  50. symphony_code-0.0.7/src/coding_agent/tui/chrome/session.py +42 -0
  51. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/chrome/topbar.py +31 -21
  52. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/commands/manager.py +76 -67
  53. symphony_code-0.0.7/src/coding_agent/tui/commands/theme.py +53 -0
  54. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/composer/input.py +9 -3
  55. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/composer/surface.py +10 -22
  56. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/composer/voice_mode.py +76 -83
  57. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/runtime/events.py +87 -57
  58. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/runtime/state.py +20 -0
  59. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/runtime/subagent.py +35 -21
  60. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/runtime/turn.py +72 -53
  61. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/ask.py +2 -3
  62. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/diff.py +7 -7
  63. symphony_code-0.0.7/src/coding_agent/tui/screens/extensions.py +97 -0
  64. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/history.py +71 -27
  65. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/onboard.py +1 -1
  66. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/resume.py +14 -11
  67. symphony_code-0.0.7/src/coding_agent/tui/screens/theme_picker.py +103 -0
  68. symphony_code-0.0.7/src/coding_agent/tui/screens/usage.py +98 -0
  69. symphony_code-0.0.7/src/coding_agent/tui/terminal_title.py +28 -0
  70. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/theme/__init__.py +4 -2
  71. symphony_code-0.0.7/src/coding_agent/tui/theme/active.py +44 -0
  72. symphony_code-0.0.7/src/coding_agent/tui/theme/ansi_colors.py +63 -0
  73. symphony_code-0.0.7/src/coding_agent/tui/theme/base_palettes.py +104 -0
  74. symphony_code-0.0.7/src/coding_agent/tui/theme/claude_slots.py +67 -0
  75. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/theme/load.py +31 -13
  76. symphony_code-0.0.7/src/coding_agent/tui/theme/picker_css.py +35 -0
  77. symphony_code-0.0.7/src/coding_agent/tui/theme/plugin_palette.py +65 -0
  78. symphony_code-0.0.7/src/coding_agent/tui/theme/style.py +130 -0
  79. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/theme/theme.toml +8 -0
  80. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/activity.py +14 -13
  81. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/calls.py +8 -3
  82. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/modal.py +4 -19
  83. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/transcript/messages.py +43 -18
  84. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/transcript/process.py +13 -9
  85. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/transcript/surface.py +22 -12
  86. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/transcript/thinking_markdown.py +3 -2
  87. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/updates.py +5 -3
  88. symphony_code-0.0.5/src/coding_agent/addons/plugins/__init__.py +0 -19
  89. symphony_code-0.0.5/src/coding_agent/addons/plugins/install.py +0 -37
  90. symphony_code-0.0.5/src/coding_agent/addons/plugins/manager.py +0 -140
  91. symphony_code-0.0.5/src/coding_agent/addons/plugins/models.py +0 -50
  92. symphony_code-0.0.5/src/coding_agent/addons/skills/__init__.py +0 -28
  93. symphony_code-0.0.5/src/coding_agent/addons/skills/addon.py +0 -26
  94. symphony_code-0.0.5/src/coding_agent/addons/skills/bundled_skills/pick-model/SKILL.md +0 -24
  95. symphony_code-0.0.5/src/coding_agent/addons/skills/models.py +0 -57
  96. symphony_code-0.0.5/src/coding_agent/addons/skills/registry.py +0 -135
  97. symphony_code-0.0.5/src/coding_agent/addons/skills/tool.py +0 -54
  98. symphony_code-0.0.5/src/coding_agent/tui/screens/extensions.py +0 -68
  99. symphony_code-0.0.5/src/coding_agent/tui/theme/style.py +0 -95
  100. {symphony_code-0.0.5 → symphony_code-0.0.7}/LICENSE +0 -0
  101. {symphony_code-0.0.5 → symphony_code-0.0.7}/README.md +0 -0
  102. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/__init__.py +0 -0
  103. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/_lazy.py +0 -0
  104. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/approvals.py +0 -0
  105. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/artifacts/__init__.py +0 -0
  106. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/artifacts/addon.py +0 -0
  107. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/artifacts/capture.py +0 -0
  108. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/artifacts/kinds.py +0 -0
  109. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/artifacts/noise.py +0 -0
  110. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/artifacts/store.py +0 -0
  111. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/compaction/__init__.py +0 -0
  112. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/compaction/addon.py +0 -0
  113. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/compaction/compactor.py +0 -0
  114. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/compaction/prompts.py +0 -0
  115. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/compaction/transcript.py +0 -0
  116. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/evaluation/__init__.py +0 -0
  117. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/evaluation/addon.py +0 -0
  118. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/evaluation/evaluators.py +0 -0
  119. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/evaluation/handlers.py +0 -0
  120. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/evaluation/policy.py +0 -0
  121. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/evaluation/protocol.py +0 -0
  122. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/evaluation/state.py +0 -0
  123. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/langfuse/__init__.py +0 -0
  124. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/langfuse/addon.py +0 -0
  125. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/langfuse/install.py +0 -0
  126. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/langfuse/serialize.py +0 -0
  127. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/learning/__init__.py +0 -0
  128. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/learning/prompts.py +0 -0
  129. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/learning/sanitize.py +0 -0
  130. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/learning/store.py +0 -0
  131. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/manager/__init__.py +0 -0
  132. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/manager/bridge.py +0 -0
  133. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/manager/report.py +0 -0
  134. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/manager/runtime.py +0 -0
  135. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/manager/tool_changes.py +0 -0
  136. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/__init__.py +0 -0
  137. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/active.py +0 -0
  138. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/artifacts.py +0 -0
  139. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/collection.py +0 -0
  140. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/compatibility.py +0 -0
  141. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/images.py +0 -0
  142. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/persistence/presentation.py +0 -0
  143. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/args.py +0 -0
  144. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/addon-authoring/SKILL.md +0 -0
  145. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/context-budget/SKILL.md +0 -0
  146. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/orient-first/SKILL.md +0 -0
  147. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/security-boundary/SKILL.md +0 -0
  148. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/skill-discipline/SKILL.md +0 -0
  149. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/surgical-edit/SKILL.md +0 -0
  150. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/systematic-debug/SKILL.md +0 -0
  151. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/skills/bundled_skills/verify-before-done/SKILL.md +0 -0
  152. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/voice/__init__.py +0 -0
  153. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/voice/playback.py +0 -0
  154. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/voice/speak.py +0 -0
  155. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/voice/stream.py +0 -0
  156. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/addons/voice/summary.py +0 -0
  157. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/bench/__init__.py +0 -0
  158. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/bench/cli.py +0 -0
  159. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/bench/patch.py +0 -0
  160. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/commands/__init__.py +0 -0
  161. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/commands/jev_argument.py +0 -0
  162. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/config/personalities.json +0 -0
  163. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/config/personalities.py +0 -0
  164. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/__init__.py +0 -0
  165. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/acp/README.md +0 -0
  166. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/acp/__init__.py +0 -0
  167. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/acp/mapping.py +0 -0
  168. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/acp/server.py +0 -0
  169. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/acp/transport.py +0 -0
  170. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/stdio/README.md +0 -0
  171. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/stdio/__init__.py +0 -0
  172. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/stdio/catalog.py +0 -0
  173. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/stdio/requests.py +0 -0
  174. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/stdio/server.py +0 -0
  175. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/protocols/stdio/transport.py +0 -0
  176. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/py.typed +0 -0
  177. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/resources/__init__.py +0 -0
  178. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/resources/usage.py +0 -0
  179. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/run/__init__.py +0 -0
  180. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/run/detach.py +0 -0
  181. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/run/interrupted.py +0 -0
  182. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/run/log_sink.py +0 -0
  183. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tls.py +0 -0
  184. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/__init__.py +0 -0
  185. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/ask_user.py +0 -0
  186. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/base.py +0 -0
  187. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/bash.py +0 -0
  188. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/bash_jobs.py +0 -0
  189. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/generate_image.py +0 -0
  190. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/memory.py +0 -0
  191. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/patch.py +0 -0
  192. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/read_file.py +0 -0
  193. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/save_artifact.py +0 -0
  194. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/summary.py +0 -0
  195. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/web_search.py +0 -0
  196. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tools/write_file.py +0 -0
  197. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/__init__.py +0 -0
  198. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/__main__.py +0 -0
  199. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/commands/__init__.py +0 -0
  200. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/commands/catalog.py +0 -0
  201. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/composer/__init__.py +0 -0
  202. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/composer/slash_menu.py +0 -0
  203. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/composer/voice.py +0 -0
  204. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/runtime/__init__.py +0 -0
  205. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/runtime/sink.py +0 -0
  206. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/__init__.py +0 -0
  207. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/artifacts.py +0 -0
  208. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/context.py +0 -0
  209. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/cost.py +0 -0
  210. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/dashboard.py +0 -0
  211. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/file_selector.py +0 -0
  212. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/langfuse.py +0 -0
  213. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/learning.py +0 -0
  214. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/modal.py +0 -0
  215. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/screens/update.py +0 -0
  216. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/__init__.py +0 -0
  217. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/code_view.py +0 -0
  218. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/images.py +0 -0
  219. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/labels.py +0 -0
  220. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/partial_args.py +0 -0
  221. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/tools/snapshots.py +0 -0
  222. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/transcript/__init__.py +0 -0
  223. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/transcript/artifact.py +0 -0
  224. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/tui/transcript/decision.py +0 -0
  225. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/web/__init__.py +0 -0
  226. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/web/bundle.py +0 -0
  227. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/web/server.py +0 -0
  228. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/web/sessions.py +0 -0
  229. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/web/worker.py +0 -0
  230. {symphony_code-0.0.5 → symphony_code-0.0.7}/src/coding_agent/widget_fields.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: symphony-code
3
- Version: 0.0.5
3
+ Version: 0.0.7
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>
7
7
  License-Expression: MIT
8
8
  License-File: LICENSE
9
- Requires-Dist: symphony-core>=0.0.5
10
- Requires-Dist: symphony-harness>=0.0.5
9
+ Requires-Dist: symphony-core>=0.0.7
10
+ Requires-Dist: symphony-harness>=0.0.7
11
11
  Requires-Dist: pillow>=12.3.0
12
12
  Requires-Dist: pydantic>=2.0.0
13
13
  Requires-Dist: certifi>=2024.2.2
@@ -16,6 +16,7 @@ Requires-Dist: textual>=8.2.8
16
16
  Requires-Dist: textual-image>=0.12.0
17
17
  Requires-Dist: termaid>=0.9.0
18
18
  Requires-Dist: sounddevice>=0.5.1
19
+ Requires-Dist: setproctitle>=1.3.7
19
20
  Requires-Dist: langfuse>=3.0.0 ; extra == 'langfuse'
20
21
  Requires-Python: >=3.11
21
22
  Project-URL: Homepage, https://github.com/Sarthakischauhan/symphony
@@ -1,14 +1,14 @@
1
1
  [project]
2
2
  name = "symphony-code"
3
- version = "0.0.5"
3
+ version = "0.0.7"
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"
7
7
  license-files = ["LICENSE"]
8
8
  requires-python = ">=3.11"
9
9
  dependencies = [
10
- "symphony-core>=0.0.5",
11
- "symphony-harness>=0.0.5",
10
+ "symphony-core>=0.0.7",
11
+ "symphony-harness>=0.0.7",
12
12
  "pillow>=12.3.0",
13
13
  "pydantic>=2.0.0",
14
14
  "certifi>=2024.2.2",
@@ -17,6 +17,7 @@ dependencies = [
17
17
  "textual-image>=0.12.0",
18
18
  "termaid>=0.9.0",
19
19
  "sounddevice>=0.5.1",
20
+ "setproctitle>=1.3.7",
20
21
  ]
21
22
 
22
23
  [[project.authors]]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "symphony-code"
3
- version = "0.0.5"
3
+ version = "0.0.7"
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"
@@ -10,8 +10,8 @@ authors = [
10
10
  ]
11
11
  requires-python = ">=3.11"
12
12
  dependencies = [
13
- "symphony-core>=0.0.5",
14
- "symphony-harness>=0.0.5",
13
+ "symphony-core>=0.0.7",
14
+ "symphony-harness>=0.0.7",
15
15
  "pillow>=12.3.0",
16
16
  "pydantic>=2.0.0",
17
17
  # coding_agent.tls: stdlib HTTPS on uv-managed Pythons without a CA store.
@@ -21,6 +21,8 @@ dependencies = [
21
21
  "textual-image>=0.12.0",
22
22
  "termaid>=0.9.0",
23
23
  "sounddevice>=0.5.1",
24
+ # coding_agent.cli: the process name shows as `symphony`, not `python`, in ps and tab titles.
25
+ "setproctitle>=1.3.7",
24
26
  ]
25
27
 
26
28
  [project.optional-dependencies]
@@ -15,7 +15,6 @@ from coding_agent.addons.learning.addon import (
15
15
  inject_memory,
16
16
  strip_memory_context,
17
17
  )
18
- from coding_agent.addons.skills.addon import SkillsAddon
19
18
 
20
19
  __all__ = [
21
20
  "AiCompactionAddon",
@@ -26,7 +25,6 @@ __all__ = [
26
25
  "LangfuseAddon",
27
26
  "LearningAddon",
28
27
  "SessionMemoryAddon",
29
- "SkillsAddon",
30
28
  "ai_compaction_from_config",
31
29
  "inject_memory",
32
30
  "jev_from_config",
@@ -122,7 +122,7 @@ class LearningAddon(Addon):
122
122
  async def before_run(self, **payload: Any) -> None:
123
123
  self.task = next((text_from_content(m.content) for m in reversed(payload.get("messages") or [])
124
124
  if isinstance(m, Message) and m.role == "user"), str(payload.get("task") or ""))
125
- self.loop.resume()
125
+ self.loop.begin_run()
126
126
 
127
127
  async def after_turn(self, **payload: Any) -> None:
128
128
  if self.should_review():
@@ -174,7 +174,7 @@ class SessionMemoryAddon(Addon):
174
174
  self.task = next((text_from_content(m.content) for m in reversed(payload.get("messages") or [])
175
175
  if isinstance(m, Message) and m.role == "user"), str(payload.get("task") or ""))
176
176
  if self.should_inject:
177
- self.loop.resume()
177
+ self.loop.begin_run()
178
178
 
179
179
  async def after_turn(self, **payload: Any) -> None:
180
180
  if self.should_inject:
@@ -112,6 +112,7 @@ class LearningLoop:
112
112
  self.context_limit = context_limit
113
113
  self.context_max_chars = context_max_chars
114
114
  self._worker: asyncio.Task[None] | None = None
115
+ self._last_capture_job: str | None = None
115
116
  self._recaps: dict[str, Emit] = {}
116
117
  # Control-plane emit for capture notices; bound by ``LearningAddon``.
117
118
  self.emit: Emit | None = None
@@ -121,11 +122,18 @@ class LearningLoop:
121
122
  job_id = self.store.enqueue_capture(
122
123
  sanitize_task(task), _capture_messages(messages), self.store.session_id,
123
124
  )
124
- self.resume()
125
+ if job_id != self._last_capture_job:
126
+ self._last_capture_job = job_id
127
+ self.resume()
125
128
  return job_id
126
129
 
130
+ def begin_run(self) -> None:
131
+ """Allow pending captures to retry on a subsequent run."""
132
+ self._last_capture_job = None
133
+ self.resume()
134
+
127
135
  def resume(self) -> None:
128
- """Resume durable pending jobs before a run (also safe outside an event loop)."""
136
+ """Resume durable pending jobs (also safe outside an event loop)."""
129
137
  if self._worker is not None and not self._worker.done():
130
138
  return
131
139
  try:
@@ -1,14 +1,15 @@
1
1
  """Where user addons live and which names they may not take.
2
2
 
3
- Only ``<symphony home>/addons/<name>/`` is scanned (``SYMPHONY_HOME``
4
- overrides the home). There is no project-local addon folder.
3
+ ``<symphony home>/addons/<name>/`` is scanned (``SYMPHONY_HOME`` overrides the
4
+ home), and so is the addon directory of every enabled plugin. There is
5
+ no project-local addon folder.
5
6
  """
6
7
 
7
8
  from __future__ import annotations
8
9
 
9
10
  import pkgutil
10
11
  from pathlib import Path
11
- from typing import Collection
12
+ from typing import Collection, Iterable
12
13
 
13
14
  import coding_agent.addons as builtin_addons
14
15
  from core_harness.extensions import ExtensionSnapshot, load_addons
@@ -24,9 +25,13 @@ def user_addons_root() -> Path:
24
25
  return symphony_dir() / "addons"
25
26
 
26
27
 
27
- def load_user_addons(reserved_names: Collection[str] = ()) -> ExtensionSnapshot:
28
+ def load_user_addons(reserved_names: Collection[str] = (), plugin_roots: Iterable[Path] = ()) -> ExtensionSnapshot:
29
+ """Load ``~/.symphony/addons`` and ``plugin_roots``, the addon directories of enabled plugins.
30
+
31
+ The plugins package decides which roots are enabled; this loader runs whatever it is given.
32
+ """
28
33
  return load_addons(
29
- (user_addons_root(),),
34
+ (user_addons_root(), *plugin_roots),
30
35
  reserved_names=BUILTIN_ADDON_NAMES | frozenset(reserved_names),
31
36
  )
32
37
 
@@ -8,6 +8,7 @@ reconstructed from those events; no separate context file is written.
8
8
 
9
9
  from __future__ import annotations
10
10
 
11
+ import asyncio
11
12
  import fcntl
12
13
  import hashlib
13
14
  import json
@@ -166,6 +167,7 @@ class _SessionIndex:
166
167
  self.event_keys: set[tuple[str, int]] = set()
167
168
  self.collected: set[tuple[str, int]] = set()
168
169
  self.collectable: Dict[str, List[tuple[str, int]]] = {}
170
+ self.collectable_keys: set[tuple[str, int]] = set()
169
171
  self.run_started: set[str] = set()
170
172
  self.latest_terminal_run = ""
171
173
  self.messages: List[Dict[str, Any]] = []
@@ -231,8 +233,9 @@ class _SessionIndex:
231
233
  return
232
234
  if run_id in self.run_started and event_type in COLLECTABLE_EVENT_TYPES:
233
235
  bucket = self.collectable.setdefault(run_id, [])
234
- if key not in self.collected and key not in set(bucket):
236
+ if key not in self.collected and key not in self.collectable_keys:
235
237
  bucket.append(key)
238
+ self.collectable_keys.add(key)
236
239
 
237
240
  def _note_message(self, entry: Dict[str, Any], seq: int) -> None:
238
241
  payload = JsonlPersistence._message_payload_from_entry(entry)
@@ -891,8 +894,18 @@ class JsonlPersistence:
891
894
  saved = self._read_listing(session_id, size)
892
895
  if saved is not None:
893
896
  return saved
894
- self._read_entries(session_id)
895
- return self._refresh_listing(session_id)
897
+ # Older bundles may not have a listing yet. Building a display row
898
+ # must not hydrate every message/image or repair every artifact in the
899
+ # journal; those are only needed when this session is actually opened.
900
+ with self._session_lock(session_id):
901
+ self._sync_legacy(session_id)
902
+ self._require_version(session_id)
903
+ path = self._path(session_id)
904
+ size = self._mark(path)
905
+ listing = self._listing_from_entries(self._load_transcript(path))
906
+ listing["transcript_size"] = size
907
+ refresh_snapshot(self._listing_path(session_id), listing)
908
+ return listing
896
909
 
897
910
  def _transcript_messages(self, entries: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
898
911
  """Return every persisted message, including messages before compaction."""
@@ -904,9 +917,22 @@ class JsonlPersistence:
904
917
  return
905
918
  fields = self.fields
906
919
  for name, body in fields.apply(event_type, payload) if fields is not None else [(event_type, payload)]:
907
- self._journal(name, body)
908
- if name == "usage":
909
- self._record_usage_cost(body)
920
+ await self._durable_thread(self._append_event_sync, name, body)
921
+
922
+ @staticmethod
923
+ async def _durable_thread(function: Callable[..., Any], *args: Any) -> Any:
924
+ write = asyncio.create_task(asyncio.to_thread(function, *args))
925
+ try:
926
+ return await asyncio.shield(write)
927
+ except asyncio.CancelledError:
928
+ # Do not leave a write running behind subsequent persistence operations.
929
+ await write
930
+ raise
931
+
932
+ def _append_event_sync(self, name: str, body: dict[str, Any]) -> None:
933
+ self._journal(name, body)
934
+ if name == "usage":
935
+ self._record_usage_cost(body)
910
936
 
911
937
  def _record_usage_cost(self, payload: dict[str, Any]) -> None:
912
938
  if payload.get("parent_id"):
@@ -1068,6 +1094,9 @@ class JsonlPersistence:
1068
1094
  session_id: str,
1069
1095
  messages: List[Message],
1070
1096
  ) -> None:
1097
+ await self._durable_thread(self._save_conversation, session_id, list(messages))
1098
+
1099
+ def _save_conversation(self, session_id: str, messages: List[Message]) -> None:
1071
1100
  with self._lock, self._session_lock(session_id):
1072
1101
  self._stamp_client(session_id)
1073
1102
  entries = self._read_entries(session_id)
@@ -1212,16 +1241,20 @@ class JsonlPersistence:
1212
1241
  ]
1213
1242
 
1214
1243
  async def save_checkpoint(self, *, checkpoint: Checkpoint) -> None:
1215
- # The journal already holds the messages; do not dump them every turn.
1244
+ # Capture live agent state on its owning event-loop thread.
1216
1245
  payload = checkpoint.model_dump(exclude={"messages"})
1217
1246
  payload["metadata"] = {**self.checkpoint_metadata(), **payload["metadata"]}
1218
- with self._lock, self._session_lock(checkpoint.session_id):
1219
- entries = self._read_entries(checkpoint.session_id)
1247
+ await self._durable_thread(self._save_checkpoint, checkpoint.session_id, payload)
1248
+
1249
+ def _save_checkpoint(self, session_id: str, payload: dict[str, Any]) -> None:
1250
+ # The journal already holds the messages; do not dump them every turn.
1251
+ with self._lock, self._session_lock(session_id):
1252
+ entries = self._read_entries(session_id)
1220
1253
  outgoing: List[Dict[str, Any]] = []
1221
1254
  if not entries:
1222
- outgoing.append(self._header(checkpoint.session_id))
1255
+ outgoing.append(self._header(session_id))
1223
1256
  outgoing.append({"type": "checkpoint", "version": 1, **payload})
1224
- self._append_entries(checkpoint.session_id, outgoing)
1257
+ self._append_entries(session_id, outgoing)
1225
1258
 
1226
1259
  def checkpoint_goal(self, session_id: str) -> str:
1227
1260
  """Return the latest saved goal without rebuilding the conversation."""
@@ -0,0 +1,43 @@
1
+ """Plugins: find them, validate them, install them, decide whether their code may load.
2
+
3
+ This package executes nothing. It hands a plugin's skill directories to
4
+ ``addons/skills``, the addon directories of enabled plugins to the addon loader, and
5
+ the themes of enabled plugins to the TUI.
6
+ """
7
+
8
+ from coding_agent.addons.plugins.install import (
9
+ UpdateResult,
10
+ install_plugin,
11
+ remove_plugin,
12
+ set_enabled,
13
+ update_plugins,
14
+ )
15
+ from coding_agent.addons.plugins.manifest import LoadedManifest, PluginManifest, read_manifest
16
+ from coding_agent.addons.plugins.marketplaces import (
17
+ add_marketplace,
18
+ list_marketplaces,
19
+ remove_marketplace,
20
+ update_marketplaces,
21
+ )
22
+ from coding_agent.addons.plugins.resolve import PluginSet, ResolvedPlugin, resolve_plugins
23
+ from coding_agent.addons.plugins.themes import PluginTheme, find_theme
24
+
25
+ __all__ = [
26
+ "LoadedManifest",
27
+ "PluginManifest",
28
+ "PluginSet",
29
+ "PluginTheme",
30
+ "ResolvedPlugin",
31
+ "UpdateResult",
32
+ "add_marketplace",
33
+ "find_theme",
34
+ "install_plugin",
35
+ "list_marketplaces",
36
+ "read_manifest",
37
+ "remove_marketplace",
38
+ "remove_plugin",
39
+ "resolve_plugins",
40
+ "set_enabled",
41
+ "update_marketplaces",
42
+ "update_plugins",
43
+ ]
@@ -0,0 +1,140 @@
1
+ """Install, update, remove, enable and disable plugins.
2
+
3
+ Installing copies files into the cache and records them in ``state.json``. It
4
+ never imports, builds or runs anything from the plugin. An enabled plugin's
5
+ addon loads on the next start; disable it to stop that. Enabling is the trust
6
+ decision, the same way other coding agents treat an installed plugin.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import re
12
+ import shutil
13
+ import tempfile
14
+ from dataclasses import dataclass
15
+ from pathlib import Path
16
+
17
+ from coding_agent.addons.plugins.manifest import read_manifest
18
+ from coding_agent.addons.plugins.marketplace import PluginOrigin, plugin_origin, read_marketplace
19
+ from coding_agent.addons.plugins.marketplaces import marketplace_root
20
+ from coding_agent.addons.plugins.resolve import ResolvedPlugin, resolve_plugins
21
+ from coding_agent.addons.plugins.state import PluginRecord, PluginState, load_state, plugins_dir, save_state
22
+ from coding_agent.extensions.source import parse_source, stage
23
+
24
+ DIRECT = "direct"
25
+ _UNSAFE = re.compile(r"[^\w.+-]")
26
+
27
+
28
+ @dataclass(frozen=True)
29
+ class UpdateResult:
30
+ key: str
31
+ before: str
32
+ after: str
33
+ error: str = ""
34
+
35
+
36
+ def _origin(state: PluginState, record_marketplace: str, name: str) -> PluginOrigin:
37
+ if record_marketplace not in state.marketplaces:
38
+ raise ValueError(f"marketplace {record_marketplace!r} is not added; run: symphony plugins marketplace add <source>")
39
+ root = marketplace_root(record_marketplace)
40
+ return plugin_origin(read_marketplace(root).entry(name), root)
41
+
42
+
43
+ def _delete_cached(relative: str) -> None:
44
+ """Delete a cached version, then the plugin and marketplace folders if that left them empty."""
45
+ path = plugins_dir() / relative
46
+ shutil.rmtree(path, ignore_errors=True)
47
+ for parent in (path.parent, path.parent.parent):
48
+ if parent.is_dir() and not any(parent.iterdir()) and parent != plugins_dir() / "cache":
49
+ parent.rmdir()
50
+
51
+
52
+ def _install(state: PluginState, origin: PluginOrigin, *, marketplace: str, via: str) -> PluginRecord:
53
+ """Stage, validate, then move into the cache. Nothing is written if validation fails."""
54
+ plugins_dir().mkdir(parents=True, exist_ok=True)
55
+ with tempfile.TemporaryDirectory(dir=plugins_dir(), prefix=".staging-") as scratch:
56
+ staged = Path(scratch) / "plugin"
57
+ revision = stage(origin.source, staged, sha=origin.sha)
58
+ loaded = read_manifest(staged)
59
+ name = loaded.manifest.name
60
+ version = _UNSAFE.sub("_", loaded.manifest.version or revision[:12] or "unversioned")
61
+ destination = plugins_dir() / "cache" / marketplace / name / version
62
+ if destination.exists():
63
+ shutil.rmtree(destination)
64
+ destination.parent.mkdir(parents=True, exist_ok=True)
65
+ shutil.move(str(staged), destination)
66
+ key = f"{name}@{marketplace}"
67
+ previous = state.plugins.get(key)
68
+ record = PluginRecord(
69
+ name=name, marketplace=marketplace, version=version, revision=revision, source=origin.source, via=via,
70
+ path=destination.relative_to(plugins_dir()).as_posix(), installed=True,
71
+ enabled=previous.enabled if previous else True,
72
+ )
73
+ if previous is not None and previous.path != record.path:
74
+ _delete_cached(previous.path)
75
+ state.plugins[key] = record
76
+ return record
77
+
78
+
79
+ def install_plugin(text: str, *, cwd: Path, subdir: str = "") -> PluginRecord:
80
+ """Install ``text``: a path, git URL[@ref], owner/repo, or plugin@marketplace."""
81
+ source = parse_source(text, cwd=cwd, subdir=subdir)
82
+ state = load_state()
83
+ if source.kind == "marketplace":
84
+ origin = _origin(state, source.marketplace, source.location)
85
+ record = _install(state, origin, marketplace=source.marketplace, via=text)
86
+ else:
87
+ record = _install(state, PluginOrigin(source), marketplace=DIRECT, via="")
88
+ save_state(state)
89
+ return record
90
+
91
+
92
+ def update_plugins(name: str | None = None) -> list[UpdateResult]:
93
+ """Re-fetch installed plugins from where they came from. Enabled stays enabled."""
94
+ state = load_state()
95
+ installed = {key: record for key, record in sorted(state.plugins.items()) if record.installed}
96
+ if name is not None:
97
+ installed = {key: record for key, record in installed.items() if name in {key, record.name}}
98
+ if not installed:
99
+ raise ValueError(f"no installed plugin named {name!r}; see: symphony plugins list")
100
+ results: list[UpdateResult] = []
101
+ for key, record in installed.items():
102
+ before = record.version or record.revision[:12]
103
+ try:
104
+ origin = _origin(state, record.marketplace, record.name) if record.via else PluginOrigin(record.source)
105
+ updated = _install(state, origin, marketplace=record.marketplace, via=record.via)
106
+ results.append(UpdateResult(key, before, updated.version))
107
+ except ValueError as exc:
108
+ results.append(UpdateResult(key, before, before, str(exc)))
109
+ save_state(state)
110
+ return results
111
+
112
+
113
+ def remove_plugin(reference: str, workspace: Path) -> ResolvedPlugin:
114
+ plugin = resolve_plugins(workspace).find(reference)
115
+ state = load_state()
116
+ record = state.plugins.get(plugin.key)
117
+ if record is None or not record.installed:
118
+ raise ValueError(f"{plugin.name} is not installed by symphony; it lives in {plugin.root}. Delete that directory to remove it.")
119
+ _delete_cached(record.path)
120
+ del state.plugins[plugin.key]
121
+ save_state(state)
122
+ return plugin
123
+
124
+
125
+ def _record(state: PluginState, plugin: ResolvedPlugin) -> PluginRecord:
126
+ """The state entry for ``plugin``; a plugin found in place gets one the first time it is changed."""
127
+ return state.plugins.get(plugin.key) or PluginRecord(name=plugin.name, path=str(plugin.root))
128
+
129
+
130
+ def set_enabled(reference: str, enabled: bool, workspace: Path) -> ResolvedPlugin:
131
+ plugin = resolve_plugins(workspace).find(reference)
132
+ state = load_state()
133
+ state.plugins[plugin.key] = _record(state, plugin).model_copy(update={"enabled": enabled})
134
+ save_state(state)
135
+ return plugin
136
+
137
+
138
+ __all__ = [
139
+ "DIRECT", "UpdateResult", "install_plugin", "remove_plugin", "set_enabled", "update_plugins",
140
+ ]
@@ -0,0 +1,142 @@
1
+ """Read a plugin's manifest in any of the formats plugins ship in.
2
+
3
+ Looked up in Codex's order, first valid file wins: the portable Agent Plugins
4
+ ``plugin.json`` at the root, then ``.codex-plugin``, ``.claude-plugin`` and
5
+ ``.cursor-plugin``. Reading is parsing JSON; no plugin code is touched.
6
+
7
+ What Symphony can use from a plugin: its skills (``skills`` defaults to
8
+ ``./skills/``) and, under ``extensions.symphony``, an addon directory. Anything
9
+ else the manifest or the plugin tree declares is reported as skipped with a
10
+ reason, never silently ignored and never pretended to work.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import json
16
+ from dataclasses import dataclass
17
+ from pathlib import Path
18
+ from typing import Annotated, Any
19
+
20
+ from pydantic import AfterValidator, BaseModel, ConfigDict, Field, ValidationError, field_validator
21
+
22
+ from coding_agent.addons.skills.args import fold_whitespace
23
+
24
+ MANIFEST_PATHS = (
25
+ "plugin.json",
26
+ ".codex-plugin/plugin.json",
27
+ ".claude-plugin/plugin.json",
28
+ ".cursor-plugin/plugin.json",
29
+ )
30
+ MAX_MANIFEST_BYTES = 256_000
31
+ PLUGIN_NAME = r"^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$"
32
+ # What a plugin can contribute that Symphony does not load, and why. A key in the
33
+ # manifest or a file or directory in the plugin tree each count as a contribution.
34
+ UNSUPPORTED: dict[str, str] = {
35
+ "agents": "plugin-defined agents are not supported",
36
+ "commands": "plugin slash commands are not supported",
37
+ "hooks": "hooks are not supported; Symphony runs plugin code only as an addon",
38
+ "automations": "automations are not supported",
39
+ "mcpServers": "MCP servers are not supported yet",
40
+ "apps": "apps are not supported",
41
+ "lspServers": "language servers are not supported",
42
+ "outputStyles": "output styles are not supported",
43
+ }
44
+ _TREE_MARKERS = {
45
+ "agents": "agents", "commands": "commands", "hooks": "hooks", "automations": "automations",
46
+ "hooks.json": "hooks", ".mcp.json": "mcpServers", "mcp.json": "mcpServers", ".app.json": "apps",
47
+ }
48
+
49
+
50
+ class SymphonyExtension(BaseModel):
51
+ """``extensions.symphony``: where the plugin's addons are. Declaring it means the plugin has code."""
52
+
53
+ model_config = ConfigDict(extra="forbid")
54
+
55
+ addons: str = "addons"
56
+
57
+ @field_validator("addons")
58
+ @classmethod
59
+ def _inside_plugin(cls, value: str) -> str:
60
+ path = Path(value)
61
+ if not value or path.is_absolute() or ".." in path.parts:
62
+ raise ValueError("addons must be a relative directory inside the plugin")
63
+ return value
64
+
65
+
66
+ class PluginManifest(BaseModel):
67
+ """The fields every format shares; the rest is ignored (and reported when unsupported)."""
68
+
69
+ model_config = ConfigDict(extra="ignore")
70
+
71
+ name: str = Field(pattern=PLUGIN_NAME)
72
+ version: str = ""
73
+ description: Annotated[str, AfterValidator(fold_whitespace), Field(max_length=1000)] = ""
74
+ skills: tuple[str, ...] = ("./skills/",)
75
+ extensions: dict[str, Any] = Field(default_factory=dict)
76
+
77
+ @field_validator("skills", mode="before")
78
+ @classmethod
79
+ def _one_or_many(cls, value: Any) -> Any:
80
+ return (value,) if isinstance(value, str) else value
81
+
82
+ @field_validator("skills")
83
+ @classmethod
84
+ def _inside_plugin(cls, value: tuple[str, ...]) -> tuple[str, ...]:
85
+ for item in value:
86
+ path = Path(item)
87
+ if not item or path.is_absolute() or ".." in path.parts:
88
+ raise ValueError(f"skills path {item!r} must be relative and stay inside the plugin")
89
+ return value
90
+
91
+ @property
92
+ def symphony(self) -> SymphonyExtension | None:
93
+ raw = self.extensions.get("symphony")
94
+ return None if raw is None else SymphonyExtension.model_validate(raw)
95
+
96
+
97
+ @dataclass(frozen=True)
98
+ class LoadedManifest:
99
+ manifest: PluginManifest
100
+ path: Path
101
+ root: Path
102
+ skipped: tuple[tuple[str, str], ...]
103
+
104
+
105
+ def _unsupported(root: Path, raw: dict[str, Any]) -> tuple[tuple[str, str], ...]:
106
+ found = {key for key in UNSUPPORTED if key in raw}
107
+ found |= {label for marker, label in _TREE_MARKERS.items() if (root / marker).exists()}
108
+ return tuple((label, UNSUPPORTED[label]) for label in UNSUPPORTED if label in found)
109
+
110
+
111
+ def read_manifest(root: Path) -> LoadedManifest:
112
+ """The first manifest under ``root`` that exists and validates; ``ValueError`` if none does."""
113
+ errors: list[str] = []
114
+ for relative in MANIFEST_PATHS:
115
+ path = root / relative
116
+ if not path.is_file():
117
+ continue
118
+ try:
119
+ if path.stat().st_size > MAX_MANIFEST_BYTES:
120
+ raise ValueError("manifest is too large")
121
+ raw = json.loads(path.read_text(encoding="utf-8"))
122
+ if not isinstance(raw, dict):
123
+ raise ValueError("manifest must be a JSON object")
124
+ manifest = PluginManifest.model_validate(raw)
125
+ if manifest.symphony is not None and not (root / manifest.symphony.addons).is_dir():
126
+ raise ValueError(f"extensions.symphony.addons {manifest.symphony.addons!r} is not a directory")
127
+ except (OSError, UnicodeError, ValueError, ValidationError) as exc:
128
+ errors.append(f"{relative}: {_reason(exc)}")
129
+ continue
130
+ return LoadedManifest(manifest, path, root, _unsupported(root, raw))
131
+ if errors:
132
+ raise ValueError("; ".join(errors))
133
+ raise ValueError("no plugin manifest (looked for " + ", ".join(MANIFEST_PATHS) + ")")
134
+
135
+
136
+ def _reason(exc: Exception) -> str:
137
+ if isinstance(exc, ValidationError):
138
+ return "; ".join(f"{'.'.join(str(part) for part in error['loc']) or 'manifest'}: {error['msg']}" for error in exc.errors())
139
+ return str(exc)
140
+
141
+
142
+ __all__ = ["MANIFEST_PATHS", "UNSUPPORTED", "LoadedManifest", "PluginManifest", "SymphonyExtension", "read_manifest"]