@babylonjs-toolkit/agent 1.1.82 → 1.1.84

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
@@ -1,4 +1,4 @@
1
- # Babylon Toolkit Desktop Agent (1.1.82)
1
+ # Babylon Toolkit Desktop Agent (1.1.84)
2
2
 
3
3
  The desktop agent owns the entire pipeline end to end — frontend and UI design, gameplay code, shaders, generated art and audio, 3D models in headless Blender, whole game levels and prefabs in a terminal-driven Unity Editor, the interactive glTF export, the web build, the dev server, and visual QA by screenshotting both Unity and the running browser.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs-toolkit/agent",
3
- "version": "1.1.82",
3
+ "version": "1.1.84",
4
4
  "description": "Installs the Babylon Toolkit Desktop Agent for Claude Code, Codex, GitHub Copilot, Gemini CLI and Antigravity.",
5
5
  "keywords": [
6
6
  "babylonjs",
@@ -161,6 +161,9 @@
161
161
  .chip-warning { border-color: var(--failed); color: var(--failed); background: var(--failed-soft); }
162
162
  .chip-warning strong { color: var(--failed); }
163
163
  .doc-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
164
+ a.file-link { text-decoration: none; }
165
+ a.file-link code { color: var(--accent); }
166
+ a.file-link:hover code { text-decoration: underline; }
164
167
  .doc-links a {
165
168
  display: inline-flex;
166
169
  gap: 6px;
@@ -936,7 +939,7 @@
936
939
 
937
940
  const view = pageView();
938
941
  // Stat tiles and phase bars first; then one slot that follows the run: Current run activity while it runs,
939
- // the After action report section once it is over.
942
+ // the Execution debrief section (the After Action Report) once it is over.
940
943
  appRoot.innerHTML = [
941
944
  renderMasthead(feature, allTasks.length, doneCount),
942
945
  renderNav(allUpdates.length, view),
@@ -1119,7 +1122,7 @@
1119
1122
  body = `
1120
1123
  <article class="card after-action">
1121
1124
  <div class="after-action-head">
1122
- <span class="kicker">Plan Execution Debrief${afterAction.writtenAt ? ` <span>· ${escapeHtml(afterAction.writtenAt)}</span>` : ''}</span>
1125
+ <span class="kicker">After Action Report${afterAction.writtenAt ? ` <span>· ${escapeHtml(afterAction.writtenAt)}</span>` : ''}</span>
1123
1126
  <span class="meta">${snapshotBadge([...(comparison && comparison.before && comparison.after ? [comparison] : []), ...(afterAction.snapshots || [])])}${isFinal ? '' :'<span class="status status-in-progress">Interim — plan not finished</span>'}${updatedBadge(afterAction.updates)}</span>
1124
1127
  </div>
1125
1128
  ${afterAction.headline ? `<h3 class="headline">${formatInline(afterAction.headline)}</h3>` : ''}
@@ -1140,7 +1143,7 @@
1140
1143
  }
1141
1144
  return `
1142
1145
  <section id="after-action">
1143
- <div class="section-head"><h2>After action report</h2><span class="section-note">The whole plan's execution, start to finish</span></div>
1146
+ <div class="section-head"><h2>Execution debrief</h2><span class="section-note">The whole plan's execution, start to finish</span></div>
1144
1147
  ${body}
1145
1148
  </section>`;
1146
1149
  }
@@ -1426,7 +1429,7 @@
1426
1429
  hasTests(task)
1427
1430
  ? `<span class="count count-pass">${escapeHtml(tests.passed ?? 0)} passed</span>${Number(tests.failed) ? `<div class="count count-fail">${escapeHtml(tests.failed)} failed</div>` : ''}`
1428
1431
  : `<span class="cell-note" title="${escapeAttribute(tests.note || '')}">${tests.note ? escapeHtml(tests.note) : '—'}</span>`,
1429
- (tests.files || []).length ? tests.files.map((file) => `<code>${escapeHtml(file)}</code>`).join('<br>') : '—',
1432
+ (tests.files || []).length ? tests.files.map(fileLink).join('<br>') : '—',
1430
1433
  cases.length ? `${cases.length}${casesFailed ? `<div class="count count-fail">${casesFailed} failed</div>` : ''}` : '—',
1431
1434
  hasLiveCheck(task) ? `<span title="${escapeAttribute(liveCheckNote(task))}">Yes</span>` : '—',
1432
1435
  ];
@@ -1526,7 +1529,7 @@
1526
1529
  tests.passed != null ? `${escapeHtml(tests.passed)} passed` : '',
1527
1530
  tests.failed ? `${escapeHtml(tests.failed)} failed` : '',
1528
1531
  ].filter(Boolean).join(' · ');
1529
- const files = (tests.files || []).map((file) => `<code>${escapeHtml(file)}</code>`).join(' ');
1532
+ const files = (tests.files || []).map(fileLink).join(' ');
1530
1533
  const note = tests.note ? formatInline(tests.note) : '';
1531
1534
  return [counts, files, note].filter(Boolean).join('<br>');
1532
1535
  }
@@ -2057,6 +2060,38 @@
2057
2060
  return /^[a-z][a-z0-9+.-]*:/i.test(value) && !/^https?:/i.test(value) ? '#' : value;
2058
2061
  }
2059
2062
 
2063
+ /**
2064
+ * Where a recorded file path opens from this page. A path inside this feature's folder
2065
+ * (`.agents/specs/<slug>/tests/…`, or `tests/…`) opens relative to the page, so the link survives the folder being
2066
+ * moved to `.agents/archive/`. Any other project path opens from the project root: the part of this page's address
2067
+ * before `/.agents/`.
2068
+ */
2069
+ function fileHref(file) {
2070
+ const value = String(file || '').trim().replace(/^\.\//, '');
2071
+ if (!value) return '#';
2072
+ if (/^[a-z][a-z0-9+.-]*:/i.test(value)) return cleanUrl(value);
2073
+ if (value.startsWith('/')) return `file://${value}`;
2074
+ const slug = report.feature && report.feature.slug;
2075
+ const ownFolder = /^\.agents\/(?:archive\/)?specs\/([^/]+)\//.exec(value);
2076
+ if (ownFolder && (!slug || ownFolder[1] === slug)) return value.slice(ownFolder[0].length);
2077
+ if (/^(?:tests|documents|snapshots|recon)\//.test(value)) return value;
2078
+ const here = location.href.split(/[?#]/)[0];
2079
+ const agents = here.indexOf('/.agents/');
2080
+ return agents >= 0 ? here.slice(0, agents + 1) + value : `../../../${value}`;
2081
+ }
2082
+
2083
+ /**
2084
+ * A recorded test file as a link that opens it in a new tab (a browser shows .js, .mjs, .json, .py, .cs as text).
2085
+ * A note after the path — `run-karting-tests.js (99)` — stays in the text but not in the link. An entry that is not
2086
+ * a path at all (`BtMarioKartWeb npm test (178)`, `$WEB tests (vitest)`) stays plain text rather than a dead link.
2087
+ */
2088
+ function fileLink(file) {
2089
+ const text = String(file || '');
2090
+ const target = text.trim().replace(/\s+\([^()]*\)\s*$/, '');
2091
+ if (!/^[^\s$]+\.[a-z0-9]+$/i.test(target)) return `<code>${escapeHtml(text)}</code>`;
2092
+ return `<a class="file-link" href="${escapeAttribute(fileHref(target))}" target="_blank" rel="noopener" title="Open ${escapeAttribute(target)}"><code>${escapeHtml(text)}</code></a>`;
2093
+ }
2094
+
2060
2095
  /** `cleanUrl`, escaped for use inside an HTML attribute. */
2061
2096
  function safeUrl(url) {
2062
2097
  return escapeAttribute(cleanUrl(url));
@@ -77,7 +77,7 @@ instead of a blank page if something still cannot render — it keeps checking a
77
77
  - A task added to the plan after it was complete is added here as `pending`, in plan order, with an `updates`
78
78
  note saying why — and `complete` becomes `paused`.
79
79
  - The status picks the page's top slot: `specified` shows *Plan this feature* (the `bt-plan` commands to copy, and a builder for its options and a brief); `planned` shows *Start this plan* (the `bt-execute` commands, and a builder for any task range and its options); `in-progress` shows *Current run activity* (the live file and the
80
- milestones); `paused`, `complete` and `incomplete` show *After action report* (the After Action Report, in its *Plan Execution Debrief* card, marked
80
+ milestones); `paused`, `complete` and `incomplete` show *Execution debrief* (the After Action Report card, marked
81
81
  *Interim* while paused), with *Continue this plan* — the commands that pick up where it stopped — above it.
82
82
  - **Cadence is per task.** A task's entry changes the moment it starts (`in-progress`), the moment it is built
83
83
  (`built` — summary, files, tests and snapshots filled in right then), while the verifier checks it
@@ -153,7 +153,7 @@ Each task:
153
153
  | `status` | see *Status* |
154
154
  | `summary` | what was actually done, and anything surprising |
155
155
  | `files` | paths changed |
156
- | `tests` | `{ "passed", "failed", "files": [".agents/specs/<slug>/tests/…"], "note" }` or `null` |
156
+ | `tests` | `{ "passed", "failed", "files": [".agents/specs/<slug>/tests/…"], "note" }` or `null`. `files` holds **paths only**, each from the project root (a test outside the feature folder: its real path, e.g. `BtMarioKartWeb/tests/RaceConfig.test.ts`), because the page links each one to the file. Counts, suite names and commands go in `note` |
157
157
  | `verifier` | `"PASS — independent subagent; live check in Chrome"` |
158
158
  | `checkedLive` | every run, not only `--verbose`: one line on what the verifier ran live and where — `"two-tab Shared race in headless Chrome, 150 ms lag"`; `""` when it was proven by tests alone. The page's *live check* badge and column read it (a task the plan marked `live` always counts) |
159
159
  | `attempts`, `commit`, `doneAt` | as recorded |
@@ -701,7 +701,11 @@ function shotsFrom(dir, reportDir) {
701
701
 
702
702
  /** Lowercase kebab-case, `a-z 0-9 -` only, at most 40 characters — bt-recon's slug rule. */
703
703
  function kebab(text) {
704
- return String(text || "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40).replace(/-+$/g, "");
704
+ const slug = String(text || "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
705
+ if (slug.length <= 40) return slug;
706
+ // Cut at the last whole word that fits, so a long title never ends mid-word.
707
+ const cut = slug.slice(0, 41);
708
+ return (cut.lastIndexOf("-") > 0 ? cut.slice(0, cut.lastIndexOf("-")) : slug.slice(0, 40)).replace(/-+$/g, "");
705
709
  }
706
710
 
707
711
  /** Reads a recon doc's depth from its header (`depth: quick`); a recon written before the field existed is deep. */