Skip to content

Commit 97655b8

Browse files
fix(providers): update package imports from @mariozechner to @earendil-works
1 parent 5283ea9 commit 97655b8

19 files changed

Lines changed: 154 additions & 250 deletions

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ packages/
284284
│ ├── errors.ts # UnknownProviderError
285285
│ ├── claude/ # ClaudeProvider + parseClaudeConfig + MCP/hooks/skills translation
286286
│ ├── codex/ # CodexProvider + parseCodexConfig + binary-resolver
287-
│ ├── community/pi/ # PiProvider (builtIn: false) — @mariozechner/pi-coding-agent, ~20 LLM backends
287+
│ ├── community/pi/ # PiProvider (builtIn: false) — @earendil-works/pi-coding-agent, ~20 LLM backends
288288
│ └── index.ts # Package exports
289289
├── core/ # @archon/core - Shared business logic
290290
│ └── src/
@@ -464,7 +464,7 @@ import type { DagNode, WorkflowDefinition } from '@/lib/api';
464464
- Implement `IAgentProvider` interface
465465
- **ClaudeProvider**: `@anthropic-ai/claude-agent-sdk`
466466
- **CodexProvider**: `@openai/codex-sdk`
467-
- **PiProvider** (community, `builtIn: false`): `@mariozechner/pi-coding-agent` — one harness for ~20 LLM backends via `<provider>/<model>` refs (e.g. `anthropic/claude-haiku-4-5`, `openrouter/qwen/qwen3-coder`); supports extensions, skills, tool restrictions, thinking level, best-effort structured output. See `packages/docs-web/src/content/docs/getting-started/ai-assistants.md` for setup, capability matrix, and extension config.
467+
- **PiProvider** (community, `builtIn: false`): `@earendil-works/pi-coding-agent` — one harness for ~20 LLM backends via `<provider>/<model>` refs (e.g. `anthropic/claude-haiku-4-5`, `openrouter/qwen/qwen3-coder`); supports extensions, skills, tool restrictions, thinking level, best-effort structured output. See `packages/docs-web/src/content/docs/getting-started/ai-assistants.md` for setup, capability matrix, and extension config.
468468
- Streaming: `for await (const event of events) { await platform.send(event) }`
469469

470470
### Configuration

bun.lock

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

examples/workflows/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
## Install Pi
44

55
```bash
6-
npm install -g @mariozechner/pi-coding-agent
6+
npm install -g @earendil-works/pi-coding-agent
77
```
88

99
## Install Kiro provider and dependencies
1010

1111
```bash
1212
pi install npm:pi-provider-kiro
13-
npm install -g @mariozechner/pi-tui @mariozechner/pi-ai
13+
npm install -g @earendil-works/pi-tui @earendil-works/pi-ai
1414
```
1515

1616
## Install MCP for Pi

packages/cli/src/commands/setup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ describe('checkPiModule', () => {
882882

883883
it('returns ok:false when loader throws (Pi binary missing)', async () => {
884884
const result = await checkPiModule(async () => {
885-
throw new Error('Cannot find module @mariozechner/pi-coding-agent');
885+
throw new Error('Cannot find module @earendil-works/pi-coding-agent');
886886
});
887887
expect(result.ok).toBe(false);
888888
expect(result.error).toContain('pi-coding-agent');

packages/docs-web/src/content/docs/getting-started/ai-assistants.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ DEFAULT_AI_ASSISTANT=codex
233233

234234
## Pi (Community Provider)
235235

236-
**One adapter, ~20 LLM backends.** Pi (`@mariozechner/pi-coding-agent`) is a community-maintained coding-agent harness that Archon integrates as the first community provider. It unlocks Anthropic, OpenAI, Google (Gemini + Vertex), Groq, Mistral, Cerebras, xAI, OpenRouter, Hugging Face, and local inference (LM Studio, ollama, llamacpp, custom OpenAI-compatible endpoints registered in `~/.pi/agent/models.json`) under a single `provider: pi` entry.
236+
**One adapter, ~20 LLM backends.** Pi (`@earendil-works/pi-coding-agent`) is a community-maintained coding-agent harness that Archon integrates as the first community provider. It unlocks Anthropic, OpenAI, Google (Gemini + Vertex), Groq, Mistral, Cerebras, xAI, OpenRouter, Hugging Face, and local inference (LM Studio, ollama, llamacpp, custom OpenAI-compatible endpoints registered in `~/.pi/agent/models.json`) under a single `provider: pi` entry.
237237

238238
Pi is registered as `builtIn: false` — it validates the community-provider seam rather than being a core-team-maintained option. If it proves stable and valuable it may be promoted to `builtIn: true` later.
239239

packages/providers/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
"./registry": "./src/registry.ts"
2020
},
2121
"scripts": {
22-
"test": "bun test src/claude/provider.test.ts && bun test src/codex/provider.test.ts && bun test src/registry.test.ts && bun test src/codex/binary-guard.test.ts && bun test src/codex/binary-resolver.test.ts && bun test src/codex/binary-resolver-dev.test.ts && bun test src/claude/binary-resolver.test.ts && bun test src/claude/binary-resolver-dev.test.ts && bun test src/community/pi/model-ref.test.ts && bun test src/community/pi/config.test.ts && bun test src/community/pi/event-bridge.test.ts && bun test src/community/pi/options-translator.test.ts && bun test src/community/pi/session-resolver.test.ts && bun test src/community/pi/provider.test.ts && bun test src/community/pi/provider-lazy-load.test.ts",
22+
"test": "bun test src/claude/provider.test.ts && bun test src/codex/provider.test.ts && bun test src/registry.test.ts && bun test src/codex/binary-guard.test.ts && bun test src/codex/binary-resolver.test.ts && bun test src/codex/binary-resolver-dev.test.ts && bun test src/claude/binary-resolver.test.ts && bun test src/claude/binary-resolver-dev.test.ts && bun test src/community/pi/model-ref.test.ts && bun test src/community/pi/model-catalog.test.ts && bun test src/community/pi/config.test.ts && bun test src/community/pi/event-bridge.test.ts && bun test src/community/pi/options-translator.test.ts && bun test src/community/pi/session-resolver.test.ts && bun test src/community/pi/provider.test.ts && bun test src/community/pi/provider-lazy-load.test.ts",
2323
"type-check": "bun x tsc --noEmit"
2424
},
2525
"dependencies": {
2626
"@anthropic-ai/claude-agent-sdk": "^0.2.121",
2727
"@archon/paths": "workspace:*",
28-
"@mariozechner/pi-ai": "^0.67.5",
29-
"@mariozechner/pi-coding-agent": "^0.67.5",
28+
"@earendil-works/pi-ai": "^0.75.3",
29+
"@earendil-works/pi-coding-agent": "^0.75.3",
3030
"@openai/codex-sdk": "^0.125.0",
3131
"@sinclair/typebox": "^0.34.41"
3232
},

packages/providers/src/community/pi/event-bridge.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test } from 'bun:test';
2-
import type { AgentSession, AgentSessionEvent } from '@mariozechner/pi-coding-agent';
2+
import type { AgentSession, AgentSessionEvent } from '@earendil-works/pi-coding-agent';
33

44
import type { MessageChunk } from '../../types';
55
import {

packages/providers/src/community/pi/event-bridge.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createLogger } from '@archon/paths';
2-
import type { AgentSession, AgentSessionEvent } from '@mariozechner/pi-coding-agent';
3-
import type { AssistantMessage, Usage } from '@mariozechner/pi-ai';
2+
import type { AgentSession, AgentSessionEvent } from '@earendil-works/pi-coding-agent';
3+
import type { AssistantMessage, Usage } from '@earendil-works/pi-ai';
44

55
import type { MessageChunk, TokenUsage } from '../../types';
66

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { describe, expect, test } from 'bun:test';
2+
import { AuthStorage, ModelRegistry } from '@earendil-works/pi-coding-agent';
3+
4+
describe('Pi embedded model catalog', () => {
5+
test('resolves openai-codex/gpt-5.5 through ModelRegistry', () => {
6+
const authStorage = AuthStorage.create();
7+
const modelRegistry = ModelRegistry.create(authStorage);
8+
9+
const model = modelRegistry.find('openai-codex', 'gpt-5.5');
10+
11+
expect(model).toBeDefined();
12+
expect(model?.provider).toBe('openai-codex');
13+
expect(model?.id).toBe('gpt-5.5');
14+
});
15+
});

packages/providers/src/community/pi/options-translator.ts

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,12 @@ import { homedir } from 'node:os';
33
import { join } from 'node:path';
44

55
import {
6-
codingTools,
7-
createBashTool,
8-
createEditTool,
9-
createFindTool,
10-
createGrepTool,
11-
createLsTool,
12-
createReadTool,
13-
createWriteTool,
6+
createBashToolDefinition,
147
type BashSpawnContext,
158
type BashSpawnHook,
16-
} from '@mariozechner/pi-coding-agent';
17-
import type { ThinkingLevel } from '@mariozechner/pi-ai';
18-
19-
/**
20-
* Pi's exported `Tool` type is structurally `AgentTool<TSchema>` and isn't
21-
* re-exported at the package root. Deriving it from the `codingTools` aggregate
22-
* (which IS re-exported and typed as `Tool[]`) gives us a namespace-free alias
23-
* that satisfies TS's portable-type requirement.
24-
*/
25-
type PiTool = (typeof codingTools)[number];
9+
type CreateAgentSessionOptions,
10+
} from '@earendil-works/pi-coding-agent';
11+
import type { ThinkingLevel } from '@earendil-works/pi-ai';
2612

2713
import type { NodeConfig } from '../../types';
2814

@@ -129,33 +115,29 @@ function buildBashSpawnHook(env: Record<string, string> | undefined): BashSpawnH
129115
});
130116
}
131117

132-
/** Map a normalized (lowercase) Pi tool name to its Pi-internal factory. */
133-
function buildPiTool(name: PiToolName, cwd: string, spawnHook: BashSpawnHook | undefined): PiTool {
134-
switch (name) {
135-
case 'read':
136-
return createReadTool(cwd);
137-
case 'bash':
138-
return spawnHook ? createBashTool(cwd, { spawnHook }) : createBashTool(cwd);
139-
case 'edit':
140-
return createEditTool(cwd);
141-
case 'write':
142-
return createWriteTool(cwd);
143-
case 'grep':
144-
return createGrepTool(cwd);
145-
case 'find':
146-
return createFindTool(cwd);
147-
case 'ls':
148-
return createLsTool(cwd);
149-
}
118+
type PiCustomTools = NonNullable<CreateAgentSessionOptions['customTools']>;
119+
120+
function buildEnvAwareBashTool(
121+
cwd: string,
122+
spawnHook: BashSpawnHook | undefined
123+
): PiCustomTools[number] | undefined {
124+
if (!spawnHook) return undefined;
125+
const tool = createBashToolDefinition(cwd, { spawnHook });
126+
// Pi's own built-in factory returns a concrete ToolDefinition with narrower
127+
// render argument types than the customTools slot exposes. Runtime accepts
128+
// this exact shape; bridge the SDK variance mismatch without using `any`.
129+
return tool as unknown as PiCustomTools[number];
150130
}
151131

152132
export interface ResolvedTools {
153133
/**
154-
* The tools array to pass to Pi, or `undefined` to leave Pi's default
134+
* Tool names to pass to Pi, or `undefined` to leave Pi's default
155135
* (read/bash/edit/write) in place. An empty array means "no tools —
156136
* LLM-only response" which is a valid explicit setting.
157137
*/
158-
tools: PiTool[] | undefined;
138+
tools: PiToolName[] | undefined;
139+
/** Same-name custom tool definitions used to override built-ins (currently env-aware bash). */
140+
customTools?: PiCustomTools;
159141
/** Unknown tool names in allowed_tools / denied_tools (e.g. Claude-specific like WebFetch). */
160142
unknownTools: string[];
161143
}
@@ -201,8 +183,10 @@ export function resolvePiTools(
201183
// a custom bash tool (Pi's default bashTool is pre-constructed with no
202184
// spawnHook and there's no way to retrofit env onto it).
203185
if (!spawnHook) return { tools: undefined, unknownTools: [] };
186+
const customBashTool = buildEnvAwareBashTool(cwd, spawnHook);
204187
return {
205-
tools: PI_DEFAULT_TOOL_NAMES.map(n => buildPiTool(n, cwd, spawnHook)),
188+
tools: [...PI_DEFAULT_TOOL_NAMES],
189+
...(customBashTool ? { customTools: [customBashTool] } : {}),
206190
unknownTools: [],
207191
};
208192
}
@@ -241,8 +225,12 @@ export function resolvePiTools(
241225
return true;
242226
});
243227

228+
const customBashTool = unique.includes('bash')
229+
? buildEnvAwareBashTool(cwd, spawnHook)
230+
: undefined;
244231
return {
245-
tools: unique.map(n => buildPiTool(n, cwd, spawnHook)),
232+
tools: unique,
233+
...(customBashTool ? { customTools: [customBashTool] } : {}),
246234
unknownTools,
247235
};
248236
}

0 commit comments

Comments
 (0)