@ai-setting/roy-agent-core 1.7.71 → 1.7.75
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/dist/env/agent/agent-component.js +6 -6
- package/dist/env/agent/agent-registry.d.ts +4 -1
- package/dist/env/agent/index.js +6 -6
- package/dist/env/agent/summary-agent.d.ts +6 -15
- package/dist/env/agent/types.d.ts +0 -17
- package/dist/env/error-reply.d.ts +46 -0
- package/dist/env/error-reply.js +3 -1
- package/dist/env/event-source/event-source-handlers.js +12 -12
- package/dist/env/event-source/index.js +13 -13
- package/dist/env/index.js +30 -31
- package/dist/env/llm/index.js +2 -2
- package/dist/env/llm/orphan-toolcall.d.ts +107 -0
- package/dist/env/llm/temperature-policy.d.ts +107 -0
- package/dist/env/llm/types.d.ts +2 -2
- package/dist/env/plugin/index.js +3 -3
- package/dist/env/prompt/index.js +3 -3
- package/dist/env/prompt/prompts-index.d.ts +26 -4
- package/dist/env/session/__bench__/replay-compact.d.ts +137 -0
- package/dist/env/session/__bench__/run-replay.d.ts +15 -0
- package/dist/env/session/compact-checkpoint-content.d.ts +67 -0
- package/dist/env/session/index.d.ts +1 -0
- package/dist/env/session/index.js +4 -5
- package/dist/env/session/session-component.d.ts +47 -30
- package/dist/env/session/storage/index.js +3 -3
- package/dist/env/session/storage/sqlite.d.ts +8 -0
- package/dist/env/session/types.d.ts +45 -30
- package/dist/env/task/delegate/delegate-tool.d.ts +8 -0
- package/dist/env/task/delegate/delegate-tool.js +4 -4
- package/dist/env/task/delegate/index.js +4 -4
- package/dist/env/task/index.js +7 -7
- package/dist/env/task/mcp/index.js +2 -2
- package/dist/env/task/plugins/index.d.ts +3 -0
- package/dist/env/task/plugins/index.js +32 -9
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +61 -0
- package/dist/env/task/plugins/lark-card-patch-notifier.js +6 -2
- package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +42 -0
- package/dist/env/task/prompt/index.js +1 -1
- package/dist/env/task/prompt/task-discipline.d.ts +9 -3
- package/dist/env/task/tools/cancel-tool.d.ts +28 -0
- package/dist/env/task/tools/index.d.ts +1 -0
- package/dist/env/task/tools/index.js +4 -2
- package/dist/env/task/tools/task-types.d.ts +22 -0
- package/dist/env/tool/built-in/compact-session-tool.d.ts +120 -0
- package/dist/env/tool/built-in/index.d.ts +2 -0
- package/dist/env/tool/built-in/index.js +6 -2
- package/dist/env/tool/index.js +4 -4
- package/dist/env/workflow/engine/index.js +6 -7
- package/dist/env/workflow/index.js +15 -14
- package/dist/env/workflow/plugins/index.js +2 -2
- package/dist/env/workflow/tools/ask-user-tool.d.ts +88 -0
- package/dist/env/workflow/tools/index.js +11 -10
- package/dist/env/workflow/tools/run-workflow.d.ts +2 -2
- package/dist/env/workflow/types/index.js +2 -2
- package/dist/env/workflow/types/workflow-hil.d.ts +25 -1
- package/dist/env/workflow/utils/index.js +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -34
- package/dist/shared/@ai-setting/{roy-agent-core-hy3zn2q2.js → roy-agent-core-0qyrk5k0.js} +22 -2
- package/dist/shared/@ai-setting/{roy-agent-core-kmbct9yg.js → roy-agent-core-0snm5hc5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-4jjwewvw.js → roy-agent-core-11shp00p.js} +31 -10
- package/dist/shared/@ai-setting/{roy-agent-core-yr1mryb8.js → roy-agent-core-1v4g0d4x.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-02j24hrg.js → roy-agent-core-264qexac.js} +71 -4
- package/dist/shared/@ai-setting/{roy-agent-core-9geem94g.js → roy-agent-core-29b6hc39.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-2akfd64z.js +374 -0
- package/dist/shared/@ai-setting/{roy-agent-core-zv8bswpw.js → roy-agent-core-3e6gg17d.js} +120 -28
- package/dist/shared/@ai-setting/{roy-agent-core-8cx7cfdg.js → roy-agent-core-3fh1f7s7.js} +2 -3
- package/dist/shared/@ai-setting/{roy-agent-core-mwa6apzx.js → roy-agent-core-4gr3k7qg.js} +17 -4
- package/dist/shared/@ai-setting/{roy-agent-core-zsbh9bfv.js → roy-agent-core-60jbrfye.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-add1zqsh.js → roy-agent-core-6cy43nss.js} +22 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mw2cen6s.js → roy-agent-core-6rh8k6ba.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-kpg25s2q.js → roy-agent-core-8ez6mccb.js} +4 -2
- package/dist/shared/@ai-setting/{roy-agent-core-sjr1kmfz.js → roy-agent-core-acj8ag08.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mds8tqd0.js → roy-agent-core-cgtq6427.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9bshyqjn.js → roy-agent-core-ddyk1rc0.js} +183 -132
- package/dist/shared/@ai-setting/{roy-agent-core-hfr6bzts.js → roy-agent-core-djpq6yb0.js} +16 -7
- package/dist/shared/@ai-setting/{roy-agent-core-002g6nfk.js → roy-agent-core-dqxec05w.js} +7 -6
- package/dist/shared/@ai-setting/{roy-agent-core-07fvy74y.js → roy-agent-core-ed233k5z.js} +21 -7
- package/dist/shared/@ai-setting/{roy-agent-core-jrj30vq3.js → roy-agent-core-er070zjq.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-40rv283c.js → roy-agent-core-fghc2m8z.js} +152 -2
- package/dist/shared/@ai-setting/{roy-agent-core-7sj9xs9c.js → roy-agent-core-hnyk1by7.js} +110 -2
- package/dist/shared/@ai-setting/{roy-agent-core-101qtkyc.js → roy-agent-core-jg65qnwa.js} +11 -8
- package/dist/shared/@ai-setting/{roy-agent-core-e25xkv53.js → roy-agent-core-mkc3zshb.js} +3 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0cb6w0k7.js → roy-agent-core-mww0mnd9.js} +231 -27
- package/dist/shared/@ai-setting/{roy-agent-core-5repth1n.js → roy-agent-core-n9q1encx.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-46rv4d7d.js → roy-agent-core-nmx9934r.js} +92 -2
- package/dist/shared/@ai-setting/{roy-agent-core-1w9y7mxj.js → roy-agent-core-p3zv1mx5.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-snvh4s2p.js +662 -0
- package/dist/shared/@ai-setting/{roy-agent-core-dt104qa1.js → roy-agent-core-v85n42ve.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-37tj4y6a.js → roy-agent-core-v87njmq7.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-k13pxrpk.js → roy-agent-core-y7x2qzwc.js} +553 -92
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-1gsbqesr.js +0 -1083
- package/dist/shared/@ai-setting/roy-agent-core-58804s3j.js +0 -155
- package/dist/shared/@ai-setting/roy-agent-core-ze068vc9.js +0 -37
|
@@ -24,10 +24,11 @@ import {
|
|
|
24
24
|
getRunWorkflowTool,
|
|
25
25
|
initRunWorkflowTool,
|
|
26
26
|
resetRunWorkflowTool
|
|
27
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
28
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
29
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
27
|
+
} from "../../../shared/@ai-setting/roy-agent-core-mww0mnd9.js";
|
|
28
|
+
import"../../../shared/@ai-setting/roy-agent-core-ddyk1rc0.js";
|
|
29
|
+
import"../../../shared/@ai-setting/roy-agent-core-0qyrk5k0.js";
|
|
30
30
|
import"../../../shared/@ai-setting/roy-agent-core-12n08pg5.js";
|
|
31
|
+
import"../../../shared/@ai-setting/roy-agent-core-6cy43nss.js";
|
|
31
32
|
import {
|
|
32
33
|
WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
|
|
33
34
|
WorkflowJsonOutputMarker,
|
|
@@ -35,18 +36,18 @@ import {
|
|
|
35
36
|
init_submit_json_output_tool,
|
|
36
37
|
parseWorkflowJsonOutput
|
|
37
38
|
} from "../../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
38
|
-
import"../../../shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
39
39
|
import"../../../shared/@ai-setting/roy-agent-core-7exqwax1.js";
|
|
40
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
41
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
42
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
40
|
+
import"../../../shared/@ai-setting/roy-agent-core-1v4g0d4x.js";
|
|
41
|
+
import"../../../shared/@ai-setting/roy-agent-core-cgtq6427.js";
|
|
42
|
+
import"../../../shared/@ai-setting/roy-agent-core-er070zjq.js";
|
|
43
43
|
import"../../../shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
44
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
45
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
44
|
+
import"../../../shared/@ai-setting/roy-agent-core-0snm5hc5.js";
|
|
45
|
+
import"../../../shared/@ai-setting/roy-agent-core-fghc2m8z.js";
|
|
46
46
|
import"../../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
47
47
|
import"../../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
48
48
|
import"../../../shared/@ai-setting/roy-agent-core-ntn32q7j.js";
|
|
49
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
49
|
+
import"../../../shared/@ai-setting/roy-agent-core-mkc3zshb.js";
|
|
50
|
+
import"../../../shared/@ai-setting/roy-agent-core-m880qz3y.js";
|
|
50
51
|
import"../../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
51
52
|
import"../../../shared/@ai-setting/roy-agent-core-pgvcf91v.js";
|
|
52
53
|
import"../../../shared/@ai-setting/roy-agent-core-ax9e9szb.js";
|
|
@@ -72,14 +72,14 @@ export declare const RunWorkflowInputSchema: z.ZodObject<{
|
|
|
72
72
|
}, "strict", z.ZodTypeAny, {
|
|
73
73
|
workflow_name: string;
|
|
74
74
|
input?: Record<string, any> | undefined;
|
|
75
|
-
timeout?: number | undefined;
|
|
76
75
|
session?: string | undefined;
|
|
76
|
+
timeout?: number | undefined;
|
|
77
77
|
node_config?: Record<string, Record<string, any>> | undefined;
|
|
78
78
|
}, {
|
|
79
79
|
workflow_name: string;
|
|
80
80
|
input?: Record<string, any> | undefined;
|
|
81
|
-
timeout?: number | undefined;
|
|
82
81
|
session?: string | undefined;
|
|
82
|
+
timeout?: number | undefined;
|
|
83
83
|
node_config?: Record<string, Record<string, any>> | undefined;
|
|
84
84
|
}>;
|
|
85
85
|
export type RunWorkflowInput = z.infer<typeof RunWorkflowInputSchema>;
|
|
@@ -49,12 +49,12 @@ import {
|
|
|
49
49
|
parseWorkflowFileSync,
|
|
50
50
|
pathNotFound,
|
|
51
51
|
unresolvedVariable
|
|
52
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
52
|
+
} from "../../../shared/@ai-setting/roy-agent-core-er070zjq.js";
|
|
53
53
|
import {
|
|
54
54
|
AskUserError,
|
|
55
55
|
createNodeInterruptEvent,
|
|
56
56
|
createWorkflowAskUserEvent
|
|
57
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
57
|
+
} from "../../../shared/@ai-setting/roy-agent-core-mkc3zshb.js";
|
|
58
58
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
59
59
|
init_types();
|
|
60
60
|
|
|
@@ -47,9 +47,33 @@ export declare class AskUserError extends Error {
|
|
|
47
47
|
readonly query: string;
|
|
48
48
|
readonly agentSessionId?: string | undefined;
|
|
49
49
|
readonly timestamp: number;
|
|
50
|
+
/**
|
|
51
|
+
* ★ Task #4983 — 问题**是否已经投递到用户渠道**。
|
|
52
|
+
*
|
|
53
|
+
* 语义:`true` = 工具层已经把问题正文发到 IM 渠道(用户已看到),
|
|
54
|
+
* `false` / 缺省 = **没投成** ⇒ CLI 层应当兜底补投。
|
|
55
|
+
*
|
|
56
|
+
* 为什么需要:core 的 ask_user 工具层是**主修**(抛错前投递),
|
|
57
|
+
* 但它依赖 EnvContext 里有 replyChannel —— 拿不到就投不了。
|
|
58
|
+
* CLI 层(query-executor)是**兜底**。两层靠这个标记**互斥**,
|
|
59
|
+
* 避免用户收到两条同样的问题。
|
|
60
|
+
*/
|
|
61
|
+
readonly delivered: boolean;
|
|
50
62
|
readonly type = "ask-user";
|
|
51
63
|
readonly name = "AskUserError";
|
|
52
|
-
constructor(runId: string, sessionId: string, nodeId: string, nodeType: string, query: string, agentSessionId?: string | undefined, timestamp?: number
|
|
64
|
+
constructor(runId: string, sessionId: string, nodeId: string, nodeType: string, query: string, agentSessionId?: string | undefined, timestamp?: number,
|
|
65
|
+
/**
|
|
66
|
+
* ★ Task #4983 — 问题**是否已经投递到用户渠道**。
|
|
67
|
+
*
|
|
68
|
+
* 语义:`true` = 工具层已经把问题正文发到 IM 渠道(用户已看到),
|
|
69
|
+
* `false` / 缺省 = **没投成** ⇒ CLI 层应当兜底补投。
|
|
70
|
+
*
|
|
71
|
+
* 为什么需要:core 的 ask_user 工具层是**主修**(抛错前投递),
|
|
72
|
+
* 但它依赖 EnvContext 里有 replyChannel —— 拿不到就投不了。
|
|
73
|
+
* CLI 层(query-executor)是**兜底**。两层靠这个标记**互斥**,
|
|
74
|
+
* 避免用户收到两条同样的问题。
|
|
75
|
+
*/
|
|
76
|
+
delivered?: boolean);
|
|
53
77
|
/**
|
|
54
78
|
* 转换为 WorkflowAskUserEvent
|
|
55
79
|
*/
|
|
@@ -14,20 +14,20 @@ import {
|
|
|
14
14
|
hasClosedOutputContract,
|
|
15
15
|
validateTemplateContracts,
|
|
16
16
|
validateWorkflowDefinition
|
|
17
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
17
|
+
} from "../../../shared/@ai-setting/roy-agent-core-1v4g0d4x.js";
|
|
18
18
|
import {
|
|
19
19
|
TemplateResolver,
|
|
20
20
|
init_template_resolver,
|
|
21
21
|
resolveTemplateString,
|
|
22
22
|
resolveTemplates
|
|
23
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
23
|
+
} from "../../../shared/@ai-setting/roy-agent-core-acj8ag08.js";
|
|
24
24
|
import {
|
|
25
25
|
getFromMapWithNormalization,
|
|
26
26
|
init_node_id_utils
|
|
27
27
|
} from "../../../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
28
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
29
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
30
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
28
|
+
import"../../../shared/@ai-setting/roy-agent-core-cgtq6427.js";
|
|
29
|
+
import"../../../shared/@ai-setting/roy-agent-core-er070zjq.js";
|
|
30
|
+
import"../../../shared/@ai-setting/roy-agent-core-mkc3zshb.js";
|
|
31
31
|
import {
|
|
32
32
|
TracedAs,
|
|
33
33
|
init_decorator
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export { PromptStore } from "./env/prompt/prompt-store";
|
|
|
26
26
|
export { closeDatabase } from "./env/workflow/storage/sqlite";
|
|
27
27
|
export type { PromptConfig, PromptPath, PromptEntry, PromptSource, PromptHook, RenderHookContext, PromptHookMap, } from "./env/prompt/types";
|
|
28
28
|
export { SessionComponent, MemorySessionStore, } from "./env/session";
|
|
29
|
-
export type { Session, SessionMessage, SessionConfig, CreateSessionOptions, UpdateSessionOptions, ListSessionsOptions, AddMessageOptions, SessionCheckpoint, CompactOptions, CompactResult, CompactPreview, GetContextOptions, GetContextResult, CheckpointType, SearchMessagesOptions, MessageMatch, SearchResult, } from "./env/session/types";
|
|
29
|
+
export type { Session, SessionMessage, SessionConfig, CreateSessionOptions, UpdateSessionOptions, ListSessionsOptions, AddMessageOptions, SessionCheckpoint, CompactOptions, CompactResult, CompactPreview, CheckpointAdaptReport, GetContextOptions, GetContextResult, CheckpointType, SearchMessagesOptions, MessageMatch, SearchResult, } from "./env/session/types";
|
|
30
30
|
export { cascadeStopSessionTree, type CascadeStopOptions, type CascadeStopResult, } from "./env/session-tree-stopper";
|
|
31
31
|
export { createMemoryAgentTools, } from "./env/memory/tools/memory-agent-tools";
|
|
32
32
|
export type { SearchSessionsParams, GetSessionParams, WriteMemoryParams, } from "./env/memory/tools/memory-agent-tools";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromptComponent,
|
|
3
3
|
PromptStore
|
|
4
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
4
|
+
} from "./shared/@ai-setting/roy-agent-core-29b6hc39.js";
|
|
5
5
|
import {
|
|
6
6
|
LLMComponent,
|
|
7
7
|
LLMConfigSchema,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ModelLimitsSchema,
|
|
10
10
|
ProviderCapabilitiesSchema,
|
|
11
11
|
ProviderConfigSchema
|
|
12
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
12
|
+
} from "./shared/@ai-setting/roy-agent-core-264qexac.js";
|
|
13
13
|
import"./shared/@ai-setting/roy-agent-core-wjmwwc4a.js";
|
|
14
14
|
import"./shared/@ai-setting/roy-agent-core-pnj0zh25.js";
|
|
15
15
|
import {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
grepTool,
|
|
22
22
|
readFileTool,
|
|
23
23
|
writeFileTool
|
|
24
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
24
|
+
} from "./shared/@ai-setting/roy-agent-core-8ez6mccb.js";
|
|
25
25
|
import {
|
|
26
26
|
getUnderstandImageLLMProvider,
|
|
27
27
|
resetUnderstandImageLLMProvider,
|
|
@@ -62,21 +62,21 @@ import {
|
|
|
62
62
|
BaseEnvironment,
|
|
63
63
|
generateDescendingId,
|
|
64
64
|
generateId
|
|
65
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
65
|
+
} from "./shared/@ai-setting/roy-agent-core-snvh4s2p.js";
|
|
66
66
|
import {
|
|
67
67
|
TaskComponent
|
|
68
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
69
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
68
|
+
} from "./shared/@ai-setting/roy-agent-core-4gr3k7qg.js";
|
|
69
|
+
import"./shared/@ai-setting/roy-agent-core-2akfd64z.js";
|
|
70
70
|
import"./shared/@ai-setting/roy-agent-core-jm136jzh.js";
|
|
71
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
71
|
+
import"./shared/@ai-setting/roy-agent-core-jg65qnwa.js";
|
|
72
72
|
import"./shared/@ai-setting/roy-agent-core-fttgm52a.js";
|
|
73
73
|
import"./shared/@ai-setting/roy-agent-core-ntq0gz7q.js";
|
|
74
74
|
import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
75
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
75
|
+
import"./shared/@ai-setting/roy-agent-core-hnyk1by7.js";
|
|
76
76
|
import"./shared/@ai-setting/roy-agent-core-p5cz9m8v.js";
|
|
77
77
|
import {
|
|
78
78
|
EventSourceComponent
|
|
79
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
79
|
+
} from "./shared/@ai-setting/roy-agent-core-n9q1encx.js";
|
|
80
80
|
import {
|
|
81
81
|
BountyIMInstance,
|
|
82
82
|
COMMAND_PREFIX,
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
timerHandler,
|
|
109
109
|
translateCardActionToCommand,
|
|
110
110
|
writeFallbackModelList
|
|
111
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
111
|
+
} from "./shared/@ai-setting/roy-agent-core-60jbrfye.js";
|
|
112
112
|
import {
|
|
113
113
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
114
114
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -118,7 +118,6 @@ import {
|
|
|
118
118
|
isValidEventSourceType,
|
|
119
119
|
validateEventSourceConfig
|
|
120
120
|
} from "./shared/@ai-setting/roy-agent-core-bxkjk7zx.js";
|
|
121
|
-
import"./shared/@ai-setting/roy-agent-core-add1zqsh.js";
|
|
122
121
|
import {
|
|
123
122
|
CLI_COMMAND_ES_TYPE,
|
|
124
123
|
CLI_SESSION_CHAT_ID_PREFIX,
|
|
@@ -133,7 +132,7 @@ import {
|
|
|
133
132
|
import {
|
|
134
133
|
TaskTagPlugin,
|
|
135
134
|
createAutoTaskPlugin
|
|
136
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
135
|
+
} from "./shared/@ai-setting/roy-agent-core-y7x2qzwc.js";
|
|
137
136
|
import {
|
|
138
137
|
EventStoreImpl,
|
|
139
138
|
getSharedEventStore,
|
|
@@ -143,7 +142,7 @@ import {
|
|
|
143
142
|
import {
|
|
144
143
|
getBuiltInPrompt,
|
|
145
144
|
getBuiltInPromptNames
|
|
146
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
145
|
+
} from "./shared/@ai-setting/roy-agent-core-3e6gg17d.js";
|
|
147
146
|
import {
|
|
148
147
|
SQLiteTaskStore,
|
|
149
148
|
getDefaultTaskDbPath
|
|
@@ -158,12 +157,12 @@ import {
|
|
|
158
157
|
TASK_DISCIPLINE_LIFECYCLE,
|
|
159
158
|
TASK_DISCIPLINE_OPERATION,
|
|
160
159
|
TASK_DISCIPLINE_PROMPT
|
|
161
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
162
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
163
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
160
|
+
} from "./shared/@ai-setting/roy-agent-core-11shp00p.js";
|
|
161
|
+
import"./shared/@ai-setting/roy-agent-core-p3zv1mx5.js";
|
|
162
|
+
import"./shared/@ai-setting/roy-agent-core-nmx9934r.js";
|
|
164
163
|
import {
|
|
165
164
|
WorkflowComponent
|
|
166
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
165
|
+
} from "./shared/@ai-setting/roy-agent-core-v87njmq7.js";
|
|
167
166
|
import {
|
|
168
167
|
init_node_registry_helper,
|
|
169
168
|
registerDecoratorNodeType
|
|
@@ -176,29 +175,29 @@ import {
|
|
|
176
175
|
createWorkflowFromClass
|
|
177
176
|
} from "./shared/@ai-setting/roy-agent-core-h0x19xgn.js";
|
|
178
177
|
import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
179
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
178
|
+
import"./shared/@ai-setting/roy-agent-core-mww0mnd9.js";
|
|
180
179
|
import {
|
|
181
180
|
SessionComponent
|
|
182
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
181
|
+
} from "./shared/@ai-setting/roy-agent-core-ddyk1rc0.js";
|
|
183
182
|
import {
|
|
184
183
|
MemorySessionStore
|
|
185
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
184
|
+
} from "./shared/@ai-setting/roy-agent-core-0qyrk5k0.js";
|
|
186
185
|
import"./shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
187
186
|
import"./shared/@ai-setting/roy-agent-core-12n08pg5.js";
|
|
188
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
187
|
+
import"./shared/@ai-setting/roy-agent-core-6cy43nss.js";
|
|
188
|
+
import"./shared/@ai-setting/roy-agent-core-6rh8k6ba.js";
|
|
189
189
|
import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
190
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
190
|
+
import"./shared/@ai-setting/roy-agent-core-dqxec05w.js";
|
|
191
191
|
import"./shared/@ai-setting/roy-agent-core-efkjyh69.js";
|
|
192
192
|
import"./shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
193
|
-
import"./shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
194
193
|
import"./shared/@ai-setting/roy-agent-core-dvtg4sn0.js";
|
|
195
194
|
import"./shared/@ai-setting/roy-agent-core-c2gbt68e.js";
|
|
196
195
|
import"./shared/@ai-setting/roy-agent-core-7exqwax1.js";
|
|
197
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
198
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
196
|
+
import"./shared/@ai-setting/roy-agent-core-1v4g0d4x.js";
|
|
197
|
+
import"./shared/@ai-setting/roy-agent-core-acj8ag08.js";
|
|
199
198
|
import"./shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
200
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
201
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
199
|
+
import"./shared/@ai-setting/roy-agent-core-cgtq6427.js";
|
|
200
|
+
import"./shared/@ai-setting/roy-agent-core-er070zjq.js";
|
|
202
201
|
import"./shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
203
202
|
import {
|
|
204
203
|
CommandsComponent
|
|
@@ -207,23 +206,23 @@ import"./shared/@ai-setting/roy-agent-core-jagkferh.js";
|
|
|
207
206
|
import {
|
|
208
207
|
AgentComponent,
|
|
209
208
|
AgentComponentConfigSchema
|
|
210
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
209
|
+
} from "./shared/@ai-setting/roy-agent-core-djpq6yb0.js";
|
|
211
210
|
import {
|
|
212
211
|
ToolComponent,
|
|
213
212
|
ToolRegistry,
|
|
214
213
|
ToolValidator
|
|
215
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
214
|
+
} from "./shared/@ai-setting/roy-agent-core-v85n42ve.js";
|
|
216
215
|
import"./shared/@ai-setting/roy-agent-core-jvv2h3d6.js";
|
|
217
216
|
import {
|
|
218
217
|
AgentRegistry
|
|
219
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
218
|
+
} from "./shared/@ai-setting/roy-agent-core-ed233k5z.js";
|
|
220
219
|
import {
|
|
221
220
|
XDG_PATHS,
|
|
222
221
|
getXDGPath,
|
|
223
222
|
getXDGPaths
|
|
224
223
|
} from "./shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
225
224
|
import"./shared/@ai-setting/roy-agent-core-f77k3gqt.js";
|
|
226
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
225
|
+
import"./shared/@ai-setting/roy-agent-core-0snm5hc5.js";
|
|
227
226
|
import {
|
|
228
227
|
buildOpencodeHeaders,
|
|
229
228
|
createInvokeConfig,
|
|
@@ -232,7 +231,7 @@ import {
|
|
|
232
231
|
isOpencodeEndpoint,
|
|
233
232
|
isOpencodeProvider,
|
|
234
233
|
parseModelString
|
|
235
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
234
|
+
} from "./shared/@ai-setting/roy-agent-core-fghc2m8z.js";
|
|
236
235
|
import {
|
|
237
236
|
ATTACH_FILE_MAX_BYTES,
|
|
238
237
|
isMediaType,
|
|
@@ -244,14 +243,14 @@ import"./shared/@ai-setting/roy-agent-core-ntn32q7j.js";
|
|
|
244
243
|
import {
|
|
245
244
|
AskUserError,
|
|
246
245
|
init_workflow_hil
|
|
247
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
246
|
+
} from "./shared/@ai-setting/roy-agent-core-mkc3zshb.js";
|
|
248
247
|
import {
|
|
249
248
|
PluginComponent
|
|
250
249
|
} from "./shared/@ai-setting/roy-agent-core-v6vr6za7.js";
|
|
251
|
-
import"./shared/@ai-setting/roy-agent-core-m880qz3y.js";
|
|
252
250
|
import {
|
|
253
251
|
BasePlugin
|
|
254
252
|
} from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
253
|
+
import"./shared/@ai-setting/roy-agent-core-m880qz3y.js";
|
|
255
254
|
import {
|
|
256
255
|
McpComponent
|
|
257
256
|
} from "./shared/@ai-setting/roy-agent-core-6j02sbee.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionMessageConverter
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-0snm5hc5.js";
|
|
4
4
|
import {
|
|
5
5
|
canonicalizeParts
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-fghc2m8z.js";
|
|
7
7
|
import {
|
|
8
8
|
createLogger,
|
|
9
9
|
init_logger
|
|
@@ -1042,6 +1042,26 @@ class SQLiteSessionStore extends BaseSessionStore {
|
|
|
1042
1042
|
return [];
|
|
1043
1043
|
return Object.values(checkpointDetails);
|
|
1044
1044
|
}
|
|
1045
|
+
async replaceCheckpointDetails(sessionId, checkpoints) {
|
|
1046
|
+
await this.initialize();
|
|
1047
|
+
const session = await this.get(sessionId);
|
|
1048
|
+
if (!session) {
|
|
1049
|
+
throw new Error(`Session not found: ${sessionId}`);
|
|
1050
|
+
}
|
|
1051
|
+
const meta = session.metadata || {};
|
|
1052
|
+
const details = meta.checkpointDetails || {};
|
|
1053
|
+
for (const cp of checkpoints) {
|
|
1054
|
+
details[cp.id] = cp;
|
|
1055
|
+
}
|
|
1056
|
+
meta.checkpointDetails = details;
|
|
1057
|
+
session.metadata = meta;
|
|
1058
|
+
session.updatedAt = Date.now();
|
|
1059
|
+
this.db.prepare("UPDATE session SET metadata = ?, updated_at = ? WHERE id = ?").run(JSON.stringify(session.metadata), session.updatedAt, sessionId);
|
|
1060
|
+
this.checkpointsCache.set(sessionId, Object.values(details));
|
|
1061
|
+
this.sessionsCache.set(sessionId, session);
|
|
1062
|
+
logger.info(`[SQLiteSessionStore] replaceCheckpointDetails: wrote ${checkpoints.length} checkpoint(s) for ${sessionId}`);
|
|
1063
|
+
return true;
|
|
1064
|
+
}
|
|
1045
1065
|
async getCheckpoint(sessionId, checkpointId) {
|
|
1046
1066
|
await this.initialize();
|
|
1047
1067
|
const checkpoints = await this.getCheckpoints(sessionId);
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
var TASK_COMPLETE_ITEM_BY_ITEM = "按子项逐条验收";
|
|
3
3
|
var TASK_COMPLETION_HINT_ANCHOR = "TASK_COMPLETION_HINT";
|
|
4
4
|
var TASK_COMPLETE_VERIFY_DUTY = "核实义务";
|
|
5
|
+
var TASK_COMPLETE_ACCEPTANCE = {
|
|
6
|
+
itemByItem: TASK_COMPLETE_ITEM_BY_ITEM,
|
|
7
|
+
hintAnchor: TASK_COMPLETION_HINT_ANCHOR,
|
|
8
|
+
verifyDuty: TASK_COMPLETE_VERIFY_DUTY
|
|
9
|
+
};
|
|
5
10
|
|
|
6
11
|
// src/env/task/prompt/task-discipline.ts
|
|
7
12
|
var TASK_DISCIPLINE_LIFECYCLE = `### Task Lifecycle (7 steps, 0-6)
|
|
@@ -52,13 +57,18 @@ var TASK_DISCIPLINE_LIFECYCLE = `### Task Lifecycle (7 steps, 0-6)
|
|
|
52
57
|
|
|
53
58
|
4. TRACK
|
|
54
59
|
- Update progress (0-100%) as the work advances
|
|
55
|
-
- Update status: todo → active
|
|
60
|
+
- Update status: todo → active
|
|
56
61
|
- Record \`current_status\` with human-readable progress
|
|
62
|
+
- ⚠️ **不要**把 status 直接置为 \`completed\` —— 终态由验收方落(见步骤 6)
|
|
57
63
|
|
|
58
64
|
5. RECORD — operation records (see Operation Discipline below)
|
|
59
65
|
|
|
60
|
-
6. COMPLETE —
|
|
61
|
-
|
|
66
|
+
6. COMPLETE — 收尾分两种角色(Task #5007,验收权分离)
|
|
67
|
+
- **执行方(roy sub-agent)**:进度达到你判断的 100% ⇒ \`task_update(progress=100)\`
|
|
68
|
+
+ 最后一条 \`task_operation_create\` ⇒ **结束并返回结果**。
|
|
69
|
+
❌ **不要调用 \`task_complete\`**(你无此权限)。
|
|
70
|
+
- **验收方(default agent / 接待员)**:\`task_complete\` after item-by-item verification
|
|
71
|
+
(see Complete Discipline below)`.trim();
|
|
62
72
|
var TASK_DISCIPLINE_OPERATION = `### Operation Record — 双维度分工规范
|
|
63
73
|
|
|
64
74
|
**Record milestones as you work** — call \`task_operation_create\` the moment a
|
|
@@ -124,7 +134,11 @@ Reference the four atomic assertion forms (Task #4768
|
|
|
124
134
|
- 进程断言 (process assertion): command exit code / stdout match
|
|
125
135
|
- 测试断言 (test assertion): pass/fail counts, no NEW fail
|
|
126
136
|
- 状态断言 (state assertion): version number / HTTP 200 / status field`;
|
|
127
|
-
var TASK_DISCIPLINE_COMPLETE = `### Task Complete —
|
|
137
|
+
var TASK_DISCIPLINE_COMPLETE = `### Task Complete — 核实义务(**仅验收方适用**)
|
|
138
|
+
|
|
139
|
+
> ⚠️ **角色作用域(Task #5007)**:本节是**验收方**(default agent / 接待员)的动作。
|
|
140
|
+
> 若你是**执行方**(roy sub-agent),你没有 \`task_complete\` 权限 ——
|
|
141
|
+
> 你的收尾动作是「进度推到 100% + 记完操作记录 + 结束返回」,验收由主智能体负责。
|
|
128
142
|
|
|
129
143
|
Before calling \`task_complete\`, you MUST:
|
|
130
144
|
|
|
@@ -142,12 +156,19 @@ Before calling \`task_complete\`, you MUST:
|
|
|
142
156
|
\`[${TASK_COMPLETION_HINT_ANCHOR}]\`.
|
|
143
157
|
- **If you receive a [${TASK_COMPLETION_HINT_ANCHOR}]**, you MUST verify it
|
|
144
158
|
(${TASK_COMPLETE_VERIFY_DUTY}): re-read the task via \`task_get\`, then do exactly one of:
|
|
145
|
-
(a) 确认未完成 →
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
159
|
+
(a) 确认未完成 → **重新委托**(用你的委托工具 + 同一 sub-session 续跑,
|
|
160
|
+
在指令里写明"目标尚未达成,需要补 X/Y/Z"),由 sub-agent 用
|
|
161
|
+
\`task_update(status=active)\` 重开并继续推进;若你**自己就是执行方**
|
|
162
|
+
(有 \`task_update\` 权限),则直接 \`task_update(status=todo)\` 重开;或
|
|
163
|
+
(b) 确认已完成 → **用你手上有权限的写工具**落一条 \`decision\` 类操作记录
|
|
164
|
+
(\`task_operation_create\`,milestone_type=decision,milestone_title=<一行结论>)
|
|
165
|
+
说明子项实际已达成(说明理由)。若你没有该工具的权限(验收方场景),
|
|
166
|
+
就通过你的**委托工具**让 sub-agent 代写这条记录,或在 \`task_complete\`
|
|
167
|
+
的 \`deliverable_storage_path\` / 最终汇报里明确写出核实结论与证据。
|
|
150
168
|
Never ignore it (不允许无视).
|
|
169
|
+
⚠️ **核实义务的两条路径都依赖写权限**(\`task_update\` / \`task_operation_create\`)。
|
|
170
|
+
若这些工具对你**不可用**(如验收方不持有执行类工具),必须**改用委托**把动作
|
|
171
|
+
交回给有权限的 sub-agent 执行 —— 不要试图调用不可用的工具(会被拦掉并浪费一轮迭代)。
|
|
151
172
|
- If the goal and delivery mismatch **without** a hint, either:
|
|
152
173
|
(a) extend the task via \`task_update\`, or
|
|
153
174
|
(b) record the discrepancy via \`task_operation_create\`
|
|
@@ -179,4 +200,4 @@ var TASK_DISCIPLINE_PROMPT = [
|
|
|
179
200
|
|
|
180
201
|
`);
|
|
181
202
|
|
|
182
|
-
export { TASK_COMPLETE_ITEM_BY_ITEM, TASK_COMPLETION_HINT_ANCHOR, TASK_COMPLETE_VERIFY_DUTY, TASK_DISCIPLINE_LIFECYCLE, TASK_DISCIPLINE_OPERATION, TASK_DISCIPLINE_GOALS, TASK_DISCIPLINE_COMPLETE, TASK_DISCIPLINE_PROMPT };
|
|
203
|
+
export { TASK_COMPLETE_ITEM_BY_ITEM, TASK_COMPLETION_HINT_ANCHOR, TASK_COMPLETE_VERIFY_DUTY, TASK_COMPLETE_ACCEPTANCE, TASK_DISCIPLINE_LIFECYCLE, TASK_DISCIPLINE_OPERATION, TASK_DISCIPLINE_GOALS, TASK_DISCIPLINE_COMPLETE, TASK_DISCIPLINE_PROMPT };
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
PiAiAdapter,
|
|
7
7
|
invoke,
|
|
8
8
|
invokeNonStream
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-fghc2m8z.js";
|
|
10
10
|
import {
|
|
11
11
|
ContextError,
|
|
12
12
|
ErrorCodes
|
|
@@ -241,7 +241,7 @@ var LLMConfigSchema = z.object({
|
|
|
241
241
|
defaultModel: z.string().optional(),
|
|
242
242
|
providers: z.record(z.string(), ProviderConfigSchema),
|
|
243
243
|
defaultProvider: z.string(),
|
|
244
|
-
temperature: z.number().min(0).max(2).
|
|
244
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
245
245
|
maxTokens: z.number().int().positive().optional(),
|
|
246
246
|
topP: z.number().min(0).max(1).optional(),
|
|
247
247
|
stream: z.boolean().default(true),
|
|
@@ -627,6 +627,58 @@ import { randomUUID } from "crypto";
|
|
|
627
627
|
import * as fs from "node:fs/promises";
|
|
628
628
|
import * as os from "node:os";
|
|
629
629
|
import * as path from "node:path";
|
|
630
|
+
|
|
631
|
+
// src/env/llm/temperature-policy.ts
|
|
632
|
+
var FIXED_TEMPERATURE_ENDPOINTS = [
|
|
633
|
+
{
|
|
634
|
+
id: "kimi-for-coding",
|
|
635
|
+
baseURLIncludes: "api.kimi.com/coding",
|
|
636
|
+
providerIds: ["kimi-coding"],
|
|
637
|
+
temperature: 1,
|
|
638
|
+
reason: "Kimi For Coding 端点(api.kimi.com/coding)对所有它服务的模型都只接受 temperature=1 或不传;" + "发 0.7 会 400 invalid temperature(Task #4946 实测 6 个模型全覆盖)"
|
|
639
|
+
}
|
|
640
|
+
];
|
|
641
|
+
function findFixedTemperatureRule(input) {
|
|
642
|
+
const { providerId, baseURL } = input;
|
|
643
|
+
if (baseURL) {
|
|
644
|
+
const normalized = baseURL.toLowerCase();
|
|
645
|
+
for (const rule of FIXED_TEMPERATURE_ENDPOINTS) {
|
|
646
|
+
if (normalized.includes(rule.baseURLIncludes.toLowerCase()))
|
|
647
|
+
return rule;
|
|
648
|
+
}
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
if (providerId) {
|
|
652
|
+
for (const rule of FIXED_TEMPERATURE_ENDPOINTS) {
|
|
653
|
+
if (rule.providerIds?.includes(providerId))
|
|
654
|
+
return rule;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
var DEFAULT_TEMPERATURE = 0.7;
|
|
660
|
+
function toNumberOrUndefined(value) {
|
|
661
|
+
if (typeof value === "number")
|
|
662
|
+
return Number.isFinite(value) ? value : undefined;
|
|
663
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
664
|
+
const n = Number(value);
|
|
665
|
+
return Number.isFinite(n) ? n : undefined;
|
|
666
|
+
}
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
function resolveTemperature(input) {
|
|
670
|
+
const base = toNumberOrUndefined(input.requestTemperature) ?? toNumberOrUndefined(input.globalTemperature) ?? toNumberOrUndefined(input.providerTemperature) ?? DEFAULT_TEMPERATURE;
|
|
671
|
+
const rule = findFixedTemperatureRule({
|
|
672
|
+
providerId: input.providerId,
|
|
673
|
+
baseURL: input.baseURL
|
|
674
|
+
});
|
|
675
|
+
if (rule) {
|
|
676
|
+
return { temperature: rule.temperature, clampedBy: rule };
|
|
677
|
+
}
|
|
678
|
+
return { temperature: base };
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// src/env/llm/llm.ts
|
|
630
682
|
var logger = createLogger("llm");
|
|
631
683
|
function normalizeUsage(usage) {
|
|
632
684
|
if (!usage)
|
|
@@ -886,7 +938,7 @@ class LLMComponent extends BaseComponent {
|
|
|
886
938
|
resolveRequest(request) {
|
|
887
939
|
const defaultModel = this.getLLMConfig("llm.defaultModel", "gpt-4o");
|
|
888
940
|
const defaultProvider = this.getLLMConfig("llm.defaultProvider", "openai");
|
|
889
|
-
const
|
|
941
|
+
const configuredGlobalTemperature = this.getLLMConfig("llm.temperature");
|
|
890
942
|
const defaultMaxTokens = this.getLLMConfig("llm.maxTokens", 4096);
|
|
891
943
|
const defaultTopP = this.getLLMConfig("llm.topP", 1);
|
|
892
944
|
const rawModel = request.model || defaultModel;
|
|
@@ -915,6 +967,21 @@ class LLMComponent extends BaseComponent {
|
|
|
915
967
|
const capabilities = provider?.capabilities;
|
|
916
968
|
const thinkingInText = capabilities?.thinkingInText;
|
|
917
969
|
const effectiveThinkingInText = thinkingInText !== undefined ? thinkingInText : undefined;
|
|
970
|
+
const temperatureResolution = resolveTemperature({
|
|
971
|
+
requestTemperature: request.temperature,
|
|
972
|
+
globalTemperature: configuredGlobalTemperature,
|
|
973
|
+
providerTemperature: provider?.temperature,
|
|
974
|
+
providerId,
|
|
975
|
+
baseURL: provider?.baseURL
|
|
976
|
+
});
|
|
977
|
+
if (temperatureResolution.clampedBy) {
|
|
978
|
+
logger.debug(`[LLMComponent] temperature 被端点硬约束钳制:${providerId} → ${temperatureResolution.temperature}`, {
|
|
979
|
+
provider: providerId,
|
|
980
|
+
requested: request.temperature ?? configuredGlobalTemperature ?? provider?.temperature,
|
|
981
|
+
forced: temperatureResolution.clampedBy.temperature,
|
|
982
|
+
reason: temperatureResolution.clampedBy.reason
|
|
983
|
+
});
|
|
984
|
+
}
|
|
918
985
|
return {
|
|
919
986
|
providerId,
|
|
920
987
|
model,
|
|
@@ -934,7 +1001,7 @@ class LLMComponent extends BaseComponent {
|
|
|
934
1001
|
} : {}
|
|
935
1002
|
},
|
|
936
1003
|
messages,
|
|
937
|
-
temperature:
|
|
1004
|
+
temperature: temperatureResolution.temperature,
|
|
938
1005
|
maxTokens: request.maxTokens ?? defaultMaxTokens,
|
|
939
1006
|
topP: request.topP ?? defaultTopP,
|
|
940
1007
|
abortSignal: request.abortSignal
|