@codemieai/code 0.0.58 → 0.2.0
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/README.md +69 -15
- package/bin/codebase-memory-ui-daemon.js +10 -0
- package/bin/codemie-codex.js +18 -0
- package/dist/agents/core/AgentCLI.d.ts +1 -0
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +29 -4
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +3 -0
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/session/sync-state-utils.d.ts +11 -0
- package/dist/agents/core/session/sync-state-utils.d.ts.map +1 -0
- package/dist/agents/core/session/sync-state-utils.js +99 -0
- package/dist/agents/core/session/sync-state-utils.js.map +1 -0
- package/dist/agents/core/session/types.d.ts +8 -0
- package/dist/agents/core/session/types.d.ts.map +1 -1
- package/dist/agents/core/session/utils/jsonl-reader.d.ts +8 -0
- package/dist/agents/core/session/utils/jsonl-reader.d.ts.map +1 -1
- package/dist/agents/core/session/utils/jsonl-reader.js +37 -0
- package/dist/agents/core/session/utils/jsonl-reader.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +18 -0
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/commands/README.md +2 -31
- package/dist/agents/plugins/claude/plugin/commands/codemie-catchup.md +5 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +5 -0
- package/dist/agents/plugins/claude/plugin/hooks/hooks.json +0 -15
- package/dist/agents/plugins/claude/plugin/skills/msgraph/README.md +4 -1
- package/dist/agents/plugins/claude/plugin/skills/msgraph/SKILL.md +27 -8
- package/dist/agents/plugins/claude/plugin/skills/msgraph/scripts/msgraph.js +63 -3
- package/dist/agents/plugins/claude/plugin/skills/report-issue/SKILL.md +1 -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 +2 -0
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/codex/codex-message-types.d.ts +80 -0
- package/dist/agents/plugins/codex/codex-message-types.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex-message-types.js +36 -0
- package/dist/agents/plugins/codex/codex-message-types.js.map +1 -0
- package/dist/agents/plugins/codex/codex-models.d.ts +9 -0
- package/dist/agents/plugins/codex/codex-models.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex-models.js +227 -0
- package/dist/agents/plugins/codex/codex-models.js.map +1 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.d.ts +39 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.js +147 -0
- package/dist/agents/plugins/codex/codex.incremental-sync.js.map +1 -0
- package/dist/agents/plugins/codex/codex.paths.d.ts +29 -0
- package/dist/agents/plugins/codex/codex.paths.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.paths.js +43 -0
- package/dist/agents/plugins/codex/codex.paths.js.map +1 -0
- package/dist/agents/plugins/codex/codex.plugin.d.ts +80 -0
- package/dist/agents/plugins/codex/codex.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.plugin.js +474 -0
- package/dist/agents/plugins/codex/codex.plugin.js.map +1 -0
- package/dist/agents/plugins/codex/codex.reconciliation.d.ts +43 -0
- package/dist/agents/plugins/codex/codex.reconciliation.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.reconciliation.js +141 -0
- package/dist/agents/plugins/codex/codex.reconciliation.js.map +1 -0
- package/dist/agents/plugins/codex/codex.session.d.ts +58 -0
- package/dist/agents/plugins/codex/codex.session.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.session.js +326 -0
- package/dist/agents/plugins/codex/codex.session.js.map +1 -0
- package/dist/agents/plugins/codex/codex.storage-utils.d.ts +15 -0
- package/dist/agents/plugins/codex/codex.storage-utils.d.ts.map +1 -0
- package/dist/agents/plugins/codex/codex.storage-utils.js +19 -0
- package/dist/agents/plugins/codex/codex.storage-utils.js.map +1 -0
- package/dist/agents/plugins/codex/index.d.ts +7 -0
- package/dist/agents/plugins/codex/index.d.ts.map +1 -0
- package/dist/agents/plugins/codex/index.js +9 -0
- package/dist/agents/plugins/codex/index.js.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.d.ts +24 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.js +613 -0
- package/dist/agents/plugins/codex/session/processors/codex.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.d.ts +21 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.js +124 -0
- package/dist/agents/plugins/codex/session/processors/codex.metrics-processor.js.map +1 -0
- 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 +1 -0
- package/dist/agents/plugins/gemini/session/processors/gemini.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.storage-utils.js +2 -29
- package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -1
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +2 -0
- package/dist/agents/registry.js.map +1 -1
- package/dist/assets/demo.gif +0 -0
- package/dist/assets/skills-sh-egress-guard.cjs +166 -0
- package/dist/bin/codebase-memory-ui-daemon.d.ts +2 -0
- package/dist/bin/codebase-memory-ui-daemon.d.ts.map +1 -0
- package/dist/bin/codebase-memory-ui-daemon.js +141 -0
- package/dist/bin/codebase-memory-ui-daemon.js.map +1 -0
- package/dist/bin/proxy-daemon.js +4 -0
- package/dist/bin/proxy-daemon.js.map +1 -1
- package/dist/cli/commands/assistants/constants.js +2 -2
- package/dist/cli/commands/assistants/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/constants.js +4 -4
- package/dist/cli/commands/assistants/setup/configuration/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/ui.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/ui.js +10 -13
- package/dist/cli/commands/assistants/setup/configuration/ui.js.map +1 -1
- package/dist/cli/commands/assistants/setup/constants.d.ts +1 -25
- package/dist/cli/commands/assistants/setup/constants.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/constants.js +1 -20
- package/dist/cli/commands/assistants/setup/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts +4 -4
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js +11 -10
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts +4 -4
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +11 -9
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js.map +1 -1
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.d.ts +4 -0
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.js +76 -0
- package/dist/cli/commands/assistants/setup/generators/codex-skill-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.d.ts +4 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.js +68 -0
- package/dist/cli/commands/assistants/setup/generators/gemini-skill-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/helpers.d.ts +5 -18
- package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/helpers.js +45 -60
- package/dist/cli/commands/assistants/setup/helpers.js.map +1 -1
- package/dist/cli/commands/assistants/setup/index.d.ts +3 -9
- package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/index.js +26 -167
- package/dist/cli/commands/assistants/setup/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts +2 -2
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js +2 -2
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts +1 -30
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/actions.js +1 -320
- package/dist/cli/commands/assistants/setup/selection/actions.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts +3 -65
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/constants.js +4 -81
- package/dist/cli/commands/assistants/setup/selection/constants.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/index.d.ts +1 -9
- package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/index.js +14 -34
- package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts +1 -19
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +1 -338
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/types.d.ts +7 -23
- package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts +0 -8
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/selection/ui.js +14 -135
- package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -1
- package/dist/cli/commands/assistants/setup/summary/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/setup/summary/index.js +14 -8
- package/dist/cli/commands/assistants/setup/summary/index.js.map +1 -1
- package/dist/cli/commands/codebase/daemon-manager.d.ts +24 -0
- package/dist/cli/commands/codebase/daemon-manager.d.ts.map +1 -0
- package/dist/cli/commands/codebase/daemon-manager.js +112 -0
- package/dist/cli/commands/codebase/daemon-manager.js.map +1 -0
- package/dist/cli/commands/codebase/index.d.ts +3 -0
- package/dist/cli/commands/codebase/index.d.ts.map +1 -0
- package/dist/cli/commands/codebase/index.js +130 -0
- package/dist/cli/commands/codebase/index.js.map +1 -0
- package/dist/cli/commands/doctor/index.d.ts.map +1 -1
- package/dist/cli/commands/doctor/index.js +10 -1
- package/dist/cli/commands/doctor/index.js.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +15 -2
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/install.js +2 -2
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/profile/index.d.ts +14 -0
- package/dist/cli/commands/profile/index.d.ts.map +1 -1
- package/dist/cli/commands/profile/index.js +110 -27
- package/dist/cli/commands/profile/index.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop-managed-mcp-servers.json +50 -0
- package/dist/cli/commands/proxy/connectors/desktop.d.ts +17 -9
- package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.js +139 -19
- package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
- package/dist/cli/commands/proxy/daemon-manager.d.ts +1 -0
- package/dist/cli/commands/proxy/daemon-manager.d.ts.map +1 -1
- package/dist/cli/commands/proxy/daemon-manager.js +2 -0
- package/dist/cli/commands/proxy/daemon-manager.js.map +1 -1
- package/dist/cli/commands/proxy/index.d.ts.map +1 -1
- package/dist/cli/commands/proxy/index.js +131 -52
- package/dist/cli/commands/proxy/index.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +3 -1
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/shared/agent-targets.d.ts +10 -0
- package/dist/cli/commands/shared/agent-targets.d.ts.map +1 -0
- package/dist/cli/commands/shared/agent-targets.js +220 -0
- package/dist/cli/commands/shared/agent-targets.js.map +1 -0
- package/dist/cli/commands/shared/constants.d.ts +15 -0
- package/dist/cli/commands/shared/constants.d.ts.map +1 -0
- package/dist/cli/commands/shared/constants.js +10 -0
- package/dist/cli/commands/shared/constants.js.map +1 -0
- package/dist/cli/commands/shared/helpers.d.ts +12 -0
- package/dist/cli/commands/shared/helpers.d.ts.map +1 -0
- package/dist/cli/commands/shared/helpers.js +54 -0
- package/dist/cli/commands/shared/helpers.js.map +1 -0
- package/dist/cli/commands/shared/prompts/storage-scope.d.ts +6 -0
- package/dist/cli/commands/shared/prompts/storage-scope.d.ts.map +1 -0
- package/dist/cli/commands/shared/prompts/storage-scope.js +91 -0
- package/dist/cli/commands/shared/prompts/storage-scope.js.map +1 -0
- package/dist/cli/commands/shared/selection/actions.d.ts +40 -0
- package/dist/cli/commands/shared/selection/actions.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/actions.js +264 -0
- package/dist/cli/commands/shared/selection/actions.js.map +1 -0
- package/dist/cli/commands/shared/selection/constants.d.ts +68 -0
- package/dist/cli/commands/shared/selection/constants.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/constants.js +70 -0
- package/dist/cli/commands/shared/selection/constants.js.map +1 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.d.ts +16 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.js +276 -0
- package/dist/cli/commands/shared/selection/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/shared/selection/types.d.ts +31 -0
- package/dist/cli/commands/shared/selection/types.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/types.js +2 -0
- package/dist/cli/commands/shared/selection/types.js.map +1 -0
- package/dist/cli/commands/shared/selection/ui.d.ts +31 -0
- package/dist/cli/commands/shared/selection/ui.d.ts.map +1 -0
- package/dist/cli/commands/shared/selection/ui.js +126 -0
- package/dist/cli/commands/shared/selection/ui.js.map +1 -0
- package/dist/cli/commands/skills/add.d.ts +9 -0
- package/dist/cli/commands/skills/add.d.ts.map +1 -0
- package/dist/cli/commands/skills/add.js +187 -0
- package/dist/cli/commands/skills/add.js.map +1 -0
- package/dist/cli/commands/skills/find.d.ts +17 -0
- package/dist/cli/commands/skills/find.d.ts.map +1 -0
- package/dist/cli/commands/skills/find.js +94 -0
- package/dist/cli/commands/skills/find.js.map +1 -0
- package/dist/cli/commands/skills/index.d.ts +10 -0
- package/dist/cli/commands/skills/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/index.js +23 -0
- package/dist/cli/commands/skills/index.js.map +1 -0
- package/dist/cli/commands/skills/lib/agent-detection.d.ts +27 -0
- package/dist/cli/commands/skills/lib/agent-detection.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/agent-detection.js +50 -0
- package/dist/cli/commands/skills/lib/agent-detection.js.map +1 -0
- package/dist/cli/commands/skills/lib/error-classify.d.ts +14 -0
- package/dist/cli/commands/skills/lib/error-classify.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/error-classify.js +64 -0
- package/dist/cli/commands/skills/lib/error-classify.js.map +1 -0
- package/dist/cli/commands/skills/lib/require-auth.d.ts +17 -0
- package/dist/cli/commands/skills/lib/require-auth.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/require-auth.js +44 -0
- package/dist/cli/commands/skills/lib/require-auth.js.map +1 -0
- package/dist/cli/commands/skills/lib/result-render.d.ts +26 -0
- package/dist/cli/commands/skills/lib/result-render.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/result-render.js +77 -0
- package/dist/cli/commands/skills/lib/result-render.js.map +1 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.d.ts +46 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.js +217 -0
- package/dist/cli/commands/skills/lib/run-skills-cli.js.map +1 -0
- package/dist/cli/commands/skills/lib/sanitize.d.ts +17 -0
- package/dist/cli/commands/skills/lib/sanitize.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/sanitize.js +73 -0
- package/dist/cli/commands/skills/lib/sanitize.js.map +1 -0
- package/dist/cli/commands/skills/lib/skills-metrics.d.ts +74 -0
- package/dist/cli/commands/skills/lib/skills-metrics.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/skills-metrics.js +304 -0
- package/dist/cli/commands/skills/lib/skills-metrics.js.map +1 -0
- package/dist/cli/commands/skills/lib/skills-search-client.d.ts +36 -0
- package/dist/cli/commands/skills/lib/skills-search-client.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/skills-search-client.js +147 -0
- package/dist/cli/commands/skills/lib/skills-search-client.js.map +1 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts +10 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts.map +1 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.js +33 -0
- package/dist/cli/commands/skills/lib/skills-sh-telemetry.js.map +1 -0
- package/dist/cli/commands/skills/list.d.ts +13 -0
- package/dist/cli/commands/skills/list.d.ts.map +1 -0
- package/dist/cli/commands/skills/list.js +55 -0
- package/dist/cli/commands/skills/list.js.map +1 -0
- package/dist/cli/commands/skills/remove.d.ts +11 -0
- package/dist/cli/commands/skills/remove.d.ts.map +1 -0
- package/dist/cli/commands/skills/remove.js +93 -0
- package/dist/cli/commands/skills/remove.js.map +1 -0
- package/dist/cli/commands/skills/setup/constants.d.ts +2 -0
- package/dist/cli/commands/skills/setup/constants.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/constants.js +2 -0
- package/dist/cli/commands/skills/setup/constants.js.map +1 -0
- package/dist/cli/commands/skills/setup/data.d.ts +28 -0
- package/dist/cli/commands/skills/setup/data.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/data.js +79 -0
- package/dist/cli/commands/skills/setup/data.js.map +1 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts +12 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js +94 -0
- package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js.map +1 -0
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.d.ts +4 -0
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.js +51 -0
- package/dist/cli/commands/skills/setup/generators/codex-skill-generator.js.map +1 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.d.ts +4 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.js +51 -0
- package/dist/cli/commands/skills/setup/generators/gemini-skill-generator.js.map +1 -0
- package/dist/cli/commands/skills/setup/helpers.d.ts +13 -0
- package/dist/cli/commands/skills/setup/helpers.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/helpers.js +56 -0
- package/dist/cli/commands/skills/setup/helpers.js.map +1 -0
- package/dist/cli/commands/skills/setup/index.d.ts +6 -0
- package/dist/cli/commands/skills/setup/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/index.js +140 -0
- package/dist/cli/commands/skills/setup/index.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/actions.d.ts +2 -0
- package/dist/cli/commands/skills/setup/selection/actions.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/actions.js +2 -0
- package/dist/cli/commands/skills/setup/selection/actions.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/constants.d.ts +11 -0
- package/dist/cli/commands/skills/setup/selection/constants.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/constants.js +11 -0
- package/dist/cli/commands/skills/setup/selection/constants.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/index.d.ts +13 -0
- package/dist/cli/commands/skills/setup/selection/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/index.js +113 -0
- package/dist/cli/commands/skills/setup/selection/index.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.d.ts +2 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.js +2 -0
- package/dist/cli/commands/skills/setup/selection/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/types.d.ts +13 -0
- package/dist/cli/commands/skills/setup/selection/types.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/types.js +2 -0
- package/dist/cli/commands/skills/setup/selection/types.js.map +1 -0
- package/dist/cli/commands/skills/setup/selection/ui.d.ts +3 -0
- package/dist/cli/commands/skills/setup/selection/ui.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/selection/ui.js +63 -0
- package/dist/cli/commands/skills/setup/selection/ui.js.map +1 -0
- package/dist/cli/commands/skills/setup/sync.d.ts +13 -0
- package/dist/cli/commands/skills/setup/sync.d.ts.map +1 -0
- package/dist/cli/commands/skills/setup/sync.js +46 -0
- package/dist/cli/commands/skills/setup/sync.js.map +1 -0
- package/dist/cli/commands/skills/update.d.ts +7 -0
- package/dist/cli/commands/skills/update.d.ts.map +1 -0
- package/dist/cli/commands/skills/update.js +71 -0
- package/dist/cli/commands/skills/update.js.map +1 -0
- package/dist/cli/commands/test-metrics.js +3 -4
- package/dist/cli/commands/test-metrics.js.map +1 -1
- package/dist/cli/first-time.d.ts.map +1 -1
- package/dist/cli/first-time.js +4 -0
- package/dist/cli/first-time.js.map +1 -1
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +16 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/frameworks/plugins/bmad.plugin.d.ts +10 -1
- package/dist/frameworks/plugins/bmad.plugin.d.ts.map +1 -1
- package/dist/frameworks/plugins/bmad.plugin.js +108 -9
- package/dist/frameworks/plugins/bmad.plugin.js.map +1 -1
- package/dist/frameworks/plugins/codebase-memory.plugin.d.ts +18 -0
- package/dist/frameworks/plugins/codebase-memory.plugin.d.ts.map +1 -0
- package/dist/frameworks/plugins/codebase-memory.plugin.js +131 -0
- package/dist/frameworks/plugins/codebase-memory.plugin.js.map +1 -0
- package/dist/frameworks/plugins/index.d.ts +1 -0
- package/dist/frameworks/plugins/index.d.ts.map +1 -1
- package/dist/frameworks/plugins/index.js +3 -0
- package/dist/frameworks/plugins/index.js.map +1 -1
- package/dist/providers/core/types.d.ts +1 -1
- package/dist/providers/core/types.d.ts.map +1 -1
- package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.d.ts.map +1 -1
- package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.js +26 -2
- package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.template.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts +31 -0
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js +148 -0
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts +20 -0
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js +104 -0
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/gateway-key.plugin.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/gateway-key.plugin.js +24 -3
- package/dist/providers/plugins/sso/proxy/plugins/gateway-key.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js +5 -0
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +14 -13
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js +19 -17
- package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/logging.plugin.js +10 -3
- package/dist/providers/plugins/sso/proxy/plugins/logging.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.js +26 -8
- package/dist/providers/plugins/sso/proxy/plugins/sso.session-sync.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/sso.proxy.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/sso.proxy.js +21 -4
- package/dist/providers/plugins/sso/proxy/sso.proxy.js.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.js +5 -72
- package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js +95 -4
- package/dist/providers/plugins/sso/session/processors/conversations/apiClient.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts +2 -2
- package/dist/providers/plugins/sso/session/processors/conversations/constants.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/constants.js +2 -2
- package/dist/providers/plugins/sso/session/processors/conversations/constants.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js +85 -21
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/types.d.ts +10 -2
- package/dist/providers/plugins/sso/session/processors/conversations/types.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.d.ts +1 -1
- 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 +80 -46
- 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 +1 -9
- 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 +94 -30
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.d.ts +4 -6
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.js +24 -25
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.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 +140 -99
- 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 +11 -3
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-types.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.auth.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.auth.js +22 -4
- package/dist/providers/plugins/sso/sso.auth.js.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.d.ts +1 -1
- package/dist/providers/plugins/sso/sso.http-client.js +3 -3
- package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
- package/dist/providers/plugins/sso/sso.models.js +2 -2
- package/dist/providers/plugins/sso/sso.models.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +8 -12
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.d.ts.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.js +4 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.js.map +1 -1
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.d.ts.map +1 -1
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.js +1 -3
- package/dist/telemetry/runtime/DesktopTelemetryRuntime.js.map +1 -1
- package/dist/utils/browser.d.ts +7 -0
- package/dist/utils/browser.d.ts.map +1 -0
- package/dist/utils/browser.js +10 -0
- package/dist/utils/browser.js.map +1 -0
- package/dist/utils/config.d.ts +14 -3
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +102 -6
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/paths.d.ts +8 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +15 -0
- package/dist/utils/paths.js.map +1 -1
- package/package.json +23 -10
- package/scripts/compare-codex-conversations.mjs +894 -0
- package/scripts/copy-plugins.js +5 -0
- package/scripts/sonar/package.json +3 -0
- package/scripts/sonar/run-local-sonar.js +405 -0
- package/scripts/validate-secrets.js +7 -3
- package/dist/agents/plugins/claude/plugin/claude-templates/README.md +0 -539
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +0 -252
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +0 -433
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +0 -337
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +0 -197
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +0 -258
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +0 -179
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +0 -197
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +0 -248
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +0 -298
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/integration/external-integrations.md.template +0 -160
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +0 -295
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +0 -186
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/git-workflow.md.template +0 -177
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +0 -315
- package/dist/agents/plugins/claude/plugin/commands/codemie-commit.md +0 -31
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +0 -523
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +0 -544
- package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-auto-wrapper.sh +0 -81
- package/dist/agents/plugins/claude/plugin/scripts/bash/rtk-baseline.sh +0 -39
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/SKILL.md +0 -206
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-agent.md +0 -45
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-claude-md-snippet.md +0 -40
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-command.md +0 -30
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-hooks.json +0 -23
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/bad-skill.md +0 -48
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-agent.md +0 -145
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-claude-md-snippet.md +0 -126
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-command.md +0 -170
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-hooks.json +0 -46
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/good-skill.md +0 -144
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/examples/sample-report.md +0 -223
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/best-practices.md +0 -510
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/references/component-checklists.md +0 -413
- package/dist/agents/plugins/claude/plugin/skills/claude-setup-audit/scripts/scan-repo.sh +0 -162
- package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.d.ts +0 -30
- package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.d.ts.map +0 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.js +0 -111
- package/dist/providers/plugins/sso/proxy/plugins/claude-thinking-transformer.plugin.js.map +0 -1
package/scripts/copy-plugins.js
CHANGED
|
@@ -23,6 +23,11 @@ const copyConfigs = [
|
|
|
23
23
|
name: 'Gemini extension',
|
|
24
24
|
src: join(rootDir, 'src/agents/plugins/gemini/extension'),
|
|
25
25
|
dest: join(rootDir, 'dist/agents/plugins/gemini/extension')
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Top-level assets',
|
|
29
|
+
src: join(rootDir, 'assets'),
|
|
30
|
+
dest: join(rootDir, 'dist/assets')
|
|
26
31
|
}
|
|
27
32
|
];
|
|
28
33
|
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
// Copyright 2026 EPAM Systems, Inc. (“EPAM”)
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
const { spawn } = require('node:child_process');
|
|
16
|
+
const fs = require('node:fs');
|
|
17
|
+
const http = require('node:http');
|
|
18
|
+
const https = require('node:https');
|
|
19
|
+
const path = require('node:path');
|
|
20
|
+
|
|
21
|
+
const REPOSITORY_ROOT = path.resolve(__dirname, '../..');
|
|
22
|
+
const CONNECTED_MODE_PATH = path.resolve(REPOSITORY_ROOT, '.sonarlint/connectedMode.json');
|
|
23
|
+
const SONAR_PROPERTIES_PATH = path.resolve(REPOSITORY_ROOT, 'sonar-project.properties');
|
|
24
|
+
const SERVER_TIMEOUT_MS = 5000;
|
|
25
|
+
const PAGE_SIZE = 500;
|
|
26
|
+
|
|
27
|
+
function log(message) {
|
|
28
|
+
process.stdout.write(`[sonar-local] ${message}\n`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function logError(message) {
|
|
32
|
+
process.stderr.write(`[sonar-local] ${message}\n`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function readConnectedModeConfig() {
|
|
36
|
+
if (!fs.existsSync(CONNECTED_MODE_PATH)) {
|
|
37
|
+
throw new Error(`Missing SonarLint connected mode config: ${CONNECTED_MODE_PATH}`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const rawContent = fs.readFileSync(CONNECTED_MODE_PATH, 'utf8');
|
|
41
|
+
const parsedConfig = JSON.parse(rawContent);
|
|
42
|
+
const sonarHostUrl = parsedConfig.sonarQubeUri;
|
|
43
|
+
const sonarProjectKey = parsedConfig.projectKey;
|
|
44
|
+
|
|
45
|
+
if (!sonarHostUrl || !sonarProjectKey) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`SonarLint connected mode config must define both "sonarQubeUri" and "projectKey": ${CONNECTED_MODE_PATH}`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return { sonarHostUrl, sonarProjectKey };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function readSonarProperties() {
|
|
55
|
+
if (!fs.existsSync(SONAR_PROPERTIES_PATH)) {
|
|
56
|
+
throw new Error(`Missing Sonar project configuration: ${SONAR_PROPERTIES_PATH}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const properties = {};
|
|
60
|
+
const rawContent = fs.readFileSync(SONAR_PROPERTIES_PATH, 'utf8');
|
|
61
|
+
|
|
62
|
+
for (const rawLine of rawContent.split(/\r?\n/u)) {
|
|
63
|
+
const line = rawLine.trim();
|
|
64
|
+
if (!line || line.startsWith('#')) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const separatorIndex = line.indexOf('=');
|
|
69
|
+
if (separatorIndex === -1) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const key = line.slice(0, separatorIndex).trim();
|
|
74
|
+
const value = line.slice(separatorIndex + 1).trim();
|
|
75
|
+
properties[key] = value;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return properties;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function createRequestModule(targetUrl) {
|
|
82
|
+
return targetUrl.protocol === 'https:' ? https : http;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function resolveBranchName() {
|
|
86
|
+
const overrideBranchName = process.env.SONAR_BRANCH_NAME?.trim();
|
|
87
|
+
if (overrideBranchName) {
|
|
88
|
+
return overrideBranchName;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const gitEntryPath = path.resolve(REPOSITORY_ROOT, '.git');
|
|
92
|
+
if (!fs.existsSync(gitEntryPath)) {
|
|
93
|
+
throw new Error('Unable to locate .git metadata. Set SONAR_BRANCH_NAME explicitly and retry.');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let gitDirPath = gitEntryPath;
|
|
97
|
+
const gitEntryStat = fs.statSync(gitEntryPath);
|
|
98
|
+
if (gitEntryStat.isFile()) {
|
|
99
|
+
const gitPointer = fs.readFileSync(gitEntryPath, 'utf8').trim();
|
|
100
|
+
const gitDirPrefix = 'gitdir:';
|
|
101
|
+
if (!gitPointer.startsWith(gitDirPrefix)) {
|
|
102
|
+
throw new Error('Unable to resolve git metadata directory. Set SONAR_BRANCH_NAME explicitly and retry.');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
gitDirPath = path.resolve(REPOSITORY_ROOT, gitPointer.slice(gitDirPrefix.length).trim());
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const headPath = path.join(gitDirPath, 'HEAD');
|
|
109
|
+
if (!fs.existsSync(headPath)) {
|
|
110
|
+
throw new Error('Unable to locate git HEAD. Set SONAR_BRANCH_NAME explicitly and retry.');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const headContents = fs.readFileSync(headPath, 'utf8').trim();
|
|
114
|
+
const refPrefix = 'ref: refs/heads/';
|
|
115
|
+
if (!headContents.startsWith(refPrefix)) {
|
|
116
|
+
throw new Error('Unable to determine the current git branch from HEAD. Set SONAR_BRANCH_NAME explicitly.');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return headContents.slice(refPrefix.length);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function runCommand(command, args, options = {}) {
|
|
123
|
+
const { env = process.env, description = command } = options;
|
|
124
|
+
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
const child = spawn(command, args, {
|
|
127
|
+
cwd: REPOSITORY_ROOT,
|
|
128
|
+
env,
|
|
129
|
+
stdio: 'inherit',
|
|
130
|
+
shell: process.platform === 'win32',
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
child.on('error', (error) => {
|
|
134
|
+
reject(new Error(`Failed to start ${description}: ${error.message}`));
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
child.on('exit', (code) => {
|
|
138
|
+
if (code === 0) {
|
|
139
|
+
resolve();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
reject(new Error(`${description} exited with code ${code}`));
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function resolveScannerCommand() {
|
|
149
|
+
const scannerCommand = process.env.SONAR_SCANNER_PATH?.trim() || 'sonar-scanner';
|
|
150
|
+
|
|
151
|
+
if (scannerCommand === 'sonar-scanner') {
|
|
152
|
+
const pathEntries = (process.env.PATH || '').split(path.delimiter);
|
|
153
|
+
const executableNames =
|
|
154
|
+
process.platform === 'win32'
|
|
155
|
+
? ['sonar-scanner.cmd', 'sonar-scanner.bat', 'sonar-scanner.exe']
|
|
156
|
+
: ['sonar-scanner'];
|
|
157
|
+
|
|
158
|
+
const foundScanner = pathEntries.some((entry) =>
|
|
159
|
+
executableNames.some((name) => fs.existsSync(path.join(entry, name))),
|
|
160
|
+
);
|
|
161
|
+
if (!foundScanner) {
|
|
162
|
+
throw new Error(
|
|
163
|
+
'sonar-scanner was not found. Install the official SonarScanner CLI or set SONAR_SCANNER_PATH.',
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
} else if (!fs.existsSync(scannerCommand)) {
|
|
167
|
+
throw new Error(`SONAR_SCANNER_PATH does not exist: ${scannerCommand}`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return scannerCommand;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function sonarRequestJson(sonarHostUrl, sonarToken, endpoint, searchParams = {}) {
|
|
174
|
+
return new Promise((resolve, reject) => {
|
|
175
|
+
const requestUrl = new URL(endpoint, sonarHostUrl);
|
|
176
|
+
for (const [key, value] of Object.entries(searchParams)) {
|
|
177
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
178
|
+
requestUrl.searchParams.set(key, String(value));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const request = createRequestModule(requestUrl).request(
|
|
183
|
+
requestUrl,
|
|
184
|
+
{
|
|
185
|
+
method: 'GET',
|
|
186
|
+
timeout: SERVER_TIMEOUT_MS,
|
|
187
|
+
headers: {
|
|
188
|
+
Authorization: `Basic ${Buffer.from(`${sonarToken}:`).toString('base64')}`,
|
|
189
|
+
Accept: 'application/json',
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
(response) => {
|
|
193
|
+
const chunks = [];
|
|
194
|
+
response.on('data', (chunk) => chunks.push(chunk));
|
|
195
|
+
response.on('end', () => {
|
|
196
|
+
const rawBody = Buffer.concat(chunks).toString('utf8');
|
|
197
|
+
if (response.statusCode && response.statusCode >= 400) {
|
|
198
|
+
reject(new Error(`Sonar API request failed (${response.statusCode}) for ${requestUrl.pathname}.`));
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
try {
|
|
203
|
+
resolve(JSON.parse(rawBody));
|
|
204
|
+
} catch (error) {
|
|
205
|
+
reject(new Error(`Failed to parse Sonar API response for ${requestUrl.pathname}: ${error.message}`));
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
request.on('timeout', () => {
|
|
212
|
+
request.destroy(new Error(`Timed out after ${SERVER_TIMEOUT_MS}ms`));
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
request.on('error', (error) => {
|
|
216
|
+
reject(new Error(`Sonar API request failed for ${requestUrl.pathname}: ${error.message}`));
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
request.end();
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async function fetchPaginatedItems(fetchPage) {
|
|
224
|
+
const items = [];
|
|
225
|
+
let page = 1;
|
|
226
|
+
let total = 0;
|
|
227
|
+
let pageSize = 0;
|
|
228
|
+
|
|
229
|
+
do {
|
|
230
|
+
const response = await fetchPage(page);
|
|
231
|
+
const responseItems = response.issues ?? response.hotspots ?? [];
|
|
232
|
+
items.push(...responseItems);
|
|
233
|
+
total = response.total ?? response.paging?.total ?? responseItems.length;
|
|
234
|
+
pageSize = response.ps ?? response.paging?.pageSize ?? responseItems.length;
|
|
235
|
+
page += 1;
|
|
236
|
+
} while (items.length < total && pageSize > 0);
|
|
237
|
+
|
|
238
|
+
return items;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function stripProjectKey(component, projectKey) {
|
|
242
|
+
const componentPrefix = `${projectKey}:`;
|
|
243
|
+
if (!component) {
|
|
244
|
+
return '(unknown component)';
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return component.startsWith(componentPrefix) ? component.slice(componentPrefix.length) : component;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function formatIssue(issue, projectKey) {
|
|
251
|
+
const location = `${stripProjectKey(issue.component, projectKey)}:${issue.line ?? 1}`;
|
|
252
|
+
return `- [${issue.severity}] [${issue.type}] ${location} ${issue.rule}: ${issue.message}`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function formatHotspot(hotspot, projectKey) {
|
|
256
|
+
const location = `${stripProjectKey(hotspot.component, projectKey)}:${hotspot.line ?? 1}`;
|
|
257
|
+
return `- ${location} ${hotspot.ruleKey ?? hotspot.rule ?? 'unknown-rule'}: ${hotspot.message}`;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async function collectSonarDetails({ sonarHostUrl, sonarProjectKey, branchName, sonarToken }) {
|
|
261
|
+
const qualityGate = await sonarRequestJson(sonarHostUrl, sonarToken, '/api/qualitygates/project_status', {
|
|
262
|
+
projectKey: sonarProjectKey,
|
|
263
|
+
branch: branchName,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
const issues = await fetchPaginatedItems((page) =>
|
|
267
|
+
sonarRequestJson(sonarHostUrl, sonarToken, '/api/issues/search', {
|
|
268
|
+
componentKeys: sonarProjectKey,
|
|
269
|
+
branch: branchName,
|
|
270
|
+
resolved: 'false',
|
|
271
|
+
p: page,
|
|
272
|
+
ps: PAGE_SIZE,
|
|
273
|
+
s: 'FILE_LINE',
|
|
274
|
+
asc: 'true',
|
|
275
|
+
}),
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
const hotspots = await fetchPaginatedItems((page) =>
|
|
279
|
+
sonarRequestJson(sonarHostUrl, sonarToken, '/api/hotspots/search', {
|
|
280
|
+
projectKey: sonarProjectKey,
|
|
281
|
+
branch: branchName,
|
|
282
|
+
status: 'TO_REVIEW',
|
|
283
|
+
p: page,
|
|
284
|
+
ps: PAGE_SIZE,
|
|
285
|
+
}),
|
|
286
|
+
);
|
|
287
|
+
|
|
288
|
+
return { hotspots, issues, qualityGate };
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function printSonarDetails(details, context) {
|
|
292
|
+
const { hotspots, issues, qualityGate } = details;
|
|
293
|
+
const { branchName, sonarProjectKey } = context;
|
|
294
|
+
|
|
295
|
+
log(`Project: ${sonarProjectKey}`);
|
|
296
|
+
log(`Branch: ${branchName}`);
|
|
297
|
+
log(`Quality gate: ${qualityGate.projectStatus.status}`);
|
|
298
|
+
|
|
299
|
+
const failedConditions = (qualityGate.projectStatus.conditions ?? []).filter(
|
|
300
|
+
(condition) => condition.status === 'ERROR',
|
|
301
|
+
);
|
|
302
|
+
if (failedConditions.length > 0) {
|
|
303
|
+
log('Failing gate conditions:');
|
|
304
|
+
for (const condition of failedConditions) {
|
|
305
|
+
log(
|
|
306
|
+
`- ${condition.metricKey}: actual=${condition.actualValue ?? 'n/a'}, threshold=${condition.errorThreshold ?? 'n/a'}`,
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
} else {
|
|
310
|
+
log('Failing gate conditions: none');
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
log(`Blocking security hotspots: ${hotspots.length}`);
|
|
314
|
+
for (const hotspot of hotspots) {
|
|
315
|
+
log(formatHotspot(hotspot, sonarProjectKey));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const bugsAndVulnerabilities = issues.filter((issue) => issue.type === 'BUG' || issue.type === 'VULNERABILITY');
|
|
319
|
+
log(`Bugs and vulnerabilities: ${bugsAndVulnerabilities.length}`);
|
|
320
|
+
for (const issue of bugsAndVulnerabilities) {
|
|
321
|
+
log(formatIssue(issue, sonarProjectKey));
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
log(`All unresolved issues: ${issues.length}`);
|
|
325
|
+
for (const issue of issues) {
|
|
326
|
+
log(formatIssue(issue, sonarProjectKey));
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
async function printFailureDetails(context) {
|
|
331
|
+
try {
|
|
332
|
+
const details = await collectSonarDetails(context);
|
|
333
|
+
printSonarDetails(details, context);
|
|
334
|
+
} catch (detailsError) {
|
|
335
|
+
logError(`Failed to fetch Sonar details after scan failure: ${detailsError.message}`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
async function main() {
|
|
340
|
+
const { sonarHostUrl, sonarProjectKey } = readConnectedModeConfig();
|
|
341
|
+
const sonarProperties = readSonarProperties();
|
|
342
|
+
const sonarToken = process.env.SONAR_TOKEN?.trim();
|
|
343
|
+
const branchName = resolveBranchName();
|
|
344
|
+
|
|
345
|
+
if (!sonarToken) {
|
|
346
|
+
log('Skipping Sonar scan because SONAR_TOKEN is not set.');
|
|
347
|
+
process.exit(0);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
log(`Using SonarQube project "${sonarProjectKey}" from .sonarlint/connectedMode.json.`);
|
|
351
|
+
log(`Running analysis for branch "${branchName}".`);
|
|
352
|
+
|
|
353
|
+
if (sonarProperties['sonar.projectKey'] && sonarProperties['sonar.projectKey'] !== sonarProjectKey) {
|
|
354
|
+
log(
|
|
355
|
+
`Overriding sonar.projectKey="${sonarProperties['sonar.projectKey']}" with connected-mode project key "${sonarProjectKey}".`,
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (process.env.SONAR_SKIP_TESTS?.trim()) {
|
|
360
|
+
log('Skipping test run (SONAR_SKIP_TESTS is set). Using existing coverage.xml.');
|
|
361
|
+
} else {
|
|
362
|
+
log('Generating coverage.xml...');
|
|
363
|
+
await runCommand(
|
|
364
|
+
'poetry',
|
|
365
|
+
['run', 'pytest', 'tests/', '-W', 'ignore::DeprecationWarning', '--cov', '--cov-report=xml:coverage.xml'],
|
|
366
|
+
{ description: 'coverage generation' },
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const scannerCommand = resolveScannerCommand();
|
|
371
|
+
log(`Running sonar-scanner against ${sonarHostUrl}.`);
|
|
372
|
+
try {
|
|
373
|
+
await runCommand(
|
|
374
|
+
scannerCommand,
|
|
375
|
+
[
|
|
376
|
+
`-Dsonar.projectKey=${sonarProjectKey}`,
|
|
377
|
+
`-Dsonar.branch.name=${branchName}`,
|
|
378
|
+
'-Dsonar.qualitygate.wait=true',
|
|
379
|
+
],
|
|
380
|
+
{
|
|
381
|
+
description: 'sonar-scanner',
|
|
382
|
+
env: {
|
|
383
|
+
...process.env,
|
|
384
|
+
SONAR_HOST_URL: sonarHostUrl,
|
|
385
|
+
SONAR_TOKEN: sonarToken,
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
);
|
|
389
|
+
} catch (error) {
|
|
390
|
+
await printFailureDetails({
|
|
391
|
+
branchName,
|
|
392
|
+
sonarHostUrl,
|
|
393
|
+
sonarProjectKey,
|
|
394
|
+
sonarToken,
|
|
395
|
+
});
|
|
396
|
+
throw error;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
log('Sonar scan completed successfully.');
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
main().catch((error) => {
|
|
403
|
+
logError(error.message);
|
|
404
|
+
process.exit(1);
|
|
405
|
+
});
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* This script runs Gitleaks in a Docker container for local validation.
|
|
7
7
|
* CI uses the official gitleaks-action@v2 for better GitHub integration.
|
|
8
8
|
* Both share the same .gitleaks.toml configuration.
|
|
9
|
+
*
|
|
10
|
+
* Local validation scans the staged git diff instead of the whole working tree.
|
|
11
|
+
* That keeps generated or user-local files ignored by .gitignore (for example
|
|
12
|
+
* BMAD installs under _bmad/ and .claude/skills/) out of pre-commit checks.
|
|
9
13
|
*/
|
|
10
14
|
|
|
11
15
|
import { spawn } from 'child_process';
|
|
@@ -26,10 +30,10 @@ const args = [
|
|
|
26
30
|
'-v',
|
|
27
31
|
`${projectPath}:/path`,
|
|
28
32
|
'ghcr.io/gitleaks/gitleaks:v8.30.1',
|
|
29
|
-
'
|
|
33
|
+
'protect',
|
|
34
|
+
'--staged',
|
|
30
35
|
'--source=/path',
|
|
31
|
-
'--verbose'
|
|
32
|
-
'--no-git'
|
|
36
|
+
'--verbose'
|
|
33
37
|
];
|
|
34
38
|
|
|
35
39
|
// Add config file if it exists
|