@andorra-labs/code 0.1.5 → 0.1.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.
- package/dist/src/account-presentation.js +3 -3
- package/dist/src/agent-execution.d.ts +2 -0
- package/dist/src/agent-execution.js +526 -41
- package/dist/src/agent-mcp-catalog.d.ts +21 -0
- package/dist/src/agent-mcp-catalog.js +40 -0
- package/dist/src/agent-mcp.d.ts +36 -3
- package/dist/src/agent-mcp.js +114 -45
- package/dist/src/app-server/protocol.d.ts +57 -5
- package/dist/src/app-server/protocol.js +18 -1
- package/dist/src/app-server/workspace.d.ts +9 -1
- package/dist/src/app-server/workspace.js +50 -3
- package/dist/src/app-server.d.ts +115 -41
- package/dist/src/app-server.js +1316 -221
- package/dist/src/auth/AuthManager.d.ts +33 -1
- package/dist/src/auth/AuthManager.js +138 -10
- package/dist/src/auth/callback-page.d.ts +4 -0
- package/dist/src/auth/callback-page.js +70 -0
- package/dist/src/auth/callback.d.ts +39 -0
- package/dist/src/auth/callback.js +146 -22
- package/dist/src/auth/index.d.ts +10 -6
- package/dist/src/auth/index.js +2 -2
- package/dist/src/auth/store.d.ts +142 -3
- package/dist/src/auth/store.js +334 -13
- package/dist/src/auth/types.d.ts +17 -1
- package/dist/src/auth-commands.d.ts +11 -2
- package/dist/src/auth-commands.js +14 -7
- package/dist/src/automation-runner.d.ts +9 -0
- package/dist/src/automation-runner.js +22 -1
- package/dist/src/automation-tool.js +18 -3
- package/dist/src/automations.d.ts +5 -0
- package/dist/src/automations.js +11 -1
- package/dist/src/browser-captcha-tool.d.ts +54 -0
- package/dist/src/browser-captcha-tool.js +374 -0
- package/dist/src/browser-panel-tool.d.ts +7 -0
- package/dist/src/browser-panel-tool.js +74 -3
- package/dist/src/browser-runner.js +19 -4
- package/dist/src/browser-server.js +21 -1
- package/dist/src/browser-session.d.ts +16 -0
- package/dist/src/browser-session.js +35 -0
- package/dist/src/browser-ui/app.js +193 -3
- package/dist/src/browser-ui/style.css +15 -1
- package/dist/src/browser-view.d.ts +72 -4
- package/dist/src/browser-view.js +229 -17
- package/dist/src/capabilities.d.ts +9 -3
- package/dist/src/capabilities.js +20 -5
- package/dist/src/capsolver.d.ts +60 -0
- package/dist/src/capsolver.js +101 -0
- package/dist/src/claude-provider.d.ts +6 -0
- package/dist/src/claude-provider.js +34 -3
- package/dist/src/cli-executable.d.ts +33 -0
- package/dist/src/cli-executable.js +64 -0
- package/dist/src/cli-process.d.ts +47 -0
- package/dist/src/cli-process.js +113 -0
- package/dist/src/cli-sign-in.d.ts +68 -0
- package/dist/src/cli-sign-in.js +224 -0
- package/dist/src/cli.js +84 -26
- package/dist/src/code-intelligence/CodeIntelligenceManager.d.ts +1 -1
- package/dist/src/code-intelligence/CodeIntelligenceManager.js +5 -5
- package/dist/src/codex-provider.js +12 -0
- package/dist/src/coding-tools.d.ts +5 -0
- package/dist/src/coding-tools.js +98 -53
- package/dist/src/command-output-tap.d.ts +16 -0
- package/dist/src/command-output-tap.js +45 -0
- package/dist/src/command-screens.js +3 -3
- package/dist/src/commands.d.ts +15 -2
- package/dist/src/commands.js +14 -13
- package/dist/src/completion.d.ts +23 -5
- package/dist/src/completion.js +380 -17
- package/dist/src/config.d.ts +61 -0
- package/dist/src/config.js +276 -12
- package/dist/src/context-budget.d.ts +7 -0
- package/dist/src/context-budget.js +18 -1
- package/dist/src/deadline.js +6 -0
- package/dist/src/decision/FactContinuations.d.ts +41 -6
- package/dist/src/decision/FactContinuations.js +211 -64
- package/dist/src/decision/PreparedSteps.js +3 -1
- package/dist/src/decision/checks.d.ts +25 -0
- package/dist/src/decision/checks.js +77 -6
- package/dist/src/delegation-changes.d.ts +109 -0
- package/dist/src/delegation-changes.js +431 -0
- package/dist/src/extensions.d.ts +1 -0
- package/dist/src/extensions.js +16 -3
- package/dist/src/graph-provider-portability.js +2 -2
- package/dist/src/graph-quota.d.ts +1 -1
- package/dist/src/graph-quota.js +1 -1
- package/dist/src/graph-runner.js +35 -21
- package/dist/src/graph-selection.d.ts +6 -0
- package/dist/src/graph-selection.js +10 -0
- package/dist/src/graph-server.d.ts +8 -0
- package/dist/src/graph-server.js +76 -6
- package/dist/src/graph-sync.d.ts +65 -0
- package/dist/src/graph-sync.js +433 -13
- package/dist/src/graph-tool.d.ts +52 -0
- package/dist/src/graph-tool.js +136 -0
- package/dist/src/graph-ui/app.js +272 -50
- package/dist/src/graph-ui/controls.js +6 -0
- package/dist/src/graph-ui/drafts.js +39 -0
- package/dist/src/graph-ui/embed.js +1 -1
- package/dist/src/graph-ui/icons.js +1 -0
- package/dist/src/graph-ui/index.html +2 -2
- package/dist/src/graph-ui/skill-picker.js +242 -0
- package/dist/src/graph-ui/studio.css +7 -5
- package/dist/src/graph-ui/style.css +65 -12
- package/dist/src/graphs.d.ts +60 -5
- package/dist/src/graphs.js +191 -37
- package/dist/src/grok-provider.d.ts +50 -0
- package/dist/src/grok-provider.js +186 -0
- package/dist/src/handoffs.d.ts +13 -0
- package/dist/src/handoffs.js +31 -1
- package/dist/src/hardened-runtime.d.ts +4 -4
- package/dist/src/hardened-runtime.js +109 -9
- package/dist/src/managed-sign-in.d.ts +38 -0
- package/dist/src/managed-sign-in.js +169 -0
- package/dist/src/markdown.d.ts +5 -0
- package/dist/src/markdown.js +5 -2
- package/dist/src/mcp.js +11 -0
- package/dist/src/membership.d.ts +8 -1
- package/dist/src/membership.js +15 -5
- package/dist/src/model-metadata.js +14 -2
- package/dist/src/model-override.d.ts +10 -0
- package/dist/src/model-override.js +20 -0
- package/dist/src/opencode-cli-provider.d.ts +122 -0
- package/dist/src/opencode-cli-provider.js +415 -0
- package/dist/src/opencode-provider.js +23 -8
- package/dist/src/palette.d.ts +2 -0
- package/dist/src/palette.js +2 -0
- package/dist/src/permissions.d.ts +19 -1
- package/dist/src/permissions.js +30 -1
- package/dist/src/powershell-pool.d.ts +11 -2
- package/dist/src/powershell-pool.js +34 -5
- package/dist/src/provider-connection.js +36 -0
- package/dist/src/provider-engine.d.ts +2 -1
- package/dist/src/provider-engine.js +64 -13
- package/dist/src/provider-import.js +6 -1
- package/dist/src/provider-keys.d.ts +48 -0
- package/dist/src/provider-keys.js +121 -0
- package/dist/src/provider-settings.js +22 -3
- package/dist/src/providers.d.ts +12 -1
- package/dist/src/providers.js +27 -8
- package/dist/src/pull-requests.d.ts +123 -20
- package/dist/src/pull-requests.js +334 -84
- package/dist/src/qa/qa-authorize.js +9 -1
- package/dist/src/qa/runtime/ProcessManager.d.ts +6 -0
- package/dist/src/qa/runtime/ProcessManager.js +16 -0
- package/dist/src/react-runtime.js +106 -7
- package/dist/src/read-image.d.ts +30 -0
- package/dist/src/read-image.js +97 -0
- package/dist/src/remote/engine-pool.js +1 -1
- package/dist/src/run-progress.js +6 -1
- package/dist/src/run-records.d.ts +133 -27
- package/dist/src/run-records.js +320 -40
- package/dist/src/runtime.d.ts +38 -1
- package/dist/src/runtime.js +27 -4
- package/dist/src/save-lock.d.ts +11 -0
- package/dist/src/save-lock.js +29 -2
- package/dist/src/secret-redaction.d.ts +13 -0
- package/dist/src/secret-redaction.js +71 -0
- package/dist/src/session-summary.d.ts +10 -4
- package/dist/src/session-summary.js +14 -7
- package/dist/src/sessions.js +8 -2
- package/dist/src/shell.js +4 -1
- package/dist/src/side-panel.d.ts +1 -1
- package/dist/src/side-panel.js +1 -1
- package/dist/src/skill-commands.d.ts +2 -0
- package/dist/src/skill-commands.js +2 -0
- package/dist/src/skills/bundled/create-agent/SKILL.md +81 -0
- package/dist/src/skills/bundled/create-skill/SKILL.md +81 -0
- package/dist/src/skills/bundled/doctor/SKILL.md +43 -0
- package/dist/src/skills/bundled/graph-manager/SKILL.md +100 -0
- package/dist/src/skills/bundled/graph-manager/errors.md +38 -0
- package/dist/src/skills/bundled/graph-manager/patterns.md +78 -0
- package/dist/src/skills/bundled/manage-mcp/SKILL.md +75 -0
- package/dist/src/skills/bundled/manage-mcp/probe.md +165 -0
- package/dist/src/skills/bundled/manage-skills/SKILL.md +67 -0
- package/dist/src/skills/bundled/provenance.json +50 -0
- package/dist/src/skills/bundled/write-instructions/SKILL.md +42 -0
- package/dist/src/skills/invocable-skills.d.ts +41 -0
- package/dist/src/skills/invocable-skills.js +49 -0
- package/dist/src/skills/prompt-skills.d.ts +1 -0
- package/dist/src/skills/prompt-skills.js +33 -0
- package/dist/src/skills/runtime-skills.d.ts +4 -0
- package/dist/src/skills/runtime-skills.js +21 -0
- package/dist/src/structured-step.d.ts +55 -0
- package/dist/src/structured-step.js +85 -0
- package/dist/src/subagent-run.d.ts +1 -1
- package/dist/src/subagent-run.js +29 -33
- package/dist/src/telemetry/schema.d.ts +2 -2
- package/dist/src/telemetry/schema.js +3 -2
- package/dist/src/terminal-ui.d.ts +38 -0
- package/dist/src/terminal-ui.js +126 -28
- package/dist/src/timers.d.ts +21 -2
- package/dist/src/timers.js +12 -4
- package/dist/src/tool-dependencies.js +4 -0
- package/dist/src/tool-names.d.ts +18 -0
- package/dist/src/tool-names.js +26 -0
- package/dist/src/tools.d.ts +9 -0
- package/dist/src/tools.js +159 -20
- package/dist/src/trajectory.js +32 -12
- package/dist/src/transcript.js +5 -0
- package/dist/src/types.d.ts +36 -0
- package/dist/src/web-search.d.ts +59 -0
- package/dist/src/web-search.js +216 -0
- package/docs/agents/README.md +2 -2
- package/docs/agents/mcp-server.md +28 -3
- package/docs/agents/subagent-mode.md +7 -4
- package/docs/concepts/README.md +1 -1
- package/docs/concepts/security.md +4 -2
- package/docs/getting-started/accounts.md +15 -4
- package/docs/getting-started/configure-providers.md +30 -3
- package/docs/guides/README.md +1 -0
- package/docs/guides/browser.md +12 -0
- package/docs/guides/desktop-app.md +11 -4
- package/docs/guides/graph-builder.md +9 -1
- package/docs/guides/web-search.md +47 -0
- package/docs/reference/cli.md +4 -3
- package/docs/reference/config.md +4 -4
- package/docs/reference/slash-commands.md +2 -1
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +125 -0
- package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +295 -0
- package/docs/superpowers/specs/2026-11-01-pr-section-design.md +7 -0
- package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +206 -0
- package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +291 -0
- package/package.json +1 -1
- package/tests/permissions-test-plan.md +2 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { checkSearxngUrl, loadConfig, WEB_SEARCH_KEY_FIELDS, WEB_SEARCH_PROVIDERS } from './config.js';
|
|
2
|
+
/**
|
|
3
|
+
* The native web_search tool and the search services behind it.
|
|
4
|
+
*
|
|
5
|
+
* Each service is one HTTPS request: the API key goes only in that request's header or body, never
|
|
6
|
+
* in an error message or the tool's output. SearXNG is the one keyless backend; it takes the address
|
|
7
|
+
* of an instance the user runs or trusts, and that instance must have the JSON output format enabled.
|
|
8
|
+
*/
|
|
9
|
+
export const WEB_SEARCH_TOOL = 'web_search';
|
|
10
|
+
export const WEB_SEARCH_LABELS = {
|
|
11
|
+
brave: 'Brave Search', tavily: 'Tavily', exa: 'Exa', serper: 'Serper', google: 'Google Programmable Search', searxng: 'SearXNG',
|
|
12
|
+
};
|
|
13
|
+
/** Environment fallbacks, used when the configuration holds no value for that field. */
|
|
14
|
+
export const WEB_SEARCH_ENV = {
|
|
15
|
+
brave: 'BRAVE_API_KEY', tavily: 'TAVILY_API_KEY', exa: 'EXA_API_KEY', serper: 'SERPER_API_KEY',
|
|
16
|
+
google: 'GOOGLE_SEARCH_API_KEY', googleSearchEngineId: 'GOOGLE_SEARCH_ENGINE_ID', searxng: 'SEARXNG_URL',
|
|
17
|
+
};
|
|
18
|
+
const REQUEST_TIMEOUT_MS = 20_000;
|
|
19
|
+
const MAX_QUERY_LENGTH = 400;
|
|
20
|
+
const MAX_RESULTS = 10;
|
|
21
|
+
const DEFAULT_RESULTS = 5;
|
|
22
|
+
const SNIPPET_CHARS = 300;
|
|
23
|
+
const envValue = (env, name) => env[name]?.trim() || undefined;
|
|
24
|
+
/** The provider's credentials when it has everything it needs, otherwise undefined. */
|
|
25
|
+
export function resolveWebSearchProvider(id, config, env = process.env) {
|
|
26
|
+
const saved = config?.webSearch;
|
|
27
|
+
if (id === 'searxng') {
|
|
28
|
+
if (saved?.searxngUrl)
|
|
29
|
+
return { id, source: 'config', url: saved.searxngUrl };
|
|
30
|
+
const fromEnv = envValue(env, WEB_SEARCH_ENV.searxng);
|
|
31
|
+
if (!fromEnv)
|
|
32
|
+
return undefined;
|
|
33
|
+
const checked = checkSearxngUrl(fromEnv);
|
|
34
|
+
return 'url' in checked ? { id, source: 'env', url: checked.url } : undefined;
|
|
35
|
+
}
|
|
36
|
+
const savedKey = saved?.[WEB_SEARCH_KEY_FIELDS[id]];
|
|
37
|
+
const key = savedKey || envValue(env, WEB_SEARCH_ENV[id]);
|
|
38
|
+
if (!key)
|
|
39
|
+
return undefined;
|
|
40
|
+
const source = savedKey ? 'config' : 'env';
|
|
41
|
+
if (id !== 'google')
|
|
42
|
+
return { id, source, key };
|
|
43
|
+
const engineId = saved?.googleSearchEngineId || envValue(env, WEB_SEARCH_ENV.googleSearchEngineId);
|
|
44
|
+
return engineId ? { id, source, key, engineId } : undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The backend a search uses: the default provider when one is chosen, otherwise the first configured
|
|
48
|
+
* one. A chosen default that is not configured is an error rather than a silent switch, so the user
|
|
49
|
+
* learns their choice is not in effect.
|
|
50
|
+
*/
|
|
51
|
+
export function chooseWebSearchProvider(config, env = process.env) {
|
|
52
|
+
const chosen = config?.webSearch?.defaultProvider;
|
|
53
|
+
if (chosen) {
|
|
54
|
+
const provider = resolveWebSearchProvider(chosen, config, env);
|
|
55
|
+
if (provider)
|
|
56
|
+
return provider;
|
|
57
|
+
const missing = chosen === 'searxng' ? `an instance URL (or ${WEB_SEARCH_ENV.searxng})`
|
|
58
|
+
: chosen === 'google' ? `an API key and a search engine ID (or ${WEB_SEARCH_ENV.google} and ${WEB_SEARCH_ENV.googleSearchEngineId})`
|
|
59
|
+
: `an API key (or ${WEB_SEARCH_ENV[chosen]})`;
|
|
60
|
+
throw new Error(`The default web search provider, ${WEB_SEARCH_LABELS[chosen]}, needs ${missing}. Add it in Settings → Web Search, or choose another default.`);
|
|
61
|
+
}
|
|
62
|
+
for (const id of WEB_SEARCH_PROVIDERS) {
|
|
63
|
+
const provider = resolveWebSearchProvider(id, config, env);
|
|
64
|
+
if (provider)
|
|
65
|
+
return provider;
|
|
66
|
+
}
|
|
67
|
+
throw new Error('Web search is not configured. Add a search API key or a SearXNG URL in Settings → Web Search, then retry.');
|
|
68
|
+
}
|
|
69
|
+
/** Text a model can read: tags removed, the common entities decoded, whitespace collapsed, clipped. */
|
|
70
|
+
export function plainSnippet(value, limit = SNIPPET_CHARS) {
|
|
71
|
+
if (typeof value !== 'string')
|
|
72
|
+
return '';
|
|
73
|
+
const text = value.replace(/<[^>]*>/g, '')
|
|
74
|
+
.replace(/&(amp|lt|gt|quot|#39|apos|nbsp);/g, (_, name) => ({ amp: '&', lt: '<', gt: '>', quot: '"', '#39': "'", apos: "'", nbsp: ' ' })[name] ?? '')
|
|
75
|
+
.replace(/\s+/g, ' ').trim();
|
|
76
|
+
return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
|
|
77
|
+
}
|
|
78
|
+
function results(items, map, count) {
|
|
79
|
+
if (!Array.isArray(items))
|
|
80
|
+
return [];
|
|
81
|
+
const found = [];
|
|
82
|
+
for (const item of items) {
|
|
83
|
+
if (!item || typeof item !== 'object')
|
|
84
|
+
continue;
|
|
85
|
+
const mapped = map(item);
|
|
86
|
+
if (typeof mapped.url !== 'string' || !/^https?:\/\//i.test(mapped.url))
|
|
87
|
+
continue;
|
|
88
|
+
found.push({ title: plainSnippet(mapped.title, 200) || mapped.url, url: mapped.url, snippet: plainSnippet(mapped.snippet) });
|
|
89
|
+
if (found.length >= count)
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
return found;
|
|
93
|
+
}
|
|
94
|
+
/** A service may echo the request back; the key never reaches a message. */
|
|
95
|
+
const redact = (text, secret) => secret ? text.split(secret).join('[key]') : text;
|
|
96
|
+
/** Send one request and parse its JSON, with errors that name the service and status but never the key. */
|
|
97
|
+
async function requestJson(label, url, init, request, hint) {
|
|
98
|
+
let response;
|
|
99
|
+
try {
|
|
100
|
+
response = await request.fetch(url, { ...init, signal: request.signal });
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
request.signal.throwIfAborted();
|
|
104
|
+
throw new Error(redact(`${label} request failed: ${error instanceof Error ? error.message : String(error)}`, request.secret).slice(0, 500));
|
|
105
|
+
}
|
|
106
|
+
const raw = await response.text();
|
|
107
|
+
if (!response.ok) {
|
|
108
|
+
const advice = hint?.(response.status) ?? (response.status === 401 || response.status === 403 ? 'Check the API key in Settings → Web Search.'
|
|
109
|
+
: response.status === 429 ? 'The service is rate limiting this key or its quota is used up; wait or switch the default provider.' : '');
|
|
110
|
+
const detail = plainSnippet(redact(raw, request.secret), 200);
|
|
111
|
+
throw new Error(`${label} answered HTTP ${response.status}${detail ? `: ${detail}` : ''}${advice ? ` ${advice}` : ''}`);
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const data = JSON.parse(raw);
|
|
115
|
+
if (data && typeof data === 'object' && !Array.isArray(data))
|
|
116
|
+
return data;
|
|
117
|
+
}
|
|
118
|
+
catch { /* reported below */ }
|
|
119
|
+
throw new Error(`${label} answered HTTP ${response.status} without a JSON object`);
|
|
120
|
+
}
|
|
121
|
+
const json = { 'content-type': 'application/json', accept: 'application/json' };
|
|
122
|
+
/** One function per service: build its request, then map its result list onto title, url and snippet. */
|
|
123
|
+
const BACKENDS = {
|
|
124
|
+
async brave(provider, request) {
|
|
125
|
+
const url = new URL('https://api.search.brave.com/res/v1/web/search');
|
|
126
|
+
url.searchParams.set('q', request.query);
|
|
127
|
+
url.searchParams.set('count', String(request.count));
|
|
128
|
+
const data = await requestJson('Brave Search', url.href, { headers: { accept: 'application/json', 'x-subscription-token': provider.key } }, request);
|
|
129
|
+
const web = data.web;
|
|
130
|
+
return results(web?.results, item => ({ title: item.title, url: item.url, snippet: item.description }), request.count);
|
|
131
|
+
},
|
|
132
|
+
async tavily(provider, request) {
|
|
133
|
+
const data = await requestJson('Tavily', 'https://api.tavily.com/search', {
|
|
134
|
+
method: 'POST', headers: { ...json, authorization: `Bearer ${provider.key}` },
|
|
135
|
+
body: JSON.stringify({ query: request.query, max_results: request.count, search_depth: 'basic' }),
|
|
136
|
+
}, request);
|
|
137
|
+
return results(data.results, item => ({ title: item.title, url: item.url, snippet: item.content }), request.count);
|
|
138
|
+
},
|
|
139
|
+
async exa(provider, request) {
|
|
140
|
+
const data = await requestJson('Exa', 'https://api.exa.ai/search', {
|
|
141
|
+
method: 'POST', headers: { ...json, 'x-api-key': provider.key },
|
|
142
|
+
body: JSON.stringify({ query: request.query, numResults: request.count, contents: { text: { maxCharacters: SNIPPET_CHARS * 2 } } }),
|
|
143
|
+
}, request);
|
|
144
|
+
return results(data.results, item => ({ title: item.title, url: item.url, snippet: item.text ?? item.summary }), request.count);
|
|
145
|
+
},
|
|
146
|
+
async serper(provider, request) {
|
|
147
|
+
const data = await requestJson('Serper', 'https://google.serper.dev/search', {
|
|
148
|
+
method: 'POST', headers: { ...json, 'x-api-key': provider.key },
|
|
149
|
+
body: JSON.stringify({ q: request.query, num: request.count }),
|
|
150
|
+
}, request);
|
|
151
|
+
return results(data.organic, item => ({ title: item.title, url: item.link, snippet: item.snippet }), request.count);
|
|
152
|
+
},
|
|
153
|
+
async google(provider, request) {
|
|
154
|
+
const url = new URL('https://www.googleapis.com/customsearch/v1');
|
|
155
|
+
url.searchParams.set('key', provider.key);
|
|
156
|
+
url.searchParams.set('cx', provider.engineId);
|
|
157
|
+
url.searchParams.set('q', request.query);
|
|
158
|
+
url.searchParams.set('num', String(request.count));
|
|
159
|
+
const data = await requestJson('Google Programmable Search', url.href, { headers: { accept: 'application/json' } }, request, status => status === 400 || status === 403 ? 'Check the API key and search engine ID in Settings → Web Search, and that the Custom Search API is enabled for the key\'s project.' : undefined);
|
|
160
|
+
return results(data.items, item => ({ title: item.title, url: item.link, snippet: item.snippet }), request.count);
|
|
161
|
+
},
|
|
162
|
+
async searxng(provider, request) {
|
|
163
|
+
const url = new URL(`${provider.url}/search`);
|
|
164
|
+
url.searchParams.set('q', request.query);
|
|
165
|
+
url.searchParams.set('format', 'json');
|
|
166
|
+
const data = await requestJson('SearXNG', url.href, { headers: { accept: 'application/json' } }, request, status => status === 403 ? 'The instance refuses JSON output: add "json" to search.formats in its settings.yml.' : undefined);
|
|
167
|
+
return results(data.results, item => ({ title: item.title, url: item.url, snippet: item.content }), request.count);
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
/** Run one search with the chosen backend. */
|
|
171
|
+
export async function webSearch(query, count, signal, dependencies = {}) {
|
|
172
|
+
const config = await (dependencies.loadConfig ?? (() => loadConfig().catch(() => undefined)))();
|
|
173
|
+
signal.throwIfAborted();
|
|
174
|
+
const provider = chooseWebSearchProvider(config, dependencies.env ?? process.env);
|
|
175
|
+
const bounded = AbortSignal.any([signal, AbortSignal.timeout(REQUEST_TIMEOUT_MS)]);
|
|
176
|
+
try {
|
|
177
|
+
return { provider, results: await BACKENDS[provider.id](provider, { query, count, signal: bounded, fetch: dependencies.fetch ?? fetch, secret: provider.key }) };
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
signal.throwIfAborted();
|
|
181
|
+
if (bounded.aborted)
|
|
182
|
+
throw new Error(`${WEB_SEARCH_LABELS[provider.id]} did not answer within ${REQUEST_TIMEOUT_MS / 1000} seconds`);
|
|
183
|
+
throw error;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** The tool's text: a numbered list a model reads and the desktop scans for the sites it found. */
|
|
187
|
+
export function formatWebSearchResults(query, label, found) {
|
|
188
|
+
if (!found.length)
|
|
189
|
+
return `${label} found no results for "${query}".`;
|
|
190
|
+
return [`${label} results for "${query}":`, '', ...found.map((result, index) => [`${index + 1}. ${result.title}`, ` ${result.url}`, ...(result.snippet ? [` ${result.snippet}`] : [])].join('\n'))].join('\n');
|
|
191
|
+
}
|
|
192
|
+
export function createWebSearchTool(dependencies = {}) {
|
|
193
|
+
return {
|
|
194
|
+
name: WEB_SEARCH_TOOL, family: 'web', capability: 'browser', executionMode: 'parallel',
|
|
195
|
+
description: 'Search the web and get a list of results: title, URL and a short snippet for each. Use it for current information, documentation, release notes, error messages and anything outside the workspace; open a result with a browser tool when the snippet is not enough. The search service is the one chosen in Settings → Web Search (Brave, Tavily, Exa, Serper, Google Programmable Search or a SearXNG instance).',
|
|
196
|
+
parameters: { type: 'object', properties: {
|
|
197
|
+
query: { type: 'string', description: 'What to search for, as you would type it into a search engine' },
|
|
198
|
+
count: { type: 'integer', minimum: 1, maximum: MAX_RESULTS, description: `How many results to return; default ${DEFAULT_RESULTS}` },
|
|
199
|
+
}, required: ['query'], additionalProperties: false },
|
|
200
|
+
execute: async (args, context) => {
|
|
201
|
+
if (Object.keys(args).some(key => key !== 'query' && key !== 'count'))
|
|
202
|
+
throw new Error(`Invalid argument; ${WEB_SEARCH_TOOL} accepts query and count`);
|
|
203
|
+
const query = typeof args.query === 'string' ? args.query.replace(/\s+/g, ' ').trim() : '';
|
|
204
|
+
if (!query)
|
|
205
|
+
throw new Error('query must be nonempty text');
|
|
206
|
+
if (query.length > MAX_QUERY_LENGTH)
|
|
207
|
+
throw new Error(`query must be at most ${MAX_QUERY_LENGTH} characters`);
|
|
208
|
+
const count = args.count === undefined ? DEFAULT_RESULTS : args.count;
|
|
209
|
+
if (!Number.isInteger(count) || count < 1 || count > MAX_RESULTS)
|
|
210
|
+
throw new Error(`count must be a whole number from 1 to ${MAX_RESULTS}`);
|
|
211
|
+
context.signal.throwIfAborted();
|
|
212
|
+
const { provider, results: found } = await webSearch(query, count, context.signal, dependencies);
|
|
213
|
+
return formatWebSearchResults(query, WEB_SEARCH_LABELS[provider.id], found);
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
package/docs/agents/README.md
CHANGED
|
@@ -40,13 +40,13 @@ andorra mcp-server --stdio
|
|
|
40
40
|
- **CLI surface** — [Reference: CLI](../reference/cli.md) lists every subcommand and flag; [Reference: slash commands](../reference/slash-commands.md) covers the in-TUI commands.
|
|
41
41
|
- **Headless automation** — `andorra --prompt "..." --json --no-tui` runs one task and prints a machine-readable result object with status, run ID, usage, and tool count. Exit codes: `0` success, `1` failure/exhaustion, `130` cancellation. See [Headless mode](../guides/headless.md).
|
|
42
42
|
- **Workspace instructions** — Andorra reads project-root `ANDORRA.md`, falling back to `AGENTS.md`, then lowercase `agents.md`, only when the preferred file is absent. If you are preparing a repository for Andorra, put workspace instructions in `ANDORRA.md`. See [Workspace instructions](../concepts/workspace-instructions.md).
|
|
43
|
-
- **Driving Andorra over MCP** — The same local stdio MCP server (`andorra mcp-server --stdio`) is how an agent authors and inspects graphs and reports on sessions
|
|
43
|
+
- **Driving Andorra over MCP** — The same local stdio MCP server (`andorra mcp-server --stdio`) is how an agent outside Andorra authors and inspects graphs and reports on sessions. An agent inside one of Andorra's own nodes uses the built-in `graphs` tool, which offers the same graph operations without a server. See [Agent MCP server](mcp-server.md).
|
|
44
44
|
|
|
45
45
|
### Choosing a surface
|
|
46
46
|
|
|
47
47
|
| The task | Use |
|
|
48
48
|
| --- | --- |
|
|
49
|
-
| Create or edit a graph | MCP server (`andorra_graph_*` tools) |
|
|
49
|
+
| Create or edit a graph | MCP server (`andorra_graph_*` tools); inside Andorra, the built-in `graphs` tool |
|
|
50
50
|
| Run one task and read a machine-readable result | `andorra --prompt "..." --json` |
|
|
51
51
|
| Watch sessions, find a run that needs input | MCP session tools |
|
|
52
52
|
| Edit a graph by hand, or show one to a person | Graph Builder (`andorra graph`) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## How it works
|
|
4
4
|
|
|
5
|
-
Andorra Code ships a **local stdio MCP server** for agents that author and inspect graphs
|
|
5
|
+
Andorra Code ships a **local stdio MCP server** for agents that author and inspect graphs from outside Andorra, such as Claude Code, Codex, Hermes and OpenClaw. **This is the supported surface for an outside agent to create or edit a graph.** Agents running inside one of Andorra's own graph nodes do not need it: the engine gives them the same graph operations as its built-in `graphs` tool (see [Inside Andorra](#inside-andorra-the-built-in-graphs-tool)). The [Graph Builder](../guides/graph-builder.md) is the same authoring capability for people, and both write to the same graph store; an agent should not drive that browser UI to author a graph. The server does **not** execute an arbitrary authored graph, and it opens no network listener. It
|
|
6
6
|
does run one fixed graph — the bundled Software Engineer harness — for hosts that want Andorra as
|
|
7
7
|
a subagent (see [Subagent mode](subagent-mode.md)). That fixed harness is the only execution the
|
|
8
8
|
server does: no surface of it selects a graph, and the run it does make permits writes by
|
|
@@ -17,7 +17,7 @@ the workspace it names.
|
|
|
17
17
|
|
|
18
18
|
### Installation and MCP clients
|
|
19
19
|
|
|
20
|
-
Build/install Andorra Code, sign into your paid account to edit graphs, and configure providers from Andorra's /providers screen.
|
|
20
|
+
Build/install Andorra Code, sign into your paid account to edit graphs, and configure providers from Andorra's /providers screen. Then connect the server from the agent host:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
npm install
|
|
@@ -57,13 +57,26 @@ A provider/model is mandatory. Without one the start is refused with `PROVIDER_N
|
|
|
57
57
|
error carries every configured provider with its models, so the calling agent can show the list to
|
|
58
58
|
its user and retry with the choice. The full contract is in [Subagent mode](subagent-mode.md).
|
|
59
59
|
|
|
60
|
+
## Inside Andorra: the built-in `graphs` tool
|
|
61
|
+
|
|
62
|
+
An agent running in an Andorra graph node gets every graph operation below as one built-in tool, `graphs`, with no server to configure and no `andorra` command needed on PATH. It calls `graphs` with `action` set to the operation's name and the operation's arguments in `args`:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{ "action": "andorra_graph_begin", "args": { "mode": "create", "id": "qa-flow", "name": "QA Flow" } }
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- The tool runs the same backend as this server, in the engine's own process. It is loaded the first time a graph action runs, shared by every task in that process, and closed after an hour without graph actions; tasks that never touch graphs pay nothing beyond its one schema.
|
|
69
|
+
- Like other external tools it needs a node with shell permission and is not given to delegated subagents.
|
|
70
|
+
- `andorra_graph_publish`, `andorra_graph_delete` and `andorra_graph_restore` ask for permission like an automation change, and are refused in plan mode. Drafts and reads do not ask.
|
|
71
|
+
- The session, project and subagent tools stay MCP-only.
|
|
72
|
+
|
|
60
73
|
## MCP graph tools
|
|
61
74
|
|
|
62
75
|
| Tool | Purpose |
|
|
63
76
|
| --- | --- |
|
|
64
77
|
| andorra_graph_guide | Returns the architecture, examples, node ports and machine-readable error contract |
|
|
65
78
|
| andorra_providers_list | Provider IDs, models and types, **no credentials** |
|
|
66
|
-
| andorra_graphs_list | List published graph IDs, names and revisions |
|
|
79
|
+
| andorra_graphs_list | List published graph IDs, names and revisions; deleted graphs only with `includeDeleted: true` |
|
|
67
80
|
| andorra_graph_get | Read the exact saved latest or selected immutable revision, without editor-only migration |
|
|
68
81
|
| andorra_graph_begin | Begin new or existing graph draft (mode create/edit, id, name for create); returns draftId |
|
|
69
82
|
| andorra_graph_node_upsert | Create/replace a whole node with prompt, provider, completion, permissions and other settings |
|
|
@@ -75,6 +88,8 @@ its user and retry with the choice. The full contract is in [Subagent mode](suba
|
|
|
75
88
|
| andorra_graph_validate | Validate without saving; return all missing-provider and missing-outcome issues, plus structural error |
|
|
76
89
|
| andorra_graph_publish | Validate and save the next immutable revision, or report revision conflict |
|
|
77
90
|
| andorra_graph_discard | Drop an uncommitted draft |
|
|
91
|
+
| andorra_graph_delete | Soft-delete a graph (`id`, `expectedRevision`, `confirm` repeating the id) after the user confirms in chat |
|
|
92
|
+
| andorra_graph_restore | Restore a soft-deleted graph (`id`, `expectedRevision`) |
|
|
78
93
|
|
|
79
94
|
Graph architecture is also exposed as a resource with URI andorra://graph/architecture. A third-party agent should read this before trying to design workflows. Agent completion outcomes may be pass/fail or custom names, Condition uses true/false ports, Loop uses body/done ports and bounded iteration counts, Approval uses approved/rejected, and Join all cannot wait for mutually exclusive branches. All nodes must be reachable from entry and every declared required outcome must route. See the resource for the full node and edge rules.
|
|
80
95
|
|
|
@@ -117,6 +132,16 @@ Graph architecture is also exposed as a resource with URI andorra://graph/archit
|
|
|
117
132
|
|
|
118
133
|
To make a Loop, create a Loop node with loop.maxIterations and link its body and done ports. Node visits are unlimited by default: `graph.limits.maxNodeVisits` is absent, and `0` there means the same thing. A graph with a return connection still needs a ceiling, so set `graph.limits.maxNodeVisits` high enough for each cycle/reentry, or set `graph.limits.wallTimeMs` to bound the run by the clock instead. The existing graph validator remains the authority for reachable links, cycles, schemas and Join dependencies.
|
|
119
134
|
|
|
135
|
+
### Deleting and restoring a graph
|
|
136
|
+
|
|
137
|
+
Deleting is a soft delete. `andorra_graph_delete` publishes the next revision with `metadata.deletedAt` set; no file is removed, and every earlier revision stays stored locally and in the cloud. Cloud sync carries that revision to the account's other machines like any publish. Removing the files instead would not work: sync restores every graph the account holds.
|
|
138
|
+
|
|
139
|
+
A deleted graph leaves `andorra_graphs_list` (unless `includeDeleted` is true), `/graph`, the desktop graph picker and the Graph Builder, and new runs refuse it with "Graph <name> was deleted. Restore it before running it." A saved default selection that names it falls back to the Default graph until it is restored. Sessions that already ran it keep resuming. `andorra_graph_get` still reads it and reports `deletedAt`; `andorra_graph_begin` with `mode=edit` refuses it.
|
|
140
|
+
|
|
141
|
+
`andorra_graph_restore` publishes the next revision without the marker. A deleted graph still counts toward a free account's one custom graph, so a free account restores it rather than replacing it.
|
|
142
|
+
|
|
143
|
+
Refusals: `DEFAULT_GRAPH` (the Default graph or the Andorra preset), `CONFIRMATION_MISMATCH` (`confirm` is not the id), `GRAPH_IN_USE` (an automation runs the graph; `automations` lists them), `GRAPH_DELETED` (already deleted, or an edit of a deleted graph), `GRAPH_NOT_DELETED` (restore of a live graph), and `REVISION_CONFLICT` when `expectedRevision` is not the latest. `metadata.deletedAt` is reserved: `andorra_graph_patch`, publishing and Graph Builder saves refuse it (`RESERVED_METADATA`), so a graph is deleted only through the delete tool.
|
|
144
|
+
|
|
120
145
|
### Validation errors
|
|
121
146
|
|
|
122
147
|
Every MCP tool returns a JSON text payload with ok/data or ok/error. A failed call sets MCP isError=true. For example, omitting a fail branch yields:
|
|
@@ -124,10 +124,13 @@ classified by the same recovery as any other attempt. The run record carries `su
|
|
|
124
124
|
the permission the run was bound to.
|
|
125
125
|
|
|
126
126
|
A finished run leaves no conversation behind: the checkpoint a stopped attempt needs is deleted
|
|
127
|
-
once the attempt succeeds, because a successful run has nothing to resume.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
once the attempt succeeds, because a successful run has nothing to resume. A journal append the
|
|
128
|
+
file refuses (a full disk, most often) is held and written once appends succeed again, and a
|
|
129
|
+
node's failed checkpoint write is healed by its next successful one. An attempt that stopped while
|
|
130
|
+
something was still missing is marked (`runs/<runId>.journal-error` or `.checkpoint-error`, and
|
|
131
|
+
`journalIntegrity` or `checkpointIntegrity` on the record). A resume of it still goes ahead, because
|
|
132
|
+
a session must always be resumable, and the resumed attempt opens with a warning that a step may
|
|
133
|
+
repeat.
|
|
131
134
|
|
|
132
135
|
The run's own record is durable as it goes: an event is on disk before the run moves on, and the
|
|
133
136
|
checkpoint is written before the run advances past the tool call it describes. A process killed
|
package/docs/concepts/README.md
CHANGED
|
@@ -40,7 +40,7 @@ Saved graphs are immutable revisions. A published revision is never rewritten: a
|
|
|
40
40
|
|
|
41
41
|
## How a task actually runs
|
|
42
42
|
|
|
43
|
-
- **Tools.** Provider-visible coding tools are `Read`, `Write`, `Edit`, `Glob`, `Grep`, `Bash`, and `PowerShell`. CodeGraph/`repo_explore` is attempted before `Grep` for source-discovery tasks; native text search is the fallback. Shell handles Git, package managers, and tests.
|
|
43
|
+
- **Tools.** Provider-visible coding tools are `Read`, `Write`, `Edit`, `Glob`, `Grep`, `Bash`, and `PowerShell`. CodeGraph/`repo_explore` is attempted before `Grep` for source-discovery tasks; native text search is the fallback. Shell handles Git, package managers, and tests. `Read` shows an image file (PNG, JPEG, GIF, WebP, BMP) to the model as a picture, downscaled to 1568 px on its longest edge; when the model endpoint refuses image input, the run drops the images, says so in the transcript and continues on text.
|
|
44
44
|
- **Approvals.** Writes and shell calls ask for approval unless YOLO is enabled for the session. See [Security and permissions](security.md).
|
|
45
45
|
- **Context.** Reads, searches, and output are bounded; stale discovery output shrinks deterministically; older exchanges compact semantically under context pressure. Every ReAct iteration resends the whole conversation, so cumulative token totals measure repeated context, not one giant prompt.
|
|
46
46
|
- **Memory.** Optional persistent project memory (Graphiti) survives across runs; CodeGraph indexes current code structure. See [Memory](memory.md).
|
|
@@ -20,10 +20,12 @@ Headless runs without `--yolo` receive permission-denied observations for writes
|
|
|
20
20
|
|
|
21
21
|
`/permissions` chooses a permission mode and remembers it per workspace (`workspacePermissions` in `config.json`).
|
|
22
22
|
|
|
23
|
+
A mode changed while a task runs applies to that task from its next decision on. In the desktop app (`run.setPermissions`), approvals the task is already waiting on are also checked again under the new mode: one the new mode allows goes through, and one it still requires is asked again. The change is recorded in the run journal as `run.permissions.changed`, followed by the decisions it led to. An escalated shell command approved this way runs on the host only while Full Access is still in force when it starts. A sandboxed command never leaves the sandbox because of a later switch.
|
|
24
|
+
|
|
23
25
|
## Secrets
|
|
24
26
|
|
|
25
|
-
-
|
|
26
|
-
- Andorra account tokens live in the operating system credential store
|
|
27
|
+
- Saved provider API keys live in the operating system credential store (service `Andorra Code provider keys`, one entry per provider in each Andorra home); `config.json` records only `"providerKeys": "keyring"` in their place. A `config.json` from an older version that still holds keys has them moved on the next load. Where Linux or another Unix system has no credential store, or `ANDORRA_CREDENTIAL_STORE=file` is set, keys stay in the owner-only `config.json` as before; on macOS and Windows a locked or failing store is an error rather than a reason to write them there. Keys can also be referenced by environment-variable name. They are never added to command history or displayed in provider summaries.
|
|
28
|
+
- Andorra account tokens live in the operating system credential store. On macOS and Windows a missing or locked credential store is an error and there is no fallback. On Linux and other Unix machines with no credential store at all (a VPS, a container: no Secret Service or no D-Bus session), tokens go to an owner-only file (0600) in the Andorra home instead; a locked or failing store is an error, never a reason to write the file, and login says so; `ANDORRA_CREDENTIAL_STORE=keyring` forbids that file.
|
|
27
29
|
- Codex provider sign-in is delegated to the official Codex CLI app-server; subscription tokens are never copied into Andorra configuration.
|
|
28
30
|
- Do not put credentials in handoff data, graph JSON, `--run-input`/`--run-state` files, or workspace instruction files.
|
|
29
31
|
|
|
@@ -6,17 +6,28 @@ Andorra runs the agent loop and tools on your machine. Your configured LLM provi
|
|
|
6
6
|
|
|
7
7
|
Passwords require at least 8 characters, including uppercase, lowercase, a number, and a symbol. MFA is disabled. Email verification is still required for new accounts.
|
|
8
8
|
|
|
9
|
-
Run `andorra login` before starting the harness, or enter `/login` in an interactive session. Your browser opens the Andorra sign-in page; choose **Sign up** to create an account and verify your email. After successful login the browser returns to a loopback callback on your machine. You can close that browser tab.
|
|
9
|
+
Run `andorra login` before starting the harness, or enter `/login` in an interactive session. On a remote machine, see [Sign in on a remote machine or VPS](#sign-in-on-a-remote-machine-or-vps). Your browser opens the Andorra sign-in page; choose **Sign up** to create an account and verify your email. After successful login the browser returns to a loopback callback on your machine. You can close that browser tab.
|
|
10
10
|
|
|
11
11
|
After login, the account label shows `Signed in | Free | your@email.com` (or `Legacy`, or `Paid`) using your verified email address. The same identity appears in the welcome screen, the persistent account label, and the output of the account commands. If the service cannot supply an email, the label still shows the verified membership status. Logout removes the email from the displayed account status.
|
|
12
12
|
|
|
13
|
-
Run `andorra auth status` or `/auth status` to inspect your saved session. Run `andorra logout`, `/logout` or `/auth logout` to remove it from this machine and revoke its refresh token. These standalone commands do not require an LLM provider, and none of them signs out of an LLM provider; `/logout codex` does that for Codex.
|
|
13
|
+
Run `andorra auth status` or `/auth status` to inspect your saved session. Run `andorra logout`, `/logout` or `/auth logout` to remove it from this machine and revoke its refresh token; nothing of it is left in the credential store. Each Andorra home (`ANDORRACODE_HOME`) signs in separately, and a plain logout only knows its own; `andorra logout --all` (or `/logout --all`) also deletes every other Andorra sign-in the OS credential store holds on this machine. These standalone commands do not require an LLM provider, and none of them signs out of an LLM provider; `/logout codex` does that for Codex.
|
|
14
14
|
|
|
15
15
|
To switch accounts, run `/logout`, then `/login`. Sign-in always asks for credentials, even when the browser still has a session for the previous account, so you can enter another account's email or create a new one.
|
|
16
16
|
|
|
17
|
-
The harness stores tokens in the operating system credential store, not in `config.json`. It renews access tokens automatically. Sessions have no application idle timeout. Expiration, administrative revocation, disabled accounts, or credential-store removal require signing in again. Other machines have separate sessions.
|
|
17
|
+
The harness stores tokens in the operating system credential store, not in `config.json`. It renews access tokens automatically. Sessions have no application idle timeout. Expiration, administrative revocation, disabled accounts, or credential-store removal require signing in again. Other machines have separate sessions.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
On macOS and Windows a missing or locked credential store is an error, and the harness never writes a token file. On Linux and other Unix machines with no credential store at all (no Secret Service, or no D-Bus session), which is what a VPS or container usually is, the session is saved instead to `credentials-<id>.json` in the Andorra home (`~/.andorracode`, or `ANDORRACODE_HOME`), created readable only by your user (mode 0600, in a 0700 directory). `andorra login` names the file when it does this. A credential store that exists but is locked or failing is still an error, because it may hold your session: unlock it, or set `ANDORRA_CREDENTIAL_STORE=file`. Once that file exists it stays the store for that home; `andorra logout` overwrites it with a token-free record, and also revokes and clears a session left in the other store (the keyring, or a file from an earlier fallback), so switching `ANDORRA_CREDENTIAL_STORE` never brings an old login back. Set `ANDORRA_CREDENTIAL_STORE=file` to use the file even where a credential store works, or `ANDORRA_CREDENTIAL_STORE=keyring` to forbid the file and get the old error instead.
|
|
20
|
+
|
|
21
|
+
Login needs an available local callback port 43187 and HTTPS access to the hosted account service.
|
|
22
|
+
|
|
23
|
+
## Sign in on a remote machine or VPS
|
|
24
|
+
|
|
25
|
+
Over SSH, or on a Unix machine without a graphical display, `andorra login` does not try to open a browser. It prints the sign-in address so you can open it in a browser on any device, such as your laptop. Pass `--no-browser` (`andorra login --no-browser`, or `/login --no-browser`) to get the same behavior anywhere. Either of these finishes the sign-in:
|
|
26
|
+
|
|
27
|
+
- **Paste the address back.** After you sign in, the browser goes to `http://localhost:43187/callback?code=…`. That page will not load on your laptop, which is expected. Copy the whole address from the address bar and paste it at the prompt in the remote terminal. Only an address carrying this login's own state is accepted.
|
|
28
|
+
- **Forward the port.** Connect with `ssh -L 43187:localhost:43187 <host>` before running `andorra login`. The browser's redirect then reaches the remote listener through the tunnel, and the sign-in completes on its own.
|
|
29
|
+
|
|
30
|
+
A login waiting on another device times out after 10 minutes (2 minutes when a browser opened locally). Press Ctrl+C to cancel it.
|
|
20
31
|
|
|
21
32
|
## Plans
|
|
22
33
|
|
|
@@ -10,7 +10,7 @@ Use **Add provider** to configure your first provider or add another. Select a p
|
|
|
10
10
|
|
|
11
11
|
## Credentials
|
|
12
12
|
|
|
13
|
-
For hosted APIs, choose **API key** and paste the **actual API key** into the masked field. The key is saved locally with the provider and reused after restarting Andorra. It is not added to command history or displayed in provider summaries. Configuration is stored in `config.json` under `ANDORRACODE_HOME` (default `~/.andorracode`); saved API keys are
|
|
13
|
+
For hosted APIs, choose **API key** and paste the **actual API key** into the masked field. The key is saved locally with the provider and reused after restarting Andorra. It is not added to command history or displayed in provider summaries. Configuration is stored in `config.json` under `ANDORRACODE_HOME` (default `~/.andorracode`); saved API keys are kept in the operating system credential store, not in that file. On Linux without a credential store (or with `ANDORRA_CREDENTIAL_STORE=file`) they stay in the owner-only `config.json`, so keep it private and do not commit or share it. The separate **Environment fallback** field accepts a variable name. A saved key takes precedence; **Remove authentication** clears both.
|
|
14
14
|
|
|
15
15
|
Preset endpoints: DeepSeek uses `https://api.deepseek.com`; Kimi uses `https://api.moonshot.ai/v1`; Kimi For Coding (Global) uses `https://api.kimi.ai/coding/v1` and Kimi For Coding (China) uses `https://api.kimi.com/coding/v1`; GLM Coding Plan (Z.ai) uses `https://api.z.ai/api/coding/paas/v4`. The coding-plan presets come pre-filled with the plan's default model (`kimi-for-coding`, `glm-5.3`) and take the API key from that plan's console — the Kimi Code Console or the Z.ai coding-plan page — not the standard platform key. Codex uses the installed Codex CLI's managed ChatGPT sign-in; subscription tokens are not copied into provider configuration.
|
|
16
16
|
|
|
@@ -24,9 +24,22 @@ An **Anthropic** provider can sign in with a Claude Console account instead of a
|
|
|
24
24
|
|
|
25
25
|
Andorra runs `ant auth login` with `ANTHROPIC_CONFIG_DIR` set to `~/.andorracode/anthropic-accounts/<provider id>`, so each provider keeps its own login and your own `ant` profiles are never read or changed. The Anthropic SDK refreshes the access token from that directory; Andorra never handles the OAuth exchange. **Sign out**, or removing the provider, deletes the directory. New Anthropic providers start on `claude-opus-5-5`; **Discover Models** lists the rest.
|
|
26
26
|
|
|
27
|
+
### Sign in or use an API key
|
|
28
|
+
|
|
29
|
+
In Desktop, **+ Add Provider** lists one card per vendor. A vendor with a subscription sign-in shows two choices side by side before anything is saved: **Sign in with …** (a subscription the vendor's own CLI holds) or **Use an API key**. Choosing one switches the draft's type and endpoint; **Save provider** adds it to the list.
|
|
30
|
+
|
|
31
|
+
| Card | Sign in with … | Use an API key |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| ChatGPT / OpenAI | ChatGPT Plus or Pro through Codex (`codex`) | OpenAI API key (`openai-compatible`) |
|
|
34
|
+
| Claude | Claude Pro or Max through Claude Code (`claude`) | Anthropic API key or Claude Console sign-in (`anthropic`) |
|
|
35
|
+
| Grok / xAI | SuperGrok through the Grok CLI (`grok`) | xAI API key (`openai-compatible`) |
|
|
36
|
+
| OpenCode | The providers connected in the OpenCode CLI (`opencode`) | OpenCode Go key (`opencode-go`) |
|
|
37
|
+
|
|
38
|
+
The sign-in panel runs the vendor CLI's own login on the engine's machine. The login and its tokens stay with that CLI; Andorra never copies them. After a sign-in in the add form, **Discover Models** runs once so the first model can be picked. Sign-in runs only for a local engine; for a remote workspace, sign in with the CLI on that machine.
|
|
39
|
+
|
|
27
40
|
### Claude subscription
|
|
28
41
|
|
|
29
|
-
Choose **Claude
|
|
42
|
+
Choose **Claude**, then **Sign in with Claude**, in Desktop, or **Claude subscription** in `/providers`. Install the native Claude Code CLI. Desktop's **Sign in with Claude** runs `claude auth login --claudeai`, which opens your browser; if the page shows a code instead, paste it into the panel. In the terminal, run `claude auth login` yourself first. Andorra reuses that CLI's managed sign-in; it never copies OAuth access or refresh tokens into its configuration. `ANDORRA_CLAUDE_PATH` can select a native CLI executable when it is not on PATH.
|
|
30
43
|
|
|
31
44
|
**Discover Models** reads the models available to the installed Claude CLI. The CLI must support safe mode, structured JSON output, and the stream-json control protocol. Andorra sends one model step at a time with native tools, MCP servers, hooks, plugins, and workspace customizations disabled. Andorra retains tool execution and permissions. Images use native image blocks. Changing providers does not change JEV or graph selection.
|
|
32
45
|
|
|
@@ -34,6 +47,20 @@ In Desktop, Claude and Go drafts can discover models before saving: choose the p
|
|
|
34
47
|
|
|
35
48
|
Auxiliary requests such as titles, model-health checks, graph generation, and context summaries use a separate tool-free mode with an explicit output cap. This requires native output/budget controls and matching stream usage metadata; incompatible CLI behavior is rejected. An explicit output cap combined with tool execution is not supported.
|
|
36
49
|
|
|
50
|
+
### Grok subscription
|
|
51
|
+
|
|
52
|
+
Choose **Grok / xAI**, then **Sign in with Grok**, in Desktop, or **Grok subscription (Grok CLI)** in `/providers`. Install the Grok CLI. Desktop runs `grok login --device-auth`, opens the xAI page and shows the code to confirm there; in the terminal, run `grok login` yourself. The fixed marker base is `https://api.x.ai`; requests go through the signed-in CLI. `ANDORRA_GROK_PATH` selects the executable when it is neither on PATH nor in `~/.grok/bin`.
|
|
53
|
+
|
|
54
|
+
Andorra sends one model step at a time through `grok --prompt-file … --output-format streaming-messages-json --json-schema …` with built-in tools, subagents, memory, plan mode and web search off, and refuses any native tool call. `XAI_API_KEY` is removed from the CLI's environment, so a signed-out CLI fails instead of billing an API key. Images in the conversation are not forwarded yet; the model is told how many were left out. To use an xAI API key instead, choose **Use an API key** on the same card.
|
|
55
|
+
|
|
56
|
+
### OpenCode
|
|
57
|
+
|
|
58
|
+
Choose **OpenCode**, then **Sign in with OpenCode**, in Desktop, or **OpenCode (CLI sign-in)** in `/providers`. Install the OpenCode CLI (`npm install -g opencode-ai`). Andorra starts a private `opencode serve` on loopback behind a random password the first time it is needed, stops it after five idle minutes, and stops it when the engine exits. Models are every model of every provider OpenCode has connected, named `provider/model` (for example `opencode/big-pickle`).
|
|
59
|
+
|
|
60
|
+
The panel lists the providers OpenCode has connected and the browser sign-ins it offers (ChatGPT, GitHub Copilot, Poe, xAI SuperGrok and others); **Sign in to …** runs that provider's sign-in inside OpenCode and stores the credential where OpenCode keeps it. A sign-in that needs typed input, such as a GitHub Enterprise URL, is left to `opencode auth login` in a terminal. `ANDORRA_OPENCODE_PATH` selects the executable.
|
|
61
|
+
|
|
62
|
+
Each step is a throwaway OpenCode session on an Andorra agent with every built-in tool off and a JSON-schema answer; the session is deleted afterwards. When an upstream provider is rate limited, OpenCode retries on its own schedule, which can be hours away: Andorra fails the step with the provider's reason instead of waiting.
|
|
63
|
+
|
|
37
64
|
### OpenCode Go
|
|
38
65
|
|
|
39
66
|
Choose **OpenCode Go (all model APIs)** and save your Go API key. Its fixed base is `https://opencode.ai/inference/go`. Discovery includes the live Go catalog. The adapter selects Chat Completions, Responses, Anthropic Messages, or Gemini according to verified model metadata. Requests stay on Go endpoints; failures never fall back to pay-as-you-go service. New models with unknown protocol metadata fail explicitly until their metadata is available.
|
|
@@ -100,4 +127,4 @@ Saving setup creates `~/.andorracode/config.json` (override the directory with `
|
|
|
100
127
|
}
|
|
101
128
|
```
|
|
102
129
|
|
|
103
|
-
Supported adapter types are `openai-compatible`, `anthropic`, `codex`, `claude`, and `opencode-go`. Managed CLI providers reject API-key overrides and HTTP timeout fields. The full configuration surface, including limits, memory, and request timeouts, is in [Reference: configuration](../reference/config.md).
|
|
130
|
+
Supported adapter types are `openai-compatible`, `anthropic`, `codex`, `claude`, `grok`, `opencode`, and `opencode-go`. Managed CLI providers reject API-key overrides and HTTP timeout fields. The full configuration surface, including limits, memory, and request timeouts, is in [Reference: configuration](../reference/config.md).
|
package/docs/guides/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Task-oriented how-tos for every client and mode.
|
|
|
7
7
|
- [Headless mode](headless.md) — one-shot runs with `--prompt`, `--json`, exit codes, and `needs_clarification`.
|
|
8
8
|
- [Extensions](extensions.md) — skills, MCP servers, and plugins.
|
|
9
9
|
- [Browser workspace](browser.md) — the `/browser` local web client.
|
|
10
|
+
- [Web search](web-search.md) — the `web_search` tool and its search services.
|
|
10
11
|
- [Desktop client](desktop-app.md) — the Tauri desktop application.
|
|
11
12
|
- [Windows code signing](windows-code-signing.md) — Authenticode signing of the desktop bundles with Azure Artifact Signing, and how to verify a signature.
|
|
12
13
|
- [Update](update.md) — keeping the npm installation current with `andorra update`.
|
package/docs/guides/browser.md
CHANGED
|
@@ -13,3 +13,15 @@ The application belongs to the CLI that launched it. Closing its browser tab lea
|
|
|
13
13
|
The printed URL includes a capability token in its fragment. Keep it private. The server binds only to 127.0.0.1, validates request host/origin and bearer authorization, and uses existing trajectory sanitization for stored tool activity. It does not provide remote access or a cloud relay.
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
|
|
17
|
+
## Captcha solving with CapSolver
|
|
18
|
+
|
|
19
|
+
Agents can solve captchas on pages open in their headless browser (`qa.browser_session`) with the `browser.solve_captcha` tool, using your own [CapSolver](https://www.capsolver.com/) account. The tool supports reCAPTCHA v2 and v3, Cloudflare Turnstile, and image-to-text captchas. With `type` left at `auto`, it reads the widget and its site key from the page, sends the task to CapSolver, writes the returned token into the page's response field and calls the widget's callback. The agent then submits the form. The desktop's Browser panel is not supported.
|
|
20
|
+
|
|
21
|
+
The key is optional. Without one, the tool reports that CapSolver is not configured. To add a key:
|
|
22
|
+
|
|
23
|
+
- In the desktop app, open **Settings → Browser**, paste the key and click **Save**. **Remove** deletes it.
|
|
24
|
+
- Or add `"browser": { "capsolverApiKey": "<key>" }` to `~/.andorracode/config.json`.
|
|
25
|
+
- Or set `CAPSOLVER_API_KEY` in the environment. It is used only when no key is saved.
|
|
26
|
+
|
|
27
|
+
The saved key lives in the configuration file alongside provider API keys. The engine reports only whether a key exists and which one is in use, never the key itself. Each solve spends CapSolver credit and goes through the run's normal approval for browser tools. Use it only on sites you are permitted to automate.
|
|
@@ -165,6 +165,13 @@ each project's plus open; selecting a task replaces it with that task's conversa
|
|
|
165
165
|
which becomes stop while a run holds the engine. The graph control is locked on **Default** without
|
|
166
166
|
paid membership, because every other graph is refused by the run's own membership preflight. The
|
|
167
167
|
metrics strip beneath the card is described below.
|
|
168
|
+
- **Changing permissions while a task runs.** A permission mode picked while a task is running applies
|
|
169
|
+
to that task at once, and is saved as the project's mode for the next task too. An approval card
|
|
170
|
+
waiting on screen is checked again under the new mode: switching to **Full Access** answers it, and
|
|
171
|
+
the tool runs without anyone pressing Approve. A stricter mode reaches the task's next tool call, so
|
|
172
|
+
a write that would have gone through asks first. The transcript notes where the change landed.
|
|
173
|
+
**Project default** names no mode of its own, so picking it changes only what the next task sends.
|
|
174
|
+
A scheduled job's run keeps such a change to itself, as it does its saved mode.
|
|
168
175
|
- **Model override.** A multi-agent graph whose nodes each name their own provider decides its
|
|
169
176
|
models by itself, which leaves the composer nothing to steer with. The **Override models** control
|
|
170
177
|
on the New task screen's row asks for a provider and a model and widens that pair to the whole
|
|
@@ -282,7 +289,7 @@ framing allowance, or older engines will refuse to show it.
|
|
|
282
289
|
The strip under the composer reports the following, measured from the run's own events:
|
|
283
290
|
|
|
284
291
|
```text
|
|
285
|
-
3 turns · 12 steps | LLM 45.2s · Tool call 2m42s |
|
|
292
|
+
3 turns · 12 steps | LLM 45.2s · Tool call 2m42s | Cache hit 95% | Input 12.2K tok · Output 3.4K tok
|
|
286
293
|
```
|
|
287
294
|
|
|
288
295
|
Groups are separated by a pipe and figures inside a group by a mid dot. A group whose measurement is
|
|
@@ -293,12 +300,12 @@ missing is dropped whole rather than printed as a zero. Sources:
|
|
|
293
300
|
| Turns, steps | Assistant turns in the session record; iteration events for the run in flight. |
|
|
294
301
|
| LLM time | Measured between an iteration starting and its model completion arriving. |
|
|
295
302
|
| Tool time | Summed from each tool completion's own `durationMs`. |
|
|
296
|
-
|
|
|
297
|
-
| Cache hit | Cache-read over prompt tokens, never rounded up to 100% while a miss exists; omitted entirely when the provider reported no cache traffic. |
|
|
303
|
+
| Cache hit | Cache-read over prompt tokens across the session's local-model requests, never rounded up to 100% while a miss exists; omitted entirely when no local request reported cache traffic. The context ring's panel shows this same figure. |
|
|
298
304
|
| Input / output | Session totals; the engine's saved usage is authoritative after each run. |
|
|
299
305
|
|
|
300
306
|
Context occupancy lives on the ring beside the send button, and one fact has one home: the ring
|
|
301
|
-
shows the last measured prompt size against the model's context window.
|
|
307
|
+
shows the last measured prompt size against the model's context window. Generation speed (tok/s)
|
|
308
|
+
lives on the node chips' usage line at the top of the transcript, not on this strip.
|
|
302
309
|
|
|
303
310
|
## Accounts
|
|
304
311
|
|
|
@@ -60,6 +60,14 @@ The visible **Conversation** selector defaults to **Reuse with the same provider
|
|
|
60
60
|
|
|
61
61
|
Choose **Start an isolated conversation** to prevent reuse into and out of that node. Fan-out destinations receive separate snapshots of the shared predecessor history. Joins, intervening control/action nodes, and convergence of pending activations conservatively start isolated conversations. **Advanced → Context sharing → Include previous task summaries** controls summaries from earlier user tasks; it is separate from this run's conversation reuse.
|
|
62
62
|
|
|
63
|
+
## Skills in prompts
|
|
64
|
+
|
|
65
|
+
Type `/` in an Agent's **Prompt**, its **Advanced → System prompt**, or the **Instructions** of **Add agent** to open the skills on this machine: the skills you installed (Settings → Skills) first, then Andorra's own. Keep typing to filter by command, name or description; Up/Down chooses, Enter or Tab inserts the `/command`, and Escape closes the list (a second Escape leaves full screen). A `/name` can sit anywhere in the prompt, for example `Check the diff with /review, then summarize.`
|
|
66
|
+
|
|
67
|
+
When the node runs, it loads every skill its prompts name with the `Skill` tool before working, and it is asked to load any it skipped before it completes. A skill loaded this way is active for later nodes like any other loaded skill (see below).
|
|
68
|
+
|
|
69
|
+
A `/name` that no skill on this machine answers to never blocks the graph. The editor shows a warning under the field instead of a validation error: **not found on this machine**, **turned off in Skills settings**, or **installed but cannot be loaded**. The graph still saves and runs; at run time the node is told to do the task without that skill, and the run shows a warning row naming it. A graph built on one machine can therefore run on another, and a project's own skills (`.agents/skills` or `.andorra/skills`) are found when the run starts in that project even though the editor cannot see them. Paths such as `/usr/bin` or `/notes.txt` and built-in commands such as `/model` are not treated as skills.
|
|
70
|
+
|
|
63
71
|
## Skill inheritance between graph nodes
|
|
64
72
|
|
|
65
73
|
The **Skill inheritance** selector on each Agent defaults to **Inherit active workflow skills**. Explicit slash-invoked skills at run entry, and skills successfully loaded via `Skill` or `read_skill_resource` during the run, become available to later Agent nodes as active skill references. This context is separate from conversation history: it survives isolated conversations, different providers or models, control nodes, and parallel branches.
|
|
@@ -84,7 +92,7 @@ Schema versions 1/2 remain executable with their original semantics; opening the
|
|
|
84
92
|
|
|
85
93
|
For paid accounts, the graph builder saves revisions and drafts locally, then automatically synchronizes them to your Andorra account. The sidebar reports cloud status separately from local save success; connection failures retain the local queue and retry every 30 seconds while the builder is open. Open the Graph Builder to refresh cloud graphs on another installation; in the desktop app, opening a task's graph list does the same, so a graph saved on another machine is listed there without opening the builder first.
|
|
86
94
|
|
|
87
|
-
Incomplete graphs are autosaved as drafts after a short pause, even when validation prevents saving an executable revision. Open a draft from the sidebar, or choose **Show draft history** for earlier and conflicting versions. Remote revisions keep their original IDs and history; a conflicting revision is preserved as a separate graph — existing files are never silently overwritten.
|
|
95
|
+
Incomplete graphs are autosaved as drafts after a short pause, even when validation prevents saving an executable revision. A new or duplicated graph is not drafted until you change it. Drafts are listed under **Unsaved drafts** below your saved graphs: the newest one for each graph, and only while it holds work its saved revision does not. Right-click a draft and choose **Clear draft**, or use **Clear** beside the heading, to take drafts off the list; saved graphs and revisions are unaffected. Open a draft from the sidebar, or choose **Show draft history** for earlier and conflicting versions. Remote revisions keep their original IDs and history; a conflicting revision is preserved as a separate graph — existing files are never silently overwritten.
|
|
88
96
|
|
|
89
97
|
The first paid graph refresh assigns existing local graphs to the current account. Later accounts on the same installation use separate graph directories. Cloud storage is private to the verified account. Agent-library definitions and model credentials are not synchronized; configure the required model profiles on each installation. Starting the builder requires an online paid-membership check.
|
|
90
98
|
|