@sudocode-ai/local-server 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/errors/agent-errors.d.ts +43 -0
- package/dist/errors/agent-errors.d.ts.map +1 -0
- package/dist/errors/agent-errors.js +69 -0
- package/dist/errors/agent-errors.js.map +1 -0
- package/dist/execution/adapters/claude-adapter.d.ts +63 -0
- package/dist/execution/adapters/claude-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/claude-adapter.js +82 -0
- package/dist/execution/adapters/claude-adapter.js.map +1 -0
- package/dist/execution/adapters/codex-adapter.d.ts +67 -0
- package/dist/execution/adapters/codex-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/codex-adapter.js +183 -0
- package/dist/execution/adapters/codex-adapter.js.map +1 -0
- package/dist/execution/adapters/codex-config-builder.d.ts +30 -0
- package/dist/execution/adapters/codex-config-builder.d.ts.map +1 -0
- package/dist/execution/adapters/codex-config-builder.js +110 -0
- package/dist/execution/adapters/codex-config-builder.js.map +1 -0
- package/dist/execution/adapters/copilot-adapter.d.ts +94 -0
- package/dist/execution/adapters/copilot-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/copilot-adapter.js +163 -0
- package/dist/execution/adapters/copilot-adapter.js.map +1 -0
- package/dist/execution/adapters/copilot-config-builder.d.ts +48 -0
- package/dist/execution/adapters/copilot-config-builder.d.ts.map +1 -0
- package/dist/execution/adapters/copilot-config-builder.js +125 -0
- package/dist/execution/adapters/copilot-config-builder.js.map +1 -0
- package/dist/execution/adapters/cursor-adapter.d.ts +66 -0
- package/dist/execution/adapters/cursor-adapter.d.ts.map +1 -0
- package/dist/execution/adapters/cursor-adapter.js +121 -0
- package/dist/execution/adapters/cursor-adapter.js.map +1 -0
- package/dist/execution/adapters/cursor-config-builder.d.ts +29 -0
- package/dist/execution/adapters/cursor-config-builder.d.ts.map +1 -0
- package/dist/execution/adapters/cursor-config-builder.js +49 -0
- package/dist/execution/adapters/cursor-config-builder.js.map +1 -0
- package/dist/execution/adapters/shared/config-presets.d.ts +102 -0
- package/dist/execution/adapters/shared/config-presets.d.ts.map +1 -0
- package/dist/execution/adapters/shared/config-presets.js +205 -0
- package/dist/execution/adapters/shared/config-presets.js.map +1 -0
- package/dist/execution/adapters/shared/config-utils.d.ts +95 -0
- package/dist/execution/adapters/shared/config-utils.d.ts.map +1 -0
- package/dist/execution/adapters/shared/config-utils.js +163 -0
- package/dist/execution/adapters/shared/config-utils.js.map +1 -0
- package/dist/execution/adapters/shared/index.d.ts +8 -0
- package/dist/execution/adapters/shared/index.d.ts.map +1 -0
- package/dist/execution/adapters/shared/index.js +8 -0
- package/dist/execution/adapters/shared/index.js.map +1 -0
- package/dist/execution/executors/agent-executor-wrapper.d.ts +153 -0
- package/dist/execution/executors/agent-executor-wrapper.d.ts.map +1 -0
- package/dist/execution/executors/agent-executor-wrapper.js +652 -0
- package/dist/execution/executors/agent-executor-wrapper.js.map +1 -0
- package/dist/execution/executors/executor-factory.d.ts +95 -0
- package/dist/execution/executors/executor-factory.d.ts.map +1 -0
- package/dist/execution/executors/executor-factory.js +120 -0
- package/dist/execution/executors/executor-factory.js.map +1 -0
- package/dist/execution/output/ag-ui-adapter.d.ts +0 -2
- package/dist/execution/output/ag-ui-adapter.d.ts.map +1 -1
- package/dist/execution/output/ag-ui-adapter.js +0 -2
- package/dist/execution/output/ag-ui-adapter.js.map +1 -1
- package/dist/execution/output/index.d.ts +0 -3
- package/dist/execution/output/index.d.ts.map +1 -1
- package/dist/execution/output/index.js +0 -2
- package/dist/execution/output/index.js.map +1 -1
- package/dist/execution/output/normalized-to-ag-ui-adapter.d.ts +108 -0
- package/dist/execution/output/normalized-to-ag-ui-adapter.d.ts.map +1 -0
- package/dist/execution/output/normalized-to-ag-ui-adapter.js +321 -0
- package/dist/execution/output/normalized-to-ag-ui-adapter.js.map +1 -0
- package/dist/execution/process/builders/claude.d.ts +25 -58
- package/dist/execution/process/builders/claude.d.ts.map +1 -1
- package/dist/execution/process/builders/claude.js +153 -19
- package/dist/execution/process/builders/claude.js.map +1 -1
- package/dist/execution/transport/ipc-transport-manager.d.ts +74 -0
- package/dist/execution/transport/ipc-transport-manager.d.ts.map +1 -0
- package/dist/execution/transport/ipc-transport-manager.js +104 -0
- package/dist/execution/transport/ipc-transport-manager.js.map +1 -0
- package/dist/execution/transport/transport-manager.d.ts.map +1 -1
- package/dist/execution/transport/transport-manager.js +3 -0
- package/dist/execution/transport/transport-manager.js.map +1 -1
- package/dist/execution/worktree/conflict-detector.d.ts +85 -0
- package/dist/execution/worktree/conflict-detector.d.ts.map +1 -0
- package/dist/execution/worktree/conflict-detector.js +129 -0
- package/dist/execution/worktree/conflict-detector.js.map +1 -0
- package/dist/execution/worktree/git-cli.d.ts +9 -0
- package/dist/execution/worktree/git-cli.d.ts.map +1 -1
- package/dist/execution/worktree/git-cli.js +10 -0
- package/dist/execution/worktree/git-cli.js.map +1 -1
- package/dist/execution/worktree/git-sync-cli.d.ts +187 -0
- package/dist/execution/worktree/git-sync-cli.d.ts.map +1 -0
- package/dist/execution/worktree/git-sync-cli.js +350 -0
- package/dist/execution/worktree/git-sync-cli.js.map +1 -0
- package/dist/execution/worktree/manager.d.ts +18 -0
- package/dist/execution/worktree/manager.d.ts.map +1 -1
- package/dist/execution/worktree/manager.js +9 -3
- package/dist/execution/worktree/manager.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +175 -195
- package/dist/index.js.map +1 -1
- package/dist/middleware/project-context.d.ts +37 -0
- package/dist/middleware/project-context.d.ts.map +1 -0
- package/dist/middleware/project-context.js +91 -0
- package/dist/middleware/project-context.js.map +1 -0
- package/dist/public/assets/index-Bb_W5bUr.css +1 -0
- package/dist/public/assets/index-CFKL113G.js +710 -0
- package/dist/public/assets/index-CFKL113G.js.map +1 -0
- package/dist/public/assets/{react-vendor-ByUx1V_q.js → react-vendor-DiL5hC7l.js} +2 -2
- package/dist/public/assets/{react-vendor-ByUx1V_q.js.map → react-vendor-DiL5hC7l.js.map} +1 -1
- package/dist/public/assets/ui-vendor-B4WMPEfa.js +54 -0
- package/dist/public/assets/ui-vendor-B4WMPEfa.js.map +1 -0
- package/dist/public/index.html +4 -4
- package/dist/routes/agents.d.ts +3 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +62 -0
- package/dist/routes/agents.js.map +1 -0
- package/dist/routes/config.d.ts +3 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +25 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/editors.d.ts +15 -0
- package/dist/routes/editors.d.ts.map +1 -0
- package/dist/routes/editors.js +98 -0
- package/dist/routes/editors.js.map +1 -0
- package/dist/routes/executions-stream.d.ts +8 -5
- package/dist/routes/executions-stream.d.ts.map +1 -1
- package/dist/routes/executions-stream.js +10 -6
- package/dist/routes/executions-stream.js.map +1 -1
- package/dist/routes/executions.d.ts +6 -10
- package/dist/routes/executions.d.ts.map +1 -1
- package/dist/routes/executions.js +506 -54
- package/dist/routes/executions.js.map +1 -1
- package/dist/routes/feedback.d.ts +3 -2
- package/dist/routes/feedback.d.ts.map +1 -1
- package/dist/routes/feedback.js +32 -22
- package/dist/routes/feedback.js.map +1 -1
- package/dist/routes/files.d.ts +18 -0
- package/dist/routes/files.d.ts.map +1 -0
- package/dist/routes/files.js +89 -0
- package/dist/routes/files.js.map +1 -0
- package/dist/routes/issues.d.ts +3 -2
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +19 -18
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/projects.d.ts +11 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +447 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/relationships.d.ts +3 -2
- package/dist/routes/relationships.d.ts.map +1 -1
- package/dist/routes/relationships.js +12 -10
- package/dist/routes/relationships.js.map +1 -1
- package/dist/routes/repo-info.d.ts +3 -0
- package/dist/routes/repo-info.d.ts.map +1 -0
- package/dist/routes/repo-info.js +126 -0
- package/dist/routes/repo-info.js.map +1 -0
- package/dist/routes/specs.d.ts +3 -2
- package/dist/routes/specs.d.ts.map +1 -1
- package/dist/routes/specs.js +19 -18
- package/dist/routes/specs.js.map +1 -1
- package/dist/services/agent-registry.d.ts +140 -0
- package/dist/services/agent-registry.d.ts.map +1 -0
- package/dist/services/agent-registry.js +272 -0
- package/dist/services/agent-registry.js.map +1 -0
- package/dist/services/db.d.ts.map +1 -1
- package/dist/services/db.js +19 -14
- package/dist/services/db.js.map +1 -1
- package/dist/services/editor-service.d.ts +57 -0
- package/dist/services/editor-service.d.ts.map +1 -0
- package/dist/services/editor-service.js +204 -0
- package/dist/services/editor-service.js.map +1 -0
- package/dist/services/execution-changes-service.d.ts +92 -0
- package/dist/services/execution-changes-service.d.ts.map +1 -0
- package/dist/services/execution-changes-service.js +546 -0
- package/dist/services/execution-changes-service.js.map +1 -0
- package/dist/services/execution-lifecycle.d.ts +1 -0
- package/dist/services/execution-lifecycle.d.ts.map +1 -1
- package/dist/services/execution-lifecycle.js +37 -7
- package/dist/services/execution-lifecycle.js.map +1 -1
- package/dist/services/execution-logs-store.d.ts +75 -0
- package/dist/services/execution-logs-store.d.ts.map +1 -1
- package/dist/services/execution-logs-store.js +142 -2
- package/dist/services/execution-logs-store.js.map +1 -1
- package/dist/services/execution-service.d.ts +50 -58
- package/dist/services/execution-service.d.ts.map +1 -1
- package/dist/services/execution-service.js +433 -448
- package/dist/services/execution-service.js.map +1 -1
- package/dist/services/execution-worker-pool.d.ts +116 -0
- package/dist/services/execution-worker-pool.d.ts.map +1 -0
- package/dist/services/execution-worker-pool.js +326 -0
- package/dist/services/execution-worker-pool.js.map +1 -0
- package/dist/services/executions.d.ts +3 -0
- package/dist/services/executions.d.ts.map +1 -1
- package/dist/services/executions.js +11 -2
- package/dist/services/executions.js.map +1 -1
- package/dist/services/export.d.ts +8 -2
- package/dist/services/export.d.ts.map +1 -1
- package/dist/services/export.js +29 -23
- package/dist/services/export.js.map +1 -1
- package/dist/services/feedback.d.ts +16 -0
- package/dist/services/feedback.d.ts.map +1 -1
- package/dist/services/feedback.js +25 -1
- package/dist/services/feedback.js.map +1 -1
- package/dist/services/file-search/git-ls-files-strategy.d.ts +72 -0
- package/dist/services/file-search/git-ls-files-strategy.d.ts.map +1 -0
- package/dist/services/file-search/git-ls-files-strategy.js +176 -0
- package/dist/services/file-search/git-ls-files-strategy.js.map +1 -0
- package/dist/services/file-search/index.d.ts +9 -0
- package/dist/services/file-search/index.d.ts.map +1 -0
- package/dist/services/file-search/index.js +10 -0
- package/dist/services/file-search/index.js.map +1 -0
- package/dist/services/file-search/registry.d.ts +97 -0
- package/dist/services/file-search/registry.d.ts.map +1 -0
- package/dist/services/file-search/registry.js +140 -0
- package/dist/services/file-search/registry.js.map +1 -0
- package/dist/services/file-search/strategy.d.ts +58 -0
- package/dist/services/file-search/strategy.d.ts.map +1 -0
- package/dist/services/file-search/strategy.js +8 -0
- package/dist/services/file-search/strategy.js.map +1 -0
- package/dist/services/project-context.d.ts +69 -0
- package/dist/services/project-context.d.ts.map +1 -0
- package/dist/services/project-context.js +113 -0
- package/dist/services/project-context.js.map +1 -0
- package/dist/services/project-manager.d.ts +95 -0
- package/dist/services/project-manager.d.ts.map +1 -0
- package/dist/services/project-manager.js +388 -0
- package/dist/services/project-manager.js.map +1 -0
- package/dist/services/project-registry.d.ts +98 -0
- package/dist/services/project-registry.d.ts.map +1 -0
- package/dist/services/project-registry.js +289 -0
- package/dist/services/project-registry.js.map +1 -0
- package/dist/services/prompt-resolver.d.ts +97 -0
- package/dist/services/prompt-resolver.d.ts.map +1 -0
- package/dist/services/prompt-resolver.js +377 -0
- package/dist/services/prompt-resolver.js.map +1 -0
- package/dist/services/repo-info.d.ts +29 -0
- package/dist/services/repo-info.d.ts.map +1 -0
- package/dist/services/repo-info.js +99 -0
- package/dist/services/repo-info.js.map +1 -0
- package/dist/services/watcher.d.ts +3 -4
- package/dist/services/watcher.d.ts.map +1 -1
- package/dist/services/watcher.js +18 -35
- package/dist/services/watcher.js.map +1 -1
- package/dist/services/websocket.d.ts +51 -15
- package/dist/services/websocket.d.ts.map +1 -1
- package/dist/services/websocket.js +169 -40
- package/dist/services/websocket.js.map +1 -1
- package/dist/services/worktree-sync-service.d.ts +228 -0
- package/dist/services/worktree-sync-service.d.ts.map +1 -0
- package/dist/services/worktree-sync-service.js +563 -0
- package/dist/services/worktree-sync-service.js.map +1 -0
- package/dist/types/editor.d.ts +49 -0
- package/dist/types/editor.d.ts.map +1 -0
- package/dist/types/editor.js +50 -0
- package/dist/types/editor.js.map +1 -0
- package/dist/types/project.d.ts +58 -0
- package/dist/types/project.d.ts.map +1 -0
- package/dist/types/project.js +10 -0
- package/dist/types/project.js.map +1 -0
- package/dist/utils/executable-check.d.ts +36 -0
- package/dist/utils/executable-check.d.ts.map +1 -0
- package/dist/utils/executable-check.js +79 -0
- package/dist/utils/executable-check.js.map +1 -0
- package/dist/workers/execution-worker.d.ts +18 -0
- package/dist/workers/execution-worker.d.ts.map +1 -0
- package/dist/workers/execution-worker.js +340 -0
- package/dist/workers/execution-worker.js.map +1 -0
- package/dist/workers/worker-ipc.d.ts +84 -0
- package/dist/workers/worker-ipc.d.ts.map +1 -0
- package/dist/workers/worker-ipc.js +29 -0
- package/dist/workers/worker-ipc.js.map +1 -0
- package/package.json +6 -4
- package/dist/execution/engine/engine.d.ts +0 -103
- package/dist/execution/engine/engine.d.ts.map +0 -1
- package/dist/execution/engine/engine.js +0 -10
- package/dist/execution/engine/engine.js.map +0 -1
- package/dist/execution/engine/simple-engine.d.ts +0 -190
- package/dist/execution/engine/simple-engine.d.ts.map +0 -1
- package/dist/execution/engine/simple-engine.js +0 -611
- package/dist/execution/engine/simple-engine.js.map +0 -1
- package/dist/execution/engine/types.d.ts +0 -116
- package/dist/execution/engine/types.d.ts.map +0 -1
- package/dist/execution/engine/types.js +0 -10
- package/dist/execution/engine/types.js.map +0 -1
- package/dist/execution/output/ag-ui-integration.d.ts +0 -96
- package/dist/execution/output/ag-ui-integration.d.ts.map +0 -1
- package/dist/execution/output/ag-ui-integration.js +0 -96
- package/dist/execution/output/ag-ui-integration.js.map +0 -1
- package/dist/execution/output/claude-code-output-processor.d.ts +0 -321
- package/dist/execution/output/claude-code-output-processor.d.ts.map +0 -1
- package/dist/execution/output/claude-code-output-processor.js +0 -769
- package/dist/execution/output/claude-code-output-processor.js.map +0 -1
- package/dist/execution/process/index.d.ts +0 -15
- package/dist/execution/process/index.d.ts.map +0 -1
- package/dist/execution/process/index.js +0 -15
- package/dist/execution/process/index.js.map +0 -1
- package/dist/execution/process/manager.d.ts +0 -133
- package/dist/execution/process/manager.d.ts.map +0 -1
- package/dist/execution/process/manager.js +0 -10
- package/dist/execution/process/manager.js.map +0 -1
- package/dist/execution/process/simple-manager.d.ts +0 -102
- package/dist/execution/process/simple-manager.d.ts.map +0 -1
- package/dist/execution/process/simple-manager.js +0 -336
- package/dist/execution/process/simple-manager.js.map +0 -1
- package/dist/execution/process/types.d.ts +0 -105
- package/dist/execution/process/types.d.ts.map +0 -1
- package/dist/execution/process/types.js +0 -10
- package/dist/execution/process/types.js.map +0 -1
- package/dist/execution/process/utils.d.ts +0 -53
- package/dist/execution/process/utils.d.ts.map +0 -1
- package/dist/execution/process/utils.js +0 -97
- package/dist/execution/process/utils.js.map +0 -1
- package/dist/execution/resilience/circuit-breaker.d.ts +0 -170
- package/dist/execution/resilience/circuit-breaker.d.ts.map +0 -1
- package/dist/execution/resilience/circuit-breaker.js +0 -291
- package/dist/execution/resilience/circuit-breaker.js.map +0 -1
- package/dist/execution/resilience/executor.d.ts +0 -109
- package/dist/execution/resilience/executor.d.ts.map +0 -1
- package/dist/execution/resilience/executor.js +0 -10
- package/dist/execution/resilience/executor.js.map +0 -1
- package/dist/execution/resilience/index.d.ts +0 -14
- package/dist/execution/resilience/index.d.ts.map +0 -1
- package/dist/execution/resilience/index.js +0 -15
- package/dist/execution/resilience/index.js.map +0 -1
- package/dist/execution/resilience/resilient-executor.d.ts +0 -86
- package/dist/execution/resilience/resilient-executor.d.ts.map +0 -1
- package/dist/execution/resilience/resilient-executor.js +0 -261
- package/dist/execution/resilience/resilient-executor.js.map +0 -1
- package/dist/execution/resilience/retry.d.ts +0 -161
- package/dist/execution/resilience/retry.d.ts.map +0 -1
- package/dist/execution/resilience/retry.js +0 -234
- package/dist/execution/resilience/retry.js.map +0 -1
- package/dist/execution/resilience/types.d.ts +0 -226
- package/dist/execution/resilience/types.d.ts.map +0 -1
- package/dist/execution/resilience/types.js +0 -30
- package/dist/execution/resilience/types.js.map +0 -1
- package/dist/execution/workflow/index.d.ts +0 -13
- package/dist/execution/workflow/index.d.ts.map +0 -1
- package/dist/execution/workflow/index.js +0 -13
- package/dist/execution/workflow/index.js.map +0 -1
- package/dist/execution/workflow/linear-orchestrator.d.ts +0 -216
- package/dist/execution/workflow/linear-orchestrator.d.ts.map +0 -1
- package/dist/execution/workflow/linear-orchestrator.js +0 -683
- package/dist/execution/workflow/linear-orchestrator.js.map +0 -1
- package/dist/execution/workflow/memory-storage.d.ts +0 -54
- package/dist/execution/workflow/memory-storage.d.ts.map +0 -1
- package/dist/execution/workflow/memory-storage.js +0 -68
- package/dist/execution/workflow/memory-storage.js.map +0 -1
- package/dist/execution/workflow/orchestrator.d.ts +0 -158
- package/dist/execution/workflow/orchestrator.d.ts.map +0 -1
- package/dist/execution/workflow/orchestrator.js +0 -9
- package/dist/execution/workflow/orchestrator.js.map +0 -1
- package/dist/execution/workflow/types.d.ts +0 -172
- package/dist/execution/workflow/types.d.ts.map +0 -1
- package/dist/execution/workflow/types.js +0 -9
- package/dist/execution/workflow/types.js.map +0 -1
- package/dist/execution/workflow/utils.d.ts +0 -89
- package/dist/execution/workflow/utils.d.ts.map +0 -1
- package/dist/execution/workflow/utils.js +0 -152
- package/dist/execution/workflow/utils.js.map +0 -1
- package/dist/public/assets/index-BvlblDHK.js +0 -570
- package/dist/public/assets/index-BvlblDHK.js.map +0 -1
- package/dist/public/assets/index-BwuKdLgN.css +0 -1
- package/dist/public/assets/ui-vendor-CotR6bx9.js +0 -54
- package/dist/public/assets/ui-vendor-CotR6bx9.js.map +0 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worktree Sync Service
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates worktree sync operations including conflict detection,
|
|
5
|
+
* JSONL resolution, git operations, and database updates.
|
|
6
|
+
*
|
|
7
|
+
* @module services/worktree-sync-service
|
|
8
|
+
*/
|
|
9
|
+
import type Database from "better-sqlite3";
|
|
10
|
+
import type { Execution, ExecutionStatus } from "@sudocode-ai/types";
|
|
11
|
+
import { type DiffResult, type Commit } from "../execution/worktree/git-sync-cli.js";
|
|
12
|
+
import { type ConflictReport, type JSONLConflict } from "../execution/worktree/conflict-detector.js";
|
|
13
|
+
/**
|
|
14
|
+
* Worktree sync error codes
|
|
15
|
+
*/
|
|
16
|
+
export declare enum WorktreeSyncErrorCode {
|
|
17
|
+
NO_WORKTREE = "NO_WORKTREE",
|
|
18
|
+
WORKTREE_MISSING = "WORKTREE_MISSING",
|
|
19
|
+
BRANCH_MISSING = "BRANCH_MISSING",
|
|
20
|
+
DIRTY_WORKING_TREE = "DIRTY_WORKING_TREE",
|
|
21
|
+
TARGET_BRANCH_MISSING = "TARGET_BRANCH_MISSING",
|
|
22
|
+
NO_COMMON_BASE = "NO_COMMON_BASE",
|
|
23
|
+
CODE_CONFLICTS = "CODE_CONFLICTS",
|
|
24
|
+
MERGE_FAILED = "MERGE_FAILED",
|
|
25
|
+
JSONL_RESOLUTION_FAILED = "JSONL_RESOLUTION_FAILED",
|
|
26
|
+
DATABASE_SYNC_FAILED = "DATABASE_SYNC_FAILED",
|
|
27
|
+
EXECUTION_NOT_FOUND = "EXECUTION_NOT_FOUND"
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Worktree sync error class
|
|
31
|
+
*/
|
|
32
|
+
export declare class WorktreeSyncError extends Error {
|
|
33
|
+
code: WorktreeSyncErrorCode;
|
|
34
|
+
cause?: Error | undefined;
|
|
35
|
+
constructor(message: string, code: WorktreeSyncErrorCode, cause?: Error | undefined);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sync preview result
|
|
39
|
+
*/
|
|
40
|
+
export interface SyncPreviewResult {
|
|
41
|
+
canSync: boolean;
|
|
42
|
+
conflicts: ConflictReport;
|
|
43
|
+
diff: DiffResult;
|
|
44
|
+
commits: Commit[];
|
|
45
|
+
mergeBase: string;
|
|
46
|
+
uncommittedJSONLChanges: string[];
|
|
47
|
+
executionStatus: ExecutionStatus;
|
|
48
|
+
warnings: string[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Squash sync result
|
|
52
|
+
*/
|
|
53
|
+
export interface SyncResult {
|
|
54
|
+
success: boolean;
|
|
55
|
+
finalCommit?: string;
|
|
56
|
+
filesChanged: number;
|
|
57
|
+
conflictsResolved: number;
|
|
58
|
+
uncommittedJSONLIncluded: boolean;
|
|
59
|
+
error?: string;
|
|
60
|
+
cleanupOffered?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* WorktreeSyncService
|
|
64
|
+
*
|
|
65
|
+
* Main service class for orchestrating worktree sync operations
|
|
66
|
+
*/
|
|
67
|
+
export declare class WorktreeSyncService {
|
|
68
|
+
private db;
|
|
69
|
+
private repoPath;
|
|
70
|
+
private gitSync;
|
|
71
|
+
private conflictDetector;
|
|
72
|
+
constructor(db: Database.Database, repoPath: string);
|
|
73
|
+
/**
|
|
74
|
+
* Preview sync without making changes
|
|
75
|
+
*
|
|
76
|
+
* @param executionId - Execution ID to preview sync for
|
|
77
|
+
* @returns Preview result with conflicts, diff, and warnings
|
|
78
|
+
*/
|
|
79
|
+
previewSync(executionId: string): Promise<SyncPreviewResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Load execution from database and validate it exists
|
|
82
|
+
*
|
|
83
|
+
* Used by previewSync() and will be used in i-9gz4 (squash sync)
|
|
84
|
+
*
|
|
85
|
+
* @param executionId - Execution ID to load
|
|
86
|
+
* @returns Execution record
|
|
87
|
+
* @throws WorktreeSyncError if execution not found
|
|
88
|
+
*/
|
|
89
|
+
private _loadAndValidateExecution;
|
|
90
|
+
/**
|
|
91
|
+
* Validate preconditions for sync
|
|
92
|
+
*
|
|
93
|
+
* Used by previewSync() and will be used in i-9gz4 (squash sync)
|
|
94
|
+
*
|
|
95
|
+
* Checks:
|
|
96
|
+
* - Worktree exists
|
|
97
|
+
* - Worktree branch exists
|
|
98
|
+
* - Local working tree is clean
|
|
99
|
+
* - Target branch exists
|
|
100
|
+
* - Branches have common base
|
|
101
|
+
*
|
|
102
|
+
* @param execution - Execution to validate
|
|
103
|
+
* @throws WorktreeSyncError if any precondition fails
|
|
104
|
+
*/
|
|
105
|
+
private _validateSyncPreconditions;
|
|
106
|
+
/**
|
|
107
|
+
* Create safety snapshot before sync
|
|
108
|
+
*
|
|
109
|
+
* Creates a git tag pointing to current target branch HEAD
|
|
110
|
+
* for rollback capability
|
|
111
|
+
*
|
|
112
|
+
* @param executionId - Execution ID
|
|
113
|
+
* @param targetBranch - Target branch name
|
|
114
|
+
* @returns Tag name created
|
|
115
|
+
*/
|
|
116
|
+
private _createSafetySnapshot;
|
|
117
|
+
/**
|
|
118
|
+
* Get uncommitted JSONL files from worktree
|
|
119
|
+
*
|
|
120
|
+
* Used by previewSync() and will be used in i-3wmx (JSONL conflict resolution)
|
|
121
|
+
*
|
|
122
|
+
* @param worktreePath - Path to worktree
|
|
123
|
+
* @returns Array of uncommitted JSONL file paths
|
|
124
|
+
*/
|
|
125
|
+
private _getUncommittedJSONLFiles;
|
|
126
|
+
/**
|
|
127
|
+
* Check if local working tree is clean
|
|
128
|
+
*
|
|
129
|
+
* TODO: Will be used in i-7ya6 (sync preview)
|
|
130
|
+
*
|
|
131
|
+
* @returns true if clean, false if dirty
|
|
132
|
+
*/
|
|
133
|
+
private _isLocalTreeClean;
|
|
134
|
+
/**
|
|
135
|
+
* Get list of branches in repository
|
|
136
|
+
*
|
|
137
|
+
* @returns Array of branch names
|
|
138
|
+
*/
|
|
139
|
+
private _getBranches;
|
|
140
|
+
/**
|
|
141
|
+
* Get current commit SHA for a branch
|
|
142
|
+
*
|
|
143
|
+
* @param branchName - Branch name
|
|
144
|
+
* @returns Commit SHA
|
|
145
|
+
*/
|
|
146
|
+
private _getCurrentCommit;
|
|
147
|
+
/**
|
|
148
|
+
* Escape shell argument for safe command execution
|
|
149
|
+
*
|
|
150
|
+
* @param arg - Argument to escape
|
|
151
|
+
* @returns Escaped argument
|
|
152
|
+
*/
|
|
153
|
+
private _escapeShellArg;
|
|
154
|
+
/**
|
|
155
|
+
* Resolve JSONL conflicts using three-way merge
|
|
156
|
+
*
|
|
157
|
+
* Used in squash sync to auto-resolve JSONL conflicts
|
|
158
|
+
*
|
|
159
|
+
* @param execution - Execution record
|
|
160
|
+
* @param jsonlConflicts - List of JSONL conflicts to resolve
|
|
161
|
+
* @throws WorktreeSyncError if resolution fails
|
|
162
|
+
*/
|
|
163
|
+
resolveJSONLConflicts(execution: Execution, jsonlConflicts: JSONLConflict[]): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Read JSONL file at a specific git revision
|
|
166
|
+
*
|
|
167
|
+
* @param filePath - Relative path to JSONL file
|
|
168
|
+
* @param revision - Git revision (commit SHA or branch name)
|
|
169
|
+
* @returns Array of JSONL entities
|
|
170
|
+
*/
|
|
171
|
+
private _readJSONLVersion;
|
|
172
|
+
/**
|
|
173
|
+
* Commit uncommitted JSONL files in worktree
|
|
174
|
+
*
|
|
175
|
+
* Used during sync to include uncommitted JSONL changes
|
|
176
|
+
*
|
|
177
|
+
* @param worktreePath - Path to worktree
|
|
178
|
+
* @param uncommittedFiles - List of uncommitted JSONL file paths
|
|
179
|
+
* @throws WorktreeSyncError if commit fails
|
|
180
|
+
*/
|
|
181
|
+
commitUncommittedJSONL(worktreePath: string, uncommittedFiles: string[]): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Perform git merge --squash operation
|
|
184
|
+
*
|
|
185
|
+
* @param sourceBranch - Branch to merge from (worktree branch)
|
|
186
|
+
* @param targetBranch - Branch to merge into
|
|
187
|
+
* @returns Object with filesChanged count
|
|
188
|
+
* @throws WorktreeSyncError if merge fails
|
|
189
|
+
*/
|
|
190
|
+
private _performSquashMerge;
|
|
191
|
+
/**
|
|
192
|
+
* Generate commit message for squash sync
|
|
193
|
+
*
|
|
194
|
+
* @param execution - Execution record
|
|
195
|
+
* @param commitCount - Number of commits being squashed
|
|
196
|
+
* @returns Generated commit message
|
|
197
|
+
*/
|
|
198
|
+
private _generateCommitMessage;
|
|
199
|
+
/**
|
|
200
|
+
* Create commit with staged changes
|
|
201
|
+
*
|
|
202
|
+
* @param message - Commit message
|
|
203
|
+
* @returns Commit SHA
|
|
204
|
+
* @throws WorktreeSyncError if commit fails
|
|
205
|
+
*/
|
|
206
|
+
private _createCommit;
|
|
207
|
+
/**
|
|
208
|
+
* Rollback to safety snapshot
|
|
209
|
+
*
|
|
210
|
+
* @param targetBranch - Target branch to reset
|
|
211
|
+
* @param tagName - Safety tag to rollback to
|
|
212
|
+
* @throws WorktreeSyncError if rollback fails
|
|
213
|
+
*/
|
|
214
|
+
private _rollbackToSnapshot;
|
|
215
|
+
/**
|
|
216
|
+
* Perform squash sync operation
|
|
217
|
+
*
|
|
218
|
+
* Squashes all worktree commits into a single commit on the target branch.
|
|
219
|
+
* Auto-resolves JSONL conflicts but blocks on code conflicts.
|
|
220
|
+
*
|
|
221
|
+
* @param executionId - Execution ID to sync
|
|
222
|
+
* @param customCommitMessage - Optional custom commit message
|
|
223
|
+
* @returns Sync result with details
|
|
224
|
+
* @throws WorktreeSyncError if sync fails
|
|
225
|
+
*/
|
|
226
|
+
squashSync(executionId: string, customCommitMessage?: string): Promise<SyncResult>;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=worktree-sync-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-sync-service.d.ts","sourceRoot":"","sources":["../../src/services/worktree-sync-service.ts"],"names":[],"mappings":"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"}
|