@miphamai/cli 0.16.0 → 0.16.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/dist/mipham +0 -0
- package/package.json +2 -4
- package/src/agent/message-bus.ts +7 -1
- package/src/agent/sub-agent.ts +7 -1
- package/src/commands/environment.ts +270 -0
- package/src/commands/git.ts +152 -0
- package/src/commands/project.ts +1011 -0
- package/src/core/engine.ts +8 -7
- package/src/core/permission.ts +5 -0
- package/src/core/session-store.ts +4 -1
- package/src/index.tsx +6 -5
- package/src/skills/community-registry.json +72 -0
- package/src/skills/registry.ts +2 -75
- package/src/tools/exec/bash.ts +3 -3
- package/src/tools/exec/enter-worktree.ts +23 -1
- package/src/tools/exec/exit-worktree.ts +13 -0
- package/src/ui/agent-footer.tsx +89 -0
- package/src/ui/app.tsx +156 -35
- package/src/ui/chat.tsx +80 -30
- package/src/ui/commands.ts +202 -1484
- package/src/ui/strip-indent.ts +19 -0
- package/src/workflow/runtime.ts +11 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template literal tag that strips leading indentation from multi-line strings.
|
|
3
|
+
* Used by slash command handlers to format help text and status messages.
|
|
4
|
+
*/
|
|
5
|
+
export function stripIndent(strings: TemplateStringsArray, ...values: unknown[]): string {
|
|
6
|
+
let result = strings.reduce((acc, s, i) => acc + s + (values[i] ?? ''), '')
|
|
7
|
+
// Remove leading newline
|
|
8
|
+
result = result.replace(/^\n/, '')
|
|
9
|
+
// Find minimum indent
|
|
10
|
+
const match = result.match(/^( +)/m)
|
|
11
|
+
if (match?.[1]) {
|
|
12
|
+
const indent = match[1].length
|
|
13
|
+
result = result
|
|
14
|
+
.split('\n')
|
|
15
|
+
.map((line) => line.slice(indent))
|
|
16
|
+
.join('\n')
|
|
17
|
+
}
|
|
18
|
+
return result.trim()
|
|
19
|
+
}
|
package/src/workflow/runtime.ts
CHANGED
|
@@ -157,7 +157,17 @@ export async function runWorkflow(
|
|
|
157
157
|
sandboxCtx.phase = wrappedPhase
|
|
158
158
|
sandboxCtx.log = log
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
let result: unknown
|
|
161
|
+
try {
|
|
162
|
+
result = await vmScript.runInContext(sandboxCtx, { timeout: 120_000 })
|
|
163
|
+
} catch (err) {
|
|
164
|
+
const message = err instanceof Error ? err.message : String(err)
|
|
165
|
+
throw new Error(
|
|
166
|
+
`Workflow script execution failed: ${message}\n\n` +
|
|
167
|
+
`This is likely a bug in the workflow script, not in Mipham Code itself. ` +
|
|
168
|
+
`Check the script for syntax errors, undefined references, or unhandled promise rejections.`,
|
|
169
|
+
)
|
|
170
|
+
}
|
|
161
171
|
|
|
162
172
|
// Count journal entries from state
|
|
163
173
|
const priorEntries = loadJournal(runId)
|