@cuylabs/agent-runtime-dapr 0.11.0 → 0.13.0
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/{chunk-YS2CWYBQ.js → chunk-2TBZCBXE.js} +20 -23
- package/dist/{chunk-YQQTUE6B.js → chunk-6BLY7B7U.js} +41 -31
- package/dist/{chunk-O7H3XGY2.js → chunk-EJBODJQR.js} +368 -254
- package/dist/{chunk-MQJ4LZOX.js → chunk-HQLQRXU5.js} +6 -3
- package/dist/{chunk-5CJIC4YB.js → chunk-VKPTE4J6.js} +28 -10
- package/dist/dispatch/index.js +2 -2
- package/dist/execution/index.js +2 -2
- package/dist/host/index.js +5 -5
- package/dist/index.js +5 -5
- package/dist/team/index.js +5 -5
- package/dist/workflow/index.js +2 -2
- package/package.json +4 -4
|
@@ -201,9 +201,12 @@ var DaprSidecarClient = class {
|
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
203
|
async publish(pubsubName, topic, data, metadata) {
|
|
204
|
-
const params = metadata ? "?" + new URLSearchParams(
|
|
205
|
-
([k, v]) => [
|
|
206
|
-
|
|
204
|
+
const params = metadata ? "?" + new URLSearchParams(
|
|
205
|
+
Object.entries(metadata).map(([k, v]) => [
|
|
206
|
+
`metadata.${k}`,
|
|
207
|
+
v
|
|
208
|
+
])
|
|
209
|
+
).toString() : "";
|
|
207
210
|
await this.request(
|
|
208
211
|
`/v1.0/publish/${encodeURIComponent(pubsubName)}/${encodeURIComponent(topic)}${params}`,
|
|
209
212
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DaprSidecarClient,
|
|
3
3
|
isDaprConflictError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HQLQRXU5.js";
|
|
5
5
|
|
|
6
6
|
// src/execution/store.ts
|
|
7
7
|
var DEFAULT_KEY_PREFIX = "agent-runtime:execution:";
|
|
@@ -289,7 +289,9 @@ var DaprExecutionStore = class {
|
|
|
289
289
|
let trimmedSessions = 0;
|
|
290
290
|
if (cutoff !== void 0) {
|
|
291
291
|
for (const execution of eligible) {
|
|
292
|
-
const referenceMs = Date.parse(
|
|
292
|
+
const referenceMs = Date.parse(
|
|
293
|
+
execution.completedAt ?? execution.updatedAt
|
|
294
|
+
);
|
|
293
295
|
if (Number.isFinite(referenceMs) && referenceMs < cutoff) {
|
|
294
296
|
toDelete.add(execution.sessionId);
|
|
295
297
|
}
|
|
@@ -312,7 +314,9 @@ var DaprExecutionStore = class {
|
|
|
312
314
|
deletedExecutionIds.push(sessionId);
|
|
313
315
|
}
|
|
314
316
|
if (options.maxCheckpointsPerExecution !== void 0 && Number.isFinite(options.maxCheckpointsPerExecution) && options.maxCheckpointsPerExecution >= 0) {
|
|
315
|
-
const normalizedCheckpointLimit = Math.floor(
|
|
317
|
+
const normalizedCheckpointLimit = Math.floor(
|
|
318
|
+
options.maxCheckpointsPerExecution
|
|
319
|
+
);
|
|
316
320
|
for (const execution of executions) {
|
|
317
321
|
if (toDelete.has(execution.sessionId)) {
|
|
318
322
|
continue;
|
|
@@ -328,7 +332,9 @@ var DaprExecutionStore = class {
|
|
|
328
332
|
0,
|
|
329
333
|
checkpoints.length - normalizedCheckpointLimit
|
|
330
334
|
);
|
|
331
|
-
const retained = checkpoints.slice(
|
|
335
|
+
const retained = checkpoints.slice(
|
|
336
|
+
checkpoints.length - normalizedCheckpointLimit
|
|
337
|
+
);
|
|
332
338
|
for (const checkpoint of checkpointOverflow) {
|
|
333
339
|
await this.deleteCheckpoint(checkpoint.sessionId, checkpoint.id);
|
|
334
340
|
}
|
|
@@ -372,7 +378,9 @@ var DaprExecutionStore = class {
|
|
|
372
378
|
return checkpoints.length;
|
|
373
379
|
}
|
|
374
380
|
async deleteCheckpoint(sessionId, checkpointId) {
|
|
375
|
-
await this.client.deleteState(
|
|
381
|
+
await this.client.deleteState(
|
|
382
|
+
this.stateKeyForCheckpoint(sessionId, checkpointId)
|
|
383
|
+
);
|
|
376
384
|
}
|
|
377
385
|
async readCheckpoint(sessionId, checkpointId) {
|
|
378
386
|
const value = await this.client.getState(
|
|
@@ -396,16 +404,26 @@ var DaprExecutionStore = class {
|
|
|
396
404
|
};
|
|
397
405
|
}
|
|
398
406
|
return {
|
|
399
|
-
ids: [
|
|
407
|
+
ids: [
|
|
408
|
+
...new Set(
|
|
409
|
+
entry.value.filter(
|
|
410
|
+
(item) => typeof item === "string"
|
|
411
|
+
)
|
|
412
|
+
)
|
|
413
|
+
],
|
|
400
414
|
etag: entry.etag,
|
|
401
415
|
exists: true
|
|
402
416
|
};
|
|
403
417
|
}
|
|
404
418
|
async writeCheckpointIndex(sessionId, ids, etag) {
|
|
405
|
-
await this.client.saveState(
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
419
|
+
await this.client.saveState(
|
|
420
|
+
this.stateKeyForCheckpointIndex(sessionId),
|
|
421
|
+
[...new Set(ids)],
|
|
422
|
+
{
|
|
423
|
+
etag,
|
|
424
|
+
concurrency: etag ? "first-write" : void 0
|
|
425
|
+
}
|
|
426
|
+
);
|
|
409
427
|
}
|
|
410
428
|
async updateCheckpointIndex(sessionId, updater) {
|
|
411
429
|
for (let attempt = 0; attempt < DEFAULT_INDEX_UPDATE_RETRIES; attempt += 1) {
|
package/dist/dispatch/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
createDaprWorkflowDispatchExecutor,
|
|
6
6
|
createRemoteAgentDispatchTarget,
|
|
7
7
|
createWorkflowDispatchTarget
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-6BLY7B7U.js";
|
|
9
|
+
import "../chunk-HQLQRXU5.js";
|
|
10
10
|
export {
|
|
11
11
|
createDaprAppDispatchExecutor,
|
|
12
12
|
createDaprCompositeDispatchExecutor,
|
package/dist/execution/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
createDaprLoggingObserver,
|
|
6
6
|
createOtelObserver,
|
|
7
7
|
createWorkflowObserverBridge
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-VKPTE4J6.js";
|
|
9
|
+
import "../chunk-HQLQRXU5.js";
|
|
10
10
|
export {
|
|
11
11
|
DaprExecutionObserver,
|
|
12
12
|
DaprExecutionStore,
|
package/dist/host/index.js
CHANGED
|
@@ -17,14 +17,14 @@ import {
|
|
|
17
17
|
startDaprAgentWorkflowTurn,
|
|
18
18
|
startDaprHostHttpServer,
|
|
19
19
|
startDaprHttpServer
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-EJBODJQR.js";
|
|
21
21
|
import {
|
|
22
22
|
DaprServiceInvoker,
|
|
23
23
|
invokeRemoteAgentRun
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
24
|
+
} from "../chunk-6BLY7B7U.js";
|
|
25
|
+
import "../chunk-VKPTE4J6.js";
|
|
26
|
+
import "../chunk-2TBZCBXE.js";
|
|
27
|
+
import "../chunk-HQLQRXU5.js";
|
|
28
28
|
export {
|
|
29
29
|
DaprServiceInvoker,
|
|
30
30
|
createDaprAgentRunner,
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
installDaprSubAgents,
|
|
37
37
|
startDaprAgentWorkflowTurn,
|
|
38
38
|
startDaprHostHttpServer
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-EJBODJQR.js";
|
|
40
40
|
import {
|
|
41
41
|
DaprServiceInvoker,
|
|
42
42
|
createDaprAppDispatchExecutor,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
createRemoteAgentDispatchTarget,
|
|
47
47
|
createWorkflowDispatchTarget,
|
|
48
48
|
invokeRemoteAgentRun
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-6BLY7B7U.js";
|
|
50
50
|
import {
|
|
51
51
|
DaprExecutionObserver,
|
|
52
52
|
DaprExecutionStore,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
createDaprLoggingObserver,
|
|
55
55
|
createOtelObserver,
|
|
56
56
|
createWorkflowObserverBridge
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-VKPTE4J6.js";
|
|
58
58
|
import {
|
|
59
59
|
DaprWorkflowClient,
|
|
60
60
|
createDaprAgentTurnApprovalCheckActivity,
|
|
@@ -68,8 +68,8 @@ import {
|
|
|
68
68
|
createDaprAgentTurnWorkflowKit,
|
|
69
69
|
hasStartedDaprWorkflow,
|
|
70
70
|
isTerminalDaprWorkflowStatus
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import "./chunk-
|
|
71
|
+
} from "./chunk-2TBZCBXE.js";
|
|
72
|
+
import "./chunk-HQLQRXU5.js";
|
|
73
73
|
export {
|
|
74
74
|
DAPR_SUBAGENT_BACKEND,
|
|
75
75
|
DaprExecutionObserver,
|
package/dist/team/index.js
CHANGED
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
createDaprTeamHttpHandler,
|
|
11
11
|
createDaprTeamRunner,
|
|
12
12
|
createPrepareExternalTasksActivity
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-EJBODJQR.js";
|
|
14
|
+
import "../chunk-6BLY7B7U.js";
|
|
15
|
+
import "../chunk-VKPTE4J6.js";
|
|
16
|
+
import "../chunk-2TBZCBXE.js";
|
|
17
|
+
import "../chunk-HQLQRXU5.js";
|
|
18
18
|
export {
|
|
19
19
|
DaprMailboxStore,
|
|
20
20
|
DaprTaskBoardStore,
|
package/dist/workflow/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
createDaprAgentTurnWorkflowKit,
|
|
9
9
|
hasStartedDaprWorkflow,
|
|
10
10
|
isTerminalDaprWorkflowStatus
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-2TBZCBXE.js";
|
|
12
|
+
import "../chunk-HQLQRXU5.js";
|
|
13
13
|
export {
|
|
14
14
|
DaprWorkflowClient,
|
|
15
15
|
createDaprAgentTurnModelStepActivity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuylabs/agent-runtime-dapr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Dapr-backed workload runtime and host adapters for @cuylabs/agent-runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@cuylabs/agent-core": "^0.
|
|
46
|
-
"@cuylabs/agent-runtime": "^0.
|
|
45
|
+
"@cuylabs/agent-core": "^0.13.0",
|
|
46
|
+
"@cuylabs/agent-runtime": "^0.13.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@dapr/dapr": "^3.6.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typescript": "^5.7.0",
|
|
76
76
|
"vitest": "^4.0.18",
|
|
77
77
|
"zod": "^3.24.0",
|
|
78
|
-
"@cuylabs/agent-code": "^0.
|
|
78
|
+
"@cuylabs/agent-code": "^0.13.0"
|
|
79
79
|
},
|
|
80
80
|
"keywords": [
|
|
81
81
|
"agent",
|