axon-code 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +261 -0
- package/README.zh-CN.md +261 -0
- package/dist/agents/context.d.ts +289 -0
- package/dist/agents/context.d.ts.map +1 -0
- package/dist/agents/context.js +944 -0
- package/dist/agents/context.js.map +1 -0
- package/dist/agents/explore.d.ts +190 -0
- package/dist/agents/explore.d.ts.map +1 -0
- package/dist/agents/explore.js +582 -0
- package/dist/agents/explore.js.map +1 -0
- package/dist/agents/guide.d.ts +117 -0
- package/dist/agents/guide.d.ts.map +1 -0
- package/dist/agents/guide.js +690 -0
- package/dist/agents/guide.js.map +1 -0
- package/dist/agents/index.d.ts +11 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +17 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/monitor.d.ts +343 -0
- package/dist/agents/monitor.d.ts.map +1 -0
- package/dist/agents/monitor.js +963 -0
- package/dist/agents/monitor.js.map +1 -0
- package/dist/agents/parallel.d.ts +305 -0
- package/dist/agents/parallel.d.ts.map +1 -0
- package/dist/agents/parallel.js +717 -0
- package/dist/agents/parallel.js.map +1 -0
- package/dist/agents/plan.d.ts +236 -0
- package/dist/agents/plan.d.ts.map +1 -0
- package/dist/agents/plan.js +292 -0
- package/dist/agents/plan.js.map +1 -0
- package/dist/agents/resume.d.ts +209 -0
- package/dist/agents/resume.d.ts.map +1 -0
- package/dist/agents/resume.js +520 -0
- package/dist/agents/resume.js.map +1 -0
- package/dist/agents/statusline.d.ts +167 -0
- package/dist/agents/statusline.d.ts.map +1 -0
- package/dist/agents/statusline.js +546 -0
- package/dist/agents/statusline.js.map +1 -0
- package/dist/agents/teammate-context.d.ts +163 -0
- package/dist/agents/teammate-context.d.ts.map +1 -0
- package/dist/agents/teammate-context.js +272 -0
- package/dist/agents/teammate-context.js.map +1 -0
- package/dist/agents/tools.d.ts +30 -0
- package/dist/agents/tools.d.ts.map +1 -0
- package/dist/agents/tools.js +116 -0
- package/dist/agents/tools.js.map +1 -0
- package/dist/auth/index.d.ts +204 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +1266 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/keychain.d.ts +74 -0
- package/dist/auth/keychain.d.ts.map +1 -0
- package/dist/auth/keychain.js +181 -0
- package/dist/auth/keychain.js.map +1 -0
- package/dist/auth/settings.d.ts +58 -0
- package/dist/auth/settings.d.ts.map +1 -0
- package/dist/auth/settings.js +260 -0
- package/dist/auth/settings.js.map +1 -0
- package/dist/background/index.d.ts +83 -0
- package/dist/background/index.d.ts.map +1 -0
- package/dist/background/index.js +106 -0
- package/dist/background/index.js.map +1 -0
- package/dist/background/persistence.d.ts +146 -0
- package/dist/background/persistence.d.ts.map +1 -0
- package/dist/background/persistence.js +347 -0
- package/dist/background/persistence.js.map +1 -0
- package/dist/background/shell-manager.d.ts +130 -0
- package/dist/background/shell-manager.d.ts.map +1 -0
- package/dist/background/shell-manager.js +401 -0
- package/dist/background/shell-manager.js.map +1 -0
- package/dist/background/task-queue.d.ts +96 -0
- package/dist/background/task-queue.d.ts.map +1 -0
- package/dist/background/task-queue.js +199 -0
- package/dist/background/task-queue.js.map +1 -0
- package/dist/background/timeout.d.ts +122 -0
- package/dist/background/timeout.d.ts.map +1 -0
- package/dist/background/timeout.js +247 -0
- package/dist/background/timeout.js.map +1 -0
- package/dist/blueprint/agent-decision-maker.d.ts +126 -0
- package/dist/blueprint/agent-decision-maker.d.ts.map +1 -0
- package/dist/blueprint/agent-decision-maker.js +433 -0
- package/dist/blueprint/agent-decision-maker.js.map +1 -0
- package/dist/blueprint/autonomous-worker.d.ts +182 -0
- package/dist/blueprint/autonomous-worker.d.ts.map +1 -0
- package/dist/blueprint/autonomous-worker.js +808 -0
- package/dist/blueprint/autonomous-worker.js.map +1 -0
- package/dist/blueprint/browser-test-tools.d.ts +277 -0
- package/dist/blueprint/browser-test-tools.d.ts.map +1 -0
- package/dist/blueprint/browser-test-tools.js +645 -0
- package/dist/blueprint/browser-test-tools.js.map +1 -0
- package/dist/blueprint/e2e-agent-registry.d.ts +27 -0
- package/dist/blueprint/e2e-agent-registry.d.ts.map +1 -0
- package/dist/blueprint/e2e-agent-registry.js +39 -0
- package/dist/blueprint/e2e-agent-registry.js.map +1 -0
- package/dist/blueprint/e2e-test-agent.d.ts +151 -0
- package/dist/blueprint/e2e-test-agent.d.ts.map +1 -0
- package/dist/blueprint/e2e-test-agent.js +612 -0
- package/dist/blueprint/e2e-test-agent.js.map +1 -0
- package/dist/blueprint/environment-checker.d.ts +113 -0
- package/dist/blueprint/environment-checker.d.ts.map +1 -0
- package/dist/blueprint/environment-checker.js +409 -0
- package/dist/blueprint/environment-checker.js.map +1 -0
- package/dist/blueprint/index.d.ts +26 -0
- package/dist/blueprint/index.d.ts.map +1 -0
- package/dist/blueprint/index.js +50 -0
- package/dist/blueprint/index.js.map +1 -0
- package/dist/blueprint/lead-agent.d.ts +97 -0
- package/dist/blueprint/lead-agent.d.ts.map +1 -0
- package/dist/blueprint/lead-agent.js +905 -0
- package/dist/blueprint/lead-agent.js.map +1 -0
- package/dist/blueprint/model-selector.d.ts +34 -0
- package/dist/blueprint/model-selector.d.ts.map +1 -0
- package/dist/blueprint/model-selector.js +83 -0
- package/dist/blueprint/model-selector.js.map +1 -0
- package/dist/blueprint/planner-session.d.ts +130 -0
- package/dist/blueprint/planner-session.d.ts.map +1 -0
- package/dist/blueprint/planner-session.js +479 -0
- package/dist/blueprint/planner-session.js.map +1 -0
- package/dist/blueprint/realtime-coordinator.d.ts +373 -0
- package/dist/blueprint/realtime-coordinator.d.ts.map +1 -0
- package/dist/blueprint/realtime-coordinator.js +1454 -0
- package/dist/blueprint/realtime-coordinator.js.map +1 -0
- package/dist/blueprint/smart-planner.d.ts +346 -0
- package/dist/blueprint/smart-planner.d.ts.map +1 -0
- package/dist/blueprint/smart-planner.js +2426 -0
- package/dist/blueprint/smart-planner.js.map +1 -0
- package/dist/blueprint/task-queue.d.ts +62 -0
- package/dist/blueprint/task-queue.d.ts.map +1 -0
- package/dist/blueprint/task-queue.js +185 -0
- package/dist/blueprint/task-queue.js.map +1 -0
- package/dist/blueprint/task-reviewer.d.ts +168 -0
- package/dist/blueprint/task-reviewer.d.ts.map +1 -0
- package/dist/blueprint/task-reviewer.js +570 -0
- package/dist/blueprint/task-reviewer.js.map +1 -0
- package/dist/blueprint/types.d.ts +1054 -0
- package/dist/blueprint/types.d.ts.map +1 -0
- package/dist/blueprint/types.js +49 -0
- package/dist/blueprint/types.js.map +1 -0
- package/dist/blueprint/verification-service.d.ts +134 -0
- package/dist/blueprint/verification-service.d.ts.map +1 -0
- package/dist/blueprint/verification-service.js +315 -0
- package/dist/blueprint/verification-service.js.map +1 -0
- package/dist/blueprint/visual-comparator.d.ts +112 -0
- package/dist/blueprint/visual-comparator.d.ts.map +1 -0
- package/dist/blueprint/visual-comparator.js +309 -0
- package/dist/blueprint/visual-comparator.js.map +1 -0
- package/dist/browser/controller.d.ts +188 -0
- package/dist/browser/controller.d.ts.map +1 -0
- package/dist/browser/controller.js +1256 -0
- package/dist/browser/controller.js.map +1 -0
- package/dist/browser/detect.d.ts +14 -0
- package/dist/browser/detect.d.ts.map +1 -0
- package/dist/browser/detect.js +93 -0
- package/dist/browser/detect.js.map +1 -0
- package/dist/browser/errors.d.ts +14 -0
- package/dist/browser/errors.d.ts.map +1 -0
- package/dist/browser/errors.js +45 -0
- package/dist/browser/errors.js.map +1 -0
- package/dist/browser/extension/background-utils.js +53 -0
- package/dist/browser/extension/background.js +895 -0
- package/dist/browser/extension/manifest.json +28 -0
- package/dist/browser/extension/options.html +214 -0
- package/dist/browser/extension/options.js +201 -0
- package/dist/browser/extension-relay-auth.d.ts +18 -0
- package/dist/browser/extension-relay-auth.d.ts.map +1 -0
- package/dist/browser/extension-relay-auth.js +53 -0
- package/dist/browser/extension-relay-auth.js.map +1 -0
- package/dist/browser/extension-relay.d.ts +39 -0
- package/dist/browser/extension-relay.d.ts.map +1 -0
- package/dist/browser/extension-relay.js +855 -0
- package/dist/browser/extension-relay.js.map +1 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +11 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/manager.d.ts +77 -0
- package/dist/browser/manager.d.ts.map +1 -0
- package/dist/browser/manager.js +911 -0
- package/dist/browser/manager.js.map +1 -0
- package/dist/browser/navigation-guard.d.ts +15 -0
- package/dist/browser/navigation-guard.d.ts.map +1 -0
- package/dist/browser/navigation-guard.js +163 -0
- package/dist/browser/navigation-guard.js.map +1 -0
- package/dist/browser/profiles.d.ts +49 -0
- package/dist/browser/profiles.d.ts.map +1 -0
- package/dist/browser/profiles.js +211 -0
- package/dist/browser/profiles.js.map +1 -0
- package/dist/browser/types.d.ts +96 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +5 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/checkpoint/index.d.ts +289 -0
- package/dist/checkpoint/index.d.ts.map +1 -0
- package/dist/checkpoint/index.js +1424 -0
- package/dist/checkpoint/index.js.map +1 -0
- package/dist/chrome/index.d.ts +31 -0
- package/dist/chrome/index.d.ts.map +1 -0
- package/dist/chrome/index.js +41 -0
- package/dist/chrome/index.js.map +1 -0
- package/dist/chrome-mcp/index.d.ts +84 -0
- package/dist/chrome-mcp/index.d.ts.map +1 -0
- package/dist/chrome-mcp/index.js +192 -0
- package/dist/chrome-mcp/index.js.map +1 -0
- package/dist/chrome-mcp/mcp-server.d.ts +115 -0
- package/dist/chrome-mcp/mcp-server.d.ts.map +1 -0
- package/dist/chrome-mcp/mcp-server.js +312 -0
- package/dist/chrome-mcp/mcp-server.js.map +1 -0
- package/dist/chrome-mcp/native-host.d.ts +65 -0
- package/dist/chrome-mcp/native-host.d.ts.map +1 -0
- package/dist/chrome-mcp/native-host.js +357 -0
- package/dist/chrome-mcp/native-host.js.map +1 -0
- package/dist/chrome-mcp/socket-client.d.ts +105 -0
- package/dist/chrome-mcp/socket-client.d.ts.map +1 -0
- package/dist/chrome-mcp/socket-client.js +325 -0
- package/dist/chrome-mcp/socket-client.js.map +1 -0
- package/dist/chrome-mcp/socket-server.d.ts +65 -0
- package/dist/chrome-mcp/socket-server.d.ts.map +1 -0
- package/dist/chrome-mcp/socket-server.js +354 -0
- package/dist/chrome-mcp/socket-server.js.map +1 -0
- package/dist/chrome-mcp/tools.d.ts +22 -0
- package/dist/chrome-mcp/tools.d.ts.map +1 -0
- package/dist/chrome-mcp/tools.js +372 -0
- package/dist/chrome-mcp/tools.js.map +1 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3302 -0
- package/dist/cli.js.map +1 -0
- package/dist/codesign/index.d.ts +84 -0
- package/dist/codesign/index.d.ts.map +1 -0
- package/dist/codesign/index.js +289 -0
- package/dist/codesign/index.js.map +1 -0
- package/dist/commands/api.d.ts +8 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +510 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/auth.d.ts +13 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +713 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/config-cmd.d.ts +12 -0
- package/dist/commands/config-cmd.d.ts.map +1 -0
- package/dist/commands/config-cmd.js +578 -0
- package/dist/commands/config-cmd.js.map +1 -0
- package/dist/commands/config.d.ts +22 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +2457 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/development.d.ts +14 -0
- package/dist/commands/development.d.ts.map +1 -0
- package/dist/commands/development.js +905 -0
- package/dist/commands/development.js.map +1 -0
- package/dist/commands/general.d.ts +15 -0
- package/dist/commands/general.d.ts.map +1 -0
- package/dist/commands/general.js +620 -0
- package/dist/commands/general.js.map +1 -0
- package/dist/commands/index.d.ts +28 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +70 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/registry.d.ts +16 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +55 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/session.d.ts +14 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +1256 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/settings.d.ts +15 -0
- package/dist/commands/settings.d.ts.map +1 -0
- package/dist/commands/settings.js +439 -0
- package/dist/commands/settings.js.map +1 -0
- package/dist/commands/tools.d.ts +14 -0
- package/dist/commands/tools.d.ts.map +1 -0
- package/dist/commands/tools.js +1579 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/commands/types.d.ts +82 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +5 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/utility.d.ts +19 -0
- package/dist/commands/utility.d.ts.map +1 -0
- package/dist/commands/utility.js +738 -0
- package/dist/commands/utility.js.map +1 -0
- package/dist/config/axon-md-parser.d.ts +167 -0
- package/dist/config/axon-md-parser.d.ts.map +1 -0
- package/dist/config/axon-md-parser.js +472 -0
- package/dist/config/axon-md-parser.js.map +1 -0
- package/dist/config/builtin-api.d.ts +2 -0
- package/dist/config/builtin-api.d.ts.map +1 -0
- package/dist/config/builtin-api.js +2 -0
- package/dist/config/builtin-api.js.map +1 -0
- package/dist/config/config-command.d.ts +81 -0
- package/dist/config/config-command.d.ts.map +1 -0
- package/dist/config/config-command.js +292 -0
- package/dist/config/config-command.js.map +1 -0
- package/dist/config/index.d.ts +1700 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +1677 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/keybindings.d.ts +141 -0
- package/dist/config/keybindings.d.ts.map +1 -0
- package/dist/config/keybindings.js +708 -0
- package/dist/config/keybindings.js.map +1 -0
- package/dist/context/__tests__/enhanced.test.d.ts +5 -0
- package/dist/context/__tests__/enhanced.test.d.ts.map +1 -0
- package/dist/context/__tests__/enhanced.test.js +298 -0
- package/dist/context/__tests__/enhanced.test.js.map +1 -0
- package/dist/context/enhanced.d.ts +244 -0
- package/dist/context/enhanced.d.ts.map +1 -0
- package/dist/context/enhanced.js +527 -0
- package/dist/context/enhanced.js.map +1 -0
- package/dist/context/index.d.ts +249 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1043 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/intent-enricher.d.ts +38 -0
- package/dist/context/intent-enricher.d.ts.map +1 -0
- package/dist/context/intent-enricher.js +212 -0
- package/dist/context/intent-enricher.js.map +1 -0
- package/dist/context/link-detector.d.ts +20 -0
- package/dist/context/link-detector.d.ts.map +1 -0
- package/dist/context/link-detector.js +99 -0
- package/dist/context/link-detector.js.map +1 -0
- package/dist/context/session-memory.d.ts +206 -0
- package/dist/context/session-memory.d.ts.map +1 -0
- package/dist/context/session-memory.js +542 -0
- package/dist/context/session-memory.js.map +1 -0
- package/dist/context/summarizer.d.ts +27 -0
- package/dist/context/summarizer.d.ts.map +1 -0
- package/dist/context/summarizer.js +157 -0
- package/dist/context/summarizer.js.map +1 -0
- package/dist/context/window.d.ts +104 -0
- package/dist/context/window.d.ts.map +1 -0
- package/dist/context/window.js +140 -0
- package/dist/context/window.js.map +1 -0
- package/dist/core/backgroundTasks.d.ts +87 -0
- package/dist/core/backgroundTasks.d.ts.map +1 -0
- package/dist/core/backgroundTasks.js +229 -0
- package/dist/core/backgroundTasks.js.map +1 -0
- package/dist/core/cache-keepalive.d.ts +37 -0
- package/dist/core/cache-keepalive.d.ts.map +1 -0
- package/dist/core/cache-keepalive.js +130 -0
- package/dist/core/cache-keepalive.js.map +1 -0
- package/dist/core/client.cache.test.d.ts +13 -0
- package/dist/core/client.cache.test.d.ts.map +1 -0
- package/dist/core/client.cache.test.js +315 -0
- package/dist/core/client.cache.test.js.map +1 -0
- package/dist/core/client.d.ts +306 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +1930 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/cwd-context.d.ts +53 -0
- package/dist/core/cwd-context.d.ts.map +1 -0
- package/dist/core/cwd-context.js +102 -0
- package/dist/core/cwd-context.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/loop.d.ts +401 -0
- package/dist/core/loop.d.ts.map +1 -0
- package/dist/core/loop.js +3375 -0
- package/dist/core/loop.js.map +1 -0
- package/dist/core/retryLogic.d.ts +84 -0
- package/dist/core/retryLogic.d.ts.map +1 -0
- package/dist/core/retryLogic.js +157 -0
- package/dist/core/retryLogic.js.map +1 -0
- package/dist/core/session-context.d.ts +24 -0
- package/dist/core/session-context.d.ts.map +1 -0
- package/dist/core/session-context.js +35 -0
- package/dist/core/session-context.js.map +1 -0
- package/dist/core/session.d.ts +229 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +729 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/validateToolResults.test.d.ts +6 -0
- package/dist/core/validateToolResults.test.d.ts.map +1 -0
- package/dist/core/validateToolResults.test.js +303 -0
- package/dist/core/validateToolResults.test.js.map +1 -0
- package/dist/daemon/alarm.d.ts +62 -0
- package/dist/daemon/alarm.d.ts.map +1 -0
- package/dist/daemon/alarm.js +145 -0
- package/dist/daemon/alarm.js.map +1 -0
- package/dist/daemon/config.d.ts +225 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +104 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/executor.d.ts +52 -0
- package/dist/daemon/executor.d.ts.map +1 -0
- package/dist/daemon/executor.js +288 -0
- package/dist/daemon/executor.js.map +1 -0
- package/dist/daemon/index.d.ts +72 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +394 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/locked.d.ts +15 -0
- package/dist/daemon/locked.d.ts.map +1 -0
- package/dist/daemon/locked.js +16 -0
- package/dist/daemon/locked.js.map +1 -0
- package/dist/daemon/notifier.d.ts +25 -0
- package/dist/daemon/notifier.d.ts.map +1 -0
- package/dist/daemon/notifier.js +87 -0
- package/dist/daemon/notifier.js.map +1 -0
- package/dist/daemon/run-log.d.ts +43 -0
- package/dist/daemon/run-log.d.ts.map +1 -0
- package/dist/daemon/run-log.js +126 -0
- package/dist/daemon/run-log.js.map +1 -0
- package/dist/daemon/scheduler.d.ts +85 -0
- package/dist/daemon/scheduler.d.ts.map +1 -0
- package/dist/daemon/scheduler.js +379 -0
- package/dist/daemon/scheduler.js.map +1 -0
- package/dist/daemon/store.d.ts +94 -0
- package/dist/daemon/store.d.ts.map +1 -0
- package/dist/daemon/store.js +121 -0
- package/dist/daemon/store.js.map +1 -0
- package/dist/daemon/time-parser.d.ts +15 -0
- package/dist/daemon/time-parser.d.ts.map +1 -0
- package/dist/daemon/time-parser.js +68 -0
- package/dist/daemon/time-parser.js.map +1 -0
- package/dist/daemon/watcher.d.ts +34 -0
- package/dist/daemon/watcher.d.ts.map +1 -0
- package/dist/daemon/watcher.js +105 -0
- package/dist/daemon/watcher.js.map +1 -0
- package/dist/database/drivers/mongo.d.ts +14 -0
- package/dist/database/drivers/mongo.d.ts.map +1 -0
- package/dist/database/drivers/mongo.js +112 -0
- package/dist/database/drivers/mongo.js.map +1 -0
- package/dist/database/drivers/mysql.d.ts +13 -0
- package/dist/database/drivers/mysql.d.ts.map +1 -0
- package/dist/database/drivers/mysql.js +76 -0
- package/dist/database/drivers/mysql.js.map +1 -0
- package/dist/database/drivers/postgres.d.ts +13 -0
- package/dist/database/drivers/postgres.d.ts.map +1 -0
- package/dist/database/drivers/postgres.js +79 -0
- package/dist/database/drivers/postgres.js.map +1 -0
- package/dist/database/drivers/redis.d.ts +13 -0
- package/dist/database/drivers/redis.d.ts.map +1 -0
- package/dist/database/drivers/redis.js +100 -0
- package/dist/database/drivers/redis.js.map +1 -0
- package/dist/database/drivers/sqlite.d.ts +13 -0
- package/dist/database/drivers/sqlite.d.ts.map +1 -0
- package/dist/database/drivers/sqlite.js +89 -0
- package/dist/database/drivers/sqlite.js.map +1 -0
- package/dist/database/index.d.ts +21 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +97 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/types.d.ts +54 -0
- package/dist/database/types.d.ts.map +1 -0
- package/dist/database/types.js +2 -0
- package/dist/database/types.js.map +1 -0
- package/dist/debugger/dap-client.d.ts +32 -0
- package/dist/debugger/dap-client.d.ts.map +1 -0
- package/dist/debugger/dap-client.js +108 -0
- package/dist/debugger/dap-client.js.map +1 -0
- package/dist/debugger/index.d.ts +30 -0
- package/dist/debugger/index.d.ts.map +1 -0
- package/dist/debugger/index.js +574 -0
- package/dist/debugger/index.js.map +1 -0
- package/dist/debugger/types.d.ts +59 -0
- package/dist/debugger/types.d.ts.map +1 -0
- package/dist/debugger/types.js +2 -0
- package/dist/debugger/types.js.map +1 -0
- package/dist/diagnostics/index.d.ts +72 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +1013 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/ear/index.d.ts +73 -0
- package/dist/ear/index.d.ts.map +1 -0
- package/dist/ear/index.js +114 -0
- package/dist/ear/index.js.map +1 -0
- package/dist/email-mcp/index.d.ts +12 -0
- package/dist/email-mcp/index.d.ts.map +1 -0
- package/dist/email-mcp/index.js +11 -0
- package/dist/email-mcp/index.js.map +1 -0
- package/dist/email-mcp/mcp-server.d.ts +18 -0
- package/dist/email-mcp/mcp-server.d.ts.map +1 -0
- package/dist/email-mcp/mcp-server.js +381 -0
- package/dist/email-mcp/mcp-server.js.map +1 -0
- package/dist/email-mcp/tools.d.ts +22 -0
- package/dist/email-mcp/tools.d.ts.map +1 -0
- package/dist/email-mcp/tools.js +251 -0
- package/dist/email-mcp/tools.js.map +1 -0
- package/dist/env/index.d.ts +27 -0
- package/dist/env/index.d.ts.map +1 -0
- package/dist/env/index.js +31 -0
- package/dist/env/index.js.map +1 -0
- package/dist/env/manager.d.ts +150 -0
- package/dist/env/manager.d.ts.map +1 -0
- package/dist/env/manager.js +290 -0
- package/dist/env/manager.js.map +1 -0
- package/dist/env/sensitive.d.ts +134 -0
- package/dist/env/sensitive.d.ts.map +1 -0
- package/dist/env/sensitive.js +255 -0
- package/dist/env/sensitive.js.map +1 -0
- package/dist/env/validator.d.ts +93 -0
- package/dist/env/validator.d.ts.map +1 -0
- package/dist/env/validator.js +122 -0
- package/dist/env/validator.js.map +1 -0
- package/dist/env/validators/builtin.d.ts +68 -0
- package/dist/env/validators/builtin.d.ts.map +1 -0
- package/dist/env/validators/builtin.js +294 -0
- package/dist/env/validators/builtin.js.map +1 -0
- package/dist/eye/camera.py +396 -0
- package/dist/eye/index.d.ts +70 -0
- package/dist/eye/index.d.ts.map +1 -0
- package/dist/eye/index.js +356 -0
- package/dist/eye/index.js.map +1 -0
- package/dist/fast-mode/index.d.ts +136 -0
- package/dist/fast-mode/index.d.ts.map +1 -0
- package/dist/fast-mode/index.js +390 -0
- package/dist/fast-mode/index.js.map +1 -0
- package/dist/fast-mode/provider.d.ts +10 -0
- package/dist/fast-mode/provider.d.ts.map +1 -0
- package/dist/fast-mode/provider.js +23 -0
- package/dist/fast-mode/provider.js.map +1 -0
- package/dist/feishu/bot.d.ts +71 -0
- package/dist/feishu/bot.d.ts.map +1 -0
- package/dist/feishu/bot.js +287 -0
- package/dist/feishu/bot.js.map +1 -0
- package/dist/feishu/config.d.ts +54 -0
- package/dist/feishu/config.d.ts.map +1 -0
- package/dist/feishu/config.js +100 -0
- package/dist/feishu/config.js.map +1 -0
- package/dist/feishu/index.d.ts +7 -0
- package/dist/feishu/index.d.ts.map +1 -0
- package/dist/feishu/index.js +5 -0
- package/dist/feishu/index.js.map +1 -0
- package/dist/feishu/message-handler.d.ts +42 -0
- package/dist/feishu/message-handler.d.ts.map +1 -0
- package/dist/feishu/message-handler.js +112 -0
- package/dist/feishu/message-handler.js.map +1 -0
- package/dist/feishu/session-manager.d.ts +57 -0
- package/dist/feishu/session-manager.d.ts.map +1 -0
- package/dist/feishu/session-manager.js +179 -0
- package/dist/feishu/session-manager.js.map +1 -0
- package/dist/feishu-cli.d.ts +34 -0
- package/dist/feishu-cli.d.ts.map +1 -0
- package/dist/feishu-cli.js +132 -0
- package/dist/feishu-cli.js.map +1 -0
- package/dist/git/analysis.d.ts +135 -0
- package/dist/git/analysis.d.ts.map +1 -0
- package/dist/git/analysis.js +259 -0
- package/dist/git/analysis.js.map +1 -0
- package/dist/git/core.d.ts +175 -0
- package/dist/git/core.d.ts.map +1 -0
- package/dist/git/core.js +349 -0
- package/dist/git/core.js.map +1 -0
- package/dist/git/ignore.d.ts +74 -0
- package/dist/git/ignore.d.ts.map +1 -0
- package/dist/git/ignore.js +257 -0
- package/dist/git/ignore.js.map +1 -0
- package/dist/git/index.d.ts +37 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +48 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/operations.d.ts +96 -0
- package/dist/git/operations.d.ts.map +1 -0
- package/dist/git/operations.js +288 -0
- package/dist/git/operations.js.map +1 -0
- package/dist/git/safety.d.ts +107 -0
- package/dist/git/safety.d.ts.map +1 -0
- package/dist/git/safety.js +293 -0
- package/dist/git/safety.js.map +1 -0
- package/dist/github/index.d.ts +58 -0
- package/dist/github/index.d.ts.map +1 -0
- package/dist/github/index.js +246 -0
- package/dist/github/index.js.map +1 -0
- package/dist/goals/goal-daemon.d.ts +54 -0
- package/dist/goals/goal-daemon.d.ts.map +1 -0
- package/dist/goals/goal-daemon.js +171 -0
- package/dist/goals/goal-daemon.js.map +1 -0
- package/dist/goals/goal-evaluator.d.ts +28 -0
- package/dist/goals/goal-evaluator.d.ts.map +1 -0
- package/dist/goals/goal-evaluator.js +117 -0
- package/dist/goals/goal-evaluator.js.map +1 -0
- package/dist/goals/goal-planner.d.ts +21 -0
- package/dist/goals/goal-planner.d.ts.map +1 -0
- package/dist/goals/goal-planner.js +80 -0
- package/dist/goals/goal-planner.js.map +1 -0
- package/dist/goals/goal-store.d.ts +31 -0
- package/dist/goals/goal-store.d.ts.map +1 -0
- package/dist/goals/goal-store.js +238 -0
- package/dist/goals/goal-store.js.map +1 -0
- package/dist/goals/index.d.ts +15 -0
- package/dist/goals/index.d.ts.map +1 -0
- package/dist/goals/index.js +22 -0
- package/dist/goals/index.js.map +1 -0
- package/dist/goals/storage.d.ts +83 -0
- package/dist/goals/storage.d.ts.map +1 -0
- package/dist/goals/storage.js +235 -0
- package/dist/goals/storage.js.map +1 -0
- package/dist/goals/types.d.ts +138 -0
- package/dist/goals/types.d.ts.map +1 -0
- package/dist/goals/types.js +5 -0
- package/dist/goals/types.js.map +1 -0
- package/dist/hooks/blueprint-hooks.d.ts +52 -0
- package/dist/hooks/blueprint-hooks.d.ts.map +1 -0
- package/dist/hooks/blueprint-hooks.js +75 -0
- package/dist/hooks/blueprint-hooks.js.map +1 -0
- package/dist/hooks/index.d.ts +421 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +1225 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.test.d.ts +33 -0
- package/dist/hooks/index.test.d.ts.map +1 -0
- package/dist/hooks/index.test.js +199 -0
- package/dist/hooks/index.test.js.map +1 -0
- package/dist/i18n/index.d.ts +25 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +96 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales/en.d.ts +786 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +865 -0
- package/dist/i18n/locales/en.js.map +1 -0
- package/dist/i18n/locales/zh.d.ts +7 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -0
- package/dist/i18n/locales/zh.js +862 -0
- package/dist/i18n/locales/zh.js.map +1 -0
- package/dist/ide/index.d.ts +81 -0
- package/dist/ide/index.d.ts.map +1 -0
- package/dist/ide/index.js +371 -0
- package/dist/ide/index.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle/index.d.ts +120 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/index.js +178 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lsp/index.d.ts +12 -0
- package/dist/lsp/index.d.ts.map +1 -0
- package/dist/lsp/index.js +20 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/manager.d.ts +307 -0
- package/dist/lsp/manager.d.ts.map +1 -0
- package/dist/lsp/manager.js +1012 -0
- package/dist/lsp/manager.js.map +1 -0
- package/dist/map/index.d.ts +2 -0
- package/dist/map/index.d.ts.map +1 -0
- package/dist/map/index.js +2 -0
- package/dist/map/index.js.map +1 -0
- package/dist/map/types.d.ts +264 -0
- package/dist/map/types.d.ts.map +1 -0
- package/dist/map/types.js +6 -0
- package/dist/map/types.js.map +1 -0
- package/dist/mcp/adapter.d.ts +217 -0
- package/dist/mcp/adapter.d.ts.map +1 -0
- package/dist/mcp/adapter.js +527 -0
- package/dist/mcp/adapter.js.map +1 -0
- package/dist/mcp/auto-discovery.d.ts +303 -0
- package/dist/mcp/auto-discovery.d.ts.map +1 -0
- package/dist/mcp/auto-discovery.js +1009 -0
- package/dist/mcp/auto-discovery.js.map +1 -0
- package/dist/mcp/cancellation.d.ts +258 -0
- package/dist/mcp/cancellation.d.ts.map +1 -0
- package/dist/mcp/cancellation.js +478 -0
- package/dist/mcp/cancellation.js.map +1 -0
- package/dist/mcp/config.d.ts +521 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/config.js +694 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/connection.d.ts +228 -0
- package/dist/mcp/connection.d.ts.map +1 -0
- package/dist/mcp/connection.js +707 -0
- package/dist/mcp/connection.js.map +1 -0
- package/dist/mcp/discovery.d.ts +128 -0
- package/dist/mcp/discovery.d.ts.map +1 -0
- package/dist/mcp/discovery.js +577 -0
- package/dist/mcp/discovery.js.map +1 -0
- package/dist/mcp/errors.d.ts +273 -0
- package/dist/mcp/errors.d.ts.map +1 -0
- package/dist/mcp/errors.js +566 -0
- package/dist/mcp/errors.js.map +1 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +29 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/integration.d.ts +71 -0
- package/dist/mcp/integration.d.ts.map +1 -0
- package/dist/mcp/integration.js +198 -0
- package/dist/mcp/integration.js.map +1 -0
- package/dist/mcp/lifecycle.d.ts +261 -0
- package/dist/mcp/lifecycle.d.ts.map +1 -0
- package/dist/mcp/lifecycle.js +714 -0
- package/dist/mcp/lifecycle.js.map +1 -0
- package/dist/mcp/logging.d.ts +166 -0
- package/dist/mcp/logging.d.ts.map +1 -0
- package/dist/mcp/logging.js +346 -0
- package/dist/mcp/logging.js.map +1 -0
- package/dist/mcp/notifications.d.ts +221 -0
- package/dist/mcp/notifications.d.ts.map +1 -0
- package/dist/mcp/notifications.js +356 -0
- package/dist/mcp/notifications.js.map +1 -0
- package/dist/mcp/protocol.d.ts +516 -0
- package/dist/mcp/protocol.d.ts.map +1 -0
- package/dist/mcp/protocol.js +490 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/resources.d.ts +197 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +432 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/roots.d.ts +149 -0
- package/dist/mcp/roots.d.ts.map +1 -0
- package/dist/mcp/roots.js +368 -0
- package/dist/mcp/roots.js.map +1 -0
- package/dist/mcp/sampling.d.ts +170 -0
- package/dist/mcp/sampling.d.ts.map +1 -0
- package/dist/mcp/sampling.js +373 -0
- package/dist/mcp/sampling.js.map +1 -0
- package/dist/mcp/tools.d.ts +347 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +773 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/websocket-connection.d.ts +164 -0
- package/dist/mcp/websocket-connection.d.ts.map +1 -0
- package/dist/mcp/websocket-connection.js +503 -0
- package/dist/mcp/websocket-connection.js.map +1 -0
- package/dist/mcp-cli.d.ts +26 -0
- package/dist/mcp-cli.d.ts.map +1 -0
- package/dist/mcp-cli.js +366 -0
- package/dist/mcp-cli.js.map +1 -0
- package/dist/media/image.d.ts +91 -0
- package/dist/media/image.d.ts.map +1 -0
- package/dist/media/image.js +400 -0
- package/dist/media/image.js.map +1 -0
- package/dist/media/index.d.ts +66 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +122 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/mime.d.ts +23 -0
- package/dist/media/mime.d.ts.map +1 -0
- package/dist/media/mime.js +110 -0
- package/dist/media/mime.js.map +1 -0
- package/dist/media/office.d.ts +93 -0
- package/dist/media/office.d.ts.map +1 -0
- package/dist/media/office.js +735 -0
- package/dist/media/office.js.map +1 -0
- package/dist/media/pdf.d.ts +132 -0
- package/dist/media/pdf.d.ts.map +1 -0
- package/dist/media/pdf.js +281 -0
- package/dist/media/pdf.js.map +1 -0
- package/dist/media/svg.d.ts +55 -0
- package/dist/media/svg.d.ts.map +1 -0
- package/dist/media/svg.js +217 -0
- package/dist/media/svg.js.map +1 -0
- package/dist/memory/embedding-cache.d.ts +40 -0
- package/dist/memory/embedding-cache.d.ts.map +1 -0
- package/dist/memory/embedding-cache.js +105 -0
- package/dist/memory/embedding-cache.js.map +1 -0
- package/dist/memory/embedding-provider.d.ts +36 -0
- package/dist/memory/embedding-provider.d.ts.map +1 -0
- package/dist/memory/embedding-provider.js +105 -0
- package/dist/memory/embedding-provider.js.map +1 -0
- package/dist/memory/hybrid-search.d.ts +58 -0
- package/dist/memory/hybrid-search.d.ts.map +1 -0
- package/dist/memory/hybrid-search.js +68 -0
- package/dist/memory/hybrid-search.js.map +1 -0
- package/dist/memory/index.d.ts +15 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +12 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/long-term-store.d.ts +131 -0
- package/dist/memory/long-term-store.d.ts.map +1 -0
- package/dist/memory/long-term-store.js +701 -0
- package/dist/memory/long-term-store.js.map +1 -0
- package/dist/memory/memory-search.d.ts +134 -0
- package/dist/memory/memory-search.d.ts.map +1 -0
- package/dist/memory/memory-search.js +338 -0
- package/dist/memory/memory-search.js.map +1 -0
- package/dist/memory/memory-sync.d.ts +66 -0
- package/dist/memory/memory-sync.d.ts.map +1 -0
- package/dist/memory/memory-sync.js +429 -0
- package/dist/memory/memory-sync.js.map +1 -0
- package/dist/memory/mmr.d.ts +34 -0
- package/dist/memory/mmr.d.ts.map +1 -0
- package/dist/memory/mmr.js +101 -0
- package/dist/memory/mmr.js.map +1 -0
- package/dist/memory/notebook.d.ts +80 -0
- package/dist/memory/notebook.d.ts.map +1 -0
- package/dist/memory/notebook.js +320 -0
- package/dist/memory/notebook.js.map +1 -0
- package/dist/memory/query-expansion.d.ts +22 -0
- package/dist/memory/query-expansion.d.ts.map +1 -0
- package/dist/memory/query-expansion.js +60 -0
- package/dist/memory/query-expansion.js.map +1 -0
- package/dist/memory/types.d.ts +16 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +5 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/models/config.d.ts +85 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/models/config.js +427 -0
- package/dist/models/config.js.map +1 -0
- package/dist/models/fallback.d.ts +80 -0
- package/dist/models/fallback.d.ts.map +1 -0
- package/dist/models/fallback.js +215 -0
- package/dist/models/fallback.js.map +1 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +11 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/quota.d.ts +121 -0
- package/dist/models/quota.d.ts.map +1 -0
- package/dist/models/quota.js +397 -0
- package/dist/models/quota.js.map +1 -0
- package/dist/models/stats.d.ts +96 -0
- package/dist/models/stats.d.ts.map +1 -0
- package/dist/models/stats.js +224 -0
- package/dist/models/stats.js.map +1 -0
- package/dist/models/subagent-config.d.ts +119 -0
- package/dist/models/subagent-config.d.ts.map +1 -0
- package/dist/models/subagent-config.js +267 -0
- package/dist/models/subagent-config.js.map +1 -0
- package/dist/models/thinking.d.ts +102 -0
- package/dist/models/thinking.d.ts.map +1 -0
- package/dist/models/thinking.js +213 -0
- package/dist/models/thinking.js.map +1 -0
- package/dist/models/types.d.ts +250 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/models/types.js +33 -0
- package/dist/models/types.js.map +1 -0
- package/dist/network/audit-log.d.ts +93 -0
- package/dist/network/audit-log.d.ts.map +1 -0
- package/dist/network/audit-log.js +319 -0
- package/dist/network/audit-log.js.map +1 -0
- package/dist/network/discovery.d.ts +91 -0
- package/dist/network/discovery.d.ts.map +1 -0
- package/dist/network/discovery.js +398 -0
- package/dist/network/discovery.js.map +1 -0
- package/dist/network/global-proxy.d.ts +19 -0
- package/dist/network/global-proxy.d.ts.map +1 -0
- package/dist/network/global-proxy.js +81 -0
- package/dist/network/global-proxy.js.map +1 -0
- package/dist/network/identity.d.ts +58 -0
- package/dist/network/identity.d.ts.map +1 -0
- package/dist/network/identity.js +267 -0
- package/dist/network/identity.js.map +1 -0
- package/dist/network/index.d.ts +153 -0
- package/dist/network/index.d.ts.map +1 -0
- package/dist/network/index.js +916 -0
- package/dist/network/index.js.map +1 -0
- package/dist/network/permission.d.ts +60 -0
- package/dist/network/permission.d.ts.map +1 -0
- package/dist/network/permission.js +124 -0
- package/dist/network/permission.js.map +1 -0
- package/dist/network/project-probe.d.ts +12 -0
- package/dist/network/project-probe.d.ts.map +1 -0
- package/dist/network/project-probe.js +74 -0
- package/dist/network/project-probe.js.map +1 -0
- package/dist/network/protocol.d.ts +59 -0
- package/dist/network/protocol.d.ts.map +1 -0
- package/dist/network/protocol.js +158 -0
- package/dist/network/protocol.js.map +1 -0
- package/dist/network/proxy.d.ts +93 -0
- package/dist/network/proxy.d.ts.map +1 -0
- package/dist/network/proxy.js +228 -0
- package/dist/network/proxy.js.map +1 -0
- package/dist/network/retry.d.ts +44 -0
- package/dist/network/retry.d.ts.map +1 -0
- package/dist/network/retry.js +110 -0
- package/dist/network/retry.js.map +1 -0
- package/dist/network/router.d.ts +36 -0
- package/dist/network/router.d.ts.map +1 -0
- package/dist/network/router.js +73 -0
- package/dist/network/router.js.map +1 -0
- package/dist/network/timeout.d.ts +59 -0
- package/dist/network/timeout.d.ts.map +1 -0
- package/dist/network/timeout.js +120 -0
- package/dist/network/timeout.js.map +1 -0
- package/dist/network/transport.d.ts +97 -0
- package/dist/network/transport.d.ts.map +1 -0
- package/dist/network/transport.js +397 -0
- package/dist/network/transport.js.map +1 -0
- package/dist/network/types.d.ts +282 -0
- package/dist/network/types.d.ts.map +1 -0
- package/dist/network/types.js +31 -0
- package/dist/network/types.js.map +1 -0
- package/dist/notifications/index.d.ts +161 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +341 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/organization/index.d.ts +125 -0
- package/dist/organization/index.d.ts.map +1 -0
- package/dist/organization/index.js +237 -0
- package/dist/organization/index.js.map +1 -0
- package/dist/permissions/elevated-commands.d.ts +38 -0
- package/dist/permissions/elevated-commands.d.ts.map +1 -0
- package/dist/permissions/elevated-commands.js +256 -0
- package/dist/permissions/elevated-commands.js.map +1 -0
- package/dist/permissions/index.d.ts +120 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +689 -0
- package/dist/permissions/index.js.map +1 -0
- package/dist/permissions/rule-parser.d.ts +396 -0
- package/dist/permissions/rule-parser.d.ts.map +1 -0
- package/dist/permissions/rule-parser.js +990 -0
- package/dist/permissions/rule-parser.js.map +1 -0
- package/dist/permissions/rule-parser.test.d.ts +15 -0
- package/dist/permissions/rule-parser.test.d.ts.map +1 -0
- package/dist/permissions/rule-parser.test.js +489 -0
- package/dist/permissions/rule-parser.test.js.map +1 -0
- package/dist/permissions/shell-security.d.ts +128 -0
- package/dist/permissions/shell-security.d.ts.map +1 -0
- package/dist/permissions/shell-security.js +669 -0
- package/dist/permissions/shell-security.js.map +1 -0
- package/dist/permissions/shell-security.test.d.ts +7 -0
- package/dist/permissions/shell-security.test.d.ts.map +1 -0
- package/dist/permissions/shell-security.test.js +286 -0
- package/dist/permissions/shell-security.test.js.map +1 -0
- package/dist/permissions/tools.d.ts +255 -0
- package/dist/permissions/tools.d.ts.map +1 -0
- package/dist/permissions/tools.js +733 -0
- package/dist/permissions/tools.js.map +1 -0
- package/dist/permissions/tools.test.d.ts +11 -0
- package/dist/permissions/tools.test.d.ts.map +1 -0
- package/dist/permissions/tools.test.js +530 -0
- package/dist/permissions/tools.test.js.map +1 -0
- package/dist/permissions/ui-integration.d.ts +69 -0
- package/dist/permissions/ui-integration.d.ts.map +1 -0
- package/dist/permissions/ui-integration.js +129 -0
- package/dist/permissions/ui-integration.js.map +1 -0
- package/dist/permissions/ui.d.ts +188 -0
- package/dist/permissions/ui.d.ts.map +1 -0
- package/dist/permissions/ui.js +590 -0
- package/dist/permissions/ui.js.map +1 -0
- package/dist/plan/comparison.d.ts +67 -0
- package/dist/plan/comparison.d.ts.map +1 -0
- package/dist/plan/comparison.js +451 -0
- package/dist/plan/comparison.js.map +1 -0
- package/dist/plan/index.d.ts +91 -0
- package/dist/plan/index.d.ts.map +1 -0
- package/dist/plan/index.js +151 -0
- package/dist/plan/index.js.map +1 -0
- package/dist/plan/persistence.d.ts +131 -0
- package/dist/plan/persistence.d.ts.map +1 -0
- package/dist/plan/persistence.js +781 -0
- package/dist/plan/persistence.js.map +1 -0
- package/dist/plan/types.d.ts +353 -0
- package/dist/plan/types.d.ts.map +1 -0
- package/dist/plan/types.js +6 -0
- package/dist/plan/types.js.map +1 -0
- package/dist/plugins/cli.d.ts +14 -0
- package/dist/plugins/cli.d.ts.map +1 -0
- package/dist/plugins/cli.js +1050 -0
- package/dist/plugins/cli.js.map +1 -0
- package/dist/plugins/index.d.ts +621 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +1978 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/marketplace.d.ts +120 -0
- package/dist/plugins/marketplace.d.ts.map +1 -0
- package/dist/plugins/marketplace.js +630 -0
- package/dist/plugins/marketplace.js.map +1 -0
- package/dist/prompt/attachments.d.ts +94 -0
- package/dist/prompt/attachments.d.ts.map +1 -0
- package/dist/prompt/attachments.js +486 -0
- package/dist/prompt/attachments.js.map +1 -0
- package/dist/prompt/builder.d.ts +45 -0
- package/dist/prompt/builder.d.ts.map +1 -0
- package/dist/prompt/builder.js +298 -0
- package/dist/prompt/builder.js.map +1 -0
- package/dist/prompt/cache.d.ts +71 -0
- package/dist/prompt/cache.d.ts.map +1 -0
- package/dist/prompt/cache.js +150 -0
- package/dist/prompt/cache.js.map +1 -0
- package/dist/prompt/index.d.ts +10 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +9 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/templates.d.ts +216 -0
- package/dist/prompt/templates.d.ts.map +1 -0
- package/dist/prompt/templates.js +670 -0
- package/dist/prompt/templates.js.map +1 -0
- package/dist/prompt/types.d.ts +234 -0
- package/dist/prompt/types.d.ts.map +1 -0
- package/dist/prompt/types.js +19 -0
- package/dist/prompt/types.js.map +1 -0
- package/dist/providers/cli.d.ts +14 -0
- package/dist/providers/cli.d.ts.map +1 -0
- package/dist/providers/cli.js +466 -0
- package/dist/providers/cli.js.map +1 -0
- package/dist/providers/index.d.ts +128 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +662 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/vertex.d.ts +174 -0
- package/dist/providers/vertex.d.ts.map +1 -0
- package/dist/providers/vertex.js +499 -0
- package/dist/providers/vertex.js.map +1 -0
- package/dist/proxy/ollama-adapter.d.ts +41 -0
- package/dist/proxy/ollama-adapter.d.ts.map +1 -0
- package/dist/proxy/ollama-adapter.js +669 -0
- package/dist/proxy/ollama-adapter.js.map +1 -0
- package/dist/proxy/server.d.ts +63 -0
- package/dist/proxy/server.d.ts.map +1 -0
- package/dist/proxy/server.js +1160 -0
- package/dist/proxy/server.js.map +1 -0
- package/dist/proxy-cli.d.ts +19 -0
- package/dist/proxy-cli.d.ts.map +1 -0
- package/dist/proxy-cli.js +308 -0
- package/dist/proxy-cli.js.map +1 -0
- package/dist/ratelimit/index.d.ts +252 -0
- package/dist/ratelimit/index.d.ts.map +1 -0
- package/dist/ratelimit/index.js +580 -0
- package/dist/ratelimit/index.js.map +1 -0
- package/dist/renderer/index.d.ts +75 -0
- package/dist/renderer/index.d.ts.map +1 -0
- package/dist/renderer/index.js +383 -0
- package/dist/renderer/index.js.map +1 -0
- package/dist/renderer/tree-render.d.ts +172 -0
- package/dist/renderer/tree-render.d.ts.map +1 -0
- package/dist/renderer/tree-render.js +397 -0
- package/dist/renderer/tree-render.js.map +1 -0
- package/dist/rewind/fileHistory.d.ts +140 -0
- package/dist/rewind/fileHistory.d.ts.map +1 -0
- package/dist/rewind/fileHistory.js +326 -0
- package/dist/rewind/fileHistory.js.map +1 -0
- package/dist/rewind/index.d.ts +8 -0
- package/dist/rewind/index.d.ts.map +1 -0
- package/dist/rewind/index.js +8 -0
- package/dist/rewind/index.js.map +1 -0
- package/dist/rewind/rewindManager.d.ts +98 -0
- package/dist/rewind/rewindManager.d.ts.map +1 -0
- package/dist/rewind/rewindManager.js +199 -0
- package/dist/rewind/rewindManager.js.map +1 -0
- package/dist/rules/index.d.ts +69 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +410 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/sandbox/bubblewrap.d.ts +157 -0
- package/dist/sandbox/bubblewrap.d.ts.map +1 -0
- package/dist/sandbox/bubblewrap.js +637 -0
- package/dist/sandbox/bubblewrap.js.map +1 -0
- package/dist/sandbox/config.d.ts +497 -0
- package/dist/sandbox/config.d.ts.map +1 -0
- package/dist/sandbox/config.js +696 -0
- package/dist/sandbox/config.js.map +1 -0
- package/dist/sandbox/docker.d.ts +104 -0
- package/dist/sandbox/docker.d.ts.map +1 -0
- package/dist/sandbox/docker.js +347 -0
- package/dist/sandbox/docker.js.map +1 -0
- package/dist/sandbox/executor.d.ts +68 -0
- package/dist/sandbox/executor.d.ts.map +1 -0
- package/dist/sandbox/executor.js +341 -0
- package/dist/sandbox/executor.js.map +1 -0
- package/dist/sandbox/filesystem.d.ts +146 -0
- package/dist/sandbox/filesystem.d.ts.map +1 -0
- package/dist/sandbox/filesystem.js +501 -0
- package/dist/sandbox/filesystem.js.map +1 -0
- package/dist/sandbox/index.d.ts +21 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +21 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/network.d.ts +174 -0
- package/dist/sandbox/network.d.ts.map +1 -0
- package/dist/sandbox/network.js +487 -0
- package/dist/sandbox/network.js.map +1 -0
- package/dist/sandbox/resource-limits.d.ts +83 -0
- package/dist/sandbox/resource-limits.d.ts.map +1 -0
- package/dist/sandbox/resource-limits.js +305 -0
- package/dist/sandbox/resource-limits.js.map +1 -0
- package/dist/sandbox/seatbelt.d.ts +70 -0
- package/dist/sandbox/seatbelt.d.ts.map +1 -0
- package/dist/sandbox/seatbelt.js +256 -0
- package/dist/sandbox/seatbelt.js.map +1 -0
- package/dist/search/ripgrep.d.ts +82 -0
- package/dist/search/ripgrep.d.ts.map +1 -0
- package/dist/search/ripgrep.js +399 -0
- package/dist/search/ripgrep.js.map +1 -0
- package/dist/security/skill-scanner.d.ts +18 -0
- package/dist/security/skill-scanner.d.ts.map +1 -0
- package/dist/security/skill-scanner.js +115 -0
- package/dist/security/skill-scanner.js.map +1 -0
- package/dist/session/cleanup.d.ts +62 -0
- package/dist/session/cleanup.d.ts.map +1 -0
- package/dist/session/cleanup.js +218 -0
- package/dist/session/cleanup.js.map +1 -0
- package/dist/session/index.d.ts +584 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +1910 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/list.d.ts +150 -0
- package/dist/session/list.d.ts.map +1 -0
- package/dist/session/list.js +807 -0
- package/dist/session/list.js.map +1 -0
- package/dist/session/resume.d.ts +103 -0
- package/dist/session/resume.d.ts.map +1 -0
- package/dist/session/resume.js +173 -0
- package/dist/session/resume.js.map +1 -0
- package/dist/skills/builtin/skill-hub/SKILL.md +51 -0
- package/dist/skills/builtin/tool-discovery/SKILL.md +194 -0
- package/dist/skills/hub.d.ts +54 -0
- package/dist/skills/hub.d.ts.map +1 -0
- package/dist/skills/hub.js +251 -0
- package/dist/skills/hub.js.map +1 -0
- package/dist/streaming/index.d.ts +115 -0
- package/dist/streaming/index.d.ts.map +1 -0
- package/dist/streaming/index.js +249 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/streaming/message-stream.d.ts +237 -0
- package/dist/streaming/message-stream.d.ts.map +1 -0
- package/dist/streaming/message-stream.js +480 -0
- package/dist/streaming/message-stream.js.map +1 -0
- package/dist/streaming/sse.d.ts +94 -0
- package/dist/streaming/sse.d.ts.map +1 -0
- package/dist/streaming/sse.js +314 -0
- package/dist/streaming/sse.js.map +1 -0
- package/dist/teams/index.d.ts +7 -0
- package/dist/teams/index.d.ts.map +1 -0
- package/dist/teams/index.js +7 -0
- package/dist/teams/index.js.map +1 -0
- package/dist/teams/storage.d.ts +94 -0
- package/dist/teams/storage.d.ts.map +1 -0
- package/dist/teams/storage.js +350 -0
- package/dist/teams/storage.js.map +1 -0
- package/dist/teams/tmux.d.ts +122 -0
- package/dist/teams/tmux.d.ts.map +1 -0
- package/dist/teams/tmux.js +419 -0
- package/dist/teams/tmux.js.map +1 -0
- package/dist/teams/types.d.ts +139 -0
- package/dist/teams/types.d.ts.map +1 -0
- package/dist/teams/types.js +8 -0
- package/dist/teams/types.js.map +1 -0
- package/dist/telemetry/index.d.ts +215 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +776 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/teleport/index.d.ts +43 -0
- package/dist/teleport/index.d.ts.map +1 -0
- package/dist/teleport/index.js +71 -0
- package/dist/teleport/index.js.map +1 -0
- package/dist/teleport/session.d.ts +78 -0
- package/dist/teleport/session.d.ts.map +1 -0
- package/dist/teleport/session.js +273 -0
- package/dist/teleport/session.js.map +1 -0
- package/dist/teleport/types.d.ts +93 -0
- package/dist/teleport/types.d.ts.map +1 -0
- package/dist/teleport/types.js +6 -0
- package/dist/teleport/types.js.map +1 -0
- package/dist/teleport/validation.d.ts +30 -0
- package/dist/teleport/validation.d.ts.map +1 -0
- package/dist/teleport/validation.js +124 -0
- package/dist/teleport/validation.js.map +1 -0
- package/dist/tools/agent-teams.d.ts +26 -0
- package/dist/tools/agent-teams.d.ts.map +1 -0
- package/dist/tools/agent-teams.js +171 -0
- package/dist/tools/agent-teams.js.map +1 -0
- package/dist/tools/agent.d.ts +223 -0
- package/dist/tools/agent.d.ts.map +1 -0
- package/dist/tools/agent.js +1540 -0
- package/dist/tools/agent.js.map +1 -0
- package/dist/tools/ask.d.ts +87 -0
- package/dist/tools/ask.d.ts.map +1 -0
- package/dist/tools/ask.js +572 -0
- package/dist/tools/ask.js.map +1 -0
- package/dist/tools/base.d.ts +89 -0
- package/dist/tools/base.d.ts.map +1 -0
- package/dist/tools/base.js +199 -0
- package/dist/tools/base.js.map +1 -0
- package/dist/tools/bash-history.d.ts +83 -0
- package/dist/tools/bash-history.d.ts.map +1 -0
- package/dist/tools/bash-history.js +245 -0
- package/dist/tools/bash-history.js.map +1 -0
- package/dist/tools/bash.d.ts +214 -0
- package/dist/tools/bash.d.ts.map +1 -0
- package/dist/tools/bash.js +1823 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/blueprint.d.ts +91 -0
- package/dist/tools/blueprint.d.ts.map +1 -0
- package/dist/tools/blueprint.js +618 -0
- package/dist/tools/blueprint.js.map +1 -0
- package/dist/tools/browser.d.ts +28 -0
- package/dist/tools/browser.d.ts.map +1 -0
- package/dist/tools/browser.js +776 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/create-tool.d.ts +63 -0
- package/dist/tools/create-tool.d.ts.map +1 -0
- package/dist/tools/create-tool.js +230 -0
- package/dist/tools/create-tool.js.map +1 -0
- package/dist/tools/database.d.ts +12 -0
- package/dist/tools/database.d.ts.map +1 -0
- package/dist/tools/database.js +223 -0
- package/dist/tools/database.js.map +1 -0
- package/dist/tools/dispatch-worker.d.ts +46 -0
- package/dist/tools/dispatch-worker.d.ts.map +1 -0
- package/dist/tools/dispatch-worker.js +276 -0
- package/dist/tools/dispatch-worker.js.map +1 -0
- package/dist/tools/ear.d.ts +25 -0
- package/dist/tools/ear.d.ts.map +1 -0
- package/dist/tools/ear.js +43 -0
- package/dist/tools/ear.js.map +1 -0
- package/dist/tools/eye.d.ts +29 -0
- package/dist/tools/eye.d.ts.map +1 -0
- package/dist/tools/eye.js +104 -0
- package/dist/tools/eye.js.map +1 -0
- package/dist/tools/file.d.ts +164 -0
- package/dist/tools/file.d.ts.map +1 -0
- package/dist/tools/file.js +1638 -0
- package/dist/tools/file.js.map +1 -0
- package/dist/tools/generate-blueprint.d.ts +62 -0
- package/dist/tools/generate-blueprint.d.ts.map +1 -0
- package/dist/tools/generate-blueprint.js +141 -0
- package/dist/tools/generate-blueprint.js.map +1 -0
- package/dist/tools/generate-design.d.ts +27 -0
- package/dist/tools/generate-design.d.ts.map +1 -0
- package/dist/tools/generate-design.js +66 -0
- package/dist/tools/generate-design.js.map +1 -0
- package/dist/tools/goal.d.ts +56 -0
- package/dist/tools/goal.d.ts.map +1 -0
- package/dist/tools/goal.js +298 -0
- package/dist/tools/goal.js.map +1 -0
- package/dist/tools/index.d.ts +53 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +183 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/mcp-manage.d.ts +32 -0
- package/dist/tools/mcp-manage.d.ts.map +1 -0
- package/dist/tools/mcp-manage.js +61 -0
- package/dist/tools/mcp-manage.js.map +1 -0
- package/dist/tools/mcp.d.ts +311 -0
- package/dist/tools/mcp.d.ts.map +1 -0
- package/dist/tools/mcp.js +1696 -0
- package/dist/tools/mcp.js.map +1 -0
- package/dist/tools/memory-search.d.ts +26 -0
- package/dist/tools/memory-search.d.ts.map +1 -0
- package/dist/tools/memory-search.js +89 -0
- package/dist/tools/memory-search.js.map +1 -0
- package/dist/tools/network-agent.d.ts +55 -0
- package/dist/tools/network-agent.d.ts.map +1 -0
- package/dist/tools/network-agent.js +349 -0
- package/dist/tools/network-agent.js.map +1 -0
- package/dist/tools/notebook-write.d.ts +23 -0
- package/dist/tools/notebook-write.d.ts.map +1 -0
- package/dist/tools/notebook-write.js +86 -0
- package/dist/tools/notebook-write.js.map +1 -0
- package/dist/tools/notebook.d.ts +46 -0
- package/dist/tools/notebook.d.ts.map +1 -0
- package/dist/tools/notebook.js +335 -0
- package/dist/tools/notebook.js.map +1 -0
- package/dist/tools/output-persistence.d.ts +73 -0
- package/dist/tools/output-persistence.d.ts.map +1 -0
- package/dist/tools/output-persistence.js +258 -0
- package/dist/tools/output-persistence.js.map +1 -0
- package/dist/tools/planmode.d.ts +73 -0
- package/dist/tools/planmode.d.ts.map +1 -0
- package/dist/tools/planmode.js +464 -0
- package/dist/tools/planmode.js.map +1 -0
- package/dist/tools/sandbox.d.ts +192 -0
- package/dist/tools/sandbox.d.ts.map +1 -0
- package/dist/tools/sandbox.js +932 -0
- package/dist/tools/sandbox.js.map +1 -0
- package/dist/tools/schedule.d.ts +65 -0
- package/dist/tools/schedule.d.ts.map +1 -0
- package/dist/tools/schedule.js +537 -0
- package/dist/tools/schedule.js.map +1 -0
- package/dist/tools/search.d.ts +48 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +568 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/self-evolve.d.ts +53 -0
- package/dist/tools/self-evolve.d.ts.map +1 -0
- package/dist/tools/self-evolve.js +241 -0
- package/dist/tools/self-evolve.js.map +1 -0
- package/dist/tools/skill.d.ts +182 -0
- package/dist/tools/skill.d.ts.map +1 -0
- package/dist/tools/skill.js +1274 -0
- package/dist/tools/skill.js.map +1 -0
- package/dist/tools/start-lead-agent.d.ts +103 -0
- package/dist/tools/start-lead-agent.d.ts.map +1 -0
- package/dist/tools/start-lead-agent.js +243 -0
- package/dist/tools/start-lead-agent.js.map +1 -0
- package/dist/tools/structured-output.d.ts +80 -0
- package/dist/tools/structured-output.d.ts.map +1 -0
- package/dist/tools/structured-output.js +113 -0
- package/dist/tools/structured-output.js.map +1 -0
- package/dist/tools/submit-e2e-result.d.ts +57 -0
- package/dist/tools/submit-e2e-result.d.ts.map +1 -0
- package/dist/tools/submit-e2e-result.js +161 -0
- package/dist/tools/submit-e2e-result.js.map +1 -0
- package/dist/tools/submit-review.d.ts +42 -0
- package/dist/tools/submit-review.d.ts.map +1 -0
- package/dist/tools/submit-review.js +122 -0
- package/dist/tools/submit-review.js.map +1 -0
- package/dist/tools/task-status.d.ts +33 -0
- package/dist/tools/task-status.d.ts.map +1 -0
- package/dist/tools/task-status.js +86 -0
- package/dist/tools/task-status.js.map +1 -0
- package/dist/tools/task-storage.d.ts +165 -0
- package/dist/tools/task-storage.d.ts.map +1 -0
- package/dist/tools/task-storage.js +354 -0
- package/dist/tools/task-storage.js.map +1 -0
- package/dist/tools/task-v2.d.ts +38 -0
- package/dist/tools/task-v2.d.ts.map +1 -0
- package/dist/tools/task-v2.js +472 -0
- package/dist/tools/task-v2.js.map +1 -0
- package/dist/tools/team.d.ts +51 -0
- package/dist/tools/team.d.ts.map +1 -0
- package/dist/tools/team.js +441 -0
- package/dist/tools/team.js.map +1 -0
- package/dist/tools/todo.d.ts +30 -0
- package/dist/tools/todo.d.ts.map +1 -0
- package/dist/tools/todo.js +204 -0
- package/dist/tools/todo.js.map +1 -0
- package/dist/tools/trigger-e2e-test.d.ts +62 -0
- package/dist/tools/trigger-e2e-test.d.ts.map +1 -0
- package/dist/tools/trigger-e2e-test.js +228 -0
- package/dist/tools/trigger-e2e-test.js.map +1 -0
- package/dist/tools/update-task-plan.d.ts +43 -0
- package/dist/tools/update-task-plan.d.ts.map +1 -0
- package/dist/tools/update-task-plan.js +214 -0
- package/dist/tools/update-task-plan.js.map +1 -0
- package/dist/tools/web.d.ts +78 -0
- package/dist/tools/web.d.ts.map +1 -0
- package/dist/tools/web.js +535 -0
- package/dist/tools/web.js.map +1 -0
- package/dist/trust/index.d.ts +165 -0
- package/dist/trust/index.d.ts.map +1 -0
- package/dist/trust/index.js +408 -0
- package/dist/trust/index.js.map +1 -0
- package/dist/types/config.d.ts +1259 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +245 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/errors.d.ts +389 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +670 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +26 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/messages.d.ts +761 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/messages.js +10 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/results.d.ts +583 -0
- package/dist/types/results.d.ts.map +1 -0
- package/dist/types/results.js +111 -0
- package/dist/types/results.js.map +1 -0
- package/dist/types/tools.d.ts +734 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +9 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/ui/App.d.ts +17 -0
- package/dist/ui/App.d.ts.map +1 -0
- package/dist/ui/App.js +977 -0
- package/dist/ui/App.js.map +1 -0
- package/dist/ui/ChromeSettings.d.ts +18 -0
- package/dist/ui/ChromeSettings.d.ts.map +1 -0
- package/dist/ui/ChromeSettings.js +224 -0
- package/dist/ui/ChromeSettings.js.map +1 -0
- package/dist/ui/LoginSelector.d.ts +29 -0
- package/dist/ui/LoginSelector.d.ts.map +1 -0
- package/dist/ui/LoginSelector.js +168 -0
- package/dist/ui/LoginSelector.js.map +1 -0
- package/dist/ui/McpSettings.d.ts +29 -0
- package/dist/ui/McpSettings.d.ts.map +1 -0
- package/dist/ui/McpSettings.js +689 -0
- package/dist/ui/McpSettings.js.map +1 -0
- package/dist/ui/PluginsDialog.d.ts +21 -0
- package/dist/ui/PluginsDialog.d.ts.map +1 -0
- package/dist/ui/PluginsDialog.js +923 -0
- package/dist/ui/PluginsDialog.js.map +1 -0
- package/dist/ui/autocomplete/bash-history.d.ts +58 -0
- package/dist/ui/autocomplete/bash-history.d.ts.map +1 -0
- package/dist/ui/autocomplete/bash-history.js +196 -0
- package/dist/ui/autocomplete/bash-history.js.map +1 -0
- package/dist/ui/autocomplete/commands.d.ts +25 -0
- package/dist/ui/autocomplete/commands.d.ts.map +1 -0
- package/dist/ui/autocomplete/commands.js +535 -0
- package/dist/ui/autocomplete/commands.js.map +1 -0
- package/dist/ui/autocomplete/example.d.ts +10 -0
- package/dist/ui/autocomplete/example.d.ts.map +1 -0
- package/dist/ui/autocomplete/example.js +118 -0
- package/dist/ui/autocomplete/example.js.map +1 -0
- package/dist/ui/autocomplete/files.d.ts +27 -0
- package/dist/ui/autocomplete/files.d.ts.map +1 -0
- package/dist/ui/autocomplete/files.js +127 -0
- package/dist/ui/autocomplete/files.js.map +1 -0
- package/dist/ui/autocomplete/index.d.ts +25 -0
- package/dist/ui/autocomplete/index.d.ts.map +1 -0
- package/dist/ui/autocomplete/index.js +85 -0
- package/dist/ui/autocomplete/index.js.map +1 -0
- package/dist/ui/autocomplete/mentions.d.ts +29 -0
- package/dist/ui/autocomplete/mentions.d.ts.map +1 -0
- package/dist/ui/autocomplete/mentions.js +170 -0
- package/dist/ui/autocomplete/mentions.js.map +1 -0
- package/dist/ui/autocomplete/types.d.ts +58 -0
- package/dist/ui/autocomplete/types.d.ts.map +1 -0
- package/dist/ui/autocomplete/types.js +110 -0
- package/dist/ui/autocomplete/types.js.map +1 -0
- package/dist/ui/components/AxonMdImportDialog.d.ts +79 -0
- package/dist/ui/components/AxonMdImportDialog.d.ts.map +1 -0
- package/dist/ui/components/AxonMdImportDialog.js +420 -0
- package/dist/ui/components/AxonMdImportDialog.js.map +1 -0
- package/dist/ui/components/BackgroundTasksPanel.d.ts +16 -0
- package/dist/ui/components/BackgroundTasksPanel.d.ts.map +1 -0
- package/dist/ui/components/BackgroundTasksPanel.js +90 -0
- package/dist/ui/components/BackgroundTasksPanel.js.map +1 -0
- package/dist/ui/components/BreathingLight.d.ts +68 -0
- package/dist/ui/components/BreathingLight.d.ts.map +1 -0
- package/dist/ui/components/BreathingLight.js +110 -0
- package/dist/ui/components/BreathingLight.js.map +1 -0
- package/dist/ui/components/DiffView.d.ts +21 -0
- package/dist/ui/components/DiffView.d.ts.map +1 -0
- package/dist/ui/components/DiffView.js +387 -0
- package/dist/ui/components/DiffView.js.map +1 -0
- package/dist/ui/components/Header.d.ts +38 -0
- package/dist/ui/components/Header.d.ts.map +1 -0
- package/dist/ui/components/Header.js +163 -0
- package/dist/ui/components/Header.js.map +1 -0
- package/dist/ui/components/HistorySearch.d.ts +18 -0
- package/dist/ui/components/HistorySearch.d.ts.map +1 -0
- package/dist/ui/components/HistorySearch.js +59 -0
- package/dist/ui/components/HistorySearch.js.map +1 -0
- package/dist/ui/components/HiveConsole.d.ts +45 -0
- package/dist/ui/components/HiveConsole.d.ts.map +1 -0
- package/dist/ui/components/HiveConsole.js +166 -0
- package/dist/ui/components/HiveConsole.js.map +1 -0
- package/dist/ui/components/HiveConsole.test.d.ts +8 -0
- package/dist/ui/components/HiveConsole.test.d.ts.map +1 -0
- package/dist/ui/components/HiveConsole.test.js +330 -0
- package/dist/ui/components/HiveConsole.test.js.map +1 -0
- package/dist/ui/components/Input.d.ts +25 -0
- package/dist/ui/components/Input.d.ts.map +1 -0
- package/dist/ui/components/Input.js +1097 -0
- package/dist/ui/components/Input.js.map +1 -0
- package/dist/ui/components/Message.d.ts +18 -0
- package/dist/ui/components/Message.d.ts.map +1 -0
- package/dist/ui/components/Message.js +212 -0
- package/dist/ui/components/Message.js.map +1 -0
- package/dist/ui/components/MessageSelector.d.ts +66 -0
- package/dist/ui/components/MessageSelector.d.ts.map +1 -0
- package/dist/ui/components/MessageSelector.js +272 -0
- package/dist/ui/components/MessageSelector.js.map +1 -0
- package/dist/ui/components/ModelSelector.d.ts +27 -0
- package/dist/ui/components/ModelSelector.d.ts.map +1 -0
- package/dist/ui/components/ModelSelector.js +135 -0
- package/dist/ui/components/ModelSelector.js.map +1 -0
- package/dist/ui/components/PermissionPrompt.d.ts +44 -0
- package/dist/ui/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/ui/components/PermissionPrompt.js +416 -0
- package/dist/ui/components/PermissionPrompt.js.map +1 -0
- package/dist/ui/components/ProgressBar.d.ts +61 -0
- package/dist/ui/components/ProgressBar.d.ts.map +1 -0
- package/dist/ui/components/ProgressBar.js +174 -0
- package/dist/ui/components/ProgressBar.js.map +1 -0
- package/dist/ui/components/ResumeSession.d.ts +27 -0
- package/dist/ui/components/ResumeSession.d.ts.map +1 -0
- package/dist/ui/components/ResumeSession.js +330 -0
- package/dist/ui/components/ResumeSession.js.map +1 -0
- package/dist/ui/components/SelectInput.d.ts +22 -0
- package/dist/ui/components/SelectInput.d.ts.map +1 -0
- package/dist/ui/components/SelectInput.js +84 -0
- package/dist/ui/components/SelectInput.js.map +1 -0
- package/dist/ui/components/ShortcutHelp.d.ts +12 -0
- package/dist/ui/components/ShortcutHelp.d.ts.map +1 -0
- package/dist/ui/components/ShortcutHelp.js +55 -0
- package/dist/ui/components/ShortcutHelp.js.map +1 -0
- package/dist/ui/components/SkillsDialog.d.ts +12 -0
- package/dist/ui/components/SkillsDialog.d.ts.map +1 -0
- package/dist/ui/components/SkillsDialog.js +239 -0
- package/dist/ui/components/SkillsDialog.js.map +1 -0
- package/dist/ui/components/Spinner.d.ts +81 -0
- package/dist/ui/components/Spinner.d.ts.map +1 -0
- package/dist/ui/components/Spinner.js +165 -0
- package/dist/ui/components/Spinner.js.map +1 -0
- package/dist/ui/components/StatsPanel.d.ts +20 -0
- package/dist/ui/components/StatsPanel.d.ts.map +1 -0
- package/dist/ui/components/StatsPanel.js +584 -0
- package/dist/ui/components/StatsPanel.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +43 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +160 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/StatusBar.test.d.ts +10 -0
- package/dist/ui/components/StatusBar.test.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.test.js +70 -0
- package/dist/ui/components/StatusBar.test.js.map +1 -0
- package/dist/ui/components/TodoList.d.ts +25 -0
- package/dist/ui/components/TodoList.d.ts.map +1 -0
- package/dist/ui/components/TodoList.js +146 -0
- package/dist/ui/components/TodoList.js.map +1 -0
- package/dist/ui/components/ToolCall.d.ts +19 -0
- package/dist/ui/components/ToolCall.d.ts.map +1 -0
- package/dist/ui/components/ToolCall.js +196 -0
- package/dist/ui/components/ToolCall.js.map +1 -0
- package/dist/ui/components/TrustDialog.d.ts +35 -0
- package/dist/ui/components/TrustDialog.d.ts.map +1 -0
- package/dist/ui/components/TrustDialog.js +163 -0
- package/dist/ui/components/TrustDialog.js.map +1 -0
- package/dist/ui/components/UpdateNotification.d.ts +11 -0
- package/dist/ui/components/UpdateNotification.d.ts.map +1 -0
- package/dist/ui/components/UpdateNotification.js +66 -0
- package/dist/ui/components/UpdateNotification.js.map +1 -0
- package/dist/ui/components/WelcomeScreen.d.ts +22 -0
- package/dist/ui/components/WelcomeScreen.d.ts.map +1 -0
- package/dist/ui/components/WelcomeScreen.js +156 -0
- package/dist/ui/components/WelcomeScreen.js.map +1 -0
- package/dist/ui/components/index.d.ts +35 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +25 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +12 -0
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +9 -0
- package/dist/ui/hooks/index.js.map +1 -0
- package/dist/ui/hooks/useAutoScroll.d.ts +22 -0
- package/dist/ui/hooks/useAutoScroll.d.ts.map +1 -0
- package/dist/ui/hooks/useAutoScroll.js +46 -0
- package/dist/ui/hooks/useAutoScroll.js.map +1 -0
- package/dist/ui/hooks/useAxonMdImport.d.ts +57 -0
- package/dist/ui/hooks/useAxonMdImport.d.ts.map +1 -0
- package/dist/ui/hooks/useAxonMdImport.js +248 -0
- package/dist/ui/hooks/useAxonMdImport.js.map +1 -0
- package/dist/ui/hooks/useGlobalKeybindings.d.ts +60 -0
- package/dist/ui/hooks/useGlobalKeybindings.d.ts.map +1 -0
- package/dist/ui/hooks/useGlobalKeybindings.js +460 -0
- package/dist/ui/hooks/useGlobalKeybindings.js.map +1 -0
- package/dist/ui/hooks/useRewind.d.ts +44 -0
- package/dist/ui/hooks/useRewind.d.ts.map +1 -0
- package/dist/ui/hooks/useRewind.js +67 -0
- package/dist/ui/hooks/useRewind.js.map +1 -0
- package/dist/ui/hooks/useTerminalSize.d.ts +32 -0
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/ui/hooks/useTerminalSize.js +70 -0
- package/dist/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/ui/index.d.ts +29 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +42 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/ink-v2/dom-renderer.d.ts +58 -0
- package/dist/ui/ink-v2/dom-renderer.d.ts.map +1 -0
- package/dist/ui/ink-v2/dom-renderer.js +295 -0
- package/dist/ui/ink-v2/dom-renderer.js.map +1 -0
- package/dist/ui/ink-v2/frame.d.ts +25 -0
- package/dist/ui/ink-v2/frame.d.ts.map +1 -0
- package/dist/ui/ink-v2/frame.js +120 -0
- package/dist/ui/ink-v2/frame.js.map +1 -0
- package/dist/ui/ink-v2/index.d.ts +92 -0
- package/dist/ui/ink-v2/index.d.ts.map +1 -0
- package/dist/ui/ink-v2/index.js +185 -0
- package/dist/ui/ink-v2/index.js.map +1 -0
- package/dist/ui/ink-v2/output.d.ts +43 -0
- package/dist/ui/ink-v2/output.d.ts.map +1 -0
- package/dist/ui/ink-v2/output.js +154 -0
- package/dist/ui/ink-v2/output.js.map +1 -0
- package/dist/ui/ink-v2/renderer.d.ts +49 -0
- package/dist/ui/ink-v2/renderer.d.ts.map +1 -0
- package/dist/ui/ink-v2/renderer.js +411 -0
- package/dist/ui/ink-v2/renderer.js.map +1 -0
- package/dist/ui/ink-v2/screen.d.ts +65 -0
- package/dist/ui/ink-v2/screen.d.ts.map +1 -0
- package/dist/ui/ink-v2/screen.js +260 -0
- package/dist/ui/ink-v2/screen.js.map +1 -0
- package/dist/ui/ink-v2/style-pool.d.ts +28 -0
- package/dist/ui/ink-v2/style-pool.d.ts.map +1 -0
- package/dist/ui/ink-v2/style-pool.js +50 -0
- package/dist/ui/ink-v2/style-pool.js.map +1 -0
- package/dist/ui/ink-v2/types.d.ts +138 -0
- package/dist/ui/ink-v2/types.d.ts.map +1 -0
- package/dist/ui/ink-v2/types.js +11 -0
- package/dist/ui/ink-v2/types.js.map +1 -0
- package/dist/ui/markdown-renderer.d.ts +35 -0
- package/dist/ui/markdown-renderer.d.ts.map +1 -0
- package/dist/ui/markdown-renderer.js +369 -0
- package/dist/ui/markdown-renderer.js.map +1 -0
- package/dist/ui/spinner-verbs.d.ts +15 -0
- package/dist/ui/spinner-verbs.d.ts.map +1 -0
- package/dist/ui/spinner-verbs.js +75 -0
- package/dist/ui/spinner-verbs.js.map +1 -0
- package/dist/ui/utils/history-manager.d.ts +41 -0
- package/dist/ui/utils/history-manager.d.ts.map +1 -0
- package/dist/ui/utils/history-manager.js +109 -0
- package/dist/ui/utils/history-manager.js.map +1 -0
- package/dist/ui/utils/index.d.ts +9 -0
- package/dist/ui/utils/index.d.ts.map +1 -0
- package/dist/ui/utils/index.js +10 -0
- package/dist/ui/utils/index.js.map +1 -0
- package/dist/ui/utils/kitty-keyboard.d.ts +239 -0
- package/dist/ui/utils/kitty-keyboard.d.ts.map +1 -0
- package/dist/ui/utils/kitty-keyboard.js +341 -0
- package/dist/ui/utils/kitty-keyboard.js.map +1 -0
- package/dist/ui/utils/string-width.d.ts +36 -0
- package/dist/ui/utils/string-width.d.ts.map +1 -0
- package/dist/ui/utils/string-width.js +339 -0
- package/dist/ui/utils/string-width.js.map +1 -0
- package/dist/ui/utils/syntaxHighlight.d.ts +94 -0
- package/dist/ui/utils/syntaxHighlight.d.ts.map +1 -0
- package/dist/ui/utils/syntaxHighlight.js +415 -0
- package/dist/ui/utils/syntaxHighlight.js.map +1 -0
- package/dist/ui/utils/terminal.d.ts +145 -0
- package/dist/ui/utils/terminal.d.ts.map +1 -0
- package/dist/ui/utils/terminal.js +229 -0
- package/dist/ui/utils/terminal.js.map +1 -0
- package/dist/updater/index.d.ts +115 -0
- package/dist/updater/index.d.ts.map +1 -0
- package/dist/updater/index.js +546 -0
- package/dist/updater/index.js.map +1 -0
- package/dist/utils/AppError.d.ts +24 -0
- package/dist/utils/AppError.d.ts.map +1 -0
- package/dist/utils/AppError.js +33 -0
- package/dist/utils/AppError.js.map +1 -0
- package/dist/utils/AppError.test.d.ts +2 -0
- package/dist/utils/AppError.test.d.ts.map +1 -0
- package/dist/utils/AppError.test.js +257 -0
- package/dist/utils/AppError.test.js.map +1 -0
- package/dist/utils/attribution.d.ts +111 -0
- package/dist/utils/attribution.d.ts.map +1 -0
- package/dist/utils/attribution.js +219 -0
- package/dist/utils/attribution.js.map +1 -0
- package/dist/utils/editor.d.ts +19 -0
- package/dist/utils/editor.d.ts.map +1 -0
- package/dist/utils/editor.js +115 -0
- package/dist/utils/editor.js.map +1 -0
- package/dist/utils/env-check.d.ts +78 -0
- package/dist/utils/env-check.d.ts.map +1 -0
- package/dist/utils/env-check.js +114 -0
- package/dist/utils/env-check.js.map +1 -0
- package/dist/utils/error-watcher.d.ts +78 -0
- package/dist/utils/error-watcher.d.ts.map +1 -0
- package/dist/utils/error-watcher.js +355 -0
- package/dist/utils/error-watcher.js.map +1 -0
- package/dist/utils/git-helper.d.ts +55 -0
- package/dist/utils/git-helper.d.ts.map +1 -0
- package/dist/utils/git-helper.js +238 -0
- package/dist/utils/git-helper.js.map +1 -0
- package/dist/utils/index.d.ts +188 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +472 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +117 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +458 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/package-manager.d.ts +134 -0
- package/dist/utils/package-manager.d.ts.map +1 -0
- package/dist/utils/package-manager.js +325 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/dist/utils/platform.d.ts +283 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +748 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/pr-status.d.ts +50 -0
- package/dist/utils/pr-status.d.ts.map +1 -0
- package/dist/utils/pr-status.js +182 -0
- package/dist/utils/pr-status.js.map +1 -0
- package/dist/utils/retry.d.ts +86 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +202 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/temp-dir.d.ts +31 -0
- package/dist/utils/temp-dir.d.ts.map +1 -0
- package/dist/utils/temp-dir.js +141 -0
- package/dist/utils/temp-dir.js.map +1 -0
- package/dist/utils/terminal-setup.d.ts +31 -0
- package/dist/utils/terminal-setup.d.ts.map +1 -0
- package/dist/utils/terminal-setup.js +224 -0
- package/dist/utils/terminal-setup.js.map +1 -0
- package/dist/utils/terminal-tab.d.ts +15 -0
- package/dist/utils/terminal-tab.d.ts.map +1 -0
- package/dist/utils/terminal-tab.js +173 -0
- package/dist/utils/terminal-tab.js.map +1 -0
- package/dist/utils/token-estimate.d.ts +26 -0
- package/dist/utils/token-estimate.d.ts.map +1 -0
- package/dist/utils/token-estimate.js +62 -0
- package/dist/utils/token-estimate.js.map +1 -0
- package/dist/utils/truncated-buffer.d.ts +70 -0
- package/dist/utils/truncated-buffer.d.ts.map +1 -0
- package/dist/utils/truncated-buffer.js +124 -0
- package/dist/utils/truncated-buffer.js.map +1 -0
- package/dist/version.d.ts +30 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +32 -0
- package/dist/version.js.map +1 -0
- package/dist/web/index.d.ts +7 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +7 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/server/api-manager.d.ts +53 -0
- package/dist/web/server/api-manager.d.ts.map +1 -0
- package/dist/web/server/api-manager.js +271 -0
- package/dist/web/server/api-manager.js.map +1 -0
- package/dist/web/server/channels/adapters/discord.d.ts +41 -0
- package/dist/web/server/channels/adapters/discord.d.ts.map +1 -0
- package/dist/web/server/channels/adapters/discord.js +326 -0
- package/dist/web/server/channels/adapters/discord.js.map +1 -0
- package/dist/web/server/channels/adapters/feishu.d.ts +38 -0
- package/dist/web/server/channels/adapters/feishu.d.ts.map +1 -0
- package/dist/web/server/channels/adapters/feishu.js +442 -0
- package/dist/web/server/channels/adapters/feishu.js.map +1 -0
- package/dist/web/server/channels/adapters/slack-bot.d.ts +30 -0
- package/dist/web/server/channels/adapters/slack-bot.d.ts.map +1 -0
- package/dist/web/server/channels/adapters/slack-bot.js +226 -0
- package/dist/web/server/channels/adapters/slack-bot.js.map +1 -0
- package/dist/web/server/channels/adapters/telegram.d.ts +32 -0
- package/dist/web/server/channels/adapters/telegram.d.ts.map +1 -0
- package/dist/web/server/channels/adapters/telegram.js +261 -0
- package/dist/web/server/channels/adapters/telegram.js.map +1 -0
- package/dist/web/server/channels/adapters/whatsapp.d.ts +48 -0
- package/dist/web/server/channels/adapters/whatsapp.d.ts.map +1 -0
- package/dist/web/server/channels/adapters/whatsapp.js +316 -0
- package/dist/web/server/channels/adapters/whatsapp.js.map +1 -0
- package/dist/web/server/channels/bridge.d.ts +103 -0
- package/dist/web/server/channels/bridge.d.ts.map +1 -0
- package/dist/web/server/channels/bridge.js +728 -0
- package/dist/web/server/channels/bridge.js.map +1 -0
- package/dist/web/server/channels/index.d.ts +71 -0
- package/dist/web/server/channels/index.d.ts.map +1 -0
- package/dist/web/server/channels/index.js +307 -0
- package/dist/web/server/channels/index.js.map +1 -0
- package/dist/web/server/channels/types.d.ts +249 -0
- package/dist/web/server/channels/types.d.ts.map +1 -0
- package/dist/web/server/channels/types.js +8 -0
- package/dist/web/server/channels/types.js.map +1 -0
- package/dist/web/server/checkpoint-manager.d.ts +152 -0
- package/dist/web/server/checkpoint-manager.d.ts.map +1 -0
- package/dist/web/server/checkpoint-manager.js +359 -0
- package/dist/web/server/checkpoint-manager.js.map +1 -0
- package/dist/web/server/connectors/index.d.ts +115 -0
- package/dist/web/server/connectors/index.d.ts.map +1 -0
- package/dist/web/server/connectors/index.js +759 -0
- package/dist/web/server/connectors/index.js.map +1 -0
- package/dist/web/server/connectors/providers.d.ts +6 -0
- package/dist/web/server/connectors/providers.d.ts.map +1 -0
- package/dist/web/server/connectors/providers.js +238 -0
- package/dist/web/server/connectors/providers.js.map +1 -0
- package/dist/web/server/connectors/types.d.ts +79 -0
- package/dist/web/server/connectors/types.d.ts.map +1 -0
- package/dist/web/server/connectors/types.js +5 -0
- package/dist/web/server/connectors/types.js.map +1 -0
- package/dist/web/server/conversation.d.ts +593 -0
- package/dist/web/server/conversation.d.ts.map +1 -0
- package/dist/web/server/conversation.js +5170 -0
- package/dist/web/server/conversation.js.map +1 -0
- package/dist/web/server/database/swarm-logs.d.ts +150 -0
- package/dist/web/server/database/swarm-logs.d.ts.map +1 -0
- package/dist/web/server/database/swarm-logs.js +456 -0
- package/dist/web/server/database/swarm-logs.js.map +1 -0
- package/dist/web/server/doctor.d.ts +59 -0
- package/dist/web/server/doctor.d.ts.map +1 -0
- package/dist/web/server/doctor.js +666 -0
- package/dist/web/server/doctor.js.map +1 -0
- package/dist/web/server/evolve-state.d.ts +30 -0
- package/dist/web/server/evolve-state.d.ts.map +1 -0
- package/dist/web/server/evolve-state.js +54 -0
- package/dist/web/server/evolve-state.js.map +1 -0
- package/dist/web/server/git-manager.d.ts +373 -0
- package/dist/web/server/git-manager.d.ts.map +1 -0
- package/dist/web/server/git-manager.js +1556 -0
- package/dist/web/server/git-manager.js.map +1 -0
- package/dist/web/server/handlers/types.d.ts +95 -0
- package/dist/web/server/handlers/types.d.ts.map +1 -0
- package/dist/web/server/handlers/types.js +22 -0
- package/dist/web/server/handlers/types.js.map +1 -0
- package/dist/web/server/index.d.ts +41 -0
- package/dist/web/server/index.d.ts.map +1 -0
- package/dist/web/server/index.js +935 -0
- package/dist/web/server/index.js.map +1 -0
- package/dist/web/server/oauth-manager.d.ts +89 -0
- package/dist/web/server/oauth-manager.d.ts.map +1 -0
- package/dist/web/server/oauth-manager.js +361 -0
- package/dist/web/server/oauth-manager.js.map +1 -0
- package/dist/web/server/permission-handler.d.ts +170 -0
- package/dist/web/server/permission-handler.d.ts.map +1 -0
- package/dist/web/server/permission-handler.js +591 -0
- package/dist/web/server/permission-handler.js.map +1 -0
- package/dist/web/server/project-suggestions.d.ts +39 -0
- package/dist/web/server/project-suggestions.d.ts.map +1 -0
- package/dist/web/server/project-suggestions.js +365 -0
- package/dist/web/server/project-suggestions.js.map +1 -0
- package/dist/web/server/prompt-snippets.d.ts +92 -0
- package/dist/web/server/prompt-snippets.d.ts.map +1 -0
- package/dist/web/server/prompt-snippets.js +206 -0
- package/dist/web/server/prompt-snippets.js.map +1 -0
- package/dist/web/server/routes/__tests__/artifacts-api.test.d.ts +2 -0
- package/dist/web/server/routes/__tests__/artifacts-api.test.d.ts.map +1 -0
- package/dist/web/server/routes/__tests__/artifacts-api.test.js +572 -0
- package/dist/web/server/routes/__tests__/artifacts-api.test.js.map +1 -0
- package/dist/web/server/routes/agent-api.d.ts +7 -0
- package/dist/web/server/routes/agent-api.d.ts.map +1 -0
- package/dist/web/server/routes/agent-api.js +225 -0
- package/dist/web/server/routes/agent-api.js.map +1 -0
- package/dist/web/server/routes/ai-editor.d.ts +13 -0
- package/dist/web/server/routes/ai-editor.d.ts.map +1 -0
- package/dist/web/server/routes/ai-editor.js +2079 -0
- package/dist/web/server/routes/ai-editor.js.map +1 -0
- package/dist/web/server/routes/ai-hover.d.ts +10 -0
- package/dist/web/server/routes/ai-hover.d.ts.map +1 -0
- package/dist/web/server/routes/ai-hover.js +359 -0
- package/dist/web/server/routes/ai-hover.js.map +1 -0
- package/dist/web/server/routes/api.d.ts +7 -0
- package/dist/web/server/routes/api.d.ts.map +1 -0
- package/dist/web/server/routes/api.js +1200 -0
- package/dist/web/server/routes/api.js.map +1 -0
- package/dist/web/server/routes/artifacts-api.d.ts +15 -0
- package/dist/web/server/routes/artifacts-api.d.ts.map +1 -0
- package/dist/web/server/routes/artifacts-api.js +231 -0
- package/dist/web/server/routes/artifacts-api.js.map +1 -0
- package/dist/web/server/routes/auth.d.ts +7 -0
- package/dist/web/server/routes/auth.d.ts.map +1 -0
- package/dist/web/server/routes/auth.js +292 -0
- package/dist/web/server/routes/auth.js.map +1 -0
- package/dist/web/server/routes/autocomplete-api.d.ts +10 -0
- package/dist/web/server/routes/autocomplete-api.d.ts.map +1 -0
- package/dist/web/server/routes/autocomplete-api.js +302 -0
- package/dist/web/server/routes/autocomplete-api.js.map +1 -0
- package/dist/web/server/routes/axon-cloud.d.ts +7 -0
- package/dist/web/server/routes/axon-cloud.d.ts.map +1 -0
- package/dist/web/server/routes/axon-cloud.js +160 -0
- package/dist/web/server/routes/axon-cloud.js.map +1 -0
- package/dist/web/server/routes/blueprint-api.d.ts +459 -0
- package/dist/web/server/routes/blueprint-api.d.ts.map +1 -0
- package/dist/web/server/routes/blueprint-api.js +6057 -0
- package/dist/web/server/routes/blueprint-api.js.map +1 -0
- package/dist/web/server/routes/blueprint-requirement-api.d.ts +11 -0
- package/dist/web/server/routes/blueprint-requirement-api.d.ts.map +1 -0
- package/dist/web/server/routes/blueprint-requirement-api.js +91 -0
- package/dist/web/server/routes/blueprint-requirement-api.js.map +1 -0
- package/dist/web/server/routes/code-parser.d.ts +14 -0
- package/dist/web/server/routes/code-parser.d.ts.map +1 -0
- package/dist/web/server/routes/code-parser.js +191 -0
- package/dist/web/server/routes/code-parser.js.map +1 -0
- package/dist/web/server/routes/config-api.d.ts +14 -0
- package/dist/web/server/routes/config-api.d.ts.map +1 -0
- package/dist/web/server/routes/config-api.js +670 -0
- package/dist/web/server/routes/config-api.js.map +1 -0
- package/dist/web/server/routes/connectors-api.d.ts +7 -0
- package/dist/web/server/routes/connectors-api.d.ts.map +1 -0
- package/dist/web/server/routes/connectors-api.js +267 -0
- package/dist/web/server/routes/connectors-api.js.map +1 -0
- package/dist/web/server/routes/data-flow-analyzer.d.ts +60 -0
- package/dist/web/server/routes/data-flow-analyzer.d.ts.map +1 -0
- package/dist/web/server/routes/data-flow-analyzer.js +220 -0
- package/dist/web/server/routes/data-flow-analyzer.js.map +1 -0
- package/dist/web/server/routes/download-proxy.d.ts +16 -0
- package/dist/web/server/routes/download-proxy.d.ts.map +1 -0
- package/dist/web/server/routes/download-proxy.js +114 -0
- package/dist/web/server/routes/download-proxy.js.map +1 -0
- package/dist/web/server/routes/file-api.d.ts +18 -0
- package/dist/web/server/routes/file-api.d.ts.map +1 -0
- package/dist/web/server/routes/file-api.js +1514 -0
- package/dist/web/server/routes/file-api.js.map +1 -0
- package/dist/web/server/routes/lsp-analyzer.d.ts +76 -0
- package/dist/web/server/routes/lsp-analyzer.d.ts.map +1 -0
- package/dist/web/server/routes/lsp-analyzer.js +457 -0
- package/dist/web/server/routes/lsp-analyzer.js.map +1 -0
- package/dist/web/server/routes/lsp-api.d.ts +8 -0
- package/dist/web/server/routes/lsp-api.d.ts.map +1 -0
- package/dist/web/server/routes/lsp-api.js +283 -0
- package/dist/web/server/routes/lsp-api.js.map +1 -0
- package/dist/web/server/routes/mcp-cli-api.d.ts +19 -0
- package/dist/web/server/routes/mcp-cli-api.d.ts.map +1 -0
- package/dist/web/server/routes/mcp-cli-api.js +223 -0
- package/dist/web/server/routes/mcp-cli-api.js.map +1 -0
- package/dist/web/server/routes/network-api.d.ts +8 -0
- package/dist/web/server/routes/network-api.d.ts.map +1 -0
- package/dist/web/server/routes/network-api.js +367 -0
- package/dist/web/server/routes/network-api.js.map +1 -0
- package/dist/web/server/routes/notebook-api.d.ts +12 -0
- package/dist/web/server/routes/notebook-api.d.ts.map +1 -0
- package/dist/web/server/routes/notebook-api.js +164 -0
- package/dist/web/server/routes/notebook-api.js.map +1 -0
- package/dist/web/server/routes/port-forward.d.ts +20 -0
- package/dist/web/server/routes/port-forward.d.ts.map +1 -0
- package/dist/web/server/routes/port-forward.js +155 -0
- package/dist/web/server/routes/port-forward.js.map +1 -0
- package/dist/web/server/routes/project-map-generator.d.ts +126 -0
- package/dist/web/server/routes/project-map-generator.d.ts.map +1 -0
- package/dist/web/server/routes/project-map-generator.js +800 -0
- package/dist/web/server/routes/project-map-generator.js.map +1 -0
- package/dist/web/server/routes/schedule-api.d.ts +7 -0
- package/dist/web/server/routes/schedule-api.d.ts.map +1 -0
- package/dist/web/server/routes/schedule-api.js +324 -0
- package/dist/web/server/routes/schedule-api.js.map +1 -0
- package/dist/web/server/routes/symbol-classifier.d.ts +71 -0
- package/dist/web/server/routes/symbol-classifier.d.ts.map +1 -0
- package/dist/web/server/routes/symbol-classifier.js +190 -0
- package/dist/web/server/routes/symbol-classifier.js.map +1 -0
- package/dist/web/server/services/axon-cloud-service.d.ts +95 -0
- package/dist/web/server/services/axon-cloud-service.d.ts.map +1 -0
- package/dist/web/server/services/axon-cloud-service.js +210 -0
- package/dist/web/server/services/axon-cloud-service.js.map +1 -0
- package/dist/web/server/services/config-service.d.ts +436 -0
- package/dist/web/server/services/config-service.d.ts.map +1 -0
- package/dist/web/server/services/config-service.js +872 -0
- package/dist/web/server/services/config-service.js.map +1 -0
- package/dist/web/server/services/gemini-image-service.d.ts +80 -0
- package/dist/web/server/services/gemini-image-service.d.ts.map +1 -0
- package/dist/web/server/services/gemini-image-service.js +373 -0
- package/dist/web/server/services/gemini-image-service.js.map +1 -0
- package/dist/web/server/services/mode-presets.d.ts +40 -0
- package/dist/web/server/services/mode-presets.d.ts.map +1 -0
- package/dist/web/server/services/mode-presets.js +167 -0
- package/dist/web/server/services/mode-presets.js.map +1 -0
- package/dist/web/server/services/proxy-service.d.ts +59 -0
- package/dist/web/server/services/proxy-service.d.ts.map +1 -0
- package/dist/web/server/services/proxy-service.js +132 -0
- package/dist/web/server/services/proxy-service.js.map +1 -0
- package/dist/web/server/session-manager.d.ts +152 -0
- package/dist/web/server/session-manager.d.ts.map +1 -0
- package/dist/web/server/session-manager.js +421 -0
- package/dist/web/server/session-manager.js.map +1 -0
- package/dist/web/server/slash-commands.d.ts +46 -0
- package/dist/web/server/slash-commands.d.ts.map +1 -0
- package/dist/web/server/slash-commands.js +774 -0
- package/dist/web/server/slash-commands.js.map +1 -0
- package/dist/web/server/task-manager.d.ts +190 -0
- package/dist/web/server/task-manager.d.ts.map +1 -0
- package/dist/web/server/task-manager.js +596 -0
- package/dist/web/server/task-manager.js.map +1 -0
- package/dist/web/server/terminal-manager.d.ts +50 -0
- package/dist/web/server/terminal-manager.d.ts.map +1 -0
- package/dist/web/server/terminal-manager.js +274 -0
- package/dist/web/server/terminal-manager.js.map +1 -0
- package/dist/web/server/trpc/appRouter.d.ts +429 -0
- package/dist/web/server/trpc/appRouter.d.ts.map +1 -0
- package/dist/web/server/trpc/appRouter.js +18 -0
- package/dist/web/server/trpc/appRouter.js.map +1 -0
- package/dist/web/server/trpc/index.d.ts +29 -0
- package/dist/web/server/trpc/index.d.ts.map +1 -0
- package/dist/web/server/trpc/index.js +25 -0
- package/dist/web/server/trpc/index.js.map +1 -0
- package/dist/web/server/trpc/routers/blueprint.d.ts +162 -0
- package/dist/web/server/trpc/routers/blueprint.d.ts.map +1 -0
- package/dist/web/server/trpc/routers/blueprint.js +225 -0
- package/dist/web/server/trpc/routers/blueprint.js.map +1 -0
- package/dist/web/server/trpc/routers/coordinator.d.ts +247 -0
- package/dist/web/server/trpc/routers/coordinator.d.ts.map +1 -0
- package/dist/web/server/trpc/routers/coordinator.js +363 -0
- package/dist/web/server/trpc/routers/coordinator.js.map +1 -0
- package/dist/web/server/trpc/routers/execution.d.ts +106 -0
- package/dist/web/server/trpc/routers/execution.d.ts.map +1 -0
- package/dist/web/server/trpc/routers/execution.js +176 -0
- package/dist/web/server/trpc/routers/execution.js.map +1 -0
- package/dist/web/server/user-interaction.d.ts +61 -0
- package/dist/web/server/user-interaction.d.ts.map +1 -0
- package/dist/web/server/user-interaction.js +133 -0
- package/dist/web/server/user-interaction.js.map +1 -0
- package/dist/web/server/web-auth.d.ts +125 -0
- package/dist/web/server/web-auth.d.ts.map +1 -0
- package/dist/web/server/web-auth.js +364 -0
- package/dist/web/server/web-auth.js.map +1 -0
- package/dist/web/server/web-scheduler.d.ts +96 -0
- package/dist/web/server/web-scheduler.d.ts.map +1 -0
- package/dist/web/server/web-scheduler.js +762 -0
- package/dist/web/server/web-scheduler.js.map +1 -0
- package/dist/web/server/websocket-git-handlers.d.ts +107 -0
- package/dist/web/server/websocket-git-handlers.d.ts.map +1 -0
- package/dist/web/server/websocket-git-handlers.js +855 -0
- package/dist/web/server/websocket-git-handlers.js.map +1 -0
- package/dist/web/server/websocket.d.ts +18 -0
- package/dist/web/server/websocket.d.ts.map +1 -0
- package/dist/web/server/websocket.js +6158 -0
- package/dist/web/server/websocket.js.map +1 -0
- package/dist/web/shared/types.d.ts +4100 -0
- package/dist/web/shared/types.d.ts.map +1 -0
- package/dist/web/shared/types.js +123 -0
- package/dist/web/shared/types.js.map +1 -0
- package/dist/web-cli.d.ts +11 -0
- package/dist/web-cli.d.ts.map +1 -0
- package/dist/web-cli.js +196 -0
- package/dist/web-cli.js.map +1 -0
- package/dist/wizard/onboarding.d.ts +13 -0
- package/dist/wizard/onboarding.d.ts.map +1 -0
- package/dist/wizard/onboarding.js +196 -0
- package/dist/wizard/onboarding.js.map +1 -0
- package/electron/README.md +41 -0
- package/electron/main.cjs +341 -0
- package/package.json +236 -0
- package/scripts/postinstall.js +110 -0
|
@@ -0,0 +1,1424 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Checkpointing System
|
|
3
|
+
* Save and restore file states during editing sessions
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Automatic and manual checkpoint creation
|
|
7
|
+
* - Incremental diff-based storage
|
|
8
|
+
* - Git integration
|
|
9
|
+
* - Checkpoint browsing and search
|
|
10
|
+
* - Multi-file restoration
|
|
11
|
+
* - Compression and storage optimization
|
|
12
|
+
*/
|
|
13
|
+
import * as fs from 'fs';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
import * as os from 'os';
|
|
16
|
+
import * as crypto from 'crypto';
|
|
17
|
+
import * as zlib from 'zlib';
|
|
18
|
+
import { execSync } from 'child_process';
|
|
19
|
+
// Checkpoint storage directory
|
|
20
|
+
const CHECKPOINT_DIR = path.join(os.homedir(), '.axon', 'checkpoints');
|
|
21
|
+
const MAX_CHECKPOINTS_PER_FILE = 100;
|
|
22
|
+
const CHECKPOINT_RETENTION_DAYS = 30;
|
|
23
|
+
const DEFAULT_AUTO_CHECKPOINT_INTERVAL = 5; // Create checkpoint every 5 edits
|
|
24
|
+
const MAX_STORAGE_SIZE_MB = 500; // Maximum storage size
|
|
25
|
+
const COMPRESSION_THRESHOLD_BYTES = 1024; // Compress files larger than 1KB
|
|
26
|
+
// Current session
|
|
27
|
+
let currentSession = null;
|
|
28
|
+
/**
|
|
29
|
+
* Initialize checkpoint system
|
|
30
|
+
*/
|
|
31
|
+
export function initCheckpoints(sessionId, autoCheckpointInterval = DEFAULT_AUTO_CHECKPOINT_INTERVAL) {
|
|
32
|
+
if (!fs.existsSync(CHECKPOINT_DIR)) {
|
|
33
|
+
fs.mkdirSync(CHECKPOINT_DIR, { recursive: true });
|
|
34
|
+
}
|
|
35
|
+
const gitBranch = getGitBranch();
|
|
36
|
+
const gitCommit = getGitCommit();
|
|
37
|
+
currentSession = {
|
|
38
|
+
id: sessionId || generateSessionId(),
|
|
39
|
+
startTime: Date.now(),
|
|
40
|
+
workingDirectory: process.cwd(),
|
|
41
|
+
checkpoints: new Map(),
|
|
42
|
+
currentIndex: new Map(),
|
|
43
|
+
editCounts: new Map(),
|
|
44
|
+
autoCheckpointInterval,
|
|
45
|
+
metadata: {
|
|
46
|
+
gitBranch,
|
|
47
|
+
gitCommit,
|
|
48
|
+
totalSize: 0,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
// Clean up old checkpoints
|
|
52
|
+
cleanupOldCheckpoints();
|
|
53
|
+
// Load existing session if resuming
|
|
54
|
+
if (sessionId) {
|
|
55
|
+
loadCheckpointSession(sessionId);
|
|
56
|
+
}
|
|
57
|
+
return currentSession;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Generate session ID
|
|
61
|
+
*/
|
|
62
|
+
function generateSessionId() {
|
|
63
|
+
return `${Date.now().toString(36)}-${crypto.randomBytes(4).toString('hex')}`;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get content hash
|
|
67
|
+
*/
|
|
68
|
+
function getContentHash(content) {
|
|
69
|
+
return crypto.createHash('sha256').update(content).digest('hex').slice(0, 16);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get current git branch
|
|
73
|
+
*/
|
|
74
|
+
function getGitBranch() {
|
|
75
|
+
try {
|
|
76
|
+
return execSync('git rev-parse --abbrev-ref HEAD', {
|
|
77
|
+
cwd: process.cwd(),
|
|
78
|
+
encoding: 'utf-8',
|
|
79
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
80
|
+
}).trim();
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get current git commit
|
|
88
|
+
*/
|
|
89
|
+
function getGitCommit() {
|
|
90
|
+
try {
|
|
91
|
+
return execSync('git rev-parse HEAD', {
|
|
92
|
+
cwd: process.cwd(),
|
|
93
|
+
encoding: 'utf-8',
|
|
94
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
95
|
+
}).trim();
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Check if file is in a git repository
|
|
103
|
+
*/
|
|
104
|
+
function isInGitRepo(filePath) {
|
|
105
|
+
try {
|
|
106
|
+
execSync('git rev-parse --is-inside-work-tree', {
|
|
107
|
+
cwd: path.dirname(filePath),
|
|
108
|
+
encoding: 'utf-8',
|
|
109
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
110
|
+
});
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Compress content using gzip
|
|
119
|
+
*/
|
|
120
|
+
function compressContent(content) {
|
|
121
|
+
return zlib.gzipSync(Buffer.from(content, 'utf-8'));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Decompress content
|
|
125
|
+
*/
|
|
126
|
+
function decompressContent(compressed) {
|
|
127
|
+
return zlib.gunzipSync(compressed).toString('utf-8');
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Calculate simple diff between two strings
|
|
131
|
+
* Returns a compact diff representation
|
|
132
|
+
*/
|
|
133
|
+
function calculateDiff(oldContent, newContent) {
|
|
134
|
+
const oldLines = oldContent.split('\n');
|
|
135
|
+
const newLines = newContent.split('\n');
|
|
136
|
+
const diff = [];
|
|
137
|
+
// Simple LCS-based diff
|
|
138
|
+
const lcs = longestCommonSubsequence(oldLines, newLines);
|
|
139
|
+
let oldIdx = 0;
|
|
140
|
+
let newIdx = 0;
|
|
141
|
+
let lcsIdx = 0;
|
|
142
|
+
while (oldIdx < oldLines.length || newIdx < newLines.length) {
|
|
143
|
+
if (lcsIdx < lcs.length) {
|
|
144
|
+
// Find next common line
|
|
145
|
+
while (oldIdx < oldLines.length && oldLines[oldIdx] !== lcs[lcsIdx]) {
|
|
146
|
+
diff.push({ op: 'del', line: oldLines[oldIdx], num: oldIdx });
|
|
147
|
+
oldIdx++;
|
|
148
|
+
}
|
|
149
|
+
while (newIdx < newLines.length && newLines[newIdx] !== lcs[lcsIdx]) {
|
|
150
|
+
diff.push({ op: 'add', line: newLines[newIdx], num: newIdx });
|
|
151
|
+
newIdx++;
|
|
152
|
+
}
|
|
153
|
+
if (oldIdx < oldLines.length && newIdx < newLines.length) {
|
|
154
|
+
diff.push({ op: 'eq', line: oldLines[oldIdx], num: oldIdx });
|
|
155
|
+
oldIdx++;
|
|
156
|
+
newIdx++;
|
|
157
|
+
lcsIdx++;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
// Remaining lines
|
|
162
|
+
while (oldIdx < oldLines.length) {
|
|
163
|
+
diff.push({ op: 'del', line: oldLines[oldIdx], num: oldIdx });
|
|
164
|
+
oldIdx++;
|
|
165
|
+
}
|
|
166
|
+
while (newIdx < newLines.length) {
|
|
167
|
+
diff.push({ op: 'add', line: newLines[newIdx], num: newIdx });
|
|
168
|
+
newIdx++;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Encode diff as JSON
|
|
173
|
+
return JSON.stringify(diff);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Apply diff to content
|
|
177
|
+
*/
|
|
178
|
+
function applyDiff(oldContent, diffStr) {
|
|
179
|
+
const diff = JSON.parse(diffStr);
|
|
180
|
+
const result = [];
|
|
181
|
+
for (const entry of diff) {
|
|
182
|
+
if (entry.op === 'add' || entry.op === 'eq') {
|
|
183
|
+
result.push(entry.line);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return result.join('\n');
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Longest Common Subsequence algorithm
|
|
190
|
+
*/
|
|
191
|
+
function longestCommonSubsequence(arr1, arr2) {
|
|
192
|
+
const m = arr1.length;
|
|
193
|
+
const n = arr2.length;
|
|
194
|
+
const dp = Array(m + 1)
|
|
195
|
+
.fill(null)
|
|
196
|
+
.map(() => Array(n + 1).fill(0));
|
|
197
|
+
for (let i = 1; i <= m; i++) {
|
|
198
|
+
for (let j = 1; j <= n; j++) {
|
|
199
|
+
if (arr1[i - 1] === arr2[j - 1]) {
|
|
200
|
+
dp[i][j] = dp[i - 1][j - 1] + 1;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Backtrack to find LCS
|
|
208
|
+
const lcs = [];
|
|
209
|
+
let i = m;
|
|
210
|
+
let j = n;
|
|
211
|
+
while (i > 0 && j > 0) {
|
|
212
|
+
if (arr1[i - 1] === arr2[j - 1]) {
|
|
213
|
+
lcs.unshift(arr1[i - 1]);
|
|
214
|
+
i--;
|
|
215
|
+
j--;
|
|
216
|
+
}
|
|
217
|
+
else if (dp[i - 1][j] > dp[i][j - 1]) {
|
|
218
|
+
i--;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
j--;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return lcs;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Create a checkpoint for a file (enhanced version)
|
|
228
|
+
*/
|
|
229
|
+
export function createCheckpoint(filePath, options) {
|
|
230
|
+
if (!currentSession) {
|
|
231
|
+
initCheckpoints();
|
|
232
|
+
}
|
|
233
|
+
const absolutePath = path.resolve(filePath);
|
|
234
|
+
// Check if file exists
|
|
235
|
+
if (!fs.existsSync(absolutePath)) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
try {
|
|
239
|
+
const content = fs.readFileSync(absolutePath, 'utf-8');
|
|
240
|
+
const stats = fs.statSync(absolutePath);
|
|
241
|
+
const hash = getContentHash(content);
|
|
242
|
+
// Check if content is different from last checkpoint
|
|
243
|
+
const existingCheckpoints = currentSession.checkpoints.get(absolutePath) || [];
|
|
244
|
+
if (existingCheckpoints.length > 0 && !options?.forceFullContent) {
|
|
245
|
+
const lastCheckpoint = existingCheckpoints[existingCheckpoints.length - 1];
|
|
246
|
+
if (lastCheckpoint.hash === hash) {
|
|
247
|
+
// Content unchanged, skip
|
|
248
|
+
return lastCheckpoint;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// Get git commit if in repo
|
|
252
|
+
const gitCommit = isInGitRepo(absolutePath) ? getGitCommit() : undefined;
|
|
253
|
+
// Get edit count
|
|
254
|
+
const editCount = currentSession.editCounts.get(absolutePath) || 0;
|
|
255
|
+
// Determine if we should use diff or full content
|
|
256
|
+
const useFullContent = existingCheckpoints.length === 0 || options?.forceFullContent || editCount === 0;
|
|
257
|
+
let checkpointContent;
|
|
258
|
+
let checkpointDiff;
|
|
259
|
+
let compressed = false;
|
|
260
|
+
if (useFullContent) {
|
|
261
|
+
// Store full content
|
|
262
|
+
if (content.length > COMPRESSION_THRESHOLD_BYTES) {
|
|
263
|
+
// Compress large files
|
|
264
|
+
const compressedBuffer = compressContent(content);
|
|
265
|
+
checkpointContent = compressedBuffer.toString('base64');
|
|
266
|
+
compressed = true;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
checkpointContent = content;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
// Store incremental diff
|
|
274
|
+
const lastCheckpoint = existingCheckpoints[existingCheckpoints.length - 1];
|
|
275
|
+
const lastContent = reconstructContent(absolutePath, existingCheckpoints.length - 1);
|
|
276
|
+
checkpointDiff = calculateDiff(lastContent, content);
|
|
277
|
+
}
|
|
278
|
+
const checkpoint = {
|
|
279
|
+
path: absolutePath,
|
|
280
|
+
content: checkpointContent,
|
|
281
|
+
diff: checkpointDiff,
|
|
282
|
+
hash,
|
|
283
|
+
timestamp: Date.now(),
|
|
284
|
+
name: options?.name,
|
|
285
|
+
description: options?.description,
|
|
286
|
+
gitCommit,
|
|
287
|
+
editCount,
|
|
288
|
+
compressed,
|
|
289
|
+
metadata: {
|
|
290
|
+
mode: stats.mode,
|
|
291
|
+
uid: stats.uid,
|
|
292
|
+
gid: stats.gid,
|
|
293
|
+
size: stats.size,
|
|
294
|
+
},
|
|
295
|
+
tags: options?.tags,
|
|
296
|
+
};
|
|
297
|
+
// Add to session
|
|
298
|
+
if (!currentSession.checkpoints.has(absolutePath)) {
|
|
299
|
+
currentSession.checkpoints.set(absolutePath, []);
|
|
300
|
+
}
|
|
301
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
302
|
+
checkpoints.push(checkpoint);
|
|
303
|
+
// Limit checkpoints (keep first and last, remove middle ones if needed)
|
|
304
|
+
if (checkpoints.length > MAX_CHECKPOINTS_PER_FILE) {
|
|
305
|
+
// Keep first checkpoint (base) and recent ones
|
|
306
|
+
const toKeep = MAX_CHECKPOINTS_PER_FILE;
|
|
307
|
+
const toRemove = checkpoints.length - toKeep;
|
|
308
|
+
checkpoints.splice(1, toRemove); // Remove from position 1
|
|
309
|
+
}
|
|
310
|
+
// Update index
|
|
311
|
+
currentSession.currentIndex.set(absolutePath, checkpoints.length - 1);
|
|
312
|
+
// Reset edit count
|
|
313
|
+
currentSession.editCounts.set(absolutePath, 0);
|
|
314
|
+
// Persist checkpoint
|
|
315
|
+
saveCheckpointToDisk(checkpoint);
|
|
316
|
+
// Update total size
|
|
317
|
+
updateSessionSize();
|
|
318
|
+
// Check storage limits
|
|
319
|
+
enforceStorageLimits();
|
|
320
|
+
return checkpoint;
|
|
321
|
+
}
|
|
322
|
+
catch (err) {
|
|
323
|
+
console.error(`Failed to create checkpoint for ${filePath}:`, err);
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Auto-checkpoint: called after each file edit
|
|
329
|
+
*/
|
|
330
|
+
export function trackFileEdit(filePath) {
|
|
331
|
+
if (!currentSession) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
const absolutePath = path.resolve(filePath);
|
|
335
|
+
const editCount = (currentSession.editCounts.get(absolutePath) || 0) + 1;
|
|
336
|
+
currentSession.editCounts.set(absolutePath, editCount);
|
|
337
|
+
// Auto-checkpoint if threshold reached
|
|
338
|
+
if (editCount >= currentSession.autoCheckpointInterval) {
|
|
339
|
+
createCheckpoint(absolutePath, {
|
|
340
|
+
name: `Auto-checkpoint at ${editCount} edits`,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Reconstruct file content from checkpoints
|
|
346
|
+
*/
|
|
347
|
+
function reconstructContent(filePath, checkpointIndex) {
|
|
348
|
+
if (!currentSession) {
|
|
349
|
+
throw new Error('No active session');
|
|
350
|
+
}
|
|
351
|
+
const absolutePath = path.resolve(filePath);
|
|
352
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
353
|
+
if (!checkpoints || checkpointIndex < 0 || checkpointIndex >= checkpoints.length) {
|
|
354
|
+
throw new Error('Invalid checkpoint index');
|
|
355
|
+
}
|
|
356
|
+
// Find the last full content checkpoint at or before this index
|
|
357
|
+
let baseIndex = checkpointIndex;
|
|
358
|
+
while (baseIndex >= 0 && !checkpoints[baseIndex].content) {
|
|
359
|
+
baseIndex--;
|
|
360
|
+
}
|
|
361
|
+
if (baseIndex < 0) {
|
|
362
|
+
throw new Error('No base checkpoint found');
|
|
363
|
+
}
|
|
364
|
+
let content = checkpoints[baseIndex].content;
|
|
365
|
+
// Decompress if needed
|
|
366
|
+
if (checkpoints[baseIndex].compressed) {
|
|
367
|
+
const buffer = Buffer.from(content, 'base64');
|
|
368
|
+
content = decompressContent(buffer);
|
|
369
|
+
}
|
|
370
|
+
// Apply diffs from base to target
|
|
371
|
+
for (let i = baseIndex + 1; i <= checkpointIndex; i++) {
|
|
372
|
+
if (checkpoints[i].diff) {
|
|
373
|
+
content = applyDiff(content, checkpoints[i].diff);
|
|
374
|
+
}
|
|
375
|
+
else if (checkpoints[i].content) {
|
|
376
|
+
// Full content checkpoint
|
|
377
|
+
content = checkpoints[i].content;
|
|
378
|
+
if (checkpoints[i].compressed) {
|
|
379
|
+
const buffer = Buffer.from(content, 'base64');
|
|
380
|
+
content = decompressContent(buffer);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return content;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Save checkpoint to disk
|
|
388
|
+
*/
|
|
389
|
+
function saveCheckpointToDisk(checkpoint) {
|
|
390
|
+
if (!currentSession)
|
|
391
|
+
return;
|
|
392
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
393
|
+
if (!fs.existsSync(sessionDir)) {
|
|
394
|
+
fs.mkdirSync(sessionDir, { recursive: true });
|
|
395
|
+
}
|
|
396
|
+
// Use hash of file path as filename
|
|
397
|
+
const fileHash = getContentHash(checkpoint.path);
|
|
398
|
+
const checkpointFile = path.join(sessionDir, `${fileHash}-${checkpoint.timestamp}.json`);
|
|
399
|
+
fs.writeFileSync(checkpointFile, JSON.stringify(checkpoint, null, 2), {
|
|
400
|
+
mode: 0o600,
|
|
401
|
+
});
|
|
402
|
+
// Save session metadata
|
|
403
|
+
saveSessionMetadata();
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Save session metadata
|
|
407
|
+
*/
|
|
408
|
+
function saveSessionMetadata() {
|
|
409
|
+
if (!currentSession)
|
|
410
|
+
return;
|
|
411
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
412
|
+
const metadataFile = path.join(sessionDir, 'session.json');
|
|
413
|
+
const metadata = {
|
|
414
|
+
id: currentSession.id,
|
|
415
|
+
startTime: currentSession.startTime,
|
|
416
|
+
workingDirectory: currentSession.workingDirectory,
|
|
417
|
+
autoCheckpointInterval: currentSession.autoCheckpointInterval,
|
|
418
|
+
metadata: currentSession.metadata,
|
|
419
|
+
files: Array.from(currentSession.checkpoints.keys()),
|
|
420
|
+
};
|
|
421
|
+
fs.writeFileSync(metadataFile, JSON.stringify(metadata, null, 2), {
|
|
422
|
+
mode: 0o600,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Load checkpoint session from disk
|
|
427
|
+
*/
|
|
428
|
+
function loadCheckpointSession(sessionId) {
|
|
429
|
+
if (!currentSession)
|
|
430
|
+
return;
|
|
431
|
+
const sessionDir = path.join(CHECKPOINT_DIR, sessionId);
|
|
432
|
+
if (!fs.existsSync(sessionDir)) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
try {
|
|
436
|
+
// Load all checkpoint files
|
|
437
|
+
const files = fs.readdirSync(sessionDir);
|
|
438
|
+
for (const file of files) {
|
|
439
|
+
if (file === 'session.json')
|
|
440
|
+
continue;
|
|
441
|
+
if (!file.endsWith('.json'))
|
|
442
|
+
continue;
|
|
443
|
+
const filePath = path.join(sessionDir, file);
|
|
444
|
+
const checkpoint = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
445
|
+
// Add to session
|
|
446
|
+
if (!currentSession.checkpoints.has(checkpoint.path)) {
|
|
447
|
+
currentSession.checkpoints.set(checkpoint.path, []);
|
|
448
|
+
}
|
|
449
|
+
currentSession.checkpoints.get(checkpoint.path).push(checkpoint);
|
|
450
|
+
}
|
|
451
|
+
// Sort checkpoints by timestamp
|
|
452
|
+
for (const [, checkpoints] of currentSession.checkpoints) {
|
|
453
|
+
checkpoints.sort((a, b) => a.timestamp - b.timestamp);
|
|
454
|
+
}
|
|
455
|
+
// Update indices
|
|
456
|
+
for (const [filePath, checkpoints] of currentSession.checkpoints) {
|
|
457
|
+
currentSession.currentIndex.set(filePath, checkpoints.length - 1);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
catch (err) {
|
|
461
|
+
console.error(`Failed to load checkpoint session ${sessionId}:`, err);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Update session total size
|
|
466
|
+
*/
|
|
467
|
+
function updateSessionSize() {
|
|
468
|
+
if (!currentSession)
|
|
469
|
+
return;
|
|
470
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
471
|
+
if (!fs.existsSync(sessionDir)) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
let totalSize = 0;
|
|
475
|
+
try {
|
|
476
|
+
const files = fs.readdirSync(sessionDir);
|
|
477
|
+
for (const file of files) {
|
|
478
|
+
const filePath = path.join(sessionDir, file);
|
|
479
|
+
const stats = fs.statSync(filePath);
|
|
480
|
+
totalSize += stats.size;
|
|
481
|
+
}
|
|
482
|
+
if (currentSession.metadata) {
|
|
483
|
+
currentSession.metadata.totalSize = totalSize;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
catch {
|
|
487
|
+
// Ignore errors
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Enforce storage limits
|
|
492
|
+
*/
|
|
493
|
+
function enforceStorageLimits() {
|
|
494
|
+
if (!currentSession)
|
|
495
|
+
return;
|
|
496
|
+
const maxBytes = MAX_STORAGE_SIZE_MB * 1024 * 1024;
|
|
497
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
498
|
+
if (!fs.existsSync(sessionDir)) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
try {
|
|
502
|
+
const totalSize = currentSession.metadata?.totalSize || 0;
|
|
503
|
+
if (totalSize > maxBytes) {
|
|
504
|
+
// Remove oldest checkpoints until under limit
|
|
505
|
+
const allCheckpoints = [];
|
|
506
|
+
const files = fs.readdirSync(sessionDir);
|
|
507
|
+
for (const file of files) {
|
|
508
|
+
if (file === 'session.json')
|
|
509
|
+
continue;
|
|
510
|
+
if (!file.endsWith('.json'))
|
|
511
|
+
continue;
|
|
512
|
+
const filePath = path.join(sessionDir, file);
|
|
513
|
+
const stats = fs.statSync(filePath);
|
|
514
|
+
const checkpoint = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
515
|
+
allCheckpoints.push({
|
|
516
|
+
file: filePath,
|
|
517
|
+
timestamp: checkpoint.timestamp,
|
|
518
|
+
size: stats.size,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
// Sort by timestamp (oldest first)
|
|
522
|
+
allCheckpoints.sort((a, b) => a.timestamp - b.timestamp);
|
|
523
|
+
let currentSize = totalSize;
|
|
524
|
+
for (const cp of allCheckpoints) {
|
|
525
|
+
if (currentSize <= maxBytes * 0.8) {
|
|
526
|
+
// Aim for 80% of limit
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
// Don't delete the first checkpoint for each file
|
|
530
|
+
try {
|
|
531
|
+
const checkpoint = JSON.parse(fs.readFileSync(cp.file, 'utf-8'));
|
|
532
|
+
const fileCheckpoints = currentSession.checkpoints.get(checkpoint.path);
|
|
533
|
+
if (fileCheckpoints && fileCheckpoints.length > 1 && fileCheckpoints[0] !== checkpoint) {
|
|
534
|
+
fs.unlinkSync(cp.file);
|
|
535
|
+
currentSize -= cp.size;
|
|
536
|
+
// Remove from session
|
|
537
|
+
const idx = fileCheckpoints.findIndex((c) => c.timestamp === checkpoint.timestamp);
|
|
538
|
+
if (idx > 0) {
|
|
539
|
+
fileCheckpoints.splice(idx, 1);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
catch {
|
|
544
|
+
// Skip if error
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
// Update size
|
|
548
|
+
updateSessionSize();
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
catch (err) {
|
|
552
|
+
console.error('Failed to enforce storage limits:', err);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Restore file from checkpoint (enhanced)
|
|
557
|
+
*/
|
|
558
|
+
export function restoreCheckpoint(filePath, index, options) {
|
|
559
|
+
if (!currentSession) {
|
|
560
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
561
|
+
}
|
|
562
|
+
const absolutePath = path.resolve(filePath);
|
|
563
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
564
|
+
if (!checkpoints || checkpoints.length === 0) {
|
|
565
|
+
return { success: false, message: 'No checkpoints found for this file' };
|
|
566
|
+
}
|
|
567
|
+
const targetIndex = index ?? currentSession.currentIndex.get(absolutePath) ?? checkpoints.length - 1;
|
|
568
|
+
if (targetIndex < 0 || targetIndex >= checkpoints.length) {
|
|
569
|
+
return { success: false, message: 'Invalid checkpoint index' };
|
|
570
|
+
}
|
|
571
|
+
const checkpoint = checkpoints[targetIndex];
|
|
572
|
+
try {
|
|
573
|
+
// Reconstruct content
|
|
574
|
+
const content = reconstructContent(absolutePath, targetIndex);
|
|
575
|
+
// Dry run mode
|
|
576
|
+
if (options?.dryRun) {
|
|
577
|
+
return {
|
|
578
|
+
success: true,
|
|
579
|
+
message: 'Dry run successful',
|
|
580
|
+
content,
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
// Create backup of current state first
|
|
584
|
+
if (fs.existsSync(absolutePath) && options?.createBackup !== false) {
|
|
585
|
+
createCheckpoint(absolutePath, {
|
|
586
|
+
name: 'Pre-restore backup',
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
// Restore content
|
|
590
|
+
fs.writeFileSync(absolutePath, content);
|
|
591
|
+
// Restore metadata if requested
|
|
592
|
+
if (options?.preserveMetadata !== false && checkpoint.metadata?.mode) {
|
|
593
|
+
try {
|
|
594
|
+
fs.chmodSync(absolutePath, checkpoint.metadata.mode);
|
|
595
|
+
}
|
|
596
|
+
catch {
|
|
597
|
+
// Ignore permission errors
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
currentSession.currentIndex.set(absolutePath, targetIndex);
|
|
601
|
+
const checkpointName = checkpoint.name || `checkpoint from ${new Date(checkpoint.timestamp).toLocaleString()}`;
|
|
602
|
+
return {
|
|
603
|
+
success: true,
|
|
604
|
+
message: `Restored to ${checkpointName}`,
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
catch (err) {
|
|
608
|
+
return { success: false, message: `Failed to restore: ${err}` };
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Restore multiple files to a specific checkpoint
|
|
613
|
+
*/
|
|
614
|
+
export function restoreMultipleCheckpoints(files, options) {
|
|
615
|
+
const results = [];
|
|
616
|
+
for (const file of files) {
|
|
617
|
+
const result = restoreCheckpoint(file.path, file.index, options);
|
|
618
|
+
results.push({
|
|
619
|
+
path: file.path,
|
|
620
|
+
success: result.success,
|
|
621
|
+
message: result.message,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
return results;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Restore all files to a specific timestamp
|
|
628
|
+
*/
|
|
629
|
+
export function restoreToTimestamp(timestamp, options) {
|
|
630
|
+
if (!currentSession) {
|
|
631
|
+
return [];
|
|
632
|
+
}
|
|
633
|
+
const results = [];
|
|
634
|
+
for (const [filePath, checkpoints] of currentSession.checkpoints) {
|
|
635
|
+
// Find checkpoint closest to timestamp (but not after)
|
|
636
|
+
let closestIndex = -1;
|
|
637
|
+
let closestDiff = Infinity;
|
|
638
|
+
for (let i = 0; i < checkpoints.length; i++) {
|
|
639
|
+
const diff = timestamp - checkpoints[i].timestamp;
|
|
640
|
+
if (diff >= 0 && diff < closestDiff) {
|
|
641
|
+
closestDiff = diff;
|
|
642
|
+
closestIndex = i;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
if (closestIndex >= 0) {
|
|
646
|
+
const result = restoreCheckpoint(filePath, closestIndex, options);
|
|
647
|
+
results.push({
|
|
648
|
+
path: filePath,
|
|
649
|
+
success: result.success,
|
|
650
|
+
message: result.message,
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return results;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Undo last change (go to previous checkpoint)
|
|
658
|
+
*/
|
|
659
|
+
export function undo(filePath) {
|
|
660
|
+
if (!currentSession) {
|
|
661
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
662
|
+
}
|
|
663
|
+
const absolutePath = path.resolve(filePath);
|
|
664
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
665
|
+
if (!checkpoints || checkpoints.length === 0) {
|
|
666
|
+
return { success: false, message: 'No checkpoints available' };
|
|
667
|
+
}
|
|
668
|
+
const currentIndex = currentSession.currentIndex.get(absolutePath) ?? checkpoints.length - 1;
|
|
669
|
+
if (currentIndex <= 0) {
|
|
670
|
+
return { success: false, message: 'Already at oldest checkpoint' };
|
|
671
|
+
}
|
|
672
|
+
return restoreCheckpoint(absolutePath, currentIndex - 1);
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Redo (go to next checkpoint)
|
|
676
|
+
*/
|
|
677
|
+
export function redo(filePath) {
|
|
678
|
+
if (!currentSession) {
|
|
679
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
680
|
+
}
|
|
681
|
+
const absolutePath = path.resolve(filePath);
|
|
682
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
683
|
+
if (!checkpoints || checkpoints.length === 0) {
|
|
684
|
+
return { success: false, message: 'No checkpoints available' };
|
|
685
|
+
}
|
|
686
|
+
const currentIndex = currentSession.currentIndex.get(absolutePath) ?? checkpoints.length - 1;
|
|
687
|
+
if (currentIndex >= checkpoints.length - 1) {
|
|
688
|
+
return { success: false, message: 'Already at newest checkpoint' };
|
|
689
|
+
}
|
|
690
|
+
return restoreCheckpoint(absolutePath, currentIndex + 1);
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Get checkpoint history for a file (enhanced)
|
|
694
|
+
*/
|
|
695
|
+
export function getCheckpointHistory(filePath) {
|
|
696
|
+
if (!currentSession) {
|
|
697
|
+
return { checkpoints: [], currentIndex: -1 };
|
|
698
|
+
}
|
|
699
|
+
const absolutePath = path.resolve(filePath);
|
|
700
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath) || [];
|
|
701
|
+
const currentIndex = currentSession.currentIndex.get(absolutePath) ?? checkpoints.length - 1;
|
|
702
|
+
return {
|
|
703
|
+
checkpoints: checkpoints.map((cp, idx) => ({
|
|
704
|
+
index: idx,
|
|
705
|
+
timestamp: cp.timestamp,
|
|
706
|
+
hash: cp.hash,
|
|
707
|
+
name: cp.name,
|
|
708
|
+
description: cp.description,
|
|
709
|
+
gitCommit: cp.gitCommit,
|
|
710
|
+
tags: cp.tags,
|
|
711
|
+
size: cp.metadata?.size,
|
|
712
|
+
compressed: cp.compressed,
|
|
713
|
+
current: idx === currentIndex,
|
|
714
|
+
})),
|
|
715
|
+
currentIndex,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Search checkpoints across all files
|
|
720
|
+
*/
|
|
721
|
+
export function searchCheckpoints(options) {
|
|
722
|
+
if (!currentSession) {
|
|
723
|
+
return [];
|
|
724
|
+
}
|
|
725
|
+
let results = [];
|
|
726
|
+
for (const [filePath, checkpoints] of currentSession.checkpoints) {
|
|
727
|
+
// Filter by file path
|
|
728
|
+
if (options.filePath) {
|
|
729
|
+
const pattern = new RegExp(options.filePath, 'i');
|
|
730
|
+
if (!pattern.test(filePath)) {
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
for (const checkpoint of checkpoints) {
|
|
735
|
+
// Filter by time range
|
|
736
|
+
if (options.timeRange) {
|
|
737
|
+
if (checkpoint.timestamp < options.timeRange.start ||
|
|
738
|
+
checkpoint.timestamp > options.timeRange.end) {
|
|
739
|
+
continue;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
// Filter by tags
|
|
743
|
+
if (options.tags && options.tags.length > 0) {
|
|
744
|
+
if (!checkpoint.tags || !options.tags.some((tag) => checkpoint.tags?.includes(tag))) {
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
// Filter by git commit
|
|
749
|
+
if (options.gitCommit && checkpoint.gitCommit !== options.gitCommit) {
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
// Filter by name pattern
|
|
753
|
+
if (options.namePattern && checkpoint.name) {
|
|
754
|
+
const pattern = new RegExp(options.namePattern, 'i');
|
|
755
|
+
if (!pattern.test(checkpoint.name)) {
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
results.push(checkpoint);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
// Sort by timestamp (newest first)
|
|
763
|
+
results.sort((a, b) => b.timestamp - a.timestamp);
|
|
764
|
+
// Apply limit
|
|
765
|
+
if (options.limit && results.length > options.limit) {
|
|
766
|
+
results = results.slice(0, options.limit);
|
|
767
|
+
}
|
|
768
|
+
return results;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* List all checkpoints with filtering
|
|
772
|
+
*/
|
|
773
|
+
export function listAllCheckpoints(options) {
|
|
774
|
+
if (!currentSession) {
|
|
775
|
+
return [];
|
|
776
|
+
}
|
|
777
|
+
const results = [];
|
|
778
|
+
for (const [filePath, checkpoints] of currentSession.checkpoints) {
|
|
779
|
+
checkpoints.forEach((checkpoint, index) => {
|
|
780
|
+
results.push({ filePath, checkpoint, index });
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
// Sort
|
|
784
|
+
const sortBy = options?.sortBy || 'timestamp';
|
|
785
|
+
const ascending = options?.ascending || false;
|
|
786
|
+
results.sort((a, b) => {
|
|
787
|
+
let comparison = 0;
|
|
788
|
+
switch (sortBy) {
|
|
789
|
+
case 'timestamp':
|
|
790
|
+
comparison = a.checkpoint.timestamp - b.checkpoint.timestamp;
|
|
791
|
+
break;
|
|
792
|
+
case 'size':
|
|
793
|
+
comparison = (a.checkpoint.metadata?.size || 0) - (b.checkpoint.metadata?.size || 0);
|
|
794
|
+
break;
|
|
795
|
+
case 'file':
|
|
796
|
+
comparison = a.filePath.localeCompare(b.filePath);
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
return ascending ? comparison : -comparison;
|
|
800
|
+
});
|
|
801
|
+
return results;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Get diff between two checkpoints
|
|
805
|
+
*/
|
|
806
|
+
export function getCheckpointDiff(filePath, fromIndex, toIndex) {
|
|
807
|
+
if (!currentSession) {
|
|
808
|
+
return null;
|
|
809
|
+
}
|
|
810
|
+
const absolutePath = path.resolve(filePath);
|
|
811
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
812
|
+
if (!checkpoints || fromIndex < 0 || toIndex >= checkpoints.length) {
|
|
813
|
+
return null;
|
|
814
|
+
}
|
|
815
|
+
const fromContent = checkpoints[fromIndex].content;
|
|
816
|
+
const toContent = checkpoints[toIndex].content;
|
|
817
|
+
// Simple line-based diff
|
|
818
|
+
const fromLines = fromContent.split('\n');
|
|
819
|
+
const toLines = toContent.split('\n');
|
|
820
|
+
let added = 0;
|
|
821
|
+
let removed = 0;
|
|
822
|
+
const diffLines = [];
|
|
823
|
+
// Very simple diff - just count line changes
|
|
824
|
+
const maxLines = Math.max(fromLines.length, toLines.length);
|
|
825
|
+
for (let i = 0; i < maxLines; i++) {
|
|
826
|
+
if (i >= fromLines.length) {
|
|
827
|
+
added++;
|
|
828
|
+
diffLines.push(`+ ${toLines[i]}`);
|
|
829
|
+
}
|
|
830
|
+
else if (i >= toLines.length) {
|
|
831
|
+
removed++;
|
|
832
|
+
diffLines.push(`- ${fromLines[i]}`);
|
|
833
|
+
}
|
|
834
|
+
else if (fromLines[i] !== toLines[i]) {
|
|
835
|
+
removed++;
|
|
836
|
+
added++;
|
|
837
|
+
diffLines.push(`- ${fromLines[i]}`);
|
|
838
|
+
diffLines.push(`+ ${toLines[i]}`);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
return {
|
|
842
|
+
added,
|
|
843
|
+
removed,
|
|
844
|
+
diff: diffLines.join('\n'),
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Clean up old checkpoints
|
|
849
|
+
*/
|
|
850
|
+
function cleanupOldCheckpoints() {
|
|
851
|
+
if (!fs.existsSync(CHECKPOINT_DIR)) {
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
const cutoffTime = Date.now() - CHECKPOINT_RETENTION_DAYS * 24 * 60 * 60 * 1000;
|
|
855
|
+
try {
|
|
856
|
+
const sessions = fs.readdirSync(CHECKPOINT_DIR);
|
|
857
|
+
for (const sessionDir of sessions) {
|
|
858
|
+
const sessionPath = path.join(CHECKPOINT_DIR, sessionDir);
|
|
859
|
+
const stats = fs.statSync(sessionPath);
|
|
860
|
+
if (stats.isDirectory() && stats.mtimeMs < cutoffTime) {
|
|
861
|
+
// Remove old session directory
|
|
862
|
+
fs.rmSync(sessionPath, { recursive: true });
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
catch (err) {
|
|
867
|
+
// Ignore cleanup errors
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Delete specific checkpoint
|
|
872
|
+
*/
|
|
873
|
+
export function deleteCheckpoint(filePath, index) {
|
|
874
|
+
if (!currentSession) {
|
|
875
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
876
|
+
}
|
|
877
|
+
const absolutePath = path.resolve(filePath);
|
|
878
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
879
|
+
if (!checkpoints || index < 0 || index >= checkpoints.length) {
|
|
880
|
+
return { success: false, message: 'Invalid checkpoint index' };
|
|
881
|
+
}
|
|
882
|
+
// Don't allow deleting the first checkpoint if it's the only one
|
|
883
|
+
if (checkpoints.length === 1) {
|
|
884
|
+
return { success: false, message: 'Cannot delete the only checkpoint' };
|
|
885
|
+
}
|
|
886
|
+
// Don't allow deleting the base checkpoint if there are diff-based checkpoints
|
|
887
|
+
if (index === 0) {
|
|
888
|
+
const hasDiffs = checkpoints.slice(1).some((cp) => cp.diff && !cp.content);
|
|
889
|
+
if (hasDiffs) {
|
|
890
|
+
return { success: false, message: 'Cannot delete base checkpoint while diff checkpoints exist' };
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
try {
|
|
894
|
+
const checkpoint = checkpoints[index];
|
|
895
|
+
// Delete from disk
|
|
896
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
897
|
+
const fileHash = getContentHash(checkpoint.path);
|
|
898
|
+
const checkpointFile = path.join(sessionDir, `${fileHash}-${checkpoint.timestamp}.json`);
|
|
899
|
+
if (fs.existsSync(checkpointFile)) {
|
|
900
|
+
fs.unlinkSync(checkpointFile);
|
|
901
|
+
}
|
|
902
|
+
// Remove from session
|
|
903
|
+
checkpoints.splice(index, 1);
|
|
904
|
+
// Update current index if needed
|
|
905
|
+
const currentIndex = currentSession.currentIndex.get(absolutePath);
|
|
906
|
+
if (currentIndex !== undefined && currentIndex >= index) {
|
|
907
|
+
currentSession.currentIndex.set(absolutePath, Math.max(0, currentIndex - 1));
|
|
908
|
+
}
|
|
909
|
+
updateSessionSize();
|
|
910
|
+
return { success: true, message: 'Checkpoint deleted successfully' };
|
|
911
|
+
}
|
|
912
|
+
catch (err) {
|
|
913
|
+
return { success: false, message: `Failed to delete checkpoint: ${err}` };
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Delete all checkpoints for a file
|
|
918
|
+
*/
|
|
919
|
+
export function deleteFileCheckpoints(filePath) {
|
|
920
|
+
if (!currentSession) {
|
|
921
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
922
|
+
}
|
|
923
|
+
const absolutePath = path.resolve(filePath);
|
|
924
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
925
|
+
if (!checkpoints || checkpoints.length === 0) {
|
|
926
|
+
return { success: false, message: 'No checkpoints found for this file' };
|
|
927
|
+
}
|
|
928
|
+
try {
|
|
929
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
930
|
+
// Delete all checkpoint files
|
|
931
|
+
for (const checkpoint of checkpoints) {
|
|
932
|
+
const fileHash = getContentHash(checkpoint.path);
|
|
933
|
+
const checkpointFile = path.join(sessionDir, `${fileHash}-${checkpoint.timestamp}.json`);
|
|
934
|
+
if (fs.existsSync(checkpointFile)) {
|
|
935
|
+
fs.unlinkSync(checkpointFile);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
// Remove from session
|
|
939
|
+
currentSession.checkpoints.delete(absolutePath);
|
|
940
|
+
currentSession.currentIndex.delete(absolutePath);
|
|
941
|
+
currentSession.editCounts.delete(absolutePath);
|
|
942
|
+
updateSessionSize();
|
|
943
|
+
return { success: true, message: `Deleted ${checkpoints.length} checkpoints` };
|
|
944
|
+
}
|
|
945
|
+
catch (err) {
|
|
946
|
+
return { success: false, message: `Failed to delete checkpoints: ${err}` };
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Merge consecutive checkpoints
|
|
951
|
+
* Useful for reducing storage when you have many small changes
|
|
952
|
+
*/
|
|
953
|
+
export function mergeCheckpoints(filePath, startIndex, endIndex, options) {
|
|
954
|
+
if (!currentSession) {
|
|
955
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
956
|
+
}
|
|
957
|
+
const absolutePath = path.resolve(filePath);
|
|
958
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
959
|
+
if (!checkpoints || startIndex < 0 || endIndex >= checkpoints.length || startIndex >= endIndex) {
|
|
960
|
+
return { success: false, message: 'Invalid checkpoint range' };
|
|
961
|
+
}
|
|
962
|
+
try {
|
|
963
|
+
// Reconstruct final content
|
|
964
|
+
const finalContent = reconstructContent(absolutePath, endIndex);
|
|
965
|
+
// Get metadata from last checkpoint
|
|
966
|
+
const lastCheckpoint = checkpoints[endIndex];
|
|
967
|
+
// Create merged checkpoint
|
|
968
|
+
const mergedCheckpoint = {
|
|
969
|
+
path: absolutePath,
|
|
970
|
+
content: finalContent.length > COMPRESSION_THRESHOLD_BYTES
|
|
971
|
+
? compressContent(finalContent).toString('base64')
|
|
972
|
+
: finalContent,
|
|
973
|
+
hash: getContentHash(finalContent),
|
|
974
|
+
timestamp: Date.now(),
|
|
975
|
+
name: options?.name || `Merged ${endIndex - startIndex + 1} checkpoints`,
|
|
976
|
+
description: options?.description,
|
|
977
|
+
compressed: finalContent.length > COMPRESSION_THRESHOLD_BYTES,
|
|
978
|
+
metadata: lastCheckpoint.metadata,
|
|
979
|
+
tags: lastCheckpoint.tags,
|
|
980
|
+
};
|
|
981
|
+
// Delete old checkpoint files
|
|
982
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
983
|
+
for (let i = startIndex; i <= endIndex; i++) {
|
|
984
|
+
const checkpoint = checkpoints[i];
|
|
985
|
+
const fileHash = getContentHash(checkpoint.path);
|
|
986
|
+
const checkpointFile = path.join(sessionDir, `${fileHash}-${checkpoint.timestamp}.json`);
|
|
987
|
+
if (fs.existsSync(checkpointFile)) {
|
|
988
|
+
fs.unlinkSync(checkpointFile);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
// Remove old checkpoints and insert merged one
|
|
992
|
+
checkpoints.splice(startIndex, endIndex - startIndex + 1, mergedCheckpoint);
|
|
993
|
+
// Save merged checkpoint
|
|
994
|
+
saveCheckpointToDisk(mergedCheckpoint);
|
|
995
|
+
// Update index if needed
|
|
996
|
+
const currentIndex = currentSession.currentIndex.get(absolutePath);
|
|
997
|
+
if (currentIndex !== undefined && currentIndex >= startIndex && currentIndex <= endIndex) {
|
|
998
|
+
currentSession.currentIndex.set(absolutePath, startIndex);
|
|
999
|
+
}
|
|
1000
|
+
else if (currentIndex !== undefined && currentIndex > endIndex) {
|
|
1001
|
+
currentSession.currentIndex.set(absolutePath, currentIndex - (endIndex - startIndex));
|
|
1002
|
+
}
|
|
1003
|
+
updateSessionSize();
|
|
1004
|
+
return {
|
|
1005
|
+
success: true,
|
|
1006
|
+
message: `Merged ${endIndex - startIndex + 1} checkpoints into one`,
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
catch (err) {
|
|
1010
|
+
return { success: false, message: `Failed to merge checkpoints: ${err}` };
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Get checkpoint statistics
|
|
1015
|
+
*/
|
|
1016
|
+
export function getCheckpointStats() {
|
|
1017
|
+
if (!currentSession) {
|
|
1018
|
+
return {
|
|
1019
|
+
totalCheckpoints: 0,
|
|
1020
|
+
totalFiles: 0,
|
|
1021
|
+
totalSize: 0,
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
let totalCheckpoints = 0;
|
|
1025
|
+
let totalFiles = 0;
|
|
1026
|
+
let oldestTimestamp;
|
|
1027
|
+
let newestTimestamp;
|
|
1028
|
+
let uncompressedSize = 0;
|
|
1029
|
+
let compressedSize = 0;
|
|
1030
|
+
for (const [, checkpoints] of currentSession.checkpoints) {
|
|
1031
|
+
totalFiles++;
|
|
1032
|
+
totalCheckpoints += checkpoints.length;
|
|
1033
|
+
for (const checkpoint of checkpoints) {
|
|
1034
|
+
if (!oldestTimestamp || checkpoint.timestamp < oldestTimestamp) {
|
|
1035
|
+
oldestTimestamp = checkpoint.timestamp;
|
|
1036
|
+
}
|
|
1037
|
+
if (!newestTimestamp || checkpoint.timestamp > newestTimestamp) {
|
|
1038
|
+
newestTimestamp = checkpoint.timestamp;
|
|
1039
|
+
}
|
|
1040
|
+
if (checkpoint.metadata?.size) {
|
|
1041
|
+
uncompressedSize += checkpoint.metadata.size;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
compressedSize = currentSession.metadata?.totalSize || 0;
|
|
1046
|
+
return {
|
|
1047
|
+
totalCheckpoints,
|
|
1048
|
+
totalFiles,
|
|
1049
|
+
totalSize: compressedSize,
|
|
1050
|
+
oldestCheckpoint: oldestTimestamp,
|
|
1051
|
+
newestCheckpoint: newestTimestamp,
|
|
1052
|
+
compressionRatio: uncompressedSize > 0 ? compressedSize / uncompressedSize : undefined,
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Export checkpoint session
|
|
1057
|
+
*/
|
|
1058
|
+
export function exportCheckpointSession(outputPath) {
|
|
1059
|
+
if (!currentSession) {
|
|
1060
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
1061
|
+
}
|
|
1062
|
+
const exported = {};
|
|
1063
|
+
for (const [filePath, checkpoints] of currentSession.checkpoints) {
|
|
1064
|
+
exported[filePath] = checkpoints;
|
|
1065
|
+
}
|
|
1066
|
+
const exportData = {
|
|
1067
|
+
id: currentSession.id,
|
|
1068
|
+
startTime: currentSession.startTime,
|
|
1069
|
+
workingDirectory: currentSession.workingDirectory,
|
|
1070
|
+
metadata: currentSession.metadata,
|
|
1071
|
+
files: exported,
|
|
1072
|
+
};
|
|
1073
|
+
if (outputPath) {
|
|
1074
|
+
try {
|
|
1075
|
+
fs.writeFileSync(outputPath, JSON.stringify(exportData, null, 2), {
|
|
1076
|
+
mode: 0o600,
|
|
1077
|
+
});
|
|
1078
|
+
return {
|
|
1079
|
+
success: true,
|
|
1080
|
+
message: `Session exported to ${outputPath}`,
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
catch (err) {
|
|
1084
|
+
return {
|
|
1085
|
+
success: false,
|
|
1086
|
+
message: `Failed to export session: ${err}`,
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
return {
|
|
1091
|
+
success: true,
|
|
1092
|
+
message: 'Session data prepared',
|
|
1093
|
+
data: exportData,
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Import checkpoint session
|
|
1098
|
+
*/
|
|
1099
|
+
export function importCheckpointSession(importPath) {
|
|
1100
|
+
try {
|
|
1101
|
+
const data = JSON.parse(fs.readFileSync(importPath, 'utf-8'));
|
|
1102
|
+
// Initialize session
|
|
1103
|
+
currentSession = {
|
|
1104
|
+
id: data.id || generateSessionId(),
|
|
1105
|
+
startTime: data.startTime,
|
|
1106
|
+
workingDirectory: data.workingDirectory,
|
|
1107
|
+
checkpoints: new Map(),
|
|
1108
|
+
currentIndex: new Map(),
|
|
1109
|
+
editCounts: new Map(),
|
|
1110
|
+
autoCheckpointInterval: DEFAULT_AUTO_CHECKPOINT_INTERVAL,
|
|
1111
|
+
metadata: data.metadata,
|
|
1112
|
+
};
|
|
1113
|
+
// Restore checkpoints
|
|
1114
|
+
for (const [filePath, checkpoints] of Object.entries(data.files)) {
|
|
1115
|
+
currentSession.checkpoints.set(filePath, checkpoints);
|
|
1116
|
+
currentSession.currentIndex.set(filePath, checkpoints.length - 1);
|
|
1117
|
+
}
|
|
1118
|
+
// Save to disk
|
|
1119
|
+
for (const [, checkpoints] of currentSession.checkpoints) {
|
|
1120
|
+
for (const checkpoint of checkpoints) {
|
|
1121
|
+
saveCheckpointToDisk(checkpoint);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
return {
|
|
1125
|
+
success: true,
|
|
1126
|
+
message: `Session imported successfully (${currentSession.checkpoints.size} files)`,
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
catch (err) {
|
|
1130
|
+
return {
|
|
1131
|
+
success: false,
|
|
1132
|
+
message: `Failed to import session: ${err}`,
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Clear all checkpoints for current session
|
|
1138
|
+
*/
|
|
1139
|
+
export function clearCheckpoints() {
|
|
1140
|
+
if (!currentSession) {
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
currentSession.checkpoints.clear();
|
|
1144
|
+
currentSession.currentIndex.clear();
|
|
1145
|
+
// Remove session directory
|
|
1146
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
1147
|
+
if (fs.existsSync(sessionDir)) {
|
|
1148
|
+
fs.rmSync(sessionDir, { recursive: true });
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Get current session
|
|
1153
|
+
*/
|
|
1154
|
+
export function getCurrentSession() {
|
|
1155
|
+
return currentSession;
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* End current checkpoint session
|
|
1159
|
+
*/
|
|
1160
|
+
export function endCheckpointSession() {
|
|
1161
|
+
if (currentSession) {
|
|
1162
|
+
saveSessionMetadata();
|
|
1163
|
+
}
|
|
1164
|
+
currentSession = null;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* List all available checkpoint sessions
|
|
1168
|
+
*/
|
|
1169
|
+
export function listCheckpointSessions() {
|
|
1170
|
+
if (!fs.existsSync(CHECKPOINT_DIR)) {
|
|
1171
|
+
return [];
|
|
1172
|
+
}
|
|
1173
|
+
const sessions = [];
|
|
1174
|
+
try {
|
|
1175
|
+
const sessionDirs = fs.readdirSync(CHECKPOINT_DIR);
|
|
1176
|
+
for (const sessionId of sessionDirs) {
|
|
1177
|
+
const sessionDir = path.join(CHECKPOINT_DIR, sessionId);
|
|
1178
|
+
const metadataFile = path.join(sessionDir, 'session.json');
|
|
1179
|
+
if (fs.existsSync(metadataFile)) {
|
|
1180
|
+
try {
|
|
1181
|
+
const metadata = JSON.parse(fs.readFileSync(metadataFile, 'utf-8'));
|
|
1182
|
+
const stats = fs.statSync(sessionDir);
|
|
1183
|
+
// Calculate total size
|
|
1184
|
+
let totalSize = 0;
|
|
1185
|
+
const files = fs.readdirSync(sessionDir);
|
|
1186
|
+
for (const file of files) {
|
|
1187
|
+
const filePath = path.join(sessionDir, file);
|
|
1188
|
+
const fileStats = fs.statSync(filePath);
|
|
1189
|
+
totalSize += fileStats.size;
|
|
1190
|
+
}
|
|
1191
|
+
sessions.push({
|
|
1192
|
+
id: metadata.id,
|
|
1193
|
+
startTime: metadata.startTime,
|
|
1194
|
+
workingDirectory: metadata.workingDirectory,
|
|
1195
|
+
fileCount: metadata.files?.length || 0,
|
|
1196
|
+
totalSize,
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
catch {
|
|
1200
|
+
// Skip invalid sessions
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
// Sort by start time (newest first)
|
|
1205
|
+
sessions.sort((a, b) => b.startTime - a.startTime);
|
|
1206
|
+
}
|
|
1207
|
+
catch (err) {
|
|
1208
|
+
console.error('Failed to list sessions:', err);
|
|
1209
|
+
}
|
|
1210
|
+
return sessions;
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Delete a specific checkpoint session
|
|
1214
|
+
*/
|
|
1215
|
+
export function deleteCheckpointSession(sessionId) {
|
|
1216
|
+
const sessionDir = path.join(CHECKPOINT_DIR, sessionId);
|
|
1217
|
+
if (!fs.existsSync(sessionDir)) {
|
|
1218
|
+
return { success: false, message: 'Session not found' };
|
|
1219
|
+
}
|
|
1220
|
+
try {
|
|
1221
|
+
fs.rmSync(sessionDir, { recursive: true });
|
|
1222
|
+
return { success: true, message: 'Session deleted successfully' };
|
|
1223
|
+
}
|
|
1224
|
+
catch (err) {
|
|
1225
|
+
return { success: false, message: `Failed to delete session: ${err}` };
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Optimize checkpoint storage for a file
|
|
1230
|
+
* Converts diff-based checkpoints to full content at intervals
|
|
1231
|
+
*/
|
|
1232
|
+
export function optimizeCheckpointStorage(filePath) {
|
|
1233
|
+
if (!currentSession) {
|
|
1234
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
1235
|
+
}
|
|
1236
|
+
const absolutePath = path.resolve(filePath);
|
|
1237
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
1238
|
+
if (!checkpoints || checkpoints.length === 0) {
|
|
1239
|
+
return { success: false, message: 'No checkpoints found for this file' };
|
|
1240
|
+
}
|
|
1241
|
+
try {
|
|
1242
|
+
let modified = 0;
|
|
1243
|
+
// Every 10 checkpoints, create a full content checkpoint
|
|
1244
|
+
for (let i = 0; i < checkpoints.length; i++) {
|
|
1245
|
+
if (i % 10 === 0 && i > 0 && checkpoints[i].diff) {
|
|
1246
|
+
// Reconstruct content
|
|
1247
|
+
const content = reconstructContent(absolutePath, i);
|
|
1248
|
+
// Replace diff with full content
|
|
1249
|
+
checkpoints[i].content =
|
|
1250
|
+
content.length > COMPRESSION_THRESHOLD_BYTES
|
|
1251
|
+
? compressContent(content).toString('base64')
|
|
1252
|
+
: content;
|
|
1253
|
+
checkpoints[i].diff = undefined;
|
|
1254
|
+
checkpoints[i].compressed = content.length > COMPRESSION_THRESHOLD_BYTES;
|
|
1255
|
+
// Save updated checkpoint
|
|
1256
|
+
saveCheckpointToDisk(checkpoints[i]);
|
|
1257
|
+
modified++;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
updateSessionSize();
|
|
1261
|
+
return {
|
|
1262
|
+
success: true,
|
|
1263
|
+
message: `Optimized ${modified} checkpoints`,
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
catch (err) {
|
|
1267
|
+
return { success: false, message: `Failed to optimize: ${err}` };
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Compact checkpoint storage by removing redundant checkpoints
|
|
1272
|
+
*/
|
|
1273
|
+
export function compactCheckpoints(filePath, options) {
|
|
1274
|
+
if (!currentSession) {
|
|
1275
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
1276
|
+
}
|
|
1277
|
+
const absolutePath = path.resolve(filePath);
|
|
1278
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
1279
|
+
if (!checkpoints || checkpoints.length === 0) {
|
|
1280
|
+
return { success: false, message: 'No checkpoints found for this file' };
|
|
1281
|
+
}
|
|
1282
|
+
const keepEveryNth = options?.keepEveryNth || 5;
|
|
1283
|
+
const maxCheckpoints = options?.maxCheckpoints || MAX_CHECKPOINTS_PER_FILE;
|
|
1284
|
+
try {
|
|
1285
|
+
const toKeep = [];
|
|
1286
|
+
// Always keep first checkpoint
|
|
1287
|
+
toKeep.push(checkpoints[0]);
|
|
1288
|
+
// Keep every Nth checkpoint
|
|
1289
|
+
for (let i = keepEveryNth; i < checkpoints.length; i += keepEveryNth) {
|
|
1290
|
+
toKeep.push(checkpoints[i]);
|
|
1291
|
+
}
|
|
1292
|
+
// Always keep last checkpoint
|
|
1293
|
+
if (checkpoints.length > 1 && toKeep[toKeep.length - 1] !== checkpoints[checkpoints.length - 1]) {
|
|
1294
|
+
toKeep.push(checkpoints[checkpoints.length - 1]);
|
|
1295
|
+
}
|
|
1296
|
+
// Limit total checkpoints
|
|
1297
|
+
if (toKeep.length > maxCheckpoints) {
|
|
1298
|
+
// Keep first, last, and evenly distributed ones
|
|
1299
|
+
const step = Math.floor(toKeep.length / maxCheckpoints);
|
|
1300
|
+
const limited = [toKeep[0]];
|
|
1301
|
+
for (let i = step; i < toKeep.length - 1; i += step) {
|
|
1302
|
+
limited.push(toKeep[i]);
|
|
1303
|
+
}
|
|
1304
|
+
limited.push(toKeep[toKeep.length - 1]);
|
|
1305
|
+
toKeep.splice(0, toKeep.length, ...limited);
|
|
1306
|
+
}
|
|
1307
|
+
const deletedCount = checkpoints.length - toKeep.length;
|
|
1308
|
+
// Delete checkpoints not in toKeep
|
|
1309
|
+
const sessionDir = path.join(CHECKPOINT_DIR, currentSession.id);
|
|
1310
|
+
for (const checkpoint of checkpoints) {
|
|
1311
|
+
if (!toKeep.includes(checkpoint)) {
|
|
1312
|
+
const fileHash = getContentHash(checkpoint.path);
|
|
1313
|
+
const checkpointFile = path.join(sessionDir, `${fileHash}-${checkpoint.timestamp}.json`);
|
|
1314
|
+
if (fs.existsSync(checkpointFile)) {
|
|
1315
|
+
fs.unlinkSync(checkpointFile);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
// Update session
|
|
1320
|
+
currentSession.checkpoints.set(absolutePath, toKeep);
|
|
1321
|
+
currentSession.currentIndex.set(absolutePath, toKeep.length - 1);
|
|
1322
|
+
updateSessionSize();
|
|
1323
|
+
return {
|
|
1324
|
+
success: true,
|
|
1325
|
+
message: `Compacted from ${checkpoints.length} to ${toKeep.length} checkpoints (deleted ${deletedCount})`,
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
catch (err) {
|
|
1329
|
+
return { success: false, message: `Failed to compact: ${err}` };
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Compare two checkpoints and get detailed diff
|
|
1334
|
+
*/
|
|
1335
|
+
export function compareCheckpoints(filePath, fromIndex, toIndex) {
|
|
1336
|
+
if (!currentSession) {
|
|
1337
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
1338
|
+
}
|
|
1339
|
+
const absolutePath = path.resolve(filePath);
|
|
1340
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
1341
|
+
if (!checkpoints || fromIndex < 0 || toIndex >= checkpoints.length) {
|
|
1342
|
+
return { success: false, message: 'Invalid checkpoint indices' };
|
|
1343
|
+
}
|
|
1344
|
+
try {
|
|
1345
|
+
const fromContent = reconstructContent(absolutePath, fromIndex);
|
|
1346
|
+
const toContent = reconstructContent(absolutePath, toIndex);
|
|
1347
|
+
const fromLines = fromContent.split('\n');
|
|
1348
|
+
const toLines = toContent.split('\n');
|
|
1349
|
+
let added = 0;
|
|
1350
|
+
let removed = 0;
|
|
1351
|
+
let modified = 0;
|
|
1352
|
+
const diffLines = [];
|
|
1353
|
+
const maxLines = Math.max(fromLines.length, toLines.length);
|
|
1354
|
+
for (let i = 0; i < maxLines; i++) {
|
|
1355
|
+
if (i >= fromLines.length) {
|
|
1356
|
+
added++;
|
|
1357
|
+
diffLines.push(`+${i + 1}: ${toLines[i]}`);
|
|
1358
|
+
}
|
|
1359
|
+
else if (i >= toLines.length) {
|
|
1360
|
+
removed++;
|
|
1361
|
+
diffLines.push(`-${i + 1}: ${fromLines[i]}`);
|
|
1362
|
+
}
|
|
1363
|
+
else if (fromLines[i] !== toLines[i]) {
|
|
1364
|
+
modified++;
|
|
1365
|
+
diffLines.push(`-${i + 1}: ${fromLines[i]}`);
|
|
1366
|
+
diffLines.push(`+${i + 1}: ${toLines[i]}`);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
return {
|
|
1370
|
+
success: true,
|
|
1371
|
+
diff: {
|
|
1372
|
+
added,
|
|
1373
|
+
removed,
|
|
1374
|
+
modified,
|
|
1375
|
+
diffText: diffLines.join('\n'),
|
|
1376
|
+
},
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
catch (err) {
|
|
1380
|
+
return { success: false, message: `Failed to compare: ${err}` };
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
/**
|
|
1384
|
+
* Tag a checkpoint
|
|
1385
|
+
*/
|
|
1386
|
+
export function tagCheckpoint(filePath, index, tags) {
|
|
1387
|
+
if (!currentSession) {
|
|
1388
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
1389
|
+
}
|
|
1390
|
+
const absolutePath = path.resolve(filePath);
|
|
1391
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
1392
|
+
if (!checkpoints || index < 0 || index >= checkpoints.length) {
|
|
1393
|
+
return { success: false, message: 'Invalid checkpoint index' };
|
|
1394
|
+
}
|
|
1395
|
+
try {
|
|
1396
|
+
checkpoints[index].tags = [...new Set([...(checkpoints[index].tags || []), ...tags])];
|
|
1397
|
+
saveCheckpointToDisk(checkpoints[index]);
|
|
1398
|
+
return { success: true, message: 'Tags added successfully' };
|
|
1399
|
+
}
|
|
1400
|
+
catch (err) {
|
|
1401
|
+
return { success: false, message: `Failed to tag checkpoint: ${err}` };
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Get checkpoint content without restoring
|
|
1406
|
+
*/
|
|
1407
|
+
export function getCheckpointContent(filePath, index) {
|
|
1408
|
+
if (!currentSession) {
|
|
1409
|
+
return { success: false, message: 'No active checkpoint session' };
|
|
1410
|
+
}
|
|
1411
|
+
const absolutePath = path.resolve(filePath);
|
|
1412
|
+
const checkpoints = currentSession.checkpoints.get(absolutePath);
|
|
1413
|
+
if (!checkpoints || index < 0 || index >= checkpoints.length) {
|
|
1414
|
+
return { success: false, message: 'Invalid checkpoint index' };
|
|
1415
|
+
}
|
|
1416
|
+
try {
|
|
1417
|
+
const content = reconstructContent(absolutePath, index);
|
|
1418
|
+
return { success: true, content };
|
|
1419
|
+
}
|
|
1420
|
+
catch (err) {
|
|
1421
|
+
return { success: false, message: `Failed to get content: ${err}` };
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
//# sourceMappingURL=index.js.map
|