synabun 2.4.4 → 2.4.6

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 (129) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/docs/browser-extension-bridge.md +5 -4
  4. package/docs/whatsapp.md +19 -3
  5. package/hooks/claude-code/session-start.mjs +21 -18
  6. package/lib/claude-global-config.js +214 -0
  7. package/lib/client-config-repair.js +17 -3
  8. package/mcp-server/dist/index.d.ts.map +1 -1
  9. package/mcp-server/dist/index.js +6 -1
  10. package/mcp-server/dist/index.js.map +1 -1
  11. package/mcp-server/dist/services/neural-interface.d.ts +1 -0
  12. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  13. package/mcp-server/dist/services/neural-interface.js +1 -0
  14. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  15. package/mcp-server/dist/services/tool-catalog.js +1 -1
  16. package/mcp-server/dist/services/tool-catalog.js.map +1 -1
  17. package/mcp-server/dist/tools/agents.d.ts +18 -3
  18. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  19. package/mcp-server/dist/tools/agents.js +85 -16
  20. package/mcp-server/dist/tools/agents.js.map +1 -1
  21. package/mcp-server/dist/tools/skill-tools.d.ts +24 -5
  22. package/mcp-server/dist/tools/skill-tools.d.ts.map +1 -1
  23. package/mcp-server/dist/tools/skill-tools.js +88 -8
  24. package/mcp-server/dist/tools/skill-tools.js.map +1 -1
  25. package/mcp-server/dist/tools/tool-groups.d.ts.map +1 -1
  26. package/mcp-server/dist/tools/tool-groups.js +19 -4
  27. package/mcp-server/dist/tools/tool-groups.js.map +1 -1
  28. package/mcp-server/package-lock.json +2 -2
  29. package/mcp-server/package.json +1 -1
  30. package/mcp-server/src/index.ts +6 -1
  31. package/mcp-server/src/services/neural-interface.ts +2 -1
  32. package/mcp-server/src/services/tool-catalog.ts +1 -1
  33. package/mcp-server/src/tools/agents.ts +78 -16
  34. package/mcp-server/src/tools/skill-tools.ts +82 -9
  35. package/mcp-server/src/tools/tool-groups.ts +19 -4
  36. package/neural-interface/i18n/en.json +484 -19
  37. package/neural-interface/i18n/pt-BR.json +484 -19
  38. package/neural-interface/lib/agents-studio-api.js +7 -2
  39. package/neural-interface/lib/antigravity/home.js +43 -8
  40. package/neural-interface/lib/antigravity/panel-bridge.js +7 -3
  41. package/neural-interface/lib/antigravity/tool-call.js +14 -0
  42. package/neural-interface/lib/assistant-brains/antigravity.js +4 -2
  43. package/neural-interface/lib/assistant-dispatch.js +15 -1
  44. package/neural-interface/lib/assistant-persona.js +8 -3
  45. package/neural-interface/lib/assistant-route-gate.js +11 -2
  46. package/neural-interface/lib/assistant-runtime.js +95 -13
  47. package/neural-interface/lib/assistant-spilled-output.js +53 -0
  48. package/neural-interface/lib/assistant-user-context.js +7 -3
  49. package/neural-interface/lib/browser-default.js +22 -2
  50. package/neural-interface/lib/browser-extension-bridge.js +50 -3
  51. package/neural-interface/lib/browser-extension-pin.json +7 -7
  52. package/neural-interface/lib/browser-extension-protocol.js +30 -1
  53. package/neural-interface/lib/browser-extension-setup.js +204 -36
  54. package/neural-interface/lib/claude-agent-bridge.js +13 -2
  55. package/neural-interface/lib/codex-thread-history.js +144 -7
  56. package/neural-interface/lib/codex-worker-app-server.js +84 -30
  57. package/neural-interface/lib/db.js +26 -0
  58. package/neural-interface/lib/greeting/sources.js +7 -3
  59. package/neural-interface/lib/jsonl-lines.js +10 -11
  60. package/neural-interface/lib/line-buffer.js +88 -0
  61. package/neural-interface/lib/loop-stall.js +15 -1
  62. package/neural-interface/lib/memory-list-read.js +105 -0
  63. package/neural-interface/lib/memory-timers.js +4 -1
  64. package/neural-interface/lib/native-loop-runtime.js +7 -3
  65. package/neural-interface/lib/provider-panel-api-key-auth.js +33 -6
  66. package/neural-interface/lib/remote-policy.js +24 -7
  67. package/neural-interface/lib/skills/api-v2.js +18 -3
  68. package/neural-interface/lib/skills/bundle.js +2 -2
  69. package/neural-interface/lib/skills/deploy.js +169 -34
  70. package/neural-interface/lib/skills/digest.js +57 -3
  71. package/neural-interface/lib/skills/health.js +55 -1
  72. package/neural-interface/lib/skills/known-bridge-digests.json +12 -0
  73. package/neural-interface/lib/skills/runtime-checks.js +7 -4
  74. package/neural-interface/lib/skills/scan-shell.js +56 -7
  75. package/neural-interface/lib/skills/scan.js +13 -12
  76. package/neural-interface/lib/skills/service.js +7 -2
  77. package/neural-interface/lib/skills/telemetry.js +2 -2
  78. package/neural-interface/lib/teams/README.md +34 -6
  79. package/neural-interface/lib/teams/api.js +94 -10
  80. package/neural-interface/lib/teams/index.js +4 -0
  81. package/neural-interface/lib/teams/landing.js +195 -75
  82. package/neural-interface/lib/teams/recovery.js +68 -0
  83. package/neural-interface/lib/teams/scheduler.js +380 -61
  84. package/neural-interface/lib/teams/worktrees.js +123 -30
  85. package/neural-interface/lib/terminal-token-redaction.js +228 -58
  86. package/neural-interface/lib/terminal-tokens.js +18 -0
  87. package/neural-interface/lib/whatsapp/brain.js +21 -0
  88. package/neural-interface/lib/whatsapp/bridge.js +40 -4
  89. package/neural-interface/package-lock.json +2 -2
  90. package/neural-interface/package.json +1 -1
  91. package/neural-interface/public/extension-setup.html +6 -2
  92. package/neural-interface/public/index.html +117 -37
  93. package/neural-interface/public/shared/agents/studio/ax-api.js +27 -0
  94. package/neural-interface/public/shared/agents/studio/ax-create-view.js +1 -1
  95. package/neural-interface/public/shared/agents/studio/ax-icons.js +1 -0
  96. package/neural-interface/public/shared/agents/studio/ax-library-view.js +3 -2
  97. package/neural-interface/public/shared/agents/studio/ax-main.js +127 -41
  98. package/neural-interface/public/shared/agents/studio/ax-review-view.js +3 -2
  99. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +436 -33
  100. package/neural-interface/public/shared/agents/studio/ax-teams.js +357 -10
  101. package/neural-interface/public/shared/agents/studio/ax-ui.js +31 -0
  102. package/neural-interface/public/shared/agents/studio/ax-views.js +67 -69
  103. package/neural-interface/public/shared/agents/studio/ax-work-answer.js +86 -0
  104. package/neural-interface/public/shared/agents/studio/ax-work-view.js +305 -0
  105. package/neural-interface/public/shared/agents/studio/ax-work.css +74 -0
  106. package/neural-interface/public/shared/agents/studio/ax-work.js +300 -0
  107. package/neural-interface/public/shared/browser-extension-updates.js +3 -1
  108. package/neural-interface/public/shared/cdx/cdx-deferred.js +90 -0
  109. package/neural-interface/public/shared/cdx/cdx-render.js +18 -7
  110. package/neural-interface/public/shared/cdx/cdx-tabs.js +2 -1
  111. package/neural-interface/public/shared/extension-setup/es-page.js +23 -4
  112. package/neural-interface/public/shared/extension-setup/es-view.js +51 -11
  113. package/neural-interface/public/shared/extension-update-view.js +1 -1
  114. package/neural-interface/public/shared/loading-diagnostic-entry.js +16 -1
  115. package/neural-interface/public/shared/settings/settings-ai-browser.js +23 -3
  116. package/neural-interface/public/shared/settings/settings-browser-extension.js +575 -197
  117. package/neural-interface/public/shared/settings/settings-extension-diagrams.js +116 -0
  118. package/neural-interface/public/shared/settings/settings-extension-guide.js +222 -0
  119. package/neural-interface/public/shared/settings/settings-ia.js +2 -2
  120. package/neural-interface/public/shared/settings/settings-shell.js +5 -0
  121. package/neural-interface/public/shared/skills/studio/sx-operations-view.js +5 -0
  122. package/neural-interface/public/shared/skills/studio/sx-plan.js +42 -3
  123. package/neural-interface/public/shared/skills/studio/sx-publish-view.js +20 -4
  124. package/neural-interface/public/shared/styles.css +196 -13
  125. package/neural-interface/public/shared/ui-settings.js +48 -11
  126. package/neural-interface/server.js +336 -253
  127. package/npm-shrinkwrap.json +2 -2
  128. package/package.json +2 -1
  129. package/skills/skill-forge/SKILL.md +7 -3
@@ -0,0 +1,116 @@
1
+ // The guide's close-ups of a browser's Extensions page (Settings → Browser → the extension's setup guide): original
2
+ // vector drawings of the one control each step asks for, with a ring and a leader to it and its name beside it. They are
3
+ // a picture of where to look, never the instruction itself: every step says the same in HTML outside the drawing, and
4
+ // each figure carries its own caption. No imports, no DOM: node --test reads the markup.
5
+ //
6
+ // Placement is drawn only where it is known: Developer mode sits at the top right of the Extensions header in Chrome,
7
+ // Brave, Arc, Vivaldi and Chromium, and in the left sidebar in Edge. Any other browser gets the switch by its label,
8
+ // with a caption that says the picture is a Chrome-style example (developerLayout, settings-extension-guide.js).
9
+ // Colours are classes (styles.css → "browser-extension-guide"), so the drawing follows Settings' tokens.
10
+ import { developerLayout } from './settings-extension-guide.js';
11
+
12
+ const esc = s => String(s ?? '').replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
13
+ const rect = (x, y, w, h, cls, r = 6) => `<rect x="${x}" y="${y}" width="${w}" height="${h}" rx="${r}" class="${cls}"/>`;
14
+ const text = (x, y, value, size, cls = 'bg-t', anchor = 'start') => `<text x="${x}" y="${y}" font-size="${size}" class="${cls}"${anchor !== 'start' ? ` text-anchor="${anchor}"` : ''}>${esc(value)}</text>`;
15
+ const line = (d, cls = 'bg-ln') => `<path d="${d}" class="${cls}"/>`;
16
+ const toggle = (x, y) => `${rect(x, y, 40, 22, 'bg-track', 11)}<circle cx="${x + 29}" cy="${y + 11}" r="8" class="bg-knob"/>`;
17
+ const ring = (x, y, w, h) => `${rect(x, y, w, h, 'bg-halo', 8)}${rect(x, y, w, h, 'bg-ring', 8)}`;
18
+ // A label's width in the drawing, from its length (a little wider than the panel's fonts set it): translations run
19
+ // longer than English, and the boxes grow with them.
20
+ const textWidth = (value, size) => Math.round(String(value).length * size * 0.56);
21
+ const width = (value, size, pad = 24, max = 220) => Math.min(max, textWidth(value, size) + pad);
22
+ const button = (x, y, value, size = 12) => { const w = width(value, size); return { w, svg: `${rect(x, y, w, 27, 'bg-panel', 6)}${text(x + 12, y + 18, value, size)}` }; };
23
+ // The largest size, from `size` down to 10, at which `value` fits in `room`; past that it is squeezed into `room`
24
+ // (SVG textLength), never drawn wider.
25
+ const fitText = (value, size, room) => {
26
+ let s = size; while (s > 10 && textWidth(value, s) > room) s -= 0.5;
27
+ const w = textWidth(value, s);
28
+ return w > room ? { size: s, w: room, squeeze: true } : { size: s, w, squeeze: false };
29
+ };
30
+
31
+ // The Developer mode label where developerGeometry put it (squeezed to its width when even 10 px is too wide).
32
+ const devText = (at, value) => `<text x="${at.x}" y="${at.y}" font-size="${at.size}" class="bg-t"${at.squeeze ? ` textLength="${at.w}" lengthAdjust="spacingAndGlyphs"` : ''}>${esc(value)}</text>`;
33
+
34
+ /** The switch's track: TOGGLE_W wide. */
35
+ export const TOGGLE_W = 40;
36
+ /**
37
+ * Where the Developer mode label, its switch and the ring around both go (Step 2's drawing), from the label's own
38
+ * width: the switch always after the label with a gap, the ring around both with the same margin on each side. In
39
+ * Edge's sidebar the sidebar grows with the label (to SIDEBAR_MAX), and the divider and the installed-extensions panel
40
+ * move right with it; in the Chrome-style header the label grows to the left of the switch. All in viewBox units
41
+ * (520 × 166). Pure: the tests check that nothing overlaps in any locale.
42
+ */
43
+ export const SIDEBAR_MAX = 262;
44
+ export function developerGeometry(layout, label) {
45
+ const gap = 16;
46
+ if (layout === 'sidebar') {
47
+ const textX = 28, toggleY = 90, toggleMax = SIDEBAR_MAX - 14 - TOGGLE_W;
48
+ const fit = fitText(label, 13, toggleMax - gap - textX), textW = fit.w;
49
+ const toggleX = Math.max(146, textX + textW + gap), toggleEnd = toggleX + TOGGLE_W;
50
+ const ring = { x: textX - 8, y: 82, w: toggleEnd + 8 - (textX - 8), h: 39 };
51
+ const sideEnd = Math.max(208, toggleEnd + 14);
52
+ const panelX = sideEnd + 18;
53
+ return { layout, text: { x: textX, y: 106, w: textW, size: fit.size, squeeze: fit.squeeze }, toggle: { x: toggleX, y: toggleY, w: TOGGLE_W }, ring, sideEnd, panel: { x: panelX, w: 479 - panelX } };
54
+ }
55
+ const toggleX = 444, toggleEnd = toggleX + TOGGLE_W, pad = 10;
56
+ // The label may grow left up to the page title's end ("Extensions", 18px, at x 32) with room to spare.
57
+ const fit = fitText(label, 13, toggleX - gap - 160), textW = fit.w, textX = toggleX - gap - textW;
58
+ return { layout, text: { x: textX, y: 49, w: textW, size: fit.size, squeeze: fit.squeeze }, toggle: { x: toggleX, y: 33, w: TOGGLE_W }, ring: { x: textX - pad, y: 25, w: toggleEnd + pad - (textX - pad), h: 38 }, header: { x: 15, w: 490 } };
59
+ }
60
+
61
+ /**
62
+ * The figure for a guide step (2 Developer mode, 3 Load unpacked, 5 Details, 6 Allow user scripts), or null for a step
63
+ * without one. `t(key)` gives the translated string of browserExtension.guide.<key> (unescaped); `browser`: { id, name }.
64
+ * Returns { html, layout }: the <figure> with its header, drawing and caption.
65
+ */
66
+ export function guideFigure(step, { browser, address = '', t }) {
67
+ const id = browser?.id || '', name = browser?.name || '';
68
+ const ui = key => t(`ui.${key}`);
69
+ let art = '', caption = '', label = '', layout = '';
70
+ if (step === 2) {
71
+ layout = developerLayout(id);
72
+ const dev = ui('developerMode');
73
+ const geo = developerGeometry(layout === 'sidebar' ? 'sidebar' : 'header', dev), r = geo.ring;
74
+ if (layout === 'sidebar') {
75
+ const side = geo.sideEnd, panel = geo.panel;
76
+ art = rect(14, 12, 492, 128, 'bg-frame', 8) + rect(15, 13, side - 15, 126, 'bg-surface', 7) + line(`M${side} 13v126`) + text(28, 38, ui('extensions'), 16, 'bg-t bg-strong')
77
+ + text(28, 63, ui('manage'), 12, 'bg-t bg-muted') + line(`M28 77h${side - 46}`) + devText(geo.text, dev) + toggle(geo.toggle.x, geo.toggle.y) + ring(r.x, r.y, r.w, r.h)
78
+ + text(panel.x, 40, ui('installed'), 15) + rect(panel.x, 54, panel.w, 56, 'bg-surface', 6) + text(panel.x + 14, 86, ui('bridgeName'), 13, 'bg-t bg-muted')
79
+ + line('M108 123v28h60', 'bg-lead') + text(176, 156, t('figDeveloperCall'), 13, 'bg-t bg-call');
80
+ caption = t('figDeveloperEdge'); label = t('figDeveloperEdgeName');
81
+ } else {
82
+ art = rect(14, 17, 492, 109, 'bg-frame', 8) + rect(15, 18, 490, 50, 'bg-surface', 7) + line('M15 68h490') + text(32, 49, ui('extensions'), 18, 'bg-t bg-strong')
83
+ + devText(geo.text, dev) + toggle(geo.toggle.x, geo.toggle.y) + ring(r.x, r.y, r.w, r.h) + text(32, 100, ui('mine'), 14, 'bg-t bg-muted')
84
+ + line('M414 65v64l-11 12h-52', 'bg-lead') + text(345, 146, t('figDeveloperCall'), 14, 'bg-t bg-call', 'end');
85
+ caption = layout === 'header' ? t('figDeveloperHeader', { browser: name }) : t('figDeveloperUnverified', { browser: name });
86
+ label = t('figDeveloperName');
87
+ }
88
+ } else if (step === 3) {
89
+ const load = button(33, 74, ui('loadUnpacked')), pack = button(33 + load.w + 12, 74, ui('pack')), update = button(33 + load.w + pack.w + 24, 74, ui('update'));
90
+ art = rect(14, 15, 492, 113, 'bg-frame', 8) + text(32, 47, ui('extensions'), 18, 'bg-t bg-strong') + text(445, 45, ui('developerMode'), 12, 'bg-t bg-muted', 'end')
91
+ + rect(457, 32, 29, 16, 'bg-on', 8) + '<circle cx="478" cy="40" r="6" class="bg-knob-off"/>' + line('M15 58h490')
92
+ + load.svg + (33 + load.w + pack.w + 24 + update.w < 500 ? pack.svg + update.svg : '') + ring(28, 68, load.w + 10, 39)
93
+ + line(`M${33 + Math.round(load.w / 2)} 109v32h${Math.max(20, 122 - Math.round(load.w / 2))}`, 'bg-lead') + text(160, 146, t('figLoadCall'), 14, 'bg-t bg-call');
94
+ caption = t('figLoad'); label = t('figLoadName');
95
+ } else if (step === 5) {
96
+ const details = button(44, 85, ui('details')), remove = button(44 + details.w + 14, 85, ui('remove'));
97
+ art = rect(25, 12, 471, 119, 'bg-surface', 9) + rect(42, 28, 42, 42, 'bg-frame', 8) + '<path d="M52 44h22M52 54h22" class="bg-mark"/>'
98
+ + text(99, 45, ui('bridgeName'), 17, 'bg-t bg-strong') + text(99, 64, ui('bridgeMeta'), 12, 'bg-t bg-muted') + details.svg + remove.svg
99
+ + rect(444, 91, 32, 18, 'bg-on', 9) + '<circle cx="467" cy="100" r="6.5" class="bg-knob-off"/>' + ring(39, 79, details.w + 10, 39)
100
+ + line(`M${44 + Math.round(details.w / 2)} 120v25h${Math.max(20, 114 - Math.round(details.w / 2))}`, 'bg-lead') + text(165, 150, t('figDetailsCall'), 14, 'bg-t bg-call');
101
+ caption = t('figDetails'); label = t('figDetailsName');
102
+ } else if (step === 6) {
103
+ art = rect(14, 15, 492, 112, 'bg-frame', 8) + text(32, 43, ui('bridgeName'), 16, 'bg-t bg-strong') + text(32, 64, ui('extensionDetails'), 12, 'bg-t bg-muted')
104
+ + line('M15 75h490') + text(32, 106, ui('allowUserScripts'), 15) + toggle(444, 86) + ring(437, 81, 54, 32)
105
+ + line('M464 115v28h-74', 'bg-lead') + text(384, 148, t('figScriptsCall'), 14, 'bg-t bg-call', 'end');
106
+ caption = t('figScripts'); label = t('figScriptsName');
107
+ } else return null;
108
+ const titleId = `bc-guide-fig-${step}`;
109
+ const tour = { 2: layout === 'sidebar' ? t('tourSidebar') : layout === 'header' ? t('tourHeader') : t('tourExample'), 3: t('tourToolbar'), 5: t('tourCard'), 6: t('tourDetails') }[step];
110
+ const html = `<figure class="bc-guide-figure" data-figure-step="${step}" data-layout="${layout || 'fixed'}">
111
+ <div class="bc-guide-figure-head"><strong>${esc(name)}</strong><span>${esc(tour)}</span>${address ? `<code dir="ltr">${esc(address)}</code>` : ''}</div>
112
+ <svg class="bc-guide-art" viewBox="0 0 520 166" role="img" aria-labelledby="${titleId}" focusable="false"><title id="${titleId}">${esc(label)}</title>${art}</svg>
113
+ <figcaption>${esc(caption)}</figcaption>
114
+ </figure>`;
115
+ return { html, layout: layout || 'fixed' };
116
+ }
@@ -0,0 +1,222 @@
1
+ // Settings → Browser → My browser · use the extension: what the card and its six-step guide decide, without the DOM
2
+ // (node --test loads this file; settings-browser-extension.js renders what it returns). No imports.
3
+ //
4
+ // The finish line is not "a socket is open". It is: the expected extension, in the browser the owner chose, on a live
5
+ // bridge, running the folder's current copy, and reporting that the browser lets it use user scripts (the extension's
6
+ // own probe, browser-extension/service-worker.js: it calls chrome.userScripts.getScripts() and looks for `execute`,
7
+ // and never runs a script in a tab). Anything short of that is said as the step it still needs.
8
+ //
9
+ // Evidence comes from two reads: GET /api/browser/extension (`connected`, `paired`, `extensionVersion`, `reloadNeeded`,
10
+ // `capabilities`: the current peer's last report or null) and GET …/setup/status (`state`, `code`, `browser`,
11
+ // `pairedThrough`: the browser whose setup made the pairing). An extension from before the report (1.5.0) sends no
12
+ // `capabilities`: its scripts access is unknown, never assumed. A server from before the report (one not restarted
13
+ // after an update) has no `capabilities` key at all: its connection is only "connected", never a legacy peer.
14
+ //
15
+ // A setup's download error belongs to that setup (the guide's Step 4, Advanced): a live bridge is never shown as
16
+ // "Offline" or "Package unavailable" because a Repair or a Set up after it could not download.
17
+
18
+ /** The guide's pages, in order. Page 7 is Ready. */
19
+ export const GUIDE_STEPS = Object.freeze(['open', 'developer', 'load', 'folder', 'details', 'scripts']);
20
+ export const READY_STEP = GUIDE_STEPS.length + 1;
21
+ /** The first extension version that reports its scripts capability. */
22
+ export const CAPABILITY_VERSION = '1.6.0';
23
+ /** The setup's download errors, each with its own stage. */
24
+ const DOWNLOAD_STAGES = Object.freeze({ EXTENSION_DOWNLOAD_OFFLINE: 'offline', EXTENSION_DOWNLOAD_UNAVAILABLE: 'package-unavailable', EXTENSION_VERIFY_FAILED: 'verification-failed' });
25
+ /**
26
+ * Every stage the card can be in. The ladder is not-set-up → detected → allow-scripts → ready; the rest say why the
27
+ * ladder stopped. `rung`: how far up the ladder the stage is (the status symbol); `step`: the guide page that resolves it.
28
+ */
29
+ export const STAGES = Object.freeze({
30
+ loading: { rung: 0, tone: '', step: 1 },
31
+ 'not-set-up': { rung: 0, tone: '', step: 1 },
32
+ downloading: { rung: 0, tone: 'sync', step: 4 },
33
+ offline: { rung: 0, tone: 'err', step: 4 },
34
+ 'package-unavailable': { rung: 0, tone: 'err', step: 4 },
35
+ 'verification-failed': { rung: 0, tone: 'err', step: 4 },
36
+ pairing: { rung: 0, tone: 'sync', step: 4 },
37
+ disconnected: { rung: 0, tone: 'warn', step: 1 },
38
+ 'other-browser': { rung: 0, tone: 'warn', step: 1 },
39
+ detected: { rung: 1, tone: 'sync', step: 5 },
40
+ 'allow-scripts': { rung: 2, tone: 'warn', step: 6 },
41
+ 'reload-required': { rung: 1, tone: 'warn', step: 6 },
42
+ 'browser-update': { rung: 1, tone: 'err', step: 6 },
43
+ 'legacy-peer': { rung: 1, tone: 'warn', step: 6 },
44
+ // Connected, through a server that cannot report what the extension may do (it predates the report): no action.
45
+ connected: { rung: 1, tone: 'ok', step: READY_STEP },
46
+ ready: { rung: 3, tone: 'ok', step: READY_STEP },
47
+ error: { rung: 0, tone: 'err', step: 1 },
48
+ });
49
+
50
+ /** a.b.c version compare: negative, 0 or positive (missing parts are 0). */
51
+ export function compareVersions(a, b) {
52
+ const pa = String(a || '').split('.').map(n => Number.parseInt(n, 10) || 0), pb = String(b || '').split('.').map(n => Number.parseInt(n, 10) || 0);
53
+ for (let i = 0; i < Math.max(pa.length, pb.length); i++) { const d = (pa[i] || 0) - (pb[i] || 0); if (d) return d; }
54
+ return 0;
55
+ }
56
+
57
+ // Which installed-browser ids a reported brand can be. A Chromium build that names only "Chromium" may be Chromium,
58
+ // Arc or Vivaldi (both hide their own name from the brand list), so it rules out only the browsers that do name themselves.
59
+ const BRAND_IDS = Object.freeze([
60
+ [/^brave$/i, ['brave']], [/^microsoft edge$/i, ['edge']], [/^opera( gx)?$/i, ['opera']], [/^vivaldi$/i, ['vivaldi']],
61
+ [/^arc$/i, ['arc']], [/^google chrome$/i, ['chrome']],
62
+ ]);
63
+ const GENERIC = ['chromium', 'arc', 'vivaldi'];
64
+ /** The browser ids the peer's reported brands allow, or null when it reported none. */
65
+ export function brandCandidates(capabilities) {
66
+ const brands = Array.isArray(capabilities?.browser?.brands) ? capabilities.browser.brands.map(String) : [];
67
+ if (!brands.length) return null;
68
+ for (const [pattern, ids] of BRAND_IDS) if (brands.some(b => pattern.test(b.trim()))) return ids;
69
+ return brands.some(b => /^chromium$/i.test(b.trim())) ? GENERIC : null;
70
+ }
71
+ /**
72
+ * Whether the connected peer is in the browser the owner chose: 'match', 'mismatch' or 'unknown'. A bridge paired from
73
+ * one browser never counts for another: a brand that names another browser, or a pairing a setup made for another
74
+ * browser that the brand does not overrule, is a mismatch. A brand that only says "Chromium" names the target only
75
+ * when the setup that paired says so, or when the target is the one installed browser it could be (`installed`: the
76
+ * ids of the installed browsers, when known).
77
+ */
78
+ export function peerIdentity(target, capabilities, pairedThrough, installed = null) {
79
+ if (!target) return 'unknown';
80
+ let brands = brandCandidates(capabilities);
81
+ const through = pairedThrough?.id || null;
82
+ if (brands && !brands.includes(target)) return 'mismatch';
83
+ if (brands && brands.length > 1 && Array.isArray(installed) && installed.length) brands = brands.filter(id => installed.includes(id));
84
+ const single = !!brands && brands.length === 1 && brands[0] === target;
85
+ if (through && through !== target && !single) return 'mismatch';
86
+ if (single || through === target) return 'match';
87
+ return 'unknown';
88
+ }
89
+
90
+ /**
91
+ * The card's stage. `data`: GET /api/browser/extension (null when the read failed); `setup`: the setup status (null
92
+ * when none ran); `target`: the installed browser the owner chose; `failed`: the last read failed.
93
+ */
94
+ export function extensionStage({ data = null, setup = null, target = null, failed = false, installed = null } = {}) {
95
+ if (!data) return failed ? 'error' : 'loading';
96
+ const running = setup?.state || data.setup || 'idle';
97
+ const forTarget = !target || !setup?.browser?.id || setup.browser.id === target;
98
+ if (!data.connected) {
99
+ // Only while nothing is connected: a failed download never hides a live bridge (it stays in Step 4 and Advanced).
100
+ if (running === 'error' && forTarget && DOWNLOAD_STAGES[setup?.code]) return DOWNLOAD_STAGES[setup.code];
101
+ if (running === 'downloading' && forTarget) return 'downloading';
102
+ if (running === 'pairing' && forTarget) return 'pairing';
103
+ if (failed) return 'error';
104
+ return data.paired ? 'disconnected' : 'not-set-up';
105
+ }
106
+ if (peerIdentity(target, data.capabilities, setup?.pairedThrough, installed) === 'mismatch') return 'other-browser';
107
+ if (data.reloadNeeded === true) return 'reload-required';
108
+ // No `capabilities` key: a server from before the report, not a peer from before it (a current server sends null).
109
+ if (!Object.hasOwn(data, 'capabilities')) return 'connected';
110
+ const caps = data.capabilities;
111
+ if (!caps || !caps.userScripts) {
112
+ // An extension older than the report never sends one; a current one sends it right after it connects.
113
+ return data.extensionVersion && compareVersions(data.extensionVersion, CAPABILITY_VERSION) >= 0 ? 'detected' : 'legacy-peer';
114
+ }
115
+ const state = caps.userScripts.state;
116
+ if (state === 'unsupported') return 'browser-update';
117
+ if (state === 'ready') return peerIdentity(target, caps, setup?.pairedThrough, installed) === 'match' ? 'ready' : 'detected';
118
+ return 'allow-scripts';
119
+ }
120
+
121
+ /** The verification list of the Ready page: each check and whether the evidence holds it. */
122
+ export function readyChecks({ data = null, setup = null, target = null, installed = null } = {}) {
123
+ const caps = data?.capabilities;
124
+ return [
125
+ { key: 'peer', ok: !!data?.connected && peerIdentity(target, caps, setup?.pairedThrough, installed) === 'match' },
126
+ { key: 'live', ok: !!data?.connected },
127
+ { key: 'reload', ok: !!data?.connected && data.reloadNeeded !== true },
128
+ { key: 'scripts', ok: caps?.userScripts?.state === 'ready' },
129
+ ];
130
+ }
131
+
132
+ /**
133
+ * The page the guide moves to when the evidence changes (never backwards: the owner's Back stays where they put it).
134
+ * `step`: the page shown; `stage`: the new stage; `previous`: the stage the last move was decided on.
135
+ */
136
+ export function branchStep(step, stage, previous = null) {
137
+ if (stage === previous) return step;
138
+ if (stage === 'ready') return READY_STEP;
139
+ const wanted = STAGES[stage]?.step || 1;
140
+ // Evidence that the extension is in the browser moves an install still under way to its Details step.
141
+ if (['detected', 'allow-scripts', 'reload-required', 'browser-update', 'legacy-peer'].includes(stage) && step <= 4) return 5;
142
+ // A lapse after Ready (the extension asks for scripts again, a reload, an update) goes to the page that fixes it; a
143
+ // browser that is only away keeps the Ready page, whose checklist then names what is missing.
144
+ if (step === READY_STEP && wanted >= 4 && wanted < READY_STEP) return wanted;
145
+ return step;
146
+ }
147
+ /** The page the guide opens on for a stage (Resume setup, Review setup, Allow user scripts …). */
148
+ export function entryStep(stage, saved = 0) {
149
+ if (stage === 'ready') return READY_STEP;
150
+ const wanted = STAGES[stage]?.step || 1;
151
+ if (wanted >= 5) return wanted;
152
+ return saved >= 1 && saved < READY_STEP ? saved : wanted;
153
+ }
154
+
155
+ /** The status word, help, symbol and main action for a stage. Keys are under browserExtension.card. */
156
+ export function stageView(stage, { savedStep = 0, legacyServer = false } = {}) {
157
+ const meta = STAGES[stage] || STAGES.error;
158
+ const status = {
159
+ loading: 'stageLoading', 'not-set-up': 'stageNotSetUp', downloading: 'stageDownloading', offline: 'stageOffline',
160
+ 'package-unavailable': 'stagePackageUnavailable', 'verification-failed': 'stageVerifyFailed', pairing: 'stagePairing',
161
+ disconnected: 'stageDisconnected', 'other-browser': 'stageOtherBrowser', detected: 'stageDetected', 'allow-scripts': 'stageAllowScripts',
162
+ 'reload-required': 'stageReload', 'browser-update': 'stageBrowserUpdate', 'legacy-peer': 'stageLegacy', connected: 'stageConnected', ready: 'stageReady', error: 'stageError',
163
+ }[stage] || 'stageError';
164
+ // The chosen browser's extension is connected (rung 1 and up): never offered the older server's "Connect your
165
+ // browser", which opens the setup page and the folder again; nor any action while the server cannot check it.
166
+ const cta = stage === 'connected' ? null
167
+ : legacyServer ? (stage === 'disconnected' ? 'ctaReconnect' : stage === 'error' ? 'retry' : meta.rung >= 1 ? null : 'ctaConnect')
168
+ : stage === 'ready' ? 'ctaReview'
169
+ : stage === 'disconnected' ? 'ctaReconnect'
170
+ : stage === 'allow-scripts' ? 'ctaAllowScripts'
171
+ : stage === 'detected' ? 'ctaDetails'
172
+ : ['offline', 'package-unavailable', 'verification-failed', 'error'].includes(stage) ? 'retry'
173
+ : ['reload-required', 'browser-update', 'legacy-peer', 'pairing', 'downloading'].includes(stage) ? 'ctaResume'
174
+ : savedStep > 1 ? 'ctaResume' : 'ctaSetUp';
175
+ return { status, help: `${status}Help`, tone: meta.tone, rung: meta.rung, cta };
176
+ }
177
+
178
+ /** The keys to paste an address with, on this computer. */
179
+ export function pasteKeys(platform = '') {
180
+ return /mac|darwin|iphone|ipad/i.test(String(platform)) ? ['⌘L', '⌘V', 'Return'] : ['Ctrl+L', 'Ctrl+V', 'Enter'];
181
+ }
182
+ /** 'mac', 'windows' or 'linux' for a platform word (the server's inventory or the page's navigator). */
183
+ export function osOf(platform = '') {
184
+ const p = String(platform || '').toLowerCase();
185
+ return /mac|darwin|iphone|ipad/.test(p) ? 'mac' : /win/.test(p) ? 'windows' : 'linux';
186
+ }
187
+ /** Where Developer mode is on a browser's Extensions page: verified layouts only; anything else names the switch only. */
188
+ export function developerLayout(browserId) {
189
+ if (browserId === 'edge') return 'sidebar';
190
+ return ['chrome', 'brave', 'arc', 'vivaldi', 'chromium'].includes(browserId) ? 'header' : 'unverified';
191
+ }
192
+
193
+ /** The browser the card offers first: the saved choice while installed, else the server's suggestion, else the first. */
194
+ export function pickTarget(inventory, saved = null) {
195
+ const list = Array.isArray(inventory?.installedBrowsers) ? inventory.installedBrowsers.filter(b => b?.id) : [];
196
+ if (saved && list.some(b => b.id === saved)) return saved;
197
+ if (inventory?.suggested && list.some(b => b.id === inventory.suggested)) return inventory.suggested;
198
+ return list[0]?.id || null;
199
+ }
200
+ /** The short name the guide uses ("Brave", "Chrome", "Edge"): the catalog's names carry the vendor. */
201
+ export function shortName(browser) {
202
+ const name = String(browser?.name || '').trim();
203
+ return { 'Google Chrome': 'Chrome', 'Microsoft Edge': 'Edge' }[name] || name;
204
+ }
205
+
206
+ // ── what the guide remembers between openings (the chosen browser and how far each browser got) ──
207
+ export const GUIDE_STORE_KEY = 'synabun.browserBridgeGuide';
208
+ /** Progress older than this is not resumed (the browser is still remembered). */
209
+ export const GUIDE_STORE_MS = 6 * 60 * 60 * 1000;
210
+ export function readGuideStore(raw, now = Date.now()) {
211
+ let value; try { value = JSON.parse(raw || 'null'); } catch { value = null; }
212
+ if (!value || typeof value !== 'object') return { target: null, open: false, progress: {} };
213
+ const fresh = Number(value.at) > 0 && now - Number(value.at) < GUIDE_STORE_MS;
214
+ const progress = {};
215
+ if (fresh && value.progress && typeof value.progress === 'object') {
216
+ for (const [id, step] of Object.entries(value.progress)) if (/^[a-z]{2,12}$/.test(id) && Number.isInteger(step) && step >= 1 && step <= READY_STEP) progress[id] = step;
217
+ }
218
+ return { target: typeof value.target === 'string' && /^[a-z]{2,12}$/.test(value.target) ? value.target : null, open: fresh && value.open === true, progress };
219
+ }
220
+ export function writeGuideStore({ target, open, progress }, now = Date.now()) {
221
+ return JSON.stringify({ target: target || null, open: !!open, progress: progress || {}, at: now });
222
+ }
@@ -265,8 +265,8 @@ export const SETTINGS_CONTROLS = {
265
265
  'stg-sec-maintenance': 'MEM008 MEM012 MEM013 MEM014 MEM001 MEM015 MEM016',
266
266
  'stg-sec-workspaces': 'PRJ013 PRJ007 PRJ008 PRJ009 PRJ010 PRJ011 PRJ014 PRJ015 PRJ016 PRJ017 PRJ018',
267
267
  'project-storage-manager': 'PRJ001 PRJ012 PRJ002 PRJ003 PRJ004 PRJ005 PRJ006',
268
- 'setup-browser': 'BRW003 BRW001 BRW002 BRW084 BRW004 BRW005 BRW006 BRW007 BRW008 BRW009',
269
- 'bcg-profiles': 'BRW011 BRW012 BRW083 BRW010 BRW015 BRW016 BRW017 BRW018 BRW019 BRW020',
268
+ 'setup-browser': 'BRW011 BRW003 BRW001 BRW002 BRW084 BRW004 BRW005 BRW006 BRW007 BRW008 BRW009',
269
+ 'bcg-profiles': 'BRW012 BRW083 BRW010 BRW015 BRW016 BRW017 BRW018 BRW019 BRW020',
270
270
  'bcg-owner-access': 'BRW087',
271
271
  'bcg-identity': 'BRW021 BRW022 BRW023 BRW024 BRW025',
272
272
  'bcg-viewport': 'BRW026 BRW027 BRW028 BRW029 BRW030 BRW031 BRW032',
@@ -55,8 +55,13 @@ export function storeSectionState(section) {
55
55
  /**
56
56
  * Open every closed ancestor of `el` (collapsible cards, <details>, a project's panel, a block behind its own tab),
57
57
  * then `el` itself. Nothing is remembered: the sections the user left open or closed stay as stored.
58
+ *
59
+ * First `el` announces itself with a bubbling `settings-reveal` event: a pane that shows something in place of its
60
+ * content (the Browser page's setup guide, settings-browser-extension.js) steps aside, synchronously, for a target
61
+ * outside it, so a deep link or a search result always lands on what it names.
58
62
  */
59
63
  export function revealSettingsTarget(overlay, el) {
64
+ try { el?.dispatchEvent?.(new CustomEvent('settings-reveal', { bubbles: true })); } catch { /* no event support: nothing steps aside */ }
60
65
  for (let node = el; node && node !== overlay; node = node.parentElement) {
61
66
  if (node.matches?.('[data-collapsible].collapsed')) node.classList.remove('collapsed');
62
67
  if (node.tagName === 'DETAILS' && !node.open) node.open = true;
@@ -74,6 +74,9 @@ export async function renderOperationsPlace(host, ctx, place) {
74
74
  }
75
75
  function healthHTML(data, usage, settings, scanners) {
76
76
  const nameOf = (id) => ctx.data?.skills?.find((s) => s.skillId === id)?.name || id;
77
+ // Per runtime (health.js runtimeVerification): which are not confirmed yet, which have no listing to ask.
78
+ const runtimeNames = (list) => list.map((rt) => (['claude', 'codex', 'opencode', 'antigravity'].includes(rt) ? ctx.t(`skillsStudio.runtime.${rt}`) : rt)).join(', ');
79
+ const staticOnly = (r) => Object.entries(r.runtimes || {}).filter(([, v]) => v?.verification === 'static-only').map(([rt]) => rt);
77
80
  return html`<div class="sx-ops-grid"><section class="sx-ops-card">
78
81
  <h4 class="sx-section-title">${t('collection')}</h4><label class="sx-choice"><input type="checkbox" id="sx-usage-enabled"${attr('checked', settings.telemetryEnabled)}${attr('disabled', ctx.guest)}> ${t('collect')}</label>
79
82
  <label class="sx-field-label" for="sx-retention">${t('retention')}</label><input class="sx-input" type="number" id="sx-retention" min="1" max="365" value="${settings.retentionDays}"${attr('disabled', ctx.guest)}>
@@ -89,6 +92,8 @@ export async function renderOperationsPlace(host, ctx, place) {
89
92
  <h4 class="sx-section-title">${t('usage')}</h4>${usage.rows.length ? html`<div class="sx-ops-grid">${usage.rows.map((r) => html`<article class="sx-ops-card"><strong>${nameOf(r.skillId)} · ${r.runtime}</strong><p class="sx-help">${r.revisionId}</p><p>${t('counts', r)}</p></article>`)}</div>` : html`<p class="sx-help">${t('noUsage')}</p>`}
90
93
  <h4 class="sx-section-title">${t('installations')}</h4>${data.rows.length ? html`<div class="sx-ops-grid">${data.rows.map((r) => html`<article class="sx-ops-card"><strong>${r.name || nameOf(r.skillId)} · ${r.runtime}</strong>
91
94
  <p class="sx-help">${r.revisionId}</p><p class="${r.issues.length ? 'sx-warn-text' : 'sx-help'}">${t(`state_${r.status}`)}</p>
95
+ ${r.unverifiedRuntimes?.length ? html`<p class="sx-help">${t('unverifiedRuntimes', { runtimes: runtimeNames(r.unverifiedRuntimes) })}</p>` : ''}
96
+ ${staticOnly(r).length ? html`<p class="sx-help">${t('staticOnlyRuntimes', { runtimes: runtimeNames(staticOnly(r)) })}</p>` : ''}
92
97
  <ul class="sx-plain-list">${r.issues.map((i) => html`<li>${t(`issue_${i}`)}</li>`)}</ul>
93
98
  ${r.scan ? html`<p class="sx-help">${r.scan.engine} ${r.scan.engineVersion} · ${r.scan.policy}</p><ul class="sx-plain-list">${r.scan.findings.slice(0, 12).map((f) => html`<li>${f.severity} · ${f.ruleId} · ${f.file || ''}${f.line ? `:${f.line}` : ''} — ${scanFindingText(t, f)}</li>`)}</ul>` : ''}
94
99
  </article>`)}</div>` : html`<p class="sx-help">${t('noChecks')}</p>`}
@@ -19,8 +19,10 @@ export const BLOCK_CODES = Object.freeze(['no_root', 'shared_root_off', 'root_re
19
19
  export const REFRESH_KINDS = Object.freeze(['automatic', 'reload-skills', 'new-session', 'panel-reload', 'terminal-only']);
20
20
  // Why a runtime could not be asked on Verify (lib/skills/runtime-checks.js probe, deploy.js verify): each has its words.
21
21
  export const PROBE_CODES = Object.freeze(['not-installed', 'not-running', 'no-answer', 'no-list', 'terminal-only']);
22
- export const ELIGIBILITY_STATES = Object.freeze(['enabled', 'disabled', 'unknown']);
23
- export const ELIGIBILITY_REASONS = Object.freeze(['codex-config', 'claude-override', 'claude-deny', 'opencode-permission', 'unreadable', 'invalid-json']);
22
+ // 'not-checked': a runtime whose settings SynaBun does not read (Antigravity, reason `not-read`); never "could not
23
+ // be read", so the plan says nothing about it (sx-install.js lists only disabled and unknown-with-a-reason).
24
+ export const ELIGIBILITY_STATES = Object.freeze(['enabled', 'disabled', 'unknown', 'not-checked']);
25
+ export const ELIGIBILITY_REASONS = Object.freeze(['codex-config', 'claude-override', 'claude-deny', 'opencode-permission', 'unreadable', 'invalid-json', 'not-read']);
24
26
  export const RESULT_STATES = Object.freeze(['committed', 'skipped', 'needs-confirmation', 'failed']);
25
27
 
26
28
  const list = (v) => (Array.isArray(v) ? v : []);
@@ -137,20 +139,57 @@ export function resultModel(result) {
137
139
  }));
138
140
  }
139
141
 
140
- /** What a verify found, fact by fact; nothing is claimed that the service did not establish ("loaded" never is). */
142
+ // Per runtime of an installation (lib/skills/deploy.js eligibilityByRuntime): 'not-checked' is a runtime whose
143
+ // settings SynaBun does not read (Antigravity), never "could not be read".
144
+ export const RUNTIME_ELIGIBILITY_STATES = ELIGIBILITY_STATES;
145
+ // Whether a runtime was or can be asked (deploy.js probeStates): Codex and OpenCode have a listing; Claude Code and
146
+ // Antigravity never can be asked.
147
+ export const PROBE_STATES = Object.freeze(['found', 'not-found', 'no-answer', 'not-probed', 'cannot-probe']);
148
+ const PROBEABLE_RUNTIMES = ['codex', 'opencode'];
149
+
150
+ /** Per runtime, what asking it said or why it was not asked; a record from before reads the same way. */
151
+ function probeFacts(runtimes, discovered) {
152
+ const d = discovered && typeof discovered === 'object' ? discovered : {};
153
+ return runtimes.map((runtime) => {
154
+ const v = d[runtime];
155
+ const answer = v && typeof v === 'object' ? v.discovered : (typeof v === 'boolean' ? v : undefined);
156
+ const code = PROBE_CODES.includes(v?.code) ? v.code : null;
157
+ if (answer === true) return { runtime, state: 'found', code: null };
158
+ if (answer === false) return { runtime, state: 'not-found', code: null };
159
+ if (!PROBEABLE_RUNTIMES.includes(runtime) || code === 'no-list') return { runtime, state: 'cannot-probe', code: 'no-list' };
160
+ if (code === 'terminal-only') return { runtime, state: 'cannot-probe', code };
161
+ if (v && typeof v === 'object') return { runtime, state: 'no-answer', code };
162
+ return { runtime, state: 'not-probed', code: null };
163
+ });
164
+ }
165
+
166
+ /**
167
+ * What a verify (or the check SynaBun runs right after an install) found, fact by fact; nothing is claimed that the
168
+ * service did not establish ("loaded" never is). Takes an installation record or a skill view's installation row
169
+ * (`affectedRuntimes`, `state`). `checked`: whether a check ever ran (a record from before the automatic check
170
+ * that nobody verified has not).
171
+ */
141
172
  export function verifyFacts(installation) {
142
173
  const s = installation?.state || {};
143
174
  const written = s.writtenCheck || (s.written === true ? 'verified' : s.written === false ? 'changed' : 'unknown');
144
175
  const discovered = s.discovered && typeof s.discovered === 'object'
145
176
  ? Object.entries(s.discovered).map(([runtime, v]) => ({ runtime, discovered: v?.discovered ?? (typeof v === 'boolean' ? v : null), error: v?.error || null, code: PROBE_CODES.includes(v?.code) ? v.code : null }))
146
177
  : [];
178
+ const runtimes = list(installation?.destination?.affectedRuntimes).length ? list(installation.destination.affectedRuntimes) : list(installation?.affectedRuntimes);
179
+ const byRuntime = s.eligibilityByRuntime && typeof s.eligibilityByRuntime === 'object' ? s.eligibilityByRuntime : {};
180
+ const reasons = s.eligibilityReasons && typeof s.eligibilityReasons === 'object' ? s.eligibilityReasons : {};
147
181
  return {
148
182
  written,
149
183
  discoverable: s.discoverable === true ? 'yes' : s.discoverable === false ? 'no' : 'unknown',
150
184
  eligibility: ['enabled', 'disabled'].includes(s.eligibility) ? s.eligibility : 'unknown',
185
+ eligibilityByRuntime: Object.entries(byRuntime).map(([runtime, v]) => ({ runtime, state: RUNTIME_ELIGIBILITY_STATES.includes(v) ? v : 'unknown', reason: reasons[runtime] || null })),
186
+ notChecked: Array.isArray(s.eligibilityNotChecked) ? s.eligibilityNotChecked.slice() : Object.keys(byRuntime).filter((r) => byRuntime[r] === 'not-checked'),
151
187
  discovered,
188
+ probes: probeFacts(runtimes, s.discovered),
152
189
  checks: list(s.checks).map((c) => ({ runtime: c.runtime || null, ok: !!c.ok, message: String(c.message ?? '') })),
153
190
  checkedAt: s.checkedAt || null,
191
+ checked: s.staticCheck?.state === 'ok' || s.discoverable === true || s.discoverable === false,
192
+ checkError: s.staticCheck?.state === 'error' ? String(s.staticCheck.error || '') : null,
154
193
  };
155
194
  }
156
195
 
@@ -21,7 +21,7 @@
21
21
  import { scanStatus, scanText, scanFindingText } from './sx-scan.js';
22
22
  import { studioErrorText } from './sx-errors.js';
23
23
  import { dropdownHTML, wireDropdowns } from '../../cc-dropdown.js';
24
- import { html, raw, setHTML, ICONS, relativeTime, listText } from './sx-dom.js';
24
+ import { html, raw, attr, setHTML, ICONS, relativeTime, listText } from './sx-dom.js';
25
25
  import { installTargets, targetState, wholeTarget, sameAsk } from './sx-subject.js';
26
26
  import { verifyFacts, needsConfirmation, newPublishState, clearPlan, choosePublishRevision, planModel } from './sx-plan.js';
27
27
  import { defaultSelection, scopeOf, simplePicker, moveScope, defaultRevisionId, plainLabel, planLines, installButton, installStatus, whereOf } from './sx-install.js';
@@ -326,7 +326,9 @@ function outcomeHTML(ctx, results) {
326
326
  function installRowHTML(ctx, ws, i, revisionId, owner) {
327
327
  const { t } = ctx;
328
328
  const current = revisionId ? i.sourceRevisionId === revisionId : !i.updateAvailable;
329
- const facts = ws.pub.verify[i.installationId] || null;
329
+ // What Verify just found, else what SynaBun's own check after the install stored (a server from before sends no state).
330
+ const stored = i.state ? verifyFacts(i) : null;
331
+ const facts = ws.pub.verify[i.installationId] || (stored && (stored.checked || stored.checkError !== null) ? stored : null);
330
332
  return html`<li class="sx-install-row">
331
333
  <span class="sx-install-where">${targetWords(ctx, whereOf(i))}</span>
332
334
  <span class="sx-mono sx-dim sx-path" title="${i.destination || ''}">${shortPath(i.destination || '')}</span>
@@ -343,12 +345,26 @@ function factsHTML(t, f) {
343
345
  return html`<ul class="sx-facts sx-install-facts">
344
346
  <li>${t(`skillsStudio.publish.fact.written.${f.written === 'verified' ? 'ok' : f.written === 'missing' ? 'missing' : f.written === 'changed' ? 'changed' : 'unknown'}`)}</li>
345
347
  <li>${t(`skillsStudio.publish.fact.discoverable.${f.discoverable}`)}</li>
346
- <li>${t(`skillsStudio.publish.fact.eligibility.${f.eligibility}`)}</li>
347
- ${f.discovered.map((d) => html`<li>${t(`skillsStudio.publish.fact.discovered.${d.discovered === true ? 'yes' : d.discovered === false ? 'no' : d.code || 'unknown'}`, { runtime: t(`skillsStudio.runtime.${d.runtime}`) })}</li>`)}
348
+ ${(f.eligibilityByRuntime || []).length
349
+ ? f.eligibilityByRuntime.map((e) => html`<li${attr('class', e.state === 'disabled' ? 'sx-warn-text' : null)}>${t(`skillsStudio.publish.fact.eligibilityRuntime.${e.state}`, { runtime: t(`skillsStudio.runtime.${e.runtime}`) })}</li>`)
350
+ : html`<li>${t(`skillsStudio.publish.fact.eligibility.${f.eligibility}`)}</li>`}
351
+ ${(f.probes || []).length ? f.probes.map((p) => html`<li>${probeLine(t, p)}</li>`)
352
+ : f.discovered.map((d) => html`<li>${t(`skillsStudio.publish.fact.discovered.${d.discovered === true ? 'yes' : d.discovered === false ? 'no' : d.code || 'unknown'}`, { runtime: t(`skillsStudio.runtime.${d.runtime}`) })}</li>`)}
353
+ ${f.checkError !== null && f.checkError !== undefined ? html`<li class="sx-warn-text">${t('skillsStudio.publish.fact.checkFailed', { error: f.checkError })}</li>` : ''}
348
354
  ${f.checks.filter((c) => !c.ok).map((c) => html`<li class="sx-warn-text">${c.message}</li>`)}
349
355
  </ul>`;
350
356
  }
351
357
 
358
+ /** One runtime: what asking it said, "cannot be asked" (no listing: Claude Code, Antigravity), or "not asked yet". */
359
+ function probeLine(t, p) {
360
+ const runtime = t(`skillsStudio.runtime.${p.runtime}`);
361
+ if (p.state === 'found') return t('skillsStudio.publish.fact.discovered.yes', { runtime });
362
+ if (p.state === 'not-found') return t('skillsStudio.publish.fact.discovered.no', { runtime });
363
+ if (p.state === 'cannot-probe') return t(p.code === 'terminal-only' ? 'skillsStudio.publish.fact.discovered.terminal-only' : 'skillsStudio.publish.fact.probe.cannot-probe', { runtime });
364
+ if (p.state === 'not-probed') return t('skillsStudio.publish.fact.probe.not-probed', { runtime });
365
+ return t(`skillsStudio.publish.fact.discovered.${p.code || 'unknown'}`, { runtime });
366
+ }
367
+
352
368
  /** The foot of the tab: what is picked, and the one button. */
353
369
  function barHTML(ctx, ws, picker, revisionId, rev) {
354
370
  const { t } = ctx;