@downcity/plugins 1.0.34 → 1.0.38
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/bin/auth/Plugin.js +2 -2
- package/bin/auth/Plugin.js.map +1 -1
- package/bin/chat/Action.js +4 -4
- package/bin/chat/Action.js.map +1 -1
- package/bin/chat/accounts/ChannelAccountManager.d.ts +3 -3
- package/bin/chat/accounts/ChannelAccountManager.js +6 -6
- package/bin/chat/accounts/ChannelAccountManager.js.map +1 -1
- package/bin/chat/accounts/Crypto.d.ts +1 -1
- package/bin/chat/accounts/Crypto.js +1 -1
- package/bin/chat/accounts/Store.d.ts +8 -8
- package/bin/chat/accounts/Store.js +13 -13
- package/bin/chat/accounts/Store.js.map +1 -1
- package/bin/chat/channels/feishu/Configuration.d.ts +1 -1
- package/bin/chat/channels/feishu/Configuration.js +5 -5
- package/bin/chat/channels/feishu/Configuration.js.map +1 -1
- package/bin/chat/channels/qq/Configuration.d.ts +1 -1
- package/bin/chat/channels/qq/Configuration.js +5 -5
- package/bin/chat/channels/qq/Configuration.js.map +1 -1
- package/bin/chat/channels/telegram/BotInfo.d.ts +1 -1
- package/bin/chat/channels/telegram/BotInfo.js +1 -1
- package/bin/chat/channels/telegram/Configuration.d.ts +1 -1
- package/bin/chat/channels/telegram/Configuration.js +5 -5
- package/bin/chat/channels/telegram/Configuration.js.map +1 -1
- package/bin/chat/runtime/ChatChannelCore.d.ts +1 -1
- package/bin/chat/runtime/ChatChannelCore.js +1 -1
- package/bin/chat/runtime/ChatChannelLifecycle.js +1 -1
- package/bin/chat/runtime/ChatChannelLifecycle.js.map +1 -1
- package/bin/chat/runtime/ChatPluginSystem.d.ts +2 -2
- package/bin/chat/runtime/ChatPluginSystem.js +1 -1
- package/bin/chat/runtime/ChatPromptAssets.d.ts +1 -1
- package/bin/chat/runtime/ChatPromptAssets.js +1 -1
- package/bin/chat/runtime/ChatQueueWorker.d.ts.map +1 -1
- package/bin/chat/runtime/ChatQueueWorker.js +12 -33
- package/bin/chat/runtime/ChatQueueWorker.js.map +1 -1
- package/bin/chat/runtime/ChatSession.d.ts.map +1 -1
- package/bin/chat/runtime/ChatSession.js +11 -2
- package/bin/chat/runtime/ChatSession.js.map +1 -1
- package/bin/chat/runtime/SystemPrompt.js +2 -2
- package/bin/chat/runtime/SystemPrompt.js.map +1 -1
- package/bin/chat/types/BotInfo.d.ts +2 -2
- package/bin/chat/types/BotInfo.js +1 -1
- package/bin/chat/types/ChannelAccount.d.ts +12 -12
- package/bin/chat/types/ChannelAccount.js +2 -2
- package/bin/chat/types/ChannelConfiguration.d.ts +2 -2
- package/bin/chat/types/FeishuPost.d.ts +1 -1
- package/bin/chat/types/FeishuPost.js +1 -1
- package/bin/shell/runtime/ShellRuntimeEnvironment.js +4 -4
- package/bin/shell/runtime/ShellRuntimeEnvironment.js.map +1 -1
- package/bin/skill/runtime/SystemProvider.js +3 -3
- package/bin/skill/runtime/SystemProvider.js.map +1 -1
- package/bin/task/runtime/TaskRunnerRound.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunnerRound.js +13 -2
- package/bin/task/runtime/TaskRunnerRound.js.map +1 -1
- package/package.json +2 -2
- package/src/auth/Plugin.ts +2 -2
- package/src/chat/Action.ts +4 -4
- package/src/chat/accounts/ChannelAccountManager.ts +6 -6
- package/src/chat/accounts/Crypto.ts +1 -1
- package/src/chat/accounts/Store.ts +13 -13
- package/src/chat/channels/feishu/Configuration.ts +5 -5
- package/src/chat/channels/qq/Configuration.ts +5 -5
- package/src/chat/channels/telegram/BotInfo.ts +1 -1
- package/src/chat/channels/telegram/Configuration.ts +5 -5
- package/src/chat/runtime/ChatChannelCore.ts +1 -1
- package/src/chat/runtime/ChatChannelLifecycle.ts +1 -1
- package/src/chat/runtime/ChatPluginSystem.ts +2 -2
- package/src/chat/runtime/ChatPromptAssets.ts +1 -1
- package/src/chat/runtime/ChatQueueWorker.ts +12 -39
- package/src/chat/runtime/ChatSession.ts +12 -2
- package/src/chat/runtime/SystemPrompt.ts +2 -2
- package/src/chat/types/BotInfo.ts +2 -2
- package/src/chat/types/ChannelAccount.ts +12 -12
- package/src/chat/types/ChannelConfiguration.ts +2 -3
- package/src/chat/types/FeishuPost.ts +1 -1
- package/src/shell/runtime/ShellRuntimeEnvironment.ts +4 -4
- package/src/skill/runtime/SystemProvider.ts +3 -3
- package/src/task/runtime/TaskRunnerRound.ts +15 -2
|
@@ -11,6 +11,7 @@ import fs from "fs-extra";
|
|
|
11
11
|
import type { AgentContext } from "@downcity/agent/internal/types/runtime/agent/AgentContext.js";
|
|
12
12
|
import { runSandboxCommand } from "@downcity/agent/internal/sandbox/SandboxRunner.js";
|
|
13
13
|
import type { SessionRunResult } from "@downcity/agent/internal/executor/types/SessionRun.js";
|
|
14
|
+
import type { SessionRunContext } from "@downcity/agent/internal/types/executor/SessionRunContext.js";
|
|
14
15
|
import type { JsonObject } from "@downcity/agent/internal/types/common/Json.js";
|
|
15
16
|
import type {
|
|
16
17
|
ChatSendOutputPick,
|
|
@@ -245,7 +246,7 @@ export async function runAgentRound(params: {
|
|
|
245
246
|
|
|
246
247
|
const result = await withSessionRunScope(
|
|
247
248
|
{
|
|
248
|
-
|
|
249
|
+
runContext: create_task_run_context(params.sessionId),
|
|
249
250
|
},
|
|
250
251
|
() =>
|
|
251
252
|
params.taskSessionRuntime.getExecutor(params.sessionId).run({
|
|
@@ -286,7 +287,7 @@ export async function runScriptTask(params: {
|
|
|
286
287
|
await fs.writeFile(scriptAbs, body.endsWith("\n") ? body : `${body}\n`, "utf-8");
|
|
287
288
|
|
|
288
289
|
const execResult = await withSessionRunScope(
|
|
289
|
-
{
|
|
290
|
+
{ runContext: create_task_run_context(params.sessionId) },
|
|
290
291
|
() => {
|
|
291
292
|
const childEnv: NodeJS.ProcessEnv = {
|
|
292
293
|
...process.env,
|
|
@@ -314,6 +315,18 @@ export async function runScriptTask(params: {
|
|
|
314
315
|
};
|
|
315
316
|
}
|
|
316
317
|
|
|
318
|
+
/**
|
|
319
|
+
* 创建 task runner 的显式 session run context。
|
|
320
|
+
*/
|
|
321
|
+
function create_task_run_context(session_id: string): SessionRunContext {
|
|
322
|
+
return {
|
|
323
|
+
sessionId: session_id,
|
|
324
|
+
injectedUserMessages: [],
|
|
325
|
+
deferredPersistedUserMessages: [],
|
|
326
|
+
pendingAssistantFileParts: [],
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
317
330
|
/**
|
|
318
331
|
* 校验任务结果是否满足“必须有结果”的规则。
|
|
319
332
|
*/
|