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
9 changes: 9 additions & 0 deletions packages/skill-pi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @counterposition/skill-pi

## 0.74.0

### Minor Changes

- Update the Pi skill for Pi 0.74.0, including the official
`@earendil-works/*` package scope and `earendil-works/pi` source repository.
- Refresh package guidance so Pi-provided libraries, including `typebox`, are
declared as peer dependencies with `"*"` ranges.

## 0.73.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/skill-pi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@counterposition/skill-pi",
"version": "0.73.0",
"version": "0.74.0",
"description": "Pi coding agent reference skill — extensions, settings, providers, SDK/RPC, packages, and .pi/ config",
"keywords": [
"ai-skill",
Expand Down
11 changes: 6 additions & 5 deletions packages/skill-pi/skills/pi/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ Pi's philosophy: **adapt Pi to your workflows, not the other way around**.

## Architecture

Four core packages on npm (source: [github.com/badlogic/pi-mono](https://github.com/badlogic/pi-mono)):
Core packages on npm (source: [github.com/earendil-works/pi](https://github.com/earendil-works/pi)):

| Package | Purpose |
|---------|---------|
| `@mariozechner/pi-ai` | Unified LLM API across 20+ providers |
| `@mariozechner/pi-agent-core` | Agent loop, tool execution, state |
| `@mariozechner/pi-tui` | Terminal UI components |
| `@mariozechner/pi-coding-agent` | CLI, extensions, skills, sessions, settings |
| `@earendil-works/pi-ai` | Unified LLM API across 20+ providers |
| `@earendil-works/pi-agent-core` | Agent runtime with tool execution and state |
| `@earendil-works/pi-tui` | Terminal UI components |
| `@earendil-works/pi-coding-agent` | CLI, extensions, skills, sessions, settings |
| `@earendil-works/pi-web-ui` | Web components for chat interfaces |

## File System Layout

Expand Down
2 changes: 1 addition & 1 deletion packages/skill-pi/skills/pi/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"expected_output": "A TypeScript extension file that hooks into tool_call events, checks for curl in bash commands, prompts via ctx.ui.select, and appends blocked commands to a log file. Should check ctx.hasUI and handle non-interactive mode.",
"files": [],
"assertions": [
"Uses correct ExtensionAPI import from @mariozechner/pi-coding-agent",
"Uses correct ExtensionAPI import from @earendil-works/pi-coding-agent",
"Hooks into tool_call event (the correct event for intercepting tool calls)",
"Checks event.toolName === 'bash' before inspecting command",
"Tests for curl in the command string",
Expand Down
14 changes: 7 additions & 7 deletions packages/skill-pi/skills/pi/references/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ Use `pi -e ./my-extension.ts` or `pi --extension ...` for quick tests. Put stabl
## Common Imports

```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { Type } from "typebox";
import { StringEnum } from "@mariozechner/pi-ai";
import { Text } from "@mariozechner/pi-tui";
import { StringEnum } from "@earendil-works/pi-ai";
import { Text } from "@earendil-works/pi-tui";
```

- Use `typebox` (1.x) for schemas. Legacy `@sinclair/typebox` is still aliased but `@sinclair/typebox/compiler` is not.
- Use `StringEnum` from `@mariozechner/pi-ai` for Google-compatible string enums.
- Use `typebox` (1.x) for schemas.
- Use `StringEnum` from `@earendil-works/pi-ai` for Google-compatible string enums.

## Quick Start

```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { Type } from "typebox";

export default function (pi: ExtensionAPI) {
pi.on("session_start", async (_event, ctx) => {
Expand Down
10 changes: 5 additions & 5 deletions packages/skill-pi/skills/pi/references/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ If there is no `pi` manifest, Pi auto-discovers:

- Normal runtime dependencies belong in `dependencies`
- Pi core libraries should be peer deps with `"*"` ranges:
- `@mariozechner/pi-ai`
- `@mariozechner/pi-agent-core`
- `@mariozechner/pi-coding-agent`
- `@mariozechner/pi-tui`
- `typebox` (legacy `@sinclair/typebox` still aliased)
- `@earendil-works/pi-ai`
- `@earendil-works/pi-agent-core`
- `@earendil-works/pi-coding-agent`
- `@earendil-works/pi-tui`
- `typebox`
- Other Pi packages must be bundled explicitly
- Git package installs run `npm install --omit=dev` — runtime needs go in `dependencies`, not `devDependencies`

Expand Down
4 changes: 2 additions & 2 deletions packages/skill-pi/skills/pi/references/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Practical recipes for extending Pi. Each pattern is a self-contained example.
Block dangerous bash commands with user confirmation:

```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";

export default function (pi: ExtensionAPI) {
const dangerous = [/\brm\s+(-rf?|--recursive)/i, /\bsudo\b/i, /\b(chmod|chown)\b.*777/i];
Expand Down Expand Up @@ -237,7 +237,7 @@ The Pi examples include an `interactive-shell.ts` extension that maintains a per

## TUI Components

Pi's TUI library (`@mariozechner/pi-tui`) provides:
Pi's TUI library (`@earendil-works/pi-tui`) provides:

- `Text` — Word-wrapped text
- `Box` — Padded container with border
Expand Down
4 changes: 2 additions & 2 deletions packages/skill-pi/skills/pi/references/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
| OpenCode Go | `OPENCODE_API_KEY` | `opencode-go` |
| Hugging Face | `HF_TOKEN` | `huggingface` |
| Fireworks | `FIREWORKS_API_KEY` | `fireworks` |
| Together AI | `TOGETHER_API_KEY` | `together` |
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
| Moonshot | `MOONSHOT_API_KEY` | `moonshot` |
| Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
| Xiaomi MiMo Token Plan (CN/AMS/SGP) | `XIAOMI_TOKEN_PLAN_{CN,AMS,SGP}_API_KEY` | `xiaomi-token-plan-{cn,ams,sgp}` |

Expand Down Expand Up @@ -167,7 +167,7 @@ Common `api` values:

- `thinkingLevelMap` (Pi 0.72) replaces `compat.reasoningEffortMap`. Map pi levels (`off`/`minimal`/`low`/`medium`/`high`/`xhigh`) to provider values; use `null` to hide a level.
- `openRouterRouting` is forwarded as-is in the OpenRouter `provider` field (fallbacks, ZDR, ignore lists, throughput/latency).
- Advanced `compat` flags exist for proxy quirks (`cacheControlFormat`, `supportsLongCacheRetention`, `supportsEagerToolInputStreaming`, `sendSessionIdHeader`, `sendSessionAffinityHeaders`). See [pi-mono `docs/models.md`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/models.md) when a proxy rejects pi's defaults.
- Advanced `compat` flags exist for proxy quirks (`cacheControlFormat`, `supportsLongCacheRetention`, `supportsEagerToolInputStreaming`, `sendSessionIdHeader`, `sendSessionAffinityHeaders`). See [Pi `docs/models.md`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/models.md) when a proxy rejects pi's defaults.

## Custom Providers via Extensions

Expand Down
12 changes: 6 additions & 6 deletions packages/skill-pi/skills/pi/references/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The SDK embeds Pi in Node.js applications via `createAgentSession()`. Use `creat
## Installation

```bash
npm install @mariozechner/pi-coding-agent
npm install @earendil-works/pi-coding-agent
```

## Quick Start
Expand All @@ -16,7 +16,7 @@ import {
createAgentSession,
ModelRegistry,
SessionManager,
} from "@mariozechner/pi-coding-agent";
} from "@earendil-works/pi-coding-agent";

const authStorage = AuthStorage.create();
const modelRegistry = ModelRegistry.create(authStorage);
Expand Down Expand Up @@ -50,8 +50,8 @@ import {
defineTool,
ModelRegistry,
SessionManager,
} from "@mariozechner/pi-coding-agent";
import { getModel } from "@mariozechner/pi-ai";
} from "@earendil-works/pi-coding-agent";
import { getModel } from "@earendil-works/pi-ai";
```

## Core Options
Expand Down Expand Up @@ -115,7 +115,7 @@ import {
createAgentSessionServices,
getAgentDir,
SessionManager,
} from "@mariozechner/pi-coding-agent";
} from "@earendil-works/pi-coding-agent";

const createRuntime: CreateAgentSessionRuntimeFactory = async ({
cwd,
Expand Down Expand Up @@ -218,7 +218,7 @@ session.subscribe((event) => {
Use `defineTool()` when you want a reusable custom tool definition outside `pi.registerTool(...)`:

```typescript
import { defineTool } from "@mariozechner/pi-coding-agent";
import { defineTool } from "@earendil-works/pi-coding-agent";
import { Type } from "typebox";

const myTool = defineTool({
Expand Down
11 changes: 6 additions & 5 deletions skills/pi/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ Pi's philosophy: **adapt Pi to your workflows, not the other way around**.

## Architecture

Four core packages on npm (source: [github.com/badlogic/pi-mono](https://github.com/badlogic/pi-mono)):
Core packages on npm (source: [github.com/earendil-works/pi](https://github.com/earendil-works/pi)):

| Package | Purpose |
|---------|---------|
| `@mariozechner/pi-ai` | Unified LLM API across 20+ providers |
| `@mariozechner/pi-agent-core` | Agent loop, tool execution, state |
| `@mariozechner/pi-tui` | Terminal UI components |
| `@mariozechner/pi-coding-agent` | CLI, extensions, skills, sessions, settings |
| `@earendil-works/pi-ai` | Unified LLM API across 20+ providers |
| `@earendil-works/pi-agent-core` | Agent runtime with tool execution and state |
| `@earendil-works/pi-tui` | Terminal UI components |
| `@earendil-works/pi-coding-agent` | CLI, extensions, skills, sessions, settings |
| `@earendil-works/pi-web-ui` | Web components for chat interfaces |

## File System Layout

Expand Down
2 changes: 1 addition & 1 deletion skills/pi/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"expected_output": "A TypeScript extension file that hooks into tool_call events, checks for curl in bash commands, prompts via ctx.ui.select, and appends blocked commands to a log file. Should check ctx.hasUI and handle non-interactive mode.",
"files": [],
"assertions": [
"Uses correct ExtensionAPI import from @mariozechner/pi-coding-agent",
"Uses correct ExtensionAPI import from @earendil-works/pi-coding-agent",
"Hooks into tool_call event (the correct event for intercepting tool calls)",
"Checks event.toolName === 'bash' before inspecting command",
"Tests for curl in the command string",
Expand Down
14 changes: 7 additions & 7 deletions skills/pi/references/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ Use `pi -e ./my-extension.ts` or `pi --extension ...` for quick tests. Put stabl
## Common Imports

```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { Type } from "typebox";
import { StringEnum } from "@mariozechner/pi-ai";
import { Text } from "@mariozechner/pi-tui";
import { StringEnum } from "@earendil-works/pi-ai";
import { Text } from "@earendil-works/pi-tui";
```

- Use `typebox` (1.x) for schemas. Legacy `@sinclair/typebox` is still aliased but `@sinclair/typebox/compiler` is not.
- Use `StringEnum` from `@mariozechner/pi-ai` for Google-compatible string enums.
- Use `typebox` (1.x) for schemas.
- Use `StringEnum` from `@earendil-works/pi-ai` for Google-compatible string enums.

## Quick Start

```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { Type } from "typebox";

export default function (pi: ExtensionAPI) {
pi.on("session_start", async (_event, ctx) => {
Expand Down
10 changes: 5 additions & 5 deletions skills/pi/references/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ If there is no `pi` manifest, Pi auto-discovers:

- Normal runtime dependencies belong in `dependencies`
- Pi core libraries should be peer deps with `"*"` ranges:
- `@mariozechner/pi-ai`
- `@mariozechner/pi-agent-core`
- `@mariozechner/pi-coding-agent`
- `@mariozechner/pi-tui`
- `typebox` (legacy `@sinclair/typebox` still aliased)
- `@earendil-works/pi-ai`
- `@earendil-works/pi-agent-core`
- `@earendil-works/pi-coding-agent`
- `@earendil-works/pi-tui`
- `typebox`
- Other Pi packages must be bundled explicitly
- Git package installs run `npm install --omit=dev` — runtime needs go in `dependencies`, not `devDependencies`

Expand Down
4 changes: 2 additions & 2 deletions skills/pi/references/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Practical recipes for extending Pi. Each pattern is a self-contained example.
Block dangerous bash commands with user confirmation:

```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";

export default function (pi: ExtensionAPI) {
const dangerous = [/\brm\s+(-rf?|--recursive)/i, /\bsudo\b/i, /\b(chmod|chown)\b.*777/i];
Expand Down Expand Up @@ -237,7 +237,7 @@ The Pi examples include an `interactive-shell.ts` extension that maintains a per

## TUI Components

Pi's TUI library (`@mariozechner/pi-tui`) provides:
Pi's TUI library (`@earendil-works/pi-tui`) provides:

- `Text` — Word-wrapped text
- `Box` — Padded container with border
Expand Down
4 changes: 2 additions & 2 deletions skills/pi/references/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
| OpenCode Go | `OPENCODE_API_KEY` | `opencode-go` |
| Hugging Face | `HF_TOKEN` | `huggingface` |
| Fireworks | `FIREWORKS_API_KEY` | `fireworks` |
| Together AI | `TOGETHER_API_KEY` | `together` |
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
| Moonshot | `MOONSHOT_API_KEY` | `moonshot` |
| Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
| Xiaomi MiMo Token Plan (CN/AMS/SGP) | `XIAOMI_TOKEN_PLAN_{CN,AMS,SGP}_API_KEY` | `xiaomi-token-plan-{cn,ams,sgp}` |

Expand Down Expand Up @@ -167,7 +167,7 @@ Common `api` values:

- `thinkingLevelMap` (Pi 0.72) replaces `compat.reasoningEffortMap`. Map pi levels (`off`/`minimal`/`low`/`medium`/`high`/`xhigh`) to provider values; use `null` to hide a level.
- `openRouterRouting` is forwarded as-is in the OpenRouter `provider` field (fallbacks, ZDR, ignore lists, throughput/latency).
- Advanced `compat` flags exist for proxy quirks (`cacheControlFormat`, `supportsLongCacheRetention`, `supportsEagerToolInputStreaming`, `sendSessionIdHeader`, `sendSessionAffinityHeaders`). See [pi-mono `docs/models.md`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/models.md) when a proxy rejects pi's defaults.
- Advanced `compat` flags exist for proxy quirks (`cacheControlFormat`, `supportsLongCacheRetention`, `supportsEagerToolInputStreaming`, `sendSessionIdHeader`, `sendSessionAffinityHeaders`). See [Pi `docs/models.md`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/models.md) when a proxy rejects pi's defaults.

## Custom Providers via Extensions

Expand Down
12 changes: 6 additions & 6 deletions skills/pi/references/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The SDK embeds Pi in Node.js applications via `createAgentSession()`. Use `creat
## Installation

```bash
npm install @mariozechner/pi-coding-agent
npm install @earendil-works/pi-coding-agent
```

## Quick Start
Expand All @@ -16,7 +16,7 @@ import {
createAgentSession,
ModelRegistry,
SessionManager,
} from "@mariozechner/pi-coding-agent";
} from "@earendil-works/pi-coding-agent";

const authStorage = AuthStorage.create();
const modelRegistry = ModelRegistry.create(authStorage);
Expand Down Expand Up @@ -50,8 +50,8 @@ import {
defineTool,
ModelRegistry,
SessionManager,
} from "@mariozechner/pi-coding-agent";
import { getModel } from "@mariozechner/pi-ai";
} from "@earendil-works/pi-coding-agent";
import { getModel } from "@earendil-works/pi-ai";
```

## Core Options
Expand Down Expand Up @@ -115,7 +115,7 @@ import {
createAgentSessionServices,
getAgentDir,
SessionManager,
} from "@mariozechner/pi-coding-agent";
} from "@earendil-works/pi-coding-agent";

const createRuntime: CreateAgentSessionRuntimeFactory = async ({
cwd,
Expand Down Expand Up @@ -218,7 +218,7 @@ session.subscribe((event) => {
Use `defineTool()` when you want a reusable custom tool definition outside `pi.registerTool(...)`:

```typescript
import { defineTool } from "@mariozechner/pi-coding-agent";
import { defineTool } from "@earendil-works/pi-coding-agent";
import { Type } from "typebox";

const myTool = defineTool({
Expand Down