testeiya 0.4.4 → 0.4.5
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 +21 -1
- package/dist/prompt/clis.js +38 -0
- package/dist/prompt/clis.js.map +1 -0
- package/dist/prompt/comment-thread.js +56 -44
- package/dist/prompt/comment-thread.js.map +1 -1
- package/dist/prompt/system-prompt.js +154 -174
- package/dist/prompt/system-prompt.js.map +1 -1
- package/dist/src/doctor.js +9 -1
- package/dist/src/doctor.js.map +1 -1
- package/dist/src/langfuse-extension.js +135 -0
- package/dist/src/langfuse-extension.js.map +1 -0
- package/dist/src/langfuse.js +143 -0
- package/dist/src/langfuse.js.map +1 -0
- package/dist/src/output.js +48 -3
- package/dist/src/output.js.map +1 -1
- package/dist/src/run.js +36 -12
- package/dist/src/run.js.map +1 -1
- package/dist/src/session.js +22 -8
- package/dist/src/session.js.map +1 -1
- package/package.json +1 -1
- package/prompt/clis.ts +45 -0
- package/prompt/comment-thread.ts +65 -47
- package/prompt/system-prompt.ts +182 -184
- package/skills/playwright/playwright-cli/SKILL.md +49 -0
- package/skills/playwright/playwright-cli/references/pr-attachments.md +60 -0
- package/skills/playwright/playwright-cli/references/session-management.md +2 -0
- package/skills/playwright/playwright-cli/references/video-recording.md +12 -0
- package/skills/skills.lock.json +2 -2
- package/skills/testomatio/requirements/write-user-story/SKILL.md +7 -10
- package/skills/testomatio/test-management/scan-automation-project/SKILL.md +103 -26
- package/dist/prompt/context.js +0 -87
- package/dist/prompt/context.js.map +0 -1
- package/dist/prompt/index.js +0 -60
- package/dist/prompt/index.js.map +0 -1
- package/dist/prompt/print.js +0 -30
- package/dist/prompt/print.js.map +0 -1
- package/dist/prompt/project-info.js +0 -2
- package/dist/prompt/project-info.js.map +0 -1
- package/dist/prompt/testomatio.js +0 -264
- package/dist/prompt/testomatio.js.map +0 -1
- package/dist/prompt/tools.js +0 -70
- package/dist/prompt/tools.js.map +0 -1
- package/dist/prompt/vocab.js +0 -8
- package/dist/prompt/vocab.js.map +0 -1
- package/prompt/context.ts +0 -108
- package/prompt/index.ts +0 -102
- package/prompt/print.ts +0 -32
- package/prompt/project-info.ts +0 -30
- package/prompt/testomatio.ts +0 -281
- package/prompt/tools.ts +0 -72
- package/prompt/vocab.ts +0 -7
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: scan-automation-project
|
|
3
|
-
description: Scan project
|
|
3
|
+
description: Scan a project and inventory what is available for QA work - project type, languages, frameworks, manual `*.test.md` cases, automated tests and automated references, and how Testomat.io is reachable (token, MCP, project settings). Use this skill whenever analyzing a codebase for test planning, detecting test frameworks, counting tests, or preparing for test automation. Specifically, when the user mentions "scan project", "what tests exist", "how many tests", "analyze codebase", "detect frameworks", "test matrix", or needs an inventory before a QA workflow.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: Testomat.io
|
|
7
|
-
version: 1.
|
|
7
|
+
version: 1.1.0
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Scan Automation Project
|
|
11
11
|
|
|
12
|
-
Scan project
|
|
12
|
+
Scan the project and return a QA-focused inventory: project type, languages, frameworks, existing tests, and what Testomat.io access is available.
|
|
13
13
|
|
|
14
14
|
**Shallow scan only.** No full import resolution, no line-by-line parsing, no reading full test implementations. High-level structure only.
|
|
15
15
|
|
|
@@ -27,26 +27,42 @@ Where is the source code?
|
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
- Wait for the user's reply.
|
|
30
|
-
- If the user gives a Git repo or another folder, clone or symlink it into `.testeiya
|
|
30
|
+
- If the user gives a Git repo or another folder, clone or symlink it into `.testeiya/<name>/` (the source's basename; `extra-` prefix if taken). No-op if it is already there.
|
|
31
|
+
|
|
32
|
+
### The `.testeiya/` folder
|
|
33
|
+
|
|
34
|
+
All persistent QA metadata lives in `.testeiya/` in the project root.
|
|
35
|
+
|
|
36
|
+
- `<name>/`: a linked or cloned external project, named after its source. Read-only reference.
|
|
37
|
+
- `requirements/`: user stories and acceptance criteria (pdfs, docs, images).
|
|
38
|
+
- `docs/`: feature explanations, test planning and strategy files. Prose for humans, never data dumps.
|
|
39
|
+
- `manual-tests/`: markdown test cases pulled from Testomat.io.
|
|
40
|
+
- `auto-tests/`: references to the relevant automated (e2e) tests.
|
|
41
|
+
- `exploratory/`: explorbot setup.
|
|
42
|
+
- `project-info.json`: the project's settings as Testomat.io reports them, when cached.
|
|
43
|
+
|
|
44
|
+
Rules:
|
|
45
|
+
|
|
46
|
+
- It is a dot-folder. File-search tools skip it by default: search it with hidden:true or an explicit `.testeiya/` path prefix. A linked folder is a symlink; wildcard searches do not descend into it, so search it with its own `.testeiya/<name>/` prefix.
|
|
47
|
+
- It excludes itself from git: when you create `.testeiya/`, also create `.testeiya/.gitignore` containing a single `*`. **Never add `.testeiya/` to the repo's own `.gitignore`**: a repo-level entry hides the folder from search tools, so the next scan reports "no manual tests" while the cases sit right there.
|
|
31
48
|
|
|
32
49
|
### Rule for pulled data
|
|
33
50
|
|
|
34
51
|
**When you need to pull external data** (manual test cases, app code, e2e tests from another repo) into this project:
|
|
35
52
|
|
|
36
|
-
| This project has | Store pulled data in |
|
|
37
|
-
| ------------------ | ---------------------- |
|
|
38
|
-
| **Source code** (`src/` folder) or **big project** | `.testeiya/…` |
|
|
39
|
-
| **Only test infrastructure** (e2e dirs like `tests/`, `playwright/`, `cypress/` but no `src/`) | `manual-tests/` or `e2e-tests/` |
|
|
40
|
-
| **Empty / manual-only** | `manual-tests/` |
|
|
53
|
+
| This project has | Store pulled data in |
|
|
54
|
+
| ------------------ | ---------------------- |
|
|
55
|
+
| **Source code** (`src/` folder) or **big project** | `.testeiya/…` |
|
|
56
|
+
| **Only test infrastructure** (e2e dirs like `tests/`, `playwright/`, `cypress/` but no `src/`) | `manual-tests/` or `e2e-tests/` |
|
|
57
|
+
| **Empty / manual-only** | `manual-tests/` |
|
|
41
58
|
|
|
42
59
|
Detection logic:
|
|
43
60
|
1. Has `src/` folder or is a monorepo? → Use `.testeiya/`
|
|
44
61
|
2. Has e2e test dirs (`tests/`, `playwright/`, `cypress/`, `e2e/`)? → Use tracked folder (`manual-tests/`, `e2e-tests/`)
|
|
45
62
|
3. Otherwise → Default to `manual-tests/`
|
|
46
63
|
|
|
47
|
-
- Any skill that creates `.testeiya/...` must also add `.testeiya/` to the project's `.gitignore` — but only if it is not there yet. Never add it twice.
|
|
48
64
|
- The rule covers *pulled* data only. Output a skill *produces* and the user wants — a `coverage.*.yml`, new `*.test.md` files — goes in the repo as normal.
|
|
49
|
-
- On a source repo with no manual tests, this skill changes no tracked file: it only creates the
|
|
65
|
+
- On a source repo with no manual tests, this skill changes no tracked file: it only creates the self-ignored `.testeiya/` directory.
|
|
50
66
|
- **Only touch `.testeiya/` and tracked folders — never pollute the repo with cache in a wrong location.**
|
|
51
67
|
|
|
52
68
|
## Step 2: Project Analysis
|
|
@@ -59,11 +75,15 @@ Include:
|
|
|
59
75
|
|
|
60
76
|
Exclude:
|
|
61
77
|
- Dependencies, build output, coverage, reports, caches, config, lock, and environment files.
|
|
62
|
-
- Paths ignored by `.gitignore` — but **not** `.testeiya
|
|
78
|
+
- Paths ignored by `.gitignore` — but **not** `.testeiya/<name>/`. In a manual-tests repo the app code lives there; scan it as source.
|
|
63
79
|
- Testeiya internal files (e.g. `session-factory.ts`, `system-prompt.ts`).
|
|
64
80
|
- **If in doubt**, exclude.
|
|
65
81
|
|
|
66
82
|
From the file list:
|
|
83
|
+
- Classify the **project type**, one of:
|
|
84
|
+
- `source`: application source code. Never change it; use it for discovery.
|
|
85
|
+
- `e2e`: a test automation project (e2e dirs, a test framework config, little or no app source). You can write tests for it.
|
|
86
|
+
- `manual`: empty, or mostly `*.test.md` files. Test cases go into the project itself.
|
|
67
87
|
- Detect languages and frameworks. Collect one `frameworks` list with ALL application and testing frameworks.
|
|
68
88
|
- Extract the project name from a project config file (`package.json`, `Cargo.toml`, `pom.xml`, ...); fall back to the root directory name.
|
|
69
89
|
- Rate complexity by source file count:
|
|
@@ -75,34 +95,81 @@ From the file list:
|
|
|
75
95
|
| 151-500 | `large` |
|
|
76
96
|
| 500+ | `very-large` |
|
|
77
97
|
|
|
78
|
-
## Step 3: Test Inventory
|
|
98
|
+
## Step 3: Test Inventory
|
|
79
99
|
|
|
80
100
|
Detect existing tests, automated and manual. Stay shallow.
|
|
81
101
|
|
|
82
|
-
|
|
83
|
-
- Detect frameworks via config files (`jest.config.*`, `playwright.config.*`, `vitest.config.*`, `pytest.ini`, `pom.xml`, ...), project dependencies, and test file patterns (`*.test.*`, `*.spec.*`, `*_test.*`).
|
|
84
|
-
- For each framework: identify its test file pattern and count matching files.
|
|
102
|
+
### Manual tests
|
|
85
103
|
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
A `*.test.md` file is a suite. Each test inside it is a `<!-- test ... -->` block followed by an `#`/`##` heading (the title). The block's `type:` field says which kind of test it is:
|
|
105
|
+
|
|
106
|
+
- `type: manual`: a manual test case, authored and maintained here as markdown.
|
|
107
|
+
- `type: automated`: a **reference** to an automated test (see below).
|
|
108
|
+
- No `type:` line at all: treat as manual. This is common, so never count manual tests by grepping for `type: manual`; it silently undercounts.
|
|
109
|
+
|
|
110
|
+
Know the counts before you answer anything about project scope, coverage or progress. Read them straight from the files; this mirrors how Testomat.io parses them. `find .` also looks inside `.testeiya/manual-tests/`, so a re-run after a pull finds the cached cases instead of reporting "no manual tests":
|
|
88
111
|
|
|
89
112
|
```bash
|
|
113
|
+
# one line per suite or test: SUITE <title>, or <type> <title>
|
|
90
114
|
find . -name "*.test.md" -exec awk '
|
|
91
|
-
/^<!-- test/ { in_block=1; kind="TEST"; next }
|
|
92
115
|
/^<!-- suite/ { in_block=1; kind="SUITE"; next }
|
|
116
|
+
/^<!-- test/ { in_block=1; kind="manual"; next }
|
|
117
|
+
in_block && /^type:[[:space:]]*automated/ { kind="automated"; next }
|
|
93
118
|
in_block && /^-->/ { in_block=0; expect=1; next }
|
|
94
119
|
expect && /^#+[[:space:]]+/ {
|
|
95
120
|
title=$0; sub(/^#+[[:space:]]+/, "", title)
|
|
96
121
|
if (kind == "SUITE") printf "SUITE: %s\n", title
|
|
97
|
-
else
|
|
122
|
+
else printf "|- [%s] %s\n", kind, title
|
|
98
123
|
expect=0
|
|
99
124
|
}
|
|
100
125
|
' {} +
|
|
101
126
|
```
|
|
102
127
|
|
|
128
|
+
Pipe the output into `grep -c '\[manual\]'` or `grep -c '\[automated\]'` to count one kind.
|
|
129
|
+
|
|
103
130
|
- If the only `.test.md` files are under `.testeiya/manual-tests/`, say so in the inventory: they came from Testomat.io, not from this repo.
|
|
131
|
+
- A source checkout with no `*.test.md` files has nothing to count. Say so; do not estimate.
|
|
132
|
+
|
|
133
|
+
### Automated tests
|
|
134
|
+
|
|
135
|
+
- Detect frameworks via config files (`jest.config.*`, `playwright.config.*`, `vitest.config.*`, `pytest.ini`, `pom.xml`, ...), project dependencies, and test file patterns (`*.test.*`, `*.spec.*`, `*_test.*`).
|
|
136
|
+
- For each framework: identify its test file pattern and count matching files.
|
|
137
|
+
- Unit and integration tests are inventory, not QA scope: note them, but flag e2e and acceptance suites as the ones QA work targets.
|
|
138
|
+
|
|
139
|
+
### Automated references
|
|
140
|
+
|
|
141
|
+
`type: automated` entries in `*.test.md` are references, not runnable code. They arrive via `check-tests pull --export-automated`, which exports the automated tests Testomat.io knows about as markdown. The real implementation lives in a **different repository**, the automation project, which is usually not this one.
|
|
142
|
+
|
|
143
|
+
- Never claim you ran an automated test because you found its reference here. Nothing here executes.
|
|
144
|
+
- Do not edit a reference's markdown to change the test's behaviour. The code is elsewhere, the edit gets overwritten on the next pull, and pushing it can clobber TMS data. Locate the real test in the automation repo instead.
|
|
145
|
+
- To actually run them, use a CI profile (Step 4): if the project has one configured, a run can be triggered through Testomat.io.
|
|
146
|
+
- They are still valuable context: they tell you what is already automated versus what is still manual, which is what coverage gaps and automation candidates need.
|
|
147
|
+
|
|
148
|
+
## Step 4: Testomat.io Access
|
|
149
|
+
|
|
150
|
+
Record how Testomat.io is reachable from this session. Check, do not assume:
|
|
151
|
+
|
|
152
|
+
- **Token:** `TESTOMATIO` in the environment (or in `.env`). With it, `npx check-tests` can pull and push test cases and the REST API answers under `$TESTOMATIO_URL/api/v2`.
|
|
153
|
+
- **MCP:** Testomat.io MCP tools are present (tools prefixed `testomatio-`, direct tools such as `tests_list` and `runs_list`, or one `mcp` tool that searches and calls operations). MCP needs `TESTOMATIO_PROJECT_ID` as well as the token; a token alone identifies no project. Setup lives in the `testomatio-mcp` skill.
|
|
154
|
+
- **Project settings:** `.testeiya/project-info.json`, when present: framework, language, environments, labels, tags, and **CI profiles** (runs can be triggered through them).
|
|
104
155
|
|
|
105
|
-
|
|
156
|
+
Never ask the user for the Testomat.io token when one is configured. Secrets the app under test needs are a different thing; a missing one blocks a run.
|
|
157
|
+
|
|
158
|
+
### Which source answers what
|
|
159
|
+
|
|
160
|
+
| Question is about | First action |
|
|
161
|
+
|---|---|
|
|
162
|
+
| Test content: steps, gherkin, description, file path, tags | `read`, `find`, `grep` in the project |
|
|
163
|
+
| Suite hierarchy, structure, which files exist | `ls`, `find` |
|
|
164
|
+
| Individual test metadata: priority, status flag, labels | the files; if missing, get the test from Testomat.io |
|
|
165
|
+
| Runs, testruns, plans, labels, issues, analytics | Testomat.io (MCP or REST); these are not files |
|
|
166
|
+
| Creating or updating tests or suites | edit the markdown file, then `npx check-tests push` (see `sync-test-cases-with-tms`) |
|
|
167
|
+
| Launching an automated or mixed run on CI | `npx -y @testomatio/reporter@latest run --remote <profile>`; raise an error if no CI profile is configured |
|
|
168
|
+
| Running automated tests locally | the local test runner with the Testomat.io reporter attached |
|
|
169
|
+
|
|
170
|
+
Statuses and counts in Testomat.io are live. Runs change them at any time, so fresh query results supersede numbers from earlier in the conversation.
|
|
171
|
+
|
|
172
|
+
## Step 5: Output
|
|
106
173
|
|
|
107
174
|
Return one structured markdown result directly. **Do NOT save to a file.**
|
|
108
175
|
|
|
@@ -111,14 +178,16 @@ Return one structured markdown result directly. **Do NOT save to a file.**
|
|
|
111
178
|
|
|
112
179
|
- **Project Name:** acme-web-app
|
|
113
180
|
- **Description:** A React-based customer dashboard with an Express API.
|
|
181
|
+
- **Project Type:** source
|
|
114
182
|
- **Languages:** TypeScript, SQL
|
|
115
183
|
- **Frameworks:** React, Express, Jest, Playwright
|
|
116
184
|
- **Complexity:** small (12 files)
|
|
117
185
|
|
|
118
186
|
## Test Inventory
|
|
119
187
|
|
|
120
|
-
- **Automated Tests:** 10 files
|
|
121
|
-
- **Manual Tests:** 37 cases
|
|
188
|
+
- **Automated Tests:** 10 files (Playwright)
|
|
189
|
+
- **Manual Tests:** 37 cases (`.testeiya/manual-tests/`, pulled from Testomat.io)
|
|
190
|
+
- **Automated References:** 12 (implementation lives in another repository)
|
|
122
191
|
|
|
123
192
|
### Manual Tests (20 of 37 shown)
|
|
124
193
|
|
|
@@ -133,17 +202,25 @@ Return one structured markdown result directly. **Do NOT save to a file.**
|
|
|
133
202
|
|
|
134
203
|
- home.page.spec.ts
|
|
135
204
|
...
|
|
205
|
+
|
|
206
|
+
## Testomat.io
|
|
207
|
+
|
|
208
|
+
- **Token:** set (`TESTOMATIO`)
|
|
209
|
+
- **MCP:** available (`testomatio-*` tools)
|
|
210
|
+
- **Project settings:** `.testeiya/project-info.json`, framework playwright, CI profiles: "e2e" (github)
|
|
136
211
|
```
|
|
137
212
|
|
|
138
213
|
Field rules:
|
|
139
214
|
- **Description:** 1-2 sentences based only on detected source code and folder structure (include the domain area if that makes sense).
|
|
215
|
+
- **Project Type:** one of `source` | `e2e` | `manual`.
|
|
140
216
|
- **Complexity:** one of `small` | `moderate` | `large` | `very-large`, plus the file count.
|
|
141
|
-
- **Manual Tests:** preserve hierarchy as plain strings — SUITE items as parent bullets, test titles (`|-`) as nested children.
|
|
217
|
+
- **Manual Tests:** preserve hierarchy as plain strings — SUITE items as parent bullets, test titles (`|-`) as nested children. Say where they live.
|
|
142
218
|
- **Automated Tests:** list of detected test files.
|
|
143
|
-
-
|
|
219
|
+
- **Testomat.io:** one line per access path, `available`/`not available`; omit the section only when none is present, and then say the project is not connected.
|
|
220
|
+
- All values must come from observable files and tools. Do NOT guess missing data or add fields not shown above.
|
|
144
221
|
|
|
145
222
|
Sections:
|
|
146
|
-
- If Step 3
|
|
223
|
+
- If Step 3 found no tests, omit `## Test Inventory` and note that the project contains no tests; the `# Project Overview` section is still useful for next steps.
|
|
147
224
|
- If one test type is absent, note it with a blockquote, e.g. ``> No manual tests (`.test.md`) found in the project.``
|
|
148
225
|
|
|
149
226
|
Test listing truncation:
|
package/dist/prompt/context.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import dedent from "dedent";
|
|
2
|
-
import { TESTEIYA_DIR_NAME } from "./vocab.js";
|
|
3
|
-
/** System-prompt section describing the workspace context; "" when none. */
|
|
4
|
-
export function contextPromptSection(entries, folders = []) {
|
|
5
|
-
if (entries.length === 0 && folders.length === 0)
|
|
6
|
-
return "";
|
|
7
|
-
return dedent `
|
|
8
|
-
<workspace-context>
|
|
9
|
-
This workspace has context attached — the user (or you, earlier) put it there for a purpose. Consult it before answering, and prefer it over assumptions about the project.
|
|
10
|
-
|
|
11
|
-
${contextLines(entries, folders)}
|
|
12
|
-
|
|
13
|
-
Everything whose path starts with \`${TESTEIYA_DIR_NAME}/\` is in a hidden dir: file-search tools skip hidden dirs by default, so search those explicitly (pass hidden:true, or prefix the path with \`${TESTEIYA_DIR_NAME}/\`). Any other path above is an ordinary workspace path the user attached — read it where it is. Linked folders and cloned repositories are reference material: read them, never modify them. A linked folder is a symlink — wildcard searches do not descend into it; search it with its own path prefix (e.g. \`${TESTEIYA_DIR_NAME}/<name>/\`). Documents under \`${TESTEIYA_DIR_NAME}/requirements\` and \`${TESTEIYA_DIR_NAME}/docs\` are specs and plans — use them when writing or reviewing tests.
|
|
14
|
-
</workspace-context>
|
|
15
|
-
`;
|
|
16
|
-
}
|
|
17
|
-
/** Per-prompt notice when the context changed mid-session; appended to the next prompt. */
|
|
18
|
-
export function contextUpdateNotice(entries, folders = []) {
|
|
19
|
-
if (entries.length === 0 && folders.length === 0) {
|
|
20
|
-
return dedent `
|
|
21
|
-
<workspace-context-update>
|
|
22
|
-
All extra workspace context was removed. Do not rely on it anymore.
|
|
23
|
-
</workspace-context-update>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
return dedent `
|
|
27
|
-
<workspace-context-update>
|
|
28
|
-
The workspace context just changed. It now contains:
|
|
29
|
-
|
|
30
|
-
${contextLines(entries, folders)}
|
|
31
|
-
|
|
32
|
-
This was done for a purpose — take it into account for this and future requests. Remember \`${TESTEIYA_DIR_NAME}/\` is hidden: search it with hidden:true or an explicit path prefix.
|
|
33
|
-
</workspace-context-update>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
function contextLines(entries, folders) {
|
|
37
|
-
const lines = [];
|
|
38
|
-
const covered = new Set(entries.map((e) => parentDir(e.path)));
|
|
39
|
-
for (const f of folders) {
|
|
40
|
-
if (covered.has(f.path))
|
|
41
|
-
continue;
|
|
42
|
-
lines.push(`- \`${f.path}/\` — ${folderPurpose(f.name)}`);
|
|
43
|
-
}
|
|
44
|
-
for (const e of entries)
|
|
45
|
-
lines.push(`- ${describeEntry(e)}`);
|
|
46
|
-
return lines.join("\n");
|
|
47
|
-
}
|
|
48
|
-
function folderPurpose(name) {
|
|
49
|
-
if (name === "manual-tests") {
|
|
50
|
-
return "the project's manual test suites pulled from Testomat.io (*.test.md — THE manual tests of this project)";
|
|
51
|
-
}
|
|
52
|
-
if (name === "code")
|
|
53
|
-
return "reference code added as context";
|
|
54
|
-
if (name === "requirements")
|
|
55
|
-
return "requirements and specs";
|
|
56
|
-
if (name === "docs")
|
|
57
|
-
return "test planning and strategy documents";
|
|
58
|
-
if (name === "auto-tests")
|
|
59
|
-
return "automated test references";
|
|
60
|
-
return "exploratory testing setup";
|
|
61
|
-
}
|
|
62
|
-
function parentDir(rel) {
|
|
63
|
-
const idx = rel.lastIndexOf("/");
|
|
64
|
-
if (idx < 0)
|
|
65
|
-
return "";
|
|
66
|
-
return rel.slice(0, idx);
|
|
67
|
-
}
|
|
68
|
-
function describeEntry(e) {
|
|
69
|
-
const date = e.addedAt?.split("T")[0] ?? "";
|
|
70
|
-
// A path outside the hidden dir is one the user attached where it already
|
|
71
|
-
// lives — it is part of the project, not reference material dropped beside it.
|
|
72
|
-
if (!e.path.startsWith(`${TESTEIYA_DIR_NAME}/`)) {
|
|
73
|
-
let what = "folder";
|
|
74
|
-
if (e.kind === "file")
|
|
75
|
-
what = "file";
|
|
76
|
-
return `\`${e.path}\` — workspace ${what}, attached by the user (${date})`;
|
|
77
|
-
}
|
|
78
|
-
let from = "";
|
|
79
|
-
if (e.origin && e.origin !== e.name)
|
|
80
|
-
from = ` from ${e.origin}`;
|
|
81
|
-
if (e.kind === "repo")
|
|
82
|
-
return `\`${e.path}\` — git repository${from} (${date})`;
|
|
83
|
-
if (e.kind === "folder")
|
|
84
|
-
return `\`${e.path}\` — local folder${from} (${date})`;
|
|
85
|
-
return `\`${e.path}\` — document${from} (${date})`;
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../prompt/context.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,4EAA4E;AAC5E,MAAM,UAAU,oBAAoB,CAClC,OAAuB,EACvB,UAA2B,EAAE;IAE7B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC5D,OAAO,MAAM,CAAA;;;;IAIX,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC;;0CAEQ,iBAAiB,kJAAkJ,iBAAiB,sTAAsT,iBAAiB,kCAAkC,iBA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AC,IAAI,oBAAoB,IAAI,KAAK,IAAI,GAAG,CAAC;IAChF,OAAO,KAAK,CAAC,CAAC,IAAI,gBAAgB,IAAI,KAAK,IAAI,GAAG,CAAC;AACrD,CAAC"}
|
package/dist/prompt/index.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { getSystemPrompt } from "./system-prompt.js";
|
|
2
|
-
import { testomatioTms, testomatioConnection, testomatioNotConnected, projectSettings, } from "./testomatio.js";
|
|
3
|
-
import { briefAnswer, nonInteractive, reportOutput } from "./print.js";
|
|
4
|
-
import { contextPromptSection, } from "./context.js";
|
|
5
|
-
export function buildSystemPrompt(options) {
|
|
6
|
-
const mode = options?.mode ?? "tui";
|
|
7
|
-
const interactive = mode !== "print";
|
|
8
|
-
// The base prompt (role, workspace, tools, goals) comes first — it defines who
|
|
9
|
-
// the agent is. Specialized rules layer on after it, dynamic context goes last.
|
|
10
|
-
// Anything only one harness can do — its own question tool, a browser it can
|
|
11
|
-
// open for a watching user — reaches the prompt through `sections`,
|
|
12
|
-
// `toolBullets` and `rules`, never from here.
|
|
13
|
-
const parts = [
|
|
14
|
-
getSystemPrompt(options?.cwd, {
|
|
15
|
-
interactive,
|
|
16
|
-
toolBullets: options?.toolBullets,
|
|
17
|
-
rules: options?.rules,
|
|
18
|
-
connectedClis: options?.connectedClis,
|
|
19
|
-
connectedMcps: options?.connectedMcps,
|
|
20
|
-
}),
|
|
21
|
-
];
|
|
22
|
-
const tokenSlugs = options?.tokens ? Object.keys(options.tokens) : [];
|
|
23
|
-
// The TUI passes no `connection`, so it keeps the managed-tokens gating.
|
|
24
|
-
const tokenAvailable = options?.connection?.tokenAvailable ?? tokenSlugs.length > 0;
|
|
25
|
-
const tms = options?.tms ?? "mcp-direct";
|
|
26
|
-
// Gated on the same condition as the connection section below: both describe
|
|
27
|
-
// the same connection, and the rules are just as needed when the token comes
|
|
28
|
-
// from the environment rather than from a per-project session token.
|
|
29
|
-
if (tokenAvailable || tokenSlugs.length > 0)
|
|
30
|
-
parts.push(testomatioTms(tms));
|
|
31
|
-
if (mode === "print")
|
|
32
|
-
parts.push(nonInteractive);
|
|
33
|
-
// Whatever this harness alone can offer — its chat-app UI tools, a browser it
|
|
34
|
-
// can open for a watching user. A one-shot CLI contributes none of it, and
|
|
35
|
-
// `nonInteractive` tells the agent to report such a gap rather than try.
|
|
36
|
-
for (const section of options?.sections ?? [])
|
|
37
|
-
parts.push(section);
|
|
38
|
-
if (options?.promptContext) {
|
|
39
|
-
parts.push(`## Project Test Context\n\n${options.promptContext}`);
|
|
40
|
-
}
|
|
41
|
-
if (options?.contextEntries?.length || options?.contextFolders?.length) {
|
|
42
|
-
parts.push(contextPromptSection(options.contextEntries ?? [], options.contextFolders ?? []));
|
|
43
|
-
}
|
|
44
|
-
if (options?.projectInfo) {
|
|
45
|
-
parts.push(projectSettings(options.projectInfo));
|
|
46
|
-
}
|
|
47
|
-
if (tokenAvailable || tokenSlugs.length > 0) {
|
|
48
|
-
parts.push(testomatioConnection(tokenSlugs, options?.backendUrl, options?.connection, tms));
|
|
49
|
-
}
|
|
50
|
-
else if (mode === "web" || mode === "print") {
|
|
51
|
-
parts.push(testomatioNotConnected());
|
|
52
|
-
}
|
|
53
|
-
// The answer contract goes last so it is the final instruction the model reads.
|
|
54
|
-
if (options?.brief)
|
|
55
|
-
parts.push(briefAnswer);
|
|
56
|
-
if (options?.outputFile)
|
|
57
|
-
parts.push(reportOutput(options.outputFile));
|
|
58
|
-
return parts.join("\n\n");
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=index.js.map
|
package/dist/prompt/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../prompt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,GAEhB,MAAM,iBAAiB,CAA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|
1
|
-
import dedent from "dedent";
|
|
2
|
-
export const nonInteractive = dedent `
|
|
3
|
-
<non-interactive>
|
|
4
|
-
* Nobody is watching this session. There is no way to ask a question and no answer will ever come.
|
|
5
|
-
* Resolve every ambiguity yourself: pick the most reasonable reading and state the assumption in your output.
|
|
6
|
-
* Never wait for input, confirmation, or approval. Finish the whole task in this run.
|
|
7
|
-
* Missing credentials or an unreachable app are blockers, not questions — report them as the outcome.
|
|
8
|
-
* Do not launch or drive a browser. If the task needs one, report what it would take and stop.
|
|
9
|
-
* Call \`set_result\` with \`fail\` and a one-line reason when the verdict is negative: regressions found, a quality gate unmet, tests broken, or the task could not be completed. Otherwise do not call it — silence means success.
|
|
10
|
-
</non-interactive>
|
|
11
|
-
`;
|
|
12
|
-
export function reportOutput(path) {
|
|
13
|
-
return dedent `
|
|
14
|
-
<final-report>
|
|
15
|
-
* Write your complete final report to \`${path}\` with the \`write\` tool. Writing it is required before you finish.
|
|
16
|
-
* That file is your answer — it is the run's deliverable. Nothing else you say is kept.
|
|
17
|
-
* Markdown. Open with an \`#\` title, then the findings. Overwrite the file; never append.
|
|
18
|
-
* Keep your chat replies short: the report carries the detail.
|
|
19
|
-
</final-report>
|
|
20
|
-
`;
|
|
21
|
-
}
|
|
22
|
-
export const briefAnswer = dedent `
|
|
23
|
-
<answer>
|
|
24
|
-
* You were asked a question, not given a task. Answer it.
|
|
25
|
-
* Lead with the answer in one line, then the evidence you checked.
|
|
26
|
-
* A few sentences. No report file, no headings, no plan.
|
|
27
|
-
* Say plainly when what you found does not settle the question.
|
|
28
|
-
</answer>
|
|
29
|
-
`;
|
|
30
|
-
//# sourceMappingURL=print.js.map
|
package/dist/prompt/print.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../prompt/print.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAA;;;;;;;;;CASnC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,MAAM,CAAA;;4CAE6B,IAAI;;;;;CAK/C,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAA;;;;;;;CAOhC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-info.js","sourceRoot":"","sources":["../../prompt/project-info.ts"],"names":[],"mappings":""}
|