@codemieai/code 0.0.45 → 0.0.46
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.
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +20 -3
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/metrics/types.d.ts +0 -6
- package/dist/agents/core/metrics/types.d.ts.map +1 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +0 -6
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin-installer.d.ts +0 -11
- package/dist/agents/plugins/claude/claude.plugin-installer.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin-installer.js +0 -32
- package/dist/agents/plugins/claude/claude.plugin-installer.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +1 -1
- package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.session.js +1 -28
- package/dist/agents/plugins/claude/claude.session.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/README.md +1 -14
- package/dist/agents/plugins/claude/plugin/hooks/hooks.json +4 -4
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/SKILL.md +206 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-agent.md +45 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-claude-md-snippet.md +40 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-command.md +30 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-hooks.json +23 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-skill.md +48 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-agent.md +145 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-claude-md-snippet.md +126 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-command.md +170 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-hooks.json +46 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-skill.md +144 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/sample-report.md +223 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/best-practices.md +510 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/component-checklists.md +413 -0
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/scripts/scan-repo.sh +162 -0
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +3 -78
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +7 -16
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
- package/dist/agents/plugins/claude/sounds-installer.d.ts +1 -1
- package/dist/agents/plugins/claude/sounds-installer.d.ts.map +1 -1
- package/dist/agents/plugins/claude/sounds-installer.js +1 -4
- package/dist/agents/plugins/claude/sounds-installer.js.map +1 -1
- package/dist/agents/plugins/codemie-code.plugin.d.ts +1 -4
- package/dist/agents/plugins/codemie-code.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/codemie-code.plugin.js +26 -81
- package/dist/agents/plugins/codemie-code.plugin.js.map +1 -1
- package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts +1 -8
- package/dist/agents/plugins/gemini/gemini.session-adapter.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.session-adapter.js +2 -30
- package/dist/agents/plugins/gemini/gemini.session-adapter.js.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js +2 -8
- package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js +0 -7
- package/dist/agents/plugins/gemini/session/processors/gemini.metrics-processor.js.map +1 -1
- package/dist/agents/plugins/opencode/index.d.ts +1 -1
- package/dist/agents/plugins/opencode/index.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/index.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts +2 -22
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.session.js +5 -30
- package/dist/agents/plugins/opencode/opencode.session.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.sqlite-reader.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.sqlite-reader.js +0 -2
- package/dist/agents/plugins/opencode/opencode.sqlite-reader.js.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +0 -8
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +8 -97
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -1
- package/dist/cli/commands/analytics/aggregator.d.ts +0 -8
- package/dist/cli/commands/analytics/aggregator.d.ts.map +1 -1
- package/dist/cli/commands/analytics/aggregator.js +5 -100
- package/dist/cli/commands/analytics/aggregator.js.map +1 -1
- package/dist/cli/commands/analytics/data-loader.d.ts +0 -7
- package/dist/cli/commands/analytics/data-loader.d.ts.map +1 -1
- package/dist/cli/commands/analytics/data-loader.js +3 -10
- package/dist/cli/commands/analytics/data-loader.js.map +1 -1
- package/dist/cli/commands/analytics/exporter.d.ts.map +1 -1
- package/dist/cli/commands/analytics/exporter.js +0 -12
- package/dist/cli/commands/analytics/exporter.js.map +1 -1
- package/dist/cli/commands/analytics/formatter.d.ts.map +1 -1
- package/dist/cli/commands/analytics/formatter.js +0 -9
- package/dist/cli/commands/analytics/formatter.js.map +1 -1
- package/dist/cli/commands/analytics/types.d.ts +0 -17
- package/dist/cli/commands/analytics/types.d.ts.map +1 -1
- package/dist/cli/commands/assistants/chat/historyLoader.d.ts +22 -0
- package/dist/cli/commands/assistants/chat/historyLoader.d.ts.map +1 -0
- package/dist/cli/commands/assistants/chat/historyLoader.js +80 -0
- package/dist/cli/commands/assistants/chat/historyLoader.js.map +1 -0
- package/dist/cli/commands/assistants/{chat.d.ts → chat/index.d.ts} +1 -1
- package/dist/cli/commands/assistants/chat/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/{chat.js → chat/index.js} +54 -45
- package/dist/cli/commands/assistants/chat/index.js.map +1 -0
- package/dist/cli/commands/assistants/chat/types.d.ts +27 -0
- package/dist/cli/commands/assistants/chat/types.d.ts.map +1 -0
- package/dist/cli/commands/assistants/chat/types.js +5 -0
- package/dist/cli/commands/assistants/chat/types.js.map +1 -0
- package/dist/cli/commands/assistants/chat/utils.d.ts +12 -0
- package/dist/cli/commands/assistants/chat/utils.d.ts.map +1 -0
- package/dist/cli/commands/assistants/chat/utils.js +24 -0
- package/dist/cli/commands/assistants/chat/utils.js.map +1 -0
- package/dist/cli/commands/assistants/constants.d.ts +1 -0
- package/dist/cli/commands/assistants/constants.d.ts.map +1 -1
- package/dist/cli/commands/assistants/constants.js.map +1 -1
- package/dist/cli/commands/assistants/index.js +2 -2
- package/dist/cli/commands/assistants/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +1 -1
- package/dist/cli/commands/assistants/setup/index.js +4 -4
- package/dist/cli/commands/assistants/setup/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/index.d.ts +1 -1
- package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/index.js +5 -3
- package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +7 -1
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/types.d.ts +2 -0
- package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.js +15 -4
- package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -1
- package/dist/cli/commands/hook.js +1 -1
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/plugin.d.ts +16 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +210 -0
- package/dist/cli/commands/plugin.js.map +1 -0
- package/dist/cli/commands/setup.js +1 -1
- package/dist/cli/commands/skill.d.ts.map +1 -1
- package/dist/cli/commands/skill.js +3 -1
- package/dist/cli/commands/skill.js.map +1 -1
- package/dist/cli/commands/sound.d.ts +3 -0
- package/dist/cli/commands/sound.d.ts.map +1 -0
- package/dist/cli/commands/sound.js +87 -0
- package/dist/cli/commands/sound.js.map +1 -0
- package/dist/cli/commands/test-metrics.js +3 -5
- package/dist/cli/commands/test-metrics.js.map +1 -1
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +8 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/plugins/core/index.d.ts +13 -0
- package/dist/plugins/core/index.d.ts.map +1 -0
- package/dist/plugins/core/index.js +15 -0
- package/dist/plugins/core/index.js.map +1 -0
- package/dist/plugins/core/manifest-parser.d.ts +28 -0
- package/dist/plugins/core/manifest-parser.d.ts.map +1 -0
- package/dist/plugins/core/manifest-parser.js +137 -0
- package/dist/plugins/core/manifest-parser.js.map +1 -0
- package/dist/plugins/core/plugin-cache.d.ts +65 -0
- package/dist/plugins/core/plugin-cache.d.ts.map +1 -0
- package/dist/plugins/core/plugin-cache.js +170 -0
- package/dist/plugins/core/plugin-cache.js.map +1 -0
- package/dist/plugins/core/plugin-loader.d.ts +21 -0
- package/dist/plugins/core/plugin-loader.d.ts.map +1 -0
- package/dist/plugins/core/plugin-loader.js +55 -0
- package/dist/plugins/core/plugin-loader.js.map +1 -0
- package/dist/plugins/core/plugin-resolver.d.ts +33 -0
- package/dist/plugins/core/plugin-resolver.d.ts.map +1 -0
- package/dist/plugins/core/plugin-resolver.js +118 -0
- package/dist/plugins/core/plugin-resolver.js.map +1 -0
- package/dist/plugins/core/types.d.ts +183 -0
- package/dist/plugins/core/types.d.ts.map +1 -0
- package/dist/plugins/core/types.js +22 -0
- package/dist/plugins/core/types.js.map +1 -0
- package/dist/plugins/loaders/agents-loader.d.ts +19 -0
- package/dist/plugins/loaders/agents-loader.d.ts.map +1 -0
- package/dist/plugins/loaders/agents-loader.js +92 -0
- package/dist/plugins/loaders/agents-loader.js.map +1 -0
- package/dist/plugins/loaders/hooks-loader.d.ts +27 -0
- package/dist/plugins/loaders/hooks-loader.d.ts.map +1 -0
- package/dist/plugins/loaders/hooks-loader.js +94 -0
- package/dist/plugins/loaders/hooks-loader.js.map +1 -0
- package/dist/plugins/loaders/mcp-loader.d.ts +24 -0
- package/dist/plugins/loaders/mcp-loader.d.ts.map +1 -0
- package/dist/plugins/loaders/mcp-loader.js +86 -0
- package/dist/plugins/loaders/mcp-loader.js.map +1 -0
- package/dist/plugins/loaders/skills-loader.d.ts +30 -0
- package/dist/plugins/loaders/skills-loader.d.ts.map +1 -0
- package/dist/plugins/loaders/skills-loader.js +167 -0
- package/dist/plugins/loaders/skills-loader.js.map +1 -0
- package/dist/providers/plugins/bedrock/bedrock.template.js +1 -1
- package/dist/providers/plugins/jwt/jwt.setup-steps.js +1 -1
- package/dist/providers/plugins/jwt/jwt.template.js +1 -1
- package/dist/providers/plugins/litellm/litellm.template.js +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js +10 -0
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/proxy-types.d.ts +3 -0
- package/dist/providers/plugins/sso/proxy/proxy-types.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.js +2 -3
- package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts +21 -0
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js +159 -0
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts +24 -0
- package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/constants.js +36 -0
- package/dist/providers/plugins/sso/session/processors/conversations/constants.js.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.d.ts +19 -0
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.d.ts.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/{conversation-sync-processor.js → syncProcessor.js} +48 -33
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/{conversation-types.d.ts → types.d.ts} +14 -2
- package/dist/providers/plugins/sso/session/processors/conversations/types.d.ts.map +1 -0
- package/dist/providers/plugins/sso/session/processors/conversations/types.js +14 -0
- package/dist/providers/plugins/sso/session/processors/conversations/types.js.map +1 -0
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js +16 -17
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts +3 -3
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js +8 -38
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js +2 -6
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts +49 -31
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.template.js +1 -1
- package/dist/{agents/codemie-code/skills → skills}/core/SkillDiscovery.d.ts +10 -0
- package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/core/SkillDiscovery.js +64 -7
- package/dist/skills/core/SkillDiscovery.js.map +1 -0
- package/dist/skills/core/SkillManager.d.ts.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/core/SkillManager.js +15 -10
- package/dist/skills/core/SkillManager.js.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/core/types.d.ts +3 -25
- package/dist/skills/core/types.d.ts.map +1 -0
- package/dist/skills/core/types.js.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/index.d.ts +3 -3
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/index.js +2 -2
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/sync/SkillSync.d.ts.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/sync/SkillSync.js +5 -3
- package/dist/skills/sync/SkillSync.js.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/utils/content-loader.d.ts +2 -12
- package/dist/skills/utils/content-loader.d.ts.map +1 -0
- package/dist/{agents/codemie-code/skills → skills}/utils/content-loader.js +3 -8
- package/dist/skills/utils/content-loader.js.map +1 -0
- package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
- package/dist/skills/utils/pattern-matcher.js.map +1 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/package.json +1 -1
- package/dist/agents/codemie-code/agent.d.ts +0 -129
- package/dist/agents/codemie-code/agent.d.ts.map +0 -1
- package/dist/agents/codemie-code/agent.js +0 -1106
- package/dist/agents/codemie-code/agent.js.map +0 -1
- package/dist/agents/codemie-code/config.d.ts +0 -40
- package/dist/agents/codemie-code/config.d.ts.map +0 -1
- package/dist/agents/codemie-code/config.js +0 -293
- package/dist/agents/codemie-code/config.js.map +0 -1
- package/dist/agents/codemie-code/filters.d.ts +0 -91
- package/dist/agents/codemie-code/filters.d.ts.map +0 -1
- package/dist/agents/codemie-code/filters.js +0 -328
- package/dist/agents/codemie-code/filters.js.map +0 -1
- package/dist/agents/codemie-code/index.d.ts +0 -93
- package/dist/agents/codemie-code/index.d.ts.map +0 -1
- package/dist/agents/codemie-code/index.js +0 -359
- package/dist/agents/codemie-code/index.js.map +0 -1
- package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts +0 -87
- package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts.map +0 -1
- package/dist/agents/codemie-code/modes/contextAwarePlanning.js +0 -957
- package/dist/agents/codemie-code/modes/contextAwarePlanning.js.map +0 -1
- package/dist/agents/codemie-code/modes/planMode.d.ts +0 -116
- package/dist/agents/codemie-code/modes/planMode.d.ts.map +0 -1
- package/dist/agents/codemie-code/modes/planMode.js +0 -537
- package/dist/agents/codemie-code/modes/planMode.js.map +0 -1
- package/dist/agents/codemie-code/prompts.d.ts +0 -47
- package/dist/agents/codemie-code/prompts.d.ts.map +0 -1
- package/dist/agents/codemie-code/prompts.js +0 -207
- package/dist/agents/codemie-code/prompts.js.map +0 -1
- package/dist/agents/codemie-code/skills/core/SkillDiscovery.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/core/SkillDiscovery.js.map +0 -1
- package/dist/agents/codemie-code/skills/core/SkillManager.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/core/SkillManager.js.map +0 -1
- package/dist/agents/codemie-code/skills/core/types.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/core/types.js.map +0 -1
- package/dist/agents/codemie-code/skills/index.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/index.js.map +0 -1
- package/dist/agents/codemie-code/skills/sync/SkillSync.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/sync/SkillSync.js.map +0 -1
- package/dist/agents/codemie-code/skills/utils/content-loader.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/utils/content-loader.js.map +0 -1
- package/dist/agents/codemie-code/skills/utils/frontmatter.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/utils/frontmatter.js.map +0 -1
- package/dist/agents/codemie-code/skills/utils/pattern-matcher.d.ts.map +0 -1
- package/dist/agents/codemie-code/skills/utils/pattern-matcher.js.map +0 -1
- package/dist/agents/codemie-code/storage/todoStorage.d.ts +0 -78
- package/dist/agents/codemie-code/storage/todoStorage.d.ts.map +0 -1
- package/dist/agents/codemie-code/storage/todoStorage.js +0 -225
- package/dist/agents/codemie-code/storage/todoStorage.js.map +0 -1
- package/dist/agents/codemie-code/tokenUtils.d.ts +0 -108
- package/dist/agents/codemie-code/tokenUtils.d.ts.map +0 -1
- package/dist/agents/codemie-code/tokenUtils.js +0 -220
- package/dist/agents/codemie-code/tokenUtils.js.map +0 -1
- package/dist/agents/codemie-code/toolMetadata.d.ts +0 -15
- package/dist/agents/codemie-code/toolMetadata.d.ts.map +0 -1
- package/dist/agents/codemie-code/toolMetadata.js +0 -316
- package/dist/agents/codemie-code/toolMetadata.js.map +0 -1
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts +0 -47
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +0 -1
- package/dist/agents/codemie-code/tools/assistant-invocation.js +0 -129
- package/dist/agents/codemie-code/tools/assistant-invocation.js.map +0 -1
- package/dist/agents/codemie-code/tools/index.d.ts +0 -111
- package/dist/agents/codemie-code/tools/index.d.ts.map +0 -1
- package/dist/agents/codemie-code/tools/index.js +0 -424
- package/dist/agents/codemie-code/tools/index.js.map +0 -1
- package/dist/agents/codemie-code/tools/planning.d.ts +0 -54
- package/dist/agents/codemie-code/tools/planning.d.ts.map +0 -1
- package/dist/agents/codemie-code/tools/planning.js +0 -226
- package/dist/agents/codemie-code/tools/planning.js.map +0 -1
- package/dist/agents/codemie-code/types.d.ts +0 -459
- package/dist/agents/codemie-code/types.d.ts.map +0 -1
- package/dist/agents/codemie-code/types.js +0 -59
- package/dist/agents/codemie-code/types.js.map +0 -1
- package/dist/agents/codemie-code/ui/autocomplete.d.ts +0 -98
- package/dist/agents/codemie-code/ui/autocomplete.d.ts.map +0 -1
- package/dist/agents/codemie-code/ui/autocomplete.js +0 -145
- package/dist/agents/codemie-code/ui/autocomplete.js.map +0 -1
- package/dist/agents/codemie-code/ui/keyHandlers.d.ts +0 -112
- package/dist/agents/codemie-code/ui/keyHandlers.d.ts.map +0 -1
- package/dist/agents/codemie-code/ui/keyHandlers.js +0 -415
- package/dist/agents/codemie-code/ui/keyHandlers.js.map +0 -1
- package/dist/agents/codemie-code/ui/mentions.d.ts +0 -86
- package/dist/agents/codemie-code/ui/mentions.d.ts.map +0 -1
- package/dist/agents/codemie-code/ui/mentions.js +0 -122
- package/dist/agents/codemie-code/ui/mentions.js.map +0 -1
- package/dist/agents/codemie-code/ui/progressTracker.d.ts +0 -125
- package/dist/agents/codemie-code/ui/progressTracker.d.ts.map +0 -1
- package/dist/agents/codemie-code/ui/progressTracker.js +0 -343
- package/dist/agents/codemie-code/ui/progressTracker.js.map +0 -1
- package/dist/agents/codemie-code/ui/terminalCodes.d.ts +0 -38
- package/dist/agents/codemie-code/ui/terminalCodes.d.ts.map +0 -1
- package/dist/agents/codemie-code/ui/terminalCodes.js +0 -42
- package/dist/agents/codemie-code/ui/terminalCodes.js.map +0 -1
- package/dist/agents/codemie-code/ui/todoPanel.d.ts +0 -112
- package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +0 -1
- package/dist/agents/codemie-code/ui/todoPanel.js +0 -321
- package/dist/agents/codemie-code/ui/todoPanel.js.map +0 -1
- package/dist/agents/codemie-code/ui.d.ts +0 -180
- package/dist/agents/codemie-code/ui.d.ts.map +0 -1
- package/dist/agents/codemie-code/ui.js +0 -1345
- package/dist/agents/codemie-code/ui.js.map +0 -1
- package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts +0 -87
- package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts.map +0 -1
- package/dist/agents/codemie-code/utils/progressionEnforcer.js +0 -293
- package/dist/agents/codemie-code/utils/progressionEnforcer.js.map +0 -1
- package/dist/agents/codemie-code/utils/todoParser.d.ts +0 -41
- package/dist/agents/codemie-code/utils/todoParser.d.ts.map +0 -1
- package/dist/agents/codemie-code/utils/todoParser.js +0 -305
- package/dist/agents/codemie-code/utils/todoParser.js.map +0 -1
- package/dist/agents/codemie-code/utils/todoValidator.d.ts +0 -65
- package/dist/agents/codemie-code/utils/todoValidator.d.ts.map +0 -1
- package/dist/agents/codemie-code/utils/todoValidator.js +0 -249
- package/dist/agents/codemie-code/utils/todoValidator.js.map +0 -1
- package/dist/agents/codemie-code/validators/planValidator.d.ts +0 -94
- package/dist/agents/codemie-code/validators/planValidator.d.ts.map +0 -1
- package/dist/agents/codemie-code/validators/planValidator.js +0 -281
- package/dist/agents/codemie-code/validators/planValidator.js.map +0 -1
- package/dist/agents/plugins/claude/plugin/hooks/hooks.windows.json +0 -98
- package/dist/agents/plugins/claude/plugin/sounds/play-random-sound.ps1 +0 -112
- package/dist/agents/plugins/claude/plugin/sounds/play-random-sound.sh +0 -58
- package/dist/agents/plugins/gemini/session/utils/token-aggregator.d.ts +0 -26
- package/dist/agents/plugins/gemini/session/utils/token-aggregator.d.ts.map +0 -1
- package/dist/agents/plugins/gemini/session/utils/token-aggregator.js +0 -38
- package/dist/agents/plugins/gemini/session/utils/token-aggregator.js.map +0 -1
- package/dist/cli/commands/assistants/chat.d.ts.map +0 -1
- package/dist/cli/commands/assistants/chat.js.map +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.d.ts +0 -26
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.d.ts.map +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.js +0 -146
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-api-client.js.map +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts +0 -22
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts.map +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js.map +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.d.ts.map +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.js +0 -7
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-types.js.map +0 -1
- /package/dist/{agents/codemie-code/skills → skills}/core/SkillManager.d.ts +0 -0
- /package/dist/{agents/codemie-code/skills → skills}/core/types.js +0 -0
- /package/dist/{agents/codemie-code/skills → skills}/sync/SkillSync.d.ts +0 -0
- /package/dist/{agents/codemie-code/skills → skills}/utils/pattern-matcher.d.ts +0 -0
- /package/dist/{agents/codemie-code/skills → skills}/utils/pattern-matcher.js +0 -0
- /package/dist/{agents/codemie-code/skills/utils → utils}/frontmatter.d.ts +0 -0
- /package/dist/{agents/codemie-code/skills/utils → utils}/frontmatter.js +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Agents Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers agent definitions from a plugin's agents/ directory.
|
|
5
|
+
* Each agent is namespaced with the plugin name.
|
|
6
|
+
*/
|
|
7
|
+
import type { PluginAgent, PluginManifest } from '../core/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Discover agents from a plugin directory
|
|
10
|
+
*
|
|
11
|
+
* Looks for *.md files in the plugin's agents/ directory (or custom paths from manifest).
|
|
12
|
+
* Each agent is namespaced as "plugin-name:agent-name".
|
|
13
|
+
*
|
|
14
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
15
|
+
* @param manifest - Parsed plugin manifest
|
|
16
|
+
* @returns Array of discovered plugin agents
|
|
17
|
+
*/
|
|
18
|
+
export declare function discoverPluginAgents(pluginDir: string, manifest: PluginManifest): Promise<PluginAgent[]>;
|
|
19
|
+
//# sourceMappingURL=agents-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/loaders/agents-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,EAAE,CAAC,CAiCxB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Agents Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers agent definitions from a plugin's agents/ directory.
|
|
5
|
+
* Each agent is namespaced with the plugin name.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from 'fs/promises';
|
|
8
|
+
import { join, basename } from 'path';
|
|
9
|
+
import fg from 'fast-glob';
|
|
10
|
+
import { logger } from '../../utils/logger.js';
|
|
11
|
+
import { parseFrontmatter, hasFrontmatter } from '../../utils/frontmatter.js';
|
|
12
|
+
/**
|
|
13
|
+
* Discover agents from a plugin directory
|
|
14
|
+
*
|
|
15
|
+
* Looks for *.md files in the plugin's agents/ directory (or custom paths from manifest).
|
|
16
|
+
* Each agent is namespaced as "plugin-name:agent-name".
|
|
17
|
+
*
|
|
18
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
19
|
+
* @param manifest - Parsed plugin manifest
|
|
20
|
+
* @returns Array of discovered plugin agents
|
|
21
|
+
*/
|
|
22
|
+
export async function discoverPluginAgents(pluginDir, manifest) {
|
|
23
|
+
const agentsDirs = resolveAgentDirs(pluginDir, manifest.agents);
|
|
24
|
+
const agents = [];
|
|
25
|
+
for (const dir of agentsDirs) {
|
|
26
|
+
try {
|
|
27
|
+
const files = await fg('*.md', {
|
|
28
|
+
cwd: dir,
|
|
29
|
+
absolute: true,
|
|
30
|
+
caseSensitiveMatch: false,
|
|
31
|
+
deep: 1,
|
|
32
|
+
ignore: ['**/node_modules/**', '**/.git/**'],
|
|
33
|
+
onlyFiles: true,
|
|
34
|
+
});
|
|
35
|
+
for (const filePath of files) {
|
|
36
|
+
try {
|
|
37
|
+
const agent = await parsePluginAgentFile(filePath, manifest.name);
|
|
38
|
+
if (agent) {
|
|
39
|
+
agents.push(agent);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
logger.debug(`[plugin] Failed to parse agent ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// Directory doesn't exist — skip silently
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return agents;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Parse a single agent .md file into a PluginAgent
|
|
55
|
+
*/
|
|
56
|
+
async function parsePluginAgentFile(filePath, pluginName) {
|
|
57
|
+
const fileContent = await readFile(filePath, 'utf-8');
|
|
58
|
+
let metadata = {};
|
|
59
|
+
let content;
|
|
60
|
+
if (hasFrontmatter(fileContent)) {
|
|
61
|
+
const parsed = parseFrontmatter(fileContent, filePath);
|
|
62
|
+
metadata = parsed.metadata;
|
|
63
|
+
content = parsed.content;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
content = fileContent.trim();
|
|
67
|
+
}
|
|
68
|
+
// Derive agent name from metadata or filename (without .md extension)
|
|
69
|
+
const agentName = metadata.name || basename(filePath, '.md');
|
|
70
|
+
if (!agentName) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
pluginName,
|
|
75
|
+
agentName,
|
|
76
|
+
namespacedName: `${pluginName}:${agentName}`,
|
|
77
|
+
filePath,
|
|
78
|
+
content,
|
|
79
|
+
metadata,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Resolve agent directories from manifest field or defaults
|
|
84
|
+
*/
|
|
85
|
+
function resolveAgentDirs(pluginDir, agentsField) {
|
|
86
|
+
if (!agentsField) {
|
|
87
|
+
return [join(pluginDir, 'agents')];
|
|
88
|
+
}
|
|
89
|
+
const paths = Array.isArray(agentsField) ? agentsField : [agentsField];
|
|
90
|
+
return paths.map(p => join(pluginDir, p));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=agents-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-loader.js","sourceRoot":"","sources":["../../../src/plugins/loaders/agents-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,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
|
+
/**
|
|
2
|
+
* Plugin Hooks Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers and merges hooks configuration from plugins.
|
|
5
|
+
* Supports both hooks/hooks.json files and inline manifest hooks config.
|
|
6
|
+
*/
|
|
7
|
+
import type { HooksConfiguration } from '../../hooks/types.js';
|
|
8
|
+
import type { PluginManifest } from '../core/types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Load hooks configuration from a plugin
|
|
11
|
+
*
|
|
12
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
13
|
+
* @param manifest - Parsed plugin manifest
|
|
14
|
+
* @returns HooksConfiguration or null if no hooks found
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadPluginHooks(pluginDir: string, manifest: PluginManifest): Promise<HooksConfiguration | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Merge plugin hooks into an existing hooks configuration
|
|
19
|
+
*
|
|
20
|
+
* Plugin hooks are appended to each event's matcher array (lower priority than profile hooks).
|
|
21
|
+
*
|
|
22
|
+
* @param base - Existing hooks configuration (from profile or defaults)
|
|
23
|
+
* @param pluginHooks - Hooks from a plugin
|
|
24
|
+
* @returns Merged hooks configuration
|
|
25
|
+
*/
|
|
26
|
+
export declare function mergeHooks(base: HooksConfiguration, pluginHooks: HooksConfiguration): HooksConfiguration;
|
|
27
|
+
//# sourceMappingURL=hooks-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/loaders/hooks-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,kBAAkB,EAAe,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA4BpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,kBAAkB,GAC9B,kBAAkB,CAapB"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Hooks Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers and merges hooks configuration from plugins.
|
|
5
|
+
* Supports both hooks/hooks.json files and inline manifest hooks config.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from 'fs/promises';
|
|
8
|
+
import { join } from 'path';
|
|
9
|
+
import { existsSync } from 'fs';
|
|
10
|
+
import { logger } from '../../utils/logger.js';
|
|
11
|
+
import { expandPluginRoot } from '../core/manifest-parser.js';
|
|
12
|
+
/**
|
|
13
|
+
* Load hooks configuration from a plugin
|
|
14
|
+
*
|
|
15
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
16
|
+
* @param manifest - Parsed plugin manifest
|
|
17
|
+
* @returns HooksConfiguration or null if no hooks found
|
|
18
|
+
*/
|
|
19
|
+
export async function loadPluginHooks(pluginDir, manifest) {
|
|
20
|
+
const hooksField = manifest.hooks;
|
|
21
|
+
// Inline hooks configuration in manifest
|
|
22
|
+
if (hooksField && typeof hooksField === 'object' && !Array.isArray(hooksField)) {
|
|
23
|
+
return hooksField;
|
|
24
|
+
}
|
|
25
|
+
// Path(s) to hooks config files
|
|
26
|
+
const hooksPaths = resolveHooksPaths(pluginDir, hooksField);
|
|
27
|
+
for (const hooksPath of hooksPaths) {
|
|
28
|
+
if (!existsSync(hooksPath))
|
|
29
|
+
continue;
|
|
30
|
+
try {
|
|
31
|
+
const raw = await readFile(hooksPath, 'utf-8');
|
|
32
|
+
const parsed = JSON.parse(raw);
|
|
33
|
+
// Expand ${CLAUDE_PLUGIN_ROOT} in command strings
|
|
34
|
+
return expandHooksCommands(parsed, pluginDir);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
logger.debug(`[plugin] Failed to parse hooks from ${hooksPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Merge plugin hooks into an existing hooks configuration
|
|
44
|
+
*
|
|
45
|
+
* Plugin hooks are appended to each event's matcher array (lower priority than profile hooks).
|
|
46
|
+
*
|
|
47
|
+
* @param base - Existing hooks configuration (from profile or defaults)
|
|
48
|
+
* @param pluginHooks - Hooks from a plugin
|
|
49
|
+
* @returns Merged hooks configuration
|
|
50
|
+
*/
|
|
51
|
+
export function mergeHooks(base, pluginHooks) {
|
|
52
|
+
const merged = { ...base };
|
|
53
|
+
const events = Object.keys(pluginHooks);
|
|
54
|
+
for (const event of events) {
|
|
55
|
+
const pluginMatchers = pluginHooks[event];
|
|
56
|
+
if (!pluginMatchers || pluginMatchers.length === 0)
|
|
57
|
+
continue;
|
|
58
|
+
const baseMatchers = merged[event] || [];
|
|
59
|
+
merged[event] = [...baseMatchers, ...pluginMatchers];
|
|
60
|
+
}
|
|
61
|
+
return merged;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve hooks file paths from manifest field or defaults
|
|
65
|
+
*/
|
|
66
|
+
function resolveHooksPaths(pluginDir, hooksField) {
|
|
67
|
+
if (!hooksField || typeof hooksField === 'object') {
|
|
68
|
+
// Default: check hooks/hooks.json
|
|
69
|
+
return [join(pluginDir, 'hooks', 'hooks.json')];
|
|
70
|
+
}
|
|
71
|
+
const paths = Array.isArray(hooksField) ? hooksField : [hooksField];
|
|
72
|
+
return paths.map(p => join(pluginDir, p));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Expand ${CLAUDE_PLUGIN_ROOT} in all hook command strings
|
|
76
|
+
*/
|
|
77
|
+
function expandHooksCommands(hooks, pluginDir) {
|
|
78
|
+
const result = {};
|
|
79
|
+
const events = Object.keys(hooks);
|
|
80
|
+
for (const event of events) {
|
|
81
|
+
const matchers = hooks[event];
|
|
82
|
+
if (!matchers)
|
|
83
|
+
continue;
|
|
84
|
+
result[event] = matchers.map((matcher) => ({
|
|
85
|
+
...matcher,
|
|
86
|
+
hooks: matcher.hooks.map(hook => ({
|
|
87
|
+
...hook,
|
|
88
|
+
...(hook.command && { command: expandPluginRoot(hook.command, pluginDir) }),
|
|
89
|
+
})),
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=hooks-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks-loader.js","sourceRoot":"","sources":["../../../src/plugins/loaders/hooks-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAI9D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,SAAiB,EACjB,QAAwB;IAExB,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC;IAElC,yCAAyC;IACzC,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/E,OAAO,UAAgC,CAAC;IAC1C,CAAC;IAED,gCAAgC;IAChC,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAE5D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,SAAS;QAErC,IAAI,CAAC;YACH,MAAM,GAAG,GA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AAC,CAAC;IAClD,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACpE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAC1B,KAAyB,EACzB,SAAiB;IAEjB,MAAM,MAAM,GAAuB,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAoC,CAAC;IAErE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,QAAQ;YAAE,SAAS;QAExB,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAoB,EAAE,EAAE,CAAC,CAAC;YACtD,GAAG,OAAO;YACV,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAChC,GAAG,IAAI;gBACP,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;aAC5E,CAAC,CAAC;SACJ,CAAC,CAAC,CAAC;IACN,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin MCP Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers and merges MCP (Model Context Protocol) server configurations from plugins.
|
|
5
|
+
* MCP servers are namespaced to avoid conflicts between plugins.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpConfig, PluginManifest } from '../core/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Load MCP server configuration from a plugin
|
|
10
|
+
*
|
|
11
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
12
|
+
* @param manifest - Parsed plugin manifest
|
|
13
|
+
* @returns McpConfig with namespaced server names, or null if none found
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadPluginMcpServers(pluginDir: string, manifest: PluginManifest): Promise<McpConfig | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Merge plugin MCP config into an existing MCP configuration
|
|
18
|
+
*
|
|
19
|
+
* @param base - Existing MCP config
|
|
20
|
+
* @param pluginMcp - MCP config from a plugin (already namespaced)
|
|
21
|
+
* @returns Merged MCP config
|
|
22
|
+
*/
|
|
23
|
+
export declare function mergeMcpConfigs(base: McpConfig, pluginMcp: McpConfig): McpConfig;
|
|
24
|
+
//# sourceMappingURL=mcp-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/loaders/mcp-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CA2B3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,CAOhF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin MCP Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers and merges MCP (Model Context Protocol) server configurations from plugins.
|
|
5
|
+
* MCP servers are namespaced to avoid conflicts between plugins.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from 'fs/promises';
|
|
8
|
+
import { join } from 'path';
|
|
9
|
+
import { existsSync } from 'fs';
|
|
10
|
+
import { logger } from '../../utils/logger.js';
|
|
11
|
+
import { expandPluginRootDeep } from '../core/manifest-parser.js';
|
|
12
|
+
/**
|
|
13
|
+
* Load MCP server configuration from a plugin
|
|
14
|
+
*
|
|
15
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
16
|
+
* @param manifest - Parsed plugin manifest
|
|
17
|
+
* @returns McpConfig with namespaced server names, or null if none found
|
|
18
|
+
*/
|
|
19
|
+
export async function loadPluginMcpServers(pluginDir, manifest) {
|
|
20
|
+
const mcpField = manifest.mcpServers;
|
|
21
|
+
// Inline MCP config in manifest
|
|
22
|
+
if (mcpField && typeof mcpField === 'object' && !Array.isArray(mcpField)) {
|
|
23
|
+
const config = mcpField;
|
|
24
|
+
return namespaceMcpServers(config, manifest.name, pluginDir);
|
|
25
|
+
}
|
|
26
|
+
// Path(s) to MCP config files
|
|
27
|
+
const mcpPaths = resolveMcpPaths(pluginDir, mcpField);
|
|
28
|
+
for (const mcpPath of mcpPaths) {
|
|
29
|
+
if (!existsSync(mcpPath))
|
|
30
|
+
continue;
|
|
31
|
+
try {
|
|
32
|
+
const raw = await readFile(mcpPath, 'utf-8');
|
|
33
|
+
const parsed = JSON.parse(raw);
|
|
34
|
+
return namespaceMcpServers(parsed, manifest.name, pluginDir);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
logger.debug(`[plugin] Failed to parse MCP config from ${mcpPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Merge plugin MCP config into an existing MCP configuration
|
|
44
|
+
*
|
|
45
|
+
* @param base - Existing MCP config
|
|
46
|
+
* @param pluginMcp - MCP config from a plugin (already namespaced)
|
|
47
|
+
* @returns Merged MCP config
|
|
48
|
+
*/
|
|
49
|
+
export function mergeMcpConfigs(base, pluginMcp) {
|
|
50
|
+
return {
|
|
51
|
+
mcpServers: {
|
|
52
|
+
...base.mcpServers,
|
|
53
|
+
...pluginMcp.mcpServers,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Namespace MCP server names to prevent conflicts between plugins
|
|
59
|
+
*
|
|
60
|
+
* E.g., a server named "filesystem" in plugin "my-tools" becomes "my-tools:filesystem"
|
|
61
|
+
*/
|
|
62
|
+
function namespaceMcpServers(config, pluginName, pluginDir) {
|
|
63
|
+
if (!config.mcpServers) {
|
|
64
|
+
return { mcpServers: {} };
|
|
65
|
+
}
|
|
66
|
+
const namespacedServers = {};
|
|
67
|
+
for (const [serverName, serverConfig] of Object.entries(config.mcpServers)) {
|
|
68
|
+
const namespacedName = `${pluginName}:${serverName}`;
|
|
69
|
+
// Expand ${CLAUDE_PLUGIN_ROOT} in server config
|
|
70
|
+
const expanded = expandPluginRootDeep(serverConfig, pluginDir);
|
|
71
|
+
namespacedServers[namespacedName] = expanded;
|
|
72
|
+
}
|
|
73
|
+
return { mcpServers: namespacedServers };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Resolve MCP config file paths from manifest field or defaults
|
|
77
|
+
*/
|
|
78
|
+
function resolveMcpPaths(pluginDir, mcpField) {
|
|
79
|
+
if (!mcpField || typeof mcpField === 'object') {
|
|
80
|
+
// Default: check .mcp.json at plugin root
|
|
81
|
+
return [join(pluginDir, '.mcp.json')];
|
|
82
|
+
}
|
|
83
|
+
const paths = Array.isArray(mcpField) ? mcpField : [mcpField];
|
|
84
|
+
return paths.map(p => join(pluginDir, p));
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=mcp-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-loader.js","sourceRoot":"","sources":["../../../src/plugins/loaders/mcp-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QA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AC9D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Skills Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers skills from a plugin's skills/ and commands/ directories.
|
|
5
|
+
* Skills are namespaced with the plugin name to avoid conflicts.
|
|
6
|
+
*/
|
|
7
|
+
import type { PluginSkill, PluginCommand, PluginManifest } from '../core/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Discover skills from a plugin directory
|
|
10
|
+
*
|
|
11
|
+
* Looks for SKILL.md files in the plugin's skills/ directory (or custom paths from manifest).
|
|
12
|
+
* Each skill is namespaced as "plugin-name:skill-name".
|
|
13
|
+
*
|
|
14
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
15
|
+
* @param manifest - Parsed plugin manifest
|
|
16
|
+
* @returns Array of discovered plugin skills
|
|
17
|
+
*/
|
|
18
|
+
export declare function discoverPluginSkills(pluginDir: string, manifest: PluginManifest): Promise<PluginSkill[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Discover commands from a plugin directory
|
|
21
|
+
*
|
|
22
|
+
* Looks for *.md files in the plugin's commands/ directory (or custom paths from manifest).
|
|
23
|
+
* Each command is namespaced as "plugin-name:command-name".
|
|
24
|
+
*
|
|
25
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
26
|
+
* @param manifest - Parsed plugin manifest
|
|
27
|
+
* @returns Array of discovered plugin commands
|
|
28
|
+
*/
|
|
29
|
+
export declare function discoverPluginCommands(pluginDir: string, manifest: PluginManifest): Promise<PluginCommand[]>;
|
|
30
|
+
//# sourceMappingURL=skills-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/loaders/skills-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEnF;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,EAAE,CAAC,CAiCxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,EAAE,CAAC,CAiC1B"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Skills Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers skills from a plugin's skills/ and commands/ directories.
|
|
5
|
+
* Skills are namespaced with the plugin name to avoid conflicts.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from 'fs/promises';
|
|
8
|
+
import { join, basename, dirname } from 'path';
|
|
9
|
+
import fg from 'fast-glob';
|
|
10
|
+
import { logger } from '../../utils/logger.js';
|
|
11
|
+
import { parseFrontmatter, hasFrontmatter } from '../../utils/frontmatter.js';
|
|
12
|
+
/**
|
|
13
|
+
* Discover skills from a plugin directory
|
|
14
|
+
*
|
|
15
|
+
* Looks for SKILL.md files in the plugin's skills/ directory (or custom paths from manifest).
|
|
16
|
+
* Each skill is namespaced as "plugin-name:skill-name".
|
|
17
|
+
*
|
|
18
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
19
|
+
* @param manifest - Parsed plugin manifest
|
|
20
|
+
* @returns Array of discovered plugin skills
|
|
21
|
+
*/
|
|
22
|
+
export async function discoverPluginSkills(pluginDir, manifest) {
|
|
23
|
+
const skillsDirs = resolveComponentDirs(pluginDir, manifest.skills, 'skills');
|
|
24
|
+
const skills = [];
|
|
25
|
+
for (const dir of skillsDirs) {
|
|
26
|
+
try {
|
|
27
|
+
const files = await fg('**/SKILL.md', {
|
|
28
|
+
cwd: dir,
|
|
29
|
+
absolute: true,
|
|
30
|
+
caseSensitiveMatch: false,
|
|
31
|
+
deep: 3,
|
|
32
|
+
ignore: ['**/node_modules/**', '**/.git/**'],
|
|
33
|
+
onlyFiles: true,
|
|
34
|
+
});
|
|
35
|
+
for (const filePath of files) {
|
|
36
|
+
try {
|
|
37
|
+
const skill = await parsePluginSkillFile(filePath, manifest.name);
|
|
38
|
+
if (skill) {
|
|
39
|
+
skills.push(skill);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
logger.debug(`[plugin] Failed to parse skill ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// Directory doesn't exist — skip silently
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return skills;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Discover commands from a plugin directory
|
|
55
|
+
*
|
|
56
|
+
* Looks for *.md files in the plugin's commands/ directory (or custom paths from manifest).
|
|
57
|
+
* Each command is namespaced as "plugin-name:command-name".
|
|
58
|
+
*
|
|
59
|
+
* @param pluginDir - Absolute path to the plugin root
|
|
60
|
+
* @param manifest - Parsed plugin manifest
|
|
61
|
+
* @returns Array of discovered plugin commands
|
|
62
|
+
*/
|
|
63
|
+
export async function discoverPluginCommands(pluginDir, manifest) {
|
|
64
|
+
const commandsDirs = resolveComponentDirs(pluginDir, manifest.commands, 'commands');
|
|
65
|
+
const commands = [];
|
|
66
|
+
for (const dir of commandsDirs) {
|
|
67
|
+
try {
|
|
68
|
+
const files = await fg('*.md', {
|
|
69
|
+
cwd: dir,
|
|
70
|
+
absolute: true,
|
|
71
|
+
caseSensitiveMatch: false,
|
|
72
|
+
deep: 1,
|
|
73
|
+
ignore: ['**/node_modules/**', '**/.git/**'],
|
|
74
|
+
onlyFiles: true,
|
|
75
|
+
});
|
|
76
|
+
for (const filePath of files) {
|
|
77
|
+
try {
|
|
78
|
+
const command = await parsePluginCommandFile(filePath, manifest.name);
|
|
79
|
+
if (command) {
|
|
80
|
+
commands.push(command);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
logger.debug(`[plugin] Failed to parse command ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// Directory doesn't exist — skip silently
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return commands;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Parse a single SKILL.md file into a PluginSkill
|
|
96
|
+
*/
|
|
97
|
+
async function parsePluginSkillFile(filePath, pluginName) {
|
|
98
|
+
const fileContent = await readFile(filePath, 'utf-8');
|
|
99
|
+
let metadata = {};
|
|
100
|
+
let content;
|
|
101
|
+
if (hasFrontmatter(fileContent)) {
|
|
102
|
+
const parsed = parseFrontmatter(fileContent, filePath);
|
|
103
|
+
metadata = parsed.metadata;
|
|
104
|
+
content = parsed.content;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
content = fileContent.trim();
|
|
108
|
+
}
|
|
109
|
+
// Derive skill name from metadata or directory name
|
|
110
|
+
const skillName = metadata.name || basename(dirname(filePath));
|
|
111
|
+
if (!skillName) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
pluginName,
|
|
116
|
+
skillName,
|
|
117
|
+
namespacedName: `${pluginName}:${skillName}`,
|
|
118
|
+
filePath,
|
|
119
|
+
content,
|
|
120
|
+
metadata,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Parse a single command .md file into a PluginCommand
|
|
125
|
+
*/
|
|
126
|
+
async function parsePluginCommandFile(filePath, pluginName) {
|
|
127
|
+
const fileContent = await readFile(filePath, 'utf-8');
|
|
128
|
+
let metadata = {};
|
|
129
|
+
let content;
|
|
130
|
+
if (hasFrontmatter(fileContent)) {
|
|
131
|
+
const parsed = parseFrontmatter(fileContent, filePath);
|
|
132
|
+
metadata = parsed.metadata;
|
|
133
|
+
content = parsed.content;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
content = fileContent.trim();
|
|
137
|
+
}
|
|
138
|
+
// Derive command name from metadata or filename (without .md extension)
|
|
139
|
+
const commandName = metadata.name || basename(filePath, '.md');
|
|
140
|
+
if (!commandName) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
pluginName,
|
|
145
|
+
commandName,
|
|
146
|
+
namespacedName: `${pluginName}:${commandName}`,
|
|
147
|
+
filePath,
|
|
148
|
+
content,
|
|
149
|
+
metadata,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Resolve component directories from manifest field or defaults
|
|
154
|
+
*
|
|
155
|
+
* @param pluginDir - Plugin root directory
|
|
156
|
+
* @param manifestField - Value from manifest (string, string[], or undefined)
|
|
157
|
+
* @param defaultDir - Default directory name (e.g., 'skills', 'commands')
|
|
158
|
+
* @returns Array of absolute directory paths to scan
|
|
159
|
+
*/
|
|
160
|
+
function resolveComponentDirs(pluginDir, manifestField, defaultDir) {
|
|
161
|
+
if (!manifestField) {
|
|
162
|
+
return [join(pluginDir, defaultDir)];
|
|
163
|
+
}
|
|
164
|
+
const paths = Array.isArray(manifestField) ? manifestField : [manifestField];
|
|
165
|
+
return paths.map(p => join(pluginDir, p));
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=skills-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-loader.js","sourceRoot":"","sources":["../../../src/plugins/loaders/skills-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,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,WAAW,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,wEAAwE;IACxE,MAAM,WAAW,GAAI,QAAQ,CAAC,IAAe,IAAI,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAE3E,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,UAAU;QACV,WAAW;QACX,cAAc,EAAE,GAAG,UAAU,IAAI,WAAW,EAAE;QAC9C,QAAQ;QACR,OAAO;QACP,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAC3B,SAAiB,EACjB,aAA4C,EAC5C,UAAkB;IAElB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IAC7E,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -17,7 +17,7 @@ export const BedrockTemplate = registerProvider({
|
|
|
17
17
|
priority: 15,
|
|
18
18
|
defaultProfileName: 'bedrock',
|
|
19
19
|
recommendedModels: [
|
|
20
|
-
'claude-sonnet-4-
|
|
20
|
+
'claude-sonnet-4-6', // Latest Claude Sonnet 4.6
|
|
21
21
|
],
|
|
22
22
|
capabilities: ['streaming', 'tools', 'function-calling', 'vision'],
|
|
23
23
|
supportsModelInstallation: false,
|
|
@@ -94,7 +94,7 @@ export const JWTBearerSetupSteps = {
|
|
|
94
94
|
// Return default models - actual model list will be fetched at runtime with JWT token
|
|
95
95
|
// User can override model selection via CLI or config
|
|
96
96
|
return [
|
|
97
|
-
'claude-4-
|
|
97
|
+
'claude-sonnet-4-6',
|
|
98
98
|
'claude-opus-4-6',
|
|
99
99
|
'claude-4-5-haiku',
|
|
100
100
|
'gpt-4-turbo',
|
|
@@ -19,7 +19,7 @@ export const JWTTemplate = registerProvider({
|
|
|
19
19
|
hidden: true, // Not shown in interactive setup - used only for script/auto-configuration
|
|
20
20
|
defaultProfileName: 'jwt-bearer',
|
|
21
21
|
recommendedModels: [
|
|
22
|
-
'claude-4-
|
|
22
|
+
'claude-sonnet-4-6',
|
|
23
23
|
'claude-opus-4-6',
|
|
24
24
|
'gpt-4-turbo',
|
|
25
25
|
],
|
|
@@ -17,7 +17,7 @@ export const LiteLLMTemplate = registerProvider({
|
|
|
17
17
|
priority: 14,
|
|
18
18
|
defaultProfileName: 'litellm',
|
|
19
19
|
recommendedModels: [
|
|
20
|
-
'claude-4-
|
|
20
|
+
'claude-sonnet-4-6'
|
|
21
21
|
],
|
|
22
22
|
capabilities: ['streaming', 'tools', 'function-calling'],
|
|
23
23
|
supportsModelInstallation: false,
|
|
@@ -49,6 +49,16 @@ class HeaderInjectionInterceptor {
|
|
|
49
49
|
if (config.clientType) {
|
|
50
50
|
context.headers['X-CodeMie-Client'] = config.clientType;
|
|
51
51
|
}
|
|
52
|
+
// Add repository, branch and project headers
|
|
53
|
+
if (config.repository) {
|
|
54
|
+
context.headers['X-CodeMie-Repository'] = config.repository;
|
|
55
|
+
}
|
|
56
|
+
if (config.branch) {
|
|
57
|
+
context.headers['X-CodeMie-Branch'] = config.branch;
|
|
58
|
+
}
|
|
59
|
+
if (config.project) {
|
|
60
|
+
context.headers['X-CodeMie-Project'] = config.project;
|
|
61
|
+
}
|
|
52
62
|
logger.debug(`[${this.name}] Injected CodeMie headers`);
|
|
53
63
|
}
|
|
54
64
|
}
|