@andorra-labs/code 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -208
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/dist/src/agent-execution.js +56 -0
- package/dist/src/app-server/protocol.d.ts +109 -1
- package/dist/src/app-server/protocol.js +8 -1
- package/dist/src/app-server.d.ts +59 -1
- package/dist/src/app-server.js +418 -63
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/index.js +1 -1
- package/dist/src/auth/store.d.ts +17 -1
- package/dist/src/auth/store.js +25 -2
- package/dist/src/automation-service.js +1 -1
- package/dist/src/browser-session.d.ts +8 -0
- package/dist/src/browser-session.js +27 -1
- package/dist/src/browser-ui/app.js +255 -33
- package/dist/src/browser-ui/index.html +9 -9
- package/dist/src/browser-ui/style.css +110 -65
- package/dist/src/browser-ui/tokens.css +27 -26
- package/dist/src/cli.js +10 -5
- package/dist/src/coding-tools.d.ts +24 -0
- package/dist/src/coding-tools.js +71 -8
- package/dist/src/command-screens.js +1 -1
- package/dist/src/commands.d.ts +1 -1
- package/dist/src/commands.js +2 -2
- package/dist/src/completion-gates.d.ts +42 -7
- package/dist/src/completion-gates.js +55 -9
- package/dist/src/completion.d.ts +9 -1
- package/dist/src/completion.js +20 -2
- package/dist/src/dashboard-view.js +2 -2
- package/dist/src/deadline.js +4 -0
- package/dist/src/decision/checks.js +1 -1
- package/dist/src/file-diff.d.ts +105 -0
- package/dist/src/file-diff.js +244 -0
- package/dist/src/graph-manager-chat.js +4 -4
- package/dist/src/graph-runner.js +39 -2
- package/dist/src/graph-sync.d.ts +8 -0
- package/dist/src/graph-sync.js +54 -3
- package/dist/src/graph-tool.js +1 -1
- package/dist/src/graph-ui/app.js +303 -129
- package/dist/src/graph-ui/controls.css +43 -22
- package/dist/src/graph-ui/controls.js +31 -1
- package/dist/src/graph-ui/embed.js +56 -7
- package/dist/src/graph-ui/icons.js +5 -0
- package/dist/src/graph-ui/index.html +3 -3
- package/dist/src/graph-ui/manager-state.js +2 -2
- package/dist/src/graph-ui/manager.css +19 -18
- package/dist/src/graph-ui/manager.js +5 -5
- package/dist/src/graph-ui/skill-picker.js +5 -5
- package/dist/src/graph-ui/studio-canvas.js +16 -16
- package/dist/src/graph-ui/studio.css +18 -15
- package/dist/src/graph-ui/studio.js +99 -42
- package/dist/src/graph-ui/style.css +125 -80
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graph-ui/tokens.css +33 -29
- package/dist/src/graphs.d.ts +10 -3
- package/dist/src/graphs.js +15 -4
- package/dist/src/mcp.d.ts +75 -0
- package/dist/src/mcp.js +240 -8
- package/dist/src/membership-errors.d.ts +7 -1
- package/dist/src/membership-errors.js +9 -3
- package/dist/src/provider-keys.d.ts +5 -1
- package/dist/src/provider-keys.js +7 -3
- package/dist/src/provider-settings.d.ts +4 -1
- package/dist/src/provider-settings.js +46 -5
- package/dist/src/pull-requests.d.ts +42 -6
- package/dist/src/pull-requests.js +11 -3
- package/dist/src/qa/guidance.js +6 -19
- package/dist/src/qa/index.d.ts +0 -2
- package/dist/src/qa/index.js +0 -2
- package/dist/src/qa/profile/QaProfile.d.ts +5 -1
- package/dist/src/qa/profile/QaProfile.js +6 -2
- package/dist/src/qa/tools.d.ts +19 -1
- package/dist/src/qa/tools.js +20 -145
- package/dist/src/react-runtime.js +134 -16
- package/dist/src/read-document-doc.d.ts +20 -0
- package/dist/src/read-document-doc.js +524 -0
- package/dist/src/read-document-docx.d.ts +21 -0
- package/dist/src/read-document-docx.js +584 -0
- package/dist/src/read-document-text.d.ts +29 -0
- package/dist/src/read-document-text.js +67 -0
- package/dist/src/read-document-tool.d.ts +48 -0
- package/dist/src/read-document-tool.js +162 -0
- package/dist/src/read-document.d.ts +78 -0
- package/dist/src/read-document.js +353 -0
- package/dist/src/read-image.d.ts +29 -2
- package/dist/src/read-image.js +42 -17
- package/dist/src/remote/engine-pool.js +18 -6
- package/dist/src/runtime.d.ts +19 -0
- package/dist/src/runtime.js +10 -1
- package/dist/src/screen-selection.d.ts +38 -0
- package/dist/src/screen-selection.js +103 -0
- package/dist/src/session-changes.d.ts +122 -0
- package/dist/src/session-changes.js +804 -0
- package/dist/src/side-panel.d.ts +6 -1
- package/dist/src/side-panel.js +12 -10
- package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
- package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
- package/dist/src/skills/bundled/graph-manager/SKILL.md +37 -3
- package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
- package/dist/src/skills/bundled/provenance.json +4 -4
- package/dist/src/skills/runtime-skills.js +3 -3
- package/dist/src/stall-recovery.d.ts +15 -0
- package/dist/src/stall-recovery.js +17 -0
- package/dist/src/telemetry/schema.d.ts +1 -1
- package/dist/src/telemetry/schema.js +1 -2
- package/dist/src/terminal-ui.d.ts +64 -20
- package/dist/src/terminal-ui.js +312 -82
- package/dist/src/time-limit.d.ts +53 -0
- package/dist/src/time-limit.js +79 -0
- package/dist/src/tool-diff-stats.d.ts +9 -0
- package/dist/src/tool-diff-stats.js +20 -0
- package/dist/src/tool-names.d.ts +1 -1
- package/dist/src/tool-result-filter.js +1 -1
- package/dist/src/tools.js +118 -9
- package/dist/src/transcript.d.ts +11 -0
- package/dist/src/transcript.js +15 -3
- package/dist/src/types.d.ts +12 -0
- package/dist/src/usage-analytics.d.ts +3 -1
- package/dist/src/usage-analytics.js +16 -2
- package/package.json +6 -26
- package/dist/src/qa/api/http-runner.d.ts +0 -3
- package/dist/src/qa/api/http-runner.js +0 -47
- package/dist/src/qa/git/ChangeDetector.d.ts +0 -26
- package/dist/src/qa/git/ChangeDetector.js +0 -177
- package/dist/src/qa/git/DiffReviewer.d.ts +0 -28
- package/dist/src/qa/git/DiffReviewer.js +0 -115
- package/dist/src/qa/orchestrator/ChangeClassifier.d.ts +0 -14
- package/dist/src/qa/orchestrator/ChangeClassifier.js +0 -28
- package/dist/src/qa/orchestrator/MergeGate.d.ts +0 -14
- package/dist/src/qa/orchestrator/MergeGate.js +0 -40
- package/dist/src/qa/orchestrator/QaOrchestrator.d.ts +0 -79
- package/dist/src/qa/orchestrator/QaOrchestrator.js +0 -373
- package/dist/src/qa/runners/CommandRunner.d.ts +0 -22
- package/dist/src/qa/runners/CommandRunner.js +0 -96
- package/dist/src/qa/runners/TestRunner.d.ts +0 -21
- package/dist/src/qa/runners/TestRunner.js +0 -66
- package/dist/src/qa/runtime/RuntimeSmoke.d.ts +0 -11
- package/dist/src/qa/runtime/RuntimeSmoke.js +0 -78
- package/dist/src/qa/runtime-detect.d.ts +0 -10
- package/dist/src/qa/runtime-detect.js +0 -72
- package/dist/src/qa/security/DependencyScanner.d.ts +0 -19
- package/dist/src/qa/security/DependencyScanner.js +0 -167
- package/dist/src/qa/security/SecretScanner.d.ts +0 -3
- package/dist/src/qa/security/SecretScanner.js +0 -55
- package/docs/README.md +0 -36
- package/docs/agents/README.md +0 -62
- package/docs/agents/install-for-agents.md +0 -56
- package/docs/agents/mcp-server.md +0 -212
- package/docs/agents/subagent-mode.md +0 -149
- package/docs/concepts/README.md +0 -47
- package/docs/concepts/jev-actionable-routing.md +0 -113
- package/docs/concepts/jev-decision-thresholds.md +0 -412
- package/docs/concepts/jev-efficiency.md +0 -217
- package/docs/concepts/jev-eval-2026-11-01.md +0 -78
- package/docs/concepts/limits.md +0 -52
- package/docs/concepts/memory.md +0 -10
- package/docs/concepts/security.md +0 -50
- package/docs/concepts/workspace-instructions.md +0 -29
- package/docs/getting-started/README.md +0 -82
- package/docs/getting-started/accounts.md +0 -78
- package/docs/getting-started/configure-providers.md +0 -132
- package/docs/guides/README.md +0 -13
- package/docs/guides/browser.md +0 -39
- package/docs/guides/desktop-app.md +0 -414
- package/docs/guides/extensions.md +0 -102
- package/docs/guides/graph-builder.md +0 -116
- package/docs/guides/headless.md +0 -46
- package/docs/guides/tui.md +0 -75
- package/docs/guides/update.md +0 -70
- package/docs/guides/web-search.md +0 -51
- package/docs/guides/windows-code-signing.md +0 -319
- package/docs/llms.txt +0 -45
- package/docs/reference/README.md +0 -7
- package/docs/reference/cli.md +0 -76
- package/docs/reference/config.md +0 -91
- package/docs/reference/slash-commands.md +0 -59
- package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
- package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
- package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
- package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
- package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
- package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
- package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
- package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
- package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
- package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
- package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
- package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
- package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
- package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
- package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
- package/scripts/jev-efficiency-eval.mjs +0 -187
- package/scripts/jev-efficiency-live.mjs +0 -193
- package/scripts/zcode-engine-replay.mjs +0 -223
- package/tests/agent-centric-mcp-test-plan.md +0 -208
- package/tests/analytics-settings-test-plan.md +0 -165
- package/tests/browser-cli-smoke.mjs +0 -276
- package/tests/browser-test-plan.md +0 -280
- package/tests/chat-side-panel-test-plan.md +0 -309
- package/tests/decision-engine-test-plan.md +0 -163
- package/tests/default-active-jev-test-plan.md +0 -85
- package/tests/harness-extensions-test-plan.md +0 -113
- package/tests/jev-all-decisions-test-plan.md +0 -156
- package/tests/jev-efficiency/criteria.json +0 -158
- package/tests/jev-efficiency/workloads.mjs +0 -242
- package/tests/jev-efficiency-test-plan.md +0 -198
- package/tests/permissions-sandbox-probe.mjs +0 -74
- package/tests/permissions-test-plan.md +0 -191
- package/tests/product-telemetry-test-plan.md +0 -536
- package/tests/thinking-stream-preview-test-plan.md +0 -136
- package/tests/zcode-react-engine-test-plan.md +0 -396
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { getQaProcessManager } from './ProcessManager.js';
|
|
2
|
-
const DEFAULT_STARTUP_TIMEOUT_MS = 30_000;
|
|
3
|
-
const CRASH_PATTERNS = [
|
|
4
|
-
{ pattern: /uncaughtException|unhandledRejection/i, message: 'uncaught exception during startup' },
|
|
5
|
-
{ pattern: /Cannot find module|MODULE_NOT_FOUND/, message: 'module resolution failure during startup' },
|
|
6
|
-
{ pattern: /EADDRINUSE/, message: 'startup port already in use' },
|
|
7
|
-
{ pattern: /Traceback \(most recent call last\)/, message: 'Python traceback during startup' },
|
|
8
|
-
{ pattern: /\b(TypeError|ReferenceError|SyntaxError):/, message: 'runtime error during startup' },
|
|
9
|
-
{ pattern: /\bFATAL\b/, message: 'fatal startup error' },
|
|
10
|
-
];
|
|
11
|
-
/**
|
|
12
|
-
* Boot the configured startup command, wait for its health URL (or a short
|
|
13
|
-
* grace window), scan the log for crash signatures, then always stop it.
|
|
14
|
-
*/
|
|
15
|
-
export async function runRuntimeSmoke(options) {
|
|
16
|
-
const startup = options.profile.startup;
|
|
17
|
-
if (!startup) {
|
|
18
|
-
return { id: 'runtime_smoke', category: 'runtime', status: 'skipped', durationMs: 0, summary: 'no startup command configured (.andorra/qa.yaml qa.startup.command)' };
|
|
19
|
-
}
|
|
20
|
-
const manager = getQaProcessManager(options.workspace);
|
|
21
|
-
const startedAt = Date.now();
|
|
22
|
-
const timeout = startup.timeoutMs ?? DEFAULT_STARTUP_TIMEOUT_MS;
|
|
23
|
-
try {
|
|
24
|
-
await manager.start({ id: 'startup', command: startup.command, logDir: options.logDir });
|
|
25
|
-
let readiness = { ready: true };
|
|
26
|
-
if (startup.healthUrl) {
|
|
27
|
-
readiness = await manager.waitForUrl(startup.healthUrl, timeout, options.signal, 'startup');
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
await new Promise(resolve => {
|
|
31
|
-
const timer = setTimeout(resolve, Math.min(timeout, 5_000));
|
|
32
|
-
options.signal.addEventListener('abort', () => { clearTimeout(timer); resolve(); }, { once: true });
|
|
33
|
-
});
|
|
34
|
-
const info = manager.get('startup');
|
|
35
|
-
if (!info?.running)
|
|
36
|
-
readiness = { ready: false, reason: `startup process exited (${info?.exitCode ?? info?.exitSignal ?? 'unknown'}) before readiness` };
|
|
37
|
-
}
|
|
38
|
-
const log = manager.logs('startup', 32_768);
|
|
39
|
-
const crashes = [];
|
|
40
|
-
for (const line of log.split('\n')) {
|
|
41
|
-
for (const rule of CRASH_PATTERNS) {
|
|
42
|
-
if (rule.pattern.test(line)) {
|
|
43
|
-
crashes.push({ severity: 'error', message: `${rule.message}: ${line.trim().slice(0, 300)}`, code: 'runtime-crash' });
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (crashes.length >= 10)
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
const durationMs = Date.now() - startedAt;
|
|
51
|
-
if (!readiness.ready) {
|
|
52
|
-
return {
|
|
53
|
-
id: 'runtime_smoke', category: 'runtime', status: 'failed', durationMs,
|
|
54
|
-
summary: `startup never became healthy: ${readiness.reason}`,
|
|
55
|
-
errors: crashes.length ? crashes : undefined,
|
|
56
|
-
importantOutput: log.split('\n').filter(l => l.trim()).slice(-15).map(l => l.slice(0, 300)),
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
if (crashes.length) {
|
|
60
|
-
return {
|
|
61
|
-
id: 'runtime_smoke', category: 'runtime', status: 'failed', durationMs,
|
|
62
|
-
summary: `startup logged fatal errors (${crashes.length})`,
|
|
63
|
-
errors: crashes,
|
|
64
|
-
importantOutput: crashes.map(issue => issue.message),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
return { id: 'runtime_smoke', category: 'runtime', status: 'passed', durationMs, summary: `startup ran cleanly${startup.healthUrl ? ` and answered ${startup.healthUrl}` : ''}` };
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
71
|
-
if (/aborted/i.test(message))
|
|
72
|
-
throw error;
|
|
73
|
-
return { id: 'runtime_smoke', category: 'runtime', status: 'blocked', durationMs: Date.now() - startedAt, summary: `startup could not launch: ${message.split('\n')[0]}` };
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
await manager.stop('startup').catch(() => { });
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RuntimeCapabilities, ShellEnvironment } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Detect the host shell for QA execution (plan §2.2). Interpreter presence is
|
|
4
|
-
* probed rather than assumed; the default kind still decides command syntax.
|
|
5
|
-
*/
|
|
6
|
-
export declare function detectShellEnvironment(): ShellEnvironment;
|
|
7
|
-
/** Probe once per process; a missing tool answers instantly, a present one within 2s. */
|
|
8
|
-
export declare function detectRuntimeCapabilities(force?: boolean): Promise<RuntimeCapabilities>;
|
|
9
|
-
/** Compact per-tool lines for the agent context: only availability plus one-line versions. */
|
|
10
|
-
export declare function describeRuntimeCapabilities(capabilities?: RuntimeCapabilities): Promise<string>;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
|
-
import { existsSync } from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { defaultShellKind, shellInvocation } from '../shell.js';
|
|
6
|
-
const executeFile = promisify(execFile);
|
|
7
|
-
const PROBE_TIMEOUT_MS = 2_000;
|
|
8
|
-
/** Probe arguments per tool; most accept --version, a few have their own spelling. */
|
|
9
|
-
const PROBES = {
|
|
10
|
-
node: ['--version'], npm: ['--version'], npx: ['--version'], pnpm: ['--version'], yarn: ['--version'], bun: ['--version'],
|
|
11
|
-
python: ['--version'], python3: ['--version'], pip: ['--version'], pytest: ['--version'], uv: ['--version'],
|
|
12
|
-
git: ['--version'], gh: ['--version'], cargo: ['--version'], rustc: ['--version'], go: ['version'],
|
|
13
|
-
dotnet: ['--version'], java: ['-version'], mvn: ['-version'], gradle: ['--version'],
|
|
14
|
-
docker: ['--version'], 'docker-compose': ['--version'],
|
|
15
|
-
};
|
|
16
|
-
async function probe(tool, args) {
|
|
17
|
-
try {
|
|
18
|
-
// Most tools print the version on stdout; java -version uses stderr. Either counts.
|
|
19
|
-
const { stdout, stderr } = await executeFile(tool, args, { windowsHide: true, timeout: PROBE_TIMEOUT_MS, maxBuffer: 64 * 1024, encoding: 'utf8' });
|
|
20
|
-
const line = (stdout || stderr).split(/\r?\n/).map(part => part.trim()).find(Boolean) ?? '';
|
|
21
|
-
return { available: true, version: line.slice(0, 120) };
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
return { available: false };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function platform() {
|
|
28
|
-
return process.platform === 'win32' ? 'windows' : process.platform === 'darwin' ? 'macos' : 'linux';
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Detect the host shell for QA execution (plan §2.2). Interpreter presence is
|
|
32
|
-
* probed rather than assumed; the default kind still decides command syntax.
|
|
33
|
-
*/
|
|
34
|
-
export function detectShellEnvironment() {
|
|
35
|
-
const kind = defaultShellKind;
|
|
36
|
-
const executable = (() => {
|
|
37
|
-
// An interpreter may be unavailable (e.g. Git Bash absent on Windows); report the
|
|
38
|
-
// kind rather than failing detection for a host that can still run other probes.
|
|
39
|
-
try {
|
|
40
|
-
const resolved = shellInvocation('exit 0', kind).executable;
|
|
41
|
-
return existsSync(resolved) || !path.isAbsolute(resolved) ? resolved : `${resolved} (not found)`;
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
return kind;
|
|
45
|
-
}
|
|
46
|
-
})();
|
|
47
|
-
const prefixes = { powershell: ['-Command'], bash: ['-c'], posix: ['-c'] };
|
|
48
|
-
return { platform: platform(), executable, argsPrefix: prefixes[kind] };
|
|
49
|
-
}
|
|
50
|
-
let cached;
|
|
51
|
-
/** Probe once per process; a missing tool answers instantly, a present one within 2s. */
|
|
52
|
-
export function detectRuntimeCapabilities(force = false) {
|
|
53
|
-
if (!cached || force)
|
|
54
|
-
cached = (async () => {
|
|
55
|
-
const entries = await Promise.all(Object.entries(PROBES).map(async ([tool, args]) => [tool, await probe(tool, args)]));
|
|
56
|
-
return { shell: detectShellEnvironment(), tools: Object.fromEntries(entries) };
|
|
57
|
-
})();
|
|
58
|
-
return cached;
|
|
59
|
-
}
|
|
60
|
-
/** Compact per-tool lines for the agent context: only availability plus one-line versions. */
|
|
61
|
-
export async function describeRuntimeCapabilities(capabilities) {
|
|
62
|
-
const caps = capabilities ?? await detectRuntimeCapabilities();
|
|
63
|
-
const order = ['node', 'npm', 'pnpm', 'yarn', 'bun', 'python', 'pytest', 'uv', 'git', 'gh', 'cargo', 'go', 'dotnet', 'java', 'mvn', 'gradle', 'docker', 'docker-compose'];
|
|
64
|
-
const lines = [`Shell: ${caps.shell.platform} ${path.basename(caps.shell.executable)}`];
|
|
65
|
-
for (const tool of order) {
|
|
66
|
-
const entry = caps.tools[tool];
|
|
67
|
-
if (!entry)
|
|
68
|
-
continue;
|
|
69
|
-
lines.push(`${tool}: ${entry.available ? entry.version ?? 'available' : 'unavailable'}`);
|
|
70
|
-
}
|
|
71
|
-
return lines.join('\n');
|
|
72
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { QaIssue, QaSeverityCascade } from '../types.js';
|
|
2
|
-
export interface DependencyAuditOutcome {
|
|
3
|
-
status: 'passed' | 'failed' | 'blocked';
|
|
4
|
-
summary: string;
|
|
5
|
-
issues: QaIssue[];
|
|
6
|
-
importantOutput: string[];
|
|
7
|
-
durationMs: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* `npm/pnpm/yarn audit` with tolerant JSON parsing. The check fails when any
|
|
11
|
-
* advisory severity is in `failOn`; unsupported ecosystems report blocked
|
|
12
|
-
* rather than silently passing.
|
|
13
|
-
*/
|
|
14
|
-
export declare function runDependencyAudit(options: {
|
|
15
|
-
workspace: string;
|
|
16
|
-
packageManager?: string;
|
|
17
|
-
failOn: QaSeverityCascade[];
|
|
18
|
-
signal: AbortSignal;
|
|
19
|
-
}): Promise<DependencyAuditOutcome>;
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { executeShell } from '../../shell.js';
|
|
2
|
-
const AUDIT_TIMEOUT_MS = 120_000;
|
|
3
|
-
const NO_VULNS_COUNTS = { critical: 0, high: 0, moderate: 0, low: 0, info: 0 };
|
|
4
|
-
function asRecord(value) {
|
|
5
|
-
return value && typeof value === 'object' && !Array.isArray(value) ? value : undefined;
|
|
6
|
-
}
|
|
7
|
-
function severityOf(value) {
|
|
8
|
-
return typeof value === 'string' ? value.toLowerCase() : 'unknown';
|
|
9
|
-
}
|
|
10
|
-
function metadataCounts(metadata) {
|
|
11
|
-
const counts = asRecord(asRecord(metadata)?.vulnerabilities);
|
|
12
|
-
if (!counts)
|
|
13
|
-
return {};
|
|
14
|
-
const result = {};
|
|
15
|
-
for (const [key, value] of Object.entries(counts))
|
|
16
|
-
if (typeof value === 'number')
|
|
17
|
-
result[key.toLowerCase()] = value;
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
/** Tolerant parse of `npm audit --json` (report v1 and v2) and `pnpm audit --json`. */
|
|
21
|
-
function parseAuditJson(stdout) {
|
|
22
|
-
const start = stdout.indexOf('{');
|
|
23
|
-
if (start < 0)
|
|
24
|
-
return undefined;
|
|
25
|
-
let root;
|
|
26
|
-
try {
|
|
27
|
-
root = JSON.parse(stdout.slice(start));
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
const data = asRecord(root);
|
|
33
|
-
if (!data)
|
|
34
|
-
return undefined;
|
|
35
|
-
const vulnerabilities = [];
|
|
36
|
-
const named = asRecord(data.vulnerabilities);
|
|
37
|
-
if (named) {
|
|
38
|
-
for (const [pkg, entry] of Object.entries(named)) {
|
|
39
|
-
const record = asRecord(entry);
|
|
40
|
-
if (!record)
|
|
41
|
-
continue;
|
|
42
|
-
let title;
|
|
43
|
-
if (Array.isArray(record.via)) {
|
|
44
|
-
for (const via of record.via) {
|
|
45
|
-
const advisory = asRecord(via);
|
|
46
|
-
if (advisory && typeof advisory.title === 'string') {
|
|
47
|
-
title = advisory.title;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
vulnerabilities.push({ name: pkg, severity: severityOf(record.severity), title });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const advisories = asRecord(data.advisories);
|
|
56
|
-
if (advisories) {
|
|
57
|
-
for (const entry of Object.values(advisories)) {
|
|
58
|
-
const advisory = asRecord(entry);
|
|
59
|
-
if (!advisory)
|
|
60
|
-
continue;
|
|
61
|
-
vulnerabilities.push({
|
|
62
|
-
name: typeof advisory.module_name === 'string' ? advisory.module_name : 'unknown',
|
|
63
|
-
severity: severityOf(advisory.severity),
|
|
64
|
-
title: typeof advisory.title === 'string' ? advisory.title : undefined,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const counts = metadataCounts(data.metadata);
|
|
69
|
-
if (!vulnerabilities.length && !Object.keys(counts).length)
|
|
70
|
-
return undefined;
|
|
71
|
-
return { vulnerabilities, counts };
|
|
72
|
-
}
|
|
73
|
-
/** Newer pnpm emits newline-delimited JSON findings; older pnpm and yarn emit newline-delimited events. */
|
|
74
|
-
function parseAuditJsonLines(stdout) {
|
|
75
|
-
const vulnerabilities = [];
|
|
76
|
-
let counts = {};
|
|
77
|
-
let sawAny = false;
|
|
78
|
-
for (const line of stdout.split('\n')) {
|
|
79
|
-
const trimmed = line.trim();
|
|
80
|
-
if (!trimmed.startsWith('{'))
|
|
81
|
-
continue;
|
|
82
|
-
let event;
|
|
83
|
-
try {
|
|
84
|
-
event = JSON.parse(trimmed);
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
const record = asRecord(event);
|
|
90
|
-
if (!record)
|
|
91
|
-
continue;
|
|
92
|
-
sawAny = true;
|
|
93
|
-
const advisory = asRecord(record.advisory);
|
|
94
|
-
if (advisory) {
|
|
95
|
-
vulnerabilities.push({
|
|
96
|
-
name: typeof advisory.module_name === 'string' ? advisory.module_name : 'unknown',
|
|
97
|
-
severity: severityOf(advisory.severity),
|
|
98
|
-
title: typeof advisory.title === 'string' ? advisory.title : undefined,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
const finding = asRecord(record.finding);
|
|
102
|
-
const findingSeverity = finding ? asRecord(finding.severity) : undefined;
|
|
103
|
-
if (findingSeverity) {
|
|
104
|
-
const [severity] = Object.keys(findingSeverity);
|
|
105
|
-
if (severity)
|
|
106
|
-
vulnerabilities.push({ name: String(record.package ?? 'unknown'), severity: severityOf(severity) });
|
|
107
|
-
}
|
|
108
|
-
const lineCounts = metadataCounts(record.metadata);
|
|
109
|
-
if (Object.keys(lineCounts).length)
|
|
110
|
-
counts = lineCounts;
|
|
111
|
-
}
|
|
112
|
-
if (!sawAny)
|
|
113
|
-
return undefined;
|
|
114
|
-
return { vulnerabilities, counts };
|
|
115
|
-
}
|
|
116
|
-
function mergedCounts(report) {
|
|
117
|
-
if (Object.keys(report.counts).length)
|
|
118
|
-
return report.counts;
|
|
119
|
-
const counts = { ...NO_VULNS_COUNTS };
|
|
120
|
-
for (const vuln of report.vulnerabilities)
|
|
121
|
-
counts[vuln.severity] = (counts[vuln.severity] ?? 0) + 1;
|
|
122
|
-
return counts;
|
|
123
|
-
}
|
|
124
|
-
function formatCounts(counts) {
|
|
125
|
-
const parts = ['critical', 'high', 'moderate', 'low', 'info']
|
|
126
|
-
.filter(key => (counts[key] ?? 0) > 0)
|
|
127
|
-
.map(key => `${counts[key]} ${key}`);
|
|
128
|
-
return parts.length ? parts.join(', ') : 'no advisories';
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* `npm/pnpm/yarn audit` with tolerant JSON parsing. The check fails when any
|
|
132
|
-
* advisory severity is in `failOn`; unsupported ecosystems report blocked
|
|
133
|
-
* rather than silently passing.
|
|
134
|
-
*/
|
|
135
|
-
export async function runDependencyAudit(options) {
|
|
136
|
-
const manager = options.packageManager ?? 'npm';
|
|
137
|
-
if (!['npm', 'pnpm', 'yarn'].includes(manager)) {
|
|
138
|
-
return { status: 'blocked', summary: `no built-in dependency audit for package manager "${manager}"`, issues: [], importantOutput: [], durationMs: 0 };
|
|
139
|
-
}
|
|
140
|
-
const started = Date.now();
|
|
141
|
-
let result;
|
|
142
|
-
try {
|
|
143
|
-
result = await executeShell(`${manager} audit --json`, options.workspace, AUDIT_TIMEOUT_MS, options.signal);
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
147
|
-
return { status: 'blocked', summary: `dependency audit could not run: ${message.split('\n')[0]}`, issues: [], importantOutput: [], durationMs: Date.now() - started };
|
|
148
|
-
}
|
|
149
|
-
const durationMs = Date.now() - started;
|
|
150
|
-
const report = parseAuditJson(result.stdout) ?? parseAuditJsonLines(result.stdout);
|
|
151
|
-
if (!report) {
|
|
152
|
-
const firstLine = (result.stderr || result.stdout || `exit ${result.exitCode ?? result.exitSignal}`).split('\n').find(line => line.trim()) ?? 'no output';
|
|
153
|
-
return { status: 'blocked', summary: `${manager} audit produced no parseable report: ${firstLine.slice(0, 200)}`, issues: [], importantOutput: [], durationMs };
|
|
154
|
-
}
|
|
155
|
-
const counts = mergedCounts(report);
|
|
156
|
-
const failing = report.vulnerabilities.filter(vuln => options.failOn.includes(vuln.severity));
|
|
157
|
-
const failingByCount = options.failOn.some(severity => (counts[severity] ?? 0) > 0);
|
|
158
|
-
const summary = `${manager} audit: ${formatCounts(counts)}`;
|
|
159
|
-
const importantOutput = report.vulnerabilities.slice(0, 10).map(vuln => `${vuln.severity}: ${vuln.name}${vuln.title ? ` - ${vuln.title}` : ''}`);
|
|
160
|
-
const issues = report.vulnerabilities.slice(0, 25).map(vuln => ({
|
|
161
|
-
severity: options.failOn.includes(vuln.severity) ? 'error' : 'warning',
|
|
162
|
-
message: `${vuln.severity} vulnerability in ${vuln.name}${vuln.title ? `: ${vuln.title}` : ''}`,
|
|
163
|
-
code: 'dependency-vulnerability',
|
|
164
|
-
}));
|
|
165
|
-
const failed = failing.length > 0 || failingByCount;
|
|
166
|
-
return { status: failed ? 'failed' : 'passed', summary, issues, importantOutput, durationMs };
|
|
167
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { addedLines } from '../git/DiffReviewer.js';
|
|
2
|
-
const SECRET_RULES = [
|
|
3
|
-
{ name: 'aws-access-key', pattern: /\b((?:AKIA|ASIA)[0-9A-Z]{16})\b/ },
|
|
4
|
-
{ name: 'github-token', pattern: /\b(gh[pousr]_[A-Za-z0-9]{30,255})\b/ },
|
|
5
|
-
{ name: 'openai-key', pattern: /\b(sk-[A-Za-z0-9_-]{20,})\b/ },
|
|
6
|
-
{ name: 'slack-token', pattern: /\b(xox[baprs]-[A-Za-z0-9-]{10,})\b/ },
|
|
7
|
-
{ name: 'google-api-key', pattern: /\b(AIza[0-9A-Za-z_-]{35})\b/ },
|
|
8
|
-
{ name: 'private-key', pattern: /(-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY(?: BLOCK)?-----)/ },
|
|
9
|
-
{ name: 'jwt', pattern: /\b(eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,})\b/ },
|
|
10
|
-
{
|
|
11
|
-
name: 'credential-assignment',
|
|
12
|
-
pattern: /\b(?:password|passwd|pwd|secret|api[_-]?key|apikey|access[_-]?token|auth[_-]?token|client[_-]?secret)\b["']?\s*[:=]\s*["']([^"'\n]{8,})["']/i,
|
|
13
|
-
valueGroup: 1,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'connection-string-password',
|
|
17
|
-
pattern: /\b(?:postgres(?:ql)?|mysql|mongodb(?:\+srv)?|redis|amqps?|mssql):\/\/[^\s/:@]+:([^@\s/]{4,})@/i,
|
|
18
|
-
valueGroup: 1,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
/** Template/placeholder shapes that are credentials in name only. */
|
|
22
|
-
const PLACEHOLDER = /\$\{|\{\{|<[a-z0-9_.-]+>|\.\.\.|xxxx|your[-_]|changeme|placeholder|example/i;
|
|
23
|
-
function redact(value) {
|
|
24
|
-
const visible = value.slice(0, 4);
|
|
25
|
-
return visible + '*'.repeat(Math.min(Math.max(value.length - visible.length, 4), 24));
|
|
26
|
-
}
|
|
27
|
-
/** Scan diff-added lines for credential-shaped strings. Issues carry redacted values. */
|
|
28
|
-
export function scanAddedLinesForSecrets(diff) {
|
|
29
|
-
const issues = [];
|
|
30
|
-
if (!diff)
|
|
31
|
-
return issues;
|
|
32
|
-
for (const line of addedLines(diff)) {
|
|
33
|
-
if (!line.text)
|
|
34
|
-
continue;
|
|
35
|
-
for (const rule of SECRET_RULES) {
|
|
36
|
-
const match = rule.pattern.exec(line.text);
|
|
37
|
-
if (!match)
|
|
38
|
-
continue;
|
|
39
|
-
const value = (rule.valueGroup !== undefined ? match[rule.valueGroup] : match[1]) ?? match[0];
|
|
40
|
-
if (PLACEHOLDER.test(value))
|
|
41
|
-
continue;
|
|
42
|
-
issues.push({
|
|
43
|
-
file: line.file,
|
|
44
|
-
line: line.line,
|
|
45
|
-
severity: 'error',
|
|
46
|
-
message: `possible secret (${rule.name}): ${redact(value)}`,
|
|
47
|
-
code: 'secret',
|
|
48
|
-
});
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
if (issues.length >= 50)
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
return issues;
|
|
55
|
-
}
|
package/docs/README.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Andorra Code
|
|
2
|
-
|
|
3
|
-
Andorra Code is a terminal-first coding agent. Run `andorra` in a project folder and it researches the repository, asks what you need, and implements the work with your own model providers. Instead of one opaque agent loop, work runs on a **graph**: visible stages, decisions, and handoffs that you can inspect, edit, and rerun.
|
|
4
|
-
|
|
5
|
-
```sh
|
|
6
|
-
# after installing (see Getting started)
|
|
7
|
-
cd /path/to/your/project
|
|
8
|
-
andorra
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Where to start
|
|
12
|
-
|
|
13
|
-
| Page | What it covers |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| [Getting started](getting-started/README.md) | Install Andorra Code, configure a provider, run your first task |
|
|
16
|
-
| [Give these instructions to an AI agent](agents/install-for-agents.md) | A copy-paste block that lets another coding agent install and set up Andorra Code for you |
|
|
17
|
-
| [Accounts, membership, and hosted Jev](getting-started/accounts.md) | Signing in, free and paid access, the `/jev` routing service |
|
|
18
|
-
| [Concepts](concepts/README.md) | Graphs, agent nodes, providers, memory, limits, and security boundaries |
|
|
19
|
-
| [Guides](guides/README.md) | The TUI, the visual Graph Builder, headless runs, extensions, the browser and desktop clients |
|
|
20
|
-
| [Reference](reference/README.md) | CLI commands and flags, slash commands, configuration files |
|
|
21
|
-
| [For AI agents](agents/README.md) | How an agent should read this documentation |
|
|
22
|
-
|
|
23
|
-
## The short version
|
|
24
|
-
|
|
25
|
-
- **CLI-first.** `andorra` opens the TUI. `andorra graph` opens the local browser Graph Builder. There is no required cloud service for the coding loop: it runs on your machine with your providers.
|
|
26
|
-
- **Bring your own models.** OpenAI-compatible endpoints, Anthropic, Codex (ChatGPT subscription sign-in), and local servers such as LM Studio. See [Configure providers](getting-started/configure-providers.md).
|
|
27
|
-
- **The graph is the harness.** Out of the box, `andorra` runs a single Andorra Agent on the bundled default graph. Free accounts can build one small custom graph; paid members can select the Orchestrator workflow (`/graph` or `--graph :andorra`) and build any number of custom graphs with per-agent models, tools, instructions, typed handoffs, loops, and joins. See [Concepts](concepts/README.md).
|
|
28
|
-
- **Agent-readable.** Every page here is written in Markdown, and [`llms.txt`](/llms.txt) indexes them for AI agents. See [For AI agents](agents/README.md).
|
|
29
|
-
|
|
30
|
-
## Documentation map
|
|
31
|
-
|
|
32
|
-
- **Getting started** — install, first run, providers, accounts.
|
|
33
|
-
- **Concepts** — what the runtime actually does: the graph model, context handling, limits, security.
|
|
34
|
-
- **Guides** — task-oriented how-tos for every client and mode.
|
|
35
|
-
- **Reference** — exact CLI and configuration surface.
|
|
36
|
-
- **For AI agents** — machine-facing entry points, including graph authoring over the local MCP server (the supported surface for agents; the Graph Builder is the editor for people).
|
package/docs/agents/README.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# For AI agents
|
|
2
|
-
|
|
3
|
-
This page is written for AI agents (and the people who configure them). Andorra Code is an agent-centric tool, so its documentation is designed to be read by machines as well as humans.
|
|
4
|
-
|
|
5
|
-
## Reading these docs
|
|
6
|
-
|
|
7
|
-
Every page you are reading is published on the documentation site. The rendered page is at `/docs/<page>`; the same page as plain markdown, exactly as it is written here, is at `/docs-md/<path>`:
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
/docs-md/getting-started/README.md
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
`llms.txt` at the site root is a curated index of every page with a one-line description, following the emerging `llms.txt` convention. Start there, then fetch only the pages you need:
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
/llms.txt
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Authoring a graph: use the MCP server
|
|
20
|
-
|
|
21
|
-
When an agent creates or edits a graph, the MCP server is the surface to use — not the Graph Builder. The Graph Builder is a browser application for people; the MCP server is the documented authoring API for agents, and it needs no browser, no mouse, and no UI state to coordinate.
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
andorra mcp-server --stdio
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
- **It does not run the graph you authored and opens no network listener.** Authoring and running are separate steps: publish a revision over MCP, then run it with `andorra --graph <id>`.
|
|
28
|
-
- **Graph access requires a signed-in account.** A free account is held to its allowance of one custom graph of up to three nodes; legacy and paid accounts are not. If the account signs out or switches during a call, the server fails closed with `AUTH_CHANGED` instead of disclosing another account's graphs.
|
|
29
|
-
- **Every Agent node you create must name a provider ID from `andorra_providers_list`.** Never assume the session provider is inherited; `NODE_PROVIDER_MISSING` and `NODE_PROVIDER_INVALID` mean the node, not the call, is wrong.
|
|
30
|
-
- **Read the architecture resource before designing.** `andorra_graph_guide` returns the node types, ports, edge rules, and error contract — including that `agent`, `condition`, `loop`, `approval`, `join`, `parallel`, `action`, and `end` are the node types, and that every declared outcome needs an outgoing edge unless the node sets `completion.requireRoutes: false`. Do not guess at node fields from an example alone, and do not add edges or End nodes just to satisfy a route an agent deliberately left terminal.
|
|
31
|
-
- **Follow the documented sequence and never skip validation.** `andorra_graph_begin` → `andorra_graph_node_upsert` / `andorra_graph_edge_upsert` / `andorra_graph_patch` → `andorra_graph_validate` → `andorra_graph_publish`. Fix every reported issue; do not suppress them by widening schemas or dropping outcomes.
|
|
32
|
-
- **Cycles need a ceiling.** A failure route back to an earlier node is a cycle, so set `limits.maxNodeVisits` (or a wall clock) and make the ceiling large enough for the intended reentries.
|
|
33
|
-
- **Drafts are process-local and expire after an hour of disuse.** Exiting the MCP process discards unpublished work, so finish the sequence in one session.
|
|
34
|
-
- **Publishing is local-first.** A successful `andorra_graph_publish` is durable locally but is **not** cloud confirmation; report the sync state rather than claiming the graph was backed up.
|
|
35
|
-
- **Do not drive the Graph Builder UI to author a graph.** Open it only for human editing or to show a person the result visually. If you do use it, expect an online account check before it starts.
|
|
36
|
-
|
|
37
|
-
## What an agent should know
|
|
38
|
-
|
|
39
|
-
- **Install and setup** — [Give these instructions to an AI agent](install-for-agents.md) is a deterministic, copy-pasteable procedure for installing Andorra Code and configuring a provider. Follow it verbatim; it lists every decision point.
|
|
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
|
-
- **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, `143` termination (SIGTERM). See [Headless mode](../guides/headless.md).
|
|
42
|
-
- **Workspace instructions** — Andorra reads project-root `ANDORRA.md`, falling back to `AGENTS.md` only when the preferred file is absent; names match in any case. 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 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
|
-
|
|
45
|
-
### Choosing a surface
|
|
46
|
-
|
|
47
|
-
| The task | Use |
|
|
48
|
-
| --- | --- |
|
|
49
|
-
| Create or edit a graph | MCP server (`andorra_graph_*` tools); inside Andorra, the built-in `graphs` tool |
|
|
50
|
-
| Run one task and read a machine-readable result | `andorra --prompt "..." --json` |
|
|
51
|
-
| Watch sessions, find a run that needs input | MCP session tools |
|
|
52
|
-
| Edit a graph by hand, or show one to a person | Graph Builder (`andorra graph`) |
|
|
53
|
-
| Answer an Orchestrator's intake questions | an interactive session; headless returns `needs_clarification` |
|
|
54
|
-
|
|
55
|
-
## Grounding rules for agents
|
|
56
|
-
|
|
57
|
-
1. Prefer this documentation over assumptions about CLI behavior; flags and commands change between revisions and the docs track the current `main`.
|
|
58
|
-
2. Do not run interactive TUI commands when automating; use the headless flags or the MCP server.
|
|
59
|
-
3. Author graphs over the MCP server, and read `andorra_graph_guide` before designing one. The Graph Builder is for people, not for agents.
|
|
60
|
-
4. Treat exit code `1` with status `needs_clarification` as a request for human input, not a retryable failure — answer it in an interactive session.
|
|
61
|
-
5. Never put credentials in handoff data, graph JSON, or workspace instruction files; provider keys live in the operating system credential store (`~/.andorracode/config.json` only where there is none) or in environment variables.
|
|
62
|
-
6. Report what you actually ran and saw. A build that compiles is not evidence that the change works, and a published revision is not evidence that the cloud copy exists.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Give these instructions to an AI agent
|
|
2
|
-
|
|
3
|
-
If you use another AI coding agent (Hermes, Codex, Claude Code, etc.), paste the block below into it. The agent can then install Andorra Code on your machine, configure a provider, and verify the install without further decisions from you.
|
|
4
|
-
|
|
5
|
-
Before pasting, fill in the bracketed value: which provider to configure. Everything else is deterministic.
|
|
6
|
-
|
|
7
|
-
````markdown
|
|
8
|
-
Install Andorra Code (a terminal-first coding agent) on this machine and verify it works.
|
|
9
|
-
|
|
10
|
-
Prerequisites you must check first:
|
|
11
|
-
- Node.js 22.19 or newer (`node --version`). If missing or older, install the current LTS
|
|
12
|
-
from nodejs.org (or via the system's package manager) before continuing. npm ships with it.
|
|
13
|
-
- Network access to registry.npmjs.org and to the model provider endpoint below.
|
|
14
|
-
- If the provider preset below is "ChatGPT / Codex": the official OpenAI Codex CLI must already be
|
|
15
|
-
installed and signed in with ChatGPT (install @openai/codex and run `codex login`), or
|
|
16
|
-
ANDORRA_CODEX_PATH must point at its executable. Without it, configuring the Codex
|
|
17
|
-
provider fails — check this before step 3 when that preset is chosen.
|
|
18
|
-
|
|
19
|
-
Steps (run verbatim, stopping to report if any step fails):
|
|
20
|
-
1. npm install -g @andorra-labs/code
|
|
21
|
-
2. Verify: `andorra --version` must print a version number. If `andorra` is not found, the
|
|
22
|
-
npm global bin directory is not on PATH — report that; do not edit shell profiles silently.
|
|
23
|
-
|
|
24
|
-
Provider configuration (interactive, needs the human once):
|
|
25
|
-
3. Tell the user to run `andorra` in any folder, type `/providers`, press Enter, choose
|
|
26
|
-
"Add provider", select the "<provider preset, exactly as the picker labels it: DeepSeek | Kimi / Moonshot | Kimi For Coding (Global) | Kimi For Coding (China) | GLM Coding Plan (Z.ai) | OpenAI | Anthropic | Local server | ChatGPT / Codex | Claude subscription | Grok subscription (Grok CLI) | OpenCode (CLI sign-in) | OpenCode Go | Custom provider>"
|
|
27
|
-
preset, and provide credentials one of these two ways:
|
|
28
|
-
- Paste their API key into the masked **API key** field (saved locally), or
|
|
29
|
-
- Enter a variable name (e.g. OPENAI_API_KEY) in the **Environment fallback** field AND
|
|
30
|
-
export that variable in the shell before starting. Exporting alone does nothing: the
|
|
31
|
-
fallback field is what tells Andorra to read the environment.
|
|
32
|
-
Settings save only after choosing "Save changes".
|
|
33
|
-
|
|
34
|
-
Verification (optional, non-interactive):
|
|
35
|
-
4. `andorra --version`
|
|
36
|
-
5. `andorra auth status` — reports the Andorra account session (signed out is fine;
|
|
37
|
-
accounts are optional and only needed for hosted Jev and custom graphs).
|
|
38
|
-
|
|
39
|
-
Notes:
|
|
40
|
-
- To update later: run `andorra update` from any directory. It installs the latest npm
|
|
41
|
-
release of @andorra-labs/code and never downgrades.
|
|
42
|
-
- Configuration lives in ~/.andorracode (override with ANDORRACODE_HOME). Saved API keys
|
|
43
|
-
go to the operating system credential store. On Linux without one they stay in
|
|
44
|
-
~/.andorracode/config.json, so never commit or share that file.
|
|
45
|
-
````
|
|
46
|
-
|
|
47
|
-
## What the human still has to do
|
|
48
|
-
|
|
49
|
-
Two things cannot be automated away:
|
|
50
|
-
|
|
51
|
-
1. **The API key.** Provider keys are secrets; paste them yourself in the masked field, or export the environment variable yourself.
|
|
52
|
-
2. **The optional account.** Run `andorra login` yourself if you want hosted Jev routing or custom graphs — the browser sign-in is interactive. See [Accounts](../getting-started/accounts.md).
|
|
53
|
-
|
|
54
|
-
## Installing from source instead
|
|
55
|
-
|
|
56
|
-
To run unreleased changes, clone and link the repository as [Getting started](../getting-started/README.md#install-from-source) describes. `andorra update` does not update a source checkout: pull and rebuild it yourself, or switch to the npm release with `npm install -g @andorra-labs/code@latest`.
|