hybridtm 0.8.0 → 0.9.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/README.md +3 -5
- package/dist/backupHandler.d.ts +1 -1
- package/dist/backupHandler.js +1 -1
- package/dist/backupReader.d.ts +1 -1
- package/dist/backupReader.js +1 -1
- package/dist/batchImporter.d.ts +1 -1
- package/dist/batchImporter.js +1 -1
- package/dist/cli/backupCommand.d.ts +5 -3
- package/dist/cli/backupCommand.js +33 -31
- package/dist/cli/backupCommand.js.map +1 -1
- package/dist/cli/cliUtils.d.ts +2 -1
- package/dist/cli/cliUtils.js +13 -1
- package/dist/cli/cliUtils.js.map +1 -1
- package/dist/cli/createCommand.d.ts +5 -3
- package/dist/cli/createCommand.js +33 -31
- package/dist/cli/createCommand.js.map +1 -1
- package/dist/cli/hybridtmCli.d.ts +1 -1
- package/dist/cli/hybridtmCli.js +24 -14
- package/dist/cli/hybridtmCli.js.map +1 -1
- package/dist/cli/importCommand.d.ts +11 -3
- package/dist/cli/importCommand.js +75 -76
- package/dist/cli/importCommand.js.map +1 -1
- package/dist/cli/matchCommand.d.ts +17 -3
- package/dist/cli/matchCommand.js +88 -234
- package/dist/cli/matchCommand.js.map +1 -1
- package/dist/cli/registryCommands.d.ts +8 -5
- package/dist/cli/registryCommands.js +63 -61
- package/dist/cli/registryCommands.js.map +1 -1
- package/dist/cli/restoreCommand.d.ts +8 -3
- package/dist/cli/restoreCommand.js +80 -78
- package/dist/cli/restoreCommand.js.map +1 -1
- package/dist/cli/serveCommand.d.ts +17 -0
- package/dist/cli/serveCommand.js +87 -0
- package/dist/cli/serveCommand.js.map +1 -0
- package/dist/cli/stopCommand.d.ts +15 -0
- package/dist/cli/stopCommand.js +73 -0
- package/dist/cli/stopCommand.js.map +1 -0
- package/dist/hybridtm.d.ts +1 -1
- package/dist/hybridtm.js +48 -24
- package/dist/hybridtm.js.map +1 -1
- package/dist/hybridtmFactory.d.ts +1 -1
- package/dist/hybridtmFactory.js +6 -1
- package/dist/hybridtmFactory.js.map +1 -1
- package/dist/importOptions.d.ts +5 -4
- package/dist/importOptions.js +11 -10
- package/dist/importOptions.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/langEntry.d.ts +1 -1
- package/dist/langEntry.js +1 -1
- package/dist/match.d.ts +1 -1
- package/dist/match.js +1 -1
- package/dist/matchQuality.d.ts +1 -1
- package/dist/matchQuality.js +1 -1
- package/dist/pendingEntry.d.ts +1 -1
- package/dist/pendingEntry.js +1 -1
- package/dist/searchFilters.d.ts +1 -1
- package/dist/searchFilters.js +1 -1
- package/dist/server/hybridtmServer.d.ts +40 -0
- package/dist/server/hybridtmServer.js +527 -0
- package/dist/server/hybridtmServer.js.map +1 -0
- package/dist/server/hybridtmServerMain.d.ts +12 -0
- package/dist/server/hybridtmServerMain.js +18 -0
- package/dist/server/hybridtmServerMain.js.map +1 -0
- package/dist/tmxHandler.d.ts +1 -1
- package/dist/tmxHandler.js +5 -5
- package/dist/tmxHandler.js.map +1 -1
- package/dist/tmxReader.d.ts +1 -1
- package/dist/tmxReader.js +4 -4
- package/dist/tmxReader.js.map +1 -1
- package/dist/utils.d.ts +26 -2
- package/dist/utils.js +153 -2
- package/dist/utils.js.map +1 -1
- package/dist/xliffHandler.d.ts +1 -1
- package/dist/xliffHandler.js +8 -8
- package/dist/xliffHandler.js.map +1 -1
- package/dist/xliffReader.d.ts +1 -1
- package/dist/xliffReader.js +4 -4
- package/dist/xliffReader.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ HybridTM is a semantic translation memory engine that stores bilingual content i
|
|
|
11
11
|
- Prevents duplicate segments by rewriting entries with deterministic IDs (`fileId:unitId:segmentIndex:lang`)
|
|
12
12
|
- Backs up any instance to a single format-agnostic XML file and restores it into an existing or brand-new instance, optionally under a different embedding model
|
|
13
13
|
- Ships a `hybridtm` command-line tool for creating instances, importing files, backing up/restoring data, and enriching XLIFF files with TM match candidates from the shell
|
|
14
|
+
- Runs as a JSON-over-HTTP server too (`hybridtm serve`, or embed `HybridTMServer` directly), for CAT tool and editor integrations that want to keep an instance and its loaded model open across many requests, with ticketed handling for long-running imports and matches, and a `storeXliffUnit` command for persisting a single confirmed unit as the user works
|
|
14
15
|
|
|
15
16
|
Models download automatically the first time you initialize an instance and are cached in the standard Hugging Face directory.
|
|
16
17
|
|
|
@@ -102,7 +103,7 @@ npm install -g hybridtm
|
|
|
102
103
|
|
|
103
104
|
hybridtm create -name project -path ./project.lancedb
|
|
104
105
|
hybridtm import -name project -file ./translations/project.xlf
|
|
105
|
-
hybridtm match -name project -file ./new-content.xlf -output ./new-content.matches.xlf
|
|
106
|
+
hybridtm match -name project -file ./new-content.xlf -similarity 60 -output ./new-content.matches.xlf
|
|
106
107
|
hybridtm backup -name project -file ./project-backup.xml
|
|
107
108
|
hybridtm restore -file ./project-backup.xml -name project
|
|
108
109
|
hybridtm list
|
|
@@ -122,6 +123,7 @@ see [05 · Command-Line Interface](docs/05-command-line-interface.md).
|
|
|
122
123
|
- [04 · Sample Scenarios](docs/04-sample-scenarios.md)
|
|
123
124
|
- [05 · Command-Line Interface](docs/05-command-line-interface.md)
|
|
124
125
|
- [06 · Backup and Restore](docs/06-backup-and-restore.md)
|
|
126
|
+
- [07 · HTTP Server](docs/07-http-server.md)
|
|
125
127
|
|
|
126
128
|
Each guide is short and task-oriented, so you can jump directly to the workflow you need.
|
|
127
129
|
|
|
@@ -148,14 +150,10 @@ If you copy `samples/` elsewhere, update `samples/package.json` so the `hybridtm
|
|
|
148
150
|
- `dist/` – compiled JavaScript and declarations (`npm run build`)
|
|
149
151
|
- `docs/` – task-focused tutorials referenced above
|
|
150
152
|
- `samples/` – standalone TypeScript project with runnable workflows
|
|
151
|
-
- `models/` – local cache for pre-downloaded embedding models (optional)
|
|
152
153
|
|
|
153
154
|
## Development
|
|
154
155
|
|
|
155
156
|
- `npm run build` – compile TypeScript to `dist/`
|
|
156
|
-
- The [samples](docs/04-sample-scenarios.md) project doubles as a manual regression check for the importers and search APIs
|
|
157
|
-
|
|
158
|
-
Contributions should include unit or integration coverage when you touch importer or search logic. Use `HybridTMFactory.removeInstance(name)` to clean up any throwaway databases you create during manual tests.
|
|
159
157
|
|
|
160
158
|
## License
|
|
161
159
|
|
package/dist/backupHandler.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
package/dist/backupHandler.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
package/dist/backupReader.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
package/dist/backupReader.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
package/dist/batchImporter.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
package/dist/batchImporter.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
9
9
|
* Contributors:
|
|
10
10
|
* Maxprograms - initial API and implementation
|
|
11
11
|
*******************************************************************************/
|
|
12
|
-
export declare
|
|
13
|
-
|
|
12
|
+
export declare class BackupCommand {
|
|
13
|
+
static usage(): void;
|
|
14
|
+
static run(args: string[]): Promise<void>;
|
|
15
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
@@ -11,37 +11,39 @@
|
|
|
11
11
|
*******************************************************************************/
|
|
12
12
|
import { HybridTMFactory } from '../index.js';
|
|
13
13
|
import { CliUtils } from './cliUtils.js';
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export async function runBackupCommand(args) {
|
|
21
|
-
if (CliUtils.hasFlag(args, '-help')) {
|
|
22
|
-
usage();
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const name = CliUtils.getFlag(args, '-name');
|
|
26
|
-
const rawFile = CliUtils.getFlag(args, '-file');
|
|
27
|
-
if (!name || !rawFile) {
|
|
28
|
-
usage();
|
|
29
|
-
CliUtils.fail('Missing required -name or -file.');
|
|
30
|
-
}
|
|
31
|
-
const outputPath = CliUtils.resolvePath(rawFile);
|
|
32
|
-
const tm = HybridTMFactory.getInstance(name);
|
|
33
|
-
if (!tm) {
|
|
34
|
-
CliUtils.fail('No instance named "' + name + '". Run "hybridtm create" or "hybridtm list" first.');
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const count = await tm.backup(outputPath);
|
|
38
|
-
console.log('Backed up ' + count + ' entries from "' + name + '" to ' + outputPath + '.');
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
CliUtils.fail(error instanceof Error ? error.message : String(error));
|
|
14
|
+
export class BackupCommand {
|
|
15
|
+
static usage() {
|
|
16
|
+
console.log('Usage: hybridtm backup -name <name> -file <path>');
|
|
17
|
+
console.log();
|
|
18
|
+
console.log(' -name Instance to back up (required)');
|
|
19
|
+
console.log(' -file Output XML file path (required)');
|
|
42
20
|
}
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
static async run(args) {
|
|
22
|
+
if (CliUtils.hasFlag(args, '-help')) {
|
|
23
|
+
BackupCommand.usage();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const name = CliUtils.getFlag(args, '-name');
|
|
27
|
+
const rawFile = CliUtils.getFlag(args, '-file');
|
|
28
|
+
if (!name || !rawFile) {
|
|
29
|
+
BackupCommand.usage();
|
|
30
|
+
CliUtils.fail('Missing required -name or -file.');
|
|
31
|
+
}
|
|
32
|
+
const outputPath = CliUtils.resolvePath(rawFile);
|
|
33
|
+
const tm = HybridTMFactory.getInstance(name);
|
|
34
|
+
if (!tm) {
|
|
35
|
+
CliUtils.fail('No instance named "' + name + '". Run "hybridtm create" or "hybridtm list" first.');
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
const count = await tm.backup(outputPath);
|
|
39
|
+
console.log('Backed up ' + count + ' entries from "' + name + '" to ' + outputPath + '.');
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
CliUtils.fail(error instanceof Error ? error.message : String(error));
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
await tm.close();
|
|
46
|
+
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
//# sourceMappingURL=backupCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backupCommand.js","sourceRoot":"","sources":["../../ts/cli/backupCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;iFAUiF;AAEjF,OAAO,EAAY,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,
|
|
1
|
+
{"version":3,"file":"backupCommand.js","sourceRoot":"","sources":["../../ts/cli/backupCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;iFAUiF;AAEjF,OAAO,EAAY,eA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AAG,IAAI,GAAG,OAAO,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC;QAC9F,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1E,CAAC;gBAAS,CAAC;YACP,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACL,CAAC;CACJ"}
|
package/dist/cli/cliUtils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
export declare class CliUtils {
|
|
13
13
|
static getFlag(args: string[], flag: string): string | undefined;
|
|
14
14
|
static hasFlag(args: string[], flag: string): boolean;
|
|
15
|
+
static parseIntFlag(args: string[], flag: string, fallback: number, min: number, max?: number): number;
|
|
15
16
|
static resolvePath(rawPath: string): string;
|
|
16
17
|
static requireExistingFile(rawPath: string, label: string): string;
|
|
17
18
|
static resolveModelName(alias: string | undefined): string;
|
package/dist/cli/cliUtils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
@@ -24,6 +24,18 @@ export class CliUtils {
|
|
|
24
24
|
static hasFlag(args, flag) {
|
|
25
25
|
return args.includes(flag);
|
|
26
26
|
}
|
|
27
|
+
static parseIntFlag(args, flag, fallback, min, max) {
|
|
28
|
+
const raw = CliUtils.getFlag(args, flag);
|
|
29
|
+
if (raw === undefined) {
|
|
30
|
+
return fallback;
|
|
31
|
+
}
|
|
32
|
+
const parsed = Number(raw);
|
|
33
|
+
if (!Number.isInteger(parsed) || parsed < min || (max !== undefined && parsed > max)) {
|
|
34
|
+
const range = max !== undefined ? 'an integer between ' + min + ' and ' + max : 'an integer of at least ' + min;
|
|
35
|
+
CliUtils.fail('Invalid ' + flag + ' value "' + raw + '"; expected ' + range + '.');
|
|
36
|
+
}
|
|
37
|
+
return parsed;
|
|
38
|
+
}
|
|
27
39
|
static resolvePath(rawPath) {
|
|
28
40
|
let expanded = rawPath;
|
|
29
41
|
if (expanded.startsWith('~')) {
|
package/dist/cli/cliUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliUtils.js","sourceRoot":"","sources":["../../ts/cli/cliUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;iFAUiF;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,OAAO,QAAQ;IAEjB,MAAM,CAAC,OAAO,CAAC,IAAc,EAAE,IAAY;QACvC,MAAM,KAAK,GAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,U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AO,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,OAAe,EAAE,KAAa;QACrD,MAAM,QAAQ,GAAW,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG,QAAQ,GAAG,mBAAmB,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,KAAyB;QAC7C,QAAQ,KAAK,EAAE,CAAC;YACZ,KAAK,SAAS;gBACV,OAAO,QAAQ,CAAC,aAAa,CAAC;YAClC,KAAK,UAAU;gBACX,OAAO,QAAQ,CAAC,cAAc,CAAC;YACnC,KAAK,OAAO,CAAC;YACb,KAAK,SAAS;gBACV,OAAO,QAAQ,CAAC,WAAW,CAAC;YAChC;gBACI,sEAAsE;gBACtE,kEAAkE;gBAClE,OAAO,KAAK,CAAC;QACrB,CAAC;IACL,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAe;QACvB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;CACJ"}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
9
9
|
* Contributors:
|
|
10
10
|
* Maxprograms - initial API and implementation
|
|
11
11
|
*******************************************************************************/
|
|
12
|
-
export declare
|
|
13
|
-
|
|
12
|
+
export declare class CreateCommand {
|
|
13
|
+
static usage(): void;
|
|
14
|
+
static run(args: string[]): Promise<void>;
|
|
15
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
@@ -11,37 +11,39 @@
|
|
|
11
11
|
*******************************************************************************/
|
|
12
12
|
import { HybridTMFactory } from '../index.js';
|
|
13
13
|
import { CliUtils } from './cliUtils.js';
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export async function runCreateCommand(args) {
|
|
25
|
-
if (CliUtils.hasFlag(args, '-help')) {
|
|
26
|
-
usage();
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const name = CliUtils.getFlag(args, '-name');
|
|
30
|
-
const rawPath = CliUtils.getFlag(args, '-path');
|
|
31
|
-
if (!name || !rawPath) {
|
|
32
|
-
usage();
|
|
33
|
-
CliUtils.fail('Missing required -name or -path.');
|
|
34
|
-
}
|
|
35
|
-
const modelAlias = CliUtils.getFlag(args, '-model');
|
|
36
|
-
const modelName = CliUtils.resolveModelName(modelAlias);
|
|
37
|
-
const resolvedPath = CliUtils.resolvePath(rawPath);
|
|
38
|
-
try {
|
|
39
|
-
const tm = HybridTMFactory.createInstance(name, resolvedPath, modelName);
|
|
40
|
-
await tm.close();
|
|
41
|
-
console.log('Created instance "' + name + '" at ' + resolvedPath + ' (model: ' + modelName + ')');
|
|
14
|
+
export class CreateCommand {
|
|
15
|
+
static usage() {
|
|
16
|
+
console.log('Usage: hybridtm create -name <name> -path <dir> [-model compact|standard|large|<model id>]');
|
|
17
|
+
console.log();
|
|
18
|
+
console.log(' -name Name to register the new instance under (required)');
|
|
19
|
+
console.log(' -path Directory where the instance\'s LanceDB data will live (required)');
|
|
20
|
+
console.log(' -model Embedding model preset (compact, standard, large [default]), or any');
|
|
21
|
+
console.log(' other Hugging Face feature-extraction model id to load directly');
|
|
22
|
+
console.log(' (e.g. onnx-community/gte-multilingual-base). See the README section');
|
|
23
|
+
console.log(' "Choosing an embedding model" for guidance on which preset to pick.');
|
|
42
24
|
}
|
|
43
|
-
|
|
44
|
-
CliUtils.
|
|
25
|
+
static async run(args) {
|
|
26
|
+
if (CliUtils.hasFlag(args, '-help')) {
|
|
27
|
+
CreateCommand.usage();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const name = CliUtils.getFlag(args, '-name');
|
|
31
|
+
const rawPath = CliUtils.getFlag(args, '-path');
|
|
32
|
+
if (!name || !rawPath) {
|
|
33
|
+
CreateCommand.usage();
|
|
34
|
+
CliUtils.fail('Missing required -name or -path.');
|
|
35
|
+
}
|
|
36
|
+
const modelAlias = CliUtils.getFlag(args, '-model');
|
|
37
|
+
const modelName = CliUtils.resolveModelName(modelAlias);
|
|
38
|
+
const resolvedPath = CliUtils.resolvePath(rawPath);
|
|
39
|
+
try {
|
|
40
|
+
const tm = HybridTMFactory.createInstance(name, resolvedPath, modelName);
|
|
41
|
+
await tm.close();
|
|
42
|
+
console.log('Created instance "' + name + '" at ' + resolvedPath + ' (model: ' + modelName + ')');
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
CliUtils.fail(error instanceof Error ? error.message : String(error));
|
|
46
|
+
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
//# sourceMappingURL=createCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCommand.js","sourceRoot":"","sources":["../../ts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AAa,CAAC,KAAK,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QAED,MAAM,UAAU,GAAuB,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACxE,MAAM,SAAS,GAAW,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAChE,MAAM,YAAY,GAAW,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAE3D,IAAI,CAAC;YACD,MAAM,EAAE,GAAa,eAAe,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;YACnF,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,IAAI,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,GAAG,CAAC,CAAC;QACtG,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1E,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
4
4
|
*
|
|
5
5
|
* This program and the accompanying materials
|
|
6
|
-
* are made available under the terms of the Eclipse
|
|
6
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
7
7
|
* which accompanies this distribution, and is available at
|
|
8
8
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
9
9
|
*
|
package/dist/cli/hybridtmCli.js
CHANGED
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
4
4
|
*
|
|
5
5
|
* This program and the accompanying materials
|
|
6
|
-
* are made available under the terms of the Eclipse
|
|
6
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
7
7
|
* which accompanies this distribution, and is available at
|
|
8
8
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
9
9
|
*
|
|
10
10
|
* Contributors:
|
|
11
11
|
* Maxprograms - initial API and implementation
|
|
12
12
|
*******************************************************************************/
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
13
|
+
import { BackupCommand } from './backupCommand.js';
|
|
14
|
+
import { CreateCommand } from './createCommand.js';
|
|
15
|
+
import { ImportCommand } from './importCommand.js';
|
|
16
|
+
import { MatchCommand } from './matchCommand.js';
|
|
17
|
+
import { RegistryCommands } from './registryCommands.js';
|
|
18
|
+
import { RestoreCommand } from './restoreCommand.js';
|
|
19
|
+
import { ServeCommand } from './serveCommand.js';
|
|
20
|
+
import { StopCommand } from './stopCommand.js';
|
|
19
21
|
class HybridTMCli {
|
|
20
22
|
constructor() {
|
|
21
23
|
this.run(process.argv.slice(2));
|
|
@@ -25,25 +27,31 @@ class HybridTMCli {
|
|
|
25
27
|
const rest = argv.slice(1);
|
|
26
28
|
try {
|
|
27
29
|
if (command === 'create') {
|
|
28
|
-
await
|
|
30
|
+
await CreateCommand.run(rest);
|
|
29
31
|
}
|
|
30
32
|
else if (command === 'import') {
|
|
31
|
-
await
|
|
33
|
+
await ImportCommand.run(rest);
|
|
32
34
|
}
|
|
33
35
|
else if (command === 'match') {
|
|
34
|
-
await
|
|
36
|
+
await MatchCommand.run(rest);
|
|
35
37
|
}
|
|
36
38
|
else if (command === 'backup') {
|
|
37
|
-
await
|
|
39
|
+
await BackupCommand.run(rest);
|
|
38
40
|
}
|
|
39
41
|
else if (command === 'restore') {
|
|
40
|
-
await
|
|
42
|
+
await RestoreCommand.run(rest);
|
|
41
43
|
}
|
|
42
44
|
else if (command === 'list') {
|
|
43
|
-
await
|
|
45
|
+
await RegistryCommands.runList(rest);
|
|
44
46
|
}
|
|
45
47
|
else if (command === 'remove') {
|
|
46
|
-
await
|
|
48
|
+
await RegistryCommands.runRemove(rest);
|
|
49
|
+
}
|
|
50
|
+
else if (command === 'serve') {
|
|
51
|
+
await ServeCommand.run(rest);
|
|
52
|
+
}
|
|
53
|
+
else if (command === 'stop') {
|
|
54
|
+
await StopCommand.run(rest);
|
|
47
55
|
}
|
|
48
56
|
else if (command === '-help' || command === '--help') {
|
|
49
57
|
this.usage();
|
|
@@ -75,6 +83,8 @@ class HybridTMCli {
|
|
|
75
83
|
console.log(' restore Reimport a backup XML file into an existing or new instance');
|
|
76
84
|
console.log(' list List registered instances');
|
|
77
85
|
console.log(' remove Delete a registered instance and its data');
|
|
86
|
+
console.log(' serve Start the HybridTM HTTP server');
|
|
87
|
+
console.log(' stop Stop the HybridTM HTTP server');
|
|
78
88
|
console.log();
|
|
79
89
|
console.log('Run "hybridtm <command> -help" for command-specific options.');
|
|
80
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hybridtmCli.js","sourceRoot":"","sources":["../../ts/cli/hybridtmCli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;iFAUiF;AAEjF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"hybridtmCli.js","sourceRoot":"","sources":["../../ts/cli/hybridtmCli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;iFAUiF;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,E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AC,GAAG,CAAC,yEAAyE,CAAC,CAAC;QACvF,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAChF,CAAC;CACJ;AAED,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials
|
|
5
|
-
* are made available under the terms of the Eclipse
|
|
5
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
6
6
|
* which accompanies this distribution, and is available at
|
|
7
7
|
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
8
|
*
|
|
9
9
|
* Contributors:
|
|
10
10
|
* Maxprograms - initial API and implementation
|
|
11
11
|
*******************************************************************************/
|
|
12
|
-
|
|
13
|
-
export
|
|
12
|
+
import { HybridTM, ImportOptions, TranslationState } from '../index.js';
|
|
13
|
+
export type ImportType = 'xliff' | 'tmx' | 'sdltm';
|
|
14
|
+
export declare class ImportCommand {
|
|
15
|
+
static usage(): void;
|
|
16
|
+
static run(args: string[]): Promise<void>;
|
|
17
|
+
static importFile(tm: HybridTM, filePath: string, type: ImportType, options: ImportOptions): Promise<number>;
|
|
18
|
+
static resolveImportType(explicit: string | undefined, filePath: string): ImportType;
|
|
19
|
+
static isTranslationState(value: string): value is TranslationState;
|
|
20
|
+
private static buildImportOptions;
|
|
21
|
+
}
|