@ttsc/graph 0.30.4 → 0.31.1

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 (292) hide show
  1. package/README.md +122 -30
  2. package/lib/CapturedProcessOutput.d.ts +47 -0
  3. package/lib/CapturedProcessOutput.js +3 -0
  4. package/lib/CapturedProcessOutput.js.map +1 -0
  5. package/lib/ILauncherOption.d.ts +22 -0
  6. package/lib/ILauncherOption.js +3 -0
  7. package/lib/ILauncherOption.js.map +1 -0
  8. package/lib/IProjectOptions.d.ts +18 -0
  9. package/lib/IProjectOptions.js +3 -0
  10. package/lib/IProjectOptions.js.map +1 -0
  11. package/lib/ParsedLauncherOptions.d.ts +13 -0
  12. package/lib/ParsedLauncherOptions.js +3 -0
  13. package/lib/ParsedLauncherOptions.js.map +1 -0
  14. package/lib/TtscGraphApplication.d.ts +38 -1
  15. package/lib/TtscGraphApplication.js +26 -1
  16. package/lib/TtscGraphApplication.js.map +1 -1
  17. package/lib/TtscGraphLauncherArguments.d.ts +115 -0
  18. package/lib/TtscGraphLauncherArguments.js +181 -0
  19. package/lib/TtscGraphLauncherArguments.js.map +1 -0
  20. package/lib/TtscGraphViewSnapshot.d.ts +35 -0
  21. package/lib/TtscGraphViewSnapshot.js +48 -0
  22. package/lib/TtscGraphViewSnapshot.js.map +1 -0
  23. package/lib/index.d.ts +9 -24
  24. package/lib/index.js +6 -128
  25. package/lib/index.js.map +1 -1
  26. package/lib/internal/GraphProcessTrace.d.ts +1 -0
  27. package/lib/internal/GraphProcessTrace.js +235 -0
  28. package/lib/internal/GraphProcessTrace.js.map +1 -0
  29. package/lib/launcherArgs.d.ts +75 -16
  30. package/lib/launcherArgs.js +77 -8
  31. package/lib/launcherArgs.js.map +1 -1
  32. package/lib/model/IArtifactDirectory.d.ts +26 -0
  33. package/lib/model/IArtifactDirectory.js +3 -0
  34. package/lib/model/IArtifactDirectory.js.map +1 -0
  35. package/lib/model/IArtifactInputs.d.ts +19 -0
  36. package/lib/model/IArtifactInputs.js +3 -0
  37. package/lib/model/IArtifactInputs.js.map +1 -0
  38. package/lib/model/IPublishedArtifacts.d.ts +76 -0
  39. package/lib/model/IPublishedArtifacts.js +3 -0
  40. package/lib/model/IPublishedArtifacts.js.map +1 -0
  41. package/lib/model/IPublishedArtifactsResident.d.ts +19 -0
  42. package/lib/model/IPublishedArtifactsResident.js +3 -0
  43. package/lib/model/IPublishedArtifactsResident.js.map +1 -0
  44. package/lib/model/ITtscLintDaemonTarget.d.ts +20 -0
  45. package/lib/model/ITtscLintDaemonTarget.js +3 -0
  46. package/lib/model/ITtscLintDaemonTarget.js.map +1 -0
  47. package/lib/model/TtscGraphLinePeer.d.ts +146 -0
  48. package/lib/model/TtscGraphLinePeer.js +213 -0
  49. package/lib/model/TtscGraphLinePeer.js.map +1 -0
  50. package/lib/model/TtscGraphMemory.d.ts +156 -16
  51. package/lib/model/TtscGraphMemory.js +228 -222
  52. package/lib/model/TtscGraphMemory.js.map +1 -1
  53. package/lib/model/TtscGraphNativeArguments.d.ts +40 -0
  54. package/lib/model/TtscGraphNativeArguments.js +64 -0
  55. package/lib/model/TtscGraphNativeArguments.js.map +1 -0
  56. package/lib/model/TtscGraphNodeId.d.ts +55 -3
  57. package/lib/model/TtscGraphNodeId.js +40 -2
  58. package/lib/model/TtscGraphNodeId.js.map +1 -1
  59. package/lib/model/TtscGraphProjection.d.ts +156 -0
  60. package/lib/model/TtscGraphProjection.js +390 -0
  61. package/lib/model/TtscGraphProjection.js.map +1 -0
  62. package/lib/model/TtscGraphProtocol.d.ts +28 -0
  63. package/lib/model/TtscGraphProtocol.js +928 -0
  64. package/lib/model/TtscGraphProtocol.js.map +1 -0
  65. package/lib/model/TtscGraphReadonly.d.ts +15 -0
  66. package/lib/model/TtscGraphReadonly.js +3 -0
  67. package/lib/model/TtscGraphReadonly.js.map +1 -0
  68. package/lib/model/TtscGraphRequestOptions.d.ts +16 -0
  69. package/lib/model/TtscGraphRequestOptions.js +3 -0
  70. package/lib/model/TtscGraphRequestOptions.js.map +1 -0
  71. package/lib/model/TtscGraphSession.d.ts +82 -36
  72. package/lib/model/TtscGraphSession.js +164 -1238
  73. package/lib/model/TtscGraphSession.js.map +1 -1
  74. package/lib/model/TtscGraphSessionOptions.d.ts +20 -0
  75. package/lib/model/TtscGraphSessionOptions.js +3 -0
  76. package/lib/model/TtscGraphSessionOptions.js.map +1 -0
  77. package/lib/model/TtscGraphSessionState.d.ts +187 -0
  78. package/lib/model/TtscGraphSessionState.js +417 -0
  79. package/lib/model/TtscGraphSessionState.js.map +1 -0
  80. package/lib/model/TtscGraphShardStore.d.ts +64 -3
  81. package/lib/model/TtscGraphShardStore.js +85 -15
  82. package/lib/model/TtscGraphShardStore.js.map +1 -1
  83. package/lib/model/TtscGraphSourceReader.d.ts +31 -8
  84. package/lib/model/TtscGraphSourceReader.js +37 -13
  85. package/lib/model/TtscGraphSourceReader.js.map +1 -1
  86. package/lib/model/TtscLintDaemon.d.ts +35 -17
  87. package/lib/model/TtscLintDaemon.js +39 -117
  88. package/lib/model/TtscLintDaemon.js.map +1 -1
  89. package/lib/model/TtscLintDaemonState.d.ts +69 -0
  90. package/lib/model/TtscLintDaemonState.js +166 -0
  91. package/lib/model/TtscLintDaemonState.js.map +1 -0
  92. package/lib/model/copyGraphRecords.d.ts +14 -0
  93. package/lib/model/copyGraphRecords.js +19 -0
  94. package/lib/model/copyGraphRecords.js.map +1 -0
  95. package/lib/model/copyGraphSnapshot.d.ts +17 -0
  96. package/lib/model/copyGraphSnapshot.js +33 -0
  97. package/lib/model/copyGraphSnapshot.js.map +1 -0
  98. package/lib/model/loadGraph.d.ts +19 -10
  99. package/lib/model/loadGraph.js +21 -12
  100. package/lib/model/loadGraph.js.map +1 -1
  101. package/lib/model/publishedArtifacts.d.ts +78 -97
  102. package/lib/model/publishedArtifacts.js +271 -85
  103. package/lib/model/publishedArtifacts.js.map +1 -1
  104. package/lib/nativeExecutable.d.ts +19 -8
  105. package/lib/nativeExecutable.js +75 -15
  106. package/lib/nativeExecutable.js.map +1 -1
  107. package/lib/reduce.d.ts +19 -45
  108. package/lib/reduce.js +19 -3
  109. package/lib/reduce.js.map +1 -1
  110. package/lib/resolveGraphBinary.d.ts +9 -0
  111. package/lib/resolveGraphBinary.js +11 -3
  112. package/lib/resolveGraphBinary.js.map +1 -1
  113. package/lib/runGraph.d.ts +21 -0
  114. package/lib/runGraph.js +83 -0
  115. package/lib/runGraph.js.map +1 -0
  116. package/lib/server/IResolvedGraphHandle.d.ts +22 -0
  117. package/lib/server/IResolvedGraphHandle.js +3 -0
  118. package/lib/server/IResolvedGraphHandle.js.map +1 -0
  119. package/lib/server/createServer.d.ts +14 -10
  120. package/lib/server/createServer.js +42 -39
  121. package/lib/server/createServer.js.map +1 -1
  122. package/lib/server/exportSurface.d.ts +23 -1
  123. package/lib/server/exportSurface.js +23 -1
  124. package/lib/server/exportSurface.js.map +1 -1
  125. package/lib/server/formatGraphFailure.d.ts +20 -0
  126. package/lib/server/formatGraphFailure.js +35 -0
  127. package/lib/server/formatGraphFailure.js.map +1 -0
  128. package/lib/server/pathPolicy.d.ts +70 -5
  129. package/lib/server/pathPolicy.js +66 -4
  130. package/lib/server/pathPolicy.js.map +1 -1
  131. package/lib/server/resolveHandle.d.ts +10 -5
  132. package/lib/server/resolveHandle.js +39 -7
  133. package/lib/server/resolveHandle.js.map +1 -1
  134. package/lib/server/resultAudit.d.ts +17 -14
  135. package/lib/server/resultAudit.js +56 -27
  136. package/lib/server/resultAudit.js.map +1 -1
  137. package/lib/server/resultNext.d.ts +26 -1
  138. package/lib/server/resultNext.js +14 -0
  139. package/lib/server/resultNext.js.map +1 -1
  140. package/lib/server/runDetails.d.ts +72 -15
  141. package/lib/server/runDetails.js +104 -69
  142. package/lib/server/runDetails.js.map +1 -1
  143. package/lib/server/runEntrypoints.d.ts +9 -0
  144. package/lib/server/runEntrypoints.js +9 -0
  145. package/lib/server/runEntrypoints.js.map +1 -1
  146. package/lib/server/runLookup.d.ts +13 -3
  147. package/lib/server/runLookup.js +19 -6
  148. package/lib/server/runLookup.js.map +1 -1
  149. package/lib/server/runOverview.d.ts +13 -4
  150. package/lib/server/runOverview.js +13 -4
  151. package/lib/server/runOverview.js.map +1 -1
  152. package/lib/server/runTour.d.ts +9 -0
  153. package/lib/server/runTour.js +33 -65
  154. package/lib/server/runTour.js.map +1 -1
  155. package/lib/server/runTrace.d.ts +25 -1
  156. package/lib/server/runTrace.js +133 -88
  157. package/lib/server/runTrace.js.map +1 -1
  158. package/lib/server/startServer.d.ts +16 -0
  159. package/lib/server/startServer.js +24 -1
  160. package/lib/server/startServer.js.map +1 -1
  161. package/lib/structures/ITtscGraphApplication.d.ts +95 -41
  162. package/lib/structures/ITtscGraphDecorator.d.ts +18 -0
  163. package/lib/structures/ITtscGraphDetails.d.ts +81 -6
  164. package/lib/structures/ITtscGraphDocTag.d.ts +17 -8
  165. package/lib/structures/ITtscGraphDump.d.ts +106 -8
  166. package/lib/structures/ITtscGraphEdge.d.ts +14 -2
  167. package/lib/structures/ITtscGraphEntrypoints.d.ts +81 -6
  168. package/lib/structures/ITtscGraphEscape.d.ts +24 -2
  169. package/lib/structures/ITtscGraphEvidence.d.ts +9 -0
  170. package/lib/structures/ITtscGraphLookup.d.ts +42 -9
  171. package/lib/structures/ITtscGraphNext.d.ts +12 -1
  172. package/lib/structures/ITtscGraphNode.d.ts +38 -11
  173. package/lib/structures/ITtscGraphOverview.d.ts +81 -6
  174. package/lib/structures/ITtscGraphSnapshot.d.ts +97 -2
  175. package/lib/structures/ITtscGraphSpan.d.ts +9 -0
  176. package/lib/structures/ITtscGraphTour.d.ts +83 -9
  177. package/lib/structures/ITtscGraphTrace.d.ts +99 -14
  178. package/lib/structures/RawDump.d.ts +22 -0
  179. package/lib/structures/RawDump.js +3 -0
  180. package/lib/structures/RawDump.js.map +1 -0
  181. package/lib/structures/RawEdge.d.ts +20 -0
  182. package/lib/structures/RawEdge.js +3 -0
  183. package/lib/structures/RawEdge.js.map +1 -0
  184. package/lib/structures/RawNode.d.ts +26 -0
  185. package/lib/structures/RawNode.js +3 -0
  186. package/lib/structures/RawNode.js.map +1 -0
  187. package/lib/structures/TtscGraphArtifactNodeKind.d.ts +9 -0
  188. package/lib/structures/TtscGraphArtifactNodeKind.js +9 -0
  189. package/lib/structures/TtscGraphArtifactNodeKind.js.map +1 -1
  190. package/lib/structures/TtscGraphDumpEdgeKind.d.ts +15 -1
  191. package/lib/structures/TtscGraphDumpNodeKind.d.ts +9 -0
  192. package/lib/structures/TtscGraphEdgeKind.d.ts +13 -4
  193. package/lib/structures/TtscGraphNodeKind.d.ts +9 -0
  194. package/lib/structures/TtscGraphNodeModifier.d.ts +9 -0
  195. package/lib/structures/ViewerLink.d.ts +20 -0
  196. package/lib/structures/ViewerLink.js +3 -0
  197. package/lib/structures/ViewerLink.js.map +1 -0
  198. package/lib/structures/ViewerNode.d.ts +24 -0
  199. package/lib/structures/ViewerNode.js +3 -0
  200. package/lib/structures/ViewerNode.js.map +1 -0
  201. package/lib/structures/ViewerPayload.d.ts +42 -0
  202. package/lib/structures/ViewerPayload.js +3 -0
  203. package/lib/structures/ViewerPayload.js.map +1 -0
  204. package/lib/view.d.ts +9 -0
  205. package/lib/view.js +203 -91
  206. package/lib/view.js.map +1 -1
  207. package/lib/viewer/viewer.js +1 -1
  208. package/package.json +8 -6
  209. package/src/CapturedProcessOutput.ts +50 -0
  210. package/src/ILauncherOption.ts +24 -0
  211. package/src/IProjectOptions.ts +19 -0
  212. package/src/ParsedLauncherOptions.ts +13 -0
  213. package/src/TtscGraphApplication.ts +38 -1
  214. package/src/TtscGraphLauncherArguments.ts +207 -0
  215. package/src/TtscGraphViewSnapshot.ts +46 -0
  216. package/src/index.ts +9 -160
  217. package/src/internal/GraphProcessTrace.ts +242 -0
  218. package/src/launcherArgs.ts +89 -23
  219. package/src/model/IArtifactDirectory.ts +27 -0
  220. package/src/model/IArtifactInputs.ts +21 -0
  221. package/src/model/IPublishedArtifacts.ts +81 -0
  222. package/src/model/IPublishedArtifactsResident.ts +24 -0
  223. package/src/model/ITtscLintDaemonTarget.ts +22 -0
  224. package/src/model/TtscGraphLinePeer.ts +318 -0
  225. package/src/model/TtscGraphMemory.ts +284 -246
  226. package/src/model/TtscGraphNativeArguments.ts +67 -0
  227. package/src/model/TtscGraphNodeId.ts +57 -3
  228. package/src/model/TtscGraphProjection.ts +473 -0
  229. package/src/model/TtscGraphProtocol.ts +90 -0
  230. package/src/model/TtscGraphReadonly.ts +17 -0
  231. package/src/model/TtscGraphRequestOptions.ts +16 -0
  232. package/src/model/TtscGraphSession.ts +196 -475
  233. package/src/model/TtscGraphSessionOptions.ts +22 -0
  234. package/src/model/TtscGraphSessionState.ts +558 -0
  235. package/src/model/TtscGraphShardStore.ts +99 -23
  236. package/src/model/TtscGraphSourceReader.ts +37 -15
  237. package/src/model/TtscLintDaemon.ts +55 -136
  238. package/src/model/TtscLintDaemonState.ts +174 -0
  239. package/src/model/copyGraphRecords.ts +17 -0
  240. package/src/model/copyGraphSnapshot.ts +30 -0
  241. package/src/model/loadGraph.ts +23 -12
  242. package/src/model/publishedArtifacts.ts +361 -182
  243. package/src/nativeExecutable.ts +93 -26
  244. package/src/reduce.ts +24 -51
  245. package/src/resolveGraphBinary.ts +13 -3
  246. package/src/runGraph.ts +90 -0
  247. package/src/server/IResolvedGraphHandle.ts +24 -0
  248. package/src/server/createServer.ts +16 -22
  249. package/src/server/exportSurface.ts +23 -1
  250. package/src/server/formatGraphFailure.ts +32 -0
  251. package/src/server/pathPolicy.ts +70 -5
  252. package/src/server/resolveHandle.ts +45 -14
  253. package/src/server/resultAudit.ts +58 -27
  254. package/src/server/resultNext.ts +26 -1
  255. package/src/server/runDetails.ts +138 -73
  256. package/src/server/runEntrypoints.ts +13 -1
  257. package/src/server/runLookup.ts +23 -7
  258. package/src/server/runOverview.ts +17 -5
  259. package/src/server/runTour.ts +44 -82
  260. package/src/server/runTrace.ts +175 -102
  261. package/src/server/startServer.ts +29 -1
  262. package/src/structures/ITtscGraphApplication.ts +95 -41
  263. package/src/structures/ITtscGraphDecorator.ts +18 -0
  264. package/src/structures/ITtscGraphDetails.ts +81 -6
  265. package/src/structures/ITtscGraphDocTag.ts +17 -8
  266. package/src/structures/ITtscGraphDump.ts +106 -8
  267. package/src/structures/ITtscGraphEdge.ts +14 -2
  268. package/src/structures/ITtscGraphEntrypoints.ts +81 -6
  269. package/src/structures/ITtscGraphEscape.ts +24 -2
  270. package/src/structures/ITtscGraphEvidence.ts +9 -0
  271. package/src/structures/ITtscGraphLookup.ts +42 -9
  272. package/src/structures/ITtscGraphNext.ts +12 -1
  273. package/src/structures/ITtscGraphNode.ts +38 -11
  274. package/src/structures/ITtscGraphOverview.ts +88 -6
  275. package/src/structures/ITtscGraphSnapshot.ts +117 -2
  276. package/src/structures/ITtscGraphSpan.ts +9 -0
  277. package/src/structures/ITtscGraphTour.ts +83 -9
  278. package/src/structures/ITtscGraphTrace.ts +100 -14
  279. package/src/structures/RawDump.ts +25 -0
  280. package/src/structures/RawEdge.ts +22 -0
  281. package/src/structures/RawNode.ts +31 -0
  282. package/src/structures/TtscGraphArtifactNodeKind.ts +9 -0
  283. package/src/structures/TtscGraphDumpEdgeKind.ts +15 -1
  284. package/src/structures/TtscGraphDumpNodeKind.ts +9 -0
  285. package/src/structures/TtscGraphEdgeKind.ts +13 -4
  286. package/src/structures/TtscGraphNodeKind.ts +9 -0
  287. package/src/structures/TtscGraphNodeModifier.ts +9 -0
  288. package/src/structures/ViewerLink.ts +22 -0
  289. package/src/structures/ViewerNode.ts +28 -0
  290. package/src/structures/ViewerPayload.ts +52 -0
  291. package/src/view.ts +208 -110
  292. package/src/viewer/legend.ts +119 -27
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TtscGraphLauncherArguments = void 0;
4
+ const launcherArgs_1 = require("./launcherArgs");
5
+ /**
6
+ * Project, viewer and dump argument contracts consumed by the real launchers.
7
+ *
8
+ * @evidence contracts/common.md#principled-implementation Existing explicit grammar and typed validators qualify project coordinates before real launch work; dump tokens and completion preserve the native contract.
9
+ * @evidence contracts/common.md#clear-and-simple-design This namespace owns launcher grammar, dump launch-vector construction and completion mapping; native process execution remains with runGraph/view.
10
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Actual facades consume these operations without alternate test entrypoints, executable stand-ins or weakened grammar.
11
+ * @evidence contracts/common.md#meaningful-documentation Member prose identifies coordinate defaults, argv preservation and native completion ownership needed by the facades.
12
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The namespace groups contracts; its members own native path and process-value representation.
13
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns plain values and holds no handle.
14
+ * @evidenceExclude contracts/performance.md#efficient-algorithms groups launcher parsers and completion mappers that each do bounded work.
15
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work its members run once per launcher invocation, so nothing is shared.
16
+ */
17
+ var TtscGraphLauncherArguments;
18
+ (function (TtscGraphLauncherArguments) {
19
+ /**
20
+ * Parse MCP project coordinates with the shared cwd/config defaults.
21
+ *
22
+ * @evidence contracts/common.md#principled-implementation The shared PROJECT_OPTIONS grammar rejects unknown or incomplete tokens before projectOptions supplies its supported defaults.
23
+ * @evidence contracts/common.md#clear-and-simple-design Only the shared project grammar is selected; startServer retains lazy native lifetime ownership.
24
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
25
+ * @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
26
+ * @evidence contracts/portability.md#os-neutral-implementation Project normalization delegates to Node path.resolve; selected config spelling remains intact, with no shell or separator rewriting.
27
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
28
+ * @evidenceExclude contracts/performance.md#efficient-algorithms one parseLauncherOptions pass over argv plus a path.resolve.
29
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work parses argv once per process start.
30
+ */
31
+ function project(argv) {
32
+ return (0, launcherArgs_1.projectOptions)((0, launcherArgs_1.parseLauncherOptions)(argv, launcherArgs_1.PROJECT_OPTIONS));
33
+ }
34
+ TtscGraphLauncherArguments.project = project;
35
+ /**
36
+ * Parse dump project coordinates without altering forwarded tokens.
37
+ *
38
+ * @evidence contracts/common.md#principled-implementation The original dump grammar accepts its cwd/config aliases, pretty booleans and help flags, rejecting incomplete or unknown options before resolution.
39
+ * @evidence contracts/common.md#clear-and-simple-design Dump validation returns coordinates and explicit artifact presence; dumpVector separately preserves the caller tokens actually sent to the producer.
40
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
41
+ * @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
42
+ * @evidence contracts/portability.md#os-neutral-implementation Project normalization delegates to Node path.resolve; selected config spelling remains intact, with no shell or separator rewriting.
43
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
44
+ * @evidenceExclude contracts/performance.md#efficient-algorithms one parseLauncherOptions pass over argv plus a path.resolve.
45
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work parses argv once per process start.
46
+ */
47
+ function dump(argv) {
48
+ const values = (0, launcherArgs_1.parseLauncherOptions)(argv, DUMP_OPTIONS);
49
+ return {
50
+ ...(0, launcherArgs_1.projectOptions)(values),
51
+ artifactsSpecified: values.has("artifacts"),
52
+ };
53
+ }
54
+ TtscGraphLauncherArguments.dump = dump;
55
+ /**
56
+ * Parse viewer coordinates and bounded numeric options with existing
57
+ * defaults.
58
+ *
59
+ * @evidence contracts/common.md#principled-implementation The original viewer grammar plus safe integer validators retains port zero through 65,535 and positive maxNodes through Number.MAX_SAFE_INTEGER before graph work.
60
+ * @evidence contracts/common.md#clear-and-simple-design Project defaults and numeric policy share existing owners; the viewer retains build, reduction and HTTP lifetime.
61
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
62
+ * @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
63
+ * @evidence contracts/portability.md#os-neutral-implementation Project normalization delegates to Node path.resolve; selected config spelling remains intact, with no shell or separator rewriting.
64
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
65
+ * @evidenceExclude contracts/performance.md#efficient-algorithms one parse pass over argv and up to two integer validations.
66
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work parses argv once per process start.
67
+ */
68
+ function view(argv) {
69
+ const values = (0, launcherArgs_1.parseLauncherOptions)(argv, [
70
+ { key: "cwd", flags: ["--cwd"], kind: "value" },
71
+ { key: "tsconfig", flags: ["--tsconfig", "-p"], kind: "value" },
72
+ { key: "port", flags: ["--port"], kind: "value" },
73
+ { key: "open", flags: ["--no-open"], kind: "flag" },
74
+ { key: "max_nodes", flags: ["--max-nodes"], kind: "value" },
75
+ ]);
76
+ return {
77
+ ...(0, launcherArgs_1.projectOptions)(values),
78
+ port: values.has("port") === true
79
+ ? (0, launcherArgs_1.nonNegativeIntegerOption)(values, "port", 65_535)
80
+ : 0,
81
+ open: values.get("open") !== true,
82
+ maxNodes: values.has("max_nodes") === true
83
+ ? (0, launcherArgs_1.positiveIntegerOption)(values, "max_nodes", Number.MAX_SAFE_INTEGER)
84
+ : 1200,
85
+ };
86
+ }
87
+ TtscGraphLauncherArguments.view = view;
88
+ /**
89
+ * Preserve native dump argv, adding only a present published-artifact path.
90
+ *
91
+ * @evidence contracts/common.md#principled-implementation The dump token precedes the unmodified caller vector; a null publication adds no overlay coordinate.
92
+ * @evidence contracts/common.md#clear-and-simple-design One vector owner is consumed by the actual dump spawn; resident serve/lint vectors remain distinct in their existing owner.
93
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
94
+ * @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
95
+ * @evidence contracts/portability.md#os-neutral-implementation Separate argv elements preserve path and equals-form spelling exactly for Node spawn, without shell quoting.
96
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
97
+ * @evidenceExclude contracts/performance.md#efficient-algorithms one parse pass over argv and a copy of it with at most two appended entries.
98
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work builds one argv per spawn.
99
+ */
100
+ function dumpVector(argv, artifacts) {
101
+ const values = (0, launcherArgs_1.parseLauncherOptions)(argv, DUMP_OPTIONS);
102
+ return [
103
+ "dump",
104
+ ...argv,
105
+ ...(artifacts === null || values.has("artifacts")
106
+ ? []
107
+ : ["--artifacts", artifacts]),
108
+ ];
109
+ }
110
+ TtscGraphLauncherArguments.dumpVector = dumpVector;
111
+ /**
112
+ * Map native completion to its exit code and optional owned spawn diagnostic.
113
+ *
114
+ * @evidence contracts/common.md#principled-implementation Actual spawn errors return code one with the existing owned prefix; normal status passes through exactly, and absent status remains failure one.
115
+ * @evidence contracts/common.md#clear-and-simple-design The actual dump facade writes only the returned diagnostic and returns this code; completion decides no process timing or retry.
116
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
117
+ * @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
118
+ * @evidence contracts/portability.md#os-neutral-implementation Node error and nullable numeric status are preserved as native result representations, with no platform shell exit interpretation.
119
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a small record and retains nothing.
120
+ * @evidenceExclude contracts/performance.md#efficient-algorithms reads two fields of the spawn result in constant time.
121
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work maps one spawn result once.
122
+ */
123
+ function dumpCompletion(result) {
124
+ if (result.error)
125
+ return { code: 1, diagnostic: `@ttsc/graph: ${result.error.message}\n` };
126
+ return { code: result.status ?? 1 };
127
+ }
128
+ TtscGraphLauncherArguments.dumpCompletion = dumpCompletion;
129
+ /**
130
+ * Answer help without a producer, or retain the missing-installation failure.
131
+ *
132
+ * This summary is a fallback: installed native dump still owns its exact
133
+ * flags.
134
+ *
135
+ * @evidence contracts/common.md#principled-implementation Only the three existing help spellings qualify a missing-producer success; ordinary dump remains code one with the owned installation diagnostic.
136
+ * @evidence contracts/common.md#clear-and-simple-design The actual unresolved-binary facade writes these channels and returns their code; this operation decides neither resolution nor child execution.
137
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The qualified help summary names the native authority and its possible drift; no graph fact or native success is fabricated.
138
+ * @evidence contracts/common.md#meaningful-documentation Native prose distinguishes missing-install help from installed authoritative help and ordinary missing-install failure.
139
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation This completion maps already parsed tokens to fixed text and numeric code, without filesystem or process operations.
140
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a small record of strings and retains nothing.
141
+ * @evidenceExclude contracts/performance.md#efficient-algorithms tests argv against three help spellings and returns a constant summary or message.
142
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work answers once per failed binary resolution.
143
+ */
144
+ function missingDump(argv) {
145
+ if (argv.some((argument) => DUMP_HELP_FLAGS.has(argument)))
146
+ return { code: 0, stdout: DUMP_HELP_SUMMARY };
147
+ return {
148
+ code: 1,
149
+ stderr: "@ttsc/graph: could not resolve the ttscgraph binary. " +
150
+ "Install `ttsc` so its platform package is present, " +
151
+ "or set TTSC_GRAPH_BINARY to an absolute path.\n",
152
+ };
153
+ }
154
+ TtscGraphLauncherArguments.missingDump = missingDump;
155
+ })(TtscGraphLauncherArguments || (exports.TtscGraphLauncherArguments = TtscGraphLauncherArguments = {}));
156
+ const DUMP_OPTIONS = [
157
+ { key: "artifacts", flags: ["--artifacts", "-artifacts"], kind: "string" },
158
+ { key: "cwd", flags: ["--cwd", "-cwd"], kind: "value" },
159
+ { key: "tsconfig", flags: ["--tsconfig", "-tsconfig"], kind: "value" },
160
+ { key: "pretty", flags: ["--pretty", "-pretty"], kind: "boolean" },
161
+ { key: "help", flags: ["--help", "-help", "-h"], kind: "flag" },
162
+ ];
163
+ /** The native help aliases mirrored only for missing-installation fallback. */
164
+ const DUMP_HELP_FLAGS = new Set(["--help", "-help", "-h"]);
165
+ /** Short fallback summary pointing to the native command's authoritative help. */
166
+ const DUMP_HELP_SUMMARY = [
167
+ "Usage: ttsc-graph dump [options]",
168
+ "",
169
+ "Write the whole compiler graph as JSON to stdout: every node and edge,",
170
+ "none of the MCP response caps.",
171
+ "",
172
+ "Options:",
173
+ " --cwd <dir> Project root (default: current directory).",
174
+ " --tsconfig <path> Project tsconfig path (default: tsconfig.json).",
175
+ " --pretty Indent the JSON output.",
176
+ "",
177
+ "The native `ttscgraph` binary owns these flags and is not installed here,",
178
+ "so this summary may lag it. Install `ttsc` and rerun for the exact list.",
179
+ "",
180
+ ].join("\n");
181
+ //# sourceMappingURL=TtscGraphLauncherArguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TtscGraphLauncherArguments.js","sourceRoot":"","sources":["../src/TtscGraphLauncherArguments.ts"],"names":[],"mappings":";;;AACA,iDAMwB;AAExB;;;;;;;;;;;GAWG;AACH,IAAiB,0BAA0B,CAuJ1C;AAvJD,WAAiB,0BAA0B;IACzC;;;;;;;;;;;OAWG;IACH,SAAgB,OAAO,CAAC,IAAuB;QAC7C,OAAO,IAAA,6BAAc,EAAC,IAAA,mCAAoB,EAAC,IAAI,EAAE,8BAAe,CAAC,CAAC,CAAC;IACrE,CAAC;IAFe,2BAAA,OAAO,UAEtB,CAAA;IAED;;;;;;;;;;;OAWG;IACH,SAAgB,IAAI,CAClB,IAAuB;QAEvB,MAAM,MAAM,GAAG,IAAA,mCAAoB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACxD,OAAO;YACL,GAAG,IAAA,6BAAc,EAAC,MAAM,CAAC;YACzB,kBAAkB,EAAE,MAAM,CAAC,GAAG,CAA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CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1E,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;IACvD,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;IACtE,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;IAClE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;CACvD,CAAC;AAEX,+EAA+E;AAC/E,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AAE3D,kFAAkF;AAClF,MAAM,iBAAiB,GAAG;IACxB,kCAAkC;IAClC,EAAE;IACF,wEAAwE;IACxE,gCAAgC;IAChC,EAAE;IACF,UAAU;IACV,iEAAiE;IACjE,sEAAsE;IACtE,8CAA8C;IAC9C,EAAE;IACF,2EAA2E;IAC3E,0EAA0E;IAC1E,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { parseDump } from "./model/loadGraph";
2
+ /**
3
+ * Qualify a viewer dump before reduction or HTTP lifetime can begin.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation The actual shared dump decoder validates syntax, schema agreement and complete shape before a viewer receives facts; failures preserve the existing owned diagnostic and code one.
6
+ * @evidence contracts/common.md#clear-and-simple-design This namespace owns viewer validation/completion while parseDump owns schema authority and runView owns native capture, reduction and HTTP resources.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Actual generated validation is retained without a handwritten substitute, test-only producer or successful empty fallback.
8
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the before-reduction/HTTP boundary; decode documents success transfer and diagnostic/code meaning.
9
+ * @evidenceExclude contracts/performance.md#efficient-algorithms decode owns validation work; the namespace groups its result contract.
10
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work No result cache is owned by the namespace; runView owns the one-shot snapshot lifetime.
11
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The grouping acquires no process/socket; decode transfers valid facts to runView.
12
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation validates dump JSON text that the caller already captured; no file, path or process.
13
+ */
14
+ export declare namespace TtscGraphViewSnapshot {
15
+ /**
16
+ * Return validated facts, or the existing viewer diagnostic and failure code.
17
+ *
18
+ * @evidence contracts/common.md#principled-implementation parseDump is the sole generated schema authority; its owned messages pass through once, and an unowned exception receives the existing validation prefix.
19
+ * @evidence contracts/common.md#clear-and-simple-design A discriminated result keeps failure before actual reduction/server creation; runView writes only the returned diagnostic and returns its code.
20
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Failed validation never supplies raw facts; no partial cast or alternate executable bypasses the real decoder.
21
+ * @evidence contracts/common.md#meaningful-documentation The headline explains valid-fact transfer versus failure diagnostic/code, without claiming this pure result is a process exit by itself.
22
+ * @evidence contracts/performance.md#efficient-algorithms Shared JSON/schema validation is linear in submitted bytes and facts, followed by constant-count diagnostic prefix handling; no historical/project scan is introduced.
23
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work Each supplied dump requires actual validation; runView reuses the subsequently reduced immutable HTTP payload.
24
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Only local parsed facts or diagnostic text are created; ownership transfers to the caller and no process, reader, socket or prior dump is retained.
25
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation parses and validates dump JSON text that the caller already captured; no file, path or process.
26
+ */
27
+ function decode(text: string): {
28
+ ok: true;
29
+ raw: ReturnType<typeof parseDump>;
30
+ } | {
31
+ ok: false;
32
+ code: 1;
33
+ diagnostic: string;
34
+ };
35
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TtscGraphViewSnapshot = void 0;
4
+ const loadGraph_1 = require("./model/loadGraph");
5
+ /**
6
+ * Qualify a viewer dump before reduction or HTTP lifetime can begin.
7
+ *
8
+ * @evidence contracts/common.md#principled-implementation The actual shared dump decoder validates syntax, schema agreement and complete shape before a viewer receives facts; failures preserve the existing owned diagnostic and code one.
9
+ * @evidence contracts/common.md#clear-and-simple-design This namespace owns viewer validation/completion while parseDump owns schema authority and runView owns native capture, reduction and HTTP resources.
10
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Actual generated validation is retained without a handwritten substitute, test-only producer or successful empty fallback.
11
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the before-reduction/HTTP boundary; decode documents success transfer and diagnostic/code meaning.
12
+ * @evidenceExclude contracts/performance.md#efficient-algorithms decode owns validation work; the namespace groups its result contract.
13
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work No result cache is owned by the namespace; runView owns the one-shot snapshot lifetime.
14
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The grouping acquires no process/socket; decode transfers valid facts to runView.
15
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation validates dump JSON text that the caller already captured; no file, path or process.
16
+ */
17
+ var TtscGraphViewSnapshot;
18
+ (function (TtscGraphViewSnapshot) {
19
+ /**
20
+ * Return validated facts, or the existing viewer diagnostic and failure code.
21
+ *
22
+ * @evidence contracts/common.md#principled-implementation parseDump is the sole generated schema authority; its owned messages pass through once, and an unowned exception receives the existing validation prefix.
23
+ * @evidence contracts/common.md#clear-and-simple-design A discriminated result keeps failure before actual reduction/server creation; runView writes only the returned diagnostic and returns its code.
24
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Failed validation never supplies raw facts; no partial cast or alternate executable bypasses the real decoder.
25
+ * @evidence contracts/common.md#meaningful-documentation The headline explains valid-fact transfer versus failure diagnostic/code, without claiming this pure result is a process exit by itself.
26
+ * @evidence contracts/performance.md#efficient-algorithms Shared JSON/schema validation is linear in submitted bytes and facts, followed by constant-count diagnostic prefix handling; no historical/project scan is introduced.
27
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work Each supplied dump requires actual validation; runView reuses the subsequently reduced immutable HTTP payload.
28
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Only local parsed facts or diagnostic text are created; ownership transfers to the caller and no process, reader, socket or prior dump is retained.
29
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation parses and validates dump JSON text that the caller already captured; no file, path or process.
30
+ */
31
+ function decode(text) {
32
+ try {
33
+ return { ok: true, raw: (0, loadGraph_1.parseDump)(text) };
34
+ }
35
+ catch (error) {
36
+ const message = error instanceof Error ? error.message : String(error);
37
+ return {
38
+ ok: false,
39
+ code: 1,
40
+ diagnostic: message.startsWith("@ttsc/graph:")
41
+ ? `${message}\n`
42
+ : `@ttsc/graph: could not validate the graph dump: ${message}\n`,
43
+ };
44
+ }
45
+ }
46
+ TtscGraphViewSnapshot.decode = decode;
47
+ })(TtscGraphViewSnapshot || (exports.TtscGraphViewSnapshot = TtscGraphViewSnapshot = {}));
48
+ //# sourceMappingURL=TtscGraphViewSnapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TtscGraphViewSnapshot.js","sourceRoot":"","sources":["../src/TtscGraphViewSnapshot.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C;;;;;;;;;;;GAWG;AACH,IAAiB,qBAAqB,CA+BrC;AA/BD,WAAiB,qBAAqB;IACpC;;;;;;;;;;;OAWG;IACH,SAAgB,MAAM,CACpB,IAAY;QAIZ,IAAI,CAAC;YACH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAA,qBAAS,EAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,CAAC;gBACP,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC;oBAC5C,CAAC,CAAC,GAAG,OAAO,IAAI;oBAChB,CAAC,CAAC,mDAAmD,OAAO,IAAI;aACnE,CAAC;QACJ,CAAC;IACH,CAAC;IAjBe,sBAAA,MAAM,SAiBrB,CAAA;AACH,CAAC,EA/BgB,qBAAqB,aAArB,qBAAqB,GAArB,qBAAqB,QA+BrC"}
package/lib/index.d.ts CHANGED
@@ -1,28 +1,13 @@
1
- /** What a graph result says about where its facts came from. */
1
+ /** Public graph launchers, resident sessions, audit vocabulary and viewer DTOs. */
2
2
  export { RESULT_AUDIT, RESULT_AUDIT_DETAILS, RESULT_AUDIT_DETAILS_CAPPED, RESULT_AUDIT_ESCAPE, RESULT_AUDIT_SELECTION, } from "./server/resultAudit";
3
3
  export { resolveGraphBinary } from "./resolveGraphBinary";
4
- /**
5
- * The viewer reduction the `view` command runs before serving a payload.
6
- *
7
- * Exported because it is one of three copies of the same pure transform — the
8
- * website's uploaded-dump viewer and the benchmark viewer hold the others — and
9
- * a shared policy that cannot be measured from outside the package drifts. It
10
- * already did: two of them filtered git-ignored generated code and this one did
11
- * not.
12
- */
13
4
  export { reduce } from "./reduce";
14
- export type { RawDump, RawEdge, RawNode, ViewerPayload } from "./reduce";
5
+ export type { RawDump } from "./structures/RawDump";
6
+ export type { RawEdge } from "./structures/RawEdge";
7
+ export type { RawNode } from "./structures/RawNode";
8
+ export type { ViewerPayload } from "./structures/ViewerPayload";
15
9
  export { DUMP_SCHEMA_VERSION, loadGraph } from "./model/loadGraph";
16
- export { TtscGraphSession, type TtscGraphRequestOptions, type TtscGraphSessionOptions, } from "./model/TtscGraphSession";
17
- /**
18
- * Run the `@ttsc/graph` launcher.
19
- *
20
- * - `view`: JS-orchestrated 3D viewer (dump -> reduce -> serve -> open).
21
- * - `dump`: pass through to the native `ttscgraph dump`, which prints the whole
22
- * graph as JSON for piping or the viewer.
23
- * - Default: serve the MCP graph over stdio. The TypeScript server keeps a native
24
- * incremental compiler session resident, checks the disk snapshot before each
25
- * graph operation, and reuses the in-memory graph when unchanged; the agent's
26
- * MCP client speaks JSON-RPC over this process's stdin/stdout.
27
- */
28
- export declare function runGraph(argv?: readonly string[]): number | void;
10
+ export { TtscGraphSession } from "./model/TtscGraphSession";
11
+ export type { TtscGraphRequestOptions } from "./model/TtscGraphRequestOptions";
12
+ export type { TtscGraphSessionOptions } from "./model/TtscGraphSessionOptions";
13
+ export { runGraph } from "./runGraph";
package/lib/index.js CHANGED
@@ -1,36 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TtscGraphSession = exports.loadGraph = exports.DUMP_SCHEMA_VERSION = exports.reduce = exports.resolveGraphBinary = exports.RESULT_AUDIT_SELECTION = exports.RESULT_AUDIT_ESCAPE = exports.RESULT_AUDIT_DETAILS_CAPPED = exports.RESULT_AUDIT_DETAILS = exports.RESULT_AUDIT = void 0;
4
- exports.runGraph = runGraph;
5
- const node_child_process_1 = require("node:child_process");
6
- const launcherArgs_1 = require("./launcherArgs");
7
- const publishedArtifacts_1 = require("./model/publishedArtifacts");
8
- const nativeExecutable_1 = require("./nativeExecutable");
9
- const resolveGraphBinary_1 = require("./resolveGraphBinary");
10
- const startServer_1 = require("./server/startServer");
11
- const view_1 = require("./view");
12
- /** What a graph result says about where its facts came from. */
3
+ exports.runGraph = exports.TtscGraphSession = exports.loadGraph = exports.DUMP_SCHEMA_VERSION = exports.reduce = exports.resolveGraphBinary = exports.RESULT_AUDIT_SELECTION = exports.RESULT_AUDIT_ESCAPE = exports.RESULT_AUDIT_DETAILS_CAPPED = exports.RESULT_AUDIT_DETAILS = exports.RESULT_AUDIT = void 0;
4
+ /** Public graph launchers, resident sessions, audit vocabulary and viewer DTOs. */
13
5
  var resultAudit_1 = require("./server/resultAudit");
14
6
  Object.defineProperty(exports, "RESULT_AUDIT", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT; } });
15
7
  Object.defineProperty(exports, "RESULT_AUDIT_DETAILS", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT_DETAILS; } });
16
8
  Object.defineProperty(exports, "RESULT_AUDIT_DETAILS_CAPPED", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT_DETAILS_CAPPED; } });
17
9
  Object.defineProperty(exports, "RESULT_AUDIT_ESCAPE", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT_ESCAPE; } });
18
10
  Object.defineProperty(exports, "RESULT_AUDIT_SELECTION", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT_SELECTION; } });
19
- // Programmatic entry points. Each resolves its native binary from the project
20
- // `cwd` it is given (see `resolveGraphBinary`), so a caller that graphs a
21
- // project other than its own process directory names it once and the binary is
22
- // found under that project's installed `ttsc`.
23
- var resolveGraphBinary_2 = require("./resolveGraphBinary");
24
- Object.defineProperty(exports, "resolveGraphBinary", { enumerable: true, get: function () { return resolveGraphBinary_2.resolveGraphBinary; } });
25
- /**
26
- * The viewer reduction the `view` command runs before serving a payload.
27
- *
28
- * Exported because it is one of three copies of the same pure transform — the
29
- * website's uploaded-dump viewer and the benchmark viewer hold the others — and
30
- * a shared policy that cannot be measured from outside the package drifts. It
31
- * already did: two of them filtered git-ignored generated code and this one did
32
- * not.
33
- */
11
+ var resolveGraphBinary_1 = require("./resolveGraphBinary");
12
+ Object.defineProperty(exports, "resolveGraphBinary", { enumerable: true, get: function () { return resolveGraphBinary_1.resolveGraphBinary; } });
34
13
  var reduce_1 = require("./reduce");
35
14
  Object.defineProperty(exports, "reduce", { enumerable: true, get: function () { return reduce_1.reduce; } });
36
15
  var loadGraph_1 = require("./model/loadGraph");
@@ -38,107 +17,6 @@ Object.defineProperty(exports, "DUMP_SCHEMA_VERSION", { enumerable: true, get: f
38
17
  Object.defineProperty(exports, "loadGraph", { enumerable: true, get: function () { return loadGraph_1.loadGraph; } });
39
18
  var TtscGraphSession_1 = require("./model/TtscGraphSession");
40
19
  Object.defineProperty(exports, "TtscGraphSession", { enumerable: true, get: function () { return TtscGraphSession_1.TtscGraphSession; } });
41
- // The server version reported in the MCP handshake; read from this package.
42
- const VERSION = require("../package.json")
43
- .version;
44
- const DUMP_OPTIONS = [
45
- { key: "cwd", flags: ["--cwd", "-cwd"], kind: "value" },
46
- { key: "tsconfig", flags: ["--tsconfig", "-tsconfig"], kind: "value" },
47
- { key: "pretty", flags: ["--pretty", "-pretty"], kind: "boolean" },
48
- { key: "help", flags: ["--help", "-help", "-h"], kind: "flag" },
49
- ];
50
- /**
51
- * Run the `@ttsc/graph` launcher.
52
- *
53
- * - `view`: JS-orchestrated 3D viewer (dump -> reduce -> serve -> open).
54
- * - `dump`: pass through to the native `ttscgraph dump`, which prints the whole
55
- * graph as JSON for piping or the viewer.
56
- * - Default: serve the MCP graph over stdio. The TypeScript server keeps a native
57
- * incremental compiler session resident, checks the disk snapshot before each
58
- * graph operation, and reuses the in-memory graph when unchanged; the agent's
59
- * MCP client speaks JSON-RPC over this process's stdin/stdout.
60
- */
61
- function runGraph(argv = process.argv.slice(2)) {
62
- if (argv[0] === "view")
63
- return (0, view_1.runView)(argv.slice(1));
64
- if (argv[0] === "dump")
65
- return runDump(argv.slice(1));
66
- const { cwd, tsconfig } = (0, launcherArgs_1.projectOptions)((0, launcherArgs_1.parseLauncherOptions)(argv, launcherArgs_1.PROJECT_OPTIONS));
67
- void (0, startServer_1.startServer)({ cwd, tsconfig, version: VERSION }).catch((error) => {
68
- process.stderr.write(`@ttsc/graph: ${error instanceof Error ? error.message : String(error)}\n`);
69
- process.exit(1);
70
- });
71
- }
72
- /** The help spellings `ttscgraph` itself accepts, mirrored for the fallback. */
73
- const DUMP_HELP_FLAGS = new Set(["--help", "-help", "-h"]);
74
- /**
75
- * Print a `dump` usage summary when the native binary cannot be resolved.
76
- *
77
- * This is a fallback, not a second contract: `cmd/ttscgraph/main.go` owns these
78
- * flags and answers whenever it is installed. Keep this short and point at that
79
- * authority, so a drift degrades to a stale summary rather than a wrong
80
- * answer.
81
- */
82
- function printDumpHelp() {
83
- process.stdout.write([
84
- "Usage: ttsc-graph dump [options]",
85
- "",
86
- "Write the whole compiler graph as JSON to stdout: every node and edge,",
87
- "none of the MCP response caps.",
88
- "",
89
- "Options:",
90
- " --cwd <dir> Project root (default: current directory).",
91
- " --tsconfig <path> Project tsconfig path (default: tsconfig.json).",
92
- " --pretty Indent the JSON output.",
93
- "",
94
- "The native `ttscgraph` binary owns these flags and is not installed here,",
95
- "so this summary may lag it. Install `ttsc` and rerun for the exact list.",
96
- "",
97
- ].join("\n"));
98
- }
99
- /**
100
- * Pass `dump` through to the native binary, inheriting stdio so the JSON lands
101
- * on this process's stdout. Returns the child's exit code.
102
- */
103
- function runDump(argv) {
104
- // Resolve the native binary from the target project the caller named with
105
- // `--cwd`, not from wherever the launcher process happened to start.
106
- const { cwd, tsconfig } = (0, launcherArgs_1.projectOptions)((0, launcherArgs_1.parseLauncherOptions)(argv, DUMP_OPTIONS));
107
- const binary = (0, resolveGraphBinary_1.resolveGraphBinary)(process.env, cwd);
108
- if (binary === null) {
109
- // `ttscgraph` owns the flag contract, so a resolvable binary always answers
110
- // `--help` itself and stays the single source of truth. It cannot answer
111
- // when it is absent, and that is exactly when a caller is most likely to be
112
- // asking what the command needs — so fall back to a summary that names the
113
- // authority rather than making usage unreachable behind an install error.
114
- if (argv.some((argument) => DUMP_HELP_FLAGS.has(argument))) {
115
- printDumpHelp();
116
- return 0;
117
- }
118
- process.stderr.write("@ttsc/graph: could not resolve the ttscgraph binary. " +
119
- "Install `ttsc` so its platform package is present, " +
120
- "or set TTSC_GRAPH_BINARY to an absolute path.\n");
121
- return 1;
122
- }
123
- (0, nativeExecutable_1.ensureExecutable)(binary);
124
- // The same artifacts `loadGraph` and the resident session ask for, so the
125
- // three ways to reach a dump answer a citation the same way. A caller that
126
- // named `--artifacts` itself owns the answer and is not overridden.
127
- const published = argv.includes("--artifacts")
128
- ? null
129
- : (0, publishedArtifacts_1.publishArtifacts)({ cwd, tsconfig });
130
- const result = (0, node_child_process_1.spawnSync)(binary, [
131
- "dump",
132
- ...argv,
133
- ...(published?.file == null ? [] : ["--artifacts", published.file]),
134
- ], {
135
- stdio: "inherit",
136
- windowsHide: true,
137
- });
138
- if (result.error) {
139
- process.stderr.write(`@ttsc/graph: ${result.error.message}\n`);
140
- return 1;
141
- }
142
- return result.status ?? 1;
143
- }
20
+ var runGraph_1 = require("./runGraph");
21
+ Object.defineProperty(exports, "runGraph", { enumerable: true, get: function () { return runGraph_1.runGraph; } });
144
22
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,2DAA+C;AAE/C,iDAIwB;AACxB,mEAA8D;AAC9D,yDAAsD;AACtD,6DAA0D;AAC1D,sDAAmD;AACnD,iCAAiC;AAEjC,gEAAgE;AAChE,oDAM8B;AAL5B,2GAAA,YAAY,OAAA;AACZ,mHAAA,oBAAoB,OAAA;AACpB,0HAAA,2BAA2B,OAAA;AAC3B,kHAAA,mBAAmB,OAAA;AACnB,qHAAA,sBAAsB,OAAA;AAGxB,8EAA8E;AAC9E,0EAA0E;AAC1E,+EAA+E;AAC/E,+CAA+C;AAC/C,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B;;;;;;;;GAQG;AACH,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,+CAAmE;AAA1D,gHAAA,mBAAmB,OAAA;AAAE,sGAAA,SAAS,OAAA;AACvC,6DAIkC;AAHhC,oHAAA,gBAAgB,OAAA;AAKlB,4EAA4E;AAC5E,MAAM,OAAO,GAAY,OAAO,CAAC,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