@oh-my-pi/cli 0.3.0 → 0.5.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.
Files changed (108) hide show
  1. package/README.md +79 -84
  2. package/dist/cli.js +5025 -1016
  3. package/dist/commands/config.d.ts +27 -0
  4. package/dist/commands/config.d.ts.map +1 -1
  5. package/dist/commands/create.d.ts.map +1 -1
  6. package/dist/commands/doctor.d.ts +2 -0
  7. package/dist/commands/doctor.d.ts.map +1 -1
  8. package/dist/commands/env.d.ts.map +1 -1
  9. package/dist/commands/features.d.ts.map +1 -1
  10. package/dist/commands/info.d.ts.map +1 -1
  11. package/dist/commands/init.d.ts.map +1 -1
  12. package/dist/commands/install.d.ts +6 -0
  13. package/dist/commands/install.d.ts.map +1 -1
  14. package/dist/commands/link.d.ts +1 -0
  15. package/dist/commands/link.d.ts.map +1 -1
  16. package/dist/commands/list.d.ts.map +1 -1
  17. package/dist/commands/outdated.d.ts.map +1 -1
  18. package/dist/commands/search.d.ts.map +1 -1
  19. package/dist/commands/uninstall.d.ts +3 -0
  20. package/dist/commands/uninstall.d.ts.map +1 -1
  21. package/dist/commands/update.d.ts +1 -0
  22. package/dist/commands/update.d.ts.map +1 -1
  23. package/dist/commands/why.d.ts.map +1 -1
  24. package/dist/conflicts.d.ts +7 -2
  25. package/dist/conflicts.d.ts.map +1 -1
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/lock.d.ts.map +1 -1
  29. package/dist/lockfile.d.ts +24 -3
  30. package/dist/lockfile.d.ts.map +1 -1
  31. package/dist/manifest.d.ts +12 -1
  32. package/dist/manifest.d.ts.map +1 -1
  33. package/dist/npm.d.ts +11 -0
  34. package/dist/npm.d.ts.map +1 -1
  35. package/dist/output.d.ts +51 -0
  36. package/dist/output.d.ts.map +1 -0
  37. package/dist/paths.d.ts +5 -0
  38. package/dist/paths.d.ts.map +1 -1
  39. package/dist/progress.d.ts +78 -0
  40. package/dist/progress.d.ts.map +1 -0
  41. package/dist/runtime.d.ts.map +1 -1
  42. package/dist/symlinks.d.ts +1 -0
  43. package/dist/symlinks.d.ts.map +1 -1
  44. package/package.json +24 -10
  45. package/.github/icon.png +0 -0
  46. package/.github/logo.png +0 -0
  47. package/.github/workflows/ci.yml +0 -32
  48. package/.github/workflows/publish.yml +0 -42
  49. package/biome.json +0 -29
  50. package/bun.lock +0 -109
  51. package/plugins/exa/README.md +0 -153
  52. package/plugins/exa/package.json +0 -56
  53. package/plugins/exa/tools/exa/company.ts +0 -35
  54. package/plugins/exa/tools/exa/index.ts +0 -66
  55. package/plugins/exa/tools/exa/linkedin.ts +0 -35
  56. package/plugins/exa/tools/exa/researcher.ts +0 -40
  57. package/plugins/exa/tools/exa/runtime.json +0 -4
  58. package/plugins/exa/tools/exa/search.ts +0 -46
  59. package/plugins/exa/tools/exa/shared.ts +0 -230
  60. package/plugins/exa/tools/exa/websets.ts +0 -62
  61. package/plugins/metal-theme/README.md +0 -13
  62. package/plugins/metal-theme/omp.json +0 -8
  63. package/plugins/metal-theme/package.json +0 -19
  64. package/plugins/metal-theme/themes/metal.json +0 -79
  65. package/plugins/subagents/README.md +0 -25
  66. package/plugins/subagents/agents/explore.md +0 -71
  67. package/plugins/subagents/agents/planner.md +0 -51
  68. package/plugins/subagents/agents/reviewer.md +0 -53
  69. package/plugins/subagents/agents/task.md +0 -46
  70. package/plugins/subagents/commands/architect-plan.md +0 -9
  71. package/plugins/subagents/commands/implement-with-critic.md +0 -10
  72. package/plugins/subagents/commands/implement.md +0 -10
  73. package/plugins/subagents/omp.json +0 -15
  74. package/plugins/subagents/package.json +0 -26
  75. package/plugins/subagents/tools/task/index.ts +0 -1019
  76. package/plugins/user-prompt/README.md +0 -130
  77. package/plugins/user-prompt/package.json +0 -19
  78. package/plugins/user-prompt/tools/user-prompt/index.ts +0 -235
  79. package/scripts/bump-version.sh +0 -52
  80. package/scripts/publish.sh +0 -35
  81. package/src/cli.ts +0 -242
  82. package/src/commands/config.ts +0 -384
  83. package/src/commands/create.ts +0 -203
  84. package/src/commands/doctor.ts +0 -305
  85. package/src/commands/enable.ts +0 -122
  86. package/src/commands/env.ts +0 -38
  87. package/src/commands/features.ts +0 -295
  88. package/src/commands/info.ts +0 -120
  89. package/src/commands/init.ts +0 -60
  90. package/src/commands/install.ts +0 -700
  91. package/src/commands/link.ts +0 -159
  92. package/src/commands/list.ts +0 -186
  93. package/src/commands/outdated.ts +0 -87
  94. package/src/commands/search.ts +0 -77
  95. package/src/commands/uninstall.ts +0 -124
  96. package/src/commands/update.ts +0 -170
  97. package/src/commands/why.ts +0 -136
  98. package/src/conflicts.ts +0 -116
  99. package/src/errors.ts +0 -22
  100. package/src/index.ts +0 -46
  101. package/src/lock.ts +0 -46
  102. package/src/lockfile.ts +0 -132
  103. package/src/manifest.ts +0 -360
  104. package/src/npm.ts +0 -206
  105. package/src/paths.ts +0 -137
  106. package/src/runtime.ts +0 -116
  107. package/src/symlinks.ts +0 -455
  108. package/tsconfig.json +0 -28
@@ -1,130 +0,0 @@
1
- # User Prompt Plugin
2
-
3
- Interactive user prompting tool for gathering user input during agent execution.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- omp install oh-my-pi/plugins/user-prompt
9
- ```
10
-
11
- ## Tool
12
-
13
- ### `user_prompt`
14
-
15
- Asks the user questions during execution and returns their response. Useful for:
16
-
17
- - Gathering user preferences or requirements
18
- - Clarifying ambiguous instructions
19
- - Getting decisions on implementation choices
20
- - Offering choices about what direction to take
21
-
22
- ## Features
23
-
24
- ### Enhanced UI (when available)
25
-
26
- The plugin provides custom TUI components that integrate directly into pi's interface:
27
-
28
- **Single-select with inline "Other" input:**
29
- ```
30
- ─────────────────────────────────────────────
31
- Which database would you like to use?
32
-
33
- → PostgreSQL (Recommended)
34
- MySQL
35
- SQLite
36
- MongoDB
37
- Other (type your own)
38
-
39
- ↑↓ navigate · enter select · esc cancel
40
- ─────────────────────────────────────────────
41
- ```
42
-
43
- When "Other" is selected, an inline text input appears - no separate dialog needed.
44
-
45
- **Multi-select with checkboxes:**
46
- ```
47
- ─────────────────────────────────────────────
48
- Which features should I implement?
49
-
50
- → [X] Authentication
51
- [X] API endpoints
52
- [ ] Database models
53
- [ ] Unit tests
54
- [ ] Documentation
55
-
56
- ↑↓ navigate · space toggle · enter confirm · esc cancel
57
- ─────────────────────────────────────────────
58
- ```
59
-
60
- Space toggles selection, Enter confirms. Selected items show `[X]` in green with white text.
61
-
62
- ### Fallback Mode
63
-
64
- If the enhanced UI cannot be loaded, the plugin gracefully falls back to using pi's built-in `select()` and `input()` methods.
65
-
66
- ## Parameters
67
-
68
- | Parameter | Type | Required | Description |
69
- |-----------|------|----------|-------------|
70
- | `question` | string | Yes | The question to ask the user |
71
- | `options` | array | Yes | Array of `{label: string}` options to present |
72
- | `multiSelect` | boolean | No | Allow multiple selections (default: false) |
73
-
74
- ## Usage Notes
75
-
76
- - Users can always select "Other" to provide custom text input
77
- - Use `multiSelect: true` to allow multiple answers to be selected
78
- - If you recommend a specific option, make that the first option and add "(Recommended)" at the end of the label
79
-
80
- ## Examples
81
-
82
- ### Single-choice question
83
-
84
- ```json
85
- {
86
- "question": "Which database would you like to use?",
87
- "options": [
88
- {"label": "PostgreSQL (Recommended)"},
89
- {"label": "MySQL"},
90
- {"label": "SQLite"},
91
- {"label": "MongoDB"}
92
- ]
93
- }
94
- ```
95
-
96
- ### Multi-select question
97
-
98
- ```json
99
- {
100
- "question": "Which features should I implement?",
101
- "options": [
102
- {"label": "Authentication"},
103
- {"label": "API endpoints"},
104
- {"label": "Database models"},
105
- {"label": "Unit tests"},
106
- {"label": "Documentation"}
107
- ],
108
- "multiSelect": true
109
- }
110
- ```
111
-
112
- ## Response Format
113
-
114
- The tool returns the user's selection in a structured format:
115
-
116
- - **Single selection**: `"User selected: PostgreSQL (Recommended)"`
117
- - **Multi-selection**: `"User selected: Authentication, API endpoints, Unit tests"`
118
- - **Custom input**: `"User provided custom input: Use Redis for caching"`
119
- - **Cancelled**: `"User cancelled the selection"`
120
-
121
- ## How It Works
122
-
123
- The plugin hooks into pi's interactive mode at runtime to provide custom TUI components. It:
124
-
125
- 1. Dynamically imports pi's theme for consistent styling
126
- 2. Locates the InteractiveMode instance to access the editor container
127
- 3. Swaps in custom components (MultiSelectList, SelectWithInput) when prompting
128
- 4. Restores the normal editor when done
129
-
130
- This approach provides a seamless, native-feeling UI without requiring upstream changes to pi.
@@ -1,19 +0,0 @@
1
- {
2
- "name": "@oh-my-pi/user-prompt",
3
- "version": "0.3.0",
4
- "description": "Interactive user prompting tool for gathering user input during execution",
5
- "keywords": ["omp-plugin", "user-prompt", "interactive", "questions", "input"],
6
- "author": "Can Bölük <me@can.ac>",
7
- "license": "MIT",
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/can1357/oh-my-pi.git",
11
- "directory": "plugins/user-prompt"
12
- },
13
- "omp": {
14
- "install": [
15
- { "src": "tools/user-prompt/index.ts", "dest": "agent/tools/user-prompt/index.ts" }
16
- ]
17
- },
18
- "files": ["tools"]
19
- }
@@ -1,235 +0,0 @@
1
- /**
2
- * User Prompt Tool - Ask questions to the user during execution
3
- *
4
- * Use this tool when you need to ask the user questions during execution.
5
- * This allows you to:
6
- * 1. Gather user preferences or requirements
7
- * 2. Clarify ambiguous instructions
8
- * 3. Get decisions on implementation choices as you work
9
- * 4. Offer choices to the user about what direction to take
10
- *
11
- * Usage notes:
12
- * - Users will always be able to select "Other" to provide custom text input
13
- * - Use multi: true to allow multiple answers to be selected for a question
14
- * - If you recommend a specific option, make that the first option in the list
15
- * and add "(Recommended)" at the end of the label
16
- */
17
-
18
- import { Type } from "@sinclair/typebox";
19
- import { Text } from "@mariozechner/pi-tui";
20
- import type { CustomAgentTool, CustomToolFactory, ToolAPI } from "@mariozechner/pi-coding-agent";
21
-
22
- // =============================================================================
23
- // Tool Definition
24
- // =============================================================================
25
-
26
- const OTHER_OPTION = "Other (type your own)";
27
-
28
- const OptionItem = Type.Object({
29
- label: Type.String({ description: "Display label for this option" }),
30
- });
31
-
32
- const UserPromptParams = Type.Object({
33
- question: Type.String({ description: "The question to ask the user" }),
34
- options: Type.Array(OptionItem, {
35
- description: "Available options for the user to choose from.",
36
- minItems: 1,
37
- }),
38
- multi: Type.Optional(Type.Boolean({
39
- description: "Allow multiple options to be selected (default: false)",
40
- default: false,
41
- })),
42
- });
43
-
44
- interface UserPromptDetails {
45
- question: string;
46
- options: string[];
47
- multi: boolean;
48
- selectedOptions: string[];
49
- customInput?: string;
50
- }
51
-
52
- const DESCRIPTION = `Use this tool when you need to ask the user questions during execution. This allows you to:
53
- 1. Gather user preferences or requirements
54
- 2. Clarify ambiguous instructions
55
- 3. Get decisions on implementation choices as you work
56
- 4. Offer choices to the user about what direction to take.
57
-
58
- Usage notes:
59
- - Users will always be able to select "Other" to provide custom text input
60
- - Use multi: true to allow multiple answers to be selected for a question
61
- - If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label
62
-
63
- Example usage:
64
-
65
- <example>
66
- assistant: Let me ask which features you want to include.
67
- assistant: Uses the user_prompt tool:
68
- {
69
- "question": "Which features should I implement?",
70
- "options": [
71
- {"label": "Authentication"},
72
- {"label": "API endpoints"},
73
- {"label": "Database models"},
74
- {"label": "Unit tests"},
75
- {"label": "Documentation"}
76
- ],
77
- "multi": true
78
- }
79
- </example>`;
80
-
81
- const factory: CustomToolFactory = (pi: ToolAPI) => {
82
- const tool: CustomAgentTool<typeof UserPromptParams, UserPromptDetails> = {
83
- name: "user_prompt",
84
- label: "User Prompt",
85
- description: DESCRIPTION,
86
- parameters: UserPromptParams,
87
-
88
- async execute(_toolCallId, params, _signal, _onUpdate) {
89
- const { question, options, multi = false } = params;
90
- const optionLabels = options.map((o) => o.label);
91
-
92
- if (!pi.hasUI) {
93
- return {
94
- content: [{ type: "text", text: "Error: User prompt requires interactive mode" }],
95
- details: { question, options: optionLabels, multi, selectedOptions: [] },
96
- };
97
- }
98
-
99
- let selectedOptions: string[] = [];
100
- let customInput: string | undefined;
101
-
102
- if (multi) {
103
- // Multi-select: show checkboxes in the label to indicate selection state
104
- const DONE = "✓ Done selecting";
105
- const selected = new Set<string>();
106
-
107
- while (true) {
108
- // Build options with checkbox indicators
109
- const opts: string[] = [];
110
-
111
- // Add "Done" option if any selected
112
- if (selected.size > 0) {
113
- opts.push(DONE);
114
- }
115
-
116
- // Add all options with [X] or [ ] prefix
117
- for (const opt of optionLabels) {
118
- const checkbox = selected.has(opt) ? "[X]" : "[ ]";
119
- opts.push(`${checkbox} ${opt}`);
120
- }
121
-
122
- // Add "Other" option
123
- opts.push(OTHER_OPTION);
124
-
125
- const prefix = selected.size > 0 ? `(${selected.size} selected) ` : "";
126
- const choice = await pi.ui.select(`${prefix}${question}`, opts);
127
-
128
- if (choice === null || choice === DONE) break;
129
-
130
- if (choice === OTHER_OPTION) {
131
- const input = await pi.ui.input("Enter your response:");
132
- if (input) customInput = input;
133
- break;
134
- }
135
-
136
- // Toggle selection - extract the actual option name
137
- const optMatch = choice.match(/^\[.\] (.+)$/);
138
- if (optMatch) {
139
- const opt = optMatch[1];
140
- if (selected.has(opt)) {
141
- selected.delete(opt);
142
- } else {
143
- selected.add(opt);
144
- }
145
- }
146
- }
147
- selectedOptions = Array.from(selected);
148
- } else {
149
- // Single select with "Other" option
150
- const choice = await pi.ui.select(question, [...optionLabels, OTHER_OPTION]);
151
- if (choice === OTHER_OPTION) {
152
- const input = await pi.ui.input("Enter your response:");
153
- if (input) customInput = input;
154
- } else if (choice) {
155
- selectedOptions = [choice];
156
- }
157
- }
158
-
159
- const details: UserPromptDetails = {
160
- question,
161
- options: optionLabels,
162
- multi,
163
- selectedOptions,
164
- customInput,
165
- };
166
-
167
- let responseText: string;
168
- if (customInput) {
169
- responseText = `User provided custom input: ${customInput}`;
170
- } else if (selectedOptions.length > 0) {
171
- responseText = multi
172
- ? `User selected: ${selectedOptions.join(", ")}`
173
- : `User selected: ${selectedOptions[0]}`;
174
- } else {
175
- responseText = "User cancelled the selection";
176
- }
177
-
178
- return { content: [{ type: "text", text: responseText }], details };
179
- },
180
-
181
- renderCall(args, t) {
182
- if (!args.question) {
183
- return new Text(t.fg("error", "user_prompt: no question provided"), 0, 0);
184
- }
185
-
186
- const multiTag = args.multi ? t.fg("muted", " [multi-select]") : "";
187
- let text = t.fg("toolTitle", "? ") + t.fg("accent", args.question) + multiTag;
188
-
189
- if (args.options?.length) {
190
- for (const opt of args.options) {
191
- text += "\n" + t.fg("dim", " ○ ") + t.fg("muted", opt.label);
192
- }
193
- text += "\n" + t.fg("dim", " ○ ") + t.fg("muted", "Other (custom input)");
194
- }
195
-
196
- return new Text(text, 0, 0);
197
- },
198
-
199
- renderResult(result, { expanded }, t) {
200
- const { details } = result;
201
- if (!details) {
202
- const txt = result.content[0];
203
- return new Text(txt?.type === "text" ? txt.text : "", 0, 0);
204
- }
205
-
206
- let text = t.fg("toolTitle", "? ") + t.fg("accent", details.question);
207
-
208
- if (details.customInput) {
209
- // Custom input provided
210
- text += "\n" + t.fg("dim", " ⎿ ") + t.fg("success", details.customInput);
211
- } else if (details.selectedOptions.length > 0) {
212
- // Show only selected options
213
- const selected = details.selectedOptions;
214
- if (selected.length === 1) {
215
- text += "\n" + t.fg("dim", " ⎿ ") + t.fg("success", selected[0]);
216
- } else {
217
- // Multiple selections
218
- for (let i = 0; i < selected.length; i++) {
219
- const isLast = i === selected.length - 1;
220
- const branch = isLast ? "└─" : "├─";
221
- text += "\n" + t.fg("dim", ` ${branch} `) + t.fg("success", selected[i]);
222
- }
223
- }
224
- } else {
225
- text += "\n" + t.fg("dim", " ⎿ ") + t.fg("warning", "Cancelled");
226
- }
227
-
228
- return new Text(text, 0, 0);
229
- },
230
- };
231
-
232
- return tool;
233
- };
234
-
235
- export default factory;
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- # Bump version across all packages
5
- # Usage: ./scripts/bump-version.sh <version>
6
- # Example: ./scripts/bump-version.sh 1.0.0
7
-
8
- if [[ -z "$1" ]]; then
9
- echo "Usage: $0 <version>"
10
- echo "Example: $0 1.0.0"
11
- exit 1
12
- fi
13
-
14
- VERSION="$1"
15
-
16
- echo "📦 Bumping all packages to v$VERSION..."
17
-
18
- # Update root package.json
19
- echo " Updating package.json..."
20
- bun --eval "
21
- const pkg = require('./package.json');
22
- pkg.version = '$VERSION';
23
- require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n');
24
- "
25
-
26
- # Update plugins/subagents/package.json
27
- echo " Updating plugins/subagents/package.json..."
28
- bun --eval "
29
- const pkg = require('./plugins/subagents/package.json');
30
- pkg.version = '$VERSION';
31
- require('fs').writeFileSync('plugins/subagents/package.json', JSON.stringify(pkg, null, 2) + '\n');
32
- "
33
-
34
- # Update plugins/metal-theme/package.json
35
- echo " Updating plugins/metal-theme/package.json..."
36
- bun --eval "
37
- const pkg = require('./plugins/metal-theme/package.json');
38
- pkg.version = '$VERSION';
39
- require('fs').writeFileSync('plugins/metal-theme/package.json', JSON.stringify(pkg, null, 2) + '\n');
40
- "
41
-
42
- # Update version in CLI
43
- echo " Updating src/cli.ts version..."
44
- sed -i "s/\.version(\"[^\"]*\")/.version(\"$VERSION\")/" src/cli.ts
45
-
46
- echo ""
47
- echo "✅ All packages bumped to v$VERSION"
48
- echo ""
49
- echo "Next steps:"
50
- echo " 1. git add -A && git commit -m 'chore: bump version to $VERSION'"
51
- echo " 2. git tag v$VERSION"
52
- echo " 3. git push && git push --tags"
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- # Publish all @oh-my-pi packages
5
- # Usage: ./scripts/publish.sh [--dry-run]
6
-
7
- DRY_RUN=""
8
- if [[ "$1" == "--dry-run" ]]; then
9
- DRY_RUN="--dry-run"
10
- echo "🔍 Dry run mode - no packages will be published"
11
- fi
12
-
13
- echo "📦 Publishing @oh-my-pi packages..."
14
- echo ""
15
-
16
- # Build first
17
- echo "🔨 Building CLI..."
18
- bun run build
19
-
20
- # Publish CLI
21
- echo ""
22
- echo "📤 Publishing @oh-my-pi/cli..."
23
- npm publish --access public $DRY_RUN
24
-
25
- # Publish plugins
26
- echo ""
27
- echo "📤 Publishing @oh-my-pi/subagents..."
28
- cd plugins/subagents && npm publish --access public $DRY_RUN && cd ../..
29
-
30
- echo ""
31
- echo "📤 Publishing @oh-my-pi/metal-theme..."
32
- cd plugins/metal-theme && npm publish --access public $DRY_RUN && cd ../..
33
-
34
- echo ""
35
- echo "✅ All packages published!"