@tienne/gestalt 0.88.0 → 0.90.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.
- package/CLAUDE.md +7 -2
- package/README.ko.md +2 -1
- package/README.md +3 -1
- package/dist/package.json +7 -4
- package/dist/plugin/skills/_shared/proactive-routing.md +29 -12
- package/dist/plugin/skills/architecture/SKILL.md +944 -0
- package/dist/plugin/skills/brief/SKILL.md +2 -1
- package/dist/plugin/skills/dispatch/SKILL.md +2 -0
- package/dist/plugin/skills/explain/SKILL.md +4 -2
- package/dist/plugin/skills/jira-create/SKILL.md +2 -0
- package/dist/plugin/skills/pr/SKILL.md +2 -0
- package/dist/plugin/skills/presentation/SKILL.md +2 -0
- package/dist/plugin/skills/review/SKILL.md +1 -0
- package/dist/plugin/skills/review-loop/SKILL.md +3 -1
- package/dist/plugin/skills/review-reply/SKILL.md +2 -0
- package/dist/plugin/skills/ship/SKILL.md +2 -2
- package/dist/plugin/skills/slack-send/SKILL.md +2 -0
- package/dist/schemas/architecture-ir.schema.json +596 -0
- package/dist/src/architecture/canvas-geometry.d.ts +40 -0
- package/dist/src/architecture/canvas-geometry.d.ts.map +1 -0
- package/dist/src/architecture/canvas-geometry.js +212 -0
- package/dist/src/architecture/canvas-geometry.js.map +1 -0
- package/dist/src/architecture/codeowners.d.ts +16 -0
- package/dist/src/architecture/codeowners.d.ts.map +1 -0
- package/dist/src/architecture/codeowners.js +58 -0
- package/dist/src/architecture/codeowners.js.map +1 -0
- package/dist/src/architecture/compare-layout.d.ts +27 -0
- package/dist/src/architecture/compare-layout.d.ts.map +1 -0
- package/dist/src/architecture/compare-layout.js +72 -0
- package/dist/src/architecture/compare-layout.js.map +1 -0
- package/dist/src/architecture/dataflow-layout.d.ts +29 -0
- package/dist/src/architecture/dataflow-layout.d.ts.map +1 -0
- package/dist/src/architecture/dataflow-layout.js +229 -0
- package/dist/src/architecture/dataflow-layout.js.map +1 -0
- package/dist/src/architecture/doc-fresh.d.ts +31 -0
- package/dist/src/architecture/doc-fresh.d.ts.map +1 -0
- package/dist/src/architecture/doc-fresh.js +84 -0
- package/dist/src/architecture/doc-fresh.js.map +1 -0
- package/dist/src/architecture/doc-link.d.ts +84 -0
- package/dist/src/architecture/doc-link.d.ts.map +1 -0
- package/dist/src/architecture/doc-link.js +396 -0
- package/dist/src/architecture/doc-link.js.map +1 -0
- package/dist/src/architecture/doc-routes.d.ts +39 -0
- package/dist/src/architecture/doc-routes.d.ts.map +1 -0
- package/dist/src/architecture/doc-routes.js +123 -0
- package/dist/src/architecture/doc-routes.js.map +1 -0
- package/dist/src/architecture/doc-scan.d.ts +107 -0
- package/dist/src/architecture/doc-scan.d.ts.map +1 -0
- package/dist/src/architecture/doc-scan.js +617 -0
- package/dist/src/architecture/doc-scan.js.map +1 -0
- package/dist/src/architecture/doc-stale.d.ts +32 -0
- package/dist/src/architecture/doc-stale.d.ts.map +1 -0
- package/dist/src/architecture/doc-stale.js +60 -0
- package/dist/src/architecture/doc-stale.js.map +1 -0
- package/dist/src/architecture/drilldown.d.ts +51 -0
- package/dist/src/architecture/drilldown.d.ts.map +1 -0
- package/dist/src/architecture/drilldown.js +1160 -0
- package/dist/src/architecture/drilldown.js.map +1 -0
- package/dist/src/architecture/endpoint-match.d.ts +43 -0
- package/dist/src/architecture/endpoint-match.d.ts.map +1 -0
- package/dist/src/architecture/endpoint-match.js +133 -0
- package/dist/src/architecture/endpoint-match.js.map +1 -0
- package/dist/src/architecture/flow-layout.d.ts +79 -0
- package/dist/src/architecture/flow-layout.d.ts.map +1 -0
- package/dist/src/architecture/flow-layout.js +519 -0
- package/dist/src/architecture/flow-layout.js.map +1 -0
- package/dist/src/architecture/focus.d.ts +14 -0
- package/dist/src/architecture/focus.d.ts.map +1 -0
- package/dist/src/architecture/focus.js +107 -0
- package/dist/src/architecture/focus.js.map +1 -0
- package/dist/src/architecture/global-context.d.ts +23 -0
- package/dist/src/architecture/global-context.d.ts.map +1 -0
- package/dist/src/architecture/global-context.js +67 -0
- package/dist/src/architecture/global-context.js.map +1 -0
- package/dist/src/architecture/html-client.d.ts +35 -0
- package/dist/src/architecture/html-client.d.ts.map +1 -0
- package/dist/src/architecture/html-client.js +1852 -0
- package/dist/src/architecture/html-client.js.map +1 -0
- package/dist/src/architecture/html-renderer.d.ts +22 -0
- package/dist/src/architecture/html-renderer.d.ts.map +1 -0
- package/dist/src/architecture/html-renderer.js +1290 -0
- package/dist/src/architecture/html-renderer.js.map +1 -0
- package/dist/src/architecture/html-theme.d.ts +25 -0
- package/dist/src/architecture/html-theme.d.ts.map +1 -0
- package/dist/src/architecture/html-theme.js +681 -0
- package/dist/src/architecture/html-theme.js.map +1 -0
- package/dist/src/architecture/index.d.ts +9 -0
- package/dist/src/architecture/index.d.ts.map +1 -0
- package/dist/src/architecture/index.js +9 -0
- package/dist/src/architecture/index.js.map +1 -0
- package/dist/src/architecture/ir-schema.d.ts +1832 -0
- package/dist/src/architecture/ir-schema.d.ts.map +1 -0
- package/dist/src/architecture/ir-schema.js +343 -0
- package/dist/src/architecture/ir-schema.js.map +1 -0
- package/dist/src/architecture/kind-text.d.ts +21 -0
- package/dist/src/architecture/kind-text.d.ts.map +1 -0
- package/dist/src/architecture/kind-text.js +42 -0
- package/dist/src/architecture/kind-text.js.map +1 -0
- package/dist/src/architecture/layout.d.ts +227 -0
- package/dist/src/architecture/layout.d.ts.map +1 -0
- package/dist/src/architecture/layout.js +627 -0
- package/dist/src/architecture/layout.js.map +1 -0
- package/dist/src/architecture/mcp-tool-match.d.ts +49 -0
- package/dist/src/architecture/mcp-tool-match.d.ts.map +1 -0
- package/dist/src/architecture/mcp-tool-match.js +53 -0
- package/dist/src/architecture/mcp-tool-match.js.map +1 -0
- package/dist/src/architecture/merge.d.ts +54 -0
- package/dist/src/architecture/merge.d.ts.map +1 -0
- package/dist/src/architecture/merge.js +681 -0
- package/dist/src/architecture/merge.js.map +1 -0
- package/dist/src/architecture/micro-app.d.ts +20 -0
- package/dist/src/architecture/micro-app.d.ts.map +1 -0
- package/dist/src/architecture/micro-app.js +41 -0
- package/dist/src/architecture/micro-app.js.map +1 -0
- package/dist/src/architecture/name-ref-match.d.ts +43 -0
- package/dist/src/architecture/name-ref-match.d.ts.map +1 -0
- package/dist/src/architecture/name-ref-match.js +127 -0
- package/dist/src/architecture/name-ref-match.js.map +1 -0
- package/dist/src/architecture/packs/data.d.ts +109 -0
- package/dist/src/architecture/packs/data.d.ts.map +1 -0
- package/dist/src/architecture/packs/data.js +64 -0
- package/dist/src/architecture/packs/data.js.map +1 -0
- package/dist/src/architecture/packs/generic.d.ts +47 -0
- package/dist/src/architecture/packs/generic.d.ts.map +1 -0
- package/dist/src/architecture/packs/generic.js +35 -0
- package/dist/src/architecture/packs/generic.js.map +1 -0
- package/dist/src/architecture/packs/harness.d.ts +96 -0
- package/dist/src/architecture/packs/harness.d.ts.map +1 -0
- package/dist/src/architecture/packs/harness.js +66 -0
- package/dist/src/architecture/packs/harness.js.map +1 -0
- package/dist/src/architecture/packs/index.d.ts +840 -0
- package/dist/src/architecture/packs/index.d.ts.map +1 -0
- package/dist/src/architecture/packs/index.js +87 -0
- package/dist/src/architecture/packs/index.js.map +1 -0
- package/dist/src/architecture/packs/infra.d.ts +91 -0
- package/dist/src/architecture/packs/infra.d.ts.map +1 -0
- package/dist/src/architecture/packs/infra.js +57 -0
- package/dist/src/architecture/packs/infra.js.map +1 -0
- package/dist/src/architecture/packs/knowledge.d.ts +72 -0
- package/dist/src/architecture/packs/knowledge.d.ts.map +1 -0
- package/dist/src/architecture/packs/knowledge.js +58 -0
- package/dist/src/architecture/packs/knowledge.js.map +1 -0
- package/dist/src/architecture/packs/process.d.ts +87 -0
- package/dist/src/architecture/packs/process.d.ts.map +1 -0
- package/dist/src/architecture/packs/process.js +52 -0
- package/dist/src/architecture/packs/process.js.map +1 -0
- package/dist/src/architecture/packs/render-classes.d.ts +11 -0
- package/dist/src/architecture/packs/render-classes.d.ts.map +1 -0
- package/dist/src/architecture/packs/render-classes.js +92 -0
- package/dist/src/architecture/packs/render-classes.js.map +1 -0
- package/dist/src/architecture/packs/types.d.ts +66 -0
- package/dist/src/architecture/packs/types.d.ts.map +1 -0
- package/dist/src/architecture/packs/types.js +18 -0
- package/dist/src/architecture/packs/types.js.map +1 -0
- package/dist/src/architecture/packs/web-product.d.ts +348 -0
- package/dist/src/architecture/packs/web-product.d.ts.map +1 -0
- package/dist/src/architecture/packs/web-product.js +226 -0
- package/dist/src/architecture/packs/web-product.js.map +1 -0
- package/dist/src/architecture/sequence-layout.d.ts +50 -0
- package/dist/src/architecture/sequence-layout.d.ts.map +1 -0
- package/dist/src/architecture/sequence-layout.js +140 -0
- package/dist/src/architecture/sequence-layout.js.map +1 -0
- package/dist/src/architecture/service-facts.d.ts +30 -0
- package/dist/src/architecture/service-facts.d.ts.map +1 -0
- package/dist/src/architecture/service-facts.js +88 -0
- package/dist/src/architecture/service-facts.js.map +1 -0
- package/dist/src/architecture/store.d.ts +50 -0
- package/dist/src/architecture/store.d.ts.map +1 -0
- package/dist/src/architecture/store.js +320 -0
- package/dist/src/architecture/store.js.map +1 -0
- package/dist/src/architecture/types.d.ts +400 -0
- package/dist/src/architecture/types.d.ts.map +1 -0
- package/dist/src/architecture/types.js +75 -0
- package/dist/src/architecture/types.js.map +1 -0
- package/dist/src/architecture/validator.d.ts +65 -0
- package/dist/src/architecture/validator.d.ts.map +1 -0
- package/dist/src/architecture/validator.js +1249 -0
- package/dist/src/architecture/validator.js.map +1 -0
- package/dist/src/core/errors.d.ts +4 -0
- package/dist/src/core/errors.d.ts.map +1 -1
- package/dist/src/core/errors.js +8 -0
- package/dist/src/core/errors.js.map +1 -1
- package/dist/src/core/types.d.ts +4 -0
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/mcp/schemas.d.ts +317 -0
- package/dist/src/mcp/schemas.d.ts.map +1 -1
- package/dist/src/mcp/schemas.js +151 -0
- package/dist/src/mcp/schemas.js.map +1 -1
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +7 -1
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools/architecture-passthrough.d.ts +9 -0
- package/dist/src/mcp/tools/architecture-passthrough.d.ts.map +1 -0
- package/dist/src/mcp/tools/architecture-passthrough.js +587 -0
- package/dist/src/mcp/tools/architecture-passthrough.js.map +1 -0
- package/dist/src/skills/parser.d.ts.map +1 -1
- package/dist/src/skills/parser.js +1 -0
- package/dist/src/skills/parser.js.map +1 -1
- package/dist/src/skills/types.d.ts +4 -0
- package/dist/src/skills/types.d.ts.map +1 -1
- package/dist/src/utils/claude-projects.d.ts +19 -0
- package/dist/src/utils/claude-projects.d.ts.map +1 -0
- package/dist/src/utils/claude-projects.js +157 -0
- package/dist/src/utils/claude-projects.js.map +1 -0
- package/dist/src/utils/read-only-tools.d.ts +19 -0
- package/dist/src/utils/read-only-tools.d.ts.map +1 -0
- package/dist/src/utils/read-only-tools.js +132 -0
- package/dist/src/utils/read-only-tools.js.map +1 -0
- package/package.json +7 -4
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
- package/plugin/mcp.json +1 -1
- package/plugin/skills/_shared/proactive-routing.md +29 -12
- package/plugin/skills/architecture/SKILL.md +944 -0
- package/plugin/skills/brief/SKILL.md +2 -1
- package/plugin/skills/dispatch/SKILL.md +2 -0
- package/plugin/skills/explain/SKILL.md +4 -2
- package/plugin/skills/jira-create/SKILL.md +2 -0
- package/plugin/skills/pr/SKILL.md +2 -0
- package/plugin/skills/presentation/SKILL.md +2 -0
- package/plugin/skills/review/SKILL.md +1 -0
- package/plugin/skills/review-loop/SKILL.md +3 -1
- package/plugin/skills/review-reply/SKILL.md +2 -0
- package/plugin/skills/ship/SKILL.md +2 -2
- package/plugin/skills/slack-send/SKILL.md +2 -0
- package/schemas/architecture-ir.schema.json +596 -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":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAgB,MAAM,6BAA6B,CAAC;AAoBxF,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,GAAW,EAAE,SAAkB;IACnD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;aACxD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aACnD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ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.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,E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