@ttsc/playground 0.30.4 → 0.31.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 (180) hide show
  1. package/README.md +6 -4
  2. package/lib/src/compiler/buildTsconfigJSON.d.ts +5 -0
  3. package/lib/src/compiler/buildTsconfigJSON.js +5 -0
  4. package/lib/src/compiler/buildTsconfigJSON.js.map +1 -1
  5. package/lib/src/compiler/createTypiaSourcePackMount.d.ts +9 -3
  6. package/lib/src/compiler/createTypiaSourcePackMount.js +9 -3
  7. package/lib/src/compiler/createTypiaSourcePackMount.js.map +1 -1
  8. package/lib/src/compiler/createWorkerCompiler.d.ts +5 -0
  9. package/lib/src/compiler/createWorkerCompiler.js +5 -0
  10. package/lib/src/compiler/createWorkerCompiler.js.map +1 -1
  11. package/lib/src/compiler/installDependenciesIntoMemFS.d.ts +5 -0
  12. package/lib/src/compiler/installDependenciesIntoMemFS.js +5 -0
  13. package/lib/src/compiler/installDependenciesIntoMemFS.js.map +1 -1
  14. package/lib/src/compiler/installTypiaSourcePack.d.ts +7 -2
  15. package/lib/src/compiler/installTypiaSourcePack.js +7 -2
  16. package/lib/src/compiler/installTypiaSourcePack.js.map +1 -1
  17. package/lib/src/compiler/internal/createWorkerCompilerService.d.ts +31 -0
  18. package/lib/src/compiler/internal/createWorkerCompilerService.js +22 -4
  19. package/lib/src/compiler/internal/createWorkerCompilerService.js.map +1 -1
  20. package/lib/src/compiler/internal/joinUnder.d.ts +5 -0
  21. package/lib/src/compiler/internal/joinUnder.js +5 -0
  22. package/lib/src/compiler/internal/joinUnder.js.map +1 -1
  23. package/lib/src/compiler/internal/parseLintDiagnostics.d.ts +5 -0
  24. package/lib/src/compiler/internal/parseLintDiagnostics.js +8 -3
  25. package/lib/src/compiler/internal/parseLintDiagnostics.js.map +1 -1
  26. package/lib/src/compiler/internal/safeParseTypiaTransform.d.ts +14 -1
  27. package/lib/src/compiler/internal/safeParseTypiaTransform.js +12 -1
  28. package/lib/src/compiler/internal/safeParseTypiaTransform.js.map +1 -1
  29. package/lib/src/compiler/lineColumnOf.d.ts +9 -1
  30. package/lib/src/compiler/lineColumnOf.js +23 -7
  31. package/lib/src/compiler/lineColumnOf.js.map +1 -1
  32. package/lib/src/compiler/loadTypiaSourcePack.d.ts +23 -1
  33. package/lib/src/compiler/loadTypiaSourcePack.js +48 -12
  34. package/lib/src/compiler/loadTypiaSourcePack.js.map +1 -1
  35. package/lib/src/compiler/mapDiagnostic.d.ts +7 -2
  36. package/lib/src/compiler/mapDiagnostic.js +53 -6
  37. package/lib/src/compiler/mapDiagnostic.js.map +1 -1
  38. package/lib/src/compiler/normalizeError.d.ts +9 -1
  39. package/lib/src/compiler/normalizeError.js +9 -1
  40. package/lib/src/compiler/normalizeError.js.map +1 -1
  41. package/lib/src/compiler/normalizeNodeModulePath.d.ts +5 -0
  42. package/lib/src/compiler/normalizeNodeModulePath.js +5 -0
  43. package/lib/src/compiler/normalizeNodeModulePath.js.map +1 -1
  44. package/lib/src/compiler/pickEmittedJS.d.ts +9 -2
  45. package/lib/src/compiler/pickEmittedJS.js +23 -6
  46. package/lib/src/compiler/pickEmittedJS.js.map +1 -1
  47. package/lib/src/npm/collectExternalPackageNames.d.ts +17 -0
  48. package/lib/src/npm/collectExternalPackageNames.js +51 -11
  49. package/lib/src/npm/collectExternalPackageNames.js.map +1 -1
  50. package/lib/src/npm/installPlaygroundDependencies.d.ts +10 -2
  51. package/lib/src/npm/installPlaygroundDependencies.js +18 -4
  52. package/lib/src/npm/installPlaygroundDependencies.js.map +1 -1
  53. package/lib/src/npm/internal/npmRegistry.d.ts +149 -2
  54. package/lib/src/npm/internal/npmRegistry.js +95 -4
  55. package/lib/src/npm/internal/npmRegistry.js.map +1 -1
  56. package/lib/src/npm/packageNameFromSpecifier.d.ts +5 -0
  57. package/lib/src/npm/packageNameFromSpecifier.js +7 -0
  58. package/lib/src/npm/packageNameFromSpecifier.js.map +1 -1
  59. package/lib/src/react/ConsoleViewer.d.ts +9 -0
  60. package/lib/src/react/ConsoleViewer.js +11 -2
  61. package/lib/src/react/ConsoleViewer.js.map +1 -1
  62. package/lib/src/react/DependencyProgressModal.d.ts +9 -0
  63. package/lib/src/react/DependencyProgressModal.js +9 -0
  64. package/lib/src/react/DependencyProgressModal.js.map +1 -1
  65. package/lib/src/react/DiagnosticsPanel.d.ts +9 -0
  66. package/lib/src/react/DiagnosticsPanel.js +9 -0
  67. package/lib/src/react/DiagnosticsPanel.js.map +1 -1
  68. package/lib/src/react/ExamplePicker.d.ts +9 -0
  69. package/lib/src/react/ExamplePicker.js +14 -2
  70. package/lib/src/react/ExamplePicker.js.map +1 -1
  71. package/lib/src/react/LintPane.d.ts +5 -0
  72. package/lib/src/react/LintPane.js +5 -0
  73. package/lib/src/react/LintPane.js.map +1 -1
  74. package/lib/src/react/OptionsPanel.d.ts +10 -0
  75. package/lib/src/react/OptionsPanel.js +19 -4
  76. package/lib/src/react/OptionsPanel.js.map +1 -1
  77. package/lib/src/react/PlaygroundShell.d.ts +13 -0
  78. package/lib/src/react/PlaygroundShell.js +17 -5
  79. package/lib/src/react/PlaygroundShell.js.map +1 -1
  80. package/lib/src/react/ResultViewer.d.ts +5 -0
  81. package/lib/src/react/ResultViewer.js +27 -7
  82. package/lib/src/react/ResultViewer.js.map +1 -1
  83. package/lib/src/react/SourceEditor.d.ts +10 -0
  84. package/lib/src/react/SourceEditor.js +10 -0
  85. package/lib/src/react/SourceEditor.js.map +1 -1
  86. package/lib/src/react/createCompilerClient.d.ts +5 -0
  87. package/lib/src/react/createCompilerClient.js +5 -0
  88. package/lib/src/react/createCompilerClient.js.map +1 -1
  89. package/lib/src/react/internal/PlaygroundCompilerLifecycle.d.ts +64 -1
  90. package/lib/src/react/internal/PlaygroundCompilerLifecycle.js +48 -0
  91. package/lib/src/react/internal/PlaygroundCompilerLifecycle.js.map +1 -1
  92. package/lib/src/react/internal/PlaygroundExecutionLifecycle.d.ts +42 -2
  93. package/lib/src/react/internal/PlaygroundExecutionLifecycle.js +18 -0
  94. package/lib/src/react/internal/PlaygroundExecutionLifecycle.js.map +1 -1
  95. package/lib/src/react/internal/recoverTerminalCompilerWorker.d.ts +46 -4
  96. package/lib/src/react/internal/recoverTerminalCompilerWorker.js +14 -1
  97. package/lib/src/react/internal/recoverTerminalCompilerWorker.js.map +1 -1
  98. package/lib/src/sandbox/createSandboxRequire.d.ts +12 -3
  99. package/lib/src/sandbox/createSandboxRequire.js +26 -12
  100. package/lib/src/sandbox/createSandboxRequire.js.map +1 -1
  101. package/lib/src/sandbox/loadTypiaRuntimePack.d.ts +22 -0
  102. package/lib/src/sandbox/loadTypiaRuntimePack.js +30 -1
  103. package/lib/src/sandbox/loadTypiaRuntimePack.js.map +1 -1
  104. package/lib/src/structures/IBuildTsconfigOptions.d.ts +9 -1
  105. package/lib/src/structures/ICompilerService.d.ts +112 -2
  106. package/lib/src/structures/IConsoleMessage.d.ts +5 -0
  107. package/lib/src/structures/ICreateCompilerClientOptions.d.ts +9 -2
  108. package/lib/src/structures/ICreateWorkerCompilerOptions.d.ts +11 -3
  109. package/lib/src/structures/IInstallTypiaSourcePackOptions.d.ts +7 -1
  110. package/lib/src/structures/ILintPluginConfig.d.ts +8 -1
  111. package/lib/src/structures/ILoadTypiaRuntimePackOptions.d.ts +8 -1
  112. package/lib/src/structures/IOptionToggle.d.ts +5 -0
  113. package/lib/src/structures/IPlaygroundDependencyInstallOptions.d.ts +41 -6
  114. package/lib/src/structures/IPlaygroundDependencyInstallResult.d.ts +8 -1
  115. package/lib/src/structures/IPlaygroundDependencyPackage.d.ts +9 -1
  116. package/lib/src/structures/IPlaygroundDependencyProgress.d.ts +9 -1
  117. package/lib/src/structures/IPlaygroundDependencyProgressPhase.d.ts +7 -2
  118. package/lib/src/structures/IPlaygroundDependencyRequest.d.ts +8 -1
  119. package/lib/src/structures/IPlaygroundExample.d.ts +5 -0
  120. package/lib/src/structures/IPlaygroundInstalledDependency.d.ts +8 -1
  121. package/lib/src/structures/IPlaygroundShellProps.d.ts +53 -19
  122. package/lib/src/structures/ISourceEditorProps.d.ts +16 -1
  123. package/lib/src/structures/ITransformOptions.d.ts +5 -0
  124. package/lib/src/structures/ITypiaPluginConfig.d.ts +25 -7
  125. package/package.json +6 -4
  126. package/src/compiler/buildTsconfigJSON.ts +5 -0
  127. package/src/compiler/createTypiaSourcePackMount.ts +9 -3
  128. package/src/compiler/createWorkerCompiler.ts +5 -0
  129. package/src/compiler/installDependenciesIntoMemFS.ts +5 -0
  130. package/src/compiler/installTypiaSourcePack.ts +7 -2
  131. package/src/compiler/internal/createWorkerCompilerService.ts +47 -4
  132. package/src/compiler/internal/joinUnder.ts +5 -0
  133. package/src/compiler/internal/parseLintDiagnostics.ts +8 -3
  134. package/src/compiler/internal/safeParseTypiaTransform.ts +25 -2
  135. package/src/compiler/lineColumnOf.ts +24 -8
  136. package/src/compiler/loadTypiaSourcePack.ts +57 -14
  137. package/src/compiler/mapDiagnostic.ts +67 -7
  138. package/src/compiler/normalizeError.ts +9 -1
  139. package/src/compiler/normalizeNodeModulePath.ts +5 -0
  140. package/src/compiler/pickEmittedJS.ts +22 -5
  141. package/src/npm/collectExternalPackageNames.ts +54 -13
  142. package/src/npm/installPlaygroundDependencies.ts +18 -6
  143. package/src/npm/internal/npmRegistry.ts +156 -4
  144. package/src/npm/packageNameFromSpecifier.ts +6 -0
  145. package/src/react/ConsoleViewer.tsx +10 -1
  146. package/src/react/DependencyProgressModal.tsx +9 -0
  147. package/src/react/DiagnosticsPanel.tsx +9 -0
  148. package/src/react/ExamplePicker.tsx +22 -6
  149. package/src/react/LintPane.tsx +5 -0
  150. package/src/react/OptionsPanel.tsx +22 -4
  151. package/src/react/PlaygroundShell.tsx +17 -5
  152. package/src/react/ResultViewer.tsx +28 -7
  153. package/src/react/SourceEditor.tsx +10 -0
  154. package/src/react/createCompilerClient.ts +5 -0
  155. package/src/react/internal/PlaygroundCompilerLifecycle.ts +64 -1
  156. package/src/react/internal/PlaygroundExecutionLifecycle.ts +44 -2
  157. package/src/react/internal/recoverTerminalCompilerWorker.ts +48 -4
  158. package/src/sandbox/createSandboxRequire.ts +28 -15
  159. package/src/sandbox/loadTypiaRuntimePack.ts +35 -2
  160. package/src/structures/IBuildTsconfigOptions.ts +13 -1
  161. package/src/structures/ICompilerService.ts +119 -2
  162. package/src/structures/IConsoleMessage.ts +5 -0
  163. package/src/structures/ICreateCompilerClientOptions.ts +9 -2
  164. package/src/structures/ICreateWorkerCompilerOptions.ts +15 -3
  165. package/src/structures/IInstallTypiaSourcePackOptions.ts +11 -1
  166. package/src/structures/ILintPluginConfig.ts +8 -1
  167. package/src/structures/ILoadTypiaRuntimePackOptions.ts +8 -1
  168. package/src/structures/IOptionToggle.ts +5 -0
  169. package/src/structures/IPlaygroundDependencyInstallOptions.ts +56 -6
  170. package/src/structures/IPlaygroundDependencyInstallResult.ts +12 -1
  171. package/src/structures/IPlaygroundDependencyPackage.ts +11 -1
  172. package/src/structures/IPlaygroundDependencyProgress.ts +9 -1
  173. package/src/structures/IPlaygroundDependencyProgressPhase.ts +7 -2
  174. package/src/structures/IPlaygroundDependencyRequest.ts +10 -1
  175. package/src/structures/IPlaygroundExample.ts +6 -0
  176. package/src/structures/IPlaygroundInstalledDependency.ts +11 -1
  177. package/src/structures/IPlaygroundShellProps.ts +62 -22
  178. package/src/structures/ISourceEditorProps.ts +20 -1
  179. package/src/structures/ITransformOptions.ts +7 -0
  180. package/src/structures/ITypiaPluginConfig.ts +31 -7
@@ -31,6 +31,28 @@ const packCache = new Map<string, RuntimePackEntry>();
31
31
  * attempt; rejection removes it from the cache so the next call retries from
32
32
  * scratch. Successful packs remain cached. Nothing else ends the load: how long
33
33
  * a fetch takes belongs to the network, not to a number chosen here.
34
+ *
35
+ * @evidence contracts/common.md#principled-implementation
36
+ * Fetch, AbortController and Promise sharing implement the site-selected
37
+ * runtime-pack transport. The loader returns source records for the existing
38
+ * resolver rather than evaluating packages or introducing another module
39
+ * protocol.
40
+ *
41
+ * @evidence contracts/common.md#clear-and-simple-design
42
+ * The URL map owns shared attempt identity; cancellation helpers isolate
43
+ * event cleanup from transport decoding and the resolver owns evaluation.
44
+ *
45
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts
46
+ * The URL comes from the caller, and load failures remain failures. Shared
47
+ * cancellation is an explicit public policy rather than a fixture-specific
48
+ * timeout or a replacement of fetch internals; rejection removes the owned
49
+ * entry instead of returning a fabricated empty pack.
50
+ *
51
+ * @evidence contracts/common.md#meaningful-documentation
52
+ * Native JSDoc separates the per-URL purpose from shared cancellation,
53
+ * rejection eviction and network waiting policy. Those reasons follow the
54
+ * documentation skill, and ILoadTypiaRuntimePackOptions documents the
55
+ * cancellation scope.
34
56
  */
35
57
  export function loadTypiaRuntimePack(
36
58
  url: string,
@@ -62,12 +84,23 @@ export function loadTypiaRuntimePack(
62
84
  );
63
85
 
64
86
  phase = `reading JSON from ${url}`;
65
- return (await raceRuntimePackCancellation(
87
+ const pack: unknown = await raceRuntimePackCancellation(
66
88
  response.json(),
67
89
  cancellation.promise,
68
90
  controller.signal,
69
91
  () => phase,
70
- )) as Record<string, string>;
92
+ );
93
+ if (
94
+ !pack ||
95
+ typeof pack !== "object" ||
96
+ Array.isArray(pack) ||
97
+ !Object.values(pack).every((value) => typeof value === "string")
98
+ ) {
99
+ throw new Error(
100
+ "loadTypiaRuntimePack: expected a source-text record map.",
101
+ );
102
+ }
103
+ return pack as Record<string, string>;
71
104
  })()
72
105
  .catch((error) => {
73
106
  if (packCache.get(url) === entry) packCache.delete(url);
@@ -1,19 +1,31 @@
1
- /** Options accepted by {@link buildTsconfigJSON}. */
1
+ /**
2
+ * Options accepted by {@link buildTsconfigJSON}; extra compiler entries override
3
+ * the module and directory defaults during serialization.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation Required module spelling and optional JSON-compatible overrides express the emitted compiler configuration, not compiler validation.
6
+ * @evidence contracts/common.md#clear-and-simple-design A flat options record separates compiler entries from project include globs without another configuration layer.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Literal module choices are supported compiler settings; callers supply extensions through compilerOptions.
8
+ * @evidence contracts/common.md#meaningful-documentation JSDoc states override precedence, directory defaults and emit purpose; paragraphs and member spacing follow the documentation skill.
9
+ */
2
10
  export interface IBuildTsconfigOptions {
3
11
  /**
4
12
  * Module emit shape. Sites preview-render ESM, then re-run as CommonJS for
5
13
  * the in-page `new Function` sandbox.
6
14
  */
7
15
  module: "ESNext" | "CommonJS";
16
+
8
17
  /** Output directory relative to project root. Defaults to `"dist"`. */
9
18
  outDir?: string;
19
+
10
20
  /** Source root relative to project root. Defaults to `"src"`. */
11
21
  rootDir?: string;
22
+
12
23
  /**
13
24
  * Extra entries spliced into `compilerOptions`. Use for plugins, paths, lib
14
25
  * overrides, etc.
15
26
  */
16
27
  compilerOptions?: Record<string, unknown>;
28
+
17
29
  /** Project `include` globs. Defaults to `["src"]`. */
18
30
  include?: readonly string[];
19
31
  }
@@ -7,12 +7,21 @@ import type { ITransformOptions } from "./ITransformOptions";
7
7
  * (UI side) returns a tgrid Driver bound to this shape. Sites that need an
8
8
  * `extraTabs` lane should layer additional verbs over this base interface in
9
9
  * their own ICompilerService subtype.
10
+ *
11
+ * @evidence contracts/common.md#principled-implementation Promise-returning install, compile, bundle and lint verbs express the asynchronous Worker RPC boundary and their distinct result shapes.
12
+ * @evidence contracts/common.md#clear-and-simple-design One base RPC interface separates worker capabilities from React state and site-specific extensions.
13
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Extensions use a typed service boundary instead of replacing Worker or compiler internals.
14
+ * @evidence contracts/common.md#meaningful-documentation Native paragraphs document both RPC ends and extension ownership; member comments describe transform order and disabled lint behavior under the documentation skill.
10
15
  */
11
16
  export interface ICompilerService {
12
17
  /**
13
18
  * Mount external npm package files into the worker's MemFS under
14
- * `node_modules/`. Driven by the dependency installer in
15
- * `@ttsc/playground/npm`.
19
+ * `node_modules/`. The package's dependency installer supplies these files.
20
+ *
21
+ * @evidence contracts/common.md#principled-implementation Package-relative file keys and metadata produce a virtual mount report; the Worker serializes installation with compilation.
22
+ * @evidence contracts/common.md#clear-and-simple-design This verb owns mounting while registry fetching stays on the caller side.
23
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Writes use the virtual-host boundary without bypassing path validation for known packages.
24
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the virtual node_modules namespace and caller responsibility, with tag separation under the documentation skill.
16
25
  */
17
26
  installDependencies(
18
27
  props: ICompilerService.IInstallDependenciesProps,
@@ -22,6 +31,11 @@ export interface ICompilerService {
22
31
  * Compile the user's source into JavaScript with diagnostics. Plugin
23
32
  * transforms (typia, when enabled in options) run first; the result is the
24
33
  * post-transform emit.
34
+ *
35
+ * @evidence contracts/common.md#principled-implementation A discriminated result distinguishes usable emit, compiler findings and operational failure after configured transforms.
36
+ * @evidence contracts/common.md#clear-and-simple-design The verb takes source and per-call flags; factory configuration owns runtime and plugins.
37
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Configured transform failures remain errors rather than claiming untransformed output fulfills the transform request.
38
+ * @evidence contracts/common.md#meaningful-documentation Native prose states transform-before-emit ordering with tag separation under the documentation skill.
25
39
  */
26
40
  compile(props: ICompilerService.IProps): Promise<ICompilerService.IResult>;
27
41
 
@@ -29,6 +43,11 @@ export interface ICompilerService {
29
43
  * Same pipeline as `compile`, but using the bundle-flavored tsconfig
30
44
  * (typically `module: "CommonJS"` for in-page `new Function` sandboxing).
31
45
  * Sites that don't run user code may treat this identically to `compile`.
46
+ *
47
+ * @evidence contracts/common.md#principled-implementation The bundle verb uses the execution-oriented module configuration but shares the same compile result distinctions.
48
+ * @evidence contracts/common.md#clear-and-simple-design A separate named RPC verb exposes execution emit without requiring clients to supply compiler configuration.
49
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Module format is explicit supported behavior, not a special case based on the user's source.
50
+ * @evidence contracts/common.md#meaningful-documentation Native prose distinguishes this module shape from preview compile, with tag separation under the documentation skill.
32
51
  */
33
52
  bundle(props: ICompilerService.IProps): Promise<ICompilerService.IResult>;
34
53
 
@@ -36,39 +55,115 @@ export interface ICompilerService {
36
55
  * Run the lint plugin and parse its findings into the same diagnostic shape
37
56
  * as `compile`. Returns an empty list when no lint plugin is wired into the
38
57
  * worker.
58
+ *
59
+ * @evidence contracts/common.md#principled-implementation A diagnostic list carries lint findings; disabled integration legitimately has no findings while operational failures are represented as error diagnostics.
60
+ * @evidence contracts/common.md#clear-and-simple-design Lint owns findings independently of emit and execution results.
61
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts A failed configured linter cannot masquerade as the documented disabled-linter empty result.
62
+ * @evidence contracts/common.md#meaningful-documentation Native prose documents findings and absent integration, separated from tags under the documentation skill.
39
63
  */
40
64
  lint(props: ICompilerService.IProps): Promise<ICompilerService.ILintResult>;
41
65
  }
42
66
 
43
67
  export namespace ICompilerService {
68
+ /**
69
+ * Per-call source and transform enablement; omitted flags use service
70
+ * defaults.
71
+ *
72
+ * @evidence contracts/common.md#principled-implementation Text and optional flags capture the complete per-call input without embedding factory runtime identity.
73
+ * @evidence contracts/common.md#clear-and-simple-design Compile, bundle and lint share one input record rather than duplicate source policy.
74
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Flags use the declared plugin boundary rather than source-specific dispatch exceptions.
75
+ * @evidence contracts/common.md#meaningful-documentation Native prose defines per-call and omitted-option meaning with tag separation under the documentation skill.
76
+ */
44
77
  export interface IProps {
45
78
  source: string;
46
79
  options?: ITransformOptions;
47
80
  }
48
81
 
82
+ /**
83
+ * Text files and package identities submitted as one virtual installation.
84
+ *
85
+ * @evidence contracts/common.md#principled-implementation Relative file keys identify writes and the package array labels that operation's metadata; this is not a registry graph solver.
86
+ * @evidence contracts/common.md#clear-and-simple-design Files and identities stay in one RPC payload while result counts are a separate response.
87
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Virtual installation uses caller-supplied entries and the host's path gate, not fixture-specific package logic.
88
+ * @evidence contracts/common.md#meaningful-documentation Member prose defines relative keys and metadata association with blank member lines under the documentation skill.
89
+ */
49
90
  export interface IInstallDependenciesProps {
50
91
  /** Node_modules-relative paths to text content. */
51
92
  files: Record<string, string>;
93
+
52
94
  /** Metadata for the packages whose files are in `files`. */
53
95
  packages: IInstalledPackage[];
54
96
  }
55
97
 
98
+ /**
99
+ * Exposed package name and exact installed version for a mounting report.
100
+ *
101
+ * @evidence contracts/common.md#principled-implementation Name and version label the mounted package; registry alias identity and active constraints belong to the dependency solver's richer type.
102
+ * @evidence contracts/common.md#clear-and-simple-design The mounting report carries only the identity its client needs.
103
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The record reports supplied metadata and does not infer compatibility from a name alone.
104
+ * @evidence contracts/common.md#meaningful-documentation Native prose distinguishes mount metadata from solver state, with tags separated under the documentation skill.
105
+ */
56
106
  export interface IInstalledPackage {
57
107
  name: string;
58
108
  version: string;
59
109
  }
60
110
 
111
+ /**
112
+ * Submitted package identities and count of accepted virtual-file writes.
113
+ *
114
+ * @evidence contracts/common.md#principled-implementation fileCount counts writes accepted by path validation; installed carries the submitted identities rather than asserting a solved dependency graph.
115
+ * @evidence contracts/common.md#clear-and-simple-design A small mounting response separates accepted-write count from compile output.
116
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Counts arise from actual writes rather than expected answers or skipped malformed paths.
117
+ * @evidence contracts/common.md#meaningful-documentation Native prose defines counting and metadata limits with tag separation under the documentation skill.
118
+ */
61
119
  export interface IInstallDependenciesResult {
62
120
  installed: IInstalledPackage[];
63
121
  fileCount: number;
64
122
  }
65
123
 
124
+ /**
125
+ * Compile outcome discriminated by successful emit, findings or operation
126
+ * error.
127
+ *
128
+ * @evidence contracts/common.md#principled-implementation The type field discriminates string emit from unknown error payload; failure retains both emit and diagnostics.
129
+ * @evidence contracts/common.md#clear-and-simple-design Named variants centralize result narrowing across Worker and UI.
130
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Operational errors are a distinct variant rather than fabricated successful text.
131
+ * @evidence contracts/common.md#meaningful-documentation Native prose names all outcome meanings with tag separation under the documentation skill.
132
+ */
66
133
  export type IResult = ISuccess | IFailure | IError;
67
134
 
135
+ /**
136
+ * JavaScript emit with no error diagnostics; empty text may mean no emitted
137
+ * file.
138
+ *
139
+ * @evidence contracts/common.md#principled-implementation The success discriminant and string payload represent the compile lane's non-error outcome.
140
+ * @evidence contracts/common.md#clear-and-simple-design The common envelope is reused without an unnecessary second success structure.
141
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Success does not claim that empty emit proves a file exists or user code is safe.
142
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains the empty-emit limit with tag separation under the documentation skill.
143
+ */
68
144
  export interface ISuccess extends IBase<"success", string> {}
145
+
146
+ /**
147
+ * Compiler findings together with any available JavaScript emit.
148
+ *
149
+ * @evidence contracts/common.md#principled-implementation Error findings accompany a string emit payload so the UI can show both even when compilation is unsuccessful.
150
+ * @evidence contracts/common.md#clear-and-simple-design Only the finding variant adds diagnostics to the shared envelope.
151
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Findings remain explicit rather than converting nonempty emit into unconditional success.
152
+ * @evidence contracts/common.md#meaningful-documentation Native prose defines simultaneous diagnostics and emit with tag separation under the documentation skill.
153
+ */
69
154
  export interface IFailure extends IBase<"failure", string> {
70
155
  diagnostics: IDiagnostic[];
71
156
  }
157
+
158
+ /**
159
+ * Operation failure whose transport payload may be an error record or
160
+ * message.
161
+ *
162
+ * @evidence contracts/common.md#principled-implementation Unknown preserves the permitted error payload domain until the receiver normalizes it.
163
+ * @evidence contracts/common.md#clear-and-simple-design The error discriminant shares routing fields with other outcomes without pretending its payload is JavaScript.
164
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Failures retain their own outcome rather than inventing emit to satisfy consumers.
165
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains payload variability with tag separation under the documentation skill.
166
+ */
72
167
  export interface IError extends IBase<"error", unknown> {}
73
168
 
74
169
  interface IBase<Type extends string, Value> {
@@ -77,19 +172,41 @@ export namespace ICompilerService {
77
172
  value: Value;
78
173
  }
79
174
 
175
+ /**
176
+ * UI diagnostic with one-based location and a span measured in source
177
+ * characters.
178
+ *
179
+ * @evidence contracts/common.md#principled-implementation Location, severity, text and optional code represent compiler and lint findings without tying them to one producer.
180
+ * @evidence contracts/common.md#clear-and-simple-design One diagnostic shape is shared by compile and lint result lanes.
181
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Producer codes are carried as metadata rather than hardcoded finding decisions.
182
+ * @evidence contracts/common.md#meaningful-documentation Member JSDoc defines coordinate bases, span units and code purpose, with documentation-skill member spacing.
183
+ */
80
184
  export interface IDiagnostic {
81
185
  /** 1-based line number. */
82
186
  line: number;
187
+
83
188
  /** 1-based column number. */
84
189
  column: number;
190
+
85
191
  /** Length of the span in source characters; at least 1. */
86
192
  length: number;
193
+
87
194
  severity: "error" | "warning";
88
195
  message: string;
196
+
89
197
  /** Diagnostic code, e.g. `"TS2322"` or a lint rule id. */
90
198
  code?: string;
91
199
  }
92
200
 
201
+ /**
202
+ * Lint findings, including an error diagnostic when the configured plugin
203
+ * fails.
204
+ *
205
+ * @evidence contracts/common.md#principled-implementation A diagnostic array covers both rule findings and plugin failure reports; absence of configured lint yields an empty array.
206
+ * @evidence contracts/common.md#clear-and-simple-design The lint lane returns findings without unrelated JavaScript output fields.
207
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Configured-plugin failure is kept visible rather than encoded as a clean empty list.
208
+ * @evidence contracts/common.md#meaningful-documentation Native prose states failure representation with tag separation under the documentation skill.
209
+ */
93
210
  export interface ILintResult {
94
211
  diagnostics: IDiagnostic[];
95
212
  }
@@ -3,6 +3,11 @@
3
3
  * `console.log(...args)`), so `console.log("user:", user)` shows up as a single
4
4
  * row with both pieces rendered inline, separated by a space — same as a real
5
5
  * DevTools console.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation The finite console-method union labels one captured invocation; unknown arguments preserve values without pretending every value is serializable.
8
+ * @evidence contracts/common.md#clear-and-simple-design Method and argument list keep event identity separate from renderer policy.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Console labels are supported invocation kinds, not special cases for particular user output.
10
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains argument grouping and display meaning in a separate paragraph under the documentation skill.
6
11
  */
7
12
  export interface IConsoleMessage {
8
13
  type: "debug" | "dir" | "error" | "info" | "log" | "table" | "warn";
@@ -1,10 +1,17 @@
1
- /** Options for {@link createCompilerClient}. */
1
+ /**
2
+ * Options for {@link createCompilerClient}.
3
+ *
4
+ * @evidence contracts/common.md#principled-implementation A script URL is the input accepted by the tgrid Worker connector; this type does not advertise unsupported Worker construction options.
5
+ * @evidence contracts/common.md#clear-and-simple-design The single client input stays distinct from worker-side compiler configuration.
6
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Worker creation uses tgrid's supported URL boundary instead of replacing its internals.
7
+ * @evidence contracts/common.md#meaningful-documentation The member comment explains script ownership and classic Worker constraints, following documentation-skill prose separation.
8
+ */
2
9
  export interface ICreateCompilerClientOptions {
3
10
  /**
4
11
  * URL of the bundled worker script (the site's rspack output of its
5
12
  * `compiler/index.ts` worker entry, which calls `createWorkerCompiler`).
6
13
  *
7
- * The Worker is constructed by tgrid's `WorkerConnector` with classic- worker
14
+ * The Worker is constructed by tgrid's `WorkerConnector` with classic Worker
8
15
  * semantics. A custom Worker factory hook is intentionally not exposed — the
9
16
  * upstream tgrid v1 API only accepts a URL. File an issue if you need module
10
17
  * workers, named workers, or custom credentials.
@@ -1,12 +1,21 @@
1
1
  import type { ILintPluginConfig } from "./ILintPluginConfig";
2
2
  import type { ITypiaPluginConfig } from "./ITypiaPluginConfig";
3
3
 
4
- /** Options for {@link createWorkerCompiler}. */
4
+ /**
5
+ * Options for {@link createWorkerCompiler}.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation Required runtime identity and optional virtual-project paths express boot and compilation inputs; false distinguishes disabled integrations from default integration settings.
8
+ * @evidence contracts/common.md#clear-and-simple-design Boot inputs, virtual layout and plugin options remain one explicit factory record with nested plugin responsibilities.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Plugin names and defaults describe the supported playground integrations; sites override them through explicit configuration.
10
+ * @evidence contracts/common.md#meaningful-documentation Member JSDoc explains defaults, registration identity and compiler-option ownership, with blank member lines following the documentation skill.
11
+ */
5
12
  export interface ICreateWorkerCompilerOptions {
6
13
  /** URL of the site's pre-built playground.wasm. */
7
14
  wasmUrl: string;
15
+
8
16
  /** URL of the matching wasm_exec.js. Defaults to next to wasmUrl. */
9
17
  wasmExecUrl?: string;
18
+
10
19
  /**
11
20
  * `globalThis[apiName]` the wasm binds. Must match the `apiName` passed to
12
21
  * `host.Expose` when the site's wasm was built.
@@ -15,8 +24,10 @@ export interface ICreateWorkerCompilerOptions {
15
24
 
16
25
  /** In-MemFS project root. Defaults to `/work`. */
17
26
  workDir?: string;
27
+
18
28
  /** Tsconfig path relative to `workDir`. Defaults to `tsconfig.json`. */
19
29
  tsconfigPath?: string;
30
+
20
31
  /** Entry source path relative to `workDir`. Defaults to `src/playground.ts`. */
21
32
  entryFile?: string;
22
33
 
@@ -33,8 +44,9 @@ export interface ICreateWorkerCompilerOptions {
33
44
  /**
34
45
  * Extra entries spliced into the tsconfig's `compilerOptions`. Use to wire
35
46
  * site-specific plugins, paths, or lib overrides. The typia plugin entry is
36
- * appended automatically when `typiaPlugin` is enabled — sites should NOT
37
- * include it here.
47
+ * appended automatically after any `plugins` array given here when
48
+ * `typiaPlugin` is enabled — sites should NOT include it themselves, and an
49
+ * entry naming the same transform module is replaced by the appended one.
38
50
  */
39
51
  extraCompilerOptions?: Record<string, unknown>;
40
52
  }
@@ -1,20 +1,30 @@
1
+ import type { PlaygroundFetch } from "./IPlaygroundDependencyInstallOptions";
2
+
1
3
  /**
2
4
  * Options for {@link installTypiaSourcePack} and
3
5
  * {@link createTypiaSourcePackMount}.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation URL, virtual mount root, abort signal and fetch injection represent independent transport and installation inputs.
8
+ * @evidence contracts/common.md#clear-and-simple-design One shared record serves the mount adapter and installer without a second transport configuration model.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Transport injection is explicit; callers need not monkey-patch global fetch to load a pack.
10
+ * @evidence contracts/common.md#meaningful-documentation Member prose explains virtual root defaults and shared cancellation, with native paragraphs and spacing from the documentation skill.
4
11
  */
5
12
  export interface IInstallTypiaSourcePackOptions {
6
13
  /** URL the site serves the pre-built typia source pack from. */
7
14
  url: string;
15
+
8
16
  /**
9
17
  * Where to mount the pack inside the MemFS. Defaults to `/work/node_modules`,
10
18
  * matching `DEFAULT_WORK_DIR + "/node_modules"`.
11
19
  */
12
20
  mountRoot?: string;
21
+
13
22
  /** Cancel the shared in-flight load. */
14
23
  signal?: AbortSignal;
24
+
15
25
  /**
16
26
  * Optional fetcher. Defaults to `globalThis.fetch`. Override for tests or for
17
27
  * sites that want their own caching strategy.
18
28
  */
19
- fetch?: (input: string, init?: RequestInit) => Promise<Response>;
29
+ fetch?: PlaygroundFetch;
20
30
  }
@@ -1,4 +1,11 @@
1
- /** Options for the `@ttsc/lint` integration of {@link createWorkerCompiler}. */
1
+ /**
2
+ * Options for the `@ttsc/lint` integration of {@link createWorkerCompiler}.
3
+ *
4
+ * @evidence contracts/common.md#principled-implementation An optional registration name selects the host's lint verb without conflating its identity with enablement.
5
+ * @evidence contracts/common.md#clear-and-simple-design The record contains only the integration-owned name; factory options own disabling the integration.
6
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The default id is a registered product integration and remains caller-configurable.
7
+ * @evidence contracts/common.md#meaningful-documentation Native comments identify registration ownership and the default id, with prose separated from tags under the documentation skill.
8
+ */
2
9
  export interface ILintPluginConfig {
3
10
  /** Plugin id registered with `host.Expose` (default: `"@ttsc/lint"`). */
4
11
  name?: string;
@@ -1,4 +1,11 @@
1
- /** Cancellation policy for `loadTypiaRuntimePack`. */
1
+ /**
2
+ * Cancellation policy for `loadTypiaRuntimePack`.
3
+ *
4
+ * @evidence contracts/common.md#principled-implementation Optional AbortSignal carries the caller's cancellation request without imposing a fabricated network deadline.
5
+ * @evidence contracts/common.md#clear-and-simple-design Runtime URL is the loader's direct argument; this record contains only cancellation policy.
6
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Shared cancellation is an explicit supported behavior, not a hidden timeout or global replacement.
7
+ * @evidence contracts/common.md#meaningful-documentation The member comment states that cancellation ends the shared attempt, following native documentation and tag separation rules.
8
+ */
2
9
  export interface ILoadTypiaRuntimePackOptions {
3
10
  /** Cancel the shared in-flight load. */
4
11
  signal?: AbortSignal;
@@ -4,6 +4,11 @@
4
4
  * Sites declare these for whatever transform plugins their wasm registered; the
5
5
  * panel renders one row per entry and bubbles `onChange` with the merged
6
6
  * options object.
7
+ *
8
+ * @evidence contracts/common.md#principled-implementation The key identifies a boolean option while label and description supply its visible presentation.
9
+ * @evidence contracts/common.md#clear-and-simple-design Rendering metadata stays separate from plugin execution and current option values.
10
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Site-provided keys drive the panel instead of consumer-specific option branches.
11
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains site ownership and option merging in separated paragraphs following the documentation skill.
7
12
  */
8
13
  export interface IOptionToggle {
9
14
  key: string;
@@ -1,10 +1,18 @@
1
1
  import type { IPlaygroundDependencyProgress } from "./IPlaygroundDependencyProgress";
2
2
  import type { IPlaygroundInstalledDependency } from "./IPlaygroundInstalledDependency";
3
3
 
4
- /** Options for {@link installPlaygroundDependencies}. */
4
+ /**
5
+ * Options for {@link installPlaygroundDependencies}.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation Mounted exact identities, ignore policy, budgets and callbacks express distinct installation inputs; deprecated name-only state cannot establish version compatibility.
8
+ * @evidence contracts/common.md#clear-and-simple-design One installation record groups transport, prior graph and progress controls without owning compiler mounting.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Fetch injection and explicit built-in exclusions are public policy; byte and package budgets apply to every package.
10
+ * @evidence contracts/common.md#meaningful-documentation Member prose documents legacy limitations, byte units and streaming enforcement, with separate paragraphs and member spacing under the documentation skill.
11
+ */
5
12
  export interface IPlaygroundDependencyInstallOptions {
6
- /** Defaults to `globalThis.fetch`. Override for tests or for offline runs. */
7
- fetch?: (input: string, init?: RequestInit) => Promise<Response>;
13
+ /** Defaults to `globalThis.fetch`; inject a transport for offline runs. */
14
+ fetch?: PlaygroundFetch;
15
+
8
16
  /**
9
17
  * Exact package identities already mounted in this session.
10
18
  *
@@ -12,16 +20,27 @@ export interface IPlaygroundDependencyInstallOptions {
12
20
  * active requests before a tarball is reused.
13
21
  */
14
22
  installedDependencies?: Iterable<IPlaygroundInstalledDependency>;
23
+
15
24
  /**
16
25
  * Legacy name-only skip list.
17
26
  *
18
27
  * Prefer `installedDependencies`; names alone cannot validate later ranges.
19
28
  */
20
29
  installedPackages?: Iterable<string>;
30
+
21
31
  /** Package names to never install (preinstalled / built-in). */
22
32
  ignoredPackages?: Iterable<string>;
23
- /** Safety cap: error out after installing this many packages. */
33
+
34
+ /**
35
+ * Maximum distinct package names completed in one install call (default: 48).
36
+ *
37
+ * Must be a nonnegative safe integer. Mounted packages revalidated and
38
+ * optional packages omitted count toward the cap; unrequested mounted state
39
+ * does not. Zero allows only calls with no queued packages. Invalid values
40
+ * reject before input iteration, progress callbacks or network requests.
41
+ */
24
42
  maxPackages?: number;
43
+
25
44
  /**
26
45
  * Maximum compressed bytes accepted for one npm tarball.
27
46
  *
@@ -29,14 +48,45 @@ export interface IPlaygroundDependencyInstallOptions {
29
48
  * response's `Content-Length`.
30
49
  */
31
50
  maxTarballBytes?: number;
51
+
32
52
  /**
33
53
  * Maximum expanded tar bytes accepted for one npm package.
34
54
  *
35
55
  * Defaults to 64 MiB and is enforced while gzip output is streamed.
36
56
  */
37
57
  maxUnpackedBytes?: number;
58
+
38
59
  /** Aborts the install when triggered. */
39
60
  signal?: AbortSignal;
40
- /** Fires for each phase transition during the install. */
41
- onProgress?: (event: IPlaygroundDependencyProgress) => void;
61
+
62
+ /**
63
+ * Fires synchronously for phase transitions; callback failures reject the
64
+ * install.
65
+ */
66
+ onProgress?: PlaygroundDependencyProgressHandler;
42
67
  }
68
+
69
+ /**
70
+ * Fetch a playground package or source pack through the caller's transport.
71
+ *
72
+ * @evidence contracts/common.md#principled-implementation Standard RequestInit and Response preserve status, cancellation and streamed-body semantics used by the loaders.
73
+ * @evidence contracts/common.md#clear-and-simple-design Transport stays distinct from registry resolution, archive processing and mounting.
74
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Injection uses an explicit seam without replacing global fetch internals.
75
+ * @evidence contracts/common.md#meaningful-documentation Native prose identifies the transport role; optional initialization matches fetch consumers.
76
+ */
77
+ export type PlaygroundFetch = (
78
+ input: string,
79
+ init?: RequestInit,
80
+ ) => Promise<Response>;
81
+
82
+ /**
83
+ * Receive synchronous installation progress; thrown errors reject installation.
84
+ *
85
+ * @evidence contracts/common.md#principled-implementation A typed event reports the actual install transition without inventing a success result.
86
+ * @evidence contracts/common.md#clear-and-simple-design A single void notification keeps presentation state outside registry processing.
87
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Observer failures are not converted into synthetic installation success.
88
+ * @evidence contracts/common.md#meaningful-documentation Native prose states delivery timing and error propagation independently of acknowledgment tags.
89
+ */
90
+ export type PlaygroundDependencyProgressHandler = (
91
+ event: IPlaygroundDependencyProgress,
92
+ ) => void;
@@ -1,22 +1,33 @@
1
1
  import type { IPlaygroundDependencyPackage } from "./IPlaygroundDependencyPackage";
2
2
  import type { IPlaygroundInstalledDependency } from "./IPlaygroundInstalledDependency";
3
3
 
4
- /** Aggregate result returned by {@link installPlaygroundDependencies}. */
4
+ /**
5
+ * Aggregate result returned by {@link installPlaygroundDependencies}.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation Exact identities describe the complete graph while downloaded package metadata and file maps describe this call's additions in each consumer's namespace.
8
+ * @evidence contracts/common.md#clear-and-simple-design Compiler, editor and runtime maps remain explicit lanes instead of requiring consumers to infer path spelling.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Output namespaces represent actual consumer protocols rather than special casing a package or source example.
10
+ * @evidence contracts/common.md#meaningful-documentation Member prose distinguishes complete state from new downloads and documents each map's path namespace, with documentation-skill member spacing.
11
+ */
5
12
  export interface IPlaygroundDependencyInstallResult {
6
13
  /** Complete exact state after merging installed packages with this call. */
7
14
  resolvedDependencies: IPlaygroundInstalledDependency[];
15
+
8
16
  /** Packages whose tarballs were downloaded and unpacked by this call. */
9
17
  packages: IPlaygroundDependencyPackage[];
18
+
10
19
  /**
11
20
  * `node_modules/...` keyed map of files to mount inside the wasm-side
12
21
  * compiler MemFS.
13
22
  */
14
23
  compilerFiles: Record<string, string>;
24
+
15
25
  /**
16
26
  * `file:///node_modules/...` keyed map of `.d.ts` + `package.json` files to
17
27
  * register with Monaco via `addExtraLib`.
18
28
  */
19
29
  editorLibs: Record<string, string>;
30
+
20
31
  /**
21
32
  * Package-rooted runtime files (e.g. `uuid/dist/index.js`) the in-page
22
33
  * execute sandbox `require` can resolve.
@@ -1,8 +1,18 @@
1
- /** Metadata for one successfully installed npm package. */
1
+ /**
2
+ * Metadata for one successfully installed npm package; counts refer to mounted
3
+ * text files and declaration files, respectively.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation Mount name, registry identity and exact version distinguish aliases from their targets; counts describe the installed artifact population.
6
+ * @evidence contracts/common.md#clear-and-simple-design Artifact metadata is separate from active dependency constraints and the downloaded file maps.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Registry identity is explicit rather than inferred from an alias's exposed name.
8
+ * @evidence contracts/common.md#meaningful-documentation Native prose defines count meaning and the registryName distinction, with separate tags under the documentation skill.
9
+ */
2
10
  export interface IPlaygroundDependencyPackage {
3
11
  name: string;
12
+
4
13
  /** Package name queried from the registry, which differs for npm aliases. */
5
14
  registryName: string;
15
+
6
16
  version: string;
7
17
  tarball: string;
8
18
  fileCount: number;
@@ -1,6 +1,14 @@
1
1
  import type { IPlaygroundDependencyProgressPhase } from "./IPlaygroundDependencyProgressPhase";
2
2
 
3
- /** A single progress event emitted while installing playground dependencies. */
3
+ /**
4
+ * One dependency-install progress event. Package identity may be absent for
5
+ * aggregate completion; completed and total count package work, not bytes.
6
+ *
7
+ * @evidence contracts/common.md#principled-implementation Phase and optional package identity express both per-package transitions and aggregate completion without inventing an identity for the latter.
8
+ * @evidence contracts/common.md#clear-and-simple-design One event record carries display progress without exposing the installer's queue internals.
9
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Progress reflects actual phase transitions and package counts, not fabricated measurement outcomes.
10
+ * @evidence contracts/common.md#meaningful-documentation Native prose states optional identity and count units; paragraph and tag separation follow the documentation skill.
11
+ */
4
12
  export interface IPlaygroundDependencyProgress {
5
13
  phase: IPlaygroundDependencyProgressPhase;
6
14
  packageName?: string;
@@ -1,6 +1,11 @@
1
1
  /**
2
- * Lifecycle phase of a single dependency install reported via the progress
3
- * callback.
2
+ * Lifecycle phase of dependency installation. `done` can describe one package
3
+ * or the completed install; the shell reports `error` when installation fails.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation The finite union represents queued, transport, extraction and terminal reporting phases shared by the installer and shell.
6
+ * @evidence contracts/common.md#clear-and-simple-design A named phase union lets event consumers share labels without depending on installer control flow.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Phase constants are supported progress states rather than package-specific cases.
8
+ * @evidence contracts/common.md#meaningful-documentation Native prose distinguishes per-package phases from aggregate completion, with tag separation following the documentation skill.
4
9
  */
5
10
  export type IPlaygroundDependencyProgressPhase =
6
11
  | "queued"