@hamsterbase/evidra 0.3.2 → 0.3.3

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 (146) hide show
  1. package/dist/types/modules/core/contracts/comparison.d.ts +41 -0
  2. package/dist/types/modules/core/contracts/config.d.ts +19 -0
  3. package/dist/types/modules/core/contracts/context.d.ts +6 -0
  4. package/dist/types/modules/core/contracts/functions/addCase.d.ts +128 -0
  5. package/dist/types/modules/core/contracts/functions/addTask.d.ts +14 -0
  6. package/dist/types/modules/core/contracts/functions/approve.d.ts +8 -0
  7. package/dist/types/modules/core/contracts/functions/baselineChanges.d.ts +14 -0
  8. package/dist/types/modules/core/contracts/functions/compare.d.ts +14 -0
  9. package/dist/types/modules/core/contracts/functions/compareTask.d.ts +6 -0
  10. package/dist/types/modules/core/contracts/functions/compareTasks.d.ts +18 -0
  11. package/dist/types/modules/core/contracts/functions/deleteBaselineFile.d.ts +8 -0
  12. package/dist/types/modules/core/contracts/functions/finishTask.d.ts +8 -0
  13. package/dist/types/modules/core/contracts/functions/getBaseline.d.ts +10 -0
  14. package/dist/types/modules/core/contracts/functions/getBaselineChanges.d.ts +6 -0
  15. package/dist/types/modules/core/contracts/functions/getGitChanges.d.ts +6 -0
  16. package/dist/types/modules/core/contracts/functions/getGitDiff.d.ts +8 -0
  17. package/dist/types/modules/core/contracts/functions/getTaskCase.d.ts +23 -0
  18. package/dist/types/modules/core/contracts/functions/getTaskTree.d.ts +21 -0
  19. package/dist/types/modules/core/contracts/functions/gitChanges.d.ts +25 -0
  20. package/dist/types/modules/core/contracts/functions/index.d.ts +18 -0
  21. package/dist/types/modules/core/contracts/functions/listBaselines.d.ts +5 -0
  22. package/dist/types/modules/core/contracts/functions/listRuns.d.ts +7 -0
  23. package/dist/types/modules/core/contracts/functions/listTaskSummaries.d.ts +15 -0
  24. package/dist/types/modules/core/contracts/functions/listTasks.d.ts +15 -0
  25. package/dist/types/modules/core/contracts/functions/loadConfig.d.ts +5 -0
  26. package/dist/types/modules/core/contracts/functions/readProjectInfo.d.ts +5 -0
  27. package/dist/types/modules/core/contracts/functions/readTaskReport.d.ts +6 -0
  28. package/dist/types/modules/core/contracts/functions/resolveConfig.d.ts +6 -0
  29. package/dist/types/modules/core/contracts/functions/reviewBaselineChanges.d.ts +9 -0
  30. package/dist/types/modules/core/contracts/functions/reviewCodeChanges.d.ts +9 -0
  31. package/dist/types/modules/core/contracts/functions/taskRecords.d.ts +6 -0
  32. package/dist/types/modules/core/contracts/functions/updateBaseline.d.ts +20 -0
  33. package/dist/types/modules/core/contracts/git.d.ts +14 -0
  34. package/dist/types/modules/core/contracts/imageDiffPool.d.ts +5 -0
  35. package/dist/types/modules/core/contracts/index.d.ts +30 -0
  36. package/dist/types/modules/core/contracts/internal/compare.d.ts +14 -0
  37. package/dist/types/modules/core/contracts/internal/getBaseline.d.ts +10 -0
  38. package/dist/types/modules/core/contracts/internal/listTasks.d.ts +12 -0
  39. package/dist/types/modules/core/contracts/internal/taskRecords.d.ts +6 -0
  40. package/dist/types/modules/core/contracts/internal/updateBaseline.d.ts +20 -0
  41. package/dist/types/modules/core/contracts/model.d.ts +80 -0
  42. package/dist/types/modules/core/contracts/report.d.ts +52 -0
  43. package/dist/types/modules/core/contracts/repository.d.ts +5 -0
  44. package/dist/types/modules/core/contracts/requests.d.ts +23 -0
  45. package/dist/types/modules/core/contracts/scanCases.d.ts +15 -0
  46. package/dist/types/modules/core/contracts/shared.d.ts +6 -0
  47. package/dist/types/modules/core/contracts/snapshots.d.ts +6 -0
  48. package/dist/types/modules/core/contracts/taskRecord.d.ts +76 -0
  49. package/dist/types/modules/core/implementations/Functions/addCase.d.ts +4 -0
  50. package/dist/types/modules/core/implementations/Functions/addTask.d.ts +4 -0
  51. package/dist/types/modules/core/implementations/Functions/approve.d.ts +6 -0
  52. package/dist/types/modules/core/implementations/Functions/compare.d.ts +15 -0
  53. package/dist/types/modules/core/implementations/Functions/compareTask.d.ts +3 -0
  54. package/dist/types/modules/core/implementations/Functions/compareTasks.d.ts +5 -0
  55. package/dist/types/modules/core/implementations/Functions/deleteBaselineFile.d.ts +4 -0
  56. package/dist/types/modules/core/implementations/Functions/finishTask.d.ts +4 -0
  57. package/dist/types/modules/core/implementations/Functions/getBaseline.d.ts +4 -0
  58. package/dist/types/modules/core/implementations/Functions/getBaselineChanges.d.ts +4 -0
  59. package/dist/types/modules/core/implementations/Functions/getGitChanges.d.ts +3 -0
  60. package/dist/types/modules/core/implementations/Functions/getGitDiff.d.ts +3 -0
  61. package/dist/types/modules/core/implementations/Functions/getTaskCase.d.ts +5 -0
  62. package/dist/types/modules/core/implementations/Functions/getTaskTree.d.ts +5 -0
  63. package/dist/types/modules/core/implementations/Functions/listBaselines.d.ts +3 -0
  64. package/dist/types/modules/core/implementations/Functions/listTaskSummaries.d.ts +2 -0
  65. package/dist/types/modules/core/implementations/Functions/listTasks.d.ts +4 -0
  66. package/dist/types/modules/core/implementations/Functions/loadConfig.d.ts +3 -0
  67. package/dist/types/modules/core/implementations/Functions/readProjectInfo.d.ts +3 -0
  68. package/dist/types/modules/core/implementations/Functions/readTaskReport.d.ts +3 -0
  69. package/dist/types/modules/core/implementations/Functions/resolveConfig.d.ts +9 -0
  70. package/dist/types/modules/core/implementations/Functions/reviewBaselineChanges.d.ts +4 -0
  71. package/dist/types/modules/core/implementations/Functions/reviewCodeChanges.d.ts +4 -0
  72. package/dist/types/modules/core/implementations/Functions/taskRecords.d.ts +4 -0
  73. package/dist/types/modules/core/implementations/Functions/updateBaseline.d.ts +5 -0
  74. package/dist/types/modules/core/implementations/Utils/assertNamespace.d.ts +1 -0
  75. package/dist/types/modules/core/implementations/Utils/canonical.d.ts +1 -0
  76. package/dist/types/modules/core/implementations/Utils/createTaskId.d.ts +1 -0
  77. package/dist/types/modules/core/implementations/Utils/deletionAllowed.d.ts +2 -0
  78. package/dist/types/modules/core/implementations/Utils/download.d.ts +3 -0
  79. package/dist/types/modules/core/implementations/Utils/hash.d.ts +1 -0
  80. package/dist/types/modules/core/implementations/Utils/imageDiffPool.d.ts +18 -0
  81. package/dist/types/modules/core/implementations/Utils/imageKey.d.ts +1 -0
  82. package/dist/types/modules/core/implementations/Utils/loadBaseline.d.ts +4 -0
  83. package/dist/types/modules/core/implementations/Utils/mapLimit.d.ts +1 -0
  84. package/dist/types/modules/core/implementations/Utils/observationKey.d.ts +1 -0
  85. package/dist/types/modules/core/implementations/Utils/pngSize.d.ts +4 -0
  86. package/dist/types/modules/core/implementations/Utils/readJson.d.ts +1 -0
  87. package/dist/types/modules/core/implementations/Utils/readTaskRecord.d.ts +2 -0
  88. package/dist/types/modules/core/implementations/Utils/scanCases.d.ts +9 -0
  89. package/dist/types/modules/core/implementations/Utils/taskDirectory.d.ts +1 -0
  90. package/dist/types/modules/core/implementations/Utils/toCase.d.ts +3 -0
  91. package/dist/types/modules/core/implementations/Utils/toObservation.d.ts +3 -0
  92. package/dist/types/modules/core/implementations/Utils/toSnapshot.d.ts +3 -0
  93. package/dist/types/modules/core/implementations/Utils/writeBytesAtomic.d.ts +1 -0
  94. package/dist/types/modules/core/implementations/Utils/writeJsonAtomic.d.ts +1 -0
  95. package/dist/types/modules/core/implementations/Utils/writeTextAtomic.d.ts +1 -0
  96. package/dist/types/modules/core/implementations/baselineChanges.d.ts +6 -0
  97. package/dist/types/modules/core/implementations/config.d.ts +6 -0
  98. package/dist/types/modules/core/implementations/content.d.ts +1 -0
  99. package/dist/types/modules/core/implementations/evidra.d.ts +31 -0
  100. package/dist/types/modules/core/implementations/git.d.ts +11 -0
  101. package/dist/types/modules/core/implementations/gitChanges.d.ts +29 -0
  102. package/dist/types/modules/core/implementations/index.d.ts +17 -0
  103. package/dist/types/modules/core/implementations/internal/compare.d.ts +15 -0
  104. package/dist/types/modules/core/implementations/internal/getBaseline.d.ts +4 -0
  105. package/dist/types/modules/core/implementations/internal/listTasks.d.ts +2 -0
  106. package/dist/types/modules/core/implementations/internal/taskRecords.d.ts +4 -0
  107. package/dist/types/modules/core/implementations/internal/updateBaseline.d.ts +5 -0
  108. package/dist/types/modules/core/implementations/paths.d.ts +48 -0
  109. package/dist/types/modules/core/implementations/report.d.ts +3 -0
  110. package/dist/types/modules/core/implementations/reportResources.d.ts +4 -0
  111. package/dist/types/modules/core/implementations/reportStatus.d.ts +10 -0
  112. package/dist/types/modules/core/implementations/reportTree.d.ts +5 -0
  113. package/dist/types/modules/core/implementations/repository.d.ts +10 -0
  114. package/dist/types/modules/core/implementations/requests.d.ts +13 -0
  115. package/dist/types/modules/core/implementations/snapshots.d.ts +11 -0
  116. package/dist/types/modules/core/implementations/storage/local.d.ts +3 -0
  117. package/dist/types/modules/core/implementations/storage/objects.d.ts +3 -0
  118. package/dist/types/modules/core/index.d.ts +21 -0
  119. package/dist/types/packages/sdk/src/index.d.ts +21 -0
  120. package/dist/types/packages/sdk/src/types.d.ts +9 -0
  121. package/dist/web/assets/{cssMode-BTAZgpQt.js → cssMode-Dhqi33oU.js} +1 -1
  122. package/dist/web/assets/{editor.api-CfnVkTAL.js → editor.api-BdoUH79A.js} +1 -1
  123. package/dist/web/assets/{freemarker2-BV0isRRj.js → freemarker2-Di1XsZv-.js} +1 -1
  124. package/dist/web/assets/{handlebars-CbLz4Wc3.js → handlebars-BmMiVsf3.js} +1 -1
  125. package/dist/web/assets/{html-D2xBZbJh.js → html-BWw9s24y.js} +1 -1
  126. package/dist/web/assets/{htmlMode-DwPRG6d4.js → htmlMode-BLrNvZ52.js} +1 -1
  127. package/dist/web/assets/index-7nw0XeCR.css +2 -0
  128. package/dist/web/assets/index-DUtB8WRj.js +35 -0
  129. package/dist/web/assets/{javascript-D-gNVUGD.js → javascript-Bw0zDh-8.js} +1 -1
  130. package/dist/web/assets/{jsonMode-BMqe91Um.js → jsonMode-Bg-zBRn4.js} +1 -1
  131. package/dist/web/assets/{liquid-D6FHObSg.js → liquid-QbiTMLnd.js} +1 -1
  132. package/dist/web/assets/{lspLanguageFeatures-D6i7D2oO.js → lspLanguageFeatures-CxAtCJVb.js} +1 -1
  133. package/dist/web/assets/{mdx-CGtrE9A8.js → mdx-CEzuFeFS.js} +1 -1
  134. package/dist/web/assets/{monaco-C3WraHAR.js → monaco-BUdi4Xi9.js} +4 -4
  135. package/dist/web/assets/{python-B2ywaTtF.js → python-_M325yHp.js} +1 -1
  136. package/dist/web/assets/{razor-zzTWj2fW.js → razor-B6FUqtCe.js} +1 -1
  137. package/dist/web/assets/{tsMode-BrfjRJaR.js → tsMode-DTgoRzrO.js} +1 -1
  138. package/dist/web/assets/{typescript-xVM47PRQ.js → typescript-Bzm0l5-o.js} +1 -1
  139. package/dist/web/assets/{workers-DEZ7PLe8.js → workers-Cga5X6ar.js} +1 -1
  140. package/dist/web/assets/{xml-kpizFTtc.js → xml-BCwAkxsD.js} +1 -1
  141. package/dist/web/assets/{yaml-DDFZ3vPi.js → yaml-ClBi6NOp.js} +1 -1
  142. package/dist/web/index.html +2 -2
  143. package/package.json +2 -2
  144. package/dist/web/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
  145. package/dist/web/assets/index-CJuNTIx5.css +0 -2
  146. package/dist/web/assets/index-CqRUszBc.js +0 -35
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import type { Task } from '../model.js';
3
+ export declare const ListTasksInputSchema: z.ZodObject<{
4
+ limit: z.ZodOptional<z.ZodNumber>;
5
+ }, z.core.$strip>;
6
+ export type ListTasksInput = z.infer<typeof ListTasksInputSchema>;
7
+ export interface TaskListItem extends Task {
8
+ failedCount: number;
9
+ }
10
+ export interface ListTasksOutput {
11
+ tasks: TaskListItem[];
12
+ }
@@ -0,0 +1,6 @@
1
+ import type { TaskRecord } from '../taskRecord.js';
2
+ export interface TaskRecordEntry {
3
+ /** 相对 tasks 根目录的路径。 */
4
+ taskPath: string;
5
+ record: TaskRecord;
6
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { CompareOutput } from './compare.js';
3
+ export declare const UpdateBaselineInputSchema: z.ZodObject<{
4
+ taskPath: z.ZodString;
5
+ baselineVersion: z.ZodOptional<z.ZodString>;
6
+ cases: z.ZodArray<z.ZodObject<{
7
+ id: z.ZodString;
8
+ baselineHash: z.ZodNullable<z.ZodString>;
9
+ }, z.core.$strip>>;
10
+ }, z.core.$strip>;
11
+ export type UpdateBaselineInput = z.infer<typeof UpdateBaselineInputSchema>;
12
+ export type UpdateBaselineOutput = {
13
+ conflict: false;
14
+ updatedCaseIds: string[];
15
+ deletedCaseIds: string[];
16
+ comparison: CompareOutput;
17
+ } | {
18
+ conflict: true;
19
+ comparison: CompareOutput;
20
+ };
@@ -0,0 +1,80 @@
1
+ /** keypath 的单段与 id 共用同一约束:只允许大小写字母、数字、中划线。 */
2
+ export type Key = string;
3
+ /** 基线库中的一个 namespace,等价于 evidra.config.json 的 namespaces 项。 */
4
+ export interface Namespace {
5
+ id: string;
6
+ name: string;
7
+ }
8
+ export interface TreeSegment {
9
+ key: Key;
10
+ display: string;
11
+ }
12
+ export type CaseStatus = 'passed' | 'failed' | 'skipped' | 'interrupted';
13
+ export type TaskStatus = CaseStatus | 'running';
14
+ export type Coverage = 'partial' | 'complete';
15
+ export interface CaseResult {
16
+ status: CaseStatus;
17
+ durationMs?: number;
18
+ errors?: string[];
19
+ }
20
+ /** 已保存的快照元数据。 */
21
+ export interface Snapshot {
22
+ id: string;
23
+ name: string;
24
+ type: 'text' | 'image';
25
+ /** 文本正文;图片使用独立对象 key。 */
26
+ body?: string;
27
+ language?: string;
28
+ contentType?: 'image/png';
29
+ width?: number;
30
+ height?: number;
31
+ /** 1–12,默认 4。 */
32
+ col?: number;
33
+ maxDiffPixels?: number;
34
+ /** 对象存储 key。 */
35
+ key?: string;
36
+ /** 内容读取地址;文本返回 text/plain,图片返回 image/png。 */
37
+ url?: string;
38
+ }
39
+ export interface Observation {
40
+ name: string;
41
+ type: 'text' | 'image';
42
+ /** 文本正文;图片使用独立对象 key。 */
43
+ body?: string;
44
+ language?: string;
45
+ contentType?: 'image/png';
46
+ width?: number;
47
+ height?: number;
48
+ /** 对象存储 key。 */
49
+ key?: string;
50
+ url?: string;
51
+ }
52
+ export interface Case {
53
+ id: string;
54
+ name: string;
55
+ treePath: TreeSegment[];
56
+ /** 失败且未采集到快照时为 null。 */
57
+ snapshots: Snapshot[] | null;
58
+ result: CaseResult;
59
+ observations: Observation[];
60
+ }
61
+ export interface Task {
62
+ id: string;
63
+ /** 相对 tasks 目录的完整路径:<yyyy-MM-dd>/<HH-mm-ss>-<taskId>。 */
64
+ path: string;
65
+ namespace: string;
66
+ name: string;
67
+ coverage: Coverage;
68
+ status: TaskStatus;
69
+ /** ISO 8601。 */
70
+ startedAt: string;
71
+ finishedAt?: string;
72
+ caseCount: number;
73
+ }
74
+ export interface BaselineCase {
75
+ id: string;
76
+ name: string;
77
+ treePath: TreeSegment[];
78
+ snapshots: Snapshot[];
79
+ approvedAt: string;
80
+ }
@@ -0,0 +1,52 @@
1
+ import type { CaseDiff, Comparison } from './comparison.js';
2
+ import type { TaskDetail } from './repository.js';
3
+ import type { Baseline } from './snapshots.js';
4
+ export interface ReportEntry {
5
+ ignored?: boolean;
6
+ file?: string;
7
+ key: string;
8
+ namespace: string;
9
+ item: CaseDiff;
10
+ taskId: string;
11
+ version: string;
12
+ }
13
+ export interface ReportTreeNode {
14
+ key: string;
15
+ label: string;
16
+ kind: 'namespace' | 'folder' | 'case';
17
+ namespace?: string;
18
+ children?: ReportTreeNode[];
19
+ }
20
+ export interface BaselineGroup extends Baseline {
21
+ id: string;
22
+ name: string;
23
+ }
24
+ export interface BaselineList {
25
+ namespaces: BaselineGroup[];
26
+ entries: ReportEntry[];
27
+ tree: ReportTreeNode[];
28
+ }
29
+ export type ReportStatus = 'running' | 'failed' | 'partial' | 'unavailable' | 'added' | 'deleted' | 'changed' | 'same' | 'unknown';
30
+ export interface TaskDisplay {
31
+ executionId: string;
32
+ namespace: string;
33
+ namespaceName: string;
34
+ taskName: string;
35
+ coverage: 'partial' | 'complete';
36
+ startedAt: string;
37
+ endedAt?: string;
38
+ durationMs: number;
39
+ status: 'running' | 'success' | 'failed' | 'interrupted';
40
+ taskStatus: ReportStatus;
41
+ sceneCount: number;
42
+ successCount: number;
43
+ failedCount: number;
44
+ comparison: 'same' | 'attention' | 'unknown';
45
+ }
46
+ export interface TaskReport {
47
+ task: TaskDetail;
48
+ comparison: Comparison;
49
+ entries: ReportEntry[];
50
+ tree: ReportTreeNode[];
51
+ display: TaskDisplay;
52
+ }
@@ -0,0 +1,5 @@
1
+ import type { Task } from './model.js';
2
+ import type { StoredCase } from './taskRecord.js';
3
+ export type TaskDetail = Task & {
4
+ cases: StoredCase[];
5
+ };
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ export declare const CodeReviewRequestSchema: z.ZodObject<{
3
+ ref: z.ZodString;
4
+ version: z.ZodString;
5
+ items: z.ZodArray<z.ZodString>;
6
+ reviewed: z.ZodBoolean;
7
+ }, z.core.$strip>;
8
+ export declare const ReviewRequestSchema: z.ZodObject<{
9
+ ref: z.ZodString;
10
+ version: z.ZodString;
11
+ items: z.ZodArray<z.ZodString>;
12
+ reviewed: z.ZodBoolean;
13
+ }, z.core.$strip>;
14
+ export declare const BaselineDeleteRequestSchema: z.ZodObject<{
15
+ namespace: z.ZodString;
16
+ file: z.ZodString;
17
+ version: z.ZodString;
18
+ }, z.core.$strip>;
19
+ export declare const ApproveRequestSchema: z.ZodObject<{
20
+ taskId: z.ZodString;
21
+ baselineVersion: z.ZodString;
22
+ caseIds: z.ZodArray<z.ZodString>;
23
+ }, z.core.$strip>;
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import type { BaselineCase } from './model.js';
3
+ export declare const ScanCasesInputSchema: z.ZodObject<{
4
+ root: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type ScanCasesInput = z.infer<typeof ScanCasesInputSchema>;
7
+ export interface CaseFile {
8
+ file: string;
9
+ path: string;
10
+ hash: string;
11
+ baseline: BaselineCase;
12
+ }
13
+ export interface ScanCasesOutput {
14
+ cases: CaseFile[];
15
+ }
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ export declare const IdSchema: z.ZodString;
3
+ export declare const NameSchema: z.ZodString;
4
+ export declare const ColSchema: z.ZodNumber;
5
+ export declare const DateTimeSchema: z.ZodISODateTime;
6
+ export declare const TaskPathSchema: z.ZodString;
@@ -0,0 +1,6 @@
1
+ import type { BaselineCase } from './model.js';
2
+ export interface Baseline {
3
+ candidates?: import('./internal/getBaseline.js').GetBaselineOutput['candidates'];
4
+ cases: BaselineCase[];
5
+ baselineVersion: string;
6
+ }
@@ -0,0 +1,76 @@
1
+ import type { CaseDiff, ComparisonSummary } from './comparison.js';
2
+ import type { BaselineCase, CaseResult, Task, TreeSegment } from './model.js';
3
+ export interface StoredTextSnapshot {
4
+ id: string;
5
+ name: string;
6
+ type: 'text';
7
+ body: string;
8
+ language?: string;
9
+ col?: number;
10
+ }
11
+ export interface StoredImageSnapshot {
12
+ id: string;
13
+ name: string;
14
+ type: 'image';
15
+ key: string;
16
+ contentType: 'image/png';
17
+ width: number;
18
+ height: number;
19
+ maxDiffPixels?: number;
20
+ col?: number;
21
+ }
22
+ export type StoredSnapshot = StoredTextSnapshot | StoredImageSnapshot;
23
+ export interface StoredTextObservation {
24
+ name: string;
25
+ type: 'text';
26
+ body: string;
27
+ language?: string;
28
+ }
29
+ export interface StoredImageObservation {
30
+ name: string;
31
+ type: 'image';
32
+ key: string;
33
+ contentType: 'image/png';
34
+ width: number;
35
+ height: number;
36
+ }
37
+ export type StoredObservation = StoredTextObservation | StoredImageObservation;
38
+ export interface StoredCase {
39
+ id: string;
40
+ name: string;
41
+ treePath: TreeSegment[];
42
+ snapshots: StoredSnapshot[] | null;
43
+ result: CaseResult;
44
+ observations: StoredObservation[];
45
+ }
46
+ export interface TaskRecord {
47
+ task: Task;
48
+ cases: StoredCase[];
49
+ }
50
+ export interface CachedCaseDiff {
51
+ currentHash: string | null;
52
+ baselineHash: string | null;
53
+ canDelete: boolean;
54
+ diff: CaseDiff;
55
+ }
56
+ export interface BaselineEntry {
57
+ file?: string;
58
+ path: string;
59
+ hash: string;
60
+ baseline: BaselineCase;
61
+ }
62
+ export interface BaselineState {
63
+ files?: string[];
64
+ cases: Map<string, BaselineEntry>;
65
+ }
66
+ export interface CachedComparisonIndex {
67
+ formatVersion?: number;
68
+ /** 生成缓存时使用的基线版本;与当前基线不一致时整份摘要视为过期。 */
69
+ baselineVersion: string;
70
+ cases: Record<string, CachedCaseDiff>;
71
+ }
72
+ /** Lightweight list cache; case details remain in index.json. */
73
+ export interface CachedComparisonSummary {
74
+ baselineVersion: string;
75
+ summary: ComparisonSummary;
76
+ }
@@ -0,0 +1,4 @@
1
+ import { type AddCaseInput, type AddCaseOutput } from '../../contracts/functions/addCase.js';
2
+ export { AddCaseInputSchema, CaseInputSchema, ObservationInputSchema, SnapshotInputSchema, } from '../../contracts/functions/addCase.js';
3
+ export type { AddCaseInput, AddCaseOutput, CaseInput, ObservationInput, SnapshotInput, } from '../../contracts/functions/addCase.js';
4
+ export declare function addCase(input: AddCaseInput): Promise<AddCaseOutput>;
@@ -0,0 +1,4 @@
1
+ import { type AddTaskInput, type AddTaskOutput } from '../../contracts/functions/addTask.js';
2
+ export { AddTaskInputSchema } from '../../contracts/functions/addTask.js';
3
+ export type { AddTaskInput, AddTaskOutput } from '../../contracts/functions/addTask.js';
4
+ export declare function addTask(input: AddTaskInput): Promise<AddTaskOutput>;
@@ -0,0 +1,6 @@
1
+ import { type ApproveInput } from '../../contracts/functions/approve.js';
2
+ import type { Comparison } from '../../contracts/comparison.js';
3
+ export declare function approve(input: ApproveInput): Promise<{
4
+ conflict: boolean;
5
+ comparison: Comparison;
6
+ }>;
@@ -0,0 +1,15 @@
1
+ import { type CompareInput, type CompareOutput, type CompareRecordOptions } from '../../contracts/functions/compare.js';
2
+ import type { Comparison, ComparisonSummary } from '../../contracts/comparison.js';
3
+ import type { FileStorage } from '../../contracts/context.js';
4
+ import type { BaselineState, TaskRecord } from '../../contracts/taskRecord.js';
5
+ import { type ImageDiffResult } from '../Utils/imageDiffPool.js';
6
+ export { CompareInputSchema } from '../../contracts/functions/compare.js';
7
+ export type { CompareInput, CompareOutput, CompareRecordOptions, } from '../../contracts/functions/compare.js';
8
+ export declare function compare(input: CompareInput, cwd: string, baselineRoot: string, storage: FileStorage, concurrency?: number): Promise<CompareOutput>;
9
+ export declare function compareRecord(cwd: string, storage: FileStorage, record: TaskRecord, baseline: BaselineState, options?: CompareRecordOptions): Promise<Comparison>;
10
+ /**
11
+ * 只读取轻量 summary.json,不读取 case/diff 索引或计算图片差异。
12
+ * 摘要缺失、损坏或基线版本不一致时返回 null,列表显示未知。
13
+ */
14
+ export declare function readCachedComparisonSummary(cwd: string, namespace: string, taskId: string, currentBaselineVersion: string): Promise<ComparisonSummary | null>;
15
+ export declare function localImageDiff(oldBytes: Uint8Array, newBytes: Uint8Array): ImageDiffResult;
@@ -0,0 +1,3 @@
1
+ import { type CompareTaskInput } from '../../contracts/functions/compareTask.js';
2
+ import type { Comparison } from '../../contracts/comparison.js';
3
+ export declare function compareTask(input: CompareTaskInput): Promise<Comparison>;
@@ -0,0 +1,5 @@
1
+ import { type CompareTasksInput, type CompareTasksOutput } from '../../contracts/functions/compareTasks.js';
2
+ import type { FileStorage } from '../../contracts/context.js';
3
+ export { CompareTasksInputSchema } from '../../contracts/functions/compareTasks.js';
4
+ export type { CompareTasksInput, CompareTasksOutput, TaskComparisonSummary, } from '../../contracts/functions/compareTasks.js';
5
+ export declare function compareTasks(input: CompareTasksInput, cwd: string, baselineRoot: string, storage: FileStorage, concurrency?: number): Promise<CompareTasksOutput>;
@@ -0,0 +1,4 @@
1
+ import { type DeleteBaselineFileInput } from '../../contracts/functions/deleteBaselineFile.js';
2
+ export declare function deleteBaselineFile(input: DeleteBaselineFileInput): Promise<{
3
+ ok: boolean;
4
+ }>;
@@ -0,0 +1,4 @@
1
+ import { type FinishTaskInput, type FinishTaskOutput } from '../../contracts/functions/finishTask.js';
2
+ export { FinishTaskInputSchema } from '../../contracts/functions/finishTask.js';
3
+ export type { FinishTaskInput, FinishTaskOutput } from '../../contracts/functions/finishTask.js';
4
+ export declare function finishTask(input: FinishTaskInput): Promise<FinishTaskOutput>;
@@ -0,0 +1,4 @@
1
+ import { type GetBaselineOutput } from '../../contracts/functions/getBaseline.js';
2
+ export type { GetBaselineOutput } from '../../contracts/functions/getBaseline.js';
3
+ /** 读取某个 namespace 的 core 基线;只扫描 baselines 目录,不做比较。 */
4
+ export declare function getBaseline(baselineRoot: string, namespace: string): Promise<GetBaselineOutput>;
@@ -0,0 +1,4 @@
1
+ import { type GetBaselineChangesInput } from '../../contracts/functions/getBaselineChanges.js';
2
+ import { type BaselineChanges } from '../../contracts/functions/baselineChanges.js';
3
+ export type { BaselineChange, BaselineChanges } from '../../contracts/functions/baselineChanges.js';
4
+ export declare function getBaselineChanges(input: GetBaselineChangesInput): Promise<BaselineChanges>;
@@ -0,0 +1,3 @@
1
+ import type { CodeChanges } from '../../contracts/functions/gitChanges.js';
2
+ import { type GetGitChangesInput } from '../../contracts/functions/getGitChanges.js';
3
+ export declare function getGitChanges(input: GetGitChangesInput): Promise<CodeChanges>;
@@ -0,0 +1,3 @@
1
+ import type { CodeDiff } from '../../contracts/functions/gitChanges.js';
2
+ import { type GetGitDiffInput } from '../../contracts/functions/getGitDiff.js';
3
+ export declare function getGitDiff(input: GetGitDiffInput): Promise<CodeDiff>;
@@ -0,0 +1,5 @@
1
+ import { type GetTaskCaseInput, type GetTaskCaseOutput } from '../../contracts/functions/getTaskCase.js';
2
+ import type { FileStorage } from '../../contracts/context.js';
3
+ export { GetTaskCaseInputSchema } from '../../contracts/functions/getTaskCase.js';
4
+ export type { GetTaskCaseInput, GetTaskCaseOutput, TaskCaseObservation, } from '../../contracts/functions/getTaskCase.js';
5
+ export declare function getTaskCase(input: GetTaskCaseInput, cwd: string, baselineRoot: string, storage: FileStorage, concurrency?: number): Promise<GetTaskCaseOutput>;
@@ -0,0 +1,5 @@
1
+ import { type GetTaskTreeInput, type GetTaskTreeOutput } from '../../contracts/functions/getTaskTree.js';
2
+ import type { FileStorage } from '../../contracts/context.js';
3
+ export { GetTaskTreeInputSchema } from '../../contracts/functions/getTaskTree.js';
4
+ export type { GetTaskTreeInput, GetTaskTreeOutput, TaskTreeNode, } from '../../contracts/functions/getTaskTree.js';
5
+ export declare function getTaskTree(input: GetTaskTreeInput, cwd: string, baselineRoot: string, storage: FileStorage, concurrency?: number): Promise<GetTaskTreeOutput>;
@@ -0,0 +1,3 @@
1
+ import { type ListBaselinesInput } from '../../contracts/functions/listBaselines.js';
2
+ import type { BaselineList } from '../../contracts/report.js';
3
+ export declare function listBaselines(input: ListBaselinesInput): Promise<BaselineList>;
@@ -0,0 +1,2 @@
1
+ import { type ListTaskSummariesInput, type TaskSummaryItem } from '../../contracts/functions/listTaskSummaries.js';
2
+ export declare function listTaskSummaries(input: ListTaskSummariesInput): Promise<TaskSummaryItem[]>;
@@ -0,0 +1,4 @@
1
+ import { type ListTasksInput, type ListTasksOutput } from '../../contracts/functions/listTasks.js';
2
+ export { ListTasksInputSchema } from '../../contracts/functions/listTasks.js';
3
+ export type { ListTasksInput, ListTasksOutput } from '../../contracts/functions/listTasks.js';
4
+ export declare function listTasks(input: ListTasksInput, cwd: string, namespaces: Set<string>): Promise<ListTasksOutput>;
@@ -0,0 +1,3 @@
1
+ import type { Config } from '../../contracts/config.js';
2
+ import { type LoadConfigInput } from '../../contracts/functions/loadConfig.js';
3
+ export declare function loadConfig(input: LoadConfigInput): Promise<Config>;
@@ -0,0 +1,3 @@
1
+ import type { ProjectInfo } from '../../contracts/git.js';
2
+ import { type ReadProjectInfoInput } from '../../contracts/functions/readProjectInfo.js';
3
+ export declare function readProjectInfo(input: ReadProjectInfoInput): Promise<ProjectInfo>;
@@ -0,0 +1,3 @@
1
+ import { type ReadTaskReportInput } from '../../contracts/functions/readTaskReport.js';
2
+ import type { TaskReport } from '../../contracts/report.js';
3
+ export declare function readTaskReport(input: ReadTaskReportInput): Promise<TaskReport>;
@@ -0,0 +1,9 @@
1
+ import { type ResolveConfigInput } from '../../contracts/functions/resolveConfig.js';
2
+ /** 解析显式仓库路径;指定 namespace 时额外校验其已注册。 */
3
+ export declare function resolveConfig(input: ResolveConfigInput): Promise<{
4
+ absoluteReportPath: string;
5
+ namespaceList: {
6
+ id: string;
7
+ name: string;
8
+ }[];
9
+ }>;
@@ -0,0 +1,4 @@
1
+ import { type ReviewBaselineChangesInput } from '../../contracts/functions/reviewBaselineChanges.js';
2
+ export declare function reviewBaselineChanges(input: ReviewBaselineChangesInput): Promise<{
3
+ reviewed: string[];
4
+ }>;
@@ -0,0 +1,4 @@
1
+ import { type ReviewCodeChangesInput } from '../../contracts/functions/reviewCodeChanges.js';
2
+ export declare function reviewCodeChanges(input: ReviewCodeChangesInput): Promise<{
3
+ reviewed: string[];
4
+ }>;
@@ -0,0 +1,4 @@
1
+ import { type TaskRecordEntry } from '../../contracts/functions/taskRecords.js';
2
+ export type { TaskRecordEntry } from '../../contracts/functions/taskRecords.js';
3
+ /** 按 ID 索引读取任务;索引或任务不存在时返回 null,不扫描任务目录。 */
4
+ export declare function getTask(cwd: string, taskId: string): Promise<TaskRecordEntry | null>;
@@ -0,0 +1,5 @@
1
+ import { type UpdateBaselineInput, type UpdateBaselineOutput } from '../../contracts/functions/updateBaseline.js';
2
+ import type { FileStorage } from '../../contracts/context.js';
3
+ export { UpdateBaselineInputSchema } from '../../contracts/functions/updateBaseline.js';
4
+ export type { UpdateBaselineInput, UpdateBaselineOutput, } from '../../contracts/functions/updateBaseline.js';
5
+ export declare function updateBaseline(input: UpdateBaselineInput, cwd: string, baselineRoot: string, storage: FileStorage, concurrency?: number): Promise<UpdateBaselineOutput>;
@@ -0,0 +1 @@
1
+ export declare function assertNamespace(namespaces: Set<string>, namespace: string): void;
@@ -0,0 +1 @@
1
+ export declare function canonical(value: unknown): string;
@@ -0,0 +1 @@
1
+ export declare const createTaskId: () => string;
@@ -0,0 +1,2 @@
1
+ import type { TaskRecord } from '../../contracts/taskRecord.js';
2
+ export declare function deletionAllowed(record: TaskRecord): boolean;
@@ -0,0 +1,3 @@
1
+ import type { FileStorage } from '../../contracts/context.js';
2
+ /** Storage owns the cache so it can isolate objects by S3 location. */
3
+ export declare function download(_cwd: string, storage: FileStorage, key: string): Promise<Buffer>;
@@ -0,0 +1 @@
1
+ export declare const hash: (value: string | Uint8Array) => string;
@@ -0,0 +1,18 @@
1
+ import { type ImageDiffResult } from '../../contracts/imageDiffPool.js';
2
+ export type { ImageDiffResult } from '../../contracts/imageDiffPool.js';
3
+ export declare class ImageDiffPool {
4
+ private readonly size;
5
+ private readonly workers;
6
+ private readonly idle;
7
+ private readonly active;
8
+ private readonly queue;
9
+ private nextId;
10
+ constructor(size: number);
11
+ compare(oldBytes: Uint8Array, newBytes: Uint8Array): Promise<ImageDiffResult>;
12
+ close(): Promise<void>;
13
+ private ensureWorkers;
14
+ private addWorker;
15
+ private handleResult;
16
+ private failWorker;
17
+ private pump;
18
+ }
@@ -0,0 +1 @@
1
+ export declare function imageKey(namespace: string, caseId: string, snapshotId: string, imageId: string): string;
@@ -0,0 +1,4 @@
1
+ import type { BaselineState } from '../../contracts/taskRecord.js';
2
+ export declare function baselineVersion(baseline: BaselineState): string;
3
+ export declare function loadBaseline(baselineRoot: string, namespace: string): Promise<BaselineState>;
4
+ export declare function readBaselineVersion(root: string, namespace: string): Promise<string>;
@@ -0,0 +1 @@
1
+ export declare function mapLimit<T, R>(items: T[], limit: number, fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
@@ -0,0 +1 @@
1
+ export declare function observationKey(namespace: string, caseId: string, index: number, imageId: string): string;
@@ -0,0 +1,4 @@
1
+ export declare function pngSize(body: Uint8Array): {
2
+ width: number;
3
+ height: number;
4
+ };
@@ -0,0 +1 @@
1
+ export declare function readJson<T>(file: string): Promise<T | null>;
@@ -0,0 +1,2 @@
1
+ import type { TaskRecord } from '../../contracts/taskRecord.js';
2
+ export declare function readTaskRecord(file: string): Promise<TaskRecord>;
@@ -0,0 +1,9 @@
1
+ import { type ScanCasesInput, type ScanCasesOutput } from '../../contracts/scanCases.js';
2
+ export { ScanCasesInputSchema } from '../../contracts/scanCases.js';
3
+ export type { CaseFile, ScanCasesInput, ScanCasesOutput } from '../../contracts/scanCases.js';
4
+ /**
5
+ * 扫描 root 下所有 baseline.json,解析内容并计算稳定 hash。
6
+ * case 路径相对于 root;hash 输入为排序后的相对文件路径和解析后的 JSON。
7
+ */
8
+ export declare function scanCases(input: ScanCasesInput): Promise<ScanCasesOutput>;
9
+ export declare function baselineFiles(root: string): Promise<string[]>;
@@ -0,0 +1 @@
1
+ export declare function taskDirectory(cwd: string, taskPath: string): string;
@@ -0,0 +1,3 @@
1
+ import type { Case } from '../../contracts/model.js';
2
+ import type { StoredCase } from '../../contracts/taskRecord.js';
3
+ export declare function toCase(value: StoredCase): Case;
@@ -0,0 +1,3 @@
1
+ import type { Observation } from '../../contracts/model.js';
2
+ import type { StoredObservation } from '../../contracts/taskRecord.js';
3
+ export declare function toObservation(observation: StoredObservation): Observation;
@@ -0,0 +1,3 @@
1
+ import type { Snapshot } from '../../contracts/model.js';
2
+ import type { StoredSnapshot } from '../../contracts/taskRecord.js';
3
+ export declare function toSnapshot(snapshot: StoredSnapshot): Snapshot;
@@ -0,0 +1 @@
1
+ export declare function writeBytesAtomic(file: string, body: Uint8Array): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function writeJsonAtomic(file: string, value: unknown): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function writeTextAtomic(file: string, body: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import { type BaselineChanges } from '../contracts/functions/baselineChanges.js';
2
+ export type { BaselineChange, BaselineChanges } from '../contracts/functions/baselineChanges.js';
3
+ export declare function getBaselineChanges(root: string, ref: string): Promise<BaselineChanges>;
4
+ export declare function reviewChanges(root: string, ref: string, expected: string, ids: string[], reviewed?: boolean): Promise<{
5
+ reviewed: string[];
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import { type Config } from '../contracts/config.js';
2
+ export { ConfigSchema, NamespaceSchema } from '../contracts/config.js';
3
+ export type { Config } from '../contracts/config.js';
4
+ export declare const CONFIG_NAME = "evidra.config.json";
5
+ export declare function namespaceId(value: unknown): asserts value is string;
6
+ export declare function parseConfig(config: unknown): Config;
@@ -0,0 +1 @@
1
+ export declare function coreErrorStatus(error: unknown): number;