@miphamai/cli 0.85.12 → 0.85.14
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/README.md +1 -1
- package/package.json +6 -6
- package/src/agent/sub-agent.ts +15 -1
- package/src/config/loader.ts +78 -3
- package/src/core/credential-masker/output-scrub.ts +120 -7
- package/src/core/engine.ts +79 -12
- package/src/core/permission-classifier.ts +36 -12
- package/src/core/permission.ts +45 -0
- package/src/core/self-critique.ts +3 -15
- package/src/i18n-core/locales/en-US.json +3 -0
- package/src/i18n-core/locales/zh-CN.json +3 -0
- package/src/index.tsx +15 -1
- package/src/mcp/oauth.ts +14 -0
- package/src/plugin/plugin-manager.ts +19 -1
- package/src/providers/anthropic.ts +38 -3
- package/src/providers/openai-compat.ts +3 -1
- package/src/providers/registry.ts +38 -0
- package/src/security/world-writable-chmod.ts +157 -0
- package/src/shared/package-info.ts +2 -2
- package/src/shared/types.ts +35 -0
- package/src/tools/agent/send-message.ts +9 -2
- package/src/ui/command-picker.tsx +0 -1
- package/src/ui/commands.ts +17 -5
- package/src/ui/input.tsx +10 -1
|
@@ -85,7 +85,6 @@ export function CommandPicker({
|
|
|
85
85
|
Math.min(cursorIdx.value - Math.floor(maxVisible / 2), filtered.length - maxVisible),
|
|
86
86
|
)
|
|
87
87
|
const visible = filtered.slice(scrollStart, scrollStart + maxVisible)
|
|
88
|
-
const _adjustedCursor = cursorIdx.value - scrollStart
|
|
89
88
|
|
|
90
89
|
// Wrap cursor safely
|
|
91
90
|
const safeCursor = (i: number) =>
|
package/src/ui/commands.ts
CHANGED
|
@@ -5117,7 +5117,13 @@ const loginCmd: CommandHandler = (ctx) => {
|
|
|
5117
5117
|
|
|
5118
5118
|
for (const p of activeProviders) {
|
|
5119
5119
|
const envVar = providerEnvMap[p.id] ?? `${p.id.toUpperCase()}_API_KEY`
|
|
5120
|
-
|
|
5120
|
+
// An env var is only one of the two ways a provider gets a key: `ctx.config`
|
|
5121
|
+
// already carries the merged (and, for `enc:v1:`, decrypted) `apiKey` from
|
|
5122
|
+
// config.yml. An env-only check reports a fully configured provider as ⬜.
|
|
5123
|
+
// Reuse `isApiKeyMissing` — the same predicate `/switch` uses — so the two
|
|
5124
|
+
// readouts agree on what "has a key" means (and an empty row stays ⬜).
|
|
5125
|
+
const configSet = !isApiKeyMissing(p.apiKey)
|
|
5126
|
+
const isSet = (typeof process !== 'undefined' && !!process.env[envVar]) || configSet
|
|
5121
5127
|
const icon = isSet ? '✅' : '⬜'
|
|
5122
5128
|
lines.push(` ${icon} ${p.id.padEnd(14)} $${envVar}${isSet ? ' (set)' : ''}`)
|
|
5123
5129
|
}
|
|
@@ -5439,7 +5445,7 @@ const forkCmd: CommandHandler = async (ctx, args) => {
|
|
|
5439
5445
|
}
|
|
5440
5446
|
}
|
|
5441
5447
|
|
|
5442
|
-
const { execSync } = await import('node:child_process')
|
|
5448
|
+
const { execSync, execFileSync } = await import('node:child_process')
|
|
5443
5449
|
const { join } = await import('node:path')
|
|
5444
5450
|
|
|
5445
5451
|
try {
|
|
@@ -5463,15 +5469,21 @@ const forkCmd: CommandHandler = async (ctx, args) => {
|
|
|
5463
5469
|
const wtPath = join(worktreeRoot(process.cwd()), name)
|
|
5464
5470
|
|
|
5465
5471
|
try {
|
|
5466
|
-
|
|
5472
|
+
// argv array, no shell — `wtPath` is derived from the current directory and can
|
|
5473
|
+
// contain a space or a metacharacter, which a shell string would split or misfire on.
|
|
5474
|
+
// Same reason the add/remove/branch trio all go through execFileSync here.
|
|
5475
|
+
execFileSync('git', ['worktree', 'add', '-b', branch, wtPath, 'HEAD'], {
|
|
5476
|
+
stdio: 'ignore',
|
|
5477
|
+
timeout: 30_000,
|
|
5478
|
+
})
|
|
5467
5479
|
} catch (err) {
|
|
5468
5480
|
try {
|
|
5469
|
-
|
|
5481
|
+
execFileSync('git', ['worktree', 'remove', '--force', wtPath], { stdio: 'ignore' })
|
|
5470
5482
|
} catch {
|
|
5471
5483
|
/* ok */
|
|
5472
5484
|
}
|
|
5473
5485
|
try {
|
|
5474
|
-
|
|
5486
|
+
execFileSync('git', ['branch', '-D', branch], { stdio: 'ignore' })
|
|
5475
5487
|
} catch {
|
|
5476
5488
|
/* ok */
|
|
5477
5489
|
}
|
package/src/ui/input.tsx
CHANGED
|
@@ -356,7 +356,16 @@ export function InputBar({
|
|
|
356
356
|
if (!value.startsWith('/')) return []
|
|
357
357
|
const filter = value.slice(1).toLowerCase()
|
|
358
358
|
if (!filter) return allCommands.slice(0, 12) // show first 12 when just "/"
|
|
359
|
-
|
|
359
|
+
// Match name OR description — the same rule the CommandPicker uses. A name-only
|
|
360
|
+
// filter hid commands a user was plainly looking for ("fork" should surface a
|
|
361
|
+
// command described as "fork the conversation"), so the two slash surfaces now
|
|
362
|
+
// agree on one semantic.
|
|
363
|
+
return allCommands
|
|
364
|
+
.filter(
|
|
365
|
+
(c) =>
|
|
366
|
+
c.name.toLowerCase().includes(filter) || c.description.toLowerCase().includes(filter),
|
|
367
|
+
)
|
|
368
|
+
.slice(0, 8)
|
|
360
369
|
}, [value, allCommands])
|
|
361
370
|
|
|
362
371
|
// ── @mention hints (cross-session recipients) ──
|