@kylebrodeur/pi-model-router 0.1.4 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.2.1] - 2026-06-05
2
+
3
+ - Bumped @earendil-works/pi-coding-agent SDK to 0.78.1.
4
+ - Updated tool `execute` signatures to match the new SDK API.
5
+
1
6
  # Changelog
2
7
 
3
8
  All notable changes to this project will be documented in this file.
@@ -7,22 +12,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
12
 
8
13
  ## [Unreleased]
9
14
 
15
+ ## [0.2.0] - 2026-05-17
16
+
10
17
  ### Added
11
- - Transparent wait and retry interception for string-based rate limit errors (e.g., "quota will reset after X seconds")
18
+ - Transparent wait and retry interception for string-based rate limit errors
12
19
  - Ollama auto-sync feature
13
- - Rate-limit fallback with transparent HTTP error handling (402, 429, 503, 529)
20
+ - Rate-limit fallback with transparent HTTP error handling
14
21
  - Feature toggles in config (`features` object)
15
22
  - Scope shim for syncing router profiles to Pi enabled models
16
23
  - Progressive enhancement (auto-detect qmd-ledger and agent-bus)
17
- - Progressive config files (`model-router.ledger.json`, `model-router.agent-bus.json`, `model-router.essential.json`)
18
- - GitHub issue templates and pull request template
19
- - Code of Conduct
20
24
 
21
25
  ### Changed
22
- - Updated minimum Pi SDK version from 0.68.0 to 0.70.2
23
- - Merged `README_FORK.md` into canonical `README.md`
26
+ - **BREAKING:** Migrate from `@mariozechner/pi-coding-agent` to `@earendil-works/pi-coding-agent` v0.75.0
27
+ - Update `detectPlugins` to use `pi.getAllTools()` for Pi v0.74.1+ compatibility
28
+ - Updated minimum Pi SDK version to `>=0.75.0`
24
29
  - Replaced `@sinclair/typebox` peer dependency with `typebox`
25
30
 
31
+ ## [0.1.4] - 2026-04-27
32
+
33
+ ### Added
34
+ - Wait/retry interception for string-based rate limit errors
35
+
36
+ ## [0.1.3] - 2026-04-24
37
+
38
+ ## [0.1.2] - 2026-04-23
39
+
40
+ ### Fixed
41
+ - Config merge bug where features/ollamaSync/rateLimitFallback were dropped
42
+
26
43
  ## [0.1.1] - 2025-04-22
27
44
 
28
45
  ### Fixed
@@ -38,6 +55,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
38
55
  - Scope shim module
39
56
  - Progressive enhancement with plugin detection
40
57
 
41
- [Unreleased]: https://github.com/kylebrodeur/pi-model-router/compare/v0.1.1...HEAD
58
+ [Unreleased]: https://github.com/kylebrodeur/pi-model-router/compare/v0.2.0...HEAD
59
+ [0.2.0]: https://github.com/kylebrodeur/pi-model-router/compare/v0.1.4...v0.2.0
60
+ [0.1.4]: https://github.com/kylebrodeur/pi-model-router/compare/v0.1.3...v0.1.4
61
+ [0.1.3]: https://github.com/kylebrodeur/pi-model-router/compare/v0.1.2...v0.1.3
62
+ [0.1.2]: https://github.com/kylebrodeur/pi-model-router/compare/v0.1.1...v0.1.2
42
63
  [0.1.1]: https://github.com/kylebrodeur/pi-model-router/compare/v0.1.0...v0.1.1
43
64
  [0.1.0]: https://github.com/kylebrodeur/pi-model-router/releases/tag/v0.1.0
@@ -2,10 +2,10 @@ import {
2
2
  getAgentDir,
3
3
  type ExtensionAPI,
4
4
  type ExtensionContext,
5
- } from '@mariozechner/pi-coding-agent';
5
+ } from '@earendil-works/pi-coding-agent';
6
6
  import { existsSync, writeFileSync } from 'node:fs';
7
7
  import { join } from 'node:path';
8
- import type { AutocompleteItem } from '@mariozechner/pi-tui';
8
+ import type { AutocompleteItem } from '@earendil-works/pi-tui';
9
9
  import type {
10
10
  RouterConfig,
11
11
  RouterPinByProfile,
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- import { getAgentDir } from '@mariozechner/pi-coding-agent';
4
- import type { ThinkingLevel } from '@mariozechner/pi-agent-core';
3
+ import { getAgentDir } from '@earendil-works/pi-coding-agent';
4
+ import type { ThinkingLevel } from '@earendil-works/pi-agent-core';
5
5
  import type {
6
6
  RouterConfig,
7
7
  RouterProfile,
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  ExtensionAPI,
3
3
  ExtensionContext,
4
- } from '@mariozechner/pi-coding-agent';
4
+ } from '@earendil-works/pi-coding-agent';
5
5
  import {
6
6
  type RouterConfig,
7
7
  type RouterPersistedState,
@@ -34,11 +34,25 @@ interface PluginStatus {
34
34
  }
35
35
 
36
36
  const detectPlugins = (pi: ExtensionAPI): PluginStatus => {
37
- const tools = (pi as any).tools ?? {};
38
37
  const log = (pi as any).log || console;
38
+
39
+ // Pi v0.74.1+: tools are exposed via pi.getAllTools() returning { name, description, ... }[]
40
+ // Legacy Pi versions exposed tools as pi.tools.<name>() directly.
41
+ let allTools: { name: string }[] = [];
42
+ try {
43
+ allTools = (pi as any).getAllTools?.() ?? [];
44
+ } catch {
45
+ allTools = [];
46
+ }
47
+
48
+ const legacyTools = (pi as any).tools ?? {};
49
+ const hasTool = (name: string) =>
50
+ allTools.some((t) => t.name === name) ||
51
+ typeof legacyTools[name] === 'function';
52
+
39
53
  return {
40
- ledger: typeof tools.append_ledger === 'function',
41
- agentBus: typeof tools.link_send === 'function',
54
+ ledger: hasTool('append_ledger'),
55
+ agentBus: hasTool('link_send'),
42
56
  };
43
57
  };
44
58
 
@@ -10,7 +10,7 @@ import { homedir } from 'node:os';
10
10
  import type {
11
11
  ExtensionAPI,
12
12
  ExtensionContext,
13
- } from '@mariozechner/pi-coding-agent';
13
+ } from '@earendil-works/pi-coding-agent';
14
14
 
15
15
  // ─── Types ──────────────────────────────────────────────────────────────────
16
16
 
@@ -8,11 +8,11 @@ import {
8
8
  type Model,
9
9
  type SimpleStreamOptions,
10
10
  type Message,
11
- } from '@mariozechner/pi-ai';
11
+ } from '@earendil-works/pi-ai';
12
12
  import type {
13
13
  ExtensionAPI,
14
14
  ExtensionContext,
15
- } from '@mariozechner/pi-coding-agent';
15
+ } from '@earendil-works/pi-coding-agent';
16
16
  import type {
17
17
  RouterConfig,
18
18
  RoutingDecision,
@@ -7,7 +7,7 @@
7
7
  import type {
8
8
  ExtensionAPI,
9
9
  ExtensionContext,
10
- } from '@mariozechner/pi-coding-agent';
10
+ } from '@earendil-works/pi-coding-agent';
11
11
 
12
12
  // ─── Types ──────────────────────────────────────────────────────────────────
13
13
 
@@ -1,5 +1,5 @@
1
- import { streamSimple, type Context, type Message } from '@mariozechner/pi-ai';
2
- import type { ExtensionContext } from '@mariozechner/pi-coding-agent';
1
+ import { streamSimple, type Context, type Message } from '@earendil-works/pi-ai';
2
+ import type { ExtensionContext } from '@earendil-works/pi-coding-agent';
3
3
  import type {
4
4
  RouterTier,
5
5
  RouterPhase,
@@ -8,12 +8,12 @@
8
8
  */
9
9
  import { readFileSync, writeFileSync } from 'node:fs';
10
10
  import { join } from 'node:path';
11
- import { getAgentDir } from '@mariozechner/pi-coding-agent';
12
- import type { Model } from '@mariozechner/pi-ai';
11
+ import { getAgentDir } from '@earendil-works/pi-coding-agent';
12
+ import type { Model } from '@earendil-works/pi-ai';
13
13
  import type {
14
14
  ExtensionAPI,
15
15
  ExtensionContext,
16
- } from '@mariozechner/pi-coding-agent';
16
+ } from '@earendil-works/pi-coding-agent';
17
17
  import type { RouterProfile, RouterConfig } from './types';
18
18
  import { parseCanonicalModelRef } from './config';
19
19
 
@@ -1,4 +1,4 @@
1
- import type { ThinkingLevel } from '@mariozechner/pi-agent-core';
1
+ import type { ThinkingLevel } from '@earendil-works/pi-agent-core';
2
2
 
3
3
  // ─── Feature Toggles (added by fork) ──────────────────────────────────────
4
4
 
package/extensions/ui.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ExtensionContext } from '@mariozechner/pi-coding-agent';
1
+ import type { ExtensionContext } from '@earendil-works/pi-coding-agent';
2
2
  import type {
3
3
  RoutingDecision,
4
4
  RouterConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kylebrodeur/pi-model-router",
3
- "version": "0.1.4",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "Intelligent per-turn model router extension for the pi coding agent (Enhanced Fork)",
6
6
  "keywords": [
@@ -50,14 +50,14 @@
50
50
  "prepublishOnly": "npm run tsc"
51
51
  },
52
52
  "peerDependencies": {
53
- "@mariozechner/pi-agent-core": "*",
54
- "@mariozechner/pi-ai": "*",
55
- "@mariozechner/pi-coding-agent": ">=0.70.2",
56
- "@mariozechner/pi-tui": "*",
53
+ "@earendil-works/pi-agent-core": "^0.78.1",
54
+ "@earendil-works/pi-ai": "^0.78.1",
55
+ "@earendil-works/pi-coding-agent": ">=0.78.1",
56
+ "@earendil-works/pi-tui": "^0.78.1",
57
57
  "typebox": "*"
58
58
  },
59
59
  "devDependencies": {
60
- "@mariozechner/pi-coding-agent": "^0.70.2",
60
+ "@earendil-works/pi-coding-agent": "^0.78.1",
61
61
  "prettier": "^3.8.1",
62
62
  "typescript": "^6.0.2"
63
63
  }