@compass-ai/nova 1.0.74 → 1.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +557 -555
- package/dist/index.js +10 -8
- package/package.json +1 -1
- package/dist/acp/agent.d.ts +0 -318
- package/dist/acp/agent.d.ts.map +0 -1
- package/dist/acp/agent.js +0 -795
- package/dist/acp/agent.js.map +0 -1
- package/dist/acp/backpressure-writer.d.ts +0 -49
- package/dist/acp/backpressure-writer.d.ts.map +0 -1
- package/dist/acp/backpressure-writer.js +0 -153
- package/dist/acp/backpressure-writer.js.map +0 -1
- package/dist/acp/event-adapter.d.ts +0 -242
- package/dist/acp/event-adapter.d.ts.map +0 -1
- package/dist/acp/event-adapter.js +0 -456
- package/dist/acp/event-adapter.js.map +0 -1
- package/dist/acp/index.d.ts +0 -30
- package/dist/acp/index.d.ts.map +0 -1
- package/dist/acp/index.js +0 -36
- package/dist/acp/index.js.map +0 -1
- package/dist/acp/modes.d.ts +0 -56
- package/dist/acp/modes.d.ts.map +0 -1
- package/dist/acp/modes.js +0 -135
- package/dist/acp/modes.js.map +0 -1
- package/dist/acp/session-manager.d.ts +0 -170
- package/dist/acp/session-manager.d.ts.map +0 -1
- package/dist/acp/session-manager.js +0 -381
- package/dist/acp/session-manager.js.map +0 -1
- package/dist/acp/text-coalescer.d.ts +0 -45
- package/dist/acp/text-coalescer.d.ts.map +0 -1
- package/dist/acp/text-coalescer.js +0 -110
- package/dist/acp/text-coalescer.js.map +0 -1
- package/dist/acp/tool-bridge.d.ts +0 -156
- package/dist/acp/tool-bridge.d.ts.map +0 -1
- package/dist/acp/tool-bridge.js +0 -381
- package/dist/acp/tool-bridge.js.map +0 -1
- package/dist/acp/types.d.ts +0 -314
- package/dist/acp/types.d.ts.map +0 -1
- package/dist/acp/types.js +0 -8
- package/dist/acp/types.js.map +0 -1
- package/dist/cli.d.ts +0 -9
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/acp.d.ts +0 -26
- package/dist/commands/acp.d.ts.map +0 -1
- package/dist/commands/acp.js +0 -492
- package/dist/commands/acp.js.map +0 -1
- package/dist/commands/cache.d.ts +0 -33
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/cache.js +0 -537
- package/dist/commands/cache.js.map +0 -1
- package/dist/commands/config.d.ts +0 -10
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -367
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/consent.d.ts +0 -21
- package/dist/commands/consent.d.ts.map +0 -1
- package/dist/commands/consent.js +0 -334
- package/dist/commands/consent.js.map +0 -1
- package/dist/commands/data.d.ts +0 -24
- package/dist/commands/data.d.ts.map +0 -1
- package/dist/commands/data.js +0 -586
- package/dist/commands/data.js.map +0 -1
- package/dist/commands/index.d.ts +0 -145
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -210
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init.d.ts +0 -106
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -349
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -13
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -359
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -20
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -687
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/reset.d.ts +0 -20
- package/dist/commands/reset.d.ts.map +0 -1
- package/dist/commands/reset.js +0 -372
- package/dist/commands/reset.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -74
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -863
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/slash/agents.d.ts +0 -40
- package/dist/commands/slash/agents.d.ts.map +0 -1
- package/dist/commands/slash/agents.js +0 -519
- package/dist/commands/slash/agents.js.map +0 -1
- package/dist/commands/slash/approve.d.ts +0 -46
- package/dist/commands/slash/approve.d.ts.map +0 -1
- package/dist/commands/slash/approve.js +0 -239
- package/dist/commands/slash/approve.js.map +0 -1
- package/dist/commands/slash/attach.d.ts +0 -70
- package/dist/commands/slash/attach.d.ts.map +0 -1
- package/dist/commands/slash/attach.js +0 -333
- package/dist/commands/slash/attach.js.map +0 -1
- package/dist/commands/slash/clear.d.ts +0 -47
- package/dist/commands/slash/clear.d.ts.map +0 -1
- package/dist/commands/slash/clear.js +0 -261
- package/dist/commands/slash/clear.js.map +0 -1
- package/dist/commands/slash/commit.d.ts +0 -40
- package/dist/commands/slash/commit.d.ts.map +0 -1
- package/dist/commands/slash/commit.js +0 -337
- package/dist/commands/slash/commit.js.map +0 -1
- package/dist/commands/slash/compact.d.ts +0 -48
- package/dist/commands/slash/compact.d.ts.map +0 -1
- package/dist/commands/slash/compact.js +0 -288
- package/dist/commands/slash/compact.js.map +0 -1
- package/dist/commands/slash/config.d.ts +0 -20
- package/dist/commands/slash/config.d.ts.map +0 -1
- package/dist/commands/slash/config.js +0 -136
- package/dist/commands/slash/config.js.map +0 -1
- package/dist/commands/slash/context.d.ts +0 -49
- package/dist/commands/slash/context.d.ts.map +0 -1
- package/dist/commands/slash/context.js +0 -430
- package/dist/commands/slash/context.js.map +0 -1
- package/dist/commands/slash/cost.d.ts +0 -34
- package/dist/commands/slash/cost.d.ts.map +0 -1
- package/dist/commands/slash/cost.js +0 -312
- package/dist/commands/slash/cost.js.map +0 -1
- package/dist/commands/slash/custom.d.ts +0 -41
- package/dist/commands/slash/custom.d.ts.map +0 -1
- package/dist/commands/slash/custom.js +0 -126
- package/dist/commands/slash/custom.js.map +0 -1
- package/dist/commands/slash/exit.d.ts +0 -25
- package/dist/commands/slash/exit.d.ts.map +0 -1
- package/dist/commands/slash/exit.js +0 -186
- package/dist/commands/slash/exit.js.map +0 -1
- package/dist/commands/slash/export.d.ts +0 -27
- package/dist/commands/slash/export.d.ts.map +0 -1
- package/dist/commands/slash/export.js +0 -318
- package/dist/commands/slash/export.js.map +0 -1
- package/dist/commands/slash/files.d.ts +0 -47
- package/dist/commands/slash/files.d.ts.map +0 -1
- package/dist/commands/slash/files.js +0 -521
- package/dist/commands/slash/files.js.map +0 -1
- package/dist/commands/slash/help.d.ts +0 -50
- package/dist/commands/slash/help.d.ts.map +0 -1
- package/dist/commands/slash/help.js +0 -282
- package/dist/commands/slash/help.js.map +0 -1
- package/dist/commands/slash/index-cmd.d.ts +0 -41
- package/dist/commands/slash/index-cmd.d.ts.map +0 -1
- package/dist/commands/slash/index-cmd.js +0 -349
- package/dist/commands/slash/index-cmd.js.map +0 -1
- package/dist/commands/slash/index.d.ts +0 -97
- package/dist/commands/slash/index.d.ts.map +0 -1
- package/dist/commands/slash/index.js +0 -251
- package/dist/commands/slash/index.js.map +0 -1
- package/dist/commands/slash/login.d.ts +0 -23
- package/dist/commands/slash/login.d.ts.map +0 -1
- package/dist/commands/slash/login.js +0 -175
- package/dist/commands/slash/login.js.map +0 -1
- package/dist/commands/slash/logout.d.ts +0 -23
- package/dist/commands/slash/logout.d.ts.map +0 -1
- package/dist/commands/slash/logout.js +0 -153
- package/dist/commands/slash/logout.js.map +0 -1
- package/dist/commands/slash/logs.d.ts +0 -29
- package/dist/commands/slash/logs.d.ts.map +0 -1
- package/dist/commands/slash/logs.js +0 -423
- package/dist/commands/slash/logs.js.map +0 -1
- package/dist/commands/slash/mcp.d.ts +0 -29
- package/dist/commands/slash/mcp.d.ts.map +0 -1
- package/dist/commands/slash/mcp.js +0 -1026
- package/dist/commands/slash/mcp.js.map +0 -1
- package/dist/commands/slash/model.d.ts +0 -60
- package/dist/commands/slash/model.d.ts.map +0 -1
- package/dist/commands/slash/model.js +0 -466
- package/dist/commands/slash/model.js.map +0 -1
- package/dist/commands/slash/personality.d.ts +0 -40
- package/dist/commands/slash/personality.d.ts.map +0 -1
- package/dist/commands/slash/personality.js +0 -272
- package/dist/commands/slash/personality.js.map +0 -1
- package/dist/commands/slash/purge.d.ts +0 -42
- package/dist/commands/slash/purge.d.ts.map +0 -1
- package/dist/commands/slash/purge.js +0 -233
- package/dist/commands/slash/purge.js.map +0 -1
- package/dist/commands/slash/reset.d.ts +0 -44
- package/dist/commands/slash/reset.d.ts.map +0 -1
- package/dist/commands/slash/reset.js +0 -326
- package/dist/commands/slash/reset.js.map +0 -1
- package/dist/commands/slash/skills.d.ts +0 -40
- package/dist/commands/slash/skills.d.ts.map +0 -1
- package/dist/commands/slash/skills.js +0 -207
- package/dist/commands/slash/skills.js.map +0 -1
- package/dist/commands/slash/tokens.d.ts +0 -34
- package/dist/commands/slash/tokens.d.ts.map +0 -1
- package/dist/commands/slash/tokens.js +0 -205
- package/dist/commands/slash/tokens.js.map +0 -1
- package/dist/commands/slash/unleash.d.ts +0 -50
- package/dist/commands/slash/unleash.d.ts.map +0 -1
- package/dist/commands/slash/unleash.js +0 -262
- package/dist/commands/slash/unleash.js.map +0 -1
- package/dist/commands/slash/update.d.ts +0 -34
- package/dist/commands/slash/update.d.ts.map +0 -1
- package/dist/commands/slash/update.js +0 -364
- package/dist/commands/slash/update.js.map +0 -1
- package/dist/commands/slash/wrap.d.ts +0 -18
- package/dist/commands/slash/wrap.d.ts.map +0 -1
- package/dist/commands/slash/wrap.js +0 -21
- package/dist/commands/slash/wrap.js.map +0 -1
- package/dist/commands/tokens.d.ts +0 -26
- package/dist/commands/tokens.d.ts.map +0 -1
- package/dist/commands/tokens.js +0 -245
- package/dist/commands/tokens.js.map +0 -1
- package/dist/constants/builtin-agents.d.ts +0 -27
- package/dist/constants/builtin-agents.d.ts.map +0 -1
- package/dist/constants/builtin-agents.js +0 -710
- package/dist/constants/builtin-agents.js.map +0 -1
- package/dist/constants/builtin-skills.d.ts +0 -32
- package/dist/constants/builtin-skills.d.ts.map +0 -1
- package/dist/constants/builtin-skills.js +0 -389
- package/dist/constants/builtin-skills.js.map +0 -1
- package/dist/constants/defaults.d.ts +0 -448
- package/dist/constants/defaults.d.ts.map +0 -1
- package/dist/constants/defaults.js +0 -829
- package/dist/constants/defaults.js.map +0 -1
- package/dist/constants/index.d.ts +0 -27
- package/dist/constants/index.d.ts.map +0 -1
- package/dist/constants/index.js +0 -85
- package/dist/constants/index.js.map +0 -1
- package/dist/constants/install-hints.d.ts +0 -7
- package/dist/constants/install-hints.d.ts.map +0 -1
- package/dist/constants/install-hints.js +0 -123
- package/dist/constants/install-hints.js.map +0 -1
- package/dist/constants/models.d.ts +0 -255
- package/dist/constants/models.d.ts.map +0 -1
- package/dist/constants/models.js +0 -596
- package/dist/constants/models.js.map +0 -1
- package/dist/constants/schedule.d.ts +0 -43
- package/dist/constants/schedule.d.ts.map +0 -1
- package/dist/constants/schedule.js +0 -110
- package/dist/constants/schedule.js.map +0 -1
- package/dist/constants/system-utilities.d.ts +0 -57
- package/dist/constants/system-utilities.d.ts.map +0 -1
- package/dist/constants/system-utilities.js +0 -421
- package/dist/constants/system-utilities.js.map +0 -1
- package/dist/constants/token-limits.d.ts +0 -102
- package/dist/constants/token-limits.d.ts.map +0 -1
- package/dist/constants/token-limits.js +0 -286
- package/dist/constants/token-limits.js.map +0 -1
- package/dist/core/autocomplete.d.ts +0 -132
- package/dist/core/autocomplete.d.ts.map +0 -1
- package/dist/core/autocomplete.js +0 -653
- package/dist/core/autocomplete.js.map +0 -1
- package/dist/core/command-parser.d.ts +0 -301
- package/dist/core/command-parser.d.ts.map +0 -1
- package/dist/core/command-parser.js +0 -526
- package/dist/core/command-parser.js.map +0 -1
- package/dist/core/context-builder.d.ts +0 -264
- package/dist/core/context-builder.d.ts.map +0 -1
- package/dist/core/context-builder.js +0 -1018
- package/dist/core/context-builder.js.map +0 -1
- package/dist/core/event-emitter.d.ts +0 -411
- package/dist/core/event-emitter.d.ts.map +0 -1
- package/dist/core/event-emitter.js +0 -138
- package/dist/core/event-emitter.js.map +0 -1
- package/dist/core/history-manager.d.ts +0 -62
- package/dist/core/history-manager.d.ts.map +0 -1
- package/dist/core/history-manager.js +0 -151
- package/dist/core/history-manager.js.map +0 -1
- package/dist/core/slash-command-handler.d.ts +0 -352
- package/dist/core/slash-command-handler.d.ts.map +0 -1
- package/dist/core/slash-command-handler.js +0 -563
- package/dist/core/slash-command-handler.js.map +0 -1
- package/dist/core/task-processor.d.ts +0 -179
- package/dist/core/task-processor.d.ts.map +0 -1
- package/dist/core/task-processor.js +0 -519
- package/dist/core/task-processor.js.map +0 -1
- package/dist/index.d.ts +0 -90
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/prompts/agent-prompt-generator.d.ts +0 -26
- package/dist/prompts/agent-prompt-generator.d.ts.map +0 -1
- package/dist/prompts/agent-prompt-generator.js +0 -244
- package/dist/prompts/agent-prompt-generator.js.map +0 -1
- package/dist/prompts/commit-message.d.ts +0 -35
- package/dist/prompts/commit-message.d.ts.map +0 -1
- package/dist/prompts/commit-message.js +0 -187
- package/dist/prompts/commit-message.js.map +0 -1
- package/dist/prompts/conversation.d.ts +0 -51
- package/dist/prompts/conversation.d.ts.map +0 -1
- package/dist/prompts/conversation.js +0 -115
- package/dist/prompts/conversation.js.map +0 -1
- package/dist/prompts/index.d.ts +0 -39
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/index.js +0 -74
- package/dist/prompts/index.js.map +0 -1
- package/dist/prompts/memory.d.ts +0 -6
- package/dist/prompts/memory.d.ts.map +0 -1
- package/dist/prompts/memory.js +0 -29
- package/dist/prompts/memory.js.map +0 -1
- package/dist/prompts/personality.d.ts +0 -77
- package/dist/prompts/personality.d.ts.map +0 -1
- package/dist/prompts/personality.js +0 -393
- package/dist/prompts/personality.js.map +0 -1
- package/dist/prompts/plan-generator.d.ts +0 -144
- package/dist/prompts/plan-generator.d.ts.map +0 -1
- package/dist/prompts/plan-generator.js +0 -553
- package/dist/prompts/plan-generator.js.map +0 -1
- package/dist/prompts/system.d.ts +0 -95
- package/dist/prompts/system.d.ts.map +0 -1
- package/dist/prompts/system.js +0 -461
- package/dist/prompts/system.js.map +0 -1
- package/dist/prompts/task-processor.d.ts +0 -94
- package/dist/prompts/task-processor.d.ts.map +0 -1
- package/dist/prompts/task-processor.js +0 -554
- package/dist/prompts/task-processor.js.map +0 -1
- package/dist/prompts/unguarded.d.ts +0 -78
- package/dist/prompts/unguarded.d.ts.map +0 -1
- package/dist/prompts/unguarded.js +0 -418
- package/dist/prompts/unguarded.js.map +0 -1
- package/dist/prompts/utils.d.ts +0 -73
- package/dist/prompts/utils.d.ts.map +0 -1
- package/dist/prompts/utils.js +0 -114
- package/dist/prompts/utils.js.map +0 -1
- package/dist/prompts/workflow.d.ts +0 -241
- package/dist/prompts/workflow.d.ts.map +0 -1
- package/dist/prompts/workflow.js +0 -608
- package/dist/prompts/workflow.js.map +0 -1
- package/dist/services/action-logger.d.ts +0 -383
- package/dist/services/action-logger.d.ts.map +0 -1
- package/dist/services/action-logger.js +0 -544
- package/dist/services/action-logger.js.map +0 -1
- package/dist/services/agent-budget-allocator.d.ts +0 -111
- package/dist/services/agent-budget-allocator.d.ts.map +0 -1
- package/dist/services/agent-budget-allocator.js +0 -278
- package/dist/services/agent-budget-allocator.js.map +0 -1
- package/dist/services/agent-manager.d.ts +0 -181
- package/dist/services/agent-manager.d.ts.map +0 -1
- package/dist/services/agent-manager.js +0 -749
- package/dist/services/agent-manager.js.map +0 -1
- package/dist/services/agent-spawner.d.ts +0 -138
- package/dist/services/agent-spawner.d.ts.map +0 -1
- package/dist/services/agent-spawner.js +0 -748
- package/dist/services/agent-spawner.js.map +0 -1
- package/dist/services/agent-state-service.d.ts +0 -145
- package/dist/services/agent-state-service.d.ts.map +0 -1
- package/dist/services/agent-state-service.js +0 -247
- package/dist/services/agent-state-service.js.map +0 -1
- package/dist/services/anthropic-client.d.ts +0 -357
- package/dist/services/anthropic-client.d.ts.map +0 -1
- package/dist/services/anthropic-client.js +0 -1451
- package/dist/services/anthropic-client.js.map +0 -1
- package/dist/services/approval-manager.d.ts +0 -385
- package/dist/services/approval-manager.d.ts.map +0 -1
- package/dist/services/approval-manager.js +0 -1044
- package/dist/services/approval-manager.js.map +0 -1
- package/dist/services/audit-logger.d.ts +0 -245
- package/dist/services/audit-logger.d.ts.map +0 -1
- package/dist/services/audit-logger.js +0 -324
- package/dist/services/audit-logger.js.map +0 -1
- package/dist/services/backup-manager.d.ts +0 -136
- package/dist/services/backup-manager.d.ts.map +0 -1
- package/dist/services/backup-manager.js +0 -260
- package/dist/services/backup-manager.js.map +0 -1
- package/dist/services/cache-service.d.ts +0 -247
- package/dist/services/cache-service.d.ts.map +0 -1
- package/dist/services/cache-service.js +0 -558
- package/dist/services/cache-service.js.map +0 -1
- package/dist/services/chat-archival-service.d.ts +0 -108
- package/dist/services/chat-archival-service.d.ts.map +0 -1
- package/dist/services/chat-archival-service.js +0 -465
- package/dist/services/chat-archival-service.js.map +0 -1
- package/dist/services/codebase-indexer.d.ts +0 -272
- package/dist/services/codebase-indexer.d.ts.map +0 -1
- package/dist/services/codebase-indexer.js +0 -863
- package/dist/services/codebase-indexer.js.map +0 -1
- package/dist/services/compass-auth-service.d.ts +0 -204
- package/dist/services/compass-auth-service.d.ts.map +0 -1
- package/dist/services/compass-auth-service.js +0 -391
- package/dist/services/compass-auth-service.js.map +0 -1
- package/dist/services/complexity-classifier.d.ts +0 -208
- package/dist/services/complexity-classifier.d.ts.map +0 -1
- package/dist/services/complexity-classifier.js +0 -1410
- package/dist/services/complexity-classifier.js.map +0 -1
- package/dist/services/config-manager.d.ts +0 -278
- package/dist/services/config-manager.d.ts.map +0 -1
- package/dist/services/config-manager.js +0 -651
- package/dist/services/config-manager.js.map +0 -1
- package/dist/services/consent-manager.d.ts +0 -239
- package/dist/services/consent-manager.d.ts.map +0 -1
- package/dist/services/consent-manager.js +0 -516
- package/dist/services/consent-manager.js.map +0 -1
- package/dist/services/conversation-compactor.d.ts +0 -223
- package/dist/services/conversation-compactor.d.ts.map +0 -1
- package/dist/services/conversation-compactor.js +0 -750
- package/dist/services/conversation-compactor.js.map +0 -1
- package/dist/services/cost-tracker.d.ts +0 -167
- package/dist/services/cost-tracker.d.ts.map +0 -1
- package/dist/services/cost-tracker.js +0 -199
- package/dist/services/cost-tracker.js.map +0 -1
- package/dist/services/credential-store.d.ts +0 -273
- package/dist/services/credential-store.d.ts.map +0 -1
- package/dist/services/credential-store.js +0 -877
- package/dist/services/credential-store.js.map +0 -1
- package/dist/services/custom-command-service.d.ts +0 -112
- package/dist/services/custom-command-service.d.ts.map +0 -1
- package/dist/services/custom-command-service.js +0 -464
- package/dist/services/custom-command-service.js.map +0 -1
- package/dist/services/default-statusline-renderer.d.ts +0 -60
- package/dist/services/default-statusline-renderer.d.ts.map +0 -1
- package/dist/services/default-statusline-renderer.js +0 -110
- package/dist/services/default-statusline-renderer.js.map +0 -1
- package/dist/services/enhanced-context-gatherer.d.ts +0 -116
- package/dist/services/enhanced-context-gatherer.d.ts.map +0 -1
- package/dist/services/enhanced-context-gatherer.js +0 -605
- package/dist/services/enhanced-context-gatherer.js.map +0 -1
- package/dist/services/file-hash-tracker.d.ts +0 -95
- package/dist/services/file-hash-tracker.d.ts.map +0 -1
- package/dist/services/file-hash-tracker.js +0 -199
- package/dist/services/file-hash-tracker.js.map +0 -1
- package/dist/services/file-service.d.ts +0 -274
- package/dist/services/file-service.d.ts.map +0 -1
- package/dist/services/file-service.js +0 -876
- package/dist/services/file-service.js.map +0 -1
- package/dist/services/git-service.d.ts +0 -536
- package/dist/services/git-service.d.ts.map +0 -1
- package/dist/services/git-service.js +0 -1215
- package/dist/services/git-service.js.map +0 -1
- package/dist/services/hook-service.d.ts +0 -148
- package/dist/services/hook-service.d.ts.map +0 -1
- package/dist/services/hook-service.js +0 -705
- package/dist/services/hook-service.js.map +0 -1
- package/dist/services/ide-state-service.d.ts +0 -114
- package/dist/services/ide-state-service.d.ts.map +0 -1
- package/dist/services/ide-state-service.js +0 -204
- package/dist/services/ide-state-service.js.map +0 -1
- package/dist/services/interactive-clarifier.d.ts +0 -90
- package/dist/services/interactive-clarifier.d.ts.map +0 -1
- package/dist/services/interactive-clarifier.js +0 -446
- package/dist/services/interactive-clarifier.js.map +0 -1
- package/dist/services/iteration-scoper.d.ts +0 -225
- package/dist/services/iteration-scoper.d.ts.map +0 -1
- package/dist/services/iteration-scoper.js +0 -387
- package/dist/services/iteration-scoper.js.map +0 -1
- package/dist/services/llm-plan-generator.d.ts +0 -44
- package/dist/services/llm-plan-generator.d.ts.map +0 -1
- package/dist/services/llm-plan-generator.js +0 -863
- package/dist/services/llm-plan-generator.js.map +0 -1
- package/dist/services/llm-system-prompt-generator.d.ts +0 -85
- package/dist/services/llm-system-prompt-generator.d.ts.map +0 -1
- package/dist/services/llm-system-prompt-generator.js +0 -257
- package/dist/services/llm-system-prompt-generator.js.map +0 -1
- package/dist/services/log-interpreter.d.ts +0 -190
- package/dist/services/log-interpreter.d.ts.map +0 -1
- package/dist/services/log-interpreter.js +0 -520
- package/dist/services/log-interpreter.js.map +0 -1
- package/dist/services/mcp-config-manager.d.ts +0 -141
- package/dist/services/mcp-config-manager.d.ts.map +0 -1
- package/dist/services/mcp-config-manager.js +0 -678
- package/dist/services/mcp-config-manager.js.map +0 -1
- package/dist/services/mcp-oauth-service.d.ts +0 -170
- package/dist/services/mcp-oauth-service.d.ts.map +0 -1
- package/dist/services/mcp-oauth-service.js +0 -892
- package/dist/services/mcp-oauth-service.js.map +0 -1
- package/dist/services/mcp-plugin-support.d.ts +0 -81
- package/dist/services/mcp-plugin-support.d.ts.map +0 -1
- package/dist/services/mcp-plugin-support.js +0 -305
- package/dist/services/mcp-plugin-support.js.map +0 -1
- package/dist/services/mcp-server-manager.d.ts +0 -134
- package/dist/services/mcp-server-manager.d.ts.map +0 -1
- package/dist/services/mcp-server-manager.js +0 -613
- package/dist/services/mcp-server-manager.js.map +0 -1
- package/dist/services/mcp-tool-integration.d.ts +0 -119
- package/dist/services/mcp-tool-integration.d.ts.map +0 -1
- package/dist/services/mcp-tool-integration.js +0 -381
- package/dist/services/mcp-tool-integration.js.map +0 -1
- package/dist/services/mcp-transport.d.ts +0 -105
- package/dist/services/mcp-transport.d.ts.map +0 -1
- package/dist/services/mcp-transport.js +0 -1316
- package/dist/services/mcp-transport.js.map +0 -1
- package/dist/services/memory-service.d.ts +0 -55
- package/dist/services/memory-service.d.ts.map +0 -1
- package/dist/services/memory-service.js +0 -251
- package/dist/services/memory-service.js.map +0 -1
- package/dist/services/model-availability.d.ts +0 -64
- package/dist/services/model-availability.d.ts.map +0 -1
- package/dist/services/model-availability.js +0 -114
- package/dist/services/model-availability.js.map +0 -1
- package/dist/services/plan-generator.d.ts +0 -98
- package/dist/services/plan-generator.d.ts.map +0 -1
- package/dist/services/plan-generator.js +0 -658
- package/dist/services/plan-generator.js.map +0 -1
- package/dist/services/plan-mode-fallback.d.ts +0 -80
- package/dist/services/plan-mode-fallback.d.ts.map +0 -1
- package/dist/services/plan-mode-fallback.js +0 -307
- package/dist/services/plan-mode-fallback.js.map +0 -1
- package/dist/services/plan-mode-handler.d.ts +0 -42
- package/dist/services/plan-mode-handler.d.ts.map +0 -1
- package/dist/services/plan-mode-handler.js +0 -388
- package/dist/services/plan-mode-handler.js.map +0 -1
- package/dist/services/plan-persistence.d.ts +0 -203
- package/dist/services/plan-persistence.d.ts.map +0 -1
- package/dist/services/plan-persistence.js +0 -538
- package/dist/services/plan-persistence.js.map +0 -1
- package/dist/services/prompt-preprocessor.d.ts +0 -73
- package/dist/services/prompt-preprocessor.d.ts.map +0 -1
- package/dist/services/prompt-preprocessor.js +0 -146
- package/dist/services/prompt-preprocessor.js.map +0 -1
- package/dist/services/rating-service.d.ts +0 -84
- package/dist/services/rating-service.d.ts.map +0 -1
- package/dist/services/rating-service.js +0 -171
- package/dist/services/rating-service.js.map +0 -1
- package/dist/services/rating-state-manager.d.ts +0 -131
- package/dist/services/rating-state-manager.d.ts.map +0 -1
- package/dist/services/rating-state-manager.js +0 -270
- package/dist/services/rating-state-manager.js.map +0 -1
- package/dist/services/sdk-runner.d.ts +0 -113
- package/dist/services/sdk-runner.d.ts.map +0 -1
- package/dist/services/sdk-runner.js +0 -1424
- package/dist/services/sdk-runner.js.map +0 -1
- package/dist/services/session-manager.d.ts +0 -528
- package/dist/services/session-manager.d.ts.map +0 -1
- package/dist/services/session-manager.js +0 -1184
- package/dist/services/session-manager.js.map +0 -1
- package/dist/services/shell-executor.d.ts +0 -337
- package/dist/services/shell-executor.d.ts.map +0 -1
- package/dist/services/shell-executor.js +0 -1201
- package/dist/services/shell-executor.js.map +0 -1
- package/dist/services/skill-service.d.ts +0 -149
- package/dist/services/skill-service.d.ts.map +0 -1
- package/dist/services/skill-service.js +0 -594
- package/dist/services/skill-service.js.map +0 -1
- package/dist/services/statusline-executor.d.ts +0 -102
- package/dist/services/statusline-executor.d.ts.map +0 -1
- package/dist/services/statusline-executor.js +0 -305
- package/dist/services/statusline-executor.js.map +0 -1
- package/dist/services/step-tracker.d.ts +0 -356
- package/dist/services/step-tracker.d.ts.map +0 -1
- package/dist/services/step-tracker.js +0 -634
- package/dist/services/step-tracker.js.map +0 -1
- package/dist/services/system-event-logger.d.ts +0 -473
- package/dist/services/system-event-logger.d.ts.map +0 -1
- package/dist/services/system-event-logger.js +0 -790
- package/dist/services/system-event-logger.js.map +0 -1
- package/dist/services/system-utility-detector.d.ts +0 -91
- package/dist/services/system-utility-detector.d.ts.map +0 -1
- package/dist/services/system-utility-detector.js +0 -238
- package/dist/services/system-utility-detector.js.map +0 -1
- package/dist/services/team-context-store.d.ts +0 -100
- package/dist/services/team-context-store.d.ts.map +0 -1
- package/dist/services/team-context-store.js +0 -513
- package/dist/services/team-context-store.js.map +0 -1
- package/dist/services/temp-file-service.d.ts +0 -164
- package/dist/services/temp-file-service.d.ts.map +0 -1
- package/dist/services/temp-file-service.js +0 -303
- package/dist/services/temp-file-service.js.map +0 -1
- package/dist/services/token-limit-enforcer.d.ts +0 -53
- package/dist/services/token-limit-enforcer.d.ts.map +0 -1
- package/dist/services/token-limit-enforcer.js +0 -90
- package/dist/services/token-limit-enforcer.js.map +0 -1
- package/dist/services/token-limit-store.d.ts +0 -105
- package/dist/services/token-limit-store.d.ts.map +0 -1
- package/dist/services/token-limit-store.js +0 -288
- package/dist/services/token-limit-store.js.map +0 -1
- package/dist/services/token-tracker.d.ts +0 -290
- package/dist/services/token-tracker.d.ts.map +0 -1
- package/dist/services/token-tracker.js +0 -751
- package/dist/services/token-tracker.js.map +0 -1
- package/dist/services/tool-registry.d.ts +0 -302
- package/dist/services/tool-registry.d.ts.map +0 -1
- package/dist/services/tool-registry.js +0 -606
- package/dist/services/tool-registry.js.map +0 -1
- package/dist/services/tools-logger.d.ts +0 -152
- package/dist/services/tools-logger.d.ts.map +0 -1
- package/dist/services/tools-logger.js +0 -222
- package/dist/services/tools-logger.js.map +0 -1
- package/dist/services/update-plan-handler.d.ts +0 -56
- package/dist/services/update-plan-handler.d.ts.map +0 -1
- package/dist/services/update-plan-handler.js +0 -372
- package/dist/services/update-plan-handler.js.map +0 -1
- package/dist/services/update-service.d.ts +0 -197
- package/dist/services/update-service.d.ts.map +0 -1
- package/dist/services/update-service.js +0 -749
- package/dist/services/update-service.js.map +0 -1
- package/dist/services/verifier.d.ts +0 -113
- package/dist/services/verifier.d.ts.map +0 -1
- package/dist/services/verifier.js +0 -541
- package/dist/services/verifier.js.map +0 -1
- package/dist/services/workflow-manager.d.ts +0 -277
- package/dist/services/workflow-manager.d.ts.map +0 -1
- package/dist/services/workflow-manager.js +0 -616
- package/dist/services/workflow-manager.js.map +0 -1
- package/dist/services/workflow-orchestrator.d.ts +0 -148
- package/dist/services/workflow-orchestrator.d.ts.map +0 -1
- package/dist/services/workflow-orchestrator.js +0 -617
- package/dist/services/workflow-orchestrator.js.map +0 -1
- package/dist/services/worktree-manager.d.ts +0 -36
- package/dist/services/worktree-manager.d.ts.map +0 -1
- package/dist/services/worktree-manager.js +0 -185
- package/dist/services/worktree-manager.js.map +0 -1
- package/dist/templates/ascii-art.d.ts +0 -136
- package/dist/templates/ascii-art.d.ts.map +0 -1
- package/dist/templates/ascii-art.js +0 -286
- package/dist/templates/ascii-art.js.map +0 -1
- package/dist/templates/help.d.ts +0 -186
- package/dist/templates/help.d.ts.map +0 -1
- package/dist/templates/help.js +0 -588
- package/dist/templates/help.js.map +0 -1
- package/dist/templates/prompts/workflow-prompts.d.ts +0 -9
- package/dist/templates/prompts/workflow-prompts.d.ts.map +0 -1
- package/dist/templates/prompts/workflow-prompts.js +0 -9
- package/dist/templates/prompts/workflow-prompts.js.map +0 -1
- package/dist/tools/agent-tools.d.ts +0 -9
- package/dist/tools/agent-tools.d.ts.map +0 -1
- package/dist/tools/agent-tools.js +0 -349
- package/dist/tools/agent-tools.js.map +0 -1
- package/dist/tools/edit-replacers.d.ts +0 -90
- package/dist/tools/edit-replacers.d.ts.map +0 -1
- package/dist/tools/edit-replacers.js +0 -553
- package/dist/tools/edit-replacers.js.map +0 -1
- package/dist/tools/file-tools.d.ts +0 -13
- package/dist/tools/file-tools.d.ts.map +0 -1
- package/dist/tools/file-tools.js +0 -954
- package/dist/tools/file-tools.js.map +0 -1
- package/dist/tools/git-tools.d.ts +0 -9
- package/dist/tools/git-tools.d.ts.map +0 -1
- package/dist/tools/git-tools.js +0 -261
- package/dist/tools/git-tools.js.map +0 -1
- package/dist/tools/index.d.ts +0 -13
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -70
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/network-tools.d.ts +0 -8
- package/dist/tools/network-tools.d.ts.map +0 -1
- package/dist/tools/network-tools.js +0 -261
- package/dist/tools/network-tools.js.map +0 -1
- package/dist/tools/openai-tools.d.ts +0 -16
- package/dist/tools/openai-tools.d.ts.map +0 -1
- package/dist/tools/openai-tools.js +0 -385
- package/dist/tools/openai-tools.js.map +0 -1
- package/dist/tools/plan-tools.d.ts +0 -9
- package/dist/tools/plan-tools.d.ts.map +0 -1
- package/dist/tools/plan-tools.js +0 -223
- package/dist/tools/plan-tools.js.map +0 -1
- package/dist/tools/schedule-tools.d.ts +0 -9
- package/dist/tools/schedule-tools.d.ts.map +0 -1
- package/dist/tools/schedule-tools.js +0 -405
- package/dist/tools/schedule-tools.js.map +0 -1
- package/dist/tools/search-tools.d.ts +0 -8
- package/dist/tools/search-tools.d.ts.map +0 -1
- package/dist/tools/search-tools.js +0 -357
- package/dist/tools/search-tools.js.map +0 -1
- package/dist/tools/shared-utils.d.ts +0 -91
- package/dist/tools/shared-utils.d.ts.map +0 -1
- package/dist/tools/shared-utils.js +0 -385
- package/dist/tools/shared-utils.js.map +0 -1
- package/dist/tools/shell-tools.d.ts +0 -9
- package/dist/tools/shell-tools.d.ts.map +0 -1
- package/dist/tools/shell-tools.js +0 -409
- package/dist/tools/shell-tools.js.map +0 -1
- package/dist/tools/skill-tools.d.ts +0 -13
- package/dist/tools/skill-tools.d.ts.map +0 -1
- package/dist/tools/skill-tools.js +0 -244
- package/dist/tools/skill-tools.js.map +0 -1
- package/dist/tools/swarm-tools.d.ts +0 -9
- package/dist/tools/swarm-tools.d.ts.map +0 -1
- package/dist/tools/swarm-tools.js +0 -422
- package/dist/tools/swarm-tools.js.map +0 -1
- package/dist/tools/user-tools.d.ts +0 -13
- package/dist/tools/user-tools.d.ts.map +0 -1
- package/dist/tools/user-tools.js +0 -232
- package/dist/tools/user-tools.js.map +0 -1
- package/dist/types/agent-process.d.ts +0 -244
- package/dist/types/agent-process.d.ts.map +0 -1
- package/dist/types/agent-process.js +0 -93
- package/dist/types/agent-process.js.map +0 -1
- package/dist/types/agent.d.ts +0 -358
- package/dist/types/agent.d.ts.map +0 -1
- package/dist/types/agent.js +0 -171
- package/dist/types/agent.js.map +0 -1
- package/dist/types/anthropic.d.ts +0 -438
- package/dist/types/anthropic.d.ts.map +0 -1
- package/dist/types/anthropic.js +0 -9
- package/dist/types/anthropic.js.map +0 -1
- package/dist/types/approval.d.ts +0 -332
- package/dist/types/approval.d.ts.map +0 -1
- package/dist/types/approval.js +0 -44
- package/dist/types/approval.js.map +0 -1
- package/dist/types/autocomplete.d.ts +0 -57
- package/dist/types/autocomplete.d.ts.map +0 -1
- package/dist/types/autocomplete.js +0 -7
- package/dist/types/autocomplete.js.map +0 -1
- package/dist/types/chat-archive.d.ts +0 -161
- package/dist/types/chat-archive.d.ts.map +0 -1
- package/dist/types/chat-archive.js +0 -36
- package/dist/types/chat-archive.js.map +0 -1
- package/dist/types/config.d.ts +0 -268
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js +0 -188
- package/dist/types/config.js.map +0 -1
- package/dist/types/consent.d.ts +0 -191
- package/dist/types/consent.d.ts.map +0 -1
- package/dist/types/consent.js +0 -119
- package/dist/types/consent.js.map +0 -1
- package/dist/types/custom-command.d.ts +0 -139
- package/dist/types/custom-command.d.ts.map +0 -1
- package/dist/types/custom-command.js +0 -7
- package/dist/types/custom-command.js.map +0 -1
- package/dist/types/git.d.ts +0 -20
- package/dist/types/git.d.ts.map +0 -1
- package/dist/types/git.js +0 -2
- package/dist/types/git.js.map +0 -1
- package/dist/types/hook.d.ts +0 -342
- package/dist/types/hook.d.ts.map +0 -1
- package/dist/types/hook.js +0 -84
- package/dist/types/hook.js.map +0 -1
- package/dist/types/index.d.ts +0 -86
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -71
- package/dist/types/index.js.map +0 -1
- package/dist/types/mcp.d.ts +0 -456
- package/dist/types/mcp.d.ts.map +0 -1
- package/dist/types/mcp.js +0 -94
- package/dist/types/mcp.js.map +0 -1
- package/dist/types/rating.d.ts +0 -110
- package/dist/types/rating.d.ts.map +0 -1
- package/dist/types/rating.js +0 -53
- package/dist/types/rating.js.map +0 -1
- package/dist/types/schedule.d.ts +0 -91
- package/dist/types/schedule.d.ts.map +0 -1
- package/dist/types/schedule.js +0 -8
- package/dist/types/schedule.js.map +0 -1
- package/dist/types/session.d.ts +0 -361
- package/dist/types/session.d.ts.map +0 -1
- package/dist/types/session.js +0 -9
- package/dist/types/session.js.map +0 -1
- package/dist/types/skill.d.ts +0 -258
- package/dist/types/skill.d.ts.map +0 -1
- package/dist/types/skill.js +0 -79
- package/dist/types/skill.js.map +0 -1
- package/dist/types/statusline.d.ts +0 -212
- package/dist/types/statusline.d.ts.map +0 -1
- package/dist/types/statusline.js +0 -8
- package/dist/types/statusline.js.map +0 -1
- package/dist/types/stream.d.ts +0 -61
- package/dist/types/stream.d.ts.map +0 -1
- package/dist/types/stream.js +0 -17
- package/dist/types/stream.js.map +0 -1
- package/dist/types/swarm.d.ts +0 -132
- package/dist/types/swarm.d.ts.map +0 -1
- package/dist/types/swarm.js +0 -21
- package/dist/types/swarm.js.map +0 -1
- package/dist/types/token-limits.d.ts +0 -107
- package/dist/types/token-limits.d.ts.map +0 -1
- package/dist/types/token-limits.js +0 -57
- package/dist/types/token-limits.js.map +0 -1
- package/dist/types/token.d.ts +0 -329
- package/dist/types/token.d.ts.map +0 -1
- package/dist/types/token.js +0 -9
- package/dist/types/token.js.map +0 -1
- package/dist/types/update.d.ts +0 -189
- package/dist/types/update.d.ts.map +0 -1
- package/dist/types/update.js +0 -55
- package/dist/types/update.js.map +0 -1
- package/dist/types/workflow.d.ts +0 -396
- package/dist/types/workflow.d.ts.map +0 -1
- package/dist/types/workflow.js +0 -46
- package/dist/types/workflow.js.map +0 -1
- package/dist/ui/App.d.ts +0 -62
- package/dist/ui/App.d.ts.map +0 -1
- package/dist/ui/App.js +0 -511
- package/dist/ui/App.js.map +0 -1
- package/dist/ui/InteractiveSession.d.ts +0 -34
- package/dist/ui/InteractiveSession.d.ts.map +0 -1
- package/dist/ui/InteractiveSession.js +0 -3611
- package/dist/ui/InteractiveSession.js.map +0 -1
- package/dist/ui/MCPApprovalPrompt.d.ts +0 -27
- package/dist/ui/MCPApprovalPrompt.d.ts.map +0 -1
- package/dist/ui/MCPApprovalPrompt.js +0 -51
- package/dist/ui/MCPApprovalPrompt.js.map +0 -1
- package/dist/ui/SetupWizard.d.ts +0 -26
- package/dist/ui/SetupWizard.d.ts.map +0 -1
- package/dist/ui/SetupWizard.js +0 -396
- package/dist/ui/SetupWizard.js.map +0 -1
- package/dist/ui/components/AgentCreationWizard.d.ts +0 -36
- package/dist/ui/components/AgentCreationWizard.d.ts.map +0 -1
- package/dist/ui/components/AgentCreationWizard.js +0 -619
- package/dist/ui/components/AgentCreationWizard.js.map +0 -1
- package/dist/ui/components/AgentManager.d.ts +0 -41
- package/dist/ui/components/AgentManager.d.ts.map +0 -1
- package/dist/ui/components/AgentManager.js +0 -343
- package/dist/ui/components/AgentManager.js.map +0 -1
- package/dist/ui/components/ApprovalDialog.d.ts +0 -18
- package/dist/ui/components/ApprovalDialog.d.ts.map +0 -1
- package/dist/ui/components/ApprovalDialog.js +0 -439
- package/dist/ui/components/ApprovalDialog.js.map +0 -1
- package/dist/ui/components/AsciiArt.d.ts +0 -54
- package/dist/ui/components/AsciiArt.d.ts.map +0 -1
- package/dist/ui/components/AsciiArt.js +0 -89
- package/dist/ui/components/AsciiArt.js.map +0 -1
- package/dist/ui/components/ClarificationWizard.d.ts +0 -36
- package/dist/ui/components/ClarificationWizard.d.ts.map +0 -1
- package/dist/ui/components/ClarificationWizard.js +0 -407
- package/dist/ui/components/ClarificationWizard.js.map +0 -1
- package/dist/ui/components/CompassSpinner.d.ts +0 -15
- package/dist/ui/components/CompassSpinner.d.ts.map +0 -1
- package/dist/ui/components/CompassSpinner.js +0 -50
- package/dist/ui/components/CompassSpinner.js.map +0 -1
- package/dist/ui/components/ConfirmationSelector.d.ts +0 -45
- package/dist/ui/components/ConfirmationSelector.d.ts.map +0 -1
- package/dist/ui/components/ConfirmationSelector.js +0 -106
- package/dist/ui/components/ConfirmationSelector.js.map +0 -1
- package/dist/ui/components/ContextUsage.d.ts +0 -76
- package/dist/ui/components/ContextUsage.d.ts.map +0 -1
- package/dist/ui/components/ContextUsage.js +0 -188
- package/dist/ui/components/ContextUsage.js.map +0 -1
- package/dist/ui/components/DiffPreview.d.ts +0 -13
- package/dist/ui/components/DiffPreview.d.ts.map +0 -1
- package/dist/ui/components/DiffPreview.js +0 -30
- package/dist/ui/components/DiffPreview.js.map +0 -1
- package/dist/ui/components/ExecutionModeSelector.d.ts +0 -45
- package/dist/ui/components/ExecutionModeSelector.d.ts.map +0 -1
- package/dist/ui/components/ExecutionModeSelector.js +0 -120
- package/dist/ui/components/ExecutionModeSelector.js.map +0 -1
- package/dist/ui/components/FileTree.d.ts +0 -47
- package/dist/ui/components/FileTree.d.ts.map +0 -1
- package/dist/ui/components/FileTree.js +0 -258
- package/dist/ui/components/FileTree.js.map +0 -1
- package/dist/ui/components/HelpMenu.d.ts +0 -49
- package/dist/ui/components/HelpMenu.d.ts.map +0 -1
- package/dist/ui/components/HelpMenu.js +0 -91
- package/dist/ui/components/HelpMenu.js.map +0 -1
- package/dist/ui/components/InterleavedStream.d.ts +0 -42
- package/dist/ui/components/InterleavedStream.d.ts.map +0 -1
- package/dist/ui/components/InterleavedStream.js +0 -1500
- package/dist/ui/components/InterleavedStream.js.map +0 -1
- package/dist/ui/components/ModelSelector.d.ts +0 -81
- package/dist/ui/components/ModelSelector.d.ts.map +0 -1
- package/dist/ui/components/ModelSelector.js +0 -305
- package/dist/ui/components/ModelSelector.js.map +0 -1
- package/dist/ui/components/PlanApprovalDialog.d.ts +0 -21
- package/dist/ui/components/PlanApprovalDialog.d.ts.map +0 -1
- package/dist/ui/components/PlanApprovalDialog.js +0 -189
- package/dist/ui/components/PlanApprovalDialog.js.map +0 -1
- package/dist/ui/components/PlanExecutionTracker.d.ts +0 -53
- package/dist/ui/components/PlanExecutionTracker.d.ts.map +0 -1
- package/dist/ui/components/PlanExecutionTracker.js +0 -113
- package/dist/ui/components/PlanExecutionTracker.js.map +0 -1
- package/dist/ui/components/ProgressIndicator.d.ts +0 -151
- package/dist/ui/components/ProgressIndicator.d.ts.map +0 -1
- package/dist/ui/components/ProgressIndicator.js +0 -171
- package/dist/ui/components/ProgressIndicator.js.map +0 -1
- package/dist/ui/components/Prompt.d.ts +0 -47
- package/dist/ui/components/Prompt.d.ts.map +0 -1
- package/dist/ui/components/Prompt.js +0 -632
- package/dist/ui/components/Prompt.js.map +0 -1
- package/dist/ui/components/RatingPanel.d.ts +0 -45
- package/dist/ui/components/RatingPanel.d.ts.map +0 -1
- package/dist/ui/components/RatingPanel.js +0 -119
- package/dist/ui/components/RatingPanel.js.map +0 -1
- package/dist/ui/components/StatusLine.d.ts +0 -43
- package/dist/ui/components/StatusLine.d.ts.map +0 -1
- package/dist/ui/components/StatusLine.js +0 -44
- package/dist/ui/components/StatusLine.js.map +0 -1
- package/dist/ui/components/StreamingResponse.d.ts +0 -45
- package/dist/ui/components/StreamingResponse.d.ts.map +0 -1
- package/dist/ui/components/StreamingResponse.js +0 -56
- package/dist/ui/components/StreamingResponse.js.map +0 -1
- package/dist/ui/components/TokenUsage.d.ts +0 -89
- package/dist/ui/components/TokenUsage.d.ts.map +0 -1
- package/dist/ui/components/TokenUsage.js +0 -99
- package/dist/ui/components/TokenUsage.js.map +0 -1
- package/dist/ui/components/ToolSummary.d.ts +0 -77
- package/dist/ui/components/ToolSummary.d.ts.map +0 -1
- package/dist/ui/components/ToolSummary.js +0 -162
- package/dist/ui/components/ToolSummary.js.map +0 -1
- package/dist/ui/components/UpdateNotification.d.ts +0 -65
- package/dist/ui/components/UpdateNotification.d.ts.map +0 -1
- package/dist/ui/components/UpdateNotification.js +0 -166
- package/dist/ui/components/UpdateNotification.js.map +0 -1
- package/dist/ui/diff-renderer.d.ts +0 -18
- package/dist/ui/diff-renderer.d.ts.map +0 -1
- package/dist/ui/diff-renderer.js +0 -206
- package/dist/ui/diff-renderer.js.map +0 -1
- package/dist/ui/themes/markdown-theme.d.ts +0 -48
- package/dist/ui/themes/markdown-theme.d.ts.map +0 -1
- package/dist/ui/themes/markdown-theme.js +0 -79
- package/dist/ui/themes/markdown-theme.js.map +0 -1
- package/dist/ui/themes/ui-theme.d.ts +0 -301
- package/dist/ui/themes/ui-theme.d.ts.map +0 -1
- package/dist/ui/themes/ui-theme.js +0 -204
- package/dist/ui/themes/ui-theme.js.map +0 -1
- package/dist/utils/attachment-handler.d.ts +0 -129
- package/dist/utils/attachment-handler.d.ts.map +0 -1
- package/dist/utils/attachment-handler.js +0 -280
- package/dist/utils/attachment-handler.js.map +0 -1
- package/dist/utils/backup-cleanup.d.ts +0 -28
- package/dist/utils/backup-cleanup.d.ts.map +0 -1
- package/dist/utils/backup-cleanup.js +0 -99
- package/dist/utils/backup-cleanup.js.map +0 -1
- package/dist/utils/clipboard-handler.d.ts +0 -82
- package/dist/utils/clipboard-handler.d.ts.map +0 -1
- package/dist/utils/clipboard-handler.js +0 -311
- package/dist/utils/clipboard-handler.js.map +0 -1
- package/dist/utils/cloud-detection.d.ts +0 -14
- package/dist/utils/cloud-detection.d.ts.map +0 -1
- package/dist/utils/cloud-detection.js +0 -92
- package/dist/utils/cloud-detection.js.map +0 -1
- package/dist/utils/command-parser.d.ts +0 -56
- package/dist/utils/command-parser.d.ts.map +0 -1
- package/dist/utils/command-parser.js +0 -206
- package/dist/utils/command-parser.js.map +0 -1
- package/dist/utils/console-capture.d.ts +0 -30
- package/dist/utils/console-capture.d.ts.map +0 -1
- package/dist/utils/console-capture.js +0 -88
- package/dist/utils/console-capture.js.map +0 -1
- package/dist/utils/cron-parser.d.ts +0 -52
- package/dist/utils/cron-parser.d.ts.map +0 -1
- package/dist/utils/cron-parser.js +0 -455
- package/dist/utils/cron-parser.js.map +0 -1
- package/dist/utils/crypto.d.ts +0 -351
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js +0 -615
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/diff.d.ts +0 -311
- package/dist/utils/diff.d.ts.map +0 -1
- package/dist/utils/diff.js +0 -566
- package/dist/utils/diff.js.map +0 -1
- package/dist/utils/editor.d.ts +0 -12
- package/dist/utils/editor.d.ts.map +0 -1
- package/dist/utils/editor.js +0 -30
- package/dist/utils/editor.js.map +0 -1
- package/dist/utils/file-system.d.ts +0 -512
- package/dist/utils/file-system.d.ts.map +0 -1
- package/dist/utils/file-system.js +0 -798
- package/dist/utils/file-system.js.map +0 -1
- package/dist/utils/format.d.ts +0 -318
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/format.js +0 -587
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/ignore-patterns.d.ts +0 -93
- package/dist/utils/ignore-patterns.d.ts.map +0 -1
- package/dist/utils/ignore-patterns.js +0 -710
- package/dist/utils/ignore-patterns.js.map +0 -1
- package/dist/utils/log-cleanup.d.ts +0 -16
- package/dist/utils/log-cleanup.d.ts.map +0 -1
- package/dist/utils/log-cleanup.js +0 -51
- package/dist/utils/log-cleanup.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -305
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -447
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/path.d.ts +0 -406
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/path.js +0 -549
- package/dist/utils/path.js.map +0 -1
- package/dist/utils/schedule-file.d.ts +0 -63
- package/dist/utils/schedule-file.d.ts.map +0 -1
- package/dist/utils/schedule-file.js +0 -244
- package/dist/utils/schedule-file.js.map +0 -1
- package/dist/utils/task-id.d.ts +0 -29
- package/dist/utils/task-id.d.ts.map +0 -1
- package/dist/utils/task-id.js +0 -53
- package/dist/utils/task-id.js.map +0 -1
- package/dist/utils/temp-cleanup.d.ts +0 -46
- package/dist/utils/temp-cleanup.d.ts.map +0 -1
- package/dist/utils/temp-cleanup.js +0 -95
- package/dist/utils/temp-cleanup.js.map +0 -1
- package/dist/utils/terminal-output.d.ts +0 -34
- package/dist/utils/terminal-output.d.ts.map +0 -1
- package/dist/utils/terminal-output.js +0 -40
- package/dist/utils/terminal-output.js.map +0 -1
- package/dist/utils/token-counter.d.ts +0 -224
- package/dist/utils/token-counter.d.ts.map +0 -1
- package/dist/utils/token-counter.js +0 -332
- package/dist/utils/token-counter.js.map +0 -1
- package/dist/utils/tool-mapper.d.ts +0 -70
- package/dist/utils/tool-mapper.d.ts.map +0 -1
- package/dist/utils/tool-mapper.js +0 -234
- package/dist/utils/tool-mapper.js.map +0 -1
|
@@ -1,1215 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Git integration service using simple-git
|
|
3
|
-
*
|
|
4
|
-
* This module provides comprehensive Git operations for the Compass CLI,
|
|
5
|
-
* including commits, branches, diffs, conflict detection, and intelligent
|
|
6
|
-
* commit message generation. It wraps the simple-git library to provide
|
|
7
|
-
* a clean, promise-based API for all Git operations.
|
|
8
|
-
*/
|
|
9
|
-
import { simpleGit } from 'simple-git';
|
|
10
|
-
import path from 'path';
|
|
11
|
-
import fs from 'fs/promises';
|
|
12
|
-
import { logger } from '../utils/logger.js';
|
|
13
|
-
import { getSystemEventLogger } from './system-event-logger.js';
|
|
14
|
-
import { createIgnoreInstance } from '../utils/ignore-patterns.js';
|
|
15
|
-
/**
|
|
16
|
-
* GitService class provides comprehensive Git operations for the Compass CLI.
|
|
17
|
-
* It wraps simple-git to provide a clean, typed API for all Git operations
|
|
18
|
-
* including commits, branches, diffs, conflict detection, and more.
|
|
19
|
-
*/
|
|
20
|
-
class GitService {
|
|
21
|
-
git;
|
|
22
|
-
projectRoot;
|
|
23
|
-
constructor(projectRoot) {
|
|
24
|
-
this.projectRoot = projectRoot || process.cwd();
|
|
25
|
-
const options = {
|
|
26
|
-
baseDir: this.projectRoot,
|
|
27
|
-
binary: 'git',
|
|
28
|
-
maxConcurrentProcesses: 6,
|
|
29
|
-
trimmed: true,
|
|
30
|
-
};
|
|
31
|
-
// Call simpleGit as a function with options
|
|
32
|
-
this.git = simpleGit(options);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Initializes the Git service and verifies the repository
|
|
36
|
-
*/
|
|
37
|
-
async initialize() {
|
|
38
|
-
try {
|
|
39
|
-
const isRepo = await this.isGitRepo();
|
|
40
|
-
if (!isRepo) {
|
|
41
|
-
logger.warn('Not a Git repository');
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
logger.debug('Git service initialized');
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
logger.error('Failed to initialize Git service', error);
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Checks if the directory is a Git repository
|
|
54
|
-
*/
|
|
55
|
-
async isGitRepo() {
|
|
56
|
-
try {
|
|
57
|
-
await this.git.status();
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Initializes a new Git repository
|
|
66
|
-
*/
|
|
67
|
-
async initRepo(bare = false) {
|
|
68
|
-
await this.git.init(bare);
|
|
69
|
-
logger.info(`Initialized ${bare ? 'bare ' : ''}Git repository in ${this.projectRoot}`);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Gets the current Git status
|
|
73
|
-
*/
|
|
74
|
-
async getStatus() {
|
|
75
|
-
try {
|
|
76
|
-
const status = await this.git.status();
|
|
77
|
-
const staged = status.staged.map((file) => ({
|
|
78
|
-
path: file,
|
|
79
|
-
index: 'A',
|
|
80
|
-
workingDir: ' ',
|
|
81
|
-
staged: true,
|
|
82
|
-
modified: false,
|
|
83
|
-
isNew: true,
|
|
84
|
-
deleted: false,
|
|
85
|
-
conflicted: false,
|
|
86
|
-
}));
|
|
87
|
-
// Add modified staged files
|
|
88
|
-
for (const file of status.modified) {
|
|
89
|
-
if (status.staged.includes(file)) {
|
|
90
|
-
const existing = staged.find((s) => s.path === file);
|
|
91
|
-
if (existing) {
|
|
92
|
-
existing.index = 'M';
|
|
93
|
-
existing.modified = true;
|
|
94
|
-
existing.isNew = false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
const modified = status.modified
|
|
99
|
-
.filter((file) => !status.staged.includes(file))
|
|
100
|
-
.map((file) => ({
|
|
101
|
-
path: file,
|
|
102
|
-
index: ' ',
|
|
103
|
-
workingDir: 'M',
|
|
104
|
-
staged: false,
|
|
105
|
-
modified: true,
|
|
106
|
-
isNew: false,
|
|
107
|
-
deleted: false,
|
|
108
|
-
conflicted: false,
|
|
109
|
-
}));
|
|
110
|
-
// Add deleted files
|
|
111
|
-
for (const file of status.deleted) {
|
|
112
|
-
const fileStatus = {
|
|
113
|
-
path: file,
|
|
114
|
-
index: status.staged.includes(file) ? 'D' : ' ',
|
|
115
|
-
workingDir: status.staged.includes(file) ? ' ' : 'D',
|
|
116
|
-
staged: status.staged.includes(file),
|
|
117
|
-
modified: false,
|
|
118
|
-
isNew: false,
|
|
119
|
-
deleted: true,
|
|
120
|
-
conflicted: false,
|
|
121
|
-
};
|
|
122
|
-
if (fileStatus.staged) {
|
|
123
|
-
staged.push(fileStatus);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
modified.push(fileStatus);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
branch: status.current || 'HEAD',
|
|
131
|
-
tracking: status.tracking || null,
|
|
132
|
-
ahead: status.ahead,
|
|
133
|
-
behind: status.behind,
|
|
134
|
-
staged,
|
|
135
|
-
modified,
|
|
136
|
-
untracked: status.not_added,
|
|
137
|
-
conflicted: status.conflicted,
|
|
138
|
-
isClean: status.isClean(),
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
logger.debug(`Git status failed, attempting .gitignore fallback: ${error}`);
|
|
143
|
-
return this.getStatusWithGitignoreFallback();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Gets the current branch name
|
|
148
|
-
*/
|
|
149
|
-
async getCurrentBranch() {
|
|
150
|
-
const status = await this.git.status();
|
|
151
|
-
return status.current || 'HEAD';
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Gets the diff for staged changes
|
|
155
|
-
*/
|
|
156
|
-
async getStagedDiff(options = {}) {
|
|
157
|
-
const args = ['--cached'];
|
|
158
|
-
if (options.context !== undefined) {
|
|
159
|
-
args.push(`-U${options.context}`);
|
|
160
|
-
}
|
|
161
|
-
if (options.ignoreWhitespace) {
|
|
162
|
-
args.push('-w');
|
|
163
|
-
}
|
|
164
|
-
if (options.wordDiff) {
|
|
165
|
-
args.push('--word-diff');
|
|
166
|
-
}
|
|
167
|
-
return this.git.diff(args);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Gets the diff for unstaged changes
|
|
171
|
-
*/
|
|
172
|
-
async getUnstagedDiff(options = {}) {
|
|
173
|
-
const args = [];
|
|
174
|
-
if (options.context !== undefined) {
|
|
175
|
-
args.push(`-U${options.context}`);
|
|
176
|
-
}
|
|
177
|
-
if (options.ignoreWhitespace) {
|
|
178
|
-
args.push('-w');
|
|
179
|
-
}
|
|
180
|
-
if (options.wordDiff) {
|
|
181
|
-
args.push('--word-diff');
|
|
182
|
-
}
|
|
183
|
-
return this.git.diff(args);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Gets the diff for a specific file
|
|
187
|
-
*/
|
|
188
|
-
async getFileDiff(filePath, options = {}) {
|
|
189
|
-
const args = [];
|
|
190
|
-
if (options.context !== undefined) {
|
|
191
|
-
args.push(`-U${options.context}`);
|
|
192
|
-
}
|
|
193
|
-
if (options.ignoreWhitespace) {
|
|
194
|
-
args.push('-w');
|
|
195
|
-
}
|
|
196
|
-
if (options.commit) {
|
|
197
|
-
args.push(options.commit);
|
|
198
|
-
}
|
|
199
|
-
args.push('--', filePath);
|
|
200
|
-
return this.git.diff(args);
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Gets the diff between two commits
|
|
204
|
-
*/
|
|
205
|
-
async getDiffBetweenCommits(fromCommit, toCommit, options = {}) {
|
|
206
|
-
const args = [];
|
|
207
|
-
if (options.context !== undefined) {
|
|
208
|
-
args.push(`-U${options.context}`);
|
|
209
|
-
}
|
|
210
|
-
if (options.ignoreWhitespace) {
|
|
211
|
-
args.push('-w');
|
|
212
|
-
}
|
|
213
|
-
args.push(fromCommit, toCommit);
|
|
214
|
-
return this.git.diff(args);
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Stages files for commit
|
|
218
|
-
*/
|
|
219
|
-
async stage(files) {
|
|
220
|
-
const fileList = Array.isArray(files) ? files : [files];
|
|
221
|
-
await this.git.add(fileList);
|
|
222
|
-
logger.debug(`Staged: ${fileList.join(', ')}`);
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Stages all changes
|
|
226
|
-
*/
|
|
227
|
-
async stageAll() {
|
|
228
|
-
await this.git.add('.');
|
|
229
|
-
logger.debug('Staged all changes');
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Unstages files
|
|
233
|
-
*/
|
|
234
|
-
async unstage(files) {
|
|
235
|
-
const fileList = Array.isArray(files) ? files : [files];
|
|
236
|
-
await this.git.reset(['HEAD', '--', ...fileList]);
|
|
237
|
-
logger.debug(`Unstaged: ${fileList.join(', ')}`);
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Unstages all files
|
|
241
|
-
*/
|
|
242
|
-
async unstageAll() {
|
|
243
|
-
await this.git.reset(['HEAD']);
|
|
244
|
-
logger.debug('Unstaged all files');
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Commits staged changes
|
|
248
|
-
*/
|
|
249
|
-
async commit(message, options = {}) {
|
|
250
|
-
const startTime = Date.now();
|
|
251
|
-
const isMultiLine = message.includes('\n');
|
|
252
|
-
let tempFilePath = null;
|
|
253
|
-
try {
|
|
254
|
-
if (isMultiLine) {
|
|
255
|
-
const repoRoot = await this.getRepoRoot();
|
|
256
|
-
tempFilePath = path.join(repoRoot, '.git', 'COMMIT_EDITMSG_TEMP');
|
|
257
|
-
await fs.writeFile(tempFilePath, message, 'utf8');
|
|
258
|
-
const commitArgs = ['-F', tempFilePath];
|
|
259
|
-
if (options.amend) {
|
|
260
|
-
commitArgs.push('--amend');
|
|
261
|
-
}
|
|
262
|
-
if (options.allowEmpty) {
|
|
263
|
-
commitArgs.push('--allow-empty');
|
|
264
|
-
}
|
|
265
|
-
if (options.noVerify) {
|
|
266
|
-
commitArgs.push('--no-verify');
|
|
267
|
-
}
|
|
268
|
-
if (options.author) {
|
|
269
|
-
commitArgs.push(`--author=${options.author}`);
|
|
270
|
-
}
|
|
271
|
-
const result = await this.git.raw(['commit', ...commitArgs]);
|
|
272
|
-
const hashMatch = result.match(/\[.+?\s+([a-f0-9]+)\]/);
|
|
273
|
-
const commitHash = hashMatch ? hashMatch[1] : 'unknown';
|
|
274
|
-
logger.info(`Committed: ${commitHash}`);
|
|
275
|
-
const systemEventLogger = getSystemEventLogger();
|
|
276
|
-
await systemEventLogger.logGitOperation({
|
|
277
|
-
operation: 'commit',
|
|
278
|
-
branch: await this.getCurrentBranch(),
|
|
279
|
-
success: true,
|
|
280
|
-
duration_ms: Date.now() - startTime,
|
|
281
|
-
details: { hash: commitHash, amend: options.amend, multiLine: true },
|
|
282
|
-
});
|
|
283
|
-
return commitHash;
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
const commitOptions = [];
|
|
287
|
-
if (options.amend) {
|
|
288
|
-
commitOptions.push('--amend');
|
|
289
|
-
}
|
|
290
|
-
if (options.allowEmpty) {
|
|
291
|
-
commitOptions.push('--allow-empty');
|
|
292
|
-
}
|
|
293
|
-
if (options.noVerify) {
|
|
294
|
-
commitOptions.push('--no-verify');
|
|
295
|
-
}
|
|
296
|
-
if (options.author) {
|
|
297
|
-
commitOptions.push(`--author=${options.author}`);
|
|
298
|
-
}
|
|
299
|
-
const result = await this.git.commit(message, commitOptions);
|
|
300
|
-
logger.info(`Committed: ${result.commit}`);
|
|
301
|
-
const systemEventLogger = getSystemEventLogger();
|
|
302
|
-
await systemEventLogger.logGitOperation({
|
|
303
|
-
operation: 'commit',
|
|
304
|
-
branch: await this.getCurrentBranch(),
|
|
305
|
-
success: true,
|
|
306
|
-
duration_ms: Date.now() - startTime,
|
|
307
|
-
details: { hash: result.commit, amend: options.amend },
|
|
308
|
-
});
|
|
309
|
-
return result.commit;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
finally {
|
|
313
|
-
if (tempFilePath) {
|
|
314
|
-
try {
|
|
315
|
-
await fs.unlink(tempFilePath);
|
|
316
|
-
}
|
|
317
|
-
catch (error) {
|
|
318
|
-
logger.debug(`Failed to clean up temp commit file: ${error}`);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Commits with a conventional commit message
|
|
325
|
-
*/
|
|
326
|
-
async commitConventional(commit) {
|
|
327
|
-
const message = this.formatConventionalCommit(commit);
|
|
328
|
-
return this.commit(message);
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Formats a conventional commit message
|
|
332
|
-
*/
|
|
333
|
-
formatConventionalCommit(commit) {
|
|
334
|
-
let message = commit.type;
|
|
335
|
-
if (commit.scope) {
|
|
336
|
-
message += `(${commit.scope})`;
|
|
337
|
-
}
|
|
338
|
-
if (commit.breaking) {
|
|
339
|
-
message += '!';
|
|
340
|
-
}
|
|
341
|
-
message += `: ${commit.description}`;
|
|
342
|
-
if (commit.body) {
|
|
343
|
-
message += `\n\n${commit.body}`;
|
|
344
|
-
}
|
|
345
|
-
if (commit.footer) {
|
|
346
|
-
message += `\n\n${commit.footer}`;
|
|
347
|
-
}
|
|
348
|
-
if (commit.breaking && !commit.footer?.includes('BREAKING CHANGE')) {
|
|
349
|
-
message += `\n\nBREAKING CHANGE: ${commit.description}`;
|
|
350
|
-
}
|
|
351
|
-
return message;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Creates a new branch
|
|
355
|
-
*/
|
|
356
|
-
async createBranch(branchName, startPoint) {
|
|
357
|
-
if (startPoint) {
|
|
358
|
-
await this.git.checkoutBranch(branchName, startPoint);
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
await this.git.checkoutLocalBranch(branchName);
|
|
362
|
-
}
|
|
363
|
-
logger.info(`Created and switched to branch: ${branchName}`);
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Switches to a branch
|
|
367
|
-
*/
|
|
368
|
-
async checkout(branchName) {
|
|
369
|
-
await this.git.checkout(branchName);
|
|
370
|
-
logger.info(`Switched to branch: ${branchName}`);
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Checks out a specific file from a commit
|
|
374
|
-
*/
|
|
375
|
-
async checkoutFile(filePath, commit) {
|
|
376
|
-
if (commit) {
|
|
377
|
-
await this.git.checkout([commit, '--', filePath]);
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
await this.git.checkout(['--', filePath]);
|
|
381
|
-
}
|
|
382
|
-
logger.debug(`Checked out file: ${filePath}`);
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Gets the list of local branches
|
|
386
|
-
*/
|
|
387
|
-
async getBranches() {
|
|
388
|
-
const result = await this.git.branchLocal();
|
|
389
|
-
return Object.entries(result.branches).map(([name, data]) => ({
|
|
390
|
-
name,
|
|
391
|
-
current: data.current,
|
|
392
|
-
commit: data.commit,
|
|
393
|
-
label: data.label,
|
|
394
|
-
}));
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Gets all branches including remote
|
|
398
|
-
*/
|
|
399
|
-
async getAllBranches() {
|
|
400
|
-
const result = await this.git.branch(['-a', '-v']);
|
|
401
|
-
return Object.entries(result.branches).map(([name, data]) => ({
|
|
402
|
-
name,
|
|
403
|
-
current: data.current,
|
|
404
|
-
commit: data.commit,
|
|
405
|
-
label: data.label,
|
|
406
|
-
}));
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Deletes a branch
|
|
410
|
-
*/
|
|
411
|
-
async deleteBranch(branchName, force = false) {
|
|
412
|
-
const flag = force ? '-D' : '-d';
|
|
413
|
-
await this.git.branch([flag, branchName]);
|
|
414
|
-
logger.info(`Deleted branch: ${branchName}`);
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Renames a branch
|
|
418
|
-
*/
|
|
419
|
-
async renameBranch(oldName, newName) {
|
|
420
|
-
await this.git.branch(['-m', oldName, newName]);
|
|
421
|
-
logger.info(`Renamed branch: ${oldName} -> ${newName}`);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Gets recent commits
|
|
425
|
-
*/
|
|
426
|
-
async getRecentCommits(options = {}) {
|
|
427
|
-
const logOptions = {};
|
|
428
|
-
if (options.maxCount) {
|
|
429
|
-
logOptions['--max-count'] = options.maxCount;
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
logOptions['--max-count'] = 10;
|
|
433
|
-
}
|
|
434
|
-
if (options.from) {
|
|
435
|
-
logOptions['--since'] = options.from;
|
|
436
|
-
}
|
|
437
|
-
if (options.author) {
|
|
438
|
-
logOptions['--author'] = options.author;
|
|
439
|
-
}
|
|
440
|
-
if (options.since) {
|
|
441
|
-
logOptions['--since'] = options.since;
|
|
442
|
-
}
|
|
443
|
-
if (options.until) {
|
|
444
|
-
logOptions['--until'] = options.until;
|
|
445
|
-
}
|
|
446
|
-
if (!options.includeMerges) {
|
|
447
|
-
logOptions['--no-merges'] = null;
|
|
448
|
-
}
|
|
449
|
-
const log = await this.git.log(logOptions);
|
|
450
|
-
return log.all.map((commit) => ({
|
|
451
|
-
hash: commit.hash.substring(0, 7),
|
|
452
|
-
fullHash: commit.hash,
|
|
453
|
-
message: commit.message,
|
|
454
|
-
author: commit.author_name,
|
|
455
|
-
authorEmail: commit.author_email,
|
|
456
|
-
date: commit.date,
|
|
457
|
-
parents: commit.refs ? commit.refs.split(', ') : [],
|
|
458
|
-
}));
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Gets the log for a specific file
|
|
462
|
-
*/
|
|
463
|
-
async getFileHistory(filePath, options = {}) {
|
|
464
|
-
const logOptions = {
|
|
465
|
-
file: filePath,
|
|
466
|
-
};
|
|
467
|
-
if (options.maxCount) {
|
|
468
|
-
logOptions['--max-count'] = options.maxCount;
|
|
469
|
-
}
|
|
470
|
-
else {
|
|
471
|
-
logOptions['--max-count'] = 20;
|
|
472
|
-
}
|
|
473
|
-
const log = await this.git.log(logOptions);
|
|
474
|
-
return log.all.map((commit) => ({
|
|
475
|
-
hash: commit.hash.substring(0, 7),
|
|
476
|
-
fullHash: commit.hash,
|
|
477
|
-
message: commit.message,
|
|
478
|
-
author: commit.author_name,
|
|
479
|
-
authorEmail: commit.author_email,
|
|
480
|
-
date: commit.date,
|
|
481
|
-
parents: [],
|
|
482
|
-
}));
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* Checks for merge conflicts
|
|
486
|
-
*/
|
|
487
|
-
async hasConflicts() {
|
|
488
|
-
const status = await this.git.status();
|
|
489
|
-
return status.conflicted.length > 0;
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Gets conflicted files
|
|
493
|
-
*/
|
|
494
|
-
async getConflictedFiles() {
|
|
495
|
-
const status = await this.git.status();
|
|
496
|
-
return status.conflicted;
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Marks a file as resolved
|
|
500
|
-
*/
|
|
501
|
-
async markResolved(filePath) {
|
|
502
|
-
await this.git.add(filePath);
|
|
503
|
-
logger.debug(`Marked as resolved: ${filePath}`);
|
|
504
|
-
}
|
|
505
|
-
/**
|
|
506
|
-
* Aborts a merge in progress
|
|
507
|
-
*/
|
|
508
|
-
async abortMerge() {
|
|
509
|
-
await this.git.merge(['--abort']);
|
|
510
|
-
logger.info('Merge aborted');
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* Merges a branch into the current branch
|
|
514
|
-
*/
|
|
515
|
-
async merge(branchName, options = {}) {
|
|
516
|
-
const startTime = Date.now();
|
|
517
|
-
const systemEventLogger = getSystemEventLogger();
|
|
518
|
-
try {
|
|
519
|
-
const mergeOptions = [branchName];
|
|
520
|
-
if (options.noFastForward) {
|
|
521
|
-
mergeOptions.unshift('--no-ff');
|
|
522
|
-
}
|
|
523
|
-
if (options.squash) {
|
|
524
|
-
mergeOptions.unshift('--squash');
|
|
525
|
-
}
|
|
526
|
-
if (options.message) {
|
|
527
|
-
mergeOptions.unshift('-m', options.message);
|
|
528
|
-
}
|
|
529
|
-
const result = await this.git.merge(mergeOptions);
|
|
530
|
-
logger.info(`Merged ${branchName} into current branch`);
|
|
531
|
-
// Convert conflicts array to string array if needed
|
|
532
|
-
const conflicts = Array.isArray(result.conflicts)
|
|
533
|
-
? result.conflicts.map((c) => typeof c === 'string' ? c : c.file || '')
|
|
534
|
-
: [];
|
|
535
|
-
// Log successful merge
|
|
536
|
-
await systemEventLogger.logGitOperation({
|
|
537
|
-
operation: 'merge',
|
|
538
|
-
branch: await this.getCurrentBranch(),
|
|
539
|
-
success: true,
|
|
540
|
-
duration_ms: Date.now() - startTime,
|
|
541
|
-
details: { sourceBranch: branchName, conflicts: conflicts.length },
|
|
542
|
-
});
|
|
543
|
-
return {
|
|
544
|
-
success: true,
|
|
545
|
-
message: result.result || 'Merge successful',
|
|
546
|
-
conflicts,
|
|
547
|
-
fastForward: result.merges?.length === 0 || false,
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
catch (error) {
|
|
551
|
-
const conflicts = await this.getConflictedFiles();
|
|
552
|
-
// Log failed merge
|
|
553
|
-
await systemEventLogger.logGitOperation({
|
|
554
|
-
operation: 'merge',
|
|
555
|
-
branch: await this.getCurrentBranch(),
|
|
556
|
-
success: false,
|
|
557
|
-
duration_ms: Date.now() - startTime,
|
|
558
|
-
error: error instanceof Error ? error.message : 'Merge failed',
|
|
559
|
-
details: { sourceBranch: branchName, conflicts: conflicts.length },
|
|
560
|
-
});
|
|
561
|
-
return {
|
|
562
|
-
success: false,
|
|
563
|
-
message: error instanceof Error ? error.message : 'Merge failed',
|
|
564
|
-
conflicts,
|
|
565
|
-
fastForward: false,
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Generates a commit message based on changes
|
|
571
|
-
*/
|
|
572
|
-
async generateCommitMessage() {
|
|
573
|
-
const status = await this.git.status();
|
|
574
|
-
const stagedCount = status.staged.length;
|
|
575
|
-
const modifiedCount = status.modified.filter((f) => status.staged.includes(f)).length;
|
|
576
|
-
const deletedCount = status.deleted.filter((f) => status.staged.includes(f)).length;
|
|
577
|
-
const newCount = stagedCount - modifiedCount - deletedCount;
|
|
578
|
-
if (stagedCount === 0) {
|
|
579
|
-
return 'chore: update files';
|
|
580
|
-
}
|
|
581
|
-
// Analyze file types to determine commit type
|
|
582
|
-
const fileTypes = new Map();
|
|
583
|
-
for (const file of status.staged) {
|
|
584
|
-
const ext = path.extname(file).toLowerCase();
|
|
585
|
-
fileTypes.set(ext, (fileTypes.get(ext) || 0) + 1);
|
|
586
|
-
}
|
|
587
|
-
// Determine commit type based on files
|
|
588
|
-
let commitType = 'chore';
|
|
589
|
-
let scope;
|
|
590
|
-
// Check for specific patterns
|
|
591
|
-
const hasTestFiles = status.staged.some((f) => f.includes('test') || f.includes('spec') || f.includes('__tests__'));
|
|
592
|
-
const hasDocFiles = status.staged.some((f) => f.endsWith('.md') || f.includes('docs/'));
|
|
593
|
-
const hasConfigFiles = status.staged.some((f) => f.includes('config') ||
|
|
594
|
-
f.endsWith('.json') ||
|
|
595
|
-
f.endsWith('.yaml') ||
|
|
596
|
-
f.endsWith('.yml'));
|
|
597
|
-
const hasSrcFiles = status.staged.some((f) => f.startsWith('src/') || f.includes('/src/'));
|
|
598
|
-
if (hasTestFiles && !hasSrcFiles) {
|
|
599
|
-
commitType = 'test';
|
|
600
|
-
}
|
|
601
|
-
else if (hasDocFiles && !hasSrcFiles) {
|
|
602
|
-
commitType = 'docs';
|
|
603
|
-
}
|
|
604
|
-
else if (hasConfigFiles && !hasSrcFiles) {
|
|
605
|
-
commitType = 'build';
|
|
606
|
-
}
|
|
607
|
-
else if (hasSrcFiles) {
|
|
608
|
-
commitType = newCount > 0 ? 'feat' : 'fix';
|
|
609
|
-
}
|
|
610
|
-
// Determine scope from directory
|
|
611
|
-
if (status.staged.length === 1) {
|
|
612
|
-
const file = status.staged[0];
|
|
613
|
-
const parts = file.split('/');
|
|
614
|
-
if (parts.length > 1) {
|
|
615
|
-
scope = parts[parts.length - 2];
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
// Find common directory
|
|
620
|
-
const dirs = status.staged.map((f) => path.dirname(f));
|
|
621
|
-
const commonDir = this.findCommonPrefix(dirs);
|
|
622
|
-
if (commonDir && commonDir !== '.') {
|
|
623
|
-
scope = path.basename(commonDir);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
// Generate description
|
|
627
|
-
let description;
|
|
628
|
-
if (stagedCount === 1) {
|
|
629
|
-
const file = path.basename(status.staged[0]);
|
|
630
|
-
if (newCount === 1) {
|
|
631
|
-
description = `add ${file}`;
|
|
632
|
-
}
|
|
633
|
-
else if (deletedCount === 1) {
|
|
634
|
-
description = `remove ${file}`;
|
|
635
|
-
}
|
|
636
|
-
else {
|
|
637
|
-
description = `update ${file}`;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
else {
|
|
641
|
-
const parts = [];
|
|
642
|
-
if (newCount > 0)
|
|
643
|
-
parts.push(`add ${newCount} file${newCount > 1 ? 's' : ''}`);
|
|
644
|
-
if (modifiedCount > 0)
|
|
645
|
-
parts.push(`update ${modifiedCount} file${modifiedCount > 1 ? 's' : ''}`);
|
|
646
|
-
if (deletedCount > 0)
|
|
647
|
-
parts.push(`remove ${deletedCount} file${deletedCount > 1 ? 's' : ''}`);
|
|
648
|
-
description = parts.join(', ');
|
|
649
|
-
}
|
|
650
|
-
// Format the message
|
|
651
|
-
let message = commitType;
|
|
652
|
-
if (scope) {
|
|
653
|
-
message += `(${scope})`;
|
|
654
|
-
}
|
|
655
|
-
message += `: ${description}`;
|
|
656
|
-
return message;
|
|
657
|
-
}
|
|
658
|
-
/**
|
|
659
|
-
* Finds the common prefix among an array of paths
|
|
660
|
-
*/
|
|
661
|
-
findCommonPrefix(paths) {
|
|
662
|
-
if (paths.length === 0)
|
|
663
|
-
return '';
|
|
664
|
-
if (paths.length === 1)
|
|
665
|
-
return paths[0];
|
|
666
|
-
const sorted = paths.slice().sort();
|
|
667
|
-
const first = sorted[0].split('/');
|
|
668
|
-
const last = sorted[sorted.length - 1].split('/');
|
|
669
|
-
const common = [];
|
|
670
|
-
for (let i = 0; i < Math.min(first.length, last.length); i++) {
|
|
671
|
-
if (first[i] === last[i]) {
|
|
672
|
-
common.push(first[i]);
|
|
673
|
-
}
|
|
674
|
-
else {
|
|
675
|
-
break;
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
return common.join('/');
|
|
679
|
-
}
|
|
680
|
-
/**
|
|
681
|
-
* Pulls latest changes from remote
|
|
682
|
-
*/
|
|
683
|
-
async pull(remote, branch) {
|
|
684
|
-
const startTime = Date.now();
|
|
685
|
-
const result = await this.git.pull(remote, branch);
|
|
686
|
-
logger.info('Pulled latest changes');
|
|
687
|
-
// Log the git operation
|
|
688
|
-
const systemEventLogger = getSystemEventLogger();
|
|
689
|
-
await systemEventLogger.logGitOperation({
|
|
690
|
-
operation: 'pull',
|
|
691
|
-
branch: await this.getCurrentBranch(),
|
|
692
|
-
success: true,
|
|
693
|
-
duration_ms: Date.now() - startTime,
|
|
694
|
-
details: { remote, filesChanged: result.files?.length },
|
|
695
|
-
});
|
|
696
|
-
return result;
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* Fetches from remote without merging
|
|
700
|
-
*/
|
|
701
|
-
async fetch(remote, branch) {
|
|
702
|
-
if (remote && branch) {
|
|
703
|
-
const result = await this.git.fetch(remote, branch);
|
|
704
|
-
logger.debug('Fetched from remote');
|
|
705
|
-
return result;
|
|
706
|
-
}
|
|
707
|
-
else if (remote) {
|
|
708
|
-
const result = await this.git.fetch(remote);
|
|
709
|
-
logger.debug('Fetched from remote');
|
|
710
|
-
return result;
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
const result = await this.git.fetch();
|
|
714
|
-
logger.debug('Fetched from remote');
|
|
715
|
-
return result;
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* Pushes commits to remote
|
|
720
|
-
*/
|
|
721
|
-
async push(remote = 'origin', branch, options = {}) {
|
|
722
|
-
const startTime = Date.now();
|
|
723
|
-
const currentBranch = branch || (await this.getCurrentBranch());
|
|
724
|
-
const pushOptions = [];
|
|
725
|
-
if (options.force) {
|
|
726
|
-
pushOptions.push('--force');
|
|
727
|
-
}
|
|
728
|
-
if (options.setUpstream) {
|
|
729
|
-
pushOptions.push('--set-upstream');
|
|
730
|
-
}
|
|
731
|
-
const result = await this.git.push(remote, currentBranch, pushOptions);
|
|
732
|
-
logger.info(`Pushed to ${remote}/${currentBranch}`);
|
|
733
|
-
// Log the git operation
|
|
734
|
-
const systemEventLogger = getSystemEventLogger();
|
|
735
|
-
await systemEventLogger.logGitOperation({
|
|
736
|
-
operation: 'push',
|
|
737
|
-
branch: currentBranch,
|
|
738
|
-
success: true,
|
|
739
|
-
duration_ms: Date.now() - startTime,
|
|
740
|
-
details: { remote, force: options.force },
|
|
741
|
-
});
|
|
742
|
-
return result;
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Stashes current changes
|
|
746
|
-
*/
|
|
747
|
-
async stash(message) {
|
|
748
|
-
if (message) {
|
|
749
|
-
await this.git.stash(['push', '-m', message]);
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
await this.git.stash(['push']);
|
|
753
|
-
}
|
|
754
|
-
logger.info('Changes stashed');
|
|
755
|
-
}
|
|
756
|
-
/**
|
|
757
|
-
* Applies stashed changes
|
|
758
|
-
*/
|
|
759
|
-
async stashPop(index) {
|
|
760
|
-
if (index !== undefined) {
|
|
761
|
-
await this.git.stash(['pop', `stash@{${index}}`]);
|
|
762
|
-
}
|
|
763
|
-
else {
|
|
764
|
-
await this.git.stash(['pop']);
|
|
765
|
-
}
|
|
766
|
-
logger.info('Stash applied');
|
|
767
|
-
}
|
|
768
|
-
/**
|
|
769
|
-
* Applies stash without removing it
|
|
770
|
-
*/
|
|
771
|
-
async stashApply(index) {
|
|
772
|
-
if (index !== undefined) {
|
|
773
|
-
await this.git.stash(['apply', `stash@{${index}}`]);
|
|
774
|
-
}
|
|
775
|
-
else {
|
|
776
|
-
await this.git.stash(['apply']);
|
|
777
|
-
}
|
|
778
|
-
logger.debug('Stash applied (kept in stash list)');
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* Lists all stashes
|
|
782
|
-
*/
|
|
783
|
-
async listStashes() {
|
|
784
|
-
const result = await this.git.stashList();
|
|
785
|
-
return result.all.map((stash, index) => ({
|
|
786
|
-
index,
|
|
787
|
-
message: stash.message,
|
|
788
|
-
date: stash.date,
|
|
789
|
-
branch: stash.refs || '',
|
|
790
|
-
}));
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* Drops a stash
|
|
794
|
-
*/
|
|
795
|
-
async dropStash(index) {
|
|
796
|
-
if (index !== undefined) {
|
|
797
|
-
await this.git.stash(['drop', `stash@{${index}}`]);
|
|
798
|
-
}
|
|
799
|
-
else {
|
|
800
|
-
await this.git.stash(['drop']);
|
|
801
|
-
}
|
|
802
|
-
logger.debug('Stash dropped');
|
|
803
|
-
}
|
|
804
|
-
/**
|
|
805
|
-
* Clears all stashes
|
|
806
|
-
*/
|
|
807
|
-
async clearStashes() {
|
|
808
|
-
await this.git.stash(['clear']);
|
|
809
|
-
logger.info('All stashes cleared');
|
|
810
|
-
}
|
|
811
|
-
/**
|
|
812
|
-
* Resets a file to its last committed state
|
|
813
|
-
*/
|
|
814
|
-
async resetFile(filePath) {
|
|
815
|
-
await this.git.checkout(['--', filePath]);
|
|
816
|
-
logger.info(`Reset file: ${filePath}`);
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Resets to a specific commit
|
|
820
|
-
*/
|
|
821
|
-
async reset(commit, mode = 'mixed') {
|
|
822
|
-
await this.git.reset([`--${mode}`, commit]);
|
|
823
|
-
logger.info(`Reset to ${commit} (${mode})`);
|
|
824
|
-
}
|
|
825
|
-
/**
|
|
826
|
-
* Reverts a commit
|
|
827
|
-
*/
|
|
828
|
-
async revert(commit, noCommit = false) {
|
|
829
|
-
if (noCommit) {
|
|
830
|
-
await this.git.raw(['revert', '--no-commit', commit]);
|
|
831
|
-
}
|
|
832
|
-
else {
|
|
833
|
-
await this.git.raw(['revert', commit]);
|
|
834
|
-
}
|
|
835
|
-
logger.info(`Reverted commit: ${commit}`);
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Gets the remote URL
|
|
839
|
-
*/
|
|
840
|
-
async getRemoteUrl(remote = 'origin') {
|
|
841
|
-
try {
|
|
842
|
-
const remotes = await this.git.getRemotes(true);
|
|
843
|
-
const found = remotes.find((r) => r.name === remote);
|
|
844
|
-
return found?.refs.fetch || null;
|
|
845
|
-
}
|
|
846
|
-
catch {
|
|
847
|
-
return null;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* Gets all remotes
|
|
852
|
-
*/
|
|
853
|
-
async getRemotes() {
|
|
854
|
-
const remotes = await this.git.getRemotes(true);
|
|
855
|
-
return remotes.map((r) => ({
|
|
856
|
-
name: r.name,
|
|
857
|
-
fetchUrl: r.refs.fetch || '',
|
|
858
|
-
pushUrl: r.refs.push || '',
|
|
859
|
-
}));
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Adds a remote
|
|
863
|
-
*/
|
|
864
|
-
async addRemote(name, url) {
|
|
865
|
-
await this.git.addRemote(name, url);
|
|
866
|
-
logger.info(`Added remote: ${name} -> ${url}`);
|
|
867
|
-
}
|
|
868
|
-
/**
|
|
869
|
-
* Removes a remote
|
|
870
|
-
*/
|
|
871
|
-
async removeRemote(name) {
|
|
872
|
-
await this.git.removeRemote(name);
|
|
873
|
-
logger.info(`Removed remote: ${name}`);
|
|
874
|
-
}
|
|
875
|
-
/**
|
|
876
|
-
* Gets tags
|
|
877
|
-
*/
|
|
878
|
-
async getTags() {
|
|
879
|
-
const result = await this.git.tags();
|
|
880
|
-
return result.all;
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Creates a tag
|
|
884
|
-
*/
|
|
885
|
-
async createTag(tagName, message, commit) {
|
|
886
|
-
if (message) {
|
|
887
|
-
// Annotated tag with message
|
|
888
|
-
const options = ['-a', tagName, '-m', message];
|
|
889
|
-
if (commit) {
|
|
890
|
-
options.push(commit);
|
|
891
|
-
}
|
|
892
|
-
await this.git.tag(options);
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
// Lightweight tag
|
|
896
|
-
if (commit) {
|
|
897
|
-
await this.git.tag([tagName, commit]);
|
|
898
|
-
}
|
|
899
|
-
else {
|
|
900
|
-
await this.git.tag([tagName]);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
logger.info(`Created tag: ${tagName}`);
|
|
904
|
-
}
|
|
905
|
-
/**
|
|
906
|
-
* Deletes a tag
|
|
907
|
-
*/
|
|
908
|
-
async deleteTag(tagName) {
|
|
909
|
-
await this.git.tag(['-d', tagName]);
|
|
910
|
-
logger.info(`Deleted tag: ${tagName}`);
|
|
911
|
-
}
|
|
912
|
-
/**
|
|
913
|
-
* Gets the content of a file at a specific commit
|
|
914
|
-
*/
|
|
915
|
-
async getFileAtCommit(filePath, commit) {
|
|
916
|
-
return this.git.show(`${commit}:${filePath}`);
|
|
917
|
-
}
|
|
918
|
-
/**
|
|
919
|
-
* Checks if a file exists in the repository
|
|
920
|
-
*/
|
|
921
|
-
async fileExistsInRepo(filePath) {
|
|
922
|
-
try {
|
|
923
|
-
await this.git.show(`HEAD:${filePath}`);
|
|
924
|
-
return true;
|
|
925
|
-
}
|
|
926
|
-
catch {
|
|
927
|
-
return false;
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
/**
|
|
931
|
-
* Gets blame information for a file
|
|
932
|
-
*/
|
|
933
|
-
async blame(filePath) {
|
|
934
|
-
const result = await this.git.raw(['blame', filePath]);
|
|
935
|
-
return result;
|
|
936
|
-
}
|
|
937
|
-
/**
|
|
938
|
-
* Cleans untracked files
|
|
939
|
-
*/
|
|
940
|
-
async clean(options = {}) {
|
|
941
|
-
const args = [];
|
|
942
|
-
if (options.force) {
|
|
943
|
-
args.push('-f');
|
|
944
|
-
}
|
|
945
|
-
if (options.directories) {
|
|
946
|
-
args.push('-d');
|
|
947
|
-
}
|
|
948
|
-
if (options.dryRun) {
|
|
949
|
-
args.push('-n');
|
|
950
|
-
}
|
|
951
|
-
const result = await this.git.clean(args);
|
|
952
|
-
// CleanSummary has a files array
|
|
953
|
-
if (typeof result === 'object' && 'files' in result) {
|
|
954
|
-
return result.files;
|
|
955
|
-
}
|
|
956
|
-
return [];
|
|
957
|
-
}
|
|
958
|
-
/**
|
|
959
|
-
* Gets the root directory of the Git repository
|
|
960
|
-
*/
|
|
961
|
-
async getRepoRoot() {
|
|
962
|
-
const result = await this.git.revparse(['--show-toplevel']);
|
|
963
|
-
return result.trim();
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* Checks if there are uncommitted changes
|
|
967
|
-
*/
|
|
968
|
-
async hasUncommittedChanges() {
|
|
969
|
-
const status = await this.git.status();
|
|
970
|
-
return !status.isClean();
|
|
971
|
-
}
|
|
972
|
-
/**
|
|
973
|
-
* Gets the short hash of HEAD
|
|
974
|
-
*/
|
|
975
|
-
async getHeadShortHash() {
|
|
976
|
-
const result = await this.git.revparse(['--short', 'HEAD']);
|
|
977
|
-
return result.trim();
|
|
978
|
-
}
|
|
979
|
-
/**
|
|
980
|
-
* Gets the full hash of HEAD
|
|
981
|
-
*/
|
|
982
|
-
async getHeadHash() {
|
|
983
|
-
const result = await this.git.revparse(['HEAD']);
|
|
984
|
-
return result.trim();
|
|
985
|
-
}
|
|
986
|
-
/**
|
|
987
|
-
* Checks if a branch exists
|
|
988
|
-
*/
|
|
989
|
-
async branchExists(branchName) {
|
|
990
|
-
const branches = await this.getBranches();
|
|
991
|
-
return branches.some((b) => b.name === branchName);
|
|
992
|
-
}
|
|
993
|
-
/**
|
|
994
|
-
* Gets the tracking branch for the current branch
|
|
995
|
-
*/
|
|
996
|
-
async getTrackingBranch() {
|
|
997
|
-
try {
|
|
998
|
-
const result = await this.git.raw([
|
|
999
|
-
'rev-parse',
|
|
1000
|
-
'--abbrev-ref',
|
|
1001
|
-
'--symbolic-full-name',
|
|
1002
|
-
'@{u}',
|
|
1003
|
-
]);
|
|
1004
|
-
return result.trim() || null;
|
|
1005
|
-
}
|
|
1006
|
-
catch {
|
|
1007
|
-
return null;
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
/**
|
|
1011
|
-
* Sets the upstream branch
|
|
1012
|
-
*/
|
|
1013
|
-
async setUpstream(remote, branch) {
|
|
1014
|
-
await this.git.branch(['--set-upstream-to', `${remote}/${branch}`]);
|
|
1015
|
-
logger.debug(`Set upstream to ${remote}/${branch}`);
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* Cherry-picks a commit
|
|
1019
|
-
*/
|
|
1020
|
-
async cherryPick(commit, noCommit = false) {
|
|
1021
|
-
const options = noCommit ? ['--no-commit', commit] : [commit];
|
|
1022
|
-
await this.git.raw(['cherry-pick', ...options]);
|
|
1023
|
-
logger.info(`Cherry-picked commit: ${commit}`);
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* Aborts a cherry-pick in progress
|
|
1027
|
-
*/
|
|
1028
|
-
async abortCherryPick() {
|
|
1029
|
-
await this.git.raw(['cherry-pick', '--abort']);
|
|
1030
|
-
logger.info('Cherry-pick aborted');
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* Continues a cherry-pick after resolving conflicts
|
|
1034
|
-
*/
|
|
1035
|
-
async continueCherryPick() {
|
|
1036
|
-
await this.git.raw(['cherry-pick', '--continue']);
|
|
1037
|
-
logger.info('Cherry-pick continued');
|
|
1038
|
-
}
|
|
1039
|
-
// ===========================================================================
|
|
1040
|
-
// Worktree Operations
|
|
1041
|
-
// ===========================================================================
|
|
1042
|
-
/**
|
|
1043
|
-
* Represents a git worktree entry
|
|
1044
|
-
*/
|
|
1045
|
-
/**
|
|
1046
|
-
* Adds a new git worktree at the given path on a new branch
|
|
1047
|
-
*/
|
|
1048
|
-
async addWorktree(worktreePath, branchName, baseBranch) {
|
|
1049
|
-
const args = ['worktree', 'add', '-b', branchName, worktreePath];
|
|
1050
|
-
if (baseBranch) {
|
|
1051
|
-
args.push(baseBranch);
|
|
1052
|
-
}
|
|
1053
|
-
await this.git.raw(args);
|
|
1054
|
-
logger.info(`Added worktree at ${worktreePath} on branch ${branchName}`);
|
|
1055
|
-
}
|
|
1056
|
-
/**
|
|
1057
|
-
* Lists all git worktrees
|
|
1058
|
-
*/
|
|
1059
|
-
async listWorktrees() {
|
|
1060
|
-
const result = await this.git.raw(['worktree', 'list', '--porcelain']);
|
|
1061
|
-
const worktrees = [];
|
|
1062
|
-
let current = { path: '', head: '', branch: '' };
|
|
1063
|
-
for (const line of result.split('\n')) {
|
|
1064
|
-
if (line.startsWith('worktree ')) {
|
|
1065
|
-
current = { path: line.replace('worktree ', ''), head: '', branch: '' };
|
|
1066
|
-
}
|
|
1067
|
-
else if (line.startsWith('HEAD ')) {
|
|
1068
|
-
current.head = line.replace('HEAD ', '');
|
|
1069
|
-
}
|
|
1070
|
-
else if (line.startsWith('branch ')) {
|
|
1071
|
-
current.branch = line.replace('branch refs/heads/', '');
|
|
1072
|
-
worktrees.push(current);
|
|
1073
|
-
}
|
|
1074
|
-
else if (line === 'detached') {
|
|
1075
|
-
current.branch = '(detached)';
|
|
1076
|
-
worktrees.push(current);
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
return worktrees;
|
|
1080
|
-
}
|
|
1081
|
-
/**
|
|
1082
|
-
* Removes a git worktree (with force option for dirty worktrees)
|
|
1083
|
-
*/
|
|
1084
|
-
async removeWorktree(worktreePath, force = false) {
|
|
1085
|
-
const args = ['worktree', 'remove', worktreePath];
|
|
1086
|
-
if (force) {
|
|
1087
|
-
args.push('--force');
|
|
1088
|
-
}
|
|
1089
|
-
await this.git.raw(args);
|
|
1090
|
-
logger.info(`Removed worktree at ${worktreePath}`);
|
|
1091
|
-
}
|
|
1092
|
-
/**
|
|
1093
|
-
* Prunes stale worktree metadata
|
|
1094
|
-
*/
|
|
1095
|
-
async pruneWorktrees() {
|
|
1096
|
-
await this.git.raw(['worktree', 'prune']);
|
|
1097
|
-
logger.debug('Pruned stale worktree metadata');
|
|
1098
|
-
}
|
|
1099
|
-
/**
|
|
1100
|
-
* Gets the default remote branch (e.g., origin/main or origin/master)
|
|
1101
|
-
*/
|
|
1102
|
-
async getDefaultRemoteBranch() {
|
|
1103
|
-
try {
|
|
1104
|
-
// Try HEAD of default remote
|
|
1105
|
-
const result = await this.git.raw(['symbolic-ref', 'refs/remotes/origin/HEAD']);
|
|
1106
|
-
return result.trim().replace('refs/remotes/origin/', '');
|
|
1107
|
-
}
|
|
1108
|
-
catch {
|
|
1109
|
-
// Fallback: check if main or master exists
|
|
1110
|
-
try {
|
|
1111
|
-
await this.git.raw(['rev-parse', '--verify', 'origin/main']);
|
|
1112
|
-
return 'main';
|
|
1113
|
-
}
|
|
1114
|
-
catch {
|
|
1115
|
-
try {
|
|
1116
|
-
await this.git.raw(['rev-parse', '--verify', 'origin/master']);
|
|
1117
|
-
return 'master';
|
|
1118
|
-
}
|
|
1119
|
-
catch {
|
|
1120
|
-
return null;
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
/**
|
|
1126
|
-
* Reads and parses .gitignore file using shared utility.
|
|
1127
|
-
* Falls back to DEFAULT_IGNORE_PATTERNS if .gitignore doesn't exist.
|
|
1128
|
-
*/
|
|
1129
|
-
async readGitignore(_gitignorePath) {
|
|
1130
|
-
// Use shared utility which handles .gitignore loading and fallback
|
|
1131
|
-
return createIgnoreInstance(this.projectRoot, true);
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* Recursively walks directory tree and collects files
|
|
1135
|
-
*/
|
|
1136
|
-
async walkDirectory(dir, ig, baseDir) {
|
|
1137
|
-
const files = [];
|
|
1138
|
-
try {
|
|
1139
|
-
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
1140
|
-
for (const entry of entries) {
|
|
1141
|
-
const fullPath = path.join(dir, entry.name);
|
|
1142
|
-
const relativePath = path.relative(baseDir, fullPath).replace(/\\/g, '/');
|
|
1143
|
-
// Skip if ignored by .gitignore
|
|
1144
|
-
if (ig && ig.ignores(relativePath)) {
|
|
1145
|
-
continue;
|
|
1146
|
-
}
|
|
1147
|
-
if (entry.isDirectory()) {
|
|
1148
|
-
// Skip .git directory
|
|
1149
|
-
if (entry.name === '.git') {
|
|
1150
|
-
continue;
|
|
1151
|
-
}
|
|
1152
|
-
// Recursively walk subdirectories
|
|
1153
|
-
const subFiles = await this.walkDirectory(fullPath, ig, baseDir);
|
|
1154
|
-
files.push(...subFiles);
|
|
1155
|
-
}
|
|
1156
|
-
else if (entry.isFile()) {
|
|
1157
|
-
files.push(relativePath);
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
catch (error) {
|
|
1162
|
-
logger.debug(`Failed to walk directory ${dir}: ${error}`);
|
|
1163
|
-
}
|
|
1164
|
-
return files;
|
|
1165
|
-
}
|
|
1166
|
-
/**
|
|
1167
|
-
* Gets file status using .gitignore as fallback when git is not available
|
|
1168
|
-
*/
|
|
1169
|
-
async getStatusWithGitignoreFallback() {
|
|
1170
|
-
logger.debug('Using .gitignore fallback for status');
|
|
1171
|
-
const gitignorePath = path.join(this.projectRoot, '.gitignore');
|
|
1172
|
-
const ig = await this.readGitignore(gitignorePath);
|
|
1173
|
-
// Walk the directory tree
|
|
1174
|
-
const allFiles = await this.walkDirectory(this.projectRoot, ig, this.projectRoot);
|
|
1175
|
-
// All files are considered untracked in fallback mode
|
|
1176
|
-
return {
|
|
1177
|
-
branch: 'unknown',
|
|
1178
|
-
tracking: null,
|
|
1179
|
-
ahead: 0,
|
|
1180
|
-
behind: 0,
|
|
1181
|
-
staged: [],
|
|
1182
|
-
modified: [],
|
|
1183
|
-
untracked: allFiles,
|
|
1184
|
-
conflicted: [],
|
|
1185
|
-
isClean: allFiles.length === 0,
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* Factory function to create a GitService instance
|
|
1191
|
-
*
|
|
1192
|
-
* @param projectRoot - Optional project root directory
|
|
1193
|
-
* @returns A new GitService instance
|
|
1194
|
-
*/
|
|
1195
|
-
export function createGitService(projectRoot) {
|
|
1196
|
-
return new GitService(projectRoot);
|
|
1197
|
-
}
|
|
1198
|
-
// Singleton instance
|
|
1199
|
-
let gitServiceInstance = null;
|
|
1200
|
-
/**
|
|
1201
|
-
* Gets the singleton GitService instance.
|
|
1202
|
-
* Creates the instance on first call.
|
|
1203
|
-
*
|
|
1204
|
-
* @param projectRoot - Optional project root directory
|
|
1205
|
-
* @returns Promise resolving to the GitService instance
|
|
1206
|
-
*/
|
|
1207
|
-
export async function getGitService(projectRoot) {
|
|
1208
|
-
if (!gitServiceInstance) {
|
|
1209
|
-
gitServiceInstance = new GitService(projectRoot);
|
|
1210
|
-
await gitServiceInstance.initialize();
|
|
1211
|
-
}
|
|
1212
|
-
return gitServiceInstance;
|
|
1213
|
-
}
|
|
1214
|
-
export { GitService };
|
|
1215
|
-
//# sourceMappingURL=git-service.js.map
|