@mionjs/devtools 0.13.0 → 0.14.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 (89) hide show
  1. package/README.md +4 -4
  2. package/dist/core/apply-edits.d.ts +1 -1
  3. package/dist/core/apply-edits.js +2 -3
  4. package/dist/core/apply-edits.js.map +1 -1
  5. package/dist/core/bundledApiStub.js.map +1 -1
  6. package/dist/core/devReporter.js.map +1 -1
  7. package/dist/core/diagnosticCatalog.js.map +1 -1
  8. package/dist/core/downgradeErrors.js.map +1 -1
  9. package/dist/core/edit-buffer.d.ts +0 -2
  10. package/dist/core/edit-buffer.js +1 -8
  11. package/dist/core/edit-buffer.js.map +1 -1
  12. package/dist/core/go-generated/diagnosticCatalog.generated.js +6 -1
  13. package/dist/core/go-generated/diagnosticCatalog.generated.js.map +1 -1
  14. package/dist/core/go-generated/reflectionKind.generated.js.map +1 -1
  15. package/dist/core/go-generated/runtypes-constants.generated.d.ts +1 -1
  16. package/dist/core/go-generated/runtypes-constants.generated.js +1 -1
  17. package/dist/core/go-generated/runtypes-constants.generated.js.map +1 -1
  18. package/dist/core/go-generated/tsconfig-plugin-keys.generated.d.ts +1 -1
  19. package/dist/core/go-generated/tsconfig-plugin-keys.generated.js +1 -0
  20. package/dist/core/go-generated/tsconfig-plugin-keys.generated.js.map +1 -1
  21. package/dist/core/groupedLog.js.map +1 -1
  22. package/dist/core/levels.js.map +1 -1
  23. package/dist/core/markerImports.js.map +1 -1
  24. package/dist/core/option-guards.js.map +1 -1
  25. package/dist/core/plugin-option-keys.js +1 -0
  26. package/dist/core/plugin-option-keys.js.map +1 -1
  27. package/dist/core/protocol.d.ts +2 -0
  28. package/dist/core/protocol.js.map +1 -1
  29. package/dist/core/resolver-client.d.ts +4 -0
  30. package/dist/core/resolver-client.js +26 -4
  31. package/dist/core/resolver-client.js.map +1 -1
  32. package/dist/core/scan-batcher.js.map +1 -1
  33. package/dist/core/surface.js.map +1 -1
  34. package/dist/core/type-deps.js.map +1 -1
  35. package/dist/core/types.d.ts +8 -0
  36. package/dist/core/types.js.map +1 -1
  37. package/dist/core/typescript-floor.js.map +1 -1
  38. package/dist/core/unplugin.d.ts +1 -0
  39. package/dist/core/unplugin.js +63 -10
  40. package/dist/core/unplugin.js.map +1 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/lint/diagnosticRouting.js.map +1 -1
  43. package/dist/lint/index.js.map +1 -1
  44. package/dist/lint/lint-worker.js +11 -6
  45. package/dist/lint/lint-worker.js.map +1 -1
  46. package/dist/lint/prefilter.js.map +1 -1
  47. package/dist/lint/session-protocol.js.map +1 -1
  48. package/dist/lint/session.js.map +1 -1
  49. package/dist/lint/spawn-shim.js.map +1 -1
  50. package/dist/lint/vueSfc.d.ts +9 -0
  51. package/dist/lint/vueSfc.js +112 -0
  52. package/dist/lint/vueSfc.js.map +1 -0
  53. package/dist/options.js.map +1 -1
  54. package/dist/runtypes/bun.js.map +1 -1
  55. package/dist/runtypes/esbuild.js.map +1 -1
  56. package/dist/runtypes/next/broker.js +13 -13
  57. package/dist/runtypes/next/broker.js.map +1 -1
  58. package/dist/runtypes/next/index.d.ts +0 -1
  59. package/dist/runtypes/next/index.js +2 -0
  60. package/dist/runtypes/next/index.js.map +1 -1
  61. package/dist/runtypes/next/loader.js.map +1 -1
  62. package/dist/runtypes/next/wire.js.map +1 -1
  63. package/dist/runtypes/rolldown.js.map +1 -1
  64. package/dist/runtypes/rollup.js.map +1 -1
  65. package/dist/runtypes/rspack.js.map +1 -1
  66. package/dist/runtypes/vite.js.map +1 -1
  67. package/dist/runtypes/webpack.js.map +1 -1
  68. package/dist/vite/buildEntries.js +14 -11
  69. package/dist/vite/buildEntries.js.map +1 -1
  70. package/dist/vite/index.d.ts +0 -1
  71. package/dist/vite/index.js +0 -1
  72. package/dist/vite/index.js.map +1 -1
  73. package/dist/vite/middlewareMode.d.ts +3 -2
  74. package/dist/vite/middlewareMode.js +73 -59
  75. package/dist/vite/middlewareMode.js.map +1 -1
  76. package/dist/vite/mionVitePlugin.d.ts +0 -1
  77. package/dist/vite/mionVitePlugin.js +28 -8
  78. package/dist/vite/mionVitePlugin.js.map +1 -1
  79. package/dist/vite/nodeWebBridge.js.map +1 -1
  80. package/dist/vite/sfcTransform.d.ts +1 -0
  81. package/dist/vite/sfcTransform.js +17 -7
  82. package/dist/vite/sfcTransform.js.map +1 -1
  83. package/package.json +8 -13
  84. package/dist/next/index.d.ts +0 -11
  85. package/dist/next/index.js +0 -17
  86. package/dist/next/index.js.map +0 -1
  87. package/dist/vite/cjsPackageJsonPlugin.d.ts +0 -3
  88. package/dist/vite/cjsPackageJsonPlugin.js +0 -12
  89. package/dist/vite/cjsPackageJsonPlugin.js.map +0 -1
@@ -10,6 +10,7 @@ export const TSCONFIG_PLUGIN_KEYS = [
10
10
  'levels',
11
11
  'logStyle',
12
12
  'markers',
13
+ 'maxUnknownKeys',
13
14
  'moduleMode',
14
15
  'name',
15
16
  'parallelRender',
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfig-plugin-keys.generated.js","sourceRoot":"","sources":["../../../src/core/go-generated/tsconfig-plugin-keys.generated.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc;IACd,iBAAiB;IACjB,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,cAAc;IACd,QAAQ;IACR,UAAU;IACV,SAAS;IACT,YAAY;IACZ,MAAM;IACN,gBAAgB;IAChB,cAAc;IACd,oBAAoB;IACpB,sBAAsB;IACtB,cAAc;IACd,gBAAgB;IAChB,UAAU;CACF,CAAC"}
1
+ {"version":3,"file":"tsconfig-plugin-keys.generated.js","sourceRoot":"","sources":["../../../src/core/go-generated/tsconfig-plugin-keys.generated.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc;IACd,iBAAiB;IACjB,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,cAAc;IACd,QAAQ;IACR,UAAU;IACV,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,MAAM;IACN,gBAAgB;IAChB,cAAc;IACd,oBAAoB;IACpB,sBAAsB;IACtB,cAAc;IACd,gBAAgB;IAChB,UAAU;CACF,CAAC","sourcesContent":["// Code generated by cmd/gen-plugin-keys. DO NOT EDIT.\n// Source: cmd/mion/config.go (tsRuntypesPlugin json tags).\n// Regenerate via `pnpm miondevx core codegen pluginkeys` after changing the struct.\n//\n// The recognised keys of the tsconfig `plugins` entry. The plugin-option\n// parity test (test/plugin-option-parity.test.ts) checks these against the\n// bundler PluginOptions so a project option added to only one side fails CI.\n\nexport const TSCONFIG_PLUGIN_KEYS = [\n 'clientRoutes',\n 'downgradeErrors',\n 'emitMode',\n 'genDir',\n 'hashLength',\n 'i18n',\n 'inlineMode',\n 'jsonMaxBytes',\n 'levels',\n 'logStyle',\n 'markers',\n 'maxUnknownKeys',\n 'moduleMode',\n 'name',\n 'parallelRender',\n 'parallelScan',\n 'patternSampleCount',\n 'patternSampleRetries',\n 'pureFnReport',\n 'singleThreaded',\n 'validate',\n] as const;\n\nexport type TsconfigPluginKey = (typeof TSCONFIG_PLUGIN_KEYS)[number];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"groupedLog.js","sourceRoot":"","sources":["../../src/core/groupedLog.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,kBAAkB,EAAE,SAAS,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAuC,MAAM,eAAe,CAAC;AAG7E,MAAM,OAAO,GAA2B,EAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EA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,CAAC,MAAM,CAAC;AAC5C,CAAC","sourcesContent":["// The grouped log: each diagnostic name once with its message, then one line per site. Twin of\n// internal/diagnostics/grouped.go; testdata/grouped/cases.json there pins both to the same bytes.\n\nimport path from 'node:path';\nimport {DIAGNOSTIC_CATALOG, fillSlots, renderHeadline} from './diagnosticCatalog.ts';\nimport {DOWNGRADED_NOTE} from './downgradeErrors.ts';\nimport {Severity, type Diagnostic, type DiagnosticSite} from './protocol.ts';\nimport type {GroupedEntry} from './types.ts';\n\nconst ESCAPES: Record<string, string> = {'\\\\': '\\\\\\\\', '\"': '\\\\\"', '\\n': '\\\\n', '\\r': '\\\\r', '\\t': '\\\\t'};\n\ninterface Block {\n template: string;\n slots: readonly string[];\n entries: GroupedEntry[];\n}\n\ninterface Group {\n severity: Severity;\n name: string;\n downgraded: boolean;\n blocks: Block[];\n size: number;\n}\n\nexport function entryOf(diagnostic: Diagnostic, downgraded: boolean): GroupedEntry {\n const entry = DIAGNOSTIC_CATALOG[diagnostic.code];\n return {\n severity: downgraded ? Severity.Warning : diagnostic.severity,\n name: diagnostic.code,\n template: entry ? entry.headline : renderHeadline(diagnostic.code, diagnostic.args),\n slots: entry?.slots,\n args: diagnostic.args,\n site: diagnostic.site,\n related: diagnostic.related,\n downgraded,\n };\n}\n\n// Paths under a non-empty cwd print relative to it.\nexport function formatGrouped(allEntries: readonly GroupedEntry[], cwd = ''): string {\n if (allEntries.length === 0) return '';\n const entries = cwd === '' ? allEntries : allEntries.map((entry) => relativeEntry(entry, cwd));\n const groups: Group[] = [];\n const groupByKey = new Map<string, Group>();\n const blockByKey = new Map<string, Block>();\n for (const entry of entries) {\n const downgraded = entry.downgraded ?? false;\n const groupLookup = JSON.stringify([entry.severity, entry.name, downgraded]);\n let group = groupByKey.get(groupLookup);\n if (!group) {\n group = {severity: entry.severity, name: entry.name, downgraded, blocks: [], size: 0};\n groupByKey.set(groupLookup, group);\n groups.push(group);\n }\n group.size += 1;\n const slots = entry.slots ?? [];\n const blockLookup = JSON.stringify([groupLookup, entry.template, slots]);\n let block = blockByKey.get(blockLookup);\n if (!block) {\n block = {template: entry.template, slots, entries: []};\n blockByKey.set(blockLookup, block);\n group.blocks.push(block);\n }\n block.entries.push(entry);\n }\n for (const group of groups) {\n for (const block of group.blocks) block.entries.sort(compareEntries);\n group.blocks.sort((left, right) => compareEntries(left.entries[0], right.entries[0]));\n }\n groups.sort(\n (left, right) =>\n left.severity - right.severity || compareBytes(left.name, right.name) || Number(left.downgraded) - Number(right.downgraded)\n );\n\n const parts: string[] = [];\n for (const group of groups) {\n let text = `${severityLabel(group.severity)} ${group.name} (${group.size})`;\n if (group.downgraded) text += ` ${DOWNGRADED_NOTE}`;\n for (const block of group.blocks) text += blockText(block);\n parts.push(text);\n }\n parts.push(countLine(entries));\n return parts.join('\\n\\n');\n}\n\n// A slot with one value at every site goes into the message; the rest print per site.\nfunction blockText(block: Block): string {\n const varying: number[] = [];\n // A varying slot fills with its own placeholder, so the message keeps `{name}` there.\n const fill = block.slots.map((slot, index) => {\n const first = argAt(block.entries[0].args, index);\n if (!block.entries.some((entry) => argAt(entry.args, index) !== first)) return first;\n varying.push(index);\n return `{${slot}}`;\n });\n const message = block.slots.length === 0 ? block.template : fillSlots(block.template, block.slots, fill);\n let text = '';\n // Detail lines (a TypeScript message chain) sit deeper than the sites, so they never read as one.\n message.split('\\n').forEach((line, index) => (text += `\\n ${index > 0 ? ' ' : ''}${line}`));\n for (const entry of block.entries) {\n text += `\\n ${location(entry.site)}`;\n for (const index of varying) text += ` ${block.slots[index]}=${quoted(argAt(entry.args, index))}`;\n for (const related of entry.related ?? []) text += `\\n Related: ${location(related)} ${related.message}`;\n }\n return text;\n}\n\nfunction relativeEntry(entry: GroupedEntry, cwd: string): GroupedEntry {\n const site = {...entry.site, filePath: relativePath(entry.site.filePath, cwd)};\n const related = entry.related?.map((pointer) => ({...pointer, filePath: relativePath(pointer.filePath, cwd)}));\n return related ? {...entry, site, related} : {...entry, site};\n}\n\nfunction relativePath(filePath: string, cwd: string): string {\n if (!path.isAbsolute(filePath)) return filePath;\n const rel = path.relative(cwd, filePath);\n // The project folder itself stays as given: an empty path would read as no place at all.\n if (rel === '' || rel === '..' || rel.startsWith(`..${path.sep}`) || path.isAbsolute(rel)) return filePath;\n return rel.split(path.sep).join('/');\n}\n\nfunction argAt(args: readonly string[] | undefined, index: number): string {\n return args && index < args.length ? args[index] : '';\n}\n\n// `file:line:col` is the form terminals and editors open on click.\nfunction location(site: DiagnosticSite): string {\n if (site.filePath === '') return '(no file)';\n if (site.startLine <= 0) return site.filePath;\n return `${site.filePath}:${site.startLine}:${site.startCol}`;\n}\n\n// A value that is empty or holds whitespace or a quote is quoted, so where it ends stays visible.\nfunction quoted(value: string): string {\n if (value !== '' && !/[ \\t\\n\\r\"]/.test(value)) return value;\n return `\"${value.replace(/[\\\\\"\\n\\r\\t]/g, (char) => ESCAPES[char])}\"`;\n}\n\nfunction countLine(entries: readonly GroupedEntry[]): string {\n const counts = new Map<Severity, number>();\n const files = new Set<string>();\n for (const entry of entries) {\n counts.set(entry.severity, (counts.get(entry.severity) ?? 0) + 1);\n if (entry.site.filePath !== '') files.add(entry.site.filePath);\n }\n const parts: string[] = [];\n for (const [severity, singular, many] of [\n [Severity.Error, 'error', 'errors'],\n [Severity.Warning, 'warning', 'warnings'],\n [Severity.Info, 'info', 'info'],\n ] as const) {\n const count = counts.get(severity) ?? 0;\n if (count > 0) parts.push(`${count} ${count === 1 ? singular : many}`);\n }\n let line = `mion: ${parts.join(', ')}`;\n if (files.size > 0) line += ` in ${files.size} ${files.size === 1 ? 'file' : 'files'}`;\n return line;\n}\n\nexport function severityLabel(severity: Severity): string {\n if (severity === Severity.Error) return 'error';\n if (severity === Severity.Warning) return 'warning';\n return 'info';\n}\n\n// Go compares strings by bytes; Buffer.compare matches it where `<` on UTF-16 would not.\nfunction compareBytes(left: string, right: string): number {\n return Buffer.compare(Buffer.from(left), Buffer.from(right));\n}\n\nfunction compareEntries(left: GroupedEntry, right: GroupedEntry): number {\n const byFile = compareBytes(left.site.filePath, right.site.filePath);\n if (byFile !== 0) return byFile;\n if (left.site.startLine !== right.site.startLine) return left.site.startLine - right.site.startLine;\n if (left.site.startCol !== right.site.startCol) return left.site.startCol - right.site.startCol;\n const leftArgs = left.args ?? [];\n const rightArgs = right.args ?? [];\n for (let index = 0; index < Math.min(leftArgs.length, rightArgs.length); index++) {\n const order = compareBytes(leftArgs[index], rightArgs[index]);\n if (order !== 0) return order;\n }\n return leftArgs.length - rightArgs.length;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"levels.js","sourceRoot":"","sources":["../../src/core/levels.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAkB,MAAM,eAAe,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAGhC,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,KAAK,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kCAAkC,UAAU,GAAG,CAAC,CAAC;AAC7H,CAAC;AAED,MAAM,iBAAiB,GAAG,SAAS,CAAC;AACpC,MAAM,eAAe,GAAG,OAAO,CAAC;AAGhC,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,iBAAiB;QAAE,OAAO,IAAI,CAAC;IACpF,IAAI,KAAK,KAAK,eAAe;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,IAAI,KAAK,CACb,uCAAuC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,+BAA+B,iBAAiB,UAAU,eAAe,GAAG,CACzI,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,UAAsB,EAAE,QAAiB;IAC/D,OAAO,QAAQ,IAAI,UAAU,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC;AACrD,CAAC"}
1
+ {"version":3,"file":"levels.js","sourceRoot":"","sources":["../../src/core/levels.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAkB,MAAM,eAAe,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAGhC,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,KAAK,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kCAAkC,UAAU,GAAG,CAAC,CAAC;AAC7H,CAAC;AAED,MAAM,iBAAiB,GAAG,SAAS,CAAC;AACpC,MAAM,eAAe,GAAG,OAAO,CAAC;AAGhC,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,iBAAiB;QAAE,OAAO,IAAI,CAAC;IACpF,IAAI,KAAK,KAAK,eAAe;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,IAAI,KAAK,CACb,uCAAuC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,+BAA+B,iBAAiB,UAAU,eAAe,GAAG,CACzI,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,UAAsB,EAAE,QAAiB;IAC/D,OAAO,QAAQ,IAAI,UAAU,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC;AACrD,CAAC","sourcesContent":["// The `levels` setting: Info is hidden unless it is `'all'`, and hiding never changes a halt.\n// Go twin: ts-go-runtypes/internal/diagnostics/levels.go.\nimport {Level, type Diagnostic} from './protocol.ts';\n\nexport const LEVELS_ALL = 'all';\n\n// resolveShowInfo throws at the host boundary, so a typo fails loudly.\nexport function resolveShowInfo(value: unknown): boolean {\n if (value === undefined || value === '') return false;\n if (value === LEVELS_ALL) return true;\n throw new Error(`[@mionjs/devtools] invalid levels ${JSON.stringify(value)} — the only accepted value is '${LEVELS_ALL}'`);\n}\n\nconst LOG_STYLE_GROUPED = 'grouped';\nconst LOG_STYLE_LINES = 'lines';\n\n// The `logStyle` setting, unset groups; twin of ResolveLogStyle in ts-go-runtypes/internal/diagnostics/logstyle.go.\nexport function resolveGrouped(value: unknown): boolean {\n if (value === undefined || value === '' || value === LOG_STYLE_GROUPED) return true;\n if (value === LOG_STYLE_LINES) return false;\n throw new Error(\n `[@mionjs/devtools] invalid logStyle ${JSON.stringify(value)} — the accepted values are '${LOG_STYLE_GROUPED}' and '${LOG_STYLE_LINES}'`\n );\n}\n\nexport function isShown(diagnostic: Diagnostic, showInfo: boolean): boolean {\n return showInfo || diagnostic.level !== Level.Info;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"markerImports.js","sourceRoot":"","sources":["../../src/core/markerImports.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAQzD,MAAM,gBAAgB,GAAG,iFAAiF,CAAC;AAG3G,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAExF,MAAM,eAAe,GAAG,IAAI,GAAG,EAAmB,CAAC;AACnD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;AACrD,MAAM,aAAa,GAAG,IAAI,GAAG,EAA+C,CAAC;AAG7E,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,IAAI,CAA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AC,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;QAClG,IAAI,KAAK,EAAE,CAAC;YACV,kBAAkB,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YACzC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG;YAAE,OAAO,SAAS,CAAC;IAClD,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,WAAmB;IACvC,IAAI,CAAC;QACH,OAAQ,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAqB,CAAC,IAAI,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["// Cheap text gate for files that may hold marker calls, shared by the lint pre-filter and the build fallback for\n// files the type scan has not seen, so the two cannot drift. It follows imports: a package or local module wrapping\n// a marker (a drizzle dialect's `tableFromType<T>()`) hands it to files that never name the marker package.\n\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nexport const DEFAULT_MARKER_MODULE = '@mionjs/run-types';\n\nexport interface MarkerGateOptions {\n packages?: string[];\n checkPackage?: boolean;\n}\n\n// Static, side-effect and dynamic import specifiers, plus require() ones.\nconst specifierPattern = /(?:\\bfrom\\s*|\\bimport\\s*|\\bimport\\s*\\(\\s*|\\brequire\\s*\\(\\s*)(['\"])([^'\"\\n]+)\\1/g;\n\n// Local imports are followed one level only: a wrapper of a wrapper is missed.\nconst LOCAL_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs'];\n\nconst packageVerdicts = new Map<string, boolean>();\nconst packageJsonLookups = new Map<string, string>();\nconst localVerdicts = new Map<string, {mtimeMs: number; verdict: boolean}>();\n\n// Aliases and barrels hide package ownership; Go must classify imported declarations.\nexport function mayHoldDrizzleSchemas(text: string): boolean {\n return text.includes('drizzle') || [...importSpecifiers(text)].some((specifier) => !specifier.startsWith('node:'));\n}\n\n// With checkPackage:false a marker can be declared anywhere, so every file passes.\nexport function mayHoldMarkerCalls(text: string, file: string | undefined, markers?: MarkerGateOptions): boolean {\n if (markers?.checkPackage === false) return true;\n const modules = markerModules(markers);\n if (namesMarkerModule(text, modules)) return true;\n if (!file) return false;\n const fromDir = path.dirname(file);\n for (const specifier of importSpecifiers(text)) {\n if (isRelative(specifier)) {\n if (localFileMayHoldMarkers(fromDir, specifier, modules)) return true;\n } else if (packageDependsOnMarkers(fromDir, specifier, modules)) {\n return true;\n }\n }\n return false;\n}\n\nfunction markerModules(markers?: MarkerGateOptions): string[] {\n return [DEFAULT_MARKER_MODULE, ...(markers?.packages ?? [])];\n}\n\n// Quoted only, so a path in a comment never forces a scan.\n// `registerPureFn` catches the marker package's own sources (relative imports) and `registerPureFnFactory` too.\nfunction namesMarkerModule(text: string, modules: string[]): boolean {\n return modules.some((mod) => text.includes(`'${mod}`) || text.includes(`\"${mod}`)) || text.includes('registerPureFn');\n}\n\nfunction importSpecifiers(text: string): Set<string> {\n const specifiers = new Set<string>();\n for (const match of text.matchAll(specifierPattern)) specifiers.add(match[2]!);\n return specifiers;\n}\n\nconst isRelative = (specifier: string): boolean => specifier.startsWith('./') || specifier.startsWith('../');\n\n// Skips relative imports, which keeps local wrappers one level deep.\nfunction directlyMayHoldMarkers(text: string, fromDir: string, modules: string[]): boolean {\n if (namesMarkerModule(text, modules)) return true;\n for (const specifier of importSpecifiers(text)) {\n if (!isRelative(specifier) && packageDependsOnMarkers(fromDir, specifier, modules)) return true;\n }\n return false;\n}\n\nfunction localFileMayHoldMarkers(fromDir: string, specifier: string, modules: string[]): boolean {\n const resolved = resolveLocalFile(path.resolve(fromDir, specifier));\n if (!resolved) return false;\n const key = `${resolved.file}\\0${modules.join(',')}`;\n const cached = localVerdicts.get(key);\n if (cached && cached.mtimeMs === resolved.mtimeMs) return cached.verdict;\n let verdict = false;\n try {\n verdict = directlyMayHoldMarkers(fs.readFileSync(resolved.file, 'utf8'), path.dirname(resolved.file), modules);\n } catch {\n verdict = false;\n }\n localVerdicts.set(key, {mtimeMs: resolved.mtimeMs, verdict});\n return verdict;\n}\n\n// Bundler-style TS resolution (a `.js` specifier may name its `.ts` source); tsconfig `paths` are not followed.\nfunction resolveLocalFile(base: string): {file: string; mtimeMs: number} | undefined {\n const withoutJs = base.replace(/\\.([mc]?)jsx?$/, '');\n const candidates = [\n base,\n ...LOCAL_EXTENSIONS.map((ext) => base + ext),\n ...(withoutJs !== base ? ['.ts', '.tsx', '.mts', '.cts'].map((ext) => withoutJs + ext) : []),\n ...LOCAL_EXTENSIONS.map((ext) => path.join(base, `index${ext}`)),\n ];\n for (const candidate of candidates) {\n try {\n const stat = fs.statSync(candidate);\n if (stat.isFile()) return {file: candidate, mtimeMs: stat.mtimeMs};\n } catch {\n // not this candidate\n }\n }\n return undefined;\n}\n\nfunction packageName(specifier: string): string | undefined {\n if (specifier.startsWith('node:') || specifier.startsWith('/') || specifier.startsWith('#')) return undefined;\n const parts = specifier.split('/');\n if (specifier.startsWith('@')) return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : undefined;\n return parts[0] || undefined;\n}\n\n// A package depending on a marker module can hand a marker parameter to its importer through its typings.\nfunction packageDependsOnMarkers(fromDir: string, specifier: string, modules: string[]): boolean {\n const name = packageName(specifier);\n if (!name) return false;\n if (modules.includes(name)) return true;\n const packageJson = findPackageJson(fromDir, name);\n if (!packageJson) return false;\n const key = `${packageJson}\\0${modules.join(',')}`;\n const cached = packageVerdicts.get(key);\n if (cached !== undefined) return cached;\n let verdict = false;\n try {\n const manifest = JSON.parse(fs.readFileSync(packageJson, 'utf8')) as Record<string, Record<string, string> | undefined>;\n const dependencies = [manifest['dependencies'], manifest['peerDependencies'], manifest['optionalDependencies']];\n verdict = dependencies.some((group) => !!group && modules.some((mod) => mod in group));\n } catch {\n verdict = false;\n }\n packageVerdicts.set(key, verdict);\n return verdict;\n}\n\n// Node-style walk up (pnpm symlinks read through), also matching a package importing itself by name.\n// A miss is not cached, so a package installed mid-session is seen on the next lint.\nfunction findPackageJson(fromDir: string, name: string): string | undefined {\n const lookupKey = `${fromDir}\\0${name}`;\n const cached = packageJsonLookups.get(lookupKey);\n if (cached) return cached;\n for (let dir = fromDir; ; dir = path.dirname(dir)) {\n const installed = path.join(dir, 'node_modules', name, 'package.json');\n const own = path.join(dir, 'package.json');\n const found = fs.existsSync(installed) ? installed : manifestName(own) === name ? own : undefined;\n if (found) {\n packageJsonLookups.set(lookupKey, found);\n return found;\n }\n if (path.dirname(dir) === dir) return undefined;\n }\n}\n\nfunction manifestName(packageJson: string): string | undefined {\n try {\n return (JSON.parse(fs.readFileSync(packageJson, 'utf8')) as {name?: string}).name;\n } catch {\n return undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"option-guards.js","sourceRoot":"","sources":["../../src/core/option-guards.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,gDAAgD,CAAC;AAExD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,uBAAuB,CAAU,CAAC;AAC5G,MAAM,aAAa,GAAG,CAAC,oBAAoB,EAAE,mBAAmB,CAAU,CAAC;AAG3E,SAAS,WAAW,CAAC,KAAa,EAAE,OAA0B,EAAE,KAAc;IAC5E,IAAI,KAAK,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K,CAAC,kBAAkB,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAc,QAAQ,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,UAAmB,EAAQ,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AACxH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAe,EAAQ,EAAE,CAAC,WAAW,CAAC,eAAe,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import {\n CLIENT_ROUTES_BUNDLE,\n CLIENT_ROUTES_FETCH,\n MODULE_MODE_ALL_MODULES,\n MODULE_MODE_ALL_SINGLE,\n MODULE_MODE_DEFAULT,\n} from './go-generated/runtypes-constants.generated.ts';\n\nexport const MODULE_MODES = [MODULE_MODE_DEFAULT, MODULE_MODE_ALL_SINGLE, MODULE_MODE_ALL_MODULES] as const;\nconst CLIENT_ROUTES = [CLIENT_ROUTES_BUNDLE, CLIENT_ROUTES_FETCH] as const;\n\n/** Configs are often plain JS, so an unknown value is refused at the host boundary. **/\nfunction assertOneOf(label: string, allowed: readonly string[], value: unknown): void {\n if (value === undefined || allowed.includes(value as string)) return;\n const expected = allowed.map((option) => `'${option}'`).join(' | ');\n throw new Error(`[mion] unknown ${label} ${JSON.stringify(value)}, expected ${expected}`);\n}\n\nexport const assertValidModuleMode = (moduleMode: unknown): void => assertOneOf('moduleMode', MODULE_MODES, moduleMode);\nexport const assertValidClientRoutes = (routes: unknown): void => assertOneOf('client routes', CLIENT_ROUTES, routes);\n"]}
@@ -12,6 +12,7 @@ const PLUGIN_OPTION_KEY_TABLE = {
12
12
  hashLength: true,
13
13
  patternSampleCount: true,
14
14
  patternSampleRetries: true,
15
+ maxUnknownKeys: true,
15
16
  jsonMaxBytes: true,
16
17
  markers: true,
17
18
  moduleMode: true,
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-option-keys.js","sourceRoot":"","sources":["../../src/core/plugin-option-keys.ts"],"names":[],"mappings":"AAIA,MAAM,uBAAuB,GAAG;IAC9B,MAAM,EAAE,IAAI;IACZ,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,kBAAkB,EAAE,IAAI;IACxB,oBAAoB,EAAE,IAAI;IAC1B,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;IACnB,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;CAC+B,CAAC;AAI9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAA4B,CAAC"}
1
+ {"version":3,"file":"plugin-option-keys.js","sourceRoot":"","sources":["../../src/core/plugin-option-keys.ts"],"names":[],"mappings":"AAIA,MAAM,uBAAuB,GAAG;IAC9B,MAAM,EAAE,IAAI;IACZ,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,kBAAkB,EAAE,IAAI;IACxB,oBAAoB,EAAE,IAAI;IAC1B,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;IACnB,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;CAC+B,CAAC;AAI9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAA4B,CAAC","sourcesContent":["import type {PluginOptions} from './unplugin.ts';\n\n// The `satisfies` guard fails the typecheck both ways: a field added to PluginOptions and left out\n// here (missing property), or a stale key kept here after a field is removed (excess property).\nconst PLUGIN_OPTION_KEY_TABLE = {\n binary: true,\n cwd: true,\n tsconfig: true,\n clientRoutes: true,\n genDir: true,\n emitMode: true,\n validate: true,\n parallelScan: true,\n parallelRender: true,\n singleThreaded: true,\n hashLength: true,\n patternSampleCount: true,\n patternSampleRetries: true,\n maxUnknownKeys: true,\n jsonMaxBytes: true,\n markers: true,\n moduleMode: true,\n inlineMode: true,\n transformMode: true,\n sourcesContent: true,\n downgradeErrors: true,\n levels: true,\n logStyle: true,\n jsRuntime: true,\n detachResolver: true,\n devServer: true,\n pureFnReport: true,\n onPureFnReport: true,\n onBatchReport: true,\n onSiteFilesChanged: true,\n onGenerate: true,\n enrich: true,\n} satisfies Record<keyof PluginOptions, true>;\n\n// The plugin-option parity test compares this list to the generated TSCONFIG_PLUGIN_KEYS, so an option\n// added on only one side fails CI.\nexport const PLUGIN_OPTION_KEYS = Object.keys(PLUGIN_OPTION_KEY_TABLE) as (keyof PluginOptions)[];\n"]}
@@ -107,6 +107,7 @@ export interface TransformResult {
107
107
  code?: string;
108
108
  map?: SourceMap;
109
109
  importBlock?: string;
110
+ importAt?: number;
110
111
  edits?: Edit[];
111
112
  sourceHash?: string;
112
113
  emittedModules?: string[];
@@ -176,6 +177,7 @@ export interface Response {
176
177
  entryModules?: Record<string, string>;
177
178
  generated?: string[];
178
179
  siteFiles?: string[];
180
+ programHash?: string;
179
181
  enrichFiles?: EnrichFile[];
180
182
  outDir?: string;
181
183
  batchesModule?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/core/protocol.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,mBAAmB,EAAyB,MAAM,4CAA4C,CAAC;AACjI,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,mBAAmB,EAAyB,CAAC;AAI/E,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,gDAAgD,CAAC;AAuXxD,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;IAEV,IAAI,EAAE,CAAC;CACC,CAAC;AAIX,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;CACC,CAAC;AAMX,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/core/protocol.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,mBAAmB,EAAyB,MAAM,4CAA4C,CAAC;AACjI,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,mBAAmB,EAAyB,CAAC;AAI/E,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,gDAAgD,CAAC;AAyXxD,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;IAEV,IAAI,EAAE,CAAC;CACC,CAAC;AAIX,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;CACC,CAAC;AAMX,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,CAAC;CACF,CAAC","sourcesContent":["// Wire types mirroring Go's internal/reflection/runtype.go and internal/protocol/protocol.go.\n// The interfaces are hand-maintained to keep the plugin dep-free; the ReflectionKind enum,\n// KIND_REF sentinel and REFLECTION_SUB_KIND map are generated from the same Go source, so the\n// kind/sub-kind discriminators cannot drift. Child RunType slots on the wire are sentinels\n// (`{kind: -1, id: N}`); consumers re-knot them, or import the generated cache module whose\n// graph is already knotted.\n\n// Generated from internal/reflection/{runtype,subkind}.go, the same source as @mionjs/run-types's\n// RunTypeKind / RunTypeSubKind; re-exported here so `import {ReflectionKind} from './protocol.ts'` sites are unchanged.\nimport {KIND_REF, ReflectionKind, REFLECTION_SUB_KIND, type ReflectionSubKind} from './go-generated/reflectionKind.generated.ts';\nexport {KIND_REF, ReflectionKind, REFLECTION_SUB_KIND, type ReflectionSubKind};\n\n// Cache-module settings generated from internal/constants/constants.go, the single source of\n// truth; regenerate with `pnpm miondevx core codegen constants`.\nexport {\n CACHE_MODULES,\n RUNTYPES_VAR_PREFIX,\n RUNTYPES_MODULE_NAME,\n VALIDATE_VAR_PREFIX,\n VALIDATE_MODULE_NAME,\n type CacheModuleSettings,\n} from './go-generated/runtypes-constants.generated.ts';\n\nexport interface ClassRef {\n // \"Date\" | \"Map\" | \"Set\" | \"RegExp\"; the footer wires `t.classType = globalThis.<builtin>`.\n builtin?: string;\n // user-class export name + originating module path (v2 lazy import).\n name?: string;\n module?: string;\n}\n\n// RunType is a JSON-friendly union of every reflection variant; optional fields follow the `kind` discriminator.\n// `id` is a short alphanumeric structural hash (default 7 chars), so two structurally-equal types share one id.\nexport interface RunType {\n id?: string;\n kind: ReflectionKind | typeof KIND_REF;\n subKind?: number;\n\n // TypeAnnotations\n typeName?: string;\n typeArguments?: RunType[];\n isCircular?: boolean;\n // Kinds validation and the JSON round trip skip (function-like, symbol, never, non-serialisable class), not their children.\n notSupported?: boolean;\n\n // TypeLiteral\n literal?: unknown;\n\n // shared\n name?: string;\n optional?: true;\n readonly?: true;\n visibility?: number;\n isAbstract?: true;\n isStatic?: true;\n // Property / method nodes only: `name` is a valid identifier or all digits, so dot access works.\n // Missing means bracket notation is required.\n isSafeName?: true;\n // Parameter / tupleMember nodes only: 0-based slot index, a number rather than a flag because zero is a valid slot.\n position?: number;\n defaultVal?: unknown;\n description?: string;\n flags?: string[];\n\n // function-like\n parameters?: RunType[];\n return?: RunType;\n\n // single-typed containers (array/promise/tupleMember/property/parameter)\n child?: RunType;\n index?: RunType;\n\n // multi-typed containers (objectLiteral/class/tuple/union/intersection/enum)\n children?: RunType[];\n\n // Union only: the same refs as `children`, reordered so supersets precede subsets and no member is unreachable at validate time.\n safeUnionChildren?: RunType[];\n\n // Union only, parallel to `safeUnionChildren`: entry i refs the discriminator property of member i,\n // null for a non-object member. Read entry.name for the key and entry.child for the expected type.\n // Absent when no usable discriminator was found. Lives on the union, not the property node: the same\n // canonical property may discriminate one parent union and not another.\n unionDiscriminators?: (RunType | null | undefined)[];\n\n // The OPEN extension point: objectLiteral refs left by collapsing an intersection like `string & {__brand}`.\n // The engine never interprets them (formatAnnotation below is the CLOSED counterpart); mirrors deepkit's TypeAnnotations.decorators.\n typeMeta?: RunType[];\n\n // Set when a primitive is branded with a TypeFormat<Base, Name, Params, ...> marker from `@mionjs/run-types/formats`.\n // The structural id folds name + canonicalised params in, so key order never splits one entry into two.\n // Recognition rides the unforgeable unique-symbol sentinels, so a hand-written typeMeta object can never trigger it.\n formatAnnotation?: FormatAnnotation;\n\n // enum\n enumVal?: Record<string, unknown>;\n values?: unknown[];\n indexType?: RunType;\n\n // class\n extendsArguments?: RunType[];\n implements?: RunType[];\n arguments?: RunType[];\n classRef?: ClassRef;\n\n // objectLiteral (interface form): refs to the directly extended interfaces, empty for anonymous literals and `type` aliases.\n // Inherited properties are ALSO in `children`, so the runtime path stays flat while codegen can walk the inheritance tree.\n extends?: RunType[];\n\n // Runtime-only live constructor (globalThis.Date for a KindClass builtin), wired by the cache emitter; never in wire JSON.\n classType?: unknown;\n}\n\n// Site is one injection point: `pos` is the byte offset of the call's closing `)`, where the patcher inserts.\n// `paramIndex` is the 0-based slot the injected id takes; when `argsCount` falls short of it the patcher pads with `undefined`.\nexport interface Site {\n file: string;\n pos: number;\n id: string;\n paramIndex?: number;\n argsCount?: number;\n // The opaque fn hash an InjectTypeFnArgs site injects, never the family name the marker spells.\n // Present means the patcher injects a `[id, fnId]` tuple, not the bare `\"id\"`; absent means a reflection-only site.\n fnId?: string;\n // Every fnId a multi-function InjectTypeFnArgs<T, F1, F2, …> site injects, e.g. createStandardSchema's <T,'val','verr'>:\n // an ARRAY of entry-tuple bindings at the single paramIndex, in this order. fnId mirrors fnIds[0] when both are set.\n fnIds?: string[];\n // Go-internal emit metadata, mirrored for accuracy; the plugin does not read it.\n demand?: SiteDemand[];\n // True when the argument list was already written with a trailing comma, so the injector splices WITHOUT a leading one.\n // Otherwise the two commas produce an empty argument `f(a, , …)`, which is invalid JS.\n trailingComma?: boolean;\n // True for a `new X` written without parens: pos is the expression end and the inserted args carry their own `(...)`.\n noArgList?: boolean;\n // allSingle mode: the bundle-module BASENAME to import the binding from (`rtmod:/<module>.js`) instead of the entry's\n // own module; the clause shape is identical either way. Mirrors modules[0] when both are set.\n module?: string;\n // One bundle basename per fnId, positional with fnIds: allSingle gives each family its own bundle, so a single\n // `module` cannot address a multi-fn site. Present only for multi-fn allSingle sites.\n modules?: string[];\n}\n\n// SiteDemand mirrors Go protocol.SiteDemand: emit metadata only, the plugin never reads it.\nexport interface SiteDemand {\n family: string;\n variant?: string;\n options?: string[];\n fnHash?: string;\n}\n\n// Replacement replaces [start, end) with text: the pure-fn extractor swaps every\n// `registerPureFnFactory(ns, fn, factory)` factory argument for the entry-module import binding,\n// so the canonical fn body lives only in the emitted entry module.\nexport interface Replacement {\n file: string;\n start: number;\n end: number;\n text: string;\n // The virtual-module specifier the substituted expression needs (`rtmod:/pf/rt/foo.js`);\n // `text` IS its export name, so the rewrite imports `{<text>}` directly.\n importFrom?: string;\n // The export name to import when `text` is not it (a trailing-slot splice padded with `undefined`,\n // the bundled-API lane). Absent means `text` is the binding.\n importBinding?: string;\n}\n\n// PureFnSite mirrors Go protocol.PureFnSite: one generated pure-fn entry, delivered through the\n// `onPureFnReport` callback or `<genDir>/types/pure-fns-report.json`, only when the report is enabled.\n// Each record is SELF-CONTAINED (`code` + `paramNames` inline), so a consumer never reads a generated\n// module file and the shape holds across every `moduleMode`.\nexport interface PureFnSite {\n // The registrar call site's factory-argument span (byte offsets).\n file: string;\n start: number;\n end: number;\n // The pure fn's id: owning package plus a hash of the shipped body (`@acme/text:9Zt1bRm4cV`).\n key: string;\n // The identifier the registration was assigned to, absent when written straight into a call.\n // Not part of the id; carried because a report of hashes names nothing a reader can search for.\n bindingName?: string;\n // The identifier the site invoked (a registrar, a wrapper like `inputFrom`, a renamed import) and the\n // nearest-package.json / ambient-module name of the file that DECLARES it, so a consumer can attribute\n // a site to the framework that exposed the registrar even through a wrapper-only file.\n calleeName?: string;\n calleeModule?: string;\n // `direct` (arg IS the pure fn, wrapped) | `factory` (arg is a factory).\n form?: string;\n // Generated module basename: per-entry `pf/<id>` in default/allModules mode, the single `pf` bundle in allSingle.\n module?: string;\n // Entry payload — emitMode-honoring (`code` empty when the mode ships no body).\n paramNames?: string[];\n code?: string;\n pureFnDependencies?: string[];\n}\n\n// BatchMapping mirrors Go protocol.BatchMapping: one `inputFrom(source, mapper)` link inside a request batch.\n// The server feeds route `fromId`'s output through the mapper `mapperKey` into argument `paramIndex` of route `toId`.\nexport interface BatchMapping {\n fromId: string;\n toId: string;\n paramIndex: number;\n // The mapper's pure-fn id, the same one injected at that call.\n mapperKey: string;\n}\n\n// BatchSite mirrors Go protocol.BatchSite: one `batch([...])` call site, so the server build registers\n// the plan under the same id the client bundle carries. Delivered through `onBatchReport` or\n// `<genDir>/types/batches-report.json`, only when the build report is enabled; the id is injected regardless.\nexport interface BatchSite {\n // The `batch(...)` call expression's span (byte offsets).\n file: string;\n start: number;\n end: number;\n // The injected id: `b_<hash>` of the ordered route ids.\n batchId: string;\n // The batched routes in call order (`users/getById`).\n routeIds: string[];\n // The `inputFrom()` links, sorted by (toId, paramIndex).\n mappings?: BatchMapping[];\n // The identifier the site invoked (`batch`, or a framework wrapper) and the\n // package that declares it.\n calleeName?: string;\n calleeModule?: string;\n}\n\n// TransformResult mirrors Go protocol.TransformResult, one per file, in the wire shape Request.emitEdits selects:\n// - 'go' mode (unset): `code` + `map`, which the plugin plumbs straight to the bundler.\n// - 'edits' mode (set): `importBlock` + `edits` + `sourceHash` for apply-edits.ts, O(sites) instead of file + map.\nexport interface TransformResult {\n code?: string;\n map?: SourceMap;\n // 'edits' mode: deduped import block for `importAt`, one physical line, relativized to <outDir>/types in files mode.\n importBlock?: string;\n // 'edits' mode: UTF-16 offset of `importBlock`, past `#!` and the directive prologue (both stay first). Absent = 0.\n importAt?: number;\n // 'edits' mode: the flat point/span edit list, NOT the import block, in UTF-16 code-unit offsets\n // against the ORIGINAL source (the FE indexes JS strings natively).\n edits?: Edit[];\n // 'edits' mode: FNV-1a/32 hash of the source bytes the offsets index.\n // On mismatch the applier re-uploads the source (setSources) and re-requests, rather than misplacing every offset.\n sourceHash?: string;\n emittedModules?: string[];\n // The source files that DECLARE the types this file's call sites reflect: edges no bundler can see, since\n // `import type` is erased and an ambient `.d.ts` type never had one. A host declares these to its bundler\n // (`addWatchFile` / `addDependency`) so editing a type re-runs the files that reflect it. Absolute, sorted, deduped.\n // EMPTY MEANS UNKNOWN, NOT 'no dependencies': read as \"nothing to declare\" it ships a stale validator,\n // silently, since a stale validator does not error, it accepts data the current type rejects.\n // Fall back to coarse invalidation instead.\n typeDeps?: string[];\n}\n\n// Edit mirrors Go protocol.Edit: a point insertion (start === end) or span replacement (start < end),\n// in UTF-16 CODE-UNIT offsets against the original source. 'edits'-mode transform only.\nexport interface Edit {\n start: number;\n end: number;\n text: string;\n}\n\n// SourceMap is a standard source-map v3 object (the shape Vite/Rollup accept).\nexport interface SourceMap {\n version: number;\n sources: (string | null)[];\n sourcesContent: (string | null)[];\n names: string[];\n mappings: string;\n}\n\n// FormatAnnotation mirrors Go protocol.FormatAnnotation: the (name, params) pair from a TypeFormat<> brand.\n// Params is sorted and canonicalised before it feeds the cache key, so two orderings of one params object share an ID.\nexport interface FormatAnnotation {\n name: string;\n params?: Record<string, unknown>;\n}\n\nexport interface Request {\n op: 'scanFiles' | 'dump' | 'setSources' | 'reset' | 'tsCompile' | 'transform' | 'generate' | 'enrich';\n // The op's file input: the files to scan (scanFiles), rewrite (transform) or enrichment-check (enrich).\n // The response's sites cover every listed file, each tagged with .file; the include* flags project\n // runTypes / entryModules over these files only, never the session-wide cache (use dump for that).\n files?: string[];\n // setSources only — { relpath: source-text }.\n sources?: Record<string, string>;\n // scanFiles only: the response includes a runTypes slice covering the request's files.\n includeRunTypes?: boolean;\n // scanFiles only: the response carries the per-entry virtual module map scoped to the request's files.\n // `dump` always carries the full session's modules.\n includeEntryModules?: boolean;\n // Opts into the `metrics` block: tsgo extendedDiagnostics counters, per-phase wall times, Go memory deltas.\n // Mirrors the Go-side Request.IncludeMetrics; zero measurement cost when unset.\n includeMetrics?: boolean;\n // scanFiles only: the enrichment-health pass (tag hygiene, FriendlyText/MockData content, breadcrumb drift),\n // appended to diagnostics as Family.Enrich. Off by default so the rewrite pipeline pays nothing; the lint plugin consumes it.\n checkEnrich?: boolean;\n // scanFiles only: the mion route rules (handler annotations, a throw escaping a handler, a declared error that is\n // not an RpcError, a property named after a prototype slot), appended as Family.MionRoute. Off by default, because\n // every one is an error-severity code and a build running them would fail on a finding the team may have turned off in lint.\n checkRouterRules?: boolean;\n // scanFiles only: the RunType-family diagnostics WITHOUT the entry-module payload. Implied by includeEntryModules;\n // the lint plugin sets it so one scan surfaces everything a build would.\n includeRtDiagnostics?: boolean;\n // transform only: 'edits' mode instead of 'go' mode. A per-request wire knob, because the artifacts are identical\n // either way, so it never affects the disk cache.\n emitEdits?: boolean;\n // enrich carries NOTHING beyond `files` (empty = whole program): the families, i18n locales and output root ride\n // the spawn flags (--gen-dir / --enrich-*), defaulting from the tsconfig plugin entry.\n}\n\n// Metrics mirrors Go protocol.Metrics, present only when the request set includeMetrics.\n// The counters mirror tsc's `--extendedDiagnostics`, read off the live tsgo Program post-op;\n// the *Ms group is wall time per pipeline phase and renderMs is keyed by cache kind.\n// allocBytes / mallocs / numGC are deltas over the op; heapAlloc / heapInuse are post-op snapshots.\nexport interface Metrics {\n files?: number;\n lines?: number;\n identifiers?: number;\n symbols?: number;\n types?: number;\n instantiations?: number;\n setSourcesMs?: number;\n markerScanMs?: number;\n pureFnsMs?: number;\n prepMs?: number;\n scopedDumpMs?: number;\n renderMs?: Record<string, number>;\n totalMs?: number;\n allocBytes?: number;\n mallocs?: number;\n numGC?: number;\n heapAlloc?: number;\n heapInuse?: number;\n cacheNodes?: number;\n}\n\nexport interface Response {\n id?: string;\n // Acknowledgement for ops that return no data (setSources / reset).\n ok?: true;\n added?: RunType[];\n // Either added* flag regenerates the cache modules; an edited pure-fn body arrives as a new id.\n addedRunTypes?: boolean;\n addedPureFns?: boolean;\n sites?: Site[];\n // The byte-range rewrites the Go transform applies alongside Sites during OpTransform: one per accepted\n // `registerPureFnFactory(ns, fn, factory)` call, swapping the factory argument for the entry-module import binding.\n replacements?: Replacement[];\n // The pure-fn build report: whole program on `generate`, the rescanned files' delta on `scanFiles`,\n // populated only when the resolver's pure-fn report is enabled.\n pureFnSites?: PureFnSite[];\n // generate only: the package's `mion-pure-fns/` as path to content, for the adapter to sync into the\n // bundler's output dir once the bundle is on disk. Empty when the package registers none, so a stale one is removed.\n pureFnArtifact?: Record<string, string>;\n // The request-batch build report: whole program on `generate`, the rescanned files' delta on `scanFiles`,\n // populated only when the resolver's build report is enabled.\n batchSites?: BatchSite[];\n runTypes?: RunType[];\n // One rendered ES module per cache entry, keyed by the basename in `rtmod:/<basename>.js` (the `pf/<ns>/<fn>`\n // encoding for pure fns). The in-memory variant, returned by `dump` and by `scanFiles` under includeEntryModules;\n // in files-mode `generate` writes the same modules under `<outDir>/types/` instead.\n entryModules?: Record<string, string>;\n // Manifest of live module basenames the `generate` op wrote under <outDir>/types.\n generated?: string[];\n // Sorted unique source files carrying at least one marker site, from the `generate` op, as program paths.\n // The plugin gates its per-file transform on this set, so wrapper call sites in another package\n // (node_modules included) rewrite with zero configuration.\n siteFiles?: string[];\n // `generate` only: hash of program sources, compiler options and tsconfig text, for a host caching transforms.\n programHash?: string;\n // enrich only: the computed mirror files (path + content + added + kind).\n // The daemon never writes; the caller writes them under its own HMR-suppression window.\n enrichFiles?: EnrichFile[];\n // The output root `generate` actually wrote to: with outDir left empty the resolver infers <srcDir>/.mion\n // from the tsconfig and echoes the absolute path here, so the plugin can adopt it.\n outDir?: string;\n // `generate` only: the absolute `<outDir>/rpc/batches.generated.js`, absent unless a batch and the router exist.\n batchesModule?: string;\n // The createMionRouter files the transform appends the table import to.\n routerInitFiles?: string[];\n // tsconfig `downgradeErrors` echo on `generate` and `scanFiles` for a dependency-free host; the plugin's option wins.\n downgradeErrors?: string[];\n // Echo of the tsconfig plugin's `levels` on `generate`, absent when unset; the host's own option wins.\n levels?: string;\n // Echo of the tsconfig plugin's `logStyle` on `generate`, absent when unset; the host's own option wins.\n logStyle?: string;\n // One TransformResult per file for the `transform` op, keyed by file path.\n transformed?: Record<string, TransformResult>;\n // Every non-fatal diagnostic the Go binary emits; the Family discriminator says which subsystem produced it.\n // The build plugin prints and halts on them in surface.ts.\n diagnostics?: Diagnostic[];\n // tsCompile only: wall-time (ms) of the embedded tsgo's bind + typecheck + emit pass on the current source\n // overlay, so a bench can show the pure-TypeScript compile cost next to mion's own work.\n tsCompileMs?: number;\n // Present only when the request set includeMetrics.\n metrics?: Metrics;\n error?: string;\n}\n\n// Level: was code produced (Error: no), is it broken when called (RuntimeError: yes); Warning and Info are correct.\n// Downgrade and silence decisions read THIS, never severity; it is on the wire because a local binary can outrun the catalog.\nexport const Level = {\n Error: 1,\n RuntimeError: 2,\n Warning: 3,\n // Documented behaviour or advice; every host hides it unless `levels: 'all'`.\n Info: 4,\n} as const;\nexport type Level = (typeof Level)[keyof typeof Level];\n\n// Severity is the LABEL form of Level, so both error levels read \"error\". Numeric to match the Go-side encoding.\nexport const Severity = {\n Error: 1,\n Warning: 2,\n Info: 3,\n} as const;\nexport type Severity = (typeof Severity)[keyof typeof Severity];\n\n// Family classifies a Diagnostic by the subsystem that produced it, numeric on the wire like Severity.\n// Enrich covers the opt-in enrichment-health pass (Request.checkEnrich): tag hygiene, FriendlyText / MockData\n// content validity, mirror breadcrumb drift. MionRoute covers the opt-in route rules (Request.checkRouterRules).\nexport const Family = {\n PureFn: 1,\n Marker: 2,\n RunType: 3,\n Enrich: 4,\n MionRoute: 5,\n Drizzle: 6,\n} as const;\nexport type Family = (typeof Family)[keyof typeof Family];\n\n// DiagnosticSite is a 1-based source location; runtype-family diagnostics leave `endLine` / `endCol` zero,\n// their site being the marker call rather than a type declaration.\nexport interface DiagnosticSite {\n filePath: string;\n startLine: number;\n startCol: number;\n endLine?: number;\n endCol?: number;\n}\n\nexport interface DiagnosticRelated extends DiagnosticSite {\n message: string;\n}\n\n// EnrichFile mirrors Go protocol.EnrichFile: one computed mirror file from the `enrich` op, with the content\n// the caller writes (the daemon never does), `added` when no on-disk file existed, `kind` 'friendly' | 'mock'.\nexport interface EnrichFile {\n path: string;\n content: string;\n added?: boolean;\n kind?: string;\n}\n\n// Diagnostic mirrors the Go-side diag.Diagnostic; `code` is the stable identifier (validate-symbol-root, …).\n// The user-facing message is NOT carried on the wire: per-code templates live in the generated\n// `./go-generated/diagnosticCatalog.generated.ts` (from internal/diagnostics/messages.go via\n// `pnpm miondevx core codegen diag`) and fill their `{slot}` names from `args`, in slot order.\nexport interface Diagnostic {\n code: string;\n family: Family;\n severity: Severity;\n level: Level;\n args?: string[];\n site: DiagnosticSite;\n related?: DiagnosticRelated[];\n // Set when a source-level `@mion-downgrade-error` comment claimed this finding; level and severity stay\n // whatever the catalog says, so whoever decides to halt reads this alongside its own `downgradeErrors`.\n // Twin of the Go-side Diagnostic.Downgraded.\n downgraded?: boolean;\n}\n\nexport interface Dump {\n runTypes: RunType[];\n sites: Site[];\n}\n"]}
@@ -15,6 +15,7 @@ export interface ResolverClientOptions {
15
15
  hashLength?: number;
16
16
  patternSampleCount?: number;
17
17
  patternSampleRetries?: number;
18
+ maxUnknownKeys?: number;
18
19
  jsonMaxBytes?: boolean;
19
20
  markerPackages?: string[];
20
21
  markerPackageCheck?: boolean;
@@ -89,6 +90,7 @@ export interface GenerateResult {
89
90
  modules: string[];
90
91
  outDir: string;
91
92
  siteFiles: string[];
93
+ programHash: string;
92
94
  batchesModule: string;
93
95
  routerInitFiles: string[];
94
96
  diagnostics?: Diagnostic[];
@@ -142,7 +144,9 @@ export declare class ResolverClient extends ResolverClientBase {
142
144
  protected transport: MessageTransport;
143
145
  private intentionalClose;
144
146
  private respawnsLeft;
147
+ private fatalExit;
145
148
  constructor(binary: string, cwd: string, tsconfigPath: string, opts?: ResolverClientOptions);
149
+ private stderrTail;
146
150
  get pid(): number | undefined;
147
151
  unref(): void;
148
152
  close(): void;
@@ -5,6 +5,8 @@ const SPAWN_FAILED_PREFIX = 'spawn failed';
5
5
  function isTransportLoss(reason) {
6
6
  return reason === RESOLVER_EXITED || reason.startsWith(SPAWN_FAILED_PREFIX);
7
7
  }
8
+ const STDERR_TAIL_CHARS = 2048;
9
+ const RESOLVER_FATAL_EXIT_CODE = 1;
8
10
  const CLOSE_DRAIN_TIMEOUT_MS = 5000;
9
11
  class MessageTransport {
10
12
  stdin;
@@ -148,6 +150,7 @@ class ResolverClientBase {
148
150
  modules: resp.generated ?? [],
149
151
  outDir: resp.outDir ?? '',
150
152
  siteFiles: resp.siteFiles ?? [],
153
+ programHash: resp.programHash ?? '',
151
154
  batchesModule: resp.batchesModule ?? '',
152
155
  routerInitFiles: resp.routerInitFiles ?? [],
153
156
  diagnostics: resp.diagnostics,
@@ -222,6 +225,8 @@ export function buildResolverArgs(cwd, tsconfigPath, opts = {}) {
222
225
  args.push('--pattern-sample-count', String(opts.patternSampleCount));
223
226
  if (opts.patternSampleRetries !== undefined)
224
227
  args.push('--pattern-sample-retries', String(opts.patternSampleRetries));
228
+ if (opts.maxUnknownKeys !== undefined)
229
+ args.push('--max-unknown-keys', String(opts.maxUnknownKeys));
225
230
  if (opts.jsonMaxBytes === false)
226
231
  args.push('--json-max-bytes=false');
227
232
  if (opts.markerPackages?.length)
@@ -262,6 +267,7 @@ export class ResolverClient extends ResolverClientBase {
262
267
  transport;
263
268
  intentionalClose = false;
264
269
  respawnsLeft = 3;
270
+ fatalExit;
265
271
  constructor(binary, cwd, tsconfigPath, opts = {}) {
266
272
  super();
267
273
  this.binary = binary;
@@ -270,6 +276,7 @@ export class ResolverClient extends ResolverClientBase {
270
276
  this.opts = opts;
271
277
  this.spawnChild();
272
278
  }
279
+ stderrTail = '';
273
280
  get pid() {
274
281
  return this.child.pid;
275
282
  }
@@ -277,6 +284,7 @@ export class ResolverClient extends ResolverClientBase {
277
284
  this.child?.unref();
278
285
  unrefHandle(this.child?.stdin);
279
286
  unrefHandle(this.child?.stdout);
287
+ unrefHandle(this.child?.stderr);
280
288
  }
281
289
  close() {
282
290
  this.intentionalClose = true;
@@ -285,11 +293,17 @@ export class ResolverClient extends ResolverClientBase {
285
293
  spawnChild() {
286
294
  const args = buildResolverArgs(this.cwd, this.tsconfigPath, this.opts);
287
295
  const env = this.opts.cacheDir !== undefined ? { ...process.env, MION_CACHE_DIR: this.opts.cacheDir } : process.env;
288
- const child = spawn(this.binary, args, { stdio: ['pipe', 'pipe', 'inherit'], env });
289
- if (!child.stdin || !child.stdout) {
296
+ const child = spawn(this.binary, args, { stdio: ['pipe', 'pipe', 'pipe'], env });
297
+ if (!child.stdin || !child.stdout || !child.stderr) {
290
298
  throw new Error('failed to spawn mion (no stdio pipes)');
291
299
  }
292
300
  this.child = child;
301
+ this.stderrTail = '';
302
+ child.stderr.setEncoding('utf8');
303
+ child.stderr.on('data', (chunk) => {
304
+ process.stderr.write(chunk);
305
+ this.stderrTail = (this.stderrTail + chunk).slice(-STDERR_TAIL_CHARS);
306
+ });
293
307
  const stdin = child.stdin;
294
308
  const stdout = child.stdout;
295
309
  stdin.on('error', () => { });
@@ -302,7 +316,13 @@ export class ResolverClient extends ResolverClientBase {
302
316
  if (this.opts.inlineSources) {
303
317
  transport.writeUnframed(JSON.stringify({ sources: this.opts.inlineSources }) + '\n');
304
318
  }
305
- child.on('exit', () => transport.markClosed(RESOLVER_EXITED));
319
+ child.on('close', (code) => {
320
+ if (code === RESOLVER_FATAL_EXIT_CODE) {
321
+ const tail = this.stderrTail.trim();
322
+ this.fatalExit = `${RESOLVER_EXITED} (code ${code})${tail ? `: ${tail}` : ''}`;
323
+ }
324
+ transport.markClosed(this.fatalExit ?? RESOLVER_EXITED);
325
+ });
306
326
  }
307
327
  async send(req) {
308
328
  const attempt = this.transport;
@@ -311,6 +331,8 @@ export class ResolverClient extends ResolverClientBase {
311
331
  resp = await attempt.request(req);
312
332
  }
313
333
  catch (error) {
334
+ if (this.fatalExit)
335
+ throw new Error(this.fatalExit);
314
336
  if (!this.canRespawn())
315
337
  throw error;
316
338
  this.respawnFor(attempt);
@@ -323,7 +345,7 @@ export class ResolverClient extends ResolverClientBase {
323
345
  return resp;
324
346
  }
325
347
  canRespawn() {
326
- return !this.intentionalClose && !this.opts.serverMode && this.respawnsLeft > 0;
348
+ return !this.intentionalClose && !this.opts.serverMode && !this.fatalExit && this.respawnsLeft > 0;
327
349
  }
328
350
  respawnFor(dead) {
329
351
  if (this.transport !== dead)
@@ -1 +1 @@
1
- {"version":3,"file":"resolver-client.js","sourceRoot":"","sources":["../../src/core/resolver-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAoB,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAiB,MAAM,eAAe,CAAC;AAiH9D,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAC3C,SAAS,eAAe,CAAC,MAAc;IACrC,OAAO,MAAM,KAAK,eAAe,IAAI,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAC9E,CAAC;AAGD,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAGpC,MAAM,gBAAgB;IAaD;IAEA;IAdX,KAAK,CAAY;IACjB,KAAK,GAAiC,EAAE,CAAC;IACzC,MAAM,GAAG,KAAK,CAAC;IAGf,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,GAA0B,IAAI,CAAC;IACzC,YAAY,GAAG,CAAC,CAAC;IACjB,SAAS,GAAG,CAAC,CAAC;IACd,YAAY,GAAG,CAAC,CAAC;IAEzB,YACm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CAAC,GAAG,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,UAAU;QAChB,OAAO,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IACrG,CAAC;IAKO,UAAU,CAAC,IAAsB;QACvC,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI;YAAE,OAAO;QACpC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,4GAA4G,CAAC,CAAC;QAC5H,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;CACF;AAKD,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAChD,SAAS,CAAmB;IAEtC,YAAY,KAAe,EAAE,MAAgB,EAAE,OAAmB;QAChE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAID,UAAU,CAAC,MAAc;QACvB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF;AAKD,SAAS,WAAW,CAAC,MAA8C;IAChE,MAAkD,EAAE,KAAK,EAAE,EAAE,CAAC;AACjE,CAAC","sourcesContent":["import {spawn, type ChildProcess} from 'node:child_process';\nimport {createInterface, type Interface} from 'node:readline';\nimport type {Readable, Writable} from 'node:stream';\nimport type {\n Diagnostic,\n EnrichFile,\n Metrics,\n BatchSite,\n PureFnSite,\n Replacement,\n Request,\n Response,\n RunType,\n Site,\n TransformResult,\n} from './protocol.ts';\nimport type {ClientRoutes} from './go-generated/runtypes-constants.generated.ts';\n\nexport interface ResolverClientOptions {\n // Spawns `serve --sources stdin` and writes this map as the first stdin line (JSON `{\"sources\": …}`) before any\n // request. Keys are paths relative to `cwd`, values TS source. No on-disk tsconfig is needed: the Go side builds\n // an inferred Program whose root files are exactly these keys.\n inlineSources?: Record<string, string>;\n // Spawns `serve --sources ops`: no startup Program, no handshake, so the client installs state via setSources\n // before scanFiles. The connection survives many setSources / reset cycles, so one child serves a whole vitest file.\n serverMode?: boolean;\n // INTERNAL cache override (tests + direct-binary power users), NOT a public plugin knob: the public RT disk cache\n // follows TypeScript's `incremental` / `composite` switch. Rides the child's MION_CACHE_DIR env var so parallel\n // spawns stay isolated. The binary fingerprints non-version build options into a subdir and folds its own version\n // into every typeID hash, so cache files never cross-contaminate between configurations or releases. Three states:\n // - a path string → child env MION_CACHE_DIR=<path>: force caching on there.\n // - an empty string → child env MION_CACHE_DIR=\"\": force caching off, overriding the project's incremental setting.\n // - undefined → MION_CACHE_DIR unset, so the binary follows the project's incremental setting (off in the\n // inline / server test modes, which carry no tsconfig).\n cacheDir?: string;\n // Forwarded as --emit-mode: what each RT entry ships in its code/factory slots. 'code' (default) is the body\n // string alone, with the factory rebuilt via `new Function`; 'functions' the live factory alone; 'both' is both;\n // 'ts' is 'both' written as typed `.ts` modules.\n emitMode?: 'code' | 'functions' | 'both' | 'ts';\n // Forwarded as --number-mode: the project-wide default for validate's `numberMode`, 'isFinite' (default) /\n // 'typeof' / 'notNaN'. A per-call-site numberMode overrides it.\n numberMode?: string;\n // Parallelism opt-outs: the binary scans markers and renders caches in parallel by default, and an explicit\n // `false` forwards --no-parallel-scan / --no-parallel-render for the serial paths (benchmark baselines, debugging).\n parallelScan?: boolean;\n parallelRender?: boolean;\n // Forwarded as --module-mode, how cache entries group into virtual modules: 'default' (runtype bundle + per-entry\n // fn modules), 'allSingle' (per-family bundles) or 'allModules' (per-node runtype modules too).\n moduleMode?: string;\n // Forwarded as --inline-mode, the child-inlining policy: 'default' (unnamed non-circular compounds inline into\n // their parents, named and circular types stay external) or 'allInternal' (all but circular, names ignored).\n inlineMode?: 'default' | 'allInternal';\n // Forwarded as --single-threaded / --no-single-threaded: one checker, serial scan/render. The lint session sets it\n // true, since per-file interactive scans gain little from the pool and a light child keeps an editor/CI host running\n // several lint runtimes under its process/memory limits. false lets a build override a tsconfig singleThreaded:true.\n singleThreaded?: boolean;\n // Forwarded as --hash-length: the short structural-hash id length in generated names (undefined = the binary\n // default, 7). The build lane forwards the bundler/tsconfig value; the lint lane never sets it.\n hashLength?: number;\n // Forwarded as --pattern-sample-count: mockSamples generated per sample-less format pattern (default 100, 0 disables).\n patternSampleCount?: number;\n // Forwarded as --pattern-sample-retries: the per-sample draw multiplier for pattern sample generation (default 10).\n patternSampleRetries?: number;\n // Forwarded as --max-unknown-keys: the per-object cap on a strict errors fn's unknown-key errors (default 10).\n maxUnknownKeys?: number;\n // false forwards --json-max-bytes=false: no root row carries its compact-JSON maximum.\n jsonMaxBytes?: boolean;\n // Extra packages allowed to declare the marker types, forwarded as --marker-packages at spawn. Session config, not\n // a per-request field: the resolver folds it in once when the Program is built, so it must ride the replayed argv.\n markerPackages?: string[];\n // false forwards --no-marker-package-check, matching markers on type name alone; the package gate is on by default.\n markerPackageCheck?: boolean;\n // Forwarded as --js-runtime: the node/bun path the resolver runs format-pattern checks on. buildResolverArgs\n // defaults it to THIS process's own execPath, so every lane has an engine with zero configuration.\n jsRuntime?: string;\n // Pure-fn build report. `pureFnReportWire` forwards --pure-fn-report-wire (populate Response.pureFnSites for the\n // in-process callback); `pureFnReportFile` also forwards --pure-fn-report-file, writing the HARDCODED, not\n // configurable `<genDir>/types/pure-fns-report.json` on generate. Off by default so the pipeline pays nothing.\n // These are the low-level flags the plugin's `pureFnReport` tri-state resolves into, named after the CLI flags.\n pureFnReportWire?: boolean;\n pureFnReportFile?: boolean;\n // Forwarded as --gen-dir: the explicit output-root override (the plugin's genDir option, absolute). Session config,\n // since EVERY op needing the root resolves it the same way (flag > tsconfig genDir > inferred <srcDir>/.mion);\n // undefined lets the Go side resolve it and echo the result back on GenerateResult.outDir.\n genDir?: string;\n // Forwarded as --client-routes; unset leaves the binary's default, 'bundle'.\n clientRoutes?: ClientRoutes;\n // Forwarded as --transform-relative: rewrite the injected import block's `rtmod:` specifiers to paths relative to\n // the resolved output root (files mode). The bundler plugin always sets it; the virtual-module lanes (batchcompile\n // pass 1, the transform-wire bench, the inline test lane) leave it off. Session config: every consumer is homogeneous.\n transformRelative?: boolean;\n // Forwarded as --omit-sources-content: drop the embedded original source from each 'go'-mode transform source map,\n // the heaviest single wire item. A spawn flag because it mirrors the immutable plugin option `sourcesContent: false`.\n // A pure wire trim: no artifact changes, and transforms are never disk-cached, so it is not a fingerprint input.\n omitSourcesContent?: boolean;\n // Enrichment session config, forwarded as --enrich-friendly / --enrich-mock / --enrich-i18n / --enrich-locales /\n // --enrich-source-locale. The wire's enrich op carries only `files`, so these flags select the families OpEnrich\n // maintains and the per-locale mirror sync (locales / sourceLocale default from the tsconfig i18n block).\n enrichFriendly?: boolean;\n enrichMock?: boolean;\n enrichI18n?: boolean;\n enrichLocales?: string[];\n enrichSourceLocale?: string;\n}\n\n// WireStats is a connection's cumulative stdio byte + request tally (UTF-8, both directions), read by the\n// transform-mode benchmark to compare 'go' vs 'edits' wire cost. Always on: counting costs nothing beside the\n// JSON encode/decode of the same lines.\nexport interface WireStats {\n bytesWritten: number;\n bytesRead: number;\n requests: number;\n}\n\n// Transport-injected error reasons for a lost connection. `send`'s respawn-retry matches on EXACTLY these\n// (a Go-side {error} response must never look retryable), so keep the literals and the matcher together.\nconst RESOLVER_EXITED = 'resolver exited';\nconst SPAWN_FAILED_PREFIX = 'spawn failed';\nfunction isTransportLoss(reason: string): boolean {\n return reason === RESOLVER_EXITED || reason.startsWith(SPAWN_FAILED_PREFIX);\n}\n\n// Enough for the child's fatal line, never a whole build log.\nconst STDERR_TAIL_CHARS = 2048;\n// The Go binary's fatal() exit code (e.g. a broken tsconfig); a panic exits 2 and stays respawnable.\nconst RESOLVER_FATAL_EXIT_CODE = 1;\n\n// How long close() waits for in-flight requests before releasing the process anyway: a hung child must not wedge teardown.\nconst CLOSE_DRAIN_TIMEOUT_MS = 5000;\n\n// JSON-per-line framing and the in-flight queue, for a spawned child or a pre-spawned launcher's pipes.\nclass MessageTransport {\n private lines: Interface;\n private queue: Array<(r: Response) => void> = [];\n private closed = false;\n // Drain state: close() came with requests still in flight, so new ones are refused, pending ones get their\n // real responses, then the connection is released (bounded by CLOSE_DRAIN_TIMEOUT_MS).\n private closing = false;\n private drainTimer: NodeJS.Timeout | null = null;\n private bytesWritten = 0;\n private bytesRead = 0;\n private requestCount = 0;\n\n constructor(\n private readonly stdin: Writable,\n stdout: Readable,\n private readonly onClose: () => void\n ) {\n this.lines = createInterface({input: stdout});\n this.lines.on('line', (line) => {\n // + 1 for the newline framing readline stripped.\n this.bytesRead += Buffer.byteLength(line, 'utf8') + 1;\n const done = this.queue.shift();\n if (!done) return;\n try {\n done(JSON.parse(line));\n } catch (e) {\n done({error: `parse: ${String(e)}`});\n }\n // Last in-flight response landed after a draining close — finish it.\n if (this.closing && this.queue.length === 0) this.finishClose();\n });\n }\n\n wireStats(): WireStats {\n return {bytesWritten: this.bytesWritten, bytesRead: this.bytesRead, requests: this.requestCount};\n }\n\n // markClosed is called by external close hooks (a child's 'exit').\n markClosed(reason: string): void {\n this.closed = true;\n this.clearDrainTimer();\n while (this.queue.length) this.queue.shift()!({error: reason});\n }\n\n // writeUnframed skips the queue: the inline-sources handshake, which the Go side reads before its request loop.\n writeUnframed(payload: string): void {\n this.stdin.write(payload);\n }\n\n async request(req: Request): Promise<Response> {\n if (this.closed || this.closing) throw new Error('resolver is closed');\n return new Promise<Response>((resolve) => {\n this.queue.push(resolve);\n const payload = JSON.stringify(req) + '\\n';\n this.bytesWritten += Buffer.byteLength(payload, 'utf8');\n this.requestCount += 1;\n this.stdin.write(payload);\n });\n }\n\n // close drains before it kills: requests already on the wire get their real responses (bounded), only then is\n // the process released. Closing eagerly here used to reject every in-flight request with \"generate: resolver\n // exited\" whenever one plugin container tore down while another still had work on the shared child (the buildEnd race).\n close(): void {\n if (this.closed || this.closing) return;\n if (this.queue.length === 0) {\n this.closed = true;\n this.onClose();\n return;\n }\n this.closing = true;\n this.drainTimer = setTimeout(() => this.finishClose(), CLOSE_DRAIN_TIMEOUT_MS);\n // Never hold the host process open just for a drain window.\n this.drainTimer.unref?.();\n }\n\n private finishClose(): void {\n if (this.closed) return;\n this.closed = true;\n this.clearDrainTimer();\n this.onClose();\n }\n\n private clearDrainTimer(): void {\n if (!this.drainTimer) return;\n clearTimeout(this.drainTimer);\n this.drainTimer = null;\n }\n}\n\n// ScanFilesOptions opts scanFiles into returning runTypes / the per-entry virtual modules, projected over the\n// request's files. All off by default, so the rewrite pipeline (which needs only site offsets) pays nothing extra.\nexport interface ScanFilesOptions {\n includeRunTypes?: boolean;\n includeEntryModules?: boolean;\n // The per-op `metrics` block (checker counters, per-phase wall times, Go memory deltas). Bench-harness use.\n includeMetrics?: boolean;\n // The enrichment-health pass (tag hygiene, FriendlyText/MockData content, breadcrumb drift) as Family.Enrich\n // diagnostics. Lint-plugin use.\n checkEnrich?: boolean;\n // The mion route rules over the request's files, as Family.MionRoute diagnostics. Lint-plugin use.\n checkRouterRules?: boolean;\n // The RunType-family render diagnostics without the entry-module payload. Lint-plugin use.\n includeRtDiagnostics?: boolean;\n}\n\n// ScanFilesResult is what scanFiles returns. Sites are flat, every site across the request's files, each tagged\n// with .file so callers can filter or group. Replacements are byte-range rewrites of the user's source (pure-fn\n// factory arg to binding) that the Go transform applies alongside Site insertions.\nexport interface ScanFilesResult {\n sites: Site[];\n replacements?: Replacement[];\n runTypes?: RunType[];\n entryModules?: Record<string, string>;\n diagnostics?: import('./protocol.ts').Diagnostic[];\n // Regenerate signals; see Response.addedRunTypes in protocol.ts.\n addedRunTypes?: boolean;\n addedPureFns?: boolean;\n // Pure-fn build report DELTA for the rescanned files, present only when the resolver's report is enabled;\n // the plugin's update-lane callback source.\n pureFnSites?: PureFnSite[];\n // Request-batch build report DELTA for the rescanned files, same gating as pureFnSites; the update-lane\n // source for `onBatchReport`.\n batchSites?: BatchSite[];\n // Present only when the request set includeMetrics.\n metrics?: Metrics;\n // Echo of the tsconfig plugin's `downgradeErrors`, so the linter lowers the same codes the build does.\n downgradeErrors?: string[];\n}\n\n// TransformFilesResult is what transform() returns: one TransformResult per requested file, keyed by file path.\n// The compiler-driven path, where Go applies the rewrite and generates the map, so the plugin just plumbs\n// {code, map} to Vite. Sites/replacements ride along for the no-op short-circuit and the tests.\nexport interface TransformFilesResult {\n transformed: Record<string, TransformResult>;\n sites: Site[];\n replacements?: Replacement[];\n diagnostics?: Diagnostic[];\n addedRunTypes?: boolean;\n addedPureFns?: boolean;\n}\n\n// GenerateResult is what generate() returns: the live manifest of module basenames under <outDir>/types, the\n// output root actually written to (the resolver-inferred <srcDir>/.mion when none was passed), the source files\n// carrying marker sites (the plugin's transform gate), and the full-program render's diagnostics (a pure-fn\n// extraction error is halt-worthy).\nexport interface GenerateResult {\n modules: string[];\n outDir: string;\n siteFiles: string[];\n // Echo of Response.programHash; '' when the resolver sent none.\n programHash: string;\n // Echo of Response.batchesModule / routerInitFiles; `batchesModule` is '' when no table was written.\n batchesModule: string;\n routerInitFiles: string[];\n diagnostics?: Diagnostic[];\n // Whole-program pure-fn build report, present only when the resolver's report is enabled: the plugin's\n // build-lane callback source, the same records written to `<genDir>/types/pure-fns-report.json`.\n pureFnSites?: PureFnSite[];\n // Whole-program request-batch build report, same gating as pureFnSites; also written to\n // `<genDir>/types/batches-report.json`.\n batchSites?: BatchSite[];\n // Echo of the tsconfig plugin's downgradeErrors, absent when the tsconfig sets none.\n // The plugin adopts it as its downgrade set: options.downgradeErrors ?? this ?? nothing.\n downgradeErrors?: string[];\n // Echo of the tsconfig plugin's `levels`, adopted the same way: options.levels ?? this.\n levels?: string;\n // Echo of the tsconfig plugin's `logStyle`, adopted the same way: options.logStyle ?? this.\n logStyle?: string;\n /** The package's `mion-pure-fns/` directory, path to content; empty when it registers no pure fn. */\n pureFnArtifact: Record<string, string>;\n}\n\n// EnrichResult is what enrich() returns: the computed mirror files, which the caller writes under its own\n// HMR-suppression window (the daemon never does), plus the hygiene diagnostics. Which families and locales are\n// synced, and where the mirror tree roots, is SESSION config (the enrich* / genDir spawn flags), never per call.\nexport interface EnrichResult {\n files: EnrichFile[];\n diagnostics?: Diagnostic[];\n}\n\n// Shared by the spawn-based and stream-based clients, so a consumer need not care which transport is in use.\nexport interface ResolverConnection {\n scanFiles(files: string[], opts?: ScanFilesOptions): Promise<ScanFilesResult>;\n transform(files: string[], opts?: TransformOptions): Promise<TransformFilesResult>;\n generate(): Promise<GenerateResult>;\n enrich(files: string[]): Promise<EnrichResult>;\n dump(): Promise<Response>;\n setSources(sources: Record<string, string>): Promise<void>;\n reset(): Promise<void>;\n tsCompile(): Promise<number>;\n wireStats(): WireStats;\n close(): void;\n}\n\n// TransformOptions selects the transform wire mode, the one genuinely per-request transform knob: `emitEdits:\n// true` is 'edits' mode, omitted or false is 'go' mode. It stays on the wire because a session can degrade from\n// edits to go mid-flight (source-hash drift, applier throw). Everything else is spawn config.\nexport interface TransformOptions {\n emitEdits?: boolean;\n}\n\n// Ops implementation shared between the two clients: `this.transport` is looked up at call time, so\n// field-initializer ordering is not a concern, and it is deliberately NOT readonly because ResolverClient\n// re-assigns it when it respawns a dead child.\nabstract class ResolverClientBase implements ResolverConnection {\n protected abstract transport: MessageTransport;\n\n // Single request path for every op; ResolverClient overrides it with the respawn-retry lane.\n protected send(req: Request): Promise<Response> {\n return this.transport.request(req);\n }\n\n async scanFiles(files: string[], opts: ScanFilesOptions = {}): Promise<ScanFilesResult> {\n if (files.length === 0) throw new Error('scanFiles: files must be non-empty');\n const req: Request = {op: 'scanFiles', files};\n if (opts.includeRunTypes) req.includeRunTypes = true;\n if (opts.includeEntryModules) req.includeEntryModules = true;\n if (opts.includeMetrics) req.includeMetrics = true;\n if (opts.checkEnrich) req.checkEnrich = true;\n if (opts.checkRouterRules) req.checkRouterRules = true;\n if (opts.includeRtDiagnostics) req.includeRtDiagnostics = true;\n const resp = await this.send(req);\n if (resp.error) throw new Error(`scanFiles [${files.join(', ')}]: ${resp.error}`);\n return {\n sites: resp.sites ?? [],\n replacements: resp.replacements,\n runTypes: resp.runTypes,\n entryModules: resp.entryModules,\n diagnostics: resp.diagnostics,\n addedRunTypes: resp.addedRunTypes,\n addedPureFns: resp.addedPureFns,\n pureFnSites: resp.pureFnSites,\n batchSites: resp.batchSites,\n metrics: resp.metrics,\n downgradeErrors: resp.downgradeErrors,\n };\n }\n\n // transform runs the compiler-driven per-file transform (OpTransform): 'go' mode (default) returns finished\n // code + map per file, 'edits' mode (opts.emitEdits) the raw edit list for the FE applier, a lighter wire.\n // Either way the plugin drives HMR off the same added* signals.\n async transform(files: string[], opts: TransformOptions = {}): Promise<TransformFilesResult> {\n if (files.length === 0) throw new Error('transform: files must be non-empty');\n const req: Request = {op: 'transform', files};\n if (opts.emitEdits) req.emitEdits = true;\n const resp = await this.send(req);\n if (resp.error) throw new Error(`transform [${files.join(', ')}]: ${resp.error}`);\n return {\n transformed: resp.transformed ?? {},\n sites: resp.sites ?? [],\n replacements: resp.replacements,\n diagnostics: resp.diagnostics,\n addedRunTypes: resp.addedRunTypes,\n addedPureFns: resp.addedPureFns,\n };\n }\n\n // generate runs OpGenerate: the resolver renders the full entry-module set and WRITES it under <outDir>/types/\n // (write-only-on-change, relativized inter-module imports, stale-file GC). The files-mode replacement for the\n // virtual-module load path. The root is SESSION config (`genDir` spawn option, else tsconfig genDir, else the\n // <srcDir>/.mion inference) and always comes back absolute in `outDir`, so a dependency-free host can adopt it.\n async generate(): Promise<GenerateResult> {\n const resp = await this.send({op: 'generate'});\n if (resp.error) throw new Error(`generate: ${resp.error}`);\n return {\n modules: resp.generated ?? [],\n outDir: resp.outDir ?? '',\n siteFiles: resp.siteFiles ?? [],\n programHash: resp.programHash ?? '',\n batchesModule: resp.batchesModule ?? '',\n routerInitFiles: resp.routerInitFiles ?? [],\n diagnostics: resp.diagnostics,\n pureFnSites: resp.pureFnSites,\n batchSites: resp.batchSites,\n downgradeErrors: resp.downgradeErrors,\n levels: resp.levels,\n logStyle: resp.logStyle,\n pureFnArtifact: resp.pureFnArtifact ?? {},\n };\n }\n\n // enrich syncs the FriendlyText / MockData mirrors for `files` (empty = whole program) and returns the computed\n // content; it NEVER writes, the caller writes under its own HMR-suppression window.\n // The wire carries only the event: the families / locales / output root are the session's spawn-time config.\n async enrich(files: string[]): Promise<EnrichResult> {\n const resp = await this.send({op: 'enrich', files});\n if (resp.error) throw new Error(`enrich: ${resp.error}`);\n return {files: resp.enrichFiles ?? [], diagnostics: resp.diagnostics};\n }\n\n async dump(): Promise<Response> {\n return this.send({op: 'dump'});\n }\n\n async setSources(sources: Record<string, string>): Promise<void> {\n const resp = await this.send({op: 'setSources', sources});\n if (resp.error) throw new Error(`setSources: ${resp.error}`);\n }\n\n // reset wipes ALL resolver state (cache, sites, Program, overlay); the contract is Session.Reset in\n // internal/compiler/resolver/resolver.go. The caller must call setSources before the next scanFiles.\n async reset(): Promise<void> {\n const resp = await this.send({op: 'reset'});\n if (resp.error) throw new Error(`reset: ${resp.error}`);\n }\n\n // tsCompile runs the embedded tsgo through bind + typecheck + Emit() on the current overlay and returns the\n // wall-time in ms: purely the TypeScript baseline, it walks no markers and renders no cache modules.\n // The caller must have called setSources first.\n async tsCompile(): Promise<number> {\n const resp = await this.send({op: 'tsCompile'});\n if (resp.error) throw new Error(`tsCompile: ${resp.error}`);\n return resp.tsCompileMs ?? 0;\n }\n\n // wireStats exposes the connection's cumulative stdio byte + request tally, read by the transform-mode\n // benchmark to compare 'go' vs 'edits' wire cost.\n wireStats(): WireStats {\n return this.transport.wireStats();\n }\n\n close(): void {\n this.transport.close();\n }\n}\n\n// buildResolverArgs assembles the resolver child's argv from client options. Shared by ResolverClient (which\n// spawns the child itself) and the lint session's spawn-shim path, which hands the argv to a pre-spawned\n// launcher (see lint/spawn-shim.ts).\nexport function buildResolverArgs(cwd: string, tsconfigPath: string, opts: ResolverClientOptions = {}): string[] {\n // The resolver protocol is the `serve` subcommand; --sources selects where its startup Program comes from\n // (project | stdin | ops). serverMode wins over inlineSources when both are set, matching the Go dispatch order.\n const args = ['serve', '--cwd', cwd];\n // Forward ONLY an explicitly configured tsconfig: unset, the Go side resolves it exactly as tsc does, searching\n // upward from cwd, so the JS side carries no config logic of its own.\n if (tsconfigPath) {\n args.push('--tsconfig', tsconfigPath);\n }\n if (opts.serverMode) args.push('--sources', 'ops');\n else if (opts.inlineSources) args.push('--sources', 'stdin');\n // cacheDir is NOT a CLI arg: it rides the child's MION_CACHE_DIR env var, set by ResolverClient's spawn.\n if (opts.emitMode) args.push('--emit-mode', opts.emitMode);\n if (opts.numberMode) args.push('--number-mode', opts.numberMode);\n if (opts.parallelScan === false) args.push('--no-parallel-scan');\n if (opts.parallelRender === false) args.push('--no-parallel-render');\n if (opts.moduleMode) args.push('--module-mode', opts.moduleMode);\n if (opts.inlineMode) args.push('--inline-mode', opts.inlineMode);\n if (opts.singleThreaded === true) args.push('--single-threaded');\n else if (opts.singleThreaded === false) args.push('--no-single-threaded');\n if (opts.hashLength !== undefined) args.push('--hash-length', String(opts.hashLength));\n if (opts.patternSampleCount !== undefined) args.push('--pattern-sample-count', String(opts.patternSampleCount));\n if (opts.patternSampleRetries !== undefined) args.push('--pattern-sample-retries', String(opts.patternSampleRetries));\n if (opts.maxUnknownKeys !== undefined) args.push('--max-unknown-keys', String(opts.maxUnknownKeys));\n if (opts.jsonMaxBytes === false) args.push('--json-max-bytes=false');\n if (opts.markerPackages?.length) args.push('--marker-packages', opts.markerPackages.join(','));\n if (opts.markerPackageCheck === false) args.push('--no-marker-package-check');\n // Always passed: the format-pattern checks need a real JS engine and THIS process is one, so its execPath is\n // the zero-config default for every lane. An explicit option pins another.\n args.push('--js-runtime', opts.jsRuntime ?? process.execPath);\n if (opts.pureFnReportWire) args.push('--pure-fn-report-wire');\n if (opts.pureFnReportFile) args.push('--pure-fn-report-file');\n // Session config the wire deliberately does not carry: the output-root override and the OpEnrich family / i18n selection.\n if (opts.genDir) args.push('--gen-dir', opts.genDir);\n if (opts.clientRoutes) args.push('--client-routes', opts.clientRoutes);\n if (opts.transformRelative) args.push('--transform-relative');\n if (opts.omitSourcesContent) args.push('--omit-sources-content');\n if (opts.enrichFriendly) args.push('--enrich-friendly');\n if (opts.enrichMock) args.push('--enrich-mock');\n if (opts.enrichI18n) args.push('--enrich-i18n');\n if (opts.enrichLocales && opts.enrichLocales.length > 0) args.push('--enrich-locales', opts.enrichLocales.join(','));\n if (opts.enrichSourceLocale) args.push('--enrich-source-locale', opts.enrichSourceLocale);\n return args;\n}\n\n// ResolverClient spawns the mion binary and drives it over its JSON-per-line stdio protocol, keeping the child\n// alive until `close()` so the Program + checker pool are amortised across queries. Three modes, all the `serve`\n// subcommand, differing only in --sources:\n// - default: `serve` (--sources project) against an on-disk tsconfig.\n// - opts.inlineSources: `serve --sources stdin`, source map written as the handshake line before any request.\n// - opts.serverMode: `serve --sources ops`, no startup Program; the caller drives the ops over stdin.\nexport class ResolverClient extends ResolverClientBase {\n private child!: ChildProcess;\n protected transport!: MessageTransport;\n // True once the OWNER closed this client: an exit after that is expected and must never trigger a respawn.\n private intentionalClose = false;\n // Lifetime respawn budget: enough for the rare transient child loss (host lifecycle races, external kills)\n // without churning forever on a host where every spawn dies.\n private respawnsLeft = 3;\n // Set by the child's own fatal(): deterministic, so reported, never respawned.\n private fatalExit: string | undefined;\n\n constructor(\n private readonly binary: string,\n private readonly cwd: string,\n private readonly tsconfigPath: string,\n private readonly opts: ResolverClientOptions = {}\n ) {\n super();\n this.spawnChild();\n }\n\n // Quoted when the child dies: its own fatal line is the real error.\n private stderrTail = '';\n // The child's OS pid (fresh after a respawn). Diagnostics + tests.\n get pid(): number | undefined {\n return this.child.pid;\n }\n\n // Releases the host process from the resolver child: it stops counting toward the event loop's keep-alive set,\n // so the host can exit when ITS OWN work is done while the resolver stays usable until then. The child is not\n // orphaned, losing the parent closes its stdin and the Go `serve` loop breaks on EOF.\n // WRONG for a BUNDLER host: a pending resolver response can be the build's only live handle, so an unref'd\n // child would let the process exit mid-build. This exists for Bun's RUNTIME loader, which keeps one resolver\n // for the whole process and never gets a buildEnd to close it (the `detachResolver` option, runtypes/bun).\n unref(): void {\n this.child?.unref();\n // The stdio pipes are libuv handles of their own and keep the loop alive, so the child handle is not enough.\n unrefHandle(this.child?.stdin);\n unrefHandle(this.child?.stdout);\n unrefHandle(this.child?.stderr);\n }\n\n override close(): void {\n this.intentionalClose = true;\n super.close();\n }\n\n // spawnChild (re)creates the child process + transport, from the constructor and again on respawn: both\n // one-shot lanes rebuild their Program from the same tsconfig or replayed inline-sources handshake, so a\n // fresh child serves requests identically.\n private spawnChild(): void {\n const args = buildResolverArgs(this.cwd, this.tsconfigPath, this.opts);\n // cacheDir rides the child's MION_CACHE_DIR env, not a CLI arg, so concurrent spawns with different cache\n // dirs don't collide. A path forces the cache on there, '' forces it off, undefined leaves the env untouched.\n const env = this.opts.cacheDir !== undefined ? {...process.env, MION_CACHE_DIR: this.opts.cacheDir} : process.env;\n const child = spawn(this.binary, args, {stdio: ['pipe', 'pipe', 'pipe'], env});\n if (!child.stdin || !child.stdout || !child.stderr) {\n throw new Error('failed to spawn mion (no stdio pipes)');\n }\n this.child = child;\n this.stderrTail = '';\n // Piped, not inherited, so a death report can quote it.\n child.stderr.setEncoding('utf8');\n child.stderr.on('data', (chunk: string) => {\n process.stderr.write(chunk);\n this.stderrTail = (this.stderrTail + chunk).slice(-STDERR_TAIL_CHARS);\n });\n const stdin = child.stdin;\n const stdout = child.stdout;\n // A write to a child that just died raises a stream error: the close handler below owns it, `send` retries.\n stdin.on('error', () => {});\n const transport = new MessageTransport(stdin, stdout, () => {\n stdin.end();\n child.kill();\n });\n this.transport = transport;\n // A spawn failure (missing binary, host limits) raises 'error' with NO 'exit', so drain in-flight requests\n // instead of hanging callers until their timeout.\n child.on('error', (error) => transport.markClosed(`${SPAWN_FAILED_PREFIX}: ${error.message}`));\n if (this.opts.inlineSources) {\n // Handshake: the Go side blocks on this line before building its Program, so a request() issued right\n // after the constructor naturally lands after it on the wire.\n transport.writeUnframed(JSON.stringify({sources: this.opts.inlineSources}) + '\\n');\n }\n // 'close', not 'exit': it fires after stdio drains, so the tail already holds the last line.\n child.on('close', (code) => {\n // The child's own verdict: a fresh child would reach the same one.\n if (code === RESOLVER_FATAL_EXIT_CODE) {\n const tail = this.stderrTail.trim();\n this.fatalExit = `${RESOLVER_EXITED} (code ${code})${tail ? `: ${tail}` : ''}`;\n }\n transport.markClosed(this.fatalExit ?? RESOLVER_EXITED);\n });\n }\n\n // An UNEXPECTED child death is retryable: the one-shot lanes are stateless across spawns, so one respawn plus\n // replay turns a transient loss (host teardown race, external kill) into a stderr warning, not a failed build.\n // serverMode is excluded: its accumulated setSources/reset state lives in the child and cannot be replayed here.\n protected override async send(req: Request): Promise<Response> {\n const attempt = this.transport;\n let resp: Response;\n try {\n resp = await attempt.request(req);\n } catch (error) {\n // 'resolver is closed': the transport was already down before this request was written, e.g. the death\n // happened between two requests.\n if (this.fatalExit) throw new Error(this.fatalExit);\n if (!this.canRespawn()) throw error;\n this.respawnFor(attempt);\n return this.transport.request(req);\n }\n if (typeof resp.error === 'string' && isTransportLoss(resp.error) && this.canRespawn()) {\n this.respawnFor(attempt);\n return this.transport.request(req);\n }\n return resp;\n }\n\n private canRespawn(): boolean {\n return !this.intentionalClose && !this.opts.serverMode && !this.fatalExit && this.respawnsLeft > 0;\n }\n\n // respawnFor replaces the dead child exactly once per loss: concurrent requests that died together all funnel\n // here, and the transport identity check makes every caller after the first reuse the fresh child.\n // Synchronous on purpose: no await between the check and the spawn, so no window for a duplicate respawn.\n private respawnFor(dead: MessageTransport): void {\n if (this.transport !== dead) return;\n this.respawnsLeft -= 1;\n console.error('[@mionjs/devtools] resolver process died unexpectedly — respawned it and retrying the interrupted request.');\n try {\n this.child.kill();\n } catch {\n // The child is already gone in the common path.\n }\n this.spawnChild();\n }\n}\n\n// ResolverStreamClient drives the same protocol over caller-supplied streams, for the lint session's spawn-shim\n// path: the stdio pipes belong to the pre-spawned launcher, not to a ChildProcess this module owns, so the\n// caller wires close/exit itself.\nexport class ResolverStreamClient extends ResolverClientBase {\n protected transport: MessageTransport;\n\n constructor(stdin: Writable, stdout: Readable, onClose: () => void) {\n super();\n this.transport = new MessageTransport(stdin, stdout, onClose);\n }\n\n // markClosed drains in-flight requests with an error once the process went away; the caller observes that\n // exit, not this class.\n markClosed(reason: string): void {\n this.transport.markClosed(reason);\n }\n}\n\n// unrefHandle releases one stdio pipe from the event loop's keep-alive set. Node backs a piped stdio stream with\n// a Socket, which has unref, but the declared Readable/Writable types do not and a future runtime might not\n// either, so this probes for the method instead of assuming it.\nfunction unrefHandle(stream: Readable | Writable | null | undefined): void {\n (stream as {unref?: () => void} | null | undefined)?.unref?.();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scan-batcher.js","sourceRoot":"","sources":["../../src/core/scan-batcher.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,iBAAiB,CAAC,IAA8B;IAC9D,IAAI,OAAO,GAAgE,IAAI,CAAC;IAEhF,SAAS,OAAO,CAAC,IAAY;QAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,KAAK,GAAa,EAAE,CAAC;YAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC/D,UAAU,CAAC,GAAG,EAAE;oBACd,OAAO,GAAG,IAAI,CAAC;oBACf,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACpC,CAAC,EAAE,CAAC,CAAC,CAAC;YACR,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC;QAC7B,CAAC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,SAAS,WAAW,CAAC,MAAuB,EAAE,IAAY;IACxD,OAAO;QACL,GAAG,MAAM;QACT,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/D,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KAC7F,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,MAAc,EAAE,SAAiB;IACjD,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,SAAS,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;AACvG,CAAC","sourcesContent":["import type {ScanFilesResult} from './resolver-client.ts';\n\n// SiteScanner is the scan surface the rewrite needs, satisfied structurally by ResolverClient and by the batcher.\nexport interface SiteScanner {\n scanFiles(files: string[]): Promise<ScanFilesResult>;\n}\n\n// createScanBatcher coalesces concurrent single-file scans into one scanFiles dispatch: the resolver\n// pipe is FIFO, and one batch spans several checker groups, so the binary's parallel marker scan\n// engages on the transform path instead of N serial round-trips (one file = one checker group).\n// The window is one macrotask (setTimeout 0): the current tick, with no perceptible latency added.\n// A failed batch falls back to per-file scans, so one unscannable file fails only its own transform.\nexport function createScanBatcher(scan: SiteScanner['scanFiles']): SiteScanner {\n let pending: {files: string[]; promise: Promise<ScanFilesResult>} | null = null;\n\n function scanOne(file: string): Promise<ScanFilesResult> {\n if (!pending) {\n const files: string[] = [];\n const promise = new Promise<ScanFilesResult>((resolve, reject) => {\n setTimeout(() => {\n pending = null;\n scan(files).then(resolve, reject);\n }, 0);\n });\n pending = {files, promise};\n }\n // The same file can be requested twice in one window (SSR + client), doubling its sites.\n if (!pending.files.includes(file)) pending.files.push(file);\n return pending.promise.then(\n (result) => projectFile(result, file),\n () => scan([file]).then((result) => projectFile(result, file))\n );\n }\n\n return {\n scanFiles(files: string[]): Promise<ScanFilesResult> {\n // The rewrite pipeline always asks for exactly one file.\n if (files.length !== 1) return scan(files);\n return scanOne(files[0]);\n },\n };\n}\n\n// projectFile narrows a batched response to one file; the per-cache added* booleans stay batch-scoped\n// (coarse invalidation signals, not per-file data). Paths arrive in two shapes: sites echo the\n// REQUESTED path verbatim, pure-fn replacements carry the program's ABSOLUTE file name. Matching on a\n// separator boundary keeps `a/user.ts` from claiming `another-user.ts`.\nfunction projectFile(result: ScanFilesResult, file: string): ScanFilesResult {\n return {\n ...result,\n sites: result.sites.filter((site) => samePath(site.file, file)),\n replacements: result.replacements?.filter((replacement) => samePath(replacement.file, file)),\n };\n}\n\nfunction samePath(tagged: string, requested: string): boolean {\n return tagged === requested || tagged.endsWith('/' + requested) || tagged.endsWith('\\\\' + requested);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"surface.js","sourceRoot":"","sources":["../../src/core/surface.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAC,cAAc,EAAC,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAoB,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAC,QAAQ,EAAkB,MAAM,eAAe,CAAC;AAOxD,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAEpC,MAAM,UAAU,QAAQ,CAAC,GAA4B,EAAE,OAAe;IACpE,IAAI,OAAO,GAAG,EAAE,IAAI,KAAK,UAAU;QAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;QAClD,OAAO,CAAC,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U,GAAG,KAAK;IAC5E,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAAG,UAAU,CAAC;IAChC,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvD,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,MAAM,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,IAAI,KAAK,QAAQ,GAAG,MAAM,EAAE,CAAC;IACvI,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;QAC/C,IAAI,IAAI,gBAAgB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3G,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Prints mion diagnostics and stops the build through whichever context a bundler gives: rollup and vite throw\n// from `error`, webpack's loader context emits without throwing, unplugin's buildStart on webpack, rspack,\n// esbuild and bun has neither.\n\nimport path from 'node:path';\nimport type {UnpluginContext, UnpluginMessage} from 'unplugin';\nimport {renderHeadline} from './diagnosticCatalog.ts';\nimport {DOWNGRADED_NOTE, isDowngraded, NONE, type DowngradeSet} from './downgradeErrors.ts';\nimport {entryOf, formatGrouped, severityLabel} from './groupedLog.ts';\nimport {isShown} from './levels.ts';\nimport type {Finding} from './types.ts';\nimport {Severity, type Diagnostic} from './protocol.ts';\n\nexport type HostContext = Partial<UnpluginContext>;\n\n// vite and rollup read `id` and `loc` to show the file and position in the terminal and the browser overlay.\nexport type HaltError = Error & Pick<UnpluginMessage, 'id' | 'loc'>;\n\nconst PREFIX = '[@mionjs/devtools]';\n\nexport function hostWarn(ctx: HostContext | undefined, message: string): void {\n if (typeof ctx?.warn === 'function') ctx.warn(message);\n else console.warn(`${PREFIX} ${message}`);\n}\n\n// `error` throws on rollup and vite; without it we throw, so a missing method never lets a failing build pass.\nexport function hostHalt(ctx: HostContext | undefined, error: HaltError): void {\n if (typeof ctx?.error === 'function') {\n ctx.error(error);\n return;\n }\n throw error;\n}\n\n// `loc` only for a finding in activeFile: vite maps a transform error's loc through that file's source map.\nexport function haltError(first: Diagnostic, count: number, activeFile?: string, cwd = process.cwd()): HaltError {\n const noun = count === 1 ? 'error' : 'errors';\n const message = `@mionjs/devtools: build stopped on ${count} mion ${noun}. First: ${formatTscDiagnostic(first)}`;\n const error: HaltError = new Error(message);\n const file = first.site.filePath;\n if (!file) return error;\n const id = path.resolve(cwd, file);\n error.id = id;\n const sameFile = activeFile === undefined || path.resolve(cwd, activeFile) === id;\n if (sameFile && first.site.startLine > 0) {\n error.loc = {file: id, line: first.site.startLine, column: Math.max(0, first.site.startCol - 1)};\n }\n return error;\n}\n\ninterface SurfaceOptions {\n // A downgraded finding never halts, whatever this returns.\n halts: (diagnostic: Diagnostic) => boolean;\n downgrade?: DowngradeSet;\n showInfo?: boolean;\n // The file a transform hook is on; a halt's position is attached only when it belongs there.\n activeFile?: string;\n // Base for a relative site or activeFile: the plugin's working directory.\n cwd?: string;\n // The `logStyle` setting: one grouped block per call, or one warning per finding.\n grouped: boolean;\n}\n\nexport function printFindings(\n ctx: HostContext | undefined,\n findings: readonly Finding[],\n grouped: boolean,\n cwd = process.cwd()\n): void {\n if (findings.length === 0) return;\n if (grouped) {\n hostWarn(\n ctx,\n formatGrouped(\n findings.map(({diagnostic, downgraded}) => entryOf(diagnostic, downgraded)),\n cwd\n )\n );\n return;\n }\n for (const {diagnostic, downgraded} of findings)\n hostWarn(ctx, downgraded ? formatDowngraded(diagnostic) : formatTscDiagnostic(diagnostic));\n}\n\n// Halts ONCE after printing, so the failure sits below the list; this one loop makes every halt follow `downgrade`.\nexport function surfaceDiagnostics(ctx: HostContext | undefined, diagnostics: Diagnostic[], options: SurfaceOptions): void {\n let first: Diagnostic | undefined;\n let count = 0;\n const findings: Finding[] = [];\n for (const diagnostic of diagnostics) {\n if (!isShown(diagnostic, options.showInfo ?? false)) continue;\n // NONE, not a skip: a `@mion-downgrade-error` comment lowers its finding even with no set configured.\n const downgraded = isDowngraded(options.downgrade ?? NONE, diagnostic);\n findings.push({diagnostic, downgraded});\n if (downgraded || !options.halts(diagnostic)) continue;\n count += 1;\n first ??= diagnostic;\n }\n printFindings(ctx, findings, options.grouped, options.cwd);\n if (first) hostHalt(ctx, haltError(first, count, options.activeFile, options.cwd));\n}\n\n// The one place that sets the `warning` label and the downgraded note together.\nexport function formatDowngraded(diagnostic: Diagnostic): string {\n return formatTscDiagnostic({...diagnostic, severity: Severity.Warning}, true);\n}\n\n// Same line format `mion compile` prints; the wire carries only code + args, so the headline comes from the catalog.\nexport function formatTscDiagnostic(diagnostic: Diagnostic, downgraded = false): string {\n const {site, code} = diagnostic;\n const headline = renderHeadline(code, diagnostic.args);\n // Without the note a downgraded finding reads like one that was always a warning.\n const suffix = downgraded ? ` ${DOWNGRADED_NOTE}` : '';\n let line = `${site.filePath}(${site.startLine},${site.startCol}): ${severityLabel(diagnostic.severity)} ${code}: ${headline}${suffix}`;\n for (const related of diagnostic.related ?? []) {\n line += `\\n Related: ${related.filePath}(${related.startLine},${related.startCol}): ${related.message}`;\n }\n return line;\n}\n"]}