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.
Files changed (181) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -3
  3. package/plugins/workflow-runner/src/runtime/context.js +1 -1
  4. package/plugins/workflow-runner/src/runtime/context.ts +1 -1
  5. package/plugins/workflow-runner/test/embeddedExecution.test.ts +2 -5
  6. package/plugins/workflow-runner/test/execLifetime.test.ts +15 -2
  7. package/skills/ssh-remote-dev/SKILL.md +61 -0
  8. package/skills/ssh-remote-dev/agents/openai.yaml +4 -0
  9. package/src/advisor/README.md +62 -24
  10. package/src/advisor/advisorNudge.js +199 -0
  11. package/src/advisor/advisorNudge.ts +232 -0
  12. package/src/advisor/deliveryReview.js +35 -12
  13. package/src/advisor/deliveryReview.ts +35 -11
  14. package/src/advisor/presentation.js +7 -10
  15. package/src/advisor/presentation.ts +10 -13
  16. package/src/advisor/reviewContext.js +22 -58
  17. package/src/advisor/reviewContext.ts +24 -67
  18. package/src/cli/configMenu.js +17 -128
  19. package/src/cli/configMenu.tsx +17 -193
  20. package/src/cli/print.js +2 -0
  21. package/src/cli/print.ts +2 -0
  22. package/src/cli/streamJson.js +2 -0
  23. package/src/cli/streamJson.ts +2 -0
  24. package/src/cli/wizards/advisorWizard.js +9 -7
  25. package/src/cli/wizards/advisorWizard.tsx +9 -7
  26. package/src/cli/wizards/contextAdvisorWizard.js +9 -7
  27. package/src/cli/wizards/contextAdvisorWizard.tsx +9 -7
  28. package/src/cli/wizards/providerPresets.js +55 -18
  29. package/src/cli/wizards/providerPresets.ts +72 -19
  30. package/src/cli/wizards/providerWizard.js +51 -10
  31. package/src/cli/wizards/providerWizard.tsx +59 -9
  32. package/src/config/configDefaults.js +1 -1
  33. package/src/config/configDefaults.ts +1 -1
  34. package/src/config/configDiagnostics.js +1 -21
  35. package/src/config/configDiagnostics.ts +3 -23
  36. package/src/config/configFile.js +11 -4
  37. package/src/config/configFile.ts +27 -7
  38. package/src/config/configManagement.js +1 -0
  39. package/src/config/configManagement.ts +2 -0
  40. package/src/config/configService.js +12 -8
  41. package/src/config/configService.ts +16 -11
  42. package/src/config/numericLimits.js +0 -4
  43. package/src/config/numericLimits.ts +0 -4
  44. package/src/config/reasoningEffort.js +16 -0
  45. package/src/config/reasoningEffort.ts +18 -0
  46. package/src/context/budgetPlan.js +1 -1
  47. package/src/context/budgetPlan.ts +1 -1
  48. package/src/context/optimizeConversation.js +1 -1
  49. package/src/context/optimizeConversation.ts +1 -1
  50. package/src/harness/stallGuard.js +8 -13
  51. package/src/harness/stallGuard.ts +8 -12
  52. package/src/llm/client.js +64 -17
  53. package/src/llm/client.ts +62 -7
  54. package/src/llm/providers/anthropicFormat.js +3 -1
  55. package/src/llm/providers/anthropicFormat.ts +4 -1
  56. package/src/llm/providers/openaiFormat.js +14 -3
  57. package/src/llm/providers/openaiFormat.ts +17 -3
  58. package/src/llm/providers/responsesFormat.js +277 -0
  59. package/src/llm/providers/responsesFormat.ts +308 -0
  60. package/src/loop/README.md +18 -3
  61. package/src/loop/liveDiagramGate.js +63 -0
  62. package/src/loop/liveDiagramGate.ts +61 -0
  63. package/src/loop/messages.js +12 -0
  64. package/src/loop/messages.ts +13 -0
  65. package/src/loop/options.ts +7 -2
  66. package/src/loop/toolBatch.js +0 -1
  67. package/src/loop/toolBatch.ts +0 -1
  68. package/src/loop/toolExecutor.js +11 -46
  69. package/src/loop/toolExecutor.ts +12 -55
  70. package/src/loop/toolPresentation.js +2 -13
  71. package/src/loop/toolPresentation.ts +2 -13
  72. package/src/loop/toolSemantics.js +3 -4
  73. package/src/loop/toolSemantics.ts +4 -6
  74. package/src/loop.js +222 -214
  75. package/src/loop.ts +226 -232
  76. package/src/memory/dependencies.js +11 -3
  77. package/src/memory/dependencies.ts +11 -3
  78. package/src/memory/episodicMemory.js +59 -18
  79. package/src/memory/episodicMemory.ts +58 -18
  80. package/src/memory/experienceStore.js +4 -3
  81. package/src/memory/experienceStore.ts +4 -3
  82. package/src/memory/factCandidates.js +53 -1
  83. package/src/memory/factCandidates.ts +54 -1
  84. package/src/memory/factLearning.js +2 -2
  85. package/src/memory/factLearning.ts +2 -2
  86. package/src/memory/jobPolicy.js +24 -5
  87. package/src/memory/jobPolicy.ts +25 -5
  88. package/src/memory/learning.js +2 -2
  89. package/src/memory/learning.ts +2 -2
  90. package/src/memory/learningModel.js +7 -0
  91. package/src/memory/learningModel.ts +7 -0
  92. package/src/memory/managementService.js +8 -7
  93. package/src/memory/managementService.ts +16 -8
  94. package/src/memory/memoryService.js +104 -33
  95. package/src/memory/memoryService.ts +132 -28
  96. package/src/memory/projectKnowledge.js +39 -3
  97. package/src/memory/projectKnowledge.ts +45 -3
  98. package/src/memory/recallQuery.js +56 -0
  99. package/src/memory/recallQuery.ts +58 -0
  100. package/src/memory/retrieval.js +39 -10
  101. package/src/memory/retrieval.ts +46 -11
  102. package/src/memory/turnJournal.js +75 -10
  103. package/src/memory/turnJournal.ts +66 -10
  104. package/src/memory/types.ts +7 -1
  105. package/src/prompts/delegation.js +2 -1
  106. package/src/prompts/delegation.ts +3 -1
  107. package/src/prompts/policyRegistry.js +9 -12
  108. package/src/prompts/policyRegistry.ts +9 -12
  109. package/src/prompts/promptAssembly.js +6 -5
  110. package/src/prompts/promptAssembly.ts +8 -6
  111. package/src/prompts/visualPresentation.js +39 -10
  112. package/src/prompts/visualPresentation.ts +38 -9
  113. package/src/runtime/answerPreparation.js +1 -1
  114. package/src/runtime/answerPreparation.ts +1 -1
  115. package/src/runtime/commandCatalog.js +1 -0
  116. package/src/runtime/commandCatalog.ts +9 -0
  117. package/src/runtime/fileLock.js +19 -3
  118. package/src/runtime/fileLock.ts +19 -3
  119. package/src/runtime/invocationPolicy.js +1 -1
  120. package/src/runtime/invocationPolicy.ts +1 -1
  121. package/src/runtime/outputContract.js +0 -4
  122. package/src/runtime/outputContract.ts +0 -7
  123. package/src/session/runAgentTurn.js +3 -0
  124. package/src/session/runAgentTurn.ts +3 -0
  125. package/src/team/onlineToolContract.js +0 -1
  126. package/src/team/onlineToolContract.ts +0 -1
  127. package/src/tools/advisor/advisor.js +207 -365
  128. package/src/tools/advisor/advisor.ts +211 -383
  129. package/src/tools/agent/agentTypes.js +0 -1
  130. package/src/tools/agent/agentTypes.ts +0 -1
  131. package/src/tools/agent/coordinator.js +4 -1
  132. package/src/tools/agent/coordinator.ts +4 -1
  133. package/src/tools/bash/semantics.js +4 -5
  134. package/src/tools/bash/semantics.ts +4 -5
  135. package/src/tools/capabilities.js +2 -3
  136. package/src/tools/capabilities.ts +2 -4
  137. package/src/tools/index.js +0 -16
  138. package/src/tools/index.ts +0 -16
  139. package/src/tools/memory/maintenance.js +8 -9
  140. package/src/tools/memory/maintenance.ts +13 -11
  141. package/src/tools/memory/memory.js +5 -1
  142. package/src/tools/memory/memory.ts +5 -0
  143. package/src/tools/optimizeConversation/README.md +4 -6
  144. package/src/tools/toolPromptGuides.js +2 -9
  145. package/src/tools/toolPromptGuides.ts +2 -9
  146. package/src/types.ts +28 -105
  147. package/src/ui/App.js +22 -1
  148. package/src/ui/App.tsx +26 -1
  149. package/src/ui/MessageList.js +8 -44
  150. package/src/ui/MessageList.tsx +3 -81
  151. package/src/ui/effortCommand.js +19 -0
  152. package/src/ui/effortCommand.ts +36 -0
  153. package/src/ui/hooks/useChat.js +2 -0
  154. package/src/ui/hooks/useChat.ts +2 -0
  155. package/src/ui/toolProgress.js +1 -1
  156. package/src/ui/toolProgress.ts +1 -1
  157. package/src/web/protocol.ts +10 -3
  158. package/src/advisor/advisorCoordinator.js +0 -734
  159. package/src/advisor/advisorCoordinator.ts +0 -825
  160. package/src/cli/wizards/sshHostWizard.js +0 -156
  161. package/src/cli/wizards/sshHostWizard.tsx +0 -214
  162. package/src/context/sshHosts.js +0 -290
  163. package/src/context/sshHosts.ts +0 -312
  164. package/src/loop/publication.js +0 -94
  165. package/src/loop/publication.ts +0 -124
  166. package/src/runtime/finalAnswer.js +0 -9
  167. package/src/runtime/finalAnswer.ts +0 -13
  168. package/src/tools/advisor/advisorDecision.js +0 -79
  169. package/src/tools/advisor/advisorDecision.ts +0 -92
  170. package/src/tools/ssh/ssh.js +0 -152
  171. package/src/tools/ssh/ssh.ts +0 -167
  172. package/src/tools/ssh/sshAvailability.js +0 -35
  173. package/src/tools/ssh/sshAvailability.ts +0 -39
  174. package/src/tools/ssh/sshClient.js +0 -177
  175. package/src/tools/ssh/sshClient.ts +0 -189
  176. package/src/tools/ssh/sshDownload.js +0 -77
  177. package/src/tools/ssh/sshDownload.ts +0 -92
  178. package/src/tools/ssh/sshHostsTool.js +0 -36
  179. package/src/tools/ssh/sshHostsTool.ts +0 -48
  180. package/src/tools/ssh/sshUpload.js +0 -72
  181. 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
+ }
@@ -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,
@@ -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,
@@ -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 === 'AdvisorDecision' || toolName === 'PresentResult'
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';
@@ -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 === 'AdvisorDecision' || toolName === 'PresentResult'
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';
@@ -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
  };