@oh-my-pi/pi-coding-agent 12.7.6 → 12.8.1
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 +37 -37
- package/README.md +9 -1052
- package/package.json +7 -7
- package/src/cli/args.ts +1 -0
- package/src/cli/update-cli.ts +49 -35
- package/src/cli/web-search-cli.ts +3 -2
- package/src/commands/web-search.ts +1 -0
- package/src/config/model-registry.ts +6 -0
- package/src/config/settings-schema.ts +25 -3
- package/src/config/settings.ts +1 -0
- package/src/extensibility/extensions/wrapper.ts +20 -13
- package/src/extensibility/slash-commands.ts +12 -91
- package/src/lsp/client.ts +24 -27
- package/src/lsp/index.ts +92 -42
- package/src/mcp/config-writer.ts +33 -0
- package/src/mcp/config.ts +6 -1
- package/src/mcp/types.ts +1 -0
- package/src/modes/components/custom-editor.ts +8 -5
- package/src/modes/components/settings-defs.ts +2 -1
- package/src/modes/controllers/command-controller.ts +12 -6
- package/src/modes/controllers/input-controller.ts +21 -186
- package/src/modes/controllers/mcp-command-controller.ts +60 -3
- package/src/modes/interactive-mode.ts +2 -2
- package/src/modes/types.ts +1 -1
- package/src/sdk.ts +23 -1
- package/src/secrets/index.ts +116 -0
- package/src/secrets/obfuscator.ts +269 -0
- package/src/secrets/regex.ts +21 -0
- package/src/session/agent-session.ts +138 -21
- package/src/session/compaction/branch-summarization.ts +2 -2
- package/src/session/compaction/compaction.ts +10 -3
- package/src/session/compaction/utils.ts +25 -1
- package/src/slash-commands/builtin-registry.ts +419 -0
- package/src/web/scrapers/github.ts +50 -12
- package/src/web/search/index.ts +5 -5
- package/src/web/search/provider.ts +13 -2
- package/src/web/search/providers/brave.ts +165 -0
- package/src/web/search/types.ts +1 -1
- package/docs/compaction.md +0 -436
- package/docs/config-usage.md +0 -176
- package/docs/custom-tools.md +0 -585
- package/docs/environment-variables.md +0 -257
- package/docs/extension-loading.md +0 -106
- package/docs/extensions.md +0 -1342
- package/docs/fs-scan-cache-architecture.md +0 -50
- package/docs/hooks.md +0 -906
- package/docs/models.md +0 -234
- package/docs/python-repl.md +0 -110
- package/docs/rpc.md +0 -1173
- package/docs/sdk.md +0 -1039
- package/docs/session-tree-plan.md +0 -84
- package/docs/session.md +0 -368
- package/docs/skills.md +0 -254
- package/docs/theme.md +0 -696
- package/docs/tree.md +0 -206
- package/docs/tui.md +0 -487
package/docs/config-usage.md
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
# Config Module Usage Map
|
|
2
|
-
|
|
3
|
-
This document shows how each file uses the config module and what subpaths they access.
|
|
4
|
-
|
|
5
|
-
## Overview Diagram
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
┌─────────────────────────────────────────────────────────────────────────────────┐
|
|
9
|
-
│ config.ts exports │
|
|
10
|
-
├─────────────────────────────────────────────────────────────────────────────────┤
|
|
11
|
-
│ Constants: APP_NAME, CONFIG_DIR_NAME, VERSION │
|
|
12
|
-
│ Single paths: getAgentDir, getAuthPath, getModelsPath, getModelsYamlPath, │
|
|
13
|
-
│ getAgentDbPath, getToolsDir, getCommandsDir, getPromptsDir, │
|
|
14
|
-
│ getSessionsDir, getDebugLogPath, getCustomThemesDir, │
|
|
15
|
-
│ getChangelogPath, getPackageDir │
|
|
16
|
-
│ Multi-config: getConfigDirs, getConfigDirPaths, findConfigFile, │
|
|
17
|
-
│ findConfigFileWithMeta, readConfigFile, readAllConfigFiles, │
|
|
18
|
-
│ findNearestProjectConfigDir, findAllNearestProjectConfigDirs │
|
|
19
|
-
└─────────────────────────────────────────────────────────────────────────────────┘
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Architecture Note
|
|
23
|
-
|
|
24
|
-
Many modules now use the **capability/discovery system** (`discovery/builtin.ts`) to load configuration files (skills, hooks, tools, MCP servers, etc.) rather than importing config helpers directly. The capability system provides a unified way to load resources from multiple sources (.omp, .pi, .claude, .codex, .gemini) with proper priority ordering.
|
|
25
|
-
|
|
26
|
-
## Usage by Category
|
|
27
|
-
|
|
28
|
-
### 1. Display/Branding Only (no file I/O)
|
|
29
|
-
|
|
30
|
-
| File | Imports | Purpose |
|
|
31
|
-
| ----------------------------- | ----------------------------- | ------------------------ |
|
|
32
|
-
| `cli/args.ts` | `APP_NAME`, `CONFIG_DIR_NAME` | Help text, env var names |
|
|
33
|
-
| `cli/grep-cli.ts` | `APP_NAME` | Grep command output |
|
|
34
|
-
| `cli/jupyter-cli.ts` | `APP_NAME` | Jupyter command output |
|
|
35
|
-
| `cli/plugin-cli.ts` | `APP_NAME` | Plugin command output |
|
|
36
|
-
| `cli/setup-cli.ts` | `APP_NAME` | Setup command output |
|
|
37
|
-
| `cli/shell-cli.ts` | `APP_NAME` | Shell command output |
|
|
38
|
-
| `cli/stats-cli.ts` | `APP_NAME` | Stats command output |
|
|
39
|
-
| `cli/update-cli.ts` | `APP_NAME`, `VERSION` | Update messages |
|
|
40
|
-
| `cli.ts` | `APP_NAME` | Process title |
|
|
41
|
-
| `export/html/index.ts` | `APP_NAME` | HTML export title |
|
|
42
|
-
| `modes/components/welcome.ts` | `APP_NAME` | Welcome banner |
|
|
43
|
-
| `debug/system-info.ts` | `VERSION` | System info display |
|
|
44
|
-
|
|
45
|
-
### 2. Single Fixed Paths (user-level only)
|
|
46
|
-
|
|
47
|
-
| File | Imports | Path | Purpose |
|
|
48
|
-
| ------------------------------------------ | ---------------------------------- | ------------------------------- | ----------------------- |
|
|
49
|
-
| `cli/config-cli.ts` | `APP_NAME`, `getAgentDir` | `~/.omp/agent/` | Prints config path |
|
|
50
|
-
| `session/agent-session.ts` | `getAgentDbPath` | `~/.omp/agent/agent.db` | Database path |
|
|
51
|
-
| `session/session-manager.ts` | `getAgentDir` | `~/.omp/agent/sessions/` | Session storage |
|
|
52
|
-
| `session/agent-storage.ts` | `getAgentDbPath` | `~/.omp/agent/agent.db` | Settings/auth storage |
|
|
53
|
-
| `session/auth-storage.ts` | `getAgentDbPath` | agent.db | Auth credential storage |
|
|
54
|
-
| `session/history-storage.ts` | `getAgentDir` | `~/.omp/agent/` | Command history |
|
|
55
|
-
| `session/storage-migration.ts` | `getAgentDbPath` | `~/.omp/agent/agent.db` | JSON→SQLite migration |
|
|
56
|
-
| `modes/theme/theme.ts` | `getCustomThemesDir` | `~/.omp/agent/themes/` | Custom themes |
|
|
57
|
-
| `modes/controllers/selector-controller.ts` | `getAgentDbPath` | `~/.omp/agent/agent.db` | Model selector state |
|
|
58
|
-
| `utils/changelog.ts` | `getChangelogPath` | Package CHANGELOG.md | Re-exports path |
|
|
59
|
-
| `migrations.ts` | `getAgentDir`, `getAgentDbPath` | `~/.omp/agent/` | Auth/session migration |
|
|
60
|
-
| `extensibility/plugins/installer.ts` | `getAgentDir` | `~/.omp/agent/plugins/` | Plugin installation |
|
|
61
|
-
| `extensibility/plugins/paths.ts` | `CONFIG_DIR_NAME` | `~/.omp/plugins/` | Plugin directories |
|
|
62
|
-
| `config/keybindings.ts` | `getAgentDir` | `~/.omp/agent/keybindings.json` | Keybinding config |
|
|
63
|
-
| `config/settings.ts` | `getAgentDir`, `getAgentDbPath` | agent.db, config.yml | Settings management |
|
|
64
|
-
| `config/prompt-templates.ts` | `CONFIG_DIR_NAME`, `getPromptsDir` | `~/.omp/agent/prompts/` | Prompt template loading |
|
|
65
|
-
| `ipy/executor.ts` | `getAgentDir` | `~/.omp/agent/` | Python executor paths |
|
|
66
|
-
| `ipy/gateway-coordinator.ts` | `getAgentDir` | `~/.omp/agent/` | Jupyter gateway socket |
|
|
67
|
-
| `export/custom-share.ts` | `getAgentDir` | `~/.omp/agent/share/` | Custom share scripts |
|
|
68
|
-
| `debug/index.ts` | `getSessionsDir` | `~/.omp/agent/sessions/` | Debug session browser |
|
|
69
|
-
| `ssh/connection-manager.ts` | `CONFIG_DIR_NAME` | `~/.omp/ssh/` | SSH control sockets |
|
|
70
|
-
| `ssh/sshfs-mount.ts` | `CONFIG_DIR_NAME` | `~/.omp/remote/` | Remote mount points |
|
|
71
|
-
| `tools/read.ts` | `CONFIG_DIR_NAME` | Config dir name reference | Internal URL resolution |
|
|
72
|
-
| `utils/tools-manager.ts` | `APP_NAME`, `getToolsDir` | `~/.omp/agent/tools/` | Tool binary management |
|
|
73
|
-
|
|
74
|
-
### 3. Multi-Config Discovery (with fallbacks)
|
|
75
|
-
|
|
76
|
-
These use helpers to check `.omp`, `.pi`, `.claude`, `.codex`, `.gemini` directories:
|
|
77
|
-
|
|
78
|
-
| File | Helper Used | Subpath(s) | Levels |
|
|
79
|
-
| ----------------------------------------- | -------------------------------------------------- | ------------------------------- | ------------ |
|
|
80
|
-
| `main.ts` | `findConfigFile` | `SYSTEM.md`, `APPEND_SYSTEM.md` | user+project |
|
|
81
|
-
| `sdk.ts` | `getConfigDirPaths` | `models.yml`, `models.json` | user |
|
|
82
|
-
| `lsp/config.ts` | `getConfigDirPaths` | `lsp.json`, `.lsp.json` | user+project |
|
|
83
|
-
| `task/discovery.ts` | `getConfigDirs`, `findAllNearestProjectConfigDirs` | `agents/` | user+project |
|
|
84
|
-
| `extensibility/plugins/paths.ts` | `getConfigDirPaths` | `plugin-overrides.json` | project |
|
|
85
|
-
| `extensibility/custom-commands/loader.ts` | `getConfigDirs` | `commands/` | user+project |
|
|
86
|
-
| `web/search/auth.ts` | `getConfigDirPaths`, `getAgentDbPath` | agent.db | user |
|
|
87
|
-
| `web/search/providers/codex.ts` | `getConfigDirPaths`, `getAgentDbPath` | auth config | user |
|
|
88
|
-
| `web/search/providers/gemini.ts` | `getConfigDirPaths`, `getAgentDbPath` | auth config | user |
|
|
89
|
-
|
|
90
|
-
### 4. Via Capability/Discovery System
|
|
91
|
-
|
|
92
|
-
These modules use `discovery/builtin.ts` which has its own config directory resolution:
|
|
93
|
-
|
|
94
|
-
| Capability | Config Subpaths | Loaded Via |
|
|
95
|
-
| -------------- | --------------------------- | ------------------------ |
|
|
96
|
-
| skills | `skills/` | `skillCapability` |
|
|
97
|
-
| slash-commands | `commands/` | `slashCommandCapability` |
|
|
98
|
-
| rules | `rules/` | `ruleCapability` |
|
|
99
|
-
| prompts | `prompts/` | `promptCapability` |
|
|
100
|
-
| instructions | `instructions/` | `instructionCapability` |
|
|
101
|
-
| hooks | `hooks/pre/`, `hooks/post/` | `hookCapability` |
|
|
102
|
-
| tools | `tools/` | `toolCapability` |
|
|
103
|
-
| extensions | `extensions/` | `extensionCapability` |
|
|
104
|
-
| mcp | `mcp.json`, `.mcp.json` | `mcpCapability` |
|
|
105
|
-
| settings | `settings.json` | `settingsCapability` |
|
|
106
|
-
| system-prompt | `SYSTEM.md` | `systemPromptCapability` |
|
|
107
|
-
|
|
108
|
-
## Subpath Summary
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
User-level (~/.omp/agent/, ~/.pi/agent/, ~/.claude/, ~/.codex/, ~/.gemini/):
|
|
112
|
-
├── agent.db ← SQLite storage (settings, auth)
|
|
113
|
-
├── models.yml ← Model configuration (preferred)
|
|
114
|
-
├── models.json ← Model configuration (legacy)
|
|
115
|
-
├── config.yml ← Settings (alternative to agent.db)
|
|
116
|
-
├── keybindings.json ← Custom keybindings
|
|
117
|
-
├── commands/ ← Slash commands (via capability)
|
|
118
|
-
├── hooks/ ← Pre/post hooks (via capability)
|
|
119
|
-
│ ├── pre/
|
|
120
|
-
│ └── post/
|
|
121
|
-
├── tools/ ← Custom tools (via capability)
|
|
122
|
-
├── skills/ ← Skills (via capability)
|
|
123
|
-
├── prompts/ ← Prompt templates
|
|
124
|
-
├── themes/ ← Custom themes
|
|
125
|
-
├── sessions/ ← Session storage
|
|
126
|
-
├── agents/ ← Custom task agents
|
|
127
|
-
├── plugins/ ← Installed plugins
|
|
128
|
-
├── extensions/ ← Extension modules
|
|
129
|
-
├── rules/ ← Rules (via capability)
|
|
130
|
-
├── instructions/ ← Instructions (via capability)
|
|
131
|
-
├── share/ ← Custom share scripts
|
|
132
|
-
└── AGENTS.md ← User-level agent instructions
|
|
133
|
-
|
|
134
|
-
User-level root (~/.omp/, ~/.pi/, ~/.claude/) - not under agent/:
|
|
135
|
-
├── mcp.json ← MCP server config (via capability)
|
|
136
|
-
├── plugins/ ← Plugin storage (primary only)
|
|
137
|
-
├── logs/ ← Log files (primary only, via pi-utils)
|
|
138
|
-
├── ssh/ ← SSH control sockets
|
|
139
|
-
└── remote/ ← SSHFS mount points
|
|
140
|
-
|
|
141
|
-
Project-level (.omp/, .claude/, .codex/, .gemini/):
|
|
142
|
-
├── SYSTEM.md ← Project system prompt
|
|
143
|
-
├── APPEND_SYSTEM.md ← Appended to system prompt
|
|
144
|
-
├── settings.json ← Project settings (via capability)
|
|
145
|
-
├── commands/ ← Slash commands (via capability)
|
|
146
|
-
├── hooks/ ← Pre/post hooks (via capability)
|
|
147
|
-
├── tools/ ← Custom tools (via capability)
|
|
148
|
-
├── skills/ ← Skills (via capability)
|
|
149
|
-
├── agents/ ← Custom task agents
|
|
150
|
-
├── extensions/ ← Extension modules (via capability)
|
|
151
|
-
├── rules/ ← Rules (via capability)
|
|
152
|
-
├── instructions/ ← Instructions (via capability)
|
|
153
|
-
├── prompts/ ← Prompt templates (via capability)
|
|
154
|
-
├── plugin-overrides.json ← Plugin config overrides
|
|
155
|
-
├── lsp.json ← LSP server config
|
|
156
|
-
├── .lsp.json ← LSP server config (dotfile)
|
|
157
|
-
└── .mcp.json ← MCP server config (via capability)
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Notes
|
|
161
|
-
|
|
162
|
-
### Logger
|
|
163
|
-
|
|
164
|
-
Logging is handled by `@oh-my-pi/pi-utils`, not by this package. Logs go to `~/.omp/logs/omp.YYYY-MM-DD.log` with automatic rotation.
|
|
165
|
-
|
|
166
|
-
### Config Priority
|
|
167
|
-
|
|
168
|
-
When multiple config directories exist, priority order is:
|
|
169
|
-
|
|
170
|
-
1. `.omp` (highest)
|
|
171
|
-
2. `.pi`
|
|
172
|
-
3. `.claude`
|
|
173
|
-
4. `.codex`
|
|
174
|
-
5. `.gemini` (lowest)
|
|
175
|
-
|
|
176
|
-
For user-level paths, `.omp/agent` and `.pi/agent` have an "agent" subdirectory; others use the root directly (e.g., `~/.claude/` not `~/.claude/agent/`).
|