@lincoln504/pi-research 1.7.11 → 1.7.12

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.
@@ -2,7 +2,7 @@
2
2
  name: pi-research
3
3
  description: "Multi-agent web research for any coding agent. Use for anything requiring current information from the internet — news, trends, product/service/company facts, statistics, people, places, events, APIs, library behavior, or 'what is X / how does X work' questions. Also use to search a local knowledge store of previously researched findings before doing live research. Powered by the pi-research engine (search, stealth scraping, security databases, Stack Exchange). Not for reading local files, running project commands, or analyzing this repository's own source."
4
4
  license: MIT
5
- metadata: { "author": "Lincoln Deen", "version": "1.7.11", "package": "@lincoln504/pi-research", "engine": "pi-research-sdk", "openclaw": { "requires": { "bins": ["node"] } } }
5
+ metadata: { "author": "Lincoln Deen", "version": "1.7.12", "package": "@lincoln504/pi-research", "engine": "pi-research-sdk", "openclaw": { "requires": { "bins": ["node"] } } }
6
6
  allowed-tools: Bash(node:*)
7
7
  ---
8
8
 
package/dist/cli.mjs CHANGED
@@ -17164,7 +17164,7 @@ var WorkerPoolManager = class {
17164
17164
  }
17165
17165
  },
17166
17166
  exitHandler: (code) => {
17167
- if (code !== 0 && !this.isShuttingDown && this.poolEpoch === myEpoch) {
17167
+ if (code !== 0 && !this.isShuttingDown && !process.env["PI_PROCESS_EXITING"] && this.poolEpoch === myEpoch) {
17168
17168
  logger.error(`[WorkerPoolManager] Worker exited with code ${code}`);
17169
17169
  this.consecutiveErrors++;
17170
17170
  if (this.consecutiveErrors >= 3) {
@@ -387,8 +387,8 @@ warns on every startup when a host-provided package (`typebox`, `@sinclair/typeb
387
387
  loader and create a second live module instance (`resource-loader.js`,
388
388
  `collectExtensionPackageWarnings`; pi `docs/packages.md`). Under pi the host's own copy is used,
389
389
  so the two agree on `Value.Check`/`Convert` by construction. `@earendil-works/pi-ai` and
390
- `@earendil-works/pi-coding-agent` 1.0.0 through 1.1.0 all pin `1.3.27` (re-checked 2026-10-08 in
391
- the installed packages' `package.json`), which is why the devDependency, and so every test run and
390
+ `@earendil-works/pi-coding-agent` 1.0.0 through 1.3.0 all pin `1.3.27` (re-checked 2026-10-17 in
391
+ the installed 1.3.0 packages' `package.json`, previously 2026-10-08 in 1.1.0), which is why the devDependency, and so every test run and
392
392
  the type-check, stays on exactly that version: bump it in lockstep with the pi host, not
393
393
  independently. A standalone CLI/SDK install resolves the peer automatically on npm >= 7; the
394
394
  `pi-research` bin preflights it with the pi packages and exits 78 with the remedy when a
package/docs/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.7.12] - 2026-10-17
9
+
10
+ ### Changed
11
+
12
+ - **The pi host dev dependencies move 1.1.0 → 1.3.0** (`@earendil-works/pi-ai`, `pi-coding-agent`, `pi-tui`, and the `pi-agent-core`/`pi-codemode`/`pi-mcp`/`pi-telemetry` they pull in; `@earendil-works/chord` drops out of the tree; the peer range stays `>=0.99.0 <2`). The 1.1.0 → 1.3.0 declaration diff (installed trees, 2026-10-17): `pi-coding-agent`'s extension surface file (`dist/core/extensions/types.d.ts`) changes in exactly four places — `BeforeAgentStartEvent` becomes a `messageType`-discriminated union (`BeforeAgentStartUserEvent` / `BeforeAgentStartCustomEvent`) because `before_agent_start` now also fires for idle `pi.sendMessage(..., { triggerTurn: true })` runs, `ToolNamespace` gains `aliases?`, `ToolDefinition` gains `reachesTools?`, and `ToolInfo` picks up `reachesTools`. `pi-ai` removes the `assistant-message-frame` module (`AssistantMessageFrame*`, `reduceAssistantMessageFrames`) — the only breaking removal across the two releases, and one this package never imports — and adds the OpenRouter routing schemas and `splitErrorToolResultImages`; its thinking-level types move to `providers/model-schema.d.ts` but are re-exported from the root unchanged. `pi-tui` adds the fake-cursor helpers. Nothing this package consumes is removed or re-signed: the four type-checks (TypeScript 6 and 7, src and tests) pass against 1.3.0, and `typebox` still pins `1.3.27` in `pi-ai` and `pi-coding-agent`, so the lockstep rule and the 0.99.0 floor are unchanged.
13
+ - **`PI_TESTED_MAX_VERSION` moves to 1.3.0** (`src/core/pi-version.ts`), so a pi 1.2.x or 1.3.x host runs without the "newer than the tested ceiling" notice. pi-research never triggers the new firing path — all its `pi.sendMessage` calls are `customType` deliveries without `triggerTurn`, and both `pi.sendUserMessage` calls already pass `deliverAs` — and its `before_agent_start` handler reads only `systemPrompt`/`systemPromptOptions`, present on both union members.
14
+
15
+ ### Fixed
16
+
17
+ - **Worker exits during a process-group teardown no longer trip the pool health counter.** `isShuttingDown` only covers the pool's own `shutdown()`, but a process-group signal (a cron wrapper's `timeout N`) SIGTERMs the workers in the same instant as the master, BEFORE the pool's shutdown begins, so those exits landed as unexpected deaths and could log the pool unhealthy on a process that was exiting anyway. The exit handler now also ignores non-zero exits while `PI_PROCESS_EXITING` is set — the flag the SDK signal handler sets synchronously as its first action. The `sdk.ts` teardown comment now says which deaths each teardown path covers. New unit tests pin both sides: flag set → three exits, counter 0, no auto-recovery destroy; flag unset → counted.
18
+ - In-range lockfile refresh from the 1.3.0 install: nothing else moved.
19
+
8
20
  ## [1.7.11] - 2026-10-10
9
21
 
10
22
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincoln504/pi-research",
3
- "version": "1.7.11",
3
+ "version": "1.7.12",
4
4
  "description": "Web research for your agents with smart and safe tooling + knowledge store",
5
5
  "type": "module",
6
6
  "private": false,
@@ -119,11 +119,11 @@
119
119
  "image": "https://raw.githubusercontent.com/Lincoln504/pi-research/main/docs/media/hero.png"
120
120
  },
121
121
  "dependencies": {
122
+ "@camoufox/camoufox": "^0.5.7",
122
123
  "@kreuzberg/html-to-markdown-node": "^3.7.2",
123
124
  "@lancedb/lancedb": "0.39.0",
124
125
  "apache-arrow": "21.1.0",
125
126
  "bgutils-js": "^4.0.3",
126
- "@camoufox/camoufox": "^0.5.7",
127
127
  "esbuild": "^0.28.2",
128
128
  "impit": "0.14.5",
129
129
  "jsdom": "^30.1.0",
@@ -130,8 +130,25 @@ export const PI_MIN_VERSION: SemverParts = { major: 0, minor: 99, patch: 0 };
130
130
  * and an optional `AuthProvider.agentName`; `@earendil-works/pi-tui` adds the OSC 7501
131
131
  * program-status helpers and `Text.setPaddingX`. `docs/extensions.md` is unchanged,
132
132
  * and nothing was removed or re-signed, so the 0.99.0 floor is unchanged too.
133
+ *
134
+ * 1.2.0 and 1.3.0 (2026-10-12 / 2026-10-15) were verified on 2026-10-17 by diffing
135
+ * the installed declaration trees of all three packages, 1.1.0 against 1.3.0:
136
+ * `@earendil-works/pi-coding-agent`'s extension surface file
137
+ * (`dist/core/extensions/types.d.ts`) changes in exactly four places: `BeforeAgentStartEvent`
138
+ * becomes a `messageType`-discriminated union (`BeforeAgentStartUserEvent` / `BeforeAgentStartCustomEvent`)
139
+ * because `before_agent_start` now also fires for idle `pi.sendMessage(..., { triggerTurn: true })`
140
+ * runs, `ToolNamespace` gains `aliases?`, `ToolDefinition` gains `reachesTools?`, and `ToolInfo`
141
+ * picks up `reachesTools`. `@earendil-works/pi-ai` removes the `assistant-message-frame`
142
+ * module (`AssistantMessageFrame*`, `reduceAssistantMessageFrames`) — a breaking removal this
143
+ * package never imports — and adds the OpenRouter routing schemas and
144
+ * `splitErrorToolResultImages`; its thinking-level types move to `providers/model-schema.d.ts`
145
+ * but are re-exported from the root unchanged. `@earendil-works/pi-tui` adds the fake-cursor
146
+ * helpers (`renderFakeCursor`, `FAKE_CURSOR_START/END`) and is otherwise unchanged.
147
+ * Nothing this package consumes is removed or re-signed; the four type-checks pass against
148
+ * 1.3.0 (TypeScript 6 and 7, src and tests), and `typebox` still pins 1.3.27 in `pi-ai`
149
+ * and `pi-coding-agent`, so the lockstep rule and the 0.99.0 floor are unchanged.
133
150
  */
134
- export const PI_TESTED_MAX_VERSION: SemverParts = { major: 1, minor: 1, patch: 0 };
151
+ export const PI_TESTED_MAX_VERSION: SemverParts = { major: 1, minor: 3, patch: 0 };
135
152
 
136
153
  export type PiCompatibilityLevel = 'ok' | 'unparseable' | 'too-old' | 'untested';
137
154
 
@@ -340,7 +340,17 @@ export class WorkerPoolManager implements IService {
340
340
  // the 2026-09-01/02 logs coincided with SDK SIGTERM shutdown, tripping
341
341
  // "3 consecutive exits → pool unhealthy" once per dying session. Not a
342
342
  // queue-capacity or OOM problem: zero exits occurred during live research.
343
- if (code !== 0 && !this.isShuttingDown && this.poolEpoch === myEpoch) {
343
+ //
344
+ // The mid-shutdown flag alone does NOT cover process-GROUP signals: a cron
345
+ // wrapper like `timeout N` SIGTERMs the whole process group, so the
346
+ // workers die in the same instant as the master — BEFORE the pool's own
347
+ // shutdown() runs and sets isShuttingDown (the scheduler reaches
348
+ // workerPoolManager.shutdown() only after service lookups, a state read
349
+ // and server.stop()). The SDK signal handler sets PI_PROCESS_EXITING
350
+ // synchronously as its first action (sdk.ts _onSignal), before any
351
+ // teardown await, so any exit arriving after that flag is teardown
352
+ // noise on a dying process, not a health fault.
353
+ if (code !== 0 && !this.isShuttingDown && !process.env['PI_PROCESS_EXITING'] && this.poolEpoch === myEpoch) {
344
354
  logger.error(`[WorkerPoolManager] Worker exited with code ${code}`);
345
355
  this.consecutiveErrors++;
346
356
  if (this.consecutiveErrors >= 3) {
package/src/sdk.ts CHANGED
@@ -365,8 +365,14 @@ async function _doInit(options: ResearchSDKOptions = {}): Promise<void> {
365
365
  // sdk_shutdown cleanup list is empty ("No cleanup tasks registered"), and the scheduler's cluster workers died mid-DAG-disposal —
366
366
  // with code null — while the worker pool was still live, which the pool's
367
367
  // exitHandler counted as unexpected deaths ("3 consecutive exits → pool
368
- // unhealthy") on a process that was exiting anyway. Shutting down here puts
369
- // those deaths inside the pool's intentional-destroy window instead. Both
368
+ // unhealthy") on a process that was exiting anyway. For a signal received
369
+ // by the master only, shutting down here puts those deaths inside the
370
+ // pool's intentional-destroy window. A process-GROUP signal (e.g. `timeout
371
+ // N` from a cron wrapper) SIGTERMs the workers in the same instant the
372
+ // master runs its handler, so those deaths land BEFORE this task starts —
373
+ // they are silenced instead by the PI_PROCESS_EXITING flag the handler
374
+ // sets synchronously as its first action (see the exitHandler in
375
+ // worker-pool-manager.ts). Both
370
376
  // teardown paths are idempotent (the later DAG dispose no-ops), and the task
371
377
  // is bounded well inside the 15s signal force-exit deadline. Registered per
372
378
  // init: runCleanup detaches the task set after running, so re-init gets a