@herbertgao/pi-extensions 2026.9.6 → 2026.9.8

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 (304) hide show
  1. package/README.md +3 -8
  2. package/THIRD_PARTY_NOTICES.md +0 -4
  3. package/node_modules/@narumitw/pi-btw/README.md +2 -0
  4. package/node_modules/@narumitw/pi-btw/dist/index.ts +284 -365
  5. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
  6. package/node_modules/@narumitw/pi-btw/package.json +52 -53
  7. package/node_modules/@narumitw/pi-btw/src/bring-to-main.ts +494 -547
  8. package/node_modules/@narumitw/pi-btw/src/btw.ts +814 -856
  9. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +673 -674
  10. package/node_modules/@narumitw/pi-btw/src/keybindings.ts +228 -270
  11. package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +309 -318
  12. package/node_modules/@narumitw/pi-btw/src/menu.ts +416 -454
  13. package/node_modules/@narumitw/pi-btw/src/settings.ts +203 -219
  14. package/node_modules/@narumitw/pi-btw/src/side-thread.ts +173 -201
  15. package/node_modules/@narumitw/pi-btw/src/text.ts +21 -23
  16. package/node_modules/@narumitw/pi-btw/src/transcript-markdown.ts +65 -0
  17. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +611 -662
  18. package/node_modules/grok-mermaid/CHANGELOG.md +46 -0
  19. package/node_modules/grok-mermaid/LICENSE +205 -0
  20. package/node_modules/grok-mermaid/README.md +191 -0
  21. package/node_modules/grok-mermaid/dist/ansi.d.ts +16 -0
  22. package/node_modules/grok-mermaid/dist/ansi.d.ts.map +1 -0
  23. package/node_modules/grok-mermaid/dist/ansi.js +23 -0
  24. package/node_modules/grok-mermaid/dist/ansi.js.map +1 -0
  25. package/node_modules/grok-mermaid/dist/canvas.d.ts +87 -0
  26. package/node_modules/grok-mermaid/dist/canvas.d.ts.map +1 -0
  27. package/node_modules/grok-mermaid/dist/canvas.js +366 -0
  28. package/node_modules/grok-mermaid/dist/canvas.js.map +1 -0
  29. package/node_modules/grok-mermaid/dist/graph.d.ts +74 -0
  30. package/node_modules/grok-mermaid/dist/graph.d.ts.map +1 -0
  31. package/node_modules/grok-mermaid/dist/graph.js +91 -0
  32. package/node_modules/grok-mermaid/dist/graph.js.map +1 -0
  33. package/node_modules/grok-mermaid/dist/index.d.ts +32 -0
  34. package/node_modules/grok-mermaid/dist/index.d.ts.map +1 -0
  35. package/node_modules/grok-mermaid/dist/index.js +100 -0
  36. package/node_modules/grok-mermaid/dist/index.js.map +1 -0
  37. package/node_modules/grok-mermaid/dist/labels.d.ts +62 -0
  38. package/node_modules/grok-mermaid/dist/labels.d.ts.map +1 -0
  39. package/node_modules/grok-mermaid/dist/labels.js +324 -0
  40. package/node_modules/grok-mermaid/dist/labels.js.map +1 -0
  41. package/node_modules/grok-mermaid/dist/layout-seq.d.ts +12 -0
  42. package/node_modules/grok-mermaid/dist/layout-seq.d.ts.map +1 -0
  43. package/node_modules/grok-mermaid/dist/layout-seq.js +194 -0
  44. package/node_modules/grok-mermaid/dist/layout-seq.js.map +1 -0
  45. package/node_modules/grok-mermaid/dist/layout.d.ts +87 -0
  46. package/node_modules/grok-mermaid/dist/layout.d.ts.map +1 -0
  47. package/node_modules/grok-mermaid/dist/layout.js +881 -0
  48. package/node_modules/grok-mermaid/dist/layout.js.map +1 -0
  49. package/node_modules/grok-mermaid/dist/parse.d.ts +83 -0
  50. package/node_modules/grok-mermaid/dist/parse.d.ts.map +1 -0
  51. package/node_modules/grok-mermaid/dist/parse.js +1151 -0
  52. package/node_modules/grok-mermaid/dist/parse.js.map +1 -0
  53. package/node_modules/grok-mermaid/dist/source-box.d.ts +18 -0
  54. package/node_modules/grok-mermaid/dist/source-box.d.ts.map +1 -0
  55. package/node_modules/grok-mermaid/dist/source-box.js +78 -0
  56. package/node_modules/grok-mermaid/dist/source-box.js.map +1 -0
  57. package/node_modules/grok-mermaid/dist/types.d.ts +42 -0
  58. package/node_modules/grok-mermaid/dist/types.d.ts.map +1 -0
  59. package/node_modules/grok-mermaid/dist/types.js +1 -0
  60. package/node_modules/grok-mermaid/dist/types.js.map +1 -0
  61. package/node_modules/grok-mermaid/dist/width-data.d.ts +2 -0
  62. package/node_modules/grok-mermaid/dist/width-data.d.ts.map +1 -0
  63. package/node_modules/grok-mermaid/dist/width-data.js +994 -0
  64. package/node_modules/grok-mermaid/dist/width-data.js.map +1 -0
  65. package/node_modules/grok-mermaid/dist/width.d.ts +18 -0
  66. package/node_modules/grok-mermaid/dist/width.d.ts.map +1 -0
  67. package/node_modules/grok-mermaid/dist/width.js +76 -0
  68. package/node_modules/grok-mermaid/dist/width.js.map +1 -0
  69. package/node_modules/grok-mermaid/package.json +49 -0
  70. package/node_modules/grok-mermaid/src/ansi.ts +34 -0
  71. package/node_modules/grok-mermaid/src/canvas.ts +373 -0
  72. package/node_modules/grok-mermaid/src/graph.ts +142 -0
  73. package/node_modules/grok-mermaid/src/index.ts +104 -0
  74. package/node_modules/grok-mermaid/src/labels.ts +326 -0
  75. package/node_modules/grok-mermaid/src/layout-seq.ts +203 -0
  76. package/node_modules/grok-mermaid/src/layout.ts +1015 -0
  77. package/node_modules/grok-mermaid/src/parse.ts +1189 -0
  78. package/node_modules/grok-mermaid/src/source-box.ts +89 -0
  79. package/node_modules/grok-mermaid/src/types.ts +43 -0
  80. package/node_modules/grok-mermaid/src/width-data.ts +993 -0
  81. package/node_modules/grok-mermaid/src/width.ts +74 -0
  82. package/node_modules/pi-lens/CHANGELOG.md +239 -0
  83. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -0
  84. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +30 -4
  85. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +2 -0
  86. package/node_modules/pi-lens/dist/clients/bash-file-access.js +26 -0
  87. package/node_modules/pi-lens/dist/clients/biome-client.js +1 -1
  88. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +403 -35
  89. package/node_modules/pi-lens/dist/clients/bootstrap.js +6 -1
  90. package/node_modules/pi-lens/dist/clients/cascade-format.js +200 -4
  91. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +10 -2
  92. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +16 -1
  93. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +12 -1
  94. package/node_modules/pi-lens/dist/clients/dispatch/ast-grep-catalog.js +65 -0
  95. package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +28 -0
  96. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +9 -2
  97. package/node_modules/pi-lens/dist/clients/dispatch/finding-policy.js +222 -0
  98. package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +389 -13
  99. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +175 -25
  100. package/node_modules/pi-lens/dist/clients/dispatch/rule-ignores.js +62 -0
  101. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +21 -41
  102. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +6 -1
  103. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +7 -7
  104. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -12
  105. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +2 -21
  106. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +1 -1
  107. package/node_modules/pi-lens/dist/clients/dispatch/types.js +4 -1
  108. package/node_modules/pi-lens/dist/clients/disposition-publish.js +1 -0
  109. package/node_modules/pi-lens/dist/clients/effective-config.js +1 -1
  110. package/node_modules/pi-lens/dist/clients/file-kinds.js +26 -1
  111. package/node_modules/pi-lens/dist/clients/file-role.js +21 -21
  112. package/node_modules/pi-lens/dist/clients/file-utils.js +156 -10
  113. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +56 -9
  114. package/node_modules/pi-lens/dist/clients/format-service.js +39 -21
  115. package/node_modules/pi-lens/dist/clients/formatters.js +60 -13
  116. package/node_modules/pi-lens/dist/clients/generation-guard.js +2 -2
  117. package/node_modules/pi-lens/dist/clients/git-guard.js +11 -3
  118. package/node_modules/pi-lens/dist/clients/indent-retarget.js +78 -8
  119. package/node_modules/pi-lens/dist/clients/installer/index.js +333 -114
  120. package/node_modules/pi-lens/dist/clients/instance-reaper-state.js +7 -0
  121. package/node_modules/pi-lens/dist/clients/instance-reaper.js +20 -10
  122. package/node_modules/pi-lens/dist/clients/language-profile.js +23 -1
  123. package/node_modules/pi-lens/dist/clients/language-registry.js +5 -1
  124. package/node_modules/pi-lens/dist/clients/latency-logger.js +4 -1
  125. package/node_modules/pi-lens/dist/clients/lens-engine.js +12 -3
  126. package/node_modules/pi-lens/dist/clients/lens-events.js +2 -1
  127. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +79 -0
  128. package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +2 -1
  129. package/node_modules/pi-lens/dist/clients/lsp/client.js +25 -21
  130. package/node_modules/pi-lens/dist/clients/lsp/config.js +2 -2
  131. package/node_modules/pi-lens/dist/clients/lsp/index.js +7 -0
  132. package/node_modules/pi-lens/dist/clients/lsp/launch.js +16 -4
  133. package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -2
  134. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +2 -1
  135. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +5 -3
  136. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +12 -8
  137. package/node_modules/pi-lens/dist/clients/mcp/session.js +36 -4
  138. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +24 -7
  139. package/node_modules/pi-lens/dist/clients/observed-mutation.js +40 -2
  140. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +23 -3
  141. package/node_modules/pi-lens/dist/clients/opengrep-client.js +110 -15
  142. package/node_modules/pi-lens/dist/clients/path-utils.js +123 -3
  143. package/node_modules/pi-lens/dist/clients/performance-report.js +5 -1
  144. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +1 -1
  145. package/node_modules/pi-lens/dist/clients/pipeline.js +74 -5
  146. package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +37 -5
  147. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +145 -18
  148. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +4 -1
  149. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +59 -3
  150. package/node_modules/pi-lens/dist/clients/project-lens-config.js +45 -2
  151. package/node_modules/pi-lens/dist/clients/read-guard.js +70 -11
  152. package/node_modules/pi-lens/dist/clients/resource-sampler.js +147 -9
  153. package/node_modules/pi-lens/dist/clients/ruff-client.js +1 -1
  154. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +33 -5
  155. package/node_modules/pi-lens/dist/clients/runtime-context.js +6 -2
  156. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +77 -7
  157. package/node_modules/pi-lens/dist/clients/runtime-session.js +21 -2
  158. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +43 -12
  159. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +330 -85
  160. package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -17
  161. package/node_modules/pi-lens/dist/clients/safe-spawn.js +258 -5
  162. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +6 -0
  163. package/node_modules/pi-lens/dist/clients/session-event-guard.js +50 -5
  164. package/node_modules/pi-lens/dist/clients/sg-runner.js +23 -11
  165. package/node_modules/pi-lens/dist/clients/sgconfig.js +79 -2
  166. package/node_modules/pi-lens/dist/clients/test-runner-client.js +6 -41
  167. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +43 -0
  168. package/node_modules/pi-lens/dist/clients/tool-agreement.js +423 -0
  169. package/node_modules/pi-lens/dist/clients/tool-config.js +50 -0
  170. package/node_modules/pi-lens/dist/clients/tool-cwd.js +47 -76
  171. package/node_modules/pi-lens/dist/clients/tool-policy.js +163 -7
  172. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +120 -0
  173. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +127 -189
  174. package/node_modules/pi-lens/dist/clients/widget-state.js +98 -0
  175. package/node_modules/pi-lens/dist/clients/word-index.js +5 -2
  176. package/node_modules/pi-lens/dist/clients/write-ordering-guard.js +7 -0
  177. package/node_modules/pi-lens/dist/index.js +27416 -24153
  178. package/node_modules/pi-lens/dist/mcp/server.js +5 -2
  179. package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +7 -1
  180. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +168 -53
  181. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +244 -72
  182. package/node_modules/pi-lens/docs/audit1.md +5 -5
  183. package/node_modules/pi-lens/docs/dependencies.md +11 -0
  184. package/node_modules/pi-lens/docs/dispositions.md +52 -0
  185. package/node_modules/pi-lens/docs/environment-variables.md +2 -2
  186. package/node_modules/pi-lens/docs/features.md +4 -4
  187. package/node_modules/pi-lens/docs/globalconfig.md +3 -1
  188. package/node_modules/pi-lens/docs/language-coverage.md +1 -0
  189. package/node_modules/pi-lens/docs/pi-lens-fixer.md +53 -94
  190. package/node_modules/pi-lens/docs/pi-lens-investigator.md +43 -38
  191. package/node_modules/pi-lens/docs/pi-lens-retro.md +97 -0
  192. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +53 -66
  193. package/node_modules/pi-lens/docs/release-qa-baseline.md +22 -0
  194. package/node_modules/pi-lens/docs/settings.md +7 -4
  195. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +1 -1
  196. package/node_modules/pi-lens/docs/usage.md +2 -0
  197. package/node_modules/pi-lens/package.json +1 -1
  198. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/sql-injection.yml +24 -12
  199. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +40 -0
  200. package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +15 -0
  201. package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +7 -0
  202. package/package.json +6 -11
  203. package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +0 -376
  204. package/node_modules/@luxusai/pi-hindsight/README.md +0 -92
  205. package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +0 -56
  206. package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +0 -169
  207. package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +0 -107
  208. package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +0 -89
  209. package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +0 -189
  210. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
  211. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
  212. package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +0 -54
  213. package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +0 -75
  214. package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +0 -300
  215. package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +0 -158
  216. package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +0 -164
  217. package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +0 -139
  218. package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +0 -74
  219. package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +0 -261
  220. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +0 -151
  221. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +0 -18
  222. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +0 -46
  223. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +0 -383
  224. package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +0 -240
  225. package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +0 -176
  226. package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +0 -178
  227. package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +0 -41
  228. package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +0 -386
  229. package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +0 -39
  230. package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +0 -34
  231. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +0 -140
  232. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +0 -61
  233. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +0 -925
  234. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +0 -247
  235. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +0 -547
  236. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +0 -480
  237. package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +0 -182
  238. package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +0 -86
  239. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +0 -1010
  240. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +0 -175
  241. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +0 -425
  242. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +0 -210
  243. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +0 -817
  244. package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +0 -25
  245. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +0 -319
  246. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +0 -196
  247. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +0 -189
  248. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +0 -65
  249. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +0 -260
  250. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +0 -244
  251. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +0 -59
  252. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +0 -82
  253. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +0 -45
  254. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +0 -331
  255. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +0 -354
  256. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +0 -66
  257. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +0 -132
  258. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +0 -228
  259. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +0 -74
  260. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +0 -16
  261. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +0 -648
  262. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +0 -105
  263. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +0 -68
  264. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +0 -71
  265. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +0 -13
  266. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +0 -162
  267. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +0 -131
  268. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +0 -104
  269. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +0 -37
  270. package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +0 -893
  271. package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +0 -35
  272. package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +0 -177
  273. package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +0 -7
  274. package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +0 -21
  275. package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +0 -112
  276. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +0 -111
  277. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +0 -214
  278. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +0 -70
  279. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +0 -392
  280. package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +0 -45
  281. package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +0 -9
  282. package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +0 -860
  283. package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +0 -105
  284. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +0 -189
  285. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +0 -299
  286. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +0 -201
  287. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +0 -47
  288. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +0 -239
  289. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +0 -50
  290. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +0 -259
  291. package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +0 -77
  292. package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +0 -534
  293. package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +0 -319
  294. package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +0 -325
  295. package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +0 -42
  296. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +0 -244
  297. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +0 -56
  298. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +0 -50
  299. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +0 -167
  300. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +0 -207
  301. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +0 -120
  302. package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +0 -8
  303. package/node_modules/@luxusai/pi-hindsight/package.json +0 -118
  304. package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +0 -75
@@ -0,0 +1,366 @@
1
+ import { measured } from './width.js';
2
+ /**
3
+ * Sentinel occupying the trailing column of a wide glyph. Never emitted: the
4
+ * line builder skips it so a CJK character claims two cells of layout but
5
+ * contributes one character of output.
6
+ */
7
+ export const CONT = String.fromCharCode(0);
8
+ /** Connection direction bits, combined into a box-drawing glyph by `maskChar`. */
9
+ export const U = 1;
10
+ export const D = 2;
11
+ export const L = 4;
12
+ export const R = 8;
13
+ /** Line styles, tracked per cell so crossing edges keep their own stroke. */
14
+ export const STY_DOT = 1;
15
+ export const STY_THICK = 2;
16
+ export const STY_SOLID = 4;
17
+ /**
18
+ * A grid of cells. Edges accumulate as direction bits rather than glyphs so
19
+ * that crossings and junctions resolve correctly whatever order they are drawn
20
+ * in; `finalizeMask` turns the accumulated bits into characters at the end.
21
+ *
22
+ * `occupied` marks cells claimed by a box, which edge bits must not overwrite.
23
+ */
24
+ export class Canvas {
25
+ w;
26
+ h;
27
+ ch;
28
+ cls;
29
+ mask;
30
+ style;
31
+ occupied;
32
+ curStyle = STY_SOLID;
33
+ constructor(w, h) {
34
+ const n = w * h;
35
+ this.w = w;
36
+ this.h = h;
37
+ this.ch = new Array(n).fill(' ');
38
+ this.cls = new Array(n).fill('none');
39
+ this.mask = new Uint8Array(n);
40
+ this.style = new Uint8Array(n);
41
+ this.occupied = new Uint8Array(n);
42
+ }
43
+ idx(x, y) {
44
+ return y * this.w + x;
45
+ }
46
+ set(x, y, c, cls) {
47
+ if (x >= this.w || y >= this.h)
48
+ return;
49
+ const i = this.idx(x, y);
50
+ this.ch[i] = c;
51
+ this.cls[i] = cls;
52
+ }
53
+ /**
54
+ * Accumulate direction bits on a free cell.
55
+ *
56
+ * `cls` is the class to claim the cell for; `border` cells are never
57
+ * reclassified, so a connector meeting a box keeps the box's styling.
58
+ */
59
+ addBits(x, y, bits, cls = 'edge') {
60
+ if (x >= this.w || y >= this.h)
61
+ return;
62
+ const i = this.idx(x, y);
63
+ if (this.occupied[i])
64
+ return;
65
+ this.mask[i] |= bits;
66
+ this.style[i] |= this.curStyle;
67
+ if (this.cls[i] !== 'border')
68
+ this.cls[i] = cls;
69
+ }
70
+ /** Stamp a finished sub-canvas (a subgraph frame's contents) at an offset. */
71
+ blit(sub, ox, oy) {
72
+ for (let sy = 0; sy < sub.h; sy++) {
73
+ for (let sx = 0; sx < sub.w; sx++) {
74
+ const x = ox + sx;
75
+ const y = oy + sy;
76
+ if (x >= this.w || y >= this.h)
77
+ continue;
78
+ const si = sub.idx(sx, sy);
79
+ const di = this.idx(x, y);
80
+ this.ch[di] = sub.ch[si];
81
+ this.cls[di] = sub.cls[si];
82
+ this.style[di] = sub.style[si];
83
+ this.occupied[di] = 1;
84
+ }
85
+ }
86
+ }
87
+ /** Add direction bits even to an occupied cell, so an edge can meet a border. */
88
+ junction(x, y, bits) {
89
+ if (x >= this.w || y >= this.h)
90
+ return;
91
+ const i = this.idx(x, y);
92
+ this.mask[i] |= bits;
93
+ if (this.cls[i] !== 'border')
94
+ this.cls[i] = 'edge';
95
+ }
96
+ segV(x, y0, y1) {
97
+ const a = Math.min(y0, y1);
98
+ const b = Math.max(y0, y1);
99
+ for (let y = a; y <= b; y++) {
100
+ let bits = 0;
101
+ if (y > a)
102
+ bits |= U;
103
+ if (y < b)
104
+ bits |= D;
105
+ this.addBits(x, y, bits);
106
+ }
107
+ }
108
+ segH(y, x0, x1) {
109
+ const a = Math.min(x0, x1);
110
+ const b = Math.max(x0, x1);
111
+ for (let x = a; x <= b; x++) {
112
+ let bits = 0;
113
+ if (x > a)
114
+ bits |= L;
115
+ if (x < b)
116
+ bits |= R;
117
+ this.addBits(x, y, bits);
118
+ }
119
+ }
120
+ /** Resolve accumulated direction bits into glyphs, honouring line style. */
121
+ finalizeMask() {
122
+ for (let i = 0; i < this.ch.length; i++) {
123
+ if (this.mask[i] !== 0 && this.ch[i] === ' ') {
124
+ const c = maskChar(this.mask[i]);
125
+ this.ch[i] =
126
+ this.style[i] === STY_DOT ? dottedChar(c) : this.style[i] === STY_THICK ? thickChar(c) : c;
127
+ }
128
+ }
129
+ }
130
+ /**
131
+ * Mirror top-to-bottom for `BT`. Rows reorder but within-row text does not,
132
+ * so labels stay readable; box-drawing glyphs flip to match.
133
+ */
134
+ flipVertical() {
135
+ for (let y = 0; y < Math.floor(this.h / 2); y++) {
136
+ const y2 = this.h - 1 - y;
137
+ for (let x = 0; x < this.w; x++) {
138
+ const i = this.idx(x, y);
139
+ const j = this.idx(x, y2);
140
+ [this.ch[i], this.ch[j]] = [this.ch[j], this.ch[i]];
141
+ [this.cls[i], this.cls[j]] = [this.cls[j], this.cls[i]];
142
+ }
143
+ }
144
+ for (let i = 0; i < this.ch.length; i++)
145
+ this.ch[i] = flipGlyphV(this.ch[i]);
146
+ }
147
+ /**
148
+ * Mirror left-to-right for `RL`. Mirroring reverses each row, so after
149
+ * flipping glyphs each text/label run is reversed back to reading order.
150
+ */
151
+ flipHorizontal() {
152
+ for (let y = 0; y < this.h; y++) {
153
+ for (let x = 0; x < Math.floor(this.w / 2); x++) {
154
+ const x2 = this.w - 1 - x;
155
+ const i = this.idx(x, y);
156
+ const j = this.idx(x2, y);
157
+ [this.ch[i], this.ch[j]] = [this.ch[j], this.ch[i]];
158
+ [this.cls[i], this.cls[j]] = [this.cls[j], this.cls[i]];
159
+ }
160
+ }
161
+ for (let i = 0; i < this.ch.length; i++)
162
+ this.ch[i] = flipGlyphH(this.ch[i]);
163
+ for (let y = 0; y < this.h; y++) {
164
+ let x = 0;
165
+ while (x < this.w) {
166
+ const cls = this.cls[this.idx(x, y)];
167
+ if (cls === 'text' || cls === 'edgeLabel') {
168
+ const start = this.idx(x, y);
169
+ while (x < this.w && this.cls[this.idx(x, y)] === cls)
170
+ x++;
171
+ const end = this.idx(x, y);
172
+ reverseSlice(this.ch, start, end);
173
+ }
174
+ else {
175
+ x++;
176
+ }
177
+ }
178
+ }
179
+ }
180
+ /** Group each row into runs of one class, dropping wide-glyph continuations. */
181
+ toLines() {
182
+ const plain = [];
183
+ const styled = [];
184
+ let width = 0;
185
+ for (let y = 0; y < this.h; y++) {
186
+ // A trailing CONT counts as painted: it is the second cell of a wide
187
+ // glyph, so the row really does reach that column.
188
+ let last = 0;
189
+ for (let x = this.w - 1; x >= 0; x--) {
190
+ if (this.ch[this.idx(x, y)] !== ' ') {
191
+ last = x + 1;
192
+ break;
193
+ }
194
+ }
195
+ width = Math.max(width, last);
196
+ const spans = [];
197
+ let plainRow = '';
198
+ let run = '';
199
+ let runCls = 'none';
200
+ for (let x = 0; x < last; x++) {
201
+ const i = this.idx(x, y);
202
+ const c = this.ch[i];
203
+ if (c === CONT)
204
+ continue;
205
+ const cls = this.cls[i];
206
+ plainRow += c;
207
+ if (cls !== runCls && run !== '') {
208
+ spans.push({ text: run, cls: runCls });
209
+ run = '';
210
+ }
211
+ runCls = cls;
212
+ run += c;
213
+ }
214
+ if (run !== '')
215
+ spans.push({ text: run, cls: runCls });
216
+ styled.push(spans);
217
+ // Only ASCII spaces, which is all a blank cell ever holds. Trimming `\s`
218
+ // would eat a trailing NBSP that `styled` keeps, desyncing the two.
219
+ plain.push(plainRow.replace(/ +$/, ''));
220
+ }
221
+ let first = 0;
222
+ while (first < plain.length && plain[first] === '')
223
+ first++;
224
+ let end = plain.length;
225
+ while (end > first && plain[end - 1] === '')
226
+ end--;
227
+ return { plain: plain.slice(first, end), styled: styled.slice(first, end), width };
228
+ }
229
+ }
230
+ function reverseSlice(arr, start, end) {
231
+ for (let i = start, j = end - 1; i < j; i++, j--) {
232
+ ;
233
+ [arr[i], arr[j]] = [arr[j], arr[i]];
234
+ }
235
+ }
236
+ /**
237
+ * Paint `text` at `x, y`, one grapheme cluster per cell.
238
+ *
239
+ * A wide cluster claims a second cell, marked with `CONT` so the line builder
240
+ * emits one character for it rather than a stray space.
241
+ */
242
+ export function drawText(canvas, text, x, y, cls) {
243
+ let cur = x;
244
+ for (const [cluster, cw] of measured(text)) {
245
+ if (cw === 0)
246
+ continue;
247
+ canvas.set(cur, y, cluster, cls);
248
+ for (let k = 1; k < cw; k++)
249
+ canvas.set(cur + k, y, CONT, cls);
250
+ cur += cw;
251
+ }
252
+ }
253
+ /**
254
+ * Paint `text` at `x, y`, clearing any edge bits underneath first.
255
+ *
256
+ * Used where text sits on top of a drawn line (sequence messages, dividers,
257
+ * compartment rows) and must win over it.
258
+ */
259
+ export function drawTextOverEdges(canvas, text, x, y, cls) {
260
+ let cur = x;
261
+ for (const [cluster, cw] of measured(text)) {
262
+ if (cw === 0)
263
+ continue;
264
+ for (let k = 0; k < cw; k++) {
265
+ if (cur + k < canvas.w && y < canvas.h)
266
+ canvas.mask[canvas.idx(cur + k, y)] = 0;
267
+ canvas.set(cur + k, y, k === 0 ? cluster : CONT, cls);
268
+ }
269
+ cur += cw;
270
+ }
271
+ }
272
+ export function maskChar(mask) {
273
+ switch (mask) {
274
+ case 0:
275
+ return ' ';
276
+ case U:
277
+ case D:
278
+ case U | D:
279
+ return '│';
280
+ case L:
281
+ case R:
282
+ case L | R:
283
+ return '─';
284
+ case D | R:
285
+ return '┌';
286
+ case D | L:
287
+ return '┐';
288
+ case U | R:
289
+ return '└';
290
+ case U | L:
291
+ return '┘';
292
+ case U | D | R:
293
+ return '├';
294
+ case U | D | L:
295
+ return '┤';
296
+ case D | L | R:
297
+ return '┬';
298
+ case U | L | R:
299
+ return '┴';
300
+ default:
301
+ return '┼';
302
+ }
303
+ }
304
+ const DOTTED = { '─': '╌', '│': '╎' };
305
+ const THICK = {
306
+ '─': '━',
307
+ '│': '┃',
308
+ '┌': '┏',
309
+ '┐': '┓',
310
+ '└': '┗',
311
+ '┘': '┛',
312
+ '├': '┣',
313
+ '┤': '┫',
314
+ '┬': '┳',
315
+ '┴': '┻',
316
+ '┼': '╋',
317
+ };
318
+ const FLIP_V = {
319
+ '┌': '└',
320
+ '└': '┌',
321
+ '┐': '┘',
322
+ '┘': '┐',
323
+ '┏': '┗',
324
+ '┗': '┏',
325
+ '┓': '┛',
326
+ '┛': '┓',
327
+ '╭': '╰',
328
+ '╰': '╭',
329
+ '╮': '╯',
330
+ '╯': '╮',
331
+ '┬': '┴',
332
+ '┴': '┬',
333
+ '┳': '┻',
334
+ '┻': '┳',
335
+ '▼': '▲',
336
+ '▲': '▼',
337
+ '▽': '△',
338
+ '△': '▽',
339
+ };
340
+ const FLIP_H = {
341
+ '┌': '┐',
342
+ '┐': '┌',
343
+ '└': '┘',
344
+ '┘': '└',
345
+ '┏': '┓',
346
+ '┓': '┏',
347
+ '┗': '┛',
348
+ '┛': '┗',
349
+ '╭': '╮',
350
+ '╮': '╭',
351
+ '╰': '╯',
352
+ '╯': '╰',
353
+ '├': '┤',
354
+ '┤': '├',
355
+ '┣': '┫',
356
+ '┫': '┣',
357
+ '▶': '◄',
358
+ '◄': '▶',
359
+ '▷': '◁',
360
+ '◁': '▷',
361
+ };
362
+ export const dottedChar = (c) => DOTTED[c] ?? c;
363
+ export const thickChar = (c) => THICK[c] ?? c;
364
+ export const flipGlyphV = (c) => FLIP_V[c] ?? c;
365
+ export const flipGlyphH = (c) => FLIP_H[c] ?? c;
366
+ //# sourceMappingURL=canvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas.js","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;AAE1C,kFAAkF;AAClF,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAClB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAClB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAClB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAElB,6EAA6E;AAC7E,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAA;AACxB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAC1B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAE1B;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACR,CAAC,CAAQ;IACT,CAAC,CAAQ;IAClB,EAAE,CAAU;IACZ,GAAG,CAAO;IACV,IAAI,CAAY;IAChB,KAAK,CAAY;IACjB,QAAQ,CAAY;IACpB,QAAQ,GAAW,SAAS,CAAA;IAE5B,YAAY,CAAS,EAAE,CAAS;QAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACf,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,EAAE,G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E,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;CACT,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC/D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The shared diagram model. Flowchart, state, class and ER sources all parse
3
+ * into a `Graph`; only sequence diagrams have their own model.
4
+ */
5
+ /** Caps that keep layout bounded; exceeding one drops the diagram to fallback. */
6
+ export declare const MAX_NODES = 128;
7
+ export declare const MAX_EDGES = 512;
8
+ export declare const MAX_GROUPS = 24;
9
+ export declare const MAX_GROUP_DEPTH = 6;
10
+ /** Class members / ER attributes listed per box before eliding with `…`. */
11
+ export declare const MAX_MEMBERS = 8;
12
+ export type Shape = 'rect' | 'round' | 'diamond';
13
+ /** Decoration at one end of an edge. */
14
+ export type Head = 'none' | 'arrow' | 'circle' | 'cross' | 'triangle' | 'diamondFill' | 'diamondOpen';
15
+ export type LineKind = 'solid' | 'dotted' | 'thick';
16
+ export type Dir = 'down' | 'up' | 'right' | 'left';
17
+ export interface Node {
18
+ label: string;
19
+ shape: Shape;
20
+ }
21
+ export interface Edge {
22
+ from: number;
23
+ to: number;
24
+ label: string | null;
25
+ headTo: Head;
26
+ headFrom: Head;
27
+ line: LineKind;
28
+ }
29
+ export interface Group {
30
+ id: string;
31
+ label: string;
32
+ parent: number | null;
33
+ }
34
+ /** Extra compartment content for class and ER boxes. */
35
+ export interface ClassInfo {
36
+ annotation: string | null;
37
+ attrs: string[];
38
+ methods: string[];
39
+ }
40
+ export declare const emptyClassInfo: () => ClassInfo;
41
+ /** `LR`/`RL`/`BT` as written in a header or `direction` statement; else `down`. */
42
+ export declare function parseDir(token: string): Dir;
43
+ export declare class Graph {
44
+ nodes: Node[];
45
+ edges: Edge[];
46
+ index: Map<string, number>;
47
+ groups: Group[];
48
+ /** Innermost subgraph each node was declared in, parallel to `nodes`. */
49
+ nodeGroup: (number | null)[];
50
+ curGroup: number | null;
51
+ /** Set when a cap was hit; the caller abandons the parse. */
52
+ overCap: boolean;
53
+ /**
54
+ * Text the flowchart grammar could not read and silently discarded.
55
+ *
56
+ * Flowchart parsing is deliberately lenient — a malformed statement
57
+ * contributes whatever prefix parsed and the rest is dropped — so without
58
+ * these the reader gets a clean diagram that is not what they wrote.
59
+ */
60
+ warnings: string[];
61
+ dir: Dir;
62
+ constructor(dir?: Dir);
63
+ /**
64
+ * Index of `id`, creating the node if new. A later declaration carrying a
65
+ * label overwrites the placeholder one an edge created. Returns `null` once
66
+ * `MAX_NODES` is reached, which aborts the parse.
67
+ */
68
+ nodeIndex(id: string, label: string | null, shape: Shape): number | null;
69
+ /** Set a node's label without disturbing its shape, creating it if new. */
70
+ nodeLabel(id: string, label: string): number | null;
71
+ /** Append an edge, or flag `overCap` when `MAX_EDGES` is reached. */
72
+ pushEdge(edge: Edge): boolean;
73
+ }
74
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,kFAAkF;AAClF,eAAO,MAAM,SAAS,MAAM,CAAA;AAC5B,eAAO,MAAM,SAAS,MAAM,CAAA;AAC5B,eAAO,MAAM,UAAU,KAAK,CAAA;AAC5B,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC,4EAA4E;AAC5E,eAAO,MAAM,WAAW,IAAI,CAAA;AAE5B,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhD,wCAAwC;AACxC,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,OAAO,GACP,QAAQ,GACR,OAAO,GACP,UAAU,GACV,aAAa,GACb,aAAa,CAAA;AAEjB,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEnD,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,CAAA;AAElD,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,KAAK,CAAA;CACb;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,IAAI,CAAA;IACZ,QAAQ,EAAE,IAAI,CAAA;IACd,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,eAAO,MAAM,cAAc,QAAO,SAA2D,CAAA;AAE7F,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAW3C;AAED,qBAAa,KAAK;IAChB,KAAK,EAAE,IAAI,EAAE,CAAK;IAClB,KAAK,EAAE,IAAI,EAAE,CAAK;IAClB,KAAK,sBAA4B;IACjC,MAAM,EAAE,KAAK,EAAE,CAAK;IACpB,yEAAyE;IACzE,SAAS,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAK;IACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAO;IAC9B,6DAA6D;IAC7D,OAAO,UAAQ;IACf;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAK;IACvB,GAAG,EAAE,GAAG,CAAS;IAEjB,YAAY,GAAG,GAAE,GAAY,EAE5B;IAED;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAiBvE;IAED,2EAA2E;IAC3E,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOlD;IAED,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAO5B;CACF"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * The shared diagram model. Flowchart, state, class and ER sources all parse
3
+ * into a `Graph`; only sequence diagrams have their own model.
4
+ */
5
+ import { asciiUpper } from './labels.js';
6
+ /** Caps that keep layout bounded; exceeding one drops the diagram to fallback. */
7
+ export const MAX_NODES = 128;
8
+ export const MAX_EDGES = 512;
9
+ export const MAX_GROUPS = 24;
10
+ export const MAX_GROUP_DEPTH = 6;
11
+ /** Class members / ER attributes listed per box before eliding with `…`. */
12
+ export const MAX_MEMBERS = 8;
13
+ export const emptyClassInfo = () => ({ annotation: null, attrs: [], methods: [] });
14
+ /** `LR`/`RL`/`BT` as written in a header or `direction` statement; else `down`. */
15
+ export function parseDir(token) {
16
+ switch (asciiUpper(token)) {
17
+ case 'LR':
18
+ return 'right';
19
+ case 'RL':
20
+ return 'left';
21
+ case 'BT':
22
+ return 'up';
23
+ default:
24
+ return 'down';
25
+ }
26
+ }
27
+ export class Graph {
28
+ nodes = [];
29
+ edges = [];
30
+ index = new Map();
31
+ groups = [];
32
+ /** Innermost subgraph each node was declared in, parallel to `nodes`. */
33
+ nodeGroup = [];
34
+ curGroup = null;
35
+ /** Set when a cap was hit; the caller abandons the parse. */
36
+ overCap = false;
37
+ /**
38
+ * Text the flowchart grammar could not read and silently discarded.
39
+ *
40
+ * Flowchart parsing is deliberately lenient — a malformed statement
41
+ * contributes whatever prefix parsed and the rest is dropped — so without
42
+ * these the reader gets a clean diagram that is not what they wrote.
43
+ */
44
+ warnings = [];
45
+ dir = 'down';
46
+ constructor(dir = 'down') {
47
+ this.dir = dir;
48
+ }
49
+ /**
50
+ * Index of `id`, creating the node if new. A later declaration carrying a
51
+ * label overwrites the placeholder one an edge created. Returns `null` once
52
+ * `MAX_NODES` is reached, which aborts the parse.
53
+ */
54
+ nodeIndex(id, label, shape) {
55
+ const existing = this.index.get(id);
56
+ if (existing !== undefined) {
57
+ if (label !== null) {
58
+ this.nodes[existing].label = label;
59
+ this.nodes[existing].shape = shape;
60
+ }
61
+ return existing;
62
+ }
63
+ if (this.nodes.length >= MAX_NODES) {
64
+ this.overCap = true;
65
+ return null;
66
+ }
67
+ this.index.set(id, this.nodes.length);
68
+ this.nodes.push({ label: label ?? id, shape });
69
+ this.nodeGroup.push(this.curGroup);
70
+ return this.nodes.length - 1;
71
+ }
72
+ /** Set a node's label without disturbing its shape, creating it if new. */
73
+ nodeLabel(id, label) {
74
+ const existing = this.index.get(id);
75
+ if (existing !== undefined) {
76
+ this.nodes[existing].label = label;
77
+ return existing;
78
+ }
79
+ return this.nodeIndex(id, label, 'round');
80
+ }
81
+ /** Append an edge, or flag `overCap` when `MAX_EDGES` is reached. */
82
+ pushEdge(edge) {
83
+ if (this.edges.length >= MAX_EDGES) {
84
+ this.overCap = true;
85
+ return false;
86
+ }
87
+ this.edges.push(edge);
88
+ return true;
89
+ }
90
+ }
91
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;AAC5B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;AAC5B,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAA;AAC5B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAChC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAA;AA6C5B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAc,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;AAE7F,mFAAmF;AACnF,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,QAAQ,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,KAAK,IAAI;YACP,OAAO,OAAO,CAAA;QAChB,KAAK,IAAI;YACP,OAAO,MAAM,CAAA;QACf,KAAK,IAAI;YACP,OAAO,IAAI,CAAA;QACb;YACE,OAAO,MAAM,CAAA;IACjB,CAAC;AACH,CAAC;AAED,MAAM,OAAO,KAAK;IAChB,KAAK,GAAW,EAAE,CAAA;IAClB,KAAK,GAAW,E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,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9B,CAAC;IAED,2EAA2E;IAC3E,SAAS,CAAC,EAAU,EAAE,KAAa;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACnC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,KAAK,CAAA;YAClC,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;IAED,qEAAqE;IACrE,QAAQ,CAAC,IAAU;QACjB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;YACnB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrB,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
@@ -0,0 +1,32 @@
1
+ import type { MermaidArt } from './types.ts';
2
+ export { type AnsiTheme, DEFAULT_THEME, toAnsi } from './ansi.ts';
3
+ export { type DiagramKind, diagramKind } from './parse.ts';
4
+ export { sourceBox } from './source-box.ts';
5
+ export type { Cls, MermaidArt, Span } from './types.ts';
6
+ /**
7
+ * Render a Mermaid source block as Unicode box-drawing art.
8
+ *
9
+ * Supported: `graph`/`flowchart` (including `subgraph`), `stateDiagram`,
10
+ * `classDiagram`, `erDiagram` and `sequenceDiagram`.
11
+ *
12
+ * The diagram is laid out at whatever size it needs; `art.width` reports the
13
+ * columns that turned out to be. Deciding what to do when that exceeds the
14
+ * space at hand is the caller's — `sourceBox` is the usual answer:
15
+ *
16
+ * ```ts
17
+ * const art = render(src)
18
+ * show(art && art.width <= cols ? art : sourceBox(src, cols))
19
+ * ```
20
+ *
21
+ * `null` means there is no art to show: blank input, a syntax error, a diagram
22
+ * type this renderer does not draw, or one large enough that laying it out is
23
+ * refused. `diagramKind` separates the middle two.
24
+ *
25
+ * Rendering is best-effort. A flowchart keeps whatever parsed; the stricter
26
+ * grammars additionally get one retry without their final line, which is what
27
+ * keeps a streaming diagram on screen while its last statement is half-typed.
28
+ * Everything given up on is listed in `art.warnings` — advisory only, never a
29
+ * reason to withhold the art.
30
+ */
31
+ export declare function render(src: string): MermaidArt | null;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,KAAK,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,KAAK,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAMrD"}