synabun 2.4.5 → 2.4.7

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 (108) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1 -1
  3. package/docs/whatsapp.md +17 -1
  4. package/hooks/claude-code/session-start.mjs +21 -18
  5. package/lib/claude-global-config.js +214 -0
  6. package/lib/client-config-repair.js +17 -3
  7. package/mcp-server/dist/index.d.ts.map +1 -1
  8. package/mcp-server/dist/index.js +6 -1
  9. package/mcp-server/dist/index.js.map +1 -1
  10. package/mcp-server/dist/services/tool-catalog.js +1 -1
  11. package/mcp-server/dist/services/tool-catalog.js.map +1 -1
  12. package/mcp-server/dist/tools/agents.d.ts +2 -0
  13. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  14. package/mcp-server/dist/tools/agents.js +11 -5
  15. package/mcp-server/dist/tools/agents.js.map +1 -1
  16. package/mcp-server/dist/tools/skill-tools.d.ts +24 -5
  17. package/mcp-server/dist/tools/skill-tools.d.ts.map +1 -1
  18. package/mcp-server/dist/tools/skill-tools.js +88 -8
  19. package/mcp-server/dist/tools/skill-tools.js.map +1 -1
  20. package/mcp-server/dist/tools/tool-groups.d.ts.map +1 -1
  21. package/mcp-server/dist/tools/tool-groups.js +19 -4
  22. package/mcp-server/dist/tools/tool-groups.js.map +1 -1
  23. package/mcp-server/package-lock.json +2 -2
  24. package/mcp-server/package.json +1 -1
  25. package/mcp-server/src/index.ts +6 -1
  26. package/mcp-server/src/services/tool-catalog.ts +1 -1
  27. package/mcp-server/src/tools/agents.ts +11 -5
  28. package/mcp-server/src/tools/skill-tools.ts +82 -9
  29. package/mcp-server/src/tools/tool-groups.ts +19 -4
  30. package/neural-interface/i18n/en.json +153 -10
  31. package/neural-interface/i18n/pt-BR.json +153 -10
  32. package/neural-interface/lib/antigravity/panel-bridge.js +7 -3
  33. package/neural-interface/lib/assistant-dispatch.js +15 -1
  34. package/neural-interface/lib/assistant-runtime.js +79 -8
  35. package/neural-interface/lib/assistant-user-context.js +7 -3
  36. package/neural-interface/lib/browser-background-tab.js +12 -0
  37. package/neural-interface/lib/browser-guard-cdp.js +2 -1
  38. package/neural-interface/lib/browser-network-guard.js +140 -3
  39. package/neural-interface/lib/browser-own-targets.js +350 -0
  40. package/neural-interface/lib/claude-agent-bridge.js +13 -2
  41. package/neural-interface/lib/codex-thread-history.js +144 -7
  42. package/neural-interface/lib/codex-worker-app-server.js +84 -30
  43. package/neural-interface/lib/db.js +26 -0
  44. package/neural-interface/lib/greeting/sources.js +7 -3
  45. package/neural-interface/lib/jsonl-lines.js +10 -11
  46. package/neural-interface/lib/launch-block-api.js +86 -0
  47. package/neural-interface/lib/line-buffer.js +88 -0
  48. package/neural-interface/lib/loop-stall.js +15 -1
  49. package/neural-interface/lib/memory-list-read.js +105 -0
  50. package/neural-interface/lib/memory-timers.js +4 -1
  51. package/neural-interface/lib/morelogin-launch-recovery.js +506 -0
  52. package/neural-interface/lib/morelogin-profile-failures.js +48 -1
  53. package/neural-interface/lib/morelogin.js +16 -2
  54. package/neural-interface/lib/native-loop-runtime.js +7 -3
  55. package/neural-interface/lib/provider-panel-api-key-auth.js +33 -6
  56. package/neural-interface/lib/skills/api-v2.js +18 -3
  57. package/neural-interface/lib/skills/bundle.js +2 -2
  58. package/neural-interface/lib/skills/deploy.js +169 -34
  59. package/neural-interface/lib/skills/digest.js +57 -3
  60. package/neural-interface/lib/skills/health.js +55 -1
  61. package/neural-interface/lib/skills/known-bridge-digests.json +12 -0
  62. package/neural-interface/lib/skills/runtime-checks.js +7 -4
  63. package/neural-interface/lib/skills/scan-shell.js +56 -7
  64. package/neural-interface/lib/skills/scan.js +13 -12
  65. package/neural-interface/lib/skills/service.js +7 -2
  66. package/neural-interface/lib/skills/telemetry.js +2 -2
  67. package/neural-interface/lib/teams/README.md +12 -5
  68. package/neural-interface/lib/teams/api.js +15 -4
  69. package/neural-interface/lib/teams/index.js +2 -0
  70. package/neural-interface/lib/teams/landing.js +195 -75
  71. package/neural-interface/lib/teams/scheduler.js +31 -32
  72. package/neural-interface/lib/terminal-token-redaction.js +228 -58
  73. package/neural-interface/lib/terminal-tokens.js +18 -0
  74. package/neural-interface/lib/whatsapp/brain.js +21 -0
  75. package/neural-interface/lib/whatsapp/bridge.js +40 -4
  76. package/neural-interface/package-lock.json +2 -2
  77. package/neural-interface/package.json +1 -1
  78. package/neural-interface/public/index.html +117 -37
  79. package/neural-interface/public/shared/agents/studio/ax-api.js +11 -0
  80. package/neural-interface/public/shared/agents/studio/ax-create-view.js +1 -1
  81. package/neural-interface/public/shared/agents/studio/ax-icons.js +1 -0
  82. package/neural-interface/public/shared/agents/studio/ax-library-view.js +3 -2
  83. package/neural-interface/public/shared/agents/studio/ax-main.js +127 -41
  84. package/neural-interface/public/shared/agents/studio/ax-review-view.js +3 -2
  85. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +137 -39
  86. package/neural-interface/public/shared/agents/studio/ax-teams.js +219 -4
  87. package/neural-interface/public/shared/agents/studio/ax-ui.js +31 -0
  88. package/neural-interface/public/shared/agents/studio/ax-views.js +67 -69
  89. package/neural-interface/public/shared/agents/studio/ax-work-answer.js +86 -0
  90. package/neural-interface/public/shared/agents/studio/ax-work-view.js +305 -0
  91. package/neural-interface/public/shared/agents/studio/ax-work.css +74 -0
  92. package/neural-interface/public/shared/agents/studio/ax-work.js +300 -0
  93. package/neural-interface/public/shared/cdx/cdx-deferred.js +90 -0
  94. package/neural-interface/public/shared/cdx/cdx-render.js +18 -7
  95. package/neural-interface/public/shared/cdx/cdx-tabs.js +2 -1
  96. package/neural-interface/public/shared/launch-block-view.js +124 -0
  97. package/neural-interface/public/shared/loading-diagnostic-entry.js +16 -1
  98. package/neural-interface/public/shared/skills/studio/sx-operations-view.js +5 -0
  99. package/neural-interface/public/shared/skills/studio/sx-plan.js +42 -3
  100. package/neural-interface/public/shared/skills/studio/sx-publish-view.js +20 -4
  101. package/neural-interface/public/shared/styles.css +17 -0
  102. package/neural-interface/public/shared/ui-launch-block-notice.js +155 -0
  103. package/neural-interface/public/shared/ui-navbar.js +11 -0
  104. package/neural-interface/public/shared/ui-sync.js +2 -0
  105. package/neural-interface/server.js +745 -270
  106. package/npm-shrinkwrap.json +2 -2
  107. package/package.json +2 -1
  108. package/skills/skill-forge/SKILL.md +7 -3
@@ -11,7 +11,8 @@ import { text } from './response.js';
11
11
  // the catalog of every runtime's skill folders, the managed library (complete folders as immutable revisions), drafts,
12
12
  // the checks (lint per runtime profile, the local scan), AI drafting from sources (`create`: one confined Claude Code
13
13
  // worker writes the package, the server checks it), the skill-forge guide, install plans, the Review queue, and what
14
- // the owner installed (`installations`, read-only). Every call carries the brain's launch credential (skillsV2): the
14
+ // the owner installed (`installations`, read-only; `verify` runs an installation's static check again, which writes
15
+ // only its stored check, never a file or an install). Every call carries the brain's launch credential (skillsV2): the
15
16
  // server knows the Assistant by it, never by the role header alone. It never
16
17
  // installs and never
17
18
  // approves: what the Assistant makes goes to the owner's Review queue, and the owner installs it from Skills
@@ -27,7 +28,7 @@ export const SKILL_ACTIONS = [
27
28
  'draft_create', 'draft_patch', 'snapshot', 'lint', 'scan',
28
29
  'create', 'create_status', 'create_cancel',
29
30
  'eval_start', 'eval_status', 'eval_cancel', 'eval_report',
30
- 'install_plan', 'review_submit', 'review_list', 'review_comment', 'withdraw', 'installations',
31
+ 'install_plan', 'review_submit', 'review_list', 'review_comment', 'withdraw', 'installations', 'verify',
31
32
  ] as const;
32
33
  const EVAL_PROVIDERS = ['claude-code', 'codex', 'opencode'] as const;
33
34
  const SOURCE_KINDS = ['conversation', 'url', 'repo', 'memory', 'import'] as const;
@@ -60,7 +61,8 @@ export const skillSchema = {
60
61
  + 'Evaluate (its evals/evals.json): "eval_start" (revisionId, or skillId for its latest version [+ purpose evals|final|optimise, kinds, runtimes, baseline, repetitions, caseIds, budgetUsd, maxMinutes]): task cases with the skill and without it, trigger cases (does the runtime pick the skill?), every run confined to its own folder with a copy of the skill (nothing is installed), graded by code and an independent grader, within a spend ceiling (default $3); Codex runs (or grades) a version only after the owner allows Codex for it in the Test tab (its shell can read files on the computer): ask the owner, never pick Codex by default; "final" runs only the held-out cases, once; "optimise" proposes a better description as a candidate version (never applied). The results are the owner\'s too, in Skills Studio\'s Test tab. "eval_status" (evalRunId [, waitSeconds, since]), "eval_cancel" (evalRunId), "eval_report" (evalRunId [, trialId]): the results per runtime and case. '
61
62
  + 'Maintenance: usage (minimal local evidence), health (latest checks and proposal-only triage), discover (cached enabled sources only), package_preview / export (revisionId, format; checked local download, never remote publication). External access and maintenance settings are owner-only. '
62
63
  + 'Deploy: "install_plan" (revisionId, targets): what an install would write where, with its checks; it installs nothing. Review: "review_submit" (revisionId, targets, releaseNotes, assumptions): the owner reviews and installs it; "review_list", "review_comment" (reviewId, body), "withdraw" (reviewId). '
63
- + 'After the owner installed it: "installations" (skillId | installationId): where it went, whether the bytes on disk are the approved ones, whether each runtime can find and use it, and what a running session needs to see it (read-only; the owner re-checks from Skills Studio).'
64
+ + 'After the owner installed it: "installations" (skillId | installationId): where it went, whether the bytes on disk are the approved ones, whether each runtime can find it (discoverable) and may use it (eligibility per runtime, from its settings), whether a runtime was asked, and what a running session needs to see it (read-only; SynaBun checks every install statically by itself right after writing it). '
65
+ + '"verify" (installationId | skillId: each active installation of it [+ probe]): runs that static check again now (the bytes, the folder rules, each runtime\'s settings; nothing is started) and answers as "installations" does; it changes no skill folder, setting or install, only the stored check. probe:true also asks Codex and OpenCode whether they list it (a short Codex app-server; OpenCode only while SynaBun\'s serve runs); Claude Code and Antigravity have no listing and can never be probed. Probe only when you must confirm that Codex or OpenCode sees it.'
64
66
  ),
65
67
  format: z.enum(['bundle', 'skill', 'portable', 'claude-upload', 'claude-plugin', 'claude-api', 'github']).optional().describe('package_preview / export: a checked immutable revision package; default bundle. No remote publication.'),
66
68
  q: z.string().max(200).optional().describe('catalog: text to look for in names and descriptions.'),
@@ -129,7 +131,8 @@ export const skillSchema = {
129
131
  creationId: z.string().max(40).optional().describe('create_status / create_cancel: the creation (crt_…).'),
130
132
  waitSeconds: z.number().int().min(0).max(MAX_WAIT_SECONDS).optional().describe(`create_status / eval_status: wait up to this many seconds for a change (0: answer now; at most ${MAX_WAIT_SECONDS}).`),
131
133
  since: z.number().int().min(-1).optional().describe('create_status / eval_status: the version you last saw (a wait returns when it changes).'),
132
- installationId: z.string().max(40).optional().describe('installations: one installation (ins_…).'),
134
+ installationId: z.string().max(40).optional().describe('installations / verify: one installation (ins_…).'),
135
+ probe: z.boolean().optional().describe('verify: also ask Codex and OpenCode whether they list the skill (default false: the static check only, nothing is started). Claude Code and Antigravity have no listing.'),
133
136
  evalRunId: z.string().max(40).optional().describe('eval_status / eval_cancel / eval_report: the evaluation (evr_…).'),
134
137
  trialId: z.string().max(10).optional().describe('eval_report: one trial of it (t001…): its answer, its grades, its trigger reading.'),
135
138
  purpose: z.enum(['evals', 'final', 'optimise']).optional().describe('eval_start: "evals" (default: the train and validation cases), "final" (only the held-out cases, once, before a publish), "optimise" (rewrite the description on the trigger cases; the best becomes a candidate version).'),
@@ -290,30 +293,80 @@ type Installation = {
290
293
  target?: { runtime?: string; scope?: string; accountId?: string; projectPath?: string | null } | null;
291
294
  destination?: { path?: string; affectedRuntimes?: string[] } | null;
292
295
  state?: { written?: boolean; writtenCheck?: string; verifiedDigest?: string | null; discoverable?: boolean | null; eligibility?: string;
293
- eligibilityByRuntime?: Record<string, string>; discovered?: Record<string, { discovered?: boolean | null }> | null;
296
+ eligibilityByRuntime?: Record<string, string>; eligibilityReasons?: Record<string, { kind?: string; file?: string; rule?: string; key?: string; pattern?: string; message?: string } | null>;
297
+ eligibilityNotChecked?: string[]; discovered?: Record<string, { discovered?: boolean | null; code?: string } | boolean | null> | null;
298
+ staticCheck?: { state?: string; trigger?: string; error?: string; at?: string } | null; probedAt?: string;
294
299
  refresh?: Array<{ runtime?: string; kind?: string; message?: string }>; checks?: Array<{ ok?: boolean; message?: string }>; checkedAt?: string } | null;
295
300
  };
296
301
 
302
+ /** Runtimes with a listing SynaBun can ask (neural-interface/lib/skills/deploy.js PROBEABLE_RUNTIMES). */
303
+ const PROBEABLE = new Set(['codex', 'opencode']);
304
+ const RUNTIME_NAME: Record<string, string> = { claude: 'Claude Code', codex: 'Codex', opencode: 'OpenCode', antigravity: 'Antigravity' };
305
+
306
+ /** Why a runtime's settings say what they say, in a few words (runtime-checks.js eligibilityDetail reasons). */
307
+ function reasonWords(runtime: string, r: NonNullable<NonNullable<Installation['state']>['eligibilityReasons']>[string]): string {
308
+ if (!r?.kind) return '';
309
+ switch (r.kind) {
310
+ case 'not-read': return `SynaBun does not read ${RUNTIME_NAME[runtime] || runtime}'s settings`;
311
+ case 'codex-config': return `turned off in ${r.file} ([[skills.config]] enabled = false)`;
312
+ case 'claude-override': return `turned off in ${r.file} (skillOverrides "${r.key}": "off")`;
313
+ case 'claude-deny': return `denied in ${r.file} (permissions.deny "${r.rule}")`;
314
+ case 'opencode-permission': return `denied in ${r.file} (skill rule "${r.pattern}")`;
315
+ case 'unreadable': return `${r.file} could not be read`;
316
+ case 'invalid-json': return `${r.file} is not valid JSON`;
317
+ case 'error': return `the check failed: ${r.message || 'error'}`;
318
+ default: return r.kind;
319
+ }
320
+ }
321
+
322
+ /** Per runtime: what asking it said, or why it was not asked (deploy.js probeStates, the same rules). */
323
+ function probeWords(runtimes: string[], discovered: NonNullable<Installation['state']>['discovered']): string {
324
+ const d = discovered && typeof discovered === 'object' ? discovered : {};
325
+ return runtimes.map((r) => {
326
+ const v = d[r];
327
+ const answer = v && typeof v === 'object' ? v.discovered : (typeof v === 'boolean' ? v : undefined);
328
+ const code = v && typeof v === 'object' ? v.code : undefined;
329
+ if (answer === true) return `${r} lists it`;
330
+ if (answer === false) return `${r} does not list it`;
331
+ if (!PROBEABLE.has(r) || code === 'no-list') return `${r} cannot be probed (no listing; its folder rules were checked)`;
332
+ if (code === 'terminal-only') return `${r} cannot be probed here (only an OpenCode in a terminal reads this folder)`;
333
+ if (v && typeof v === 'object') return `${r} was asked but did not answer (${code || 'no-answer'})`;
334
+ return `${r} not probed yet (verify probe:true asks it)`;
335
+ }).join('; ');
336
+ }
337
+
297
338
  /**
298
339
  * What the owner installed, as skill-forge's check after a publish reads it (the plan's §5.1.7): exact bytes (the
299
- * digest on disk at the last check against the one approved), whether each runtime can find and use it, and the
300
- * refresh a running session needs. The re-check itself is the owner's (Skills Studio): this only reads.
340
+ * digest on disk at the last check against the one approved), whether each runtime can find it and may use it (per
341
+ * runtime, with the runtimes SynaBun did not check named), whether each runtime was or can be asked, and the
342
+ * refresh a running session needs. A record from before the per-runtime fields reads as before.
301
343
  */
302
344
  export function installationsText(list: Installation[]): string {
303
345
  if (!list.length) return 'Not installed anywhere yet: the owner installs it from Skills Studio after approving the review.';
304
346
  return list.map((i) => {
305
347
  const t = i.target || {};
306
348
  const st = i.state || {};
349
+ const runtimes = Array.isArray(i.destination?.affectedRuntimes) && i.destination.affectedRuntimes.length ? i.destination.affectedRuntimes : (t.runtime ? [t.runtime] : []);
307
350
  const where = `${t.runtime || '?'} ${t.scope === 'project' ? `project ${t.projectPath}` : `user${t.accountId && t.accountId !== 'default' ? ` (account ${t.accountId})` : ''}`}`;
308
351
  const bytes = st.writtenCheck === 'verified' || (st.writtenCheck === undefined && st.written && st.verifiedDigest && st.verifiedDigest === i.export?.artifactDigest)
309
352
  ? 'the approved bytes'
310
353
  : st.writtenCheck === 'changed' ? 'CHANGED since the install (not the approved bytes)' : st.writtenCheck === 'missing' ? 'MISSING from its folder' : 'not checked yet';
311
- const found = st.discovered ? Object.entries(st.discovered).map(([r, d]) => `${r} ${d?.discovered === true ? 'found it' : d?.discovered === false ? 'did not find it' : 'unknown'}`).join(', ') : 'not probed';
354
+ const byRuntime = st.eligibilityByRuntime && typeof st.eligibilityByRuntime === 'object' ? st.eligibilityByRuntime : null;
355
+ const notChecked = Array.isArray(st.eligibilityNotChecked) ? st.eligibilityNotChecked : (byRuntime ? Object.keys(byRuntime).filter((r) => byRuntime[r] === 'not-checked') : []);
356
+ const aggregate = `${st.eligibility || 'unknown'}${notChecked.length && byRuntime && Object.keys(byRuntime).length > notChecked.length ? ` (over the runtimes checked; not checked: ${notChecked.join(', ')})` : ''}`;
357
+ const settings = byRuntime
358
+ ? Object.entries(byRuntime).map(([r, v]) => { const why = reasonWords(r, st.eligibilityReasons?.[r] || null); return `${r} ${v === 'not-checked' ? 'not checked' : v}${why ? ` (${why})` : ''}`; }).join('; ')
359
+ : '';
360
+ const checked = st.staticCheck?.state === 'ok' || st.discoverable === true || st.discoverable === false;
312
361
  const refresh = (st.refresh || []).map((r) => r.message).filter(Boolean).join(' ');
313
362
  const problems = (st.checks || []).filter((c) => c.ok === false).map((c) => c.message).filter(Boolean);
314
363
  return [
315
364
  `- ${i.installationId}${i.active === false ? ' (replaced)' : ''}: ${where} → ${i.destination?.path || '?'}, revision ${i.sourceRevisionId}`,
316
- ` bytes: ${bytes}; discoverable: ${st.discoverable === true ? 'yes' : st.discoverable === false ? 'no' : 'unknown'}; eligibility: ${st.eligibility || 'unknown'}; runtimes: ${found}${st.checkedAt ? `; checked ${st.checkedAt}` : ''}`,
365
+ ` bytes: ${bytes}; discoverable: ${st.discoverable === true ? 'yes' : st.discoverable === false ? 'no' : 'unknown'}; eligibility: ${aggregate}${checked && st.checkedAt ? `; checked ${st.checkedAt}` : ''}`,
366
+ ...(settings ? [` settings: ${settings}`] : []),
367
+ ...(runtimes.length ? [` runtimes: ${probeWords(runtimes, st.discovered)}${st.probedAt ? `; probed ${st.probedAt}` : ''}`] : []),
368
+ ...(st.staticCheck?.state === 'error' ? [` check after install failed: ${st.staticCheck.error || 'error'} (the install itself is in place; skill verify runs the check again)`] : []),
369
+ ...(!checked && st.staticCheck?.state !== 'error' ? [` not checked yet: skill verify installationId ${i.installationId} runs the static check`] : []),
317
370
  ...(problems.length ? [` problems: ${problems.slice(0, 4).join(' / ')}`] : []),
318
371
  ...(refresh ? [` refresh: ${refresh}`] : []),
319
372
  ].join('\n');
@@ -579,6 +632,26 @@ async function run(args: Args): Promise<Result> {
579
632
  const list = (args.installationId ? [res.installation] : (res.installations as Installation[] | undefined) || []) as Installation[];
580
633
  return text(cap(installationsText(list)));
581
634
  }
635
+ case 'verify': {
636
+ // The static check (or, with probe, Codex / OpenCode asked too) of one installation, or of every active one of
637
+ // a skill. Writes only the stored check (POST /installations/:id/check).
638
+ const body = { probe: args.probe === true };
639
+ let ids: string[];
640
+ if (args.installationId) ids = [args.installationId];
641
+ else if (args.skillId) {
642
+ res = await ni.skillsV2('GET', `/installations${qs({ skillId: args.skillId, active: 'true' })}`);
643
+ if (res.error) return failure(action, res);
644
+ ids = ((res.installations as Installation[] | undefined) || []).map((i) => i.installationId).slice(0, 20);
645
+ if (!ids.length) return text(installationsText([]));
646
+ } else return text('skill verify needs skillId or installationId.');
647
+ const checked: Installation[] = [];
648
+ for (const id of ids) {
649
+ res = await ni.skillsV2('POST', `/installations/${encodeURIComponent(id)}/check`, body);
650
+ if (res.error) return failure(action, res);
651
+ checked.push(res.installation as Installation);
652
+ }
653
+ return text(cap(`Checked ${checked.length === 1 ? '1 installation' : `${checked.length} installations`}${body.probe ? ' (Codex and OpenCode asked where they read the folder)' : ' statically (nothing was started)'}; no file or install was changed.\n${installationsText(checked)}`));
654
+ }
582
655
  default:
583
656
  return text(`Unknown skill action "${String(action)}".`);
584
657
  }
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod/v3';
2
2
  import { text } from './response.js';
3
3
  import { isBrowserV2Enabled, reportRuntimeTools, type RuntimeToolsReport } from '../services/neural-interface.js';
4
- import { ALWAYS_ON_TOOLS, GATED_GROUP_IDS, TOOL_GROUPS, sortGroups, toolsOfGroup } from '../services/tool-catalog.js';
5
- import { resolveToolList, type AddedGroup } from '../services/tool-list.js';
4
+ import { ALWAYS_ON_TOOLS, GATED_GROUP_IDS, TOOL_GROUPS, groupOfTool, sortGroups, toolGroup, toolsOfGroup } from '../services/tool-catalog.js';
5
+ import { describeToolListProblems, resolveToolList, type AddedGroup, type ToolListProblem } from '../services/tool-list.js';
6
6
  import { legacyProfileValue, persistRuntimeTools, runtimeToolsWithExternalRefs, type ToolApplyResult, type ToolRuntime } from '../services/tool-runtime.js';
7
7
 
8
8
  export const toolGroupsSchema = {
@@ -90,6 +90,20 @@ function changeNote(change: RuntimeToolsChange): string {
90
90
  return 'Loaded; continue after the refresh.';
91
91
  }
92
92
 
93
+ /**
94
+ * agents-p4: a `team` item (the group or its tool) asked of this runtime, said as what is true here: the team tool
95
+ * comes with a team slice and never with a list, so a runtime without team context is told it is for team workers
96
+ * only (not that it should have it), and one that has it is told it is there already.
97
+ */
98
+ function runtimeTeamProblem(problem: ToolListProblem, runtime: ToolRuntime): ToolListProblem {
99
+ const group = toolGroup(problem.item)?.gate ? problem.item : groupOfTool(problem.item);
100
+ if (problem.reason !== 'gated' || !group || toolGroup(group)?.gate !== 'context:team') return problem;
101
+ const hint = runtime.getActiveGroups().has(group)
102
+ ? `${group} is already in this runtime: this run works a team slice, so call the ${group} tool; no list adds or removes it`
103
+ : `the ${group} tool is for workers of a team slice only, and this runtime has no team context: SynaBun gives it to a team's worker by itself from its first turn, and no tool list or tool_groups call adds it`;
104
+ return { ...problem, hint };
105
+ }
106
+
93
107
  /** Keep what the runtime added before for the groups it still has, then what this change added. */
94
108
  function mergeAdded(previous: readonly AddedGroup[], next: readonly AddedGroup[], groups: readonly string[]): AddedGroup[] {
95
109
  const merged = new Map<string, AddedGroup>();
@@ -139,11 +153,12 @@ export async function handleToolGroups(runtime: ToolRuntime, args: { action: str
139
153
  if (args.groups.some(item => item.startsWith('mcp:'))) return text(JSON.stringify({ ok: false, code: 'TOOLS_INVALID', message: 'External MCP servers are fixed for this run; dispatch again with those refs in tools.' }));
140
154
  const resolved = resolveToolList(args.groups, { source: 'runtime' });
141
155
  if (!resolved.ok) {
156
+ const problems = resolved.problems.map((problem) => runtimeTeamProblem(problem, runtime));
142
157
  return text(JSON.stringify({
143
158
  ok: false,
144
159
  code: resolved.code,
145
- problems: resolved.problems,
146
- message: `${resolved.message}. Call tool_groups action="get" for the catalog.`,
160
+ problems,
161
+ message: `${describeToolListProblems(resolved.code, problems)}. Call tool_groups action="get" for the catalog.`,
147
162
  }, null, 2));
148
163
  }
149
164
  const groups = args.action === 'add' ? sortGroups([...runtime.getGroups(), ...resolved.groups]) : resolved.groups;
@@ -7179,6 +7179,9 @@
7179
7179
  "state_attention": "Needs attention",
7180
7180
  "state_unverified_runtime": "Files checked; runtime execution is unverified",
7181
7181
  "state_checked": "Checks completed; execution is unverified",
7182
+ "state_static_only": "Files, folder rules and settings checked; no runtime listing here that SynaBun can ask",
7183
+ "unverifiedRuntimes": "Not confirmed yet: {runtimes}",
7184
+ "staticOnlyRuntimes": "Checked without a listing (none to ask): {runtimes}",
7182
7185
  "state_error": "Check failed",
7183
7186
  "issue_missing": "Installed folder is missing",
7184
7187
  "issue_changed": "Installed bytes changed",
@@ -7186,6 +7189,7 @@
7186
7189
  "issue_not_discoverable": "Runtime discovery rules no longer find it",
7187
7190
  "issue_disabled": "Disabled in runtime settings",
7188
7191
  "issue_not_listed": "Runtime did not list it",
7192
+ "issue_static_check_failed": "The static check of this installation failed",
7189
7193
  "issue_scan_review": "Security findings need review",
7190
7194
  "issue_scan_blocked": "Security check blocks use of these bytes",
7191
7195
  "issue_check_error": "Could not complete all checks",
@@ -8488,7 +8492,18 @@
8488
8492
  "no-answer": "{runtime} did not answer, so it could not be asked: Verify again in a moment",
8489
8493
  "no-list": "{runtime} has no list to ask; its folder rules were checked instead",
8490
8494
  "terminal-only": "{runtime} in a terminal reads this folder; SynaBun's {runtime} panel does not, so it was not asked"
8491
- }
8495
+ },
8496
+ "eligibilityRuntime": {
8497
+ "enabled": "{runtime}: enabled in its settings",
8498
+ "disabled": "{runtime}: turned off in its settings",
8499
+ "unknown": "{runtime}: its settings could not be read",
8500
+ "not-checked": "{runtime}: settings not checked (SynaBun does not read them)"
8501
+ },
8502
+ "probe": {
8503
+ "cannot-probe": "{runtime} cannot be asked: it has no list (its folder rules were checked)",
8504
+ "not-probed": "{runtime} not asked yet: Verify asks it"
8505
+ },
8506
+ "checkFailed": "The check after the install failed ({error}); the install is in place. Verify checks it again."
8492
8507
  },
8493
8508
  "readBy": "Read by {runtimes}",
8494
8509
  "blocked": {
@@ -9436,12 +9451,99 @@
9436
9451
  "unreachableTitle": "Agents Studio could not reach the server"
9437
9452
  },
9438
9453
  "rail": {
9454
+ "work": "Work",
9455
+ "agents": "Agents",
9439
9456
  "library": "Library",
9440
9457
  "create": "Create",
9441
- "review": "Review",
9458
+ "review": "Definition reviews",
9442
9459
  "teams": "Teams",
9443
9460
  "waiting": "waiting for review",
9444
- "byStatus": "By status"
9461
+ "taskStatus": "Task status"
9462
+ },
9463
+ "work": {
9464
+ "title": "Work",
9465
+ "needsYou": "Needs you",
9466
+ "active": "Active",
9467
+ "inReview": "In review",
9468
+ "finished": "Finished",
9469
+ "task": "Task",
9470
+ "progress": "Progress",
9471
+ "who": "Project / workers",
9472
+ "oneWorker": "1 worker",
9473
+ "teamOf": "Team of {count}",
9474
+ "noWorkers": "No workers",
9475
+ "noProject": "Project unavailable",
9476
+ "untitled": "Untitled task",
9477
+ "answer": "Answer",
9478
+ "openTask": "Open task",
9479
+ "viewProgress": "View progress",
9480
+ "reviewLand": "Review and land on {branch}",
9481
+ "readReport": "Read report",
9482
+ "viewOutcome": "View outcome",
9483
+ "waiting": "Waiting for your answer.",
9484
+ "waitingOn": "Waiting for your answer on {subject}.",
9485
+ "permission": "A worker needs your permission.",
9486
+ "decision": "A worker is waiting for your decision.",
9487
+ "failedPart": "{part} could not finish.",
9488
+ "failedTests": "{part} tests failed.",
9489
+ "failedTestsSafe": "{part} tests failed. {other} changes are safe.",
9490
+ "failedTask": "The worker could not finish.",
9491
+ "teamFailed": "The team could not finish.",
9492
+ "noCommand": "{count} parts joined. No test command set.",
9493
+ "noCommandOne": "1 part joined. No test command set.",
9494
+ "noCommandUnknown": "No test command set.",
9495
+ "noPass": "Current commit has no passing check.",
9496
+ "branchMissing": "The destination branch {branch} is missing.",
9497
+ "branchMoved": "The destination branch {branch} has moved.",
9498
+ "landingBlocked": "The team cannot land its changes yet.",
9499
+ "previewMissing": "Landing checks are unavailable.",
9500
+ "attention": "The team needs your attention.",
9501
+ "partial": "{arrived} reports arrived. {missing} reviewers returned none.",
9502
+ "partialOneMissing": "{arrived} reports arrived. 1 reviewer returned none.",
9503
+ "partialOneArrived": "1 report arrived. {missing} reviewers returned none.",
9504
+ "partialOneEach": "1 report arrived. 1 reviewer returned none.",
9505
+ "reportsUnknown": "Review finished. Report availability is unconfirmed.",
9506
+ "reportsReady": "Review finished. All {count} reports available.",
9507
+ "reportReady": "Review finished. The report is available.",
9508
+ "onBranch": "Changes are on {branch}. Check the remaining work.",
9509
+ "landedCheck": "Changes landed. Check whether anything remains.",
9510
+ "copies": "Landed on {branch}. {count} working copies remain.",
9511
+ "copy": "Landed on {branch}. 1 working copy remains.",
9512
+ "dirty": "{part} has {count} uncommitted files.",
9513
+ "dirtyOne": "{part} has 1 uncommitted file.",
9514
+ "landed": "Changes landed and working copies were removed.",
9515
+ "discarded": "The task was discarded.",
9516
+ "discardedCheck": "The task was discarded. Check whether anything remains.",
9517
+ "working": "Work is in progress.",
9518
+ "workingPart": "{part} is in progress.",
9519
+ "workingJoined": "{count} parts joined. {part} in progress.",
9520
+ "workingJoinedOne": "1 part joined. {part} in progress.",
9521
+ "ready": "Checks passed. Ready to land on {branch}.",
9522
+ "queued": "Waiting for a worker to start.",
9523
+ "paused": "Work is paused.",
9524
+ "idle": "The worker is waiting for more work.",
9525
+ "stopped": "Work stopped.",
9526
+ "completed": "Work finished.",
9527
+ "reportKept": "Work finished. The report is available.",
9528
+ "loading": "Loading tasks",
9529
+ "empty": "Nothing needs an answer or review",
9530
+ "missingTeams": "Team tasks are unavailable.",
9531
+ "missingRuns": "Worker tasks and questions are unavailable.",
9532
+ "missingDetails": "Some team details are unavailable.",
9533
+ "offline": "Connection lost. Reconnect to update tasks.",
9534
+ "retry": "Retry connection",
9535
+ "refresh": "Refresh tasks",
9536
+ "capped": "Showing the latest 500 worker records. Earlier tasks may be missing.",
9537
+ "freeText": "Your answer",
9538
+ "custom": "Another answer",
9539
+ "yes": "Yes",
9540
+ "no": "No",
9541
+ "submit": "Send answer",
9542
+ "sent": "Answer sent.",
9543
+ "stale": "This question was answered elsewhere or closed.",
9544
+ "answerFailed": "The answer could not be sent. Try again.",
9545
+ "answerUnsupported": "This server cannot accept an answer here.",
9546
+ "required": "Answer each required question."
9445
9547
  },
9446
9548
  "tab": {
9447
9549
  "edit": "Edit",
@@ -9627,7 +9729,7 @@
9627
9729
  "layout": "Layout",
9628
9730
  "layoutCards": "Cards",
9629
9731
  "layoutList": "List",
9630
- "newAgent": "New agent",
9732
+ "newAgent": "Create agent",
9631
9733
  "fromTemplate": "From a template",
9632
9734
  "import": "Import",
9633
9735
  "exportAll": "Export all",
@@ -9820,7 +9922,7 @@
9820
9922
  },
9821
9923
  "describe": {
9822
9924
  "name": "Describe it",
9823
- "desc": "Tell the Assistant what you need. It drafts the agent and sends it to Review."
9925
+ "desc": "Tell the Assistant what you need. It drafts the agent for you to review."
9824
9926
  }
9825
9927
  },
9826
9928
  "step": {
@@ -9871,9 +9973,9 @@
9871
9973
  "send": "Send to the Assistant",
9872
9974
  "review": "The draft arrives in the Review queue.",
9873
9975
  "required": "Describe the agent first.",
9874
- "sent": "Sent to the Assistant. The draft appears in Review when it is ready.",
9875
- "arrived": "A draft arrived in Review.",
9876
- "openReview": "Open Review",
9976
+ "sent": "Sent to the Assistant. The draft appears in Definition reviews when it is ready.",
9977
+ "arrived": "A draft is ready for review.",
9978
+ "openReview": "Open definition reviews",
9877
9979
  "request": "Draft a SynaBun agent definition from this description, check it, and submit it for my review in Agents Studio (do not approve it):",
9878
9980
  "requestGlobal": "Put it in the global library.",
9879
9981
  "requestProject": "Pin it to the project {path}."
@@ -10036,6 +10138,7 @@
10036
10138
  "nothingHelp": "Save a draft first."
10037
10139
  },
10038
10140
  "teams": {
10141
+ "manage": "Manage teams",
10039
10142
  "readOnly": "Read-only workers. Results need no integration or landing.",
10040
10143
  "sub": "One task given to several agents, each in its own worktree.",
10041
10144
  "emptyTitle": "No teams yet",
@@ -10045,7 +10148,7 @@
10045
10148
  "notRunning": "This server has the team routes, but its team scheduler is not running yet: it starts with the Assistant.",
10046
10149
  "goneTitle": "This team is not available",
10047
10150
  "goneHelp": "It was removed or discarded, or this server does not have the team routes yet.",
10048
- "backToList": "All teams",
10151
+ "backToList": "Back",
10049
10152
  "summary": "Team summary",
10050
10153
  "status": "Status",
10051
10154
  "project": "Project",
@@ -10101,6 +10204,28 @@
10101
10204
  "yourBranch": "your branch",
10102
10205
  "landedToast": "Landing started.",
10103
10206
  "landFailed": "The team could not be landed: {error}",
10207
+ "landTip": "Current tip",
10208
+ "landTipMissing": "Branch not found",
10209
+ "landHead": "Integration head",
10210
+ "landTests": "Tests on this head",
10211
+ "landTestsNotPassed": "Not passed",
10212
+ "landNoTestCommand": "No test command",
10213
+ "landStale": "The branch or the team's work changed since this dialog opened. Nothing was landed.",
10214
+ "landStaleAgain": "These are the values now. Confirm again to land them, or cancel.",
10215
+ "landUntested": "Land without tests",
10216
+ "landUntestedHelp": "Your own decision: land work that no test verified",
10217
+ "landUntestedTitle": "Land \"{name}\" without tests?",
10218
+ "landUntestedAsk": "{branch} will be moved to the team's integrated result.",
10219
+ "landUntestedWarn": "This work was not verified by tests: no test run passed on this head. Landing it is your own decision.",
10220
+ "landWhy": {
10221
+ "TESTS_NOT_PASSED": "Land is not offered: the tests have not passed on the integration head.",
10222
+ "NO_TEST_COMMAND": "Land is not offered: this team has no test command, so no test verified its work.",
10223
+ "NOT_FAST_FORWARD": "Land is not offered: {branch} has commits the team's work lacks, so it cannot be moved forward to it.",
10224
+ "NOTHING_TO_LAND": "Nothing to land: {branch} already has everything the team integrated.",
10225
+ "TEAM_NOT_READY": "Land is not offered yet: not every slice is joined on the integration branch.",
10226
+ "TARGET_NOT_FOUND": "Land is not offered: the branch {branch} is not in this project.",
10227
+ "other": "Land is not offered for this team right now."
10228
+ },
10104
10229
  "discard": "Discard",
10105
10230
  "discardTitle": "Discard \"{name}\"?",
10106
10231
  "discardAsk": "The team's workers are stopped and its worktrees and branches are removed. A worktree or branch that holds work that was never landed is kept: you can delete it afterwards.",
@@ -10308,7 +10433,7 @@
10308
10433
  "testStarted": "Test run started.",
10309
10434
  "focusFailed": "The run could not be focused: {error}",
10310
10435
  "sentToAssistant": "Sent to the Assistant.",
10311
- "draftArrived": "A new draft arrived in Review."
10436
+ "draftArrived": "A new draft is ready for review."
10312
10437
  }
10313
10438
  },
10314
10439
  "context": {
@@ -14129,6 +14254,24 @@
14129
14254
  "kindKilled": "ended by force",
14130
14255
  "kindInterrupted": "interrupted"
14131
14256
  },
14257
+ "launchBlock": {
14258
+ "label": "Runs keep failing to start in a browser profile",
14259
+ "title": "Runs in {profile} keep failing to start.",
14260
+ "countToday": "{count} launches in a row failed, the last at {time}.",
14261
+ "countEarlier": "{count} launches in a row failed, the last on {date} at {time}.",
14262
+ "launches": "Last affected: {names}.",
14263
+ "errorTitle": "What the browser answered",
14264
+ "restartedFailed": "SynaBun restarted the profile once at {time} and the next launch failed too.",
14265
+ "restartFailed": "SynaBun tried to restart the profile at {time} and could not.",
14266
+ "notRestarted": "SynaBun did not restart the profile.",
14267
+ "fixTitle": "How to fix it",
14268
+ "fixRestart": "Stop the profile and start it again, in MoreLogin or in Settings → Connected tools → MoreLogin. If the tab the error names opens again and freezes, close it.",
14269
+ "fixStartLimit": "MoreLogin allows no more starts of this profile today. Wait for its daily reset, raise the plan, or keep the profile open so runs need no new start.",
14270
+ "fixCheck": "Check the profile in MoreLogin or in Settings → Connected tools → MoreLogin: that it still exists, that MoreLogin is open, and that it starts.",
14271
+ "profileNamed": "\"{name}\"",
14272
+ "profileById": "profile {id}",
14273
+ "dismiss": "Dismiss"
14274
+ },
14132
14275
  "ownerAuthority": {
14133
14276
  "peerUnavailable": "SynaBun could not check which program sent this ({reason}), so it refused to act as the owner. Reload the page to try again. If it keeps happening, start SynaBun outside any sandbox, or turn this check off with SYNABUN_PEER_IDENTITY=off in ~/.synabun/.env and restart SynaBun.",
14134
14277
  "proxyRefused": "Your browser reaches SynaBun through {name} (pid {pid}), a proxy or relay, so SynaBun can't tell it is you and refused this. Let the browser connect directly: add localhost and 127.0.0.1 to the proxy's bypass list (macOS: System Settings › Network › your network › Details › Proxies › Bypass proxy settings for these Hosts & Domains; or the list in the proxy app or browser extension), or turn the proxy off for SynaBun, then reload."