@ai-setting/roy-agent-core 1.7.55 → 1.7.56
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/config/index.js +7 -7
- package/dist/env/agent/agent-component.d.ts +30 -0
- package/dist/env/agent/index.js +13 -12
- package/dist/env/commands/index.js +7 -7
- package/dist/env/context/index.js +3 -3
- package/dist/env/debug/index.js +7 -7
- package/dist/env/environment.d.ts +7 -0
- package/dist/env/event-source/index.js +16 -16
- package/dist/env/hook/index.js +5 -5
- package/dist/env/index.js +40 -39
- package/dist/env/llm/adapter-ai-sdk.d.ts +6 -0
- package/dist/env/llm/adapter-pi-ai.d.ts +5 -0
- package/dist/env/llm/index.js +10 -10
- package/dist/env/llm/invoke.d.ts +33 -1
- package/dist/env/llm/llm.d.ts +13 -0
- package/dist/env/llm/outbound-defense.d.ts +140 -0
- package/dist/env/log-trace/decorator.d.ts +46 -3
- package/dist/env/log-trace/index.d.ts +1 -0
- package/dist/env/log-trace/index.js +33 -7
- package/dist/env/log-trace/trace-filters.d.ts +127 -0
- package/dist/env/mcp/index.js +7 -7
- package/dist/env/memory/index.js +7 -7
- package/dist/env/plugin/index.js +7 -7
- package/dist/env/prompt/index.js +7 -7
- package/dist/env/session/index.js +11 -10
- package/dist/env/session/session-component.d.ts +4 -0
- package/dist/env/session/storage/index.js +5 -3
- package/dist/env/skill/index.js +7 -7
- package/dist/env/task/delegate/index.js +7 -7
- package/dist/env/task/index.js +12 -12
- package/dist/env/task/plugins/index.js +9 -9
- package/dist/env/task/storage/index.js +2 -2
- package/dist/env/task/tools/index.js +3 -3
- package/dist/env/tool/built-in/index.js +3 -3
- package/dist/env/tool/index.js +9 -9
- package/dist/env/workflow/engine/index.js +12 -12
- package/dist/env/workflow/hooks/index.js +7 -7
- package/dist/env/workflow/index.js +23 -22
- package/dist/env/workflow/nodes/index.js +2 -2
- package/dist/env/workflow/plugins/index.js +8 -8
- package/dist/env/workflow/service/index.js +2 -2
- package/dist/env/workflow/storage/index.js +3 -3
- package/dist/env/workflow/tools/index.js +15 -14
- package/dist/env/workflow/utils/index.js +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +81 -55
- package/dist/shared/@ai-setting/{roy-agent-core-k25gv86p.js → roy-agent-core-0b3fdnn3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-6qxh4xrm.js → roy-agent-core-0bmk44ye.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-k8b440n3.js → roy-agent-core-16t0zfbk.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-4z3rq5gw.js → roy-agent-core-1pnfkspm.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-a4vzsn0g.js → roy-agent-core-202v00x4.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j2nvedt6.js → roy-agent-core-2044fbsd.js} +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-fs36xgcs.js → roy-agent-core-3dkzqqsd.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qm9jda8p.js → roy-agent-core-3kz6934b.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tjg71zqp.js → roy-agent-core-3mc6vmvj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tdbv7ff4.js → roy-agent-core-40xzbjtm.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-athdr2m0.js → roy-agent-core-4zy2v3br.js} +10 -2
- package/dist/shared/@ai-setting/{roy-agent-core-t37wbysj.js → roy-agent-core-5gw6w424.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-978b6wfx.js → roy-agent-core-5psjwd08.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-7evvpfwc.js → roy-agent-core-5rxs0ra3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-12d2xap8.js → roy-agent-core-6qgq7h1g.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-6167phd4.js → roy-agent-core-833t16n1.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-2k4xffaa.js → roy-agent-core-8cgtwytv.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-rx16h2m1.js → roy-agent-core-97eyghsp.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fvs48d38.js → roy-agent-core-98aa9r0x.js} +12 -7
- package/dist/shared/@ai-setting/{roy-agent-core-ytr2w0vb.js → roy-agent-core-9nv586rw.js} +57 -19
- package/dist/shared/@ai-setting/roy-agent-core-b599jgyd.js +578 -0
- package/dist/shared/@ai-setting/{roy-agent-core-zvemdfx5.js → roy-agent-core-bwzy00t2.js} +12 -5
- package/dist/shared/@ai-setting/{roy-agent-core-dwx9hjwx.js → roy-agent-core-c6at31ra.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-1cv9j4dg.js → roy-agent-core-d14h726p.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-cd62e9p1.js → roy-agent-core-d4jpn06f.js} +22 -9
- package/dist/shared/@ai-setting/{roy-agent-core-e2z1etk4.js → roy-agent-core-e0wbq0qq.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-vrsxhw9e.js → roy-agent-core-e677am8e.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-g36jevrk.js → roy-agent-core-ezsyyjxw.js} +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-ne2t1pay.js → roy-agent-core-f8sp1txg.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ak4dc3kg.js → roy-agent-core-gn8f4rhs.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qcspfszy.js → roy-agent-core-gngjkw3b.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9jzysq50.js → roy-agent-core-heft3j4c.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-5apmk4qw.js → roy-agent-core-jszgaevt.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nde5gzta.js → roy-agent-core-m8n0dffe.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-2bscfrr1.js → roy-agent-core-n3b7ztms.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8eqngasy.js → roy-agent-core-nhk0dsxr.js} +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-b5ew8t0k.js → roy-agent-core-nntphgww.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8s9jd2qy.js → roy-agent-core-nra8vfrs.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-2b8jtv7m.js → roy-agent-core-ns3pbyz4.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-7g03zkkb.js → roy-agent-core-pemxr5n4.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-skzjs973.js → roy-agent-core-pjxa78mp.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-w527pcpe.js → roy-agent-core-q7zksbw0.js} +44 -493
- package/dist/shared/@ai-setting/{roy-agent-core-zd3ddm4k.js → roy-agent-core-qjjf4tjb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qamktze3.js → roy-agent-core-qyqnmz8c.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9csa89jx.js → roy-agent-core-r9qe0ghe.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-7qy3nffr.js → roy-agent-core-tc7gw38m.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-aer5kw1j.js → roy-agent-core-v2188rnk.js} +16 -16
- package/dist/shared/@ai-setting/{roy-agent-core-mxdc756a.js → roy-agent-core-vmg30n5x.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-rnwr39b0.js → roy-agent-core-w7hnjhvx.js} +5 -3
- package/dist/shared/@ai-setting/{roy-agent-core-dv714bqh.js → roy-agent-core-wafk25ff.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9h72sk1n.js → roy-agent-core-xcq04fq0.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-2gay3sjt.js → roy-agent-core-yg247mk4.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0hq21px2.js → roy-agent-core-yv9x4wmg.js} +631 -35
- package/dist/shared/@ai-setting/{roy-agent-core-yhsssn86.js → roy-agent-core-zmeka63k.js} +1 -1
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-dsevjbck.js +0 -245
package/dist/config/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ConfigSourceNotFoundError,
|
|
5
5
|
FileSource,
|
|
6
6
|
MemorySource
|
|
7
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
7
|
+
} from "../shared/@ai-setting/roy-agent-core-qyqnmz8c.js";
|
|
8
8
|
import {
|
|
9
9
|
EnvSource,
|
|
10
10
|
parseJSONC,
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
} from "../shared/@ai-setting/roy-agent-core-adg9ghbt.js";
|
|
16
16
|
import"../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
17
17
|
import"../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
18
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
19
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
20
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
21
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
22
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
23
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
import"../shared/@ai-setting/roy-agent-core-40xzbjtm.js";
|
|
19
|
+
import"../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
20
|
+
import"../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
21
|
+
import"../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
22
|
+
import"../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
23
|
+
import"../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
24
24
|
import"../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
25
25
|
import"../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
26
26
|
import"../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
@@ -411,6 +411,13 @@ export declare class AgentComponent extends BaseComponent {
|
|
|
411
411
|
/**
|
|
412
412
|
* 执行 Agent(核心方法,内部实现)
|
|
413
413
|
*/
|
|
414
|
+
/**
|
|
415
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479,CV 发现的漏网之鱼)。
|
|
416
|
+
*
|
|
417
|
+
* 实测:`agent.component.run` 单 span attributes 达 **70 KB**,
|
|
418
|
+
* `query` 多模态时(base64 图片)可达 MB 级 ——
|
|
419
|
+
* 等于把上一级 `env.handle_query` 省下来的体积**又吐回去一层**。
|
|
420
|
+
*/
|
|
414
421
|
private _run;
|
|
415
422
|
/**
|
|
416
423
|
* 中止 Agent
|
|
@@ -493,6 +500,10 @@ export declare class AgentComponent extends BaseComponent {
|
|
|
493
500
|
* 否则降级到当前行为:从 ctx.context.additionInfo 读取(每次 buildMessages 都
|
|
494
501
|
* 重读,可能因 caller 传入不同值而变化 → cache miss)。
|
|
495
502
|
*/
|
|
503
|
+
/**
|
|
504
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479)。改造前平均 158KB
|
|
505
|
+
* —— 入参 `ctx` 挂着完整对话历史,返回值是完整 additionInfo 文本。
|
|
506
|
+
*/
|
|
496
507
|
private _buildAdditionInfo;
|
|
497
508
|
private buildMessages;
|
|
498
509
|
/**
|
|
@@ -515,6 +526,10 @@ export declare class AgentComponent extends BaseComponent {
|
|
|
515
526
|
*
|
|
516
527
|
* 流式事件由 LLMComponent 通过 env.pushEnvEvent() 发布
|
|
517
528
|
*/
|
|
529
|
+
/**
|
|
530
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479)。改造前平均 149KB
|
|
531
|
+
* —— 入参 ctx 带全量消息,返回值是完整模型输出。
|
|
532
|
+
*/
|
|
518
533
|
private invokeLLM;
|
|
519
534
|
/**
|
|
520
535
|
* Task #2723: 归一化上游 tool-call shape → 内部 `Record<string, unknown>`。
|
|
@@ -547,6 +562,11 @@ export declare class AgentComponent extends BaseComponent {
|
|
|
547
562
|
* 刻意不覆盖「工具执行失败」(`success:false` 且有真实 error,如 bash exit!=0):
|
|
548
563
|
* 那是正常运行时结果,全标 ERROR 会让 trace 里遍布红色噪音、反而掩盖真问题。
|
|
549
564
|
*/
|
|
565
|
+
/**
|
|
566
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479)。改造前平均 259KB
|
|
567
|
+
* —— `ctx` 里挂着完整对话历史 + 工具参数 + 工具返回值。
|
|
568
|
+
* 现在只留工具名 / toolCallId / 参数键名列表。
|
|
569
|
+
*/
|
|
550
570
|
private executeTool;
|
|
551
571
|
/**
|
|
552
572
|
* 执行 Plugin Hooks (Agent 特有的 Hook 执行机制)
|
|
@@ -584,6 +604,12 @@ export declare class AgentComponent extends BaseComponent {
|
|
|
584
604
|
* amplification that turned short contentions into full SQLITE_BUSY
|
|
585
605
|
* storms (the root cause of the 2026-07-07 incident).
|
|
586
606
|
*/
|
|
607
|
+
/**
|
|
608
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479,CV 发现的**最大漏网之鱼**)。
|
|
609
|
+
*
|
|
610
|
+
* 实测:`allMessages` 是**每一轮 ReAct 迭代的全部消息**(含工具输出),
|
|
611
|
+
* 单 span attributes 达 **200 KB / 迭代** —— 这是剩余的体积大头。
|
|
612
|
+
*/
|
|
587
613
|
private recordSessionMessages;
|
|
588
614
|
/**
|
|
589
615
|
* 检查消息内容是否为空
|
|
@@ -620,6 +646,10 @@ export declare class AgentComponent extends BaseComponent {
|
|
|
620
646
|
* @param options.filterHistory - 是否过滤 tool 消息(默认 true)
|
|
621
647
|
* @returns 过滤后的会话消息列表
|
|
622
648
|
*/
|
|
649
|
+
/**
|
|
650
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479)。改造前平均 45KB
|
|
651
|
+
* —— 返回值是完整会话历史数组(每条 message 的完整 content)。
|
|
652
|
+
*/
|
|
623
653
|
private getConversationHistory;
|
|
624
654
|
}
|
|
625
655
|
/**
|
package/dist/env/agent/index.js
CHANGED
|
@@ -2,24 +2,25 @@ import {
|
|
|
2
2
|
AgentComponent,
|
|
3
3
|
AgentComponentConfigSchema,
|
|
4
4
|
SummaryAgent
|
|
5
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
6
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
} from "../../shared/@ai-setting/roy-agent-core-9nv586rw.js";
|
|
6
|
+
import"../../shared/@ai-setting/roy-agent-core-98aa9r0x.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-kzg1jwt8.js";
|
|
8
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
import"../../shared/@ai-setting/roy-agent-core-97eyghsp.js";
|
|
9
9
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
10
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
11
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
12
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../shared/@ai-setting/roy-agent-core-wafk25ff.js";
|
|
11
|
+
import"../../shared/@ai-setting/roy-agent-core-ns3pbyz4.js";
|
|
12
|
+
import"../../shared/@ai-setting/roy-agent-core-yv9x4wmg.js";
|
|
13
|
+
import"../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
13
14
|
import"../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
14
15
|
import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
15
16
|
import"../../shared/@ai-setting/roy-agent-core-ctdhjv68.js";
|
|
16
17
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
17
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
20
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
21
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
22
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-40xzbjtm.js";
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
20
|
+
import"../../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
21
|
+
import"../../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
22
|
+
import"../../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
23
|
+
import"../../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
23
24
|
import"../../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
24
25
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
25
26
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CommandsComponent
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-qjjf4tjb.js";
|
|
4
4
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
6
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
7
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
8
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
9
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
10
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
import"../../shared/@ai-setting/roy-agent-core-40xzbjtm.js";
|
|
6
|
+
import"../../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
7
|
+
import"../../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
8
|
+
import"../../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
9
|
+
import"../../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
10
|
+
import"../../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
11
11
|
import"../../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
12
12
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
13
13
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_context
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
4
4
|
import {
|
|
5
5
|
EVENT_ENV_PREFIX,
|
|
6
6
|
createEnvContext,
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
runWithEnvContextAsync,
|
|
25
25
|
serializeEventToEnv,
|
|
26
26
|
setCurrentTaskId
|
|
27
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
28
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
27
|
+
} from "../../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
28
|
+
import"../../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
29
29
|
import"../../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
30
30
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
31
31
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
package/dist/env/debug/index.js
CHANGED
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
RegexParser,
|
|
5
5
|
SpanBuilder,
|
|
6
6
|
SpanDbReader
|
|
7
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
7
|
+
} from "../../shared/@ai-setting/roy-agent-core-0b3fdnn3.js";
|
|
8
8
|
import {
|
|
9
9
|
ReplFormatter,
|
|
10
10
|
TraceFormatter,
|
|
11
11
|
TreeFormatter
|
|
12
12
|
} from "../../shared/@ai-setting/roy-agent-core-rvv6ydff.js";
|
|
13
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
14
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
15
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
16
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
17
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
13
|
+
import"../../shared/@ai-setting/roy-agent-core-40xzbjtm.js";
|
|
14
|
+
import"../../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
15
|
+
import"../../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
16
|
+
import"../../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
17
|
+
import"../../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
19
19
|
import"../../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
@@ -82,6 +82,12 @@ export declare class BaseEnvironment extends BaseComponent implements Environmen
|
|
|
82
82
|
*
|
|
83
83
|
* 委托给 AgentComponent.run() 处理
|
|
84
84
|
*/
|
|
85
|
+
/**
|
|
86
|
+
* ★ 2026-10-22:**入参只存摘要**(Task #4479)。
|
|
87
|
+
*
|
|
88
|
+
* `query` 是 `string | ContentPart[]` —— 多模态时是图片/文件数组,可能很大;
|
|
89
|
+
* 返回值是完整的 agent 响应文本。把两者都换成摘要(长度/条数/类型)。
|
|
90
|
+
*/
|
|
85
91
|
handle_query(query: string | ContentPart[], context?: AgentContext): Promise<string>;
|
|
86
92
|
/**
|
|
87
93
|
* ★ Workflow 类型 agent 查询处理
|
|
@@ -89,6 +95,7 @@ export declare class BaseEnvironment extends BaseComponent implements Environmen
|
|
|
89
95
|
* 检查 agentDef.type 是否为 "workflow",是则通过 WorkflowComponent 执行 workflow。
|
|
90
96
|
* 非 workflow 类型返回 null,让 handle_query 走原有 ReAct 路径。
|
|
91
97
|
*/
|
|
98
|
+
/** ★ 2026-10-22:同 `env.handle_query`,只存摘要(Task #4479)。 */
|
|
92
99
|
private handleWorkflowAgentQuery;
|
|
93
100
|
/**
|
|
94
101
|
* 处理动作
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
larkCliHandler,
|
|
12
12
|
resolveBountyIMSystemPrompt,
|
|
13
13
|
timerHandler
|
|
14
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
14
|
+
} from "../../shared/@ai-setting/roy-agent-core-2044fbsd.js";
|
|
15
15
|
import {
|
|
16
16
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
17
17
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -21,33 +21,33 @@ import {
|
|
|
21
21
|
isValidEventSourceType,
|
|
22
22
|
validateEventSourceConfig
|
|
23
23
|
} from "../../shared/@ai-setting/roy-agent-core-ck60j1q9.js";
|
|
24
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
25
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
24
|
+
import"../../shared/@ai-setting/roy-agent-core-w7hnjhvx.js";
|
|
25
|
+
import"../../shared/@ai-setting/roy-agent-core-ezsyyjxw.js";
|
|
26
26
|
import {
|
|
27
27
|
EventStoreImpl,
|
|
28
28
|
getSharedEventStore,
|
|
29
29
|
resetSharedEventStore,
|
|
30
30
|
setSharedEventStore
|
|
31
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
31
|
+
} from "../../shared/@ai-setting/roy-agent-core-zmeka63k.js";
|
|
32
32
|
import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
33
33
|
import"../../shared/@ai-setting/roy-agent-core-6masakz4.js";
|
|
34
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
35
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
36
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
37
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
38
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
34
|
+
import"../../shared/@ai-setting/roy-agent-core-xcq04fq0.js";
|
|
35
|
+
import"../../shared/@ai-setting/roy-agent-core-nntphgww.js";
|
|
36
|
+
import"../../shared/@ai-setting/roy-agent-core-r9qe0ghe.js";
|
|
37
|
+
import"../../shared/@ai-setting/roy-agent-core-202v00x4.js";
|
|
38
|
+
import"../../shared/@ai-setting/roy-agent-core-nra8vfrs.js";
|
|
39
39
|
import"../../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
|
|
40
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
40
|
+
import"../../shared/@ai-setting/roy-agent-core-wafk25ff.js";
|
|
41
41
|
import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
42
42
|
import"../../shared/@ai-setting/roy-agent-core-64f22h1g.js";
|
|
43
43
|
import"../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
44
44
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
45
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
46
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
47
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
48
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
49
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
50
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
45
|
+
import"../../shared/@ai-setting/roy-agent-core-40xzbjtm.js";
|
|
46
|
+
import"../../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
47
|
+
import"../../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
48
|
+
import"../../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
49
|
+
import"../../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
50
|
+
import"../../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
51
51
|
import"../../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
52
52
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
53
53
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
package/dist/env/hook/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createHook,
|
|
3
3
|
createPriorityHook,
|
|
4
4
|
init_hook
|
|
5
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
} from "../../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
6
6
|
import {
|
|
7
7
|
AgentHookPoints,
|
|
8
8
|
HookManager,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
executeLLMHook,
|
|
14
14
|
executeToolHook,
|
|
15
15
|
globalHookManager
|
|
16
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
17
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
16
|
+
} from "../../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
17
|
+
import"../../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
package/dist/env/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseEnvironment
|
|
3
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../shared/@ai-setting/roy-agent-core-d4jpn06f.js";
|
|
4
4
|
import {
|
|
5
5
|
TaskComponent
|
|
6
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../shared/@ai-setting/roy-agent-core-e0wbq0qq.js";
|
|
7
7
|
import"../shared/@ai-setting/roy-agent-core-amkqnyzy.js";
|
|
8
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
9
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
import"../shared/@ai-setting/roy-agent-core-3kz6934b.js";
|
|
9
|
+
import"../shared/@ai-setting/roy-agent-core-pemxr5n4.js";
|
|
10
10
|
import"../shared/@ai-setting/roy-agent-core-rn57psp0.js";
|
|
11
11
|
import"../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
12
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
12
|
+
import"../shared/@ai-setting/roy-agent-core-vmg30n5x.js";
|
|
13
13
|
import"../shared/@ai-setting/roy-agent-core-tbrn9wdm.js";
|
|
14
14
|
import {
|
|
15
15
|
EventSourceComponent,
|
|
16
16
|
builtInHandlers,
|
|
17
17
|
larkCliHandler
|
|
18
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
} from "../shared/@ai-setting/roy-agent-core-2044fbsd.js";
|
|
19
19
|
import {
|
|
20
20
|
EventSourceInitHooks,
|
|
21
21
|
getDefaultConfigForType,
|
|
@@ -23,78 +23,79 @@ import {
|
|
|
23
23
|
isValidEventSourceType,
|
|
24
24
|
validateEventSourceConfig
|
|
25
25
|
} from "../shared/@ai-setting/roy-agent-core-ck60j1q9.js";
|
|
26
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
27
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
28
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
26
|
+
import"../shared/@ai-setting/roy-agent-core-w7hnjhvx.js";
|
|
27
|
+
import"../shared/@ai-setting/roy-agent-core-ezsyyjxw.js";
|
|
28
|
+
import"../shared/@ai-setting/roy-agent-core-zmeka63k.js";
|
|
29
29
|
import"../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
30
30
|
import"../shared/@ai-setting/roy-agent-core-6masakz4.js";
|
|
31
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
32
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
31
|
+
import"../shared/@ai-setting/roy-agent-core-xcq04fq0.js";
|
|
32
|
+
import"../shared/@ai-setting/roy-agent-core-nntphgww.js";
|
|
33
33
|
import {
|
|
34
34
|
WorkflowComponent
|
|
35
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
36
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
35
|
+
} from "../shared/@ai-setting/roy-agent-core-nhk0dsxr.js";
|
|
36
|
+
import"../shared/@ai-setting/roy-agent-core-e677am8e.js";
|
|
37
37
|
import"../shared/@ai-setting/roy-agent-core-h0x19xgn.js";
|
|
38
38
|
import"../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
39
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
40
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
41
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
39
|
+
import"../shared/@ai-setting/roy-agent-core-0bmk44ye.js";
|
|
40
|
+
import"../shared/@ai-setting/roy-agent-core-bwzy00t2.js";
|
|
41
|
+
import"../shared/@ai-setting/roy-agent-core-tc7gw38m.js";
|
|
42
42
|
import"../shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
43
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
44
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
43
|
+
import"../shared/@ai-setting/roy-agent-core-5rxs0ra3.js";
|
|
44
|
+
import"../shared/@ai-setting/roy-agent-core-v2188rnk.js";
|
|
45
45
|
import"../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
46
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
47
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
46
|
+
import"../shared/@ai-setting/roy-agent-core-833t16n1.js";
|
|
47
|
+
import"../shared/@ai-setting/roy-agent-core-n3b7ztms.js";
|
|
48
48
|
import"../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
49
49
|
import"../shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
50
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
51
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
50
|
+
import"../shared/@ai-setting/roy-agent-core-3dkzqqsd.js";
|
|
51
|
+
import"../shared/@ai-setting/roy-agent-core-r9qe0ghe.js";
|
|
52
52
|
import"../shared/@ai-setting/roy-agent-core-7exqwax1.js";
|
|
53
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
54
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
53
|
+
import"../shared/@ai-setting/roy-agent-core-202v00x4.js";
|
|
54
|
+
import"../shared/@ai-setting/roy-agent-core-3mc6vmvj.js";
|
|
55
55
|
import"../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
56
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
56
|
+
import"../shared/@ai-setting/roy-agent-core-nra8vfrs.js";
|
|
57
57
|
import"../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
|
|
58
58
|
import"../shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
59
59
|
import {
|
|
60
60
|
AgentComponent,
|
|
61
61
|
AgentComponentConfigSchema
|
|
62
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
63
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
62
|
+
} from "../shared/@ai-setting/roy-agent-core-9nv586rw.js";
|
|
63
|
+
import"../shared/@ai-setting/roy-agent-core-98aa9r0x.js";
|
|
64
64
|
import"../shared/@ai-setting/roy-agent-core-kzg1jwt8.js";
|
|
65
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
65
|
+
import"../shared/@ai-setting/roy-agent-core-97eyghsp.js";
|
|
66
66
|
import {
|
|
67
67
|
XDG_PATHS,
|
|
68
68
|
getXDGPath,
|
|
69
69
|
getXDGPaths
|
|
70
70
|
} from "../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
71
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
72
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
73
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
71
|
+
import"../shared/@ai-setting/roy-agent-core-wafk25ff.js";
|
|
72
|
+
import"../shared/@ai-setting/roy-agent-core-ns3pbyz4.js";
|
|
73
|
+
import"../shared/@ai-setting/roy-agent-core-yv9x4wmg.js";
|
|
74
|
+
import"../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
74
75
|
import"../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
75
76
|
import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
76
77
|
import {
|
|
77
78
|
PluginComponent
|
|
78
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
79
|
+
} from "../shared/@ai-setting/roy-agent-core-5gw6w424.js";
|
|
79
80
|
import"../shared/@ai-setting/roy-agent-core-64f22h1g.js";
|
|
80
81
|
import"../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
81
82
|
import {
|
|
82
83
|
McpComponent
|
|
83
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
84
|
+
} from "../shared/@ai-setting/roy-agent-core-c6at31ra.js";
|
|
84
85
|
import"../shared/@ai-setting/roy-agent-core-8t7wny6v.js";
|
|
85
86
|
import"../shared/@ai-setting/roy-agent-core-ctdhjv68.js";
|
|
86
87
|
import"../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
87
88
|
import {
|
|
88
89
|
BaseComponent
|
|
89
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
90
|
+
} from "../shared/@ai-setting/roy-agent-core-40xzbjtm.js";
|
|
90
91
|
import {
|
|
91
92
|
createHook,
|
|
92
93
|
createPriorityHook
|
|
93
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
94
|
+
} from "../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
94
95
|
import {
|
|
95
96
|
HookManager
|
|
96
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
97
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
97
|
+
} from "../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
98
|
+
import"../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
98
99
|
import {
|
|
99
100
|
createEnvContext,
|
|
100
101
|
getEnvContext,
|
|
@@ -103,8 +104,8 @@ import {
|
|
|
103
104
|
mergeEnvContext,
|
|
104
105
|
runWithEnvContext,
|
|
105
106
|
runWithEnvContextAsync
|
|
106
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
107
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
107
|
+
} from "../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
108
|
+
import"../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
108
109
|
import"../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
109
110
|
import"../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
110
111
|
import"../shared/@ai-setting/roy-agent-core-fnv3ev18.js";
|
|
@@ -3,6 +3,12 @@ export declare class AiSdkAdapter implements LLMAdapter {
|
|
|
3
3
|
readonly name: "ai-sdk";
|
|
4
4
|
chat(req: ChatRequest): Promise<ChatResponse>;
|
|
5
5
|
stream(req: ChatRequest): Promise<StreamHandle>;
|
|
6
|
+
/**
|
|
7
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479)。embed 的 `input` 是大字符串数组,
|
|
8
|
+
* 返回值 embedding 向量更大 —— 正常路径由 filter 存「条数/维度」摘要。
|
|
9
|
+
* 这里额外保留 `recordResult: false` 作为兜底:万一 filter 失效,
|
|
10
|
+
* 宁可没有 result 列,也不能把整个向量数组写进 DB。
|
|
11
|
+
*/
|
|
6
12
|
embed(req: EmbedRequest): Promise<EmbedResponse>;
|
|
7
13
|
resolveProvider(provider: string, modelId: string): Promise<ResolvedProvider>;
|
|
8
14
|
private toInvokeConfig;
|
|
@@ -179,6 +179,11 @@ export declare class PiAiAdapter implements LLMAdapter {
|
|
|
179
179
|
readonly name: "pi-ai";
|
|
180
180
|
chat(req: ChatRequest): Promise<ChatResponse>;
|
|
181
181
|
stream(req: ChatRequest): Promise<StreamHandle>;
|
|
182
|
+
/**
|
|
183
|
+
* ★ 2026-10-22:**只存摘要**(Task #4479)。embed 的 `texts` 是大字符串数组,
|
|
184
|
+
* 绝不能入库;返回值向量同理。正常路径由 filter 存摘要,
|
|
185
|
+
* `recordResult: false` 只是 filter 失效时的兜底(见 ai_sdk.embed 的说明)。
|
|
186
|
+
*/
|
|
182
187
|
embed(_req: EmbedRequest): Promise<EmbedResponse>;
|
|
183
188
|
resolveProvider(provider: string, modelId: string): Promise<ResolvedProvider>;
|
|
184
189
|
}
|
package/dist/env/llm/index.js
CHANGED
|
@@ -7,17 +7,16 @@ import {
|
|
|
7
7
|
LLMHooks,
|
|
8
8
|
LLMTransform,
|
|
9
9
|
ModelLimitsSchema,
|
|
10
|
-
PiAiAdapter,
|
|
11
10
|
ProviderCapabilitiesSchema,
|
|
12
11
|
ProviderConfigSchema,
|
|
13
12
|
ProviderManager,
|
|
14
13
|
createLLMAdapter,
|
|
15
14
|
getLLMProviderOverride,
|
|
16
15
|
setLLMProvider
|
|
17
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
16
|
+
} from "../../shared/@ai-setting/roy-agent-core-q7zksbw0.js";
|
|
18
17
|
import"../../shared/@ai-setting/roy-agent-core-adg9ghbt.js";
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
20
18
|
import {
|
|
19
|
+
PiAiAdapter,
|
|
21
20
|
buildOpencodeHeaders,
|
|
22
21
|
convertToSDKMessages,
|
|
23
22
|
createInvokeConfig,
|
|
@@ -28,15 +27,16 @@ import {
|
|
|
28
27
|
isOpencodeEndpoint,
|
|
29
28
|
isOpencodeProvider,
|
|
30
29
|
parseModelString
|
|
31
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
30
|
+
} from "../../shared/@ai-setting/roy-agent-core-yv9x4wmg.js";
|
|
31
|
+
import"../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
32
32
|
import"../../shared/@ai-setting/roy-agent-core-ctdhjv68.js";
|
|
33
33
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
34
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
35
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
36
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
37
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
38
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
39
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
34
|
+
import"../../shared/@ai-setting/roy-agent-core-40xzbjtm.js";
|
|
35
|
+
import"../../shared/@ai-setting/roy-agent-core-gngjkw3b.js";
|
|
36
|
+
import"../../shared/@ai-setting/roy-agent-core-1pnfkspm.js";
|
|
37
|
+
import"../../shared/@ai-setting/roy-agent-core-16t0zfbk.js";
|
|
38
|
+
import"../../shared/@ai-setting/roy-agent-core-jszgaevt.js";
|
|
39
|
+
import"../../shared/@ai-setting/roy-agent-core-b599jgyd.js";
|
|
40
40
|
import"../../shared/@ai-setting/roy-agent-core-8seq65bp.js";
|
|
41
41
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
42
42
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
package/dist/env/llm/invoke.d.ts
CHANGED
|
@@ -88,6 +88,18 @@ export interface InvokeOptions {
|
|
|
88
88
|
name: string;
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Prompt-cache retention preference (Task #4465).
|
|
93
|
+
*
|
|
94
|
+
* path A already honours this through `buildPiCacheOptions()`; path B (this
|
|
95
|
+
* AI SDK fallback) ignored it entirely, so every fallback request paid full
|
|
96
|
+
* input price. Forwarded to the outbound defence middleware, which emits
|
|
97
|
+
* `prompt_cache_key` / `prompt_cache_retention` on OpenAI-family protocols.
|
|
98
|
+
*
|
|
99
|
+
* Omitted → the middleware defaults to `"long"` for OpenAI-family protocols,
|
|
100
|
+
* matching path A's default for `openai-completions`.
|
|
101
|
+
*/
|
|
102
|
+
cacheRetention?: "none" | "short" | "long";
|
|
91
103
|
}
|
|
92
104
|
/**
|
|
93
105
|
* LLM Tool Context - Context for tool calls during LLM invocation
|
|
@@ -282,8 +294,28 @@ export declare function invoke(config: InvokeConfig, options: InvokeOptions, ctx
|
|
|
282
294
|
/**
|
|
283
295
|
* 创建 Provider 实例
|
|
284
296
|
* 根据 providerId 创建对应的 AI SDK Provider
|
|
297
|
+
*
|
|
298
|
+
* Task #4465: every branch that can actually reach the wire installs an
|
|
299
|
+
* outbound defence `fetch` middleware (see outbound-defense.ts). The `google`
|
|
300
|
+
* branch is deliberately excluded: `createGoogleGenerativeAI` exposes no
|
|
301
|
+
* `fetch` option, and Google needs neither the DeepSeek-family
|
|
302
|
+
* `reasoning_content` field nor OpenAI-style prompt-cache keys. Rationale:
|
|
303
|
+
*
|
|
304
|
+
* - path A (`adapter-pi-ai.ts`) has carried the `reasoning_content` defence
|
|
305
|
+
* (#4398/#4403) and the explicit prompt-cache markers (#4383) for a while;
|
|
306
|
+
* path B — this AI SDK fallback — had neither, so a single transient 429 on
|
|
307
|
+
* path A turned into a hard 400 here.
|
|
308
|
+
* - The middleware patches the serialised HTTP body, which is the only place
|
|
309
|
+
* that is protocol-agnostic: `createOpenAI().languageModel()` speaks the
|
|
310
|
+
* **responses** protocol (body key `input`), while the compatible branch
|
|
311
|
+
* speaks **chat/completions** (body key `messages`).
|
|
312
|
+
* - `fetch` is the only option all three provider factories share
|
|
313
|
+
* (`transformRequestBody` exists on `openai-compatible` alone).
|
|
314
|
+
*
|
|
315
|
+
* The middleware is fail-open: anything it cannot parse is forwarded untouched,
|
|
316
|
+
* because path B only runs once we are already in a degraded state.
|
|
285
317
|
*/
|
|
286
|
-
declare function createProviderInstance(providerId: string, apiKey: string, baseURL?: string, conversationId?: string): any;
|
|
318
|
+
declare function createProviderInstance(providerId: string, apiKey: string, baseURL?: string, conversationId?: string, cacheRetention?: "none" | "short" | "long", modelId?: string): any;
|
|
287
319
|
/**
|
|
288
320
|
* Test-only re-export of createProviderInstance so that unit tests can verify
|
|
289
321
|
* header injection behavior without booting the full invoke() stack.
|
package/dist/env/llm/llm.d.ts
CHANGED
|
@@ -188,6 +188,19 @@ export declare class LLMComponent extends BaseComponent {
|
|
|
188
188
|
* the adapter to be recreated on the next invoke().
|
|
189
189
|
*/
|
|
190
190
|
invalidateAdapterCache(): void;
|
|
191
|
+
/**
|
|
192
|
+
* ★ 2026-10-22:**入参/返回值只存摘要**(Task #4479)。
|
|
193
|
+
*
|
|
194
|
+
* 改造前本 span 平均 473KB —— 因为 `request.messages`(全量 system prompt +
|
|
195
|
+
* 对话历史)被原样序列化进 DB attributes,完整模型响应又存了两遍
|
|
196
|
+
* (`attributes.result` + `result` 列)。
|
|
197
|
+
*
|
|
198
|
+
* 现在只存摘要:模型名 / provider / 消息条数 / 总字符数 / 工具数 /
|
|
199
|
+
* finishReason / output 长度 / usage —— 排障时最常问的问题的答案,
|
|
200
|
+
* 体积 < 1KB。
|
|
201
|
+
*
|
|
202
|
+
* 需要临时全量排查时:`ROY_TRACE_FULL=1` 重启即可恢复全量(不改代码)。
|
|
203
|
+
*/
|
|
191
204
|
invoke(request: LLMInvokeRequest): Promise<LLMInvokeResult>;
|
|
192
205
|
/**
|
|
193
206
|
* Task #2719: 消费 adapter.stream() 返回的事件流,把 pi-ai AssistantMessageEvent
|