open-pi-coding-agent 0.57.1 → 0.57.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +21 -21
  2. package/README.md +8 -8
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/cli/file-processor.d.ts.map +1 -1
  6. package/dist/cli/file-processor.js.map +1 -1
  7. package/dist/core/agent-session.d.ts.map +1 -1
  8. package/dist/core/agent-session.js.map +1 -1
  9. package/dist/core/auth-storage.d.ts.map +1 -1
  10. package/dist/core/auth-storage.js +2 -2
  11. package/dist/core/auth-storage.js.map +1 -1
  12. package/dist/core/export-html/index.d.ts.map +1 -1
  13. package/dist/core/export-html/index.js.map +1 -1
  14. package/dist/core/extensions/loader.d.ts +1 -1
  15. package/dist/core/extensions/loader.d.ts.map +1 -1
  16. package/dist/core/extensions/loader.js +6 -6
  17. package/dist/core/extensions/loader.js.map +1 -1
  18. package/dist/core/extensions/types.d.ts +1 -1
  19. package/dist/core/extensions/types.d.ts.map +1 -1
  20. package/dist/core/extensions/types.js.map +1 -1
  21. package/dist/core/keybindings.d.ts.map +1 -1
  22. package/dist/core/keybindings.js +1 -1
  23. package/dist/core/keybindings.js.map +1 -1
  24. package/dist/core/model-registry.d.ts.map +1 -1
  25. package/dist/core/model-registry.js +2 -2
  26. package/dist/core/model-registry.js.map +1 -1
  27. package/dist/core/model-resolver.d.ts.map +1 -1
  28. package/dist/core/model-resolver.js +1 -1
  29. package/dist/core/model-resolver.js.map +1 -1
  30. package/dist/core/session-manager.d.ts.map +1 -1
  31. package/dist/core/session-manager.js.map +1 -1
  32. package/dist/core/settings-manager.d.ts.map +1 -1
  33. package/dist/core/settings-manager.js.map +1 -1
  34. package/dist/core/tools/bash.d.ts +1 -1
  35. package/dist/core/tools/bash.d.ts.map +1 -1
  36. package/dist/core/tools/bash.js.map +1 -1
  37. package/dist/core/tools/edit.d.ts +1 -1
  38. package/dist/core/tools/edit.d.ts.map +1 -1
  39. package/dist/core/tools/edit.js.map +1 -1
  40. package/dist/core/tools/find.d.ts +1 -1
  41. package/dist/core/tools/find.d.ts.map +1 -1
  42. package/dist/core/tools/find.js.map +1 -1
  43. package/dist/core/tools/grep.d.ts +1 -1
  44. package/dist/core/tools/grep.d.ts.map +1 -1
  45. package/dist/core/tools/grep.js.map +1 -1
  46. package/dist/core/tools/ls.d.ts +1 -1
  47. package/dist/core/tools/ls.d.ts.map +1 -1
  48. package/dist/core/tools/ls.js.map +1 -1
  49. package/dist/core/tools/read.d.ts +1 -1
  50. package/dist/core/tools/read.d.ts.map +1 -1
  51. package/dist/core/tools/read.js.map +1 -1
  52. package/dist/core/tools/write.d.ts +1 -1
  53. package/dist/core/tools/write.d.ts.map +1 -1
  54. package/dist/core/tools/write.js.map +1 -1
  55. package/dist/main.d.ts.map +1 -1
  56. package/dist/main.js +1 -1
  57. package/dist/main.js.map +1 -1
  58. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  59. package/dist/modes/interactive/components/login-dialog.js +1 -1
  60. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  61. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  62. package/dist/modes/interactive/interactive-mode.js +1 -1
  63. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  64. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  65. package/dist/modes/interactive/theme/theme.js.map +1 -1
  66. package/dist/utils/clipboard-native.d.ts.map +1 -1
  67. package/dist/utils/clipboard-native.js +1 -1
  68. package/dist/utils/clipboard-native.js.map +1 -1
  69. package/docs/compaction.md +2 -2
  70. package/docs/custom-provider.md +3 -3
  71. package/docs/extensions.md +24 -24
  72. package/docs/packages.md +1 -1
  73. package/docs/rpc.md +1 -1
  74. package/docs/sdk.md +24 -24
  75. package/docs/session.md +1 -1
  76. package/docs/termux.md +1 -1
  77. package/docs/tui.md +20 -20
  78. package/examples/extensions/README.md +2 -2
  79. package/examples/extensions/antigravity-image-gen.ts +1 -1
  80. package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
  81. package/examples/extensions/dynamic-tools.ts +1 -1
  82. package/examples/extensions/overlay-qa-tests.ts +1 -1
  83. package/examples/extensions/question.ts +1 -1
  84. package/examples/extensions/questionnaire.ts +1 -1
  85. package/examples/extensions/reload-runtime.ts +1 -1
  86. package/examples/extensions/shutdown-command.ts +1 -1
  87. package/examples/extensions/subagent/index.ts +1 -1
  88. package/examples/extensions/todo.ts +1 -1
  89. package/examples/extensions/tool-override.ts +2 -2
  90. package/examples/extensions/truncated-tool.ts +3 -3
  91. package/examples/extensions/with-deps/index.ts +1 -1
  92. package/examples/sdk/08-prompt-templates.ts +1 -6
  93. package/examples/sdk/README.md +2 -2
  94. package/package.json +3 -3
@@ -31,7 +31,7 @@ See these complete provider examples:
31
31
  ## Quick Reference
32
32
 
33
33
  ```typescript
34
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
34
+ import type { ExtensionAPI } from "open-pi-coding-agent";
35
35
 
36
36
  export default function (pi: ExtensionAPI) {
37
37
  // Override baseUrl for existing provider
@@ -211,7 +211,7 @@ pi.registerProvider("custom-api", {
211
211
  Add OAuth/SSO authentication that integrates with `/login`:
212
212
 
213
213
  ```typescript
214
- import type { OAuthCredentials, OAuthLoginCallbacks } from "@mariozechner/pi-ai";
214
+ import type { OAuthCredentials, OAuthLoginCallbacks } from "open-pi-ai";
215
215
 
216
216
  pi.registerProvider("corporate-ai", {
217
217
  baseUrl: "https://ai.corp.com/v1",
@@ -324,7 +324,7 @@ import {
324
324
  type SimpleStreamOptions,
325
325
  calculateCost,
326
326
  createAssistantMessageEventStream,
327
- } from "@mariozechner/pi-ai";
327
+ } from "open-pi-ai";
328
328
 
329
329
  function streamMyProvider(
330
330
  model: Model<any>,
@@ -55,7 +55,7 @@ See [examples/extensions/](../examples/extensions/) for working implementations.
55
55
  Create `~/.pi/agent/extensions/my-extension.ts`:
56
56
 
57
57
  ```typescript
58
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
58
+ import type { ExtensionAPI } from "open-pi-coding-agent";
59
59
  import { Type } from "@sinclair/typebox";
60
60
 
61
61
  export default function (pi: ExtensionAPI) {
@@ -137,10 +137,10 @@ To share extensions via npm or git as pi packages, see [packages.md](packages.md
137
137
 
138
138
  | Package | Purpose |
139
139
  |---------|---------|
140
- | `@mariozechner/pi-coding-agent` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
140
+ | `open-pi-coding-agent` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
141
141
  | `@sinclair/typebox` | Schema definitions for tool parameters |
142
- | `@mariozechner/pi-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
143
- | `@mariozechner/pi-tui` | TUI components for custom rendering |
142
+ | `open-pi-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
143
+ | `open-pi-tui` | TUI components for custom rendering |
144
144
 
145
145
  npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
146
146
 
@@ -151,7 +151,7 @@ Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
151
151
  An extension exports a default function that receives `ExtensionAPI`:
152
152
 
153
153
  ```typescript
154
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
154
+ import type { ExtensionAPI } from "open-pi-coding-agent";
155
155
 
156
156
  export default function (pi: ExtensionAPI) {
157
157
  // Subscribe to events
@@ -556,7 +556,7 @@ Use this to update UI elements (status bars, footers) or perform model-specific
556
556
  Fired before tool executes. **Can block.** Use `isToolCallEventType` to narrow and get typed inputs.
557
557
 
558
558
  ```typescript
559
- import { isToolCallEventType } from "@mariozechner/pi-coding-agent";
559
+ import { isToolCallEventType } from "open-pi-coding-agent";
560
560
 
561
561
  pi.on("tool_call", async (event, ctx) => {
562
562
  // event.toolName - "bash", "read", "write", "edit", etc.
@@ -590,7 +590,7 @@ export type MyToolInput = Static<typeof myToolSchema>;
590
590
  Use `isToolCallEventType` with explicit type parameters:
591
591
 
592
592
  ```typescript
593
- import { isToolCallEventType } from "@mariozechner/pi-coding-agent";
593
+ import { isToolCallEventType } from "open-pi-coding-agent";
594
594
  import type { MyToolInput } from "my-extension";
595
595
 
596
596
  pi.on("tool_call", (event) => {
@@ -610,7 +610,7 @@ Fired after tool executes. **Can modify result.**
610
610
  - Handlers can return partial patches (`content`, `details`, or `isError`); omitted fields keep their current values
611
611
 
612
612
  ```typescript
613
- import { isBashToolResult } from "@mariozechner/pi-coding-agent";
613
+ import { isBashToolResult } from "open-pi-coding-agent";
614
614
 
615
615
  pi.on("tool_result", async (event, ctx) => {
616
616
  // event.toolName, event.toolCallId, event.input
@@ -882,7 +882,7 @@ Tools run with `ExtensionContext`, so they cannot call `ctx.reload()` directly.
882
882
  Example tool the LLM can call to trigger reload:
883
883
 
884
884
  ```typescript
885
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
885
+ import type { ExtensionAPI } from "open-pi-coding-agent";
886
886
  import { Type } from "@sinclair/typebox";
887
887
 
888
888
  export default function (pi: ExtensionAPI) {
@@ -929,7 +929,7 @@ See [dynamic-tools.ts](../examples/extensions/dynamic-tools.ts) for a full examp
929
929
 
930
930
  ```typescript
931
931
  import { Type } from "@sinclair/typebox";
932
- import { StringEnum } from "@mariozechner/pi-ai";
932
+ import { StringEnum } from "open-pi-ai";
933
933
 
934
934
  pi.registerTool({
935
935
  name: "my_tool",
@@ -1079,7 +1079,7 @@ pi.registerCommand("stats", {
1079
1079
  Optional: add argument auto-completion for `/command ...`:
1080
1080
 
1081
1081
  ```typescript
1082
- import type { AutocompleteItem } from "@mariozechner/pi-tui";
1082
+ import type { AutocompleteItem } from "open-pi-tui";
1083
1083
 
1084
1084
  pi.registerCommand("deploy", {
1085
1085
  description: "Deploy to an environment",
@@ -1335,8 +1335,8 @@ Note: Some models are idiots and include the @ prefix in tool path arguments. Bu
1335
1335
 
1336
1336
  ```typescript
1337
1337
  import { Type } from "@sinclair/typebox";
1338
- import { StringEnum } from "@mariozechner/pi-ai";
1339
- import { Text } from "@mariozechner/pi-tui";
1338
+ import { StringEnum } from "open-pi-ai";
1339
+ import { Text } from "open-pi-tui";
1340
1340
 
1341
1341
  pi.registerTool({
1342
1342
  name: "my_tool",
@@ -1391,7 +1391,7 @@ async execute(toolCallId, params) {
1391
1391
  }
1392
1392
  ```
1393
1393
 
1394
- **Important:** Use `StringEnum` from `@mariozechner/pi-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
1394
+ **Important:** Use `StringEnum` from `open-pi-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
1395
1395
 
1396
1396
  ### Overriding Built-in Tools
1397
1397
 
@@ -1428,7 +1428,7 @@ Built-in tool implementations:
1428
1428
  Built-in tools support pluggable operations for delegating to remote systems (SSH, containers, etc.):
1429
1429
 
1430
1430
  ```typescript
1431
- import { createReadTool, createBashTool, type ReadOperations } from "@mariozechner/pi-coding-agent";
1431
+ import { createReadTool, createBashTool, type ReadOperations } from "open-pi-coding-agent";
1432
1432
 
1433
1433
  // Create tool with custom operations
1434
1434
  const remoteRead = createReadTool(cwd, {
@@ -1457,7 +1457,7 @@ pi.registerTool({
1457
1457
  The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
1458
1458
 
1459
1459
  ```typescript
1460
- import { createBashTool } from "@mariozechner/pi-coding-agent";
1460
+ import { createBashTool } from "open-pi-coding-agent";
1461
1461
 
1462
1462
  const bashTool = createBashTool(cwd, {
1463
1463
  spawnHook: ({ command, cwd, env }) => ({
@@ -1487,7 +1487,7 @@ import {
1487
1487
  formatSize, // Human-readable size (e.g., "50KB", "1.5MB")
1488
1488
  DEFAULT_MAX_BYTES, // 50KB
1489
1489
  DEFAULT_MAX_LINES, // 2000
1490
- } from "@mariozechner/pi-coding-agent";
1490
+ } from "open-pi-coding-agent";
1491
1491
 
1492
1492
  async execute(toolCallId, params, signal, onUpdate, ctx) {
1493
1493
  const output = await runCommand();
@@ -1551,7 +1551,7 @@ Tool output is wrapped in a `Box` that handles padding and background. Your rend
1551
1551
  Renders the tool call (before/during execution):
1552
1552
 
1553
1553
  ```typescript
1554
- import { Text } from "@mariozechner/pi-tui";
1554
+ import { Text } from "open-pi-tui";
1555
1555
 
1556
1556
  renderCall(args, theme) {
1557
1557
  let text = theme.fg("toolTitle", theme.bold("my_tool "));
@@ -1595,7 +1595,7 @@ renderResult(result, { expanded, isPartial }, theme) {
1595
1595
  Use `keyHint()` to display keybinding hints that respect user's keybinding configuration:
1596
1596
 
1597
1597
  ```typescript
1598
- import { keyHint } from "@mariozechner/pi-coding-agent";
1598
+ import { keyHint } from "open-pi-coding-agent";
1599
1599
 
1600
1600
  renderResult(result, { expanded }, theme) {
1601
1601
  let text = theme.fg("success", "✓ Done");
@@ -1769,7 +1769,7 @@ ctx.ui.theme.fg("accent", "styled text"); // Access current theme
1769
1769
  For complex UI, use `ctx.ui.custom()`. This temporarily replaces the editor with your component until `done()` is called:
1770
1770
 
1771
1771
  ```typescript
1772
- import { Text, Component } from "@mariozechner/pi-tui";
1772
+ import { Text, Component } from "open-pi-tui";
1773
1773
 
1774
1774
  const result = await ctx.ui.custom<boolean>((tui, theme, keybindings, done) => {
1775
1775
  const text = new Text("Press Enter to confirm, Escape to cancel", 1, 1);
@@ -1827,8 +1827,8 @@ See [tui.md](tui.md) for the full `OverlayOptions` API and [overlay-qa-tests.ts]
1827
1827
  Replace the main input editor with a custom implementation (vim mode, emacs mode, etc.):
1828
1828
 
1829
1829
  ```typescript
1830
- import { CustomEditor, type ExtensionAPI } from "@mariozechner/pi-coding-agent";
1831
- import { matchesKey } from "@mariozechner/pi-tui";
1830
+ import { CustomEditor, type ExtensionAPI } from "open-pi-coding-agent";
1831
+ import { matchesKey } from "open-pi-tui";
1832
1832
 
1833
1833
  class VimEditor extends CustomEditor {
1834
1834
  private mode: "normal" | "insert" = "insert";
@@ -1868,7 +1868,7 @@ See [tui.md](tui.md) Pattern 7 for a complete example with mode indicator.
1868
1868
  Register a custom renderer for messages with your `customType`:
1869
1869
 
1870
1870
  ```typescript
1871
- import { Text } from "@mariozechner/pi-tui";
1871
+ import { Text } from "open-pi-tui";
1872
1872
 
1873
1873
  pi.registerMessageRenderer("my-extension", (message, options, theme) => {
1874
1874
  const { expanded } = options;
@@ -1917,7 +1917,7 @@ theme.strikethrough(text)
1917
1917
  For syntax highlighting in custom tool renderers:
1918
1918
 
1919
1919
  ```typescript
1920
- import { highlightCode, getLanguageFromPath } from "@mariozechner/pi-coding-agent";
1920
+ import { highlightCode, getLanguageFromPath } from "open-pi-coding-agent";
1921
1921
 
1922
1922
  // Highlight code with explicit language
1923
1923
  const highlighted = highlightCode("const x = 1;", "typescript", theme);
package/docs/packages.md CHANGED
@@ -149,7 +149,7 @@ If no `pi` manifest is present, pi auto-discovers resources from these directori
149
149
 
150
150
  Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When pi installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
151
151
 
152
- Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/pi-ai`, `@mariozechner/pi-agent-core`, `@mariozechner/pi-coding-agent`, `@mariozechner/pi-tui`, `@sinclair/typebox`.
152
+ Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `open-pi-ai`, `open-pi-agent`, `open-pi-coding-agent`, `open-pi-tui`, `@sinclair/typebox`.
153
153
 
154
154
  Other pi packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Pi loads packages with separate module roots, so separate installs do not collide or share modules.
155
155
 
package/docs/rpc.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  RPC mode enables headless operation of the coding agent via a JSON protocol over stdin/stdout. This is useful for embedding the agent in other applications, IDEs, or custom UIs.
4
4
 
5
- **Note for Node.js/TypeScript users**: If you're building a Node.js application, consider using `AgentSession` directly from `@mariozechner/pi-coding-agent` instead of spawning a subprocess. See [`src/core/agent-session.ts`](../src/core/agent-session.ts) for the API. For a subprocess-based TypeScript client, see [`src/modes/rpc/rpc-client.ts`](../src/modes/rpc/rpc-client.ts).
5
+ **Note for Node.js/TypeScript users**: If you're building a Node.js application, consider using `AgentSession` directly from `open-pi-coding-agent` instead of spawning a subprocess. See [`src/core/agent-session.ts`](../src/core/agent-session.ts) for the API. For a subprocess-based TypeScript client, see [`src/modes/rpc/rpc-client.ts`](../src/modes/rpc/rpc-client.ts).
6
6
 
7
7
  ## Starting RPC Mode
8
8
 
package/docs/sdk.md CHANGED
@@ -16,7 +16,7 @@ See [examples/sdk/](../examples/sdk/) for working examples from minimal to full
16
16
  ## Quick Start
17
17
 
18
18
  ```typescript
19
- import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@mariozechner/pi-coding-agent";
19
+ import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "open-pi-coding-agent";
20
20
 
21
21
  // Set up credential storage and model registry
22
22
  const authStorage = AuthStorage.create();
@@ -40,7 +40,7 @@ await session.prompt("What files are in the current directory?");
40
40
  ## Installation
41
41
 
42
42
  ```bash
43
- npm install @mariozechner/pi-coding-agent
43
+ npm install open-pi-coding-agent
44
44
  ```
45
45
 
46
46
  The SDK is included in the main package. No separate installation needed.
@@ -54,7 +54,7 @@ The main factory function. Creates an `AgentSession` with configurable options.
54
54
  `createAgentSession()` uses a `ResourceLoader` to supply extensions, skills, prompt templates, themes, and context files. If you do not provide one, it uses `DefaultResourceLoader` with standard discovery.
55
55
 
56
56
  ```typescript
57
- import { createAgentSession } from "@mariozechner/pi-coding-agent";
57
+ import { createAgentSession } from "open-pi-coding-agent";
58
58
 
59
59
  // Minimal: defaults with DefaultResourceLoader
60
60
  const { session } = await createAgentSession();
@@ -161,7 +161,7 @@ Both `steer()` and `followUp()` expand file-based prompt templates but error on
161
161
 
162
162
  ### Agent and AgentState
163
163
 
164
- The `Agent` class (from `@mariozechner/pi-agent-core`) handles the core LLM interaction. Access it via `session.agent`.
164
+ The `Agent` class (from `open-pi-agent`) handles the core LLM interaction. Access it via `session.agent`.
165
165
 
166
166
  ```typescript
167
167
  // Access current state
@@ -282,8 +282,8 @@ When you pass a custom `ResourceLoader`, `cwd` and `agentDir` no longer control
282
282
  ### Model
283
283
 
284
284
  ```typescript
285
- import { getModel } from "@mariozechner/pi-ai";
286
- import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent";
285
+ import { getModel } from "open-pi-ai";
286
+ import { AuthStorage, ModelRegistry } from "open-pi-coding-agent";
287
287
 
288
288
  const authStorage = AuthStorage.create();
289
289
  const modelRegistry = new ModelRegistry(authStorage);
@@ -330,7 +330,7 @@ API key resolution priority (handled by AuthStorage):
330
330
  4. Fallback resolver (for custom provider keys from `models.json`)
331
331
 
332
332
  ```typescript
333
- import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent";
333
+ import { AuthStorage, ModelRegistry } from "open-pi-coding-agent";
334
334
 
335
335
  // Default: uses ~/.pi/agent/auth.json and ~/.pi/agent/models.json
336
336
  const authStorage = AuthStorage.create();
@@ -366,7 +366,7 @@ const simpleRegistry = new ModelRegistry(authStorage);
366
366
  Use a `ResourceLoader` to override the system prompt:
367
367
 
368
368
  ```typescript
369
- import { createAgentSession, DefaultResourceLoader } from "@mariozechner/pi-coding-agent";
369
+ import { createAgentSession, DefaultResourceLoader } from "open-pi-coding-agent";
370
370
 
371
371
  const loader = new DefaultResourceLoader({
372
372
  systemPromptOverride: () => "You are a helpful assistant.",
@@ -386,7 +386,7 @@ import {
386
386
  readOnlyTools, // read, grep, find, ls
387
387
  readTool, bashTool, editTool, writeTool,
388
388
  grepTool, findTool, lsTool,
389
- } from "@mariozechner/pi-coding-agent";
389
+ } from "open-pi-coding-agent";
390
390
 
391
391
  // Use built-in tool set
392
392
  const { session } = await createAgentSession({
@@ -414,7 +414,7 @@ import {
414
414
  createGrepTool,
415
415
  createFindTool,
416
416
  createLsTool,
417
- } from "@mariozechner/pi-coding-agent";
417
+ } from "open-pi-coding-agent";
418
418
 
419
419
  const cwd = "/path/to/project";
420
420
 
@@ -444,7 +444,7 @@ const { session } = await createAgentSession({
444
444
 
445
445
  ```typescript
446
446
  import { Type } from "@sinclair/typebox";
447
- import { createAgentSession, type ToolDefinition } from "@mariozechner/pi-coding-agent";
447
+ import { createAgentSession, type ToolDefinition } from "open-pi-coding-agent";
448
448
 
449
449
  // Inline custom tool
450
450
  const myTool: ToolDefinition = {
@@ -475,7 +475,7 @@ Custom tools passed via `customTools` are combined with extension-registered too
475
475
  Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.pi/agent/extensions/`, `.pi/extensions/`, and settings.json extension sources.
476
476
 
477
477
  ```typescript
478
- import { createAgentSession, DefaultResourceLoader } from "@mariozechner/pi-coding-agent";
478
+ import { createAgentSession, DefaultResourceLoader } from "open-pi-coding-agent";
479
479
 
480
480
  const loader = new DefaultResourceLoader({
481
481
  additionalExtensionPaths: ["/path/to/my-extension.ts"],
@@ -497,7 +497,7 @@ Extensions can register tools, subscribe to events, add commands, and more. See
497
497
  **Event Bus:** Extensions can communicate via `pi.events`. Pass a shared `eventBus` to `DefaultResourceLoader` if you need to emit or listen from outside:
498
498
 
499
499
  ```typescript
500
- import { createEventBus, DefaultResourceLoader } from "@mariozechner/pi-coding-agent";
500
+ import { createEventBus, DefaultResourceLoader } from "open-pi-coding-agent";
501
501
 
502
502
  const eventBus = createEventBus();
503
503
  const loader = new DefaultResourceLoader({
@@ -517,7 +517,7 @@ import {
517
517
  createAgentSession,
518
518
  DefaultResourceLoader,
519
519
  type Skill,
520
- } from "@mariozechner/pi-coding-agent";
520
+ } from "open-pi-coding-agent";
521
521
 
522
522
  const customSkill: Skill = {
523
523
  name: "my-skill",
@@ -543,7 +543,7 @@ const { session } = await createAgentSession({ resourceLoader: loader });
543
543
  ### Context Files
544
544
 
545
545
  ```typescript
546
- import { createAgentSession, DefaultResourceLoader } from "@mariozechner/pi-coding-agent";
546
+ import { createAgentSession, DefaultResourceLoader } from "open-pi-coding-agent";
547
547
 
548
548
  const loader = new DefaultResourceLoader({
549
549
  agentsFilesOverride: (current) => ({
@@ -567,7 +567,7 @@ import {
567
567
  createAgentSession,
568
568
  DefaultResourceLoader,
569
569
  type PromptTemplate,
570
- } from "@mariozechner/pi-coding-agent";
570
+ } from "open-pi-coding-agent";
571
571
 
572
572
  const customCommand: PromptTemplate = {
573
573
  name: "deploy",
@@ -594,7 +594,7 @@ const { session } = await createAgentSession({ resourceLoader: loader });
594
594
  Sessions use a tree structure with `id`/`parentId` linking, enabling in-place branching.
595
595
 
596
596
  ```typescript
597
- import { createAgentSession, SessionManager } from "@mariozechner/pi-coding-agent";
597
+ import { createAgentSession, SessionManager } from "open-pi-coding-agent";
598
598
 
599
599
  // In-memory (no persistence)
600
600
  const { session } = await createAgentSession({
@@ -665,7 +665,7 @@ sm.createBranchedSession(leafId); // Extract path to new file
665
665
  ### Settings Management
666
666
 
667
667
  ```typescript
668
- import { createAgentSession, SettingsManager, SessionManager } from "@mariozechner/pi-coding-agent";
668
+ import { createAgentSession, SettingsManager, SessionManager } from "open-pi-coding-agent";
669
669
 
670
670
  // Default: loads from files (global + project merged)
671
671
  const { session } = await createAgentSession({
@@ -721,7 +721,7 @@ Use `DefaultResourceLoader` to discover extensions, skills, prompts, themes, and
721
721
  import {
722
722
  DefaultResourceLoader,
723
723
  getAgentDir,
724
- } from "@mariozechner/pi-coding-agent";
724
+ } from "open-pi-coding-agent";
725
725
 
726
726
  const loader = new DefaultResourceLoader({
727
727
  cwd,
@@ -762,7 +762,7 @@ interface LoadExtensionsResult {
762
762
  ## Complete Example
763
763
 
764
764
  ```typescript
765
- import { getModel } from "@mariozechner/pi-ai";
765
+ import { getModel } from "open-pi-ai";
766
766
  import { Type } from "@sinclair/typebox";
767
767
  import {
768
768
  AuthStorage,
@@ -774,7 +774,7 @@ import {
774
774
  readTool,
775
775
  bashTool,
776
776
  type ToolDefinition,
777
- } from "@mariozechner/pi-coding-agent";
777
+ } from "open-pi-coding-agent";
778
778
 
779
779
  // Set up auth storage (custom location)
780
780
  const authStorage = AuthStorage.create("/custom/agent/auth.json");
@@ -851,7 +851,7 @@ The SDK exports run mode utilities for building custom interfaces on top of `cre
851
851
  Full TUI interactive mode with editor, chat history, and all built-in commands:
852
852
 
853
853
  ```typescript
854
- import { createAgentSession, InteractiveMode } from "@mariozechner/pi-coding-agent";
854
+ import { createAgentSession, InteractiveMode } from "open-pi-coding-agent";
855
855
 
856
856
  const { session } = await createAgentSession({ /* ... */ });
857
857
 
@@ -872,7 +872,7 @@ await mode.run(); // Blocks until exit
872
872
  Single-shot mode: send prompts, output result, exit:
873
873
 
874
874
  ```typescript
875
- import { createAgentSession, runPrintMode } from "@mariozechner/pi-coding-agent";
875
+ import { createAgentSession, runPrintMode } from "open-pi-coding-agent";
876
876
 
877
877
  const { session } = await createAgentSession({ /* ... */ });
878
878
 
@@ -889,7 +889,7 @@ await runPrintMode(session, {
889
889
  JSON-RPC mode for subprocess integration:
890
890
 
891
891
  ```typescript
892
- import { createAgentSession, runRpcMode } from "@mariozechner/pi-coding-agent";
892
+ import { createAgentSession, runRpcMode } from "open-pi-coding-agent";
893
893
 
894
894
  const { session } = await createAgentSession({ /* ... */ });
895
895
 
package/docs/session.md CHANGED
@@ -34,7 +34,7 @@ Source on GitHub ([pi-mono](https://github.com/badlogic/pi-mono)):
34
34
  - [`packages/ai/src/types.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
35
35
  - [`packages/agent/src/types.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/agent/src/types.ts) - AgentMessage union type
36
36
 
37
- For TypeScript definitions in your project, inspect `node_modules/@mariozechner/pi-coding-agent/dist/` and `node_modules/@mariozechner/pi-ai/dist/`.
37
+ For TypeScript definitions in your project, inspect `node_modules/open-pi-coding-agent/dist/` and `node_modules/open-pi-ai/dist/`.
38
38
 
39
39
  ## Message Types
40
40
 
package/docs/termux.md CHANGED
@@ -17,7 +17,7 @@ pkg update && pkg upgrade
17
17
  pkg install nodejs termux-api git
18
18
 
19
19
  # Install pi
20
- npm install -g @mariozechner/pi-coding-agent
20
+ npm install -g open-pi-coding-agent
21
21
 
22
22
  # Create config directory
23
23
  mkdir -p ~/.pi/agent
package/docs/tui.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
6
6
 
7
- **Source:** [`@mariozechner/pi-tui`](https://github.com/badlogic/pi-mono/tree/main/packages/tui)
7
+ **Source:** [`open-pi-tui`](https://github.com/badlogic/pi-mono/tree/main/packages/tui)
8
8
 
9
9
  ## Component Interface
10
10
 
@@ -33,7 +33,7 @@ The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered lin
33
33
  Components that display a text cursor and need IME (Input Method Editor) support should implement the `Focusable` interface:
34
34
 
35
35
  ```typescript
36
- import { CURSOR_MARKER, type Component, type Focusable } from "@mariozechner/pi-tui";
36
+ import { CURSOR_MARKER, type Component, type Focusable } from "open-pi-tui";
37
37
 
38
38
  class MyInput implements Component, Focusable {
39
39
  focused: boolean = false; // Set by TUI when focus changes
@@ -59,7 +59,7 @@ This enables IME candidate windows to appear at the correct position for CJK inp
59
59
  When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child. Otherwise, the hardware cursor won't be positioned correctly for IME input.
60
60
 
61
61
  ```typescript
62
- import { Container, type Focusable, Input } from "@mariozechner/pi-tui";
62
+ import { Container, type Focusable, Input } from "open-pi-tui";
63
63
 
64
64
  class SearchDialog extends Container implements Focusable {
65
65
  private searchInput: Input;
@@ -179,10 +179,10 @@ See [overlay-qa-tests.ts](../examples/extensions/overlay-qa-tests.ts) for compre
179
179
 
180
180
  ## Built-in Components
181
181
 
182
- Import from `@mariozechner/pi-tui`:
182
+ Import from `open-pi-tui`:
183
183
 
184
184
  ```typescript
185
- import { Text, Box, Container, Spacer, Markdown } from "@mariozechner/pi-tui";
185
+ import { Text, Box, Container, Spacer, Markdown } from "open-pi-tui";
186
186
  ```
187
187
 
188
188
  ### Text
@@ -264,7 +264,7 @@ const image = new Image(
264
264
  Use `matchesKey()` for key detection:
265
265
 
266
266
  ```typescript
267
- import { matchesKey, Key } from "@mariozechner/pi-tui";
267
+ import { matchesKey, Key } from "open-pi-tui";
268
268
 
269
269
  handleInput(data: string) {
270
270
  if (matchesKey(data, Key.up)) {
@@ -290,7 +290,7 @@ handleInput(data: string) {
290
290
  **Critical:** Each line from `render()` must not exceed the `width` parameter.
291
291
 
292
292
  ```typescript
293
- import { visibleWidth, truncateToWidth } from "@mariozechner/pi-tui";
293
+ import { visibleWidth, truncateToWidth } from "open-pi-tui";
294
294
 
295
295
  render(width: number): string[] {
296
296
  // Truncate long lines
@@ -311,7 +311,7 @@ Example: Interactive selector
311
311
  import {
312
312
  matchesKey, Key,
313
313
  truncateToWidth, visibleWidth
314
- } from "@mariozechner/pi-tui";
314
+ } from "open-pi-tui";
315
315
 
316
316
  class MySelector {
317
317
  private items: string[];
@@ -425,8 +425,8 @@ renderResult(result, options, theme) {
425
425
  **For Markdown**, use `getMarkdownTheme()`:
426
426
 
427
427
  ```typescript
428
- import { getMarkdownTheme } from "@mariozechner/pi-coding-agent";
429
- import { Markdown } from "@mariozechner/pi-tui";
428
+ import { getMarkdownTheme } from "open-pi-coding-agent";
429
+ import { Markdown } from "open-pi-tui";
430
430
 
431
431
  renderResult(result, options, theme) {
432
432
  const mdTheme = getMarkdownTheme();
@@ -587,12 +587,12 @@ These patterns cover the most common UI needs in extensions. **Copy these patter
587
587
 
588
588
  ### Pattern 1: Selection Dialog (SelectList)
589
589
 
590
- For letting users pick from a list of options. Use `SelectList` from `@mariozechner/pi-tui` with `DynamicBorder` for framing.
590
+ For letting users pick from a list of options. Use `SelectList` from `open-pi-tui` with `DynamicBorder` for framing.
591
591
 
592
592
  ```typescript
593
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
594
- import { DynamicBorder } from "@mariozechner/pi-coding-agent";
595
- import { Container, type SelectItem, SelectList, Text } from "@mariozechner/pi-tui";
593
+ import type { ExtensionAPI } from "open-pi-coding-agent";
594
+ import { DynamicBorder } from "open-pi-coding-agent";
595
+ import { Container, type SelectItem, SelectList, Text } from "open-pi-tui";
596
596
 
597
597
  pi.registerCommand("pick", {
598
598
  handler: async (_args, ctx) => {
@@ -650,7 +650,7 @@ pi.registerCommand("pick", {
650
650
  For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
651
651
 
652
652
  ```typescript
653
- import { BorderedLoader } from "@mariozechner/pi-coding-agent";
653
+ import { BorderedLoader } from "open-pi-coding-agent";
654
654
 
655
655
  pi.registerCommand("fetch", {
656
656
  handler: async (_args, ctx) => {
@@ -679,11 +679,11 @@ pi.registerCommand("fetch", {
679
679
 
680
680
  ### Pattern 3: Settings/Toggles (SettingsList)
681
681
 
682
- For toggling multiple settings. Use `SettingsList` from `@mariozechner/pi-tui` with `getSettingsListTheme()`.
682
+ For toggling multiple settings. Use `SettingsList` from `open-pi-tui` with `getSettingsListTheme()`.
683
683
 
684
684
  ```typescript
685
- import { getSettingsListTheme } from "@mariozechner/pi-coding-agent";
686
- import { Container, type SettingItem, SettingsList, Text } from "@mariozechner/pi-tui";
685
+ import { getSettingsListTheme } from "open-pi-coding-agent";
686
+ import { Container, type SettingItem, SettingsList, Text } from "open-pi-tui";
687
687
 
688
688
  pi.registerCommand("settings", {
689
689
  handler: async (_args, ctx) => {
@@ -792,8 +792,8 @@ Token stats available via `ctx.sessionManager.getBranch()` and `ctx.model`.
792
792
  Replace the main input editor with a custom implementation. Useful for modal editing (vim), different keybindings (emacs), or specialized input handling.
793
793
 
794
794
  ```typescript
795
- import { CustomEditor, type ExtensionAPI } from "@mariozechner/pi-coding-agent";
796
- import { matchesKey, truncateToWidth } from "@mariozechner/pi-tui";
795
+ import { CustomEditor, type ExtensionAPI } from "open-pi-coding-agent";
796
+ import { matchesKey, truncateToWidth } from "open-pi-tui";
797
797
 
798
798
  type Mode = "normal" | "insert";
799
799
 
@@ -134,7 +134,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
134
134
  See [docs/extensions.md](../../docs/extensions.md) for full documentation.
135
135
 
136
136
  ```typescript
137
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
137
+ import type { ExtensionAPI } from "open-pi-coding-agent";
138
138
  import { Type } from "@sinclair/typebox";
139
139
 
140
140
  export default function (pi: ExtensionAPI) {
@@ -176,7 +176,7 @@ export default function (pi: ExtensionAPI) {
176
176
 
177
177
  **Use StringEnum for string parameters** (required for Google API compatibility):
178
178
  ```typescript
179
- import { StringEnum } from "@mariozechner/pi-ai";
179
+ import { StringEnum } from "open-pi-ai";
180
180
 
181
181
  // Good
182
182
  action: StringEnum(["list", "add"] as const)
@@ -30,9 +30,9 @@ import { existsSync, readFileSync } from "node:fs";
30
30
  import { mkdir, writeFile } from "node:fs/promises";
31
31
  import { homedir } from "node:os";
32
32
  import { join } from "node:path";
33
+ import { type Static, Type } from "@sinclair/typebox";
33
34
  import { StringEnum } from "open-pi-ai";
34
35
  import type { ExtensionAPI } from "open-pi-coding-agent";
35
- import { type Static, Type } from "@sinclair/typebox";
36
36
 
37
37
  const PROVIDER = "google-antigravity";
38
38
 
@@ -8,8 +8,8 @@
8
8
  * npx tsx test.ts claude-sonnet-4-5-20250929 --thinking
9
9
  */
10
10
 
11
- import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "open-pi-ai";
12
11
  import { readFileSync } from "fs";
12
+ import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "open-pi-ai";
13
13
  import { homedir } from "os";
14
14
  import { join } from "path";
15
15
  import { MODELS, streamGitLabDuo } from "./index.js";
@@ -7,8 +7,8 @@
7
7
  * - Registers additional tools at runtime via /add-echo-tool <name>
8
8
  */
9
9
 
10
- import type { ExtensionAPI } from "open-pi-coding-agent";
11
10
  import { Type } from "@sinclair/typebox";
11
+ import type { ExtensionAPI } from "open-pi-coding-agent";
12
12
 
13
13
  const ECHO_PARAMS = Type.Object({
14
14
  message: Type.String({ description: "Message to echo" }),
@@ -19,10 +19,10 @@
19
19
  * /overlay-streaming - Multiple input panels with simulated streaming (Tab to cycle focus)
20
20
  */
21
21
 
22
+ import { spawn } from "child_process";
22
23
  import type { ExtensionAPI, ExtensionCommandContext, Theme } from "open-pi-coding-agent";
23
24
  import type { Component, OverlayAnchor, OverlayHandle, OverlayOptions, TUI } from "open-pi-tui";
24
25
  import { matchesKey, truncateToWidth, visibleWidth } from "open-pi-tui";
25
- import { spawn } from "child_process";
26
26
 
27
27
  // Global handle for toggle demo (in real code, use a more elegant pattern)
28
28
  let globalToggleHandle: OverlayHandle | null = null;
@@ -4,9 +4,9 @@
4
4
  * Escape in editor returns to options, Escape in options cancels
5
5
  */
6
6
 
7
+ import { Type } from "@sinclair/typebox";
7
8
  import type { ExtensionAPI } from "open-pi-coding-agent";
8
9
  import { Editor, type EditorTheme, Key, matchesKey, Text, truncateToWidth } from "open-pi-tui";
9
- import { Type } from "@sinclair/typebox";
10
10
 
11
11
  interface OptionWithDesc {
12
12
  label: string;