@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
@@ -1,82 +1,41 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.TtscGraphSession = void 0;
40
- const _assertGuard_1 = __importStar(require("typia/lib/internal/_assertGuard"));
41
- const node_child_process_1 = require("node:child_process");
42
- const node_readline_1 = __importDefault(require("node:readline"));
43
- const typia_1 = __importDefault(require("typia"));
4
+ const ttsc_1 = require("ttsc");
44
5
  const nativeExecutable_1 = require("../nativeExecutable");
45
6
  const resolveGraphBinary_1 = require("../resolveGraphBinary");
46
- const TtscGraphMemory_1 = require("./TtscGraphMemory");
47
- const TtscGraphShardStore_1 = require("./TtscGraphShardStore");
7
+ const TtscGraphLinePeer_1 = require("./TtscGraphLinePeer");
8
+ const TtscGraphNativeArguments_1 = require("./TtscGraphNativeArguments");
9
+ const TtscGraphProtocol_1 = require("./TtscGraphProtocol");
10
+ const TtscGraphSessionState_1 = require("./TtscGraphSessionState");
48
11
  const TtscLintDaemon_1 = require("./TtscLintDaemon");
49
- const loadGraph_1 = require("./loadGraph");
50
12
  const publishedArtifacts_1 = require("./publishedArtifacts");
51
- /**
52
- * The serve protocol version this client speaks.
53
- *
54
- * Keep it equal to `serveProtocolVersion` in
55
- * `packages/ttsc/cmd/ttscgraph/serve.go`. The two are hand-synchronized, and
56
- * `serve_protocol_version_matches_the_typescript_client_test.go` reads this
57
- * constant out of this file and fails if the pair drifts.
58
- */
59
- const PROTOCOL_VERSION = 1;
60
- const GRAPH_SNAPSHOT_PROTOCOL_VERSION = 1;
61
- const TERMINATION_GRACE_MS = 1_000;
62
13
  /**
63
14
  * Resident bridge to `ttscgraph serve`.
64
15
  *
65
- * Every graph request first asks the native session for the current disk
66
- * snapshot. Unchanged requests reuse the existing {@link TtscGraphMemory}; an
67
- * edited source reuses tsgo's resident Program through `driver.Session`, while
68
- * config and root-file-set changes force a safe full reload.
16
+ * Requests admitted before a freshness check starts share that check and its
17
+ * snapshot. Later arrivals require another check. Unchanged requests reuse the
18
+ * existing {@link TtscGraphMemory}; an edited source reuses tsgo's resident
19
+ * Program through `driver.Session`, while config and root-file-set changes
20
+ * force a safe full reload.
21
+ *
22
+ * Cold publisher discovery, proof validation and direct publisher commands run
23
+ * through the SDK's asynchronous owner. Request-group cancellation and session
24
+ * shutdown join those producers before a later admission can publish.
25
+ *
26
+ * @evidence contracts/common.md#principled-implementation Validated versioned responses and atomic shard transactions preserve generation consistency while serialized requests correlate native replies by id.
27
+ * @evidence contracts/common.md#clear-and-simple-design This facade owns project/binary and artifact sidecars; the state owns queue/model/shards, the protocol owns generated decoding and the line adapter owns the native child.
28
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Compatible full dumps remain an explicit protocol fallback; malformed or mismatched responses retire the child rather than producing partial trusted facts.
29
+ * @evidence contracts/common.md#meaningful-documentation Native paragraphs explain resident reuse, reload boundaries and artifact ownership, while public methods describe request and shutdown behavior.
30
+ * @evidenceExclude contracts/performance.md#efficient-algorithms graph delegates admission and refresh to the state owner; this facade describes project, binary and artifact sidecar identity.
31
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work graph owns coordination of model/producer reuse and its invalidation decisions.
32
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources graph/close own actual acquisition and retirement; the class declaration describes the owner without a separate lifecycle operation.
33
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Native project resolution and process control are reviewed through graph and close, including their private helpers.
69
34
  */
70
35
  class TtscGraphSession {
71
36
  cwd;
72
37
  tsconfig;
73
38
  binary;
74
- child;
75
- nextId = 0;
76
- pending = new Map();
77
- queue = Promise.resolve();
78
- current;
79
- shardStore = new TtscGraphShardStore_1.TtscGraphShardStore();
80
39
  /**
81
40
  * The artifact answer the resident child was last handed, and the state of
82
41
  * the inputs it came from.
@@ -87,6 +46,7 @@ class TtscGraphSession {
87
46
  * session can notice.
88
47
  */
89
48
  artifacts;
49
+ resolver = new ttsc_1.CapabilityPluginResolver();
90
50
  /**
91
51
  * One resident `@ttsc/lint` sidecar per plugin binary, opened lazily.
92
52
  *
@@ -97,7 +57,10 @@ class TtscGraphSession {
97
57
  * binary answering for the same project.
98
58
  */
99
59
  daemons = new Map();
100
- closed = false;
60
+ daemonIdentities = new Map();
61
+ state;
62
+ shutdown = new AbortController();
63
+ retiredDaemons = new Set();
101
64
  constructor(options) {
102
65
  // Resolve the platform binary from the project this session serves, so the
103
66
  // MCP server started from an unrelated directory still finds the target's
@@ -112,134 +75,68 @@ class TtscGraphSession {
112
75
  this.cwd = options.cwd;
113
76
  this.tsconfig = options.tsconfig;
114
77
  this.binary = binary;
78
+ this.state = new TtscGraphSessionState_1.TtscGraphSessionState({
79
+ open: (events) => this.open(events),
80
+ decode: TtscGraphProtocol_1.TtscGraphProtocol.decode,
81
+ beforeRequest: (signal) => this.republishArtifacts(signal),
82
+ artifacts: () => this.artifacts === undefined ? undefined : (this.artifacts.file ?? ""),
83
+ close: async () => {
84
+ for (const daemon of this.daemons.values())
85
+ this.retireDaemon(daemon);
86
+ this.daemons.clear();
87
+ this.daemonIdentities.clear();
88
+ const results = await Promise.allSettled([
89
+ ...this.retiredDaemons,
90
+ this.resolver.close(),
91
+ ]);
92
+ this.artifacts = undefined;
93
+ const failures = results
94
+ .filter((result) => result.status === "rejected")
95
+ .map((result) => result.reason);
96
+ if (failures.length > 0)
97
+ throw new AggregateError(failures, "@ttsc/graph: sidecar shutdown failed");
98
+ },
99
+ });
115
100
  }
116
- /** Return a graph for the current disk snapshot, serialized per tool call. */
101
+ /**
102
+ * Return a graph refreshed after this caller's admission.
103
+ *
104
+ * Callers already waiting when a check starts share it. Cancellation rejects
105
+ * only that caller. The last cancellation aborts shared work; an outstanding
106
+ * native request then retires its peer. Closed sessions reject new requests
107
+ * and do not respawn.
108
+ *
109
+ * @evidence contracts/common.md#principled-implementation The state groups only callers admitted before its refresh starts, so every returned snapshot was validated after that caller's admission; independent cancellation cannot settle siblings.
110
+ * @evidence contracts/common.md#clear-and-simple-design The state owner handles admission, cancellation, response semantics and model replacement; facade callbacks synchronize artifacts and open the actual native transport.
111
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts A cancelled or closed request cannot be fulfilled from fabricated empty facts or restart a disposed session.
112
+ * @evidence contracts/common.md#meaningful-documentation Native prose states admission-based snapshot sharing, independent cancellation and closed-session behavior.
113
+ * @evidence contracts/portability.md#os-neutral-implementation Native binary resolution, argv spawning and Node termination APIs own host differences; project coordinates are never passed through a shell.
114
+ * @evidence contracts/performance.md#efficient-algorithms An admission group validates artifact inputs and a native frame once, then shares its model among live callers; changed frames additionally validate shards and rebuild indexes.
115
+ * @evidence contracts/performance.md#reuse-equivalent-work Only callers admitted before validation starts share that validation. Later groups check again; unchanged responses reuse current memory, while changed generations replace it and changed artifacts are republished before requesting facts.
116
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The session owns one graph child, current model, shard map and current publisher sidecars; republishing retires removed publishers, while pending/queued demand grows with submitted requests and completion/cancellation remove registrations.
117
+ */
117
118
  graph(options = {}) {
118
- if (this.closed) {
119
- return Promise.reject(new Error("@ttsc/graph: native session is closed"));
120
- }
121
- let resolve;
122
- let reject;
123
- let started = false;
124
- let settled = false;
125
- const result = new Promise((res, rej) => {
126
- resolve = (graph) => {
127
- if (settled)
128
- return;
129
- settled = true;
130
- res(graph);
131
- };
132
- reject = (error) => {
133
- if (settled)
134
- return;
135
- settled = true;
136
- rej(error);
137
- };
138
- });
139
- const cancelQueued = () => {
140
- if (!started)
141
- reject(cancelledError(options.signal));
142
- };
143
- if (options.signal?.aborted) {
144
- reject(cancelledError(options.signal));
145
- return result;
146
- }
147
- options.signal?.addEventListener("abort", cancelQueued, { once: true });
148
- this.queue = this.queue
149
- .catch(() => undefined)
150
- .then(async () => {
151
- started = true;
152
- options.signal?.removeEventListener("abort", cancelQueued);
153
- if (settled)
154
- return;
155
- try {
156
- resolve(await this.refresh(options.signal));
157
- }
158
- catch (error) {
159
- reject(asError(error));
160
- }
161
- });
162
- return result;
119
+ return this.state.graph(options);
163
120
  }
164
- /** Close the native session. Safe to call more than once. */
121
+ /**
122
+ * Close the native session. Safe to call more than once.
123
+ *
124
+ * Retires artifact sidecars, discovery worker and supervised publisher
125
+ * commands, and rejects pending native requests. Queued requests observe the
126
+ * closed state before they can create another child.
127
+ *
128
+ * @evidence contracts/common.md#principled-implementation The closed flag precedes sidecar disposal and child failure, so every pending or subsequent native operation observes retired ownership.
129
+ * @evidence contracts/common.md#clear-and-simple-design The explicit close path reuses failChild/failPending cleanup instead of a second cancellation implementation.
130
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Disposing a session cannot trigger a compensating respawn or pretend outstanding requests succeeded.
131
+ * @evidence contracts/common.md#meaningful-documentation Native prose documents idempotence, pending rejection and queued-request behavior.
132
+ * @evidence contracts/portability.md#os-neutral-implementation Node child termination ends stdin, signals the process and escalates after a grace period without platform shell commands.
133
+ * @evidence contracts/performance.md#efficient-algorithms Shutdown visits sidecars and pending replies once; a delayed force-kill timer is cancelled when the child exits.
134
+ * @evidence contracts/performance.md#reuse-equivalent-work Closure ends this owner's permission to reuse native Program, model and sidecars; subsequent graph calls reject.
135
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Shutdown aborts discovery and publisher commands, joins the resolver and sidecars, and drops opaque proofs. Native readers and reply listeners are removed, model/shards are released with child retirement, and graph-peer termination owns its finite grace timer.
136
+ */
165
137
  close() {
166
- if (this.closed)
167
- return;
168
- this.closed = true;
169
- // The sidecars outlive nothing. A daemon is a child process this session
170
- // opened, and a session that closed without stopping them would leave one
171
- // resident Program per configured publisher alive for as long as the parent
172
- // ran.
173
- for (const daemon of this.daemons.values())
174
- daemon.close();
175
- this.daemons.clear();
176
- const error = new Error("@ttsc/graph: native session closed");
177
- if (this.child !== undefined)
178
- this.failChild(this.child, error);
179
- else
180
- this.failPending(error);
181
- }
182
- async refresh(signal) {
183
- // The protocol version and the envelope shape were both settled in onLine,
184
- // before this frame was ever routed here.
185
- await this.republishArtifacts(signal);
186
- const response = await this.request(signal);
187
- this.assertResponseSemantics(response);
188
- if (response.error !== undefined) {
189
- throw new Error(`@ttsc/graph: ${response.error}`);
190
- }
191
- if (response.changed) {
192
- if (response.snapshot !== undefined) {
193
- try {
194
- this.current = TtscGraphMemory_1.TtscGraphMemory.from(this.shardStore.apply(response.snapshot));
195
- }
196
- catch (error) {
197
- const failure = asError(error);
198
- if (this.child !== undefined)
199
- this.failChild(this.child, failure);
200
- throw failure;
201
- }
202
- }
203
- else if (response.dump !== undefined) {
204
- // A serve-protocol-v1 binary predating graph shard negotiation ignores
205
- // the optional request field and retains the complete-dump response.
206
- this.current = TtscGraphMemory_1.TtscGraphMemory.from(response.dump);
207
- }
208
- else {
209
- throw new Error(`@ttsc/graph: native ${response.mode} response omitted both graph snapshot protocol v${String(GRAPH_SNAPSHOT_PROTOCOL_VERSION)} data and a compatible dump`);
210
- }
211
- }
212
- if (this.current === undefined) {
213
- throw new Error("@ttsc/graph: native session returned no initial graph snapshot");
214
- }
215
- return this.current;
216
- }
217
- assertResponseSemantics(response) {
218
- const bodies = Number(response.dump !== undefined) +
219
- Number(response.snapshot !== undefined);
220
- let problem;
221
- if (response.error !== undefined) {
222
- if (response.mode !== "error" || response.changed || bodies !== 0) {
223
- problem = "an error response carried snapshot state";
224
- }
225
- }
226
- else if (response.mode === "error") {
227
- problem = "an error-mode response omitted its error";
228
- }
229
- else if (response.changed) {
230
- if (response.mode === "unchanged" || bodies !== 1) {
231
- problem = "a changed response did not carry exactly one snapshot body";
232
- }
233
- }
234
- else if (response.mode !== "unchanged" || bodies !== 0) {
235
- problem = "an unchanged response carried changed mode or snapshot state";
236
- }
237
- if (problem === undefined)
238
- return;
239
- const error = new Error(`@ttsc/graph: native session returned ${problem}`);
240
- if (this.child !== undefined)
241
- this.failChild(this.child, error);
242
- throw error;
138
+ this.shutdown.abort(new Error("@ttsc/graph: native session closed"));
139
+ return this.state.close();
243
140
  }
244
141
  /**
245
142
  * Re-derive the artifact set when the documents or configuration behind it
@@ -262,1066 +159,95 @@ class TtscGraphSession {
262
159
  * evaluation per verb. An already-cancelled request does not start one.
263
160
  */
264
161
  async republishArtifacts(signal) {
265
- if (signal?.aborted)
162
+ const active = signal === undefined
163
+ ? this.shutdown.signal
164
+ : AbortSignal.any([signal, this.shutdown.signal]);
165
+ active.throwIfAborted();
166
+ await Promise.all(this.retiredDaemons);
167
+ active.throwIfAborted();
168
+ if (this.artifacts !== undefined &&
169
+ !(await (0, publishedArtifacts_1.artifactsAreStaleResident)(this.artifacts, { signal: active })))
266
170
  return;
267
- // A child yet to be spawned publishes on the way up, so there is nothing
268
- // here to keep fresh until one does.
269
- if (this.child === undefined || this.artifacts === undefined)
270
- return;
271
- if (!(0, publishedArtifacts_1.artifactsAreStale)(this.artifacts))
272
- return;
273
- const next = await (0, publishedArtifacts_1.publishArtifactsResident)({ cwd: this.cwd, tsconfig: this.tsconfig }, (plugin) => this.daemon(plugin));
274
- // The new answer is taken whatever it says, including that the project now
275
- // publishes nothing. Keeping the old set on a `null` would be guessing that
276
- // the publisher failed rather than that it was removed, and guessing wrong
277
- // in that direction is the unrecoverable one: a session that answers with
278
- // artifacts from a plugin the user deleted keeps doing so until it is
279
- // restarted, while a transient failure is repaired by the next edit.
280
- this.artifacts = next;
171
+ const publishers = new Set();
172
+ let next;
173
+ let failure;
174
+ try {
175
+ next = await (0, publishedArtifacts_1.publishArtifactsResident)({ cwd: this.cwd, tsconfig: this.tsconfig, signal: active }, (plugin) => {
176
+ publishers.add(plugin.binary);
177
+ return this.daemon(plugin);
178
+ }, this.resolver);
179
+ for (const [binary, daemon] of this.daemons) {
180
+ if (publishers.has(binary))
181
+ continue;
182
+ await this.retireDaemon(daemon);
183
+ this.daemons.delete(binary);
184
+ this.daemonIdentities.delete(binary);
185
+ }
186
+ active.throwIfAborted();
187
+ // Successful absence replaces the old overlay too. The exact old proof
188
+ // is released before the new one becomes this session's authority.
189
+ await this.artifacts?.discovery.release();
190
+ active.throwIfAborted();
191
+ this.artifacts = next;
192
+ next = undefined;
193
+ }
194
+ catch (error) {
195
+ failure = error;
196
+ throw error;
197
+ }
198
+ finally {
199
+ const closing = [];
200
+ if (next !== undefined)
201
+ closing.push(next.discovery.release());
202
+ if (active.aborted) {
203
+ for (const binary of publishers) {
204
+ const daemon = this.daemons.get(binary);
205
+ if (daemon !== undefined)
206
+ closing.push(this.retireDaemon(daemon));
207
+ this.daemons.delete(binary);
208
+ this.daemonIdentities.delete(binary);
209
+ }
210
+ }
211
+ const results = await Promise.allSettled(closing);
212
+ const failures = results
213
+ .filter((result) => result.status === "rejected")
214
+ .map((result) => result.reason);
215
+ if (failures.length > 0)
216
+ throw new AggregateError([...(failure === undefined ? [] : [failure]), ...failures], "@ttsc/graph: artifact cleanup failed");
217
+ }
281
218
  }
282
219
  /** The open sidecar for one plugin, opened on first use. */
283
- daemon(plugin) {
220
+ async daemon(plugin) {
221
+ this.shutdown.signal.throwIfAborted();
284
222
  const open = this.daemons.get(plugin.binary);
285
- if (open !== undefined)
223
+ const identity = JSON.stringify([plugin.manifest, plugin.projectContext]);
224
+ if (open !== undefined &&
225
+ this.daemonIdentities.get(plugin.binary) === identity)
286
226
  return open;
227
+ if (open !== undefined) {
228
+ const closing = this.retireDaemon(open);
229
+ await closing;
230
+ }
231
+ this.shutdown.signal.throwIfAborted();
287
232
  const created = new TtscLintDaemon_1.TtscLintDaemon(plugin, this.cwd, this.tsconfig);
288
233
  this.daemons.set(plugin.binary, created);
234
+ this.daemonIdentities.set(plugin.binary, identity);
289
235
  return created;
290
236
  }
291
- request(signal) {
292
- if (signal?.aborted)
293
- throw cancelledError(signal);
294
- const child = this.ensureChild();
295
- const id = ++this.nextId;
296
- return new Promise((resolve, reject) => {
297
- const pending = {
298
- child,
299
- resolve,
300
- reject,
301
- signal,
302
- };
303
- if (signal !== undefined) {
304
- pending.abort = () => this.failChild(child, cancelledError(signal, child));
305
- signal.addEventListener("abort", pending.abort, { once: true });
306
- }
307
- this.pending.set(id, pending);
308
- if (signal?.aborted) {
309
- pending.abort();
310
- return;
311
- }
312
- child.process.stdin.write(`${JSON.stringify({
313
- id,
314
- graphSnapshotVersion: GRAPH_SNAPSHOT_PROTOCOL_VERSION,
315
- // Empty when the project publishes nothing, which withdraws whatever
316
- // the server holds: a publisher the user removed must stop being
317
- // answered with, and omitting the field instead would say only that
318
- // this client has no opinion. Omitted only before a child exists,
319
- // which no request reaches.
320
- artifacts: this.artifacts === undefined
321
- ? undefined
322
- : (this.artifacts.file ?? ""),
323
- })}\n`, (error) => {
324
- if (error === null || error === undefined)
325
- return;
326
- if (this.pending.get(id) !== pending)
327
- return;
328
- this.failChild(child, new Error(`@ttsc/graph: could not request native snapshot: ${error.message}`));
329
- });
330
- });
237
+ /** Keep failures visible to shutdown, releasing fulfilled historical owners. */
238
+ retireDaemon(daemon) {
239
+ const closing = daemon.close();
240
+ this.retiredDaemons.add(closing);
241
+ void closing.then(() => this.retiredDaemons.delete(closing), () => undefined);
242
+ return closing;
331
243
  }
332
- ensureChild() {
333
- if (this.closed) {
334
- // A request queued behind the close must not respawn the native
335
- // process; an orphaned resident compiler would outlive the MCP server.
336
- throw new Error("@ttsc/graph: native session is closed");
337
- }
338
- if (this.child !== undefined &&
339
- this.child.process.exitCode === null &&
340
- this.child.process.signalCode === null) {
341
- return this.child;
342
- }
343
- const artifacts = (0, publishedArtifacts_1.publishArtifacts)({
344
- cwd: this.cwd,
345
- tsconfig: this.tsconfig,
346
- });
347
- this.artifacts = artifacts;
348
- const process = (0, node_child_process_1.spawn)(this.binary, [
349
- "serve",
350
- "--cwd",
351
- this.cwd,
352
- "--tsconfig",
353
- this.tsconfig,
354
- ...(artifacts.file === null ? [] : ["--artifacts", artifacts.file]),
355
- ], { stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
356
- const lines = node_readline_1.default.createInterface({ input: process.stdout });
357
- const child = { process, lines, stderr: "" };
358
- this.child = child;
359
- process.stderr.setEncoding("utf8");
360
- process.stderr.on("data", (chunk) => {
361
- child.stderr = (child.stderr + chunk).slice(-64 * 1024);
362
- });
363
- lines.on("line", (line) => this.onLine(child, line));
364
- process.on("error", (error) => this.failChild(child, new Error(`@ttsc/graph: native session failed: ${error.message}`)));
365
- process.on("exit", (code, signal) => {
366
- if (this.child !== child)
367
- return;
368
- this.failChild(child, new Error(`@ttsc/graph: native session exited (code=${String(code)}, signal=${String(signal)})${stderrSuffix(child)}`), false);
369
- });
370
- return child;
371
- }
372
- onLine(child, line) {
373
- if (this.child !== child)
374
- return;
375
- let parsed;
376
- try {
377
- parsed = JSON.parse(line);
378
- }
379
- catch (error) {
380
- this.failChild(child, new Error(`@ttsc/graph: native session returned invalid JSON: ${asError(error).message}`));
381
- return;
382
- }
383
- // Read the version before the shape, because a server speaking another
384
- // version is entitled to a different shape. Asserting first would report
385
- // that mismatch as a field complaint — "expected string at $input.mode" —
386
- // about a contract the other side never agreed to, which is the misparse
387
- // this field exists to prevent. Ask what protocol it is first, then hold it
388
- // to that protocol.
389
- const version = (() => {
390
- const _io0 = input => "number" === typeof input.protocolVersion;
391
- return input => "object" === typeof input && null !== input && _io0(input);
392
- })()(parsed) ? parsed.protocolVersion
393
- : undefined;
394
- if (version !== PROTOCOL_VERSION) {
395
- // Session-wide: a version mismatch is not one bad frame, it is the wrong
396
- // binary, and every request against it is equally doomed.
397
- this.failChild(child, new Error(`@ttsc/graph: ttscgraph speaks serve protocol ${version === undefined ? "an unknown version" : `v${String(version)}`}, this client speaks v${String(PROTOCOL_VERSION)}. ` +
398
- "Install a matching `ttsc` (the binary resolves from the target " +
399
- "project, or from TTSC_GRAPH_BINARY)."));
400
- return;
401
- }
402
- let response;
403
- try {
404
- // Validate the envelope, not just the dump it carries. The dump was
405
- // typia-asserted while the envelope around it was a bare cast, so the
406
- // fields the client actually branches on — the mode, and the id that
407
- // routes the frame — were the unchecked ones. Anything added to the
408
- // envelope belongs on this side of that line.
409
- response = (() => {
410
- const _ip0 = input => "number" === typeof input["protocolVersion"];
411
- const _ip1 = input => Array.isArray(input["capabilities"]) && input["capabilities"].every(elem => "string" === typeof elem);
412
- const _ip2 = input => "string" === typeof input["project"];
413
- const _ip3 = input => "string" === typeof input["tsconfig"];
414
- const _ip4 = input => Array.isArray(input["diagnostics"]) && input["diagnostics"].every(elem => "object" === typeof elem && null !== elem && _io8(elem));
415
- const _ip5 = input => Array.isArray(input["nodes"]) && input["nodes"].every(elem => "object" === typeof elem && null !== elem && _io9(elem));
416
- const _ip6 = input => Array.isArray(input["edges"]) && input["edges"].every(elem => "object" === typeof elem && null !== elem && _io16(elem));
417
- const _ip7 = input => "number" === typeof input["schemaVersion"];
418
- const _ip8 = input => "object" === typeof input["producer"] && null !== input["producer"] && _io3(input["producer"]);
419
- const _ip9 = input => "object" === typeof input["universe"] && null !== input["universe"] && _io4(input["universe"]);
420
- const _ip10 = input => "string" === typeof input["file"];
421
- const _ip11 = input => "string" === typeof input["digest"];
422
- const _ip12 = input => "string" === typeof input["id"];
423
- const _ip13 = input => "string" === typeof input["name"];
424
- const _ip14 = input => undefined === input["qualifiedName"] || "string" === typeof input["qualifiedName"];
425
- const _ip15 = input => "boolean" === typeof input["external"];
426
- const _ip16 = input => undefined === input["ignored"] || "boolean" === typeof input["ignored"];
427
- const _ip17 = input => undefined === input["exported"] || "boolean" === typeof input["exported"];
428
- const _ip18 = input => undefined === input["closure"] || "boolean" === typeof input["closure"];
429
- const _ip19 = input => undefined === input["modifiers"] || Array.isArray(input["modifiers"]) && input["modifiers"].every(elem => true === _iv0.has(elem));
430
- const _iv0 = new Set(["abstract", "async", "const", "declare", "default", "export", "private", "protected", "public", "readonly", "static"]);
431
- const _ip20 = input => undefined === input["literals"] || Array.isArray(input["literals"]) && input["literals"].every(elem => "string" === typeof elem);
432
- const _ip21 = input => undefined === input["enumMembers"] || Array.isArray(input["enumMembers"]) && input["enumMembers"].every(elem => "object" === typeof elem && null !== elem && _io10(elem));
433
- const _ip22 = input => undefined === input["objectMembers"] || Array.isArray(input["objectMembers"]) && input["objectMembers"].every(elem => "object" === typeof elem && null !== elem && _io11(elem));
434
- const _ip23 = input => undefined === input["decorators"] || Array.isArray(input["decorators"]) && input["decorators"].every(elem => "object" === typeof elem && null !== elem && _io12(elem));
435
- const _ip24 = input => undefined === input["docTags"] || Array.isArray(input["docTags"]) && input["docTags"].every(elem => "object" === typeof elem && null !== elem && _io14(elem));
436
- const _ip25 = input => undefined === input["signature"] || "string" === typeof input["signature"];
437
- const _ip26 = input => true === _iv1.has(input["kind"]);
438
- const _iv1 = new Set(["class", "enum", "function", "interface", "markdown_document", "markdown_section", "method", "module", "prisma_column", "prisma_model", "prisma_relation", "swagger_operation", "type", "variable"]);
439
- const _ip27 = input => undefined === input["parent"] || "string" === typeof input["parent"];
440
- const _ip28 = input => undefined === input["evidence"] || "object" === typeof input["evidence"] && null !== input["evidence"] && _io15(input["evidence"]);
441
- const _ip29 = input => undefined === input["implementation"] || "object" === typeof input["implementation"] && null !== input["implementation"] && _io15(input["implementation"]);
442
- const _iv2 = new Set(["accesses", "calls", "doc_ref", "exports", "extends", "implements", "instantiates", "overrides", "renders", "type_ref"]);
443
- const _ip30 = input => "string" === typeof input["key"];
444
- const _ap0 = (input, _path, _exceptionable = true) => "number" === typeof input["protocolVersion"] || _assertGuard_1._assertGuard(_exceptionable, {
445
- method: "typia.assert",
446
- path: _path + ".protocolVersion",
447
- expected: "number",
448
- value: input["protocolVersion"]
449
- }, _errorFactory);
450
- const _ap1 = (input, _path, _exceptionable = true) => (Array.isArray(input["capabilities"]) || _assertGuard_1._assertGuard(_exceptionable, {
451
- method: "typia.assert",
452
- path: _path + ".capabilities",
453
- expected: "Array<string>",
454
- value: input["capabilities"]
455
- }, _errorFactory)) && input["capabilities"].every((elem, _index18) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
456
- method: "typia.assert",
457
- path: _path + ".capabilities[" + _index18 + "]",
458
- expected: "string",
459
- value: elem
460
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
461
- method: "typia.assert",
462
- path: _path + ".capabilities",
463
- expected: "Array<string>",
464
- value: input["capabilities"]
465
- }, _errorFactory);
466
- const _ap2 = (input, _path, _exceptionable = true) => "string" === typeof input["project"] || _assertGuard_1._assertGuard(_exceptionable, {
467
- method: "typia.assert",
468
- path: _path + ".project",
469
- expected: "string",
470
- value: input["project"]
471
- }, _errorFactory);
472
- const _ap3 = (input, _path, _exceptionable = true) => "string" === typeof input["tsconfig"] || _assertGuard_1._assertGuard(_exceptionable, {
473
- method: "typia.assert",
474
- path: _path + ".tsconfig",
475
- expected: "string",
476
- value: input["tsconfig"]
477
- }, _errorFactory);
478
- const _ap4 = (input, _path, _exceptionable = true) => (Array.isArray(input["diagnostics"]) || _assertGuard_1._assertGuard(_exceptionable, {
479
- method: "typia.assert",
480
- path: _path + ".diagnostics",
481
- expected: "Array<ITtscGraphDump.IDiagnostic>",
482
- value: input["diagnostics"]
483
- }, _errorFactory)) && input["diagnostics"].every((elem, _index19) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
484
- method: "typia.assert",
485
- path: _path + ".diagnostics[" + _index19 + "]",
486
- expected: "ITtscGraphDump.IDiagnostic",
487
- value: elem
488
- }, _errorFactory)) && _ao8(elem, _path + ".diagnostics[" + _index19 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
489
- method: "typia.assert",
490
- path: _path + ".diagnostics[" + _index19 + "]",
491
- expected: "ITtscGraphDump.IDiagnostic",
492
- value: elem
493
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
494
- method: "typia.assert",
495
- path: _path + ".diagnostics",
496
- expected: "Array<ITtscGraphDump.IDiagnostic>",
497
- value: input["diagnostics"]
498
- }, _errorFactory);
499
- const _ap5 = (input, _path, _exceptionable = true) => (Array.isArray(input["nodes"]) || _assertGuard_1._assertGuard(_exceptionable, {
500
- method: "typia.assert",
501
- path: _path + ".nodes",
502
- expected: "Array<ITtscGraphDump.INode>",
503
- value: input["nodes"]
504
- }, _errorFactory)) && input["nodes"].every((elem, _index20) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
505
- method: "typia.assert",
506
- path: _path + ".nodes[" + _index20 + "]",
507
- expected: "ITtscGraphDump.INode",
508
- value: elem
509
- }, _errorFactory)) && _ao9(elem, _path + ".nodes[" + _index20 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
510
- method: "typia.assert",
511
- path: _path + ".nodes[" + _index20 + "]",
512
- expected: "ITtscGraphDump.INode",
513
- value: elem
514
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
515
- method: "typia.assert",
516
- path: _path + ".nodes",
517
- expected: "Array<ITtscGraphDump.INode>",
518
- value: input["nodes"]
519
- }, _errorFactory);
520
- const _ap6 = (input, _path, _exceptionable = true) => (Array.isArray(input["edges"]) || _assertGuard_1._assertGuard(_exceptionable, {
521
- method: "typia.assert",
522
- path: _path + ".edges",
523
- expected: "Array<ITtscGraphDump.IEdge>",
524
- value: input["edges"]
525
- }, _errorFactory)) && input["edges"].every((elem, _index21) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
526
- method: "typia.assert",
527
- path: _path + ".edges[" + _index21 + "]",
528
- expected: "ITtscGraphDump.IEdge",
529
- value: elem
530
- }, _errorFactory)) && _ao16(elem, _path + ".edges[" + _index21 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
531
- method: "typia.assert",
532
- path: _path + ".edges[" + _index21 + "]",
533
- expected: "ITtscGraphDump.IEdge",
534
- value: elem
535
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
536
- method: "typia.assert",
537
- path: _path + ".edges",
538
- expected: "Array<ITtscGraphDump.IEdge>",
539
- value: input["edges"]
540
- }, _errorFactory);
541
- const _ap7 = (input, _path, _exceptionable = true) => "number" === typeof input["schemaVersion"] || _assertGuard_1._assertGuard(_exceptionable, {
542
- method: "typia.assert",
543
- path: _path + ".schemaVersion",
544
- expected: "number",
545
- value: input["schemaVersion"]
546
- }, _errorFactory);
547
- const _ap8 = (input, _path, _exceptionable = true) => ("object" === typeof input["producer"] && null !== input["producer"] || _assertGuard_1._assertGuard(_exceptionable, {
548
- method: "typia.assert",
549
- path: _path + ".producer",
550
- expected: "ITtscGraphDump.IProducer",
551
- value: input["producer"]
552
- }, _errorFactory)) && _ao3(input["producer"], _path + ".producer", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
553
- method: "typia.assert",
554
- path: _path + ".producer",
555
- expected: "ITtscGraphDump.IProducer",
556
- value: input["producer"]
557
- }, _errorFactory);
558
- const _ap9 = (input, _path, _exceptionable = true) => ("object" === typeof input["universe"] && null !== input["universe"] || _assertGuard_1._assertGuard(_exceptionable, {
559
- method: "typia.assert",
560
- path: _path + ".universe",
561
- expected: "ITtscGraphDump.IUniverse",
562
- value: input["universe"]
563
- }, _errorFactory)) && _ao4(input["universe"], _path + ".universe", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
564
- method: "typia.assert",
565
- path: _path + ".universe",
566
- expected: "ITtscGraphDump.IUniverse",
567
- value: input["universe"]
568
- }, _errorFactory);
569
- const _ap10 = (input, _path, _exceptionable = true) => "string" === typeof input["file"] || _assertGuard_1._assertGuard(_exceptionable, {
570
- method: "typia.assert",
571
- path: _path + ".file",
572
- expected: "string",
573
- value: input["file"]
574
- }, _errorFactory);
575
- const _ap11 = (input, _path, _exceptionable = true) => "string" === typeof input["digest"] || _assertGuard_1._assertGuard(_exceptionable, {
576
- method: "typia.assert",
577
- path: _path + ".digest",
578
- expected: "string",
579
- value: input["digest"]
580
- }, _errorFactory);
581
- const _ap12 = (input, _path, _exceptionable = true) => "string" === typeof input["id"] || _assertGuard_1._assertGuard(_exceptionable, {
582
- method: "typia.assert",
583
- path: _path + ".id",
584
- expected: "string",
585
- value: input["id"]
586
- }, _errorFactory);
587
- const _ap13 = (input, _path, _exceptionable = true) => "string" === typeof input["name"] || _assertGuard_1._assertGuard(_exceptionable, {
588
- method: "typia.assert",
589
- path: _path + ".name",
590
- expected: "string",
591
- value: input["name"]
592
- }, _errorFactory);
593
- const _ap14 = (input, _path, _exceptionable = true) => undefined === input["qualifiedName"] || "string" === typeof input["qualifiedName"] || _assertGuard_1._assertGuard(_exceptionable, {
594
- method: "typia.assert",
595
- path: _path + ".qualifiedName",
596
- expected: "(string | undefined)",
597
- value: input["qualifiedName"]
598
- }, _errorFactory);
599
- const _ap15 = (input, _path, _exceptionable = true) => "boolean" === typeof input["external"] || _assertGuard_1._assertGuard(_exceptionable, {
600
- method: "typia.assert",
601
- path: _path + ".external",
602
- expected: "boolean",
603
- value: input["external"]
604
- }, _errorFactory);
605
- const _ap16 = (input, _path, _exceptionable = true) => undefined === input["ignored"] || "boolean" === typeof input["ignored"] || _assertGuard_1._assertGuard(_exceptionable, {
606
- method: "typia.assert",
607
- path: _path + ".ignored",
608
- expected: "(boolean | undefined)",
609
- value: input["ignored"]
610
- }, _errorFactory);
611
- const _ap17 = (input, _path, _exceptionable = true) => undefined === input["exported"] || "boolean" === typeof input["exported"] || _assertGuard_1._assertGuard(_exceptionable, {
612
- method: "typia.assert",
613
- path: _path + ".exported",
614
- expected: "(boolean | undefined)",
615
- value: input["exported"]
616
- }, _errorFactory);
617
- const _ap18 = (input, _path, _exceptionable = true) => undefined === input["closure"] || "boolean" === typeof input["closure"] || _assertGuard_1._assertGuard(_exceptionable, {
618
- method: "typia.assert",
619
- path: _path + ".closure",
620
- expected: "(boolean | undefined)",
621
- value: input["closure"]
622
- }, _errorFactory);
623
- const _ap19 = (input, _path, _exceptionable = true) => undefined === input["modifiers"] || (Array.isArray(input["modifiers"]) || _assertGuard_1._assertGuard(_exceptionable, {
624
- method: "typia.assert",
625
- path: _path + ".modifiers",
626
- expected: "(Array<TtscGraphNodeModifier> | undefined)",
627
- value: input["modifiers"]
628
- }, _errorFactory)) && input["modifiers"].every((elem, _index25) => true === _av0.has(elem) || _assertGuard_1._assertGuard(_exceptionable, {
629
- method: "typia.assert",
630
- path: _path + ".modifiers[" + _index25 + "]",
631
- expected: _ae0,
632
- value: elem
633
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
634
- method: "typia.assert",
635
- path: _path + ".modifiers",
636
- expected: "(Array<TtscGraphNodeModifier> | undefined)",
637
- value: input["modifiers"]
638
- }, _errorFactory);
639
- const _av0 = new Set(["abstract", "async", "const", "declare", "default", "export", "private", "protected", "public", "readonly", "static"]);
640
- const _ae0 = "(\"abstract\" | \"async\" | \"const\" | \"declare\" | \"default\" | \"export\" | \"private\" | \"protected\" | \"public\" | \"readonly\" | \"static\")";
641
- const _ap20 = (input, _path, _exceptionable = true) => undefined === input["literals"] || (Array.isArray(input["literals"]) || _assertGuard_1._assertGuard(_exceptionable, {
642
- method: "typia.assert",
643
- path: _path + ".literals",
644
- expected: "(Array<string> | undefined)",
645
- value: input["literals"]
646
- }, _errorFactory)) && input["literals"].every((elem, _index26) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
647
- method: "typia.assert",
648
- path: _path + ".literals[" + _index26 + "]",
649
- expected: "string",
650
- value: elem
651
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
652
- method: "typia.assert",
653
- path: _path + ".literals",
654
- expected: "(Array<string> | undefined)",
655
- value: input["literals"]
656
- }, _errorFactory);
657
- const _ap21 = (input, _path, _exceptionable = true) => undefined === input["enumMembers"] || (Array.isArray(input["enumMembers"]) || _assertGuard_1._assertGuard(_exceptionable, {
658
- method: "typia.assert",
659
- path: _path + ".enumMembers",
660
- expected: "(Array<ITtscGraphNode.IEnumMember> | undefined)",
661
- value: input["enumMembers"]
662
- }, _errorFactory)) && input["enumMembers"].every((elem, _index27) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
663
- method: "typia.assert",
664
- path: _path + ".enumMembers[" + _index27 + "]",
665
- expected: "ITtscGraphNode.IEnumMember",
666
- value: elem
667
- }, _errorFactory)) && _ao10(elem, _path + ".enumMembers[" + _index27 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
668
- method: "typia.assert",
669
- path: _path + ".enumMembers[" + _index27 + "]",
670
- expected: "ITtscGraphNode.IEnumMember",
671
- value: elem
672
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
673
- method: "typia.assert",
674
- path: _path + ".enumMembers",
675
- expected: "(Array<ITtscGraphNode.IEnumMember> | undefined)",
676
- value: input["enumMembers"]
677
- }, _errorFactory);
678
- const _ap22 = (input, _path, _exceptionable = true) => undefined === input["objectMembers"] || (Array.isArray(input["objectMembers"]) || _assertGuard_1._assertGuard(_exceptionable, {
679
- method: "typia.assert",
680
- path: _path + ".objectMembers",
681
- expected: "(Array<ITtscGraphNode.IObjectMember> | undefined)",
682
- value: input["objectMembers"]
683
- }, _errorFactory)) && input["objectMembers"].every((elem, _index28) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
684
- method: "typia.assert",
685
- path: _path + ".objectMembers[" + _index28 + "]",
686
- expected: "ITtscGraphNode.IObjectMember",
687
- value: elem
688
- }, _errorFactory)) && _ao11(elem, _path + ".objectMembers[" + _index28 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
689
- method: "typia.assert",
690
- path: _path + ".objectMembers[" + _index28 + "]",
691
- expected: "ITtscGraphNode.IObjectMember",
692
- value: elem
693
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
694
- method: "typia.assert",
695
- path: _path + ".objectMembers",
696
- expected: "(Array<ITtscGraphNode.IObjectMember> | undefined)",
697
- value: input["objectMembers"]
698
- }, _errorFactory);
699
- const _ap23 = (input, _path, _exceptionable = true) => undefined === input["decorators"] || (Array.isArray(input["decorators"]) || _assertGuard_1._assertGuard(_exceptionable, {
700
- method: "typia.assert",
701
- path: _path + ".decorators",
702
- expected: "(Array<ITtscGraphDecorator> | undefined)",
703
- value: input["decorators"]
704
- }, _errorFactory)) && input["decorators"].every((elem, _index29) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
705
- method: "typia.assert",
706
- path: _path + ".decorators[" + _index29 + "]",
707
- expected: "ITtscGraphDecorator",
708
- value: elem
709
- }, _errorFactory)) && _ao12(elem, _path + ".decorators[" + _index29 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
710
- method: "typia.assert",
711
- path: _path + ".decorators[" + _index29 + "]",
712
- expected: "ITtscGraphDecorator",
713
- value: elem
714
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
715
- method: "typia.assert",
716
- path: _path + ".decorators",
717
- expected: "(Array<ITtscGraphDecorator> | undefined)",
718
- value: input["decorators"]
719
- }, _errorFactory);
720
- const _ap24 = (input, _path, _exceptionable = true) => undefined === input["docTags"] || (Array.isArray(input["docTags"]) || _assertGuard_1._assertGuard(_exceptionable, {
721
- method: "typia.assert",
722
- path: _path + ".docTags",
723
- expected: "(Array<ITtscGraphDocTag> | undefined)",
724
- value: input["docTags"]
725
- }, _errorFactory)) && input["docTags"].every((elem, _index30) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
726
- method: "typia.assert",
727
- path: _path + ".docTags[" + _index30 + "]",
728
- expected: "ITtscGraphDocTag",
729
- value: elem
730
- }, _errorFactory)) && _ao14(elem, _path + ".docTags[" + _index30 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
731
- method: "typia.assert",
732
- path: _path + ".docTags[" + _index30 + "]",
733
- expected: "ITtscGraphDocTag",
734
- value: elem
735
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
736
- method: "typia.assert",
737
- path: _path + ".docTags",
738
- expected: "(Array<ITtscGraphDocTag> | undefined)",
739
- value: input["docTags"]
740
- }, _errorFactory);
741
- const _ap25 = (input, _path, _exceptionable = true) => undefined === input["signature"] || "string" === typeof input["signature"] || _assertGuard_1._assertGuard(_exceptionable, {
742
- method: "typia.assert",
743
- path: _path + ".signature",
744
- expected: "(string | undefined)",
745
- value: input["signature"]
746
- }, _errorFactory);
747
- const _ap26 = (input, _path, _exceptionable = true) => true === _av1.has(input["kind"]) || _assertGuard_1._assertGuard(_exceptionable, {
748
- method: "typia.assert",
749
- path: _path + ".kind",
750
- expected: _ae1,
751
- value: input["kind"]
752
- }, _errorFactory);
753
- const _av1 = new Set(["class", "enum", "function", "interface", "markdown_document", "markdown_section", "method", "module", "prisma_column", "prisma_model", "prisma_relation", "swagger_operation", "type", "variable"]);
754
- const _ae1 = "(\"class\" | \"enum\" | \"function\" | \"interface\" | \"markdown_document\" | \"markdown_section\" | \"method\" | \"module\" | \"prisma_column\" | \"prisma_model\" | \"prisma_relation\" | \"swagger_operation\" | \"type\" | \"variable\")";
755
- const _ap27 = (input, _path, _exceptionable = true) => undefined === input["parent"] || "string" === typeof input["parent"] || _assertGuard_1._assertGuard(_exceptionable, {
756
- method: "typia.assert",
757
- path: _path + ".parent",
758
- expected: "(string | undefined)",
759
- value: input["parent"]
760
- }, _errorFactory);
761
- const _ap28 = (input, _path, _exceptionable = true) => undefined === input["evidence"] || ("object" === typeof input["evidence"] && null !== input["evidence"] || _assertGuard_1._assertGuard(_exceptionable, {
762
- method: "typia.assert",
763
- path: _path + ".evidence",
764
- expected: "(ITtscGraphSpan | undefined)",
765
- value: input["evidence"]
766
- }, _errorFactory)) && _ao15(input["evidence"], _path + ".evidence", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
767
- method: "typia.assert",
768
- path: _path + ".evidence",
769
- expected: "(ITtscGraphSpan | undefined)",
770
- value: input["evidence"]
771
- }, _errorFactory);
772
- const _ap29 = (input, _path, _exceptionable = true) => undefined === input["implementation"] || ("object" === typeof input["implementation"] && null !== input["implementation"] || _assertGuard_1._assertGuard(_exceptionable, {
773
- method: "typia.assert",
774
- path: _path + ".implementation",
775
- expected: "(ITtscGraphSpan | undefined)",
776
- value: input["implementation"]
777
- }, _errorFactory)) && _ao15(input["implementation"], _path + ".implementation", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
778
- method: "typia.assert",
779
- path: _path + ".implementation",
780
- expected: "(ITtscGraphSpan | undefined)",
781
- value: input["implementation"]
782
- }, _errorFactory);
783
- const _av2 = new Set(["accesses", "calls", "doc_ref", "exports", "extends", "implements", "instantiates", "overrides", "renders", "type_ref"]);
784
- const _ae2 = "(\"accesses\" | \"calls\" | \"doc_ref\" | \"exports\" | \"extends\" | \"implements\" | \"instantiates\" | \"overrides\" | \"renders\" | \"type_ref\")";
785
- const _ap30 = (input, _path, _exceptionable = true) => "string" === typeof input["key"] || _assertGuard_1._assertGuard(_exceptionable, {
786
- method: "typia.assert",
787
- path: _path + ".key",
788
- expected: "string",
789
- value: input["key"]
790
- }, _errorFactory);
791
- const _ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.id || _assertGuard_1._assertGuard(_exceptionable, {
792
- method: "typia.assert",
793
- path: _path + ".id",
794
- expected: "number",
795
- value: input.id
796
- }, _errorFactory)) && _ap0(input, _path, true && _exceptionable) && ("error" === input.mode || "incremental" === input.mode || "initial" === input.mode || "rebuild" === input.mode || "reload" === input.mode || "unchanged" === input.mode || _assertGuard_1._assertGuard(_exceptionable, {
797
- method: "typia.assert",
798
- path: _path + ".mode",
799
- expected: "(\"error\" | \"incremental\" | \"initial\" | \"rebuild\" | \"reload\" | \"unchanged\")",
800
- value: input.mode
801
- }, _errorFactory)) && _ap1(input, _path, true && _exceptionable) && ("boolean" === typeof input.changed || _assertGuard_1._assertGuard(_exceptionable, {
802
- method: "typia.assert",
803
- path: _path + ".changed",
804
- expected: "boolean",
805
- value: input.changed
806
- }, _errorFactory)) && (undefined === input.dump || ("object" === typeof input.dump && null !== input.dump || _assertGuard_1._assertGuard(_exceptionable, {
807
- method: "typia.assert",
808
- path: _path + ".dump",
809
- expected: "(ITtscGraphDump | undefined)",
810
- value: input.dump
811
- }, _errorFactory)) && _ao1(input.dump, _path + ".dump", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
812
- method: "typia.assert",
813
- path: _path + ".dump",
814
- expected: "(ITtscGraphDump | undefined)",
815
- value: input.dump
816
- }, _errorFactory)) && (undefined === input.snapshot || ("object" === typeof input.snapshot && null !== input.snapshot || _assertGuard_1._assertGuard(_exceptionable, {
817
- method: "typia.assert",
818
- path: _path + ".snapshot",
819
- expected: "(ITtscGraphSnapshot.ITransaction | undefined)",
820
- value: input.snapshot
821
- }, _errorFactory)) && _ao17(input.snapshot, _path + ".snapshot", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
822
- method: "typia.assert",
823
- path: _path + ".snapshot",
824
- expected: "(ITtscGraphSnapshot.ITransaction | undefined)",
825
- value: input.snapshot
826
- }, _errorFactory)) && (undefined === input.error || "string" === typeof input.error || _assertGuard_1._assertGuard(_exceptionable, {
827
- method: "typia.assert",
828
- path: _path + ".error",
829
- expected: "(string | undefined)",
830
- value: input.error
831
- }, _errorFactory));
832
- const _ao1 = (input, _path, _exceptionable = true) => _ap2(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && (("object" === typeof input.provenance && null !== input.provenance || _assertGuard_1._assertGuard(_exceptionable, {
833
- method: "typia.assert",
834
- path: _path + ".provenance",
835
- expected: "ITtscGraphDump.IProvenance",
836
- value: input.provenance
837
- }, _errorFactory)) && _ao2(input.provenance, _path + ".provenance", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
838
- method: "typia.assert",
839
- path: _path + ".provenance",
840
- expected: "ITtscGraphDump.IProvenance",
841
- value: input.provenance
842
- }, _errorFactory)) && _ap4(input, _path, true && _exceptionable) && _ap5(input, _path, true && _exceptionable) && _ap6(input, _path, true && _exceptionable);
843
- const _ao10 = (input, _path, _exceptionable = true) => _ap13(input, _path, true && _exceptionable) && (undefined === input.value || "string" === typeof input.value || _assertGuard_1._assertGuard(_exceptionable, {
844
- method: "typia.assert",
845
- path: _path + ".value",
846
- expected: "(string | undefined)",
847
- value: input.value
848
- }, _errorFactory));
849
- const _ao11 = (input, _path, _exceptionable = true) => _ap13(input, _path, true && _exceptionable) && ("method" === input.kind || "property" === input.kind || _assertGuard_1._assertGuard(_exceptionable, {
850
- method: "typia.assert",
851
- path: _path + ".kind",
852
- expected: "(\"method\" | \"property\")",
853
- value: input.kind
854
- }, _errorFactory)) && (undefined === input.line || "number" === typeof input.line || _assertGuard_1._assertGuard(_exceptionable, {
855
- method: "typia.assert",
856
- path: _path + ".line",
857
- expected: "(number | undefined)",
858
- value: input.line
859
- }, _errorFactory)) && _ap25(input, _path, true && _exceptionable);
860
- const _ao12 = (input, _path, _exceptionable = true) => _ap13(input, _path, true && _exceptionable) && ((Array.isArray(input.arguments) || _assertGuard_1._assertGuard(_exceptionable, {
861
- method: "typia.assert",
862
- path: _path + ".arguments",
863
- expected: "Array<ITtscGraphDecorator.IArgument>",
864
- value: input.arguments
865
- }, _errorFactory)) && input.arguments.every((elem, _index31) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _assertGuard_1._assertGuard(_exceptionable, {
866
- method: "typia.assert",
867
- path: _path + ".arguments[" + _index31 + "]",
868
- expected: "ITtscGraphDecorator.IArgument",
869
- value: elem
870
- }, _errorFactory)) && _ao13(elem, _path + ".arguments[" + _index31 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
871
- method: "typia.assert",
872
- path: _path + ".arguments[" + _index31 + "]",
873
- expected: "ITtscGraphDecorator.IArgument",
874
- value: elem
875
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
876
- method: "typia.assert",
877
- path: _path + ".arguments",
878
- expected: "Array<ITtscGraphDecorator.IArgument>",
879
- value: input.arguments
880
- }, _errorFactory));
881
- const _ao13 = (input, _path, _exceptionable = true) => undefined === input.literal || "string" === typeof input.literal || "number" === typeof input.literal || "boolean" === typeof input.literal || _assertGuard_1._assertGuard(_exceptionable, {
882
- method: "typia.assert",
883
- path: _path + ".literal",
884
- expected: "(boolean | number | string | undefined)",
885
- value: input.literal
886
- }, _errorFactory);
887
- const _ao14 = (input, _path, _exceptionable = true) => _ap13(input, _path, true && _exceptionable) && (undefined === input.text || "string" === typeof input.text || _assertGuard_1._assertGuard(_exceptionable, {
888
- method: "typia.assert",
889
- path: _path + ".text",
890
- expected: "(string | undefined)",
891
- value: input.text
892
- }, _errorFactory));
893
- const _ao15 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || _assertGuard_1._assertGuard(_exceptionable, {
894
- method: "typia.assert",
895
- path: _path + ".file",
896
- expected: "(string | undefined)",
897
- value: input.file
898
- }, _errorFactory)) && ("number" === typeof input.startLine || _assertGuard_1._assertGuard(_exceptionable, {
899
- method: "typia.assert",
900
- path: _path + ".startLine",
901
- expected: "number",
902
- value: input.startLine
903
- }, _errorFactory)) && (undefined === input.startCol || "number" === typeof input.startCol || _assertGuard_1._assertGuard(_exceptionable, {
904
- method: "typia.assert",
905
- path: _path + ".startCol",
906
- expected: "(number | undefined)",
907
- value: input.startCol
908
- }, _errorFactory)) && (undefined === input.endLine || "number" === typeof input.endLine || _assertGuard_1._assertGuard(_exceptionable, {
909
- method: "typia.assert",
910
- path: _path + ".endLine",
911
- expected: "(number | undefined)",
912
- value: input.endLine
913
- }, _errorFactory)) && (undefined === input.endCol || "number" === typeof input.endCol || _assertGuard_1._assertGuard(_exceptionable, {
914
- method: "typia.assert",
915
- path: _path + ".endCol",
916
- expected: "(number | undefined)",
917
- value: input.endCol
918
- }, _errorFactory));
919
- const _ao16 = (input, _path, _exceptionable = true) => ("string" === typeof input.from || _assertGuard_1._assertGuard(_exceptionable, {
920
- method: "typia.assert",
921
- path: _path + ".from",
922
- expected: "string",
923
- value: input.from
924
- }, _errorFactory)) && ("string" === typeof input.to || _assertGuard_1._assertGuard(_exceptionable, {
925
- method: "typia.assert",
926
- path: _path + ".to",
927
- expected: "string",
928
- value: input.to
929
- }, _errorFactory)) && (true === _av2.has(input.kind) || _assertGuard_1._assertGuard(_exceptionable, {
930
- method: "typia.assert",
931
- path: _path + ".kind",
932
- expected: _ae2,
933
- value: input.kind
934
- }, _errorFactory)) && _ap28(input, _path, true && _exceptionable);
935
- const _ao17 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && _ap7(input, _path, true && _exceptionable) && _ap2(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && _ap8(input, _path, true && _exceptionable) && _ap1(input, _path, true && _exceptionable) && _ap9(input, _path, true && _exceptionable) && ("number" === typeof input.sequence || _assertGuard_1._assertGuard(_exceptionable, {
936
- method: "typia.assert",
937
- path: _path + ".sequence",
938
- expected: "number",
939
- value: input.sequence
940
- }, _errorFactory)) && ("string" === typeof input.generation || _assertGuard_1._assertGuard(_exceptionable, {
941
- method: "typia.assert",
942
- path: _path + ".generation",
943
- expected: "string",
944
- value: input.generation
945
- }, _errorFactory)) && (undefined === input.baseSequence || "number" === typeof input.baseSequence || _assertGuard_1._assertGuard(_exceptionable, {
946
- method: "typia.assert",
947
- path: _path + ".baseSequence",
948
- expected: "(number | undefined)",
949
- value: input.baseSequence
950
- }, _errorFactory)) && (undefined === input.baseGeneration || "string" === typeof input.baseGeneration || _assertGuard_1._assertGuard(_exceptionable, {
951
- method: "typia.assert",
952
- path: _path + ".baseGeneration",
953
- expected: "(string | undefined)",
954
- value: input.baseGeneration
955
- }, _errorFactory)) && ((Array.isArray(input.upserts) || _assertGuard_1._assertGuard(_exceptionable, {
956
- method: "typia.assert",
957
- path: _path + ".upserts",
958
- expected: "Array<ITtscGraphSnapshot.IShardUpsert>",
959
- value: input.upserts
960
- }, _errorFactory)) && input.upserts.every((elem, _index32) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
961
- method: "typia.assert",
962
- path: _path + ".upserts[" + _index32 + "]",
963
- expected: "ITtscGraphSnapshot.IShardUpsert",
964
- value: elem
965
- }, _errorFactory)) && _ao18(elem, _path + ".upserts[" + _index32 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
966
- method: "typia.assert",
967
- path: _path + ".upserts[" + _index32 + "]",
968
- expected: "ITtscGraphSnapshot.IShardUpsert",
969
- value: elem
970
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
971
- method: "typia.assert",
972
- path: _path + ".upserts",
973
- expected: "Array<ITtscGraphSnapshot.IShardUpsert>",
974
- value: input.upserts
975
- }, _errorFactory)) && ((Array.isArray(input.deletes) || _assertGuard_1._assertGuard(_exceptionable, {
976
- method: "typia.assert",
977
- path: _path + ".deletes",
978
- expected: "Array<string>",
979
- value: input.deletes
980
- }, _errorFactory)) && input.deletes.every((elem, _index33) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
981
- method: "typia.assert",
982
- path: _path + ".deletes[" + _index33 + "]",
983
- expected: "string",
984
- value: elem
985
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
986
- method: "typia.assert",
987
- path: _path + ".deletes",
988
- expected: "Array<string>",
989
- value: input.deletes
990
- }, _errorFactory)) && ((Array.isArray(input.manifest) || _assertGuard_1._assertGuard(_exceptionable, {
991
- method: "typia.assert",
992
- path: _path + ".manifest",
993
- expected: "Array<ITtscGraphSnapshot.IShardReference>",
994
- value: input.manifest
995
- }, _errorFactory)) && input.manifest.every((elem, _index34) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
996
- method: "typia.assert",
997
- path: _path + ".manifest[" + _index34 + "]",
998
- expected: "ITtscGraphSnapshot.IShardReference",
999
- value: elem
1000
- }, _errorFactory)) && _ao20(elem, _path + ".manifest[" + _index34 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1001
- method: "typia.assert",
1002
- path: _path + ".manifest[" + _index34 + "]",
1003
- expected: "ITtscGraphSnapshot.IShardReference",
1004
- value: elem
1005
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
1006
- method: "typia.assert",
1007
- path: _path + ".manifest",
1008
- expected: "Array<ITtscGraphSnapshot.IShardReference>",
1009
- value: input.manifest
1010
- }, _errorFactory));
1011
- const _ao18 = (input, _path, _exceptionable = true) => _ap11(input, _path, true && _exceptionable) && (("object" === typeof input.shard && null !== input.shard || _assertGuard_1._assertGuard(_exceptionable, {
1012
- method: "typia.assert",
1013
- path: _path + ".shard",
1014
- expected: "ITtscGraphSnapshot.IShard",
1015
- value: input.shard
1016
- }, _errorFactory)) && _ao19(input.shard, _path + ".shard", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1017
- method: "typia.assert",
1018
- path: _path + ".shard",
1019
- expected: "ITtscGraphSnapshot.IShard",
1020
- value: input.shard
1021
- }, _errorFactory));
1022
- const _ao19 = (input, _path, _exceptionable = true) => _ap30(input, _path, true && _exceptionable) && (undefined === input.source || ("object" === typeof input.source && null !== input.source || _assertGuard_1._assertGuard(_exceptionable, {
1023
- method: "typia.assert",
1024
- path: _path + ".source",
1025
- expected: "(ITtscGraphDump.ISourceDigest | undefined)",
1026
- value: input.source
1027
- }, _errorFactory)) && _ao7(input.source, _path + ".source", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1028
- method: "typia.assert",
1029
- path: _path + ".source",
1030
- expected: "(ITtscGraphDump.ISourceDigest | undefined)",
1031
- value: input.source
1032
- }, _errorFactory)) && (undefined === input.config || ("object" === typeof input.config && null !== input.config || _assertGuard_1._assertGuard(_exceptionable, {
1033
- method: "typia.assert",
1034
- path: _path + ".config",
1035
- expected: "(ITtscGraphDump.IFileDigest | undefined)",
1036
- value: input.config
1037
- }, _errorFactory)) && _ao5(input.config, _path + ".config", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1038
- method: "typia.assert",
1039
- path: _path + ".config",
1040
- expected: "(ITtscGraphDump.IFileDigest | undefined)",
1041
- value: input.config
1042
- }, _errorFactory)) && _ap5(input, _path, true && _exceptionable) && _ap6(input, _path, true && _exceptionable) && _ap4(input, _path, true && _exceptionable);
1043
- const _ao2 = (input, _path, _exceptionable = true) => _ap7(input, _path, true && _exceptionable) && _ap1(input, _path, true && _exceptionable) && _ap8(input, _path, true && _exceptionable) && (undefined === input.artifactProducer || ("object" === typeof input.artifactProducer && null !== input.artifactProducer || _assertGuard_1._assertGuard(_exceptionable, {
1044
- method: "typia.assert",
1045
- path: _path + ".artifactProducer",
1046
- expected: "(ITtscGraphDump.IProducer | undefined)",
1047
- value: input.artifactProducer
1048
- }, _errorFactory)) && _ao3(input.artifactProducer, _path + ".artifactProducer", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1049
- method: "typia.assert",
1050
- path: _path + ".artifactProducer",
1051
- expected: "(ITtscGraphDump.IProducer | undefined)",
1052
- value: input.artifactProducer
1053
- }, _errorFactory)) && _ap9(input, _path, true && _exceptionable) && ((Array.isArray(input.sources) || _assertGuard_1._assertGuard(_exceptionable, {
1054
- method: "typia.assert",
1055
- path: _path + ".sources",
1056
- expected: "Array<ITtscGraphDump.ISourceDigest>",
1057
- value: input.sources
1058
- }, _errorFactory)) && input.sources.every((elem, _index22) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
1059
- method: "typia.assert",
1060
- path: _path + ".sources[" + _index22 + "]",
1061
- expected: "ITtscGraphDump.ISourceDigest",
1062
- value: elem
1063
- }, _errorFactory)) && _ao7(elem, _path + ".sources[" + _index22 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1064
- method: "typia.assert",
1065
- path: _path + ".sources[" + _index22 + "]",
1066
- expected: "ITtscGraphDump.ISourceDigest",
1067
- value: elem
1068
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
1069
- method: "typia.assert",
1070
- path: _path + ".sources",
1071
- expected: "Array<ITtscGraphDump.ISourceDigest>",
1072
- value: input.sources
1073
- }, _errorFactory));
1074
- const _ao20 = (input, _path, _exceptionable = true) => _ap30(input, _path, true && _exceptionable) && _ap11(input, _path, true && _exceptionable);
1075
- const _ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.tool || _assertGuard_1._assertGuard(_exceptionable, {
1076
- method: "typia.assert",
1077
- path: _path + ".tool",
1078
- expected: "string",
1079
- value: input.tool
1080
- }, _errorFactory)) && ("string" === typeof input.version || _assertGuard_1._assertGuard(_exceptionable, {
1081
- method: "typia.assert",
1082
- path: _path + ".version",
1083
- expected: "string",
1084
- value: input.version
1085
- }, _errorFactory)) && ("string" === typeof input.typescript || _assertGuard_1._assertGuard(_exceptionable, {
1086
- method: "typia.assert",
1087
- path: _path + ".typescript",
1088
- expected: "string",
1089
- value: input.typescript
1090
- }, _errorFactory));
1091
- const _ao4 = (input, _path, _exceptionable = true) => ((Array.isArray(input.configs) || _assertGuard_1._assertGuard(_exceptionable, {
1092
- method: "typia.assert",
1093
- path: _path + ".configs",
1094
- expected: "Array<ITtscGraphDump.IFileDigest>",
1095
- value: input.configs
1096
- }, _errorFactory)) && input.configs.every((elem, _index23) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
1097
- method: "typia.assert",
1098
- path: _path + ".configs[" + _index23 + "]",
1099
- expected: "ITtscGraphDump.IFileDigest",
1100
- value: elem
1101
- }, _errorFactory)) && _ao5(elem, _path + ".configs[" + _index23 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1102
- method: "typia.assert",
1103
- path: _path + ".configs[" + _index23 + "]",
1104
- expected: "ITtscGraphDump.IFileDigest",
1105
- value: elem
1106
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
1107
- method: "typia.assert",
1108
- path: _path + ".configs",
1109
- expected: "Array<ITtscGraphDump.IFileDigest>",
1110
- value: input.configs
1111
- }, _errorFactory)) && ((Array.isArray(input.roots) || _assertGuard_1._assertGuard(_exceptionable, {
1112
- method: "typia.assert",
1113
- path: _path + ".roots",
1114
- expected: "Array<ITtscGraphDump.IRootFile>",
1115
- value: input.roots
1116
- }, _errorFactory)) && input.roots.every((elem, _index24) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
1117
- method: "typia.assert",
1118
- path: _path + ".roots[" + _index24 + "]",
1119
- expected: "ITtscGraphDump.IRootFile",
1120
- value: elem
1121
- }, _errorFactory)) && _ao6(elem, _path + ".roots[" + _index24 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
1122
- method: "typia.assert",
1123
- path: _path + ".roots[" + _index24 + "]",
1124
- expected: "ITtscGraphDump.IRootFile",
1125
- value: elem
1126
- }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
1127
- method: "typia.assert",
1128
- path: _path + ".roots",
1129
- expected: "Array<ITtscGraphDump.IRootFile>",
1130
- value: input.roots
1131
- }, _errorFactory));
1132
- const _ao5 = (input, _path, _exceptionable = true) => _ap10(input, _path, true && _exceptionable) && _ap11(input, _path, true && _exceptionable);
1133
- const _ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.config || _assertGuard_1._assertGuard(_exceptionable, {
1134
- method: "typia.assert",
1135
- path: _path + ".config",
1136
- expected: "string",
1137
- value: input.config
1138
- }, _errorFactory)) && _ap10(input, _path, true && _exceptionable);
1139
- const _ao7 = (input, _path, _exceptionable = true) => _ap10(input, _path, true && _exceptionable) && ("string" === typeof input.checkerDigest || _assertGuard_1._assertGuard(_exceptionable, {
1140
- method: "typia.assert",
1141
- path: _path + ".checkerDigest",
1142
- expected: "string",
1143
- value: input.checkerDigest
1144
- }, _errorFactory)) && ("string" === typeof input.diskDigest || _assertGuard_1._assertGuard(_exceptionable, {
1145
- method: "typia.assert",
1146
- path: _path + ".diskDigest",
1147
- expected: "string",
1148
- value: input.diskDigest
1149
- }, _errorFactory));
1150
- const _ao8 = (input, _path, _exceptionable = true) => _ap10(input, _path, true && _exceptionable) && ("number" === typeof input.line || _assertGuard_1._assertGuard(_exceptionable, {
1151
- method: "typia.assert",
1152
- path: _path + ".line",
1153
- expected: "number",
1154
- value: input.line
1155
- }, _errorFactory)) && ("number" === typeof input.column || _assertGuard_1._assertGuard(_exceptionable, {
1156
- method: "typia.assert",
1157
- path: _path + ".column",
1158
- expected: "number",
1159
- value: input.column
1160
- }, _errorFactory)) && ("number" === typeof input.code || _assertGuard_1._assertGuard(_exceptionable, {
1161
- method: "typia.assert",
1162
- path: _path + ".code",
1163
- expected: "number",
1164
- value: input.code
1165
- }, _errorFactory)) && ("error" === input.category || "warning" === input.category || _assertGuard_1._assertGuard(_exceptionable, {
1166
- method: "typia.assert",
1167
- path: _path + ".category",
1168
- expected: "(\"error\" | \"warning\")",
1169
- value: input.category
1170
- }, _errorFactory)) && ("string" === typeof input.message || _assertGuard_1._assertGuard(_exceptionable, {
1171
- method: "typia.assert",
1172
- path: _path + ".message",
1173
- expected: "string",
1174
- value: input.message
1175
- }, _errorFactory));
1176
- const _ao9 = (input, _path, _exceptionable = true) => _ap12(input, _path, true && _exceptionable) && _ap13(input, _path, true && _exceptionable) && _ap14(input, _path, true && _exceptionable) && _ap10(input, _path, true && _exceptionable) && _ap15(input, _path, true && _exceptionable) && _ap16(input, _path, true && _exceptionable) && _ap17(input, _path, true && _exceptionable) && _ap18(input, _path, true && _exceptionable) && _ap19(input, _path, true && _exceptionable) && _ap20(input, _path, true && _exceptionable) && _ap21(input, _path, true && _exceptionable) && _ap22(input, _path, true && _exceptionable) && _ap23(input, _path, true && _exceptionable) && _ap24(input, _path, true && _exceptionable) && _ap25(input, _path, true && _exceptionable) && _ap26(input, _path, true && _exceptionable) && _ap27(input, _path, true && _exceptionable) && _ap28(input, _path, true && _exceptionable) && _ap29(input, _path, true && _exceptionable);
1177
- const _io0 = input => "number" === typeof input.id && _ip0(input) && ("error" === input.mode || "incremental" === input.mode || "initial" === input.mode || "rebuild" === input.mode || "reload" === input.mode || "unchanged" === input.mode) && _ip1(input) && "boolean" === typeof input.changed && (undefined === input.dump || "object" === typeof input.dump && null !== input.dump && _io1(input.dump)) && (undefined === input.snapshot || "object" === typeof input.snapshot && null !== input.snapshot && _io17(input.snapshot)) && (undefined === input.error || "string" === typeof input.error);
1178
- const _io1 = input => _ip2(input) && _ip3(input) && ("object" === typeof input.provenance && null !== input.provenance && _io2(input.provenance)) && _ip4(input) && _ip5(input) && _ip6(input);
1179
- const _io10 = input => _ip13(input) && (undefined === input.value || "string" === typeof input.value);
1180
- const _io11 = input => _ip13(input) && ("method" === input.kind || "property" === input.kind) && (undefined === input.line || "number" === typeof input.line) && _ip25(input);
1181
- const _io12 = input => _ip13(input) && (Array.isArray(input.arguments) && input.arguments.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io13(elem)));
1182
- const _io13 = input => undefined === input.literal || "string" === typeof input.literal || "number" === typeof input.literal || "boolean" === typeof input.literal;
1183
- const _io14 = input => _ip13(input) && (undefined === input.text || "string" === typeof input.text);
1184
- const _io15 = input => (undefined === input.file || "string" === typeof input.file) && "number" === typeof input.startLine && (undefined === input.startCol || "number" === typeof input.startCol) && (undefined === input.endLine || "number" === typeof input.endLine) && (undefined === input.endCol || "number" === typeof input.endCol);
1185
- const _io16 = input => "string" === typeof input.from && "string" === typeof input.to && true === _iv2.has(input.kind) && _ip28(input);
1186
- const _io17 = input => _ip0(input) && _ip7(input) && _ip2(input) && _ip3(input) && _ip8(input) && _ip1(input) && _ip9(input) && "number" === typeof input.sequence && "string" === typeof input.generation && (undefined === input.baseSequence || "number" === typeof input.baseSequence) && (undefined === input.baseGeneration || "string" === typeof input.baseGeneration) && (Array.isArray(input.upserts) && input.upserts.every(elem => "object" === typeof elem && null !== elem && _io18(elem))) && (Array.isArray(input.deletes) && input.deletes.every(elem => "string" === typeof elem)) && (Array.isArray(input.manifest) && input.manifest.every(elem => "object" === typeof elem && null !== elem && _io20(elem)));
1187
- const _io18 = input => _ip11(input) && ("object" === typeof input.shard && null !== input.shard && _io19(input.shard));
1188
- const _io19 = input => _ip30(input) && (undefined === input.source || "object" === typeof input.source && null !== input.source && _io7(input.source)) && (undefined === input.config || "object" === typeof input.config && null !== input.config && _io5(input.config)) && _ip5(input) && _ip6(input) && _ip4(input);
1189
- const _io2 = input => _ip7(input) && _ip1(input) && _ip8(input) && (undefined === input.artifactProducer || "object" === typeof input.artifactProducer && null !== input.artifactProducer && _io3(input.artifactProducer)) && _ip9(input) && (Array.isArray(input.sources) && input.sources.every(elem => "object" === typeof elem && null !== elem && _io7(elem)));
1190
- const _io20 = input => _ip30(input) && _ip11(input);
1191
- const _io3 = input => "string" === typeof input.tool && "string" === typeof input.version && "string" === typeof input.typescript;
1192
- const _io4 = input => Array.isArray(input.configs) && input.configs.every(elem => "object" === typeof elem && null !== elem && _io5(elem)) && (Array.isArray(input.roots) && input.roots.every(elem => "object" === typeof elem && null !== elem && _io6(elem)));
1193
- const _io5 = input => _ip10(input) && _ip11(input);
1194
- const _io6 = input => "string" === typeof input.config && _ip10(input);
1195
- const _io7 = input => _ip10(input) && "string" === typeof input.checkerDigest && "string" === typeof input.diskDigest;
1196
- const _io8 = input => _ip10(input) && "number" === typeof input.line && "number" === typeof input.column && "number" === typeof input.code && ("error" === input.category || "warning" === input.category) && "string" === typeof input.message;
1197
- const _io9 = input => _ip12(input) && _ip13(input) && _ip14(input) && _ip10(input) && _ip15(input) && _ip16(input) && _ip17(input) && _ip18(input) && _ip19(input) && _ip20(input) && _ip21(input) && _ip22(input) && _ip23(input) && _ip24(input) && _ip25(input) && _ip26(input) && _ip27(input) && _ip28(input) && _ip29(input);
1198
- const __is = input => "object" === typeof input && null !== input && _io0(input);
1199
- let _errorFactory;
1200
- return (input, errorFactory) => {
1201
- if (false === __is(input)) {
1202
- _errorFactory = errorFactory;
1203
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _assertGuard_1._assertGuard(true, {
1204
- method: "typia.assert",
1205
- path: _path + "",
1206
- expected: "ITtscGraphSnapshot",
1207
- value: input
1208
- }, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard_1._assertGuard(true, {
1209
- method: "typia.assert",
1210
- path: _path + "",
1211
- expected: "ITtscGraphSnapshot",
1212
- value: input
1213
- }, _errorFactory))(input, "$input", true);
1214
- }
1215
- return input;
1216
- };
1217
- })()(parsed);
1218
- }
1219
- catch (error) {
1220
- this.failChild(child, new Error(`@ttsc/graph: native session returned an unreadable response: ${asError(error).message}`));
1221
- return;
1222
- }
1223
- // The envelope's version is not the body's, and only the envelope has been
1224
- // held to one so far. A producer can speak this protocol and still carry a
1225
- // dump from another schema — the two move apart the moment a node field is
1226
- // added without the frame around it changing — and then the facts that field
1227
- // holds are silently absent rather than refused. `literals` is exactly that
1228
- // shape: an older producer resolves no value set, so a union comes back
1229
- // looking like a type with no members. Hold the body to its own number too,
1230
- // once the frame is understood.
1231
- if ((response.dump !== undefined &&
1232
- response.dump.provenance.schemaVersion !== loadGraph_1.DUMP_SCHEMA_VERSION) ||
1233
- (response.snapshot !== undefined &&
1234
- response.snapshot.schemaVersion !== loadGraph_1.DUMP_SCHEMA_VERSION)) {
1235
- // Session-wide, for the same reason the protocol mismatch above is: it is
1236
- // the wrong binary, not one bad frame.
1237
- this.failChild(child, new Error(`@ttsc/graph: ttscgraph sends dump schema v${String(response.dump?.provenance.schemaVersion ??
1238
- response.snapshot?.schemaVersion)}, this client reads v${String(loadGraph_1.DUMP_SCHEMA_VERSION)}. ` +
1239
- "Install a matching `ttsc` (the binary resolves from the target " +
1240
- "project, or from TTSC_GRAPH_BINARY)."));
1241
- return;
1242
- }
1243
- const pending = this.pending.get(response.id);
1244
- if (pending === undefined || pending.child !== child)
1245
- return;
1246
- this.settlePending(response.id, pending, response);
1247
- }
1248
- failChild(child, error, terminate = true) {
1249
- if (this.child !== child)
1250
- return;
1251
- this.child = undefined;
1252
- this.current = undefined;
1253
- this.shardStore = new TtscGraphShardStore_1.TtscGraphShardStore();
1254
- child.lines.close();
1255
- this.failPending(error, child);
1256
- if (terminate)
1257
- terminateChild(child.process);
1258
- }
1259
- failPending(error, child) {
1260
- for (const [id, pending] of this.pending) {
1261
- if (child === undefined || pending.child === child) {
1262
- this.settlePending(id, pending, error);
1263
- }
1264
- }
1265
- }
1266
- settlePending(id, pending, result) {
1267
- if (this.pending.get(id) !== pending)
1268
- return;
1269
- this.pending.delete(id);
1270
- if (pending.signal !== undefined && pending.abort !== undefined) {
1271
- pending.signal.removeEventListener("abort", pending.abort);
1272
- }
1273
- if (result instanceof Error)
1274
- pending.reject(result);
1275
- else
1276
- pending.resolve(result);
244
+ open(events) {
245
+ this.shutdown.signal.throwIfAborted();
246
+ const artifacts = this.artifacts;
247
+ if (artifacts === undefined)
248
+ throw new Error("@ttsc/graph: artifact publication was not admitted");
249
+ return TtscGraphLinePeer_1.TtscGraphLinePeer.open(this.binary, TtscGraphNativeArguments_1.TtscGraphNativeArguments.serve(this.cwd, this.tsconfig, artifacts.file), events, { stderr: "capture" });
1277
250
  }
1278
251
  }
1279
252
  exports.TtscGraphSession = TtscGraphSession;
1280
- function terminateChild(child) {
1281
- if (!child.stdin.destroyed)
1282
- child.stdin.destroy();
1283
- if (child.exitCode !== null || child.signalCode !== null)
1284
- return;
1285
- try {
1286
- child.kill();
1287
- }
1288
- catch {
1289
- return;
1290
- }
1291
- const force = setTimeout(() => {
1292
- if (child.exitCode !== null || child.signalCode !== null)
1293
- return;
1294
- try {
1295
- child.kill("SIGKILL");
1296
- }
1297
- catch {
1298
- // The process exited between the liveness check and the signal.
1299
- }
1300
- }, TERMINATION_GRACE_MS);
1301
- force.unref();
1302
- child.once("exit", () => clearTimeout(force));
1303
- }
1304
- function cancelledError(signal, child) {
1305
- const error = new Error(`@ttsc/graph: native snapshot request cancelled${abortDetail(signal)}${child === undefined ? "" : stderrSuffix(child)}`);
1306
- error.name = "AbortError";
1307
- return error;
1308
- }
1309
- function abortDetail(signal) {
1310
- const reason = signal?.reason;
1311
- if (reason === undefined)
1312
- return "";
1313
- try {
1314
- return `: ${reason instanceof Error ? reason.message : String(reason)}`;
1315
- }
1316
- catch {
1317
- return "";
1318
- }
1319
- }
1320
- function stderrSuffix(child) {
1321
- const stderr = child.stderr.trim();
1322
- return stderr === "" ? "" : `: ${stderr}`;
1323
- }
1324
- function asError(error) {
1325
- return error instanceof Error ? error : new Error(String(error));
1326
- }
1327
253
  //# sourceMappingURL=TtscGraphSession.js.map