@andorra-labs/code 0.1.9 → 0.1.10

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 (96) hide show
  1. package/dist/src/agent-execution.js +20 -0
  2. package/dist/src/app-server/protocol.d.ts +108 -1
  3. package/dist/src/app-server/protocol.js +8 -1
  4. package/dist/src/app-server.d.ts +25 -0
  5. package/dist/src/app-server.js +156 -11
  6. package/dist/src/auth/index.d.ts +1 -1
  7. package/dist/src/auth/index.js +1 -1
  8. package/dist/src/auth/store.d.ts +17 -1
  9. package/dist/src/auth/store.js +25 -2
  10. package/dist/src/browser-ui/app.js +19 -19
  11. package/dist/src/browser-ui/index.html +7 -7
  12. package/dist/src/cli.js +10 -5
  13. package/dist/src/commands.d.ts +1 -1
  14. package/dist/src/commands.js +1 -1
  15. package/dist/src/completion-gates.js +1 -1
  16. package/dist/src/completion.d.ts +1 -1
  17. package/dist/src/completion.js +1 -1
  18. package/dist/src/decision/checks.js +1 -1
  19. package/dist/src/file-diff.d.ts +105 -0
  20. package/dist/src/file-diff.js +244 -0
  21. package/dist/src/graph-manager-chat.js +15 -15
  22. package/dist/src/graph-server.js +9 -9
  23. package/dist/src/graph-ui/app.js +123 -118
  24. package/dist/src/graph-ui/embed.js +9 -9
  25. package/dist/src/graph-ui/icons.js +1 -0
  26. package/dist/src/graph-ui/index.html +3 -3
  27. package/dist/src/graph-ui/manager-state.js +3 -3
  28. package/dist/src/graph-ui/manager.js +14 -14
  29. package/dist/src/graph-ui/skill-picker.js +6 -6
  30. package/dist/src/graph-ui/studio-canvas.js +15 -15
  31. package/dist/src/graph-ui/studio.js +40 -40
  32. package/dist/src/graph-ui/style.css +3 -1
  33. package/dist/src/graph-ui/theme.js +2 -2
  34. package/dist/src/graphs.d.ts +7 -1
  35. package/dist/src/graphs.js +12 -2
  36. package/dist/src/mcp.d.ts +75 -0
  37. package/dist/src/mcp.js +240 -8
  38. package/dist/src/membership-errors.js +1 -1
  39. package/dist/src/provider-keys.d.ts +5 -1
  40. package/dist/src/provider-keys.js +7 -3
  41. package/dist/src/provider-settings.d.ts +4 -1
  42. package/dist/src/provider-settings.js +46 -5
  43. package/dist/src/qa/guidance.js +6 -19
  44. package/dist/src/qa/index.d.ts +0 -2
  45. package/dist/src/qa/index.js +0 -2
  46. package/dist/src/qa/profile/QaProfile.d.ts +5 -1
  47. package/dist/src/qa/profile/QaProfile.js +6 -2
  48. package/dist/src/qa/tools.d.ts +19 -1
  49. package/dist/src/qa/tools.js +20 -145
  50. package/dist/src/react-runtime.js +13 -2
  51. package/dist/src/remote/engine-pool.js +18 -6
  52. package/dist/src/screen-selection.d.ts +38 -0
  53. package/dist/src/screen-selection.js +103 -0
  54. package/dist/src/session-changes.d.ts +117 -0
  55. package/dist/src/session-changes.js +796 -0
  56. package/dist/src/stall-recovery.d.ts +11 -0
  57. package/dist/src/stall-recovery.js +12 -0
  58. package/dist/src/telemetry/schema.d.ts +1 -1
  59. package/dist/src/telemetry/schema.js +1 -2
  60. package/dist/src/terminal-ui.d.ts +64 -20
  61. package/dist/src/terminal-ui.js +310 -80
  62. package/dist/src/tool-diff-stats.d.ts +9 -0
  63. package/dist/src/tool-diff-stats.js +20 -0
  64. package/dist/src/tool-names.d.ts +1 -1
  65. package/dist/src/tool-result-filter.js +1 -1
  66. package/dist/src/tools.js +26 -2
  67. package/dist/src/transcript.d.ts +11 -0
  68. package/dist/src/transcript.js +14 -2
  69. package/dist/src/types.d.ts +6 -0
  70. package/docs/guides/desktop-app.md +1 -1
  71. package/docs/guides/tui.md +9 -9
  72. package/package.json +1 -1
  73. package/dist/src/qa/api/http-runner.d.ts +0 -3
  74. package/dist/src/qa/api/http-runner.js +0 -47
  75. package/dist/src/qa/git/ChangeDetector.d.ts +0 -26
  76. package/dist/src/qa/git/ChangeDetector.js +0 -177
  77. package/dist/src/qa/git/DiffReviewer.d.ts +0 -28
  78. package/dist/src/qa/git/DiffReviewer.js +0 -115
  79. package/dist/src/qa/orchestrator/ChangeClassifier.d.ts +0 -14
  80. package/dist/src/qa/orchestrator/ChangeClassifier.js +0 -28
  81. package/dist/src/qa/orchestrator/MergeGate.d.ts +0 -14
  82. package/dist/src/qa/orchestrator/MergeGate.js +0 -40
  83. package/dist/src/qa/orchestrator/QaOrchestrator.d.ts +0 -79
  84. package/dist/src/qa/orchestrator/QaOrchestrator.js +0 -373
  85. package/dist/src/qa/runners/CommandRunner.d.ts +0 -22
  86. package/dist/src/qa/runners/CommandRunner.js +0 -96
  87. package/dist/src/qa/runners/TestRunner.d.ts +0 -21
  88. package/dist/src/qa/runners/TestRunner.js +0 -66
  89. package/dist/src/qa/runtime/RuntimeSmoke.d.ts +0 -11
  90. package/dist/src/qa/runtime/RuntimeSmoke.js +0 -78
  91. package/dist/src/qa/runtime-detect.d.ts +0 -10
  92. package/dist/src/qa/runtime-detect.js +0 -72
  93. package/dist/src/qa/security/DependencyScanner.d.ts +0 -19
  94. package/dist/src/qa/security/DependencyScanner.js +0 -167
  95. package/dist/src/qa/security/SecretScanner.d.ts +0 -3
  96. package/dist/src/qa/security/SecretScanner.js +0 -55
@@ -106,12 +106,12 @@
106
106
  }
107
107
  function describeDiff(before, after) {
108
108
  const delta = diffGraph(before, after);
109
- return 'Added nodes: ' + (delta.added.join(', ') || 'none') +
110
- '\nRemoved nodes: ' + (delta.removed.join(', ') || 'none') +
111
- '\nChanged nodes: ' + (delta.changed.join(', ') || 'none') +
109
+ return 'Added steps: ' + (delta.added.join(', ') || 'none') +
110
+ '\nRemoved steps: ' + (delta.removed.join(', ') || 'none') +
111
+ '\nChanged steps: ' + (delta.changed.join(', ') || 'none') +
112
112
  '\nConnections added: ' + delta.edgesAdded +
113
113
  '\nConnections removed: ' + delta.edgesRemoved +
114
- '\nGraph settings changed: ' + (JSON.stringify({
114
+ '\nWorkflow settings changed: ' + (JSON.stringify({
115
115
  name: before.name, entry: before.entry, limits: before.limits, widgets: before.widgets,
116
116
  inputSchema: before.inputSchema, stateSchema: before.stateSchema, metadata: before.metadata
117
117
  }) !== JSON.stringify({
@@ -133,7 +133,7 @@
133
133
  state.pendingProviderNodes = null;
134
134
  install?.();
135
135
  render(); fit();
136
- status(message || 'Draft loaded. Save a revision to publish it.');
136
+ status(message || 'Draft loaded. Save it to publish it.');
137
137
  return true;
138
138
  }
139
139
 
@@ -143,7 +143,7 @@
143
143
  async function importGraphJson(data) {
144
144
  if (typeof canCreateGraph === 'function' && !canCreateGraph()) throw new Error(FREE_CREATE_TIP);
145
145
  if (!data || typeof data !== 'object' || Array.isArray(data) || !data.nodes || typeof data.nodes !== 'object'
146
- || Array.isArray(data.nodes) || !Array.isArray(data.edges)) throw new Error('The file is not an Andorra graph.');
146
+ || Array.isArray(data.nodes) || !Array.isArray(data.edges)) throw new Error('The file is not an Andorra workflow.');
147
147
  const next = { ...data, id: newId(), revision: 0 };
148
148
  delete next.editorMigration;
149
149
  delete next.pendingProviderNodes; // a shared file never carries this editor's draft marker
@@ -158,8 +158,8 @@
158
158
  const pending = Object.values(validated.graph.nodes)
159
159
  .filter(node => node.type === 'agent' && !node.provider).map(node => node.id);
160
160
  if (await applyDraft(validated.graph, pending.length
161
- ? 'Imported graph. Assign a model profile to every outlined node, then save.'
162
- : 'Imported graph validated. Save its first revision.',
161
+ ? 'Imported workflow. Assign a model profile to every outlined step, then save.'
162
+ : 'Imported workflow validated. Save it to keep it.',
163
163
  // The install runs after applyDraft's marker-stripping copy, so the requirements are
164
164
  // mirrored onto the live draft here — that mirror is what an autosave persists and a
165
165
  // later draft recovery restores.
@@ -171,32 +171,32 @@
171
171
  }
172
172
  async function importGraphFile(file) {
173
173
  if (!file) throw new Error('Choose a JSON file first.');
174
- if (file.size > 450 * 1024) throw new Error('The JSON file exceeds the graph size limit.');
174
+ if (file.size > 450 * 1024) throw new Error('The JSON file exceeds the workflow size limit.');
175
175
  return importGraphJson(JSON.parse(await file.text()));
176
176
  }
177
177
 
178
178
  function openImport() {
179
- modal('Import graph JSON', body => {
180
- paragraph(body, 'Import creates a new graph ID and never overwrites the original graph. Only validated graph JSON is accepted.');
179
+ modal('Import workflow JSON', body => {
180
+ paragraph(body, 'Import creates a new workflow ID and never overwrites the original workflow. Only validated workflow JSON is accepted.');
181
181
  // The app's drop zone and Browse button; the platform's bare file input only where that
182
182
  // layer is absent.
183
183
  const picker = typeof globalThis.AndorraControls?.filePicker === 'function'
184
- ? globalThis.AndorraControls.filePicker({ accept: '.json,application/json', label: 'Choose a graph JSON file', hint: 'or drop it here · up to 450 KB' })
184
+ ? globalThis.AndorraControls.filePicker({ accept: '.json,application/json', label: 'Choose a workflow JSON file', hint: 'or drop it here · up to 450 KB' })
185
185
  : (() => {
186
186
  const input = element('input');
187
187
  input.type = 'file';
188
188
  input.accept = '.json,application/json';
189
- input.setAttribute('aria-label', 'Choose graph JSON');
189
+ input.setAttribute('aria-label', 'Choose workflow JSON');
190
190
  return { element: input, file: () => input.files?.[0] };
191
191
  })();
192
192
  const feedback = element('p', '', 'help');
193
193
  feedback.setAttribute('role', 'status');
194
194
  body.append(picker.element, feedback);
195
- body.append(action('Import as new graph', async () => {
195
+ body.append(action('Import as New Workflow', async () => {
196
196
  const chosen = picker.file();
197
197
  if (!chosen) throw new Error('Choose a JSON file first.');
198
198
  if (await importGraphFile(chosen)) {
199
- feedback.textContent = 'Import complete: new unsaved graph ready.';
199
+ feedback.textContent = 'Import complete: new unsaved workflow ready.';
200
200
  }
201
201
  }, 'primary'));
202
202
  });
@@ -248,7 +248,7 @@
248
248
  } else base.name = 'QA Gate';
249
249
  }
250
250
  const validated = await api('/api/validate', { graph: base });
251
- await applyDraft(validated.graph, 'Template created. Review permissions and save a revision.');
251
+ await applyDraft(validated.graph, 'Template created. Review permissions and save.');
252
252
  }
253
253
 
254
254
  function openTemplates() {
@@ -276,17 +276,17 @@
276
276
  const rows = await api('/api/graphs/' + encodeURIComponent(graphId) + '/revisions');
277
277
  // A different graph may have been opened before the revision list loaded.
278
278
  if (state.graph !== graphAtOpen || graphFingerprint() !== fingerprint) return;
279
- modal('Saved revision history', (body, dialog) => {
279
+ modal('Version history', (body, dialog) => {
280
280
  const controller = new AbortController();
281
281
  dialog.addEventListener('close', () => controller.abort(), { once: true });
282
282
  const current = () => !controller.signal.aborted && dialog.open &&
283
283
  state.graph === graphAtOpen && graphFingerprint() === fingerprint;
284
- paragraph(body, 'Snapshots are immutable. Restoring a past revision opens a draft; saving creates a new revision.');
285
- if (!rows.length) { paragraph(body, 'No saved revisions. Save this graph first.'); return; }
284
+ paragraph(body, 'Snapshots are immutable. Restoring a past version opens a draft; saving creates a new version.');
285
+ if (!rows.length) { paragraph(body, 'No saved versions. Save this workflow first.'); return; }
286
286
  for (const row of rows) {
287
287
  const item = element('section', undefined, 'studio-history-row');
288
- item.append(element('strong', 'Revision ' + row.revision + ' · ' + row.name));
289
- paragraph(item, row.nodeCount + ' nodes · ' + row.edgeCount + ' connections' +
288
+ item.append(element('strong', 'Version ' + row.revision + ' · ' + row.name));
289
+ paragraph(item, row.nodeCount + ' steps · ' + row.edgeCount + ' connections' +
290
290
  (row.updatedAt ? ' · ' + new Date(row.updatedAt).toLocaleString() : ''));
291
291
  const detail = element('pre', '', 'studio-code');
292
292
  const fetchRevision = async () => {
@@ -299,13 +299,13 @@
299
299
  if (!snapshot || !current()) return;
300
300
  detail.textContent = describeDiff(snapshot, graphAtOpen);
301
301
  }));
302
- item.append(action('Restore as draft', async () => {
302
+ item.append(action('Restore as Draft', async () => {
303
303
  if (!current()) return;
304
304
  const snapshot = await fetchRevision();
305
305
  if (!snapshot || !current()) return;
306
306
  const next = { ...snapshot, id: graphId === 'default' ? newId() : graphId,
307
307
  revision: graphId === 'default' ? 0 : baseRevision };
308
- if (await applyDraft(next, 'Restored revision ' + row.revision + ' into a draft. Save to publish it.')) {
308
+ if (await applyDraft(next, 'Restored version ' + row.revision + ' into a draft. Save to publish it.')) {
309
309
  shut(dialog);
310
310
  }
311
311
  }, 'primary'));
@@ -342,7 +342,7 @@
342
342
  body.append(row);
343
343
  }
344
344
  const results = element('pre', '', 'studio-code');
345
- body.append(action('Preview routing', async () => {
345
+ body.append(action('Preview Routing', async () => {
346
346
  const choices = {};
347
347
  for (const [id, select] of inputs) choices[id] = select.value ? { outcome: select.value } : {};
348
348
  for (const [id, input] of mockOutputs) {
@@ -356,7 +356,7 @@
356
356
  const fingerprint = graphFingerprint();
357
357
  const candidate = await api('/api/preview', { graph: state.graph, choices });
358
358
  if (!acceptPreviewIfCurrent(candidate, fingerprint)) {
359
- results.textContent = 'Graph changed during preview. Run the preview again against the updated draft.';
359
+ results.textContent = 'Workflow changed during preview. Run the preview again against the updated draft.';
360
360
  return;
361
361
  }
362
362
  const steps = preview.steps.map((step, i) => (i + 1) + '. ' + step.nodeName + ' → ' + step.outcome +
@@ -369,8 +369,8 @@
369
369
  renderCanvas();
370
370
  }, 'primary'));
371
371
  body.append(results);
372
- body.append(action('How to run live', () => {
373
- paragraph(body, 'Open Andorra Code in your project, select the saved graph using /graph, then enter your task. The CLI retains its normal permission and approval gates. Save the draft first.');
372
+ body.append(action('How to Run Live', () => {
373
+ paragraph(body, 'Open Andorra Code in your project, select the saved workflow using /graph, then enter your task. The CLI retains its normal permission and approval gates. Save the draft first.');
374
374
  }));
375
375
  }, true);
376
376
  }
@@ -399,16 +399,16 @@
399
399
  if (node?.type === 'agent') {
400
400
  const region = section(parent, 'Context preview');
401
401
  paragraph(region, 'Inspect configured instructions, context sharing, permissions, and approximate prompt size. Runtime messages may differ.');
402
- region.append(action('Preview effective settings', () => {
402
+ region.append(action('Preview Effective Settings', () => {
403
403
  const pre = element('pre', contextPreview(node), 'studio-code');
404
404
  region.replaceChildren(pre);
405
- region.prepend(action('Refresh preview', () => { pre.textContent = contextPreview(node); }));
405
+ region.prepend(action('Refresh Preview', () => { pre.textContent = contextPreview(node); }));
406
406
  }));
407
407
  }
408
408
  if (node && liveEvents.length && runMatchesCanvas()) {
409
409
  const events = liveEvents.filter(event => event.nodeId === node.id);
410
410
  if (events.length) {
411
- const region = section(parent, 'Selected run — node activity');
411
+ const region = section(parent, 'Selected run — step activity');
412
412
  const totals = nodeActivityTotals(events);
413
413
  const completion = events.filter(event => event.type === 'graph.node.completed').at(-1);
414
414
  paragraph(region, 'Latest outcome: ' + (completion?.outcome || 'pending') +
@@ -432,7 +432,7 @@
432
432
  for (const key of targets) { const opt = element('option', key); opt.value = key; dest.append(opt); }
433
433
  for (const key of sources) { const opt = element('option', key); opt.value = key; source.append(opt); }
434
434
  region.append(element('span', 'Destination field'), dest, element('span', 'Source output field'), source);
435
- region.append(action('Create mapping', () => {
435
+ region.append(action('Create Mapping', () => {
436
436
  mutate(() => { edge.inputMapping ||= {}; edge.inputMapping[dest.value] = '$source.output.' + source.value; }, true);
437
437
  renderInspector();
438
438
  }, 'primary'));
@@ -440,7 +440,7 @@
440
440
  }
441
441
  if (selectedNodes().length > 1) {
442
442
  const region = section(parent, 'Layout group');
443
- region.append(action('Group selected nodes (Ctrl/Cmd+G)', createGroup));
443
+ region.append(action('Group Selected Steps (Ctrl/Cmd+G)', createGroup));
444
444
  }
445
445
  }
446
446
 
@@ -452,13 +452,13 @@
452
452
 
453
453
  async function createGroup() {
454
454
  const nodes = selectedNodes().filter(node => node.agentRole !== 'orchestrator');
455
- if (nodes.length < 2) { status('Select at least two nodes to group.', true); return; }
455
+ if (nodes.length < 2) { status('Select at least two steps to group.', true); return; }
456
456
  const ids = new Set(nodes.map(node => node.id));
457
457
  if (!canCreateLayoutGroup(state.graph?.metadata?.studioLayoutGroupsV1 || [], ids)) {
458
- status('A graph supports at most 50 layout groups. Remove or merge a group before creating another.', true);
458
+ status('A workflow supports at most 50 layout groups. Remove or merge a group before creating another.', true);
459
459
  return;
460
460
  }
461
- const name = await askText({ title: 'Name this layout group', label: 'Layout group name', value: 'New group', confirmLabel: 'Create group', maxLength: 80 });
461
+ const name = await askText({ title: 'Name this layout group', label: 'Layout group name', value: 'New group', confirmLabel: 'Create Group', maxLength: 80 });
462
462
  if (!name) return;
463
463
  if (!name.trim() || name.length > 80) { status('Group names must contain 1–80 characters.', true); return; }
464
464
  mutate(() => {
@@ -469,7 +469,7 @@
469
469
  id: 'group-' + crypto.randomUUID().slice(0, 8), name: name.trim(), nodeIds: [...ids],
470
470
  }];
471
471
  }, true);
472
- status('Layout group created. Groups are saved with the graph.');
472
+ status('Layout group created. Groups are saved with the workflow.');
473
473
  }
474
474
 
475
475
  function renderDebugger() {
@@ -479,16 +479,16 @@
479
479
  const log = $studio('studio-run-log');
480
480
  if (!debuggerOpen || !log) return;
481
481
  log.replaceChildren();
482
- if (!selectedRun) { paragraph(log, 'Select a saved run to inspect its node transitions.'); return; }
482
+ if (!selectedRun) { paragraph(log, 'Select a saved run to inspect its step transitions.'); return; }
483
483
  const matchesCanvas = runMatchesCanvas();
484
484
  if (!matchesCanvas && liveEvents.length) {
485
- paragraph(log, 'Historical run differs from the current graph revision or unsaved draft. Canvas overlays and node navigation are disabled.');
485
+ paragraph(log, 'Historical run differs from the current workflow version or unsaved draft. Canvas overlays and step navigation are disabled.');
486
486
  }
487
487
  for (const event of liveEvents.slice(-100).reverse()) {
488
488
  const item = element('button', undefined, 'studio-run-event');
489
489
  const focusId = event.nodeId || event.source;
490
490
  const name = (matchesCanvas ? state.graph?.nodes[focusId]?.name : undefined)
491
- || focusId || 'Graph';
491
+ || focusId || 'Workflow';
492
492
  item.textContent = (event.time ? new Date(event.time).toLocaleTimeString() + ' · ' : '') +
493
493
  name + ' · ' + event.type +
494
494
  (event.outcome ? ' (' + event.outcome + ')' : '') +
@@ -666,7 +666,7 @@
666
666
  const panel = element('section', undefined, 'studio-run-panel');
667
667
  panel.id = 'studio-run-panel'; panel.hidden = true;
668
668
  const head = element('div', undefined, 'studio-run-head');
669
- head.append(element('strong', 'Graph execution timeline'));
669
+ head.append(element('strong', 'Workflow execution timeline'));
670
670
  const select = element('select'); select.id = 'studio-run-select';
671
671
  select.setAttribute('aria-label', 'Choose saved run');
672
672
  select.onchange = async () => {
@@ -174,7 +174,9 @@ textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
174
174
  font: inherit; font-size: var(--type-xs); font-weight: var(--weight-regular); color: var(--text-3); cursor: pointer;
175
175
  }
176
176
  .graph-drafts-clear:hover:not(:disabled), .graph-drafts-toggle:hover { background: var(--hover, var(--rail-wash)); color: var(--text); }
177
- .graph-drafts-toggle { justify-self: start; margin: 2px var(--space-1) 0; }
177
+ .graph-drafts-toggle { justify-self: start; margin: 2px var(--space-1) 0; display: inline-flex; align-items: center; gap: var(--space-1); }
178
+ .graph-drafts-toggle .icon { flex: none; transition: transform var(--dur-1) var(--ease-standard); }
179
+ .graph-drafts-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
178
180
  .graph-row.draft-row span { color: var(--text-2); }
179
181
  .graph-row.draft-row small { font-variant-numeric: tabular-nums; }
180
182
  .graph-row {
@@ -46,8 +46,8 @@
46
46
  toggle.hidden = embedded;
47
47
  toggle.textContent = theme === 'dark' ? 'Light' : 'Dark';
48
48
  toggle.setAttribute('aria-label', theme === 'dark'
49
- ? 'Switch the graph editor to the light appearance'
50
- : 'Switch the graph editor to the dark appearance');
49
+ ? 'Switch the Workflow Editor to the light appearance'
50
+ : 'Switch the Workflow Editor to the dark appearance');
51
51
  }
52
52
  // The canvas draws its connection colours from the tokens, so a change repaints them.
53
53
  document.dispatchEvent(new CustomEvent('andorra:themechange', { detail: theme }));
@@ -177,9 +177,15 @@ export interface Graph {
177
177
  [key: string]: unknown;
178
178
  };
179
179
  }
180
- export declare const GRAPH_TOOLS: readonly ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "PowerShell", "NativeExec", "AsyncProcess", "PowerShellFast", "ShellMetrics", "read_file", "list_files", "search_files", "write_file", "edit_file", "read", "write", "edit", "find", "grep", "ls", "powershell", "bash", "shell", "git_read", "read_artifact", "write_artifact", "repo_explore", "memory_search", "set_timer", "pull_request", "graphs", "qa.inspect_project", "qa.status", "qa.fast", "qa.deep", "qa.test", "qa.terminal", "qa.security", "qa.browser", "qa.browser_session", "browser.solve_captcha", "web_search", "read_skill_resource", "browser.panel", "browser.incognito"];
180
+ export declare const GRAPH_TOOLS: readonly ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "PowerShell", "NativeExec", "AsyncProcess", "PowerShellFast", "ShellMetrics", "read_file", "list_files", "search_files", "write_file", "edit_file", "read", "write", "edit", "find", "grep", "ls", "powershell", "bash", "shell", "git_read", "read_artifact", "write_artifact", "repo_explore", "memory_search", "set_timer", "pull_request", "graphs", "qa.terminal", "qa.browser", "qa.browser_session", "browser.solve_captcha", "web_search", "read_skill_resource", "browser.panel", "browser.incognito"];
181
181
  /** QA tool names are an explicit allowlist; gating keys off membership, never a name prefix. */
182
182
  export declare const QA_TOOL_NAMES: readonly string[];
183
+ /**
184
+ * The QA check pipeline, removed: these tools ran lint, tests and a merge gate that the agent's
185
+ * own shell commands already cover, at about two extra requests per run. A saved graph may still
186
+ * list them in a node's tools; they are dropped on load instead of failing the graph.
187
+ */
188
+ export declare const RETIRED_GRAPH_TOOLS: ReadonlySet<string>;
183
189
  export declare const isQaToolName: (name: string) => boolean;
184
190
  export declare const LEGACY_DEFAULT_HARNESS: Graph;
185
191
  /** The intake role is configuration for the shared executor, not a separate runtime. */
@@ -6,9 +6,15 @@ import { acquireSaveLock, archiveUnpublishedSnapshot, removeLockedFolder, SaveLo
6
6
  import { validateMappingConstants, validateMappings, validateSchema, validateValue, schemaAt, nodeOutputSchema } from './handoffs.js';
7
7
  import { CANONICAL_CODING_TOOLS, canonicalToolName, canonicalizeToolList, toolNameMatches } from './tool-names.js';
8
8
  import { DEFAULT_AGENT_GRAPH } from './default-graph.js';
9
- export const GRAPH_TOOLS = [...CANONICAL_CODING_TOOLS, 'NativeExec', 'AsyncProcess', 'PowerShellFast', 'ShellMetrics', 'read_file', 'list_files', 'search_files', 'write_file', 'edit_file', 'read', 'write', 'edit', 'find', 'grep', 'ls', 'powershell', 'bash', 'shell', 'git_read', 'read_artifact', 'write_artifact', 'repo_explore', 'memory_search', 'set_timer', 'pull_request', 'graphs', 'qa.inspect_project', 'qa.status', 'qa.fast', 'qa.deep', 'qa.test', 'qa.terminal', 'qa.security', 'qa.browser', 'qa.browser_session', 'browser.solve_captcha', 'web_search', 'read_skill_resource', 'browser.panel', 'browser.incognito'];
9
+ export const GRAPH_TOOLS = [...CANONICAL_CODING_TOOLS, 'NativeExec', 'AsyncProcess', 'PowerShellFast', 'ShellMetrics', 'read_file', 'list_files', 'search_files', 'write_file', 'edit_file', 'read', 'write', 'edit', 'find', 'grep', 'ls', 'powershell', 'bash', 'shell', 'git_read', 'read_artifact', 'write_artifact', 'repo_explore', 'memory_search', 'set_timer', 'pull_request', 'graphs', 'qa.terminal', 'qa.browser', 'qa.browser_session', 'browser.solve_captcha', 'web_search', 'read_skill_resource', 'browser.panel', 'browser.incognito'];
10
10
  /** QA tool names are an explicit allowlist; gating keys off membership, never a name prefix. */
11
- export const QA_TOOL_NAMES = ['qa.inspect_project', 'qa.status', 'qa.fast', 'qa.deep', 'qa.test', 'qa.terminal', 'qa.security', 'qa.browser'];
11
+ export const QA_TOOL_NAMES = ['qa.terminal', 'qa.browser'];
12
+ /**
13
+ * The QA check pipeline, removed: these tools ran lint, tests and a merge gate that the agent's
14
+ * own shell commands already cover, at about two extra requests per run. A saved graph may still
15
+ * list them in a node's tools; they are dropped on load instead of failing the graph.
16
+ */
17
+ export const RETIRED_GRAPH_TOOLS = new Set(['qa.inspect_project', 'qa.status', 'qa.fast', 'qa.deep', 'qa.test', 'qa.security']);
12
18
  export const isQaToolName = (name) => QA_TOOL_NAMES.includes(name);
13
19
  export const LEGACY_DEFAULT_HARNESS = {
14
20
  schemaVersion: 1, id: 'default', name: 'Software Engineer', revision: 1, entry: 'engineer',
@@ -686,6 +692,8 @@ function validateGraphInternal(value, options = {}) {
686
692
  if (node[k] !== undefined && (typeof node[k] !== 'string' || node[k].length > 100000))
687
693
  fail(`${label}: invalid ${k}`);
688
694
  modelRef(node, label, options);
695
+ if (Array.isArray(node.tools) && node.tools.some(tool => RETIRED_GRAPH_TOOLS.has(tool)))
696
+ node.tools = node.tools.filter(tool => !RETIRED_GRAPH_TOOLS.has(tool));
689
697
  toolsValid(node.tools, label);
690
698
  bounds(node.maxIterations, `${label} maxIterations`, 1000, 0);
691
699
  if (node.maxIterations === 0)
@@ -908,6 +916,8 @@ function validateGraphInternal(value, options = {}) {
908
916
  if (r.outputSchema)
909
917
  objectSchema(r.outputSchema, `${label} role outputSchema`);
910
918
  subagentModelRef({ ...r, provider: r.provider ?? node.provider ?? options.defaultProvider }, `${label} role ${r.id}`, options);
919
+ if (Array.isArray(r.tools) && r.tools.some(tool => RETIRED_GRAPH_TOOLS.has(tool)))
920
+ r.tools = r.tools.filter(tool => !RETIRED_GRAPH_TOOLS.has(tool));
911
921
  toolsValid(r.tools, `${label} role ${r.id}`);
912
922
  if (s.context === 'task-only' && r.inputSchema?.required?.length)
913
923
  fail(`${label}: task-only context cannot supply required inputs for role ${r.id}; select selected context or make the role inputs optional`);
package/dist/src/mcp.d.ts CHANGED
@@ -42,6 +42,80 @@ export declare function mcpCatalogKey(id: string, config: RuntimeMcpServerConfig
42
42
  /** Remembered catalogs as one small file each under the configuration home. Every failure reads as "not remembered". */
43
43
  export declare function mcpCatalogStore(directory: string): McpCatalogStore;
44
44
  export declare function mcpToolName(server: string, tool: string): string;
45
+ /**
46
+ * A server definition as an edit form sent it, applied over the saved one.
47
+ *
48
+ * Environment values and header values are secrets the engine never returns, so the form cannot
49
+ * send them back: an entry whose value is `null` keeps the saved value of that name, an entry with
50
+ * a string is the new value, and a name the edit leaves out is removed. An endpoint sent without
51
+ * the query string the saved one carries (the form is shown it without, since a query can hold a
52
+ * credential) keeps the saved endpoint. The transport may change; whether the server is enabled
53
+ * does not — the switch beside it does that.
54
+ */
55
+ export declare function mergeMcpEdit(saved: McpServerConfig, edit: unknown): McpServerConfig;
56
+ /** Told how a server's connection went, by the task that made it: what the status store records. */
57
+ export type McpStatusReporter = (id: string, config: RuntimeMcpServerConfig, result: McpProbeResult) => void;
58
+ /**
59
+ * A reporter that records what a task's connections answered. A task names a server from the
60
+ * configuration `configured:<id>` (the extension snapshot's namespace, apart from plugins' servers),
61
+ * and the record is filed under the configuration's own id, which is what the settings page lists.
62
+ */
63
+ export declare function mcpTaskStatusReporter(directory: string): McpStatusReporter;
64
+ /** What a server last answered — to a task's connection or an explicit check — and when. */
65
+ export interface McpStatusRecord {
66
+ id: string;
67
+ /** The definition it answered for (`mcpDefinitionKey`): an edited server has no status yet. */
68
+ definition: string;
69
+ state: 'ready' | 'failed';
70
+ tools?: number;
71
+ error?: string;
72
+ checkedAt: string;
73
+ source: 'task' | 'check';
74
+ }
75
+ /**
76
+ * The identity of a server's definition — command, arguments, environment, address, headers — and
77
+ * not whether it is turned on, so a status survives the switch but not an edit. Credentials in the
78
+ * definition only enter the digest.
79
+ */
80
+ export declare function mcpDefinitionKey(config: RuntimeMcpServerConfig): string;
81
+ /**
82
+ * The last thing each server answered, one small file per server under the configuration home, so a
83
+ * settings page can show it without starting anything. A task's connection writes it, and so does an
84
+ * explicit check (`mcp.status`); one file per server keeps two processes recording at once from
85
+ * overwriting each other's servers. Every failure to read reads as "not checked".
86
+ */
87
+ export declare function mcpStatusStore(directory: string): {
88
+ list(): Promise<McpStatusRecord[]>;
89
+ record(id: string, config: RuntimeMcpServerConfig, result: McpProbeResult, source: McpStatusRecord['source'], at?: Date): Promise<McpStatusRecord>;
90
+ };
91
+ /** What a configured server answered when it was asked for its tools outside a task. */
92
+ export type McpProbeResult = {
93
+ state: 'ready';
94
+ tools: number;
95
+ } | {
96
+ state: 'failed';
97
+ error: string;
98
+ };
99
+ /**
100
+ * Start one configured server, list its tools, and stop it again: the check a person asks for from
101
+ * the settings page ("Check Connection"), never one a page makes on its own — a task asks before it
102
+ * connects a server, and opening a page is not that consent.
103
+ *
104
+ * Nothing is kept. The catalog is only counted, and the client — with the process it started, for a
105
+ * stdio server — is closed before this returns, whatever happened. A probe is bounded in time as a
106
+ * task's connection is: 15 seconds to connect, 15 per page of tools, 30 in all.
107
+ */
108
+ export declare function probeMcpServer(config: RuntimeMcpServerConfig, workspace: string, signal?: AbortSignal): Promise<McpProbeResult>;
109
+ /**
110
+ * Why a probe failed, in words a person can act on.
111
+ *
112
+ * A transport error can carry what the server sent back, and an HTTP one can echo the request's own
113
+ * headers, so the message itself is never passed on: the error is sorted into a known kind, and only
114
+ * the facts that are the configuration's own (its command) or the protocol's (a status code) are named.
115
+ */
116
+ export declare function probeFailureReason(error: unknown, config: Pick<McpServerConfig, 'transport'> & {
117
+ command?: string;
118
+ }): string;
45
119
  /**
46
120
  * Each task owns its clients; no server tools or spawned processes survive task exit.
47
121
  *
@@ -57,6 +131,7 @@ export declare function mcpToolName(server: string, tool: string): string;
57
131
  */
58
132
  export declare function connectMcpServers(servers: Record<string, RuntimeMcpServerConfig>, context: ToolContext, notice: (message: string) => void, taskSignal?: AbortSignal, options?: {
59
133
  catalogs?: McpCatalogStore;
134
+ status?: McpStatusReporter;
60
135
  }): Promise<{
61
136
  tools: Tool[];
62
137
  close(): Promise<void>;