@i18nprune/core 0.1.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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +165 -0
  3. package/dist/adapters-gp1lXp0T.d.ts +12 -0
  4. package/dist/capabilities-x74cD2Hu.d.ts +48 -0
  5. package/dist/cleanup.d.ts +64 -0
  6. package/dist/cleanup.js +3999 -0
  7. package/dist/config.d.ts +201 -0
  8. package/dist/config.js +2865 -0
  9. package/dist/coreContext-DMaWLvmB.d.ts +388 -0
  10. package/dist/fs-BUYD8ZhA.d.ts +20 -0
  11. package/dist/generate.d.ts +487 -0
  12. package/dist/generate.js +9389 -0
  13. package/dist/humanEmit-ygNlYX-S.d.ts +79 -0
  14. package/dist/index-BQuLEQ9b.d.ts +7 -0
  15. package/dist/index-B_ow_Xvr.d.ts +97 -0
  16. package/dist/index-BgG01AKL.d.ts +287 -0
  17. package/dist/index-CIzZl4W8.d.ts +124 -0
  18. package/dist/index-Csm1w7XD.d.ts +58 -0
  19. package/dist/index-DLwTogCo.d.ts +43 -0
  20. package/dist/index-DVT26v11.d.ts +61 -0
  21. package/dist/index-DdjljwMj.d.ts +39 -0
  22. package/dist/index-DeIw-cZd.d.ts +52 -0
  23. package/dist/index-X50E1FIX.d.ts +50 -0
  24. package/dist/index.d.ts +9180 -0
  25. package/dist/index.js +21888 -0
  26. package/dist/init.d.ts +86 -0
  27. package/dist/init.js +848 -0
  28. package/dist/listWindow-XEFxQZi1.d.ts +30 -0
  29. package/dist/localeTargetCodes-BBIQjauw.d.ts +11 -0
  30. package/dist/locales.d.ts +39 -0
  31. package/dist/locales.js +2288 -0
  32. package/dist/missing-BVCvgUC8.d.ts +10 -0
  33. package/dist/missing.d.ts +85 -0
  34. package/dist/missing.js +5892 -0
  35. package/dist/modeResolve-cGVaY5Hh.d.ts +25 -0
  36. package/dist/path-Bfn3SAts.d.ts +11 -0
  37. package/dist/profile-BwOP9WKh.d.ts +9 -0
  38. package/dist/providers-0uMEfT6q.d.ts +82 -0
  39. package/dist/prune-c6hKZCv_.d.ts +33 -0
  40. package/dist/quality.d.ts +36 -0
  41. package/dist/quality.js +3868 -0
  42. package/dist/report-D5-6bVFj.d.ts +8 -0
  43. package/dist/report-schema.d.ts +102 -0
  44. package/dist/report-schema.js +42 -0
  45. package/dist/resumeCandidates-xR13eEwt.d.ts +200 -0
  46. package/dist/root-2-kCaBvQ.d.ts +1110 -0
  47. package/dist/runtime/edge.d.ts +21 -0
  48. package/dist/runtime/edge.js +87 -0
  49. package/dist/runtime/helpers/sync.d.ts +16 -0
  50. package/dist/runtime/helpers/sync.js +117 -0
  51. package/dist/runtime/node.d.ts +24 -0
  52. package/dist/runtime/node.js +204 -0
  53. package/dist/runtime/web.d.ts +21 -0
  54. package/dist/runtime/web.js +84 -0
  55. package/dist/shared.d.ts +1177 -0
  56. package/dist/shared.js +4897 -0
  57. package/dist/sourceContext-1LQg3HiQ.d.ts +36 -0
  58. package/dist/sourceSurface-mDtwGo1E.d.ts +122 -0
  59. package/dist/sync.d.ts +86 -0
  60. package/dist/sync.js +4971 -0
  61. package/dist/syncSegment-Bx6He2Mu.d.ts +149 -0
  62. package/dist/targets-EmtKyr6F.d.ts +23 -0
  63. package/dist/template-CGM-_WLT.d.ts +139 -0
  64. package/dist/translate-CIHYp7wi.d.ts +77 -0
  65. package/dist/types/shared.d.ts +21 -0
  66. package/dist/types/shared.js +1 -0
  67. package/dist/types.d.ts +1345 -0
  68. package/dist/types.js +1 -0
  69. package/dist/validate.d.ts +126 -0
  70. package/dist/validate.js +3717 -0
  71. package/package.json +128 -0
@@ -0,0 +1,1345 @@
1
+ import { D as DynamicKeySite } from './index-DdjljwMj.js';
2
+ export { a as DynamicKeySiteKind } from './index-DdjljwMj.js';
3
+ import { K as KeyObservation, C as ConstSubstitutionStep } from './index-Csm1w7XD.js';
4
+ export { D as DynamicKeyRef, L as LiteralKeyObservation, S as SourceSpan, T as TemplatePartialKeyObservation, a as TemplateResolvedKeyObservation } from './index-Csm1w7XD.js';
5
+ import { P as ProjectLiteralKeyUsage } from './sourceSurface-mDtwGo1E.js';
6
+ export { a as CleanupHostHooks, e as CleanupJsonOutput, f as CleanupJsonRunSummary, b as CleanupRunOptions, c as CleanupRunResult, g as CleanupSegmentWrite, d as CleanupSourceSegmentRef, C as CleanupWritePlan } from './sourceSurface-mDtwGo1E.js';
7
+ import { d as CacheRebuildMode, e as CacheProjectFileRecord, f as CachedLocalesLayout, g as CacheRebuildConfig, h as ListSourceFilesOptions, i as CacheDispatchInfo, R as ResolvedLocalesLayout, j as CacheDispatchStatus, C as CoreContext } from './coreContext-DMaWLvmB.js';
8
+ export { A as AnalysisRebuildDecision, k as AnalysisRebuildReason, l as AnalysisRebuildStrategy, m as CacheDisableReason, n as CacheDispatchPaths, o as CacheDispatchReason, p as CacheDispatchResult, q as CacheFileDelta, r as CacheHashText, s as CacheInputFilesEpochDebug, t as CacheProducerContext, u as CacheProjectFilesState, v as CacheProjectRunState, w as CacheProjectsIndex, x as CacheRuntime, y as CacheState, z as CacheStateInput, b as CacheWarning, B as CachedProjectInput, D as ClassifiedCacheFileDelta, E as ClassifiedSrcDelta, c as CoreResolvedPaths, F as FilesIndexStatus, G as LocaleCodeReadSnapshot, H as LocaleReadCache, L as LocaleReadDiagnostic, I as LocaleReadDiagnosticLevel, J as LocaleSegmentReadSnapshot, K as LocalesLayoutMode, M as LocalesLayoutStructure, N as RunOptions, S as ScanDebugEvent, O as ScanDebugSkipDirectoryEvent, P as ScanDebugSkipFileEvent, T as TranslationSurfaceLeaf, Q as TranslationSurfaceShape, U as filesIndexIsUsable } from './coreContext-DMaWLvmB.js';
9
+ import { R as RunEmitter, O as OperationId, b as ShareProjectManifest, c as ShareReportManifest, d as ShareKind, e as ShareCacheEntry, f as ShareManifest, g as ShareLinks, h as ShareJsonFile, i as ShareJsonHealReport } from './index-BgG01AKL.js';
10
+ export { C as CleanupCounts, D as DoctorCounts, G as GenerateCounts, j as GeneratePhase, k as GenerateProgressEvent, L as LoadShareJsonResult, l as LocalesDynamicCounts, M as MissingCounts, P as ProgressEvent, Q as QualityCounts, m as ReportCounts, n as ReviewCounts, o as RunCompletedEvent, p as RunCountsByOperation, q as RunErrorEvent, a as RunEvent, r as RunEventBase, s as RunFailedEvent, t as RunMessageChannel, u as RunMessageEvent, v as RunMessageLevel, w as RunShareLinksEvent, x as RunShareManifestEvent, y as RunShareSkippedEvent, z as RunShareUploadedEvent, A as RunStartedEvent, B as RunSummaryEvent, E as RunWarningEvent, F as ShareCounts, H as ShareJsonHealKind, I as SyncCounts, J as SyncPhase, S as SyncProgressEvent, V as ValidateCounts, K as ValidatePhase, N as ValidateProgressEvent, W as WorkerShareEnvelope } from './index-BgG01AKL.js';
11
+ import { I as Issue } from './index-X50E1FIX.js';
12
+ export { C as CliJsonEnvelope, E as ErrResult, a as IssueSeverity, O as OkResult, R as Result, b as ResultMeta } from './index-X50E1FIX.js';
13
+ import { H as HOSTED_PROJECT_SNAPSHOT_SCHEMA_VERSION } from './syncSegment-Bx6He2Mu.js';
14
+ export { C as CliErrorCode, L as ListLocaleCodesResult, a as ListLocaleSegmentsResult, b as LocaleLeafProjection, c as LocaleSegmentRef, d as LocaleSegmentTarget, e as LocaleSegmentWritePlan, f as LocaleSegmentWriteRole, g as LocaleSegmentWriteTarget, M as MaskedText, N as NormalizedCliError, P as PathSegment, R as ReadFlatLocaleJsonSurfaceResult, h as ReadLocaleBundleResult, i as ResolveLocaleSegmentTargetsInput, S as SourceScanResult, j as SyncLangSelection, k as SyncSegmentSourcePlan, W as WalkedJsonSegment, l as WriteFlatLocaleJsonDocumentResult } from './syncSegment-Bx6He2Mu.js';
15
+ import { C as CoreEngineRuntime } from './capabilities-x74cD2Hu.js';
16
+ export { b as ConfigPathSystemRuntime, P as ProjectFilesystemRuntime, c as RuntimeFsCap, R as RuntimeNetworkCap, d as RuntimeNetworkPort, e as RuntimePathCap, f as RuntimeSystemCap, a as RuntimeSystemPort } from './capabilities-x74cD2Hu.js';
17
+ import { R as RuntimePathPort } from './path-Bfn3SAts.js';
18
+ import { T as TranslatePolicy, H as TranslatePolicyVerb, G as ScanExcludeConfig, J as PatchingCommandName, K as PatchingAction, N as PatchingLocaleRecord, Q as PatchingConfigInput, V as PatchingRuntimePorts } from './root-2-kCaBvQ.js';
19
+ export { E as EffectiveReferenceConfig, W as KeyReferenceContext, X as LocaleConfigMismatch, Y as LocaleDirection, c as LocaleLeafPathApi, F as LocaleSegmentSource, Z as OnAuthFailureVerb, _ as OnIdentityOutputVerb, $ as OnIncompleteRunVerb, a0 as OnProviderUnavailableVerb, a1 as OnQuotaExceededVerb, a2 as OnRateLimitVerb, a3 as OnTransientFailureVerb, P as ParityPolicy, a4 as PatchingAnalyzeOutput, a5 as PatchingDiagnostic, a6 as PatchingFileEdit, a7 as PatchingLocaleImportSpec, a8 as PatchingMode, a9 as PatchingPlan, aa as PatchingRecipeId, ab as PatchingResult, ac as PatchingSkipReason, a as PreservePolicy, g as ReferenceCommandOverrides, m as ReferenceCommands, n as ReferenceConfig, ad as ReferenceConfigSource, o as ReferenceDefaults, ae as RepairPatchingConfigLocalesResult, af as ResolvePatchingLocalesResult, R as ResolveScannerConfigOptions, ag as ResolvedPatchingConfig, ah as ScanExcludePreset, ai as ScanExcludeRule, d as ScannerConfigInput, e as ScannerConfigResolved, aj as ScannerExecutionMode, S as StringPresencePolicy, ak as TRANSLATE_POLICY_DEFAULTS, al as TranslateHandoffMode, am as TranslateRoutingMode, U as UncertainKeyPolicy } from './root-2-kCaBvQ.js';
20
+ import { c as TranslateFailureOutcome, P as ProviderAttemptOutcome, d as TranslateRunPartialStats, b as TranslationTickProgressFn } from './resumeCandidates-xR13eEwt.js';
21
+ export { B as BuildTranslateCacheKeyForLocaleFileInput, g as BuildTranslateCacheKeyInput, f as GenerateResumeCandidateLeafInput, G as GenerateResumeRefContext, e as GenerateTranslateCache, h as GenerateTranslateCacheBase, i as HandoffCatalogBuildResult, H as HandoffEligibilityRow, j as IdentitySample, k as IdentityStreakConfirmFn, l as IdentityStreakConfirmInput, I as IdentityStreakGuard, m as IdentityStreakGuardOptions, n as IdentityStreakInteractive, o as IdentityStreakState, O as OpenTranslateCacheL2Options, p as TranslateCacheHitLayer, q as TranslateCacheL1Port, r as TranslateCacheL2Port, T as TranslateContext, s as TranslateLeafWithL1Result, t as TranslationCacheEntry, u as TranslationLocaleCacheFile } from './resumeCandidates-xR13eEwt.js';
22
+ export { B as BuildInitConfigTemplateOptions, I as InitConfigFormat, j as InitDetectResult, d as InitFilesystemHost, l as InitJsonPayload, f as InitLocaleLayoutHint, c as InitPackageJsonSignals, k as InitPresetConfigFields, h as InitPresetId, g as InitPresetScore, i as InitProjectSignals, a as InitRunOptions, b as InitRunResult, m as InitScoreFactor, e as InitTopologySignals, R as RunInitHostInput } from './template-CGM-_WLT.js';
23
+ export { S as StringLeaf } from './index-BQuLEQ9b.js';
24
+ import { a as TranslationLeafMeta } from './index-B_ow_Xvr.js';
25
+ export { A as ApplyLocaleMetadataModeInput, H as HeuristicLeafMetaInput, L as LeafDecision, R as ResolveLocaleLeafModeInput, d as TranslateRequest, b as TranslateTargetLanguage, e as TranslationLeafMetaPatch, f as TranslationProviderYield, T as TranslationResult, c as Translator, g as TranslatorRetryOptions } from './index-B_ow_Xvr.js';
26
+ export { b as LocaleLeafDecisionAction, a as LocaleLeafMode, c as LocaleLeafRuntimeKind, d as LocaleMetadataLeafDecision, e as LocaleMetadataPathChange, f as LocaleMetadataRepairReason, L as LocaleMetadataReport, S as StructuredLocaleLeaf } from './index-DLwTogCo.js';
27
+ import { L as LocaleListRow } from './sourceContext-1LQg3HiQ.js';
28
+ export { A as AssertGenerateTargetCodesInput, R as ResolveResumeTargetCodesFromRawInput, S as SourceLocaleContext } from './sourceContext-1LQg3HiQ.js';
29
+ export { R as ResolveLocaleTargetCodesInput } from './localeTargetCodes-BBIQjauw.js';
30
+ export { M as MissingHostHooks, g as MissingJsonOutput, h as MissingJsonTarget, a as MissingPlaceholderLeaf, i as MissingPlaceholderLeafList, c as MissingRunOptions, d as MissingRunResult, f as MissingSegmentWrite, j as MissingSkippedTarget, k as MissingTargetKind, b as MissingTargetPlan, l as MissingTargetState, e as MissingWriteInput, R as ResolveMissingPathsPlanInput } from './index-CIzZl4W8.js';
31
+ export { C as ComputeEnglishIdenticalCountsInput, Q as QualityFileLine, c as QualityHostHooks, a as QualityJsonData, b as QualityRunOptions, d as QualityRunResult } from './index-DVT26v11.js';
32
+ export { CompiledScanExclude } from './types/shared.js';
33
+ export { d as SyncFileLine, S as SyncHostHooks, c as SyncHumanLeafSummary, e as SyncJsonOutput, f as SyncLocaleDisplayGroup, b as SyncRunOptions, a as SyncRunResult } from './humanEmit-ygNlYX-S.js';
34
+ import { C as CacheProfileId } from './profile-BwOP9WKh.js';
35
+ export { a as CacheProfileDefaults } from './profile-BwOP9WKh.js';
36
+ import { T as TranslationProviderId } from './providers-0uMEfT6q.js';
37
+ export { D as DeeplResolvedTranslationOptions, G as GoogleResolvedTranslationOptions, L as LibreResolvedTranslationOptions, a as LlmResolvedTranslationOptions, M as MymemoryResolvedTranslationOptions, R as ResolvedTranslationProviderOptions, b as TranslationClientHints, c as TranslationProviderDescriptor, d as TranslationProviderEnvVar, e as TranslationProviderKind } from './providers-0uMEfT6q.js';
38
+ export { P as ProviderRateLimitProfile, g as ProviderRateLimitRegistry, a as TranslateStartRateLimit } from './translate-CIHYp7wi.js';
39
+ export { R as RuntimeAdapters, a as RuntimeKind } from './adapters-gp1lXp0T.js';
40
+ export { a as RuntimeDirEntry, c as RuntimeFsPathKind, R as RuntimeFsPort, b as RuntimeReadFsPort } from './fs-BUYD8ZhA.js';
41
+ import 'zod';
42
+ import './index-DeIw-cZd.js';
43
+
44
+ /**
45
+ * Outcome class accepted by {@link ProviderHealthMonitor.onAttemptResult}. Extends the failure
46
+ * taxonomy with `'success'`, which resets the consecutive-backoff counter for that provider.
47
+ */
48
+ type ProviderHealthOutcome = 'success' | TranslateFailureOutcome;
49
+ /**
50
+ * One attempt's worth of evidence the resolver feeds into the monitor.
51
+ *
52
+ * @remarks
53
+ * The monitor does not interpret which outcomes "deserve" a backoff. Callers (the policy
54
+ * resolver in step 5) decide which attempts to report — typically only when the resolved
55
+ * verb is `'backoff'`. Reporting an attempt always advances the counter (unless `outcome`
56
+ * is `'success'`) and may extend the no-start-before deadline if a hint is supplied or the
57
+ * exponential fallback applies.
58
+ */
59
+ type ProviderAttemptObservation = {
60
+ readonly providerId: string;
61
+ readonly outcome: ProviderHealthOutcome;
62
+ /**
63
+ * Optional `Retry-After`-derived hint. When present and positive, extends the
64
+ * "no-start-before" deadline by `retryAfterMs`. The exponential fallback is skipped
65
+ * for this attempt — host hint always wins.
66
+ */
67
+ readonly hint?: {
68
+ readonly retryAfterMs?: number;
69
+ };
70
+ };
71
+ /**
72
+ * Per-provider start-gate health state. The interface is the **load-bearing primitive** of
73
+ * step 3 in `translate-policy (shipped)`; the start-rate gate consults
74
+ * {@link ProviderHealthMonitor.shouldDelayStartFor} on top of `rpm` / `rps` / `intervalMs`
75
+ * pacing, and the policy resolver consults {@link ProviderHealthMonitor.shouldEscalate}
76
+ * to upgrade `backoff` → `fallback` after consecutive backoffs exhaust.
77
+ */
78
+ interface ProviderHealthMonitor {
79
+ /** Record one attempt for `providerId`. */
80
+ onAttemptResult(input: ProviderAttemptObservation): void;
81
+ /** Extra delay (ms) the start gate should add before launching a job for this provider. `0` if healthy. */
82
+ shouldDelayStartFor(providerId: string): number;
83
+ /** Consecutive non-success outcomes recorded since the last `'success'` (or process start). */
84
+ consecutiveBackoffsFor(providerId: string): number;
85
+ /** True when this provider's consecutive-backoff count is at or above the resolver's threshold. */
86
+ shouldEscalate(providerId: string, policy: {
87
+ readonly maxBackoffsBeforeEscalate: number;
88
+ }): boolean;
89
+ }
90
+
91
+ type TranslatePolicyAction = {
92
+ readonly verb: TranslatePolicyVerb;
93
+ readonly escalatedFrom?: TranslatePolicyVerb;
94
+ readonly reason: string;
95
+ };
96
+ type ResolveProviderActionInput = {
97
+ readonly outcome: TranslateFailureOutcome;
98
+ readonly policy: TranslatePolicy;
99
+ readonly health: ProviderHealthMonitor;
100
+ readonly providerId: string;
101
+ readonly escalationThreshold?: number;
102
+ readonly hint?: {
103
+ readonly retryAfterMs?: number;
104
+ };
105
+ };
106
+
107
+ /**
108
+ * Per-leaf input keyed by an arbitrary stable identifier. The translator preserves order; the
109
+ * **`key`** is echoed back in **`TranslateResultItem.key`** so callers can re-zip with their source.
110
+ */
111
+ type TranslateLeafInput = {
112
+ readonly key: string;
113
+ readonly source: string;
114
+ };
115
+ /**
116
+ * Outcome of a single provider attempt within the translator's per-provider chain. Aggregated into
117
+ * **`TranslateOutput.providerAttempts`** so callers can render attempt history (CLI summary, SDK logs)
118
+ * without re-deriving it.
119
+ */
120
+ type ProviderAttemptReport = {
121
+ readonly providerId: TranslationProviderId;
122
+ readonly outcome: ProviderAttemptOutcome;
123
+ /** Provider error message (when **`outcome !== 'success'`**); not always set on early failures. */
124
+ readonly errorMessage?: string;
125
+ /** Per-attempt stats (request attempts, retries, success/failure counts). */
126
+ readonly stats?: TranslateRunPartialStats;
127
+ /** Wall-clock duration of this attempt in milliseconds. */
128
+ readonly durationMs?: number;
129
+ };
130
+ /** Per-leaf result preserving input order; **`key`** present when input used **`leaves`**. */
131
+ type TranslateResultItem = {
132
+ readonly ok: true;
133
+ readonly key?: string;
134
+ readonly value: string;
135
+ readonly providerId: TranslationProviderId;
136
+ readonly leafMeta?: TranslationLeafMeta;
137
+ } | {
138
+ readonly ok: false;
139
+ readonly key?: string;
140
+ readonly reason: 'identity' | 'failed' | 'skipped';
141
+ readonly sourceValue: string;
142
+ };
143
+ /**
144
+ * Hooks let hosts observe the translator without owning orchestration. **`onTick`** drives a UI
145
+ * progress bar; **`onProviderAttempt`** records each attempt for an envelope; **`onTranslatedLeaf`**
146
+ * fires per leaf so the host can drive identity-streak prompts or write-through caches.
147
+ */
148
+ type TranslateHooks = {
149
+ readonly onTick?: TranslationTickProgressFn;
150
+ readonly onProviderAttempt?: (attempt: ProviderAttemptReport) => void;
151
+ readonly onTranslatedLeaf?: (sourceText: string, translatedText: string, key: string | number) => void | Promise<void>;
152
+ };
153
+ /**
154
+ * Identity-streak guard wiring. Disabled by default; when **`enabled: true`** the translator wires the
155
+ * core **`createIdentityStreakGuard`** with the supplied threshold and surfaces accumulated streak
156
+ * issues on **`TranslateOutput.issues`**. Hosts that need an interactive confirm prompt should keep
157
+ * owning the guard themselves and pass results in via **`hooks.onTranslatedLeaf`**.
158
+ */
159
+ type TranslateIdentityGuardOptions = {
160
+ readonly enabled?: boolean;
161
+ readonly threshold?: number;
162
+ };
163
+ /**
164
+ * Per-call options for **`runTranslate`**. The translator owns no project state — config / adapters /
165
+ * env are bundled in **`TranslateContext`** (the first argument). Use **`texts`** for plain string
166
+ * lists or **`leaves`** for keyed pairs; the output preserves input order.
167
+ */
168
+ type TranslateOptions = {
169
+ /** Plain strings to translate; mutually exclusive with **`leaves`**. */
170
+ readonly texts?: readonly string[];
171
+ /** Keyed leaves; mutually exclusive with **`texts`**. */
172
+ readonly leaves?: readonly TranslateLeafInput[];
173
+ readonly targetLang: string;
174
+ readonly sourceLang?: string;
175
+ /** Pin a provider id (CLI **`--provider`**) and/or a **`workers`** override for this run. */
176
+ readonly pin?: {
177
+ providerId?: TranslationProviderId;
178
+ workers?: number;
179
+ };
180
+ readonly hooks?: TranslateHooks;
181
+ readonly identityGuard?: TranslateIdentityGuardOptions;
182
+ };
183
+ /**
184
+ * Result of **`runTranslate`** — translations preserve input order; **`providerAttempts`** records
185
+ * the attempted chain (success ends the chain, retryable failures advance it, non-retryable failures
186
+ * end the run); **`warnings`** is forwarded from **`resolveTranslateConfig`** so hosts can display
187
+ * default-applied notes.
188
+ */
189
+ type TranslateOutput = {
190
+ readonly translations: ReadonlyArray<TranslateResultItem>;
191
+ readonly providerAttempts: ReadonlyArray<ProviderAttemptReport>;
192
+ readonly winnerProviderId: TranslationProviderId | null;
193
+ readonly fallbackCount: number;
194
+ readonly translateStats: TranslateRunPartialStats;
195
+ readonly issues: ReadonlyArray<Issue>;
196
+ readonly warnings: ReadonlyArray<Issue>;
197
+ };
198
+
199
+ /** Raw `cache` block from config (file, init template, or host flag layer). */
200
+ type CacheConfigSource = {
201
+ enabled?: boolean;
202
+ dir?: string;
203
+ profile?: CacheProfileId;
204
+ mode?: 'readWrite' | 'readOnly';
205
+ rebuild?: CacheRebuildMode;
206
+ fullRescanThresholdPercent?: number;
207
+ };
208
+ /** Fully resolved cache policy after profile expansion and overrides. */
209
+ type ResolvedCacheConfig = {
210
+ enabled: boolean;
211
+ profile: CacheProfileId;
212
+ mode: 'readWrite' | 'readOnly';
213
+ rebuild: CacheRebuildMode;
214
+ fullRescanThresholdPercent: number;
215
+ dir?: string;
216
+ };
217
+
218
+ /** Current tracked src + locale segment maps and layout fingerprint for one scan. */
219
+ type TrackedProjectFilesCurrent = {
220
+ files: Record<string, CacheProjectFileRecord>;
221
+ localeSegments: Record<string, CacheProjectFileRecord>;
222
+ localesLayout: CachedLocalesLayout;
223
+ merged: Record<string, CacheProjectFileRecord>;
224
+ };
225
+
226
+ type AnalysisCacheInvalidationAction = 'delete' | 'skip';
227
+ type AnalysisCacheInvalidationReason = 'cache_disabled' | 'no_locale_writes' | 'config_rebuild_full' | 'target_locale_writes_only' | 'locale_writes_dispatch_handles';
228
+ type AnalysisCacheInvalidationDecision = {
229
+ action: AnalysisCacheInvalidationAction;
230
+ reason: AnalysisCacheInvalidationReason;
231
+ };
232
+ type LocaleWriteInvalidationInput = {
233
+ enabled: boolean;
234
+ rebuildConfig: CacheRebuildConfig;
235
+ sourceLocaleSegmentKey: string;
236
+ mutatedLocaleSegmentKeys: readonly string[];
237
+ };
238
+
239
+ type ScanProjectFileInput = {
240
+ filePath: string;
241
+ displayPath: string;
242
+ text: string;
243
+ };
244
+ type ScanProjectSourceFilesInput<T> = {
245
+ srcRoot: string;
246
+ /** Optional scan exclusions (dirs while walking, files, extensions, path patterns). */
247
+ exclude?: ScanExcludeConfig;
248
+ /** Optional scan debug sink (same contract as {@link listSourceFiles} fourth argument). */
249
+ scanDebug?: ListSourceFilesOptions['onScanDebug'];
250
+ cwd?: string;
251
+ /**
252
+ * When `readFile` / `listFiles` are omitted, **`runtime`** supplies defaults (host `fs` + `path` + `system.cwd()`).
253
+ * Type is {@link CoreEngineRuntime} (includes `system`), not only {@link ProjectFilesystemRuntime}.
254
+ * When both **`readFile`** and **`listFiles`** are set, also pass **`path`** (or **`runtime`**) so display paths can use `path.relative`.
255
+ */
256
+ runtime?: CoreEngineRuntime;
257
+ /** Used for `relative` when injecting `readFile`/`listFiles` without a full `runtime`. */
258
+ path?: RuntimePathPort;
259
+ readFile?: (filePath: string) => string;
260
+ listFiles?: (srcRoot: string) => string[];
261
+ scanFile: (input: ScanProjectFileInput) => readonly T[];
262
+ };
263
+
264
+ /**
265
+ * Shared filesystem + override fields for project-wide scans (key sites, dynamic sites, literal usage).
266
+ * Keeps orchestration `Pick<>` types aligned.
267
+ */
268
+ type ScanProjectFilesystemInputBase = Pick<ScanProjectSourceFilesInput<unknown>, 'srcRoot' | 'cwd' | 'runtime' | 'path' | 'readFile' | 'listFiles' | 'exclude'>;
269
+
270
+ type ScanProjectDynamicKeySitesInput = ScanProjectFilesystemInputBase & {
271
+ functions: string[];
272
+ };
273
+
274
+ type DynamicRunOptions = {
275
+ top?: number;
276
+ full?: boolean;
277
+ };
278
+ type DynamicHostHooks = {
279
+ emit?: RunEmitter;
280
+ runId?: string;
281
+ };
282
+ type DynamicJsonPayload = {
283
+ kind: 'locales-dynamic';
284
+ sourceLocalePath: string;
285
+ sourceLocaleCode: string;
286
+ top: number | null;
287
+ full: boolean;
288
+ shown: number;
289
+ dynamic: {
290
+ count: number;
291
+ sites: DynamicKeySite[];
292
+ };
293
+ };
294
+ type DynamicRunResult = {
295
+ payload: DynamicJsonPayload;
296
+ issues: Issue[];
297
+ allSites: DynamicKeySite[];
298
+ };
299
+
300
+ type ListJsonPayload = {
301
+ kind: 'locales-list';
302
+ sourceLocaleCode: string;
303
+ sourceLocalePath: string;
304
+ localesDir: string;
305
+ localeCount: number;
306
+ targetLocaleCount: number;
307
+ rows: LocaleListRow[];
308
+ };
309
+ type ListRunResult = {
310
+ payload: ListJsonPayload;
311
+ issues: Issue[];
312
+ };
313
+
314
+ type DeleteTargetResult = {
315
+ target: string;
316
+ /** Segment paths removed for this locale code (e.g. `app/ar.json`). */
317
+ deletedSegmentRelativePaths: string[];
318
+ deletedJsonCount: number;
319
+ };
320
+ type DeleteJsonPayload = {
321
+ kind: 'locales-delete';
322
+ targets: string[];
323
+ /** JSON segment files removed on disk. */
324
+ deletedJson: number;
325
+ /** Distinct locale codes that had at least one segment file removed. */
326
+ deletedLocaleCount: number;
327
+ aborted: boolean;
328
+ supportsAutoPatching: false;
329
+ };
330
+ type DeleteRunResult = {
331
+ payload: DeleteJsonPayload;
332
+ issues: Issue[];
333
+ deletedTargets: DeleteTargetResult[];
334
+ };
335
+
336
+ type ScanKeyObservationsOptions = {
337
+ /** When set, skip calls whose start offset lies inside these comment ranges (line/block). */
338
+ commentRanges?: Array<{
339
+ start: number;
340
+ end: number;
341
+ }>;
342
+ };
343
+
344
+ type ScanProjectKeyObservationsInput = ScanProjectFilesystemInputBase & {
345
+ functions: string[];
346
+ };
347
+
348
+ type ScanProjectLiteralKeyUsageInput = ScanProjectFilesystemInputBase & {
349
+ functions: string[];
350
+ };
351
+
352
+ type ProjectAnalysisCounts = {
353
+ keyObservations: number;
354
+ dynamicSites: number;
355
+ sourceFilesScanned: number;
356
+ missingKeys: number;
357
+ };
358
+ /** On-disk `analysis.json` payload (`data` field of the run envelope). */
359
+ type ProjectAnalysisCacheData = {
360
+ version: 1;
361
+ keyObservations: KeyObservation[];
362
+ dynamicSites: DynamicKeySite[];
363
+ missingKeys: string[];
364
+ counts: ProjectAnalysisCounts;
365
+ };
366
+ type ProjectAnalysis = ProjectAnalysisCacheData & {
367
+ usage: ProjectLiteralKeyUsage;
368
+ cache?: CacheDispatchInfo;
369
+ };
370
+ type ProjectAnalysisResolveOptions = {
371
+ emit?: RunEmitter;
372
+ op?: OperationId;
373
+ runId?: string;
374
+ };
375
+
376
+ /** Stable identifiers for the built-in doctor checks. */
377
+ type DoctorCheckId = 'runtime' | 'tools' | 'config' | 'paths';
378
+ /** Single finding produced by a doctor check. */
379
+ type DoctorFinding = {
380
+ id: DoctorCheckId;
381
+ ok: boolean;
382
+ severity: 'ok' | 'warn' | 'error';
383
+ title: string;
384
+ detail?: string;
385
+ };
386
+
387
+ /** Per-call options for `runDoctor`. */
388
+ type DoctorRunOptions = {
389
+ /** Comma-separated list of check IDs to run (e.g. `"runtime,paths"`). Omit to run all. */
390
+ only?: string;
391
+ /** When true, warnings are treated as errors for exit-code purposes. */
392
+ strict?: boolean;
393
+ };
394
+ /**
395
+ * Host-supplied environment facts that core cannot discover on its own.
396
+ *
397
+ * @remarks Doctor checks are pure — core never calls `process.*` or probes the filesystem
398
+ * directly. The host (CLI, SDK consumer, test harness) reads the real environment and
399
+ * passes the facts here.
400
+ */
401
+ type DoctorHostHooks = {
402
+ emit?: RunEmitter;
403
+ runId?: string;
404
+ /** `process.version` string (e.g. `"v20.18.2"`). */
405
+ nodeVersion: string;
406
+ /** Whether `rg` (ripgrep) is available on `$PATH`. */
407
+ rgAvailable: boolean;
408
+ /** Whether an `i18nprune.config.*` file was found. */
409
+ hasConfigFile: boolean;
410
+ /** Display label for the resolved config file path (or `null` when no file). */
411
+ configPathLabel: string | null;
412
+ };
413
+ /** Result returned by `runDoctor`. */
414
+ type DoctorRunResult = {
415
+ payload: DoctorJsonPayload;
416
+ issues: Issue[];
417
+ exitCode: number;
418
+ };
419
+ /** JSON `data` shape for the `doctor` envelope. */
420
+ type DoctorJsonPayload = {
421
+ kind: 'doctor';
422
+ findings: DoctorFinding[];
423
+ strict: boolean;
424
+ };
425
+
426
+ type TranslationCallSite = {
427
+ functionName: string;
428
+ matchIndex: number;
429
+ openParenIndex: number;
430
+ closeParenIndex: number;
431
+ firstArgStart: number;
432
+ firstArgEnd: number;
433
+ firstArgRaw: string;
434
+ isEmptyCall: boolean;
435
+ isMultilineCall: boolean;
436
+ };
437
+
438
+ /** Result of resolving `${IDENT}` placeholders in a template fragment. */
439
+ type ResolveKeyPlaceholdersTraceResult = {
440
+ /** Fully resolved dotted key, or `null` if a placeholder could not be substituted. */
441
+ resolved: string | null;
442
+ /** Ordered substitutions applied from `constMap`. */
443
+ substitutions: ConstSubstitutionStep[];
444
+ /** Fragment after the last successful step, if resolution failed mid-way. */
445
+ remainder: string;
446
+ };
447
+
448
+ /**
449
+ * Where a binding came from syntactically (regex scan — no AST).
450
+ *
451
+ * @remarks Arbitrary variable propagation (e.g. `const x = getI18n()`) is intentionally out of scope.
452
+ */
453
+ type ImportBindingSource = 'esm' | 'cjs_require' | 'dynamic_import' | 'ts_import_equals';
454
+ /**
455
+ * A resolved import-related binding used to expand configured `functions[]`.
456
+ *
457
+ * @remarks Two shapes: **named** (direct calls `t()`, `translate()`) and **module**
458
+ * (member calls `i18n.t()`, `i18n?.t()` after expansion). Regex-based only — string literals
459
+ * and nested generics can false-positive. Bracket calls like `i18n['t']()` are not modeled here;
460
+ * call-site regex would need a separate extension.
461
+ */
462
+ type ImportBinding = {
463
+ kind: 'named';
464
+ /** Exported / property name (`t` in `import { t as translate }`). */
465
+ imported: string;
466
+ /** Local identifier used in the file. */
467
+ local: string;
468
+ source: ImportBindingSource;
469
+ /**
470
+ * When set, runtime call detection must ignore this binding
471
+ * (e.g. `import type { TFunction }`).
472
+ */
473
+ isTypeOnly?: true;
474
+ } | {
475
+ kind: 'module';
476
+ /** Local identifier (`i18n` in `import * as i18n`). */
477
+ local: string;
478
+ moduleKind: 'default' | 'namespace';
479
+ source: ImportBindingSource;
480
+ isTypeOnly?: true;
481
+ };
482
+
483
+ type PatchingRunInput = {
484
+ command: PatchingCommandName;
485
+ action: PatchingAction;
486
+ changedLocaleCodes: string[];
487
+ /** Optional records for upsert operations that need exact metadata rather than catalog defaults. */
488
+ upsertLocaleRecords?: readonly PatchingLocaleRecord[];
489
+ sourceLocaleCode?: string;
490
+ config?: PatchingConfigInput;
491
+ runtime: PatchingRuntimePorts;
492
+ /**
493
+ * Root for resolving relative **`configPath`**, **`loaderPath`**, and **`localeJsonImportBase`** (directory of
494
+ * **`i18nprune.config.*`** in normal CLI runs). Unit tests may omit and resolve **`localeJsonImportBase`**
495
+ * from **`loaderPath`**’s directory instead.
496
+ */
497
+ projectRoot?: string;
498
+ /**
499
+ * When **`true`**, completeness checks behave as if **`--patch`** forced a patching run
500
+ * (e.g. **doctor** with global **`--patch`** even if **`patching.enabled`** is false).
501
+ */
502
+ treatAsPatchRequested?: boolean;
503
+ /** Resolved i18nprune locales layout — enables multi-segment locale discovery and loader imports. */
504
+ localesLayout?: ResolvedLocalesLayout;
505
+ };
506
+
507
+ /** Per-locale aggregates (plain strings + optional structured `{ value, status, … }` leaves). */
508
+ type ReviewLocaleStats = {
509
+ stringPaths: number;
510
+ englishIdentical: number;
511
+ legacyLeaves: number;
512
+ structuredLeaves: number;
513
+ needsReviewTrue: number;
514
+ needsReviewFalse: number;
515
+ needsReviewUnset: number;
516
+ /** Structured `{ value, … }` leaves where `needsReview` is missing, non-boolean, or absent. */
517
+ structuredLeavesMissingNeedsReview: number;
518
+ /** Structured leaves where `confidence` is missing, non-finite, or JSON `null`. */
519
+ structuredLeavesMissingConfidence: number;
520
+ byStatus: Record<string, number>;
521
+ bySource: Record<string, number>;
522
+ confidenceBuckets: {
523
+ none: number;
524
+ low: number;
525
+ mid: number;
526
+ high: number;
527
+ };
528
+ };
529
+ /** Options for the review operation. */
530
+ type ReviewRunOptions = {
531
+ /** Comma-separated locale basenames, or `all` / omit for every non-source file. */
532
+ target?: string;
533
+ };
534
+ /** Payload returned by `runReview`; CLI wraps this in its stable JSON envelope. */
535
+ type ReviewJsonData = {
536
+ kind: 'localeReview';
537
+ sourceLocale: string;
538
+ localesDir: string;
539
+ dynamicKeySites: number;
540
+ locales: Record<string, ReviewLocaleStats>;
541
+ };
542
+ type ReviewHostHooks = {
543
+ emit?: RunEmitter;
544
+ runId?: string;
545
+ /** Max locale blocks in human output (from CLI list window). */
546
+ listLimit?: number;
547
+ };
548
+ type ReviewRunResult = {
549
+ payload: ReviewJsonData;
550
+ issues: Issue[];
551
+ keyObservationsCount: number;
552
+ };
553
+
554
+ type SaveShareJsonResult = {
555
+ warning?: Issue;
556
+ };
557
+ type ShareJsonBackupResult = {
558
+ created: boolean;
559
+ /** Absolute path to the backup file when {@link created} is true. */
560
+ bakPath?: string;
561
+ };
562
+ type ShareCacheDebugLine = {
563
+ level: 'info' | 'detail';
564
+ message: string;
565
+ };
566
+
567
+ /** Host hooks for share human stderr lines (`emit` + optional `runId`). */
568
+ type ShareHumanMessageHost = {
569
+ emit?: RunEmitter;
570
+ runId?: string;
571
+ };
572
+
573
+ /**
574
+ * Environment snapshot captured by the host at report-generation time.
575
+ *
576
+ * Core never probes `process.*` or `os.*` directly — the CLI (or any host)
577
+ * fills this and passes it via {@link ReportHostHooks}.
578
+ *
579
+ * @remarks Fields mirror `ProjectReportEnvironment` from `@i18nprune/core/report-schema`
580
+ * so the document shape stays consistent without a hard type dependency.
581
+ */
582
+ type ReportEnvironmentSnapshot = {
583
+ /** Node.js `process.platform` (e.g. `'linux'`, `'darwin'`, `'win32'`). */
584
+ platform: string;
585
+ /** Node.js `process.arch` (e.g. `'x64'`, `'arm64'`). */
586
+ arch: string;
587
+ /** Node.js version string (e.g. `'v20.12.0'`). */
588
+ nodeVersion: string;
589
+ /** OS kernel release string from `os.release()`. */
590
+ osRelease: string;
591
+ /** Linux distribution name from `/etc/os-release`, if available. */
592
+ distro?: string;
593
+ /** WSL distribution name from `WSL_DISTRO_NAME` env var, if running under WSL. */
594
+ wslDistroName?: string;
595
+ /**
596
+ * Runtime/filesystem compatibility family.
597
+ * `edge-worker` is a synthetic hosted runtime (no local filesystem assumptions).
598
+ */
599
+ runtimeFamily: 'windows' | 'darwin' | 'linux' | 'linux-wsl' | 'edge-worker';
600
+ };
601
+
602
+ /** Machine-facing scalar for transport payloads. */
603
+ type MetadataScalar = string | number | null;
604
+ /** Built-in ingest routes; hosts/SDKs may send other route ids via `processorContext.route`. */
605
+ type KnownIngestRouteKind = 'prepared' | 'archive';
606
+ /** `prepared` | `archive` | `custom` | any SDK-specific route id (e.g. `ci-upload`). */
607
+ type IngestRouteKind = KnownIngestRouteKind | 'custom' | (string & {});
608
+ /** Built-in prepare surfaces; SDKs may set `processorContext.surface` to any stable id. */
609
+ type KnownPayloadProcessorSurface = 'cli' | 'web' | 'worker';
610
+ /** `cli` | `web` | `worker` | `custom` | any SDK label (e.g. `github-action`, `acme-ci`). */
611
+ type PayloadProcessorSurface = KnownPayloadProcessorSurface | 'custom' | (string & {});
612
+ type PayloadProcessorEnvironment = {
613
+ platform: MetadataScalar;
614
+ arch: MetadataScalar;
615
+ nodeVersion: MetadataScalar;
616
+ osRelease: MetadataScalar;
617
+ distro?: MetadataScalar;
618
+ wslDistroName?: MetadataScalar;
619
+ runtimeFamily: MetadataScalar;
620
+ };
621
+ /**
622
+ * Analysis/files cache state at prepare time (host only).
623
+ * Helps interpret sub-second `timing.prepare` when analysis was served from cache.
624
+ */
625
+ type HostPrepareCacheMeta = {
626
+ analysis: CacheDispatchStatus | 'unavailable';
627
+ analysisReason: MetadataScalar;
628
+ /** False when analysis cache hit and prepare ms are not a full rescan (trust extraction counts, not prepare ms). */
629
+ timingsTrustworthy: boolean;
630
+ filesEpoch: MetadataScalar;
631
+ projectCacheEnabled: boolean;
632
+ };
633
+ /** Stable `processor` block on GET metadata — same keys for every surface. */
634
+ type PayloadProcessorInfo = {
635
+ surface: PayloadProcessorSurface;
636
+ surfaceLabel: MetadataScalar;
637
+ route: IngestRouteKind;
638
+ routeLabel: MetadataScalar;
639
+ prepareHost: MetadataScalar;
640
+ toolVersion: MetadataScalar;
641
+ sdk: MetadataScalar;
642
+ /** Semver of `@i18nprune/core` used to prepare the payload. */
643
+ sdkVersion: MetadataScalar;
644
+ prepareSummary: MetadataScalar;
645
+ environment: PayloadProcessorEnvironment | null;
646
+ };
647
+ /** Optional host context on JSON ingest (CLI / web / custom SDK). */
648
+ type HostedIngestProcessorContext = {
649
+ /** Surface id; built-ins: cli | web | worker | custom — any string allowed for SDK hosts. */
650
+ surface?: string;
651
+ /** Display name override (e.g. "Acme CI", "GitHub Action"). */
652
+ surfaceLabel?: string;
653
+ /** Route id; built-ins: prepared | archive | custom. */
654
+ route?: string;
655
+ routeLabel?: string;
656
+ prepareSummary?: string;
657
+ /** SDK package or integration name when not i18nprune CLI/web. */
658
+ sdk?: string;
659
+ /** Semver of `@i18nprune/core` (SDK) used at prepare time. */
660
+ sdkVersion?: string;
661
+ toolVersion?: string;
662
+ environment?: ReportEnvironmentSnapshot;
663
+ };
664
+ type ProjectMetadataPrepareTiming = {
665
+ zipParsedMs: MetadataScalar;
666
+ analysisMs: MetadataScalar;
667
+ extractionMs: MetadataScalar;
668
+ totalMs: MetadataScalar;
669
+ };
670
+ type ProjectMetadataExtractionTiming = {
671
+ startedAt: MetadataScalar;
672
+ computedAt: MetadataScalar;
673
+ durationMs: MetadataScalar;
674
+ };
675
+ type ProjectMetadataEdgeTiming = {
676
+ persistMs: MetadataScalar;
677
+ };
678
+ /** Ordered timing block for `GET /v1/projects/:id` and upload meta. */
679
+ type ProjectMetadataTiming = {
680
+ /** Payload ready to persist (host prepare on prepared route; worker zip parse end on archive). */
681
+ preparedAt: MetadataScalar;
682
+ requestReceivedAt: MetadataScalar;
683
+ storedAt: MetadataScalar;
684
+ lastAccessedAt: MetadataScalar;
685
+ prepare: ProjectMetadataPrepareTiming;
686
+ extraction: ProjectMetadataExtractionTiming;
687
+ edge: ProjectMetadataEdgeTiming;
688
+ };
689
+ type ProjectExtractionCacheMeta = {
690
+ available: boolean;
691
+ analysis: CacheAnalysisState;
692
+ analysisReason: MetadataScalar;
693
+ timingsTrustworthy: boolean;
694
+ filesEpoch: MetadataScalar;
695
+ projectCacheEnabled: boolean;
696
+ };
697
+ type CacheAnalysisState = 'hit' | 'miss' | 'disabled' | 'unavailable' | 'bypassed' | null;
698
+ type ProjectStoredSummary = {
699
+ localeCount: number;
700
+ missingKeysCount: number | null;
701
+ ok: boolean | null;
702
+ };
703
+ type ProjectStoredArtifactMeta = {
704
+ kind: 'project';
705
+ id: string;
706
+ contentHash: string;
707
+ byteSize: number;
708
+ fileCount: number;
709
+ textFileCount: number;
710
+ detectedConfigPath: string | null;
711
+ localeTags: string[];
712
+ };
713
+ type ProjectStoredExecutionMeta = {
714
+ surface: MetadataScalar;
715
+ host: MetadataScalar;
716
+ route: MetadataScalar;
717
+ transport: 'https-json';
718
+ computeLocation: 'edge';
719
+ };
720
+ type ProjectStoredAnalysisMeta = {
721
+ localeTags: string[];
722
+ detectedConfigPath: string | null;
723
+ configHash: MetadataScalar;
724
+ sourceLocalePath: MetadataScalar;
725
+ srcRoot: MetadataScalar;
726
+ localesDir: MetadataScalar;
727
+ keyObservationsCount: number;
728
+ dynamicSitesCount: number;
729
+ };
730
+ type ProjectStoredStorageMeta = {
731
+ backend: 'durable-object';
732
+ dedupByContentHash: true;
733
+ contentAddressed: true;
734
+ };
735
+ type ProjectStoredRetentionMeta = {
736
+ policy: 'idle-7d';
737
+ expiresAt: MetadataScalar;
738
+ lastAccessedAt: MetadataScalar;
739
+ };
740
+ type ProjectStoredCapabilitiesMeta = {
741
+ preparedUploads: true;
742
+ archiveUploads: true;
743
+ readOperations: readonly ['metadata', 'snapshot', 'tree', 'validate', 'review', 'missing', 'locales', 'doctor', 'report'];
744
+ project: true;
745
+ report: false;
746
+ };
747
+ type ReportMetadataDocumentTiming = {
748
+ requestReceivedAt?: MetadataScalar;
749
+ preparedAt: MetadataScalar;
750
+ storedAt: MetadataScalar;
751
+ lastAccessedAt: MetadataScalar;
752
+ prepare?: ProjectMetadataPrepareTiming;
753
+ edge: ProjectMetadataEdgeTiming;
754
+ };
755
+ type ProjectStoredMetadata = {
756
+ /** Metadata envelope contract version. */
757
+ schemaVersion: 1;
758
+ /** Underlying hosted artifact format version. */
759
+ formatVersion: 1;
760
+ artifact: ProjectStoredArtifactMeta;
761
+ timing: ProjectMetadataTiming;
762
+ processor: PayloadProcessorInfo;
763
+ execution: ProjectStoredExecutionMeta;
764
+ analysis: ProjectStoredAnalysisMeta | null;
765
+ summary: ProjectStoredSummary;
766
+ cache: ProjectExtractionCacheMeta;
767
+ storage: ProjectStoredStorageMeta;
768
+ retention: ProjectStoredRetentionMeta;
769
+ capabilities: ProjectStoredCapabilitiesMeta;
770
+ };
771
+
772
+ /**
773
+ * Project zip tree nodes for worker + web runtime (`GET .../tree`, `snapshot.tree`).
774
+ * `path` appears once per node; file fields live under `meta` (no nested duplicate `path`/`kind`).
775
+ */
776
+ type ProjectTreeFileMeta = {
777
+ kind: 'file';
778
+ size: number;
779
+ ext: string;
780
+ mimeGuess: string;
781
+ textLike: boolean;
782
+ };
783
+ type ProjectTreeDirMeta = {
784
+ kind: 'directory';
785
+ };
786
+ type ProjectTreeNode = {
787
+ path: string;
788
+ meta: ProjectTreeFileMeta | ProjectTreeDirMeta;
789
+ children?: ProjectTreeNode[];
790
+ };
791
+
792
+ type ProjectUploadExtractionSummary = {
793
+ configHash: string;
794
+ sourceLocalePath: string;
795
+ srcRoot: string;
796
+ localesDir: string;
797
+ resolvedKeys: string[];
798
+ keyObservationsCount: number;
799
+ dynamicSitesCount: number;
800
+ keyObservationsPreview: unknown[];
801
+ dynamicSitesPreview: unknown[];
802
+ /** ISO timestamp immediately before key/dynamic extraction scan. */
803
+ extractionStartedAt?: string;
804
+ /** ISO timestamp after locale map + previews are assembled. */
805
+ computedAt: string;
806
+ };
807
+ /** Parsed project zip snapshot (worker DO + web local session). */
808
+ type ProjectSnapshot = {
809
+ projectId: string;
810
+ projectHash: string;
811
+ /** ISO timestamp when the worker ingest handler received the request. */
812
+ requestReceivedAt?: string;
813
+ /** ISO timestamp when the payload was fully prepared (host prepare or worker zip parse + extraction). */
814
+ preparedAt: string;
815
+ /** ISO timestamp when the DO row was persisted successfully. */
816
+ storedAt?: string;
817
+ zipBytes: number;
818
+ fileCount: number;
819
+ textFileCount: number;
820
+ detectedConfigPath: string | null;
821
+ detectedConfigRaw: string | null;
822
+ tree: ProjectTreeNode[];
823
+ resolvedConfig: Record<string, unknown> | null;
824
+ sourceLocaleJson: Record<string, unknown> | null;
825
+ localeJsonByTag: Record<string, Record<string, unknown>>;
826
+ /** Locale codes discovered at prepare (flat_file or locale_directory layouts). */
827
+ localeTags?: string[];
828
+ extraction: ProjectUploadExtractionSummary | null;
829
+ };
830
+ type ParsedProjectUpload = {
831
+ snapshot: ProjectSnapshot;
832
+ textFiles: Record<string, string>;
833
+ };
834
+
835
+ /** High-resolution prepare timings (measured where prepare runs on the host). */
836
+ type ProjectPrepareMeta = {
837
+ prepareHost?: string;
838
+ zipParsedMs?: number;
839
+ analysisMs?: number;
840
+ extractionMs?: number;
841
+ totalMs?: number;
842
+ /** Measured DO persist on worker ingest (ms). */
843
+ persistMs?: number;
844
+ /** Host project-cache dispatch at prepare time (CLI/web/SDK). */
845
+ hostCache?: HostPrepareCacheMeta;
846
+ };
847
+ /** Primary worker ingest body: prepared snapshot from core (CLI / web / edge zip mode). */
848
+ type HostedProjectIngestEnvelope = {
849
+ schemaVersion: typeof HOSTED_PROJECT_SNAPSHOT_SCHEMA_VERSION;
850
+ snapshot: ProjectSnapshot;
851
+ prepareMeta?: ProjectPrepareMeta;
852
+ /** Host SDK context (CLI / web); omitted on worker-only archive uploads. */
853
+ processorContext?: HostedIngestProcessorContext;
854
+ /** When true, worker stores payload even if content hash already exists (replaces prior row). */
855
+ force?: boolean;
856
+ };
857
+ type PrepareProjectSnapshotResult = {
858
+ ok: true;
859
+ parsed: ParsedProjectUpload;
860
+ prepareMeta: ProjectPrepareMeta;
861
+ } | {
862
+ ok: false;
863
+ issues: Issue[];
864
+ };
865
+ type PrepareHostKind = 'cli-share' | 'web' | 'worker-archive';
866
+ type PrepareProjectSnapshotFromRootInput = {
867
+ ctx: CoreContext;
868
+ projectRoot: string;
869
+ projectId: string;
870
+ projectHash: string;
871
+ prepareHost?: PrepareHostKind;
872
+ requestReceivedAt?: string;
873
+ analysisOpts?: Pick<ProjectAnalysisResolveOptions, 'emit' | 'runId'>;
874
+ };
875
+
876
+ type HostedProjectShareArtifacts = {
877
+ envelope: HostedProjectIngestEnvelope;
878
+ serialized: string;
879
+ manifest: ShareProjectManifest;
880
+ };
881
+ type BuildHostedProjectShareArtifactsResult = ({
882
+ ok: true;
883
+ } & HostedProjectShareArtifacts) | {
884
+ ok: false;
885
+ issues: Issue[];
886
+ };
887
+ type HostedReportShareArtifacts = {
888
+ document: unknown;
889
+ manifest: ShareReportManifest;
890
+ };
891
+
892
+ /** Host-facing options for `runShare` upload (CLI maps Commander flags here; SDK/IDE pass fields directly). */
893
+ type ShareUploadOptions = {
894
+ project?: boolean;
895
+ report?: boolean;
896
+ /** Report JSON path when `report` is set (optional — hosts may scan in-process instead). */
897
+ from?: string;
898
+ workerUrl?: string;
899
+ force?: boolean;
900
+ };
901
+ type ShareListOptions = {
902
+ /** Filter to one worker-hosted project id. */
903
+ project?: string;
904
+ /** Filter to one worker-hosted report id. */
905
+ report?: string;
906
+ workerUrl?: string;
907
+ };
908
+ type ShareViewOptions = {
909
+ project?: string;
910
+ report?: string;
911
+ workerUrl?: string;
912
+ /** Extra worker metadata sections (processor, cache, timings) in human and JSON output. */
913
+ verbose?: boolean;
914
+ };
915
+ type ShareDeleteOptions = {
916
+ project?: string;
917
+ report?: string;
918
+ workerUrl?: string;
919
+ /** When true, skip `DELETE /v1/projects/:id` or `/v1/reports/:id` (local `share.json` only). */
920
+ localOnly?: boolean;
921
+ /** Delete every row in `share.json` for this project (mutually exclusive with `--project` / `--report`). */
922
+ all?: boolean;
923
+ };
924
+
925
+ /** One key=value block in share view verbose output (`--verbose` / `--json`). */
926
+ type ShareViewVerboseSectionValue = string | number | boolean | null | readonly string[];
927
+ type ShareViewVerboseSection = Record<string, ShareViewVerboseSectionValue>;
928
+ /** Structured sections returned on `share view --verbose` (human + JSON `verbose` field). */
929
+ type ShareViewVerboseDetail = {
930
+ kind: 'project' | 'report';
931
+ workerId: string;
932
+ processor: ShareViewVerboseSection;
933
+ extraction?: ShareViewVerboseSection;
934
+ snapshot?: ShareViewVerboseSection;
935
+ cache?: ShareViewVerboseSection;
936
+ timings?: ShareViewVerboseSection;
937
+ edge?: ShareViewVerboseSection;
938
+ local?: ShareViewVerboseSection;
939
+ links: ShareViewVerboseSection;
940
+ };
941
+
942
+ type ShareUploadJsonPayload = {
943
+ kind: 'share';
944
+ shareKind: ShareKind;
945
+ action: 'uploaded' | 'skipped' | 'link-only';
946
+ manifest?: ShareManifest;
947
+ links: ShareLinks;
948
+ workerIds: {
949
+ projectId?: string;
950
+ reportId?: string;
951
+ };
952
+ skippedReason?: string;
953
+ cacheEntry?: ShareCacheEntry;
954
+ workerExpiresAt?: string;
955
+ workerDeduped?: boolean;
956
+ };
957
+ type ShareListJsonPayload = {
958
+ kind: 'share-list';
959
+ entries: ShareCacheEntry[];
960
+ };
961
+ type ShareViewJsonPayload = {
962
+ kind: 'share-view';
963
+ shareKind: ShareKind;
964
+ workerId: string;
965
+ /** Canonical raw worker metadata payload. */
966
+ remote?: unknown;
967
+ local?: ShareCacheEntry;
968
+ links: ShareLinks;
969
+ /** Present when CLI passed `--verbose` (including with `--json`). */
970
+ verbose?: ShareViewVerboseDetail;
971
+ };
972
+ type ShareDeleteRowResult = {
973
+ shareKind: ShareKind;
974
+ workerId: string;
975
+ deletedLocal: boolean;
976
+ deletedRemote: boolean;
977
+ remoteAlreadyAbsent?: boolean;
978
+ };
979
+ type ShareDeleteJsonPayload = {
980
+ kind: 'share-delete';
981
+ shareKind: ShareKind;
982
+ workerId: string;
983
+ deletedLocal: boolean;
984
+ deletedRemote: boolean;
985
+ remoteAlreadyAbsent?: boolean;
986
+ };
987
+ type ShareDeleteAllJsonPayload = {
988
+ kind: 'share-delete-all';
989
+ deletions: ShareDeleteRowResult[];
990
+ aborted?: boolean;
991
+ };
992
+
993
+ type BuildProjectPayloadResult = {
994
+ ok: true;
995
+ zipBytes: Uint8Array;
996
+ manifest: ShareProjectManifest;
997
+ } | {
998
+ ok: false;
999
+ issues: Issue[];
1000
+ };
1001
+ type BuildPreparedProjectPayloadResult = {
1002
+ ok: true;
1003
+ envelope: HostedProjectIngestEnvelope;
1004
+ serialized: string;
1005
+ manifest: ShareProjectManifest;
1006
+ prepare: PrepareProjectSnapshotResult & {
1007
+ ok: true;
1008
+ };
1009
+ } | {
1010
+ ok: false;
1011
+ issues: Issue[];
1012
+ };
1013
+ type BuildPreparedProjectPayloadInput = {
1014
+ ctx: CoreContext;
1015
+ projectRoot: string;
1016
+ analysisOpts?: Pick<ProjectAnalysisResolveOptions, 'emit' | 'runId'>;
1017
+ prepareHost?: PrepareProjectSnapshotFromRootInput['prepareHost'];
1018
+ requestReceivedAt?: string;
1019
+ processorContext?: HostedIngestProcessorContext;
1020
+ };
1021
+ /** Issue emitted while assembling share zip bytes from collected paths. */
1022
+ type ShareZipBuildIssue = Issue;
1023
+
1024
+ type ValidateReportIngestResult = {
1025
+ ok: true;
1026
+ document: Record<string, unknown>;
1027
+ serialized: string;
1028
+ manifest: ShareReportManifest;
1029
+ /** Present when report was built from archive prepare (worker zip path). */
1030
+ prepareMeta?: ProjectPrepareMeta;
1031
+ /** When true, worker stores even if payload content hash already exists. */
1032
+ force?: boolean;
1033
+ } | {
1034
+ ok: false;
1035
+ issues: Issue[];
1036
+ };
1037
+
1038
+ type PrepareShareHostedInput = {
1039
+ ctx: CoreContext;
1040
+ projectRoot: string;
1041
+ projectId: string;
1042
+ projectHash: string;
1043
+ wantProject: boolean;
1044
+ wantReport: boolean;
1045
+ prepareHost?: PrepareHostKind;
1046
+ requestReceivedAt?: string;
1047
+ analysisOpts?: Pick<ProjectAnalysisResolveOptions, 'emit' | 'runId'>;
1048
+ reportHost?: {
1049
+ environment: ReportEnvironmentSnapshot;
1050
+ cwd: string;
1051
+ toolVersion: string;
1052
+ };
1053
+ };
1054
+ type PrepareShareHostedResult = {
1055
+ ok: true;
1056
+ prepareMeta: ProjectPrepareMeta;
1057
+ project?: PrepareProjectSnapshotResult & {
1058
+ ok: true;
1059
+ };
1060
+ report?: ValidateReportIngestResult & {
1061
+ ok: true;
1062
+ };
1063
+ analysis?: ProjectAnalysis;
1064
+ } | {
1065
+ ok: false;
1066
+ issues: Issue[];
1067
+ };
1068
+
1069
+ /** Summary fields extracted from a stored report document (metadata GET). */
1070
+ type StoredReportSummary = {
1071
+ missingKeysCount: number;
1072
+ dynamicSitesCount: number;
1073
+ keyObservationsCount: number;
1074
+ ok: boolean;
1075
+ };
1076
+ type StoredReportArtifactMeta = {
1077
+ kind: 'report';
1078
+ id: string;
1079
+ contentHash: string;
1080
+ byteSize: number;
1081
+ formatVersion: number;
1082
+ toolVersion: MetadataScalar;
1083
+ };
1084
+ type StoredReportExecutionMeta = {
1085
+ surface: MetadataScalar;
1086
+ host: MetadataScalar;
1087
+ route: MetadataScalar;
1088
+ transport: 'https-json';
1089
+ computeLocation: 'edge';
1090
+ };
1091
+ type StoredReportAnalysisMeta = {
1092
+ sourceLocalePath: MetadataScalar;
1093
+ localesDir: MetadataScalar;
1094
+ srcRoot: MetadataScalar;
1095
+ missingKeysCount: number;
1096
+ dynamicSitesCount: number;
1097
+ keyObservationsCount: number;
1098
+ ok: boolean;
1099
+ };
1100
+ type StoredReportStorageMeta = {
1101
+ backend: 'durable-object';
1102
+ dedupByContentHash: true;
1103
+ contentAddressed: true;
1104
+ };
1105
+ type StoredReportRetentionMeta = {
1106
+ policy: 'idle-7d';
1107
+ expiresAt: MetadataScalar;
1108
+ lastAccessedAt: MetadataScalar;
1109
+ };
1110
+ type StoredReportCapabilitiesMeta = {
1111
+ preparedUploads: true;
1112
+ archiveUploads: true;
1113
+ readOperations: readonly ['metadata', 'document'];
1114
+ project: false;
1115
+ report: true;
1116
+ };
1117
+ /** Worker `GET /v1/reports/:id` payload (metadata only). */
1118
+ type StoredReportMetadata = {
1119
+ /** Metadata envelope contract version. */
1120
+ schemaVersion: 1;
1121
+ /** Underlying hosted artifact format version. */
1122
+ formatVersion: 1;
1123
+ artifact: StoredReportArtifactMeta;
1124
+ timing: ReportMetadataDocumentTiming;
1125
+ processor: PayloadProcessorInfo;
1126
+ summary: StoredReportSummary;
1127
+ execution: StoredReportExecutionMeta;
1128
+ analysis: StoredReportAnalysisMeta;
1129
+ cache: ProjectExtractionCacheMeta;
1130
+ storage: StoredReportStorageMeta;
1131
+ retention: StoredReportRetentionMeta;
1132
+ capabilities: StoredReportCapabilitiesMeta;
1133
+ };
1134
+
1135
+ /** Reused across multiple {@link runShare} calls in one host command (e.g. CLI `--project` + `--report`). */
1136
+ type ShareRunShareJsonSession = {
1137
+ sharePath?: string;
1138
+ shareFile: ShareJsonFile;
1139
+ /** After the first load, suppress repeated `share.json` / `entries loaded` `[cache]` lines. */
1140
+ shareJsonLoadDebugDone?: boolean;
1141
+ };
1142
+
1143
+ type ShareWorkerProjectRef = {
1144
+ kind: 'project';
1145
+ workerBaseUrl: string;
1146
+ workerProjectId: string;
1147
+ };
1148
+ type ShareWorkerReportRef = {
1149
+ kind: 'report';
1150
+ workerBaseUrl: string;
1151
+ workerReportId: string;
1152
+ };
1153
+ type ShareRunInputProjectBuild = {
1154
+ ctx: CoreContext;
1155
+ /** Absolute project root (host resolves from config path / cwd). */
1156
+ projectRoot: string;
1157
+ workerBaseUrl: string;
1158
+ kind: 'project';
1159
+ source: 'build';
1160
+ force?: boolean;
1161
+ hooks: ShareHostHooks;
1162
+ /** When set, skips disk prepare (e.g. combined `prepareShareHostedFromContext`). */
1163
+ prepared?: {
1164
+ envelope: HostedProjectIngestEnvelope;
1165
+ serialized: string;
1166
+ manifest: ShareProjectManifest;
1167
+ };
1168
+ };
1169
+ type ShareRunInputProjectWorkerRef = {
1170
+ ctx: CoreContext;
1171
+ projectRoot: string;
1172
+ workerBaseUrl: string;
1173
+ kind: 'project';
1174
+ source: 'worker-ref';
1175
+ workerRef: ShareWorkerProjectRef;
1176
+ hooks: ShareHostHooks;
1177
+ };
1178
+ type ShareRunInputReportDocument = {
1179
+ ctx: CoreContext;
1180
+ projectRoot: string;
1181
+ workerBaseUrl: string;
1182
+ kind: 'report';
1183
+ source: 'document';
1184
+ reportDocument: unknown;
1185
+ force?: boolean;
1186
+ hooks: ShareHostHooks;
1187
+ /** When set, skips {@link validateReportIngest} (document + manifest already validated). */
1188
+ prepared?: {
1189
+ document: unknown;
1190
+ manifest: ShareReportManifest;
1191
+ };
1192
+ };
1193
+ type ShareRunInputReportWorkerRef = {
1194
+ ctx: CoreContext;
1195
+ projectRoot: string;
1196
+ workerBaseUrl: string;
1197
+ kind: 'report';
1198
+ source: 'worker-ref';
1199
+ workerRef: ShareWorkerReportRef;
1200
+ hooks: ShareHostHooks;
1201
+ };
1202
+ type ShareRunInput = ShareRunInputProjectBuild | ShareRunInputProjectWorkerRef | ShareRunInputReportDocument | ShareRunInputReportWorkerRef;
1203
+ type ShareHostHooks = {
1204
+ emit?: RunEmitter;
1205
+ runId?: string;
1206
+ /** When true, emit `[cache]` diagnostics (host maps to `--debug-cache`). */
1207
+ debugCache?: boolean;
1208
+ /** When true, core stops after manifest + policy (no upload hooks). */
1209
+ dryRun?: boolean;
1210
+ /** When false, core skips `confirmUpload` and uploads immediately after manifest (unless policy skips). */
1211
+ interactive?: boolean;
1212
+ confirmUpload?: (input: {
1213
+ message: string;
1214
+ defaultValue: boolean;
1215
+ }) => Promise<boolean>;
1216
+ fetchRemoteProjectRow?: (input: {
1217
+ workerBaseUrl: string;
1218
+ projectId: string;
1219
+ }) => Promise<{
1220
+ httpStatus: number;
1221
+ body: unknown;
1222
+ }>;
1223
+ fetchRemoteReportRow?: (input: {
1224
+ workerBaseUrl: string;
1225
+ reportId: string;
1226
+ }) => Promise<{
1227
+ httpStatus: number;
1228
+ body: unknown;
1229
+ }>;
1230
+ uploadProject?: (input: {
1231
+ workerBaseUrl: string;
1232
+ envelope: HostedProjectIngestEnvelope;
1233
+ serialized: string;
1234
+ /** CLI `--force` → worker accepts duplicate content hash (replaces prior row). */
1235
+ force?: boolean;
1236
+ }) => Promise<{
1237
+ httpStatus: number;
1238
+ body: unknown;
1239
+ }>;
1240
+ uploadReport?: (input: {
1241
+ workerBaseUrl: string;
1242
+ document: unknown;
1243
+ force?: boolean;
1244
+ }) => Promise<{
1245
+ httpStatus: number;
1246
+ body: unknown;
1247
+ }>;
1248
+ deleteRemoteProject?: (input: {
1249
+ workerBaseUrl: string;
1250
+ projectId: string;
1251
+ }) => Promise<{
1252
+ httpStatus: number;
1253
+ body: unknown;
1254
+ }>;
1255
+ deleteRemoteReport?: (input: {
1256
+ workerBaseUrl: string;
1257
+ reportId: string;
1258
+ }) => Promise<{
1259
+ httpStatus: number;
1260
+ body: unknown;
1261
+ }>;
1262
+ /** When set, reuse in-memory `share.json` across back-to-back uploads in one CLI invocation. */
1263
+ shareJsonSession?: ShareRunShareJsonSession;
1264
+ /** Host SDK / machine context attached to JSON ingest envelopes. */
1265
+ processorContext?: HostedIngestProcessorContext;
1266
+ };
1267
+ type ShareSkippedReason = 'dry_run' | 'hash_unchanged' | 'cache_epoch_unchanged' | 'user_cancelled_confirm' | 'worker_ref_link_only';
1268
+ type ShareRunResult = {
1269
+ action: 'uploaded' | 'skipped' | 'link-only';
1270
+ kind: 'project' | 'report';
1271
+ manifest?: ShareManifest;
1272
+ links: ShareLinks;
1273
+ workerIds: {
1274
+ projectId?: string;
1275
+ reportId?: string;
1276
+ };
1277
+ cacheEntry?: ShareCacheEntry;
1278
+ issues: Issue[];
1279
+ skippedReason?: ShareSkippedReason;
1280
+ /** Worker `expiresAt` from upload response (ISO). */
1281
+ workerExpiresAt?: string;
1282
+ /** Worker returned `HASH_ALREADY_EXISTS` (reused existing row). */
1283
+ workerDeduped?: boolean;
1284
+ /** Rows removed from `share.json` after worker 404 during skip probe (re-upload follows). */
1285
+ purgedStaleCacheRows?: Array<{
1286
+ kind: 'project' | 'report';
1287
+ workerId: string;
1288
+ }>;
1289
+ };
1290
+ type ShareListInput = {
1291
+ ctx: CoreContext;
1292
+ };
1293
+ type ShareListResult = {
1294
+ entries: ShareCacheEntry[];
1295
+ issues: Issue[];
1296
+ heal: ShareJsonHealReport;
1297
+ };
1298
+ type ShareViewInput = {
1299
+ ctx: CoreContext;
1300
+ kind: 'project' | 'report';
1301
+ workerBaseUrl: string;
1302
+ workerId: string;
1303
+ hooks: Pick<ShareHostHooks, 'fetchRemoteProjectRow' | 'fetchRemoteReportRow'>;
1304
+ /** When true (default), drop matching `share.json` rows after worker not-found (not on network errors). */
1305
+ purgeStaleLocalOnNotFound?: boolean;
1306
+ };
1307
+ type ShareViewResult = {
1308
+ kind: 'project' | 'report';
1309
+ workerId: string;
1310
+ remote?: unknown;
1311
+ /** Parsed worker GET metadata when the response matches the stored-metadata shape. */
1312
+ remoteMetadata?: ProjectStoredMetadata | StoredReportMetadata;
1313
+ local?: ShareCacheEntry;
1314
+ links: ShareLinks;
1315
+ issues: Issue[];
1316
+ /** True when a matching `share.json` row was removed after worker not-found. */
1317
+ purgedLocalCache?: boolean;
1318
+ };
1319
+ type ShareDeleteInput = {
1320
+ ctx: CoreContext;
1321
+ kind: 'project' | 'report';
1322
+ workerBaseUrl: string;
1323
+ workerId: string;
1324
+ /** When false, skip worker DELETE (local `share.json` only). Default true when host supplies delete hooks. */
1325
+ remote?: boolean;
1326
+ hooks?: Pick<ShareHostHooks, 'deleteRemoteProject' | 'deleteRemoteReport'>;
1327
+ };
1328
+ type ShareDeleteResult = {
1329
+ deletedLocal: boolean;
1330
+ deletedRemote: boolean;
1331
+ /** Worker returned 404 / not-found — DELETE treated as done. */
1332
+ remoteAlreadyAbsent?: boolean;
1333
+ issues: Issue[];
1334
+ };
1335
+
1336
+ type VerboseRow = {
1337
+ key: string;
1338
+ value: string;
1339
+ };
1340
+ type VerboseSection = {
1341
+ title: string;
1342
+ rows: VerboseRow[];
1343
+ };
1344
+
1345
+ export { type AnalysisCacheInvalidationAction, type AnalysisCacheInvalidationDecision, type AnalysisCacheInvalidationReason, type BuildHostedProjectShareArtifactsResult, type BuildPreparedProjectPayloadInput, type BuildPreparedProjectPayloadResult, type BuildProjectPayloadResult, type CacheConfigSource, CacheDispatchInfo, CacheDispatchStatus, CacheProfileId, CacheProjectFileRecord, CacheRebuildConfig, CacheRebuildMode, CachedLocalesLayout, ConstSubstitutionStep, CoreContext, CoreEngineRuntime, type DeleteJsonPayload, type DeleteRunResult, type DeleteTargetResult, type DoctorCheckId, type DoctorFinding, type DoctorHostHooks, type DoctorJsonPayload, type DoctorRunOptions, type DoctorRunResult, type DynamicHostHooks, type DynamicJsonPayload, DynamicKeySite, type DynamicRunOptions, type DynamicRunResult, type HostedProjectShareArtifacts, type HostedReportShareArtifacts, type ImportBinding, type ImportBindingSource, Issue, KeyObservation, type ListJsonPayload, type ListRunResult, ListSourceFilesOptions, LocaleListRow, type LocaleWriteInvalidationInput, OperationId, PatchingAction, PatchingCommandName, PatchingConfigInput, PatchingLocaleRecord, type PatchingRunInput, PatchingRuntimePorts, type PrepareShareHostedInput, type PrepareShareHostedResult, type ProjectAnalysis, type ProjectAnalysisCacheData, type ProjectAnalysisCounts, type ProjectAnalysisResolveOptions, ProjectLiteralKeyUsage, ProviderAttemptOutcome, type ProviderAttemptReport, type ResolveKeyPlaceholdersTraceResult, type ResolveProviderActionInput, type ResolvedCacheConfig, ResolvedLocalesLayout, type ReviewHostHooks, type ReviewJsonData, type ReviewLocaleStats, type ReviewRunOptions, type ReviewRunResult, RunEmitter, RuntimePathPort, type SaveShareJsonResult, ScanExcludeConfig, type ScanKeyObservationsOptions, type ScanProjectDynamicKeySitesInput, type ScanProjectFileInput, type ScanProjectFilesystemInputBase, type ScanProjectKeyObservationsInput, type ScanProjectLiteralKeyUsageInput, type ScanProjectSourceFilesInput, type ShareCacheDebugLine, ShareCacheEntry, type ShareDeleteAllJsonPayload, type ShareDeleteInput, type ShareDeleteJsonPayload, type ShareDeleteOptions, type ShareDeleteResult, type ShareDeleteRowResult, type ShareHostHooks, type ShareHumanMessageHost, type ShareJsonBackupResult, ShareJsonFile, ShareJsonHealReport, ShareKind, ShareLinks, type ShareListInput, type ShareListJsonPayload, type ShareListOptions, type ShareListResult, ShareManifest, ShareProjectManifest, ShareReportManifest, type ShareRunInput, type ShareRunInputProjectBuild, type ShareRunInputProjectWorkerRef, type ShareRunInputReportDocument, type ShareRunInputReportWorkerRef, type ShareRunResult, type ShareRunShareJsonSession, type ShareSkippedReason, type ShareUploadJsonPayload, type ShareUploadOptions, type ShareViewInput, type ShareViewJsonPayload, type ShareViewOptions, type ShareViewResult, type ShareViewVerboseDetail, type ShareViewVerboseSection, type ShareViewVerboseSectionValue, type ShareWorkerProjectRef, type ShareWorkerReportRef, type ShareZipBuildIssue, type TrackedProjectFilesCurrent, TranslateFailureOutcome, type TranslateHooks, type TranslateIdentityGuardOptions, type TranslateLeafInput, type TranslateOptions, type TranslateOutput, TranslatePolicy, type TranslatePolicyAction, TranslatePolicyVerb, type TranslateResultItem, TranslateRunPartialStats, type TranslationCallSite, TranslationLeafMeta, TranslationProviderId, type VerboseRow, type VerboseSection };