symphony-code 0.0.5__tar.gz → 0.0.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 (219) hide show
  1. {symphony_code-0.0.5 → symphony_code-0.0.6}/PKG-INFO +4 -3
  2. {symphony_code-0.0.5 → symphony_code-0.0.6}/pyproject.toml +4 -3
  3. {symphony_code-0.0.5 → symphony_code-0.0.6}/pyproject.toml.orig +5 -3
  4. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/__init__.py +0 -2
  5. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/manager/discovery.py +10 -5
  6. symphony_code-0.0.6/src/coding_agent/addons/plugins/__init__.py +39 -0
  7. symphony_code-0.0.6/src/coding_agent/addons/plugins/install.py +140 -0
  8. symphony_code-0.0.6/src/coding_agent/addons/plugins/manifest.py +142 -0
  9. symphony_code-0.0.6/src/coding_agent/addons/plugins/marketplace.py +115 -0
  10. symphony_code-0.0.6/src/coding_agent/addons/plugins/marketplaces.py +103 -0
  11. symphony_code-0.0.6/src/coding_agent/addons/plugins/resolve.py +155 -0
  12. symphony_code-0.0.6/src/coding_agent/addons/plugins/state.py +96 -0
  13. symphony_code-0.0.6/src/coding_agent/addons/skills/__init__.py +37 -0
  14. symphony_code-0.0.6/src/coding_agent/addons/skills/catalog.py +111 -0
  15. symphony_code-0.0.6/src/coding_agent/addons/skills/discovery.py +56 -0
  16. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/frontmatter.py +7 -2
  17. symphony_code-0.0.6/src/coding_agent/addons/skills/install.py +167 -0
  18. symphony_code-0.0.6/src/coding_agent/addons/skills/models.py +47 -0
  19. symphony_code-0.0.6/src/coding_agent/addons/skills/registry.py +112 -0
  20. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/voice/addon.py +5 -0
  21. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/voice/credentials.py +1 -1
  22. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/agent.py +61 -68
  23. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/cli.py +12 -1
  24. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/commands/catalog.py +4 -1
  25. symphony_code-0.0.6/src/coding_agent/commands/cli_support.py +78 -0
  26. symphony_code-0.0.6/src/coding_agent/commands/extension_slash.py +38 -0
  27. symphony_code-0.0.6/src/coding_agent/commands/installed.py +90 -0
  28. symphony_code-0.0.6/src/coding_agent/commands/plugins_cli.py +121 -0
  29. symphony_code-0.0.6/src/coding_agent/commands/skills_cli.py +78 -0
  30. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/config/__init__.py +2 -0
  31. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/config/config.py +29 -5
  32. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/config/credentials.py +1 -1
  33. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/config/prompts.py +1 -1
  34. symphony_code-0.0.6/src/coding_agent/extensions/__init__.py +10 -0
  35. symphony_code-0.0.6/src/coding_agent/extensions/diagnostics.py +25 -0
  36. symphony_code-0.0.6/src/coding_agent/extensions/roots.py +71 -0
  37. symphony_code-0.0.6/src/coding_agent/extensions/source.py +156 -0
  38. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/commands.py +9 -4
  39. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/app.py +43 -28
  40. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/chrome/__init__.py +5 -0
  41. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/chrome/footer.py +6 -4
  42. symphony_code-0.0.6/src/coding_agent/tui/chrome/session.py +42 -0
  43. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/chrome/topbar.py +27 -21
  44. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/commands/manager.py +73 -67
  45. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/composer/input.py +9 -3
  46. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/composer/surface.py +10 -22
  47. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/composer/voice_mode.py +76 -83
  48. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/events.py +70 -49
  49. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/state.py +20 -0
  50. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/subagent.py +35 -21
  51. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/turn.py +64 -52
  52. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/ask.py +2 -3
  53. symphony_code-0.0.6/src/coding_agent/tui/screens/extensions.py +97 -0
  54. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/history.py +26 -28
  55. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/onboard.py +1 -1
  56. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/resume.py +6 -7
  57. symphony_code-0.0.6/src/coding_agent/tui/screens/usage.py +98 -0
  58. symphony_code-0.0.6/src/coding_agent/tui/terminal_title.py +28 -0
  59. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/theme/theme.toml +5 -0
  60. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/activity.py +14 -13
  61. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/calls.py +2 -0
  62. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/modal.py +4 -19
  63. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/messages.py +13 -10
  64. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/process.py +13 -9
  65. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/surface.py +6 -11
  66. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/thinking_markdown.py +3 -2
  67. symphony_code-0.0.5/src/coding_agent/addons/plugins/__init__.py +0 -19
  68. symphony_code-0.0.5/src/coding_agent/addons/plugins/install.py +0 -37
  69. symphony_code-0.0.5/src/coding_agent/addons/plugins/manager.py +0 -140
  70. symphony_code-0.0.5/src/coding_agent/addons/plugins/models.py +0 -50
  71. symphony_code-0.0.5/src/coding_agent/addons/skills/__init__.py +0 -28
  72. symphony_code-0.0.5/src/coding_agent/addons/skills/addon.py +0 -26
  73. symphony_code-0.0.5/src/coding_agent/addons/skills/bundled_skills/pick-model/SKILL.md +0 -24
  74. symphony_code-0.0.5/src/coding_agent/addons/skills/models.py +0 -57
  75. symphony_code-0.0.5/src/coding_agent/addons/skills/registry.py +0 -135
  76. symphony_code-0.0.5/src/coding_agent/addons/skills/tool.py +0 -54
  77. symphony_code-0.0.5/src/coding_agent/tui/screens/extensions.py +0 -68
  78. {symphony_code-0.0.5 → symphony_code-0.0.6}/LICENSE +0 -0
  79. {symphony_code-0.0.5 → symphony_code-0.0.6}/README.md +0 -0
  80. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/__init__.py +0 -0
  81. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/_lazy.py +0 -0
  82. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/approvals.py +0 -0
  83. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/__init__.py +0 -0
  84. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/addon.py +0 -0
  85. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/capture.py +0 -0
  86. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/kinds.py +0 -0
  87. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/noise.py +0 -0
  88. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/store.py +0 -0
  89. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/__init__.py +0 -0
  90. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/addon.py +0 -0
  91. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/compactor.py +0 -0
  92. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/prompts.py +0 -0
  93. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/transcript.py +0 -0
  94. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/__init__.py +0 -0
  95. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/addon.py +0 -0
  96. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/evaluators.py +0 -0
  97. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/handlers.py +0 -0
  98. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/policy.py +0 -0
  99. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/protocol.py +0 -0
  100. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/state.py +0 -0
  101. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/__init__.py +0 -0
  102. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/addon.py +0 -0
  103. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/install.py +0 -0
  104. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/serialize.py +0 -0
  105. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/learning/__init__.py +0 -0
  106. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/learning/addon.py +0 -0
  107. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/learning/loop.py +0 -0
  108. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/learning/prompts.py +0 -0
  109. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/learning/sanitize.py +0 -0
  110. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/learning/store.py +0 -0
  111. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/manager/__init__.py +0 -0
  112. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/manager/bridge.py +0 -0
  113. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/manager/report.py +0 -0
  114. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/manager/runtime.py +0 -0
  115. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/manager/tool_changes.py +0 -0
  116. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/__init__.py +0 -0
  117. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/active.py +0 -0
  118. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/artifacts.py +0 -0
  119. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/collection.py +0 -0
  120. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/compatibility.py +0 -0
  121. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/images.py +0 -0
  122. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/jsonl.py +0 -0
  123. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/presentation.py +0 -0
  124. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/args.py +0 -0
  125. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/addon-authoring/SKILL.md +0 -0
  126. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/context-budget/SKILL.md +0 -0
  127. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/orient-first/SKILL.md +0 -0
  128. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/security-boundary/SKILL.md +0 -0
  129. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/skill-discipline/SKILL.md +0 -0
  130. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/surgical-edit/SKILL.md +0 -0
  131. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/systematic-debug/SKILL.md +0 -0
  132. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/verify-before-done/SKILL.md +0 -0
  133. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/voice/__init__.py +0 -0
  134. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/voice/playback.py +0 -0
  135. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/voice/speak.py +0 -0
  136. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/voice/stream.py +0 -0
  137. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/addons/voice/summary.py +0 -0
  138. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/bench/__init__.py +0 -0
  139. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/bench/cli.py +0 -0
  140. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/bench/patch.py +0 -0
  141. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/commands/__init__.py +0 -0
  142. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/commands/jev_argument.py +0 -0
  143. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/config/personalities.json +0 -0
  144. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/config/personalities.py +0 -0
  145. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/__init__.py +0 -0
  146. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/README.md +0 -0
  147. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/__init__.py +0 -0
  148. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/mapping.py +0 -0
  149. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/server.py +0 -0
  150. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/transport.py +0 -0
  151. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/README.md +0 -0
  152. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/__init__.py +0 -0
  153. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/catalog.py +0 -0
  154. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/requests.py +0 -0
  155. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/server.py +0 -0
  156. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/transport.py +0 -0
  157. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/py.typed +0 -0
  158. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/resources/__init__.py +0 -0
  159. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/resources/usage.py +0 -0
  160. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/run/__init__.py +0 -0
  161. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/run/cli.py +0 -0
  162. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/run/detach.py +0 -0
  163. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/run/interrupted.py +0 -0
  164. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/run/log_sink.py +0 -0
  165. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tls.py +0 -0
  166. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/__init__.py +0 -0
  167. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/ask_user.py +0 -0
  168. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/base.py +0 -0
  169. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/bash.py +0 -0
  170. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/bash_jobs.py +0 -0
  171. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/generate_image.py +0 -0
  172. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/memory.py +0 -0
  173. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/patch.py +0 -0
  174. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/read_file.py +0 -0
  175. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/save_artifact.py +0 -0
  176. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/search.py +0 -0
  177. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/summary.py +0 -0
  178. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/web_search.py +0 -0
  179. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tools/write_file.py +0 -0
  180. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/EFFICIENCY_PLAN.md +0 -0
  181. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/__init__.py +0 -0
  182. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/__main__.py +0 -0
  183. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/commands/__init__.py +0 -0
  184. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/commands/catalog.py +0 -0
  185. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/composer/__init__.py +0 -0
  186. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/composer/slash_menu.py +0 -0
  187. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/composer/voice.py +0 -0
  188. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/__init__.py +0 -0
  189. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/sink.py +0 -0
  190. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/__init__.py +0 -0
  191. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/artifacts.py +0 -0
  192. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/context.py +0 -0
  193. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/cost.py +0 -0
  194. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/dashboard.py +0 -0
  195. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/diff.py +0 -0
  196. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/file_selector.py +0 -0
  197. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/langfuse.py +0 -0
  198. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/learning.py +0 -0
  199. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/modal.py +0 -0
  200. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/screens/update.py +0 -0
  201. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/theme/__init__.py +0 -0
  202. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/theme/load.py +0 -0
  203. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/theme/style.py +0 -0
  204. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/__init__.py +0 -0
  205. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/code_view.py +0 -0
  206. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/images.py +0 -0
  207. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/labels.py +0 -0
  208. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/partial_args.py +0 -0
  209. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/tools/snapshots.py +0 -0
  210. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/__init__.py +0 -0
  211. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/artifact.py +0 -0
  212. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/decision.py +0 -0
  213. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/updates.py +0 -0
  214. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/web/__init__.py +0 -0
  215. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/web/bundle.py +0 -0
  216. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/web/server.py +0 -0
  217. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/web/sessions.py +0 -0
  218. {symphony_code-0.0.5 → symphony_code-0.0.6}/src/coding_agent/web/worker.py +0 -0
  219. {symphony_code-0.0.5 → symphony_code-0.0.6}/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.6
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.6
10
+ Requires-Dist: symphony-harness>=0.0.6
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.6"
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.6",
11
+ "symphony-harness>=0.0.6",
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.6"
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.6",
14
+ "symphony-harness>=0.0.6",
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",
@@ -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
 
@@ -0,0 +1,39 @@
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`` and the addon directories of enabled plugins to the addon loader.
5
+ """
6
+
7
+ from coding_agent.addons.plugins.install import (
8
+ UpdateResult,
9
+ install_plugin,
10
+ remove_plugin,
11
+ set_enabled,
12
+ update_plugins,
13
+ )
14
+ from coding_agent.addons.plugins.manifest import LoadedManifest, PluginManifest, read_manifest
15
+ from coding_agent.addons.plugins.marketplaces import (
16
+ add_marketplace,
17
+ list_marketplaces,
18
+ remove_marketplace,
19
+ update_marketplaces,
20
+ )
21
+ from coding_agent.addons.plugins.resolve import PluginSet, ResolvedPlugin, resolve_plugins
22
+
23
+ __all__ = [
24
+ "LoadedManifest",
25
+ "PluginManifest",
26
+ "PluginSet",
27
+ "ResolvedPlugin",
28
+ "UpdateResult",
29
+ "add_marketplace",
30
+ "install_plugin",
31
+ "list_marketplaces",
32
+ "read_manifest",
33
+ "remove_marketplace",
34
+ "remove_plugin",
35
+ "resolve_plugins",
36
+ "set_enabled",
37
+ "update_marketplaces",
38
+ "update_plugins",
39
+ ]
@@ -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"]
@@ -0,0 +1,115 @@
1
+ """Marketplace catalogs: a JSON list of plugins and where each one comes from.
2
+
3
+ Read from ``.agents/plugins/marketplace.json`` (Codex), ``.claude-plugin/marketplace.json``
4
+ or ``.cursor-plugin/marketplace.json``, in that order. A plugin's ``source`` is a
5
+ relative path (``./plugins/x``), ``{source: local, path}``, ``{source: github, repo}``,
6
+ ``{source: url|git, url}`` or ``{source: git-subdir, url, path}``, each git form with
7
+ an optional ``ref`` and ``sha`` pin.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import json
13
+ from dataclasses import dataclass
14
+ from pathlib import Path
15
+ from typing import Literal
16
+
17
+ from pydantic import BaseModel, ConfigDict, Field, ValidationError
18
+
19
+ from coding_agent.addons.plugins.manifest import PLUGIN_NAME
20
+ from coding_agent.extensions.source import GITHUB_BASE, Source
21
+
22
+ MARKETPLACE_PATHS = (
23
+ ".agents/plugins/marketplace.json",
24
+ ".claude-plugin/marketplace.json",
25
+ ".cursor-plugin/marketplace.json",
26
+ )
27
+ MAX_MARKETPLACE_BYTES = 1_000_000
28
+
29
+
30
+ class SourceSpec(BaseModel):
31
+ """The object form of a plugin source."""
32
+
33
+ model_config = ConfigDict(extra="ignore", populate_by_name=True)
34
+
35
+ source: Literal["local", "path", "github", "url", "git", "git-subdir"]
36
+ path: str = ""
37
+ repo: str = ""
38
+ url: str = ""
39
+ ref: str = ""
40
+ sha: str = ""
41
+
42
+
43
+ class MarketplacePlugin(BaseModel):
44
+ model_config = ConfigDict(extra="ignore")
45
+
46
+ name: str = Field(pattern=PLUGIN_NAME)
47
+ source: str | SourceSpec
48
+ description: str = ""
49
+ version: str = ""
50
+
51
+
52
+ class MarketplaceManifest(BaseModel):
53
+ model_config = ConfigDict(extra="ignore")
54
+
55
+ name: str = Field(pattern=PLUGIN_NAME)
56
+ plugins: list[MarketplacePlugin]
57
+
58
+ def entry(self, name: str) -> MarketplacePlugin:
59
+ for item in self.plugins:
60
+ if item.name == name:
61
+ return item
62
+ raise ValueError(f"marketplace {self.name!r} has no plugin {name!r}; it lists: {', '.join(i.name for i in self.plugins) or 'nothing'}")
63
+
64
+
65
+ @dataclass(frozen=True)
66
+ class PluginOrigin:
67
+ """Where one marketplace entry's plugin comes from, with an optional commit pin."""
68
+
69
+ source: Source
70
+ sha: str = ""
71
+
72
+
73
+ def read_marketplace(root: Path) -> MarketplaceManifest:
74
+ errors: list[str] = []
75
+ for relative in MARKETPLACE_PATHS:
76
+ path = root / relative
77
+ if not path.is_file():
78
+ continue
79
+ try:
80
+ if path.stat().st_size > MAX_MARKETPLACE_BYTES:
81
+ raise ValueError("marketplace file is too large")
82
+ return MarketplaceManifest.model_validate(json.loads(path.read_text(encoding="utf-8")))
83
+ except (OSError, UnicodeError, ValueError, ValidationError) as exc:
84
+ errors.append(f"{relative}: {exc}")
85
+ if errors:
86
+ raise ValueError("; ".join(errors))
87
+ raise ValueError("no marketplace file (looked for " + ", ".join(MARKETPLACE_PATHS) + ")")
88
+
89
+
90
+ def plugin_origin(entry: MarketplacePlugin, marketplace_root: Path) -> PluginOrigin:
91
+ """Turn an entry's ``source`` into a concrete source. Relative paths stay inside the marketplace."""
92
+ spec = entry.source
93
+ if isinstance(spec, str):
94
+ return PluginOrigin(_inside(marketplace_root, spec))
95
+ if spec.source in {"local", "path"}:
96
+ return PluginOrigin(_inside(marketplace_root, spec.path))
97
+ if spec.source == "github":
98
+ return PluginOrigin(Source("git", f"{GITHUB_BASE}{spec.repo}.git", spec.ref), spec.sha)
99
+ if not spec.url:
100
+ raise ValueError(f"plugin {entry.name!r}: source {spec.source!r} needs a url")
101
+ subdir = spec.path if spec.source == "git-subdir" else ""
102
+ return PluginOrigin(Source("git", spec.url, spec.ref, subdir), spec.sha)
103
+
104
+
105
+ def _inside(root: Path, relative: str) -> Source:
106
+ path = Path(relative)
107
+ if not relative or path.is_absolute() or ".." in path.parts:
108
+ raise ValueError(f"plugin path {relative!r} must be relative and stay inside the marketplace")
109
+ return Source("local", str(root), subdir=relative)
110
+
111
+
112
+ __all__ = [
113
+ "MARKETPLACE_PATHS", "MarketplaceManifest", "MarketplacePlugin", "PluginOrigin",
114
+ "plugin_origin", "read_marketplace",
115
+ ]
@@ -0,0 +1,103 @@
1
+ """Add, list, update and remove marketplaces.
2
+
3
+ An added marketplace is a staged copy under ``<symphony home>/plugins/marketplaces/<name>/``,
4
+ so its relative plugin paths keep working and nothing is read from the original
5
+ location again until ``marketplace update``. Adding one fetches files only.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import shutil
11
+ import tempfile
12
+ from pathlib import Path
13
+
14
+ from coding_agent.addons.plugins.marketplace import MarketplaceManifest, read_marketplace
15
+ from coding_agent.addons.plugins.state import MarketplaceRecord, load_state, plugins_dir, save_state
16
+ from coding_agent.extensions.source import Source, parse_source, stage
17
+
18
+
19
+ def marketplace_root(name: str) -> Path:
20
+ return plugins_dir() / "marketplaces" / name
21
+
22
+
23
+ def _fetch(source: Source) -> tuple[Path, MarketplaceManifest, str, tempfile.TemporaryDirectory[str]]:
24
+ plugins_dir().mkdir(parents=True, exist_ok=True)
25
+ scratch = tempfile.TemporaryDirectory(dir=plugins_dir(), prefix=".staging-")
26
+ try:
27
+ staged = Path(scratch.name) / "marketplace"
28
+ revision = stage(source, staged)
29
+ return staged, read_marketplace(staged), revision, scratch
30
+ except BaseException:
31
+ scratch.cleanup()
32
+ raise
33
+
34
+
35
+ def _install(name: str, staged: Path) -> None:
36
+ target = marketplace_root(name)
37
+ if target.exists():
38
+ shutil.rmtree(target)
39
+ target.parent.mkdir(parents=True, exist_ok=True)
40
+ shutil.move(str(staged), target)
41
+
42
+
43
+ def add_marketplace(text: str, *, cwd: Path) -> tuple[MarketplaceRecord, MarketplaceManifest]:
44
+ """Stage ``text`` (a path, git URL or owner/repo), read its catalog, and record it."""
45
+ source = parse_source(text, cwd=cwd, marketplaces=False)
46
+ staged, manifest, revision, scratch = _fetch(source)
47
+ with scratch:
48
+ state = load_state()
49
+ known = state.marketplaces.get(manifest.name)
50
+ if known is not None and known.source != source:
51
+ raise ValueError(f"a marketplace named {manifest.name!r} is already added from {known.source.describe()}; remove it first")
52
+ _install(manifest.name, staged)
53
+ record = MarketplaceRecord(name=manifest.name, source=source, revision=revision)
54
+ state.marketplaces[manifest.name] = record
55
+ save_state(state)
56
+ return record, manifest
57
+
58
+
59
+ def list_marketplaces() -> list[tuple[MarketplaceRecord, MarketplaceManifest | None]]:
60
+ """Each marketplace with its catalog, or ``None`` when its staged copy cannot be read."""
61
+ listed: list[tuple[MarketplaceRecord, MarketplaceManifest | None]] = []
62
+ for name, record in sorted(load_state().marketplaces.items()):
63
+ try:
64
+ listed.append((record, read_marketplace(marketplace_root(name))))
65
+ except ValueError:
66
+ listed.append((record, None))
67
+ return listed
68
+
69
+
70
+ def update_marketplaces(name: str | None = None) -> list[tuple[str, str]]:
71
+ """Re-fetch one or every marketplace; returns ``(name, outcome)`` pairs."""
72
+ state = load_state()
73
+ if name is not None and name not in state.marketplaces:
74
+ raise ValueError(f"no marketplace named {name!r}; see: symphony plugins marketplace list")
75
+ outcomes: list[tuple[str, str]] = []
76
+ for item in sorted(state.marketplaces.values(), key=lambda record: record.name):
77
+ if name not in {None, item.name}:
78
+ continue
79
+ try:
80
+ staged, manifest, revision, scratch = _fetch(item.source)
81
+ with scratch:
82
+ if manifest.name != item.name:
83
+ raise ValueError(f"the source now calls itself {manifest.name!r}")
84
+ _install(item.name, staged)
85
+ state.marketplaces[item.name] = item.model_copy(update={"revision": revision})
86
+ outcomes.append((item.name, f"updated · {len(manifest.plugins)} plugins"))
87
+ except ValueError as exc:
88
+ outcomes.append((item.name, f"failed: {exc}"))
89
+ save_state(state)
90
+ return outcomes
91
+
92
+
93
+ def remove_marketplace(name: str) -> int:
94
+ """Forget a marketplace; returns how many installed plugins came from it (they stay installed)."""
95
+ state = load_state()
96
+ if state.marketplaces.pop(name, None) is None:
97
+ raise ValueError(f"no marketplace named {name!r}; see: symphony plugins marketplace list")
98
+ shutil.rmtree(marketplace_root(name), ignore_errors=True)
99
+ save_state(state)
100
+ return sum(1 for record in state.plugins.values() if record.marketplace == name)
101
+
102
+
103
+ __all__ = ["add_marketplace", "list_marketplaces", "marketplace_root", "remove_marketplace", "update_marketplaces"]