@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,798 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File system utilities with safe operations and error handling.
|
|
3
|
-
*
|
|
4
|
-
* This module provides a comprehensive set of file system utilities wrapping fs-extra
|
|
5
|
-
* for safe read/write operations, atomic file updates, and directory management.
|
|
6
|
-
* All operations include proper error handling and logging.
|
|
7
|
-
*
|
|
8
|
-
* Features:
|
|
9
|
-
* - Safe file reading with fallback support
|
|
10
|
-
* - Atomic file writing with temporary files
|
|
11
|
-
* - JSON file read/write with automatic parsing
|
|
12
|
-
* - Directory management (ensure, read, check)
|
|
13
|
-
* - File/directory existence and type checking
|
|
14
|
-
* - File copying, moving, and removal
|
|
15
|
-
* - File statistics retrieval
|
|
16
|
-
*/
|
|
17
|
-
import fs from 'fs-extra';
|
|
18
|
-
import path from 'path';
|
|
19
|
-
import { logger } from './logger.js';
|
|
20
|
-
import { PROJECT_COMPASS_DIR, CHAT_ARCHIVE_DIR } from '../constants/defaults.js';
|
|
21
|
-
/**
|
|
22
|
-
* Safely reads a file with error handling.
|
|
23
|
-
*
|
|
24
|
-
* Returns the file content as a string, or null/fallback if the file doesn't exist.
|
|
25
|
-
* Throws an error for other file system errors (permission denied, etc.).
|
|
26
|
-
*
|
|
27
|
-
* @param filePath - Path to the file to read
|
|
28
|
-
* @param options - Read options including encoding and fallback value
|
|
29
|
-
* @returns File content as string, fallback value, or null if file doesn't exist
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* // Basic usage
|
|
34
|
-
* const content = await safeReadFile('/path/to/file.txt');
|
|
35
|
-
*
|
|
36
|
-
* // With fallback
|
|
37
|
-
* const content = await safeReadFile('/path/to/file.txt', { fallback: '' });
|
|
38
|
-
*
|
|
39
|
-
* // With specific encoding
|
|
40
|
-
* const content = await safeReadFile('/path/to/file.txt', { encoding: 'utf16le' });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export async function safeReadFile(filePath, options = {}) {
|
|
44
|
-
const { encoding = 'utf8', fallback } = options;
|
|
45
|
-
try {
|
|
46
|
-
const content = await fs.readFile(filePath, { encoding });
|
|
47
|
-
return content;
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
const nodeError = error;
|
|
51
|
-
// File doesn't exist - return fallback or null
|
|
52
|
-
if (nodeError.code === 'ENOENT') {
|
|
53
|
-
return fallback ?? null;
|
|
54
|
-
}
|
|
55
|
-
// Log and re-throw other errors
|
|
56
|
-
logger.error(`Failed to read file: ${filePath}`, error);
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Safely reads and parses a JSON file.
|
|
62
|
-
*
|
|
63
|
-
* Returns the parsed JSON object, or null/fallback if the file doesn't exist
|
|
64
|
-
* or contains invalid JSON.
|
|
65
|
-
*
|
|
66
|
-
* @param filePath - Path to the JSON file to read
|
|
67
|
-
* @param fallback - Optional fallback value if file doesn't exist or is invalid
|
|
68
|
-
* @returns Parsed JSON object, fallback value, or null
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* // Basic usage
|
|
73
|
-
* const config = await safeReadJson<ConfigType>('/path/to/config.json');
|
|
74
|
-
*
|
|
75
|
-
* // With fallback
|
|
76
|
-
* const config = await safeReadJson<ConfigType>('/path/to/config.json', { default: true });
|
|
77
|
-
*
|
|
78
|
-
* // Type-safe usage
|
|
79
|
-
* interface UserData { name: string; age: number; }
|
|
80
|
-
* const user = await safeReadJson<UserData>('/path/to/user.json');
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export async function safeReadJson(filePath, fallback) {
|
|
84
|
-
try {
|
|
85
|
-
const content = await safeReadFile(filePath);
|
|
86
|
-
if (content === null) {
|
|
87
|
-
return fallback ?? null;
|
|
88
|
-
}
|
|
89
|
-
return JSON.parse(content);
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
// If JSON parsing fails, return fallback or re-throw
|
|
93
|
-
if (error instanceof SyntaxError) {
|
|
94
|
-
logger.warn(`Invalid JSON in file: ${filePath}`, error);
|
|
95
|
-
if (fallback !== undefined) {
|
|
96
|
-
return fallback;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// For other errors, return fallback if provided, otherwise throw
|
|
100
|
-
if (fallback !== undefined) {
|
|
101
|
-
return fallback;
|
|
102
|
-
}
|
|
103
|
-
logger.error(`Failed to parse JSON file: ${filePath}`, error);
|
|
104
|
-
throw error;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Safely writes content to a file with optional atomic write and backup.
|
|
109
|
-
*
|
|
110
|
-
* By default, uses atomic write (write to temp file, then rename) to prevent
|
|
111
|
-
* data corruption if the write is interrupted. Can optionally create a backup
|
|
112
|
-
* of the existing file before overwriting.
|
|
113
|
-
*
|
|
114
|
-
* @param filePath - Path to the file to write
|
|
115
|
-
* @param content - Content to write to the file
|
|
116
|
-
* @param options - Write options including atomic write and backup settings
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* ```typescript
|
|
120
|
-
* // Basic usage
|
|
121
|
-
* await safeWriteFile('/path/to/file.txt', 'Hello, World!');
|
|
122
|
-
*
|
|
123
|
-
* // With backup
|
|
124
|
-
* await safeWriteFile('/path/to/file.txt', 'New content', { backup: true });
|
|
125
|
-
*
|
|
126
|
-
* // Non-atomic write (faster but less safe)
|
|
127
|
-
* await safeWriteFile('/path/to/file.txt', 'Content', { atomic: false });
|
|
128
|
-
*
|
|
129
|
-
* // With specific permissions
|
|
130
|
-
* await safeWriteFile('/path/to/file.txt', 'Content', { mode: 0o600 });
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
export async function safeWriteFile(filePath, content, options = {}) {
|
|
134
|
-
const { encoding = 'utf8', createDir = true, atomic = true, backup = false, backupDir, mode, } = options;
|
|
135
|
-
try {
|
|
136
|
-
// Ensure parent directory exists
|
|
137
|
-
if (createDir) {
|
|
138
|
-
await fs.ensureDir(path.dirname(filePath));
|
|
139
|
-
}
|
|
140
|
-
// Create backup if requested and file exists
|
|
141
|
-
if (backup && (await fs.pathExists(filePath))) {
|
|
142
|
-
const backupPath = backupDir
|
|
143
|
-
? path.join(backupDir, path.basename(filePath) + '.bak')
|
|
144
|
-
: filePath + '.bak';
|
|
145
|
-
// Ensure backup directory exists
|
|
146
|
-
if (backupDir) {
|
|
147
|
-
await fs.ensureDir(backupDir);
|
|
148
|
-
}
|
|
149
|
-
await fs.copy(filePath, backupPath, { overwrite: true });
|
|
150
|
-
logger.debug(`Backup created: ${backupPath}`);
|
|
151
|
-
}
|
|
152
|
-
if (atomic) {
|
|
153
|
-
// Write to temp file first, then rename for atomic operation
|
|
154
|
-
const tempPath = `${filePath}.tmp.${Date.now()}.${process.pid}`;
|
|
155
|
-
try {
|
|
156
|
-
await fs.writeFile(tempPath, content, { encoding, mode });
|
|
157
|
-
await fs.rename(tempPath, filePath);
|
|
158
|
-
}
|
|
159
|
-
catch (error) {
|
|
160
|
-
// Clean up temp file on failure
|
|
161
|
-
try {
|
|
162
|
-
await fs.remove(tempPath);
|
|
163
|
-
}
|
|
164
|
-
catch {
|
|
165
|
-
// Ignore cleanup errors
|
|
166
|
-
}
|
|
167
|
-
throw error;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
// Direct write (faster but not atomic)
|
|
172
|
-
await fs.writeFile(filePath, content, { encoding, mode });
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
logger.error(`Failed to write file: ${filePath}`, error);
|
|
177
|
-
throw error;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Safely writes JSON data to a file.
|
|
182
|
-
*
|
|
183
|
-
* Serializes the data to JSON with pretty formatting (2-space indentation)
|
|
184
|
-
* and writes it using safeWriteFile for atomic operation support.
|
|
185
|
-
*
|
|
186
|
-
* @param filePath - Path to the JSON file to write
|
|
187
|
-
* @param data - Data to serialize and write
|
|
188
|
-
* @param options - Write options (same as safeWriteFile)
|
|
189
|
-
*
|
|
190
|
-
* @example
|
|
191
|
-
* ```typescript
|
|
192
|
-
* // Basic usage
|
|
193
|
-
* await safeWriteJson('/path/to/config.json', { key: 'value' });
|
|
194
|
-
*
|
|
195
|
-
* // With backup
|
|
196
|
-
* await safeWriteJson('/path/to/data.json', userData, { backup: true });
|
|
197
|
-
* ```
|
|
198
|
-
*/
|
|
199
|
-
export async function safeWriteJson(filePath, data, options = {}) {
|
|
200
|
-
const content = JSON.stringify(data, null, 2);
|
|
201
|
-
await safeWriteFile(filePath, content, options);
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Ensures a directory exists, creating it and any parent directories if necessary.
|
|
205
|
-
*
|
|
206
|
-
* @param dirPath - Path to the directory to ensure exists
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* ```typescript
|
|
210
|
-
* await ensureDir('/path/to/nested/directory');
|
|
211
|
-
* ```
|
|
212
|
-
*/
|
|
213
|
-
export async function ensureDir(dirPath) {
|
|
214
|
-
await fs.ensureDir(dirPath);
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Checks if a path exists (file or directory).
|
|
218
|
-
*
|
|
219
|
-
* @param filePath - Path to check
|
|
220
|
-
* @returns True if the path exists, false otherwise
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* ```typescript
|
|
224
|
-
* if (await pathExists('/path/to/file.txt')) {
|
|
225
|
-
* console.log('File exists');
|
|
226
|
-
* }
|
|
227
|
-
* ```
|
|
228
|
-
*/
|
|
229
|
-
export async function pathExists(filePath) {
|
|
230
|
-
return fs.pathExists(filePath);
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Removes a file or directory (recursively for directories).
|
|
234
|
-
*
|
|
235
|
-
* @param filePath - Path to the file or directory to remove
|
|
236
|
-
*
|
|
237
|
-
* @example
|
|
238
|
-
* ```typescript
|
|
239
|
-
* // Remove a file
|
|
240
|
-
* await remove('/path/to/file.txt');
|
|
241
|
-
*
|
|
242
|
-
* // Remove a directory and all its contents
|
|
243
|
-
* await remove('/path/to/directory');
|
|
244
|
-
* ```
|
|
245
|
-
*/
|
|
246
|
-
export async function remove(filePath) {
|
|
247
|
-
await fs.remove(filePath);
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Copies a file or directory to a new location.
|
|
251
|
-
*
|
|
252
|
-
* For directories, copies recursively including all contents.
|
|
253
|
-
*
|
|
254
|
-
* @param src - Source path
|
|
255
|
-
* @param dest - Destination path
|
|
256
|
-
* @param options - Copy options (overwrite, etc.)
|
|
257
|
-
*
|
|
258
|
-
* @example
|
|
259
|
-
* ```typescript
|
|
260
|
-
* // Copy a file
|
|
261
|
-
* await copy('/path/to/source.txt', '/path/to/dest.txt');
|
|
262
|
-
*
|
|
263
|
-
* // Copy a directory
|
|
264
|
-
* await copy('/path/to/source-dir', '/path/to/dest-dir');
|
|
265
|
-
* ```
|
|
266
|
-
*/
|
|
267
|
-
export async function copy(src, dest, options) {
|
|
268
|
-
await fs.copy(src, dest, options);
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Moves a file or directory to a new location.
|
|
272
|
-
*
|
|
273
|
-
* @param src - Source path
|
|
274
|
-
* @param dest - Destination path
|
|
275
|
-
* @param options - Move options (overwrite, etc.)
|
|
276
|
-
*
|
|
277
|
-
* @example
|
|
278
|
-
* ```typescript
|
|
279
|
-
* await move('/path/to/old-location.txt', '/path/to/new-location.txt');
|
|
280
|
-
* ```
|
|
281
|
-
*/
|
|
282
|
-
export async function move(src, dest, options) {
|
|
283
|
-
await fs.move(src, dest, options);
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Gets file or directory statistics.
|
|
287
|
-
*
|
|
288
|
-
* @param filePath - Path to get stats for
|
|
289
|
-
* @returns File stats object, or null if path doesn't exist
|
|
290
|
-
*
|
|
291
|
-
* @example
|
|
292
|
-
* ```typescript
|
|
293
|
-
* const stats = await stat('/path/to/file.txt');
|
|
294
|
-
* if (stats) {
|
|
295
|
-
* console.log(`Size: ${stats.size} bytes`);
|
|
296
|
-
* console.log(`Modified: ${stats.mtime}`);
|
|
297
|
-
* }
|
|
298
|
-
* ```
|
|
299
|
-
*/
|
|
300
|
-
export async function stat(filePath) {
|
|
301
|
-
try {
|
|
302
|
-
return await fs.stat(filePath);
|
|
303
|
-
}
|
|
304
|
-
catch (error) {
|
|
305
|
-
const nodeError = error;
|
|
306
|
-
if (nodeError.code === 'ENOENT') {
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
throw error;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Lists the contents of a directory.
|
|
314
|
-
*
|
|
315
|
-
* @param dirPath - Path to the directory to read
|
|
316
|
-
* @returns Array of file and directory names, or empty array if directory doesn't exist
|
|
317
|
-
*
|
|
318
|
-
* @example
|
|
319
|
-
* ```typescript
|
|
320
|
-
* const files = await readDir('/path/to/directory');
|
|
321
|
-
* for (const file of files) {
|
|
322
|
-
* console.log(file);
|
|
323
|
-
* }
|
|
324
|
-
* ```
|
|
325
|
-
*/
|
|
326
|
-
export async function readDir(dirPath) {
|
|
327
|
-
try {
|
|
328
|
-
return await fs.readdir(dirPath);
|
|
329
|
-
}
|
|
330
|
-
catch (error) {
|
|
331
|
-
const nodeError = error;
|
|
332
|
-
if (nodeError.code === 'ENOENT') {
|
|
333
|
-
return [];
|
|
334
|
-
}
|
|
335
|
-
throw error;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Lists directory contents with file type information.
|
|
340
|
-
*
|
|
341
|
-
* @param dirPath - Path to the directory to read
|
|
342
|
-
* @returns Array of Dirent objects with name and type information
|
|
343
|
-
*
|
|
344
|
-
* @example
|
|
345
|
-
* ```typescript
|
|
346
|
-
* const entries = await readDirWithTypes('/path/to/directory');
|
|
347
|
-
* for (const entry of entries) {
|
|
348
|
-
* if (entry.isFile()) {
|
|
349
|
-
* console.log(`File: ${entry.name}`);
|
|
350
|
-
* } else if (entry.isDirectory()) {
|
|
351
|
-
* console.log(`Directory: ${entry.name}`);
|
|
352
|
-
* }
|
|
353
|
-
* }
|
|
354
|
-
* ```
|
|
355
|
-
*/
|
|
356
|
-
export async function readDirWithTypes(dirPath) {
|
|
357
|
-
try {
|
|
358
|
-
return await fs.readdir(dirPath, { withFileTypes: true });
|
|
359
|
-
}
|
|
360
|
-
catch (error) {
|
|
361
|
-
const nodeError = error;
|
|
362
|
-
if (nodeError.code === 'ENOENT') {
|
|
363
|
-
return [];
|
|
364
|
-
}
|
|
365
|
-
throw error;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Checks if a path is a directory.
|
|
370
|
-
*
|
|
371
|
-
* @param filePath - Path to check
|
|
372
|
-
* @returns True if the path is a directory, false otherwise
|
|
373
|
-
*
|
|
374
|
-
* @example
|
|
375
|
-
* ```typescript
|
|
376
|
-
* if (await isDirectory('/path/to/check')) {
|
|
377
|
-
* console.log('It is a directory');
|
|
378
|
-
* }
|
|
379
|
-
* ```
|
|
380
|
-
*/
|
|
381
|
-
export async function isDirectory(filePath) {
|
|
382
|
-
try {
|
|
383
|
-
const stats = await fs.stat(filePath);
|
|
384
|
-
return stats.isDirectory();
|
|
385
|
-
}
|
|
386
|
-
catch {
|
|
387
|
-
return false;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Checks if a path is a file.
|
|
392
|
-
*
|
|
393
|
-
* @param filePath - Path to check
|
|
394
|
-
* @returns True if the path is a file, false otherwise
|
|
395
|
-
*
|
|
396
|
-
* @example
|
|
397
|
-
* ```typescript
|
|
398
|
-
* if (await isFile('/path/to/check')) {
|
|
399
|
-
* console.log('It is a file');
|
|
400
|
-
* }
|
|
401
|
-
* ```
|
|
402
|
-
*/
|
|
403
|
-
export async function isFile(filePath) {
|
|
404
|
-
try {
|
|
405
|
-
const stats = await fs.stat(filePath);
|
|
406
|
-
return stats.isFile();
|
|
407
|
-
}
|
|
408
|
-
catch {
|
|
409
|
-
return false;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* Checks if a path is a symbolic link.
|
|
414
|
-
*
|
|
415
|
-
* @param filePath - Path to check
|
|
416
|
-
* @returns True if the path is a symbolic link, false otherwise
|
|
417
|
-
*
|
|
418
|
-
* @example
|
|
419
|
-
* ```typescript
|
|
420
|
-
* if (await isSymlink('/path/to/check')) {
|
|
421
|
-
* console.log('It is a symbolic link');
|
|
422
|
-
* }
|
|
423
|
-
* ```
|
|
424
|
-
*/
|
|
425
|
-
export async function isSymlink(filePath) {
|
|
426
|
-
try {
|
|
427
|
-
const stats = await fs.lstat(filePath);
|
|
428
|
-
return stats.isSymbolicLink();
|
|
429
|
-
}
|
|
430
|
-
catch {
|
|
431
|
-
return false;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Gets the size of a file in bytes.
|
|
436
|
-
*
|
|
437
|
-
* @param filePath - Path to the file
|
|
438
|
-
* @returns File size in bytes, or 0 if file doesn't exist
|
|
439
|
-
*
|
|
440
|
-
* @example
|
|
441
|
-
* ```typescript
|
|
442
|
-
* const size = await getFileSize('/path/to/file.txt');
|
|
443
|
-
* console.log(`File size: ${size} bytes`);
|
|
444
|
-
* ```
|
|
445
|
-
*/
|
|
446
|
-
export async function getFileSize(filePath) {
|
|
447
|
-
const stats = await stat(filePath);
|
|
448
|
-
return stats?.size ?? 0;
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Gets the modification time of a file.
|
|
452
|
-
*
|
|
453
|
-
* @param filePath - Path to the file
|
|
454
|
-
* @returns Modification time as Date, or null if file doesn't exist
|
|
455
|
-
*
|
|
456
|
-
* @example
|
|
457
|
-
* ```typescript
|
|
458
|
-
* const mtime = await getModificationTime('/path/to/file.txt');
|
|
459
|
-
* if (mtime) {
|
|
460
|
-
* console.log(`Last modified: ${mtime.toISOString()}`);
|
|
461
|
-
* }
|
|
462
|
-
* ```
|
|
463
|
-
*/
|
|
464
|
-
export async function getModificationTime(filePath) {
|
|
465
|
-
const stats = await stat(filePath);
|
|
466
|
-
return stats?.mtime ?? null;
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Creates an empty file if it doesn't exist, or updates its modification time if it does.
|
|
470
|
-
* Similar to the Unix 'touch' command.
|
|
471
|
-
*
|
|
472
|
-
* @param filePath - Path to the file to touch
|
|
473
|
-
*
|
|
474
|
-
* @example
|
|
475
|
-
* ```typescript
|
|
476
|
-
* await touch('/path/to/file.txt');
|
|
477
|
-
* ```
|
|
478
|
-
*/
|
|
479
|
-
export async function touch(filePath) {
|
|
480
|
-
await fs.ensureFile(filePath);
|
|
481
|
-
const now = new Date();
|
|
482
|
-
await fs.utimes(filePath, now, now);
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* Empties a directory by removing all its contents but keeping the directory itself.
|
|
486
|
-
*
|
|
487
|
-
* @param dirPath - Path to the directory to empty
|
|
488
|
-
*
|
|
489
|
-
* @example
|
|
490
|
-
* ```typescript
|
|
491
|
-
* await emptyDir('/path/to/directory');
|
|
492
|
-
* ```
|
|
493
|
-
*/
|
|
494
|
-
export async function emptyDir(dirPath) {
|
|
495
|
-
await fs.emptyDir(dirPath);
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
|
-
* Reads a file as a Buffer (for binary files).
|
|
499
|
-
*
|
|
500
|
-
* @param filePath - Path to the file to read
|
|
501
|
-
* @returns File content as Buffer, or null if file doesn't exist
|
|
502
|
-
*
|
|
503
|
-
* @example
|
|
504
|
-
* ```typescript
|
|
505
|
-
* const buffer = await readFileBuffer('/path/to/image.png');
|
|
506
|
-
* if (buffer) {
|
|
507
|
-
* console.log(`Read ${buffer.length} bytes`);
|
|
508
|
-
* }
|
|
509
|
-
* ```
|
|
510
|
-
*/
|
|
511
|
-
export async function readFileBuffer(filePath) {
|
|
512
|
-
try {
|
|
513
|
-
return await fs.readFile(filePath);
|
|
514
|
-
}
|
|
515
|
-
catch (error) {
|
|
516
|
-
const nodeError = error;
|
|
517
|
-
if (nodeError.code === 'ENOENT') {
|
|
518
|
-
return null;
|
|
519
|
-
}
|
|
520
|
-
logger.error(`Failed to read file as buffer: ${filePath}`, error);
|
|
521
|
-
throw error;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Writes a Buffer to a file (for binary files).
|
|
526
|
-
*
|
|
527
|
-
* @param filePath - Path to the file to write
|
|
528
|
-
* @param data - Buffer data to write
|
|
529
|
-
* @param options - Write options
|
|
530
|
-
*
|
|
531
|
-
* @example
|
|
532
|
-
* ```typescript
|
|
533
|
-
* const buffer = Buffer.from([0x00, 0x01, 0x02]);
|
|
534
|
-
* await writeFileBuffer('/path/to/file.bin', buffer);
|
|
535
|
-
* ```
|
|
536
|
-
*/
|
|
537
|
-
export async function writeFileBuffer(filePath, data, options = {}) {
|
|
538
|
-
const { createDir = true, atomic = true, backup = false, backupDir, mode } = options;
|
|
539
|
-
try {
|
|
540
|
-
if (createDir) {
|
|
541
|
-
await fs.ensureDir(path.dirname(filePath));
|
|
542
|
-
}
|
|
543
|
-
if (backup && (await fs.pathExists(filePath))) {
|
|
544
|
-
const backupPath = backupDir
|
|
545
|
-
? path.join(backupDir, path.basename(filePath) + '.bak')
|
|
546
|
-
: filePath + '.bak';
|
|
547
|
-
if (backupDir) {
|
|
548
|
-
await fs.ensureDir(backupDir);
|
|
549
|
-
}
|
|
550
|
-
await fs.copy(filePath, backupPath, { overwrite: true });
|
|
551
|
-
}
|
|
552
|
-
if (atomic) {
|
|
553
|
-
const tempPath = `${filePath}.tmp.${Date.now()}.${process.pid}`;
|
|
554
|
-
try {
|
|
555
|
-
await fs.writeFile(tempPath, data, { mode });
|
|
556
|
-
await fs.rename(tempPath, filePath);
|
|
557
|
-
}
|
|
558
|
-
catch (error) {
|
|
559
|
-
try {
|
|
560
|
-
await fs.remove(tempPath);
|
|
561
|
-
}
|
|
562
|
-
catch {
|
|
563
|
-
// Ignore cleanup errors
|
|
564
|
-
}
|
|
565
|
-
throw error;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
else {
|
|
569
|
-
await fs.writeFile(filePath, data, { mode });
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
catch (error) {
|
|
573
|
-
logger.error(`Failed to write buffer to file: ${filePath}`, error);
|
|
574
|
-
throw error;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* Appends content to a file, creating it if it doesn't exist.
|
|
579
|
-
*
|
|
580
|
-
* @param filePath - Path to the file to append to
|
|
581
|
-
* @param content - Content to append
|
|
582
|
-
* @param options - Options including encoding and createDir
|
|
583
|
-
*
|
|
584
|
-
* @example
|
|
585
|
-
* ```typescript
|
|
586
|
-
* await appendFile('/path/to/log.txt', 'New log entry\n');
|
|
587
|
-
* ```
|
|
588
|
-
*/
|
|
589
|
-
export async function appendFile(filePath, content, options = {}) {
|
|
590
|
-
const { encoding = 'utf8', createDir = true } = options;
|
|
591
|
-
try {
|
|
592
|
-
if (createDir) {
|
|
593
|
-
await fs.ensureDir(path.dirname(filePath));
|
|
594
|
-
}
|
|
595
|
-
await fs.appendFile(filePath, content, { encoding });
|
|
596
|
-
}
|
|
597
|
-
catch (error) {
|
|
598
|
-
logger.error(`Failed to append to file: ${filePath}`, error);
|
|
599
|
-
throw error;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* Checks if a file is readable (exists and has read permissions).
|
|
604
|
-
*
|
|
605
|
-
* @param filePath - Path to check
|
|
606
|
-
* @returns True if the file is readable
|
|
607
|
-
*
|
|
608
|
-
* @example
|
|
609
|
-
* ```typescript
|
|
610
|
-
* if (await isReadable('/path/to/file.txt')) {
|
|
611
|
-
* const content = await safeReadFile('/path/to/file.txt');
|
|
612
|
-
* }
|
|
613
|
-
* ```
|
|
614
|
-
*/
|
|
615
|
-
export async function isReadable(filePath) {
|
|
616
|
-
try {
|
|
617
|
-
await fs.access(filePath, fs.constants.R_OK);
|
|
618
|
-
return true;
|
|
619
|
-
}
|
|
620
|
-
catch {
|
|
621
|
-
return false;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Checks if a file is writable (exists and has write permissions, or parent directory is writable).
|
|
626
|
-
*
|
|
627
|
-
* @param filePath - Path to check
|
|
628
|
-
* @returns True if the file is writable
|
|
629
|
-
*
|
|
630
|
-
* @example
|
|
631
|
-
* ```typescript
|
|
632
|
-
* if (await isWritable('/path/to/file.txt')) {
|
|
633
|
-
* await safeWriteFile('/path/to/file.txt', 'content');
|
|
634
|
-
* }
|
|
635
|
-
* ```
|
|
636
|
-
*/
|
|
637
|
-
export async function isWritable(filePath) {
|
|
638
|
-
try {
|
|
639
|
-
// Check if file exists and is writable
|
|
640
|
-
await fs.access(filePath, fs.constants.W_OK);
|
|
641
|
-
return true;
|
|
642
|
-
}
|
|
643
|
-
catch {
|
|
644
|
-
// If file doesn't exist, check if parent directory is writable
|
|
645
|
-
try {
|
|
646
|
-
const parentDir = path.dirname(filePath);
|
|
647
|
-
await fs.access(parentDir, fs.constants.W_OK);
|
|
648
|
-
return true;
|
|
649
|
-
}
|
|
650
|
-
catch {
|
|
651
|
-
return false;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Creates a symbolic link.
|
|
657
|
-
*
|
|
658
|
-
* @param target - Path that the symlink should point to
|
|
659
|
-
* @param linkPath - Path where the symlink should be created
|
|
660
|
-
*
|
|
661
|
-
* @example
|
|
662
|
-
* ```typescript
|
|
663
|
-
* await createSymlink('/path/to/target', '/path/to/link');
|
|
664
|
-
* ```
|
|
665
|
-
*/
|
|
666
|
-
export async function createSymlink(target, linkPath) {
|
|
667
|
-
await fs.ensureDir(path.dirname(linkPath));
|
|
668
|
-
await fs.symlink(target, linkPath);
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* Reads the target of a symbolic link.
|
|
672
|
-
*
|
|
673
|
-
* @param linkPath - Path to the symbolic link
|
|
674
|
-
* @returns The target path, or null if not a symlink
|
|
675
|
-
*
|
|
676
|
-
* @example
|
|
677
|
-
* ```typescript
|
|
678
|
-
* const target = await readSymlink('/path/to/link');
|
|
679
|
-
* if (target) {
|
|
680
|
-
* console.log(`Link points to: ${target}`);
|
|
681
|
-
* }
|
|
682
|
-
* ```
|
|
683
|
-
*/
|
|
684
|
-
export async function readSymlink(linkPath) {
|
|
685
|
-
try {
|
|
686
|
-
return await fs.readlink(linkPath);
|
|
687
|
-
}
|
|
688
|
-
catch {
|
|
689
|
-
return null;
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* Recursively gets all files in a directory.
|
|
694
|
-
*
|
|
695
|
-
* @param dirPath - Path to the directory
|
|
696
|
-
* @param options - Options for filtering
|
|
697
|
-
* @returns Array of file paths relative to dirPath
|
|
698
|
-
*
|
|
699
|
-
* @example
|
|
700
|
-
* ```typescript
|
|
701
|
-
* const files = await getFilesRecursive('/path/to/directory');
|
|
702
|
-
* for (const file of files) {
|
|
703
|
-
* console.log(file);
|
|
704
|
-
* }
|
|
705
|
-
* ```
|
|
706
|
-
*/
|
|
707
|
-
export async function getFilesRecursive(dirPath, options = {}) {
|
|
708
|
-
const { maxDepth, filter } = options;
|
|
709
|
-
const files = [];
|
|
710
|
-
async function traverse(currentPath, depth) {
|
|
711
|
-
if (maxDepth !== undefined && depth > maxDepth) {
|
|
712
|
-
return;
|
|
713
|
-
}
|
|
714
|
-
const entries = await readDirWithTypes(currentPath);
|
|
715
|
-
for (const entry of entries) {
|
|
716
|
-
const fullPath = path.join(currentPath, entry.name);
|
|
717
|
-
const relativePath = path.relative(dirPath, fullPath);
|
|
718
|
-
if (entry.isDirectory()) {
|
|
719
|
-
await traverse(fullPath, depth + 1);
|
|
720
|
-
}
|
|
721
|
-
else if (entry.isFile()) {
|
|
722
|
-
if (!filter || filter(relativePath)) {
|
|
723
|
-
files.push(relativePath);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
if (await isDirectory(dirPath)) {
|
|
729
|
-
await traverse(dirPath, 0);
|
|
730
|
-
}
|
|
731
|
-
return files;
|
|
732
|
-
}
|
|
733
|
-
// =============================================================================
|
|
734
|
-
// Chat Archive Directory Utilities
|
|
735
|
-
// =============================================================================
|
|
736
|
-
/**
|
|
737
|
-
* Gets the full path to the chat archives directory for a project.
|
|
738
|
-
*
|
|
739
|
-
* @param projectPath - Root path of the project
|
|
740
|
-
* @returns Full path to .compass/chats/ directory
|
|
741
|
-
*
|
|
742
|
-
* @example
|
|
743
|
-
* ```typescript
|
|
744
|
-
* const archiveDir = getArchiveDir('/path/to/project');
|
|
745
|
-
* // Returns: '/path/to/project/.compass/chats'
|
|
746
|
-
* ```
|
|
747
|
-
*/
|
|
748
|
-
export function getArchiveDir(projectPath) {
|
|
749
|
-
return path.join(projectPath, PROJECT_COMPASS_DIR, CHAT_ARCHIVE_DIR);
|
|
750
|
-
}
|
|
751
|
-
/**
|
|
752
|
-
* Ensures the chat archives directory exists, creating it if necessary.
|
|
753
|
-
*
|
|
754
|
-
* @param projectPath - Root path of the project
|
|
755
|
-
*
|
|
756
|
-
* @example
|
|
757
|
-
* ```typescript
|
|
758
|
-
* await ensureArchiveDir('/path/to/project');
|
|
759
|
-
* // Creates: /path/to/project/.compass/chats/ if it doesn't exist
|
|
760
|
-
* ```
|
|
761
|
-
*/
|
|
762
|
-
export async function ensureArchiveDir(projectPath) {
|
|
763
|
-
const archiveDir = getArchiveDir(projectPath);
|
|
764
|
-
await fs.ensureDir(archiveDir);
|
|
765
|
-
}
|
|
766
|
-
/**
|
|
767
|
-
* Lists all chat archive JSON files in the archives directory, sorted by filename.
|
|
768
|
-
*
|
|
769
|
-
* Since archive filenames are timestamp-based (YYYY-MM-DD_HH-mm-ss_slug.json),
|
|
770
|
-
* sorting by filename gives chronological order.
|
|
771
|
-
*
|
|
772
|
-
* @param projectPath - Root path of the project
|
|
773
|
-
* @returns Array of archive filenames (not full paths), sorted chronologically
|
|
774
|
-
*
|
|
775
|
-
* @example
|
|
776
|
-
* ```typescript
|
|
777
|
-
* const archives = await listArchiveFiles('/path/to/project');
|
|
778
|
-
* // Returns: ['2024-01-15_10-30-00_fix-auth-bug.json', '2024-01-16_14-22-15_add-feature.json']
|
|
779
|
-
* ```
|
|
780
|
-
*/
|
|
781
|
-
export async function listArchiveFiles(projectPath) {
|
|
782
|
-
const archiveDir = getArchiveDir(projectPath);
|
|
783
|
-
try {
|
|
784
|
-
const entries = await fs.readdir(archiveDir);
|
|
785
|
-
return entries
|
|
786
|
-
.filter((name) => name.endsWith('.json'))
|
|
787
|
-
.sort(); // Chronological due to timestamp-based naming
|
|
788
|
-
}
|
|
789
|
-
catch (error) {
|
|
790
|
-
const nodeError = error;
|
|
791
|
-
if (nodeError.code === 'ENOENT') {
|
|
792
|
-
return []; // Directory doesn't exist yet
|
|
793
|
-
}
|
|
794
|
-
logger.error(`Failed to list archive files: ${archiveDir}`, error);
|
|
795
|
-
throw error;
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
//# sourceMappingURL=file-system.js.map
|