@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 +29 -8
- package/extensions/commands.ts +2 -2
- package/extensions/config.ts +2 -2
- package/extensions/index.ts +18 -4
- package/extensions/ollama-sync.ts +1 -1
- package/extensions/provider.ts +2 -2
- package/extensions/rate-limit.ts +1 -1
- package/extensions/routing.ts +2 -2
- package/extensions/scope-shim.ts +3 -3
- package/extensions/types.ts +1 -1
- package/extensions/ui.ts +1 -1
- package/package.json +6 -6
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
|
|
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
|
|
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
|
-
-
|
|
23
|
-
-
|
|
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.
|
|
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
|
package/extensions/commands.ts
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getAgentDir,
|
|
3
3
|
type ExtensionAPI,
|
|
4
4
|
type ExtensionContext,
|
|
5
|
-
} from '@
|
|
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 '@
|
|
8
|
+
import type { AutocompleteItem } from '@earendil-works/pi-tui';
|
|
9
9
|
import type {
|
|
10
10
|
RouterConfig,
|
|
11
11
|
RouterPinByProfile,
|
package/extensions/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import { getAgentDir } from '@
|
|
4
|
-
import type { ThinkingLevel } from '@
|
|
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,
|
package/extensions/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ExtensionAPI,
|
|
3
3
|
ExtensionContext,
|
|
4
|
-
} from '@
|
|
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:
|
|
41
|
-
agentBus:
|
|
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 '@
|
|
13
|
+
} from '@earendil-works/pi-coding-agent';
|
|
14
14
|
|
|
15
15
|
// ─── Types ──────────────────────────────────────────────────────────────────
|
|
16
16
|
|
package/extensions/provider.ts
CHANGED
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
type Model,
|
|
9
9
|
type SimpleStreamOptions,
|
|
10
10
|
type Message,
|
|
11
|
-
} from '@
|
|
11
|
+
} from '@earendil-works/pi-ai';
|
|
12
12
|
import type {
|
|
13
13
|
ExtensionAPI,
|
|
14
14
|
ExtensionContext,
|
|
15
|
-
} from '@
|
|
15
|
+
} from '@earendil-works/pi-coding-agent';
|
|
16
16
|
import type {
|
|
17
17
|
RouterConfig,
|
|
18
18
|
RoutingDecision,
|
package/extensions/rate-limit.ts
CHANGED
package/extensions/routing.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { streamSimple, type Context, type Message } from '@
|
|
2
|
-
import type { ExtensionContext } from '@
|
|
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,
|
package/extensions/scope-shim.ts
CHANGED
|
@@ -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 '@
|
|
12
|
-
import type { Model } from '@
|
|
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 '@
|
|
16
|
+
} from '@earendil-works/pi-coding-agent';
|
|
17
17
|
import type { RouterProfile, RouterConfig } from './types';
|
|
18
18
|
import { parseCanonicalModelRef } from './config';
|
|
19
19
|
|
package/extensions/types.ts
CHANGED
package/extensions/ui.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kylebrodeur/pi-model-router",
|
|
3
|
-
"version": "0.
|
|
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
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
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
|
-
"@
|
|
60
|
+
"@earendil-works/pi-coding-agent": "^0.78.1",
|
|
61
61
|
"prettier": "^3.8.1",
|
|
62
62
|
"typescript": "^6.0.2"
|
|
63
63
|
}
|