@su-record/vibe 2.16.4 → 3.1.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/CLAUDE.md +8 -8
- package/README.en.md +46 -29
- package/README.md +41 -24
- package/agents/acceptance-tester.md +56 -0
- package/agents/architect.md +25 -67
- package/agents/build-error-resolver.md +28 -97
- package/agents/code-reviewer.md +89 -0
- package/agents/diagrammer.md +34 -169
- package/agents/documenter.md +43 -0
- package/agents/e2e-tester.md +46 -281
- package/agents/event/event-ops.md +54 -77
- package/agents/event/event-planner.md +63 -0
- package/agents/figma/figma-engineer.md +76 -0
- package/agents/implementer.md +26 -41
- package/agents/security-reviewer.md +56 -0
- package/agents/tester.md +37 -33
- package/agents/ui/design-reviewer.md +62 -0
- package/agents/ui/design-system-gen.md +63 -0
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/remove.js +8 -10
- package/dist/cli/commands/remove.js.map +1 -1
- package/dist/cli/index.d.ts +0 -4
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +0 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/llm/model-refresh.js +1 -1
- package/dist/cli/llm/model-refresh.js.map +1 -1
- package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
- package/dist/cli/postinstall/claude-agents.js +16 -77
- package/dist/cli/postinstall/claude-agents.js.map +1 -1
- package/dist/cli/postinstall/constants.d.ts.map +1 -1
- package/dist/cli/postinstall/constants.js +80 -296
- package/dist/cli/postinstall/constants.js.map +1 -1
- package/dist/cli/postinstall/cursor-agents.d.ts +5 -0
- package/dist/cli/postinstall/cursor-agents.d.ts.map +1 -1
- package/dist/cli/postinstall/cursor-agents.js +26 -68
- package/dist/cli/postinstall/cursor-agents.js.map +1 -1
- package/dist/cli/postinstall/cursor-skills.d.ts.map +1 -1
- package/dist/cli/postinstall/cursor-skills.js +26 -30
- package/dist/cli/postinstall/cursor-skills.js.map +1 -1
- package/dist/cli/postinstall/main.d.ts.map +1 -1
- package/dist/cli/postinstall/main.js +0 -2
- package/dist/cli/postinstall/main.js.map +1 -1
- package/dist/cli/setup/Provisioner.d.ts.map +1 -1
- package/dist/cli/setup/Provisioner.js +19 -21
- package/dist/cli/setup/Provisioner.js.map +1 -1
- package/dist/cli/utils.d.ts +4 -1
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/cli/utils.js +4 -1
- package/dist/cli/utils.js.map +1 -1
- package/dist/infra/lib/FrameworkDetector.js +4 -4
- package/dist/infra/lib/FrameworkDetector.js.map +1 -1
- package/dist/infra/lib/OrchestrateWorkflow.js +2 -2
- package/dist/infra/lib/OrchestrateWorkflow.js.map +1 -1
- package/dist/infra/lib/browser/launch.js +1 -1
- package/dist/infra/lib/browser/launch.js.map +1 -1
- package/dist/infra/lib/browser/types.d.ts +1 -1
- package/dist/infra/lib/browser/types.js +1 -1
- package/dist/infra/lib/constants.d.ts +1 -1
- package/dist/infra/lib/constants.d.ts.map +1 -1
- package/dist/infra/lib/constants.js +4 -5
- package/dist/infra/lib/constants.js.map +1 -1
- package/dist/infra/lib/evolution/__tests__/integration.test.js +7 -7
- package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
- package/dist/infra/lib/memory/index.d.ts +0 -2
- package/dist/infra/lib/memory/index.d.ts.map +1 -1
- package/dist/infra/lib/memory/index.js +0 -2
- package/dist/infra/lib/memory/index.js.map +1 -1
- package/dist/infra/lib/telemetry/SkillTelemetry.test.js +1 -1
- package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +1 -1
- package/dist/tools/index.d.ts +0 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +0 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/memory/autoSaveContext.d.ts +0 -1
- package/dist/tools/memory/autoSaveContext.d.ts.map +1 -1
- package/dist/tools/memory/autoSaveContext.js +13 -27
- package/dist/tools/memory/autoSaveContext.js.map +1 -1
- package/hooks/scripts/__tests__/.vibe/command-log.txt +3 -78
- package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
- package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
- package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
- package/hooks/scripts/__tests__/clone-behaviors.test.js +64 -0
- package/hooks/scripts/__tests__/clone-merge-responsive.test.js +106 -0
- package/hooks/scripts/__tests__/code-check-detectors.test.js +2 -2
- package/hooks/scripts/__tests__/run-ledger.test.js +1 -1
- package/hooks/scripts/__tests__/scope-from-spec.test.js +12 -12
- package/hooks/scripts/__tests__/step-counter.test.js +1 -1
- package/hooks/scripts/clone-extract.js +242 -28
- package/hooks/scripts/clone-merge-responsive.js +184 -0
- package/hooks/scripts/clone-spec.js +33 -8
- package/hooks/scripts/clone-validate.js +15 -9
- package/hooks/scripts/code-check.js +16 -203
- package/hooks/scripts/context-save.js +0 -11
- package/hooks/scripts/lib/scope-from-spec.js +9 -6
- package/hooks/scripts/post-edit-dispatcher.js +1 -1
- package/hooks/scripts/prompt-dispatcher.js +7 -18
- package/hooks/scripts/session-start.js +25 -35
- package/package.json +6 -5
- package/skills/agents-md/SKILL.md +62 -15
- package/skills/arch-guard/SKILL.md +1 -1
- package/skills/brand-assets/SKILL.md +2 -2
- package/skills/capability-loop/SKILL.md +1 -1
- package/skills/chub-usage/SKILL.md +1 -1
- package/skills/clone/SKILL.md +132 -55
- package/skills/commerce-patterns/SKILL.md +2 -2
- package/skills/commit-push-pr/SKILL.md +0 -1
- package/skills/context7-usage/SKILL.md +1 -1
- package/skills/design-refine/SKILL.md +140 -0
- package/skills/{design-polish → design-refine}/templates/polish-report.md +1 -1
- package/skills/{design-normalize → design-refine}/templates/token-audit.md +3 -3
- package/skills/design-review/SKILL.md +143 -0
- package/skills/{design-audit → design-review}/agents/a11y-auditor.md +1 -1
- package/skills/{design-audit → design-review}/agents/performance-auditor.md +1 -1
- package/skills/{design-audit → design-review}/agents/responsive-auditor.md +1 -1
- package/skills/{design-audit → design-review}/agents/slop-detector.md +1 -1
- package/skills/{design-audit → design-review}/frameworks/core-web-vitals.md +1 -1
- package/skills/{design-audit → design-review}/frameworks/wcag-checklist.md +1 -1
- package/skills/{design-audit → design-review}/orchestrator.md +3 -3
- package/skills/{design-critique → design-review}/templates/critique-report.md +3 -3
- package/skills/{design-audit → design-review}/templates/report.md +3 -3
- package/skills/design-teach/SKILL.md +11 -11
- package/skills/docs/SKILL.md +14 -16
- package/skills/e2e-commerce/SKILL.md +1 -1
- package/skills/event-comms/SKILL.md +1 -1
- package/skills/event-ops/SKILL.md +2 -2
- package/skills/event-planning/SKILL.md +1 -1
- package/skills/exec-plan/SKILL.md +2 -2
- package/skills/figma/SKILL.md +240 -148
- package/skills/figma/rubrics/css-mapping.md +125 -0
- package/skills/git-worktree/SKILL.md +1 -1
- package/skills/handoff/SKILL.md +1 -1
- package/skills/parallel-research/SKILL.md +14 -28
- package/skills/priority-todos/SKILL.md +1 -1
- package/skills/regress/SKILL.md +11 -0
- package/skills/restraint/SKILL.md +72 -0
- package/skills/seo-checklist/SKILL.md +2 -2
- package/skills/spec/SKILL.md +65 -836
- package/skills/test/SKILL.md +3 -3
- package/skills/tool-fallback/SKILL.md +2 -2
- package/skills/vercel-react-best-practices/SKILL.md +1 -1
- package/skills/vibe/SKILL.md +20 -35
- package/skills/vibe.analyze/SKILL.md +7 -9
- package/skills/vibe.clone/SKILL.md +39 -19
- package/skills/vibe.docs/SKILL.md +1 -1
- package/skills/vibe.event/SKILL.md +27 -27
- package/skills/vibe.figma/SKILL.md +14 -18
- package/skills/vibe.harness/SKILL.md +5 -5
- package/skills/vibe.reason/SKILL.md +0 -2
- package/skills/vibe.review/SKILL.md +45 -49
- package/skills/vibe.run/SKILL.md +2 -5
- package/skills/vibe.run/references/parallel-agents.md +33 -98
- package/skills/vibe.spec/SKILL.md +38 -535
- package/skills/vibe.utils/SKILL.md +3 -3
- package/skills/vibe.verify/SKILL.md +70 -542
- package/skills/video-production/SKILL.md +1 -1
- package/vibe/rules/orchestrator-contract.md +5 -4
- package/vibe/rules/quality/performance.md +1 -1
- package/vibe/templates/claudemd-template.md +1 -1
- package/vibe/templates/spec-template.md +35 -185
- package/agents/architect-low.md +0 -41
- package/agents/architect-medium.md +0 -59
- package/agents/compounder.md +0 -265
- package/agents/docs/api-documenter.md +0 -99
- package/agents/docs/changelog-writer.md +0 -93
- package/agents/event/event-comms.md +0 -78
- package/agents/event/event-content.md +0 -68
- package/agents/event/event-image.md +0 -95
- package/agents/event/event-scheduler.md +0 -69
- package/agents/event/event-speaker.md +0 -86
- package/agents/explorer-low.md +0 -42
- package/agents/explorer-medium.md +0 -59
- package/agents/explorer.md +0 -48
- package/agents/figma/figma-analyst.md +0 -56
- package/agents/figma/figma-architect.md +0 -116
- package/agents/figma/figma-auditor.md +0 -86
- package/agents/figma/figma-builder.md +0 -104
- package/agents/implementer-low.md +0 -43
- package/agents/implementer-medium.md +0 -52
- package/agents/junior-mentor.md +0 -141
- package/agents/planning/requirements-analyst.md +0 -84
- package/agents/planning/ux-advisor.md +0 -83
- package/agents/qa/acceptance-tester.md +0 -86
- package/agents/qa/edge-case-finder.md +0 -93
- package/agents/qa/qa-coordinator.md +0 -131
- package/agents/refactor-cleaner.md +0 -143
- package/agents/research/best-practices.md +0 -199
- package/agents/research/codebase-patterns.md +0 -157
- package/agents/research/framework-docs.md +0 -188
- package/agents/research/security-advisory.md +0 -213
- package/agents/review/architecture-reviewer.md +0 -107
- package/agents/review/complexity-reviewer.md +0 -116
- package/agents/review/data-integrity-reviewer.md +0 -88
- package/agents/review/git-history-reviewer.md +0 -103
- package/agents/review/performance-reviewer.md +0 -86
- package/agents/review/python-reviewer.md +0 -150
- package/agents/review/rails-reviewer.md +0 -139
- package/agents/review/react-reviewer.md +0 -144
- package/agents/review/security-reviewer.md +0 -80
- package/agents/review/simplicity-reviewer.md +0 -140
- package/agents/review/test-coverage-reviewer.md +0 -116
- package/agents/review/typescript-reviewer.md +0 -127
- package/agents/searcher.md +0 -54
- package/agents/simplifier.md +0 -124
- package/agents/teams/debug-team.md +0 -74
- package/agents/teams/dev-team.md +0 -92
- package/agents/teams/docs-team.md +0 -84
- package/agents/teams/figma-team.md +0 -89
- package/agents/teams/fullstack-team.md +0 -87
- package/agents/teams/lite-team.md +0 -73
- package/agents/teams/migration-team.md +0 -82
- package/agents/teams/refactor-team.md +0 -98
- package/agents/teams/research-team.md +0 -90
- package/agents/teams/review-debate-team.md +0 -129
- package/agents/teams/security-team.md +0 -85
- package/agents/ui/ui-a11y-auditor.md +0 -93
- package/agents/ui/ui-antipattern-detector.md +0 -102
- package/agents/ui/ui-dataviz-advisor.md +0 -69
- package/agents/ui/ui-design-system-gen.md +0 -57
- package/agents/ui/ui-industry-analyzer.md +0 -49
- package/agents/ui/ui-layout-architect.md +0 -65
- package/agents/ui/ui-stack-implementer.md +0 -68
- package/agents/ui/ux-compliance-reviewer.md +0 -81
- package/agents/ui-previewer.md +0 -262
- package/dist/cli/llm/gemini-commands.d.ts +0 -25
- package/dist/cli/llm/gemini-commands.d.ts.map +0 -1
- package/dist/cli/llm/gemini-commands.js +0 -143
- package/dist/cli/llm/gemini-commands.js.map +0 -1
- package/dist/cli/postinstall/codex-agents.d.ts +0 -24
- package/dist/cli/postinstall/codex-agents.d.ts.map +0 -1
- package/dist/cli/postinstall/codex-agents.js +0 -114
- package/dist/cli/postinstall/codex-agents.js.map +0 -1
- package/dist/cli/postinstall/codex-instruction.d.ts +0 -10
- package/dist/cli/postinstall/codex-instruction.d.ts.map +0 -1
- package/dist/cli/postinstall/codex-instruction.js +0 -56
- package/dist/cli/postinstall/codex-instruction.js.map +0 -1
- package/dist/cli/postinstall/gemini-agents.d.ts +0 -12
- package/dist/cli/postinstall/gemini-agents.d.ts.map +0 -1
- package/dist/cli/postinstall/gemini-agents.js +0 -80
- package/dist/cli/postinstall/gemini-agents.js.map +0 -1
- package/dist/cli/postinstall/gemini-instruction.d.ts +0 -10
- package/dist/cli/postinstall/gemini-instruction.d.ts.map +0 -1
- package/dist/cli/postinstall/gemini-instruction.js +0 -59
- package/dist/cli/postinstall/gemini-instruction.js.map +0 -1
- package/dist/infra/lib/ContextCompressor.d.ts +0 -104
- package/dist/infra/lib/ContextCompressor.d.ts.map +0 -1
- package/dist/infra/lib/ContextCompressor.js +0 -297
- package/dist/infra/lib/ContextCompressor.js.map +0 -1
- package/dist/infra/lib/ContextCompressor.test.d.ts +0 -2
- package/dist/infra/lib/ContextCompressor.test.d.ts.map +0 -1
- package/dist/infra/lib/ContextCompressor.test.js +0 -25
- package/dist/infra/lib/ContextCompressor.test.js.map +0 -1
- package/dist/infra/lib/ProgressTracker.d.ts +0 -73
- package/dist/infra/lib/ProgressTracker.d.ts.map +0 -1
- package/dist/infra/lib/ProgressTracker.js +0 -267
- package/dist/infra/lib/ProgressTracker.js.map +0 -1
- package/dist/infra/lib/TokenBudgetTracker.d.ts +0 -68
- package/dist/infra/lib/TokenBudgetTracker.d.ts.map +0 -1
- package/dist/infra/lib/TokenBudgetTracker.js +0 -191
- package/dist/infra/lib/TokenBudgetTracker.js.map +0 -1
- package/dist/infra/lib/autonomy/AuditStore.d.ts +0 -63
- package/dist/infra/lib/autonomy/AuditStore.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/AuditStore.js +0 -185
- package/dist/infra/lib/autonomy/AuditStore.js.map +0 -1
- package/dist/infra/lib/autonomy/AutonomyConfig.d.ts +0 -84
- package/dist/infra/lib/autonomy/AutonomyConfig.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/AutonomyConfig.js +0 -49
- package/dist/infra/lib/autonomy/AutonomyConfig.js.map +0 -1
- package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts +0 -78
- package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/AutonomyOrchestrator.js +0 -246
- package/dist/infra/lib/autonomy/AutonomyOrchestrator.js.map +0 -1
- package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts +0 -36
- package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/BackgroundMonitor.js +0 -138
- package/dist/infra/lib/autonomy/BackgroundMonitor.js.map +0 -1
- package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts +0 -56
- package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/CollaborationProtocol.js +0 -122
- package/dist/infra/lib/autonomy/CollaborationProtocol.js.map +0 -1
- package/dist/infra/lib/autonomy/ConfirmationManager.d.ts +0 -42
- package/dist/infra/lib/autonomy/ConfirmationManager.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/ConfirmationManager.js +0 -200
- package/dist/infra/lib/autonomy/ConfirmationManager.js.map +0 -1
- package/dist/infra/lib/autonomy/ConfirmationStore.d.ts +0 -55
- package/dist/infra/lib/autonomy/ConfirmationStore.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/ConfirmationStore.js +0 -130
- package/dist/infra/lib/autonomy/ConfirmationStore.js.map +0 -1
- package/dist/infra/lib/autonomy/EventBus.d.ts +0 -20
- package/dist/infra/lib/autonomy/EventBus.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/EventBus.js +0 -119
- package/dist/infra/lib/autonomy/EventBus.js.map +0 -1
- package/dist/infra/lib/autonomy/EventOutbox.d.ts +0 -32
- package/dist/infra/lib/autonomy/EventOutbox.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/EventOutbox.js +0 -152
- package/dist/infra/lib/autonomy/EventOutbox.js.map +0 -1
- package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts +0 -24
- package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/NotificationDispatcher.js +0 -112
- package/dist/infra/lib/autonomy/NotificationDispatcher.js.map +0 -1
- package/dist/infra/lib/autonomy/PolicyEngine.d.ts +0 -76
- package/dist/infra/lib/autonomy/PolicyEngine.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/PolicyEngine.js +0 -208
- package/dist/infra/lib/autonomy/PolicyEngine.js.map +0 -1
- package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts +0 -61
- package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/ProactiveAnalyzer.js +0 -236
- package/dist/infra/lib/autonomy/ProactiveAnalyzer.js.map +0 -1
- package/dist/infra/lib/autonomy/RiskClassifier.d.ts +0 -35
- package/dist/infra/lib/autonomy/RiskClassifier.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/RiskClassifier.js +0 -147
- package/dist/infra/lib/autonomy/RiskClassifier.js.map +0 -1
- package/dist/infra/lib/autonomy/SecuritySentinel.d.ts +0 -51
- package/dist/infra/lib/autonomy/SecuritySentinel.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/SecuritySentinel.js +0 -162
- package/dist/infra/lib/autonomy/SecuritySentinel.js.map +0 -1
- package/dist/infra/lib/autonomy/SuggestionStore.d.ts +0 -54
- package/dist/infra/lib/autonomy/SuggestionStore.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/SuggestionStore.js +0 -144
- package/dist/infra/lib/autonomy/SuggestionStore.js.map +0 -1
- package/dist/infra/lib/autonomy/TaskDecomposer.d.ts +0 -38
- package/dist/infra/lib/autonomy/TaskDecomposer.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/TaskDecomposer.js +0 -175
- package/dist/infra/lib/autonomy/TaskDecomposer.js.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts +0 -2
- package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/audit-store.test.js +0 -198
- package/dist/infra/lib/autonomy/__tests__/audit-store.test.js.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts +0 -2
- package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/event-bus.test.js +0 -225
- package/dist/infra/lib/autonomy/__tests__/event-bus.test.js.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts +0 -2
- package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/event-core.test.js +0 -194
- package/dist/infra/lib/autonomy/__tests__/event-core.test.js.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts +0 -2
- package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/governance.test.js +0 -540
- package/dist/infra/lib/autonomy/__tests__/governance.test.js.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts +0 -2
- package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/integration.test.js +0 -480
- package/dist/infra/lib/autonomy/__tests__/integration.test.js.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts +0 -2
- package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/proactive.test.js +0 -410
- package/dist/infra/lib/autonomy/__tests__/proactive.test.js.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts +0 -2
- package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/__tests__/sentinel.test.js +0 -486
- package/dist/infra/lib/autonomy/__tests__/sentinel.test.js.map +0 -1
- package/dist/infra/lib/autonomy/index.d.ts +0 -18
- package/dist/infra/lib/autonomy/index.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/index.js +0 -22
- package/dist/infra/lib/autonomy/index.js.map +0 -1
- package/dist/infra/lib/autonomy/schemas.d.ts +0 -317
- package/dist/infra/lib/autonomy/schemas.d.ts.map +0 -1
- package/dist/infra/lib/autonomy/schemas.js +0 -90
- package/dist/infra/lib/autonomy/schemas.js.map +0 -1
- package/dist/infra/lib/claude/index.d.ts +0 -5
- package/dist/infra/lib/claude/index.d.ts.map +0 -1
- package/dist/infra/lib/claude/index.js +0 -5
- package/dist/infra/lib/claude/index.js.map +0 -1
- package/dist/infra/lib/claude/storage.d.ts +0 -12
- package/dist/infra/lib/claude/storage.d.ts.map +0 -1
- package/dist/infra/lib/claude/storage.js +0 -54
- package/dist/infra/lib/claude/storage.js.map +0 -1
- package/dist/infra/lib/gemini/auth.d.ts +0 -18
- package/dist/infra/lib/gemini/auth.d.ts.map +0 -1
- package/dist/infra/lib/gemini/auth.js +0 -32
- package/dist/infra/lib/gemini/auth.js.map +0 -1
- package/dist/infra/lib/gemini/capabilities.d.ts +0 -28
- package/dist/infra/lib/gemini/capabilities.d.ts.map +0 -1
- package/dist/infra/lib/gemini/capabilities.js +0 -178
- package/dist/infra/lib/gemini/capabilities.js.map +0 -1
- package/dist/infra/lib/gemini/chat.d.ts +0 -35
- package/dist/infra/lib/gemini/chat.d.ts.map +0 -1
- package/dist/infra/lib/gemini/chat.js +0 -161
- package/dist/infra/lib/gemini/chat.js.map +0 -1
- package/dist/infra/lib/gemini/completion.d.ts +0 -12
- package/dist/infra/lib/gemini/completion.d.ts.map +0 -1
- package/dist/infra/lib/gemini/completion.js +0 -13
- package/dist/infra/lib/gemini/completion.js.map +0 -1
- package/dist/infra/lib/gemini/constants.d.ts +0 -8
- package/dist/infra/lib/gemini/constants.d.ts.map +0 -1
- package/dist/infra/lib/gemini/constants.js +0 -11
- package/dist/infra/lib/gemini/constants.js.map +0 -1
- package/dist/infra/lib/gemini/index.d.ts +0 -13
- package/dist/infra/lib/gemini/index.d.ts.map +0 -1
- package/dist/infra/lib/gemini/index.js +0 -12
- package/dist/infra/lib/gemini/index.js.map +0 -1
- package/dist/infra/lib/gemini/models.d.ts +0 -11
- package/dist/infra/lib/gemini/models.d.ts.map +0 -1
- package/dist/infra/lib/gemini/models.js +0 -38
- package/dist/infra/lib/gemini/models.js.map +0 -1
- package/dist/infra/lib/gemini/orchestration.d.ts +0 -33
- package/dist/infra/lib/gemini/orchestration.d.ts.map +0 -1
- package/dist/infra/lib/gemini/orchestration.js +0 -62
- package/dist/infra/lib/gemini/orchestration.js.map +0 -1
- package/dist/infra/lib/gemini/types.d.ts +0 -115
- package/dist/infra/lib/gemini/types.d.ts.map +0 -1
- package/dist/infra/lib/gemini/types.js +0 -5
- package/dist/infra/lib/gemini/types.js.map +0 -1
- package/dist/infra/orchestrator/AgentAnnouncer.d.ts +0 -64
- package/dist/infra/orchestrator/AgentAnnouncer.d.ts.map +0 -1
- package/dist/infra/orchestrator/AgentAnnouncer.js +0 -127
- package/dist/infra/orchestrator/AgentAnnouncer.js.map +0 -1
- package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts +0 -5
- package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts.map +0 -1
- package/dist/infra/orchestrator/AgentAnnouncer.test.js +0 -119
- package/dist/infra/orchestrator/AgentAnnouncer.test.js.map +0 -1
- package/dist/infra/orchestrator/AgentExecutor.d.ts +0 -22
- package/dist/infra/orchestrator/AgentExecutor.d.ts.map +0 -1
- package/dist/infra/orchestrator/AgentExecutor.js +0 -272
- package/dist/infra/orchestrator/AgentExecutor.js.map +0 -1
- package/dist/infra/orchestrator/AgentManager.d.ts +0 -72
- package/dist/infra/orchestrator/AgentManager.d.ts.map +0 -1
- package/dist/infra/orchestrator/AgentManager.js +0 -183
- package/dist/infra/orchestrator/AgentManager.js.map +0 -1
- package/dist/infra/orchestrator/AgentManifestCache.d.ts +0 -54
- package/dist/infra/orchestrator/AgentManifestCache.d.ts.map +0 -1
- package/dist/infra/orchestrator/AgentManifestCache.js +0 -191
- package/dist/infra/orchestrator/AgentManifestCache.js.map +0 -1
- package/dist/infra/orchestrator/AgentRegistry.d.ts +0 -76
- package/dist/infra/orchestrator/AgentRegistry.d.ts.map +0 -1
- package/dist/infra/orchestrator/AgentRegistry.js +0 -217
- package/dist/infra/orchestrator/AgentRegistry.js.map +0 -1
- package/dist/infra/orchestrator/AgentRegistry.test.d.ts +0 -5
- package/dist/infra/orchestrator/AgentRegistry.test.d.ts.map +0 -1
- package/dist/infra/orchestrator/AgentRegistry.test.js +0 -122
- package/dist/infra/orchestrator/AgentRegistry.test.js.map +0 -1
- package/dist/infra/orchestrator/BackgroundManager.d.ts +0 -128
- package/dist/infra/orchestrator/BackgroundManager.d.ts.map +0 -1
- package/dist/infra/orchestrator/BackgroundManager.js +0 -620
- package/dist/infra/orchestrator/BackgroundManager.js.map +0 -1
- package/dist/infra/orchestrator/BackgroundManager.test.d.ts +0 -6
- package/dist/infra/orchestrator/BackgroundManager.test.d.ts.map +0 -1
- package/dist/infra/orchestrator/BackgroundManager.test.js +0 -162
- package/dist/infra/orchestrator/BackgroundManager.test.js.map +0 -1
- package/dist/infra/orchestrator/CheckpointManager.d.ts +0 -54
- package/dist/infra/orchestrator/CheckpointManager.d.ts.map +0 -1
- package/dist/infra/orchestrator/CheckpointManager.js +0 -121
- package/dist/infra/orchestrator/CheckpointManager.js.map +0 -1
- package/dist/infra/orchestrator/CodexAgentRuntime.d.ts +0 -12
- package/dist/infra/orchestrator/CodexAgentRuntime.d.ts.map +0 -1
- package/dist/infra/orchestrator/CodexAgentRuntime.js +0 -94
- package/dist/infra/orchestrator/CodexAgentRuntime.js.map +0 -1
- package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts +0 -2
- package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts.map +0 -1
- package/dist/infra/orchestrator/CodexAgentRuntime.test.js +0 -37
- package/dist/infra/orchestrator/CodexAgentRuntime.test.js.map +0 -1
- package/dist/infra/orchestrator/LLMCluster.d.ts +0 -82
- package/dist/infra/orchestrator/LLMCluster.d.ts.map +0 -1
- package/dist/infra/orchestrator/LLMCluster.js +0 -146
- package/dist/infra/orchestrator/LLMCluster.js.map +0 -1
- package/dist/infra/orchestrator/MultiLlmResearch.d.ts +0 -31
- package/dist/infra/orchestrator/MultiLlmResearch.d.ts.map +0 -1
- package/dist/infra/orchestrator/MultiLlmResearch.js +0 -160
- package/dist/infra/orchestrator/MultiLlmResearch.js.map +0 -1
- package/dist/infra/orchestrator/PhasePipeline.d.ts +0 -122
- package/dist/infra/orchestrator/PhasePipeline.d.ts.map +0 -1
- package/dist/infra/orchestrator/PhasePipeline.js +0 -385
- package/dist/infra/orchestrator/PhasePipeline.js.map +0 -1
- package/dist/infra/orchestrator/PhaseResultStore.d.ts +0 -39
- package/dist/infra/orchestrator/PhaseResultStore.d.ts.map +0 -1
- package/dist/infra/orchestrator/PhaseResultStore.js +0 -151
- package/dist/infra/orchestrator/PhaseResultStore.js.map +0 -1
- package/dist/infra/orchestrator/SessionStore.d.ts +0 -40
- package/dist/infra/orchestrator/SessionStore.d.ts.map +0 -1
- package/dist/infra/orchestrator/SessionStore.js +0 -116
- package/dist/infra/orchestrator/SessionStore.js.map +0 -1
- package/dist/infra/orchestrator/SmartRouter.d.ts +0 -90
- package/dist/infra/orchestrator/SmartRouter.d.ts.map +0 -1
- package/dist/infra/orchestrator/SmartRouter.js +0 -277
- package/dist/infra/orchestrator/SmartRouter.js.map +0 -1
- package/dist/infra/orchestrator/SmartRouter.test.d.ts +0 -5
- package/dist/infra/orchestrator/SmartRouter.test.d.ts.map +0 -1
- package/dist/infra/orchestrator/SmartRouter.test.js +0 -484
- package/dist/infra/orchestrator/SmartRouter.test.js.map +0 -1
- package/dist/infra/orchestrator/SwarmOrchestrator.d.ts +0 -143
- package/dist/infra/orchestrator/SwarmOrchestrator.d.ts.map +0 -1
- package/dist/infra/orchestrator/SwarmOrchestrator.js +0 -378
- package/dist/infra/orchestrator/SwarmOrchestrator.js.map +0 -1
- package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts +0 -5
- package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts.map +0 -1
- package/dist/infra/orchestrator/SwarmOrchestrator.test.js +0 -95
- package/dist/infra/orchestrator/SwarmOrchestrator.test.js.map +0 -1
- package/dist/infra/orchestrator/agentDiscovery.d.ts +0 -26
- package/dist/infra/orchestrator/agentDiscovery.d.ts.map +0 -1
- package/dist/infra/orchestrator/agentDiscovery.js +0 -175
- package/dist/infra/orchestrator/agentDiscovery.js.map +0 -1
- package/dist/infra/orchestrator/backgroundAgent.d.ts +0 -9
- package/dist/infra/orchestrator/backgroundAgent.d.ts.map +0 -1
- package/dist/infra/orchestrator/backgroundAgent.js +0 -10
- package/dist/infra/orchestrator/backgroundAgent.js.map +0 -1
- package/dist/infra/orchestrator/index.d.ts +0 -207
- package/dist/infra/orchestrator/index.d.ts.map +0 -1
- package/dist/infra/orchestrator/index.js +0 -362
- package/dist/infra/orchestrator/index.js.map +0 -1
- package/dist/infra/orchestrator/orchestrator.d.ts +0 -60
- package/dist/infra/orchestrator/orchestrator.d.ts.map +0 -1
- package/dist/infra/orchestrator/orchestrator.js +0 -214
- package/dist/infra/orchestrator/orchestrator.js.map +0 -1
- package/dist/infra/orchestrator/parallelResearch.d.ts +0 -27
- package/dist/infra/orchestrator/parallelResearch.d.ts.map +0 -1
- package/dist/infra/orchestrator/parallelResearch.js +0 -285
- package/dist/infra/orchestrator/parallelResearch.js.map +0 -1
- package/dist/infra/orchestrator/types.d.ts +0 -205
- package/dist/infra/orchestrator/types.d.ts.map +0 -1
- package/dist/infra/orchestrator/types.js +0 -87
- package/dist/infra/orchestrator/types.js.map +0 -1
- package/dist/infra/orchestrator/types.test.d.ts +0 -2
- package/dist/infra/orchestrator/types.test.d.ts.map +0 -1
- package/dist/infra/orchestrator/types.test.js +0 -57
- package/dist/infra/orchestrator/types.test.js.map +0 -1
- package/dist/tools/semantic/analyzeDependencyGraph.d.ts +0 -12
- package/dist/tools/semantic/analyzeDependencyGraph.d.ts.map +0 -1
- package/dist/tools/semantic/analyzeDependencyGraph.js +0 -359
- package/dist/tools/semantic/analyzeDependencyGraph.js.map +0 -1
- package/dist/tools/semantic/astGrep.d.ts +0 -25
- package/dist/tools/semantic/astGrep.d.ts.map +0 -1
- package/dist/tools/semantic/astGrep.js +0 -324
- package/dist/tools/semantic/astGrep.js.map +0 -1
- package/dist/tools/semantic/astGrep.test.d.ts +0 -2
- package/dist/tools/semantic/astGrep.test.d.ts.map +0 -1
- package/dist/tools/semantic/astGrep.test.js +0 -74
- package/dist/tools/semantic/astGrep.test.js.map +0 -1
- package/dist/tools/semantic/findReferences.d.ts +0 -9
- package/dist/tools/semantic/findReferences.d.ts.map +0 -1
- package/dist/tools/semantic/findReferences.js +0 -200
- package/dist/tools/semantic/findReferences.js.map +0 -1
- package/dist/tools/semantic/findSymbol.d.ts +0 -8
- package/dist/tools/semantic/findSymbol.d.ts.map +0 -1
- package/dist/tools/semantic/findSymbol.js +0 -204
- package/dist/tools/semantic/findSymbol.js.map +0 -1
- package/dist/tools/semantic/index.d.ts +0 -9
- package/dist/tools/semantic/index.d.ts.map +0 -1
- package/dist/tools/semantic/index.js +0 -11
- package/dist/tools/semantic/index.js.map +0 -1
- package/dist/tools/semantic/lsp.d.ts +0 -68
- package/dist/tools/semantic/lsp.d.ts.map +0 -1
- package/dist/tools/semantic/lsp.js +0 -561
- package/dist/tools/semantic/lsp.js.map +0 -1
- package/dist/tools/spec/e2eTestGenerator.d.ts +0 -61
- package/dist/tools/spec/e2eTestGenerator.d.ts.map +0 -1
- package/dist/tools/spec/e2eTestGenerator.js +0 -255
- package/dist/tools/spec/e2eTestGenerator.js.map +0 -1
- package/dist/tools/spec/specVersioning.d.ts +0 -76
- package/dist/tools/spec/specVersioning.d.ts.map +0 -1
- package/dist/tools/spec/specVersioning.js +0 -236
- package/dist/tools/spec/specVersioning.js.map +0 -1
- package/hooks/scripts/__tests__/keyword-detector.test.js +0 -242
- package/hooks/scripts/keyword-detector.js +0 -226
- package/skills/characterization-test/SKILL.md +0 -209
- package/skills/characterization-test/agents/behavior-capturer.md +0 -50
- package/skills/characterization-test/agents/coverage-checker.md +0 -54
- package/skills/characterization-test/agents/reporter.md +0 -50
- package/skills/characterization-test/agents/test-writer.md +0 -49
- package/skills/characterization-test/rubrics/coverage-criteria.md +0 -53
- package/skills/characterization-test/templates/test-template.ts +0 -101
- package/skills/claude-md-guide/SKILL.md +0 -353
- package/skills/claude-md-guide/rubrics/anti-patterns.md +0 -88
- package/skills/design-audit/SKILL.md +0 -154
- package/skills/design-critique/SKILL.md +0 -140
- package/skills/design-distill/SKILL.md +0 -131
- package/skills/design-normalize/SKILL.md +0 -135
- package/skills/design-polish/SKILL.md +0 -132
- package/skills/figma-convert/SKILL.md +0 -236
- package/skills/figma-extract/SKILL.md +0 -242
- package/skills/interview/SKILL.md +0 -358
- package/skills/interview/checklists/api.md +0 -101
- package/skills/interview/checklists/feature.md +0 -88
- package/skills/interview/checklists/library.md +0 -95
- package/skills/interview/checklists/mobile.md +0 -89
- package/skills/interview/checklists/webapp.md +0 -97
- package/skills/interview/checklists/website.md +0 -99
- package/skills/plan/SKILL.md +0 -254
- package/skills/rob-pike/SKILL.md +0 -66
- package/skills/spec/references/askuser-examples.md +0 -57
- package/skills/spec/references/example-session.md +0 -87
- package/skills/spec/references/templates.md +0 -194
- package/skills/spec-review/SKILL.md +0 -725
- package/skills/systematic-debugging/SKILL.md +0 -142
- package/skills/techdebt/SKILL.md +0 -126
- package/skills/techdebt/agents/analyzer.md +0 -50
- package/skills/techdebt/agents/fixer.md +0 -41
- package/skills/techdebt/agents/reviewer.md +0 -47
- package/skills/techdebt/agents/scanner.md +0 -44
- package/skills/techdebt/orchestrator.md +0 -72
- package/skills/techdebt/rubrics/severity.md +0 -51
- package/skills/techdebt/scripts/scan.js +0 -90
- package/skills/techdebt/templates/report.md +0 -86
- package/skills/typescript-advanced-types/SKILL.md +0 -68
- package/skills/typescript-advanced-types/rubrics/type-patterns.md +0 -109
- package/skills/yagni-ladder/SKILL.md +0 -90
- /package/skills/{claude-md-guide → agents-md}/templates/claude-md.md +0 -0
- /package/skills/{design-polish → design-refine}/rubrics/polish-checklist.md +0 -0
- /package/skills/{design-normalize → design-refine}/rubrics/token-naming.md +0 -0
- /package/skills/{design-distill → design-refine}/templates/design-system.md +0 -0
- /package/skills/{design-audit → design-review}/agents/scorer.md +0 -0
- /package/skills/{design-audit → design-review}/rubrics/ai-slop-patterns.md +0 -0
- /package/skills/{design-audit → design-review}/rubrics/scoring.md +0 -0
- /package/skills/{design-critique → design-review}/rubrics/ux-heuristics.md +0 -0
- /package/skills/{figma-convert → figma}/rubrics/conversion-rules.md +0 -0
- /package/skills/{figma-extract → figma}/rubrics/image-rules.md +0 -0
- /package/skills/{figma-convert → figma}/templates/component.md +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI 에이전트 변환 및 설치
|
|
3
|
-
*
|
|
4
|
-
* VIBE 에이전트 마크다운 파일을 Gemini CLI 형식
|
|
5
|
-
* (YAML frontmatter: name, description만) 으로 변환하여 ~/.gemini/agents/에 설치
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Gemini CLI 에이전트 설치
|
|
9
|
-
* agents/ → ~/.gemini/agents/ 재귀 순회하여 변환 후 설치
|
|
10
|
-
*/
|
|
11
|
-
export declare function installGeminiAgents(agentsSource: string, geminiAgentsDir: string): void;
|
|
12
|
-
//# sourceMappingURL=gemini-agents.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-agents.d.ts","sourceRoot":"","sources":["../../../src/cli/postinstall/gemini-agents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6CH;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,CAsCvF"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI 에이전트 변환 및 설치
|
|
3
|
-
*
|
|
4
|
-
* VIBE 에이전트 마크다운 파일을 Gemini CLI 형식
|
|
5
|
-
* (YAML frontmatter: name, description만) 으로 변환하여 ~/.gemini/agents/에 설치
|
|
6
|
-
*/
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import fs from 'fs';
|
|
9
|
-
import { ensureDir, removeDirRecursive } from './fs-utils.js';
|
|
10
|
-
/**
|
|
11
|
-
* VIBE 에이전트를 Gemini CLI 형식으로 변환
|
|
12
|
-
* Gemini frontmatter: name, description만 (model/tools/permissionMode 없음)
|
|
13
|
-
*/
|
|
14
|
-
function convertAgentToGemini(content, filename) {
|
|
15
|
-
const normalizedContent = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
16
|
-
const name = path.basename(filename, '.md');
|
|
17
|
-
// 제목 추출
|
|
18
|
-
const titleMatch = normalizedContent.match(/^# (.+)$/m);
|
|
19
|
-
const title = titleMatch ? titleMatch[1].trim() : name;
|
|
20
|
-
// Role 섹션 추출
|
|
21
|
-
const roleMatch = normalizedContent.match(/## Role\s*\n([\s\S]*?)(?=\n## )/);
|
|
22
|
-
const roleLines = roleMatch
|
|
23
|
-
? roleMatch[1]
|
|
24
|
-
.split('\n')
|
|
25
|
-
.filter((line) => line.trim().startsWith('- '))
|
|
26
|
-
.map((line) => line.trim().replace(/^- /, '').trim())
|
|
27
|
-
.slice(0, 3)
|
|
28
|
-
: [];
|
|
29
|
-
const description = roleLines.length > 0
|
|
30
|
-
? `${title}. ${roleLines.join(', ')}.`
|
|
31
|
-
: title;
|
|
32
|
-
// Gemini YAML frontmatter (name, description만)
|
|
33
|
-
let frontmatter = '---\n';
|
|
34
|
-
frontmatter += `name: ${name}\n`;
|
|
35
|
-
frontmatter += `description: ${description}\n`;
|
|
36
|
-
frontmatter += '---\n';
|
|
37
|
-
// 기존 frontmatter 제거 후 원본 본문 유지
|
|
38
|
-
const bodyContent = normalizedContent.replace(/^---\n[\s\S]*?\n---\n/, '');
|
|
39
|
-
return `${frontmatter}\n${bodyContent}`;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Gemini CLI 에이전트 설치
|
|
43
|
-
* agents/ → ~/.gemini/agents/ 재귀 순회하여 변환 후 설치
|
|
44
|
-
*/
|
|
45
|
-
export function installGeminiAgents(agentsSource, geminiAgentsDir) {
|
|
46
|
-
if (!fs.existsSync(agentsSource)) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
// 클린 설치
|
|
50
|
-
if (fs.existsSync(geminiAgentsDir)) {
|
|
51
|
-
removeDirRecursive(geminiAgentsDir);
|
|
52
|
-
}
|
|
53
|
-
ensureDir(geminiAgentsDir);
|
|
54
|
-
let installed = 0;
|
|
55
|
-
function processDirectory(srcDir, destDir) {
|
|
56
|
-
ensureDir(destDir);
|
|
57
|
-
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
58
|
-
for (const entry of entries) {
|
|
59
|
-
const srcPath = path.join(srcDir, entry.name);
|
|
60
|
-
const destPath = path.join(destDir, entry.name);
|
|
61
|
-
if (entry.isDirectory()) {
|
|
62
|
-
processDirectory(srcPath, destPath);
|
|
63
|
-
}
|
|
64
|
-
else if (entry.name.endsWith('.md')) {
|
|
65
|
-
try {
|
|
66
|
-
const content = fs.readFileSync(srcPath, 'utf-8');
|
|
67
|
-
const geminiContent = convertAgentToGemini(content, entry.name);
|
|
68
|
-
fs.writeFileSync(destPath, geminiContent, 'utf-8');
|
|
69
|
-
installed++;
|
|
70
|
-
}
|
|
71
|
-
catch {
|
|
72
|
-
// skip failed files
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
processDirectory(agentsSource, geminiAgentsDir);
|
|
78
|
-
console.log(` 📦 Gemini agents: ${installed} installed`);
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=gemini-agents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-agents.js","sourceRoot":"","sources":["../../../src/cli/postinstall/gemini-agents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,C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,KAAK,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBAClD,MAAM,aAAa,GAAG,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;oBAChE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;oBACnD,SAAS,EAAE,CAAC;gBACd,CAAC;gBAAC,MAAM,CAAC;oBACP,oBAAoB;gBACtB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,gBAAgB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,wBAAwB,SAAS,YAAY,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI 전역 GEMINI.md 생성
|
|
3
|
-
*
|
|
4
|
-
* CLAUDE.md에서 VIBE 섹션을 읽어 GEMINI.md 형식으로 변환
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 전역 ~/.gemini/GEMINI.md 생성
|
|
8
|
-
*/
|
|
9
|
-
export declare function generateGeminiMd(geminiDir: string, packageRoot: string): void;
|
|
10
|
-
//# sourceMappingURL=gemini-instruction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-instruction.d.ts","sourceRoot":"","sources":["../../../src/cli/postinstall/gemini-instruction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsDH;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAQ7E"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI 전역 GEMINI.md 생성
|
|
3
|
-
*
|
|
4
|
-
* CLAUDE.md에서 VIBE 섹션을 읽어 GEMINI.md 형식으로 변환
|
|
5
|
-
*/
|
|
6
|
-
import path from 'path';
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
const CORE_START_MARKER = '# VIBE';
|
|
9
|
-
const CORE_END_MARKER = '<!-- VIBE:END -->';
|
|
10
|
-
/**
|
|
11
|
-
* CLAUDE.md에서 VIBE 섹션 추출 (CLI-neutral 공통 내용)
|
|
12
|
-
*/
|
|
13
|
-
function getVibeInstructionContent(packageRoot) {
|
|
14
|
-
const claudeMdPath = path.join(packageRoot, 'CLAUDE.md');
|
|
15
|
-
if (!fs.existsSync(claudeMdPath))
|
|
16
|
-
return '';
|
|
17
|
-
const content = fs.readFileSync(claudeMdPath, 'utf-8').replace(/\r\n/g, '\n');
|
|
18
|
-
const startIdx = content.indexOf(CORE_START_MARKER);
|
|
19
|
-
const endIdx = content.indexOf(CORE_END_MARKER);
|
|
20
|
-
if (startIdx === -1)
|
|
21
|
-
return '';
|
|
22
|
-
const endPos = endIdx !== -1 ? endIdx + CORE_END_MARKER.length : content.length;
|
|
23
|
-
return content.substring(startIdx, endPos);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* VIBE 내용을 Gemini CLI 형식으로 변환
|
|
27
|
-
* - "Claude Code Exclusive" 문구 제거
|
|
28
|
-
* - hooks 이벤트 이름을 Gemini 형식으로 변환
|
|
29
|
-
* - 경로 참조를 ~/.gemini/ 기준으로 변환
|
|
30
|
-
*/
|
|
31
|
-
function adaptForGemini(content) {
|
|
32
|
-
let adapted = content;
|
|
33
|
-
// "Claude Code Exclusive" 문구 제거
|
|
34
|
-
adapted = adapted.replace(/\(Claude Code Exclusive\)/g, '');
|
|
35
|
-
adapted = adapted.replace(/Claude Code Exclusive/g, '');
|
|
36
|
-
// Hooks 이벤트 이름 변환 (Claude → Gemini)
|
|
37
|
-
adapted = adapted.replace(/PreToolUse/g, 'BeforeTool');
|
|
38
|
-
adapted = adapted.replace(/PostToolUse/g, 'AfterTool');
|
|
39
|
-
adapted = adapted.replace(/UserPromptSubmit/g, 'BeforeAgent');
|
|
40
|
-
adapted = adapted.replace(/\bStop\b/g, 'SessionEnd');
|
|
41
|
-
// ~/.claude/ → ~/.gemini/ 경로 변환
|
|
42
|
-
adapted = adapted.replace(/~\/\.claude\//g, '~/.gemini/');
|
|
43
|
-
adapted = adapted.replace(/\.claude\//g, '.gemini/');
|
|
44
|
-
// "Claude Code" → "Gemini CLI" 변환 (일반적 참조)
|
|
45
|
-
adapted = adapted.replace(/Claude Code/g, 'Gemini CLI');
|
|
46
|
-
return adapted.trim();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 전역 ~/.gemini/GEMINI.md 생성
|
|
50
|
-
*/
|
|
51
|
-
export function generateGeminiMd(geminiDir, packageRoot) {
|
|
52
|
-
const vibeContent = getVibeInstructionContent(packageRoot);
|
|
53
|
-
if (!vibeContent)
|
|
54
|
-
return;
|
|
55
|
-
const geminiContent = adaptForGemini(vibeContent);
|
|
56
|
-
const geminiMdPath = path.join(geminiDir, 'GEMINI.md');
|
|
57
|
-
fs.writeFileSync(geminiMdPath, geminiContent + '\n', 'utf-8');
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=gemini-instruction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-instruction.js","sourceRoot":"","sources":["../../../src/cli/postinstall/gemini-instruction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AACnC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;GAEG;AACH,SAAS,yBAAyB,CAAC,WAAmB;IACpD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACzD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,C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,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAErD,2CAA2C;IAC3C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAExD,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,WAAmB;IACrE,MAAM,WAAW,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,aAAa,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEvD,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,aAAa,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export interface CompressionResult {
|
|
2
|
-
compressed: string;
|
|
3
|
-
originalSize: number;
|
|
4
|
-
compressedSize: number;
|
|
5
|
-
compressionRatio: number;
|
|
6
|
-
removedSections: string[];
|
|
7
|
-
retainedSections: string[];
|
|
8
|
-
retentionStats?: {
|
|
9
|
-
codeRetentionPercent: number;
|
|
10
|
-
answerRetentionPercent: number;
|
|
11
|
-
questionRetentionPercent: number;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export interface ChunkScore {
|
|
15
|
-
text: string;
|
|
16
|
-
score: number;
|
|
17
|
-
type: 'code' | 'explanation' | 'question' | 'answer' | 'metadata';
|
|
18
|
-
keywords: string[];
|
|
19
|
-
index: number;
|
|
20
|
-
}
|
|
21
|
-
export declare class ContextCompressor {
|
|
22
|
-
private static readonly MAX_CHUNK_SIZE;
|
|
23
|
-
private static readonly DEFAULT_TARGET_TOKENS;
|
|
24
|
-
private static readonly TOKENS_PER_CHAR_ESTIMATE;
|
|
25
|
-
private static readonly MAX_SCORE;
|
|
26
|
-
private static readonly MIN_SCORE;
|
|
27
|
-
private static readonly CODE_KEYWORDS;
|
|
28
|
-
private static readonly IMPORTANT_KEYWORDS;
|
|
29
|
-
/**
|
|
30
|
-
* Compress context by selecting most important chunks
|
|
31
|
-
* @param context - Text content to compress
|
|
32
|
-
* @param targetTokens - Target token count (default: 4000)
|
|
33
|
-
* @returns Compression result with statistics
|
|
34
|
-
*/
|
|
35
|
-
static compress(context: string, targetTokens?: number): CompressionResult;
|
|
36
|
-
/**
|
|
37
|
-
* Calculate retention percentages by type
|
|
38
|
-
*/
|
|
39
|
-
private static calculateRetentionStats;
|
|
40
|
-
/**
|
|
41
|
-
* Split context into manageable chunks
|
|
42
|
-
*/
|
|
43
|
-
private static splitIntoChunks;
|
|
44
|
-
/**
|
|
45
|
-
* Score chunk importance (0-100)
|
|
46
|
-
* @param text - Text chunk to score
|
|
47
|
-
* @param index - Original position of the chunk in the source document
|
|
48
|
-
* @returns Scored chunk with type, keywords, and original index
|
|
49
|
-
*/
|
|
50
|
-
private static scoreChunk;
|
|
51
|
-
/**
|
|
52
|
-
* Detect chunk type based on content
|
|
53
|
-
*/
|
|
54
|
-
private static detectChunkType;
|
|
55
|
-
/**
|
|
56
|
-
* Extract important keywords from text
|
|
57
|
-
*/
|
|
58
|
-
private static extractKeywords;
|
|
59
|
-
/**
|
|
60
|
-
* Calculate base score for chunk
|
|
61
|
-
*/
|
|
62
|
-
private static calculateBaseScore;
|
|
63
|
-
/**
|
|
64
|
-
* Get score based on chunk type
|
|
65
|
-
*/
|
|
66
|
-
private static getTypeScore;
|
|
67
|
-
/**
|
|
68
|
-
* Get score for important keywords
|
|
69
|
-
*/
|
|
70
|
-
private static getKeywordScore;
|
|
71
|
-
/**
|
|
72
|
-
* Get score based on text structure
|
|
73
|
-
*/
|
|
74
|
-
private static getStructureScore;
|
|
75
|
-
/**
|
|
76
|
-
* Summarize removed chunk (one-liner)
|
|
77
|
-
*/
|
|
78
|
-
private static summarizeChunk;
|
|
79
|
-
/**
|
|
80
|
-
* Reconstruct compressed context.
|
|
81
|
-
*
|
|
82
|
-
* Chunks are emitted in their original document order (the caller sorts
|
|
83
|
-
* `selected` by index before calling). We intentionally do NOT regroup by
|
|
84
|
-
* type: reordering by score/type means a small change to the input reshuffles
|
|
85
|
-
* the whole output, destroying the common prefix between successive
|
|
86
|
-
* compactions and forcing a full KV-cache recompute. Preserving order keeps
|
|
87
|
-
* appended content at the tail so the prefix stays stable.
|
|
88
|
-
*/
|
|
89
|
-
private static reconstructContext;
|
|
90
|
-
/**
|
|
91
|
-
* Extract key entities (names, numbers, dates) from context
|
|
92
|
-
*/
|
|
93
|
-
static extractKeyEntities(context: string): {
|
|
94
|
-
names: string[];
|
|
95
|
-
numbers: string[];
|
|
96
|
-
dates: string[];
|
|
97
|
-
files: string[];
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Estimate token count (rough approximation)
|
|
101
|
-
*/
|
|
102
|
-
static estimateTokens(text: string): number;
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=ContextCompressor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextCompressor.d.ts","sourceRoot":"","sources":["../../../src/infra/lib/ContextCompressor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE;QACf,oBAAoB,EAAE,MAAM,CAAC;QAC7B,sBAAsB,EAAE,MAAM,CAAC;QAC/B,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CA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ACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAwBjC;;OAEG;WACW,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG;QACjD,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB;IA4BD;;OAEG;WACW,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAKnD"}
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
// Context compression utility (v1.3)
|
|
2
|
-
// Intelligently compress context when approaching token limits
|
|
3
|
-
export class ContextCompressor {
|
|
4
|
-
// WHY 500 chars: Small enough to score and discard at fine granularity, but
|
|
5
|
-
// large enough to keep related lines together (a typical function is ~300-600 chars).
|
|
6
|
-
static MAX_CHUNK_SIZE = 500; // characters
|
|
7
|
-
static DEFAULT_TARGET_TOKENS = 4000;
|
|
8
|
-
// WHY 0.25: GPT-family tokenizers average ~4 chars per token for English/code.
|
|
9
|
-
// 1 char * 0.25 = 0.25 tokens, so 4 chars = 1 token. Intentionally conservative
|
|
10
|
-
// to avoid exceeding context windows (overestimating tokens = safer truncation).
|
|
11
|
-
static TOKENS_PER_CHAR_ESTIMATE = 0.25;
|
|
12
|
-
static MAX_SCORE = 100;
|
|
13
|
-
static MIN_SCORE = 0;
|
|
14
|
-
static CODE_KEYWORDS = [
|
|
15
|
-
'function', 'class', 'const', 'let', 'var', 'import', 'export',
|
|
16
|
-
'def', 'async', 'await', 'return', 'if', 'for', 'while'
|
|
17
|
-
];
|
|
18
|
-
static IMPORTANT_KEYWORDS = [
|
|
19
|
-
'error', 'bug', 'fix', 'issue', 'problem', 'solution',
|
|
20
|
-
'TODO', 'FIXME', 'HACK', 'NOTE', 'WARNING'
|
|
21
|
-
];
|
|
22
|
-
/**
|
|
23
|
-
* Compress context by selecting most important chunks
|
|
24
|
-
* @param context - Text content to compress
|
|
25
|
-
* @param targetTokens - Target token count (default: 4000)
|
|
26
|
-
* @returns Compression result with statistics
|
|
27
|
-
*/
|
|
28
|
-
static compress(context, targetTokens = ContextCompressor.DEFAULT_TARGET_TOKENS) {
|
|
29
|
-
// Handle empty or very short context
|
|
30
|
-
if (!context || context.trim().length === 0) {
|
|
31
|
-
return {
|
|
32
|
-
compressed: '',
|
|
33
|
-
originalSize: 0,
|
|
34
|
-
compressedSize: 0,
|
|
35
|
-
compressionRatio: 0,
|
|
36
|
-
removedSections: [],
|
|
37
|
-
retainedSections: []
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
const chunks = this.splitIntoChunks(context);
|
|
41
|
-
const scoredChunks = chunks.map((chunk, i) => this.scoreChunk(chunk, i));
|
|
42
|
-
// WHY 1.2x threshold (not 1.0x): Avoids wasteful compression when the content
|
|
43
|
-
// is only marginally over the target — the scoring/reordering overhead would
|
|
44
|
-
// degrade readability for negligible size savings. context.length is in CHARS,
|
|
45
|
-
// targetTokens in tokens, so normalize via TOKENS_PER_CHAR_ESTIMATE (4 chars/token)
|
|
46
|
-
// before comparing — otherwise the early exit fires at ~30% of the real budget
|
|
47
|
-
// and in-budget content gets needlessly rechunked (breaking KV prefix-cache reuse).
|
|
48
|
-
const targetCharsWithMargin = (targetTokens / ContextCompressor.TOKENS_PER_CHAR_ESTIMATE) * 1.2;
|
|
49
|
-
if (context.length <= targetCharsWithMargin) {
|
|
50
|
-
return {
|
|
51
|
-
compressed: context,
|
|
52
|
-
originalSize: context.length,
|
|
53
|
-
compressedSize: context.length,
|
|
54
|
-
compressionRatio: 1,
|
|
55
|
-
removedSections: [],
|
|
56
|
-
retainedSections: scoredChunks.map(s => s.type),
|
|
57
|
-
retentionStats: {
|
|
58
|
-
codeRetentionPercent: 100,
|
|
59
|
-
answerRetentionPercent: 100,
|
|
60
|
-
questionRetentionPercent: 100
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
// Sort by score (highest first)
|
|
65
|
-
scoredChunks.sort((a, b) => b.score - a.score);
|
|
66
|
-
// Select chunks until target size
|
|
67
|
-
// TOKENS_PER_CHAR_ESTIMATE = 0.25 means 1 char ≈ 0.25 tokens, so 4 chars ≈ 1 token
|
|
68
|
-
// Reserve space for headers and formatting (5% overhead, min 50 chars, max 300 chars)
|
|
69
|
-
const HEADER_OVERHEAD = Math.max(50, Math.min(300, targetTokens * 4 * 0.05));
|
|
70
|
-
const targetChars = (targetTokens * 4) - HEADER_OVERHEAD;
|
|
71
|
-
const selected = [];
|
|
72
|
-
const removed = [];
|
|
73
|
-
let currentSize = 0;
|
|
74
|
-
for (const chunk of scoredChunks) {
|
|
75
|
-
if (currentSize + chunk.text.length <= targetChars) {
|
|
76
|
-
selected.push(chunk);
|
|
77
|
-
currentSize += chunk.text.length;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
removed.push(this.summarizeChunk(chunk));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// Emit in original document order (not score order) so a recompressed,
|
|
84
|
-
// grown context keeps a stable prefix — preserving KV prefix-cache reuse.
|
|
85
|
-
selected.sort((a, b) => a.index - b.index);
|
|
86
|
-
// Reconstruct compressed context
|
|
87
|
-
const compressed = this.reconstructContext(selected, removed);
|
|
88
|
-
// Calculate retention statistics
|
|
89
|
-
const retentionStats = this.calculateRetentionStats(scoredChunks, selected);
|
|
90
|
-
return {
|
|
91
|
-
compressed,
|
|
92
|
-
originalSize: context.length,
|
|
93
|
-
compressedSize: compressed.length,
|
|
94
|
-
compressionRatio: compressed.length / context.length,
|
|
95
|
-
removedSections: removed,
|
|
96
|
-
retainedSections: selected.map(s => s.type),
|
|
97
|
-
retentionStats
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Calculate retention percentages by type
|
|
102
|
-
*/
|
|
103
|
-
static calculateRetentionStats(allChunks, selectedChunks) {
|
|
104
|
-
const countByType = (chunks, type) => {
|
|
105
|
-
return chunks.filter(c => c.type === type).length;
|
|
106
|
-
};
|
|
107
|
-
const totalCode = countByType(allChunks, 'code');
|
|
108
|
-
const totalAnswer = countByType(allChunks, 'answer');
|
|
109
|
-
const totalQuestion = countByType(allChunks, 'question');
|
|
110
|
-
const retainedCode = countByType(selectedChunks, 'code');
|
|
111
|
-
const retainedAnswer = countByType(selectedChunks, 'answer');
|
|
112
|
-
const retainedQuestion = countByType(selectedChunks, 'question');
|
|
113
|
-
return {
|
|
114
|
-
codeRetentionPercent: totalCode > 0 ? Math.round((retainedCode / totalCode) * 100) : 0,
|
|
115
|
-
answerRetentionPercent: totalAnswer > 0 ? Math.round((retainedAnswer / totalAnswer) * 100) : 0,
|
|
116
|
-
questionRetentionPercent: totalQuestion > 0 ? Math.round((retainedQuestion / totalQuestion) * 100) : 0
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Split context into manageable chunks
|
|
121
|
-
*/
|
|
122
|
-
static splitIntoChunks(context) {
|
|
123
|
-
const chunks = [];
|
|
124
|
-
const lines = context.split('\n');
|
|
125
|
-
let currentChunk = '';
|
|
126
|
-
for (const line of lines) {
|
|
127
|
-
if (currentChunk.length + line.length > this.MAX_CHUNK_SIZE) {
|
|
128
|
-
if (currentChunk.trim()) {
|
|
129
|
-
chunks.push(currentChunk.trim());
|
|
130
|
-
}
|
|
131
|
-
currentChunk = line;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
currentChunk += '\n' + line;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (currentChunk.trim()) {
|
|
138
|
-
chunks.push(currentChunk.trim());
|
|
139
|
-
}
|
|
140
|
-
return chunks;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Score chunk importance (0-100)
|
|
144
|
-
* @param text - Text chunk to score
|
|
145
|
-
* @param index - Original position of the chunk in the source document
|
|
146
|
-
* @returns Scored chunk with type, keywords, and original index
|
|
147
|
-
*/
|
|
148
|
-
static scoreChunk(text, index) {
|
|
149
|
-
const lowerText = text.toLowerCase();
|
|
150
|
-
const type = this.detectChunkType(lowerText, text);
|
|
151
|
-
const keywords = this.extractKeywords(lowerText);
|
|
152
|
-
const baseScore = this.calculateBaseScore(text, lowerText, type);
|
|
153
|
-
const finalScore = Math.max(ContextCompressor.MIN_SCORE, Math.min(ContextCompressor.MAX_SCORE, baseScore));
|
|
154
|
-
return { text, score: finalScore, type, keywords, index };
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Detect chunk type based on content
|
|
158
|
-
*/
|
|
159
|
-
static detectChunkType(lowerText, text) {
|
|
160
|
-
if (text.includes('```'))
|
|
161
|
-
return 'code';
|
|
162
|
-
if (lowerText.match(/^(answer|solution|결과|답변):/i))
|
|
163
|
-
return 'answer';
|
|
164
|
-
if (lowerText.match(/^(timestamp|date|author|file):/i))
|
|
165
|
-
return 'metadata';
|
|
166
|
-
if (lowerText.includes('?'))
|
|
167
|
-
return 'question';
|
|
168
|
-
if (this.CODE_KEYWORDS.some(kw => lowerText.includes(kw)))
|
|
169
|
-
return 'code';
|
|
170
|
-
return 'explanation';
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Extract important keywords from text
|
|
174
|
-
*/
|
|
175
|
-
static extractKeywords(lowerText) {
|
|
176
|
-
const keywords = [];
|
|
177
|
-
for (const keyword of this.IMPORTANT_KEYWORDS) {
|
|
178
|
-
if (lowerText.includes(keyword.toLowerCase())) {
|
|
179
|
-
keywords.push(keyword);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
return keywords;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Calculate base score for chunk
|
|
186
|
-
*/
|
|
187
|
-
static calculateBaseScore(text, lowerText, type) {
|
|
188
|
-
let score = 0;
|
|
189
|
-
// WHY type-based scoring: Answers/code carry the highest signal density;
|
|
190
|
-
// metadata (timestamps, authors) is almost always reconstructible and expendable.
|
|
191
|
-
score += this.getTypeScore(type);
|
|
192
|
-
// Keyword bonus
|
|
193
|
-
score += this.getKeywordScore(lowerText);
|
|
194
|
-
// Structure bonuses
|
|
195
|
-
score += this.getStructureScore(text);
|
|
196
|
-
return score;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Get score based on chunk type
|
|
200
|
-
*/
|
|
201
|
-
static getTypeScore(type) {
|
|
202
|
-
const typeScores = {
|
|
203
|
-
code: 30,
|
|
204
|
-
answer: 35,
|
|
205
|
-
question: 25,
|
|
206
|
-
explanation: 0,
|
|
207
|
-
metadata: -20
|
|
208
|
-
};
|
|
209
|
-
return typeScores[type];
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Get score for important keywords
|
|
213
|
-
*/
|
|
214
|
-
static getKeywordScore(lowerText) {
|
|
215
|
-
let score = 0;
|
|
216
|
-
for (const keyword of this.IMPORTANT_KEYWORDS) {
|
|
217
|
-
if (lowerText.includes(keyword.toLowerCase())) {
|
|
218
|
-
score += 15;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return score;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Get score based on text structure
|
|
225
|
-
*/
|
|
226
|
-
static getStructureScore(text) {
|
|
227
|
-
let score = 0;
|
|
228
|
-
// Penalize very long chunks
|
|
229
|
-
if (text.length > 1000)
|
|
230
|
-
score -= 10;
|
|
231
|
-
// Boost short, concise chunks
|
|
232
|
-
if (text.length < 200 && text.split('\n').length <= 5)
|
|
233
|
-
score += 10;
|
|
234
|
-
// Boost structured content (lists)
|
|
235
|
-
if (text.match(/^[\d\-\*•]/m))
|
|
236
|
-
score += 15;
|
|
237
|
-
// Boost code blocks
|
|
238
|
-
if (text.includes('```'))
|
|
239
|
-
score += 20;
|
|
240
|
-
return score;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Summarize removed chunk (one-liner)
|
|
244
|
-
*/
|
|
245
|
-
static summarizeChunk(chunk) {
|
|
246
|
-
const firstLine = chunk.text.split('\n')[0].trim();
|
|
247
|
-
const summary = firstLine.length > 80
|
|
248
|
-
? firstLine.substring(0, 77) + '...'
|
|
249
|
-
: firstLine;
|
|
250
|
-
return `[${chunk.type}] ${summary}`;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Reconstruct compressed context.
|
|
254
|
-
*
|
|
255
|
-
* Chunks are emitted in their original document order (the caller sorts
|
|
256
|
-
* `selected` by index before calling). We intentionally do NOT regroup by
|
|
257
|
-
* type: reordering by score/type means a small change to the input reshuffles
|
|
258
|
-
* the whole output, destroying the common prefix between successive
|
|
259
|
-
* compactions and forcing a full KV-cache recompute. Preserving order keeps
|
|
260
|
-
* appended content at the tail so the prefix stays stable.
|
|
261
|
-
*/
|
|
262
|
-
static reconstructContext(selected, removed) {
|
|
263
|
-
const sections = [];
|
|
264
|
-
// Add header
|
|
265
|
-
sections.push('[Compressed Context - High Priority Information]\n');
|
|
266
|
-
// Emit selected chunks in original order to keep the prefix stable.
|
|
267
|
-
if (selected.length > 0) {
|
|
268
|
-
sections.push(selected.map(c => c.text).join('\n\n'));
|
|
269
|
-
sections.push('');
|
|
270
|
-
}
|
|
271
|
-
// Add summary of removed sections (low priority) at the tail
|
|
272
|
-
if (removed.length > 0) {
|
|
273
|
-
sections.push('## Removed Sections (Low Priority)');
|
|
274
|
-
sections.push(removed.join('\n'));
|
|
275
|
-
}
|
|
276
|
-
return sections.join('\n');
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Extract key entities (names, numbers, dates) from context
|
|
280
|
-
*/
|
|
281
|
-
static extractKeyEntities(context) {
|
|
282
|
-
const names = Array.from(new Set(context.match(/\b[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*\b/g) || []));
|
|
283
|
-
const numbers = Array.from(new Set(context.match(/\b\d+(?:\.\d+)?\b/g) || []));
|
|
284
|
-
const dates = Array.from(new Set(context.match(/\d{4}-\d{2}-\d{2}|\d{2}\/\d{2}\/\d{4}/g) || []));
|
|
285
|
-
const files = Array.from(new Set(context.match(/[\w\-]+\.[a-z]{2,4}\b/gi) || []));
|
|
286
|
-
return { names, numbers, dates, files };
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Estimate token count (rough approximation)
|
|
290
|
-
*/
|
|
291
|
-
static estimateTokens(text) {
|
|
292
|
-
// GPT-like tokenization: ~1 token per 4 characters
|
|
293
|
-
// More accurate would require actual tokenizer
|
|
294
|
-
return Math.ceil(text.length / 4);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
//# sourceMappingURL=ContextCompressor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextCompressor.js","sourceRoot":"","sources":["../../../src/infra/lib/ContextCompressor.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,+DAA+D;AA4B/D,MAAM,OAAO,iBAAiB;IAC5B,4EAA4E;IAC5E,sFAAsF;IAC9E,MAAM,CAAU,cAAc,GAAG,GAAG,CAAC,CAAC,aAAa;IACnD,MAAM,CAAU,qBAAqB,GAAG,IAAI,CAAC;IACrD,+EAA+E;IAC/E,gFAAgF;IAChF,iFAAiF;IACzE,MAAM,CAAU,wBAAwB,GAAG,IAAI,CAAC;IAChD,MAAM,CAAU,SAAS,GAAG,GAAG,CAAC;IAChC,MAAM,CAAU,SAAS,GAAG,CAAC,CAAC;IAE9B,MAAM,CAAU,aAAa,GAAG;QACtC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ;QAC9D,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO;KACxD,CAAC;IACM,MAAM,CAAU,kBAAkB,GAAG;QAC3C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU;QACrD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;KAC3C,CAAC;IAEF;;;;;OA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C,IAAI,CAAC,oCAAoC,CAAC,CAAC;YACpD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,kBAAkB,CAAC,OAAe;QAM9C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACtB,IAAI,GAAG,CACL,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,IAAI,EAAE,CAC3D,CACF,CAAC;QAEF,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CACxB,IAAI,GAAG,CACL,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAC1C,CACF,CAAC;QAEF,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACtB,IAAI,GAAG,CACL,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,IAAI,EAAE,CAC9D,CACF,CAAC;QAEF,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACtB,IAAI,GAAG,CACL,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAC/C,CACF,CAAC;QAEF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,cAAc,CAAC,IAAY;QACvC,mDAAmD;QACnD,+CAA+C;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextCompressor.test.d.ts","sourceRoot":"","sources":["../../../src/infra/lib/ContextCompressor.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { ContextCompressor } from './ContextCompressor.js';
|
|
3
|
-
describe('ContextCompressor.compress', () => {
|
|
4
|
-
it('returns content unchanged when within token budget (early exit)', () => {
|
|
5
|
-
// 4000 token target = 16,000 chars budget. 10,000 chars is well within it —
|
|
6
|
-
// must NOT be rechunked/compressed (would break KV prefix-cache reuse).
|
|
7
|
-
const content = 'const x = 1;\n'.repeat(770); // ~10,010 chars
|
|
8
|
-
const result = ContextCompressor.compress(content, 4000);
|
|
9
|
-
expect(result.compressed).toBe(content);
|
|
10
|
-
expect(result.compressionRatio).toBe(1);
|
|
11
|
-
expect(result.removedSections).toEqual([]);
|
|
12
|
-
});
|
|
13
|
-
it('compresses content exceeding the char-normalized budget', () => {
|
|
14
|
-
// 25,000 chars ≈ 6,250 tokens > 4,000 target * 1.2 margin → must compress
|
|
15
|
-
const content = 'some explanation text that goes on. '.repeat(700); // ~25,200 chars
|
|
16
|
-
const result = ContextCompressor.compress(content, 4000);
|
|
17
|
-
expect(result.compressedSize).toBeLessThan(result.originalSize);
|
|
18
|
-
});
|
|
19
|
-
it('handles empty context', () => {
|
|
20
|
-
const result = ContextCompressor.compress('', 4000);
|
|
21
|
-
expect(result.compressed).toBe('');
|
|
22
|
-
expect(result.originalSize).toBe(0);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=ContextCompressor.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextCompressor.test.js","sourceRoot":"","sources":["../../../src/infra/lib/ContextCompressor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACzE,4EAA4E;QAC5E,wEAAwE;QACxE,MAAM,O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