codex-context-map 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,6 +8,8 @@ An offline visual debugger for `AGENTS.md` discovery, overrides, and byte limits
8
8
 
9
9
  [Live demo](https://han-1413141.github.io/codex-context-map/) · [简体中文](README.zh-CN.md) · [How it works](docs/semantics.md) · [Releases](https://github.com/Han-1413141/codex-context-map/releases)
10
10
 
11
+ [Share kit: demo links, screenshots and introductions](docs/share-kit.md)
12
+
11
13
  [![CI](https://github.com/Han-1413141/codex-context-map/actions/workflows/ci.yml/badge.svg)](https://github.com/Han-1413141/codex-context-map/actions/workflows/ci.yml)
12
14
  [![npm](https://img.shields.io/npm/v/codex-context-map)](https://www.npmjs.com/package/codex-context-map)
13
15
  ![Node](https://img.shields.io/badge/node-%3E%3D20-087f6b)
@@ -25,6 +27,10 @@ You added an instruction. Codex still behaves differently. Is the file outside t
25
27
 
26
28
  Open the **[interactive demo](https://han-1413141.github.io/codex-context-map/)** and click **Hidden override**, **Budget cutoff**, or **Empty override**. You can also open a project folder: the page processes instruction files on your device.
27
29
 
30
+ Jump straight to an example: **[Hidden override](https://han-1413141.github.io/codex-context-map/?scenario=override&lang=en)** · **[Budget cutoff](https://han-1413141.github.io/codex-context-map/?scenario=budget&lang=en)** · **[Empty override](https://han-1413141.github.io/codex-context-map/?scenario=empty&lang=en)**. Each preset has a share link containing only its fictional scenario and language.
31
+
32
+ New to instruction discovery? Read **[Why is Codex ignoring my AGENTS.md?](https://han-1413141.github.io/codex-context-map/why-codex-ignores-agents-md.html)** for a worked example of directory boundaries, overrides and byte cutoffs.
33
+
28
34
  Or inspect your repository with Node.js 20+:
29
35
 
30
36
  ```bash
package/README.zh-CN.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  [在线演示](https://han-1413141.github.io/codex-context-map/) · [English](README.md) · [解析规则](docs/semantics.md) · [下载版本](https://github.com/Han-1413141/codex-context-map/releases)
10
10
 
11
+ [分享素材:场景链接、截图与中英文介绍](docs/share-kit.md)
12
+
11
13
  [![CI](https://github.com/Han-1413141/codex-context-map/actions/workflows/ci.yml/badge.svg)](https://github.com/Han-1413141/codex-context-map/actions/workflows/ci.yml)
12
14
  [![npm](https://img.shields.io/npm/v/codex-context-map)](https://www.npmjs.com/package/codex-context-map)
13
15
  [![MIT](https://img.shields.io/badge/License-MIT-087f6b.svg)](LICENSE)
@@ -24,6 +26,10 @@
24
26
 
25
27
  打开 **[在线演示](https://han-1413141.github.io/codex-context-map/)**,点击右上角「中文」,体验「隐藏的覆盖」「超出长度预算」「空覆盖文件」。也可以打开自己的项目文件夹,指令内容只在当前设备处理。
26
28
 
29
+ 也可以直接打开中文场景:**[隐藏覆盖](https://han-1413141.github.io/codex-context-map/?scenario=override&lang=zh)** · **[字节截断](https://han-1413141.github.io/codex-context-map/?scenario=budget&lang=zh)** · **[空覆盖文件](https://han-1413141.github.io/codex-context-map/?scenario=empty&lang=zh)**。场景的分享链接只包含虚构场景名称和语言。
30
+
31
+ 初次了解加载规则?阅读 **[Codex 为什么没有遵循 AGENTS.md?](https://han-1413141.github.io/codex-context-map/zh/why-codex-ignores-agents-md.html)**,通过完整示例检查目录边界、覆盖关系与字节截断。
32
+
27
33
  使用 Node.js 20+ 在仓库中运行:
28
34
 
29
35
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-context-map",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "See which AGENTS.md files Codex discovers, what overrides what, and where instructions get cut off. Offline CLI + interactive map.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,9 @@
13
13
  "files": [
14
14
  "bin",
15
15
  "src",
16
- "site",
16
+ "site/app.js",
17
+ "site/style.css",
18
+ "site/template.html",
17
19
  "README.md",
18
20
  "README.zh-CN.md",
19
21
  "LICENSE"
package/site/app.js CHANGED
@@ -20,6 +20,8 @@ let compareTarget =
20
20
  let view = "map";
21
21
  let language = "en";
22
22
  let result;
23
+ const publicDemoUrl = "https://han-1413141.github.io/codex-context-map/";
24
+ const presets = new Set(["override", "budget", "empty"]);
23
25
  const english = Object.fromEntries(
24
26
  [...document.querySelectorAll("[data-i18n]")].map((el) => [
25
27
  el.dataset.i18n,
@@ -50,6 +52,10 @@ const chinese = {
50
52
  scenarioOverride: "01 · 隐藏的覆盖",
51
53
  scenarioBudget: "02 · 超出长度预算",
52
54
  scenarioEmpty: "03 · 空覆盖文件",
55
+ openDemoLink: "打开此演示链接 ↗",
56
+ copyDemoLink: "复制链接",
57
+ shareHint: "仅分享此虚构演示场景。",
58
+ guide: "AGENTS.md 不生效?查看排障指南 ↗",
53
59
  loaded: "贡献内容的文件",
54
60
  loadedHint: "按发现顺序排列",
55
61
  shadowed: "被遮盖的文件",
@@ -103,6 +109,8 @@ function applyLanguage() {
103
109
  ? (chinese[el.dataset.i18n] ?? english[el.dataset.i18n])
104
110
  : english[el.dataset.i18n];
105
111
  $("language").textContent = language === "zh" ? "EN" : "中文";
112
+ $("guide-link").href =
113
+ `${publicDemoUrl}${language === "zh" ? "zh/" : ""}why-codex-ignores-agents-md.html`;
106
114
  $("search").placeholder = say("Find a directory…", "搜索目录…");
107
115
  $("search").setAttribute("aria-label", say("Find a directory", "搜索目录"));
108
116
  $("budget").setAttribute(
@@ -290,6 +298,16 @@ function render() {
290
298
  ? say("DEMO WORKSPACE", "演示项目")
291
299
  : say("LOCAL SNAPSHOT", "本地快照");
292
300
  $("scenarios").hidden = !isDemo;
301
+ const preset = currentPreset();
302
+ $("demo-share").hidden = !preset;
303
+ $("demo-link").href = preset
304
+ ? `${publicDemoUrl}?scenario=${preset}&lang=${language}`
305
+ : publicDemoUrl;
306
+ for (const button of document.querySelectorAll("[data-scenario]"))
307
+ button.setAttribute(
308
+ "aria-pressed",
309
+ String(button.dataset.scenario === preset),
310
+ );
293
311
  $("current-path").innerHTML =
294
312
  `<span style="color:var(--muted)">${esc(snapshot.projectName)}</span>${
295
313
  target === "."
@@ -327,6 +345,24 @@ function render() {
327
345
  renderPreview();
328
346
  if (view === "compare") renderComparison();
329
347
  }
348
+ function currentPreset() {
349
+ if (!isDemo || view !== "map" || fallbackNames.join(",") !== "TEAM_GUIDE.md")
350
+ return null;
351
+ if (target === "tools/lab" && budget === DEFAULT_BUDGET) return "empty";
352
+ if (target === "services/payments") {
353
+ if (budget === 1024) return "budget";
354
+ if (budget === DEFAULT_BUDGET) return "override";
355
+ }
356
+ return null;
357
+ }
358
+ function selectPreset(preset) {
359
+ if (!isDemo || !presets.has(preset)) return;
360
+ target = preset === "empty" ? "tools/lab" : "services/payments";
361
+ budget = preset === "budget" ? 1024 : DEFAULT_BUDGET;
362
+ fallbackNames = [...createDemo().settings.fallbackNames];
363
+ $("search").value = "";
364
+ view = "map";
365
+ }
330
366
  function loadSnapshot(input, demo = false) {
331
367
  const validated = validateSnapshot(input);
332
368
  snapshot = validated;
@@ -508,11 +544,26 @@ $("apply-fallbacks").addEventListener("click", () => {
508
544
  $("scenarios").addEventListener("click", (event) => {
509
545
  const scenario = event.target.closest("[data-scenario]")?.dataset.scenario;
510
546
  if (!scenario) return;
511
- target = scenario === "empty" ? "tools/lab" : "services/payments";
512
- budget = scenario === "budget" ? 1024 : DEFAULT_BUDGET;
513
- view = "map";
547
+ selectPreset(scenario);
514
548
  render();
515
549
  });
550
+ $("copy-demo-link").addEventListener("click", async () => {
551
+ if (!currentPreset()) return;
552
+ const url = $("demo-link").href;
553
+ try {
554
+ await navigator.clipboard.writeText(url);
555
+ announce(
556
+ say(
557
+ "Demo link copied. It contains only the fictional scenario and language.",
558
+ "演示链接已复制,仅包含虚构场景和语言。",
559
+ ),
560
+ );
561
+ } catch {
562
+ announce(
563
+ say(`Copy this demo link: ${url}`, `请手动复制此演示链接:${url}`),
564
+ );
565
+ }
566
+ });
516
567
  $("map-view").addEventListener("click", () => {
517
568
  view = "map";
518
569
  render();
@@ -577,5 +628,8 @@ $("json-input").addEventListener("change", async (event) => {
577
628
  event.target.value = "";
578
629
  }
579
630
  });
631
+ const incoming = new URLSearchParams(location.search);
632
+ if (incoming.get("lang") === "zh") language = "zh";
633
+ if (initialData.demo) selectPreset(incoming.get("scenario"));
580
634
  applyLanguage();
581
635
  render();
package/site/style.css CHANGED
@@ -511,6 +511,25 @@ h2 {
511
511
  border-color: #89b9a6;
512
512
  background: var(--accent-soft);
513
513
  }
514
+ .scenarios button[aria-pressed="true"] {
515
+ border-color: #478b72;
516
+ color: #24694e;
517
+ background: var(--accent-soft);
518
+ }
519
+ .demo-share {
520
+ display: flex;
521
+ flex-wrap: wrap;
522
+ align-items: center;
523
+ gap: 12px;
524
+ margin: -7px 0 20px;
525
+ font-size: 11px;
526
+ }
527
+ .demo-share a {
528
+ color: #24694e;
529
+ }
530
+ .demo-share span {
531
+ color: var(--muted);
532
+ }
514
533
  .metrics {
515
534
  display: grid;
516
535
  grid-template-columns: 1fr 1fr 1.7fr;
@@ -12,6 +12,7 @@
12
12
  content="An offline visual debugger for Codex AGENTS.md discovery. Explore instruction inheritance, hidden overrides, byte limits, and directory differences. No account or API key."
13
13
  />
14
14
  <meta name="theme-color" content="#f7f9f8" />
15
+ <!-- PUBLIC METADATA -->
15
16
  <meta
16
17
  property="og:title"
17
18
  content="Codex Context Map — Know what your agent reads"
@@ -155,6 +156,26 @@
155
156
  03 · Empty override
156
157
  </button>
157
158
  </div>
159
+ <div id="demo-share" class="demo-share" hidden>
160
+ <a
161
+ id="demo-link"
162
+ href="https://han-1413141.github.io/codex-context-map/"
163
+ target="_blank"
164
+ rel="noopener noreferrer"
165
+ data-i18n="openDemoLink"
166
+ >Open this demo link ↗</a
167
+ >
168
+ <button
169
+ id="copy-demo-link"
170
+ class="text-button"
171
+ data-i18n="copyDemoLink"
172
+ >
173
+ Copy link
174
+ </button>
175
+ <span data-i18n="shareHint"
176
+ >Shares this fictional scenario only.</span
177
+ >
178
+ </div>
158
179
  <div class="metrics">
159
180
  <div>
160
181
  <span data-i18n="loaded">FILES CONTRIBUTING</span
@@ -293,6 +314,11 @@
293
314
  <span data-i18n="independent"
294
315
  >Independent project. Not affiliated with OpenAI.</span
295
316
  ></span
317
+ ><a
318
+ id="guide-link"
319
+ href="https://han-1413141.github.io/codex-context-map/why-codex-ignores-agents-md.html"
320
+ data-i18n="guide"
321
+ >AGENTS.md troubleshooting guide ↗</a
296
322
  ><a
297
323
  href="https://github.com/Han-1413141/codex-context-map/issues"
298
324
  target="_blank"
package/src/report.js CHANGED
@@ -19,7 +19,22 @@ export async function renderReport(snapshot, { demo = false } = {}) {
19
19
  .replace(/\u2028/g, "\\u2028")
20
20
  .replace(/\u2029/g, "\\u2029");
21
21
  const script = `${moduleBody(core)}\n${moduleBody(demoSource)}\nconst initialData = ${data};\n${app}`;
22
+ const publicMetadata = demo
23
+ ? `<link rel="canonical" href="https://han-1413141.github.io/codex-context-map/" />
24
+ <meta property="og:type" content="website" />
25
+ <meta property="og:site_name" content="Codex Context Map" />
26
+ <meta property="og:url" content="https://han-1413141.github.io/codex-context-map/" />
27
+ <meta property="og:image" content="https://han-1413141.github.io/codex-context-map/assets/social-preview.png" />
28
+ <meta property="og:image:width" content="1280" />
29
+ <meta property="og:image:height" content="640" />
30
+ <meta property="og:image:alt" content="Codex Context Map: AGENTS.md discovery, overrides and byte cutoffs, illustrated with fictional demo data." />
31
+ <meta name="twitter:card" content="summary_large_image" />
32
+ <meta name="twitter:title" content="Codex Context Map — Know what your agent reads" />
33
+ <meta name="twitter:description" content="An offline AGENTS.md discovery debugger. Try three fictional scenarios without an account or API key." />
34
+ <meta name="twitter:image" content="https://han-1413141.github.io/codex-context-map/assets/social-preview.png" />`
35
+ : '<meta name="robots" content="noindex, nofollow, noarchive" />';
22
36
  return template
37
+ .replace("<!-- PUBLIC METADATA -->", () => publicMetadata)
23
38
  .replace("/* STYLE */", () => css)
24
39
  .replace("/* SCRIPT */", () => script);
25
40
  }