@downcity/plugins 1.0.174 → 1.0.193

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 (301) hide show
  1. package/bin/BuiltinPlugins.d.ts +4 -9
  2. package/bin/BuiltinPlugins.d.ts.map +1 -1
  3. package/bin/BuiltinPlugins.js +4 -8
  4. package/bin/BuiltinPlugins.js.map +1 -1
  5. package/bin/chat/Action.d.ts +8 -2
  6. package/bin/chat/Action.d.ts.map +1 -1
  7. package/bin/chat/Action.js +9 -5
  8. package/bin/chat/Action.js.map +1 -1
  9. package/bin/chat/ChatPlugin.d.ts +2 -22
  10. package/bin/chat/ChatPlugin.d.ts.map +1 -1
  11. package/bin/chat/ChatPlugin.js +2 -21
  12. package/bin/chat/ChatPlugin.js.map +1 -1
  13. package/bin/chat/Index.d.ts +1 -1
  14. package/bin/chat/Index.d.ts.map +1 -1
  15. package/bin/chat/channels/BaseChatChannel.js +1 -1
  16. package/bin/chat/channels/BaseChatChannel.js.map +1 -1
  17. package/bin/chat/channels/Configuration.d.ts +1 -1
  18. package/bin/chat/channels/Configuration.js +1 -1
  19. package/bin/chat/channels/RuntimeChannel.d.ts +2 -3
  20. package/bin/chat/channels/RuntimeChannel.d.ts.map +1 -1
  21. package/bin/chat/channels/RuntimeChannel.js +0 -8
  22. package/bin/chat/channels/RuntimeChannel.js.map +1 -1
  23. package/bin/chat/channels/feishu/Feishu.d.ts.map +1 -1
  24. package/bin/chat/channels/feishu/Feishu.js +2 -1
  25. package/bin/chat/channels/feishu/Feishu.js.map +1 -1
  26. package/bin/chat/runtime/ChannelContextStore.d.ts.map +1 -1
  27. package/bin/chat/runtime/ChannelContextStore.js +13 -12
  28. package/bin/chat/runtime/ChannelContextStore.js.map +1 -1
  29. package/bin/chat/runtime/ChatActionExecution.d.ts +26 -1
  30. package/bin/chat/runtime/ChatActionExecution.d.ts.map +1 -1
  31. package/bin/chat/runtime/ChatActionExecution.js +31 -3
  32. package/bin/chat/runtime/ChatActionExecution.js.map +1 -1
  33. package/bin/chat/runtime/ChatActionInput.d.ts +1 -2
  34. package/bin/chat/runtime/ChatActionInput.d.ts.map +1 -1
  35. package/bin/chat/runtime/ChatActionInput.js +1 -27
  36. package/bin/chat/runtime/ChatActionInput.js.map +1 -1
  37. package/bin/chat/runtime/ChatChannelActions.d.ts +2 -66
  38. package/bin/chat/runtime/ChatChannelActions.d.ts.map +1 -1
  39. package/bin/chat/runtime/ChatChannelActions.js +3 -195
  40. package/bin/chat/runtime/ChatChannelActions.js.map +1 -1
  41. package/bin/chat/runtime/ChatChannelConfig.d.ts +2 -23
  42. package/bin/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
  43. package/bin/chat/runtime/ChatChannelConfig.js +3 -116
  44. package/bin/chat/runtime/ChatChannelConfig.js.map +1 -1
  45. package/bin/chat/runtime/ChatChannelCore.d.ts +0 -14
  46. package/bin/chat/runtime/ChatChannelCore.d.ts.map +1 -1
  47. package/bin/chat/runtime/ChatChannelCore.js +1 -1
  48. package/bin/chat/runtime/ChatChannelCore.js.map +1 -1
  49. package/bin/chat/runtime/ChatChannelFacade.d.ts +1 -1
  50. package/bin/chat/runtime/ChatChannelFacade.d.ts.map +1 -1
  51. package/bin/chat/runtime/ChatChannelFacade.js +1 -1
  52. package/bin/chat/runtime/ChatChannelFacade.js.map +1 -1
  53. package/bin/chat/runtime/ChatHistoryStore.d.ts.map +1 -1
  54. package/bin/chat/runtime/ChatHistoryStore.js +4 -3
  55. package/bin/chat/runtime/ChatHistoryStore.js.map +1 -1
  56. package/bin/chat/runtime/ChatPluginActionRegistry.d.ts.map +1 -1
  57. package/bin/chat/runtime/ChatPluginActionRegistry.js +27 -89
  58. package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -1
  59. package/bin/chat/runtime/ChatPluginSystem.d.ts +3 -2
  60. package/bin/chat/runtime/ChatPluginSystem.d.ts.map +1 -1
  61. package/bin/chat/runtime/ChatPluginSystem.js +5 -5
  62. package/bin/chat/runtime/ChatPluginSystem.js.map +1 -1
  63. package/bin/chat/runtime/ChatQueueStore.d.ts +1 -1
  64. package/bin/chat/runtime/ChatQueueStore.js +2 -2
  65. package/bin/chat/runtime/ChatQueueStore.js.map +1 -1
  66. package/bin/chat/runtime/ChatQueueWorker.js +1 -1
  67. package/bin/chat/runtime/ChatQueueWorker.js.map +1 -1
  68. package/bin/chat/runtime/ChatSessionDelete.d.ts.map +1 -1
  69. package/bin/chat/runtime/ChatSessionDelete.js +11 -20
  70. package/bin/chat/runtime/ChatSessionDelete.js.map +1 -1
  71. package/bin/chat/runtime/ChatStorage.d.ts +32 -0
  72. package/bin/chat/runtime/ChatStorage.d.ts.map +1 -0
  73. package/bin/chat/runtime/ChatStorage.js +158 -0
  74. package/bin/chat/runtime/ChatStorage.js.map +1 -0
  75. package/bin/chat/runtime/SystemPrompt.d.ts +3 -2
  76. package/bin/chat/runtime/SystemPrompt.d.ts.map +1 -1
  77. package/bin/chat/runtime/SystemPrompt.js +4 -5
  78. package/bin/chat/runtime/SystemPrompt.js.map +1 -1
  79. package/bin/chat/types/ChannelConfiguration.d.ts +2 -2
  80. package/bin/chat/types/ChatPluginActionPayload.d.ts +7 -45
  81. package/bin/chat/types/ChatPluginActionPayload.d.ts.map +1 -1
  82. package/bin/chat/types/ChatPluginOptions.d.ts +0 -21
  83. package/bin/chat/types/ChatPluginOptions.d.ts.map +1 -1
  84. package/bin/chat/types/ChatStorage.d.ts +36 -0
  85. package/bin/chat/types/ChatStorage.d.ts.map +1 -0
  86. package/bin/chat/types/ChatStorage.js +9 -0
  87. package/bin/chat/types/ChatStorage.js.map +1 -0
  88. package/bin/contact/Action.d.ts +3 -2
  89. package/bin/contact/Action.d.ts.map +1 -1
  90. package/bin/contact/Action.js +2 -2
  91. package/bin/contact/Action.js.map +1 -1
  92. package/bin/contact/ContactPlugin.d.ts.map +1 -1
  93. package/bin/contact/ContactPlugin.js +17 -14
  94. package/bin/contact/ContactPlugin.js.map +1 -1
  95. package/bin/contact/runtime/ChatRuntime.js +1 -1
  96. package/bin/contact/runtime/ChatRuntime.js.map +1 -1
  97. package/bin/contact/types/ContactPluginOptions.d.ts +4 -0
  98. package/bin/contact/types/ContactPluginOptions.d.ts.map +1 -1
  99. package/bin/index.d.ts +5 -5
  100. package/bin/index.d.ts.map +1 -1
  101. package/bin/index.js +2 -2
  102. package/bin/index.js.map +1 -1
  103. package/bin/memory/Action.d.ts.map +1 -1
  104. package/bin/memory/Action.js +16 -4
  105. package/bin/memory/Action.js.map +1 -1
  106. package/bin/memory/runtime/Store.d.ts.map +1 -1
  107. package/bin/memory/runtime/Store.js +0 -22
  108. package/bin/memory/runtime/Store.js.map +1 -1
  109. package/bin/memory/runtime/Writer.d.ts +1 -1
  110. package/bin/memory/runtime/Writer.d.ts.map +1 -1
  111. package/bin/memory/runtime/Writer.js +2 -4
  112. package/bin/memory/runtime/Writer.js.map +1 -1
  113. package/bin/skill/Command.d.ts +3 -11
  114. package/bin/skill/Command.d.ts.map +1 -1
  115. package/bin/skill/Command.js +3 -31
  116. package/bin/skill/Command.js.map +1 -1
  117. package/bin/skill/PROMPT.d.ts +1 -1
  118. package/bin/skill/PROMPT.d.ts.map +1 -1
  119. package/bin/skill/PROMPT.js +1 -1
  120. package/bin/skill/PROMPT.js.map +1 -1
  121. package/bin/skill/Plugin.d.ts +3 -2
  122. package/bin/skill/Plugin.d.ts.map +1 -1
  123. package/bin/skill/Plugin.js +37 -129
  124. package/bin/skill/Plugin.js.map +1 -1
  125. package/bin/skill/runtime/Prompt.d.ts +11 -2
  126. package/bin/skill/runtime/Prompt.d.ts.map +1 -1
  127. package/bin/skill/runtime/Prompt.js +93 -8
  128. package/bin/skill/runtime/Prompt.js.map +1 -1
  129. package/bin/skill/runtime/SystemProvider.d.ts +2 -1
  130. package/bin/skill/runtime/SystemProvider.d.ts.map +1 -1
  131. package/bin/skill/runtime/SystemProvider.js +4 -9
  132. package/bin/skill/runtime/SystemProvider.js.map +1 -1
  133. package/bin/skill/types/SkillPlugin.d.ts +6 -18
  134. package/bin/skill/types/SkillPlugin.d.ts.map +1 -1
  135. package/bin/skill/types/SkillPlugin.js +2 -2
  136. package/bin/sound/Plugin.d.ts +69 -0
  137. package/bin/sound/Plugin.d.ts.map +1 -0
  138. package/bin/sound/Plugin.js +623 -0
  139. package/bin/sound/Plugin.js.map +1 -0
  140. package/bin/sound/types/SoundPlugin.d.ts +150 -0
  141. package/bin/sound/types/SoundPlugin.d.ts.map +1 -0
  142. package/bin/sound/types/SoundPlugin.js +10 -0
  143. package/bin/sound/types/SoundPlugin.js.map +1 -0
  144. package/bin/task/Action.d.ts +2 -0
  145. package/bin/task/Action.d.ts.map +1 -1
  146. package/bin/task/Action.js +6 -0
  147. package/bin/task/Action.js.map +1 -1
  148. package/bin/task/runtime/Runner.d.ts +4 -0
  149. package/bin/task/runtime/Runner.d.ts.map +1 -1
  150. package/bin/task/runtime/Runner.js +15 -11
  151. package/bin/task/runtime/Runner.js.map +1 -1
  152. package/bin/task/runtime/TaskActionExecution.d.ts +2 -0
  153. package/bin/task/runtime/TaskActionExecution.d.ts.map +1 -1
  154. package/bin/task/runtime/TaskActionExecution.js +1 -0
  155. package/bin/task/runtime/TaskActionExecution.js.map +1 -1
  156. package/bin/task/runtime/TaskPluginActionRegistry.d.ts.map +1 -1
  157. package/bin/task/runtime/TaskPluginActionRegistry.js +1 -0
  158. package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -1
  159. package/bin/task/runtime/TaskRunChatDispatch.js +1 -1
  160. package/bin/task/runtime/TaskRunChatDispatch.js.map +1 -1
  161. package/bin/task/runtime/TaskRunnerRound.d.ts.map +1 -1
  162. package/bin/task/runtime/TaskRunnerRound.js +19 -26
  163. package/bin/task/runtime/TaskRunnerRound.js.map +1 -1
  164. package/bin/task/runtime/TaskRunnerSession.d.ts +6 -2
  165. package/bin/task/runtime/TaskRunnerSession.d.ts.map +1 -1
  166. package/bin/task/runtime/TaskRunnerSession.js +93 -72
  167. package/bin/task/runtime/TaskRunnerSession.js.map +1 -1
  168. package/bin/task/runtime/TaskRunnerTypes.d.ts +4 -4
  169. package/bin/task/runtime/TaskRunnerTypes.d.ts.map +1 -1
  170. package/bin/task/types/TaskPluginOptions.d.ts.map +1 -1
  171. package/bin/web/PROMPT.d.ts +1 -1
  172. package/bin/web/PROMPT.d.ts.map +1 -1
  173. package/bin/web/PROMPT.js +2 -2
  174. package/bin/web/PROMPT.js.map +1 -1
  175. package/bin/web/Plugin.d.ts +1 -21
  176. package/bin/web/Plugin.d.ts.map +1 -1
  177. package/bin/web/Plugin.js +14 -79
  178. package/bin/web/Plugin.js.map +1 -1
  179. package/bin/web/runtime/Prompt.d.ts +14 -0
  180. package/bin/web/runtime/Prompt.d.ts.map +1 -0
  181. package/bin/web/runtime/Prompt.js +77 -0
  182. package/bin/web/runtime/Prompt.js.map +1 -0
  183. package/bin/web/types/WebPlugin.d.ts +40 -29
  184. package/bin/web/types/WebPlugin.d.ts.map +1 -1
  185. package/bin/web/types/WebPlugin.js +11 -3
  186. package/bin/web/types/WebPlugin.js.map +1 -1
  187. package/bin/workboard/runtime/Collector.js +1 -1
  188. package/bin/workboard/runtime/Collector.js.map +1 -1
  189. package/bin/workboard/runtime/Normalizer.js +1 -1
  190. package/bin/workboard/runtime/Normalizer.js.map +1 -1
  191. package/bin/workboard/runtime/SessionSummary.d.ts.map +1 -1
  192. package/bin/workboard/runtime/SessionSummary.js +11 -38
  193. package/bin/workboard/runtime/SessionSummary.js.map +1 -1
  194. package/package.json +8 -4
  195. package/scripts/chat-access.test.mjs +1 -1
  196. package/scripts/chat-channel-config.test.mjs +15 -64
  197. package/scripts/chat-storage.test.mjs +92 -0
  198. package/scripts/skill-plugin.test.mjs +93 -0
  199. package/scripts/sound-plugin.test.mjs +250 -0
  200. package/scripts/web-plugin.test.mjs +85 -0
  201. package/src/BuiltinPlugins.ts +7 -17
  202. package/src/chat/Action.ts +16 -5
  203. package/src/chat/ChatPlugin.ts +6 -35
  204. package/src/chat/Index.ts +0 -1
  205. package/src/chat/channels/BaseChatChannel.ts +1 -1
  206. package/src/chat/channels/Configuration.ts +1 -1
  207. package/src/chat/channels/RuntimeChannel.ts +2 -14
  208. package/src/chat/channels/feishu/Feishu.ts +2 -1
  209. package/src/chat/runtime/ChannelContextStore.ts +16 -12
  210. package/src/chat/runtime/ChatActionExecution.ts +48 -3
  211. package/src/chat/runtime/ChatActionInput.ts +0 -31
  212. package/src/chat/runtime/ChatChannelActions.ts +3 -254
  213. package/src/chat/runtime/ChatChannelConfig.ts +4 -133
  214. package/src/chat/runtime/ChatChannelCore.ts +1 -15
  215. package/src/chat/runtime/ChatChannelFacade.ts +0 -4
  216. package/src/chat/runtime/ChatHistoryStore.ts +4 -3
  217. package/src/chat/runtime/ChatPluginActionRegistry.ts +26 -98
  218. package/src/chat/runtime/ChatPluginSystem.ts +9 -3
  219. package/src/chat/runtime/ChatQueueStore.ts +2 -2
  220. package/src/chat/runtime/ChatQueueWorker.ts +1 -1
  221. package/src/chat/runtime/ChatSessionDelete.ts +11 -21
  222. package/src/chat/runtime/ChatStorage.ts +203 -0
  223. package/src/chat/runtime/SystemPrompt.ts +8 -3
  224. package/src/chat/types/ChannelConfiguration.ts +2 -2
  225. package/src/chat/types/ChatPluginActionPayload.ts +8 -49
  226. package/src/chat/types/ChatPluginOptions.ts +0 -22
  227. package/src/chat/types/ChatStorage.ts +37 -0
  228. package/src/contact/Action.ts +9 -1
  229. package/src/contact/ContactPlugin.ts +38 -14
  230. package/src/contact/runtime/ChatRuntime.ts +1 -1
  231. package/src/contact/types/ContactPluginOptions.ts +6 -0
  232. package/src/index.ts +16 -14
  233. package/src/memory/Action.ts +19 -4
  234. package/src/memory/runtime/Store.ts +0 -27
  235. package/src/memory/runtime/Writer.ts +2 -5
  236. package/src/skill/Command.ts +3 -33
  237. package/src/skill/PROMPT.ts +1 -1
  238. package/src/skill/PROMPT.ts.txt +5 -1
  239. package/src/skill/Plugin.ts +49 -156
  240. package/src/skill/runtime/Prompt.ts +109 -9
  241. package/src/skill/runtime/SystemProvider.ts +5 -9
  242. package/src/skill/types/SkillPlugin.ts +6 -18
  243. package/src/sound/Plugin.ts +699 -0
  244. package/src/sound/types/SoundPlugin.ts +163 -0
  245. package/src/task/Action.ts +8 -0
  246. package/src/task/runtime/Runner.ts +19 -13
  247. package/src/task/runtime/TaskActionExecution.ts +3 -0
  248. package/src/task/runtime/TaskPluginActionRegistry.ts +1 -0
  249. package/src/task/runtime/TaskRunChatDispatch.ts +1 -1
  250. package/src/task/runtime/TaskRunnerRound.ts +20 -38
  251. package/src/task/runtime/TaskRunnerSession.ts +108 -72
  252. package/src/task/runtime/TaskRunnerTypes.ts +4 -4
  253. package/src/task/types/TaskPluginOptions.ts +1 -0
  254. package/src/web/PROMPT.ts +2 -2
  255. package/src/web/PROMPT.ts.txt +4 -2
  256. package/src/web/Plugin.ts +20 -90
  257. package/src/web/runtime/Prompt.ts +99 -0
  258. package/src/web/types/WebPlugin.ts +42 -29
  259. package/src/workboard/runtime/Collector.ts +1 -1
  260. package/src/workboard/runtime/Normalizer.ts +1 -1
  261. package/src/workboard/runtime/SessionSummary.ts +11 -42
  262. package/bin/asr/Plugin.d.ts +0 -63
  263. package/bin/asr/Plugin.d.ts.map +0 -1
  264. package/bin/asr/Plugin.js +0 -280
  265. package/bin/asr/Plugin.js.map +0 -1
  266. package/bin/asr/types/AsrPlugin.d.ts +0 -114
  267. package/bin/asr/types/AsrPlugin.d.ts.map +0 -1
  268. package/bin/asr/types/AsrPlugin.js +0 -10
  269. package/bin/asr/types/AsrPlugin.js.map +0 -1
  270. package/bin/chat/runtime/ChatSession.d.ts +0 -97
  271. package/bin/chat/runtime/ChatSession.d.ts.map +0 -1
  272. package/bin/chat/runtime/ChatSession.js +0 -91
  273. package/bin/chat/runtime/ChatSession.js.map +0 -1
  274. package/bin/chat/runtime/ChatSessionContextComposer.d.ts +0 -45
  275. package/bin/chat/runtime/ChatSessionContextComposer.d.ts.map +0 -1
  276. package/bin/chat/runtime/ChatSessionContextComposer.js +0 -60
  277. package/bin/chat/runtime/ChatSessionContextComposer.js.map +0 -1
  278. package/bin/chat/runtime/ChatSessionTypes.d.ts +0 -30
  279. package/bin/chat/runtime/ChatSessionTypes.d.ts.map +0 -1
  280. package/bin/chat/runtime/ChatSessionTypes.js +0 -9
  281. package/bin/chat/runtime/ChatSessionTypes.js.map +0 -1
  282. package/bin/tts/Plugin.d.ts +0 -49
  283. package/bin/tts/Plugin.d.ts.map +0 -1
  284. package/bin/tts/Plugin.js +0 -247
  285. package/bin/tts/Plugin.js.map +0 -1
  286. package/bin/tts/types/TtsPlugin.d.ts +0 -122
  287. package/bin/tts/types/TtsPlugin.d.ts.map +0 -1
  288. package/bin/tts/types/TtsPlugin.js +0 -10
  289. package/bin/tts/types/TtsPlugin.js.map +0 -1
  290. package/bin/web/runtime/Install.d.ts +0 -19
  291. package/bin/web/runtime/Install.d.ts.map +0 -1
  292. package/bin/web/runtime/Install.js +0 -178
  293. package/bin/web/runtime/Install.js.map +0 -1
  294. package/src/asr/Plugin.ts +0 -322
  295. package/src/asr/types/AsrPlugin.ts +0 -118
  296. package/src/chat/runtime/ChatSession.ts +0 -168
  297. package/src/chat/runtime/ChatSessionContextComposer.ts +0 -106
  298. package/src/chat/runtime/ChatSessionTypes.ts +0 -32
  299. package/src/tts/Plugin.ts +0 -284
  300. package/src/tts/types/TtsPlugin.ts +0 -129
  301. package/src/web/runtime/Install.ts +0 -241
@@ -8,8 +8,6 @@
8
8
  import path from "node:path";
9
9
  import fs from "fs-extra";
10
10
  import { runSandboxCommand } from "@downcity/shell/sandbox/SandboxRunner.js";
11
- import { withShellRunScope } from "@downcity/shell";
12
- import { withSessionRunScope } from "@downcity/agent";
13
11
  import { appendTaskRoundUserMessage } from "./TaskRunnerSession.js";
14
12
  function stripTaskSecretEnv(env) {
15
13
  delete env.DC_AUTH_TOKEN;
@@ -200,15 +198,12 @@ export async function runAgentRound(params) {
200
198
  catch {
201
199
  // ignore
202
200
  }
203
- const result = await withSessionRunScope({
204
- runContext: create_task_run_context(params.sessionId),
205
- }, () => withShellRunScope({
206
- run_context: {
207
- session_id: params.sessionId,
208
- },
209
- }, () => params.taskSessionRuntime.getExecutor(params.sessionId).run({
201
+ const result = await params.taskSessionRuntime
202
+ .getExecutor(params.sessionId)
203
+ .run({
210
204
  query: params.query,
211
- })));
205
+ runContext: create_task_run_context(params.sessionId),
206
+ });
212
207
  const outputPick = pickAgentOutput(result.assistantMessage);
213
208
  if (!result.success) {
214
209
  const reason = outputPick.text || "agent run returned success=false";
@@ -232,22 +227,20 @@ export async function runScriptTask(params) {
232
227
  throw new Error("script task body cannot be empty");
233
228
  const scriptAbs = path.join(params.runDirAbs, "task-script.sh");
234
229
  await fs.writeFile(scriptAbs, body.endsWith("\n") ? body : `${body}\n`, "utf-8");
235
- const execResult = await withSessionRunScope({ runContext: create_task_run_context(params.sessionId) }, () => {
236
- const childEnv = {
237
- ...process.env,
238
- DC_SESSION_ID: params.sessionId,
239
- };
240
- stripTaskSecretEnv(childEnv);
241
- return runSandboxCommand({
242
- context: params.context,
243
- executionId: `task-script:${params.sessionId}`,
244
- executionDir: params.runDirAbs,
245
- cmd: `sh "${scriptAbs.replace(/(["\\$`])/g, "\\$1")}"`,
246
- cwd: params.runDirAbs,
247
- shellPath: "/bin/sh",
248
- login: false,
249
- baseEnv: childEnv,
250
- });
230
+ const childEnv = {
231
+ ...process.env,
232
+ DC_SESSION_ID: params.sessionId,
233
+ };
234
+ stripTaskSecretEnv(childEnv);
235
+ const execResult = await runSandboxCommand({
236
+ context: params.context,
237
+ executionId: `task-script:${params.sessionId}`,
238
+ executionDir: params.runDirAbs,
239
+ cmd: `sh "${scriptAbs.replace(/(["\\$`])/g, "\\$1")}"`,
240
+ cwd: params.runDirAbs,
241
+ shellPath: "/bin/sh",
242
+ login: false,
243
+ baseEnv: childEnv,
251
244
  });
252
245
  const stdout = String(execResult.stdout || "").trim();
253
246
  const stderr = String(execResult.stderr || "").trim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
  * 关键点(中文)
5
- * - 负责构建 task 专用 Executor / JsonlSessionHistoryStore 运行时。
6
- * - 负责把每轮 user/assistant 消息写入 run 目录对应的 messages.jsonl
5
+ * - 负责构建 task 专用 Executor / SessionMessages 运行时。
6
+ * - 负责把每轮 user/assistant 消息写入 run 目录对应的 canonical Message Store
7
7
  * - 这些能力与任务编排逻辑解耦后,task 主流程会更聚焦于状态流转。
8
8
  * - 当前只有 api 执行模式。
9
9
  */
@@ -35,6 +35,10 @@ export declare function createTaskSessionRuntimePort(params: {
35
35
  runDirAbs: string;
36
36
  runSessionId: string;
37
37
  userSimulatorSessionId: string;
38
+ /** 当前 task 显式继承的 Agent env 快照。 */
39
+ agent_env?: Readonly<Record<string, string>>;
40
+ /** 当前 task 显式继承的 Agent instruction 快照。 */
41
+ agent_systems?: readonly string[];
38
42
  }): TaskSessionRuntimePort;
39
43
  /**
40
44
  * 把 task session 的 assistant 消息落盘到对应 run context history Store。
@@ -1 +1 @@
1
- {"version":3,"file":"TaskRunnerSession.d.ts","sourceRoot":"","sources":["../../../src/task/runtime/TaskRunnerSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAQ,MAAM,IAAI,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAUhF;;GAEG;AACH,wBAAsB,0BAA0B,CAAC,MAAM,EAAE;IACvD,kBAAkB,EAAE,sBAAsB,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhB;A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AC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kCAAkC;IAClC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,0CAA0C;IAC1C,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,GAAG,sBAAsB,CAsIzB;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAAC,MAAM,EAAE;IACvD,kBAAkB,EAAE,sBAAsB,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,gBAAgB,CAAC;CAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB"}
@@ -2,18 +2,14 @@
2
2
  * TaskRunnerSession:task runner 的 session 装配模块。
3
3
  *
4
4
  * 关键点(中文)
5
- * - 负责构建 task 专用 Executor / JsonlSessionHistoryStore 运行时。
6
- * - 负责把每轮 user/assistant 消息写入 run 目录对应的 messages.jsonl
5
+ * - 负责构建 task 专用 Executor / SessionMessages 运行时。
6
+ * - 负责把每轮 user/assistant 消息写入 run 目录对应的 canonical Message Store
7
7
  * - 这些能力与任务编排逻辑解耦后,task 主流程会更聚焦于状态流转。
8
8
  * - 当前只有 api 执行模式。
9
9
  */
10
10
  import path from "node:path";
11
11
  import { Executor } from "@downcity/agent";
12
- import { drainDeferredPersistedUserMessages } from "@downcity/agent";
13
- import { JsonlSessionHistoryComposer } from "@downcity/agent";
14
- import { JsonlSessionHistoryStore } from "@downcity/agent";
15
- import { JsonlSessionCompactionComposer } from "@downcity/agent";
16
- import { LocalSessionContextComposer } from "@downcity/agent";
12
+ import { DefaultSessionComposer, JsonlSessionMessageStore, SessionMessages, } from "@downcity/agent";
17
13
  import { DefaultSessionSystemComposer } from "@downcity/agent";
18
14
  import { Shell } from "@downcity/shell";
19
15
  /**
@@ -23,18 +19,17 @@ export async function appendTaskRoundUserMessage(params) {
23
19
  const text = String(params.query || "").trim();
24
20
  if (!text)
25
21
  return;
26
- const historyStore = params.taskSessionRuntime.getHistoryStore(params.sessionId);
27
- await historyStore.write_record(historyStore.userText({
28
- text,
29
- metadata: {
30
- sessionId: params.sessionId,
31
- extra: {
32
- taskId: params.taskId,
33
- actorId: params.actorId,
34
- actorName: params.actorName,
35
- },
36
- },
37
- }));
22
+ const messages = params.taskSessionRuntime.get_messages(params.sessionId);
23
+ await messages.append_user_message({
24
+ turn_id: `task:${params.taskId}:${params.actorId}:${Date.now()}`,
25
+ input_type: "prompt",
26
+ parts: [{
27
+ part_id: `task-user:${Date.now()}`,
28
+ type: "text",
29
+ text,
30
+ state: "done",
31
+ }],
32
+ });
38
33
  }
39
34
  /**
40
35
  * 构建 task 专用 Session 运行时(独立于普通 Session 实例缓存)。
@@ -45,27 +40,32 @@ export async function appendTaskRoundUserMessage(params) {
45
40
  */
46
41
  export function createTaskSessionRuntimePort(params) {
47
42
  const { context, model, runDirAbs, runSessionId, userSimulatorSessionId, } = params;
48
- const compactionComposer = new JsonlSessionCompactionComposer();
43
+ const effective_env = params.agent_env
44
+ ? { ...params.agent_env }
45
+ : { ...context.env };
46
+ const effective_systems = params.agent_systems
47
+ ? [...params.agent_systems]
48
+ : [...context.systems];
49
49
  const systemComposer = new DefaultSessionSystemComposer({
50
50
  projectRoot: context.rootPath,
51
- getStaticSystemPrompts: () => context.systems,
51
+ getStaticSystemPrompts: () => [...effective_systems],
52
52
  getContext: () => context,
53
53
  profile: "task",
54
54
  });
55
- const historyStoresBySessionId = new Map();
56
- const historyComposersBySessionId = new Map();
55
+ const messages_by_session_id = new Map();
56
+ const created_at_by_session_id = new Map();
57
57
  const runtimesBySessionId = new Map();
58
58
  const shell = new Shell({
59
59
  root_path: context.rootPath,
60
- env: context.env,
60
+ env: effective_env,
61
61
  logger: context.logger,
62
62
  });
63
63
  const shell_tools = shell.tools;
64
- const resolveTaskHistoryStore = (sessionId) => {
65
- const existing = historyStoresBySessionId.get(sessionId);
64
+ const resolve_task_messages = (session_id) => {
65
+ const existing = messages_by_session_id.get(session_id);
66
66
  if (existing)
67
67
  return existing;
68
- const key = String(sessionId || "").trim();
68
+ const key = String(session_id || "").trim();
69
69
  if (!key) {
70
70
  throw new Error("TaskSessionRuntimePort requires a non-empty sessionId");
71
71
  }
@@ -74,38 +74,40 @@ export function createTaskSessionRuntimePort(params) {
74
74
  : key === userSimulatorSessionId
75
75
  ? path.join(runDirAbs, "user-simulator")
76
76
  : undefined;
77
- const created = new JsonlSessionHistoryStore({
78
- rootPath: context.rootPath,
79
- sessionId: key,
80
- ...(runMessagesDirPath
81
- ? {
82
- paths: {
83
- sessionDirPath: runMessagesDirPath,
84
- messagesDirPath: runMessagesDirPath,
85
- messagesFilePath: path.join(runMessagesDirPath, "messages.jsonl"),
86
- metaFilePath: path.join(runMessagesDirPath, "meta.json"),
87
- archiveDirPath: path.join(runMessagesDirPath, "archive"),
88
- },
89
- }
90
- : {}),
91
- });
92
- historyStoresBySessionId.set(key, created);
93
- return created;
94
- };
95
- const resolveTaskHistoryComposer = (sessionId) => {
96
- const key = String(sessionId || "").trim();
97
- const existing = historyComposersBySessionId.get(key);
98
- if (existing)
99
- return existing;
100
- const created = new JsonlSessionHistoryComposer({
101
- store: resolveTaskHistoryStore(key),
77
+ const messages_dir_path = runMessagesDirPath || path.join(runDirAbs, key);
78
+ const created = new SessionMessages({
79
+ session_id: key,
80
+ store: new JsonlSessionMessageStore({
81
+ session_id: key,
82
+ file_path: path.join(messages_dir_path, "active.jsonl"),
83
+ assistant_message_file_path: path.join(messages_dir_path, "assistant_message.json"),
84
+ }),
85
+ publish: () => { },
102
86
  });
103
- historyComposersBySessionId.set(key, created);
87
+ messages_by_session_id.set(key, created);
88
+ created_at_by_session_id.set(key, Date.now());
104
89
  return created;
105
90
  };
91
+ class TaskSessionComposer extends DefaultSessionComposer {
92
+ async compose(input) {
93
+ const composed = await super.compose(input);
94
+ return {
95
+ ...composed,
96
+ system: await systemComposer.resolve({
97
+ sessionId: input.session.session_id,
98
+ agentEnv: input.state.env,
99
+ agentSystems: input.state.systems,
100
+ injectedUserMessages: [],
101
+ deferredPersistedUserMessages: [],
102
+ pendingAssistantFileParts: [],
103
+ }),
104
+ system_blocks: undefined,
105
+ };
106
+ }
107
+ }
106
108
  return {
107
- getHistoryStore(sessionId) {
108
- return resolveTaskHistoryStore(sessionId);
109
+ get_messages(session_id) {
110
+ return resolve_task_messages(session_id);
109
111
  },
110
112
  getExecutor(sessionId) {
111
113
  const key = String(sessionId || "").trim();
@@ -115,23 +117,42 @@ export function createTaskSessionRuntimePort(params) {
115
117
  const existing = runtimesBySessionId.get(key);
116
118
  if (existing)
117
119
  return existing;
118
- const historyStore = resolveTaskHistoryStore(key);
119
- const historyComposer = resolveTaskHistoryComposer(key);
120
- const contextComposer = new LocalSessionContextComposer({
121
- sessionId: key,
122
- getTools: () => shell_tools,
123
- });
120
+ const messages = resolve_task_messages(key);
121
+ const composer = new TaskSessionComposer();
124
122
  const created = new Executor({
125
123
  sessionId: key,
124
+ composer,
125
+ get_compose_input: async (run_context, retry_count) => ({
126
+ session: {
127
+ agent_id: "task",
128
+ session_id: key,
129
+ project_root: context.rootPath,
130
+ created_at: created_at_by_session_id.get(key) || Date.now(),
131
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC",
132
+ },
133
+ state: {
134
+ model,
135
+ env: effective_env,
136
+ systems: effective_systems,
137
+ tools: shell_tools,
138
+ instruction_system_blocks: [],
139
+ managed_plugin_system_blocks: [],
140
+ plugin_system_blocks: [],
141
+ },
142
+ history: await messages.context_snapshot(),
143
+ turn: {
144
+ ...(run_context.turnId ? { turn_id: run_context.turnId } : {}),
145
+ retry_count,
146
+ },
147
+ }),
148
+ commit_compaction: async (plan) => {
149
+ await messages.compact_active({
150
+ through_sequence: plan.through_sequence,
151
+ summary: plan.summary,
152
+ });
153
+ },
126
154
  getModel: () => model,
127
155
  logger: context.logger,
128
- historyStore,
129
- historyComposer,
130
- compactionComposer,
131
- contextComposer,
132
- systemComposer,
133
- getTools: () => shell_tools,
134
- getEnv: () => ({ ...context.env }),
135
156
  });
136
157
  runtimesBySessionId.set(key, created);
137
158
  return created;
@@ -143,13 +164,13 @@ export function createTaskSessionRuntimePort(params) {
143
164
  */
144
165
  export async function appendTaskAssistantMessage(params) {
145
166
  const { taskSessionRuntime, sessionId, rawResult } = params;
146
- const historyStore = taskSessionRuntime.getHistoryStore(sessionId);
167
+ const messages = taskSessionRuntime.get_messages(sessionId);
147
168
  if (rawResult.assistantMessage) {
148
- await historyStore.write_record(rawResult.assistantMessage);
169
+ await messages.append_record(rawResult.assistantMessage);
149
170
  }
150
- const deferredUserMessages = drainDeferredPersistedUserMessages(sessionId);
171
+ const deferredUserMessages = rawResult.deferredPersistedUserMessages || [];
151
172
  for (const deferred of deferredUserMessages) {
152
- await historyStore.write_record(deferred);
173
+ await messages.append_record(deferred);
153
174
  }
154
175
  }
155
176
  //# sourceMappingURL=TaskRunnerSession.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskRunnerSession.js","sourceRoot":"","sources":["../../../src/task/runtime/TaskRunnerSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGxC;;G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C,CAAC,EAAE,CAAC;wBAC9D,WAAW;qBACZ;iBACF,CAAC;gBACF,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;oBAChC,MAAM,QAAQ,CAAC,cAAc,CAAC;wBAC5B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;wBACvC,OAAO,EAAE,IAAI,CAAC,OAAO;qBACtB,CAAC,CAAC;gBACL,CAAC;gBACD,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;gBACrB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC,CAAC;YACH,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,MAKhD;IACC,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC5D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5D,IAAI,SAAS,CAAC,gBAAgB,EAAE,CAAC;QAC/B,MAAM,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,oBAAoB,GAAG,SAAS,CAAC,6BAA6B,IAAI,EAAE,CAAC;IAC3E,KAAK,MAAM,QAAQ,IAAI,oBAAoB,EAAE,CAAC;QAC5C,MAAM,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * - 这里集中声明 task runner 在拆分后跨模块共享的内部类型。
6
6
  * - 这些类型服务于 task 运行链路,统一归档到 `src/types/task/`。
7
7
  */
8
- import type { JsonlSessionHistoryStore } from "@downcity/agent";
8
+ import type { SessionMessages } from "@downcity/agent";
9
9
  import type { SessionExecutor } from "@downcity/agent";
10
10
  import type { ShipTaskRunExecutionStatusV1, ShipTaskRunProgressPhaseV1, ShipTaskRunProgressStatusV1, ShipTaskRunResultStatusV1, ShipTaskRunStatusV1 } from "../../task/types/Task.js";
11
11
  /**
@@ -158,7 +158,7 @@ export type ScriptExecutionResult = {
158
158
  *
159
159
  * 关键点(中文)
160
160
  * - task runner 不直接依赖具体 SDK `Session` 实现。
161
- * - 这里暴露的是 task 场景最小可用端口:执行器 + history Store
161
+ * - 这里暴露的是 task 场景最小可用端口:执行器 + canonical Messages
162
162
  */
163
163
  export type TaskSessionRuntimePort = {
164
164
  /**
@@ -166,9 +166,9 @@ export type TaskSessionRuntimePort = {
166
166
  */
167
167
  getExecutor(sessionId: string): SessionExecutor;
168
168
  /**
169
- * 获取指定 sessionId 对应的 JsonlSessionHistoryStore
169
+ * 获取指定 sessionId 对应的 canonical Session Messages
170
170
  */
171
- getHistoryStore(sessionId: string): JsonlSessionHistoryStore;
171
+ get_messages(session_id: string): SessionMessages;
172
172
  };
173
173
  /**
174
174
  * 从 assistant 输出中提取的文本结果。
@@ -1 +1 @@
1
- {"version":3,"file":"TaskRunnerTypes.d.ts","sourceRoot":"","sources":["../../../src/task/runtime/TaskRunnerTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,2BAA2B,CAAC;IACpC;;OAEG;IACH,KAAK,EAAE,0BAA0B,CAAC;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,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CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IAChD;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TaskPluginOptions.d.ts","sourceRoot":"","sources":["../../../src/task/types/TaskPluginOptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"TaskPluginOptions.d.ts","sourceRoot":"","sources":["../../../src/task/types/TaskPluginOptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAEnB"}
@@ -2,6 +2,6 @@
2
2
  * 自动生成文件,请勿手改。
3
3
  * 源文件:由同路径 `*.ts.txt` 生成。
4
4
  */
5
- declare const TEXT_MODULE_CONTENT = "# Web Plugin\n\nThis plugin injects general web-access methodology. It does not choose a provider and does not guarantee that any specific web tool exists.\n\nIf web-related dependencies are needed, use the `web` plugin's `install` action to install capabilities such as `web-access`, `agent-browser`, or related skill/CLI dependencies. Installation only prepares capabilities; it does not mean the runtime must use a specific provider.\n\nWhen a task needs internet access, verification, webpage reading, webpage interaction, or browser use, choose the path based on the currently available tools, skills, and user goal.\n\n## General Principles\n\n- Goal-driven: think like a human. Define the success criteria first, then choose the starting point most likely to reach them directly.\n- Evidence at every step: each result is evidence. When a path stops making progress, switch methods instead of repeatedly retrying the wrong approach.\n- Prefer primary sources: search engines are for discovery. Conclusions should usually trace back to official sites, official platforms, original pages, official docs, or source code.\n- Stop when done: once the goal is reached, do not spend extra steps just to look more complete.\n- Capability self-check: do not assume that a web skill or tool exists. Prefer capabilities explicitly available in the current system/tool list or in already looked-up skills.\n\n## Tool Selection\n\n- To discover sources or map keyword context: prefer currently available search tools or web-access-style skills.\n- For a known URL where you need page text or a direct answer: prefer currently available fetch/read tools.\n- For a known URL where you need raw HTML, meta tags, JSON-LD, or similar structured content: prefer currently available HTTP/curl/shell capabilities.\n- For logged-in state, dynamic rendering, site navigation, complex interactions, or anti-bot pages: prefer currently available browser, Chrome, agent-browser, or computer-use capabilities.\n- Jina-style markdown preprocessing may help for article-like pages and save tokens, but do not blindly trust it for dashboards, product pages, or complex layouts.\n\n## Browser Strategy\n\n- Once in the browser layer, understand the page structure before choosing the next action.\n- Programmatic methods are faster but more likely to trigger anti-bot behavior. GUI interaction is slower but more deterministic. If programmatic access is blocked, fall back to GUI.\n- Prefer links generated by the page itself. Do not manually guess or trim internal URL parameters.\n- Operate only tabs you created. Do not disturb the user's existing tabs. Close tabs you created when the task is done.\n- When encountering a login wall, first decide whether it actually blocks the goal. Ask the user to log in only when the target cannot be reached otherwise.\n\n## Parallelism And Verification\n\n- Independent research targets may be split and run in parallel. Targets with dependencies should not be parallelized blindly.\n- Verification tasks should return to primary sources. Do not use multiple secondary reports to circularly confirm each other.\n\n## Relationship To Skills And Tools\n\n- If the current environment has a `web-access` skill, web search, scraping, and verification tasks may prefer its instructions.\n- If the current environment has `agent-browser`, browser, or Chrome capabilities, dynamic pages and logged-in tasks may prefer them.\n- If necessary web capability is missing, state that directly. Do not pretend you have accessed the web.\n\n## Available Action\n\n- `install`: prepare web-related skill/CLI dependencies.\n\nExample:\n\n```ts\nplugin_call({\n plugin: \"web\",\n action: \"install\",\n payload: {\n target: \"agent-browser\",\n scope: \"user\",\n },\n});\n```\n";
5
+ declare const TEXT_MODULE_CONTENT = "# Web Plugin\n\nThis plugin injects general web-access methodology. It does not choose a provider and does not guarantee that any specific web tool exists.\n\nIf web-related dependencies are needed, use the `web` plugin's `install` action to receive instructions for capabilities such as `web-access` and `agent-browser`. The action never executes commands, accesses the network, installs dependencies, or changes files. Follow the returned prompt with the available plugin and Shell capabilities.\n\nWhen a task needs internet access, verification, webpage reading, webpage interaction, or browser use, choose the path based on the currently available tools, skills, and user goal.\n\n## General Principles\n\n- Goal-driven: think like a human. Define the success criteria first, then choose the starting point most likely to reach them directly.\n- Evidence at every step: each result is evidence. When a path stops making progress, switch methods instead of repeatedly retrying the wrong approach.\n- Prefer primary sources: search engines are for discovery. Conclusions should usually trace back to official sites, official platforms, original pages, official docs, or source code.\n- Stop when done: once the goal is reached, do not spend extra steps just to look more complete.\n- Capability self-check: do not assume that a web skill or tool exists. Prefer capabilities explicitly available in the current system/tool list or in already looked-up skills.\n\n## Tool Selection\n\n- To discover sources or map keyword context: prefer currently available search tools or web-access-style skills.\n- For a known URL where you need page text or a direct answer: prefer currently available fetch/read tools.\n- For a known URL where you need raw HTML, meta tags, JSON-LD, or similar structured content: prefer currently available HTTP/curl/shell capabilities.\n- For logged-in state, dynamic rendering, site navigation, complex interactions, or anti-bot pages: prefer currently available browser, Chrome, agent-browser, or computer-use capabilities.\n- Jina-style markdown preprocessing may help for article-like pages and save tokens, but do not blindly trust it for dashboards, product pages, or complex layouts.\n\n## Browser Strategy\n\n- Once in the browser layer, understand the page structure before choosing the next action.\n- Programmatic methods are faster but more likely to trigger anti-bot behavior. GUI interaction is slower but more deterministic. If programmatic access is blocked, fall back to GUI.\n- Prefer links generated by the page itself. Do not manually guess or trim internal URL parameters.\n- Operate only tabs you created. Do not disturb the user's existing tabs. Close tabs you created when the task is done.\n- When encountering a login wall, first decide whether it actually blocks the goal. Ask the user to log in only when the target cannot be reached otherwise.\n\n## Parallelism And Verification\n\n- Independent research targets may be split and run in parallel. Targets with dependencies should not be parallelized blindly.\n- Verification tasks should return to primary sources. Do not use multiple secondary reports to circularly confirm each other.\n\n## Relationship To Skills And Tools\n\n- If the current environment has a `web-access` skill, web search, scraping, and verification tasks may prefer its instructions.\n- If the current environment has `agent-browser`, browser, or Chrome capabilities, dynamic pages and logged-in tasks may prefer them.\n- If necessary web capability is missing, state that directly. Do not pretend you have accessed the web.\n\n## Available Action\n\n- `install`: return installation instructions for web-related Skills and CLIs without executing them.\n\nExample:\n\n```ts\nplugin_call({\n plugin: \"web\",\n action: \"install\",\n payload: {\n target: \"agent-browser\",\n scope: \"user\",\n },\n});\n```\n\nAfter calling `install`, follow `data.prompt`. Skill installation is delegated to the `skill.install` instruction action so that the active SkillPlugin scan roots remain the source of truth. After running the instructed Shell commands, verify Skills with `skill.list` and read them with `skill.lookup`.\n";
6
6
  export default TEXT_MODULE_CONTENT;
7
7
  //# sourceMappingURL=PROMPT.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PROMPT.d.ts","sourceRoot":"","sources":["../../src/web/PROMPT.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,QAAA,MAAM,mBAAmB,mtHAAmtH,CAAC;AAE7uH,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"PROMPT.d.ts","sourceRoot":"","sources":["../../src/web/PROMPT.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,QAAA,MAAM,mBAAmB,+mIAA+mI,CAAC;AAEzoI,eAAe,mBAAmB,CAAC"}
package/bin/web/PROMPT.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * 自动生成文件,请勿手改。
3
3
  * 源文件:由同路径 `*.ts.txt` 生成。
4
4
  */
5
- // Source: src/web/PROMPT.ts.txt
6
- const TEXT_MODULE_CONTENT = "# Web Plugin\n\nThis plugin injects general web-access methodology. It does not choose a provider and does not guarantee that any specific web tool exists.\n\nIf web-related dependencies are needed, use the `web` plugin's `install` action to install capabilities such as `web-access`, `agent-browser`, or related skill/CLI dependencies. Installation only prepares capabilities; it does not mean the runtime must use a specific provider.\n\nWhen a task needs internet access, verification, webpage reading, webpage interaction, or browser use, choose the path based on the currently available tools, skills, and user goal.\n\n## General Principles\n\n- Goal-driven: think like a human. Define the success criteria first, then choose the starting point most likely to reach them directly.\n- Evidence at every step: each result is evidence. When a path stops making progress, switch methods instead of repeatedly retrying the wrong approach.\n- Prefer primary sources: search engines are for discovery. Conclusions should usually trace back to official sites, official platforms, original pages, official docs, or source code.\n- Stop when done: once the goal is reached, do not spend extra steps just to look more complete.\n- Capability self-check: do not assume that a web skill or tool exists. Prefer capabilities explicitly available in the current system/tool list or in already looked-up skills.\n\n## Tool Selection\n\n- To discover sources or map keyword context: prefer currently available search tools or web-access-style skills.\n- For a known URL where you need page text or a direct answer: prefer currently available fetch/read tools.\n- For a known URL where you need raw HTML, meta tags, JSON-LD, or similar structured content: prefer currently available HTTP/curl/shell capabilities.\n- For logged-in state, dynamic rendering, site navigation, complex interactions, or anti-bot pages: prefer currently available browser, Chrome, agent-browser, or computer-use capabilities.\n- Jina-style markdown preprocessing may help for article-like pages and save tokens, but do not blindly trust it for dashboards, product pages, or complex layouts.\n\n## Browser Strategy\n\n- Once in the browser layer, understand the page structure before choosing the next action.\n- Programmatic methods are faster but more likely to trigger anti-bot behavior. GUI interaction is slower but more deterministic. If programmatic access is blocked, fall back to GUI.\n- Prefer links generated by the page itself. Do not manually guess or trim internal URL parameters.\n- Operate only tabs you created. Do not disturb the user's existing tabs. Close tabs you created when the task is done.\n- When encountering a login wall, first decide whether it actually blocks the goal. Ask the user to log in only when the target cannot be reached otherwise.\n\n## Parallelism And Verification\n\n- Independent research targets may be split and run in parallel. Targets with dependencies should not be parallelized blindly.\n- Verification tasks should return to primary sources. Do not use multiple secondary reports to circularly confirm each other.\n\n## Relationship To Skills And Tools\n\n- If the current environment has a `web-access` skill, web search, scraping, and verification tasks may prefer its instructions.\n- If the current environment has `agent-browser`, browser, or Chrome capabilities, dynamic pages and logged-in tasks may prefer them.\n- If necessary web capability is missing, state that directly. Do not pretend you have accessed the web.\n\n## Available Action\n\n- `install`: prepare web-related skill/CLI dependencies.\n\nExample:\n\n```ts\nplugin_call({\n plugin: \"web\",\n action: \"install\",\n payload: {\n target: \"agent-browser\",\n scope: \"user\",\n },\n});\n```\n";
5
+ // Source: src/web/PROMPT.ts
6
+ const TEXT_MODULE_CONTENT = "# Web Plugin\n\nThis plugin injects general web-access methodology. It does not choose a provider and does not guarantee that any specific web tool exists.\n\nIf web-related dependencies are needed, use the `web` plugin's `install` action to receive instructions for capabilities such as `web-access` and `agent-browser`. The action never executes commands, accesses the network, installs dependencies, or changes files. Follow the returned prompt with the available plugin and Shell capabilities.\n\nWhen a task needs internet access, verification, webpage reading, webpage interaction, or browser use, choose the path based on the currently available tools, skills, and user goal.\n\n## General Principles\n\n- Goal-driven: think like a human. Define the success criteria first, then choose the starting point most likely to reach them directly.\n- Evidence at every step: each result is evidence. When a path stops making progress, switch methods instead of repeatedly retrying the wrong approach.\n- Prefer primary sources: search engines are for discovery. Conclusions should usually trace back to official sites, official platforms, original pages, official docs, or source code.\n- Stop when done: once the goal is reached, do not spend extra steps just to look more complete.\n- Capability self-check: do not assume that a web skill or tool exists. Prefer capabilities explicitly available in the current system/tool list or in already looked-up skills.\n\n## Tool Selection\n\n- To discover sources or map keyword context: prefer currently available search tools or web-access-style skills.\n- For a known URL where you need page text or a direct answer: prefer currently available fetch/read tools.\n- For a known URL where you need raw HTML, meta tags, JSON-LD, or similar structured content: prefer currently available HTTP/curl/shell capabilities.\n- For logged-in state, dynamic rendering, site navigation, complex interactions, or anti-bot pages: prefer currently available browser, Chrome, agent-browser, or computer-use capabilities.\n- Jina-style markdown preprocessing may help for article-like pages and save tokens, but do not blindly trust it for dashboards, product pages, or complex layouts.\n\n## Browser Strategy\n\n- Once in the browser layer, understand the page structure before choosing the next action.\n- Programmatic methods are faster but more likely to trigger anti-bot behavior. GUI interaction is slower but more deterministic. If programmatic access is blocked, fall back to GUI.\n- Prefer links generated by the page itself. Do not manually guess or trim internal URL parameters.\n- Operate only tabs you created. Do not disturb the user's existing tabs. Close tabs you created when the task is done.\n- When encountering a login wall, first decide whether it actually blocks the goal. Ask the user to log in only when the target cannot be reached otherwise.\n\n## Parallelism And Verification\n\n- Independent research targets may be split and run in parallel. Targets with dependencies should not be parallelized blindly.\n- Verification tasks should return to primary sources. Do not use multiple secondary reports to circularly confirm each other.\n\n## Relationship To Skills And Tools\n\n- If the current environment has a `web-access` skill, web search, scraping, and verification tasks may prefer its instructions.\n- If the current environment has `agent-browser`, browser, or Chrome capabilities, dynamic pages and logged-in tasks may prefer them.\n- If necessary web capability is missing, state that directly. Do not pretend you have accessed the web.\n\n## Available Action\n\n- `install`: return installation instructions for web-related Skills and CLIs without executing them.\n\nExample:\n\n```ts\nplugin_call({\n plugin: \"web\",\n action: \"install\",\n payload: {\n target: \"agent-browser\",\n scope: \"user\",\n },\n});\n```\n\nAfter calling `install`, follow `data.prompt`. Skill installation is delegated to the `skill.install` instruction action so that the active SkillPlugin scan roots remain the source of truth. After running the instructed Shell commands, verify Skills with `skill.list` and read them with `skill.lookup`.\n";
7
7
  export default TEXT_MODULE_CONTENT;
8
8
  //# sourceMappingURL=PROMPT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PROMPT.js","sourceRoot":"","sources":["../../src/web/PROMPT.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gCAAgC;AAChC,MAAM,mBAAmB,GAAG,gtHAAgtH,CAAC;AAE7uH,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"PROMPT.js","sourceRoot":"","sources":["../../src/web/PROMPT.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4BAA4B;AAC5B,MAAM,mBAAmB,GAAG,4mIAA4mI,CAAC;AAEzoI,eAAe,mBAAmB,CAAC"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 关键点(中文)
5
5
  * - web plugin 不选择 provider,也不持久化 provider 运行态。
6
- * - install action 只负责准备联网相关 skill / CLI 依赖。
6
+ * - install action 只返回联网能力安装提示,不执行命令或修改文件。
7
7
  * - 它只通过 `system()` 注入联网研究与浏览器使用方法论。
8
8
  * - 具体执行能力由当前 agent 已注册的 tools、skills 或外部 plugin 决定。
9
9
  */
@@ -26,26 +26,6 @@ export declare class WebPlugin extends BasePlugin {
26
26
  * 插件说明。
27
27
  */
28
28
  readonly description = "Injects web research and browser-use methodology for agents.";
29
- /**
30
- * setup 面板:只准备联网相关依赖,不做 provider 配置。
31
- */
32
- readonly setup: {
33
- mode: "install";
34
- title: string;
35
- description: string;
36
- fields: {
37
- key: string;
38
- label: string;
39
- type: "select";
40
- required: boolean;
41
- options: {
42
- label: string;
43
- value: string;
44
- hint: string;
45
- }[];
46
- }[];
47
- primaryAction: string;
48
- };
49
29
  /**
50
30
  * WebPlugin 对外 action。
51
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/web/Plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACV,MAAM,iBAAiB,CAAC;AAqDzB;;GAEG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC;;OAEG;IACH,QAAQ,CAAC,IAAI,SAAS;IAEtB;;OAEG;IACH,QAAQ,CAAC,KAAK,qBAAqB;IAEnC;;OAEG;IACH,QAAQ,CAAC,WAAW,kEAC6C;IAEjE;;OAEG;IACH,QAAQ,CAAC,KAAK;;;;;;;;;;;;;;;;MAyCZ;IAEF;;OAEG;IACH,QAAQ,CAAC,OAAO;;MAyEd;IAEF;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM;CAGvC"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/web/Plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAsB,MAAM,iBAAiB,CAAC;AA2CjF;;GAEG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC;;OAEG;IACH,QAAQ,CAAC,IAAI,SAAS;IAEtB;;OAEG;IACH,QAAQ,CAAC,KAAK,qBAAqB;IAEnC;;OAEG;IACH,QAAQ,CAAC,WAAW,kEAC6C;IAEjE;;OAEG;IACH,QAAQ,CAAC,OAAO;;MA8Dd;IAEF;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM;CAGvC"}