minimal-agent 0.18.13 → 0.18.15
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 +2 -2
- package/package.json +1 -3
- package/plugins/workflow-runner/src/runtime/context.js +1 -1
- package/plugins/workflow-runner/src/runtime/context.ts +1 -1
- package/plugins/workflow-runner/test/embeddedExecution.test.ts +2 -5
- package/plugins/workflow-runner/test/execLifetime.test.ts +15 -2
- package/skills/ssh-remote-dev/SKILL.md +61 -0
- package/skills/ssh-remote-dev/agents/openai.yaml +4 -0
- package/src/advisor/README.md +62 -24
- package/src/advisor/advisorNudge.js +199 -0
- package/src/advisor/advisorNudge.ts +232 -0
- package/src/advisor/deliveryReview.js +35 -12
- package/src/advisor/deliveryReview.ts +35 -11
- package/src/advisor/presentation.js +7 -10
- package/src/advisor/presentation.ts +10 -13
- package/src/advisor/reviewContext.js +22 -58
- package/src/advisor/reviewContext.ts +24 -67
- package/src/cli/configMenu.js +17 -128
- package/src/cli/configMenu.tsx +17 -193
- package/src/cli/print.js +2 -0
- package/src/cli/print.ts +2 -0
- package/src/cli/streamJson.js +2 -0
- package/src/cli/streamJson.ts +2 -0
- package/src/cli/wizards/advisorWizard.js +9 -7
- package/src/cli/wizards/advisorWizard.tsx +9 -7
- package/src/cli/wizards/contextAdvisorWizard.js +9 -7
- package/src/cli/wizards/contextAdvisorWizard.tsx +9 -7
- package/src/cli/wizards/providerPresets.js +55 -18
- package/src/cli/wizards/providerPresets.ts +72 -19
- package/src/cli/wizards/providerWizard.js +51 -10
- package/src/cli/wizards/providerWizard.tsx +59 -9
- package/src/config/configDefaults.js +1 -1
- package/src/config/configDefaults.ts +1 -1
- package/src/config/configDiagnostics.js +1 -21
- package/src/config/configDiagnostics.ts +3 -23
- package/src/config/configFile.js +11 -4
- package/src/config/configFile.ts +27 -7
- package/src/config/configManagement.js +1 -0
- package/src/config/configManagement.ts +2 -0
- package/src/config/configService.js +12 -8
- package/src/config/configService.ts +16 -11
- package/src/config/numericLimits.js +0 -4
- package/src/config/numericLimits.ts +0 -4
- package/src/config/reasoningEffort.js +16 -0
- package/src/config/reasoningEffort.ts +18 -0
- package/src/context/budgetPlan.js +1 -1
- package/src/context/budgetPlan.ts +1 -1
- package/src/context/optimizeConversation.js +1 -1
- package/src/context/optimizeConversation.ts +1 -1
- package/src/harness/stallGuard.js +8 -13
- package/src/harness/stallGuard.ts +8 -12
- package/src/llm/client.js +64 -17
- package/src/llm/client.ts +62 -7
- package/src/llm/providers/anthropicFormat.js +3 -1
- package/src/llm/providers/anthropicFormat.ts +4 -1
- package/src/llm/providers/openaiFormat.js +14 -3
- package/src/llm/providers/openaiFormat.ts +17 -3
- package/src/llm/providers/responsesFormat.js +277 -0
- package/src/llm/providers/responsesFormat.ts +308 -0
- package/src/loop/README.md +18 -3
- package/src/loop/liveDiagramGate.js +63 -0
- package/src/loop/liveDiagramGate.ts +61 -0
- package/src/loop/messages.js +12 -0
- package/src/loop/messages.ts +13 -0
- package/src/loop/options.ts +7 -2
- package/src/loop/toolBatch.js +0 -1
- package/src/loop/toolBatch.ts +0 -1
- package/src/loop/toolExecutor.js +11 -46
- package/src/loop/toolExecutor.ts +12 -55
- package/src/loop/toolPresentation.js +2 -13
- package/src/loop/toolPresentation.ts +2 -13
- package/src/loop/toolSemantics.js +3 -4
- package/src/loop/toolSemantics.ts +4 -6
- package/src/loop.js +222 -214
- package/src/loop.ts +226 -232
- package/src/memory/dependencies.js +11 -3
- package/src/memory/dependencies.ts +11 -3
- package/src/memory/episodicMemory.js +59 -18
- package/src/memory/episodicMemory.ts +58 -18
- package/src/memory/experienceStore.js +4 -3
- package/src/memory/experienceStore.ts +4 -3
- package/src/memory/factCandidates.js +53 -1
- package/src/memory/factCandidates.ts +54 -1
- package/src/memory/factLearning.js +2 -2
- package/src/memory/factLearning.ts +2 -2
- package/src/memory/jobPolicy.js +24 -5
- package/src/memory/jobPolicy.ts +25 -5
- package/src/memory/learning.js +2 -2
- package/src/memory/learning.ts +2 -2
- package/src/memory/learningModel.js +7 -0
- package/src/memory/learningModel.ts +7 -0
- package/src/memory/managementService.js +8 -7
- package/src/memory/managementService.ts +16 -8
- package/src/memory/memoryService.js +104 -33
- package/src/memory/memoryService.ts +132 -28
- package/src/memory/projectKnowledge.js +39 -3
- package/src/memory/projectKnowledge.ts +45 -3
- package/src/memory/recallQuery.js +56 -0
- package/src/memory/recallQuery.ts +58 -0
- package/src/memory/retrieval.js +39 -10
- package/src/memory/retrieval.ts +46 -11
- package/src/memory/turnJournal.js +75 -10
- package/src/memory/turnJournal.ts +66 -10
- package/src/memory/types.ts +7 -1
- package/src/prompts/delegation.js +2 -1
- package/src/prompts/delegation.ts +3 -1
- package/src/prompts/policyRegistry.js +9 -12
- package/src/prompts/policyRegistry.ts +9 -12
- package/src/prompts/promptAssembly.js +6 -5
- package/src/prompts/promptAssembly.ts +8 -6
- package/src/prompts/visualPresentation.js +39 -10
- package/src/prompts/visualPresentation.ts +38 -9
- package/src/runtime/answerPreparation.js +1 -1
- package/src/runtime/answerPreparation.ts +1 -1
- package/src/runtime/commandCatalog.js +1 -0
- package/src/runtime/commandCatalog.ts +9 -0
- package/src/runtime/fileLock.js +19 -3
- package/src/runtime/fileLock.ts +19 -3
- package/src/runtime/invocationPolicy.js +1 -1
- package/src/runtime/invocationPolicy.ts +1 -1
- package/src/runtime/outputContract.js +0 -4
- package/src/runtime/outputContract.ts +0 -7
- package/src/session/runAgentTurn.js +3 -0
- package/src/session/runAgentTurn.ts +3 -0
- package/src/team/onlineToolContract.js +0 -1
- package/src/team/onlineToolContract.ts +0 -1
- package/src/tools/advisor/advisor.js +207 -365
- package/src/tools/advisor/advisor.ts +211 -383
- package/src/tools/agent/agentTypes.js +0 -1
- package/src/tools/agent/agentTypes.ts +0 -1
- package/src/tools/agent/coordinator.js +4 -1
- package/src/tools/agent/coordinator.ts +4 -1
- package/src/tools/bash/semantics.js +4 -5
- package/src/tools/bash/semantics.ts +4 -5
- package/src/tools/capabilities.js +2 -3
- package/src/tools/capabilities.ts +2 -4
- package/src/tools/index.js +0 -16
- package/src/tools/index.ts +0 -16
- package/src/tools/memory/maintenance.js +8 -9
- package/src/tools/memory/maintenance.ts +13 -11
- package/src/tools/memory/memory.js +5 -1
- package/src/tools/memory/memory.ts +5 -0
- package/src/tools/optimizeConversation/README.md +4 -6
- package/src/tools/toolPromptGuides.js +2 -9
- package/src/tools/toolPromptGuides.ts +2 -9
- package/src/types.ts +28 -105
- package/src/ui/App.js +22 -1
- package/src/ui/App.tsx +26 -1
- package/src/ui/MessageList.js +8 -44
- package/src/ui/MessageList.tsx +3 -81
- package/src/ui/effortCommand.js +19 -0
- package/src/ui/effortCommand.ts +36 -0
- package/src/ui/hooks/useChat.js +2 -0
- package/src/ui/hooks/useChat.ts +2 -0
- package/src/ui/toolProgress.js +1 -1
- package/src/ui/toolProgress.ts +1 -1
- package/src/web/protocol.ts +10 -3
- package/src/advisor/advisorCoordinator.js +0 -734
- package/src/advisor/advisorCoordinator.ts +0 -825
- package/src/cli/wizards/sshHostWizard.js +0 -156
- package/src/cli/wizards/sshHostWizard.tsx +0 -214
- package/src/context/sshHosts.js +0 -290
- package/src/context/sshHosts.ts +0 -312
- package/src/loop/publication.js +0 -94
- package/src/loop/publication.ts +0 -124
- package/src/runtime/finalAnswer.js +0 -9
- package/src/runtime/finalAnswer.ts +0 -13
- package/src/tools/advisor/advisorDecision.js +0 -79
- package/src/tools/advisor/advisorDecision.ts +0 -92
- package/src/tools/ssh/ssh.js +0 -152
- package/src/tools/ssh/ssh.ts +0 -167
- package/src/tools/ssh/sshAvailability.js +0 -35
- package/src/tools/ssh/sshAvailability.ts +0 -39
- package/src/tools/ssh/sshClient.js +0 -177
- package/src/tools/ssh/sshClient.ts +0 -189
- package/src/tools/ssh/sshDownload.js +0 -77
- package/src/tools/ssh/sshDownload.ts +0 -92
- package/src/tools/ssh/sshHostsTool.js +0 -36
- package/src/tools/ssh/sshHostsTool.ts +0 -48
- package/src/tools/ssh/sshUpload.js +0 -72
- package/src/tools/ssh/sshUpload.ts +0 -85
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { REASONING_EFFORTS } from '../config/reasoningEffort.js';
|
|
2
|
+
const CLEAR_WORDS = new Set(['auto', 'default', 'unset', 'reset']);
|
|
3
|
+
export function parseEffortCommand(input) {
|
|
4
|
+
const match = /^\/effort(?:\s+(\S+))?\s*$/i.exec(input.trim());
|
|
5
|
+
if (!match)
|
|
6
|
+
return { matched: false };
|
|
7
|
+
const arg = match[1]?.toLowerCase();
|
|
8
|
+
if (!arg)
|
|
9
|
+
return { matched: true, action: 'show' };
|
|
10
|
+
if (CLEAR_WORDS.has(arg))
|
|
11
|
+
return { matched: true, action: 'set', effort: null };
|
|
12
|
+
if (REASONING_EFFORTS.includes(arg)) {
|
|
13
|
+
return { matched: true, action: 'set', effort: arg };
|
|
14
|
+
}
|
|
15
|
+
return { matched: true, action: 'invalid', input: arg };
|
|
16
|
+
}
|
|
17
|
+
export function effortChoicesText() {
|
|
18
|
+
return `${REASONING_EFFORTS.join(' / ')} / auto`;
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { REASONING_EFFORTS, type ReasoningEffort } from '../config/reasoningEffort.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `/effort [档位|auto]` 的纯解析(可单测)。只改当前 Session 的运行时 provider,
|
|
5
|
+
* 与 `/model` 同语义:不写回 config.json,进程重启后恢复配置里的值。
|
|
6
|
+
*
|
|
7
|
+
* - `/effort` → 显示当前档位与可选项
|
|
8
|
+
* - `/effort high` → 切到该档位
|
|
9
|
+
* - `/effort auto` → 不再发送该参数,沿用服务端对该模型的默认强度(也认 default / unset / off 以外的别名见下)
|
|
10
|
+
*
|
|
11
|
+
* 档位取值是各家文档出现过的并集,具体某个模型接不接受由服务端裁决:被拒绝时 client.ts
|
|
12
|
+
* 会去掉参数重发并告警,所以这里不替用户猜"这个模型支持哪几档"。
|
|
13
|
+
*/
|
|
14
|
+
export type EffortCommand =
|
|
15
|
+
| { matched: false }
|
|
16
|
+
| { matched: true; action: 'show' }
|
|
17
|
+
| { matched: true; action: 'set'; effort: ReasoningEffort | null }
|
|
18
|
+
| { matched: true; action: 'invalid'; input: string };
|
|
19
|
+
|
|
20
|
+
const CLEAR_WORDS = new Set(['auto', 'default', 'unset', 'reset']);
|
|
21
|
+
|
|
22
|
+
export function parseEffortCommand(input: string): EffortCommand {
|
|
23
|
+
const match = /^\/effort(?:\s+(\S+))?\s*$/i.exec(input.trim());
|
|
24
|
+
if (!match) return { matched: false };
|
|
25
|
+
const arg = match[1]?.toLowerCase();
|
|
26
|
+
if (!arg) return { matched: true, action: 'show' };
|
|
27
|
+
if (CLEAR_WORDS.has(arg)) return { matched: true, action: 'set', effort: null };
|
|
28
|
+
if ((REASONING_EFFORTS as readonly string[]).includes(arg)) {
|
|
29
|
+
return { matched: true, action: 'set', effort: arg as ReasoningEffort };
|
|
30
|
+
}
|
|
31
|
+
return { matched: true, action: 'invalid', input: arg };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function effortChoicesText(): string {
|
|
35
|
+
return `${REASONING_EFFORTS.join(' / ')} / auto`;
|
|
36
|
+
}
|
package/src/ui/hooks/useChat.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* 用 version 计数器驱动 setState 触发 re-render 是更顺手的写法。
|
|
15
15
|
* ============================================================
|
|
16
16
|
*/
|
|
17
|
+
import { previousUserRequest } from '../../memory/recallQuery.js';
|
|
17
18
|
import { stat } from 'node:fs/promises';
|
|
18
19
|
import { createTurnSummary } from '../turnSummary.js';
|
|
19
20
|
import { isRecoverableLoopError } from '../../runtime/eventSemantics.js';
|
|
@@ -529,6 +530,7 @@ export function useChat(args) {
|
|
|
529
530
|
surface: 'tui',
|
|
530
531
|
cwd: effectiveCwd,
|
|
531
532
|
currentUserInput: trimmed,
|
|
533
|
+
previousUserInput: previousUserRequest(historyRef.current),
|
|
532
534
|
workspaceId: workspace?.id,
|
|
533
535
|
sessionId: activeSessionIdRef.current,
|
|
534
536
|
interactiveAsk: true,
|
package/src/ui/hooks/useChat.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* ============================================================
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
import { previousUserRequest } from '../../memory/recallQuery.js';
|
|
18
19
|
import { stat } from 'node:fs/promises';
|
|
19
20
|
import { createTurnSummary } from '../turnSummary.js';
|
|
20
21
|
import { isRecoverableLoopError } from '../../runtime/eventSemantics.js';
|
|
@@ -829,6 +830,7 @@ export function useChat(args: {
|
|
|
829
830
|
surface: 'tui',
|
|
830
831
|
cwd: effectiveCwd,
|
|
831
832
|
currentUserInput: trimmed,
|
|
833
|
+
previousUserInput: previousUserRequest(historyRef.current),
|
|
832
834
|
workspaceId: workspace?.id,
|
|
833
835
|
sessionId: activeSessionIdRef.current,
|
|
834
836
|
interactiveAsk: true,
|
package/src/ui/toolProgress.js
CHANGED
|
@@ -38,7 +38,7 @@ export function toolBatchSummary(calls, maxItems = 2) {
|
|
|
38
38
|
}
|
|
39
39
|
/** 成功的普通工具结果不写 scrollback;失败和高价值结果仍保留。 */
|
|
40
40
|
export function toolHistoryVisibility(toolName, content) {
|
|
41
|
-
if (toolName === 'Advisor' || toolName === '
|
|
41
|
+
if (toolName === 'Advisor' || toolName === 'PresentResult'
|
|
42
42
|
|| toolName === 'RememberMemory' || toolName === 'UpdateMemory' || toolName === 'ForgetMemory'
|
|
43
43
|
|| toolName === 'ConfirmMemory' || toolName === 'SetPersona' || toolName === 'ClearPersona')
|
|
44
44
|
return 'full';
|
package/src/ui/toolProgress.ts
CHANGED
|
@@ -43,7 +43,7 @@ export type ToolHistoryVisibility = 'hidden' | 'compact' | 'full';
|
|
|
43
43
|
|
|
44
44
|
/** 成功的普通工具结果不写 scrollback;失败和高价值结果仍保留。 */
|
|
45
45
|
export function toolHistoryVisibility(toolName: string | undefined, content: string): ToolHistoryVisibility {
|
|
46
|
-
if (toolName === 'Advisor' || toolName === '
|
|
46
|
+
if (toolName === 'Advisor' || toolName === 'PresentResult'
|
|
47
47
|
|| toolName === 'RememberMemory' || toolName === 'UpdateMemory' || toolName === 'ForgetMemory'
|
|
48
48
|
|| toolName === 'ConfirmMemory' || toolName === 'SetPersona' || toolName === 'ClearPersona') return 'full';
|
|
49
49
|
if (toolName === 'Agent') return 'compact';
|
package/src/web/protocol.ts
CHANGED
|
@@ -295,7 +295,10 @@ export interface SkillInfo {
|
|
|
295
295
|
unavailableReason?: string;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
export type ApiFormat = 'openai' | 'anthropic';
|
|
298
|
+
export type ApiFormat = 'openai' | 'openai-responses' | 'anthropic';
|
|
299
|
+
|
|
300
|
+
/** 推理强度;缺省 = 不发送,沿用服务端对该模型的默认强度。 */
|
|
301
|
+
export type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
299
302
|
|
|
300
303
|
/** 模型列表的一个条目(脱敏视图——apiKey 只给 configured 布尔位,不下发原文)。 */
|
|
301
304
|
export interface ModelView {
|
|
@@ -317,6 +320,7 @@ export interface ModelView {
|
|
|
317
320
|
contextWindow: number;
|
|
318
321
|
maxTokens?: number;
|
|
319
322
|
supportsVision?: boolean;
|
|
323
|
+
reasoningEffort?: ReasoningEffort;
|
|
320
324
|
promptCache?: { mode: 'auto' | 'session-key' | 'disabled' };
|
|
321
325
|
enabled: boolean;
|
|
322
326
|
updatedAt: number;
|
|
@@ -347,10 +351,11 @@ export interface WebchatConfig {
|
|
|
347
351
|
configured: boolean;
|
|
348
352
|
enabled: boolean;
|
|
349
353
|
mode: 'auto' | 'manual';
|
|
354
|
+
/** remind = 只提醒;followup = 实质回答未复核时再请求一次,让模型自己补问顾问。 */
|
|
355
|
+
enforcement: 'remind' | 'followup';
|
|
350
356
|
/** 引用 models[].id;null = 未选。顾问不再自带一整套独立凭据。 */
|
|
351
357
|
modelId: string | null;
|
|
352
358
|
contextPolicy: 'full-relevant';
|
|
353
|
-
shareSensitive: boolean;
|
|
354
359
|
inputTokenBudget: number;
|
|
355
360
|
timeoutMs: number;
|
|
356
361
|
};
|
|
@@ -413,6 +418,8 @@ export interface ModelPatchFields {
|
|
|
413
418
|
contextWindow?: number;
|
|
414
419
|
maxTokens?: number;
|
|
415
420
|
supportsVision?: boolean;
|
|
421
|
+
/** update 时 null = 清除,回到服务端对该模型的默认强度。 */
|
|
422
|
+
reasoningEffort?: ReasoningEffort | null;
|
|
416
423
|
promptCache?: { mode: 'auto' | 'session-key' | 'disabled' };
|
|
417
424
|
enabled?: boolean;
|
|
418
425
|
}
|
|
@@ -431,8 +438,8 @@ export interface WebchatConfigPatch {
|
|
|
431
438
|
clear?: boolean;
|
|
432
439
|
enabled?: boolean;
|
|
433
440
|
mode?: 'auto' | 'manual';
|
|
441
|
+
enforcement?: 'remind' | 'followup';
|
|
434
442
|
modelId?: string | null;
|
|
435
|
-
shareSensitive?: boolean;
|
|
436
443
|
inputTokenBudget?: number;
|
|
437
444
|
timeoutMs?: number;
|
|
438
445
|
};
|