@tienne/gestalt 0.87.0 → 0.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/CLAUDE.md +12 -4
  2. package/README.ko.md +2 -1
  3. package/README.md +3 -1
  4. package/dist/bin/gestalt-hook.d.ts +5 -0
  5. package/dist/bin/gestalt-hook.d.ts.map +1 -0
  6. package/dist/bin/gestalt-hook.js +51 -0
  7. package/dist/bin/gestalt-hook.js.map +1 -0
  8. package/dist/package.json +5 -3
  9. package/dist/plugin/skills/_shared/proactive-routing.md +1 -0
  10. package/dist/plugin/skills/architecture/SKILL.md +913 -0
  11. package/dist/plugin/skills/blast-radius/SKILL.md +11 -1
  12. package/dist/plugin/skills/diff-radius/SKILL.md +11 -0
  13. package/dist/schemas/architecture-ir.schema.json +596 -0
  14. package/dist/schemas/gestalt.schema.json +19 -0
  15. package/dist/src/architecture/canvas-geometry.d.ts +40 -0
  16. package/dist/src/architecture/canvas-geometry.d.ts.map +1 -0
  17. package/dist/src/architecture/canvas-geometry.js +212 -0
  18. package/dist/src/architecture/canvas-geometry.js.map +1 -0
  19. package/dist/src/architecture/codeowners.d.ts +16 -0
  20. package/dist/src/architecture/codeowners.d.ts.map +1 -0
  21. package/dist/src/architecture/codeowners.js +58 -0
  22. package/dist/src/architecture/codeowners.js.map +1 -0
  23. package/dist/src/architecture/compare-layout.d.ts +27 -0
  24. package/dist/src/architecture/compare-layout.d.ts.map +1 -0
  25. package/dist/src/architecture/compare-layout.js +72 -0
  26. package/dist/src/architecture/compare-layout.js.map +1 -0
  27. package/dist/src/architecture/dataflow-layout.d.ts +29 -0
  28. package/dist/src/architecture/dataflow-layout.d.ts.map +1 -0
  29. package/dist/src/architecture/dataflow-layout.js +229 -0
  30. package/dist/src/architecture/dataflow-layout.js.map +1 -0
  31. package/dist/src/architecture/doc-fresh.d.ts +31 -0
  32. package/dist/src/architecture/doc-fresh.d.ts.map +1 -0
  33. package/dist/src/architecture/doc-fresh.js +84 -0
  34. package/dist/src/architecture/doc-fresh.js.map +1 -0
  35. package/dist/src/architecture/doc-link.d.ts +84 -0
  36. package/dist/src/architecture/doc-link.d.ts.map +1 -0
  37. package/dist/src/architecture/doc-link.js +396 -0
  38. package/dist/src/architecture/doc-link.js.map +1 -0
  39. package/dist/src/architecture/doc-routes.d.ts +39 -0
  40. package/dist/src/architecture/doc-routes.d.ts.map +1 -0
  41. package/dist/src/architecture/doc-routes.js +123 -0
  42. package/dist/src/architecture/doc-routes.js.map +1 -0
  43. package/dist/src/architecture/doc-scan.d.ts +107 -0
  44. package/dist/src/architecture/doc-scan.d.ts.map +1 -0
  45. package/dist/src/architecture/doc-scan.js +617 -0
  46. package/dist/src/architecture/doc-scan.js.map +1 -0
  47. package/dist/src/architecture/doc-stale.d.ts +32 -0
  48. package/dist/src/architecture/doc-stale.d.ts.map +1 -0
  49. package/dist/src/architecture/doc-stale.js +60 -0
  50. package/dist/src/architecture/doc-stale.js.map +1 -0
  51. package/dist/src/architecture/drilldown.d.ts +51 -0
  52. package/dist/src/architecture/drilldown.d.ts.map +1 -0
  53. package/dist/src/architecture/drilldown.js +1160 -0
  54. package/dist/src/architecture/drilldown.js.map +1 -0
  55. package/dist/src/architecture/endpoint-match.d.ts +43 -0
  56. package/dist/src/architecture/endpoint-match.d.ts.map +1 -0
  57. package/dist/src/architecture/endpoint-match.js +133 -0
  58. package/dist/src/architecture/endpoint-match.js.map +1 -0
  59. package/dist/src/architecture/flow-layout.d.ts +79 -0
  60. package/dist/src/architecture/flow-layout.d.ts.map +1 -0
  61. package/dist/src/architecture/flow-layout.js +519 -0
  62. package/dist/src/architecture/flow-layout.js.map +1 -0
  63. package/dist/src/architecture/focus.d.ts +14 -0
  64. package/dist/src/architecture/focus.d.ts.map +1 -0
  65. package/dist/src/architecture/focus.js +107 -0
  66. package/dist/src/architecture/focus.js.map +1 -0
  67. package/dist/src/architecture/global-context.d.ts +23 -0
  68. package/dist/src/architecture/global-context.d.ts.map +1 -0
  69. package/dist/src/architecture/global-context.js +67 -0
  70. package/dist/src/architecture/global-context.js.map +1 -0
  71. package/dist/src/architecture/html-client.d.ts +35 -0
  72. package/dist/src/architecture/html-client.d.ts.map +1 -0
  73. package/dist/src/architecture/html-client.js +1852 -0
  74. package/dist/src/architecture/html-client.js.map +1 -0
  75. package/dist/src/architecture/html-renderer.d.ts +22 -0
  76. package/dist/src/architecture/html-renderer.d.ts.map +1 -0
  77. package/dist/src/architecture/html-renderer.js +1290 -0
  78. package/dist/src/architecture/html-renderer.js.map +1 -0
  79. package/dist/src/architecture/html-theme.d.ts +25 -0
  80. package/dist/src/architecture/html-theme.d.ts.map +1 -0
  81. package/dist/src/architecture/html-theme.js +681 -0
  82. package/dist/src/architecture/html-theme.js.map +1 -0
  83. package/dist/src/architecture/index.d.ts +9 -0
  84. package/dist/src/architecture/index.d.ts.map +1 -0
  85. package/dist/src/architecture/index.js +9 -0
  86. package/dist/src/architecture/index.js.map +1 -0
  87. package/dist/src/architecture/ir-schema.d.ts +1832 -0
  88. package/dist/src/architecture/ir-schema.d.ts.map +1 -0
  89. package/dist/src/architecture/ir-schema.js +343 -0
  90. package/dist/src/architecture/ir-schema.js.map +1 -0
  91. package/dist/src/architecture/kind-text.d.ts +21 -0
  92. package/dist/src/architecture/kind-text.d.ts.map +1 -0
  93. package/dist/src/architecture/kind-text.js +42 -0
  94. package/dist/src/architecture/kind-text.js.map +1 -0
  95. package/dist/src/architecture/layout.d.ts +227 -0
  96. package/dist/src/architecture/layout.d.ts.map +1 -0
  97. package/dist/src/architecture/layout.js +627 -0
  98. package/dist/src/architecture/layout.js.map +1 -0
  99. package/dist/src/architecture/mcp-tool-match.d.ts +49 -0
  100. package/dist/src/architecture/mcp-tool-match.d.ts.map +1 -0
  101. package/dist/src/architecture/mcp-tool-match.js +53 -0
  102. package/dist/src/architecture/mcp-tool-match.js.map +1 -0
  103. package/dist/src/architecture/merge.d.ts +54 -0
  104. package/dist/src/architecture/merge.d.ts.map +1 -0
  105. package/dist/src/architecture/merge.js +681 -0
  106. package/dist/src/architecture/merge.js.map +1 -0
  107. package/dist/src/architecture/micro-app.d.ts +20 -0
  108. package/dist/src/architecture/micro-app.d.ts.map +1 -0
  109. package/dist/src/architecture/micro-app.js +41 -0
  110. package/dist/src/architecture/micro-app.js.map +1 -0
  111. package/dist/src/architecture/name-ref-match.d.ts +43 -0
  112. package/dist/src/architecture/name-ref-match.d.ts.map +1 -0
  113. package/dist/src/architecture/name-ref-match.js +127 -0
  114. package/dist/src/architecture/name-ref-match.js.map +1 -0
  115. package/dist/src/architecture/packs/data.d.ts +109 -0
  116. package/dist/src/architecture/packs/data.d.ts.map +1 -0
  117. package/dist/src/architecture/packs/data.js +64 -0
  118. package/dist/src/architecture/packs/data.js.map +1 -0
  119. package/dist/src/architecture/packs/generic.d.ts +47 -0
  120. package/dist/src/architecture/packs/generic.d.ts.map +1 -0
  121. package/dist/src/architecture/packs/generic.js +35 -0
  122. package/dist/src/architecture/packs/generic.js.map +1 -0
  123. package/dist/src/architecture/packs/harness.d.ts +96 -0
  124. package/dist/src/architecture/packs/harness.d.ts.map +1 -0
  125. package/dist/src/architecture/packs/harness.js +66 -0
  126. package/dist/src/architecture/packs/harness.js.map +1 -0
  127. package/dist/src/architecture/packs/index.d.ts +840 -0
  128. package/dist/src/architecture/packs/index.d.ts.map +1 -0
  129. package/dist/src/architecture/packs/index.js +87 -0
  130. package/dist/src/architecture/packs/index.js.map +1 -0
  131. package/dist/src/architecture/packs/infra.d.ts +91 -0
  132. package/dist/src/architecture/packs/infra.d.ts.map +1 -0
  133. package/dist/src/architecture/packs/infra.js +57 -0
  134. package/dist/src/architecture/packs/infra.js.map +1 -0
  135. package/dist/src/architecture/packs/knowledge.d.ts +72 -0
  136. package/dist/src/architecture/packs/knowledge.d.ts.map +1 -0
  137. package/dist/src/architecture/packs/knowledge.js +58 -0
  138. package/dist/src/architecture/packs/knowledge.js.map +1 -0
  139. package/dist/src/architecture/packs/process.d.ts +87 -0
  140. package/dist/src/architecture/packs/process.d.ts.map +1 -0
  141. package/dist/src/architecture/packs/process.js +52 -0
  142. package/dist/src/architecture/packs/process.js.map +1 -0
  143. package/dist/src/architecture/packs/render-classes.d.ts +11 -0
  144. package/dist/src/architecture/packs/render-classes.d.ts.map +1 -0
  145. package/dist/src/architecture/packs/render-classes.js +92 -0
  146. package/dist/src/architecture/packs/render-classes.js.map +1 -0
  147. package/dist/src/architecture/packs/types.d.ts +66 -0
  148. package/dist/src/architecture/packs/types.d.ts.map +1 -0
  149. package/dist/src/architecture/packs/types.js +18 -0
  150. package/dist/src/architecture/packs/types.js.map +1 -0
  151. package/dist/src/architecture/packs/web-product.d.ts +348 -0
  152. package/dist/src/architecture/packs/web-product.d.ts.map +1 -0
  153. package/dist/src/architecture/packs/web-product.js +226 -0
  154. package/dist/src/architecture/packs/web-product.js.map +1 -0
  155. package/dist/src/architecture/sequence-layout.d.ts +50 -0
  156. package/dist/src/architecture/sequence-layout.d.ts.map +1 -0
  157. package/dist/src/architecture/sequence-layout.js +140 -0
  158. package/dist/src/architecture/sequence-layout.js.map +1 -0
  159. package/dist/src/architecture/service-facts.d.ts +30 -0
  160. package/dist/src/architecture/service-facts.d.ts.map +1 -0
  161. package/dist/src/architecture/service-facts.js +88 -0
  162. package/dist/src/architecture/service-facts.js.map +1 -0
  163. package/dist/src/architecture/store.d.ts +50 -0
  164. package/dist/src/architecture/store.d.ts.map +1 -0
  165. package/dist/src/architecture/store.js +320 -0
  166. package/dist/src/architecture/store.js.map +1 -0
  167. package/dist/src/architecture/types.d.ts +400 -0
  168. package/dist/src/architecture/types.d.ts.map +1 -0
  169. package/dist/src/architecture/types.js +75 -0
  170. package/dist/src/architecture/types.js.map +1 -0
  171. package/dist/src/architecture/validator.d.ts +65 -0
  172. package/dist/src/architecture/validator.d.ts.map +1 -0
  173. package/dist/src/architecture/validator.js +1249 -0
  174. package/dist/src/architecture/validator.js.map +1 -0
  175. package/dist/src/code-graph/cochange.d.ts +40 -0
  176. package/dist/src/code-graph/cochange.d.ts.map +1 -1
  177. package/dist/src/code-graph/cochange.js +88 -3
  178. package/dist/src/code-graph/cochange.js.map +1 -1
  179. package/dist/src/code-graph/engine.d.ts +35 -1
  180. package/dist/src/code-graph/engine.d.ts.map +1 -1
  181. package/dist/src/code-graph/engine.js +300 -55
  182. package/dist/src/code-graph/engine.js.map +1 -1
  183. package/dist/src/code-graph/freshness.d.ts +39 -0
  184. package/dist/src/code-graph/freshness.d.ts.map +1 -0
  185. package/dist/src/code-graph/freshness.js +93 -0
  186. package/dist/src/code-graph/freshness.js.map +1 -0
  187. package/dist/src/code-graph/hooks/background.d.ts +18 -0
  188. package/dist/src/code-graph/hooks/background.d.ts.map +1 -0
  189. package/dist/src/code-graph/hooks/background.js +55 -0
  190. package/dist/src/code-graph/hooks/background.js.map +1 -0
  191. package/dist/src/code-graph/hooks/pointers.d.ts +66 -0
  192. package/dist/src/code-graph/hooks/pointers.d.ts.map +1 -0
  193. package/dist/src/code-graph/hooks/pointers.js +292 -0
  194. package/dist/src/code-graph/hooks/pointers.js.map +1 -0
  195. package/dist/src/code-graph/hooks/rank.d.ts +36 -0
  196. package/dist/src/code-graph/hooks/rank.d.ts.map +1 -0
  197. package/dist/src/code-graph/hooks/rank.js +212 -0
  198. package/dist/src/code-graph/hooks/rank.js.map +1 -0
  199. package/dist/src/code-graph/hooks/run.d.ts +37 -0
  200. package/dist/src/code-graph/hooks/run.d.ts.map +1 -0
  201. package/dist/src/code-graph/hooks/run.js +324 -0
  202. package/dist/src/code-graph/hooks/run.js.map +1 -0
  203. package/dist/src/code-graph/hooks/settings.d.ts +11 -0
  204. package/dist/src/code-graph/hooks/settings.d.ts.map +1 -0
  205. package/dist/src/code-graph/hooks/settings.js +25 -0
  206. package/dist/src/code-graph/hooks/settings.js.map +1 -0
  207. package/dist/src/code-graph/hooks/state.d.ts +20 -0
  208. package/dist/src/code-graph/hooks/state.d.ts.map +1 -0
  209. package/dist/src/code-graph/hooks/state.js +73 -0
  210. package/dist/src/code-graph/hooks/state.js.map +1 -0
  211. package/dist/src/code-graph/index.d.ts +6 -2
  212. package/dist/src/code-graph/index.d.ts.map +1 -1
  213. package/dist/src/code-graph/index.js +3 -1
  214. package/dist/src/code-graph/index.js.map +1 -1
  215. package/dist/src/code-graph/ko-text.d.ts +39 -0
  216. package/dist/src/code-graph/ko-text.d.ts.map +1 -0
  217. package/dist/src/code-graph/ko-text.js +223 -0
  218. package/dist/src/code-graph/ko-text.js.map +1 -0
  219. package/dist/src/code-graph/lock.d.ts +30 -0
  220. package/dist/src/code-graph/lock.d.ts.map +1 -0
  221. package/dist/src/code-graph/lock.js +140 -0
  222. package/dist/src/code-graph/lock.js.map +1 -0
  223. package/dist/src/code-graph/plugins/typescript-skeleton.d.ts +7 -0
  224. package/dist/src/code-graph/plugins/typescript-skeleton.d.ts.map +1 -0
  225. package/dist/src/code-graph/plugins/typescript-skeleton.js +157 -0
  226. package/dist/src/code-graph/plugins/typescript-skeleton.js.map +1 -0
  227. package/dist/src/code-graph/plugins/typescript.d.ts.map +1 -1
  228. package/dist/src/code-graph/plugins/typescript.js +58 -0
  229. package/dist/src/code-graph/plugins/typescript.js.map +1 -1
  230. package/dist/src/code-graph/storage.d.ts +85 -0
  231. package/dist/src/code-graph/storage.d.ts.map +1 -1
  232. package/dist/src/code-graph/storage.js +318 -3
  233. package/dist/src/code-graph/storage.js.map +1 -1
  234. package/dist/src/code-graph/types.d.ts +66 -0
  235. package/dist/src/code-graph/types.d.ts.map +1 -1
  236. package/dist/src/core/config.d.ts +33 -0
  237. package/dist/src/core/config.d.ts.map +1 -1
  238. package/dist/src/core/config.js +14 -0
  239. package/dist/src/core/config.js.map +1 -1
  240. package/dist/src/core/errors.d.ts +4 -0
  241. package/dist/src/core/errors.d.ts.map +1 -1
  242. package/dist/src/core/errors.js +8 -0
  243. package/dist/src/core/errors.js.map +1 -1
  244. package/dist/src/core/hooks-env.d.ts +9 -0
  245. package/dist/src/core/hooks-env.d.ts.map +1 -0
  246. package/dist/src/core/hooks-env.js +16 -0
  247. package/dist/src/core/hooks-env.js.map +1 -0
  248. package/dist/src/mcp/schemas.d.ts +326 -3
  249. package/dist/src/mcp/schemas.d.ts.map +1 -1
  250. package/dist/src/mcp/schemas.js +170 -2
  251. package/dist/src/mcp/schemas.js.map +1 -1
  252. package/dist/src/mcp/server.d.ts.map +1 -1
  253. package/dist/src/mcp/server.js +28 -4
  254. package/dist/src/mcp/server.js.map +1 -1
  255. package/dist/src/mcp/tools/architecture-passthrough.d.ts +9 -0
  256. package/dist/src/mcp/tools/architecture-passthrough.d.ts.map +1 -0
  257. package/dist/src/mcp/tools/architecture-passthrough.js +587 -0
  258. package/dist/src/mcp/tools/architecture-passthrough.js.map +1 -0
  259. package/dist/src/mcp/tools/code-graph-passthrough.d.ts +6 -1
  260. package/dist/src/mcp/tools/code-graph-passthrough.d.ts.map +1 -1
  261. package/dist/src/mcp/tools/code-graph-passthrough.js +95 -6
  262. package/dist/src/mcp/tools/code-graph-passthrough.js.map +1 -1
  263. package/dist/src/utils/claude-projects.d.ts +19 -0
  264. package/dist/src/utils/claude-projects.d.ts.map +1 -0
  265. package/dist/src/utils/claude-projects.js +157 -0
  266. package/dist/src/utils/claude-projects.js.map +1 -0
  267. package/dist/src/utils/read-only-tools.d.ts +19 -0
  268. package/dist/src/utils/read-only-tools.d.ts.map +1 -0
  269. package/dist/src/utils/read-only-tools.js +132 -0
  270. package/dist/src/utils/read-only-tools.js.map +1 -0
  271. package/package.json +5 -3
  272. package/plugin/.codex-plugin/plugin.json +1 -1
  273. package/plugin/.mcp.json +1 -1
  274. package/plugin/mcp.json +1 -1
  275. package/plugin/skills/_shared/proactive-routing.md +1 -0
  276. package/plugin/skills/architecture/SKILL.md +913 -0
  277. package/plugin/skills/blast-radius/SKILL.md +11 -1
  278. package/plugin/skills/diff-radius/SKILL.md +11 -0
  279. package/schemas/architecture-ir.schema.json +596 -0
  280. package/schemas/gestalt.schema.json +19 -0
@@ -0,0 +1,107 @@
1
+ import { BAND_HEAD, BAND_TAIL } from './layout.js';
2
+ /**
3
+ * 포커스 계산. 브라우저 스크립트에 이 소스를 그대로 싣고 단위 테스트도 같은 문자열을 실행해 검사한다.
4
+ * TS 함수를 따로 두면 두 구현이 어긋나도 테스트가 못 잡는다.
5
+ *
6
+ * focusSet(edges, id): id에서 화살표 방향으로 닿는 노드 전부(하류)와 id로 들어오는 쪽을 거슬러 닿는 노드 전부(상류).
7
+ * 하류에서 다시 상류로 꺾지 않는다. 그래서 같은 게이트웨이를 부르는 다른 앱은 빠진다.
8
+ * 돌려주는 edges는 위아래로 따라가며 밟은 선뿐이다.
9
+ * focusLayout(boxes, keep, top, gap): 남은 카드를 같은 열(x) 안에서 원래 위아래 순서대로 위에서부터 다시 쌓는다.
10
+ * x는 그대로 두므로 레인 자리가 안 바뀐다.
11
+ * focusBandLayout(boxes, keep, top, gap, bandOf, shareOf): 여러 제품을 합친 그림이면 띠(맨 위 같이 씀, 그 아래 제품마다 전용)별로
12
+ * 나눠 쌓고 띠 자리까지 낸다. 서버의 stackBands와 같은 규칙이다. shareOf는 같이 쓰는 카드의 제품 수다.
13
+ */
14
+ export const FOCUS_SOURCE = `
15
+ var BAND_HEAD = ${BAND_HEAD}, BAND_TAIL = ${BAND_TAIL};
16
+ function focusSet(edges, id) {
17
+ var out = {};
18
+ var inc = {};
19
+ edges.forEach(function (e) {
20
+ (out[e.from] = out[e.from] || []).push(e);
21
+ (inc[e.to] = inc[e.to] || []).push(e);
22
+ });
23
+ var nodes = {};
24
+ var kept = {};
25
+ nodes[id] = true;
26
+ function walk(index, next) {
27
+ var seen = {};
28
+ seen[id] = true;
29
+ var queue = [id];
30
+ while (queue.length) {
31
+ var at = queue.shift();
32
+ (index[at] || []).forEach(function (e) {
33
+ kept[e.id] = true;
34
+ var n = next(e);
35
+ nodes[n] = true;
36
+ if (!seen[n]) { seen[n] = true; queue.push(n); }
37
+ });
38
+ }
39
+ }
40
+ walk(out, function (e) { return e.to; });
41
+ walk(inc, function (e) { return e.from; });
42
+ return { nodes: Object.keys(nodes).sort(), edges: Object.keys(kept).sort() };
43
+ }
44
+ function focusLayout(boxes, keep, top, gap) {
45
+ var columns = {};
46
+ boxes.forEach(function (b) {
47
+ if (!keep[b.id]) return;
48
+ (columns[b.x] = columns[b.x] || []).push(b);
49
+ });
50
+ var pos = {};
51
+ Object.keys(columns).forEach(function (x) {
52
+ var col = columns[x];
53
+ col.sort(function (a, b) { return a.y - b.y || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0); });
54
+ var y = top;
55
+ col.forEach(function (b) {
56
+ pos[b.id] = { x: b.x, y: y, w: b.w, h: b.h };
57
+ y += b.h + gap;
58
+ });
59
+ });
60
+ return pos;
61
+ }
62
+ function focusBandLayout(boxes, keep, top, gap, bandOf, shareOf) {
63
+ var band = function (id) { return bandOf[id] === undefined ? 0 : bandOf[id]; };
64
+ var share = function (id) { return shareOf[id] || 0; };
65
+ var columns = {};
66
+ var counts = {};
67
+ boxes.forEach(function (b) {
68
+ if (!keep[b.id]) return;
69
+ (columns[b.x] = columns[b.x] || []).push(b);
70
+ counts[band(b.id)] = (counts[band(b.id)] || 0) + 1;
71
+ });
72
+ var order = Object.keys(counts).map(Number).sort(function (a, b) { return a - b; });
73
+ if (order.length < 2) return { pos: focusLayout(boxes, keep, top, gap) };
74
+ var height = {};
75
+ Object.keys(columns).forEach(function (x) {
76
+ order.forEach(function (k) {
77
+ var h = 0, n = 0;
78
+ columns[x].forEach(function (b) { if (band(b.id) === k) { h += b.h; n += 1; } });
79
+ if (n) height[k] = Math.max(height[k] || 0, h + gap * (n - 1));
80
+ });
81
+ });
82
+ var bands = [];
83
+ var bandTop = {};
84
+ var cursor = top;
85
+ order.forEach(function (k) {
86
+ var h = BAND_HEAD + height[k] + BAND_TAIL;
87
+ bands.push({ band: k, y: cursor, height: h });
88
+ bandTop[k] = cursor + BAND_HEAD;
89
+ cursor += h;
90
+ });
91
+ var pos = {};
92
+ Object.keys(columns).forEach(function (x) {
93
+ var col = columns[x];
94
+ order.forEach(function (k) {
95
+ var y = bandTop[k];
96
+ col.filter(function (b) { return band(b.id) === k; })
97
+ .sort(function (a, b) { return (k === 0 ? share(b.id) - share(a.id) : 0) || a.y - b.y || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0); })
98
+ .forEach(function (b) {
99
+ pos[b.id] = { x: b.x, y: y, w: b.w, h: b.h };
100
+ y += b.h + gap;
101
+ });
102
+ });
103
+ });
104
+ return { pos: pos, bands: bands, bottom: cursor };
105
+ }
106
+ `;
107
+ //# sourceMappingURL=focus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../src/architecture/focus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;kBACV,SAAS,iBAAiB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FpD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type ExecGit } from '../utils/claude-projects.js';
2
+ import type { Visibility } from './types.js';
3
+ export interface ContextCandidate {
4
+ via: 'repo' | 'global';
5
+ /** 세션이 그대로 읽을 수 있게 절대경로로 둔다 */
6
+ identifier: string;
7
+ exists: boolean;
8
+ visibility: Visibility;
9
+ }
10
+ export interface CollectGlobalContextOptions {
11
+ repoRoot: string;
12
+ /** 기본값은 os.homedir(). 테스트에서 주입한다 */
13
+ homeDir?: string;
14
+ /** 기본값은 `<homeDir>/.claude/projects` */
15
+ projectsRoot?: string;
16
+ execGit?: ExecGit;
17
+ }
18
+ /**
19
+ * 아키텍처 뷰를 그리기 전에 세션이 읽어볼 만한 맥락 파일 후보를 모은다. 본문은 읽지 않는다.
20
+ * 레포 밖 홈 디렉토리 파일은 private이다. 개인 메모가 공유 HTML로 새지 않게 출처에서부터 표시한다.
21
+ */
22
+ export declare function collectGlobalContext(opts: CollectGlobalContextOptions): ContextCandidate[];
23
+ //# sourceMappingURL=global-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-context.d.ts","sourceRoot":"","sources":["../../../src/architecture/global-context.ts"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;IACvB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAqBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,gBAAgB,EAAE,CAkC1F"}
@@ -0,0 +1,67 @@
1
+ import { existsSync, readdirSync, statSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ import { findClaudeProjectMemoryDirs } from '../utils/claude-projects.js';
5
+ function isFile(path) {
6
+ try {
7
+ return statSync(path).isFile();
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
13
+ function listMarkdown(dir, recursive) {
14
+ if (!existsSync(dir))
15
+ return [];
16
+ try {
17
+ return readdirSync(dir, { recursive, withFileTypes: true })
18
+ .filter((d) => d.isFile() && d.name.endsWith('.md'))
19
+ .map((d) => join(d.parentPath, d.name));
20
+ }
21
+ catch {
22
+ return [];
23
+ }
24
+ }
25
+ /**
26
+ * 아키텍처 뷰를 그리기 전에 세션이 읽어볼 만한 맥락 파일 후보를 모은다. 본문은 읽지 않는다.
27
+ * 레포 밖 홈 디렉토리 파일은 private이다. 개인 메모가 공유 HTML로 새지 않게 출처에서부터 표시한다.
28
+ */
29
+ export function collectGlobalContext(opts) {
30
+ const { repoRoot } = opts;
31
+ const homeDir = opts.homeDir ?? homedir();
32
+ const projectsRoot = opts.projectsRoot ?? join(homeDir, '.claude', 'projects');
33
+ const candidates = [];
34
+ const fixed = (via, path, visibility) => candidates.push({ via, identifier: path, exists: isFile(path), visibility });
35
+ fixed('repo', join(repoRoot, 'CLAUDE.md'), 'public');
36
+ fixed('repo', join(repoRoot, 'AGENTS.md'), 'public');
37
+ fixed('repo', join(repoRoot, '.gestalt', 'memory.json'), 'public');
38
+ for (const path of listMarkdown(join(repoRoot, 'docs'), true)) {
39
+ candidates.push({ via: 'repo', identifier: path, exists: true, visibility: 'public' });
40
+ }
41
+ fixed('global', join(homeDir, '.claude', 'CLAUDE.md'), 'private');
42
+ const { memoryDirs } = findClaudeProjectMemoryDirs({
43
+ repoRoot,
44
+ projectsRoot,
45
+ execGit: opts.execGit,
46
+ });
47
+ for (const dir of memoryDirs) {
48
+ for (const path of listMarkdown(dir, false)) {
49
+ candidates.push({ via: 'global', identifier: path, exists: true, visibility: 'private' });
50
+ }
51
+ }
52
+ // 홈 디렉토리 안에서 레포를 연 경우 같은 파일이 두 번 잡힐 수 있다. 먼저 넣은 repo 쪽을 남긴다
53
+ const unique = new Map();
54
+ for (const c of candidates) {
55
+ if (!unique.has(c.identifier))
56
+ unique.set(c.identifier, c);
57
+ }
58
+ return [...unique.values()].sort(compareCandidate);
59
+ }
60
+ function compareCandidate(a, b) {
61
+ if (a.via !== b.via)
62
+ return a.via === 'repo' ? -1 : 1;
63
+ if (a.identifier === b.identifier)
64
+ return 0;
65
+ return a.identifier < b.identifier ? -1 : 1;
66
+ }
67
+ //# sourceMappingURL=global-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-context.js","sourceRoot":"","sources":["../../../src/architecture/global-context.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,35 @@
1
+ import { type LaneId } from './layout.js';
2
+ export interface ClientConstants {
3
+ kindShort: Record<string, string>;
4
+ /** 호스트 micro_app 칩 글자 */
5
+ hostShort: string;
6
+ kindText: Record<string, string>;
7
+ evidenceText: Record<string, string>;
8
+ laneTitles: Record<LaneId, string>;
9
+ inferredBadge: string;
10
+ platformChip: Record<string, string>;
11
+ platformName: Record<string, string>;
12
+ webHostingChip: Record<string, string>;
13
+ webHostingName: Record<string, string>;
14
+ /** 평면 그림에서 오른쪽에서 왼쪽으로 그리는 엣지 kind */
15
+ backwardKinds: string[];
16
+ /** component를 쓸 수 있는 어휘면 true. 그때만 component 처리 코드를 싣는다 */
17
+ components?: boolean;
18
+ /** service 없는 흐름이 있으면 true. 전체 레벨의 흐름 단추가 그 흐름을 연다 */
19
+ rootFlows?: boolean;
20
+ /** 질문별 그림이 있으면 true. 메시지 서랍과 그림 단추 코드를 싣는다 */
21
+ views?: boolean;
22
+ /** 근거가 섞인 묶음 선이 있으면 true. 묶음 이름과 배지에 섞였다는 표시를 다는 코드를 싣는다 */
23
+ mixedBundles?: boolean;
24
+ /** 지식 문서 팩을 쓰면 true. 서랍에 문서 정보를 그리는 코드를 싣는다 */
25
+ docs?: boolean;
26
+ }
27
+ export declare const THEME_STORAGE_KEY = "gestalt-architecture-theme";
28
+ export declare const THEME_BOOT_SCRIPT = "(function () {\n try {\n var t = localStorage.getItem('gestalt-architecture-theme');\n if (t === 'light' || t === 'dark') document.documentElement.setAttribute('data-theme', t);\n } catch (e) {}\n})();";
29
+ /**
30
+ * 페이지 동작 전부. 화면 이동, 확대와 이동, 서랍, 검색, 팝오버, 두 항목 화면을 맡는다.
31
+ * 문자열은 전부 textContent로만 넣는다. 근거 문자열은 외부 출처에서 온 값이라 HTML로 해석하면 스크립트가 실행될 수 있다.
32
+ * 템플릿 문자열 안이라 정규식과 문자열의 백슬래시는 두 번 적어야 브라우저에 한 번 남는다.
33
+ */
34
+ export declare function renderClientScript(c: ClientConstants): string;
35
+ //# sourceMappingURL=html-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-client.d.ts","sourceRoot":"","sources":["../../../src/architecture/html-client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,qCAAqC;IACrC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA8MD,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAI9D,eAAO,MAAM,iBAAiB,sNAKxB,CAAC;AAEP;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAomD7D"}