@miphamai/cli 0.19.4 → 0.19.5
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/bin/mipham.ts +1 -1
- package/package.json +1 -1
- package/src/agent/sub-agent.ts +1 -1
- package/src/agent-view/dashboard.tsx +2 -2
- package/src/commands/environment.ts +2 -3
- package/src/commands/git.ts +0 -1
- package/src/commands/project.ts +1 -6
- package/src/config/loader.ts +1 -1
- package/src/core/credential-masker.ts +0 -1
- package/src/core/hooks.ts +0 -1
- package/src/core/rules-loader.ts +2 -2
- package/src/skills/registry.ts +1 -1
- package/src/tools/agent/skill.ts +1 -1
- package/src/tools/exec/enter-worktree.ts +1 -1
- package/src/ui/app.tsx +4 -4
- package/src/ui/command-picker.tsx +2 -2
- package/src/ui/commands.ts +1 -1
- package/src/ui/input.tsx +2 -2
package/bin/mipham.ts
CHANGED
|
@@ -241,7 +241,7 @@ async function runUpdate(): Promise<boolean> {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
if (!latestVersion && lastError) throw lastError
|
|
244
|
-
} catch
|
|
244
|
+
} catch {
|
|
245
245
|
console.log(`✗ Could not reach npm registry (network timeout)`)
|
|
246
246
|
console.log()
|
|
247
247
|
console.log(` Manual update:`)
|
package/package.json
CHANGED
package/src/agent/sub-agent.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProviderRegistry
|
|
1
|
+
import type { ProviderRegistry } from '../providers/registry'
|
|
2
2
|
import type { ToolDefinition } from '../shared/index.ts'
|
|
3
3
|
import type { SubAgentType, SubAgentOptions, AgentDefinition } from './types'
|
|
4
4
|
import { createAgentContext } from './agent-context'
|
|
@@ -30,7 +30,7 @@ const STATUS_HEADERS: Record<string, { label: string; color: string }> = {
|
|
|
30
30
|
export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps) {
|
|
31
31
|
const [selectedIndex, setSelectedIndex] = useState(0)
|
|
32
32
|
const [peekingSessionId, setPeekingSessionId] = useState<string | null>(null)
|
|
33
|
-
const [
|
|
33
|
+
const [_groupBy, setGroupBy] = useState<'status' | 'directory'>('status')
|
|
34
34
|
|
|
35
35
|
// Build a flat list of sessions in group order, with group headers
|
|
36
36
|
const flatList = useMemo(() => {
|
|
@@ -202,7 +202,7 @@ export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps
|
|
|
202
202
|
) : (
|
|
203
203
|
<Box flexDirection="column">
|
|
204
204
|
{/* Session list with group headers */}
|
|
205
|
-
{flatList.map((item,
|
|
205
|
+
{flatList.map((item, _flatIdx) => {
|
|
206
206
|
if (item.type === 'header') {
|
|
207
207
|
return (
|
|
208
208
|
<Box key={`h-${item.status}`} marginY={1}>
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* Handlers for: /theme, /release-notes, /ide, /terminal-setup
|
|
6
6
|
*/
|
|
7
7
|
import type { CommandHandler } from '../ui/commands.js'
|
|
8
|
-
import {
|
|
9
|
-
import { NPM_INSTALL_COMMAND, NPM_UPDATE_COMMAND, PACKAGE_VERSION } from '../shared/index.ts'
|
|
8
|
+
import { NPM_INSTALL_COMMAND } from '../shared/index.ts'
|
|
10
9
|
|
|
11
10
|
export { themeCmd, releaseNotesCmd, ideCmd, terminalSetupCmd }
|
|
12
11
|
|
|
@@ -89,7 +88,7 @@ Full changelog: https://mipham.ai/code/releases`,
|
|
|
89
88
|
// ═══════════════════════════════════════════════════════════════
|
|
90
89
|
|
|
91
90
|
const ideCmd: CommandHandler = async (_ctx) => {
|
|
92
|
-
const { mkdirSync, writeFileSync
|
|
91
|
+
const { mkdirSync, writeFileSync } = await import('node:fs')
|
|
93
92
|
const { join } = await import('node:path')
|
|
94
93
|
|
|
95
94
|
const cwd = process.cwd()
|
package/src/commands/git.ts
CHANGED
package/src/commands/project.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* /security, /audit, /prompt-audit
|
|
7
7
|
*/
|
|
8
8
|
import type { CommandHandler, CommandContext, CommandResult } from '../ui/commands.js'
|
|
9
|
-
import { stripIndent } from '../ui/strip-indent.js'
|
|
10
9
|
|
|
11
10
|
export { initCmd, permissionsCmd, recommendCmd, setupCmd, addDirCmd, promptAuditCmd, securityCmd }
|
|
12
11
|
|
|
@@ -135,10 +134,6 @@ const recommendCmd: CommandHandler = async (ctx) => {
|
|
|
135
134
|
const hasRequirements = existsSync(join(cwd, 'requirements.txt'))
|
|
136
135
|
const hasDockerfile = existsSync(join(cwd, 'Dockerfile'))
|
|
137
136
|
const hasGitHubActions = existsSync(join(cwd, '.github', 'workflows'))
|
|
138
|
-
const hasNextConfig =
|
|
139
|
-
existsSync(join(cwd, 'next.config.js')) || existsSync(join(cwd, 'next.config.ts'))
|
|
140
|
-
const hasVueConfig =
|
|
141
|
-
existsSync(join(cwd, 'vite.config.ts')) || existsSync(join(cwd, 'vite.config.js'))
|
|
142
137
|
const hasTailwind =
|
|
143
138
|
existsSync(join(cwd, 'tailwind.config.ts')) || existsSync(join(cwd, 'tailwind.config.js'))
|
|
144
139
|
|
|
@@ -704,7 +699,7 @@ Permission level is controlled by /config permission <level>.`,
|
|
|
704
699
|
|
|
705
700
|
const promptAuditCmd: CommandHandler = async () => {
|
|
706
701
|
const { existsSync, readFileSync, readdirSync, statSync } = await import('node:fs')
|
|
707
|
-
const { join,
|
|
702
|
+
const { join, basename } = await import('node:path')
|
|
708
703
|
const cwd = process.cwd()
|
|
709
704
|
|
|
710
705
|
// Patterns that suggest prompts written for older/less-capable models
|
package/src/config/loader.ts
CHANGED
package/src/core/hooks.ts
CHANGED
package/src/core/rules-loader.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { readdirSync, readFileSync, existsSync } from 'node:fs'
|
|
21
|
-
import { join
|
|
21
|
+
import { join } from 'node:path'
|
|
22
22
|
|
|
23
23
|
interface RuleFile {
|
|
24
24
|
name: string
|
|
@@ -146,7 +146,7 @@ export class RulesLoader {
|
|
|
146
146
|
*/
|
|
147
147
|
private parseRule(
|
|
148
148
|
raw: string,
|
|
149
|
-
|
|
149
|
+
_filename: string,
|
|
150
150
|
): { paths: string[]; description: string; content: string } {
|
|
151
151
|
const match = raw.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/)
|
|
152
152
|
if (!match) {
|
package/src/skills/registry.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* from remote sources (GitHub repos, direct URLs).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { existsSync, mkdirSync, writeFileSync, readdirSync, unlinkSync
|
|
8
|
+
import { existsSync, mkdirSync, writeFileSync, readdirSync, unlinkSync } from 'node:fs'
|
|
9
9
|
import { join } from 'node:path'
|
|
10
10
|
import { homedir } from 'node:os'
|
|
11
11
|
import { spawnSync } from 'node:child_process'
|
package/src/tools/agent/skill.ts
CHANGED
|
@@ -129,7 +129,7 @@ export const enterWorktreeTool: ToolDefinition = {
|
|
|
129
129
|
['git', 'worktree', 'add', '-b', branchName, worktreePath, resolvedBaseRef],
|
|
130
130
|
{ cwd, stdout: 'pipe', stderr: 'pipe' },
|
|
131
131
|
)
|
|
132
|
-
const
|
|
132
|
+
const _stdout = await new Response(proc.stdout).text()
|
|
133
133
|
const exitCode = await proc.exited
|
|
134
134
|
|
|
135
135
|
if (exitCode !== 0) {
|
package/src/ui/app.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import type { QueryEngine } from '../core/engine'
|
|
|
5
5
|
import type { MiphamConfig } from '../shared/index.ts'
|
|
6
6
|
import type { SkillsLoader } from '../skills/loader'
|
|
7
7
|
import type { PluginManager } from '../plugin/plugin-manager'
|
|
8
|
-
import {
|
|
8
|
+
import { setPreference } from '../config/preferences'
|
|
9
9
|
import { AgentRegistry } from '../agent/agent-registry'
|
|
10
10
|
import { getBackgroundAgentRegistry } from '../agent/background-registry'
|
|
11
11
|
import { ChatPanel } from './chat'
|
|
@@ -133,9 +133,9 @@ export function App({
|
|
|
133
133
|
const [providerId, setProviderId] = useState(initialProvider || config.defaultProvider)
|
|
134
134
|
const [modelId, setModelId] = useState(initialModel || config.defaultModel)
|
|
135
135
|
const [pickerOpen, setPickerOpen] = useState(false)
|
|
136
|
-
const [
|
|
137
|
-
const [
|
|
138
|
-
const [
|
|
136
|
+
const [_sessionTitle, setSessionTitle] = useState('')
|
|
137
|
+
const [_fastMode, setFastMode] = useState(false)
|
|
138
|
+
const [_effort, setEffort] = useState('high')
|
|
139
139
|
const [focusMode, setFocusMode] = useState(false)
|
|
140
140
|
const [_ultracodeMode, setUltracodeMode] = useState(false)
|
|
141
141
|
const [goalText, setGoalText] = useState('')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useMemo, useEffect } from 'react'
|
|
2
2
|
import { Box, Text, useInput } from 'ink'
|
|
3
3
|
import TextInput from 'ink-text-input'
|
|
4
|
-
import { getCommandList
|
|
4
|
+
import { getCommandList } from './commands.js'
|
|
5
5
|
|
|
6
6
|
interface CommandPickerProps {
|
|
7
7
|
/** Text already typed (e.g. "/", "/age") — used as initial filter */
|
|
@@ -53,7 +53,7 @@ export function CommandPicker({
|
|
|
53
53
|
Math.min(cursorIdx - Math.floor(maxVisible / 2), filtered.length - maxVisible),
|
|
54
54
|
)
|
|
55
55
|
const visible = filtered.slice(scrollStart, scrollStart + maxVisible)
|
|
56
|
-
const
|
|
56
|
+
const _adjustedCursor = cursorIdx - scrollStart
|
|
57
57
|
|
|
58
58
|
// Wrap cursor safely
|
|
59
59
|
const safeCursor = (i: number) =>
|
package/src/ui/commands.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { SkillsLoader } from '../skills/loader'
|
|
|
10
10
|
import type { PluginManager } from '../plugin/plugin-manager'
|
|
11
11
|
import type { Message } from '../shared/types.js'
|
|
12
12
|
import { McpClient } from '../mcp/client'
|
|
13
|
-
import {
|
|
13
|
+
import { NPM_UPDATE_COMMAND, PACKAGE_VERSION } from '../shared/index.ts'
|
|
14
14
|
import { getPreference } from '../config/preferences'
|
|
15
15
|
import { stripIndent } from './strip-indent.js'
|
|
16
16
|
import {
|
package/src/ui/input.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, useMemo } from 'react'
|
|
|
2
2
|
import { Box, Text, useInput } from 'ink'
|
|
3
3
|
import TextInput from 'ink-text-input'
|
|
4
4
|
import { VimMotionEngine, type VimMode } from './vim-motions.js'
|
|
5
|
-
import { getCommandList
|
|
5
|
+
import { getCommandList } from './commands.js'
|
|
6
6
|
import { CommandPicker } from './command-picker.js'
|
|
7
7
|
|
|
8
8
|
interface InputBarProps {
|
|
@@ -389,7 +389,7 @@ export function InputBar({
|
|
|
389
389
|
{slashHints.length > 0 && vimMode === 'insert' && !pickerActive && (
|
|
390
390
|
<Box marginTop={1} flexDirection="column" gap={1}>
|
|
391
391
|
<Text dimColor>Commands: </Text>
|
|
392
|
-
{slashHints.map((cmd,
|
|
392
|
+
{slashHints.map((cmd, _i) => (
|
|
393
393
|
<Text key={cmd.name} color="cyan">
|
|
394
394
|
{cmd.name}
|
|
395
395
|
</Text>
|