@codemieai/code 0.0.44 → 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 +9 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +31 -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/core/types.d.ts +83 -0
- package/dist/agents/core/types.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.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +10 -1
- package/dist/agents/plugins/claude/claude.plugin.js.map +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 +10 -5
- 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.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js +10 -0
- package/dist/agents/plugins/gemini/gemini.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.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +22 -6
- 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 +6 -5
- 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 +40 -39
- 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 +74 -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/extensions-scan.d.ts +27 -0
- package/dist/utils/extensions-scan.d.ts.map +1 -0
- package/dist/utils/extensions-scan.js +182 -0
- package/dist/utils/extensions-scan.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,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Manifest Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses and validates .claude-plugin/plugin.json files.
|
|
5
|
+
* Falls back to deriving plugin name from directory name if no manifest exists.
|
|
6
|
+
*/
|
|
7
|
+
import type { PluginManifest } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Expand ${CLAUDE_PLUGIN_ROOT} placeholders in string values
|
|
10
|
+
*/
|
|
11
|
+
export declare function expandPluginRoot(value: string, pluginRoot: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Recursively expand ${CLAUDE_PLUGIN_ROOT} in all string values of an object
|
|
14
|
+
*/
|
|
15
|
+
export declare function expandPluginRootDeep(obj: unknown, pluginRoot: string): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Parse a plugin manifest from a plugin directory
|
|
18
|
+
*
|
|
19
|
+
* @param pluginDir - Absolute path to the plugin root directory
|
|
20
|
+
* @returns Parsed and validated PluginManifest
|
|
21
|
+
* @throws Error if manifest is invalid (missing required fields)
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseManifest(pluginDir: string): Promise<PluginManifest>;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a directory contains a plugin manifest
|
|
26
|
+
*/
|
|
27
|
+
export declare function hasManifest(pluginDir: string): boolean;
|
|
28
|
+
//# sourceMappingURL=manifest-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-parser.d.ts","sourceRoot":"","sources":["../../../src/plugins/core/manifest-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAiBjD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAe9E;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAY9E;AAmFD;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Manifest Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses and validates .claude-plugin/plugin.json files.
|
|
5
|
+
* Falls back to deriving plugin name from directory name if no manifest exists.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from 'fs/promises';
|
|
8
|
+
import { join, basename } from 'path';
|
|
9
|
+
import { existsSync } from 'fs';
|
|
10
|
+
import { logger } from '../../utils/logger.js';
|
|
11
|
+
/**
|
|
12
|
+
* Manifest file paths to check (in order of priority)
|
|
13
|
+
*/
|
|
14
|
+
const MANIFEST_PATHS = [
|
|
15
|
+
'.claude-plugin/plugin.json',
|
|
16
|
+
'plugin.json',
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Validate that a plugin name is kebab-case
|
|
20
|
+
*/
|
|
21
|
+
function isValidPluginName(name) {
|
|
22
|
+
return /^[a-z0-9]+(-[a-z0-9]+)*$/.test(name);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Expand ${CLAUDE_PLUGIN_ROOT} placeholders in string values
|
|
26
|
+
*/
|
|
27
|
+
export function expandPluginRoot(value, pluginRoot) {
|
|
28
|
+
return value.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, pluginRoot);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Recursively expand ${CLAUDE_PLUGIN_ROOT} in all string values of an object
|
|
32
|
+
*/
|
|
33
|
+
export function expandPluginRootDeep(obj, pluginRoot) {
|
|
34
|
+
if (typeof obj === 'string') {
|
|
35
|
+
return expandPluginRoot(obj, pluginRoot);
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(obj)) {
|
|
38
|
+
return obj.map(item => expandPluginRootDeep(item, pluginRoot));
|
|
39
|
+
}
|
|
40
|
+
if (typeof obj === 'object' && obj !== null) {
|
|
41
|
+
const result = {};
|
|
42
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
43
|
+
result[key] = expandPluginRootDeep(value, pluginRoot);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
return obj;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Parse a plugin manifest from a plugin directory
|
|
51
|
+
*
|
|
52
|
+
* @param pluginDir - Absolute path to the plugin root directory
|
|
53
|
+
* @returns Parsed and validated PluginManifest
|
|
54
|
+
* @throws Error if manifest is invalid (missing required fields)
|
|
55
|
+
*/
|
|
56
|
+
export async function parseManifest(pluginDir) {
|
|
57
|
+
// Try to find manifest file
|
|
58
|
+
for (const manifestPath of MANIFEST_PATHS) {
|
|
59
|
+
const fullPath = join(pluginDir, manifestPath);
|
|
60
|
+
if (existsSync(fullPath)) {
|
|
61
|
+
return parseManifestFile(fullPath, pluginDir);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// No manifest found — derive from directory name
|
|
65
|
+
logger.debug(`[plugin] No manifest found in ${pluginDir}, deriving from directory name`);
|
|
66
|
+
return deriveManifestFromDir(pluginDir);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Parse a manifest from a specific file path
|
|
70
|
+
*/
|
|
71
|
+
async function parseManifestFile(filePath, pluginDir) {
|
|
72
|
+
const raw = await readFile(filePath, 'utf-8');
|
|
73
|
+
let parsed;
|
|
74
|
+
try {
|
|
75
|
+
parsed = JSON.parse(raw);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
throw new Error(`Invalid JSON in plugin manifest ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
79
|
+
}
|
|
80
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
81
|
+
throw new Error(`Plugin manifest must be a JSON object: ${filePath}`);
|
|
82
|
+
}
|
|
83
|
+
// Name is required
|
|
84
|
+
if (!parsed.name || typeof parsed.name !== 'string') {
|
|
85
|
+
throw new Error(`Plugin manifest must have a "name" field (string): ${filePath}`);
|
|
86
|
+
}
|
|
87
|
+
const name = parsed.name;
|
|
88
|
+
if (!isValidPluginName(name)) {
|
|
89
|
+
throw new Error(`Plugin name must be kebab-case (lowercase alphanumeric with hyphens): "${name}" in ${filePath}`);
|
|
90
|
+
}
|
|
91
|
+
// Expand ${CLAUDE_PLUGIN_ROOT} in all string values
|
|
92
|
+
const expanded = expandPluginRootDeep(parsed, pluginDir);
|
|
93
|
+
// Validate path fields are relative (if present)
|
|
94
|
+
validateRelativePaths(expanded, filePath);
|
|
95
|
+
return expanded;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Derive a minimal manifest from the directory name
|
|
99
|
+
*/
|
|
100
|
+
function deriveManifestFromDir(pluginDir) {
|
|
101
|
+
const dirName = basename(pluginDir);
|
|
102
|
+
// Convert to kebab-case (replace spaces/underscores with hyphens, lowercase)
|
|
103
|
+
const name = dirName
|
|
104
|
+
.toLowerCase()
|
|
105
|
+
.replace(/[_\s]+/g, '-')
|
|
106
|
+
.replace(/[^a-z0-9-]/g, '')
|
|
107
|
+
.replace(/-+/g, '-')
|
|
108
|
+
.replace(/^-|-$/g, '');
|
|
109
|
+
if (!name) {
|
|
110
|
+
throw new Error(`Cannot derive valid plugin name from directory: ${pluginDir}`);
|
|
111
|
+
}
|
|
112
|
+
return { name };
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Validate that path-like fields contain only relative paths
|
|
116
|
+
*/
|
|
117
|
+
function validateRelativePaths(manifest, filePath) {
|
|
118
|
+
const pathFields = ['commands', 'agents', 'skills', 'outputStyles'];
|
|
119
|
+
for (const field of pathFields) {
|
|
120
|
+
const value = manifest[field];
|
|
121
|
+
if (!value)
|
|
122
|
+
continue;
|
|
123
|
+
const paths = Array.isArray(value) ? value : [value];
|
|
124
|
+
for (const p of paths) {
|
|
125
|
+
if (typeof p === 'string' && (p.startsWith('/') || p.startsWith('\\'))) {
|
|
126
|
+
throw new Error(`Plugin manifest field "${field}" must use relative paths, got absolute: "${p}" in ${filePath}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Check if a directory contains a plugin manifest
|
|
133
|
+
*/
|
|
134
|
+
export function hasManifest(pluginDir) {
|
|
135
|
+
return MANIFEST_PATHS.some(p => existsSync(join(pluginDir, p)));
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=manifest-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-parser.js","sourceRoot":"","sources":["../../../src/plugins/core/manifest-parser.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,UAA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,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACrD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;gBACvE,MAAM,IAAI,KAAK,CACb,0BAA0B,KAAK,6CAA6C,CAAC,QAAQ,QAAQ,EAAE,CAChG,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB;IAC3C,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Cache
|
|
3
|
+
*
|
|
4
|
+
* Manages the plugin cache directory at ~/.codemie/plugins/cache/.
|
|
5
|
+
* Handles copying plugins for installation and cleaning up orphaned entries.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Get the plugin cache directory path
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPluginCacheDir(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Install a plugin from a source directory into the cache
|
|
13
|
+
*
|
|
14
|
+
* Copies the plugin directory to ~/.codemie/plugins/cache/<plugin-name>/.
|
|
15
|
+
* If the plugin already exists with the same version, skips the copy.
|
|
16
|
+
*
|
|
17
|
+
* @param sourceDir - Absolute path to the plugin source directory
|
|
18
|
+
* @returns The cache directory path where the plugin was installed
|
|
19
|
+
*/
|
|
20
|
+
export declare function installPluginToCache(sourceDir: string): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Remove a plugin from the cache
|
|
23
|
+
*
|
|
24
|
+
* @param pluginName - Name of the plugin to remove
|
|
25
|
+
* @returns true if the plugin was removed, false if not found
|
|
26
|
+
*/
|
|
27
|
+
export declare function removePluginFromCache(pluginName: string): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* List all cached plugins
|
|
30
|
+
*
|
|
31
|
+
* @returns Array of { name, dir } for each cached plugin
|
|
32
|
+
*/
|
|
33
|
+
export declare function listCachedPlugins(): Promise<Array<{
|
|
34
|
+
name: string;
|
|
35
|
+
dir: string;
|
|
36
|
+
}>>;
|
|
37
|
+
/**
|
|
38
|
+
* Read plugin settings from ~/.codemie/plugins.json
|
|
39
|
+
*/
|
|
40
|
+
export declare function readPluginSettings(): Promise<{
|
|
41
|
+
enabled?: string[];
|
|
42
|
+
disabled?: string[];
|
|
43
|
+
dirs?: string[];
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Write plugin settings to ~/.codemie/plugins.json
|
|
47
|
+
*/
|
|
48
|
+
export declare function writePluginSettings(settings: {
|
|
49
|
+
enabled?: string[];
|
|
50
|
+
disabled?: string[];
|
|
51
|
+
dirs?: string[];
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Enable a plugin by name (remove from disabled list)
|
|
55
|
+
*/
|
|
56
|
+
export declare function enablePlugin(pluginName: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Disable a plugin by name (add to disabled list)
|
|
59
|
+
*/
|
|
60
|
+
export declare function disablePlugin(pluginName: string): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Check if a plugin is installed in the cache
|
|
63
|
+
*/
|
|
64
|
+
export declare function isPluginCached(pluginName: string): boolean;
|
|
65
|
+
//# sourceMappingURL=plugin-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-cache.d.ts","sourceRoot":"","sources":["../../../src/plugins/core/plugin-cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkC7E;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAoBhF;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAmBvF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC,CAcD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE;IAClD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQrE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAG1D"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Cache
|
|
3
|
+
*
|
|
4
|
+
* Manages the plugin cache directory at ~/.codemie/plugins/cache/.
|
|
5
|
+
* Handles copying plugins for installation and cleaning up orphaned entries.
|
|
6
|
+
*/
|
|
7
|
+
import { join, resolve, sep } from 'path';
|
|
8
|
+
import { existsSync } from 'fs';
|
|
9
|
+
import { mkdir, cp, rm, readdir, readFile, writeFile } from 'fs/promises';
|
|
10
|
+
import { logger } from '../../utils/logger.js';
|
|
11
|
+
import { getCodemiePath } from '../../utils/paths.js';
|
|
12
|
+
import { parseManifest } from './manifest-parser.js';
|
|
13
|
+
/**
|
|
14
|
+
* Validate that a plugin name is safe (kebab-case, no path traversal)
|
|
15
|
+
*/
|
|
16
|
+
function validatePluginName(name) {
|
|
17
|
+
if (!name || /[/\\]/.test(name) || name.includes('..')) {
|
|
18
|
+
throw new Error(`Invalid plugin name: "${name}". Must be a simple kebab-case name.`);
|
|
19
|
+
}
|
|
20
|
+
if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(name)) {
|
|
21
|
+
throw new Error(`Invalid plugin name: "${name}". Must be kebab-case (lowercase alphanumeric with hyphens).`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the plugin cache directory path
|
|
26
|
+
*/
|
|
27
|
+
export function getPluginCacheDir() {
|
|
28
|
+
return getCodemiePath('plugins', 'cache');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Install a plugin from a source directory into the cache
|
|
32
|
+
*
|
|
33
|
+
* Copies the plugin directory to ~/.codemie/plugins/cache/<plugin-name>/.
|
|
34
|
+
* If the plugin already exists with the same version, skips the copy.
|
|
35
|
+
*
|
|
36
|
+
* @param sourceDir - Absolute path to the plugin source directory
|
|
37
|
+
* @returns The cache directory path where the plugin was installed
|
|
38
|
+
*/
|
|
39
|
+
export async function installPluginToCache(sourceDir) {
|
|
40
|
+
if (!existsSync(sourceDir)) {
|
|
41
|
+
throw new Error(`Plugin source directory does not exist: ${sourceDir}`);
|
|
42
|
+
}
|
|
43
|
+
// Parse manifest to get plugin name and version
|
|
44
|
+
const manifest = await parseManifest(sourceDir);
|
|
45
|
+
const cacheDir = getPluginCacheDir();
|
|
46
|
+
const pluginCacheDir = join(cacheDir, manifest.name);
|
|
47
|
+
// Check if already installed with same version
|
|
48
|
+
if (existsSync(pluginCacheDir)) {
|
|
49
|
+
try {
|
|
50
|
+
const existingManifest = await parseManifest(pluginCacheDir);
|
|
51
|
+
if (existingManifest.version && manifest.version && existingManifest.version === manifest.version) {
|
|
52
|
+
logger.debug(`[plugin] Plugin "${manifest.name}" v${manifest.version} already cached, skipping`);
|
|
53
|
+
return pluginCacheDir;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
logger.debug(`[plugin] Corrupt cache for "${manifest.name}", reinstalling: ${error instanceof Error ? error.message : String(error)}`);
|
|
58
|
+
}
|
|
59
|
+
// Remove existing cached version
|
|
60
|
+
await rm(pluginCacheDir, { recursive: true, force: true });
|
|
61
|
+
}
|
|
62
|
+
// Ensure cache directory exists
|
|
63
|
+
await mkdir(cacheDir, { recursive: true });
|
|
64
|
+
// Copy plugin to cache
|
|
65
|
+
await cp(sourceDir, pluginCacheDir, { recursive: true });
|
|
66
|
+
logger.debug(`[plugin] Installed "${manifest.name}" to cache: ${pluginCacheDir}`);
|
|
67
|
+
return pluginCacheDir;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Remove a plugin from the cache
|
|
71
|
+
*
|
|
72
|
+
* @param pluginName - Name of the plugin to remove
|
|
73
|
+
* @returns true if the plugin was removed, false if not found
|
|
74
|
+
*/
|
|
75
|
+
export async function removePluginFromCache(pluginName) {
|
|
76
|
+
validatePluginName(pluginName);
|
|
77
|
+
const cacheDir = getPluginCacheDir();
|
|
78
|
+
const pluginCacheDir = join(cacheDir, pluginName);
|
|
79
|
+
// Verify resolved path stays within cache directory
|
|
80
|
+
const resolvedPath = resolve(pluginCacheDir);
|
|
81
|
+
const resolvedCache = resolve(cacheDir);
|
|
82
|
+
if (!resolvedPath.startsWith(resolvedCache + sep)) {
|
|
83
|
+
throw new Error(`Plugin path escapes cache directory: ${pluginName}`);
|
|
84
|
+
}
|
|
85
|
+
if (!existsSync(pluginCacheDir)) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
await rm(pluginCacheDir, { recursive: true, force: true });
|
|
89
|
+
logger.debug(`[plugin] Removed "${pluginName}" from cache`);
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* List all cached plugins
|
|
94
|
+
*
|
|
95
|
+
* @returns Array of { name, dir } for each cached plugin
|
|
96
|
+
*/
|
|
97
|
+
export async function listCachedPlugins() {
|
|
98
|
+
const cacheDir = getPluginCacheDir();
|
|
99
|
+
if (!existsSync(cacheDir)) {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
const entries = await readdir(cacheDir, { withFileTypes: true });
|
|
104
|
+
return entries
|
|
105
|
+
.filter(entry => entry.isDirectory())
|
|
106
|
+
.map(entry => ({
|
|
107
|
+
name: entry.name,
|
|
108
|
+
dir: join(cacheDir, entry.name),
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
logger.debug(`[plugin] Failed to list cached plugins: ${error instanceof Error ? error.message : String(error)}`);
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Read plugin settings from ~/.codemie/plugins.json
|
|
118
|
+
*/
|
|
119
|
+
export async function readPluginSettings() {
|
|
120
|
+
const settingsPath = getCodemiePath('plugins.json');
|
|
121
|
+
if (!existsSync(settingsPath)) {
|
|
122
|
+
return {};
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
const raw = await readFile(settingsPath, 'utf-8');
|
|
126
|
+
return JSON.parse(raw);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
logger.debug(`[plugin] Failed to read plugin settings: ${error instanceof Error ? error.message : String(error)}`);
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Write plugin settings to ~/.codemie/plugins.json
|
|
135
|
+
*/
|
|
136
|
+
export async function writePluginSettings(settings) {
|
|
137
|
+
const settingsPath = getCodemiePath('plugins.json');
|
|
138
|
+
const pluginsDir = getCodemiePath('plugins');
|
|
139
|
+
await mkdir(pluginsDir, { recursive: true });
|
|
140
|
+
await writeFile(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Enable a plugin by name (remove from disabled list)
|
|
144
|
+
*/
|
|
145
|
+
export async function enablePlugin(pluginName) {
|
|
146
|
+
validatePluginName(pluginName);
|
|
147
|
+
const settings = await readPluginSettings();
|
|
148
|
+
settings.disabled = (settings.disabled || []).filter(n => n !== pluginName);
|
|
149
|
+
await writePluginSettings(settings);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Disable a plugin by name (add to disabled list)
|
|
153
|
+
*/
|
|
154
|
+
export async function disablePlugin(pluginName) {
|
|
155
|
+
validatePluginName(pluginName);
|
|
156
|
+
const settings = await readPluginSettings();
|
|
157
|
+
settings.disabled = settings.disabled || [];
|
|
158
|
+
if (!settings.disabled.includes(pluginName)) {
|
|
159
|
+
settings.disabled.push(pluginName);
|
|
160
|
+
}
|
|
161
|
+
await writePluginSettings(settings);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Check if a plugin is installed in the cache
|
|
165
|
+
*/
|
|
166
|
+
export function isPluginCached(pluginName) {
|
|
167
|
+
validatePluginName(pluginName);
|
|
168
|
+
return existsSync(join(getPluginCacheDir(), pluginName));
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=plugin-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-cache.js","sourceRoot":"","sources":["../../../src/plugins/core/plugin-cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,E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AAM,CAAC,KAAK,UAAU,YAAY,CAAC,UAAkB;IACnD,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC;IAC5E,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,UAAkB;IACpD,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC5C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5C,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Loader
|
|
3
|
+
*
|
|
4
|
+
* Loads a single plugin from a directory. Parses the manifest and discovers
|
|
5
|
+
* all components (skills, commands, agents, hooks, MCP servers).
|
|
6
|
+
*/
|
|
7
|
+
import type { LoadedPlugin, PluginSource } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Load a plugin from a directory
|
|
10
|
+
*
|
|
11
|
+
* Parses the manifest, discovers all components (skills, commands, agents,
|
|
12
|
+
* hooks, MCP servers), and returns a fully loaded plugin object.
|
|
13
|
+
*
|
|
14
|
+
* @param pluginDir - Absolute path to the plugin root directory
|
|
15
|
+
* @param source - Where this plugin was found (local, user, project)
|
|
16
|
+
* @param enabled - Whether the plugin should be enabled (default: true)
|
|
17
|
+
* @returns Loaded plugin with all discovered components
|
|
18
|
+
* @throws Error if the directory doesn't exist or manifest is invalid
|
|
19
|
+
*/
|
|
20
|
+
export declare function loadPlugin(pluginDir: string, source: PluginSource, enabled?: boolean): Promise<LoadedPlugin>;
|
|
21
|
+
//# sourceMappingURL=plugin-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/core/plugin-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,OAAc,GACtB,OAAO,CAAC,YAAY,CAAC,CAmCvB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Loader
|
|
3
|
+
*
|
|
4
|
+
* Loads a single plugin from a directory. Parses the manifest and discovers
|
|
5
|
+
* all components (skills, commands, agents, hooks, MCP servers).
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync } from 'fs';
|
|
8
|
+
import { logger } from '../../utils/logger.js';
|
|
9
|
+
import { parseManifest } from './manifest-parser.js';
|
|
10
|
+
import { discoverPluginSkills, discoverPluginCommands } from '../loaders/skills-loader.js';
|
|
11
|
+
import { loadPluginHooks } from '../loaders/hooks-loader.js';
|
|
12
|
+
import { loadPluginMcpServers } from '../loaders/mcp-loader.js';
|
|
13
|
+
import { discoverPluginAgents } from '../loaders/agents-loader.js';
|
|
14
|
+
/**
|
|
15
|
+
* Load a plugin from a directory
|
|
16
|
+
*
|
|
17
|
+
* Parses the manifest, discovers all components (skills, commands, agents,
|
|
18
|
+
* hooks, MCP servers), and returns a fully loaded plugin object.
|
|
19
|
+
*
|
|
20
|
+
* @param pluginDir - Absolute path to the plugin root directory
|
|
21
|
+
* @param source - Where this plugin was found (local, user, project)
|
|
22
|
+
* @param enabled - Whether the plugin should be enabled (default: true)
|
|
23
|
+
* @returns Loaded plugin with all discovered components
|
|
24
|
+
* @throws Error if the directory doesn't exist or manifest is invalid
|
|
25
|
+
*/
|
|
26
|
+
export async function loadPlugin(pluginDir, source, enabled = true) {
|
|
27
|
+
if (!existsSync(pluginDir)) {
|
|
28
|
+
throw new Error(`Plugin directory does not exist: ${pluginDir}`);
|
|
29
|
+
}
|
|
30
|
+
// Parse manifest
|
|
31
|
+
const manifest = await parseManifest(pluginDir);
|
|
32
|
+
logger.debug(`[plugin] Loading plugin "${manifest.name}" from ${pluginDir}`);
|
|
33
|
+
// Discover all components in parallel
|
|
34
|
+
const [skills, commands, agents, hooks, mcpServers] = await Promise.all([
|
|
35
|
+
discoverPluginSkills(pluginDir, manifest),
|
|
36
|
+
discoverPluginCommands(pluginDir, manifest),
|
|
37
|
+
discoverPluginAgents(pluginDir, manifest),
|
|
38
|
+
loadPluginHooks(pluginDir, manifest),
|
|
39
|
+
loadPluginMcpServers(pluginDir, manifest),
|
|
40
|
+
]);
|
|
41
|
+
const plugin = {
|
|
42
|
+
manifest,
|
|
43
|
+
rootDir: pluginDir,
|
|
44
|
+
source,
|
|
45
|
+
enabled,
|
|
46
|
+
skills,
|
|
47
|
+
commands,
|
|
48
|
+
agents,
|
|
49
|
+
hooks,
|
|
50
|
+
mcpServers,
|
|
51
|
+
};
|
|
52
|
+
logger.debug(`[plugin] Loaded "${manifest.name}": ${skills.length} skills, ${commands.length} commands, ${agents.length} agents`);
|
|
53
|
+
return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AAC;QACzC,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC;QACpC,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC;KAC1C,CAAC,CAAC;IAEH,MAAM,MAAM,GAAiB;QAC3B,QAAQ;QACR,OAAO,EAAE,SAAS;QAClB,MAAM;QACN,OAAO;QACP,MAAM;QACN,QAAQ;QACR,MAAM;QACN,KAAK;QACL,UAAU;KACX,CAAC;IAEF,MAAM,CAAC,KAAK,CACV,oBAAoB,QAAQ,CAAC,IAAI,MAAM,MAAM,CAAC,MAAM,YAAY,QAAQ,CAAC,MAAM,cAAc,MAAM,CAAC,MAAM,SAAS,CACpH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Resolver
|
|
3
|
+
*
|
|
4
|
+
* Discovers plugins from multiple sources, resolves enabled/disabled state,
|
|
5
|
+
* and returns an ordered list of loaded plugins. Higher-priority sources
|
|
6
|
+
* win when the same plugin exists in multiple locations.
|
|
7
|
+
*/
|
|
8
|
+
import type { LoadedPlugin, PluginSettings } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Options for plugin resolution
|
|
11
|
+
*/
|
|
12
|
+
export interface PluginResolverOptions {
|
|
13
|
+
/** Additional plugin directories from CLI flags (highest priority) */
|
|
14
|
+
cliDirs?: string[];
|
|
15
|
+
/** Working directory for project-level plugins */
|
|
16
|
+
cwd?: string;
|
|
17
|
+
/** Plugin settings from config */
|
|
18
|
+
settings?: PluginSettings;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolve all plugins from all sources
|
|
22
|
+
*
|
|
23
|
+
* Discovery sources (in priority order):
|
|
24
|
+
* 1. CLI flag directories (--plugin-dir) — highest priority
|
|
25
|
+
* 2. Project plugins (.codemie/plugins/) — team-shared
|
|
26
|
+
* 3. User cache (~/.codemie/plugins/cache/) — personal installs
|
|
27
|
+
* 4. Settings dirs (from config plugins.dirs) — managed
|
|
28
|
+
*
|
|
29
|
+
* @param options - Resolution options
|
|
30
|
+
* @returns Array of loaded plugins, deduplicated (highest priority wins)
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolvePlugins(options?: PluginResolverOptions): Promise<LoadedPlugin[]>;
|
|
33
|
+
//# sourceMappingURL=plugin-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-resolver.d.ts","sourceRoot":"","sources":["../../../src/plugins/core/plugin-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAgB,MAAM,YAAY,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,YAAY,EAAE,CAAC,CA2CzB"}
|