@opengeni/worker-bundle 1.0.0-canary.1 → 1.0.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/activities/agent-run-admission.d.ts +3 -1
- package/dist/activities/agent-turn/admission.d.ts +24 -3
- package/dist/activities/agent-turn/agent-build.d.ts +4 -0
- package/dist/activities/agent-turn/claude-usage-observer.d.ts +58 -0
- package/dist/activities/agent-turn/code-search.d.ts +60 -0
- package/dist/activities/agent-turn/codex-capacity.d.ts +13 -0
- package/dist/activities/agent-turn/codex-plan-entitlement.d.ts +105 -0
- package/dist/activities/agent-turn/codex.d.ts +3 -2
- package/dist/activities/agent-turn/compaction-prep.d.ts +21 -5
- package/dist/activities/agent-turn/credential-leases.d.ts +19 -33
- package/dist/activities/agent-turn/credential-restriction.d.ts +3 -0
- package/dist/activities/agent-turn/errors.d.ts +82 -11
- package/dist/activities/agent-turn/failure-settlement.d.ts +6 -3
- package/dist/activities/agent-turn/final-reply.d.ts +18 -0
- package/dist/activities/agent-turn/finalization-monitor.d.ts +17 -0
- package/dist/activities/agent-turn/finalization.d.ts +4 -2
- package/dist/activities/agent-turn/github-repository-bindings.d.ts +2 -0
- package/dist/activities/agent-turn/governance-model.d.ts +9 -2
- package/dist/activities/agent-turn/history-sink.d.ts +2 -0
- package/dist/activities/agent-turn/history.d.ts +2 -0
- package/dist/activities/agent-turn/input-wait-reply.d.ts +41 -0
- package/dist/activities/agent-turn/media-artifacts.d.ts +5 -3
- package/dist/activities/agent-turn/model-call-admission.d.ts +15 -0
- package/dist/activities/agent-turn/model-usage.d.ts +6 -0
- package/dist/activities/agent-turn/model-wire-dispatch.d.ts +15 -0
- package/dist/activities/agent-turn/optional-repositories.d.ts +59 -0
- package/dist/activities/agent-turn/provider-dispatch-barrier.d.ts +12 -1
- package/dist/activities/agent-turn/quiescence.d.ts +7 -7
- package/dist/activities/agent-turn/recovery-warning.d.ts +9 -0
- package/dist/activities/agent-turn/refresh-credentials.d.ts +6 -0
- package/dist/activities/agent-turn/run-credentials.d.ts +8 -3
- package/dist/activities/agent-turn/sandbox-establish.d.ts +2 -1
- package/dist/activities/agent-turn/sandbox-provision.d.ts +3 -1
- package/dist/activities/agent-turn/sandbox-route.d.ts +3 -20
- package/dist/activities/agent-turn/sandbox-runtime.d.ts +2 -2
- package/dist/activities/agent-turn/session-title.d.ts +34 -2
- package/dist/activities/agent-turn/skill-checkout.d.ts +25 -6
- package/dist/activities/agent-turn/skill-read.d.ts +70 -2
- package/dist/activities/agent-turn/skill-remove.d.ts +14 -0
- package/dist/activities/agent-turn/skill-search.d.ts +3 -1
- package/dist/activities/agent-turn/skill-tools.d.ts +15 -2
- package/dist/activities/agent-turn/skill-transfer.d.ts +18 -6
- package/dist/activities/agent-turn/stream-attempt.d.ts +7 -3
- package/dist/activities/agent-turn/subscription-lease.d.ts +38 -0
- package/dist/activities/agent-turn/tool-environment.d.ts +56 -6
- package/dist/activities/agent-turn/tool-policy.d.ts +43 -0
- package/dist/activities/agent-turn/turn-context.d.ts +29 -0
- package/dist/activities/agent-turn/turn-sandbox-access.d.ts +3 -0
- package/dist/activities/agent-turn/xai-capacity.d.ts +2 -1
- package/dist/activities/automations.d.ts +3 -1
- package/dist/activities/browser-deadline-checkpoint.d.ts +29 -0
- package/dist/activities/codemode-dispatcher.d.ts +9 -2
- package/dist/activities/codex-capacity.d.ts +18 -2
- package/dist/activities/codex-rotation.d.ts +7 -1
- package/dist/activities/context-compaction.d.ts +16 -2
- package/dist/activities/gmail-files.d.ts +32 -0
- package/dist/activities/goals.d.ts +8 -0
- package/dist/activities/knowledge-indexing.d.ts +19 -0
- package/dist/activities/mcp-account-routes.d.ts +3 -0
- package/dist/activities/mcp-credentials.d.ts +12 -13
- package/dist/activities/mcp-operation-authority.d.ts +0 -5
- package/dist/activities/model-call-fact-reconciler.d.ts +34 -0
- package/dist/activities/open-suffix-resume.d.ts +13 -0
- package/dist/activities/parent-wake.d.ts +6 -12
- package/dist/activities/retained-screenshots.d.ts +7 -2
- package/dist/activities/rig-verification.d.ts +2 -3
- package/dist/activities/run-credential-renewal.d.ts +1 -0
- package/dist/activities/run-credentials.d.ts +15 -3
- package/dist/activities/sandbox-images.d.ts +1 -1
- package/dist/activities/sandbox-lease.d.ts +47 -9
- package/dist/activities/scheduled-tasks.d.ts +4 -35
- package/dist/activities/session-state.d.ts +70 -3
- package/dist/activities/types.d.ts +55 -6
- package/dist/activities/workspace-capture.d.ts +2 -0
- package/dist/activities/workspace-credential-provider.d.ts +46 -0
- package/dist/{activities-control-HMFGSKC5.js → activities-control-BNPTRTOE.js} +1896 -418
- package/dist/activities-control-BNPTRTOE.js.map +1 -0
- package/dist/activities-control.d.ts +182 -4
- package/dist/{activities-turn-AP67JADS.js → activities-turn-5LGZOSVU.js} +4476 -1327
- package/dist/activities-turn-5LGZOSVU.js.map +1 -0
- package/dist/activities.d.ts +182 -4
- package/dist/artifact-materializer-entry.js +5 -2
- package/dist/artifact-materializer-entry.js.map +1 -1
- package/dist/artifact-outbox-entry.js +5 -2
- package/dist/artifact-outbox-entry.js.map +1 -1
- package/dist/browser-deadline-checkpoint-contract.d.ts +2 -0
- package/dist/{chunk-A4XQWVZK.js → chunk-3ZTRWDMN.js} +307 -4
- package/dist/chunk-3ZTRWDMN.js.map +1 -0
- package/dist/{chunk-RAMNYSAW.js → chunk-4ER3YXOT.js} +22 -4
- package/dist/chunk-4ER3YXOT.js.map +1 -0
- package/dist/{chunk-CYITU5UH.js → chunk-LJX7Z2KP.js} +1445 -343
- package/dist/chunk-LJX7Z2KP.js.map +1 -0
- package/dist/editable-artifact-materializer-service.d.ts +2 -2
- package/dist/editable-artifact-outbox-service.d.ts +2 -2
- package/dist/host-export-pump.d.ts +3 -1
- package/dist/host-export.d.ts +1 -1
- package/dist/host-export.js +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +95 -3
- package/dist/index.js +137 -43
- package/dist/index.js.map +1 -1
- package/dist/observability-metrics.d.ts +118 -8
- package/dist/retained-process-diagnostics.d.ts +4 -0
- package/dist/retained-process-retry.d.ts +7 -0
- package/dist/sandbox-resume.d.ts +55 -13
- package/dist/sandbox-routing.d.ts +5 -3
- package/dist/sandbox-snapshot-diagnostics.d.ts +20 -0
- package/dist/session-event-fanout.d.ts +6 -0
- package/dist/warm-capture-holder.d.ts +3 -0
- package/dist/worker-service-lifecycle.d.ts +12 -0
- package/dist/workflow-bundle.js +273 -41
- package/dist/workflows/activities.d.ts +1 -1
- package/dist/workflows/browser-deadline-checkpoint.d.ts +9 -0
- package/dist/workflows/scheduled-tasks.d.ts +4 -0
- package/dist/workflows/session.d.ts +36 -0
- package/dist/workflows.d.ts +1 -0
- package/package.json +21 -19
- package/src/activities/agent-run-admission.ts +17 -1
- package/src/activities/agent-turn/admission.ts +66 -3
- package/src/activities/agent-turn/agent-build.ts +84 -10
- package/src/activities/agent-turn/claim.ts +186 -43
- package/src/activities/agent-turn/claude-usage-observer.ts +221 -0
- package/src/activities/agent-turn/code-search.ts +275 -0
- package/src/activities/agent-turn/codex-capacity.ts +172 -8
- package/src/activities/agent-turn/codex-plan-entitlement.ts +254 -0
- package/src/activities/agent-turn/codex.ts +13 -5
- package/src/activities/agent-turn/compaction-prep.ts +170 -102
- package/src/activities/agent-turn/credential-leases.ts +122 -216
- package/src/activities/agent-turn/credential-restriction.ts +14 -0
- package/src/activities/agent-turn/errors.ts +647 -48
- package/src/activities/agent-turn/failure-settlement.ts +682 -130
- package/src/activities/agent-turn/final-reply.ts +46 -0
- package/src/activities/agent-turn/finalization-monitor.ts +120 -0
- package/src/activities/agent-turn/finalization.ts +146 -43
- package/src/activities/agent-turn/github-repository-bindings.ts +3 -1
- package/src/activities/agent-turn/governance-model.ts +69 -28
- package/src/activities/agent-turn/history-sink.ts +16 -2
- package/src/activities/agent-turn/history.ts +38 -11
- package/src/activities/agent-turn/input-wait-reply.ts +103 -0
- package/src/activities/agent-turn/knowledge-source-tools.ts +2 -0
- package/src/activities/agent-turn/media-artifacts.ts +2 -1
- package/src/activities/agent-turn/model-call-admission.ts +94 -0
- package/src/activities/agent-turn/model-usage.ts +64 -3
- package/src/activities/agent-turn/model-wire-dispatch.ts +27 -0
- package/src/activities/agent-turn/optional-repositories.ts +224 -0
- package/src/activities/agent-turn/provider-dispatch-barrier.ts +22 -0
- package/src/activities/agent-turn/quiescence.ts +10 -7
- package/src/activities/agent-turn/recovery-warning.ts +16 -0
- package/src/activities/agent-turn/refresh-credentials.ts +44 -0
- package/src/activities/agent-turn/run-credentials.ts +116 -55
- package/src/activities/agent-turn/run.ts +320 -93
- package/src/activities/agent-turn/sandbox-establish.ts +84 -8
- package/src/activities/agent-turn/sandbox-provision.ts +3 -1
- package/src/activities/agent-turn/sandbox-route.ts +4 -21
- package/src/activities/agent-turn/sandbox-runtime.ts +343 -18
- package/src/activities/agent-turn/session-title.ts +81 -5
- package/src/activities/agent-turn/skill-checkout.ts +111 -24
- package/src/activities/agent-turn/skill-install.ts +1 -1
- package/src/activities/agent-turn/skill-read.ts +374 -28
- package/src/activities/agent-turn/skill-remove.ts +46 -0
- package/src/activities/agent-turn/skill-save.ts +1 -1
- package/src/activities/agent-turn/skill-search.ts +10 -1
- package/src/activities/agent-turn/skill-selection.ts +4 -0
- package/src/activities/agent-turn/skill-tools.ts +112 -18
- package/src/activities/agent-turn/skill-transfer.ts +68 -23
- package/src/activities/agent-turn/stream-attempt.ts +313 -77
- package/src/activities/agent-turn/subscription-lease.ts +115 -0
- package/src/activities/agent-turn/tool-environment.ts +316 -167
- package/src/activities/agent-turn/tool-policy.ts +80 -1
- package/src/activities/agent-turn/turn-context.ts +35 -0
- package/src/activities/agent-turn/turn-sandbox-access.ts +7 -1
- package/src/activities/agent-turn/xai-capacity.ts +94 -51
- package/src/activities/automations.ts +76 -4
- package/src/activities/browser-deadline-checkpoint.ts +279 -0
- package/src/activities/capabilities.ts +108 -11
- package/src/activities/codemode-dispatcher.ts +36 -8
- package/src/activities/codex-capacity.ts +60 -25
- package/src/activities/codex-rotation.ts +39 -17
- package/src/activities/context-compaction.ts +75 -18
- package/src/activities/gmail-files.ts +88 -0
- package/src/activities/goals.ts +116 -121
- package/src/activities/google-drive-publication.ts +1 -3
- package/src/activities/image-generation-operation.ts +1 -1
- package/src/activities/knowledge-indexing.ts +269 -15
- package/src/activities/knowledge-source-sync.ts +10 -0
- package/src/activities/mcp-account-routes.ts +17 -0
- package/src/activities/mcp-credentials.ts +83 -194
- package/src/activities/mcp-operation-authority.ts +16 -41
- package/src/activities/model-call-fact-reconciler.ts +112 -0
- package/src/activities/open-suffix-resume.ts +15 -2
- package/src/activities/parent-wake.ts +46 -21
- package/src/activities/retained-screenshots.ts +82 -11
- package/src/activities/rig-verification.ts +38 -37
- package/src/activities/run-credential-renewal.ts +13 -1
- package/src/activities/run-credentials.ts +59 -17
- package/src/activities/run-input.ts +25 -16
- package/src/activities/sandbox-images.ts +0 -1
- package/src/activities/sandbox-lease.ts +798 -82
- package/src/activities/scheduled-tasks.ts +550 -178
- package/src/activities/session-state.ts +245 -6
- package/src/activities/site-auth-maintenance.ts +3 -0
- package/src/activities/types.ts +72 -5
- package/src/activities/workflow-wake.ts +2 -17
- package/src/activities/workspace-capture.ts +13 -2
- package/src/activities/workspace-credential-provider.ts +283 -0
- package/src/activities-control.ts +4 -0
- package/src/activities-turn.ts +5 -0
- package/src/activities.ts +13 -0
- package/src/activity-services.ts +16 -4
- package/src/browser-deadline-checkpoint-contract.ts +5 -0
- package/src/editable-artifact-hint-broker.ts +3 -0
- package/src/editable-artifact-materializer-service.ts +7 -3
- package/src/editable-artifact-outbox-service.ts +4 -4
- package/src/github-rest-mcp.ts +1 -2
- package/src/host-export-pump.ts +26 -4
- package/src/host-export.ts +3 -0
- package/src/http.ts +4 -2
- package/src/index.ts +99 -37
- package/src/observability-metrics.ts +510 -5
- package/src/personal-github-git-credentials.ts +2 -1
- package/src/pr-review-credentials.ts +1 -3
- package/src/retained-process-diagnostics.ts +50 -0
- package/src/retained-process-retry.ts +36 -0
- package/src/sandbox-resume.ts +388 -101
- package/src/sandbox-routing.ts +150 -25
- package/src/sandbox-snapshot-diagnostics.ts +112 -0
- package/src/session-event-fanout.ts +23 -0
- package/src/warm-capture-holder.ts +15 -0
- package/src/worker-service-lifecycle.ts +53 -0
- package/src/workflows/activities.ts +16 -1
- package/src/workflows/browser-deadline-checkpoint.ts +50 -0
- package/src/workflows/file-upload-reaper.ts +2 -0
- package/src/workflows/scheduled-tasks.ts +26 -13
- package/src/workflows/session.ts +242 -22
- package/src/workflows.ts +4 -0
- package/dist/activities/agent-turn/knowledge-sources.d.ts +0 -20
- package/dist/activities/packs.d.ts +0 -55
- package/dist/activities-control-HMFGSKC5.js.map +0 -1
- package/dist/activities-turn-AP67JADS.js.map +0 -1
- package/dist/chunk-A4XQWVZK.js.map +0 -1
- package/dist/chunk-CYITU5UH.js.map +0 -1
- package/dist/chunk-RAMNYSAW.js.map +0 -1
- package/src/activities/agent-turn/knowledge-sources.ts +0 -86
- package/src/activities/packs.ts +0 -166
|
@@ -7,6 +7,9 @@ export type ResolvedTurnSandboxAccess = Readonly<{
|
|
|
7
7
|
session: ChannelASession;
|
|
8
8
|
leaseEpoch: number;
|
|
9
9
|
}>;
|
|
10
|
+
/** The lazy wrapper remains the agent's owner even after provisioning fills
|
|
11
|
+
* resolvedSandbox with the raw provider handle for capture and release. */
|
|
12
|
+
export declare function ownedTurnSandboxForAgent(sandboxState: TurnSandboxAccessState): import("@opengeni/runtime").EstablishedSandboxSession | undefined;
|
|
10
13
|
/** Join the turn's canonical sandbox boundary and return its active routed session. */
|
|
11
14
|
export declare function resolveTurnSandboxAccess(sandboxState: TurnSandboxAccessState, sdkOwnedSandboxSession: unknown, unavailableMessage: string): Promise<ResolvedTurnSandboxAccess>;
|
|
12
15
|
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { CapacityPhaseDeps, CapacityPhaseOutcome } from "./codex-capacity.js";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const selectXaiTurnCapacity: (deps: CapacityPhaseDeps) => Promise<CapacityPhaseOutcome>;
|
|
3
|
+
export declare const selectClaudeTurnCapacity: (deps: CapacityPhaseDeps) => Promise<CapacityPhaseOutcome>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertWorkspaceModelPolicyAllows, createAndStartSessionWithOutcome, recordWorkspaceUsage } from "@opengeni/core";
|
|
2
|
-
import { assertAutomationRunAuthorityInTransaction, claimAutomationRun, settleAutomationRun } from "@opengeni/db";
|
|
2
|
+
import { assertAutomationRunAuthorityInTransaction, claimAutomationRun, settleAutomationRun, requireWorkspace } from "@opengeni/db";
|
|
3
3
|
import { agentRunAdmissionDenial } from "./agent-run-admission.js";
|
|
4
4
|
import type { ControlActivityServices, DispatchAutomationRunInput, DispatchAutomationRunResult } from "./types.js";
|
|
5
5
|
export type AutomationActivityOptions = {
|
|
@@ -7,6 +7,8 @@ export type AutomationActivityOptions = {
|
|
|
7
7
|
settle?: typeof settleAutomationRun;
|
|
8
8
|
assertAuthority?: typeof assertAutomationRunAuthorityInTransaction;
|
|
9
9
|
createSession?: typeof createAndStartSessionWithOutcome;
|
|
10
|
+
/** Workspace read for agent-configuration defaults (tests inject it). */
|
|
11
|
+
readWorkspace?: typeof requireWorkspace;
|
|
10
12
|
admit?: typeof agentRunAdmissionDenial;
|
|
11
13
|
assertModelPolicy?: typeof assertWorkspaceModelPolicyAllows;
|
|
12
14
|
recordUsage?: typeof recordWorkspaceUsage;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
import { readLease, type BrowserDeadlineCheckpointTarget } from "@opengeni/db";
|
|
3
|
+
import { BrowserControlClient } from "@opengeni/runtime";
|
|
4
|
+
import type { ControlActivityServices } from "./types.js";
|
|
5
|
+
type CheckpointController = Pick<BrowserControlClient, "captureState" | "endSession">;
|
|
6
|
+
type CheckpointPlacement = {
|
|
7
|
+
target: BrowserDeadlineCheckpointTarget;
|
|
8
|
+
lease: NonNullable<Awaited<ReturnType<typeof readLease>>>;
|
|
9
|
+
settings: Settings;
|
|
10
|
+
controllerRoot: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function createBrowserDeadlineCheckpointActivities(services: () => Promise<ControlActivityServices>, connectController?: (placement: CheckpointPlacement) => Promise<CheckpointController>): {
|
|
13
|
+
listDueBrowserCheckpoints(): Promise<{
|
|
14
|
+
accountId: string;
|
|
15
|
+
workspaceId: string;
|
|
16
|
+
sandboxGroupId: string;
|
|
17
|
+
leaseId: string;
|
|
18
|
+
leaseEpoch: number;
|
|
19
|
+
instanceId: string;
|
|
20
|
+
browserSessionId: string;
|
|
21
|
+
controllerGeneration: string;
|
|
22
|
+
}[]>;
|
|
23
|
+
checkpointBrowserBeforeDeadline(target: BrowserDeadlineCheckpointTarget): Promise<{
|
|
24
|
+
status: "skipped";
|
|
25
|
+
} | {
|
|
26
|
+
status: "suspended";
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type AttemptToolEnvironment } from "@opengeni/codemode";
|
|
1
|
+
import { type AttemptToolCatalogEntry, type AttemptToolEnvironment } from "@opengeni/codemode";
|
|
2
|
+
import { type ToolDisplayMetadata, type ToolFamily } from "@opengeni/contracts";
|
|
2
3
|
import { type Database } from "@opengeni/db";
|
|
3
4
|
import { type EventBus } from "@opengeni/events";
|
|
4
5
|
export type CodemodeDispatcherScope = {
|
|
@@ -25,6 +26,9 @@ export declare class CodemodeAttemptDispatcher {
|
|
|
25
26
|
private readonly scope;
|
|
26
27
|
private readonly turnSignal?;
|
|
27
28
|
private readonly maxConcurrentCalls;
|
|
29
|
+
private readonly toolDisplayMetadata?;
|
|
30
|
+
/** Content-free analytics family for a catalog entry; event enrichment only. */
|
|
31
|
+
private readonly toolFamily?;
|
|
28
32
|
private readonly stopController;
|
|
29
33
|
private readonly inFlight;
|
|
30
34
|
private pendingClaims;
|
|
@@ -32,13 +36,16 @@ export declare class CodemodeAttemptDispatcher {
|
|
|
32
36
|
private closing;
|
|
33
37
|
private readonly claimLeaseMs;
|
|
34
38
|
private readonly claimHeartbeatMs;
|
|
35
|
-
constructor(db: Database, bus: EventBus, environment: AttemptToolEnvironment, scope: CodemodeDispatcherScope, turnSignal?: AbortSignal | undefined, maxConcurrentCalls?: number, timings?: CodemodeDispatcherTimings)
|
|
39
|
+
constructor(db: Database, bus: EventBus, environment: AttemptToolEnvironment, scope: CodemodeDispatcherScope, turnSignal?: AbortSignal | undefined, maxConcurrentCalls?: number, timings?: CodemodeDispatcherTimings, toolDisplayMetadata?: ((modelName: string) => ToolDisplayMetadata | undefined) | undefined,
|
|
40
|
+
/** Content-free analytics family for a catalog entry; event enrichment only. */
|
|
41
|
+
toolFamily?: ((entry: AttemptToolCatalogEntry) => ToolFamily | null) | undefined);
|
|
36
42
|
start(): void;
|
|
37
43
|
close(reason?: string): Promise<void>;
|
|
38
44
|
private execute;
|
|
39
45
|
private executeClaimed;
|
|
40
46
|
private ensureToolCallCreated;
|
|
41
47
|
private settleWithOutput;
|
|
48
|
+
private persistSettlement;
|
|
42
49
|
private failBeforeExecution;
|
|
43
50
|
}
|
|
44
51
|
export declare function codemodeToolCallCreatedClientEventId(operationId: string): string;
|
|
@@ -17,7 +17,7 @@ export declare function signalCodexCapacityWakeTargets(services: CodexCapacitySi
|
|
|
17
17
|
export declare function signalPendingCodexCapacityWakeTargets(services: CodexCapacitySignalServices & {
|
|
18
18
|
db: ControlActivityServices["db"];
|
|
19
19
|
}, workspaceId: string): Promise<void>;
|
|
20
|
-
export declare function codexCapacityDecision<TPolicyScope = never, TUnavailableDiagnostic = never>(context: CodexCapacitySelectionContext<TPolicyScope, TUnavailableDiagnostic
|
|
20
|
+
export declare function codexCapacityDecision<TPolicyScope = never, TUnavailableDiagnostic = never>(context: CodexCapacitySelectionContext<TPolicyScope, TUnavailableDiagnostic>, now?: Date): ReturnType<Parameters<typeof reconcileCodexCapacityWaitDb>[2]>;
|
|
21
21
|
/**
|
|
22
22
|
* Arm a durable Codex waiter and immediately re-evaluate it under the
|
|
23
23
|
* allocator lock. A capacity mutation that commits just before the waiter is
|
|
@@ -28,6 +28,11 @@ export declare function codexCapacityDecision<TPolicyScope = never, TUnavailable
|
|
|
28
28
|
export declare function armAndReconcileCodexCapacityWait(services: Pick<ControlActivityServices, "db" | "bus">, input: Parameters<typeof armCodexCapacityWait>[1], options?: {
|
|
29
29
|
onArmed?: () => void;
|
|
30
30
|
}): Promise<{
|
|
31
|
+
action: "stopped";
|
|
32
|
+
sessionStatus: "failed" | "queued";
|
|
33
|
+
waiter: import("@opengeni/db").CodexCapacityWait;
|
|
34
|
+
events: import("@opengeni/contracts").SessionEvent[];
|
|
35
|
+
} | {
|
|
31
36
|
action: "stale";
|
|
32
37
|
waiter: import("@opengeni/db").CodexCapacityWait | null;
|
|
33
38
|
events: import("@opengeni/contracts").SessionEvent[];
|
|
@@ -50,7 +55,18 @@ export declare function armAndReconcileCodexCapacityWait(services: Pick<ControlA
|
|
|
50
55
|
}>;
|
|
51
56
|
export declare function createCodexCapacityActivities(services: () => Promise<ControlActivityServices>): {
|
|
52
57
|
getCodexCapacityWait: (input: GetCodexCapacityWaitInput) => Promise<{
|
|
53
|
-
provider
|
|
58
|
+
provider: "xai";
|
|
59
|
+
waiterId: string;
|
|
60
|
+
generation: number;
|
|
61
|
+
nextCheckAt: string;
|
|
62
|
+
wakeRevision: number;
|
|
63
|
+
} | {
|
|
64
|
+
provider: "claude";
|
|
65
|
+
waiterId: string;
|
|
66
|
+
generation: number;
|
|
67
|
+
nextCheckAt: string;
|
|
68
|
+
wakeRevision: number;
|
|
69
|
+
} | {
|
|
54
70
|
waiterId: string;
|
|
55
71
|
generation: number;
|
|
56
72
|
nextCheckAt: string;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { CodexAccountStatus, CodexCredentialLeaseSelectionContext, CodexLeaseAccountStatus, CodexPinSource } from "@opengeni/db";
|
|
2
2
|
export type CodexRotationAccount = CodexAccountStatus | CodexLeaseAccountStatus;
|
|
3
|
+
/**
|
|
4
|
+
* Model-scoped allocation filter: user connection policy plus proven plan
|
|
5
|
+
* entitlement. A plan exclusion applies only until it expires (one request
|
|
6
|
+
* then re-probes the account) or a different plan is observed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function codexAccountServesModel(account: Pick<CodexRotationAccount, "allowedModelIds" | "planType" | "planEntitlementExclusion">, modelId: string, now: Date): boolean;
|
|
3
9
|
/** Capacity metadata worth an authoritative live read before/all through an idle. */
|
|
4
|
-
export declare function codexAccountNeedsLiveCapacityRefresh(account: Pick<CodexAccountStatus, "primaryUsedPercent" | "secondaryUsedPercent" | "exhaustedUntil" | "exhaustedKind">,
|
|
10
|
+
export declare function codexAccountNeedsLiveCapacityRefresh(account: Pick<CodexAccountStatus, "primaryUsedPercent" | "secondaryUsedPercent" | "exhaustedUntil" | "exhaustedKind">, _now: Date): boolean;
|
|
5
11
|
export type CodexRotationStrategy = "most_remaining" | "round_robin" | "drain_then_next" | "sharded";
|
|
6
12
|
/**
|
|
7
13
|
* The ONE strategy rotation-enabled workspaces run: sticky-sharded. The legacy
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Database } from "@opengeni/db";
|
|
2
|
-
import { type CompactionItem } from "@opengeni/runtime";
|
|
2
|
+
import { prepareCompactionPromptInput, type CompactionItem, type CompactionProviderRejection } from "@opengeni/runtime";
|
|
3
3
|
import { type Settings } from "@opengeni/config";
|
|
4
4
|
import type { SessionEvent } from "@opengeni/contracts";
|
|
5
5
|
export type MaybeCompactResult = {
|
|
@@ -28,7 +28,10 @@ export type MaybeCompactResult = {
|
|
|
28
28
|
* Codex, call Codex `/codex/responses` with `compaction_trigger` and persist the
|
|
29
29
|
* opaque compaction item. Fail closed — never silently fall back to portable.
|
|
30
30
|
*/
|
|
31
|
-
export type CompactionSummarizer = (settings: Settings, input: CompactionItem[]) => Promise<string
|
|
31
|
+
export type CompactionSummarizer = ((settings: Settings, input: CompactionItem[]) => Promise<string>) & {
|
|
32
|
+
/** Model-visible instructions and tool schemas outside the history estimate. */
|
|
33
|
+
estimatePrefixTokens?: () => number;
|
|
34
|
+
};
|
|
32
35
|
/** Returns the opaque Codex remote compaction v2 item. */
|
|
33
36
|
export type RemoteCompactionV2Requester = (settings: Settings, input: CompactionItem[]) => Promise<CompactionItem>;
|
|
34
37
|
export declare function maybeCompactContext(db: Database, settings: Settings, scope: {
|
|
@@ -77,8 +80,19 @@ export declare function settleFailedContextCompactionLandmark(db: Database, scop
|
|
|
77
80
|
}, options?: {
|
|
78
81
|
clearRequestedCompaction?: boolean;
|
|
79
82
|
publishLiveEvents?: (events: SessionEvent[]) => Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Closed identifier record of a definitive provider rejection. Carried on
|
|
85
|
+
* the visible `compaction.skipped` landmark so the timeline can name the
|
|
86
|
+
* rejected field instead of offering a retry that cannot succeed.
|
|
87
|
+
*/
|
|
88
|
+
providerRejection?: CompactionProviderRejection | null;
|
|
80
89
|
}): Promise<Extract<MaybeCompactResult, {
|
|
81
90
|
compacted: false;
|
|
82
91
|
}>>;
|
|
92
|
+
export declare function summarizeWithCodexOverflowTrimming(summarize: CompactionSummarizer, settings: Settings, activeHistory: CompactionItem[]): Promise<{
|
|
93
|
+
summaryBody: string;
|
|
94
|
+
preparation: ReturnType<typeof prepareCompactionPromptInput>;
|
|
95
|
+
providerCalls: number;
|
|
96
|
+
}>;
|
|
83
97
|
export declare function isContextWindowExceeded(error: unknown, seen?: WeakSet<object>): boolean;
|
|
84
98
|
export declare function isExactContextLengthExceeded(error: unknown, seen?: WeakSet<object>): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ObjectStorage } from "@opengeni/storage";
|
|
2
|
+
import type { GmailFileMaterializationRequest } from "@opengeni/runtime/gmail-rest-mcp";
|
|
3
|
+
import type { ConnectorAttachmentMaterializer } from "@opengeni/runtime";
|
|
4
|
+
import type { SandboxChannelAService } from "@opengeni/runtime/sandbox";
|
|
5
|
+
/** Use the selected filesystem namespace, retaining descriptor confinement and
|
|
6
|
+
* one extra byte to distinguish a complete exact-limit input from truncation. */
|
|
7
|
+
export declare function readGmailFileFromChannel(channel: Pick<SandboxChannelAService, "fsRead">, request: {
|
|
8
|
+
path: string;
|
|
9
|
+
maxBytes: number;
|
|
10
|
+
}): Promise<Uint8Array>;
|
|
11
|
+
/** Gmail returns base64url JSON, while the exact filesystem importer consumes
|
|
12
|
+
* byte streams. Stage only inside the worker; no URL or bytes reach a tool result. */
|
|
13
|
+
export declare function materializeGmailFile(request: GmailFileMaterializationRequest, options: {
|
|
14
|
+
workspaceId: string;
|
|
15
|
+
storage: ObjectStorage;
|
|
16
|
+
downloadStorage: ObjectStorage;
|
|
17
|
+
materialize: ConnectorAttachmentMaterializer;
|
|
18
|
+
onCleanupFailure?: (key: string) => void;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
attachments: {
|
|
21
|
+
providerAttachmentId: {
|
|
22
|
+
provider: string;
|
|
23
|
+
kind: "attachment";
|
|
24
|
+
value: string;
|
|
25
|
+
};
|
|
26
|
+
fileName: string;
|
|
27
|
+
mediaType: string;
|
|
28
|
+
byteSize: number;
|
|
29
|
+
contentSha256: string;
|
|
30
|
+
sandboxPath: string;
|
|
31
|
+
}[];
|
|
32
|
+
}>;
|
|
@@ -2,6 +2,7 @@ import { type Settings } from "@opengeni/config";
|
|
|
2
2
|
import { type SessionGoal, type ToolRef } from "@opengeni/contracts";
|
|
3
3
|
import { getWorkspaceModelPolicy } from "@opengeni/db";
|
|
4
4
|
import type { ControlActivityServices, MaybeContinueGoalInput, MaybeContinueGoalResult } from "./types.js";
|
|
5
|
+
import { agentRunAdmissionDenial } from "./agent-run-admission.js";
|
|
5
6
|
export declare function createGoalActivities(services: () => Promise<ControlActivityServices>): {
|
|
6
7
|
enqueueGoalRetryWake: (input: MaybeContinueGoalInput) => Promise<void>;
|
|
7
8
|
maybeContinueGoal: (input: MaybeContinueGoalInput) => Promise<MaybeContinueGoalResult>;
|
|
@@ -27,3 +28,10 @@ export declare function goalContinuationPrompt(_goal: SessionGoal, _autoContinua
|
|
|
27
28
|
* lists anywhere else in the pipeline. No-op when the server is not configured.
|
|
28
29
|
*/
|
|
29
30
|
export declare function withFirstPartyTools(settings: Settings, tools: ToolRef[]): ToolRef[];
|
|
31
|
+
/**
|
|
32
|
+
* Goals share scheduled admission and pause visibly without synthesizing work.
|
|
33
|
+
*/
|
|
34
|
+
export declare function goalRunBudgetBlocked(services: Parameters<typeof agentRunAdmissionDenial>[0], input: Omit<Parameters<typeof agentRunAdmissionDenial>[1], "requestedAgentRuns">): Promise<{
|
|
35
|
+
pausedReason: "limits" | "allowance";
|
|
36
|
+
message: string;
|
|
37
|
+
} | null>;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { DocumentServices } from "@opengeni/documents";
|
|
2
2
|
import type { ControlActivityServices } from "./types.js";
|
|
3
|
+
/** The configured monthly indexed-chunk limit, not a provider failure. */
|
|
4
|
+
export declare class KnowledgeIndexUsageLimitError extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export type KnowledgeIndexFailureStage = "embedding" | "processing";
|
|
8
|
+
/**
|
|
9
|
+
* Content-free classification for a deferred Knowledge index batch. Only
|
|
10
|
+
* protocol constants, an HTTP status, and a PostgreSQL SQLSTATE are retained;
|
|
11
|
+
* provider messages, bodies, SQL, and identifiers never leave the process.
|
|
12
|
+
* Outside the embedding call, only a PostgreSQL error in the cause chain is
|
|
13
|
+
* attributed to the database; any other failure stays a worker failure.
|
|
14
|
+
*/
|
|
15
|
+
export declare function knowledgeIndexFailureDiagnostic(stage: KnowledgeIndexFailureStage, error: unknown): {
|
|
16
|
+
errorClass: "KnowledgeIndexOperationError";
|
|
17
|
+
errorCode: "knowledge_index_usage_limit_reached" | "knowledge_index_embedding_failed" | "knowledge_index_persistence_failed" | "knowledge_index_failed";
|
|
18
|
+
origin: "worker" | "db";
|
|
19
|
+
status?: number;
|
|
20
|
+
sqlState?: string;
|
|
21
|
+
};
|
|
3
22
|
export declare function createKnowledgeIndexingActivities(services: () => Promise<ControlActivityServices>, resolveDocumentServices?: () => Promise<DocumentServices>): {
|
|
4
23
|
indexKnowledge: () => Promise<{
|
|
5
24
|
completed: number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { McpConnectionAccountBinding, ToolAuthNeededPayload } from "@opengeni/contracts";
|
|
2
|
+
export declare function accountRouteAuthNeededPayload(payload: ToolAuthNeededPayload, bindings: readonly McpConnectionAccountBinding[] | null | undefined): ToolAuthNeededPayload;
|
|
3
|
+
export { expandMcpAccountRoutes, expandApiIntegrationAccountRoutes } from "@opengeni/core";
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import type { Settings } from "@opengeni/config";
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
import { type Observability } from "@opengeni/observability";
|
|
5
|
-
export declare function connectionTokenResolverForTurn(input: {
|
|
2
|
+
import { resolveAcceptedConnectionUse, type Database, type ResolveConnectionCredentialInput, type ResolveConnectionCredentialResult, type SessionTurnForExecution } from "@opengeni/db";
|
|
3
|
+
type TurnConnectionInput = {
|
|
6
4
|
db: Database;
|
|
7
5
|
settings: Settings;
|
|
8
|
-
connectionCredentials?: ConnectionCredentialsPort | null;
|
|
9
6
|
accountId: string;
|
|
10
7
|
workspaceId: string;
|
|
11
8
|
sessionId: string;
|
|
12
|
-
rootSessionId: string;
|
|
13
9
|
attemptId: string;
|
|
14
10
|
turn: SessionTurnForExecution;
|
|
11
|
+
/** Policy identities before account expansion; never used to select credentials. */
|
|
12
|
+
canonicalMcpServerIds?: readonly string[];
|
|
15
13
|
authorizeAcceptedUse?: typeof resolveAcceptedConnectionUse;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
};
|
|
15
|
+
type CredentialResolver = (request: ResolveConnectionCredentialInput) => Promise<ResolveConnectionCredentialResult>;
|
|
16
|
+
export declare function connectionTokenResolverForTurn(input: TurnConnectionInput): CredentialResolver;
|
|
17
|
+
/** Bind the ordinary credential resolver to one immutable accepted turn.
|
|
18
|
+
* Credential acquisition and refresh stay inside the native connection engine;
|
|
19
|
+
* this layer adds the exact execution context and physical-request checks. */
|
|
20
|
+
export declare function bindNativeConnectionCredentialsToTurn(input: TurnConnectionInput, nativeResolver: CredentialResolver): CredentialResolver;
|
|
21
|
+
export {};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import type { ConnectionUseAttribution } from "@opengeni/contracts/connection-authority";
|
|
2
|
-
import type { HostMcpAcceptedAuthority } from "@opengeni/contracts/host-mcp-bindings";
|
|
3
2
|
import type { ResolveConnectionCredentialInput } from "@opengeni/db";
|
|
4
3
|
/** Metadata only. Callers must obtain authority from a current live fence.
|
|
5
4
|
* This equality key is never authorization and never replaces physical-use checks. */
|
|
6
5
|
export declare function mcpOperationAuthorityDigest(request: ResolveConnectionCredentialInput, authority: {
|
|
7
6
|
native: ConnectionUseAttribution;
|
|
8
|
-
host?: never;
|
|
9
7
|
principal?: {
|
|
10
8
|
kind: string;
|
|
11
9
|
subjectId?: string;
|
|
12
10
|
};
|
|
13
|
-
} | {
|
|
14
|
-
host: HostMcpAcceptedAuthority;
|
|
15
|
-
native?: never;
|
|
16
11
|
}): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { listWorkspaceIdsAfter, reconcileModelCallFacts } from "@opengeni/db";
|
|
2
|
+
import type { ControlActivityServices } from "./types.js";
|
|
3
|
+
/** Recent charged calls are rechecked on every run; older gaps use the backfill script. */
|
|
4
|
+
export declare const MODEL_CALL_FACT_RECONCILE_LOOKBACK_MS: number;
|
|
5
|
+
/** Skip the newest calls so a live fact write is not raced by its own repair. */
|
|
6
|
+
export declare const MODEL_CALL_FACT_RECONCILE_SETTLE_MS: number;
|
|
7
|
+
export declare const MODEL_CALL_FACT_RECONCILE_WORKSPACE_LIMIT = 500;
|
|
8
|
+
export declare const MODEL_CALL_FACT_RECONCILE_RUN_BUDGET_MS: number;
|
|
9
|
+
export type ReconcileRecentModelCallFactsResult = {
|
|
10
|
+
workspaces: number;
|
|
11
|
+
missing: number;
|
|
12
|
+
repaired: number;
|
|
13
|
+
unrepaired: number;
|
|
14
|
+
/** Workspaces with more missing facts than one bounded pass examines. */
|
|
15
|
+
truncatedWorkspaces: number;
|
|
16
|
+
failedWorkspaces: number;
|
|
17
|
+
budgetExhausted: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type ModelCallFactReconcilerOptions = {
|
|
20
|
+
now?: () => number;
|
|
21
|
+
runBudgetMs?: number;
|
|
22
|
+
startAfterWorkspaceId?: () => string;
|
|
23
|
+
reconcile?: typeof reconcileModelCallFacts;
|
|
24
|
+
listWorkspaces?: typeof listWorkspaceIdsAfter;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Rebuild missing Insights call facts for recently charged model calls. Each
|
|
28
|
+
* workspace pass is bounded and idempotent, one failure never stops the rest,
|
|
29
|
+
* and each run starts at a random workspace so a run that exhausts its budget
|
|
30
|
+
* does not starve the same tail of workspaces every time.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createModelCallFactReconcilerActivities(services: () => Promise<ControlActivityServices>, options?: ModelCallFactReconcilerOptions): {
|
|
33
|
+
reconcileRecentModelCallFacts: () => Promise<ReconcileRecentModelCallFactsResult>;
|
|
34
|
+
};
|
|
@@ -40,6 +40,19 @@ export declare function matchingOpenSuffixCallId(input: {
|
|
|
40
40
|
export declare function resolveOpenSuffixResumeTarget(rows: readonly OpenSuffixPendingToolCall[], callId: string | null): OpenSuffixPendingToolCall | null;
|
|
41
41
|
/** True when the paired call and result already exist in durable history. */
|
|
42
42
|
export declare function openSuffixPairPresentInHistory(items: readonly Record<string, unknown>[], callId: string): boolean;
|
|
43
|
+
export declare function resultItemForOpenSuffixMember(input: {
|
|
44
|
+
agent: Agent<any, any>;
|
|
45
|
+
row: OpenSuffixPendingToolCall;
|
|
46
|
+
trigger: Pick<SessionEvent, "type" | "payload">;
|
|
47
|
+
humanInputResume: {
|
|
48
|
+
requestId: string;
|
|
49
|
+
toolCallId: string;
|
|
50
|
+
response: HumanInputResponse;
|
|
51
|
+
} | null;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
resultItem: Record<string, unknown>;
|
|
54
|
+
eventOutput: unknown;
|
|
55
|
+
}>;
|
|
43
56
|
export declare function settleOpenSuffixResumeIfNeeded(input: {
|
|
44
57
|
db: Database;
|
|
45
58
|
agent: Agent<any, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Settings } from "@opengeni/config";
|
|
2
2
|
import type { Session, SessionGoal } from "@opengeni/contracts";
|
|
3
|
-
import { claimPendingSessionSystemUpdateOutbox, claimPendingSessionWorkflowWakes, claimAutomaticSessionTitleFanout, markAutomaticSessionTitleFanoutDelivered, markAutomaticSessionTitleFanoutFailed, type Database } from "@opengeni/db";
|
|
3
|
+
import { claimPendingSessionSystemUpdateOutbox, claimPendingSessionWorkflowWakes, repairPendingChildTerminalResultWakes, claimAutomaticSessionTitleFanout, markAutomaticSessionTitleFanoutDelivered, markAutomaticSessionTitleFanoutFailed, type Database } from "@opengeni/db";
|
|
4
4
|
import { type EventBus } from "@opengeni/events";
|
|
5
5
|
import type { ActivityServices, WakeSessionWorkflowSignal } from "./types.js";
|
|
6
6
|
export type NotifyServices = {
|
|
@@ -15,6 +15,7 @@ export type ReconcileParentSystemUpdateOverrides = Partial<{
|
|
|
15
15
|
}>;
|
|
16
16
|
export type ReconcileSessionWorkflowWakeOverrides = Partial<{
|
|
17
17
|
claimPendingSessionWorkflowWakes: typeof claimPendingSessionWorkflowWakes;
|
|
18
|
+
repairPendingChildTerminalResultWakes: typeof repairPendingChildTerminalResultWakes;
|
|
18
19
|
}>;
|
|
19
20
|
export type ReconcileAutomaticSessionTitleFanoutOverrides = Partial<{
|
|
20
21
|
claimAutomaticSessionTitleFanout: typeof claimAutomaticSessionTitleFanout;
|
|
@@ -91,16 +92,9 @@ export type WorkflowWakeReconciliationResult = {
|
|
|
91
92
|
};
|
|
92
93
|
export declare function reconcilePendingSessionWorkflowWakes(svc: NotifyServices, limit?: number, overrides?: ReconcileSessionWorkflowWakeOverrides): Promise<WorkflowWakeReconciliationResult>;
|
|
93
94
|
/**
|
|
94
|
-
* The
|
|
95
|
-
* the
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* shared trailing instruction instead of running N model calls.
|
|
95
|
+
* The short status line for one child (what happened + its goal). It is also
|
|
96
|
+
* the timeline preview, so it carries no instructions: the parent reads the
|
|
97
|
+
* child's answer from the typed payload, and the operational contract says how
|
|
98
|
+
* to use it. N completions coalesce into one internal-update inference.
|
|
99
99
|
*/
|
|
100
100
|
export declare function childCompletionSummary(child: Session, goal: SessionGoal | null, terminalStatus: "idle" | "failed"): string;
|
|
101
|
-
/**
|
|
102
|
-
* The single trailing instruction appended to a child-completion (or digest)
|
|
103
|
-
* inference. Suppresses the "resume it now" nudge when the manager's own goal
|
|
104
|
-
* was paused by the user (paired with the goal_set reactivation guard).
|
|
105
|
-
*/
|
|
106
|
-
export declare function childCompletionTrailing(parentGoalUserPaused: boolean): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RetainedArtifactMetadata, type RetainedOutputUnavailableReason } from "@opengeni/contracts";
|
|
1
|
+
import { type RetainedArtifactMetadata, type RetainedOutputUnavailableReason, type RetainedSessionScreenshotKind } from "@opengeni/contracts";
|
|
2
2
|
import { type Database } from "@opengeni/db";
|
|
3
3
|
import { type ObjectStorage } from "@opengeni/storage";
|
|
4
4
|
export type TypedScreenshotToolOutput = {
|
|
@@ -68,6 +68,7 @@ export declare function retainedScreenshotIdentity(input: {
|
|
|
68
68
|
attemptId: string;
|
|
69
69
|
toolCallId: string;
|
|
70
70
|
toolOutputId: string;
|
|
71
|
+
kind?: RetainedSessionScreenshotKind | undefined;
|
|
71
72
|
}): {
|
|
72
73
|
artifactId: string;
|
|
73
74
|
settlementKey: string;
|
|
@@ -80,8 +81,9 @@ export declare function unavailableRetainedSessionImage(input: {
|
|
|
80
81
|
toolCallId: string;
|
|
81
82
|
toolOutputId: string;
|
|
82
83
|
reason: RetainedOutputUnavailableReason;
|
|
84
|
+
kind?: RetainedSessionScreenshotKind | undefined;
|
|
83
85
|
}): RetainedArtifactMetadata;
|
|
84
|
-
export declare function
|
|
86
|
+
export declare function retainSessionScreenshot(input: {
|
|
85
87
|
db: Database;
|
|
86
88
|
objectStorage: ObjectStorage | null;
|
|
87
89
|
accountId: string;
|
|
@@ -90,10 +92,13 @@ export declare function retainComputerScreenshot(input: {
|
|
|
90
92
|
turnId: string;
|
|
91
93
|
attemptId: string;
|
|
92
94
|
output: TypedScreenshotToolOutput;
|
|
95
|
+
kind?: RetainedSessionScreenshotKind | undefined;
|
|
93
96
|
now?: Date;
|
|
94
97
|
retentionMs?: number;
|
|
95
98
|
workspaceQuotaBytes?: number;
|
|
96
99
|
}): Promise<RetainedArtifactMetadata>;
|
|
100
|
+
/** Existing computer callers keep their stable entry point. */
|
|
101
|
+
export declare const retainComputerScreenshot: typeof retainSessionScreenshot;
|
|
97
102
|
/** Replace only new screenshot bytes with a compact receipt before first persistence. */
|
|
98
103
|
export declare function compactRetainedScreenshotHistory(history: Array<Record<string, unknown>>, receiptsByCallId: ReadonlyMap<string, RetainedArtifactMetadata>): Array<Record<string, unknown>>;
|
|
99
104
|
/** Collect durable screenshot receipts before their provider-only expansion. */
|
|
@@ -4,7 +4,6 @@ import { acquireLease, commitWarmingToWarm, failWarmingToCold, markWarmLeaseInst
|
|
|
4
4
|
import { createTurnToolCancellationController, establishSandboxSessionFromEnvelope, serializeEstablishedSandboxEnvelope, tagModalSandbox, type EstablishedSandboxSession, type TurnSandboxCommandArgs, type TurnSandboxCommandSession } from "@opengeni/runtime/sandbox";
|
|
5
5
|
import type { Context } from "@temporalio/activity";
|
|
6
6
|
import type { ControlActivityServices } from "./types.js";
|
|
7
|
-
import { type WorkspacePackRuntime } from "./packs.js";
|
|
8
7
|
type SandboxLifecycleCommandRunner = (session: TurnSandboxCommandSession, args: TurnSandboxCommandArgs) => Promise<unknown>;
|
|
9
8
|
export type RigVerificationWorkflowInput = {
|
|
10
9
|
workspaceId: string;
|
|
@@ -29,7 +28,7 @@ export type RigPlatformCheckResult = CommandResult & RigCheck;
|
|
|
29
28
|
*/
|
|
30
29
|
export declare function rigPlatformChecksForSettings(settings: ControlActivityServices["settings"]): RigCheck[];
|
|
31
30
|
export declare const RIG_VERIFICATION_OWNER_TTL_MS: number;
|
|
32
|
-
export declare const RIG_VERIFICATION_OWNERS_DISABLED_MESSAGE = "
|
|
31
|
+
export declare const RIG_VERIFICATION_OWNERS_DISABLED_MESSAGE = "Sandbox Environment verification lease ownership is disabled; refusing to create an unowned verifier sandbox";
|
|
33
32
|
export declare class RigVerificationActivityDeadlineError extends Error {
|
|
34
33
|
readonly startToCloseTimeoutMs: number;
|
|
35
34
|
readonly cleanupReserveMs: number;
|
|
@@ -146,7 +145,7 @@ export declare function buildVerifiedRigProviderImage(input: {
|
|
|
146
145
|
lifecycle: RigVerificationActivityLifecycle;
|
|
147
146
|
signal: AbortSignal;
|
|
148
147
|
}): Promise<RigProviderImage>;
|
|
149
|
-
export declare function settingsForRigVerification(settings: ControlActivityServices["settings"],
|
|
148
|
+
export declare function settingsForRigVerification(settings: ControlActivityServices["settings"], rigImage: string | null): ControlActivityServices["settings"];
|
|
150
149
|
export declare function createRigVerificationActivities(services: () => Promise<ControlActivityServices>): {
|
|
151
150
|
verifyRigChange: (input: {
|
|
152
151
|
workspaceId: string;
|
|
@@ -22,6 +22,7 @@ export type RunCredentialRenewalOptions = {
|
|
|
22
22
|
errorClass: "RunCredentialRenewalOperationError";
|
|
23
23
|
}) => void;
|
|
24
24
|
};
|
|
25
|
+
export declare function runCredentialRenewalExpiry(material: NormalizedRunCredentialMaterial | null): Date | null;
|
|
25
26
|
export declare function nextRunCredentialRenewalDelay(expiresAt: Date | null, nowMs?: number): number;
|
|
26
27
|
/** Single-flight renewal; late resolves cannot mutate a stopped attempt. */
|
|
27
28
|
export declare function startRunCredentialRenewalLoop(options: RunCredentialRenewalOptions): RunCredentialRenewalController;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ConnectionCredentialsPort, CredentialAuthNeededPayload, SandboxBackend, RunCredentialsRequest, Session, SessionTurn } from "@opengeni/contracts";
|
|
1
|
+
import type { ConnectionCredentialsPort, CredentialAuthNeededPayload, SandboxBackend, RunCredentialsRequest, Session, SessionTurn, ToolRef } from "@opengeni/contracts";
|
|
2
|
+
import type { Settings } from "@opengeni/config";
|
|
2
3
|
import { type Database } from "@opengeni/db";
|
|
3
4
|
import { type NormalizedRunCredentialMaterial } from "@opengeni/runtime";
|
|
4
5
|
export type RunCredentialResolutionContext = {
|
|
@@ -7,13 +8,22 @@ export type RunCredentialResolutionContext = {
|
|
|
7
8
|
accountId: string;
|
|
8
9
|
workspaceId: string;
|
|
9
10
|
session: Session;
|
|
10
|
-
turn: SessionTurn
|
|
11
|
+
turn: SessionTurn & {
|
|
12
|
+
initiatingHumanSubjectId?: string | null;
|
|
13
|
+
};
|
|
11
14
|
attemptId: string;
|
|
12
15
|
effectiveSandboxBackend: SandboxBackend;
|
|
13
16
|
variableSet: {
|
|
14
17
|
id: string;
|
|
15
18
|
name: string;
|
|
16
19
|
} | null;
|
|
20
|
+
/** Enables the workspace's configured HTTP credential provider. */
|
|
21
|
+
settings?: Settings;
|
|
22
|
+
initiatingHumanSubjectId?: string | null;
|
|
23
|
+
/** Installed in-process API routes must never enter a product callback. */
|
|
24
|
+
localMcpServerIds?: readonly string[];
|
|
25
|
+
/** Exact execution selection, resolved once at the turn policy boundary. */
|
|
26
|
+
effectiveTools: readonly ToolRef[];
|
|
17
27
|
};
|
|
18
28
|
export type BoundRunCredentialResolver = {
|
|
19
29
|
resolve(input: {
|
|
@@ -21,7 +31,7 @@ export type BoundRunCredentialResolver = {
|
|
|
21
31
|
forceRefresh: boolean;
|
|
22
32
|
}): Promise<NormalizedRunCredentialMaterial | null>;
|
|
23
33
|
};
|
|
24
|
-
export declare function buildRunCredentialsRequest(input: Omit<RunCredentialResolutionContext, "db" | "connectionCredentials"> & {
|
|
34
|
+
export declare function buildRunCredentialsRequest(input: Omit<RunCredentialResolutionContext, "db" | "connectionCredentials" | "settings" | "initiatingHumanSubjectId" | "effectiveTools"> & {
|
|
25
35
|
rootSessionId: string;
|
|
26
36
|
purpose: "provision" | "renewal";
|
|
27
37
|
forceRefresh: boolean;
|
|
@@ -32,5 +42,7 @@ export declare function runCredentialModelNote(material: NormalizedRunCredential
|
|
|
32
42
|
* Freeze the provider-neutral host credential request to this exact admitted
|
|
33
43
|
* turn. The host selects connections and material; the worker never infers a
|
|
34
44
|
* provider from repositories, environment names, or an OpenGeni variable set.
|
|
45
|
+
* A workspace that configured its own HTTP credential provider uses it in
|
|
46
|
+
* place of the deployment's injected port.
|
|
35
47
|
*/
|
|
36
48
|
export declare function bindRunCredentialResolver(input: RunCredentialResolutionContext): Promise<BoundRunCredentialResolver | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { resolveRigProviderImageSelection, rigProviderImageSourceImage,
|
|
1
|
+
export { resolveRigProviderImageSelection, rigProviderImageSourceImage, settingsWithRigImage, settingsWithRigProviderImage, type RigProviderImageSelectionReason, } from "@opengeni/core";
|