nstantpage-agent 0.5.28 → 0.5.29
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/agentSync.js +11 -29
- package/dist/cli.js +1 -1
- package/dist/commands/start.js +1 -1
- package/package.json +1 -1
package/dist/agentSync.js
CHANGED
|
@@ -278,6 +278,13 @@ export class AgentSync {
|
|
|
278
278
|
continue;
|
|
279
279
|
if (SKIP_EXTENSIONS.has(ext))
|
|
280
280
|
continue;
|
|
281
|
+
// Match disk scan: skip files inside SKIP_DIRS directories
|
|
282
|
+
const parts = filePath.split('/');
|
|
283
|
+
if (parts.some(p => SKIP_DIRS.has(p)))
|
|
284
|
+
continue;
|
|
285
|
+
// Match disk scan: skip dist/ and build/ top-level paths
|
|
286
|
+
if (filePath.startsWith('dist/') || filePath.startsWith('build/'))
|
|
287
|
+
continue;
|
|
281
288
|
filtered.set(filePath, sha);
|
|
282
289
|
}
|
|
283
290
|
return filtered;
|
|
@@ -358,36 +365,11 @@ export class AgentSync {
|
|
|
358
365
|
}
|
|
359
366
|
}
|
|
360
367
|
// Determine direction
|
|
368
|
+
// Disk is always the source of truth. DB only changes via push or AI coding agent
|
|
369
|
+
// (which updates both disk+DB simultaneously). So direction is only ever
|
|
370
|
+
// 'in-sync' or 'disk-ahead'. backendOnlyFiles are stale DB remnants, not "newer" files.
|
|
361
371
|
const inSync = modifiedFiles.length === 0 && diskOnlyFiles.length === 0 && backendOnlyFiles.length === 0;
|
|
362
|
-
|
|
363
|
-
if (!inSync) {
|
|
364
|
-
const hasDiskEdits = modifiedFiles.length > 0 || diskOnlyFiles.length > 0;
|
|
365
|
-
const hasBackendEdits = backendOnlyFiles.length > 0;
|
|
366
|
-
let modifiedFromBackend = false;
|
|
367
|
-
if (modifiedFiles.length > 0 && baseline) {
|
|
368
|
-
for (const filePath of modifiedFiles) {
|
|
369
|
-
const baselineSha = baseline.get(filePath);
|
|
370
|
-
const diskSha = diskResult.checksums.get(filePath);
|
|
371
|
-
const backendSha = filteredBackend.get(filePath);
|
|
372
|
-
if (baselineSha && diskSha === baselineSha && backendSha && backendSha !== baselineSha) {
|
|
373
|
-
modifiedFromBackend = true;
|
|
374
|
-
break;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
if ((hasDiskEdits && !modifiedFromBackend) && hasBackendEdits) {
|
|
379
|
-
direction = 'diverged';
|
|
380
|
-
}
|
|
381
|
-
else if (hasDiskEdits && !modifiedFromBackend && !hasBackendEdits) {
|
|
382
|
-
direction = 'disk-ahead';
|
|
383
|
-
}
|
|
384
|
-
else if (hasBackendEdits || modifiedFromBackend) {
|
|
385
|
-
direction = 'backend-ahead';
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
direction = 'disk-ahead';
|
|
389
|
-
}
|
|
390
|
-
}
|
|
372
|
+
const direction = inSync ? 'in-sync' : 'disk-ahead';
|
|
391
373
|
return {
|
|
392
374
|
inSync,
|
|
393
375
|
direction,
|
package/dist/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ const program = new Command();
|
|
|
25
25
|
program
|
|
26
26
|
.name('nstantpage')
|
|
27
27
|
.description('Local development agent for nstantpage.com — run projects on your machine, preview in the cloud')
|
|
28
|
-
.version('0.5.
|
|
28
|
+
.version('0.5.29');
|
|
29
29
|
program
|
|
30
30
|
.command('login')
|
|
31
31
|
.description('Authenticate with nstantpage.com')
|
package/dist/commands/start.js
CHANGED
|
@@ -26,7 +26,7 @@ import { LocalServer } from '../localServer.js';
|
|
|
26
26
|
import { PackageInstaller } from '../packageInstaller.js';
|
|
27
27
|
import { probeLocalPostgres, ensureLocalProjectDb, closeAdminPool, writeDatabaseUrlToEnv } from '../projectDb.js';
|
|
28
28
|
import { StatusServer } from '../statusServer.js';
|
|
29
|
-
const VERSION = '0.5.
|
|
29
|
+
const VERSION = '0.5.29';
|
|
30
30
|
/**
|
|
31
31
|
* Resolve the backend API base URL.
|
|
32
32
|
* - If --backend is passed, use it
|
package/package.json
CHANGED