@oh-my-pi/pi-coding-agent 5.7.69 → 6.0.0

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
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [6.0.0] - 2026-01-19
6
+
7
+ ### Added
8
+
9
+ - Added Cursor and OpenAI Codex OAuth providers
10
+ - Added Windows installer bash shell auto-configuration
11
+ - Added dedicated TTSR settings tab (separated from Voice/TTS)
12
+
13
+ ### Fixed
14
+
15
+ - Fixed TTSR abbreviation expansion from TTSR to Time Traveling Stream Rules
16
+
17
+ ## [5.8.0] - 2026-01-19
18
+ ### Changed
19
+
20
+ - Updated WASM loading to use streaming for development environments with base64 fallback
21
+ - Added scripts directory to published package files
22
+
5
23
  ## [5.7.68] - 2026-01-18
6
24
  ### Changed
7
25
 
package/README.md CHANGED
@@ -57,24 +57,23 @@ npm install -g @oh-my-pi/pi-coding-agent
57
57
 
58
58
  **Standalone binary:**
59
59
 
60
- Download from [GitHub Releases](https://github.com/badlogic/pi-mono/releases):
60
+ Download from [GitHub Releases](https://github.com/can1357/oh-my-pi/releases):
61
61
 
62
- | Platform | Archive |
62
+ | Platform | Binary |
63
63
  | ------------------- | ------------------------ |
64
- | macOS Apple Silicon | `omp-darwin-arm64.tar.gz` |
65
- | macOS Intel | `omp-darwin-x64.tar.gz` |
66
- | Linux x64 | `omp-linux-x64.tar.gz` |
67
- | Linux ARM64 | `omp-linux-arm64.tar.gz` |
68
- | Windows x64 | `omp-windows-x64.zip` |
64
+ | macOS Apple Silicon | `omp-darwin-arm64` |
65
+ | macOS Intel | `omp-darwin-x64` |
66
+ | Linux x64 | `omp-linux-x64` |
67
+ | Linux ARM64 | `omp-linux-arm64` |
68
+ | Windows x64 | `omp-windows-x64.exe` |
69
69
 
70
70
  ```bash
71
71
  # macOS/Linux
72
- tar -xzf omp-darwin-arm64.tar.gz
73
- ./omp
72
+ chmod +x omp-darwin-arm64
73
+ ./omp-darwin-arm64
74
74
 
75
75
  # Windows
76
- unzip omp-windows-x64.zip
77
- omp.exe
76
+ omp-windows-x64.exe
78
77
  ```
79
78
 
80
79
  **macOS note:** The binary is unsigned. If blocked, run: `xattr -c ./omp`
@@ -133,24 +132,7 @@ return config
133
132
 
134
133
  ### API Keys & OAuth
135
134
 
136
- **Option 1: Auth file** (recommended)
137
-
138
- Add API keys to `~/.omp/agent/auth.json`:
139
-
140
- ```json
141
- {
142
- "anthropic": [
143
- { "type": "api_key", "key": "sk-ant-..." },
144
- { "type": "api_key", "key": "sk-ant-..." }
145
- ],
146
- "openai": { "type": "api_key", "key": "sk-..." },
147
- "google": { "type": "api_key", "key": "..." }
148
- }
149
-
150
- If a provider has multiple credentials, new sessions round robin across them and stay sticky per session.
151
- ```
152
-
153
- **Option 2: Environment variables**
135
+ **Option 1: Environment variables** (recommended)
154
136
 
155
137
  | Provider | Auth Key | Environment Variable |
156
138
  | ---------- | ------------ | -------------------- |
@@ -164,16 +146,16 @@ If a provider has multiple credentials, new sessions round robin across them and
164
146
  | OpenRouter | `openrouter` | `OPENROUTER_API_KEY` |
165
147
  | ZAI | `zai` | `ZAI_API_KEY` |
166
148
 
167
- Auth file keys take priority over environment variables.
168
-
169
- **OAuth Providers:**
149
+ **Option 2: OAuth**
170
150
 
171
151
  Use `/login` to authenticate with subscription-based or free-tier providers:
172
152
 
173
153
  | Provider | Models | Cost |
174
154
  | -------------------------- | ----------------------------------------------- | --------------------- |
175
155
  | Anthropic (Claude Pro/Max) | Claude models via your subscription | Subscription |
156
+ | Cursor | Claude, GPT-4o via Cursor Pro subscription | Subscription |
176
157
  | GitHub Copilot | GPT-4o, Claude, Gemini via Copilot subscription | Subscription |
158
+ | OpenAI Codex | o3, o4-mini via ChatGPT Plus/Pro subscription | Subscription |
177
159
  | Google Gemini CLI | Gemini 2.0/2.5 models | Free (Google account) |
178
160
  | Google Antigravity | Gemini 3, Claude, GPT-OSS | Free (Google account) |
179
161
 
@@ -182,7 +164,7 @@ omp
182
164
  /login # Select provider, authorize in browser
183
165
  ```
184
166
 
185
- **Note:** `/login` replaces any existing API keys for that provider with OAuth credentials in `auth.json`. If OAuth credentials already exist, `/login` appends another entry.
167
+ **Note:** `/login` replaces any existing API keys for that provider with OAuth credentials. If OAuth credentials already exist, `/login` appends another entry.
186
168
 
187
169
  **GitHub Copilot notes:**
188
170
 
@@ -196,7 +178,7 @@ omp
196
178
  - Both are free with any Google account, subject to rate limits
197
179
  - Paid Cloud Code Assist subscriptions: set `GOOGLE_CLOUD_PROJECT` or `GOOGLE_CLOUD_PROJECT_ID` env var to your project ID
198
180
 
199
- Credentials stored in `~/.omp/agent/auth.json`. Use `/logout` to clear.
181
+ Credentials stored in `~/.omp/agent/agent.db`. Use `/logout` to clear.
200
182
 
201
183
  ### Quick Start
202
184
 
@@ -281,10 +263,10 @@ The agent reads, writes, and edits files, and executes commands via bash.
281
263
  | Ctrl+D | Exit (when editor is empty) |
282
264
  | Ctrl+Z | Suspend to background (use `fg` in shell to resume) |
283
265
  | Shift+Tab | Cycle thinking level |
284
- | Ctrl+P / Shift+Ctrl+P | Cycle models forward/backward (scoped by `--models`) |
266
+ | Ctrl+P / Shift+Ctrl+P | Cycle role models (slow/default/smol) |
285
267
  | Ctrl+L | Open model selector |
286
268
  | Ctrl+O | Toggle tool output expansion |
287
- | Ctrl+T | Toggle thinking block visibility |
269
+ | Ctrl+T | Toggle todo list expansion |
288
270
  | Ctrl+G | Edit message in external editor (`$VISUAL` or `$EDITOR`) |
289
271
 
290
272
  ### Bash Mode
@@ -489,7 +471,7 @@ Add custom models (Ollama, vLLM, LM Studio, etc.) via `~/.omp/agent/models.json`
489
471
  }
490
472
  ```
491
473
 
492
- **Supported APIs:** `openai-completions`, `openai-responses`, `anthropic-messages`, `google-generative-ai`
474
+ **Supported APIs:** `openai-completions`, `openai-responses`, `openai-codex-responses`, `anthropic-messages`, `google-generative-ai`, `google-vertex`
493
475
 
494
476
  **API key resolution:** The `apiKey` field is checked as environment variable name first, then used as literal value.
495
477
 
@@ -523,7 +505,6 @@ Add custom models (Ollama, vLLM, LM Studio, etc.) via `~/.omp/agent/models.json`
523
505
  | `supportsStore` | Whether provider supports `store` field |
524
506
  | `supportsDeveloperRole` | Use `developer` vs `system` role |
525
507
  | `supportsReasoningEffort` | Support for `reasoning_effort` parameter |
526
- | `supportsUsageInStreaming` | Whether provider supports `stream_options: { include_usage: true }`. Default: `true` |
527
508
  | `maxTokensField` | Use `max_completion_tokens` or `max_tokens` |
528
509
 
529
510
  **Live reload:** The file reloads each time you open `/model`. Edit during session; no restart needed.
@@ -552,8 +533,9 @@ Global `~/.omp/agent/settings.json` stores persistent preferences:
552
533
  ```json
553
534
  {
554
535
  "theme": "dark",
555
- "defaultProvider": "anthropic",
556
- "defaultModel": "claude-sonnet-4-20250514",
536
+ "modelRoles": {
537
+ "default": "anthropic/claude-sonnet-4-20250514"
538
+ },
557
539
  "defaultThinkingLevel": "medium",
558
540
  "enabledModels": ["anthropic/*", "*gpt*", "gemini-2.5-pro:high"],
559
541
  "queueMode": "one-at-a-time",
@@ -575,22 +557,19 @@ Global `~/.omp/agent/settings.json` stores persistent preferences:
575
557
  },
576
558
  "terminal": {
577
559
  "showImages": true
578
- },
579
- "hooks": ["/path/to/hook.ts"],
580
- "customTools": ["/path/to/tool.ts"]
560
+ }
581
561
  }
582
562
  ```
583
563
 
584
564
  | Setting | Description | Default |
585
565
  | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------- |
586
566
  | `theme` | Color theme name | auto-detected |
587
- | `defaultProvider` | Default model provider | - |
588
- | `defaultModel` | Default model ID | - |
567
+ | `modelRoles` | Model assignments by role (e.g., `{"default": "anthropic/claude-sonnet-4-20250514", "slow": "...", "smol": "..."}`) | - |
589
568
  | `defaultThinkingLevel` | Thinking level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh` | - |
590
569
  | `enabledModels` | Model patterns for cycling. Supports glob patterns (`github-copilot/*`, `*sonnet*`) and fuzzy matching. Same as `--models` CLI flag | - |
591
570
  | `queueMode` | Message queue mode: `all` or `one-at-a-time` | `one-at-a-time` |
592
571
  | `shellPath` | Custom bash path (Windows) | auto-detected |
593
- | `hideThinkingBlock` | Hide thinking blocks in output (Ctrl+T to toggle) | `false` |
572
+ | `hideThinkingBlock` | Hide thinking blocks in output | `false` |
594
573
  | `collapseChangelog` | Show condensed changelog after update | `false` |
595
574
  | `compaction.enabled` | Enable auto-compaction | `true` |
596
575
  | `compaction.reserveTokens` | Tokens to reserve before compaction triggers | `16384` |
@@ -600,8 +579,6 @@ Global `~/.omp/agent/settings.json` stores persistent preferences:
600
579
  | `retry.maxRetries` | Maximum retry attempts | `3` |
601
580
  | `retry.baseDelayMs` | Base delay for exponential backoff | `2000` |
602
581
  | `terminal.showImages` | Render images inline (supported terminals) | `true` |
603
- | `hooks` | Additional hook file paths | `[]` |
604
- | `customTools` | Additional custom tool file paths | `[]` |
605
582
 
606
583
  ---
607
584
 
@@ -685,10 +662,10 @@ A skill provides specialized workflows, setup instructions, helper scripts, and
685
662
 
686
663
  **Skill locations:**
687
664
 
688
- - Omp user: `~/.omp/agent/skills/**/SKILL.md` (recursive)
689
- - Omp project: `.omp/skills/**/SKILL.md` (recursive)
665
+ - Omp user: `~/.omp/agent/skills/*/SKILL.md`
666
+ - Omp project: `.omp/skills/*/SKILL.md`
690
667
  - Claude Code: `~/.claude/skills/*/SKILL.md` and `.claude/skills/*/SKILL.md`
691
- - Codex CLI: `~/.codex/skills/**/SKILL.md` (recursive)
668
+ - Codex CLI: `~/.codex/skills/*/SKILL.md`
692
669
 
693
670
  **Format:**
694
671
 
@@ -733,8 +710,8 @@ Hooks are TypeScript modules that extend omp's behavior by subscribing to lifecy
733
710
 
734
711
  **Hook locations:**
735
712
 
736
- - Global: `~/.omp/agent/hooks/*.ts`
737
- - Project: `.omp/hooks/*.ts`
713
+ - Global: `~/.omp/agent/hooks/pre/*.ts`, `~/.omp/agent/hooks/post/*.ts`
714
+ - Project: `.omp/hooks/pre/*.ts`, `.omp/hooks/post/*.ts`
738
715
  - CLI: `--hook <path>` (for debugging)
739
716
 
740
717
  **Quick example** (permission gate):
@@ -849,7 +826,7 @@ omp [options] [@files...] [messages...]
849
826
 
850
827
  | Option | Description |
851
828
  | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
852
- | `--provider <name>` | Provider: `anthropic`, `openai`, `google`, `mistral`, `xai`, `groq`, `cerebras`, `openrouter`, `zai`, `github-copilot`, `google-gemini-cli`, `google-antigravity`, or custom |
829
+ | `--provider <name>` | Provider: `anthropic`, `openai`, `google`, `mistral`, `xai`, `groq`, `cerebras`, `openrouter`, `zai`, `cursor`, `github-copilot`, `openai-codex`, `google-gemini-cli`, `google-antigravity`, or custom |
853
830
  | `--model <id>` | Model ID |
854
831
  | `--api-key <key>` | API key (overrides environment) |
855
832
  | `--system-prompt <text\|file>` | Custom system prompt (text or file path) |
@@ -861,14 +838,16 @@ omp [options] [@files...] [messages...]
861
838
  | `--session-dir <dir>` | Directory for session storage and lookup |
862
839
  | `--continue`, `-c` | Continue most recent session |
863
840
  | `--resume`, `-r` | Select session to resume |
864
- | `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling. Supports glob patterns (e.g., `anthropic/*`, `*sonnet*:high`) and fuzzy matching (e.g., `sonnet,haiku:low`) |
841
+ | `--models <patterns>` | Comma-separated patterns for model role cycling. Supports glob patterns (e.g., `anthropic/*`, `*sonnet*:high`) and fuzzy matching (e.g., `sonnet,haiku:low`) |
865
842
  | `--no-tools` | Disable all built-in tools |
866
- | `--tools <tools>` | Comma-separated tool list (default: `read,bash,edit,write`) |
867
- | `--thinking <level>` | Thinking level: `off`, `minimal`, `low`, `medium`, `high` |
843
+ | `--tools <tools>` | Restrict to comma-separated tool list (default: all tools enabled) |
844
+ | `--thinking <level>` | Thinking level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
868
845
  | `--extension <path>`, `-e` | Load an extension file (can be used multiple times) |
869
846
  | `--no-extensions` | Disable extension discovery (explicit `-e` paths still work) |
870
847
  | `--no-skills` | Disable skills discovery and loading |
871
848
  | `--skills <patterns>` | Comma-separated glob patterns to filter skills (e.g., `git-*,docker`) |
849
+ | `--no-lsp` | Disable LSP integration |
850
+ | `--hook <path>` | Load a hook file (for debugging) |
872
851
  | `--export <file> [output]` | Export session to HTML |
873
852
  | `--help`, `-h` | Show help |
874
853
  | `--version`, `-v` | Show version |
@@ -930,34 +909,40 @@ omp --export session.jsonl output.html
930
909
  | Variable | Description |
931
910
  |----------|-------------|
932
911
  | `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, etc. | API keys for providers (see [API Keys & OAuth](#api-keys--oauth)) |
933
- | `PI_CODING_AGENT_DIR` | Override the agent config directory (default: `~/.omp/agent`) |
934
- | `PI_SKIP_VERSION_CHECK` | Skip new version check at startup (useful for Nix or other package manager installs) |
912
+ | `OMP_CODING_AGENT_DIR` | Override the agent config directory (default: `~/.omp/agent`) |
935
913
  | `VISUAL`, `EDITOR` | External editor for Ctrl+G (e.g., `vim`, `code --wait`) |
936
914
 
937
915
  ---
938
916
 
939
917
  ## Tools
940
918
 
941
- ### Default Tools
919
+ All tools are enabled by default. Use `--tools <list>` to restrict to a subset.
942
920
 
943
- | Tool | Description |
944
- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
945
- | `read` | Read file contents. Images sent as attachments. Text: first 2000 lines, lines truncated at 2000 chars. Use offset/limit for large files. |
946
- | `write` | Write/overwrite file. Creates parent directories. |
947
- | `edit` | Replace exact text in file. Must match exactly including whitespace. Fails if text appears multiple times or not found. |
948
- | `bash` | Execute command. Returns stdout/stderr. Optional `timeout` parameter. |
921
+ ### Core Tools
949
922
 
950
- ### Read-Only Tools
923
+ | Tool | Description |
924
+ | ------- | --------------------------------------------------------------------------------------------------------------- |
925
+ | `read` | Read file contents. Images sent as attachments. Text: first 2000 lines. Use offset/limit for large files. |
926
+ | `write` | Write/overwrite file. Creates parent directories. |
927
+ | `edit` | Replace text in file with fuzzy whitespace matching. Fails if text appears multiple times or not found. |
928
+ | `bash` | Execute command. Returns stdout/stderr. Optional `timeout` parameter. |
929
+ | `grep` | Search file contents (regex or literal). Respects `.gitignore`. |
930
+ | `find` | Search for files by glob pattern. Respects `.gitignore`. |
931
+ | `ls` | List directory contents. Includes dotfiles. |
951
932
 
952
- Available via `--tools` flag:
933
+ ### Additional Built-in Tools
953
934
 
954
- | Tool | Description |
955
- | ------ | --------------------------------------------------------------- |
956
- | `grep` | Search file contents (regex or literal). Respects `.gitignore`. |
957
- | `find` | Search for files by glob pattern. Respects `.gitignore`. |
958
- | `ls` | List directory contents. Includes dotfiles. |
935
+ | Tool | Description |
936
+ | ------------- | ----------------------------------------------------- |
937
+ | `task` | Spawn sub-agents for complex multi-step tasks |
938
+ | `lsp` | Language Server Protocol queries (go-to-definition, references, hover) |
939
+ | `todo_write` | Track task progress during sessions |
940
+ | `web_search` | Search the web |
941
+ | `web_fetch` | Fetch and render URLs |
942
+ | `python` | Execute Python code in IPython kernel |
943
+ | `notebook` | Edit Jupyter notebook cells |
959
944
 
960
- Example: `--tools read,grep,find,ls` for code review without modification.
945
+ Example: `--tools read,grep,find,ls` for read-only code review.
961
946
 
962
947
  For adding new tools, see [Custom Tools](#custom-tools) in the Configuration section.
963
948
 
@@ -972,8 +957,8 @@ For embedding omp in Node.js/TypeScript applications, use the SDK:
972
957
  ```typescript
973
958
  import { createAgentSession, discoverAuthStorage, discoverModels, SessionManager } from "@oh-my-pi/pi-coding-agent";
974
959
 
975
- const authStorage = discoverAuthStorage();
976
- const modelRegistry = discoverModels(authStorage);
960
+ const authStorage = await discoverAuthStorage();
961
+ const modelRegistry = await discoverModels(authStorage);
977
962
 
978
963
  const { session } = await createAgentSession({
979
964
  sessionManager: SessionManager.inMemory(),
@@ -1035,21 +1020,15 @@ Works with both session files and streaming event logs from `--mode json`.
1035
1020
 
1036
1021
  ## Philosophy
1037
1022
 
1038
- Omp is opinionated about what it won't do. These are intentional design decisions to minimize context bloat and avoid anti-patterns.
1039
-
1040
- **No MCP.** Build CLI tools with READMEs (see [Skills](#skills)). The agent reads them on demand. [Would you like to know more?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
1041
-
1042
- **No sub-agents.** Spawn omp instances via tmux, or [build your own sub-agent tool](examples/custom-tools/subagent/) with [custom tools](#custom-tools). Full observability and steerability.
1043
-
1044
- **No permission popups.** Security theater. Run in a container or build your own with [Hooks](#hooks).
1023
+ Omp is a fork of [Pi](https://github.com/badlogic/pi) by [Mario Zechner](https://github.com/badlogic). Pi is intentionally minimal—no MCP, no sub-agents, no built-in todos. Omp is the opposite: batteries included.
1045
1024
 
1046
- **No plan mode.** Gather context in one session, write plans to file, start fresh for implementation.
1025
+ **Yin to Pi's Yang.** Same foundation, different philosophy. Pi strips away; omp adds on. Both are valid approaches—pick what fits your workflow.
1047
1026
 
1048
- **No built-in to-dos.** They confuse models. Use a TODO.md file, or [build your own](examples/custom-tools/todo/) with [custom tools](#custom-tools).
1027
+ **Full toolset by default.** Sub-agents, MCP, LSP, web search, Python execution, todo tracking—all enabled out of the box. Use `--tools` to restrict when needed.
1049
1028
 
1050
- **No background bash.** Use tmux. Full observability, direct interaction.
1029
+ **Agent orchestration built-in.** The Task tool spawns specialized sub-agents (explore, plan, reviewer, task) for complex multi-step work. Parallelism and delegation, not just chat.
1051
1030
 
1052
- Read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/) for the full rationale.
1031
+ **Multiple extension points.** [Skills](#skills) for on-demand capabilities, [Hooks](#hooks) for lifecycle control, [Custom Tools](#custom-tools) for new abilities, MCP for existing integrations.
1053
1032
 
1054
1033
  ---
1055
1034
 
@@ -1074,10 +1053,10 @@ Change `name`, `configDir`, and `bin` field for your fork. Affects CLI banner, c
1074
1053
 
1075
1054
  Three execution modes: npm install, standalone binary, tsx from source.
1076
1055
 
1077
- **Always use `src/paths.ts`** for package assets:
1056
+ **Always use `src/config.ts`** for package assets:
1078
1057
 
1079
1058
  ```typescript
1080
- import { getPackageDir, getThemeDir } from "./paths.js";
1059
+ import { getPackageDir } from "./config.js";
1081
1060
  ```
1082
1061
 
1083
1062
  Never use `__dirname` directly for package assets.
@@ -1096,5 +1075,5 @@ MIT
1096
1075
 
1097
1076
  ## See Also
1098
1077
 
1099
- - [@oh-my-pi/omp-ai](https://www.npmjs.com/package/@oh-my-pi/omp-ai): Core LLM toolkit
1100
- - [@oh-my-pi/omp-agent](https://www.npmjs.com/package/@oh-my-pi/omp-agent): Agent framework
1078
+ - [@oh-my-pi/pi-ai](https://www.npmjs.com/package/@oh-my-pi/pi-ai): Core LLM toolkit
1079
+ - [@oh-my-pi/pi-agent-core](https://www.npmjs.com/package/@oh-my-pi/pi-agent-core): Agent framework
package/docs/sdk.md CHANGED
@@ -20,8 +20,8 @@ See [examples/sdk/](../examples/sdk/) for working examples from minimal to full
20
20
  import { createAgentSession, discoverAuthStorage, discoverModels, SessionManager } from "@oh-my-pi/pi-coding-agent";
21
21
 
22
22
  // Set up credential storage and model registry
23
- const authStorage = discoverAuthStorage();
24
- const modelRegistry = discoverModels(authStorage);
23
+ const authStorage = await discoverAuthStorage();
24
+ const modelRegistry = await discoverModels(authStorage);
25
25
 
26
26
  const { session } = await createAgentSession({
27
27
  sessionManager: SessionManager.inMemory(),
@@ -251,8 +251,8 @@ const { session } = await createAgentSession({
251
251
  import { getModel } from "@oh-my-pi/pi-ai";
252
252
  import { discoverAuthStorage, discoverModels } from "@oh-my-pi/pi-coding-agent";
253
253
 
254
- const authStorage = discoverAuthStorage();
255
- const modelRegistry = discoverModels(authStorage);
254
+ const authStorage = await discoverAuthStorage();
255
+ const modelRegistry = await discoverModels(authStorage);
256
256
 
257
257
  // Find specific built-in model (doesn't check if API key exists)
258
258
  const opus = getModel("anthropic", "claude-opus-4-5");
@@ -301,8 +301,8 @@ API key resolution priority (handled by AuthStorage):
301
301
  import { AuthStorage, ModelRegistry, discoverAuthStorage, discoverModels } from "@oh-my-pi/pi-coding-agent";
302
302
 
303
303
  // Default: uses ~/.omp/agent/auth.json and ~/.omp/agent/models.json
304
- const authStorage = discoverAuthStorage();
305
- const modelRegistry = discoverModels(authStorage);
304
+ const authStorage = await discoverAuthStorage();
305
+ const modelRegistry = await discoverModels(authStorage);
306
306
 
307
307
  const { session } = await createAgentSession({
308
308
  sessionManager: SessionManager.inMemory(),
@@ -742,8 +742,8 @@ import {
742
742
  } from "@oh-my-pi/pi-coding-agent";
743
743
 
744
744
  // Auth and Models
745
- const authStorage = discoverAuthStorage(); // ~/.omp/agent/auth.json
746
- const modelRegistry = discoverModels(authStorage); // + ~/.omp/agent/models.json
745
+ const authStorage = await discoverAuthStorage(); // ~/.omp/agent/agent.db
746
+ const modelRegistry = await discoverModels(authStorage); // + ~/.omp/agent/models.json
747
747
  const allModels = modelRegistry.getAll(); // All models (built-in + custom)
748
748
  const available = await modelRegistry.getAvailable(); // Only models with API keys
749
749
  const model = modelRegistry.find("provider", "id"); // Find specific model
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-coding-agent",
3
- "version": "5.7.69",
3
+ "version": "6.0.0",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "ompConfig": {
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "files": [
26
26
  "src",
27
+ "scripts",
27
28
  "docs",
28
29
  "examples",
29
30
  "CHANGELOG.md"
@@ -33,17 +34,16 @@
33
34
  "clean": "rm -rf dist",
34
35
  "build": "tsgo -p tsconfig.build.json && chmod +x dist/cli.js",
35
36
  "build:binary": "bun run generate-wasm-b64 && bun build --compile ./src/cli.ts --outfile dist/omp",
36
- "generate-wasm-b64": "bun scripts/generate-wasm-b64.ts",
37
37
  "generate-template": "bun scripts/generate-template.ts",
38
- "postinstall": "[ -f scripts/generate-wasm-b64.ts ] && bun run generate-wasm-b64 && bun run generate-template || true",
38
+ "postinstall": "bun run generate-template || true",
39
39
  "test": "bun test",
40
40
  "prepublishOnly": "bun run generate-template && bun run clean && bun run build"
41
41
  },
42
42
  "dependencies": {
43
- "@oh-my-pi/pi-agent-core": "5.7.69",
44
- "@oh-my-pi/pi-ai": "5.7.69",
45
- "@oh-my-pi/pi-git-tool": "5.7.69",
46
- "@oh-my-pi/pi-tui": "5.7.69",
43
+ "@oh-my-pi/pi-agent-core": "6.0.0",
44
+ "@oh-my-pi/pi-ai": "6.0.0",
45
+ "@oh-my-pi/pi-git-tool": "6.0.0",
46
+ "@oh-my-pi/pi-tui": "6.0.0",
47
47
  "@openai/agents": "^0.3.7",
48
48
  "@sinclair/typebox": "^0.34.46",
49
49
  "ajv": "^8.17.1",
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * Pre-compute the HTML template at publish time.
4
+ * This avoids the Bun macro restriction in node_modules.
5
+ */
6
+
7
+ const dir = new URL("../src/core/export-html/", import.meta.url).pathname;
8
+
9
+ // Read all files
10
+ const html = await Bun.file(`${dir}template.html`).text();
11
+ const css = await Bun.file(`${dir}template.css`).text();
12
+ const js = await Bun.file(`${dir}template.js`).text();
13
+
14
+ // Minify CSS
15
+ const minifiedCss = css
16
+ .replace(/\/\*[\s\S]*?\*\//g, "")
17
+ .replace(/\s+/g, " ")
18
+ .replace(/\s*([{}:;,])\s*/g, "$1")
19
+ .trim();
20
+
21
+ // Inline everything
22
+ const template = html
23
+ .replace("<template-css/>", `<style>${minifiedCss}</style>`)
24
+ .replace("<template-js/>", `<script>${js}</script>`);
25
+
26
+ // Write generated file
27
+ const output = `// Auto-generated by scripts/generate-template.ts - DO NOT EDIT
28
+ export const TEMPLATE = ${JSON.stringify(template)};
29
+ `;
30
+
31
+ await Bun.write(`${dir}template.generated.ts`, output);
32
+ console.log("Generated template.generated.ts");
@@ -0,0 +1,93 @@
1
+ #!/bin/bash
2
+ #
3
+ # Migrate sessions from ~/.omp/agent/*.jsonl to proper session directories.
4
+ # This fixes sessions created by the bug in v0.30.0 where sessions were
5
+ # saved to ~/.omp/agent/ instead of ~/.omp/agent/sessions/<encoded-cwd>/.
6
+ #
7
+ # Usage: ./migrate-sessions.sh [--dry-run]
8
+ #
9
+
10
+ set -e
11
+
12
+ AGENT_DIR="${OMP_AGENT_DIR:-$HOME/.omp/agent}"
13
+ DRY_RUN=false
14
+
15
+ if [[ "$1" == "--dry-run" ]]; then
16
+ DRY_RUN=true
17
+ echo "Dry run mode - no files will be moved"
18
+ echo
19
+ fi
20
+
21
+ # Find all .jsonl files directly in agent dir (not in subdirectories)
22
+ shopt -s nullglob
23
+ files=("$AGENT_DIR"/*.jsonl)
24
+ shopt -u nullglob
25
+
26
+ if [[ ${#files[@]} -eq 0 ]]; then
27
+ echo "No session files found in $AGENT_DIR"
28
+ exit 0
29
+ fi
30
+
31
+ echo "Found ${#files[@]} session file(s) to migrate"
32
+ echo
33
+
34
+ migrated=0
35
+ failed=0
36
+
37
+ for file in "${files[@]}"; do
38
+ filename=$(basename "$file")
39
+
40
+ # Read first line and extract cwd using jq
41
+ if ! first_line=$(head -1 "$file" 2>/dev/null); then
42
+ echo "SKIP: $filename - cannot read file"
43
+ ((failed++))
44
+ continue
45
+ fi
46
+
47
+ # Parse JSON and extract cwd
48
+ if ! cwd=$(echo "$first_line" | jq -r '.cwd // empty' 2>/dev/null); then
49
+ echo "SKIP: $filename - invalid JSON"
50
+ ((failed++))
51
+ continue
52
+ fi
53
+
54
+ if [[ -z "$cwd" ]]; then
55
+ echo "SKIP: $filename - no cwd in session header"
56
+ ((failed++))
57
+ continue
58
+ fi
59
+
60
+ # Encode cwd: remove leading slash, replace slashes with dashes, wrap with --
61
+ encoded=$(echo "$cwd" | sed 's|^/||' | sed 's|[/:\\]|-|g')
62
+ encoded="--${encoded}--"
63
+
64
+ target_dir="$AGENT_DIR/sessions/$encoded"
65
+ target_file="$target_dir/$filename"
66
+
67
+ if [[ -e "$target_file" ]]; then
68
+ echo "SKIP: $filename - target already exists"
69
+ ((failed++))
70
+ continue
71
+ fi
72
+
73
+ echo "MIGRATE: $filename"
74
+ echo " cwd: $cwd"
75
+ echo " to: $target_dir/"
76
+
77
+ if [[ "$DRY_RUN" == false ]]; then
78
+ mkdir -p "$target_dir"
79
+ mv "$file" "$target_file"
80
+ fi
81
+
82
+ ((migrated++))
83
+ echo
84
+ done
85
+
86
+ echo "---"
87
+ echo "Migrated: $migrated"
88
+ echo "Skipped: $failed"
89
+
90
+ if [[ "$DRY_RUN" == true && $migrated -gt 0 ]]; then
91
+ echo
92
+ echo "Run without --dry-run to perform the migration"
93
+ fi
@@ -83,7 +83,8 @@ const THINKING_DESCRIPTIONS: Record<ThinkingLevel, string> = {
83
83
  * - behavior: Core agent behavior (compaction, modes, retries, notifications)
84
84
  * - tools: Tool-specific settings (bash, git, python, edit, MCP, skills)
85
85
  * - display: Visual/UI settings (theme, images, thinking)
86
- * - voice: Voice mode and TTSR settings
86
+ * - voice: Voice mode and TTS settings
87
+ * - ttsr: Time Traveling Stream Rules settings
87
88
  * - status: Status line configuration
88
89
  * - lsp: LSP integration settings
89
90
  * - exa: Exa search tool settings
@@ -443,7 +444,7 @@ export const SETTINGS_DEFS: SettingDef[] = [
443
444
  },
444
445
 
445
446
  // ═══════════════════════════════════════════════════════════════════════════
446
- // Voice tab - Voice mode and TTSR settings
447
+ // Voice tab - Voice mode and TTS settings
447
448
  // ═══════════════════════════════════════════════════════════════════════════
448
449
  {
449
450
  id: "voiceEnabled",
@@ -501,9 +502,13 @@ export const SETTINGS_DEFS: SettingDef[] = [
501
502
  { value: "flac", label: "FLAC", description: "Lossless compression" },
502
503
  ],
503
504
  },
505
+
506
+ // ═══════════════════════════════════════════════════════════════════════════
507
+ // TTSR tab - Time Traveling Stream Rules
508
+ // ═══════════════════════════════════════════════════════════════════════════
504
509
  {
505
510
  id: "ttsrEnabled",
506
- tab: "voice",
511
+ tab: "ttsr",
507
512
  type: "boolean",
508
513
  label: "TTSR enabled",
509
514
  description: "Time Traveling Stream Rules: interrupt agent when output matches patterns",
@@ -512,7 +517,7 @@ export const SETTINGS_DEFS: SettingDef[] = [
512
517
  },
513
518
  {
514
519
  id: "ttsrContextMode",
515
- tab: "voice",
520
+ tab: "ttsr",
516
521
  type: "enum",
517
522
  label: "TTSR context mode",
518
523
  description: "What to do with partial output when TTSR triggers",
@@ -522,7 +527,7 @@ export const SETTINGS_DEFS: SettingDef[] = [
522
527
  },
523
528
  {
524
529
  id: "ttsrRepeatMode",
525
- tab: "voice",
530
+ tab: "ttsr",
526
531
  type: "enum",
527
532
  label: "TTSR repeat mode",
528
533
  description: "How rules can repeat: once per session or after a message gap",
@@ -532,7 +537,7 @@ export const SETTINGS_DEFS: SettingDef[] = [
532
537
  },
533
538
  {
534
539
  id: "ttsrRepeatGap",
535
- tab: "voice",
540
+ tab: "ttsr",
536
541
  type: "submenu",
537
542
  label: "TTSR repeat gap",
538
543
  description: "Messages before a rule can trigger again (when repeat mode is after-gap)",
@@ -118,6 +118,7 @@ const SETTINGS_TABS: Tab[] = [
118
118
  { id: "tools", label: "Tools" },
119
119
  { id: "display", label: "Display" },
120
120
  { id: "voice", label: "Voice" },
121
+ { id: "ttsr", label: "TTSR" },
121
122
  { id: "status", label: "Status" },
122
123
  { id: "lsp", label: "LSP" },
123
124
  { id: "exa", label: "Exa" },
@@ -1,5 +1,4 @@
1
1
  /* @ts-self-types="./photon_rs.d.ts" */
2
- import wasmBase64 from "./photon_rs_bg.wasm.b64.js";
3
2
 
4
3
  /**
5
4
  * Provides the image's height, width, and contains the image's raw pixels.
@@ -4454,8 +4453,29 @@ const cachedTextEncoder = new TextEncoder();
4454
4453
 
4455
4454
  let WASM_VECTOR_LEN = 0;
4456
4455
 
4457
- // Decode base64 WASM (works in both dev and compiled binary)
4458
- const wasmBytes = Uint8Array.from(atob(wasmBase64), c => c.charCodeAt(0));
4459
- const wasmInstantiated = await WebAssembly.instantiate(wasmBytes, __wbg_get_imports());
4456
+ // Load WASM - try each source until one instantiates successfully
4457
+ let wasmInstantiated;
4458
+ const imports = __wbg_get_imports();
4459
+
4460
+ // Try .wasm file first (dev) - streaming is most efficient
4461
+ let streamingError;
4462
+ try {
4463
+ const wasmPath = new URL("./photon_rs_bg.wasm", import.meta.url);
4464
+ wasmInstantiated = await WebAssembly.instantiateStreaming(fetch(wasmPath), imports);
4465
+ } catch (e) {
4466
+ streamingError = e;
4467
+ }
4468
+
4469
+ // Fall back to base64 (compiled binary/npm)
4470
+ if (!wasmInstantiated) {
4471
+ try {
4472
+ const { default: wasmBase64 } = await import("./photon_rs_bg.wasm.b64.js");
4473
+ const wasmBytes = Uint8Array.from(atob(wasmBase64), c => c.charCodeAt(0));
4474
+ wasmInstantiated = await WebAssembly.instantiate(wasmBytes, imports);
4475
+ } catch (b64Error) {
4476
+ throw new Error(`Failed to load photon WASM:\n streaming: ${streamingError?.message}\n base64: ${b64Error.message}`);
4477
+ }
4478
+ }
4479
+
4460
4480
  const wasm = wasmInstantiated.instance.exports;
4461
4481
  wasm.__wbindgen_start();