@intlayer/cli 9.1.3 → 9.3.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.
Files changed (36) hide show
  1. package/dist/cjs/cli.cjs +3 -3
  2. package/dist/cjs/cli.cjs.map +1 -1
  3. package/dist/cjs/reviewDoc/reviewDoc.cjs +57 -15
  4. package/dist/cjs/reviewDoc/reviewDoc.cjs.map +1 -1
  5. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +14 -3
  6. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs.map +1 -1
  7. package/dist/cjs/reviewDoc/reviewDocLog.cjs +20 -15
  8. package/dist/cjs/reviewDoc/reviewDocLog.cjs.map +1 -1
  9. package/dist/cjs/reviewDoc/reviewDocProgress.cjs +66 -0
  10. package/dist/cjs/reviewDoc/reviewDocProgress.cjs.map +1 -0
  11. package/dist/cjs/reviewDoc/reviewDocSynthesis.cjs +80 -0
  12. package/dist/cjs/reviewDoc/reviewDocSynthesis.cjs.map +1 -0
  13. package/dist/esm/cli.mjs +3 -3
  14. package/dist/esm/cli.mjs.map +1 -1
  15. package/dist/esm/reviewDoc/reviewDoc.mjs +58 -16
  16. package/dist/esm/reviewDoc/reviewDoc.mjs.map +1 -1
  17. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +14 -3
  18. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs.map +1 -1
  19. package/dist/esm/reviewDoc/reviewDocLog.mjs +20 -16
  20. package/dist/esm/reviewDoc/reviewDocLog.mjs.map +1 -1
  21. package/dist/esm/reviewDoc/reviewDocProgress.mjs +63 -0
  22. package/dist/esm/reviewDoc/reviewDocProgress.mjs.map +1 -0
  23. package/dist/esm/reviewDoc/reviewDocSynthesis.mjs +77 -0
  24. package/dist/esm/reviewDoc/reviewDocSynthesis.mjs.map +1 -0
  25. package/dist/types/index.d.ts +2 -2
  26. package/dist/types/reviewDoc/reviewDoc.d.ts +15 -8
  27. package/dist/types/reviewDoc/reviewDoc.d.ts.map +1 -1
  28. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +5 -1
  29. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts.map +1 -1
  30. package/dist/types/reviewDoc/reviewDocLog.d.ts +14 -10
  31. package/dist/types/reviewDoc/reviewDocLog.d.ts.map +1 -1
  32. package/dist/types/reviewDoc/reviewDocProgress.d.ts +25 -0
  33. package/dist/types/reviewDoc/reviewDocProgress.d.ts.map +1 -0
  34. package/dist/types/reviewDoc/reviewDocSynthesis.d.ts +41 -0
  35. package/dist/types/reviewDoc/reviewDocSynthesis.d.ts.map +1 -0
  36. package/package.json +15 -15
@@ -3,6 +3,7 @@ import { GetConfigurationOptions } from "@intlayer/config/node";
3
3
  import { AIOptions } from "@intlayer/api";
4
4
  import { Locale } from "@intlayer/types/allLocales";
5
5
  import { AIConfig } from "@intlayer/ai";
6
+ import { ReviewReportSummary } from "@intlayer/engine/docReview";
6
7
  //#region src/reviewDoc/reviewDocBlockAware.d.ts
7
8
  /**
8
9
  * Review a file using block-aware alignment.
@@ -14,8 +15,11 @@ import { AIConfig } from "@intlayer/ai";
14
15
  * 5. Sends changed/new blocks to AI in bottom-up order (last block first), so
15
16
  * line numbers of earlier blocks are not shifted by edits below them.
16
17
  * 6. Rewrites the file after each block so progress is persisted incrementally.
18
+ *
19
+ * @returns The per-action block counts of the alignment plan, so the caller can
20
+ * synthesize what was reused and what had to be edited.
17
21
  */
18
- declare const reviewFileBlockAware: (baseFilePath: string, outputFilePath: string, locale: Locale, baseLocale: Locale, aiOptions?: AIOptions, configOptions?: GetConfigurationOptions, customInstructions?: string, changedLines?: number[], aiClient?: AIClient, aiConfig?: AIConfig) => Promise<void>;
22
+ declare const reviewFileBlockAware: (baseFilePath: string, outputFilePath: string, locale: Locale, baseLocale: Locale, aiOptions?: AIOptions, configOptions?: GetConfigurationOptions, customInstructions?: string, changedLines?: number[], aiClient?: AIClient, aiConfig?: AIConfig) => Promise<ReviewReportSummary>;
19
23
  //#endregion
20
24
  export { reviewFileBlockAware };
21
25
  //# sourceMappingURL=reviewDocBlockAware.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reviewDocBlockAware.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocBlockAware.ts"],"mappings":";;;;;;;;;;;;;;;;;cA0Ca,uBAAoB,sBACX,wBACE,QACd,QAAM,YACF,QAAM,YACN,WAAS,gBACL,yBAAuB,6BACZ,yBACJ,WACZ,UAAQ,WACR,aAAQ"}
1
+ {"version":3,"file":"reviewDocBlockAware.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocBlockAware.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;cA+Ca,uBAAoB,sBACX,wBACE,QACd,QAAM,YACF,QAAM,YACN,WAAS,gBACL,yBAAuB,6BACZ,yBACJ,WACZ,UAAQ,WACR,aACV,QAAQ"}
@@ -3,22 +3,26 @@ import { Locale } from "@intlayer/types/allLocales";
3
3
  import { ReviewReport } from "@intlayer/engine/docReview";
4
4
  //#region src/reviewDoc/reviewDocLog.d.ts
5
5
  /**
6
- * Log-only review of a single file/locale pair.
7
- *
8
- * Instead of calling an AI to translate the changed blocks, this compares the
9
- * base document with its translation and logs the blocks that need attention
10
- * (with their line ranges and content) so another agent or a human can generate
11
- * the missing translations.
6
+ * Compare a base document with its translation without calling any AI.
12
7
  *
13
8
  * @param baseFilePath - Absolute path of the base (source) document.
14
9
  * @param outputFilePath - Absolute path of the target (translated) document.
10
+ * @param changedLines - 1-based base line numbers that changed (from git), if any.
11
+ * @returns The structured review report.
12
+ */
13
+ declare const buildFileReviewReport: (baseFilePath: string, outputFilePath: string, changedLines?: number[]) => Promise<ReviewReport>;
14
+ /**
15
+ * Log the blocks that need attention (with their line ranges and content) for a
16
+ * single file/locale pair, so another agent or a human can generate the missing
17
+ * translations.
18
+ *
19
+ * @param report - The report built by {@link buildFileReviewReport}.
20
+ * @param baseFilePath - Absolute path of the base (source) document.
15
21
  * @param locale - The target locale being reviewed.
16
22
  * @param baseLocale - The base locale used as reference.
17
23
  * @param configOptions - Optional Intlayer configuration overrides.
18
- * @param changedLines - 1-based base line numbers that changed (from git), if any.
19
- * @returns The structured review report.
20
24
  */
21
- declare const logReviewFileBlocks: (baseFilePath: string, outputFilePath: string, locale: Locale, baseLocale: Locale, configOptions?: GetConfigurationOptions, changedLines?: number[]) => Promise<ReviewReport>;
25
+ declare const logReviewFileBlocks: (report: ReviewReport, baseFilePath: string, locale: Locale, baseLocale: Locale, configOptions?: GetConfigurationOptions) => void;
22
26
  //#endregion
23
- export { logReviewFileBlocks };
27
+ export { buildFileReviewReport, logReviewFileBlocks };
24
28
  //# sourceMappingURL=reviewDocLog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reviewDocLog.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocLog.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cA+Ba,sBAAmB,sBACV,wBACE,QACd,QAAM,YACF,QAAM,gBACF,yBAAuB,4BAEtC,QAAQ"}
1
+ {"version":3,"file":"reviewDocLog.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocLog.ts"],"mappings":";;;;;;;;;;;;cAuBa,wBAAqB,sBACZ,wBACE,4BAErB,QAAQ;;;;;;;;;;;;cAoBE,sBAAmB,QACtB,cAAY,sBACA,QACZ,QAAM,YACF,QAAM,gBACF"}
@@ -0,0 +1,25 @@
1
+ //#region src/reviewDoc/reviewDocProgress.d.ts
2
+ type ReviewProgressLogger = {
3
+ /** Show the progress line and start animating the spinner. */
4
+ start: () => void;
5
+ /** Count one processed document/locale pair and refresh the progress line. */
6
+ increment: () => void;
7
+ /** Stop the spinner and erase the progress line. */
8
+ stop: () => void;
9
+ };
10
+ /**
11
+ * Single-line progress indicator used while the documents are compared with
12
+ * their translations.
13
+ *
14
+ * The line is rewritten in place on an interactive terminal, then erased so the
15
+ * final synthesis is printed on a clean line. On a non-interactive output (a
16
+ * file, a CI log) a single static line is printed instead of the animation, to
17
+ * avoid flooding the log with escape sequences.
18
+ *
19
+ * @param totalCount - Number of document/locale pairs to process.
20
+ * @returns The progress logger handles.
21
+ */
22
+ declare const createReviewProgressLogger: (totalCount: number) => ReviewProgressLogger;
23
+ //#endregion
24
+ export { ReviewProgressLogger, createReviewProgressLogger };
25
+ //# sourceMappingURL=reviewDocProgress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewDocProgress.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocProgress.ts"],"mappings":";KAUY;;EAEV;;EAEA;;EAEA;;;;;;;;;;;;;;cAeW,6BAA0B,uBAEpC"}
@@ -0,0 +1,41 @@
1
+ import { Locale } from "@intlayer/types/allLocales";
2
+ import { ReviewReportSummary } from "@intlayer/engine/docReview";
3
+ //#region src/reviewDoc/reviewDocSynthesis.d.ts
4
+ /**
5
+ * The outcome of reviewing one base document against one target locale.
6
+ *
7
+ * - `upToDate`: the translation matches the base document, nothing to do.
8
+ * - `toEdit`: at least one block diverges (to review, to add, or to delete).
9
+ * - `skipped`: the pair was not reviewed (already exists, modification range…).
10
+ */
11
+ type ReviewOutcome = 'upToDate' | 'toEdit' | 'skipped';
12
+ /** The result of reviewing a single base document / target locale pair. */
13
+ type ReviewFileResult = {
14
+ /** Path of the base document, as matched by the doc pattern. */
15
+ docPath: string;
16
+ /** The reviewed target locale. */
17
+ locale: Locale;
18
+ /** What the review concluded for this pair. */
19
+ outcome: ReviewOutcome;
20
+ /** Per-action block counts, when the document was actually compared. */
21
+ summary?: ReviewReportSummary;
22
+ };
23
+ type FormatReviewSynthesisOptions = {
24
+ /**
25
+ * When `true`, the diverging blocks were fixed during the run, so the section
26
+ * is labelled `Updated` instead of `To edit`.
27
+ */
28
+ hasAppliedChanges?: boolean;
29
+ };
30
+ /**
31
+ * Render the end-of-run synthesis: which documents are aligned with their base
32
+ * document and which ones still have blocks to edit.
33
+ *
34
+ * @param results - One entry per reviewed base document / target locale pair.
35
+ * @param options - Rendering options.
36
+ * @returns A multi-line string, ready to be logged.
37
+ */
38
+ declare const formatReviewSynthesis: (results: ReviewFileResult[], options?: FormatReviewSynthesisOptions) => string;
39
+ //#endregion
40
+ export { FormatReviewSynthesisOptions, ReviewFileResult, ReviewOutcome, formatReviewSynthesis };
41
+ //# sourceMappingURL=reviewDocSynthesis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewDocSynthesis.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocSynthesis.ts"],"mappings":";;;;;;;;;;KAiBY;;KAGA;;EAEV;;EAEA,QAAQ;;EAER,SAAS;;EAET,UAAU;;KAGA;;;;;EAKV;;;;;;;;;;cA+EW,wBAAqB,SACvB,oBAAkB,UACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/cli",
3
- "version": "9.1.3",
3
+ "version": "9.3.0",
4
4
  "private": false,
5
5
  "description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
6
6
  "keywords": [
@@ -66,24 +66,24 @@
66
66
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
67
67
  },
68
68
  "dependencies": {
69
- "@clack/prompts": "0.11.0",
70
- "@intlayer/api": "9.1.3",
71
- "@intlayer/babel": "9.1.3",
72
- "@intlayer/config": "9.1.3",
73
- "@intlayer/core": "9.1.3",
74
- "@intlayer/dictionaries-entry": "9.1.3",
75
- "@intlayer/engine": "9.1.3",
76
- "@intlayer/remote-dictionaries-entry": "9.1.3",
77
- "@intlayer/types": "9.1.3",
78
- "@intlayer/unmerged-dictionaries-entry": "9.1.3",
69
+ "@clack/prompts": "1.7.0",
70
+ "@intlayer/api": "9.3.0",
71
+ "@intlayer/babel": "9.3.0",
72
+ "@intlayer/config": "9.3.0",
73
+ "@intlayer/core": "9.3.0",
74
+ "@intlayer/dictionaries-entry": "9.3.0",
75
+ "@intlayer/engine": "9.3.0",
76
+ "@intlayer/remote-dictionaries-entry": "9.3.0",
77
+ "@intlayer/types": "9.3.0",
78
+ "@intlayer/unmerged-dictionaries-entry": "9.3.0",
79
79
  "commander": "15.0.0",
80
80
  "enquirer": "2.4.1",
81
- "eventsource": "4.1.0",
81
+ "eventsource": "4.1.1",
82
82
  "fast-glob": "3.3.3"
83
83
  },
84
84
  "devDependencies": {
85
- "@intlayer/ai": "9.1.3",
86
- "@types/node": "26.1.2",
85
+ "@intlayer/ai": "9.3.0",
86
+ "@types/node": "26.2.0",
87
87
  "@utils/ts-config": "1.0.4",
88
88
  "@utils/ts-config-types": "1.0.4",
89
89
  "@utils/tsdown-config": "1.0.4",
@@ -93,7 +93,7 @@
93
93
  "vitest": "4.1.10"
94
94
  },
95
95
  "peerDependencies": {
96
- "@intlayer/ai": "9.1.3"
96
+ "@intlayer/ai": "9.3.0"
97
97
  },
98
98
  "peerDependenciesMeta": {
99
99
  "@intlayer/ai": {