@takagaki/cortex-decisions-viewer 0.4.23 → 0.4.24

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/dist/build.js CHANGED
@@ -149,6 +149,7 @@ async function readFleetSources(repoRoot) {
149
149
  ? s.matchKeys.map((k) => String(k)).filter(Boolean)
150
150
  : undefined,
151
151
  driveSync: typeof s.driveSync === "boolean" ? s.driveSync : undefined,
152
+ enabled: typeof s.enabled === "boolean" ? s.enabled : undefined,
152
153
  }))
153
154
  : undefined;
154
155
  const pipelines = Array.isArray(obj.pipelines)
@@ -163,7 +164,18 @@ async function readFleetSources(repoRoot) {
163
164
  applicable: typeof p.applicable === "boolean" ? p.applicable : undefined,
164
165
  }))
165
166
  : undefined;
166
- return { externalSources, internalSources, pipelines };
167
+ // 能力→ツールの宣言マップ(例: { チャット: "slack", 開発: "none" })。"none" は未使用のグレー行表示に使う
168
+ let tools;
169
+ if (obj.tools != null && typeof obj.tools === "object" && !Array.isArray(obj.tools)) {
170
+ tools = {};
171
+ for (const [k, v] of Object.entries(obj.tools)) {
172
+ if (typeof v === "string")
173
+ tools[k] = v;
174
+ }
175
+ if (!Object.keys(tools).length)
176
+ tools = undefined;
177
+ }
178
+ return { externalSources, internalSources, pipelines, tools };
167
179
  }
168
180
  /** ディレクトリ内の .md を汎用レコードとして読み込む(存在しなければ空配列) */
169
181
  async function loadGenericRecords(dirAbs, exclude, repoBaseUrl, branch) {
@@ -948,6 +960,7 @@ async function build(opts) {
948
960
  externalSources: fleet.externalSources,
949
961
  internalSources: fleet.internalSources,
950
962
  pipelines: fleet.pipelines,
963
+ tools: fleet.tools,
951
964
  };
952
965
  // サムネイル(デザイン画面等)をサイトに同梱し、ノードのパスをサイト内相対に書き換える
953
966
  await node_fs_1.promises.mkdir(outAbs, { recursive: true });
package/dist/render.js CHANGED
@@ -360,6 +360,11 @@ a.ds-name:hover { text-decoration: underline; }
360
360
  .ds-group > .ds-list { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--border); }
361
361
  .badge.ds-sum-ok { background: #e9f7ef; color: #1f7a45; }
362
362
  .badge.ds-sum-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
363
+ /* 未使用(非活性)行: アダプターとして存在するが、この案件では設定されていないもの */
364
+ .ds-card.ds-inactive, .ds-pipe.ds-inactive { background: #f8f9fa; border-style: dashed; box-shadow: none; }
365
+ .ds-inactive .ds-icon { filter: grayscale(1); opacity: .55; }
366
+ .ds-inactive .ds-type, .ds-inactive .ds-name, .ds-inactive a.ds-name, .ds-inactive .ds-pipe-label { color: #9ca3af; }
367
+ .ds-inactive-note { font-size: 12px; color: #9ca3af; line-height: 1.6; flex: 0 0 auto; }
363
368
  .ds-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
364
369
  .badge.ds-gold { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
365
370
  .badge.ds-excluded { background: #eceef1; color: #6b7280; }
@@ -735,10 +740,12 @@ const CLIENT_JS = `
735
740
  function renderDataSources() {
736
741
  var internals = SITE.internalSources || [];
737
742
  var sources = SITE.externalSources || [];
738
- // tools宣言上この案件の対象外(applicable: false)のパイプラインは載せない
739
- // (スキップ正常終了のrunが成功表示に見えるため)。フィールド無しは従来どおり表示する。
740
- var pipes = (SITE.pipelines || []).filter(function (p) { return p.applicable !== false; });
741
- if (!internals.length && !sources.length && !pipes.length) return; // すべて無ければセクションごと出さない
743
+ var pipes = SITE.pipelines || [];
744
+ // 能力→ツールの宣言(例: チャット: "none")。"none" の能力は「未使用」のグレー行で存在だけ見せる
745
+ var tools = SITE.tools || {};
746
+ var chatOff = tools["チャット"] === "none";
747
+ var devOff = tools["開発"] === "none";
748
+ if (!internals.length && !sources.length && !pipes.length && !chatOff && !devOff) return; // すべて無ければセクションごと出さない
742
749
 
743
750
  var sec = el("section", { class: "datasources" });
744
751
  sec.appendChild(el("h2", { class: "datasources-head", text: "データソースと自動化" }));
@@ -763,13 +770,18 @@ const CLIENT_JS = `
763
770
  if (s.driveSync === false) {
764
771
  col.appendChild(el("span", { class: "ds-drive-note", text: "Drive自動同期は未設定(手動で置いたファイルの変換のみ)" }));
765
772
  }
766
- var card = el("div", { class: "ds-card" }, [
773
+ // 未使用(enabled: false)はグレー行。アダプターの存在は見せつつ、この案件では設定されていないことを示す
774
+ var inactive = s.enabled === false;
775
+ if (inactive) {
776
+ col.appendChild(el("span", { class: "ds-inactive-note", text: "未使用(この案件では設定されていません)" }));
777
+ }
778
+ var card = el("div", { class: "ds-card" + (inactive ? " ds-inactive" : "") }, [
767
779
  el("div", { class: "ds-card-main" }, [
768
780
  el("span", { class: "ds-icon", text: DS_KIND_ICON[s.kind] || "📁" }),
769
781
  el("span", { class: "ds-type", text: s.kind || "" }),
770
782
  col,
771
783
  ]),
772
- s.lastSync && dsFmtTime(s.lastSync)
784
+ !inactive && s.lastSync && dsFmtTime(s.lastSync)
773
785
  ? el("span", { class: "ds-sync", text: "最終同期: " + dsFmtTime(s.lastSync) })
774
786
  : null,
775
787
  ]);
@@ -779,7 +791,7 @@ const CLIENT_JS = `
779
791
  sec.appendChild(el("p", { class: "ds-note", text: "これらの更新は毎晩の Gold 昇格が読み取ります。" }));
780
792
  }
781
793
 
782
- if (sources.length) {
794
+ if (sources.length || chatOff || devOff) {
783
795
  sec.appendChild(el("div", { class: "ds-sub", text: "外部ソース(ライブ参照)" }));
784
796
  // ツール(type)別にグループ化し、多いグループ(4件以上)は折りたたむ
785
797
  var groups = [];
@@ -791,6 +803,8 @@ const CLIENT_JS = `
791
803
  });
792
804
  var UNIT = { "slack": "チャンネル", "github-issues": "リポジトリ", "github-discussions": "リポジトリ" };
793
805
  var wrap = el("div", { class: "ds-list" });
806
+ // チャット未使用: Slackグループの位置(先頭)に「存在するが未設定」のグレー行を出す
807
+ if (chatOff) wrap.appendChild(inactiveSourceRow("💬", "チャット"));
794
808
  groups.forEach(function (g) {
795
809
  var meta = DS_TYPE[g.type] || { icon: "🔗", label: g.type || "その他" };
796
810
  var cards = el("div", { class: "ds-list" });
@@ -810,6 +824,8 @@ const CLIENT_JS = `
810
824
  while (cards.firstChild) wrap.appendChild(cards.firstChild);
811
825
  }
812
826
  });
827
+ // 開発未使用: GitHubグループの位置(末尾)にグレー行を出す
828
+ if (devOff) wrap.appendChild(inactiveSourceRow("🐙", "GitHub"));
813
829
  sec.appendChild(wrap);
814
830
  }
815
831
 
@@ -817,6 +833,15 @@ const CLIENT_JS = `
817
833
  sec.appendChild(el("div", { class: "ds-sub", text: "自動化パイプライン" }));
818
834
  var plist = el("div", { class: "ds-pipes" });
819
835
  pipes.forEach(function (p) {
836
+ // tools宣言上この案件の対象外(applicable: false)はグレー行。✅❌や最終成功は出さない
837
+ // (スキップ正常終了のrunが成功表示に見えるため)。存在自体は見せる
838
+ if (p.applicable === false) {
839
+ plist.appendChild(el("div", { class: "ds-pipe ds-inactive" }, [
840
+ el("span", { class: "ds-pipe-label", text: p.label || p.id || "" }),
841
+ el("span", { class: "ds-inactive-note", text: "未使用" }),
842
+ ]));
843
+ return;
844
+ }
820
845
  var t = p.lastSuccess ? dsFmtTime(p.lastSuccess) : "";
821
846
  var children = [];
822
847
  if (p.lastConclusion === "success") {
@@ -833,6 +858,17 @@ const CLIENT_JS = `
833
858
 
834
859
  app.appendChild(sec);
835
860
  }
861
+ // 未使用能力のプレースホルダ行(アダプターとして存在するが、この案件では設定されていないもの)
862
+ function inactiveSourceRow(icon, typeLabel) {
863
+ return el("div", { class: "ds-card ds-inactive" }, [
864
+ el("div", { class: "ds-card-main" }, [
865
+ el("span", { class: "ds-icon", text: icon }),
866
+ el("span", { class: "ds-type", text: typeLabel }),
867
+ el("span", { class: "ds-name", text: "未使用" }),
868
+ ]),
869
+ el("span", { class: "ds-inactive-note", text: "この案件では設定されていません" }),
870
+ ]);
871
+ }
836
872
  // 外部ソース1件のカード(グループ化表示・展開表示の両方から使う)
837
873
  function extSourceCard(s, meta) {
838
874
  var badges = el("div", { class: "ds-badges" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takagaki/cortex-decisions-viewer",
3
- "version": "0.4.23",
3
+ "version": "0.4.24",
4
4
  "description": "Cortexの意思決定記録(Decisions/*.md)を静的サイトにビルドして閲覧する。各レコードに「Edit on GitHub」リンクを付与する。",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,