symphony-code 0.0.4__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.
- {symphony_code-0.0.4 → symphony_code-0.0.6}/PKG-INFO +4 -3
- {symphony_code-0.0.4 → symphony_code-0.0.6}/pyproject.toml +4 -3
- {symphony_code-0.0.4 → symphony_code-0.0.6}/pyproject.toml.orig +5 -3
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/__init__.py +0 -2
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/addon.py +6 -5
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/capture.py +7 -1
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/noise.py +16 -2
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/manager/discovery.py +10 -5
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/jsonl.py +46 -0
- symphony_code-0.0.6/src/coding_agent/addons/plugins/__init__.py +39 -0
- symphony_code-0.0.6/src/coding_agent/addons/plugins/install.py +140 -0
- symphony_code-0.0.6/src/coding_agent/addons/plugins/manifest.py +142 -0
- symphony_code-0.0.6/src/coding_agent/addons/plugins/marketplace.py +115 -0
- symphony_code-0.0.6/src/coding_agent/addons/plugins/marketplaces.py +103 -0
- symphony_code-0.0.6/src/coding_agent/addons/plugins/resolve.py +155 -0
- symphony_code-0.0.6/src/coding_agent/addons/plugins/state.py +96 -0
- symphony_code-0.0.6/src/coding_agent/addons/skills/__init__.py +37 -0
- symphony_code-0.0.6/src/coding_agent/addons/skills/catalog.py +111 -0
- symphony_code-0.0.6/src/coding_agent/addons/skills/discovery.py +56 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/frontmatter.py +7 -2
- symphony_code-0.0.6/src/coding_agent/addons/skills/install.py +167 -0
- symphony_code-0.0.6/src/coding_agent/addons/skills/models.py +47 -0
- symphony_code-0.0.6/src/coding_agent/addons/skills/registry.py +112 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/voice/addon.py +5 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/voice/credentials.py +1 -1
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/agent.py +155 -67
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/cli.py +12 -1
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/commands/catalog.py +4 -1
- symphony_code-0.0.6/src/coding_agent/commands/cli_support.py +78 -0
- symphony_code-0.0.6/src/coding_agent/commands/extension_slash.py +38 -0
- symphony_code-0.0.6/src/coding_agent/commands/installed.py +90 -0
- symphony_code-0.0.6/src/coding_agent/commands/plugins_cli.py +121 -0
- symphony_code-0.0.6/src/coding_agent/commands/skills_cli.py +78 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/config/__init__.py +2 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/config/config.py +29 -5
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/config/credentials.py +1 -1
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/config/prompts.py +11 -10
- symphony_code-0.0.6/src/coding_agent/extensions/__init__.py +10 -0
- symphony_code-0.0.6/src/coding_agent/extensions/diagnostics.py +25 -0
- symphony_code-0.0.6/src/coding_agent/extensions/roots.py +71 -0
- symphony_code-0.0.6/src/coding_agent/extensions/source.py +156 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/commands.py +9 -4
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/ask_user.py +5 -3
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/base.py +19 -7
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/bash.py +12 -11
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/generate_image.py +4 -3
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/memory.py +13 -7
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/patch.py +7 -4
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/read_file.py +6 -4
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/save_artifact.py +4 -3
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/search.py +6 -4
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/web_search.py +5 -5
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/write_file.py +5 -2
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/app.py +63 -32
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/chrome/__init__.py +7 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/chrome/footer.py +42 -4
- symphony_code-0.0.6/src/coding_agent/tui/chrome/session.py +42 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/chrome/topbar.py +74 -15
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/commands/manager.py +73 -67
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/composer/input.py +9 -3
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/composer/surface.py +10 -22
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/composer/voice_mode.py +76 -83
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/events.py +83 -38
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/state.py +41 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/subagent.py +35 -15
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/turn.py +82 -36
- symphony_code-0.0.6/src/coding_agent/tui/screens/artifacts.py +39 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/ask.py +2 -3
- symphony_code-0.0.6/src/coding_agent/tui/screens/cost.py +61 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/dashboard.py +20 -4
- symphony_code-0.0.6/src/coding_agent/tui/screens/extensions.py +97 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/history.py +26 -21
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/onboard.py +1 -1
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/resume.py +6 -7
- symphony_code-0.0.6/src/coding_agent/tui/screens/usage.py +98 -0
- symphony_code-0.0.6/src/coding_agent/tui/terminal_title.py +28 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/theme/theme.toml +5 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/activity.py +14 -13
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/calls.py +2 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/modal.py +4 -19
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/messages.py +13 -10
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/process.py +13 -9
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/surface.py +8 -8
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/thinking_markdown.py +3 -2
- symphony_code-0.0.4/src/coding_agent/addons/plugins/__init__.py +0 -19
- symphony_code-0.0.4/src/coding_agent/addons/plugins/install.py +0 -37
- symphony_code-0.0.4/src/coding_agent/addons/plugins/manager.py +0 -140
- symphony_code-0.0.4/src/coding_agent/addons/plugins/models.py +0 -50
- symphony_code-0.0.4/src/coding_agent/addons/skills/__init__.py +0 -28
- symphony_code-0.0.4/src/coding_agent/addons/skills/addon.py +0 -26
- symphony_code-0.0.4/src/coding_agent/addons/skills/models.py +0 -57
- symphony_code-0.0.4/src/coding_agent/addons/skills/registry.py +0 -109
- symphony_code-0.0.4/src/coding_agent/addons/skills/tool.py +0 -54
- symphony_code-0.0.4/src/coding_agent/tui/screens/extensions.py +0 -68
- {symphony_code-0.0.4 → symphony_code-0.0.6}/LICENSE +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/README.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/_lazy.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/approvals.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/kinds.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/artifacts/store.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/addon.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/compactor.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/prompts.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/compaction/transcript.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/addon.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/evaluators.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/handlers.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/policy.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/protocol.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/evaluation/state.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/addon.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/install.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/langfuse/serialize.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/learning/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/learning/addon.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/learning/loop.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/learning/prompts.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/learning/sanitize.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/learning/store.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/manager/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/manager/bridge.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/manager/report.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/manager/runtime.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/manager/tool_changes.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/active.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/artifacts.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/collection.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/compatibility.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/images.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/persistence/presentation.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/args.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/addon-authoring/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/context-budget/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/orient-first/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/security-boundary/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/skill-discipline/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/surgical-edit/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/systematic-debug/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/skills/bundled_skills/verify-before-done/SKILL.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/voice/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/voice/playback.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/voice/speak.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/voice/stream.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/addons/voice/summary.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/bench/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/bench/cli.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/bench/patch.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/commands/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/commands/jev_argument.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/config/personalities.json +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/config/personalities.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/README.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/mapping.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/server.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/acp/transport.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/README.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/catalog.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/requests.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/server.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/protocols/stdio/transport.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/py.typed +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/resources/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/resources/usage.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/run/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/run/cli.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/run/detach.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/run/interrupted.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/run/log_sink.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tls.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/bash_jobs.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tools/summary.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/EFFICIENCY_PLAN.md +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/__main__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/commands/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/commands/catalog.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/composer/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/composer/slash_menu.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/composer/voice.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/runtime/sink.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/context.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/diff.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/file_selector.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/langfuse.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/learning.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/modal.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/screens/update.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/theme/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/theme/load.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/theme/style.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/code_view.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/images.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/labels.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/partial_args.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/tools/snapshots.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/artifact.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/tui/transcript/decision.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/updates.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/web/__init__.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/web/bundle.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/web/server.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/web/sessions.py +0 -0
- {symphony_code-0.0.4 → symphony_code-0.0.6}/src/coding_agent/web/worker.py +0 -0
- {symphony_code-0.0.4 → 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.
|
|
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
|
|
10
|
-
Requires-Dist: symphony-harness
|
|
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.
|
|
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",
|
|
11
|
-
"symphony-harness",
|
|
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.
|
|
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",
|
|
14
|
-
"symphony-harness",
|
|
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",
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
- ``write_file``, ``patch`` and ``generate_image`` capture the written path
|
|
6
6
|
when its suffix is html, csv, json or an image (see ``capture``). A file
|
|
7
7
|
inside a website folder (one below the workspace with ``index.html``)
|
|
8
|
-
versions that whole site instead.
|
|
9
|
-
|
|
8
|
+
versions that whole site instead. A Vite, Next, or Astro project is not a
|
|
9
|
+
site: its ``index.html`` is the dev entry. Manifests, configs, lockfiles and
|
|
10
|
+
anything under node_modules, .git, dist, build, or .vite are skipped (``noise``),
|
|
10
11
|
as is a patch to an html or json file git tracks outside a website folder.
|
|
11
12
|
- ``save_artifact`` captures its path with the kind and title it was given.
|
|
12
13
|
- Any other tool except ``read_file`` captures the inline images it returned.
|
|
@@ -39,7 +40,7 @@ from coding_agent.addons.artifacts.capture import (
|
|
|
39
40
|
snapshot_site,
|
|
40
41
|
)
|
|
41
42
|
from coding_agent.addons.artifacts.kinds import ArtifactKind, kind_of
|
|
42
|
-
from coding_agent.addons.artifacts.noise import git_tracked, is_noise
|
|
43
|
+
from coding_agent.addons.artifacts.noise import git_tracked, is_app_project, is_noise
|
|
43
44
|
from coding_agent.addons.artifacts.store import ArtifactStore, Saved
|
|
44
45
|
|
|
45
46
|
ARTIFACT_CREATED = "artifact_created"
|
|
@@ -69,7 +70,7 @@ def site_of(path: Path, workspace: Path) -> Path | None:
|
|
|
69
70
|
for folder in path.parents:
|
|
70
71
|
if folder == workspace or not folder.is_relative_to(workspace):
|
|
71
72
|
return None
|
|
72
|
-
if (folder / SITE_ENTRY).is_file():
|
|
73
|
+
if (folder / SITE_ENTRY).is_file() and not is_app_project(folder):
|
|
73
74
|
return folder
|
|
74
75
|
return None
|
|
75
76
|
|
|
@@ -116,7 +117,7 @@ class ArtifactsAddon(Addon):
|
|
|
116
117
|
)
|
|
117
118
|
elif tool_call.name in PATH_TOOLS and isinstance(raw, str):
|
|
118
119
|
path = resolve(self.workspace, raw)
|
|
119
|
-
if is_noise(path, self.workspace):
|
|
120
|
+
if is_noise(path, self.workspace) or is_app_project(path.parent):
|
|
120
121
|
return
|
|
121
122
|
site = site_of(path, self.workspace)
|
|
122
123
|
kind = kind_of(path)
|
|
@@ -23,6 +23,7 @@ from pathlib import Path
|
|
|
23
23
|
from core_ai.content import sniff_image_media_type
|
|
24
24
|
|
|
25
25
|
from coding_agent.addons.artifacts.kinds import IMAGE_MIME_TYPES, TEXT_MIME_TYPES, ArtifactKind, kind_of
|
|
26
|
+
from coding_agent.addons.artifacts.noise import is_app_project
|
|
26
27
|
|
|
27
28
|
MAX_FILE_BYTES = 20 * 1024 * 1024
|
|
28
29
|
MAX_SITE_FILES = 200
|
|
@@ -118,7 +119,12 @@ def snapshot_path(path: Path, workspace: Path, kind: ArtifactKind | None = None,
|
|
|
118
119
|
chosen = kind or kind_of(path)
|
|
119
120
|
if chosen is None:
|
|
120
121
|
raise ArtifactError(f"not an html, csv, json or image file: {path}")
|
|
121
|
-
if
|
|
122
|
+
if (
|
|
123
|
+
chosen is ArtifactKind.HTML
|
|
124
|
+
and path.name == SITE_ENTRY
|
|
125
|
+
and path.parent != workspace
|
|
126
|
+
and not is_app_project(path.parent)
|
|
127
|
+
):
|
|
122
128
|
return snapshot_site(path.parent, workspace, title)
|
|
123
129
|
payload = _read(path)
|
|
124
130
|
if chosen is ArtifactKind.IMAGE:
|
|
@@ -10,7 +10,16 @@ import subprocess
|
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
12
|
# Any path through one of these folders is dependencies, VCS data or build output.
|
|
13
|
-
NOISE_DIRS = frozenset({
|
|
13
|
+
NOISE_DIRS = frozenset({
|
|
14
|
+
"node_modules", ".git", "dist", "build", ".vite", ".next", ".nuxt", ".output",
|
|
15
|
+
})
|
|
16
|
+
# A folder holding one of these is an application project. Its index.html is the
|
|
17
|
+
# dev server entry (Vite, Next, Astro), not a page the run produced.
|
|
18
|
+
APP_MARKERS = frozenset({
|
|
19
|
+
"package.json", "vite.config.js", "vite.config.ts", "vite.config.mjs",
|
|
20
|
+
"next.config.js", "next.config.ts", "next.config.mjs", "astro.config.mjs",
|
|
21
|
+
"astro.config.ts",
|
|
22
|
+
})
|
|
14
23
|
MANIFEST_NAMES = frozenset({"package.json", "package-lock.json", "npm-shrinkwrap.json"})
|
|
15
24
|
CONFIG_PATTERNS = ("tsconfig*.json", "*.config.json")
|
|
16
25
|
# Lockfiles of every package manager: yarn.lock, Cargo.lock, uv.lock,
|
|
@@ -30,6 +39,11 @@ def is_noise(path: Path, workspace: Path) -> bool:
|
|
|
30
39
|
return any(fnmatch.fnmatchcase(name, pattern) for pattern in (*CONFIG_PATTERNS, *LOCK_PATTERNS))
|
|
31
40
|
|
|
32
41
|
|
|
42
|
+
def is_app_project(folder: Path) -> bool:
|
|
43
|
+
"""True when ``folder`` is a web app project rather than a generated site."""
|
|
44
|
+
return any((folder / name).is_file() for name in APP_MARKERS)
|
|
45
|
+
|
|
46
|
+
|
|
33
47
|
def git_tracked(path: Path) -> bool:
|
|
34
48
|
"""Whether git tracks ``path`` in the repository that contains it."""
|
|
35
49
|
try:
|
|
@@ -45,4 +59,4 @@ def git_tracked(path: Path) -> bool:
|
|
|
45
59
|
return result.returncode == 0
|
|
46
60
|
|
|
47
61
|
|
|
48
|
-
__all__ = ["NOISE_DIRS", "git_tracked", "is_noise"]
|
|
62
|
+
__all__ = ["APP_MARKERS", "NOISE_DIRS", "git_tracked", "is_app_project", "is_noise"]
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"""Where user addons live and which names they may not take.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
|
@@ -81,6 +81,20 @@ def _utc_now() -> str:
|
|
|
81
81
|
return datetime.now(timezone.utc).isoformat()
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
def _read_cost(path: Path) -> dict[str, float]:
|
|
85
|
+
try:
|
|
86
|
+
loaded = json.loads(path.read_text(encoding="utf-8"))
|
|
87
|
+
except (OSError, ValueError):
|
|
88
|
+
return {}
|
|
89
|
+
if not isinstance(loaded, dict):
|
|
90
|
+
return {}
|
|
91
|
+
return {
|
|
92
|
+
str(model): float(amount)
|
|
93
|
+
for model, amount in loaded.items()
|
|
94
|
+
if isinstance(model, str) and isinstance(amount, (int, float)) and amount >= 0
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
84
98
|
def sessions_dir(
|
|
85
99
|
workspace: Union[str, Path] | None = None,
|
|
86
100
|
*,
|
|
@@ -339,6 +353,27 @@ class JsonlPersistence:
|
|
|
339
353
|
raise ValueError(f"invalid session_id: {session_id!r}")
|
|
340
354
|
return safe_path(self.root, session_id)
|
|
341
355
|
|
|
356
|
+
def record_message_cost(self, session_id: str, model_id: str, amount: float) -> dict[str, float]:
|
|
357
|
+
"""Add one response's USD cost and return the saved per-model totals."""
|
|
358
|
+
if not model_id or not isinstance(amount, (int, float)) or amount < 0:
|
|
359
|
+
return self.session_costs(session_id)
|
|
360
|
+
with self._lock, self._session_lock(session_id):
|
|
361
|
+
directory = self.session_dir(session_id)
|
|
362
|
+
directory.mkdir(parents=True, exist_ok=True)
|
|
363
|
+
path = safe_path(directory, "cost.json")
|
|
364
|
+
costs = _read_cost(path)
|
|
365
|
+
costs[model_id] = costs.get(model_id, 0.0) + float(amount)
|
|
366
|
+
path.write_text(json.dumps(costs, sort_keys=True), encoding="utf-8")
|
|
367
|
+
return dict(costs)
|
|
368
|
+
|
|
369
|
+
def session_costs(self, session_id: str) -> dict[str, float]:
|
|
370
|
+
"""The running per-model cost stored beside this session's transcript."""
|
|
371
|
+
try:
|
|
372
|
+
path = safe_path(self.session_dir(session_id), "cost.json")
|
|
373
|
+
except ValueError:
|
|
374
|
+
return {}
|
|
375
|
+
return _read_cost(path)
|
|
376
|
+
|
|
342
377
|
def _path(self, session_id: str) -> Path:
|
|
343
378
|
return safe_path(self.session_dir(session_id), "transcript.jsonl")
|
|
344
379
|
|
|
@@ -870,6 +905,17 @@ class JsonlPersistence:
|
|
|
870
905
|
fields = self.fields
|
|
871
906
|
for name, body in fields.apply(event_type, payload) if fields is not None else [(event_type, payload)]:
|
|
872
907
|
self._journal(name, body)
|
|
908
|
+
if name == "usage":
|
|
909
|
+
self._record_usage_cost(body)
|
|
910
|
+
|
|
911
|
+
def _record_usage_cost(self, payload: dict[str, Any]) -> None:
|
|
912
|
+
if payload.get("parent_id"):
|
|
913
|
+
return
|
|
914
|
+
session_id = str(payload.get("session_id") or "")
|
|
915
|
+
model_id = payload.get("model_id")
|
|
916
|
+
amount = payload.get("session_cost")
|
|
917
|
+
if session_id and isinstance(model_id, str) and isinstance(amount, (int, float)):
|
|
918
|
+
self.record_message_cost(session_id, model_id, float(amount))
|
|
873
919
|
|
|
874
920
|
def _journal(self, event_type: str, payload: dict[str, Any]) -> None:
|
|
875
921
|
session_id = str(payload.get("session_id") or "")
|
|
@@ -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"]
|