Skip to content

Commit 8f764db

Browse files
Merge pull request #14 from OneStepAt4time/docs/readme-10-redesign
chore(release): prepare v1.1.5
2 parents b3e6151 + 9a1fd91 commit 8f764db

14 files changed

Lines changed: 269 additions & 54 deletions
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
description: "Use when: drafting release notes, generating changelog entries, summarizing commits for a release, writing CHANGELOG.md updates, preparing version bump notes. Generates structured release notes from conventional commits."
3+
tools: [read, search, execute]
4+
argument-hint: "Describe the version or commit range (e.g. 'draft notes for v1.2.0' or 'changelog since v1.1.4')"
5+
---
6+
7+
You are a **Changelog Drafter** — you generate precise, well-structured release notes from conventional commits. You read git history, categorize changes, and produce a changelog entry that matches the project's existing format.
8+
9+
## Approach
10+
11+
1. **Detect the changelog format**: Read the existing `CHANGELOG.md` to understand the project's style — heading levels, categories, date format, linking conventions, and tone.
12+
2. **Determine the commit range**:
13+
- If the user specifies a version or tag range, use it: `git log v1.1.4..HEAD --oneline`
14+
- If no range is given, find the latest tag (`git describe --tags --abbrev=0`) and log from there to HEAD
15+
- Always use `--no-merges` to skip merge commits unless they carry meaningful info
16+
3. **Categorize commits** by conventional commit prefix:
17+
- `feat:` → **Added**
18+
- `fix:` → **Fixed**
19+
- `docs:` → **Documentation**
20+
- `test:` → **Tests**
21+
- `refactor:` → **Changed**
22+
- `perf:` → **Performance**
23+
- `chore:` / `ci:` / `build:` → **Maintenance** (collapse into one section)
24+
- `BREAKING CHANGE` or `!` suffix → **Breaking Changes** (always listed first)
25+
4. **Enrich entries**:
26+
- Cross-reference commit messages with actual file changes (`git diff --stat`) to add context
27+
- If a commit references an issue or PR (`#123`, `PR #45`), include the reference
28+
- Write entries in past tense, user-facing language — explain *what changed* for the user, not implementation details
29+
- Group related commits into single entries when they address the same feature/fix
30+
5. **Determine the version number**:
31+
- If the user specifies it, use that
32+
- Otherwise, suggest based on changes: breaking → major bump, feat → minor, fix-only → patch
33+
6. **Output the entry** in the exact format of the existing changelog
34+
35+
## Constraints
36+
37+
- DO NOT modify `CHANGELOG.md` directly — output the draft for the user to review and approve
38+
- DO NOT invent changes that aren't in the commit log
39+
- DO NOT include internal refactors in user-facing sections unless they affect behavior
40+
- DO NOT include commit hashes in the changelog entries (unless the project's existing format does)
41+
- ONLY use information from git history and file diffs — do not guess
42+
43+
## Output Format
44+
45+
Output the changelog entry as a markdown block ready to paste, preceded by a brief summary:
46+
47+
```
48+
Version: {version}
49+
Type: {major|minor|patch}
50+
Commits analyzed: {count}
51+
Range: {from_ref}..{to_ref}
52+
```
53+
54+
Then the formatted entry matching the project's changelog style.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
description: "Use when: writing tests, modifying test files, adding test cases, reviewing test coverage. Covers Vitest conventions, harness patterns, and quality requirements for MCP Comet."
3+
applyTo: "tests/**"
4+
---
5+
6+
# Testing Conventions
7+
8+
## General Rules
9+
10+
- NEVER use `.only`, `.skip`, or `.todo` on tests — all tests must run in CI
11+
- NEVER use `any` type assertions in tests — use proper typing or `as unknown as Type`
12+
- Import from `vitest` explicitly: `describe`, `it`, `expect`, `vi`, `beforeEach`, `beforeAll`, `afterEach`
13+
- Use `.js` extension in all import paths (TypeScript ESM requirement)
14+
- Reset mocks/singletons in `beforeEach` to prevent test coupling
15+
- Test names should describe behavior: `it('returns error when connection is refused')`
16+
17+
## Directory Structure
18+
19+
- `tests/unit/` — Isolated component tests with mocked dependencies. Mirror `src/` folder structure.
20+
- `tests/integration/tools/` — End-to-end tool handler tests using the shared harness.
21+
- UI script tests validate that `build*Script()` returns valid JS strings — no browser needed.
22+
23+
## Unit Test Patterns
24+
25+
- Mock external modules with `vi.mock()` at the top of the file
26+
- CDPClient tests: mock `chrome-remote-interface` and `globalThis.fetch`
27+
- Always call `CDPClient.resetInstance()` in `beforeEach` to clear singleton state
28+
- Use `vi.fn()` for mock functions, assert with `toHaveBeenCalled()` / `toHaveBeenCalledWith()`
29+
30+
## Integration Test Harness
31+
32+
Always use the shared harness from `tests/integration/tools/harness.ts`:
33+
34+
```ts
35+
import { getHandler, mocks, registerHandlers, resetHarness } from './harness.js'
36+
37+
beforeAll(async () => { await registerHandlers() })
38+
beforeEach(() => { resetHarness() })
39+
```
40+
41+
- Override `mocks.*` per-test to control CDPClient behavior
42+
- Call `getHandler('tool_name')` to get the registered handler function
43+
- DO NOT create alternative harness setups — extend the existing one
44+
45+
## Coverage Requirements
46+
47+
Thresholds (enforced in `vitest.config.ts`):
48+
- Statements: 75%, Lines: 75%, Branches: 70%, Functions: 80%
49+
50+
When adding new source code, add corresponding tests that maintain these thresholds.
51+
52+
## Console Output
53+
54+
- Use `// biome-ignore lint/suspicious/noConsole:` with a justification when `console.*` is intentionally used in test utilities
55+
- Prefer `vi.spyOn(console, 'error')` to assert on console output without polluting test logs

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ mcp-comet.config.json
33
.mcp.json
44
.claude/settings.local.json
55
.claude/plans
6+
.claude/scheduled_tasks.lock
7+
.claude/worktrees/
68

79
tools/
810
# Internal Documentation & Plans (local only)

‎CHANGELOG.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Changelog
22

3+
## [1.1.5] - 2026-04-15
4+
5+
### Fixed
6+
7+
- **UAT Reliability:** Updated smoke checks to validate current comet_ask fire-and-forget behavior and timeout handling through comet_wait, resolving previously failing UAT scenarios.
8+
- **UAT Reporting:** Ensured UAT report output directory is created automatically before writing docs/uat/uat-report.md.
9+
10+
### Changed
11+
12+
- **Release Metadata:** Bumped package version metadata to 1.1.5.
13+
- **QA Workflow:** Stabilized release-gate execution and quality checks used during certification.
14+
15+
### Documentation
16+
17+
- Refreshed README presentation and supporting docs for clearer onboarding and release readiness guidance.
18+
19+
## [1.1.4] - 2026-04-13
20+
21+
### Documentation
22+
23+
- **Product Documentation:** Refreshed README with improved product messaging and updated documentation files with clearer examples and consistent naming conventions.
24+
- **Cleanup:** Removed obsolete UAT planning artifacts.
25+
26+
### Changed
27+
28+
- **Project Naming:** Standardized mcp-comet naming conventions across core server, CLI, logging, and test suite for consistency.
29+
- **Configuration:** Aligned configuration file naming and maintenance scripts with project standards.
30+
31+
### Maintenance
32+
33+
- **Agent Workspace Integration:** Added shared agent workspace metadata and IDE configuration files for enhanced development experience.
34+
335
## [1.1.2] - 2026-04-11
436

537
### Fixed
@@ -79,3 +111,6 @@ TypeScript, Vitest, Chrome DevTools Protocol, Biome. 295 tests, 30 files.
79111
- Tab management with categorization
80112
- CLI with --help, --version, detect, snapshot commands
81113
- Comet version auto-detection and selector registry
114+
115+
116+

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Most teams only tune these three:
275275

276276
| Variable | Default | Change It When |
277277
| ------------------------ | ------------- | ---------------------------------------- |
278-
| `COMET_RESPONSE_TIMEOUT` | `180000` | Queries are long and timing out |
278+
| `COMET_RESPONSE_TIMEOUT` | `180000` | `comet_wait` calls are timing out |
279279
| `COMET_PATH` | auto-detect | Comet is in a non-standard install path |
280280
| `COMET_LOG_LEVEL` | `info` | You need debug logs |
281281

‎docs/integration.md‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ MCP Comet provides a `call` subcommand for invoking tools directly from the term
108108
# Connect to Comet
109109
mcp-comet call comet_connect
110110

111-
# Ask a question
111+
# Submit a question
112112
mcp-comet call comet_ask '{"prompt": "What is 2+2?"}'
113113

114-
# Wait for completion after a timeout
114+
# Wait for completion
115115
mcp-comet call comet_wait
116116

117117
# Check the current status
@@ -206,8 +206,23 @@ child.stdout.on('data', (chunk) => {
206206
)
207207
}
208208

209-
// Handle tool response
209+
// comet_ask is fire-and-forget; then block with comet_wait
210210
if (msg.id === 1 && msg.result) {
211+
child.stdin.write(
212+
JSON.stringify({
213+
jsonrpc: '2.0',
214+
id: 2,
215+
method: 'tools/call',
216+
params: {
217+
name: 'comet_wait',
218+
arguments: {},
219+
},
220+
}) + '\n',
221+
)
222+
}
223+
224+
// Handle final response
225+
if (msg.id === 2 && msg.result) {
211226
console.log(msg.result.content[0].text)
212227
}
213228
}

‎docs/tools.md‎

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -70,41 +70,25 @@ Connected to Comet on port {port} (Chrome/{version}), target {targetId}
7070

7171
## 2. comet_ask
7272

73-
Send a prompt to Perplexity Comet and poll until the agent responds or times out.
73+
Send a prompt to Perplexity Comet and return immediately.
7474

75-
This is the primary interaction tool. It types the prompt into the Comet input field, submits it, and polls for the response using a non-blocking loop with stall detection. The response includes any agent steps and the final answer text.
75+
This tool submits the prompt and does not block for the final answer. Use `comet_poll` for status snapshots or `comet_wait` to block until completion.
7676

7777
### Parameters
7878

7979
| Parameter | Type | Required | Default | Description |
8080
|-----------|---------|----------|----------------------------------|--------------------------------------------------|
8181
| `prompt` | string | Yes | | The question or instruction to send |
8282
| `newChat` | boolean | No | `false` | Start a fresh chat before sending the prompt |
83-
| `timeout` | number | No | `180000` (`COMET_RESPONSE_TIMEOUT`) | Maximum wait time in ms for the agent response |
8483

8584
### Response
8685

87-
**Completed (within timeout):**
88-
```
89-
{response text}
90-
91-
Steps:
92-
- {step 1}
93-
- {step 2}
94-
```
95-
96-
**Timeout (agent still working):**
86+
**Success:**
9787
```
98-
Agent is still working. Use comet_poll to check status.
99-
100-
Steps so far:
101-
- {step 1}
102-
103-
Partial response:
104-
{partial text}
88+
Prompt submitted successfully. Use comet_poll to track status or comet_wait to block until completion.
10589
```
10690

107-
**Error codes:** `CDP_CONNECTION_FAILED`, `EVALUATION_FAILED`, `TIMEOUT`
91+
**Error codes:** `CDP_CONNECTION_FAILED`, `EVALUATION_FAILED`
10892

10993
### CLI Example
11094

@@ -115,26 +99,24 @@ Partial response:
11599
```json
116100
{
117101
"prompt": "Compare GPT-4 and Claude 3.5 on reasoning benchmarks",
118-
"newChat": true,
119-
"timeout": 300000
102+
"newChat": true
120103
}
121104
```
122105

123106
### Notes
124107

125-
- **Stall detection:** If the response length does not grow for 10 consecutive polls, the tool breaks out of the polling loop and returns whatever has been collected so far.
126-
- **Response stabilization:** After the agent transitions to `idle` or `completed`, the tool performs up to 5 additional settle polls (1 second apart) to ensure the response text has finished rendering.
127108
- **Pre-send state capture:** Before typing, the tool captures the current prose count and last prose text to accurately detect new responses versus pre-existing content.
128109
- **newChat behavior:** When `true`, closes all extra tabs, disconnects, reconnects, and navigates to the Perplexity home page before sending the prompt.
129110
- If `newChat` is `false` and the main tab differs from the current target, the tool automatically switches to the main tab.
111+
- This tool is intentionally non-blocking. Pair it with `comet_poll` or `comet_wait` to collect progress and final output.
130112

131113
---
132114

133115
## 3. comet_poll
134116

135117
Poll the current agent status, steps, and response content.
136118

137-
Returns a snapshot of the Comet agent state. Use this to check progress after `comet_ask` times out, or to implement custom polling logic in your own agent loop.
119+
Returns a snapshot of the Comet agent state. Use this after `comet_ask` to check progress, or in a custom polling loop.
138120

139121
### Parameters
140122

@@ -183,7 +165,7 @@ None.
183165

184166
Poll until the current agent finishes responding and return the full response.
185167

186-
Designed to be used after `comet_ask` times out. It continues polling the agent status until the response completes, another timeout is reached, or stall detection triggers.
168+
Designed to be used after `comet_ask` submission when you want a blocking wait. It continues polling the agent status until the response completes, another timeout is reached, or stall detection triggers.
187169

188170
### Parameters
189171

@@ -227,7 +209,7 @@ Partial response:
227209

228210
- **Stall detection:** Breaks out of the polling loop if the response length does not grow for 10 consecutive polls.
229211
- **Response stabilization:** After the agent transitions to `idle` or `completed`, performs up to 5 settle polls (1 second apart) to ensure the response has finished rendering.
230-
- Default timeout is 120 seconds (2 minutes), shorter than `comet_ask` default of 180 seconds.
212+
- Default timeout is 120 seconds (2 minutes).
231213
- Returns `"Agent completed with no visible response."` if the agent finishes but no response text was found.
232214

233215
---
@@ -649,18 +631,24 @@ Title: {page title}
649631

650632
### 1. Ask and Wait (Simple)
651633

652-
Use `comet_ask` with the default timeout (180 seconds). This handles most queries in a single call.
634+
Submit with `comet_ask`, then call `comet_wait` to block until completion.
653635

636+
Step 1:
654637
```json
655638
{ "prompt": "What is the current state of fusion energy research?" }
656639
```
657640

641+
Step 2:
642+
```json
643+
{}
644+
```
645+
658646
### 2. Ask + Poll (Custom Loop)
659647

660-
Use `comet_ask` with a short timeout, then loop `comet_poll` in your agent to implement custom progress reporting or conditional logic.
648+
Submit with `comet_ask`, then loop `comet_poll` in your agent to implement custom progress reporting or conditional logic.
661649

662650
```json
663-
{ "prompt": "Deep research on AI safety", "timeout": 30000 }
651+
{ "prompt": "Deep research on AI safety" }
664652
```
665653

666654
Then poll:
@@ -671,14 +659,14 @@ Then poll:
671659

672660
### 3. Ask + Wait (Two-Phase)
673661

674-
Use `comet_ask` (which may timeout for long-running queries), then `comet_wait` to collect the full result. This is useful when you want to start a query and check back later.
662+
Use `comet_ask`, continue with other work, then call `comet_wait` later to collect the full result.
675663

676664
Step 1:
677665
```json
678666
{ "prompt": "Write a comprehensive analysis of global semiconductor supply chains" }
679667
```
680668

681-
Step 2 (if Step 1 times out):
669+
Step 2 (when ready to block for completion):
682670
```json
683671
{ "timeout": 300000 }
684672
```

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onestepat4time/mcp-comet",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "The definitive MCP server for Perplexity Comet browser management",
55
"type": "module",
66
"main": "dist/index.js",
@@ -36,9 +36,10 @@
3636
"test:ci": "vitest run --coverage",
3737
"test:watch": "vitest",
3838
"lint": "biome check .",
39-
"format": "biome write .",
40-
"format:check": "biome check --formatter-enabled .",
39+
"format": "biome format --write .",
40+
"format:check": "biome check --formatter-enabled=true .",
4141
"typecheck": "tsc --noEmit",
42+
"precommit": "node scripts/pre-commit-gates.mjs",
4243
"prepublishOnly": "npm run build && npm test"
4344
},
4445
"engines": {

0 commit comments

Comments
 (0)