pushwork 1.0.4 → 1.0.7
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 +87 -328
- package/dist/.pushwork/automerge/3P/Dm3ekE2pmjGnWvDaG3vSR7ww98/snapshot/aa2349c94955ea561f698720142f9d884a6872d9f82dc332d578c216beb0df0e +0 -0
- package/dist/.pushwork/automerge/st/orage-adapter-id +1 -0
- package/dist/.pushwork/config.json +15 -0
- package/dist/.pushwork/snapshot.json +7 -0
- package/dist/cli.js +231 -170
- package/dist/cli.js.map +1 -1
- package/dist/commands.d.ts +51 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +799 -0
- package/dist/commands.js.map +1 -0
- package/dist/core/change-detection.d.ts +6 -19
- package/dist/core/change-detection.d.ts.map +1 -1
- package/dist/core/change-detection.js +101 -80
- package/dist/core/change-detection.js.map +1 -1
- package/dist/{config/index.d.ts → core/config.d.ts} +13 -3
- package/dist/core/config.d.ts.map +1 -0
- package/dist/{config/index.js → core/config.js} +55 -73
- package/dist/core/config.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/move-detection.d.ts +12 -50
- package/dist/core/move-detection.d.ts.map +1 -1
- package/dist/core/move-detection.js +58 -139
- package/dist/core/move-detection.js.map +1 -1
- package/dist/core/snapshot.d.ts +0 -4
- package/dist/core/snapshot.d.ts.map +1 -1
- package/dist/core/snapshot.js +2 -11
- package/dist/core/snapshot.js.map +1 -1
- package/dist/core/sync-engine.d.ts +5 -11
- package/dist/core/sync-engine.d.ts.map +1 -1
- package/dist/core/sync-engine.js +220 -362
- package/dist/core/sync-engine.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +1 -1
- package/dist/types/config.d.ts +43 -67
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -1
- package/dist/types/documents.d.ts +15 -3
- package/dist/types/documents.d.ts.map +1 -1
- package/dist/types/documents.js.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/snapshot.d.ts +3 -21
- package/dist/types/snapshot.d.ts.map +1 -1
- package/dist/types/snapshot.js +0 -14
- package/dist/types/snapshot.js.map +1 -1
- package/dist/utils/content.d.ts.map +1 -1
- package/dist/utils/content.js +2 -6
- package/dist/utils/content.js.map +1 -1
- package/dist/utils/directory.d.ts +10 -0
- package/dist/utils/directory.d.ts.map +1 -0
- package/dist/utils/directory.js +37 -0
- package/dist/utils/directory.js.map +1 -0
- package/dist/utils/fs.d.ts +15 -2
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +63 -53
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mime-types.d.ts.map +1 -1
- package/dist/utils/mime-types.js +11 -4
- package/dist/utils/mime-types.js.map +1 -1
- package/dist/utils/network-sync.d.ts +0 -6
- package/dist/utils/network-sync.d.ts.map +1 -1
- package/dist/utils/network-sync.js +55 -99
- package/dist/utils/network-sync.js.map +1 -1
- package/dist/utils/output.d.ts +129 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +375 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/repo-factory.d.ts +2 -6
- package/dist/utils/repo-factory.d.ts.map +1 -1
- package/dist/utils/repo-factory.js +8 -22
- package/dist/utils/repo-factory.js.map +1 -1
- package/dist/utils/string-similarity.d.ts +14 -0
- package/dist/utils/string-similarity.d.ts.map +1 -0
- package/dist/utils/string-similarity.js +43 -0
- package/dist/utils/string-similarity.js.map +1 -0
- package/dist/utils/trace.d.ts +19 -0
- package/dist/utils/trace.d.ts.map +1 -0
- package/dist/utils/trace.js +68 -0
- package/dist/utils/trace.js.map +1 -0
- package/package.json +17 -12
- package/src/cli.ts +326 -252
- package/src/commands.ts +988 -0
- package/src/core/change-detection.ts +199 -162
- package/src/{config/index.ts → core/config.ts} +65 -82
- package/src/core/index.ts +1 -1
- package/src/core/move-detection.ts +74 -180
- package/src/core/snapshot.ts +2 -12
- package/src/core/sync-engine.ts +248 -499
- package/src/index.ts +0 -10
- package/src/types/config.ts +50 -72
- package/src/types/documents.ts +16 -3
- package/src/types/index.ts +0 -5
- package/src/types/snapshot.ts +1 -23
- package/src/utils/content.ts +2 -6
- package/src/utils/directory.ts +50 -0
- package/src/utils/fs.ts +67 -56
- package/src/utils/index.ts +1 -6
- package/src/utils/mime-types.ts +12 -4
- package/src/utils/network-sync.ts +79 -137
- package/src/utils/output.ts +450 -0
- package/src/utils/repo-factory.ts +13 -31
- package/src/utils/string-similarity.ts +54 -0
- package/src/utils/trace.ts +70 -0
- package/test/integration/exclude-patterns.test.ts +6 -15
- package/test/integration/fuzzer.test.ts +308 -391
- package/test/integration/init-sync.test.ts +89 -0
- package/test/integration/sync-deletion.test.ts +2 -61
- package/test/integration/sync-flow.test.ts +4 -24
- package/test/jest.setup.ts +34 -0
- package/test/unit/deletion-behavior.test.ts +3 -14
- package/test/unit/enhanced-mime-detection.test.ts +0 -22
- package/test/unit/snapshot.test.ts +2 -29
- package/test/unit/sync-convergence.test.ts +3 -198
- package/test/unit/sync-timing.test.ts +0 -44
- package/test/unit/utils.test.ts +0 -2
- package/tsconfig.json +3 -3
- package/dist/browser/browser-sync-engine.d.ts +0 -64
- package/dist/browser/browser-sync-engine.d.ts.map +0 -1
- package/dist/browser/browser-sync-engine.js +0 -303
- package/dist/browser/browser-sync-engine.js.map +0 -1
- package/dist/browser/filesystem-adapter.d.ts +0 -84
- package/dist/browser/filesystem-adapter.d.ts.map +0 -1
- package/dist/browser/filesystem-adapter.js +0 -413
- package/dist/browser/filesystem-adapter.js.map +0 -1
- package/dist/browser/index.d.ts +0 -36
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -90
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/types.d.ts +0 -70
- package/dist/browser/types.d.ts.map +0 -1
- package/dist/browser/types.js +0 -6
- package/dist/browser/types.js.map +0 -1
- package/dist/cli/commands.d.ts +0 -77
- package/dist/cli/commands.d.ts.map +0 -1
- package/dist/cli/commands.js +0 -904
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -19
- package/dist/cli/index.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/core/isomorphic-snapshot.d.ts +0 -58
- package/dist/core/isomorphic-snapshot.d.ts.map +0 -1
- package/dist/core/isomorphic-snapshot.js +0 -204
- package/dist/core/isomorphic-snapshot.js.map +0 -1
- package/dist/platform/browser-filesystem.d.ts +0 -26
- package/dist/platform/browser-filesystem.d.ts.map +0 -1
- package/dist/platform/browser-filesystem.js +0 -91
- package/dist/platform/browser-filesystem.js.map +0 -1
- package/dist/platform/filesystem.d.ts +0 -29
- package/dist/platform/filesystem.d.ts.map +0 -1
- package/dist/platform/filesystem.js +0 -65
- package/dist/platform/filesystem.js.map +0 -1
- package/dist/platform/node-filesystem.d.ts +0 -21
- package/dist/platform/node-filesystem.d.ts.map +0 -1
- package/dist/platform/node-filesystem.js +0 -93
- package/dist/platform/node-filesystem.js.map +0 -1
- package/dist/utils/content-similarity.d.ts +0 -53
- package/dist/utils/content-similarity.d.ts.map +0 -1
- package/dist/utils/content-similarity.js +0 -155
- package/dist/utils/content-similarity.js.map +0 -1
- package/dist/utils/fs-browser.d.ts +0 -57
- package/dist/utils/fs-browser.d.ts.map +0 -1
- package/dist/utils/fs-browser.js +0 -311
- package/dist/utils/fs-browser.js.map +0 -1
- package/dist/utils/fs-node.d.ts +0 -53
- package/dist/utils/fs-node.d.ts.map +0 -1
- package/dist/utils/fs-node.js +0 -220
- package/dist/utils/fs-node.js.map +0 -1
- package/dist/utils/isomorphic.d.ts +0 -29
- package/dist/utils/isomorphic.d.ts.map +0 -1
- package/dist/utils/isomorphic.js +0 -139
- package/dist/utils/isomorphic.js.map +0 -1
- package/dist/utils/pure.d.ts +0 -25
- package/dist/utils/pure.d.ts.map +0 -1
- package/dist/utils/pure.js +0 -112
- package/dist/utils/pure.js.map +0 -1
- package/src/cli/commands.ts +0 -1207
- package/src/cli/index.ts +0 -2
- package/src/utils/content-similarity.ts +0 -194
- package/test/README-TESTING-GAPS.md +0 -174
- package/test/unit/content-similarity.test.ts +0 -236
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Platform-agnostic filesystem interface
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.isBrowser = isBrowser;
|
|
40
|
-
exports.isNode = isNode;
|
|
41
|
-
exports.getFilesystem = getFilesystem;
|
|
42
|
-
/**
|
|
43
|
-
* Platform detection
|
|
44
|
-
*/
|
|
45
|
-
function isBrowser() {
|
|
46
|
-
return (typeof window !== "undefined" &&
|
|
47
|
-
typeof window.document !== "undefined");
|
|
48
|
-
}
|
|
49
|
-
function isNode() {
|
|
50
|
-
return typeof process !== "undefined" && !!process.versions?.node;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get the appropriate filesystem implementation for the current platform
|
|
54
|
-
*/
|
|
55
|
-
async function getFilesystem() {
|
|
56
|
-
if (isBrowser()) {
|
|
57
|
-
const { BrowserFilesystem } = await Promise.resolve().then(() => __importStar(require("./browser-filesystem")));
|
|
58
|
-
return new BrowserFilesystem();
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
const { NodeFilesystem } = await Promise.resolve().then(() => __importStar(require("./node-filesystem")));
|
|
62
|
-
return new NodeFilesystem();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=filesystem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/platform/filesystem.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBH,8BAKC;AAED,wBAEC;AAKD,sCAQC;AAzBD;;GAEG;AACH,SAAgB,SAAS;IACvB,OAAO,CACL,OAAO,MAAM,KAAK,WAAW;QAC7B,OAAQ,MAAc,CAAC,QAAQ,KAAK,WAAW,CAChD,CAAC;AACJ,CAAC;AAED,SAAgB,MAAM;IACpB,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,CAAE,OAAe,CAAC,QAAQ,EAAE,IAAI,CAAC;AAC7E,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,aAAa;IACjC,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,MAAM,EAAE,iBAAiB,EAAE,GAAG,wDAAa,sBAAsB,GAAC,CAAC;QACnE,OAAO,IAAI,iBAAiB,EAAE,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,cAAc,EAAE,GAAG,wDAAa,mBAAmB,GAAC,CAAC;QAC7D,OAAO,IAAI,cAAc,EAAE,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node.js filesystem implementation
|
|
3
|
-
*/
|
|
4
|
-
import { FileSystemInterface } from "./filesystem";
|
|
5
|
-
export declare class NodeFilesystem implements FileSystemInterface {
|
|
6
|
-
readFileContent(filePath: string): Promise<string | Uint8Array>;
|
|
7
|
-
writeFileContent(filePath: string, content: string | Uint8Array): Promise<void>;
|
|
8
|
-
removePath(targetPath: string): Promise<void>;
|
|
9
|
-
movePath(fromPath: string, toPath: string): Promise<void>;
|
|
10
|
-
ensureDirectoryExists(dirPath: string): Promise<void>;
|
|
11
|
-
listDirectory(dirPath: string): Promise<Array<{
|
|
12
|
-
name: string;
|
|
13
|
-
type: "file" | "directory";
|
|
14
|
-
}>>;
|
|
15
|
-
getFileStats(filePath: string): Promise<{
|
|
16
|
-
size: number;
|
|
17
|
-
mtime: Date;
|
|
18
|
-
}>;
|
|
19
|
-
exists(targetPath: string): Promise<boolean>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=node-filesystem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-filesystem.d.ts","sourceRoot":"","sources":["../../src/platform/node-filesystem.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AASnD,qBAAa,cAAe,YAAW,mBAAmB;IAClD,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC;IAI/D,gBAAgB,CACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GAAG,UAAU,GAC3B,OAAO,CAAC,IAAI,CAAC;IAIV,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,aAAa,CACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE,CAAC,CAAC;IAYzD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,CAAC;IAYtE,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQnD"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Node.js filesystem implementation
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.NodeFilesystem = void 0;
|
|
40
|
-
const fs = __importStar(require("fs/promises"));
|
|
41
|
-
const fs_1 = require("../utils/fs");
|
|
42
|
-
class NodeFilesystem {
|
|
43
|
-
async readFileContent(filePath) {
|
|
44
|
-
return (0, fs_1.readFileContent)(filePath);
|
|
45
|
-
}
|
|
46
|
-
async writeFileContent(filePath, content) {
|
|
47
|
-
return (0, fs_1.writeFileContent)(filePath, content);
|
|
48
|
-
}
|
|
49
|
-
async removePath(targetPath) {
|
|
50
|
-
return (0, fs_1.removePath)(targetPath);
|
|
51
|
-
}
|
|
52
|
-
async movePath(fromPath, toPath) {
|
|
53
|
-
return (0, fs_1.movePath)(fromPath, toPath);
|
|
54
|
-
}
|
|
55
|
-
async ensureDirectoryExists(dirPath) {
|
|
56
|
-
return (0, fs_1.ensureDirectoryExists)(dirPath);
|
|
57
|
-
}
|
|
58
|
-
async listDirectory(dirPath) {
|
|
59
|
-
try {
|
|
60
|
-
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
61
|
-
return entries.map((entry) => ({
|
|
62
|
-
name: entry.name,
|
|
63
|
-
type: entry.isDirectory() ? "directory" : "file",
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
throw new Error(`Failed to list directory ${dirPath}: ${error}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async getFileStats(filePath) {
|
|
71
|
-
try {
|
|
72
|
-
const stats = await fs.stat(filePath);
|
|
73
|
-
return {
|
|
74
|
-
size: stats.size,
|
|
75
|
-
mtime: stats.mtime,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
throw new Error(`Failed to get file stats for ${filePath}: ${error}`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async exists(targetPath) {
|
|
83
|
-
try {
|
|
84
|
-
await fs.access(targetPath);
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
catch {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
exports.NodeFilesystem = NodeFilesystem;
|
|
93
|
-
//# sourceMappingURL=node-filesystem.js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OAAO,KAAK,KAAK,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAgB;QACjC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtC,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;aACnB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,QAAQ,KAAK,KAAK,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC7B,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AA1DD,wCA0DC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Content similarity calculation for move detection
|
|
3
|
-
*/
|
|
4
|
-
export declare class ContentSimilarity {
|
|
5
|
-
private static readonly CHUNK_SIZE;
|
|
6
|
-
private static readonly AUTO_THRESHOLD;
|
|
7
|
-
private static readonly PROMPT_THRESHOLD;
|
|
8
|
-
/**
|
|
9
|
-
* Calculate similarity between two content pieces
|
|
10
|
-
*/
|
|
11
|
-
static calculateSimilarity(content1: string | Uint8Array, content2: string | Uint8Array): Promise<number>;
|
|
12
|
-
/**
|
|
13
|
-
* Check if two content pieces are identical
|
|
14
|
-
*/
|
|
15
|
-
private static areIdentical;
|
|
16
|
-
/**
|
|
17
|
-
* Calculate similarity for small files using full content
|
|
18
|
-
*/
|
|
19
|
-
private static calculateFullSimilarity;
|
|
20
|
-
/**
|
|
21
|
-
* Calculate similarity for large files using sampling
|
|
22
|
-
*/
|
|
23
|
-
private static calculateSampledSimilarity;
|
|
24
|
-
/**
|
|
25
|
-
* Get representative samples from content
|
|
26
|
-
*/
|
|
27
|
-
private static getSamples;
|
|
28
|
-
/**
|
|
29
|
-
* Calculate Levenshtein similarity (0-1 scale)
|
|
30
|
-
*/
|
|
31
|
-
private static levenshteinSimilarity;
|
|
32
|
-
/**
|
|
33
|
-
* Calculate Levenshtein distance
|
|
34
|
-
*/
|
|
35
|
-
private static levenshteinDistance;
|
|
36
|
-
/**
|
|
37
|
-
* Convert buffer to string for comparison
|
|
38
|
-
*/
|
|
39
|
-
private static bufferToString;
|
|
40
|
-
/**
|
|
41
|
-
* Determine confidence level based on similarity score
|
|
42
|
-
*/
|
|
43
|
-
static getConfidenceLevel(similarity: number): "auto" | "prompt" | "low";
|
|
44
|
-
/**
|
|
45
|
-
* Should auto-apply move based on similarity
|
|
46
|
-
*/
|
|
47
|
-
static shouldAutoApply(similarity: number): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Should prompt user for move confirmation
|
|
50
|
-
*/
|
|
51
|
-
static shouldPromptUser(similarity: number): boolean;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=content-similarity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-similarity.d.ts","sourceRoot":"","sources":["../../src/utils/content-similarity.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAQ;IAC1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAO;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAO;IAE/C;;OAEG;WACU,mBAAmB,CAC9B,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,QAAQ,EAAE,MAAM,GAAG,UAAU,GAC5B,OAAO,CAAC,MAAM,CAAC;IA0BlB;;OAEG;mBACkB,YAAY;IASjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAYtC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAkBzC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAwBzB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAUpC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAsBlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAO7B;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK;IAUxE;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAInD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;CAKrD"}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContentSimilarity = void 0;
|
|
4
|
-
const fs_1 = require("./fs");
|
|
5
|
-
/**
|
|
6
|
-
* Content similarity calculation for move detection
|
|
7
|
-
*/
|
|
8
|
-
class ContentSimilarity {
|
|
9
|
-
/**
|
|
10
|
-
* Calculate similarity between two content pieces
|
|
11
|
-
*/
|
|
12
|
-
static async calculateSimilarity(content1, content2) {
|
|
13
|
-
// Quick early exit for identical content
|
|
14
|
-
if (await this.areIdentical(content1, content2)) {
|
|
15
|
-
return 1.0;
|
|
16
|
-
}
|
|
17
|
-
// Size-based quick rejection
|
|
18
|
-
const size1 = typeof content1 === "string" ? content1.length : content1.length;
|
|
19
|
-
const size2 = typeof content2 === "string" ? content2.length : content2.length;
|
|
20
|
-
const sizeDiff = Math.abs(size1 - size2) / Math.max(size1, size2);
|
|
21
|
-
if (sizeDiff > 0.5) {
|
|
22
|
-
return 0.0; // Too different in size
|
|
23
|
-
}
|
|
24
|
-
// For small files, use full content comparison
|
|
25
|
-
if (size1 < this.CHUNK_SIZE * 4 && size2 < this.CHUNK_SIZE * 4) {
|
|
26
|
-
return this.calculateFullSimilarity(content1, content2);
|
|
27
|
-
}
|
|
28
|
-
// For large files, use sampling
|
|
29
|
-
return this.calculateSampledSimilarity(content1, content2);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Check if two content pieces are identical
|
|
33
|
-
*/
|
|
34
|
-
static async areIdentical(content1, content2) {
|
|
35
|
-
const hash1 = await (0, fs_1.calculateContentHash)(content1);
|
|
36
|
-
const hash2 = await (0, fs_1.calculateContentHash)(content2);
|
|
37
|
-
return hash1 === hash2;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Calculate similarity for small files using full content
|
|
41
|
-
*/
|
|
42
|
-
static calculateFullSimilarity(content1, content2) {
|
|
43
|
-
const str1 = typeof content1 === "string" ? content1 : this.bufferToString(content1);
|
|
44
|
-
const str2 = typeof content2 === "string" ? content2 : this.bufferToString(content2);
|
|
45
|
-
return this.levenshteinSimilarity(str1, str2);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Calculate similarity for large files using sampling
|
|
49
|
-
*/
|
|
50
|
-
static calculateSampledSimilarity(content1, content2) {
|
|
51
|
-
const samples1 = this.getSamples(content1);
|
|
52
|
-
const samples2 = this.getSamples(content2);
|
|
53
|
-
let totalSimilarity = 0;
|
|
54
|
-
let comparisons = 0;
|
|
55
|
-
for (let i = 0; i < Math.min(samples1.length, samples2.length); i++) {
|
|
56
|
-
totalSimilarity += this.levenshteinSimilarity(samples1[i], samples2[i]);
|
|
57
|
-
comparisons++;
|
|
58
|
-
}
|
|
59
|
-
return comparisons > 0 ? totalSimilarity / comparisons : 0;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get representative samples from content
|
|
63
|
-
*/
|
|
64
|
-
static getSamples(content) {
|
|
65
|
-
const str = typeof content === "string" ? content : this.bufferToString(content);
|
|
66
|
-
const length = str.length;
|
|
67
|
-
const samples = [];
|
|
68
|
-
if (length <= this.CHUNK_SIZE) {
|
|
69
|
-
samples.push(str);
|
|
70
|
-
return samples;
|
|
71
|
-
}
|
|
72
|
-
// Beginning
|
|
73
|
-
samples.push(str.slice(0, this.CHUNK_SIZE));
|
|
74
|
-
// Middle
|
|
75
|
-
const midStart = Math.floor(length / 2) - Math.floor(this.CHUNK_SIZE / 2);
|
|
76
|
-
samples.push(str.slice(midStart, midStart + this.CHUNK_SIZE));
|
|
77
|
-
// End
|
|
78
|
-
samples.push(str.slice(-this.CHUNK_SIZE));
|
|
79
|
-
return samples;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Calculate Levenshtein similarity (0-1 scale)
|
|
83
|
-
*/
|
|
84
|
-
static levenshteinSimilarity(str1, str2) {
|
|
85
|
-
if (str1 === str2)
|
|
86
|
-
return 1.0;
|
|
87
|
-
if (str1.length === 0 || str2.length === 0)
|
|
88
|
-
return 0.0;
|
|
89
|
-
const distance = this.levenshteinDistance(str1, str2);
|
|
90
|
-
const maxLength = Math.max(str1.length, str2.length);
|
|
91
|
-
return 1 - distance / maxLength;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Calculate Levenshtein distance
|
|
95
|
-
*/
|
|
96
|
-
static levenshteinDistance(str1, str2) {
|
|
97
|
-
const matrix = Array(str2.length + 1)
|
|
98
|
-
.fill(null)
|
|
99
|
-
.map(() => Array(str1.length + 1).fill(null));
|
|
100
|
-
for (let i = 0; i <= str1.length; i++)
|
|
101
|
-
matrix[0][i] = i;
|
|
102
|
-
for (let j = 0; j <= str2.length; j++)
|
|
103
|
-
matrix[j][0] = j;
|
|
104
|
-
for (let j = 1; j <= str2.length; j++) {
|
|
105
|
-
for (let i = 1; i <= str1.length; i++) {
|
|
106
|
-
const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1;
|
|
107
|
-
matrix[j][i] = Math.min(matrix[j][i - 1] + 1, // deletion
|
|
108
|
-
matrix[j - 1][i] + 1, // insertion
|
|
109
|
-
matrix[j - 1][i - 1] + indicator // substitution
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return matrix[str2.length][str1.length];
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Convert buffer to string for comparison
|
|
117
|
-
*/
|
|
118
|
-
static bufferToString(buffer) {
|
|
119
|
-
// For binary content, use hex representation for comparison
|
|
120
|
-
return Array.from(buffer)
|
|
121
|
-
.map((b) => b.toString(16).padStart(2, "0"))
|
|
122
|
-
.join("");
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Determine confidence level based on similarity score
|
|
126
|
-
*/
|
|
127
|
-
static getConfidenceLevel(similarity) {
|
|
128
|
-
if (similarity >= this.AUTO_THRESHOLD) {
|
|
129
|
-
return "auto";
|
|
130
|
-
}
|
|
131
|
-
else if (similarity >= this.PROMPT_THRESHOLD) {
|
|
132
|
-
return "prompt";
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
return "low";
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Should auto-apply move based on similarity
|
|
140
|
-
*/
|
|
141
|
-
static shouldAutoApply(similarity) {
|
|
142
|
-
return similarity >= this.AUTO_THRESHOLD;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Should prompt user for move confirmation
|
|
146
|
-
*/
|
|
147
|
-
static shouldPromptUser(similarity) {
|
|
148
|
-
return (similarity >= this.PROMPT_THRESHOLD && similarity < this.AUTO_THRESHOLD);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
exports.ContentSimilarity = ContentSimilarity;
|
|
152
|
-
ContentSimilarity.CHUNK_SIZE = 1024; // 1KB chunks for sampling
|
|
153
|
-
ContentSimilarity.AUTO_THRESHOLD = 0.8;
|
|
154
|
-
ContentSimilarity.PROMPT_THRESHOLD = 0.5;
|
|
155
|
-
//# sourceMappingURL=content-simil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,UAAkB;QACxC,OAAO,CACL,UAAU,IAAI,IAAI,CAAC,gBAAgB,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,CACxE,CAAC;IACJ,CAAC;;AA3LH,8CA4LC;AA3LyB,4BAAU,GAAG,IAAI,CAAC,CAAC,0BAA0B;AAC7C,gCAAc,GAAG,GAAG,CAAC;AACrB,kCAAgB,GAAG,GAAG,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-specific filesystem utilities using File System Access API
|
|
3
|
-
*/
|
|
4
|
-
import { FileSystemEntry } from "../types";
|
|
5
|
-
/**
|
|
6
|
-
* Set the root directory handle for browser filesystem operations
|
|
7
|
-
*/
|
|
8
|
-
export declare function setRootDirectoryHandle(handle: any): void;
|
|
9
|
-
/**
|
|
10
|
-
* Get the root directory handle
|
|
11
|
-
*/
|
|
12
|
-
export declare function getRootDirectoryHandle(): any;
|
|
13
|
-
/**
|
|
14
|
-
* Check if a path exists
|
|
15
|
-
*/
|
|
16
|
-
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
17
|
-
/**
|
|
18
|
-
* Get file system entry information
|
|
19
|
-
*/
|
|
20
|
-
export declare function getFileSystemEntry(filePath: string): Promise<FileSystemEntry>;
|
|
21
|
-
/**
|
|
22
|
-
* Check if a file is a text file
|
|
23
|
-
*/
|
|
24
|
-
export declare function isTextFile(filePath: string): Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Read file content
|
|
27
|
-
*/
|
|
28
|
-
export declare function readFileContent(filePath: string): Promise<string | Uint8Array>;
|
|
29
|
-
/**
|
|
30
|
-
* Write file content
|
|
31
|
-
*/
|
|
32
|
-
export declare function writeFileContent(filePath: string, content: string | Uint8Array): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Ensure directory exists
|
|
35
|
-
*/
|
|
36
|
-
export declare function ensureDirectoryExists(dirPath: string): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Remove a file or directory
|
|
39
|
-
*/
|
|
40
|
-
export declare function removePath(filePath: string): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* List directory contents
|
|
43
|
-
*/
|
|
44
|
-
export declare function listDirectory(dirPath: string, excludePatterns?: string[]): Promise<FileSystemEntry[]>;
|
|
45
|
-
/**
|
|
46
|
-
* Copy a file (not supported in File System Access API)
|
|
47
|
-
*/
|
|
48
|
-
export declare function copyFile(sourcePath: string, targetPath: string): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Move a file or directory
|
|
51
|
-
*/
|
|
52
|
-
export declare function movePath(sourcePath: string, targetPath: string): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Get MIME type
|
|
55
|
-
*/
|
|
56
|
-
export declare function getMimeType(filePath: string): string;
|
|
57
|
-
//# sourceMappingURL=fs-browser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fs-browser.d.ts","sourceRoot":"","sources":["../../src/utils/fs-browser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAY,MAAM,UAAU,CAAC;AAYrD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAExD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,GAAG,CAO5C;AAiCD;;GAEG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,CAAC,CA2B1B;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMnE;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAiB9B;AAED;;GAEG;AACH,w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