@opengeni/worker-bundle 3.2.2 → 3.3.1-canary.38922642121001

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/worker-bundle",
3
- "version": "3.2.2",
3
+ "version": "3.3.1-canary.38922642121001",
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": {
@@ -56,31 +56,31 @@
56
56
  "@1password/sdk": "0.5.0",
57
57
  "@keeper-security/secrets-manager-core": "17.6.0",
58
58
  "@llamaindex/liteparse": "2.14.2",
59
- "@opengeni/agent-proto": "3.2.2",
60
- "@opengeni/capabilities": "3.2.2",
61
- "@opengeni/codemode": "3.2.2",
62
- "@opengeni/codex": "3.2.2",
63
- "@opengeni/config": "3.2.2",
64
- "@opengeni/contracts": "3.2.2",
65
- "@opengeni/core": "3.2.2",
66
- "@opengeni/db": "3.2.2",
67
- "@opengeni/documents": "3.2.2",
68
- "@opengeni/events": "3.2.2",
69
- "@opengeni/github": "3.2.2",
70
- "@opengeni/interaction": "3.2.2",
71
- "@opengeni/jev": "3.2.2",
72
- "@opengeni/network": "3.2.2",
73
- "@opengeni/observability": "3.2.2",
74
- "@opengeni/runtime": "3.2.2",
75
- "@opengeni/sdk": "3.2.2",
76
- "@opengeni/storage": "3.2.2",
77
- "@opengeni/subscriptions": "3.2.2",
78
- "@opengeni/tool-gateway": "3.2.2",
79
- "@opengeni/vaults": "3.2.2",
80
- "@opengeni/vaults-keeper": "3.2.2",
81
- "@opengeni/vaults-onepassword": "3.2.2",
82
- "@opengeni/vaults-protonpass": "3.2.2",
83
- "@opengeni/xai-subscription": "3.2.2",
59
+ "@opengeni/agent-proto": "3.3.1-canary.38922642121001",
60
+ "@opengeni/capabilities": "3.3.1-canary.38922642121001",
61
+ "@opengeni/codemode": "3.3.1-canary.38922642121001",
62
+ "@opengeni/codex": "3.3.1-canary.38922642121001",
63
+ "@opengeni/config": "3.3.1-canary.38922642121001",
64
+ "@opengeni/contracts": "3.3.1-canary.38922642121001",
65
+ "@opengeni/core": "3.3.1-canary.38922642121001",
66
+ "@opengeni/db": "3.3.1-canary.38922642121001",
67
+ "@opengeni/documents": "3.3.1-canary.38922642121001",
68
+ "@opengeni/events": "3.3.1-canary.38922642121001",
69
+ "@opengeni/github": "3.3.1-canary.38922642121001",
70
+ "@opengeni/interaction": "3.3.1-canary.38922642121001",
71
+ "@opengeni/jev": "3.3.1-canary.38922642121001",
72
+ "@opengeni/network": "3.3.1-canary.38922642121001",
73
+ "@opengeni/observability": "3.3.1-canary.38922642121001",
74
+ "@opengeni/runtime": "3.3.1-canary.38922642121001",
75
+ "@opengeni/sdk": "3.3.1-canary.38922642121001",
76
+ "@opengeni/storage": "3.3.1-canary.38922642121001",
77
+ "@opengeni/subscriptions": "3.3.1-canary.38922642121001",
78
+ "@opengeni/tool-gateway": "3.3.1-canary.38922642121001",
79
+ "@opengeni/vaults": "3.3.1-canary.38922642121001",
80
+ "@opengeni/vaults-keeper": "3.3.1-canary.38922642121001",
81
+ "@opengeni/vaults-onepassword": "3.3.1-canary.38922642121001",
82
+ "@opengeni/vaults-protonpass": "3.3.1-canary.38922642121001",
83
+ "@opengeni/xai-subscription": "3.3.1-canary.38922642121001",
84
84
  "@temporalio/activity": "^1.17.0",
85
85
  "@temporalio/client": "^1.17.0",
86
86
  "@temporalio/worker": "^1.17.0",
@@ -542,6 +542,8 @@ export async function establishTurnSandbox(deps: EstablishTurnSandboxDeps): Prom
542
542
  liveMachineEnrollment?.agentCapabilities.operationCpuQuota === true,
543
543
  transactionalFsWriteSupported:
544
544
  liveMachineEnrollment?.agentCapabilities.transactionalFsWrite === true,
545
+ browserControlHttpSupported:
546
+ liveMachineEnrollment?.agentCapabilities.browserControlHttp === true,
545
547
  // Carried for shared machines too: the audience can narrow to Only me
546
548
  // mid-turn, and each operation then rechecks this authority.
547
549
  ...(fileAuthoritySubjectId
@@ -10,11 +10,13 @@ import {
10
10
  automaticSessionTitleFanoutDue,
11
11
  browserDeadlineCheckpointDue,
12
12
  knowledgeIndexDue,
13
+ maintainSubscriptionPlans,
13
14
  sandboxIdleCheckpointDue,
14
15
  sandboxLeaseReaperDue,
15
16
  sandboxMaintenanceDue,
16
17
  sessionWorkflowWakesDue,
17
18
  siteAuthMaintenanceDue,
19
+ subscriptionPlanMaintenanceDue,
18
20
  workspacePauseTimerDue,
19
21
  type Database,
20
22
  } from "@opengeni/db";
@@ -53,6 +55,8 @@ export const SITE_AUTH_MAINTENANCE_WORKFLOW_ID = "opengeni-site-auth-maintenance
53
55
  export const SITE_AUTH_MAINTENANCE_PERIOD_MS = 60 * 1_000;
54
56
  /** The Schedule earlier releases used to drive the sandbox lease reaper. */
55
57
  export const SANDBOX_REAPER_SCHEDULE_ID = "opengeni-sandbox-lease-reaper";
58
+ /** Small bounded DB-only pass; no Temporal execution for plan maintenance. */
59
+ export const SUBSCRIPTION_PLAN_MAINTENANCE_PERIOD_MS = 60_000;
56
60
 
57
61
  export const INTERNAL_MAINTENANCE_JOBS = [
58
62
  "session-workflow-wake-dispatcher",
@@ -61,6 +65,7 @@ export const INTERNAL_MAINTENANCE_JOBS = [
61
65
  "sandbox-lease-reaper",
62
66
  "sandbox-idle-checkpoint",
63
67
  "browser-deadline-checkpoint",
68
+ "subscription-plan-maintenance",
64
69
  ] as const;
65
70
  export type InternalMaintenanceJob = (typeof INTERNAL_MAINTENANCE_JOBS)[number];
66
71
 
@@ -139,6 +144,25 @@ export async function internalMaintenanceCadences(input: {
139
144
  const jobs = new Set(input.jobs ?? INTERNAL_MAINTENANCE_JOBS);
140
145
  const taskQueue = settings.temporalTaskQueue;
141
146
  const cadences: MaintenanceCadence[] = [];
147
+ if (settings.subscriptionPlansEnabled && jobs.has("subscription-plan-maintenance")) {
148
+ cadences.push({
149
+ job: "subscription-plan-maintenance",
150
+ periodMs: SUBSCRIPTION_PLAN_MAINTENANCE_PERIOD_MS,
151
+ hasWork: async () => await subscriptionPlanMaintenanceDue(db),
152
+ start: async () => {
153
+ const result = await maintainSubscriptionPlans(db, {
154
+ onError: (error, accountId) =>
155
+ observability.warn("Subscription plan maintenance account failed", {
156
+ accountId,
157
+ error: error instanceof Error ? error.message : String(error),
158
+ }),
159
+ });
160
+ if (result.failedAccounts > 0)
161
+ throw new Error(`${result.failedAccounts} subscription plan maintenance accounts failed`);
162
+ return "started";
163
+ },
164
+ });
165
+ }
142
166
  if (jobs.has("session-workflow-wake-dispatcher")) {
143
167
  const { repairMissedSessionWorkflowWakes } = await import("./activities/parent-wake");
144
168
  cadences.push({
@@ -1542,6 +1542,7 @@ export type SelfhostedTurnSessionArgs = {
1542
1542
  operationCpuQuotaSupported: boolean;
1543
1543
  /** Feature advertisement only; refreshed by exact live admission for each operation. */
1544
1544
  transactionalFsWriteSupported?: boolean;
1545
+ browserControlHttpSupported?: boolean;
1545
1546
  /** The active pointer's epoch — the control-op fence echoed to the agent. */
1546
1547
  epoch: number;
1547
1548
  /** The run's declared sandbox environment (the SAME object fed to buildAgent +
@@ -1618,6 +1619,7 @@ export function connectionBindingFor(
1618
1619
  operationResourcePolicySupported: enrollment.agentCapabilities.operationResourcePolicy === true,
1619
1620
  operationCpuQuotaSupported: enrollment.agentCapabilities.operationCpuQuota === true,
1620
1621
  transactionalFsWriteSupported: enrollment.agentCapabilities.transactionalFsWrite === true,
1622
+ browserControlHttpSupported: enrollment.agentCapabilities.browserControlHttp === true,
1621
1623
  };
1622
1624
  }
1623
1625
 
@@ -1693,6 +1695,7 @@ export async function establishSelfhostedTurnSession(
1693
1695
  operationResourcePolicySupported: args.operationResourcePolicySupported,
1694
1696
  operationCpuQuotaSupported: args.operationCpuQuotaSupported,
1695
1697
  transactionalFsWriteSupported: args.transactionalFsWriteSupported === true,
1698
+ browserControlHttpSupported: args.browserControlHttpSupported === true,
1696
1699
  resolveOperationAdmission: async () => {
1697
1700
  // The machine's audience can change in place during a turn. Read the
1698
1701
  // current scope on every admitted operation: a machine that is Only me now