@syntero/orca-cli 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant.d.ts +17 -3
- package/dist/assistant.d.ts.map +1 -1
- package/dist/assistant.js +217 -22
- package/dist/assistant.js.map +1 -1
- package/dist/auth.d.ts +97 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +438 -0
- package/dist/auth.js.map +1 -0
- package/dist/autocomplete.d.ts +24 -0
- package/dist/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete.js +43 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/components/ChatApp.d.ts +32 -0
- package/dist/components/ChatApp.d.ts.map +1 -0
- package/dist/components/ChatApp.js +470 -0
- package/dist/components/ChatApp.js.map +1 -0
- package/dist/components/CommandPalette.d.ts +15 -0
- package/dist/components/CommandPalette.d.ts.map +1 -0
- package/dist/components/CommandPalette.js +22 -0
- package/dist/components/CommandPalette.js.map +1 -0
- package/dist/components/ConfigWizard.d.ts +25 -0
- package/dist/components/ConfigWizard.d.ts.map +1 -0
- package/dist/components/ConfigWizard.js +401 -0
- package/dist/components/ConfigWizard.js.map +1 -0
- package/dist/components/InputFooter.d.ts +33 -0
- package/dist/components/InputFooter.d.ts.map +1 -0
- package/dist/components/InputFooter.js +618 -0
- package/dist/components/InputFooter.js.map +1 -0
- package/dist/components/InputModal.d.ts +25 -0
- package/dist/components/InputModal.d.ts.map +1 -0
- package/dist/components/InputModal.js +529 -0
- package/dist/components/InputModal.js.map +1 -0
- package/dist/components/ModelMenu.d.ts +24 -0
- package/dist/components/ModelMenu.d.ts.map +1 -0
- package/dist/components/ModelMenu.js +175 -0
- package/dist/components/ModelMenu.js.map +1 -0
- package/dist/components/ProviderMenu.d.ts +20 -0
- package/dist/components/ProviderMenu.d.ts.map +1 -0
- package/dist/components/ProviderMenu.js +31 -0
- package/dist/components/ProviderMenu.js.map +1 -0
- package/dist/components/SyncMenu.d.ts +23 -0
- package/dist/components/SyncMenu.d.ts.map +1 -0
- package/dist/components/SyncMenu.js +135 -0
- package/dist/components/SyncMenu.js.map +1 -0
- package/dist/components/TokenInput.d.ts +15 -0
- package/dist/components/TokenInput.d.ts.map +1 -0
- package/dist/components/TokenInput.js +103 -0
- package/dist/components/TokenInput.js.map +1 -0
- package/dist/index.js +323 -173
- package/dist/index.js.map +1 -1
- package/dist/ink-input.d.ts +14 -0
- package/dist/ink-input.d.ts.map +1 -0
- package/dist/ink-input.js +92 -0
- package/dist/ink-input.js.map +1 -0
- package/dist/models.d.ts +115 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +221 -0
- package/dist/models.js.map +1 -0
- package/dist/providers.d.ts +19 -4
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +80 -112
- package/dist/providers.js.map +1 -1
- package/dist/settings.d.ts +15 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +56 -21
- package/dist/settings.js.map +1 -1
- package/dist/sync/docker.d.ts +68 -0
- package/dist/sync/docker.d.ts.map +1 -0
- package/dist/sync/docker.js +234 -0
- package/dist/sync/docker.js.map +1 -0
- package/dist/sync/download.d.ts +87 -0
- package/dist/sync/download.d.ts.map +1 -0
- package/dist/sync/download.js +291 -0
- package/dist/sync/download.js.map +1 -0
- package/dist/sync/hash.d.ts +60 -0
- package/dist/sync/hash.d.ts.map +1 -0
- package/dist/sync/hash.js +92 -0
- package/dist/sync/hash.js.map +1 -0
- package/dist/sync/index.d.ts +15 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +21 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/manifest.d.ts +132 -0
- package/dist/sync/manifest.d.ts.map +1 -0
- package/dist/sync/manifest.js +260 -0
- package/dist/sync/manifest.js.map +1 -0
- package/dist/sync/progress.d.ts +164 -0
- package/dist/sync/progress.d.ts.map +1 -0
- package/dist/sync/progress.js +233 -0
- package/dist/sync/progress.js.map +1 -0
- package/dist/sync/services.d.ts +70 -0
- package/dist/sync/services.d.ts.map +1 -0
- package/dist/sync/services.js +134 -0
- package/dist/sync/services.js.map +1 -0
- package/dist/sync/sync-engine.d.ts +69 -0
- package/dist/sync/sync-engine.d.ts.map +1 -0
- package/dist/sync/sync-engine.js +533 -0
- package/dist/sync/sync-engine.js.map +1 -0
- package/dist/tokens.d.ts +70 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +198 -0
- package/dist/tokens.js.map +1 -0
- package/dist/tools.d.ts +60 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +34 -0
- package/dist/tools.js.map +1 -1
- package/dist/types/sync.d.ts +284 -0
- package/dist/types/sync.d.ts.map +1 -0
- package/dist/types/sync.js +5 -0
- package/dist/types/sync.js.map +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Engine - Main sync logic for library sync.
|
|
3
|
+
*
|
|
4
|
+
* Handles the complete sync workflow:
|
|
5
|
+
* 1. Pre-flight checks
|
|
6
|
+
* 2. Fetch remote manifest
|
|
7
|
+
* 3. Compare with local manifest
|
|
8
|
+
* 4. Build sync plan
|
|
9
|
+
* 5. Execute sync (download, verify, write to container)
|
|
10
|
+
* 6. Update local manifest and services registry
|
|
11
|
+
*/
|
|
12
|
+
import { SyncOptions, SyncResult } from '../types/sync.js';
|
|
13
|
+
/**
|
|
14
|
+
* SyncEngine class - orchestrates the sync process.
|
|
15
|
+
*/
|
|
16
|
+
export declare class SyncEngine {
|
|
17
|
+
private options;
|
|
18
|
+
private progressState;
|
|
19
|
+
constructor(options?: SyncOptions);
|
|
20
|
+
/**
|
|
21
|
+
* Main sync entry point.
|
|
22
|
+
*/
|
|
23
|
+
sync(): Promise<SyncResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Resume an interrupted sync.
|
|
26
|
+
*/
|
|
27
|
+
resume(): Promise<SyncResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Show sync status.
|
|
30
|
+
*/
|
|
31
|
+
status(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Fetch remote manifest from backend.
|
|
34
|
+
*/
|
|
35
|
+
private fetchRemoteManifest;
|
|
36
|
+
/**
|
|
37
|
+
* Build sync plan by comparing manifests.
|
|
38
|
+
*/
|
|
39
|
+
private buildSyncPlan;
|
|
40
|
+
/**
|
|
41
|
+
* Execute the sync plan.
|
|
42
|
+
*/
|
|
43
|
+
private executeSyncPlan;
|
|
44
|
+
/**
|
|
45
|
+
* Update the services registry in the sandbox.
|
|
46
|
+
*/
|
|
47
|
+
private updateServicesRegistry;
|
|
48
|
+
/**
|
|
49
|
+
* Update the local sync manifest.
|
|
50
|
+
*/
|
|
51
|
+
private updateLocalManifest;
|
|
52
|
+
/**
|
|
53
|
+
* Create a failed result.
|
|
54
|
+
*/
|
|
55
|
+
private createFailedResult;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Run sync with options.
|
|
59
|
+
*/
|
|
60
|
+
export declare function runSync(options?: SyncOptions): Promise<SyncResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Resume an interrupted sync.
|
|
63
|
+
*/
|
|
64
|
+
export declare function resumeSync(options?: SyncOptions): Promise<SyncResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Show sync status.
|
|
67
|
+
*/
|
|
68
|
+
export declare function showSyncStatus(): Promise<void>;
|
|
69
|
+
//# sourceMappingURL=sync-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-engine.d.ts","sourceRoot":"","sources":["../../src/sync/sync-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EACL,WAAW,EACX,UAAU,EASX,MAAM,kBAAkB,CAAC;AAyC1B;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,aAAa,CAAgB;gBAEzB,OAAO,GAAE,WAAgB;IAYrC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IA8IjC;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC;IA8DnC;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB7B;;OAEG;YACW,mBAAmB;IA0CjC;;OAEG;IACH,OAAO,CAAC,aAAa;IAkFrB;;OAEG;YACW,eAAe;IAoG7B;;OAEG;YACW,sBAAsB;IAuCpC;;OAEG;YACW,mBAAmB;IAqDjC;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAe3B;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAG5E;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAG/E;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpD"}
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Engine - Main sync logic for library sync.
|
|
3
|
+
*
|
|
4
|
+
* Handles the complete sync workflow:
|
|
5
|
+
* 1. Pre-flight checks
|
|
6
|
+
* 2. Fetch remote manifest
|
|
7
|
+
* 3. Compare with local manifest
|
|
8
|
+
* 4. Build sync plan
|
|
9
|
+
* 5. Execute sync (download, verify, write to container)
|
|
10
|
+
* 6. Update local manifest and services registry
|
|
11
|
+
*/
|
|
12
|
+
import { cloudRequest, loadCredentials } from '../auth.js';
|
|
13
|
+
import { runPreflightChecks, writeFileToSandbox, readFileFromSandbox, deleteFromSandbox, getLibraryPath, getServicesRegistryPath } from './docker.js';
|
|
14
|
+
import { loadLocalManifest, saveLocalManifest, loadSyncState, startSync, completeSync, isFirstSync } from './manifest.js';
|
|
15
|
+
import { mergeServicesRegistry } from './services.js';
|
|
16
|
+
import { downloadWithRetry } from './download.js';
|
|
17
|
+
import { displayProgress, displayPhase, displaySuccess, displayWarning, displayError, displaySyncPlan, displayDryRunPlan, displaySyncComplete, displaySyncStatus } from './progress.js';
|
|
18
|
+
/**
|
|
19
|
+
* SyncEngine class - orchestrates the sync process.
|
|
20
|
+
*/
|
|
21
|
+
export class SyncEngine {
|
|
22
|
+
options;
|
|
23
|
+
progressState;
|
|
24
|
+
constructor(options = {}) {
|
|
25
|
+
this.options = options;
|
|
26
|
+
this.progressState = {
|
|
27
|
+
phase: 'preflight',
|
|
28
|
+
filesTotal: 0,
|
|
29
|
+
filesComplete: 0,
|
|
30
|
+
bytesTotal: 0,
|
|
31
|
+
bytesComplete: 0,
|
|
32
|
+
startTime: Date.now()
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Main sync entry point.
|
|
37
|
+
*/
|
|
38
|
+
async sync() {
|
|
39
|
+
const startTime = Date.now();
|
|
40
|
+
const errors = [];
|
|
41
|
+
// Get credentials
|
|
42
|
+
const creds = loadCredentials();
|
|
43
|
+
if (!creds) {
|
|
44
|
+
displayError('Not authenticated. Run /token first.');
|
|
45
|
+
return this.createFailedResult(startTime, errors);
|
|
46
|
+
}
|
|
47
|
+
// 1. Pre-flight checks
|
|
48
|
+
displayPhase('Running pre-flight checks...');
|
|
49
|
+
const preflight = await runPreflightChecks(creds.org_id);
|
|
50
|
+
if (!preflight.success) {
|
|
51
|
+
for (const error of preflight.errors) {
|
|
52
|
+
displayError(error);
|
|
53
|
+
}
|
|
54
|
+
return this.createFailedResult(startTime, errors);
|
|
55
|
+
}
|
|
56
|
+
for (const warning of preflight.warnings) {
|
|
57
|
+
displayWarning(warning);
|
|
58
|
+
}
|
|
59
|
+
// Check for first sync warning
|
|
60
|
+
if (isFirstSync() && preflight.existingLibraryContent && preflight.existingLibraryContent > 0) {
|
|
61
|
+
if (!this.options.force) {
|
|
62
|
+
displayWarning(`\nFirst Sync Warning`);
|
|
63
|
+
displayWarning('-'.repeat(40));
|
|
64
|
+
console.log(`The local library already contains ${preflight.existingLibraryContent} files.`);
|
|
65
|
+
console.log('Syncing will overwrite any files that conflict with the remote library.');
|
|
66
|
+
console.log('Local-only solutions will be preserved.');
|
|
67
|
+
console.log('\nRun with --force to proceed anyway.');
|
|
68
|
+
return this.createFailedResult(startTime, errors);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// 2. Fetch remote manifest
|
|
72
|
+
this.progressState.phase = 'manifest';
|
|
73
|
+
displayPhase('Fetching library manifest...');
|
|
74
|
+
const { manifest: remoteManifest, unchanged } = await this.fetchRemoteManifest();
|
|
75
|
+
if (!remoteManifest) {
|
|
76
|
+
displayError('Failed to fetch remote manifest');
|
|
77
|
+
return this.createFailedResult(startTime, errors);
|
|
78
|
+
}
|
|
79
|
+
if (unchanged && !this.options.force) {
|
|
80
|
+
displaySuccess('Library is up to date.');
|
|
81
|
+
return {
|
|
82
|
+
success: true,
|
|
83
|
+
stats: {
|
|
84
|
+
newSolutions: 0,
|
|
85
|
+
updatedSolutions: 0,
|
|
86
|
+
deletedSolutions: 0,
|
|
87
|
+
filesDownloaded: 0,
|
|
88
|
+
filesDeleted: 0,
|
|
89
|
+
bytesDownloaded: 0,
|
|
90
|
+
durationMs: Date.now() - startTime
|
|
91
|
+
},
|
|
92
|
+
errors: []
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
// 3. Load local manifest
|
|
96
|
+
this.progressState.phase = 'comparing';
|
|
97
|
+
displayPhase('Comparing with local library...');
|
|
98
|
+
const localManifest = loadLocalManifest();
|
|
99
|
+
// 4. Build sync plan
|
|
100
|
+
const plan = this.buildSyncPlan(localManifest, remoteManifest);
|
|
101
|
+
// Check if any changes
|
|
102
|
+
if (plan.newSolutions.length === 0 &&
|
|
103
|
+
plan.modifiedSolutions.length === 0 &&
|
|
104
|
+
plan.deletedSolutions.length === 0) {
|
|
105
|
+
displaySuccess('Library is up to date.');
|
|
106
|
+
return {
|
|
107
|
+
success: true,
|
|
108
|
+
stats: {
|
|
109
|
+
newSolutions: 0,
|
|
110
|
+
updatedSolutions: 0,
|
|
111
|
+
deletedSolutions: 0,
|
|
112
|
+
filesDownloaded: 0,
|
|
113
|
+
filesDeleted: 0,
|
|
114
|
+
bytesDownloaded: 0,
|
|
115
|
+
durationMs: Date.now() - startTime
|
|
116
|
+
},
|
|
117
|
+
errors: []
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
// Display plan
|
|
121
|
+
if (this.options.dryRun) {
|
|
122
|
+
displayDryRunPlan(plan);
|
|
123
|
+
return {
|
|
124
|
+
success: true,
|
|
125
|
+
stats: {
|
|
126
|
+
newSolutions: plan.newSolutions.length,
|
|
127
|
+
updatedSolutions: plan.modifiedSolutions.length,
|
|
128
|
+
deletedSolutions: plan.deletedSolutions.length,
|
|
129
|
+
filesDownloaded: plan.filesToDownload.length,
|
|
130
|
+
filesDeleted: plan.filesToDelete.length,
|
|
131
|
+
bytesDownloaded: 0,
|
|
132
|
+
durationMs: Date.now() - startTime
|
|
133
|
+
},
|
|
134
|
+
errors: []
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
displaySyncPlan(plan);
|
|
138
|
+
// 5. Execute sync
|
|
139
|
+
startSync();
|
|
140
|
+
const stats = await this.executeSyncPlan(plan, creds.org_id, remoteManifest, errors);
|
|
141
|
+
// 6. Finalize
|
|
142
|
+
const durationMs = Date.now() - startTime;
|
|
143
|
+
const finalStats = {
|
|
144
|
+
files_downloaded: stats.filesDownloaded,
|
|
145
|
+
files_skipped: 0,
|
|
146
|
+
files_deleted: stats.filesDeleted,
|
|
147
|
+
bytes_downloaded: stats.bytesDownloaded,
|
|
148
|
+
duration_ms: durationMs
|
|
149
|
+
};
|
|
150
|
+
completeSync(finalStats);
|
|
151
|
+
displaySyncComplete({ ...stats, durationMs });
|
|
152
|
+
return {
|
|
153
|
+
success: errors.length === 0,
|
|
154
|
+
stats: { ...stats, durationMs },
|
|
155
|
+
errors
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Resume an interrupted sync.
|
|
160
|
+
*/
|
|
161
|
+
async resume() {
|
|
162
|
+
const state = loadSyncState();
|
|
163
|
+
if (state.status !== 'interrupted' || !state.pending_queue) {
|
|
164
|
+
displayWarning('No interrupted sync to resume.');
|
|
165
|
+
return this.sync();
|
|
166
|
+
}
|
|
167
|
+
displayPhase(`Resuming sync: ${state.pending_queue.files_to_download.length} files remaining`);
|
|
168
|
+
// Convert pending queue to sync plan
|
|
169
|
+
const plan = {
|
|
170
|
+
newSolutions: state.pending_queue.solutions_to_sync || [],
|
|
171
|
+
modifiedSolutions: [],
|
|
172
|
+
deletedSolutions: state.pending_queue.solutions_to_delete || [],
|
|
173
|
+
filesToDownload: state.pending_queue.files_to_download.map(f => ({
|
|
174
|
+
solution: f.solution,
|
|
175
|
+
path: f.path,
|
|
176
|
+
hash: f.hash,
|
|
177
|
+
size: 0 // Size not stored in pending queue
|
|
178
|
+
})),
|
|
179
|
+
filesToDelete: []
|
|
180
|
+
};
|
|
181
|
+
const creds = loadCredentials();
|
|
182
|
+
if (!creds) {
|
|
183
|
+
displayError('Not authenticated. Run /token first.');
|
|
184
|
+
return this.createFailedResult(Date.now(), []);
|
|
185
|
+
}
|
|
186
|
+
const startTime = Date.now();
|
|
187
|
+
const errors = [];
|
|
188
|
+
// Fetch fresh manifest for solution details
|
|
189
|
+
const { manifest: remoteManifest } = await this.fetchRemoteManifest();
|
|
190
|
+
if (!remoteManifest) {
|
|
191
|
+
displayError('Failed to fetch remote manifest');
|
|
192
|
+
return this.createFailedResult(startTime, errors);
|
|
193
|
+
}
|
|
194
|
+
startSync();
|
|
195
|
+
const stats = await this.executeSyncPlan(plan, creds.org_id, remoteManifest, errors);
|
|
196
|
+
const durationMs = Date.now() - startTime;
|
|
197
|
+
const finalStats = {
|
|
198
|
+
files_downloaded: stats.filesDownloaded,
|
|
199
|
+
files_skipped: 0,
|
|
200
|
+
files_deleted: stats.filesDeleted,
|
|
201
|
+
bytes_downloaded: stats.bytesDownloaded,
|
|
202
|
+
duration_ms: durationMs
|
|
203
|
+
};
|
|
204
|
+
completeSync(finalStats);
|
|
205
|
+
displaySyncComplete({ ...stats, durationMs });
|
|
206
|
+
return {
|
|
207
|
+
success: errors.length === 0,
|
|
208
|
+
stats: { ...stats, durationMs },
|
|
209
|
+
errors
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Show sync status.
|
|
214
|
+
*/
|
|
215
|
+
async status() {
|
|
216
|
+
const { getSyncStatusSummary } = await import('./manifest.js');
|
|
217
|
+
const status = getSyncStatusSummary();
|
|
218
|
+
displaySyncStatus({
|
|
219
|
+
syncStatus: status.status,
|
|
220
|
+
lastSyncTime: status.lastSyncTime,
|
|
221
|
+
lastSyncRelative: status.lastSyncRelative,
|
|
222
|
+
solutionCount: status.solutionCount,
|
|
223
|
+
fileCount: status.fileCount,
|
|
224
|
+
totalSize: status.totalSize,
|
|
225
|
+
orgId: status.orgId,
|
|
226
|
+
endpoint: status.endpoint,
|
|
227
|
+
pendingFiles: status.pendingFiles
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Fetch remote manifest from backend.
|
|
232
|
+
*/
|
|
233
|
+
async fetchRemoteManifest() {
|
|
234
|
+
try {
|
|
235
|
+
// Build query params
|
|
236
|
+
let queryParams = '';
|
|
237
|
+
if (this.options.solutionFilter && this.options.solutionFilter.length > 0) {
|
|
238
|
+
queryParams = `?solutions=${this.options.solutionFilter.join(',')}`;
|
|
239
|
+
}
|
|
240
|
+
// Check for cached ETag
|
|
241
|
+
const localManifest = loadLocalManifest();
|
|
242
|
+
const headers = {};
|
|
243
|
+
if (localManifest?.remote_etag) {
|
|
244
|
+
headers['If-None-Match'] = localManifest.remote_etag;
|
|
245
|
+
}
|
|
246
|
+
const response = await cloudRequest('GET', `/api/v2/library/sync/manifest${queryParams}`);
|
|
247
|
+
// Check for 304 Not Modified
|
|
248
|
+
if (response.status === 304) {
|
|
249
|
+
return { manifest: null, unchanged: true };
|
|
250
|
+
}
|
|
251
|
+
if (response.status !== 200) {
|
|
252
|
+
const errorData = response.data;
|
|
253
|
+
throw new Error(errorData.error || `HTTP ${response.status}`);
|
|
254
|
+
}
|
|
255
|
+
const responseData = response.data;
|
|
256
|
+
if (responseData.status !== 'success' || !responseData.data) {
|
|
257
|
+
throw new Error('Invalid response format');
|
|
258
|
+
}
|
|
259
|
+
return { manifest: responseData.data, unchanged: false };
|
|
260
|
+
}
|
|
261
|
+
catch (e) {
|
|
262
|
+
displayError(`Failed to fetch manifest: ${e instanceof Error ? e.message : String(e)}`);
|
|
263
|
+
return { manifest: null, unchanged: false };
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Build sync plan by comparing manifests.
|
|
268
|
+
*/
|
|
269
|
+
buildSyncPlan(local, remote) {
|
|
270
|
+
const localSolutions = new Map((local?.solutions || []).map(s => [s.library_id, s]));
|
|
271
|
+
const remoteSolutions = new Map(remote.solutions.map(s => [s.library_id, s]));
|
|
272
|
+
const plan = {
|
|
273
|
+
newSolutions: [],
|
|
274
|
+
modifiedSolutions: [],
|
|
275
|
+
deletedSolutions: [],
|
|
276
|
+
filesToDownload: [],
|
|
277
|
+
filesToDelete: []
|
|
278
|
+
};
|
|
279
|
+
// Find new and modified solutions
|
|
280
|
+
for (const [id, remoteSolution] of remoteSolutions) {
|
|
281
|
+
// Apply solution filter if specified
|
|
282
|
+
if (this.options.solutionFilter && !this.options.solutionFilter.includes(id)) {
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
const localSolution = localSolutions.get(id);
|
|
286
|
+
if (!localSolution) {
|
|
287
|
+
// New solution
|
|
288
|
+
plan.newSolutions.push(id);
|
|
289
|
+
for (const file of remoteSolution.files) {
|
|
290
|
+
plan.filesToDownload.push({
|
|
291
|
+
solution: id,
|
|
292
|
+
path: file.path,
|
|
293
|
+
hash: file.hash,
|
|
294
|
+
size: file.size
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
else if (localSolution.solution_hash !== remoteSolution.solution_hash) {
|
|
299
|
+
// Modified solution - find specific file changes
|
|
300
|
+
plan.modifiedSolutions.push(id);
|
|
301
|
+
const localFiles = new Map(localSolution.files.map(f => [f.path, f]));
|
|
302
|
+
const remoteFiles = new Map(remoteSolution.files.map(f => [f.path, f]));
|
|
303
|
+
// Files to download (new or changed)
|
|
304
|
+
for (const [filePath, remoteFile] of remoteFiles) {
|
|
305
|
+
const localFile = localFiles.get(filePath);
|
|
306
|
+
if (!localFile || localFile.hash !== remoteFile.hash) {
|
|
307
|
+
plan.filesToDownload.push({
|
|
308
|
+
solution: id,
|
|
309
|
+
path: filePath,
|
|
310
|
+
hash: remoteFile.hash,
|
|
311
|
+
size: remoteFile.size
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// Files to delete (removed from solution)
|
|
316
|
+
for (const [filePath] of localFiles) {
|
|
317
|
+
if (!remoteFiles.has(filePath)) {
|
|
318
|
+
plan.filesToDelete.push({ solution: id, path: filePath });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
// Find deleted solutions
|
|
324
|
+
for (const [id] of localSolutions) {
|
|
325
|
+
if (!remoteSolutions.has(id)) {
|
|
326
|
+
// Apply solution filter if specified
|
|
327
|
+
if (this.options.solutionFilter && !this.options.solutionFilter.includes(id)) {
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
plan.deletedSolutions.push(id);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return plan;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Execute the sync plan.
|
|
337
|
+
*/
|
|
338
|
+
async executeSyncPlan(plan, orgId, remoteManifest, errors) {
|
|
339
|
+
const stats = {
|
|
340
|
+
newSolutions: plan.newSolutions.length,
|
|
341
|
+
updatedSolutions: plan.modifiedSolutions.length,
|
|
342
|
+
deletedSolutions: 0,
|
|
343
|
+
filesDownloaded: 0,
|
|
344
|
+
filesDeleted: 0,
|
|
345
|
+
bytesDownloaded: 0
|
|
346
|
+
};
|
|
347
|
+
// Update progress state
|
|
348
|
+
this.progressState.phase = 'downloading';
|
|
349
|
+
this.progressState.filesTotal = plan.filesToDownload.length;
|
|
350
|
+
this.progressState.filesComplete = 0;
|
|
351
|
+
this.progressState.bytesTotal = plan.filesToDownload.reduce((sum, f) => sum + f.size, 0);
|
|
352
|
+
this.progressState.bytesComplete = 0;
|
|
353
|
+
// Download files in batches
|
|
354
|
+
if (plan.filesToDownload.length > 0) {
|
|
355
|
+
const downloadResult = await downloadWithRetry(plan.filesToDownload, (downloaded, total) => {
|
|
356
|
+
this.progressState.filesComplete = downloaded;
|
|
357
|
+
displayProgress(this.progressState);
|
|
358
|
+
});
|
|
359
|
+
// Write downloaded files to sandbox
|
|
360
|
+
for (const file of downloadResult.files) {
|
|
361
|
+
try {
|
|
362
|
+
const containerPath = `${getLibraryPath()}/${file.solution}/${file.path}`;
|
|
363
|
+
await writeFileToSandbox(orgId, containerPath, file.content);
|
|
364
|
+
stats.filesDownloaded++;
|
|
365
|
+
stats.bytesDownloaded += file.content.length;
|
|
366
|
+
}
|
|
367
|
+
catch (e) {
|
|
368
|
+
errors.push({
|
|
369
|
+
solution: file.solution,
|
|
370
|
+
file: file.path,
|
|
371
|
+
error: e instanceof Error ? e.message : String(e)
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
// Record download errors
|
|
376
|
+
for (const error of downloadResult.errors) {
|
|
377
|
+
errors.push(error);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
// Delete files
|
|
381
|
+
this.progressState.phase = 'cleaning';
|
|
382
|
+
for (const file of plan.filesToDelete) {
|
|
383
|
+
try {
|
|
384
|
+
const containerPath = `${getLibraryPath()}/${file.solution}/${file.path}`;
|
|
385
|
+
deleteFromSandbox(orgId, containerPath);
|
|
386
|
+
stats.filesDeleted++;
|
|
387
|
+
}
|
|
388
|
+
catch (e) {
|
|
389
|
+
errors.push({
|
|
390
|
+
solution: file.solution,
|
|
391
|
+
file: file.path,
|
|
392
|
+
error: e instanceof Error ? e.message : String(e)
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
// Delete entire solutions
|
|
397
|
+
for (const solutionId of plan.deletedSolutions) {
|
|
398
|
+
try {
|
|
399
|
+
const solutionPath = `${getLibraryPath()}/${solutionId}`;
|
|
400
|
+
deleteFromSandbox(orgId, solutionPath);
|
|
401
|
+
stats.deletedSolutions++;
|
|
402
|
+
}
|
|
403
|
+
catch (e) {
|
|
404
|
+
errors.push({
|
|
405
|
+
solution: solutionId,
|
|
406
|
+
error: e instanceof Error ? e.message : String(e)
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
// Update services registry
|
|
411
|
+
await this.updateServicesRegistry(orgId, remoteManifest, plan);
|
|
412
|
+
// Update local manifest
|
|
413
|
+
await this.updateLocalManifest(remoteManifest, plan);
|
|
414
|
+
return stats;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Update the services registry in the sandbox.
|
|
418
|
+
*/
|
|
419
|
+
async updateServicesRegistry(orgId, remoteManifest, plan) {
|
|
420
|
+
try {
|
|
421
|
+
// Read current local services registry
|
|
422
|
+
let localRegistry = {};
|
|
423
|
+
try {
|
|
424
|
+
const content = await readFileFromSandbox(orgId, getServicesRegistryPath());
|
|
425
|
+
localRegistry = JSON.parse(content.toString());
|
|
426
|
+
}
|
|
427
|
+
catch {
|
|
428
|
+
// No existing registry or couldn't read
|
|
429
|
+
}
|
|
430
|
+
// Get set of synced solutions
|
|
431
|
+
const syncedSolutions = new Set([
|
|
432
|
+
...plan.newSolutions,
|
|
433
|
+
...plan.modifiedSolutions,
|
|
434
|
+
...plan.deletedSolutions
|
|
435
|
+
]);
|
|
436
|
+
// Merge registries
|
|
437
|
+
const merged = mergeServicesRegistry(remoteManifest.services_registry, localRegistry, syncedSolutions);
|
|
438
|
+
// Write updated registry
|
|
439
|
+
const content = Buffer.from(JSON.stringify(merged, null, 2));
|
|
440
|
+
await writeFileToSandbox(orgId, getServicesRegistryPath(), content);
|
|
441
|
+
}
|
|
442
|
+
catch (e) {
|
|
443
|
+
if (this.options.verbose) {
|
|
444
|
+
displayWarning(`Failed to update services registry: ${e instanceof Error ? e.message : String(e)}`);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Update the local sync manifest.
|
|
450
|
+
*/
|
|
451
|
+
async updateLocalManifest(remoteManifest, plan) {
|
|
452
|
+
const currentManifest = loadLocalManifest();
|
|
453
|
+
// Build map of existing solutions
|
|
454
|
+
const solutionMap = new Map();
|
|
455
|
+
if (currentManifest) {
|
|
456
|
+
for (const s of currentManifest.solutions) {
|
|
457
|
+
solutionMap.set(s.library_id, s);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
// Remove deleted solutions
|
|
461
|
+
for (const id of plan.deletedSolutions) {
|
|
462
|
+
solutionMap.delete(id);
|
|
463
|
+
}
|
|
464
|
+
// Add/update synced solutions
|
|
465
|
+
const now = new Date().toISOString();
|
|
466
|
+
for (const remoteSolution of remoteManifest.solutions) {
|
|
467
|
+
if (plan.newSolutions.includes(remoteSolution.library_id) ||
|
|
468
|
+
plan.modifiedSolutions.includes(remoteSolution.library_id)) {
|
|
469
|
+
solutionMap.set(remoteSolution.library_id, {
|
|
470
|
+
library_id: remoteSolution.library_id,
|
|
471
|
+
solution_hash: remoteSolution.solution_hash,
|
|
472
|
+
synced_at: now,
|
|
473
|
+
files: remoteSolution.files.map(f => ({
|
|
474
|
+
path: f.path,
|
|
475
|
+
hash: f.hash,
|
|
476
|
+
size: f.size
|
|
477
|
+
})),
|
|
478
|
+
status: 'complete'
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
// Save updated manifest
|
|
483
|
+
const newManifest = {
|
|
484
|
+
version: 1,
|
|
485
|
+
updated_at: now,
|
|
486
|
+
org_id: remoteManifest.org_id,
|
|
487
|
+
endpoint: remoteManifest.endpoint,
|
|
488
|
+
solutions: Array.from(solutionMap.values()),
|
|
489
|
+
services_registry: remoteManifest.services_registry
|
|
490
|
+
};
|
|
491
|
+
saveLocalManifest(newManifest);
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Create a failed result.
|
|
495
|
+
*/
|
|
496
|
+
createFailedResult(startTime, errors) {
|
|
497
|
+
return {
|
|
498
|
+
success: false,
|
|
499
|
+
stats: {
|
|
500
|
+
newSolutions: 0,
|
|
501
|
+
updatedSolutions: 0,
|
|
502
|
+
deletedSolutions: 0,
|
|
503
|
+
filesDownloaded: 0,
|
|
504
|
+
filesDeleted: 0,
|
|
505
|
+
bytesDownloaded: 0,
|
|
506
|
+
durationMs: Date.now() - startTime
|
|
507
|
+
},
|
|
508
|
+
errors
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Run sync with options.
|
|
514
|
+
*/
|
|
515
|
+
export async function runSync(options = {}) {
|
|
516
|
+
const engine = new SyncEngine(options);
|
|
517
|
+
return engine.sync();
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Resume an interrupted sync.
|
|
521
|
+
*/
|
|
522
|
+
export async function resumeSync(options = {}) {
|
|
523
|
+
const engine = new SyncEngine(options);
|
|
524
|
+
return engine.resume();
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Show sync status.
|
|
528
|
+
*/
|
|
529
|
+
export async function showSyncStatus() {
|
|
530
|
+
const engine = new SyncEngine();
|
|
531
|
+
return engine.status();
|
|
532
|
+
}
|
|
533
|
+
//# sourceMappingURL=sync-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-engine.js","sourceRoot":"","sources":["../../src/sync/sync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