@pcamarajr/scout 0.6.0 → 0.7.1
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 +73 -237
- package/dist/cli.js +121 -1
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.js +3 -0
- package/dist/config.js.map +1 -1
- package/dist/credentials.d.ts +73 -0
- package/dist/credentials.js +196 -0
- package/dist/credentials.js.map +1 -0
- package/dist/engine.js +5 -8
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runner/agent-tools.d.ts +45 -0
- package/dist/runner/agent-tools.js +151 -0
- package/dist/runner/agent-tools.js.map +1 -0
- package/dist/runner/ai-runner.d.ts +11 -35
- package/dist/runner/ai-runner.js +36 -229
- package/dist/runner/ai-runner.js.map +1 -1
- package/dist/runner/engines/ai-sdk.d.ts +58 -0
- package/dist/runner/engines/ai-sdk.js +144 -0
- package/dist/runner/engines/ai-sdk.js.map +1 -0
- package/dist/runner/engines/claude-agent-sdk.d.ts +11 -0
- package/dist/runner/engines/claude-agent-sdk.js +117 -0
- package/dist/runner/engines/claude-agent-sdk.js.map +1 -0
- package/dist/runner/engines/index.d.ts +20 -0
- package/dist/runner/engines/index.js +28 -0
- package/dist/runner/engines/index.js.map +1 -0
- package/dist/runner/engines/types.d.ts +68 -0
- package/dist/runner/engines/types.js +37 -0
- package/dist/runner/engines/types.js.map +1 -0
- package/package.json +7 -1
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
import type { ScoutConfig } from "../config.js";
|
|
2
|
-
import type { Scenario
|
|
2
|
+
import type { Scenario } from "../types.js";
|
|
3
|
+
import { describeNoVerdict, relativizeUrl, type AiRunOutcome, type QueryEndInfo } from "./engines/types.js";
|
|
3
4
|
import { BrowserSession } from "./browser.js";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
reason: string;
|
|
7
|
-
steps: Step[];
|
|
8
|
-
transcript: string[];
|
|
9
|
-
/**
|
|
10
|
-
* Set when the runner itself failed to produce a verdict (agent never called
|
|
11
|
-
* scout_verdict) — NOT a UI judgment. Callers may retry and must report it
|
|
12
|
-
* as an infrastructure failure, never as "the scenario is blocked by the UI".
|
|
13
|
-
*/
|
|
14
|
-
runnerFailure?: string;
|
|
15
|
-
}
|
|
16
|
-
/** How the SDK query ended, for no-verdict diagnostics. */
|
|
17
|
-
export interface QueryEndInfo {
|
|
18
|
-
subtype: string;
|
|
19
|
-
numTurns?: number;
|
|
20
|
-
errors?: string[];
|
|
21
|
-
}
|
|
5
|
+
export { describeNoVerdict, relativizeUrl };
|
|
6
|
+
export type { AiRunOutcome, QueryEndInfo };
|
|
22
7
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
* survive --base-url / SCOUT_BASE_URL pointing at another server. URLs that
|
|
31
|
-
* merely share the prefix (http://localhost:3000x) or live on other hosts
|
|
32
|
-
* stay absolute.
|
|
33
|
-
*/
|
|
34
|
-
export declare function relativizeUrl(url: string, baseUrl: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* AI-driven run: a Claude agent navigates the real browser to verify the
|
|
37
|
-
* scenario. Every successful action is recorded as a deterministic Step so
|
|
38
|
-
* subsequent runs can replay without the LLM.
|
|
8
|
+
* AI-driven run, engine-neutral orchestrator. A Claude agent (via the Agent SDK
|
|
9
|
+
* by default, or the Vercel AI SDK when selected) navigates the real browser to
|
|
10
|
+
* verify the scenario. Every successful action is recorded as a deterministic
|
|
11
|
+
* Step so subsequent runs can replay without the LLM.
|
|
12
|
+
*
|
|
13
|
+
* Verdict capture, the forced-verdict rescue, and outcome assembly live HERE,
|
|
14
|
+
* above both engines, so behavior is identical regardless of engine.
|
|
39
15
|
*/
|
|
40
16
|
export declare function runWithAgent(session: BrowserSession, scenario: Scenario, config: ScoutConfig): Promise<AiRunOutcome>;
|
package/dist/runner/ai-runner.js
CHANGED
|
@@ -1,187 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { inferProvider } from "../credentials.js";
|
|
2
|
+
import { createScoutTools } from "./agent-tools.js";
|
|
3
|
+
import { selectEngine } from "./engines/index.js";
|
|
4
|
+
import { describeNoVerdict, relativizeUrl, } from "./engines/types.js";
|
|
5
|
+
// Re-exported from their new home so existing importers (src/index.ts, callers)
|
|
6
|
+
// keep working unchanged.
|
|
7
|
+
export { describeNoVerdict, relativizeUrl };
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
switch (end.subtype) {
|
|
13
|
-
case "error_max_turns":
|
|
14
|
-
return `o agente estourou o limite de ${maxTurns} turns sem chamar scout_verdict`;
|
|
15
|
-
case "error_during_execution":
|
|
16
|
-
return `erro durante a execução do agente${end.errors?.length ? `: ${end.errors.join("; ")}` : ""}`;
|
|
17
|
-
case "success":
|
|
18
|
-
return "o agente encerrou normalmente sem chamar scout_verdict";
|
|
19
|
-
default:
|
|
20
|
-
return `a sessão do agente terminou com "${end.subtype}"${end.errors?.length ? `: ${end.errors.join("; ")}` : ""}`;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Records navigation relative to the configured baseUrl so cached scripts
|
|
25
|
-
* survive --base-url / SCOUT_BASE_URL pointing at another server. URLs that
|
|
26
|
-
* merely share the prefix (http://localhost:3000x) or live on other hosts
|
|
27
|
-
* stay absolute.
|
|
28
|
-
*/
|
|
29
|
-
export function relativizeUrl(url, baseUrl) {
|
|
30
|
-
const base = baseUrl.replace(/\/+$/, "");
|
|
31
|
-
if (url === base || url === `${base}/`)
|
|
32
|
-
return "/";
|
|
33
|
-
if (url.startsWith(base)) {
|
|
34
|
-
const rest = url.slice(base.length);
|
|
35
|
-
if (rest.startsWith("/") || rest.startsWith("?") || rest.startsWith("#"))
|
|
36
|
-
return rest;
|
|
37
|
-
}
|
|
38
|
-
return url;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* AI-driven run: a Claude agent navigates the real browser to verify the
|
|
42
|
-
* scenario. Every successful action is recorded as a deterministic Step so
|
|
43
|
-
* subsequent runs can replay without the LLM.
|
|
9
|
+
* AI-driven run, engine-neutral orchestrator. A Claude agent (via the Agent SDK
|
|
10
|
+
* by default, or the Vercel AI SDK when selected) navigates the real browser to
|
|
11
|
+
* verify the scenario. Every successful action is recorded as a deterministic
|
|
12
|
+
* Step so subsequent runs can replay without the LLM.
|
|
13
|
+
*
|
|
14
|
+
* Verdict capture, the forced-verdict rescue, and outcome assembly live HERE,
|
|
15
|
+
* above both engines, so behavior is identical regardless of engine.
|
|
44
16
|
*/
|
|
45
17
|
export async function runWithAgent(session, scenario, config) {
|
|
46
18
|
const steps = [];
|
|
47
19
|
const transcript = [];
|
|
48
20
|
let verdict;
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
content: [{ type: "text", text: `ERRO: ${error instanceof Error ? error.message : String(error)}` }],
|
|
57
|
-
isError: true,
|
|
58
|
-
});
|
|
59
|
-
const browserServer = createSdkMcpServer({
|
|
60
|
-
name: "browser",
|
|
61
|
-
version: "1.0.0",
|
|
62
|
-
tools: [
|
|
63
|
-
tool("browser_navigate", "Navega para uma URL (absoluta ou relativa ao baseUrl do app). Para tokens/segredos na URL use placeholder $ENV:VAR_NAME — resolvido em runtime, nunca passa por você.", { url: z.string().describe("Ex: /login, /renovar?token=$ENV:TOKEN ou https://...") }, async ({ url }) => {
|
|
64
|
-
try {
|
|
65
|
-
await session.navigate(url);
|
|
66
|
-
record({ kind: "navigate", url: relativizeUrl(url, config.baseUrl) });
|
|
67
|
-
return ok(await afterAction());
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
return fail(e);
|
|
71
|
-
}
|
|
72
|
-
}),
|
|
73
|
-
tool("browser_snapshot", "Retorna o estado atual da página: URL, título, elementos interativos numerados [ref] e texto visível. Use sempre que precisar decidir a próxima ação.", {}, async () => {
|
|
74
|
-
try {
|
|
75
|
-
return ok(await afterAction());
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
return fail(e);
|
|
79
|
-
}
|
|
80
|
-
}),
|
|
81
|
-
tool("browser_click", "Clica no elemento identificado pelo [ref] do último snapshot.", { ref: z.number().int().describe("Ref numérico do snapshot") }, async ({ ref }) => {
|
|
82
|
-
try {
|
|
83
|
-
const target = await session.click(ref);
|
|
84
|
-
record({ kind: "click", target });
|
|
85
|
-
return ok(`Cliquei em ${target.description}.\n\n${await afterAction()}`);
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
return fail(e);
|
|
89
|
-
}
|
|
90
|
-
}),
|
|
91
|
-
tool("browser_fill", "Preenche um campo. Para credenciais/segredos use placeholder $ENV:VAR_NAME — o valor real vem do ambiente e nunca passa por você.", {
|
|
92
|
-
ref: z.number().int(),
|
|
93
|
-
value: z.string().describe("Texto literal ou $ENV:VAR_NAME"),
|
|
94
|
-
}, async ({ ref, value }) => {
|
|
95
|
-
try {
|
|
96
|
-
const target = await session.fill(ref, resolveEnvValue(value));
|
|
97
|
-
record({ kind: "fill", target, value });
|
|
98
|
-
return ok(`Preenchi ${target.description}.`);
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
101
|
-
return fail(e);
|
|
102
|
-
}
|
|
103
|
-
}),
|
|
104
|
-
tool("browser_select", "Seleciona uma opção em um <select> pelo value ou label.", { ref: z.number().int(), value: z.string() }, async ({ ref, value }) => {
|
|
105
|
-
try {
|
|
106
|
-
const target = await session.select(ref, resolveEnvValue(value));
|
|
107
|
-
record({ kind: "select", target, value });
|
|
108
|
-
return ok(`Selecionei "${value}" em ${target.description}.\n\n${await afterAction()}`);
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
return fail(e);
|
|
112
|
-
}
|
|
113
|
-
}),
|
|
114
|
-
tool("browser_press", "Pressiona uma tecla (Enter, Escape, Tab, ArrowDown...).", { key: z.string() }, async ({ key }) => {
|
|
115
|
-
try {
|
|
116
|
-
await session.press(key);
|
|
117
|
-
record({ kind: "press", key });
|
|
118
|
-
return ok(await afterAction());
|
|
119
|
-
}
|
|
120
|
-
catch (e) {
|
|
121
|
-
return fail(e);
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
124
|
-
tool("browser_wait_for", "Espera texto aparecer na página OU a URL conter um trecho. Use após ações que disparam carregamento.", {
|
|
125
|
-
text: z.string().optional().describe("Texto que deve ficar visível"),
|
|
126
|
-
urlContains: z.string().optional().describe("Trecho esperado na URL"),
|
|
127
|
-
}, async ({ text, urlContains }) => {
|
|
128
|
-
try {
|
|
129
|
-
if (text) {
|
|
130
|
-
await session.waitForText(text);
|
|
131
|
-
record({ kind: "waitForText", text });
|
|
132
|
-
}
|
|
133
|
-
if (urlContains) {
|
|
134
|
-
await session.waitForUrl(urlContains);
|
|
135
|
-
record({ kind: "waitForUrl", pattern: urlContains });
|
|
136
|
-
}
|
|
137
|
-
return ok(await afterAction());
|
|
138
|
-
}
|
|
139
|
-
catch (e) {
|
|
140
|
-
return fail(e);
|
|
141
|
-
}
|
|
142
|
-
}),
|
|
143
|
-
tool("browser_assert", "Registra uma verificação do comportamento esperado. Use para CADA expectativa do cenário — essas asserções viram o teste determinístico.", {
|
|
144
|
-
visibleText: z.string().optional().describe("Texto que DEVE estar visível"),
|
|
145
|
-
notVisibleText: z.string().optional().describe("Texto que NÃO deve estar visível"),
|
|
146
|
-
urlContains: z.string().optional().describe("Trecho que a URL deve conter"),
|
|
147
|
-
}, async ({ visibleText, notVisibleText, urlContains }) => {
|
|
148
|
-
try {
|
|
149
|
-
if (visibleText) {
|
|
150
|
-
await session.assertVisible(visibleText);
|
|
151
|
-
record({ kind: "assertVisible", text: visibleText });
|
|
152
|
-
}
|
|
153
|
-
if (notVisibleText) {
|
|
154
|
-
await session.assertNotVisible(notVisibleText);
|
|
155
|
-
record({ kind: "assertNotVisible", text: notVisibleText });
|
|
156
|
-
}
|
|
157
|
-
if (urlContains) {
|
|
158
|
-
await session.assertUrl(urlContains);
|
|
159
|
-
record({ kind: "assertUrl", pattern: urlContains });
|
|
160
|
-
}
|
|
161
|
-
return ok("Asserção passou.");
|
|
162
|
-
}
|
|
163
|
-
catch (e) {
|
|
164
|
-
return fail(e);
|
|
165
|
-
}
|
|
166
|
-
}),
|
|
167
|
-
tool("browser_screenshot", "Captura screenshot como evidência. Use em momentos-chave (estado final, paywall, erro encontrado).", { label: z.string().describe("Rótulo curto, ex: 'paywall-exibido'") }, async ({ label }) => {
|
|
168
|
-
try {
|
|
169
|
-
await session.screenshot(label);
|
|
170
|
-
record({ kind: "screenshot", label });
|
|
171
|
-
return ok(`Screenshot "${label}" salvo.`);
|
|
172
|
-
}
|
|
173
|
-
catch (e) {
|
|
174
|
-
return fail(e);
|
|
175
|
-
}
|
|
176
|
-
}),
|
|
177
|
-
tool("scout_verdict", "OBRIGATÓRIO ao final: registra o veredito da verificação. Após chamar, encerre.", {
|
|
178
|
-
verdict: z.enum(["verified", "failed", "partial", "blocked"]),
|
|
179
|
-
reason: z.string().describe("Justificativa objetiva, citando o que foi observado"),
|
|
180
|
-
}, async (args) => {
|
|
181
|
-
verdict = args;
|
|
182
|
-
return ok("Veredito registrado. Encerre agora.");
|
|
183
|
-
}),
|
|
184
|
-
],
|
|
21
|
+
const tools = createScoutTools({
|
|
22
|
+
session,
|
|
23
|
+
config,
|
|
24
|
+
record: (step) => steps.push(step),
|
|
25
|
+
setVerdict: (v) => {
|
|
26
|
+
verdict = v;
|
|
27
|
+
},
|
|
185
28
|
});
|
|
186
29
|
const profileInfo = scenario.profile
|
|
187
30
|
? `Sessão autenticada com o profile "${scenario.profile}"${config.profiles[scenario.profile]?.description ? ` (${config.profiles[scenario.profile].description})` : ""}. Você JÁ está logado — não faça login de novo a menos que o cenário peça.`
|
|
@@ -214,65 +57,29 @@ Regras:
|
|
|
214
57
|
- Não re-preencha um campo que você já preencheu, a menos que a página tenha limpado o valor — cada ação sua vira um passo do script gravado, e passos duplicados são ruído que fragiliza o replay.
|
|
215
58
|
- Seja econômico: não explore além do cenário. Seu orçamento é de ${config.maxTurns} ações.
|
|
216
59
|
- Se você está repetindo tentativas sem progresso (overlay bloqueando, elemento que não aparece), PARE e chame scout_verdict (partial ou blocked) explicando o obstáculo — um veredito parcial vale mais que morrer sem veredito.`;
|
|
217
|
-
const
|
|
60
|
+
const userPrompt = `Verifique este cenário de QA:\n\n## ${scenario.name}\n\n${scenario.scenario}${scenario.notes ? `\n\nNotas: ${scenario.notes}` : ""}`;
|
|
61
|
+
const provider = inferProvider(config.model);
|
|
62
|
+
const engine = selectEngine(provider, config.engine);
|
|
63
|
+
const run = await engine.run({
|
|
64
|
+
provider,
|
|
218
65
|
model: config.model,
|
|
219
66
|
systemPrompt,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
let sessionId;
|
|
227
|
-
let endInfo;
|
|
228
|
-
/** Drains a query, collecting transcript/session/end info. Always aborts at the end so no claude-agent-sdk subprocess outlives the run. */
|
|
229
|
-
const drain = async (q, controller) => {
|
|
230
|
-
try {
|
|
231
|
-
for await (const message of q) {
|
|
232
|
-
if ("session_id" in message && message.session_id)
|
|
233
|
-
sessionId = message.session_id;
|
|
234
|
-
if (message.type === "assistant") {
|
|
235
|
-
for (const block of message.message.content) {
|
|
236
|
-
if (block.type === "text" && block.text.trim())
|
|
237
|
-
transcript.push(block.text.trim());
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
if (message.type === "result") {
|
|
241
|
-
endInfo = {
|
|
242
|
-
subtype: message.subtype,
|
|
243
|
-
numTurns: message.num_turns,
|
|
244
|
-
errors: "errors" in message ? message.errors : undefined,
|
|
245
|
-
};
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
finally {
|
|
251
|
-
controller.abort();
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
const mainController = new AbortController();
|
|
255
|
-
try {
|
|
256
|
-
await drain(query({
|
|
257
|
-
prompt: `Verifique este cenário de QA:\n\n## ${scenario.name}\n\n${scenario.scenario}${scenario.notes ? `\n\nNotas: ${scenario.notes}` : ""}`,
|
|
258
|
-
options: { ...baseOptions, maxTurns: config.maxTurns, abortController: mainController },
|
|
259
|
-
}), mainController);
|
|
260
|
-
}
|
|
261
|
-
catch (error) {
|
|
262
|
-
endInfo = { subtype: "sdk_error", errors: [error instanceof Error ? error.message : String(error)] };
|
|
263
|
-
}
|
|
67
|
+
userPrompt,
|
|
68
|
+
tools,
|
|
69
|
+
maxTurns: config.maxTurns,
|
|
70
|
+
});
|
|
71
|
+
transcript.push(...run.transcript);
|
|
72
|
+
let endInfo = run.end;
|
|
264
73
|
// Forced-verdict rescue: the agent died mute (typically error_max_turns).
|
|
265
74
|
// Resume the same session with a tiny turn budget and demand scout_verdict
|
|
266
75
|
// with whatever it observed — a partial verdict beats a silent death.
|
|
267
76
|
const mainCause = verdict ? undefined : describeNoVerdict(endInfo, config.maxTurns);
|
|
268
|
-
if (!verdict
|
|
77
|
+
if (!verdict) {
|
|
269
78
|
transcript.push(`[scout] Agente encerrou sem veredito (${mainCause}) — resgate: exigindo scout_verdict com o que foi observado.`);
|
|
270
|
-
const rescueController = new AbortController();
|
|
271
79
|
try {
|
|
272
|
-
await
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}), rescueController);
|
|
80
|
+
const rescue = await run.resume("Sua verificação atingiu o limite de ações. NÃO execute mais nenhuma ação de browser. Chame scout_verdict AGORA com base no que você já observou: 'partial' se a verificação ficou incompleta, 'blocked' se você nem chegou ao fluxo, 'failed'/'verified' apenas se já tinha evidência suficiente.", 4);
|
|
81
|
+
transcript.push(...rescue.transcript);
|
|
82
|
+
endInfo = rescue.end;
|
|
276
83
|
}
|
|
277
84
|
catch (error) {
|
|
278
85
|
transcript.push(`[scout] Resgate de veredito falhou: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-runner.js","sourceRoot":"","sources":["../../src/runner/ai-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAkB,eAAe,EAAE,MAAM,cAAc,CAAC;AAsB/D;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAA6B,EAAE,QAAgB;IAC/E,IAAI,CAAC,GAAG;QAAE,OAAO,wEAAwE,CAAC;IAC1F,QAAQ,GAAG,CAAC,OAAO,EAAE,CAAC;QACpB,KAAK,iBAAiB;YACpB,OAAO,iCAAiC,QAAQ,iCAAiC,CAAC;QACpF,KAAK,wBAAwB;YAC3B,OAAO,oCAAoC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACtG,KAAK,SAAS;YACZ,OAAO,wDAAwD,CAAC;QAClE;YACE,OAAO,oCAAoC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACvH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,OAAe;IACxD,MAAM,IAAI,GAAG,OAAO,CAAC,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
|
+
import { type FinishReason, type LanguageModel } from "ai";
|
|
2
|
+
import type { AiProvider } from "../../credentials.js";
|
|
3
|
+
import type { AgentEngine, EngineRunSpec, EngineSession, QueryEndInfo } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Optional injection seam. Production leaves `model` unset and we resolve the
|
|
6
|
+
* provider model from the spec's provider + model id; tests pass a
|
|
7
|
+
* MockLanguageModelV3 so the tool-calling loop runs deterministically with no
|
|
8
|
+
* network.
|
|
9
|
+
*/
|
|
10
|
+
export interface AiSdkEngineOptions {
|
|
11
|
+
model?: LanguageModel;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Maps a provider + model id onto the matching AI SDK `LanguageModel`.
|
|
15
|
+
*
|
|
16
|
+
* anthropic → @ai-sdk/anthropic
|
|
17
|
+
* openai → @ai-sdk/openai
|
|
18
|
+
* google → @ai-sdk/google when a Gemini/Generative-AI API key is present;
|
|
19
|
+
* otherwise @ai-sdk/google-vertex (keyless, via Application Default
|
|
20
|
+
* Credentials). The split is driven by the same credential ladder
|
|
21
|
+
* `detectAiCredentials("google")` reports, so the engine and
|
|
22
|
+
* `scout doctor` agree on which sub-provider runs.
|
|
23
|
+
*
|
|
24
|
+
* For Vertex we pass `project` from GOOGLE_CLOUD_PROJECT when set (the provider
|
|
25
|
+
* otherwise reads GOOGLE_VERTEX_PROJECT) and default `location` to
|
|
26
|
+
* GOOGLE_VERTEX_LOCATION or "us-central1" — the Vertex provider requires a
|
|
27
|
+
* location eagerly at model construction, so we supply a sensible default to
|
|
28
|
+
* keep the keyless path zero-config. ADC itself comes from google-auth-library.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveModel(provider: AiProvider, modelId: string): LanguageModel;
|
|
31
|
+
/**
|
|
32
|
+
* Second engine, built on the Vercel AI SDK. It runs the SAME engine-neutral
|
|
33
|
+
* ScoutTool set through `generateText`'s tool-calling loop, against Anthropic,
|
|
34
|
+
* Google (Gemini API key or Vertex ADC) or OpenAI — selected per the spec's
|
|
35
|
+
* provider via {@link resolveModel}. The shared orchestrator owns prompts,
|
|
36
|
+
* verdict capture and the forced-verdict rescue — this class only drives the SDK
|
|
37
|
+
* loop and maps the SDK's `finishReason` into the QueryEndInfo vocabulary the
|
|
38
|
+
* rescue understands.
|
|
39
|
+
*/
|
|
40
|
+
export declare class AiSdkEngine implements AgentEngine {
|
|
41
|
+
private readonly opts;
|
|
42
|
+
constructor(opts?: AiSdkEngineOptions);
|
|
43
|
+
run(spec: EngineRunSpec): Promise<EngineSession>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Maps the AI SDK `finishReason` onto the QueryEndInfo.subtype vocabulary that
|
|
47
|
+
* {@link describeNoVerdict} and the forced-verdict rescue already speak.
|
|
48
|
+
*
|
|
49
|
+
* tool-calls / length → "error_max_turns" (hit the step budget mid-flight)
|
|
50
|
+
* stop → "success" (model ended its turn cleanly)
|
|
51
|
+
* error / content-filter / other → "error_during_execution"
|
|
52
|
+
*
|
|
53
|
+
* Rationale: when the loop stops on `tool-calls` it means `stopWhen` cut it off
|
|
54
|
+
* with a tool call still pending — i.e. it would have kept going, the budget ran
|
|
55
|
+
* out (exactly the Agent SDK's `error_max_turns`). `length` is the token-budget
|
|
56
|
+
* analog. Only a clean `stop` means the model chose to end its turn.
|
|
57
|
+
*/
|
|
58
|
+
export declare function toEndInfo(finishReason: FinishReason, numTurns: number): QueryEndInfo;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { anthropic } from "@ai-sdk/anthropic";
|
|
2
|
+
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
3
|
+
import { createVertex } from "@ai-sdk/google-vertex";
|
|
4
|
+
import { openai } from "@ai-sdk/openai";
|
|
5
|
+
import { generateText, stepCountIs, tool, } from "ai";
|
|
6
|
+
import { detectAiCredentials } from "../../credentials.js";
|
|
7
|
+
/**
|
|
8
|
+
* Maps a provider + model id onto the matching AI SDK `LanguageModel`.
|
|
9
|
+
*
|
|
10
|
+
* anthropic → @ai-sdk/anthropic
|
|
11
|
+
* openai → @ai-sdk/openai
|
|
12
|
+
* google → @ai-sdk/google when a Gemini/Generative-AI API key is present;
|
|
13
|
+
* otherwise @ai-sdk/google-vertex (keyless, via Application Default
|
|
14
|
+
* Credentials). The split is driven by the same credential ladder
|
|
15
|
+
* `detectAiCredentials("google")` reports, so the engine and
|
|
16
|
+
* `scout doctor` agree on which sub-provider runs.
|
|
17
|
+
*
|
|
18
|
+
* For Vertex we pass `project` from GOOGLE_CLOUD_PROJECT when set (the provider
|
|
19
|
+
* otherwise reads GOOGLE_VERTEX_PROJECT) and default `location` to
|
|
20
|
+
* GOOGLE_VERTEX_LOCATION or "us-central1" — the Vertex provider requires a
|
|
21
|
+
* location eagerly at model construction, so we supply a sensible default to
|
|
22
|
+
* keep the keyless path zero-config. ADC itself comes from google-auth-library.
|
|
23
|
+
*/
|
|
24
|
+
export function resolveModel(provider, modelId) {
|
|
25
|
+
switch (provider) {
|
|
26
|
+
case "anthropic":
|
|
27
|
+
return anthropic(modelId);
|
|
28
|
+
case "openai":
|
|
29
|
+
return openai(modelId);
|
|
30
|
+
case "google": {
|
|
31
|
+
const status = detectAiCredentials("google");
|
|
32
|
+
const usesApiKey = status.ok && status.source !== undefined && /API_KEY$/.test(status.source);
|
|
33
|
+
if (usesApiKey)
|
|
34
|
+
return createGoogleGenerativeAI()(modelId);
|
|
35
|
+
const project = process.env.GOOGLE_CLOUD_PROJECT?.trim();
|
|
36
|
+
const location = process.env.GOOGLE_VERTEX_LOCATION?.trim() || "us-central1";
|
|
37
|
+
return createVertex({ location, ...(project ? { project } : {}) })(modelId);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Second engine, built on the Vercel AI SDK. It runs the SAME engine-neutral
|
|
43
|
+
* ScoutTool set through `generateText`'s tool-calling loop, against Anthropic,
|
|
44
|
+
* Google (Gemini API key or Vertex ADC) or OpenAI — selected per the spec's
|
|
45
|
+
* provider via {@link resolveModel}. The shared orchestrator owns prompts,
|
|
46
|
+
* verdict capture and the forced-verdict rescue — this class only drives the SDK
|
|
47
|
+
* loop and maps the SDK's `finishReason` into the QueryEndInfo vocabulary the
|
|
48
|
+
* rescue understands.
|
|
49
|
+
*/
|
|
50
|
+
export class AiSdkEngine {
|
|
51
|
+
opts;
|
|
52
|
+
constructor(opts = {}) {
|
|
53
|
+
this.opts = opts;
|
|
54
|
+
}
|
|
55
|
+
async run(spec) {
|
|
56
|
+
const model = this.opts.model ?? resolveModel(spec.provider, spec.model);
|
|
57
|
+
const tools = buildAiSdkTools(spec.tools);
|
|
58
|
+
const transcript = [];
|
|
59
|
+
// Running conversation so resume() can append the rescue prompt and
|
|
60
|
+
// continue from where the agent left off.
|
|
61
|
+
const messages = [{ role: "user", content: spec.userPrompt }];
|
|
62
|
+
const abortController = new AbortController();
|
|
63
|
+
const step = async (maxTurns) => {
|
|
64
|
+
try {
|
|
65
|
+
const result = await generateText({
|
|
66
|
+
model,
|
|
67
|
+
system: spec.systemPrompt,
|
|
68
|
+
messages,
|
|
69
|
+
tools,
|
|
70
|
+
stopWhen: stepCountIs(maxTurns),
|
|
71
|
+
abortSignal: abortController.signal,
|
|
72
|
+
});
|
|
73
|
+
// Collect assistant text across every step in order.
|
|
74
|
+
for (const s of result.steps) {
|
|
75
|
+
if (s.text && s.text.trim())
|
|
76
|
+
transcript.push(s.text.trim());
|
|
77
|
+
}
|
|
78
|
+
// Persist the full assistant/tool exchange so the next step continues it.
|
|
79
|
+
messages.push(...result.response.messages);
|
|
80
|
+
return toEndInfo(result.finishReason, result.steps.length);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return {
|
|
84
|
+
subtype: "error_during_execution",
|
|
85
|
+
errors: [error instanceof Error ? error.message : String(error)],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const end = await step(spec.maxTurns);
|
|
90
|
+
const resume = async (prompt, maxTurns) => {
|
|
91
|
+
const before = transcript.length;
|
|
92
|
+
messages.push({ role: "user", content: prompt });
|
|
93
|
+
const resumeEnd = await step(maxTurns);
|
|
94
|
+
return { end: resumeEnd, transcript: transcript.slice(before) };
|
|
95
|
+
};
|
|
96
|
+
return { end, transcript, resume };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Maps the AI SDK `finishReason` onto the QueryEndInfo.subtype vocabulary that
|
|
101
|
+
* {@link describeNoVerdict} and the forced-verdict rescue already speak.
|
|
102
|
+
*
|
|
103
|
+
* tool-calls / length → "error_max_turns" (hit the step budget mid-flight)
|
|
104
|
+
* stop → "success" (model ended its turn cleanly)
|
|
105
|
+
* error / content-filter / other → "error_during_execution"
|
|
106
|
+
*
|
|
107
|
+
* Rationale: when the loop stops on `tool-calls` it means `stopWhen` cut it off
|
|
108
|
+
* with a tool call still pending — i.e. it would have kept going, the budget ran
|
|
109
|
+
* out (exactly the Agent SDK's `error_max_turns`). `length` is the token-budget
|
|
110
|
+
* analog. Only a clean `stop` means the model chose to end its turn.
|
|
111
|
+
*/
|
|
112
|
+
export function toEndInfo(finishReason, numTurns) {
|
|
113
|
+
switch (finishReason) {
|
|
114
|
+
case "tool-calls":
|
|
115
|
+
case "length":
|
|
116
|
+
return { subtype: "error_max_turns", numTurns };
|
|
117
|
+
case "stop":
|
|
118
|
+
return { subtype: "success", numTurns };
|
|
119
|
+
default:
|
|
120
|
+
return { subtype: "error_during_execution", numTurns, errors: [`finishReason=${finishReason}`] };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Adapts the engine-neutral ScoutTool set into AI SDK tools. `execute` returns
|
|
125
|
+
* the tool text; on a tool error we return the error string (prefixed "ERRO:",
|
|
126
|
+
* same as the handler produces) rather than throwing. Returning a string keeps
|
|
127
|
+
* the model in the loop with the failure visible — the same recovery affordance
|
|
128
|
+
* the Agent SDK gives via an isError tool result — instead of aborting the run.
|
|
129
|
+
*/
|
|
130
|
+
function buildAiSdkTools(scoutTools) {
|
|
131
|
+
const entries = scoutTools.map((scoutTool) => [
|
|
132
|
+
scoutTool.name,
|
|
133
|
+
tool({
|
|
134
|
+
description: scoutTool.description,
|
|
135
|
+
inputSchema: scoutTool.schema,
|
|
136
|
+
execute: async (args) => {
|
|
137
|
+
const result = await scoutTool.handler(args);
|
|
138
|
+
return result.text;
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
]);
|
|
142
|
+
return Object.fromEntries(entries);
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=ai-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-sdk.js","sourceRoot":"","sources":["../../../src/runner/engines/ai-sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,WAAW,EACX,IAAI,GAIL,MAAM,IAAI,CAAC;AAEZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAoB3D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,YAAY,CAAC,QAAoB,EAAE,OAAe;IAChE,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,WAAW;YACd,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5B,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;QACzB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,MAAM,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YAC7C,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI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,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QAClE,CAAC,CAAC;QAEF,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;CACF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,YAA0B,EAAE,QAAgB;IACpE,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,YAAY,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC;QAClD,KAAK,MAAM;YACT,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;QAC1C;YACE,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,gBAAgB,YAAY,EAAE,CAAC,EAAE,CAAC;IACrG,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,UAAuB;IAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;QAC5C,SAAS,CAAC,IAAI;QACd,IAAI,CAAC;YACH,WAAW,EAAE,SAAS,CAAC,WAAW;YAClC,WAAW,EAAE,SAAS,CAAC,MAAM;YAC7B,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;gBAC/B,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC7C,OAAO,MAAM,CAAC,IAAI,CAAC;YACrB,CAAC;SACF,CAAC;KACH,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentEngine, EngineRunSpec, EngineSession } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The original, trusted engine: runs the verification through the
|
|
4
|
+
* `@anthropic-ai/claude-agent-sdk` subprocess. Behavior here is intentionally
|
|
5
|
+
* IDENTICAL to the pre-refactor ai-runner: bypassPermissions, empty
|
|
6
|
+
* settingSources, allowedTools scoped to the in-process MCP browser server, the
|
|
7
|
+
* query()+drain() loop, and an abort-in-finally so no subprocess outlives a run.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ClaudeAgentSdkEngine implements AgentEngine {
|
|
10
|
+
run(spec: EngineRunSpec): Promise<EngineSession>;
|
|
11
|
+
}
|