@ai-setting/roy-agent-core 1.7.38 → 1.7.39
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 +6 -6
- package/dist/env/agent/index.js +7 -7
- package/dist/env/commands/index.js +6 -6
- package/dist/env/context/index.js +6 -2
- package/dist/env/debug/index.js +6 -6
- package/dist/env/event-source/index.js +8 -8
- package/dist/env/hook/index.js +4 -4
- package/dist/env/index.js +22 -22
- package/dist/env/llm/index.js +6 -6
- package/dist/env/log-trace/index.js +6 -6
- package/dist/env/mcp/index.js +6 -6
- package/dist/env/memory/index.js +6 -6
- package/dist/env/plugin/index.js +6 -6
- package/dist/env/prompt/index.js +6 -6
- package/dist/env/session/index.js +6 -6
- package/dist/env/skill/index.js +6 -6
- package/dist/env/task/delegate/index.js +4 -4
- package/dist/env/task/index.js +9 -9
- package/dist/env/task/plugins/index.js +3 -3
- package/dist/env/task/storage/index.js +1 -1
- package/dist/env/task/tools/index.js +2 -2
- package/dist/env/tool/index.js +6 -6
- package/dist/env/workflow/engine/index.js +5 -5
- package/dist/env/workflow/index.js +10 -10
- package/dist/env/workflow/tools/index.js +7 -7
- package/dist/index.js +29 -29
- package/dist/shared/@ai-setting/{roy-agent-core-83j0v0hs.js → roy-agent-core-34je386q.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-p0c98phj.js → roy-agent-core-3h7ajma5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e5pnnzdm.js → roy-agent-core-47wrv4ex.js} +89 -27
- package/dist/shared/@ai-setting/{roy-agent-core-mzyzdf33.js → roy-agent-core-4cqcdk7k.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-vh10qamt.js → roy-agent-core-5exnp10h.js} +8 -5
- package/dist/shared/@ai-setting/{roy-agent-core-nz4n1w28.js → roy-agent-core-6mnwqcqf.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-vn6f4nxv.js → roy-agent-core-6vwf03cz.js} +9 -6
- package/dist/shared/@ai-setting/{roy-agent-core-970btnjh.js → roy-agent-core-754b0078.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-yv4anf1c.js → roy-agent-core-9t675te0.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-yjyvwxs4.js → roy-agent-core-a236mps6.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-gh6szaj5.js → roy-agent-core-asxe1nt4.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-gpf33hn9.js → roy-agent-core-cazvr63z.js} +60 -38
- package/dist/shared/@ai-setting/{roy-agent-core-y7atw1kw.js → roy-agent-core-cw89yj9d.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9wsy4yfv.js → roy-agent-core-cysnmvcy.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-5gpf5j51.js → roy-agent-core-f18jk3cw.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-wb1b61f8.js → roy-agent-core-jadrj0bz.js} +7 -0
- package/dist/shared/@ai-setting/{roy-agent-core-p2ham63a.js → roy-agent-core-jawzpf5k.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e02f0ywc.js → roy-agent-core-jg8cv1f7.js} +85 -31
- package/dist/shared/@ai-setting/{roy-agent-core-wfpzny0h.js → roy-agent-core-jjw7xcxv.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-dfnyvxr9.js → roy-agent-core-krppch0s.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-cd9h49ng.js → roy-agent-core-m3ffkexb.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-rhfywyz1.js → roy-agent-core-n1ceexfz.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e8rxb9a6.js → roy-agent-core-pc8x07p0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-wacnvjaq.js → roy-agent-core-qfktfbrr.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-q3vbxprp.js → roy-agent-core-rczz7e81.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ym1hwrcm.js → roy-agent-core-s44egzrh.js} +34 -3
- package/dist/shared/@ai-setting/{roy-agent-core-hfmpmt0k.js → roy-agent-core-vsrfzaze.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ff2ssff5.js → roy-agent-core-wn59p0zw.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-3m7j2wcb.js → roy-agent-core-wybj8emq.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-z4486eek.js → roy-agent-core-zbb3sk72.js} +16 -2
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
createWorkflowSearchTool,
|
|
14
14
|
createWorkflowTagListTool,
|
|
15
15
|
createWorkflowValidateTool
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-34je386q.js";
|
|
17
17
|
import {
|
|
18
18
|
WorkflowService
|
|
19
19
|
} from "./roy-agent-core-8nv07zgr.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
WorkflowEngine,
|
|
22
22
|
exports_engine,
|
|
23
23
|
init_engine
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-rczz7e81.js";
|
|
25
25
|
import {
|
|
26
26
|
BaseComponent
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-9t675te0.js";
|
|
28
28
|
import {
|
|
29
29
|
createLogger,
|
|
30
30
|
init_logger
|
|
@@ -141,7 +141,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
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-asxe1nt4.js");
|
|
145
145
|
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
} from "./roy-agent-core-rmn29nrh.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseComponent
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-9t675te0.js";
|
|
7
7
|
import {
|
|
8
8
|
globalHookManager,
|
|
9
9
|
init_global_hook_manager
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-a236mps6.js";
|
|
11
11
|
import {
|
|
12
12
|
init_context
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-wn59p0zw.js";
|
|
14
14
|
import {
|
|
15
15
|
getEnvContextOrEmpty
|
|
16
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-zbb3sk72.js";
|
|
17
17
|
import {
|
|
18
18
|
createLogger,
|
|
19
19
|
init_logger
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
13
13
|
import {
|
|
14
14
|
BaseComponent
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-9t675te0.js";
|
|
16
16
|
import {
|
|
17
17
|
TracedAs,
|
|
18
18
|
init_decorator
|
|
@@ -337,6 +337,23 @@ class SessionComponent extends BaseComponent {
|
|
|
337
337
|
chatBindingCache = new Map;
|
|
338
338
|
static CHAT_BINDING_CACHE_TTL_MS = 60000;
|
|
339
339
|
static CHAT_BINDING_CACHE_MAX = 1000;
|
|
340
|
+
chatBindingLocks = new Map;
|
|
341
|
+
runChatBindingExclusive(chatId, fn) {
|
|
342
|
+
const prev = this.chatBindingLocks.get(chatId) ?? Promise.resolve();
|
|
343
|
+
const run = prev.catch(() => {}).then(() => fn());
|
|
344
|
+
const tail = run.then(() => {
|
|
345
|
+
return;
|
|
346
|
+
}, () => {
|
|
347
|
+
return;
|
|
348
|
+
});
|
|
349
|
+
this.chatBindingLocks.set(chatId, tail);
|
|
350
|
+
tail.then(() => {
|
|
351
|
+
if (this.chatBindingLocks.get(chatId) === tail) {
|
|
352
|
+
this.chatBindingLocks.delete(chatId);
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
return run;
|
|
356
|
+
}
|
|
340
357
|
async upsertChatTaskBinding(opts) {
|
|
341
358
|
if (!opts.chatId || typeof opts.chatId !== "string") {
|
|
342
359
|
throw new Error("upsertChatTaskBinding: chatId is required (non-empty string)");
|
|
@@ -344,6 +361,9 @@ class SessionComponent extends BaseComponent {
|
|
|
344
361
|
if (typeof opts.taskId !== "number" || !Number.isInteger(opts.taskId) || opts.taskId <= 0) {
|
|
345
362
|
throw new Error(`upsertChatTaskBinding: taskId must be a positive integer, got ${JSON.stringify(opts.taskId)}`);
|
|
346
363
|
}
|
|
364
|
+
return this.runChatBindingExclusive(opts.chatId, () => this.upsertChatTaskBindingLocked(opts));
|
|
365
|
+
}
|
|
366
|
+
async upsertChatTaskBindingLocked(opts) {
|
|
347
367
|
const now = new Date().toISOString();
|
|
348
368
|
const desiredStatus = opts.status ?? "ready";
|
|
349
369
|
const existing = await this.getChatTaskBinding(opts.chatId);
|
|
@@ -959,14 +979,25 @@ __legacyDecorateClassTS([
|
|
|
959
979
|
TracedAs("session.upsertChatTaskBinding", {
|
|
960
980
|
recordParams: false,
|
|
961
981
|
recordResult: false,
|
|
962
|
-
log: true
|
|
982
|
+
log: true,
|
|
983
|
+
resultFilter: (binding) => ({
|
|
984
|
+
chatId: binding?.chatId ?? null,
|
|
985
|
+
taskId: binding?.taskId ?? null,
|
|
986
|
+
status: binding?.status ?? null,
|
|
987
|
+
rebindCount: binding?.rebindCount ?? null
|
|
988
|
+
})
|
|
963
989
|
})
|
|
964
990
|
], SessionComponent.prototype, "upsertChatTaskBinding", null);
|
|
965
991
|
__legacyDecorateClassTS([
|
|
966
992
|
TracedAs("session.getChatTaskBinding", {
|
|
967
993
|
recordParams: false,
|
|
968
994
|
recordResult: false,
|
|
969
|
-
log: false
|
|
995
|
+
log: false,
|
|
996
|
+
resultFilter: (binding) => ({
|
|
997
|
+
found: !!binding,
|
|
998
|
+
taskId: binding?.taskId ?? null,
|
|
999
|
+
status: binding?.status ?? null
|
|
1000
|
+
})
|
|
970
1001
|
})
|
|
971
1002
|
], SessionComponent.prototype, "getChatTaskBinding", null);
|
|
972
1003
|
__legacyDecorateClassTS([
|
|
@@ -111,6 +111,9 @@ async function runWithEnvContextAsync(context, fn) {
|
|
|
111
111
|
}
|
|
112
112
|
return fn();
|
|
113
113
|
}
|
|
114
|
+
function normalizeParentTaskId(value) {
|
|
115
|
+
return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : undefined;
|
|
116
|
+
}
|
|
114
117
|
function createEnvContext(options) {
|
|
115
118
|
let replyChannel = options.replyChannel;
|
|
116
119
|
if (replyChannel && options.messageId && !replyChannel.messageId) {
|
|
@@ -184,13 +187,24 @@ function getEventFromEnvContext(ctx) {
|
|
|
184
187
|
}
|
|
185
188
|
return;
|
|
186
189
|
}
|
|
187
|
-
var logger, envContextStorage, setCurrentTaskId;
|
|
190
|
+
var logger, envContextStorage, resolveEnvParentTaskId, setCurrentTaskId;
|
|
188
191
|
var init_env_context = __esm(() => {
|
|
189
192
|
init_logger();
|
|
190
193
|
init_decorator();
|
|
191
194
|
init_env_event();
|
|
192
195
|
logger = createLogger("env:context:env-context");
|
|
193
196
|
envContextStorage = new AsyncLocalStorage;
|
|
197
|
+
resolveEnvParentTaskId = wrapFunction(function _resolveEnvParentTaskId(envEvent, parentEnvContext) {
|
|
198
|
+
const fromEvent = normalizeParentTaskId(envEvent?.metadata?.parentTaskId);
|
|
199
|
+
return fromEvent ?? normalizeParentTaskId(parentEnvContext?.parentTaskId);
|
|
200
|
+
}, "env-context.resolveEnvParentTaskId", {
|
|
201
|
+
recordParams: false,
|
|
202
|
+
recordResult: false,
|
|
203
|
+
log: false,
|
|
204
|
+
resultFilter: (parentTaskId) => ({
|
|
205
|
+
parentTaskId: parentTaskId ?? null
|
|
206
|
+
})
|
|
207
|
+
});
|
|
194
208
|
setCurrentTaskId = wrapFunction(function _setCurrentTaskId(taskId) {
|
|
195
209
|
const prev = getCurrentTaskId();
|
|
196
210
|
const ctx = envContextStorage.getStore();
|
|
@@ -204,4 +218,4 @@ var init_env_context = __esm(() => {
|
|
|
204
218
|
}, "env-context.setCurrentTaskId", { recordParams: true, recordResult: false, log: true });
|
|
205
219
|
});
|
|
206
220
|
|
|
207
|
-
export { isLarkEvent, isGithubEvent, isJiraEvent, getLarkMessageId, getLarkChatId, getLarkUserId, EVENT_ENV_PREFIX, serializeEventToEnv, restoreEventFromEnv, init_env_event, envContextStorage, getEnvContext, getEnvContextOrEmpty, hasEnvContext, getCurrentTaskId, runWithEnvContext, runWithEnvContextAsync, createEnvContext, mergeEnvContext, setCurrentTaskId, getEventFromEnvContext, init_env_context };
|
|
221
|
+
export { isLarkEvent, isGithubEvent, isJiraEvent, getLarkMessageId, getLarkChatId, getLarkUserId, EVENT_ENV_PREFIX, serializeEventToEnv, restoreEventFromEnv, init_env_event, envContextStorage, getEnvContext, getEnvContextOrEmpty, hasEnvContext, getCurrentTaskId, runWithEnvContext, runWithEnvContextAsync, normalizeParentTaskId, resolveEnvParentTaskId, createEnvContext, mergeEnvContext, setCurrentTaskId, getEventFromEnvContext, init_env_context };
|