@ai-setting/roy-agent-core 1.4.12 → 1.4.14
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/packages/core/src/config/index.js +32 -0
- package/dist/packages/core/src/env/agent/index.js +24 -0
- package/dist/packages/core/src/env/commands/index.js +14 -0
- package/dist/packages/core/src/env/debug/formatters/index.js +11 -0
- package/dist/packages/core/src/env/debug/index.js +26 -0
- package/dist/packages/core/src/env/hook/index.js +29 -0
- package/dist/packages/core/src/env/index.js +81 -0
- package/dist/packages/core/src/env/llm/index.js +40 -0
- package/dist/packages/core/src/env/log-trace/index.js +83 -0
- package/dist/packages/core/src/env/mcp/index.js +39 -0
- package/dist/packages/core/src/env/mcp/tool/index.js +14 -0
- package/dist/packages/core/src/env/memory/built-in/index.js +11 -0
- package/dist/packages/core/src/env/memory/index.js +56 -0
- package/dist/packages/core/src/env/memory/plugin/index.js +36 -0
- package/dist/packages/core/src/env/prompt/index.js +20 -0
- package/dist/packages/core/src/env/session/index.js +25 -0
- package/dist/packages/core/src/env/session/storage/index.js +18 -0
- package/dist/packages/core/src/env/skill/index.js +34 -0
- package/dist/packages/core/src/env/skill/tool/index.js +9 -0
- package/dist/packages/core/src/env/task/delegate/index.js +18 -0
- package/dist/packages/core/src/env/task/hooks/index.js +7 -0
- package/dist/packages/core/src/env/task/index.js +30 -0
- package/dist/packages/core/src/env/task/plugins/index.js +23 -0
- package/dist/packages/core/src/env/task/storage/index.js +14 -0
- package/dist/packages/core/src/env/task/tools/index.js +17 -0
- package/dist/packages/core/src/env/task/tools/operation/index.js +15 -0
- package/dist/packages/core/src/env/tool/built-in/index.js +25 -0
- package/dist/packages/core/src/env/tool/index.js +39 -0
- package/dist/packages/core/src/env/workflow/decorators/index.js +27 -0
- package/dist/packages/core/src/env/workflow/engine/index.js +28 -0
- package/dist/packages/core/src/env/workflow/index.js +132 -0
- package/dist/packages/core/src/env/workflow/nodes/index.js +19 -0
- package/dist/packages/core/src/env/workflow/service/index.js +13 -0
- package/dist/packages/core/src/env/workflow/storage/index.js +27 -0
- package/dist/packages/core/src/env/workflow/tools/index.js +159 -0
- package/dist/packages/core/src/env/workflow/types/index.js +94 -0
- package/dist/packages/core/src/env/workflow/utils/index.js +637 -0
- package/dist/packages/core/src/index.js +398 -0
- package/dist/shared/@ai-setting/roy-agent-core-04fm8177.js +393 -0
- package/dist/shared/@ai-setting/roy-agent-core-04qgbjbe.js +172 -0
- package/dist/shared/@ai-setting/roy-agent-core-084qqd7t.js +11 -0
- package/dist/shared/@ai-setting/roy-agent-core-0gekht4e.js +1130 -0
- package/dist/shared/@ai-setting/roy-agent-core-0hdry23r.js +419 -0
- package/dist/shared/@ai-setting/roy-agent-core-0sgn3de4.js +102 -0
- package/dist/{env/task/tools/index.js → shared/@ai-setting/roy-agent-core-12x57kf1.js} +1 -59
- package/dist/shared/@ai-setting/roy-agent-core-1f3xrrm6.js +393 -0
- package/dist/shared/@ai-setting/roy-agent-core-1k28kg7h.js +368 -0
- package/dist/shared/@ai-setting/roy-agent-core-1z1zv5g8.js +258 -0
- package/dist/shared/@ai-setting/roy-agent-core-2hqxnaf3.js +851 -0
- package/dist/shared/@ai-setting/roy-agent-core-3dfq8awb.js +587 -0
- package/dist/shared/@ai-setting/roy-agent-core-3takar0s.js +93 -0
- package/dist/shared/@ai-setting/roy-agent-core-3tnb2005.js +117 -0
- package/dist/shared/@ai-setting/roy-agent-core-4vmcvkav.js +14 -0
- package/dist/shared/@ai-setting/roy-agent-core-4ws8atva.js +107 -0
- package/dist/{env/workflow/nodes/index.js → shared/@ai-setting/roy-agent-core-5fbp24se.js} +8 -55
- package/dist/shared/@ai-setting/roy-agent-core-5my94ywp.js +66 -0
- package/dist/shared/@ai-setting/roy-agent-core-6j0zcmwk.js +2146 -0
- package/dist/shared/@ai-setting/roy-agent-core-6w4pmxc7.js +266 -0
- package/dist/shared/@ai-setting/roy-agent-core-7vrk3add.js +10 -0
- package/dist/shared/@ai-setting/roy-agent-core-8dvbn7tw.js +64 -0
- package/dist/{env/memory/built-in/index.js → shared/@ai-setting/roy-agent-core-8mbmrwzs.js} +22 -76
- package/dist/shared/@ai-setting/roy-agent-core-8wzz66qe.js +620 -0
- package/dist/shared/@ai-setting/roy-agent-core-9ykq91jc.js +762 -0
- package/dist/shared/@ai-setting/roy-agent-core-dde19zke.js +1305 -0
- package/dist/shared/@ai-setting/roy-agent-core-f7g67gce.js +913 -0
- package/dist/{env/workflow/types/index.js → shared/@ai-setting/roy-agent-core-fq5mtxsy.js} +16 -154
- package/dist/{env/task/hooks/index.js → shared/@ai-setting/roy-agent-core-fs0mn2jk.js} +3 -18
- package/dist/{config/index.js → shared/@ai-setting/roy-agent-core-fvd9g6k8.js} +140 -605
- package/dist/shared/@ai-setting/roy-agent-core-gv1hrn3x.js +378 -0
- package/dist/{env/task/tools/operation/index.js → shared/@ai-setting/roy-agent-core-gy0wp5h7.js} +1 -58
- package/dist/shared/@ai-setting/roy-agent-core-hyza1gm7.js +15 -0
- package/dist/shared/@ai-setting/roy-agent-core-j8zx62zr.js +154 -0
- package/dist/shared/@ai-setting/roy-agent-core-jb2exr0d.js +442 -0
- package/dist/shared/@ai-setting/roy-agent-core-jv3b7v9w.js +57 -0
- package/dist/shared/@ai-setting/roy-agent-core-k1rxf9ya.js +513 -0
- package/dist/shared/@ai-setting/roy-agent-core-kydc9nwb.js +60 -0
- package/dist/shared/@ai-setting/roy-agent-core-m2x48hw6.js +97 -0
- package/dist/shared/@ai-setting/roy-agent-core-m6y668cc.js +377 -0
- package/dist/shared/@ai-setting/roy-agent-core-nczzf0ms.js +15 -0
- package/dist/shared/@ai-setting/roy-agent-core-nfj6knp5.js +36 -0
- package/dist/shared/@ai-setting/roy-agent-core-ntrp979d.js +204 -0
- package/dist/shared/@ai-setting/roy-agent-core-pd7g8z5v.js +1387 -0
- package/dist/shared/@ai-setting/roy-agent-core-pzk1syce.js +14 -0
- package/dist/shared/@ai-setting/roy-agent-core-q50tg9m2.js +862 -0
- package/dist/shared/@ai-setting/roy-agent-core-qg9tcaph.js +11 -0
- package/dist/shared/@ai-setting/roy-agent-core-qhyerewk.js +20 -0
- package/dist/shared/@ai-setting/roy-agent-core-qxybm159.js +82 -0
- package/dist/shared/@ai-setting/roy-agent-core-rh9dpkpw.js +549 -0
- package/dist/shared/@ai-setting/roy-agent-core-rr9p1g43.js +205 -0
- package/dist/{env/workflow/decorators/index.js → shared/@ai-setting/roy-agent-core-sbzvpfn7.js} +8 -173
- package/dist/shared/@ai-setting/roy-agent-core-t22nqt4d.js +788 -0
- package/dist/shared/@ai-setting/roy-agent-core-tkr5ynkh.js +200 -0
- package/dist/shared/@ai-setting/roy-agent-core-v4aabsf0.js +303 -0
- package/dist/{env/hook/index.js → shared/@ai-setting/roy-agent-core-w75rafhy.js} +3 -74
- package/dist/{env/debug/formatters/index.js → shared/@ai-setting/roy-agent-core-w76hqkmg.js} +11 -66
- package/dist/shared/@ai-setting/roy-agent-core-yfbgwes2.js +408 -0
- package/dist/shared/@ai-setting/roy-agent-core-yn761yve.js +299 -0
- package/dist/shared/@ai-setting/roy-agent-core-yrzmn4m1.js +492 -0
- package/dist/{env/workflow/service/index.js → shared/@ai-setting/roy-agent-core-yt8wdh2w.js} +1 -57
- package/package.json +3 -2
- package/dist/env/agent/index.js +0 -3035
- package/dist/env/commands/index.js +0 -1685
- package/dist/env/debug/index.js +0 -2300
- package/dist/env/index.js +0 -12591
- package/dist/env/llm/index.js +0 -2736
- package/dist/env/log-trace/index.js +0 -1779
- package/dist/env/mcp/index.js +0 -2173
- package/dist/env/mcp/tool/index.js +0 -1149
- package/dist/env/memory/index.js +0 -2171
- package/dist/env/memory/plugin/index.js +0 -1263
- package/dist/env/prompt/index.js +0 -2107
- package/dist/env/session/index.js +0 -3594
- package/dist/env/session/storage/index.js +0 -2049
- package/dist/env/skill/index.js +0 -1635
- package/dist/env/skill/tool/index.js +0 -114
- package/dist/env/task/delegate/index.js +0 -1844
- package/dist/env/task/index.js +0 -3578
- package/dist/env/task/plugins/index.js +0 -1626
- package/dist/env/task/storage/index.js +0 -1464
- package/dist/env/tool/built-in/index.js +0 -1151
- package/dist/env/tool/index.js +0 -2284
- package/dist/env/workflow/engine/index.js +0 -4391
- package/dist/env/workflow/index.js +0 -6214
- package/dist/env/workflow/storage/index.js +0 -1236
- package/dist/env/workflow/tools/index.js +0 -1081
- package/dist/env/workflow/utils/index.js +0 -1631
- package/dist/index.js +0 -22778
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__esm
|
|
3
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
4
|
+
|
|
5
|
+
// packages/core/src/env/workflow/decorators/decorator-node.ts
|
|
6
|
+
class DecoratorNode {
|
|
7
|
+
type = "decorator";
|
|
8
|
+
id;
|
|
9
|
+
methodName;
|
|
10
|
+
instance;
|
|
11
|
+
dependsOn;
|
|
12
|
+
timeout;
|
|
13
|
+
retryConfig;
|
|
14
|
+
constructor(definition) {
|
|
15
|
+
const config = definition.config;
|
|
16
|
+
this.id = definition.id;
|
|
17
|
+
this.methodName = config._methodName;
|
|
18
|
+
this.instance = config._instance;
|
|
19
|
+
this.dependsOn = definition.depends_on || [];
|
|
20
|
+
this.timeout = definition.timeout;
|
|
21
|
+
this.retryConfig = definition.retry;
|
|
22
|
+
}
|
|
23
|
+
async execute(context) {
|
|
24
|
+
const startTime = Date.now();
|
|
25
|
+
const method = this.instance[this.methodName];
|
|
26
|
+
if (typeof method !== "function") {
|
|
27
|
+
return {
|
|
28
|
+
success: false,
|
|
29
|
+
error: `Method '${this.methodName}' is not a function`,
|
|
30
|
+
duration: Date.now() - startTime
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const input = this.prepareInput(context);
|
|
34
|
+
const result = await this.executeWithRetry(input, context.abort);
|
|
35
|
+
return {
|
|
36
|
+
success: !result.error,
|
|
37
|
+
output: result.output,
|
|
38
|
+
error: result.error,
|
|
39
|
+
duration: Date.now() - startTime,
|
|
40
|
+
metadata: {
|
|
41
|
+
methodName: this.methodName
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
prepareInput(context) {
|
|
46
|
+
const nodeOutputs = context.nodeOutputs;
|
|
47
|
+
if (this.dependsOn.length === 0) {
|
|
48
|
+
return context.input || {};
|
|
49
|
+
}
|
|
50
|
+
const input = {};
|
|
51
|
+
for (const depId of this.dependsOn) {
|
|
52
|
+
const depOutput = nodeOutputs instanceof Map ? nodeOutputs.get(depId) : nodeOutputs?.[depId];
|
|
53
|
+
if (depOutput && typeof depOutput === "object") {
|
|
54
|
+
if ("output" in depOutput) {
|
|
55
|
+
input[depId] = depOutput.output;
|
|
56
|
+
} else {
|
|
57
|
+
input[depId] = depOutput;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return input;
|
|
62
|
+
}
|
|
63
|
+
async executeWithRetry(input, abort) {
|
|
64
|
+
const maxAttempts = this.retryConfig?.max_attempts ?? 1;
|
|
65
|
+
const backoff = this.retryConfig?.backoff ?? "exponential";
|
|
66
|
+
const initialDelay = this.retryConfig?.initial_delay ?? 1000;
|
|
67
|
+
let lastError;
|
|
68
|
+
for (let attempt = 1;attempt <= maxAttempts; attempt++) {
|
|
69
|
+
if (abort?.aborted) {
|
|
70
|
+
return { error: "Execution aborted" };
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const output = await this.executeWithTimeout(input, abort);
|
|
74
|
+
return { output };
|
|
75
|
+
} catch (error) {
|
|
76
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
77
|
+
if (attempt < maxAttempts) {
|
|
78
|
+
const delay = this.calculateBackoff(backoff, initialDelay, attempt - 1);
|
|
79
|
+
await this.sleep(delay, abort);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { error: lastError?.message || "Unknown error" };
|
|
84
|
+
}
|
|
85
|
+
async executeWithTimeout(input, abort) {
|
|
86
|
+
if (!this.timeout) {
|
|
87
|
+
return this.instance[this.methodName](input);
|
|
88
|
+
}
|
|
89
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
reject(new Error(`Execution timeout after ${this.timeout}ms`));
|
|
92
|
+
}, this.timeout);
|
|
93
|
+
});
|
|
94
|
+
return Promise.race([
|
|
95
|
+
this.instance[this.methodName](input),
|
|
96
|
+
timeoutPromise
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
calculateBackoff(backoff, initialDelay, attempt) {
|
|
100
|
+
if (backoff === "exponential") {
|
|
101
|
+
return initialDelay * Math.pow(2, attempt);
|
|
102
|
+
}
|
|
103
|
+
return initialDelay;
|
|
104
|
+
}
|
|
105
|
+
sleep(ms, abort) {
|
|
106
|
+
return new Promise((resolve) => {
|
|
107
|
+
const timeout = setTimeout(resolve, ms);
|
|
108
|
+
abort?.addEventListener("abort", () => {
|
|
109
|
+
clearTimeout(timeout);
|
|
110
|
+
resolve();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
var init_decorator_node = () => {};
|
|
116
|
+
|
|
117
|
+
export { DecoratorNode, init_decorator_node };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WorkflowRepository,
|
|
3
|
+
rowToWorkflow
|
|
4
|
+
} from "./roy-agent-core-tkr5ynkh.js";
|
|
5
|
+
import"./roy-agent-core-qxybm159.js";
|
|
6
|
+
import"./roy-agent-core-0sgn3de4.js";
|
|
7
|
+
import"./roy-agent-core-yn761yve.js";
|
|
8
|
+
import"./roy-agent-core-1k28kg7h.js";
|
|
9
|
+
import"./roy-agent-core-j8zx62zr.js";
|
|
10
|
+
import"./roy-agent-core-fs0mn2jk.js";
|
|
11
|
+
export {
|
|
12
|
+
rowToWorkflow,
|
|
13
|
+
WorkflowRepository
|
|
14
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__esm
|
|
3
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
4
|
+
|
|
5
|
+
// packages/core/src/env/workflow/utils/session-recovery.ts
|
|
6
|
+
function inferNextNode(messages, definition) {
|
|
7
|
+
if (messages.length === 0) {
|
|
8
|
+
return { type: "entry_node", nodeId: definition.entryNode };
|
|
9
|
+
}
|
|
10
|
+
const lastMessage = messages[messages.length - 1];
|
|
11
|
+
const metadata = lastMessage.metadata;
|
|
12
|
+
switch (metadata?.type) {
|
|
13
|
+
case "workflow.node.call":
|
|
14
|
+
return {
|
|
15
|
+
type: "resume_node",
|
|
16
|
+
nodeId: metadata.workflowNodeId,
|
|
17
|
+
agentSessionId: metadata.agentSessionId
|
|
18
|
+
};
|
|
19
|
+
case "workflow.node.interrupt":
|
|
20
|
+
return {
|
|
21
|
+
type: "ask_user",
|
|
22
|
+
nodeId: metadata.workflowNodeId,
|
|
23
|
+
agentSessionId: metadata.agentSessionId
|
|
24
|
+
};
|
|
25
|
+
case "workflow.node.result":
|
|
26
|
+
return getNextNodes(metadata.workflowNodeId, definition);
|
|
27
|
+
default:
|
|
28
|
+
const lastCall = findLastCallMessage(messages);
|
|
29
|
+
if (lastCall) {
|
|
30
|
+
const callMetadata = lastCall.metadata;
|
|
31
|
+
return {
|
|
32
|
+
type: "resume_node",
|
|
33
|
+
nodeId: callMetadata.workflowNodeId,
|
|
34
|
+
agentSessionId: callMetadata.agentSessionId
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return { type: "entry_node", nodeId: definition.entryNode };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function getNextNodes(completedNodeId, definition) {
|
|
41
|
+
if (!definition.edges) {
|
|
42
|
+
return { type: "next_nodes", nodeIds: [] };
|
|
43
|
+
}
|
|
44
|
+
const nextNodeIds = definition.edges.filter((edge) => edge.from === completedNodeId).map((edge) => edge.to);
|
|
45
|
+
return { type: "next_nodes", nodeIds: nextNodeIds };
|
|
46
|
+
}
|
|
47
|
+
function findLastInterruptMessage(messages) {
|
|
48
|
+
for (let i = messages.length - 1;i >= 0; i--) {
|
|
49
|
+
const msg = messages[i];
|
|
50
|
+
if (msg.metadata?.type === "workflow.node.interrupt") {
|
|
51
|
+
return msg;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
function findLastCallMessage(messages) {
|
|
57
|
+
for (let i = messages.length - 1;i >= 0; i--) {
|
|
58
|
+
const msg = messages[i];
|
|
59
|
+
if (msg.metadata?.type === "workflow.node.call") {
|
|
60
|
+
return msg;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
function parseNodeOutputs(messages) {
|
|
66
|
+
const outputs = new Map;
|
|
67
|
+
let lastCallNodeId = null;
|
|
68
|
+
for (const msg of messages) {
|
|
69
|
+
const metadata = msg.metadata;
|
|
70
|
+
if (metadata?.type === "workflow.node.call") {
|
|
71
|
+
lastCallNodeId = metadata.workflowNodeId;
|
|
72
|
+
} else if (metadata?.type === "workflow.node.result" && lastCallNodeId) {
|
|
73
|
+
try {
|
|
74
|
+
outputs.set(lastCallNodeId, JSON.parse(msg.content));
|
|
75
|
+
} catch {
|
|
76
|
+
outputs.set(lastCallNodeId, msg.content);
|
|
77
|
+
}
|
|
78
|
+
lastCallNodeId = null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return outputs;
|
|
82
|
+
}
|
|
83
|
+
function hasPendingAskUser(messages) {
|
|
84
|
+
if (messages.length === 0)
|
|
85
|
+
return false;
|
|
86
|
+
const lastMessage = messages[messages.length - 1];
|
|
87
|
+
const metadata = lastMessage.metadata;
|
|
88
|
+
return metadata?.type === "workflow.node.interrupt";
|
|
89
|
+
}
|
|
90
|
+
function getAgentSessionIdFromInterrupt(messages) {
|
|
91
|
+
const lastInterrupt = findLastInterruptMessage(messages);
|
|
92
|
+
if (!lastInterrupt)
|
|
93
|
+
return null;
|
|
94
|
+
const metadata = lastInterrupt.metadata;
|
|
95
|
+
return metadata?.agentSessionId || null;
|
|
96
|
+
}
|
|
97
|
+
var init_session_recovery = () => {};
|
|
98
|
+
init_session_recovery();
|
|
99
|
+
|
|
100
|
+
export {
|
|
101
|
+
parseNodeOutputs,
|
|
102
|
+
inferNextNode,
|
|
103
|
+
hasPendingAskUser,
|
|
104
|
+
getAgentSessionIdFromInterrupt,
|
|
105
|
+
findLastInterruptMessage,
|
|
106
|
+
findLastCallMessage
|
|
107
|
+
};
|
|
@@ -1,53 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
function __accessProp(key) {
|
|
7
|
-
return this[key];
|
|
8
|
-
}
|
|
9
|
-
var __toCommonJS = (from) => {
|
|
10
|
-
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
11
|
-
if (entry)
|
|
12
|
-
return entry;
|
|
13
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (var key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(entry, key))
|
|
17
|
-
__defProp(entry, key, {
|
|
18
|
-
get: __accessProp.bind(from, key),
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
__moduleCache.set(from, entry);
|
|
23
|
-
return entry;
|
|
24
|
-
};
|
|
25
|
-
var __moduleCache;
|
|
26
|
-
var __returnValue = (v) => v;
|
|
27
|
-
function __exportSetter(name, newValue) {
|
|
28
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
29
|
-
}
|
|
30
|
-
var __export = (target, all) => {
|
|
31
|
-
for (var name in all)
|
|
32
|
-
__defProp(target, name, {
|
|
33
|
-
get: all[name],
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
set: __exportSetter.bind(all, name)
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
40
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
41
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
42
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
43
|
-
else
|
|
44
|
-
for (var i = decorators.length - 1;i >= 0; i--)
|
|
45
|
-
if (d = decorators[i])
|
|
46
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
47
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
48
|
-
};
|
|
49
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
50
|
-
var __require = import.meta.require;
|
|
1
|
+
import {
|
|
2
|
+
__esm
|
|
3
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
51
4
|
|
|
52
5
|
// packages/core/src/env/workflow/nodes/tool-node.ts
|
|
53
6
|
class ToolNode {
|
|
@@ -311,6 +264,7 @@ class ToolNode {
|
|
|
311
264
|
return str.replace(/\\/g, "\\\\").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/"/g, "\\\"").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
312
265
|
}
|
|
313
266
|
}
|
|
267
|
+
var init_tool_node = () => {};
|
|
314
268
|
|
|
315
269
|
// packages/core/src/env/workflow/nodes/skill-node.ts
|
|
316
270
|
class SkillNode {
|
|
@@ -509,6 +463,7 @@ class SkillNode {
|
|
|
509
463
|
return JSON.stringify(value);
|
|
510
464
|
}
|
|
511
465
|
}
|
|
466
|
+
var init_skill_node = () => {};
|
|
512
467
|
|
|
513
468
|
// packages/core/src/env/workflow/nodes/workflow-node.ts
|
|
514
469
|
class WorkflowNode {
|
|
@@ -643,8 +598,6 @@ class WorkflowNode {
|
|
|
643
598
|
return JSON.stringify(value);
|
|
644
599
|
}
|
|
645
600
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
SkillNode
|
|
650
|
-
};
|
|
601
|
+
var init_workflow_node = () => {};
|
|
602
|
+
|
|
603
|
+
export { ToolNode, init_tool_node, SkillNode, init_skill_node, WorkflowNode, init_workflow_node };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__require
|
|
3
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
4
|
+
|
|
5
|
+
// packages/core/src/env/paths.ts
|
|
6
|
+
import os from "os";
|
|
7
|
+
import path from "path";
|
|
8
|
+
var APP_NAME = "roy-agent";
|
|
9
|
+
function getXdgBase() {
|
|
10
|
+
const home = os.homedir();
|
|
11
|
+
try {
|
|
12
|
+
const xdg = __require("xdg-basedir");
|
|
13
|
+
return {
|
|
14
|
+
config: xdg.xdgConfig || path.join(home, ".config"),
|
|
15
|
+
state: xdg.xdgState || path.join(home, ".local", "state"),
|
|
16
|
+
data: xdg.xdgData || path.join(home, ".local", "share"),
|
|
17
|
+
cache: xdg.xdgCache || path.join(home, ".cache")
|
|
18
|
+
};
|
|
19
|
+
} catch {
|
|
20
|
+
return {
|
|
21
|
+
config: path.join(home, ".config"),
|
|
22
|
+
state: path.join(home, ".local", "state"),
|
|
23
|
+
data: path.join(home, ".local", "share"),
|
|
24
|
+
cache: path.join(home, ".cache")
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function computeXDGPaths() {
|
|
29
|
+
const home = os.homedir();
|
|
30
|
+
const xdg = getXdgBase();
|
|
31
|
+
return {
|
|
32
|
+
home,
|
|
33
|
+
config: path.join(xdg.config, APP_NAME),
|
|
34
|
+
state: path.join(xdg.state, APP_NAME),
|
|
35
|
+
data: path.join(xdg.data, APP_NAME),
|
|
36
|
+
cache: path.join(xdg.cache, APP_NAME)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
class XDGPathsCalculator {
|
|
41
|
+
_paths;
|
|
42
|
+
get paths() {
|
|
43
|
+
if (!this._paths) {
|
|
44
|
+
this._paths = computeXDGPaths();
|
|
45
|
+
}
|
|
46
|
+
return this._paths;
|
|
47
|
+
}
|
|
48
|
+
getPath(type) {
|
|
49
|
+
return this.paths[type];
|
|
50
|
+
}
|
|
51
|
+
getComponentPath(base, subPath) {
|
|
52
|
+
return path.join(this.paths[base], subPath);
|
|
53
|
+
}
|
|
54
|
+
reset() {
|
|
55
|
+
this._paths = undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
var XDG_PATHS = new XDGPathsCalculator;
|
|
59
|
+
function getXDGPaths() {
|
|
60
|
+
return XDG_PATHS.paths;
|
|
61
|
+
}
|
|
62
|
+
function getXDGPath(type) {
|
|
63
|
+
return XDG_PATHS.getPath(type);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { XDG_PATHS, getXDGPaths, getXDGPath };
|