@ai-setting/roy-agent-core 1.7.62 → 1.7.64
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 +9 -9
- package/dist/env/agent/agent-component.d.ts +33 -0
- package/dist/env/agent/agent-component.js +16 -15
- package/dist/env/agent/index.js +16 -15
- package/dist/env/agent/types.d.ts +17 -0
- package/dist/env/commands/index.js +9 -9
- package/dist/env/context/index.js +5 -5
- package/dist/env/debug/index.js +9 -9
- package/dist/env/error-reply.d.ts +53 -1
- package/dist/env/error-reply.js +10 -3
- package/dist/env/event-source/bounty-im-handler.d.ts +1 -1
- package/dist/env/event-source/cli-command-handler.js +3 -3
- package/dist/env/event-source/event-source-handlers.js +22 -21
- package/dist/env/event-source/event-store.js +4 -4
- package/dist/env/event-source/index.js +23 -22
- package/dist/env/hook/index.js +7 -7
- package/dist/env/index.js +49 -48
- package/dist/env/llm/adapter-pi-ai.d.ts +47 -0
- package/dist/env/llm/index.js +11 -10
- package/dist/env/llm/model-fallback.d.ts +54 -0
- package/dist/env/llm/redact.d.ts +39 -0
- package/dist/env/llm/types.d.ts +13 -0
- package/dist/env/log-trace/index.js +9 -9
- package/dist/env/log-trace/logger.js +2 -2
- package/dist/env/mcp/index.js +10 -10
- package/dist/env/mcp/tool/index.js +3 -3
- package/dist/env/memory/index.js +10 -10
- package/dist/env/memory/plugin/index.js +3 -3
- package/dist/env/plugin/index.js +9 -9
- package/dist/env/prompt/index.js +9 -9
- package/dist/env/session/index.js +13 -12
- package/dist/env/session/storage/index.js +7 -6
- package/dist/env/skill/index.js +9 -9
- package/dist/env/task/delegate/delegate-tool.d.ts +27 -1
- package/dist/env/task/delegate/delegate-tool.js +10 -10
- package/dist/env/task/delegate/index.js +10 -10
- package/dist/env/task/index.js +16 -16
- package/dist/env/task/mcp/index.js +5 -5
- package/dist/env/task/plugins/index.js +12 -12
- package/dist/env/task/plugins/lark-card-patch-notifier.js +4 -4
- package/dist/env/task/storage/index.js +5 -5
- package/dist/env/task/tools/index.js +5 -5
- package/dist/env/tool/built-in/index.js +5 -5
- package/dist/env/tool/index.js +12 -12
- package/dist/env/tool/types.d.ts +13 -0
- package/dist/env/workflow/engine/index.js +14 -14
- package/dist/env/workflow/hooks/index.js +9 -9
- package/dist/env/workflow/index.js +25 -24
- package/dist/env/workflow/nodes/index.js +4 -4
- package/dist/env/workflow/plugins/index.js +10 -10
- package/dist/env/workflow/service/index.js +4 -4
- package/dist/env/workflow/storage/index.js +5 -5
- package/dist/env/workflow/tools/index.js +17 -16
- package/dist/env/workflow/utils/index.js +6 -6
- package/dist/index.js +60 -59
- package/dist/shared/@ai-setting/{roy-agent-core-sj4y3wdm.js → roy-agent-core-002g6nfk.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-06jakebr.js → roy-agent-core-07fvy74y.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fr296a53.js → roy-agent-core-0cb6w0k7.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-cxpgd415.js → roy-agent-core-0ys85x46.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-6wxww10t.js → roy-agent-core-12n08pg5.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-nmn853z0.js → roy-agent-core-1h5bbqcg.js} +11 -11
- package/dist/shared/@ai-setting/{roy-agent-core-h3fwjbhp.js → roy-agent-core-37tj4y6a.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-gjsvehfs.js → roy-agent-core-3wrveh5p.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-9qgrc9dy.js → roy-agent-core-40rv283c.js} +56 -16
- package/dist/shared/@ai-setting/{roy-agent-core-kvq4a4p6.js → roy-agent-core-5pr4zp88.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-qmqe8ds3.js → roy-agent-core-6j02sbee.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-hfyxv2kx.js → roy-agent-core-7cbpmk4q.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6awgfh3x.js → roy-agent-core-7f7t9wwp.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-83bewqx8.js +10 -0
- package/dist/shared/@ai-setting/{roy-agent-core-jnszp0jq.js → roy-agent-core-85xyctnb.js} +7 -2
- package/dist/shared/@ai-setting/{roy-agent-core-2pma868e.js → roy-agent-core-87942bw4.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-ja4sr63d.js → roy-agent-core-8cx7cfdg.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-th92f833.js → roy-agent-core-9bs6xrav.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-48h4zh60.js → roy-agent-core-9bshyqjn.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-9nvyffxg.js → roy-agent-core-add1zqsh.js} +118 -8
- package/dist/shared/@ai-setting/{roy-agent-core-7tce05jt.js → roy-agent-core-ax9e9szb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8xv4qzx7.js → roy-agent-core-br9cdm8d.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zjgckbdd.js → roy-agent-core-c2gbt68e.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-v7mwj8eq.js → roy-agent-core-cpcd24n2.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-hczj1ryh.js → roy-agent-core-dc9zq75z.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-zy8vkbnk.js → roy-agent-core-dvtg4sn0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-cqpd41gf.js → roy-agent-core-e4hehcdr.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-hwkc0bg2.js → roy-agent-core-efkjyh69.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dfqhc9ey.js → roy-agent-core-es203w7p.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-w2ev3z5q.js → roy-agent-core-es467wsz.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-p8rf4z89.js → roy-agent-core-f77k3gqt.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-jw63js86.js → roy-agent-core-fttgm52a.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-32ck9rqt.js → roy-agent-core-g8htfwxj.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-5mrynf9g.js → roy-agent-core-gxzxq1sf.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fqandv0a.js → roy-agent-core-hjejpcg5.js} +29 -19
- package/dist/shared/@ai-setting/{roy-agent-core-2veqhrxa.js → roy-agent-core-hy3zn2q2.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-wzp4tbsn.js → roy-agent-core-jvv2h3d6.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-prnry2mw.js → roy-agent-core-jz8dsypm.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-x1d6edkh.js → roy-agent-core-kmbct9yg.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-gc6wcd7z.js → roy-agent-core-mcy5apay.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-p6a4v4fq.js → roy-agent-core-mds8tqd0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-bpvz1dqr.js → roy-agent-core-mw2cen6s.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-a08dpf71.js → roy-agent-core-na18zwj0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-2hkyp51n.js → roy-agent-core-nm4xbs1d.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-ntn32q7j.js +72 -0
- package/dist/shared/@ai-setting/{roy-agent-core-79gyka2q.js → roy-agent-core-nwbfepba.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-gtdtzbs7.js → roy-agent-core-pgvcf91v.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-084zthqx.js → roy-agent-core-q96qynhb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-386wa4wy.js → roy-agent-core-qq96p0tj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-33hn1beg.js → roy-agent-core-qqaak24r.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-vwzan9v0.js → roy-agent-core-r5wt1h3c.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-vvb4cyyy.js → roy-agent-core-rjzdj0xb.js} +11 -6
- package/dist/shared/@ai-setting/{roy-agent-core-ye4bfzqg.js → roy-agent-core-ry2eztft.js} +11 -11
- package/dist/shared/@ai-setting/{roy-agent-core-c57278kx.js → roy-agent-core-sjr1kmfz.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-anb53t3v.js → roy-agent-core-tm1mxttk.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-p37kh0kt.js → roy-agent-core-v0hf14bj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-c4t4y18j.js → roy-agent-core-v6vr6za7.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-w2h6xt6k.js → roy-agent-core-vd9zak15.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-gz2jnaan.js → roy-agent-core-vncwfzw5.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-c8xvy6hj.js → roy-agent-core-w07ymg29.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-mbwaxqs0.js → roy-agent-core-xcp8vwax.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-5bj0xfjk.js → roy-agent-core-xhrrgfdy.js} +324 -43
- package/dist/shared/@ai-setting/{roy-agent-core-mkpsz128.js → roy-agent-core-xvt7kf7p.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-as0dd70m.js → roy-agent-core-xw4wsj38.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-kmvw6b4v.js → roy-agent-core-yr1mryb8.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-m3w3ytxt.js → roy-agent-core-zk2jg0v7.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-mrrv80jy.js → roy-agent-core-zxz5fkwj.js} +1 -1
- package/dist/utils/temp-file-manager/index.js +3 -3
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-a6cz4d23.js +0 -10
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LarkCardPatchNotifier,
|
|
3
3
|
formatDurationMs
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-zk2jg0v7.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowHookPoints,
|
|
7
7
|
init_workflow_hook_points
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-c2gbt68e.js";
|
|
9
9
|
import {
|
|
10
10
|
init_context
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-qqaak24r.js";
|
|
12
12
|
import {
|
|
13
13
|
getEnvContextOrEmpty
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-7cbpmk4q.js";
|
|
15
15
|
import {
|
|
16
16
|
TracedAs,
|
|
17
17
|
init_decorator
|
|
18
|
-
} from "./roy-agent-core-
|
|
18
|
+
} from "./roy-agent-core-qq96p0tj.js";
|
|
19
19
|
import {
|
|
20
20
|
createLogger,
|
|
21
21
|
init_logger
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
23
23
|
import {
|
|
24
24
|
__legacyDecorateClassTS
|
|
25
25
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
TracedAs,
|
|
6
6
|
init_decorator
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-qq96p0tj.js";
|
|
8
8
|
import {
|
|
9
9
|
createLogger,
|
|
10
10
|
init_logger
|
|
11
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
12
12
|
import {
|
|
13
13
|
__legacyDecorateClassTS
|
|
14
14
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -3,52 +3,52 @@ import {
|
|
|
3
3
|
} from "./roy-agent-core-bxkjk7zx.js";
|
|
4
4
|
import {
|
|
5
5
|
notifyReactFailure
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-add1zqsh.js";
|
|
7
7
|
import {
|
|
8
8
|
cliCommandHandler
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-v0hf14bj.js";
|
|
10
10
|
import {
|
|
11
11
|
TaskTagPlugin,
|
|
12
12
|
createLarkCliTaskNotifyHook,
|
|
13
13
|
createPerTaskGroupChatPlugin,
|
|
14
14
|
extractPerTaskChatId,
|
|
15
15
|
extractPerTaskChatName
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-ry2eztft.js";
|
|
17
17
|
import {
|
|
18
18
|
getSharedEventStore
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-na18zwj0.js";
|
|
20
20
|
import {
|
|
21
21
|
createLarkCliWorkflowNotifyHook
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-0ys85x46.js";
|
|
23
23
|
import {
|
|
24
24
|
LarkCardPatchNotifier,
|
|
25
25
|
buildTaskCard
|
|
26
|
-
} from "./roy-agent-core-
|
|
26
|
+
} from "./roy-agent-core-zk2jg0v7.js";
|
|
27
27
|
import {
|
|
28
28
|
normalizeLarkAtMentions
|
|
29
29
|
} from "./roy-agent-core-m880qz3y.js";
|
|
30
30
|
import {
|
|
31
31
|
globalHookManager,
|
|
32
32
|
init_global_hook_manager
|
|
33
|
-
} from "./roy-agent-core-
|
|
33
|
+
} from "./roy-agent-core-cpcd24n2.js";
|
|
34
34
|
import {
|
|
35
35
|
init_context
|
|
36
|
-
} from "./roy-agent-core-
|
|
36
|
+
} from "./roy-agent-core-qqaak24r.js";
|
|
37
37
|
import {
|
|
38
38
|
createEnvContext,
|
|
39
39
|
normalizeParentTaskId,
|
|
40
40
|
runWithEnvContext
|
|
41
|
-
} from "./roy-agent-core-
|
|
41
|
+
} from "./roy-agent-core-7cbpmk4q.js";
|
|
42
42
|
import {
|
|
43
43
|
TracedAs,
|
|
44
44
|
init_decorator,
|
|
45
45
|
wrapFunction
|
|
46
|
-
} from "./roy-agent-core-
|
|
46
|
+
} from "./roy-agent-core-qq96p0tj.js";
|
|
47
47
|
import {
|
|
48
48
|
createLogger,
|
|
49
49
|
getTracerProvider,
|
|
50
50
|
init_logger
|
|
51
|
-
} from "./roy-agent-core-
|
|
51
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
52
52
|
import {
|
|
53
53
|
__legacyDecorateClassTS,
|
|
54
54
|
__require
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exports_node_registry_helper,
|
|
3
3
|
init_node_registry_helper
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-es203w7p.js";
|
|
5
5
|
import {
|
|
6
6
|
askUserTool,
|
|
7
7
|
createRunWorkflowTool,
|
|
@@ -13,22 +13,22 @@ import {
|
|
|
13
13
|
createWorkflowSearchTool,
|
|
14
14
|
createWorkflowTagListTool,
|
|
15
15
|
createWorkflowValidateTool
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-0cb6w0k7.js";
|
|
17
17
|
import {
|
|
18
18
|
WorkflowService
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-12n08pg5.js";
|
|
20
20
|
import {
|
|
21
21
|
WorkflowEngine,
|
|
22
22
|
exports_engine,
|
|
23
23
|
init_engine
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-mw2cen6s.js";
|
|
25
25
|
import {
|
|
26
26
|
BaseComponent
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-pgvcf91v.js";
|
|
28
28
|
import {
|
|
29
29
|
createLogger,
|
|
30
30
|
init_logger
|
|
31
|
-
} from "./roy-agent-core-
|
|
31
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
32
32
|
import {
|
|
33
33
|
__require,
|
|
34
34
|
__toCommonJS
|
|
@@ -104,7 +104,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
104
104
|
return;
|
|
105
105
|
try {
|
|
106
106
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
107
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
107
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-xcp8vwax.js");
|
|
108
108
|
this.nodeRegistry = new NodeRegistry;
|
|
109
109
|
registerDecoratorNodeType2(this.nodeRegistry);
|
|
110
110
|
this.decoratorsRegistered = true;
|
|
@@ -134,14 +134,14 @@ class WorkflowComponent extends BaseComponent {
|
|
|
134
134
|
}
|
|
135
135
|
async runWorkflow(definition, input, options) {
|
|
136
136
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
137
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
137
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-xcp8vwax.js");
|
|
138
138
|
const toolComponent = this.toolComponent || this._workflowEnv?.getComponent("tool");
|
|
139
139
|
const skillComponent = this._workflowEnv?.getComponent("skill");
|
|
140
140
|
let agentRunner = this.agentRunner;
|
|
141
141
|
if (!agentRunner && this._workflowEnv) {
|
|
142
142
|
const agentComponent = this._workflowEnv.getComponent("agent");
|
|
143
143
|
if (agentComponent) {
|
|
144
|
-
const { AgentComponentAdapter } = await import("./roy-agent-core-
|
|
144
|
+
const { AgentComponentAdapter } = await import("./roy-agent-core-8cx7cfdg.js");
|
|
145
145
|
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -163,7 +163,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
163
163
|
if (this.workflowService) {
|
|
164
164
|
this.workflowService = null;
|
|
165
165
|
try {
|
|
166
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
166
|
+
const { closeDatabase } = await import("./roy-agent-core-dc9zq75z.js");
|
|
167
167
|
closeDatabase();
|
|
168
168
|
componentLogger.info("[WorkflowComponent] SQLite database closed");
|
|
169
169
|
} catch (error) {
|
|
@@ -241,9 +241,9 @@ class WorkflowComponent extends BaseComponent {
|
|
|
241
241
|
}
|
|
242
242
|
async initSqliteService() {
|
|
243
243
|
try {
|
|
244
|
-
const { getDatabase, initializeTables } = await import("./roy-agent-core-
|
|
245
|
-
const { WorkflowRepository } = await import("./roy-agent-core-
|
|
246
|
-
const { TagRepository } = await import("./roy-agent-core-
|
|
244
|
+
const { getDatabase, initializeTables } = await import("./roy-agent-core-dc9zq75z.js");
|
|
245
|
+
const { WorkflowRepository } = await import("./roy-agent-core-xvt7kf7p.js");
|
|
246
|
+
const { TagRepository } = await import("./roy-agent-core-83bewqx8.js");
|
|
247
247
|
const db = getDatabase();
|
|
248
248
|
initializeTables();
|
|
249
249
|
const workflowRepository = new WorkflowRepository(db);
|
|
@@ -309,7 +309,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
309
309
|
this.workflowService = null;
|
|
310
310
|
this.nodeRegistry = null;
|
|
311
311
|
try {
|
|
312
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
312
|
+
const { closeDatabase } = await import("./roy-agent-core-dc9zq75z.js");
|
|
313
313
|
closeDatabase();
|
|
314
314
|
} catch {}
|
|
315
315
|
this._status = "stopped";
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
init_tracer_provider,
|
|
5
5
|
resetTracerProvider,
|
|
6
6
|
setTracerProvider
|
|
7
|
-
} from "./roy-agent-core-
|
|
8
|
-
import"./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
8
|
+
import"./roy-agent-core-85xyctnb.js";
|
|
9
9
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
10
10
|
init_tracer_provider();
|
|
11
11
|
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sniffImageMime
|
|
3
3
|
} from "./roy-agent-core-zjdzk1gg.js";
|
|
4
|
+
import {
|
|
5
|
+
redactErrorForTransport,
|
|
6
|
+
redactSecrets
|
|
7
|
+
} from "./roy-agent-core-ntn32q7j.js";
|
|
4
8
|
import {
|
|
5
9
|
TracedAs,
|
|
6
10
|
embedParamFilter,
|
|
7
11
|
embedResultFilter,
|
|
8
12
|
init_decorator,
|
|
9
13
|
init_trace_filters
|
|
10
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-qq96p0tj.js";
|
|
11
15
|
import {
|
|
12
16
|
createLogger,
|
|
13
17
|
init_logger
|
|
14
|
-
} from "./roy-agent-core-
|
|
18
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
15
19
|
import {
|
|
16
20
|
__legacyDecorateClassTS,
|
|
17
21
|
__require
|
|
@@ -523,6 +527,35 @@ function resolvePiModel(provider, modelId, baseURL, capabilities) {
|
|
|
523
527
|
maxTokens: KNOWN_PROVIDER_APIS[provider]?.maxTokensLimit || 8192
|
|
524
528
|
};
|
|
525
529
|
}
|
|
530
|
+
var PI_MAX_RETRIES = 0;
|
|
531
|
+
function createResponseCapture() {
|
|
532
|
+
let last;
|
|
533
|
+
return {
|
|
534
|
+
onResponse: (response) => {
|
|
535
|
+
last = {
|
|
536
|
+
status: response?.status ?? 0,
|
|
537
|
+
headers: { ...response?.headers ?? {} }
|
|
538
|
+
};
|
|
539
|
+
},
|
|
540
|
+
captured: () => last
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
function buildProviderError(message, captured, knownSecrets = []) {
|
|
544
|
+
const err = new Error(redactSecrets(message, knownSecrets));
|
|
545
|
+
if (!captured)
|
|
546
|
+
return err;
|
|
547
|
+
const enriched = err;
|
|
548
|
+
if (captured.status)
|
|
549
|
+
enriched.statusCode = captured.status;
|
|
550
|
+
if (Object.keys(captured.headers).length > 0) {
|
|
551
|
+
enriched.responseHeaders = captured.headers;
|
|
552
|
+
}
|
|
553
|
+
enriched.cause = {
|
|
554
|
+
statusCode: captured.status,
|
|
555
|
+
responseHeaders: captured.headers
|
|
556
|
+
};
|
|
557
|
+
return enriched;
|
|
558
|
+
}
|
|
526
559
|
function toPiMessages(messages) {
|
|
527
560
|
const out = [];
|
|
528
561
|
const ts = Date.now();
|
|
@@ -647,12 +680,14 @@ class PiAiAdapter {
|
|
|
647
680
|
messages: toPiMessages(req.messages),
|
|
648
681
|
tools: toPiTools(req.tools)
|
|
649
682
|
};
|
|
683
|
+
const responseCapture = createResponseCapture();
|
|
650
684
|
const msg = await complete(model, ctx, {
|
|
651
685
|
apiKey: req.apiKey,
|
|
652
686
|
baseURL: req.baseURL,
|
|
653
687
|
temperature: req.temperature,
|
|
654
688
|
maxTokens: req.maxTokens,
|
|
655
689
|
signal: req.signal,
|
|
690
|
+
onResponse: responseCapture.onResponse,
|
|
656
691
|
...buildPiCacheOptions({
|
|
657
692
|
apiProtocol: model.api,
|
|
658
693
|
sessionId: req.sessionId,
|
|
@@ -662,8 +697,12 @@ class PiAiAdapter {
|
|
|
662
697
|
provider: req.provider,
|
|
663
698
|
modelId: req.modelId
|
|
664
699
|
}),
|
|
700
|
+
maxRetries: PI_MAX_RETRIES,
|
|
665
701
|
...piRequestExtras(req)
|
|
666
702
|
});
|
|
703
|
+
if (msg.stopReason === "error") {
|
|
704
|
+
throw buildProviderError(msg.errorMessage || "Provider returned an error stop reason", responseCapture.captured(), [req.apiKey]);
|
|
705
|
+
}
|
|
667
706
|
return fromAssistantMessage(msg);
|
|
668
707
|
}
|
|
669
708
|
async stream(req) {
|
|
@@ -675,12 +714,14 @@ class PiAiAdapter {
|
|
|
675
714
|
messages: toPiMessages(req.messages),
|
|
676
715
|
tools: toPiTools(req.tools)
|
|
677
716
|
};
|
|
717
|
+
const responseCapture = createResponseCapture();
|
|
678
718
|
const eventStream = piStream(model, ctx, {
|
|
679
719
|
apiKey: req.apiKey,
|
|
680
720
|
baseURL: req.baseURL,
|
|
681
721
|
temperature: req.temperature,
|
|
682
722
|
maxTokens: req.maxTokens,
|
|
683
723
|
signal: req.signal,
|
|
724
|
+
onResponse: responseCapture.onResponse,
|
|
684
725
|
...buildPiCacheOptions({
|
|
685
726
|
apiProtocol: model.api,
|
|
686
727
|
sessionId: req.sessionId,
|
|
@@ -690,9 +731,19 @@ class PiAiAdapter {
|
|
|
690
731
|
provider: req.provider,
|
|
691
732
|
modelId: req.modelId
|
|
692
733
|
}),
|
|
734
|
+
maxRetries: PI_MAX_RETRIES,
|
|
693
735
|
...piRequestExtras(req)
|
|
694
736
|
});
|
|
695
|
-
return {
|
|
737
|
+
return {
|
|
738
|
+
events: eventStream,
|
|
739
|
+
result: async () => {
|
|
740
|
+
const msg = await eventStream.result();
|
|
741
|
+
if (msg.stopReason === "error") {
|
|
742
|
+
throw buildProviderError(msg.errorMessage || "Provider returned an error stop reason", responseCapture.captured(), [req.apiKey]);
|
|
743
|
+
}
|
|
744
|
+
return fromAssistantMessage(msg);
|
|
745
|
+
}
|
|
746
|
+
};
|
|
696
747
|
}
|
|
697
748
|
async embed(_req) {
|
|
698
749
|
throw new EmbeddingNotSupportedError(this.name);
|
|
@@ -1577,22 +1628,11 @@ async function invoke(config, options, ctx) {
|
|
|
1577
1628
|
return {
|
|
1578
1629
|
toolCallId: "error-" + Date.now(),
|
|
1579
1630
|
result: safeMessage,
|
|
1580
|
-
isError: true
|
|
1631
|
+
isError: true,
|
|
1632
|
+
...error instanceof Error ? { originalError: redactErrorForTransport(error, [config.apiKey]) } : {}
|
|
1581
1633
|
};
|
|
1582
1634
|
}
|
|
1583
1635
|
}
|
|
1584
|
-
function redactSecrets(text, knownSecrets = []) {
|
|
1585
|
-
let out = text;
|
|
1586
|
-
for (const secret of knownSecrets) {
|
|
1587
|
-
if (secret && secret.length >= 8) {
|
|
1588
|
-
out = out.split(secret).join("<redacted>");
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
out = out.replace(/\boc_sk_[A-Za-z0-9_-]{8,}\b/g, "<redacted>");
|
|
1592
|
-
out = out.replace(/\bsk-(?:proj-)?[A-Za-z0-9_-]{16,}\b/g, "<redacted>");
|
|
1593
|
-
out = out.replace(/\bBearer\s+[A-Za-z0-9._\-+/=]{12,}\b/g, "<redacted>");
|
|
1594
|
-
return out;
|
|
1595
|
-
}
|
|
1596
1636
|
function resolveDefenseProtocol(providerId, baseURL) {
|
|
1597
1637
|
if (providerId === "openai")
|
|
1598
1638
|
return "openai-responses";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseComponent
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-pgvcf91v.js";
|
|
10
10
|
import {
|
|
11
11
|
createLogger,
|
|
12
12
|
init_logger
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
14
14
|
|
|
15
15
|
// src/env/skill/skill-component.ts
|
|
16
16
|
init_logger();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
adaptMcpTool
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-q96qynhb.js";
|
|
4
4
|
import {
|
|
5
5
|
ComponentError,
|
|
6
6
|
ErrorCodes
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseComponent
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-pgvcf91v.js";
|
|
14
14
|
import {
|
|
15
15
|
createLogger,
|
|
16
16
|
init_logger
|
|
17
|
-
} from "./roy-agent-core-
|
|
17
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
18
18
|
import {
|
|
19
19
|
ensureFallbackNpmPrefix,
|
|
20
20
|
isUsableNpmPrefix
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_decorator,
|
|
3
3
|
wrapFunction
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-qq96p0tj.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
init_logger
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm
|
|
11
11
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -40,9 +40,14 @@ function getDatabaseClass() {
|
|
|
40
40
|
if (typeof Bun !== "undefined") {
|
|
41
41
|
const { Database } = __require("bun:sqlite");
|
|
42
42
|
return Database;
|
|
43
|
-
} else {
|
|
44
|
-
return __require("better-sqlite3");
|
|
45
43
|
}
|
|
44
|
+
try {
|
|
45
|
+
const { DatabaseSync } = __require("node:sqlite");
|
|
46
|
+
if (typeof DatabaseSync === "function") {
|
|
47
|
+
return DatabaseSync;
|
|
48
|
+
}
|
|
49
|
+
} catch {}
|
|
50
|
+
return __require("better-sqlite3");
|
|
46
51
|
}
|
|
47
52
|
function createCompatibleDatabase(path) {
|
|
48
53
|
const Database = getDatabaseClass();
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./roy-agent-core-rvv6ydff.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseComponent
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-pgvcf91v.js";
|
|
8
8
|
import {
|
|
9
9
|
__require
|
|
10
10
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -141,7 +141,7 @@ class SpanDbReader {
|
|
|
141
141
|
}
|
|
142
142
|
async initSqliteStorage() {
|
|
143
143
|
try {
|
|
144
|
-
const { SQLiteSpanStorage } = await import("./roy-agent-core-
|
|
144
|
+
const { SQLiteSpanStorage } = await import("./roy-agent-core-br9cdm8d.js");
|
|
145
145
|
this.storage = new SQLiteSpanStorage(this.dbPath);
|
|
146
146
|
await this.storage.initialize();
|
|
147
147
|
} catch (error) {
|
|
@@ -590,7 +590,7 @@ class DebugComponent extends BaseComponent {
|
|
|
590
590
|
}
|
|
591
591
|
async getLiveTrace(traceId) {
|
|
592
592
|
try {
|
|
593
|
-
const { getTracerProvider } = await import("./roy-agent-core-
|
|
593
|
+
const { getTracerProvider } = await import("./roy-agent-core-3wrveh5p.js");
|
|
594
594
|
const provider = getTracerProvider();
|
|
595
595
|
if (!provider.isInitialized()) {
|
|
596
596
|
await provider.initialize();
|
|
@@ -635,7 +635,7 @@ class DebugComponent extends BaseComponent {
|
|
|
635
635
|
}
|
|
636
636
|
async listLiveTraces(limit = 20) {
|
|
637
637
|
try {
|
|
638
|
-
const { getTracerProvider } = await import("./roy-agent-core-
|
|
638
|
+
const { getTracerProvider } = await import("./roy-agent-core-3wrveh5p.js");
|
|
639
639
|
const provider = getTracerProvider();
|
|
640
640
|
if (!provider.isInitialized()) {
|
|
641
641
|
await provider.initialize();
|
|
@@ -653,7 +653,7 @@ class DebugComponent extends BaseComponent {
|
|
|
653
653
|
}
|
|
654
654
|
async formatLiveTrace(traceId) {
|
|
655
655
|
try {
|
|
656
|
-
const { getTracerProvider } = await import("./roy-agent-core-
|
|
656
|
+
const { getTracerProvider } = await import("./roy-agent-core-3wrveh5p.js");
|
|
657
657
|
const provider = getTracerProvider();
|
|
658
658
|
if (!provider.isInitialized()) {
|
|
659
659
|
await provider.initialize();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentComponentAdapter,
|
|
3
3
|
init_agent_component_adapter
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-002g6nfk.js";
|
|
5
5
|
import"./roy-agent-core-1db4vpc6.js";
|
|
6
6
|
import"./roy-agent-core-ze068vc9.js";
|
|
7
7
|
import"./roy-agent-core-e25xkv53.js";
|
|
8
|
-
import"./roy-agent-core-
|
|
9
|
-
import"./roy-agent-core-
|
|
10
|
-
import"./roy-agent-core-
|
|
11
|
-
import"./roy-agent-core-
|
|
12
|
-
import"./roy-agent-core-
|
|
13
|
-
import"./roy-agent-core-
|
|
8
|
+
import"./roy-agent-core-cpcd24n2.js";
|
|
9
|
+
import"./roy-agent-core-qqaak24r.js";
|
|
10
|
+
import"./roy-agent-core-7cbpmk4q.js";
|
|
11
|
+
import"./roy-agent-core-qq96p0tj.js";
|
|
12
|
+
import"./roy-agent-core-7f7t9wwp.js";
|
|
13
|
+
import"./roy-agent-core-85xyctnb.js";
|
|
14
14
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
15
15
|
init_agent_component_adapter();
|
|
16
16
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TracedAs,
|
|
3
3
|
init_decorator
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-qq96p0tj.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
init_logger
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm,
|
|
11
11
|
__export,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MemorySessionStore,
|
|
3
3
|
SQLiteSessionStore
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-hy3zn2q2.js";
|
|
5
5
|
import {
|
|
6
6
|
init_loose_json,
|
|
7
7
|
tryParseJsonFromText
|
|
@@ -16,17 +16,17 @@ import {
|
|
|
16
16
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
17
17
|
import {
|
|
18
18
|
BaseComponent
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-pgvcf91v.js";
|
|
20
20
|
import {
|
|
21
21
|
TracedAs,
|
|
22
22
|
init_decorator,
|
|
23
23
|
init_trace_filters,
|
|
24
24
|
messagesParamFilter
|
|
25
|
-
} from "./roy-agent-core-
|
|
25
|
+
} from "./roy-agent-core-qq96p0tj.js";
|
|
26
26
|
import {
|
|
27
27
|
createLogger,
|
|
28
28
|
init_logger
|
|
29
|
-
} from "./roy-agent-core-
|
|
29
|
+
} from "./roy-agent-core-7f7t9wwp.js";
|
|
30
30
|
import {
|
|
31
31
|
__legacyDecorateClassTS
|
|
32
32
|
} from "./roy-agent-core-fs0mn2jk.js";
|