testronaut 1.3.4 → 1.3.6
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/.devcontainer/devcontainer.json +21 -3
- package/.devcontainer/setup-github-auth.sh +36 -0
- package/.github/workflows/prepare-release.yml +168 -0
- package/.github/workflows/publish.yml +133 -0
- package/bin/cli.js +67 -0
- package/bin/init.js +1 -0
- package/bin/initHelpers.js +4 -0
- package/core/agent.js +13 -1
- package/core/config.js +65 -0
- package/core/redaction.js +30 -7
- package/core/turnLoop.js +35 -4
- package/package.json +5 -1
- package/runner/testronaut.js +15 -2
- package/tests/binTests/init.test.js +6 -0
- package/tests/binTests/initHelpersTests/defaultConfig.test.js +2 -0
- package/tests/coreTests/config.test.js +40 -0
- package/tests/coreTests/redation.test.js +30 -0
- package/tests/coreTests/turnLoop.test.js +1 -0
- package/tests/runnerTests/testronaut.test.js +7 -5
- package/tests/toolsTests/humanInput.test.js +26 -0
- package/tests/toolsTests/toolSchema.test.js +8 -0
- package/tests/toolsTests/turnLoopUtils.test.js +24 -0
- package/tools/chromeBrowser.js +2 -0
- package/tools/generateHtmlReport.js +13 -4
- package/tools/humanInput.js +165 -0
- package/tools/toolSchema.js +28 -0
- package/tools/turnLoopUtils.js +10 -6
package/tools/toolSchema.js
CHANGED
|
@@ -328,6 +328,34 @@ const toolsSchema = [
|
|
|
328
328
|
},
|
|
329
329
|
},
|
|
330
330
|
},
|
|
331
|
+
{
|
|
332
|
+
type: 'function',
|
|
333
|
+
function: {
|
|
334
|
+
name: 'request_human_input',
|
|
335
|
+
description:
|
|
336
|
+
'Pause for a human to enter a short verification code such as TOTP, SMS, or email confirmation. Use only when the page requires a code the agent cannot obtain itself.',
|
|
337
|
+
parameters: {
|
|
338
|
+
type: 'object',
|
|
339
|
+
properties: {
|
|
340
|
+
prompt: {
|
|
341
|
+
type: 'string',
|
|
342
|
+
description: 'Short prompt shown to the human. Do not ask for passwords or long free-form text.'
|
|
343
|
+
},
|
|
344
|
+
codeType: {
|
|
345
|
+
type: 'string',
|
|
346
|
+
enum: ['totp', 'sms', 'email', 'verification_code', 'other_code'],
|
|
347
|
+
default: 'verification_code'
|
|
348
|
+
},
|
|
349
|
+
maxLength: {
|
|
350
|
+
type: 'number',
|
|
351
|
+
default: 64,
|
|
352
|
+
description: 'Maximum accepted code length. Values are clamped to 1-64.'
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
required: ['prompt']
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
331
359
|
{
|
|
332
360
|
type: 'function',
|
|
333
361
|
function: {
|
package/tools/turnLoopUtils.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
+
import { redactPasswordInText } from '../core/redaction.js';
|
|
2
|
+
|
|
1
3
|
export const finalResponseHandler = (msg) => {
|
|
2
|
-
const
|
|
4
|
+
const content = String(msg.content ?? '');
|
|
5
|
+
const safeContent = redactPasswordInText(content);
|
|
6
|
+
const final = content.trim().toLowerCase();
|
|
3
7
|
if (final?.startsWith('success')) {
|
|
4
8
|
console.log('\n┏━ FINAL AGENT RESPONSE ━━━━━━━━━━━━━━━━━━━');
|
|
5
|
-
console.log(
|
|
9
|
+
console.log(safeContent);
|
|
6
10
|
console.log('┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
7
|
-
return { finalMessage:
|
|
11
|
+
return { finalMessage: safeContent, success: true};
|
|
8
12
|
}
|
|
9
13
|
if (final?.startsWith('failure')) {
|
|
10
14
|
console.log('\n┏━ FINAL AGENT RESPONSE ━━━━━━━━━━━━━━━━━━━');
|
|
11
|
-
console.log(
|
|
15
|
+
console.log(safeContent);
|
|
12
16
|
console.log('┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
13
|
-
return { finalMessage:
|
|
17
|
+
return { finalMessage: safeContent, success: false};
|
|
14
18
|
}
|
|
15
19
|
return null;
|
|
16
20
|
}
|
|
@@ -62,4 +66,4 @@ export function validateAndInsertMissingToolResponses(messages, options = {}) {
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
return true;
|
|
65
|
-
}
|
|
69
|
+
}
|