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