Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,49 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: ["20", "22"]
node: ["22", "24"]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.2

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: Check (tsgo + biome)
run: npm run check
run: bun run check

- name: Unit tests
run: npm test
run: bun run test

- name: Package smoke
run: npm pack --dry-run

npm-consumer:
name: npm-consumer
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node 22
uses: actions/setup-node@v7
with:
node-version: "22"
cache: npm

- name: Install dependencies
run: npm ci

- name: Unit tests
run: npm test
13 changes: 7 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ Conventions for human contributors and AI agents working on this repository.

## Commands

- `npm install` — install dependencies.
- `npm test` — run vitest test suite once.
- `npm run typecheck` — strict TypeScript check (no emit).
- `npm run check` — type check + biome.
- `bun install` — install dependencies (preferred for development).
- `npm install` / `npm ci` — supported consumer install paths.
- `bun run test` / `npm test` — run vitest test suite once.
- `bun run typecheck` — strict TypeScript check (no emit).
- `bun run check` — type check + biome.
- `pi -e ./src/index.ts` — load the extension into a local pi session for manual smoke testing.

## Constraints

- No Bun APIs. Runtime is Node only.
- No dependency on pi-coding-agent internal modules outside the documented public extension API in `@mariozechner/pi-coding-agent`.
- No Bun APIs. Runtime is Node only. Bun is used as the development/CI toolchain, not as a runtime API.
- No dependency on pi-coding-agent internal modules outside the documented public extension API in `@earendil-works/pi-coding-agent`.
- Keep network behavior bounded: abort-aware fetches, timeout cap, and response size cap.
- Tool renderers read typed `details` returned by `execute`; renderers must not parse formatted strings.

Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

## 0.1.3 - 2026-09-24

### Fixed

- Drain response bodies that lack `dump()`, attach a no-op stream error listener before teardown, and abort the drain when the fetch signal fires so discard cannot crash the host or hang (`#7`, Indosaram).

### Changed

- Require Node `>=22.19.0`.
- Move CI to Bun `1.4.2` (`oven-sh/setup-bun@v2`) with a Node 22/24 matrix on Ubuntu and macOS, plus an `npm ci` consumer job.
- Add `@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent`, and `@earendil-works/pi-tui` as exact `0.87.1` devDependencies. Peer range for `@earendil-works/pi-*` stays `*` so date-versioned downstream runtimes still resolve.
- Refresh runtime and toolchain dependencies (see version table in the release notes). Majors: `jsdom` 29.1.1 → 30.1.1 (`@types/jsdom` 30.0.0), `undici` 7.28.0 → 8.11.0, `vitest` 4 → 5.0.1.

### CI

- `actions/checkout@v7`, `actions/setup-node@v7`.
- Jobs: `test` (`bun install --frozen-lockfile`, `bun run check`, `bun run test`, `npm pack --dry-run`) and `npm-consumer` (`npm ci`, `npm test`).
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pi install npm:@code-yeongyu/pi-webfetch
# 2. From git
pi install git:github.com/code-yeongyu/pi-webfetch

# 3. Manual placement
# 3. Manual placement (npm consumer install)
git clone https://github.com/code-yeongyu/pi-webfetch ~/.pi/agent/extensions/pi-webfetch
cd ~/.pi/agent/extensions/pi-webfetch && npm install

Expand Down Expand Up @@ -74,14 +74,14 @@ HTML responses are converted when `format` is `markdown` or `text`. Non-HTML res
```bash
git clone https://github.com/code-yeongyu/pi-webfetch
cd pi-webfetch
npm install
npm test
npm run typecheck
npm run check
bun install
bun run test
bun run typecheck
bun run check
pi -e ./src/index.ts
```

The test suite uses vitest. Test descriptions follow `#given .. #when .. #then` style; bodies use plain `// given / // when / // then` comments. TypeScript is strict, Node-only, and uses ESM imports with `.js` suffixes.
npm remains a supported consumer install (`npm install` / `npm ci` / `npm test`). The test suite uses vitest. Test descriptions follow `#given .. #when .. #then` style; bodies use plain `// given / // when / // then` comments. TypeScript is strict, Node-only, and uses ESM imports with `.js` suffixes.

## License

Expand Down
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"preset": "recommended",
"style": {
"noNonNullAssertion": "error",
"useImportType": "error",
Expand Down
Loading
Loading