@opengeni/worker-bundle 0.26.0-canary.2 → 0.26.0-canary.4
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/index.js
CHANGED
|
@@ -781,7 +781,7 @@ function temporalWorkflowExecutionNotFound(error) {
|
|
|
781
781
|
return isGrpcServiceError(error) && error.code === 5;
|
|
782
782
|
}
|
|
783
783
|
async function createDefaultWorkerActivities(role, dependencies = {}) {
|
|
784
|
-
return role === "control" ? (await import("./activities-control-
|
|
784
|
+
return role === "control" ? (await import("./activities-control-SHMDOQWS.js")).createControlActivities(dependencies) : (await import("./activities-turn-GHSFZB64.js")).createTurnActivities(dependencies);
|
|
785
785
|
}
|
|
786
786
|
function resolveOpenGeniWorkflowDefinition(moduleUrl = import.meta.url) {
|
|
787
787
|
const modulePath = fileURLToPath(moduleUrl).replaceAll("\\", "/");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/worker-bundle",
|
|
3
|
-
"version": "0.26.0-canary.
|
|
3
|
+
"version": "0.26.0-canary.4",
|
|
4
4
|
"description": "OpenGeni worker entry and reusable embedded lifecycle, shipped with a release-coherent pre-bundled Temporal workflow artifact.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -54,22 +54,22 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@llamaindex/liteparse": "2.14.2",
|
|
57
|
-
"@opengeni/agent-proto": "^0.5.1-canary.
|
|
58
|
-
"@opengeni/capabilities": "^0.3.2-canary.
|
|
59
|
-
"@opengeni/codemode": "^0.4.27-canary.
|
|
60
|
-
"@opengeni/codex": "^0.2.21-canary.
|
|
61
|
-
"@opengeni/config": "^1.0.0-canary.
|
|
62
|
-
"@opengeni/contracts": "^2.13.0-canary.
|
|
63
|
-
"@opengeni/core": "^2.7.5-canary.
|
|
64
|
-
"@opengeni/db": "^4.0.0-canary.
|
|
65
|
-
"@opengeni/documents": "^0.8.19-canary.
|
|
66
|
-
"@opengeni/events": "^0.4.17-canary.
|
|
67
|
-
"@opengeni/github": "^0.7.3-canary.
|
|
68
|
-
"@opengeni/network": "^0.3.0-canary.
|
|
69
|
-
"@opengeni/observability": "^0.8.19-canary.
|
|
70
|
-
"@opengeni/runtime": "^2.3.0-canary.
|
|
71
|
-
"@opengeni/storage": "^0.2.120-canary.
|
|
72
|
-
"@opengeni/xai-subscription": "^0.1.3-canary.
|
|
57
|
+
"@opengeni/agent-proto": "^0.5.1-canary.13",
|
|
58
|
+
"@opengeni/capabilities": "^0.3.2-canary.4",
|
|
59
|
+
"@opengeni/codemode": "^0.4.27-canary.4",
|
|
60
|
+
"@opengeni/codex": "^0.2.21-canary.4",
|
|
61
|
+
"@opengeni/config": "^1.0.0-canary.4",
|
|
62
|
+
"@opengeni/contracts": "^2.13.0-canary.4",
|
|
63
|
+
"@opengeni/core": "^2.7.5-canary.4",
|
|
64
|
+
"@opengeni/db": "^4.0.0-canary.4",
|
|
65
|
+
"@opengeni/documents": "^0.8.19-canary.4",
|
|
66
|
+
"@opengeni/events": "^0.4.17-canary.4",
|
|
67
|
+
"@opengeni/github": "^0.7.3-canary.4",
|
|
68
|
+
"@opengeni/network": "^0.3.0-canary.4",
|
|
69
|
+
"@opengeni/observability": "^0.8.19-canary.4",
|
|
70
|
+
"@opengeni/runtime": "^2.3.0-canary.4",
|
|
71
|
+
"@opengeni/storage": "^0.2.120-canary.4",
|
|
72
|
+
"@opengeni/xai-subscription": "^0.1.3-canary.4",
|
|
73
73
|
"@temporalio/activity": "^1.17.0",
|
|
74
74
|
"@temporalio/client": "^1.17.0",
|
|
75
75
|
"@temporalio/worker": "^1.17.0",
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fireWorkspacePauseTimerInTransaction,
|
|
3
|
+
listDueWorkspacePauseTimers,
|
|
4
|
+
withWorkspaceRls,
|
|
5
|
+
getWorkspaceControlEvent,
|
|
6
|
+
type Database,
|
|
7
|
+
} from "@opengeni/db";
|
|
8
|
+
import { publishDurableWorkspaceControlEvent } from "@opengeni/events";
|
|
1
9
|
import type { ControlActivityServices } from "./types";
|
|
2
10
|
import {
|
|
3
11
|
reconcileAutomaticSessionTitleFanout,
|
|
@@ -24,6 +32,34 @@ export function createWorkflowWakeActivities(services: () => Promise<ControlActi
|
|
|
24
32
|
return {
|
|
25
33
|
async dispatchSessionWorkflowWakes(): Promise<DispatchSessionWorkflowWakesResult> {
|
|
26
34
|
const service = await services();
|
|
35
|
+
// Timer commits produce ordinary durable wakes; drain those below in the same sweep.
|
|
36
|
+
const timers = await listDueWorkspacePauseTimers(service.db, 100);
|
|
37
|
+
for (const timer of timers) {
|
|
38
|
+
try {
|
|
39
|
+
const result = await withWorkspaceRls(service.db, timer.workspace_id, (scoped) =>
|
|
40
|
+
scoped.transaction((tx) =>
|
|
41
|
+
fireWorkspacePauseTimerInTransaction(tx as unknown as Database, {
|
|
42
|
+
workspaceId: timer.workspace_id,
|
|
43
|
+
timerId: timer.timer_id,
|
|
44
|
+
}),
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
if (result?.workspaceControlEventId) {
|
|
48
|
+
const event = await getWorkspaceControlEvent(
|
|
49
|
+
service.db,
|
|
50
|
+
timer.workspace_id,
|
|
51
|
+
result.workspaceControlEventId,
|
|
52
|
+
);
|
|
53
|
+
if (event)
|
|
54
|
+
await publishDurableWorkspaceControlEvent(service.bus, timer.workspace_id, event);
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
service.observability.warn("Workspace pause timer will retry", {
|
|
58
|
+
workspaceId: timer.workspace_id,
|
|
59
|
+
error: String(error),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
27
63
|
let claimed = 0;
|
|
28
64
|
let delivered = 0;
|
|
29
65
|
let failed = 0;
|