@miphamai/cli 0.85.54 → 0.85.55
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 +1 -1
- package/src/agent/sub-agent.ts +18 -2
- package/src/agent/types.ts +9 -0
- package/src/config/loader.ts +60 -0
- package/src/core/command-taps.ts +10 -0
- package/src/core/engine.ts +306 -2
- package/src/core/instructions.ts +1 -1
- package/src/core/review-gate.ts +192 -0
- package/src/core/task-performance-tasks.json +18 -0
- package/src/core/verification-baseline.ts +277 -0
- package/src/core/write-paths.ts +19 -0
- package/src/daemon/engine-capabilities.ts +22 -1
- package/src/i18n-core/locales/en-US.json +4 -0
- package/src/i18n-core/locales/zh-CN.json +4 -0
- package/src/index.tsx +25 -0
- package/src/shared/package-info.ts +2 -2
- package/src/shared/types.ts +11 -0
- package/src/skills/fork-executor.ts +3 -2
- package/src/tools/agent/skill.ts +1 -0
- package/src/tools/agent/workflow.ts +1 -0
- package/src/ui/commands.ts +8 -0
- package/src/workflow/primitives/agent.ts +4 -1
- package/src/workflow/runtime.ts +4 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SubAgent } from '../agent/sub-agent'
|
|
2
2
|
import type { ProviderRegistry } from '../providers/registry'
|
|
3
3
|
import type { Llm } from '../providers/llm'
|
|
4
|
-
import type { ToolDefinition, SkillDefinition } from '../shared/index.ts'
|
|
4
|
+
import type { ToolDefinition, SkillDefinition, ToolContext } from '../shared/index.ts'
|
|
5
5
|
import type { AgentDefinition } from '../agent/types'
|
|
6
6
|
import type { PermissionSystem } from '../core/permission'
|
|
7
7
|
import type { SubAgentServices } from '../agent/services'
|
|
@@ -24,6 +24,7 @@ export async function executeForkedSkill(
|
|
|
24
24
|
permissionSystem?: PermissionSystem,
|
|
25
25
|
llm?: Llm,
|
|
26
26
|
services?: SubAgentServices,
|
|
27
|
+
toolContext?: Partial<ToolContext>,
|
|
27
28
|
): Promise<string> {
|
|
28
29
|
const agentDef: AgentDefinition = {
|
|
29
30
|
name: `skill:${skill.name}`,
|
|
@@ -49,7 +50,7 @@ export async function executeForkedSkill(
|
|
|
49
50
|
? `Execute the "${skill.name}" skill with arguments: ${args}`
|
|
50
51
|
: `Execute the "${skill.name}" skill.`
|
|
51
52
|
|
|
52
|
-
return sub.execute(prompt, `skill:${skill.name}`, { agentDef })
|
|
53
|
+
return sub.execute(prompt, `skill:${skill.name}`, { agentDef, toolContext })
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
function buildSkillSystemPrompt(skill: SkillDefinition): string {
|
package/src/tools/agent/skill.ts
CHANGED
package/src/ui/commands.ts
CHANGED
|
@@ -620,6 +620,13 @@ const statusCmd: CommandHandler = async (ctx) => {
|
|
|
620
620
|
.filter((p) => p.status !== 'upcoming')
|
|
621
621
|
.map((p) => `${p.id} ${health.get(p.id) ? '🟢' : '🔴'}`)
|
|
622
622
|
.join(' ')
|
|
623
|
+
// Only the engine knows what it actually wired. A remote stub without the
|
|
624
|
+
// accessor omits the row instead of showing a guess.
|
|
625
|
+
const selfCheck = (
|
|
626
|
+
ctx.engine as QueryEngine & {
|
|
627
|
+
getSelfCheckStatus?: () => { reviewGate: boolean; verification: boolean }
|
|
628
|
+
}
|
|
629
|
+
).getSelfCheckStatus?.()
|
|
623
630
|
|
|
624
631
|
return {
|
|
625
632
|
content: stripIndent`
|
|
@@ -630,6 +637,7 @@ const statusCmd: CommandHandler = async (ctx) => {
|
|
|
630
637
|
${t('commands.status.tokens')} ~${c.getEstimatedTokens().toLocaleString()} / ${c.getMaxTokens().toLocaleString()}
|
|
631
638
|
${t('commands.status.tools')} ${tools.size} ${t('commands.status.loaded')}
|
|
632
639
|
${t('commands.status.permission')} ${liveMode(ctx)}
|
|
640
|
+
${selfCheck ? `Self-check review=${selfCheck.reviewGate ? 'on' : 'off'} verification=${selfCheck.verification ? 'on' : 'off'}` : ''}
|
|
633
641
|
Telemetry ${telemetryStatus(ctx)}
|
|
634
642
|
|
|
635
643
|
${t('commands.status.system_title')}
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path'
|
|
|
2
2
|
import { SubAgent } from '../../agent/sub-agent'
|
|
3
3
|
import type { ProviderRegistry } from '../../providers/registry'
|
|
4
4
|
import type { Llm } from '../../providers/llm'
|
|
5
|
-
import type { ToolDefinition } from '../../shared/index.ts'
|
|
5
|
+
import type { ToolDefinition, ToolContext } from '../../shared/index.ts'
|
|
6
6
|
import type { PermissionSystem } from '../../core/permission'
|
|
7
7
|
import type { SubAgentServices } from '../../agent/services'
|
|
8
8
|
import { worktreeRoot } from '../../core/paths.ts'
|
|
@@ -40,6 +40,8 @@ export interface WorkflowAgentOpts {
|
|
|
40
40
|
permissionSystem?: PermissionSystem
|
|
41
41
|
/** Hooks, gates and DLP handed down by the engine running the workflow. */
|
|
42
42
|
services?: SubAgentServices
|
|
43
|
+
/** Write tracking handed down by the engine (the review gate is one consumer). */
|
|
44
|
+
toolContext?: Partial<ToolContext>
|
|
43
45
|
/** Run the agent in an isolated git worktree (optional). */
|
|
44
46
|
isolation?: 'worktree'
|
|
45
47
|
/**
|
|
@@ -173,6 +175,7 @@ export async function workflowAgent(
|
|
|
173
175
|
effort: opts.effort,
|
|
174
176
|
allowedTools: undefined, // use all tools by default
|
|
175
177
|
worktreePath,
|
|
178
|
+
toolContext: opts.toolContext,
|
|
176
179
|
signal: opts.signal,
|
|
177
180
|
// The prompt is computed by the script, not typed by the user — say so,
|
|
178
181
|
// so text the script relayed from a file or another agent cannot pass
|
package/src/workflow/runtime.ts
CHANGED
|
@@ -152,6 +152,10 @@ export async function runWorkflow(
|
|
|
152
152
|
...(opts || {}),
|
|
153
153
|
permissionSystem: permission,
|
|
154
154
|
services: engine.getSubAgentServices(),
|
|
155
|
+
// Stub engines (the Workflow tool's, older tests) may predate this
|
|
156
|
+
// accessor; a missing write tap must not fail the whole run.
|
|
157
|
+
toolContext:
|
|
158
|
+
typeof engine.getToolContext === 'function' ? engine.getToolContext() : undefined,
|
|
155
159
|
signal: controller.signal,
|
|
156
160
|
} as Record<string, unknown>,
|
|
157
161
|
llm,
|