@activate-core/test-forge 0.3.0 → 0.3.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/dist/core/config.js +29 -0
- package/dist/core/index.js +1 -1
- package/dist/core/reference.js +3 -3
- package/package.json +1 -1
package/dist/core/config.js
CHANGED
|
@@ -127,6 +127,35 @@ export function withEditTools(cmd) {
|
|
|
127
127
|
args: [...cmd.args, '--permission-mode', 'acceptEdits'],
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Tools an external reference may need to be read: fetching a web page or
|
|
132
|
+
* a Notion doc. `acceptEdits` only auto-approves file edits, so a headless
|
|
133
|
+
* `claude -p` would otherwise be DENIED web/connector tools (no prompt to
|
|
134
|
+
* approve in non-interactive mode). We therefore pre-approve them.
|
|
135
|
+
*
|
|
136
|
+
* The connector must still be configured and authenticated in the user's
|
|
137
|
+
* own Claude CLI — this only grants permission to USE it headlessly. Both
|
|
138
|
+
* common Notion tool names are allow-listed (the claude.ai connector
|
|
139
|
+
* `claude_ai_Notion`, and a CLI-added server conventionally named
|
|
140
|
+
* `notion`). Non-Claude CLIs get the command unchanged.
|
|
141
|
+
*/
|
|
142
|
+
export function withReferenceTools(cmd) {
|
|
143
|
+
if (!isClaude(cmd.program))
|
|
144
|
+
return cmd;
|
|
145
|
+
const allow = [
|
|
146
|
+
'Read',
|
|
147
|
+
'Glob',
|
|
148
|
+
'Grep',
|
|
149
|
+
'WebFetch',
|
|
150
|
+
'WebSearch',
|
|
151
|
+
'mcp__notion__*',
|
|
152
|
+
'mcp__claude_ai_Notion__*',
|
|
153
|
+
].join(' ');
|
|
154
|
+
return {
|
|
155
|
+
program: cmd.program,
|
|
156
|
+
args: [...cmd.args, '--permission-mode', 'acceptEdits', '--allowedTools', allow],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
130
159
|
/**
|
|
131
160
|
* Decide where a journey's test file should go, based on its type
|
|
132
161
|
* and the config. Falls back to "generated-tests/<area>" when the
|
package/dist/core/index.js
CHANGED
package/dist/core/reference.js
CHANGED
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
* and tuned for the Claude CLI.
|
|
23
23
|
*/
|
|
24
24
|
import { execFileSync } from 'node:child_process';
|
|
25
|
-
import { loadConfig, splitCommand,
|
|
25
|
+
import { loadConfig, splitCommand, withReferenceTools } from './config.js';
|
|
26
26
|
/** Where the comparison report is written. */
|
|
27
27
|
export const DIFF_PATH = 'testforge.diff.md';
|
|
28
28
|
const MAP_PATH = 'testforge.md';
|
|
29
|
-
/** Run the configured AI command with read/write/web access. */
|
|
29
|
+
/** Run the configured AI command with read/write/web (+ Notion) access. */
|
|
30
30
|
function runAI(prompt) {
|
|
31
|
-
const { program, args } =
|
|
31
|
+
const { program, args } = withReferenceTools(splitCommand(loadConfig().aiCommand));
|
|
32
32
|
const output = execFileSync(program, args, {
|
|
33
33
|
input: prompt,
|
|
34
34
|
encoding: 'utf-8',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activate-core/test-forge",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "AI-powered QA automation. Scans a project, drafts journey docs, and generates seeded Jest/Playwright tests. Works in any project, with any AI CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|