@opengeni/worker-bundle 0.20.1 → 0.22.0-canary.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-turn/admission.d.ts +52 -0
- package/dist/activities/agent-turn/agent-build.d.ts +89 -0
- package/dist/activities/agent-turn/claim.d.ts +67 -0
- package/dist/activities/agent-turn/codex-capacity.d.ts +40 -0
- package/dist/activities/agent-turn/codex.d.ts +32 -0
- package/dist/activities/agent-turn/compaction-prep.d.ts +88 -0
- package/dist/activities/agent-turn/credential-leases.d.ts +56 -0
- package/dist/activities/agent-turn/errors.d.ts +253 -0
- package/dist/activities/agent-turn/failure-settlement.d.ts +33 -0
- package/dist/activities/agent-turn/file-resources.d.ts +37 -0
- package/dist/activities/agent-turn/finalization.d.ts +42 -0
- package/dist/activities/agent-turn/github-repository-bindings.d.ts +105 -0
- package/dist/activities/agent-turn/governance-model.d.ts +66 -0
- package/dist/activities/agent-turn/history-sink.d.ts +52 -0
- package/dist/activities/agent-turn/history.d.ts +63 -0
- package/dist/activities/agent-turn/media-artifacts.d.ts +145 -0
- package/dist/activities/agent-turn/model-usage.d.ts +218 -0
- package/dist/activities/agent-turn/quiescence.d.ts +135 -0
- package/dist/activities/agent-turn/run-credentials.d.ts +84 -0
- package/dist/activities/agent-turn/run.d.ts +3 -0
- package/dist/activities/agent-turn/sandbox-establish.d.ts +93 -0
- package/dist/activities/agent-turn/sandbox-provision.d.ts +89 -0
- package/dist/activities/agent-turn/sandbox-route.d.ts +151 -0
- package/dist/activities/agent-turn/sandbox-runtime.d.ts +44 -0
- package/dist/activities/agent-turn/stream-attempt.d.ts +107 -0
- package/dist/activities/agent-turn/tool-environment.d.ts +142 -0
- package/dist/activities/agent-turn/tool-policy.d.ts +127 -0
- package/dist/activities/agent-turn/tool-result-spill.d.ts +59 -0
- package/dist/activities/agent-turn/turn-context.d.ts +144 -0
- package/dist/activities/agent-turn/xai-capacity.d.ts +2 -0
- package/dist/activities/agent-turn.d.ts +12 -954
- package/dist/activities/automations.d.ts +16 -0
- package/dist/activities/common.d.ts +1 -1
- package/dist/activities/connector-attachments.d.ts +13 -0
- package/dist/activities/documents.d.ts +1 -0
- package/dist/activities/environment.d.ts +26 -15
- package/dist/activities/generated-images.d.ts +1 -1
- package/dist/activities/git-credential-renewal.d.ts +3 -1
- package/dist/activities/goals.d.ts +4 -1
- package/dist/activities/google-drive-provider.d.ts +29 -0
- package/dist/activities/google-drive-publication.d.ts +66 -0
- package/dist/activities/image-generation-references.d.ts +2 -0
- package/dist/activities/incident-telemetry-authority.d.ts +52 -0
- package/dist/activities/incident-telemetry-preflight.d.ts +71 -0
- package/dist/activities/knowledge-source-sync-driver.d.ts +21 -0
- package/dist/activities/knowledge-source-sync.d.ts +33 -1
- package/dist/activities/mcp-credentials.d.ts +9 -3
- package/dist/activities/open-suffix-resume.d.ts +77 -0
- package/dist/activities/packs.d.ts +3 -11
- package/dist/activities/parent-wake.d.ts +19 -0
- package/dist/activities/retained-screenshot-reaper.d.ts +1 -1
- package/dist/activities/retained-screenshots.d.ts +1 -1
- package/dist/activities/rig-verification.d.ts +1 -1
- package/dist/activities/run-input.d.ts +16 -7
- package/dist/activities/sandbox-images.d.ts +1 -14
- package/dist/activities/sandbox-lease.d.ts +21 -3
- package/dist/activities/scheduled-tasks.d.ts +47 -0
- package/dist/activities/types.d.ts +23 -2
- package/dist/activities/video-media-validation.d.ts +1 -1
- package/dist/activities/video-output-retention.d.ts +1 -2
- package/dist/activities/xai-auth.d.ts +3 -0
- package/dist/{activities-control-SMKF2OBE.js → activities-control-DKG22ONJ.js} +2946 -549
- package/dist/activities-control-DKG22ONJ.js.map +1 -0
- package/dist/activities-control.d.ts +6 -2
- package/dist/activities-turn-4IMC3MAA.js +21326 -0
- package/dist/activities-turn-4IMC3MAA.js.map +1 -0
- package/dist/activities.d.ts +7 -3
- package/dist/artifact-materializer-entry.js +41 -22
- package/dist/artifact-materializer-entry.js.map +1 -1
- package/dist/{chunk-N5TJIFCE.js → chunk-CE7TPKBS.js} +468 -1
- package/dist/chunk-CE7TPKBS.js.map +1 -0
- package/dist/chunk-CNYGVRKF.js +4698 -0
- package/dist/chunk-CNYGVRKF.js.map +1 -0
- package/dist/connection-provider-use.d.ts +18 -0
- package/dist/editable-artifact-materializer.d.ts +4 -3
- package/dist/github-rest-mcp.d.ts +26 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +58 -14
- package/dist/index.js.map +1 -1
- package/dist/knowledge-source-sync-activity-policy.d.ts +2 -0
- package/dist/model-context-contributions.d.ts +8 -4
- package/dist/observability-metrics.d.ts +63 -4
- package/dist/opensandbox-kubernetes-inventory.d.ts +21 -0
- package/dist/personal-github-git-credentials.d.ts +9 -0
- package/dist/pr-review-credentials.d.ts +6 -0
- package/dist/sandbox-archive-storage.d.ts +45 -0
- package/dist/sandbox-resume.d.ts +65 -6
- package/dist/sandbox-routing.d.ts +38 -2
- package/dist/scheduled-alert-occurrence.d.ts +33 -0
- package/dist/workflow-bundle.js +87 -28
- package/dist/workflows/activities.d.ts +1 -0
- package/dist/workflows/automations.d.ts +6 -0
- package/dist/workflows/document-index.d.ts +1 -0
- package/dist/workflows.d.ts +1 -0
- package/package.json +17 -17
- package/src/activities/agent-turn/admission.ts +292 -0
- package/src/activities/agent-turn/agent-build.ts +802 -0
- package/src/activities/agent-turn/claim.ts +590 -0
- package/src/activities/agent-turn/codex-capacity.ts +720 -0
- package/src/activities/agent-turn/codex.ts +94 -0
- package/src/activities/agent-turn/compaction-prep.ts +722 -0
- package/src/activities/agent-turn/credential-leases.ts +240 -0
- package/src/activities/agent-turn/errors.ts +1068 -0
- package/src/activities/agent-turn/failure-settlement.ts +1436 -0
- package/src/activities/agent-turn/file-resources.ts +227 -0
- package/src/activities/agent-turn/finalization.ts +754 -0
- package/src/activities/agent-turn/github-repository-bindings.ts +300 -0
- package/src/activities/agent-turn/governance-model.ts +465 -0
- package/src/activities/agent-turn/history-sink.ts +139 -0
- package/src/activities/agent-turn/history.ts +200 -0
- package/src/activities/agent-turn/media-artifacts.ts +359 -0
- package/src/activities/agent-turn/model-usage.ts +823 -0
- package/src/activities/agent-turn/quiescence.ts +353 -0
- package/src/activities/agent-turn/run-credentials.ts +761 -0
- package/src/activities/agent-turn/run.ts +1530 -0
- package/src/activities/agent-turn/sandbox-establish.ts +1207 -0
- package/src/activities/agent-turn/sandbox-provision.ts +569 -0
- package/src/activities/agent-turn/sandbox-route.ts +358 -0
- package/src/activities/agent-turn/sandbox-runtime.ts +731 -0
- package/src/activities/agent-turn/stream-attempt.ts +1670 -0
- package/src/activities/agent-turn/tool-environment.ts +729 -0
- package/src/activities/agent-turn/tool-policy.ts +216 -0
- package/src/activities/agent-turn/tool-result-spill.ts +265 -0
- package/src/activities/agent-turn/turn-context.ts +281 -0
- package/src/activities/agent-turn/xai-capacity.ts +229 -0
- package/src/activities/agent-turn.ts +12 -12575
- package/src/activities/api-integrations.ts +3 -0
- package/src/activities/automations.ts +214 -0
- package/src/activities/codemode-dispatcher.ts +12 -1
- package/src/activities/common.ts +1 -5
- package/src/activities/connector-attachments.ts +168 -0
- package/src/activities/context-compaction.ts +18 -0
- package/src/activities/documents.ts +6 -4
- package/src/activities/environment.ts +151 -55
- package/src/activities/generated-images.ts +26 -11
- package/src/activities/git-credential-renewal.ts +13 -3
- package/src/activities/goals.ts +85 -19
- package/src/activities/google-drive-provider.ts +178 -0
- package/src/activities/google-drive-publication.ts +938 -0
- package/src/activities/image-generation-references.ts +11 -2
- package/src/activities/incident-telemetry-authority.ts +327 -0
- package/src/activities/incident-telemetry-preflight.ts +317 -0
- package/src/activities/knowledge-source-sync-driver.ts +23 -0
- package/src/activities/knowledge-source-sync.ts +556 -40
- package/src/activities/mcp-credentials.ts +191 -17
- package/src/activities/open-suffix-resume.ts +422 -0
- package/src/activities/packs.ts +12 -60
- package/src/activities/parent-wake.ts +64 -14
- package/src/activities/retained-screenshot-reaper.ts +6 -3
- package/src/activities/retained-screenshots.ts +15 -47
- package/src/activities/rig-verification.ts +1 -1
- package/src/activities/run-input.ts +128 -136
- package/src/activities/sandbox-images.ts +7 -166
- package/src/activities/sandbox-lease.ts +406 -15
- package/src/activities/scheduled-tasks.ts +2103 -411
- package/src/activities/session-state.ts +10 -2
- package/src/activities/types.ts +32 -2
- package/src/activities/video-media-validation.ts +3 -3
- package/src/activities/video-output-retention.ts +2 -57
- package/src/activities/xai-auth.ts +8 -0
- package/src/activities-control.ts +2 -0
- package/src/activities.ts +3 -0
- package/src/activity-services.ts +13 -4
- package/src/connection-provider-use.ts +36 -0
- package/src/editable-artifact-materializer-subprocess.ts +25 -14
- package/src/editable-artifact-materializer.ts +29 -18
- package/src/github-rest-mcp.ts +713 -0
- package/src/http.ts +16 -6
- package/src/index.ts +40 -5
- package/src/knowledge-source-sync-activity-policy.ts +2 -0
- package/src/model-context-contributions.ts +33 -10
- package/src/observability-metrics.ts +357 -0
- package/src/opensandbox-kubernetes-inventory.ts +292 -0
- package/src/personal-github-git-credentials.ts +331 -0
- package/src/pr-review-credentials.ts +163 -0
- package/src/sandbox-archive-storage.ts +159 -0
- package/src/sandbox-resume.ts +449 -63
- package/src/sandbox-routing.ts +314 -16
- package/src/scheduled-alert-occurrence.ts +176 -0
- package/src/workflows/activities.ts +18 -2
- package/src/workflows/automations.ts +11 -0
- package/src/workflows/session.ts +13 -3
- package/src/workflows.ts +1 -0
- package/dist/activities-control-SMKF2OBE.js.map +0 -1
- package/dist/activities-turn-IDS3WEHA.js +0 -16532
- package/dist/activities-turn-IDS3WEHA.js.map +0 -1
- package/dist/chunk-N5TJIFCE.js.map +0 -1
- package/dist/chunk-P6Z2SLAA.js +0 -3092
- package/dist/chunk-P6Z2SLAA.js.map +0 -1
|
@@ -22,12 +22,31 @@ export type ReconcileSessionWorkflowWakeOverrides = Partial<{
|
|
|
22
22
|
* stable episode identity is the newest non-status event sequence.
|
|
23
23
|
*/
|
|
24
24
|
export declare function notifyParentOfChildIdle(svc: NotifyServices, workspaceId: string, childSessionId: string, episodeKey: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Deliver one exact child-lifecycle outbox row already committed by the
|
|
27
|
+
* child's own lifecycle transaction (turn failure, requires_action freeze,
|
|
28
|
+
* ...). This layer deliberately cannot create or rewrite the row: the
|
|
29
|
+
* producing transaction is the sole owner of its payload and lineage, and the
|
|
30
|
+
* global reconciler remains the recovery path if immediate delivery fails.
|
|
31
|
+
*/
|
|
32
|
+
export declare function deliverChildLifecycleOutboxToParent(svc: NotifyServices, workspaceId: string, childSessionId: string, dedupeKey: string, options?: {
|
|
33
|
+
requireRow?: boolean;
|
|
34
|
+
}): Promise<void>;
|
|
25
35
|
/**
|
|
26
36
|
* Deliver the exact failure row already committed by turn settlement. This
|
|
27
37
|
* layer deliberately cannot create or rewrite the row: the settlement
|
|
28
38
|
* transaction is the sole owner of the failed turn id, payload, and lineage.
|
|
29
39
|
*/
|
|
30
40
|
export declare function deliverFailedChildTurnToParent(svc: NotifyServices, workspaceId: string, childSessionId: string, turnId: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Deliver the child_requires_action notice a requires_action settlement
|
|
43
|
+
* committed for this exact (child, turn, generation). When the rollout flag is
|
|
44
|
+
* off no row exists and this is a no-op; the reaper covers crashes after commit.
|
|
45
|
+
*/
|
|
46
|
+
export declare function deliverChildRequiresActionToParent(svc: NotifyServices, workspaceId: string, childSessionId: string, input: {
|
|
47
|
+
turnId: string;
|
|
48
|
+
turnGeneration: number;
|
|
49
|
+
}): Promise<void>;
|
|
31
50
|
export declare function reconcilePendingParentSystemUpdates(svc: NotifyServices, limit?: number, overrides?: ReconcileParentSystemUpdateOverrides): Promise<{
|
|
32
51
|
claimed: number;
|
|
33
52
|
delivered: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileAsset } from "@opengeni/contracts";
|
|
2
|
-
import type
|
|
2
|
+
import { type ObjectHead, type ObjectStorage } from "@opengeni/storage";
|
|
3
3
|
import type { ControlActivityServices } from "./types.js";
|
|
4
4
|
export declare const RETAINED_SCREENSHOT_PENDING_GRACE_MS: number;
|
|
5
5
|
export declare const RETAINED_SCREENSHOT_CLAIM_TIMEOUT_MS: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type RetainedArtifactMetadata, type RetainedOutputUnavailableReason } from "@opengeni/contracts";
|
|
2
2
|
import { type Database } from "@opengeni/db";
|
|
3
|
-
import type
|
|
3
|
+
import { type ObjectStorage } from "@opengeni/storage";
|
|
4
4
|
export type TypedScreenshotToolOutput = {
|
|
5
5
|
callId: string;
|
|
6
6
|
toolOutputId: string;
|
|
@@ -175,7 +175,7 @@ export declare function createRigVerificationActivities(services: () => Promise<
|
|
|
175
175
|
command: string;
|
|
176
176
|
}[];
|
|
177
177
|
providerImage: {
|
|
178
|
-
backend: "blaxel" | "cloudflare" | "daytona" | "docker" | "e2b" | "local" | "modal" | "none" | "runloop" | "selfhosted" | "vercel";
|
|
178
|
+
backend: "blaxel" | "cloudflare" | "daytona" | "docker" | "e2b" | "local" | "modal" | "none" | "opensandbox" | "runloop" | "selfhosted" | "vercel";
|
|
179
179
|
provider: string;
|
|
180
180
|
status: "building" | "failed" | "ready" | "unsupported";
|
|
181
181
|
contentHash: string;
|
|
@@ -23,13 +23,18 @@ export type PreparedTurnInput = {
|
|
|
23
23
|
};
|
|
24
24
|
export type TurnInputOptions = {
|
|
25
25
|
turnId: string;
|
|
26
|
+
/** Frozen initiating-human authority for every model-visible file read. */
|
|
27
|
+
fileAuthority: {
|
|
28
|
+
accountId: string;
|
|
29
|
+
subjectId: string | null;
|
|
30
|
+
};
|
|
26
31
|
recovering?: boolean;
|
|
27
32
|
unavailableSandboxFilesNote?: string;
|
|
28
33
|
runCredentialsNote?: string;
|
|
34
|
+
mcpAvailabilityNote?: string;
|
|
29
35
|
providerApi: HistoryProviderApi;
|
|
30
36
|
projectCanonicalHistory?: ModelHistoryAttachmentProjector;
|
|
31
37
|
materializeModelHistory?: ModelHistoryAttachmentProjector;
|
|
32
|
-
materializeSerializedRunState?: (serialized: string) => Promise<string>;
|
|
33
38
|
projectModelHistory?: ModelHistoryAttachmentProjector;
|
|
34
39
|
loadActiveHistory?: typeof getActiveSessionHistoryItemsPaged;
|
|
35
40
|
/** Bounded critical-path timings; telemetry failures never affect preparation. */
|
|
@@ -49,19 +54,23 @@ export type ModelAttachmentContent = {
|
|
|
49
54
|
contentType: string;
|
|
50
55
|
dataUrl: string;
|
|
51
56
|
};
|
|
52
|
-
export type ModelHistoryAttachmentProjector = (items: Array<Record<string, unknown
|
|
57
|
+
export type ModelHistoryAttachmentProjector = (items: Array<Record<string, unknown>>, options?: ModelHistoryAttachmentProjectionOptions) => Promise<Array<Record<string, unknown>>>;
|
|
58
|
+
export type ModelHistoryAttachmentProjectionOptions = {
|
|
59
|
+
/** Exact, already-authorized files attached to the triggering message. */
|
|
60
|
+
inlineFiles?: readonly FileAsset[];
|
|
61
|
+
};
|
|
53
62
|
export type ModelAttachmentInputPolicy = {
|
|
54
63
|
supportsImageInput: boolean;
|
|
55
64
|
inputFileMediaTypes: readonly string[];
|
|
56
65
|
};
|
|
57
66
|
export declare function modelAttachmentContentForFiles(files: FileAsset[], readFileBytes: (file: FileAsset) => Promise<Uint8Array>): Promise<ModelAttachmentContent[]>;
|
|
58
67
|
/**
|
|
59
|
-
* Build one turn-scoped durable-attachment projector.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
68
|
+
* Build one turn-scoped durable-attachment projector. Current attachment
|
|
69
|
+
* metadata arrives already authorized; bytes are memoized for same-turn retry.
|
|
70
|
+
* Historical projection has no database or object-storage path.
|
|
62
71
|
*/
|
|
63
|
-
export declare function createModelHistoryAttachmentProjector(
|
|
72
|
+
export declare function createModelHistoryAttachmentProjector(policy: ModelAttachmentInputPolicy, readFileBytes?: (file: FileAsset) => Promise<Uint8Array>): ModelHistoryAttachmentProjector;
|
|
64
73
|
/** Add current trigger refs only when older/local history predates durable stamping. */
|
|
65
74
|
export declare function withCurrentUserAttachmentRefs(historyItems: Array<Record<string, unknown>>, refs: FileResourceRef[]): Array<Record<string, unknown>>;
|
|
66
75
|
export declare function turnInput(db: Database, runtime: OpenGeniRuntime, agent: any, trigger: Awaited<ReturnType<typeof getSessionEvent>>, options: TurnInputOptions): Promise<PreparedTurnInput>;
|
|
67
|
-
export declare function userMessageTextWithAttachments(db: Database, workspaceId: string, text: string, resources: ResourceRef[]): Promise<string>;
|
|
76
|
+
export declare function userMessageTextWithAttachments(db: Database, accountId: string, workspaceId: string, subjectId: string | null, text: string, resources: ResourceRef[]): Promise<string>;
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { CapabilityPack, RigVersion, SandboxBackend } from "@opengeni/contracts";
|
|
3
|
-
import { resolveModalCheckpointProviderBinding } from "@opengeni/runtime/sandbox";
|
|
4
|
-
export declare function settingsWithPackSandboxImage(settings: Settings, sandboxImage: string | null, sandboxProviderImages?: CapabilityPack["sandboxProviderImages"] | null): Settings;
|
|
5
|
-
export declare function settingsWithRigImage(settings: Settings, rigImage: string | null): Settings;
|
|
6
|
-
export declare function rigProviderImageSourceImage(settings: Settings, backend: SandboxBackend): string | null;
|
|
7
|
-
export type RigProviderImageSelectionReason = "selected" | "missing" | "provider_unsupported" | "not_ready" | "not_cold_boot_validated" | "content_mismatch" | "provider_binding_unavailable" | "provider_binding_mismatch";
|
|
8
|
-
export declare function resolveRigProviderImageSelection(settings: Settings, version: RigVersion | null, backend: SandboxBackend, currentProviderBindingKeyHash: string | null): {
|
|
9
|
-
settings: Settings;
|
|
10
|
-
reason: RigProviderImageSelectionReason;
|
|
11
|
-
contentHash: string | null;
|
|
12
|
-
imageId: string | null;
|
|
13
|
-
};
|
|
14
|
-
export declare function settingsWithRigProviderImage(settings: Settings, version: RigVersion | null, backend: SandboxBackend, resolveBinding?: typeof resolveModalCheckpointProviderBinding): Promise<Settings>;
|
|
1
|
+
export { resolveRigProviderImageSelection, rigProviderImageSourceImage, settingsWithPackSandboxImage, settingsWithRigImage, settingsWithRigProviderImage, type RigProviderImageSelectionReason, } from "@opengeni/core";
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { type OpStatus } from "@opengeni/agent-proto";
|
|
1
2
|
import { listLiveModalSandboxLeaseAttributions, readLease, type ReapDrainable, type RetainedProcessProviderProof, type SandboxRetainedProcess, type LeaseSnapshot } from "@opengeni/db";
|
|
2
|
-
import {
|
|
3
|
+
import { type ConnectedMachineBackgroundCommandClaim, type ConnectedMachineBackgroundCommandProof } from "@opengeni/db/session-background-commands";
|
|
4
|
+
import { createSandboxClientForBackend, inspectModalSandboxLifecycle, resolveModalCheckpointProviderBindingForSession, terminateModalSandboxById, type ModalOrphanSweepTermination, type ModalCheckpointProviderBinding, type ProviderWorkspaceCapturePolicy, type WorkspaceArchiveDescriptor, type ControlRpc } from "@opengeni/runtime/sandbox";
|
|
3
5
|
import { type SandboxDrainActivityInput, type SandboxLeaseSweepMaintenanceInput } from "../sandbox-reaper-contract.js";
|
|
4
6
|
import type { ControlActivityServices as ActivityServices } from "./types.js";
|
|
7
|
+
import { type OpenSandboxKubernetesInventory } from "../opensandbox-kubernetes-inventory.js";
|
|
5
8
|
export { sandboxLeaseTelemetryKey } from "@opengeni/observability";
|
|
6
9
|
export type ReapSandboxLeasesResult = {
|
|
7
10
|
/** Stale viewer holders + warming-death rows the sweep touched is folded into
|
|
@@ -57,6 +60,9 @@ export type DrainCaptureDisposition = "capture_required" | "archive_published";
|
|
|
57
60
|
* provider disappearance before capture. */
|
|
58
61
|
export type TerminateBoxFn = (settings: ActivityServices["settings"], lease: NonNullable<Awaited<ReturnType<typeof readLease>>>, observability: ActivityServices["observability"], persistArchive: PersistArchiveFn, providerCaptureRequestId?: string, captureDisposition?: DrainCaptureDisposition, capturePolicy?: ProviderWorkspaceCapturePolicy | null) => Promise<boolean | ProviderTerminationOutcome>;
|
|
59
62
|
export type SweepModalOrphansFn = (settings: ActivityServices["settings"], db: ActivityServices["db"], observability: ActivityServices["observability"]) => Promise<number>;
|
|
63
|
+
export type InspectOpenSandboxKubernetesInventoryFn = (input: {
|
|
64
|
+
namespace: string;
|
|
65
|
+
}) => Promise<OpenSandboxKubernetesInventory>;
|
|
60
66
|
export type SandboxLeaseActivityOptions = {
|
|
61
67
|
/** Override the provider terminate (tests spy this; defaults to the real
|
|
62
68
|
* resume-by-id + provider stop()). */
|
|
@@ -64,6 +70,8 @@ export type SandboxLeaseActivityOptions = {
|
|
|
64
70
|
/** Override the provider-side Modal orphan sweep (tests spy this; defaults to
|
|
65
71
|
* Modal list+tag comparison when Modal is configured). */
|
|
66
72
|
sweepModalOrphans?: SweepModalOrphansFn;
|
|
73
|
+
/** Override the read-only bounded OpenSandbox Kubernetes projection. */
|
|
74
|
+
inspectOpenSandboxKubernetesInventory?: InspectOpenSandboxKubernetesInventoryFn;
|
|
67
75
|
/** Override only the read-only provider process probe. The canonical DB
|
|
68
76
|
* settlement remains real in tests and production. */
|
|
69
77
|
probeRetainedProcess?: RetainedProcessProbeFn;
|
|
@@ -85,12 +93,14 @@ export type RetainedProcessProbeResult = {
|
|
|
85
93
|
status: "deferred";
|
|
86
94
|
reason: "identity_mismatch" | "resume_state_missing" | "backend_unsupported" | "provider_running" | "provider_unknown" | "provider_timeout" | "provider_error" | "provider_binding_missing" | "provider_binding_mismatch";
|
|
87
95
|
};
|
|
88
|
-
export type RetainedProcessProbeFn = (settings: ActivityServices["settings"], lease: LeaseSnapshot, process: SandboxRetainedProcess) => Promise<RetainedProcessProbeResult>;
|
|
96
|
+
export type RetainedProcessProbeFn = (settings: ActivityServices["settings"], lease: LeaseSnapshot, process: SandboxRetainedProcess, mode?: "observe" | "cancel") => Promise<RetainedProcessProbeResult>;
|
|
89
97
|
export type HistoricalModalSandboxLifecycleProbeFn = typeof inspectModalSandboxLifecycle;
|
|
90
98
|
export type DrainableProviderProbeFn = (settings: ActivityServices["settings"], lease: LeaseSnapshot) => Promise<"ready" | "missing">;
|
|
91
99
|
export declare const RETAINED_PROCESS_RECONCILIATION_LIMIT = 20;
|
|
92
100
|
export declare const RETAINED_PROCESS_RECONCILIATION_CLAIM_TTL_MS: number;
|
|
93
101
|
export declare const RETAINED_PROCESS_PROVIDER_PROBE_TIMEOUT_MS = 5000;
|
|
102
|
+
export declare const CONNECTED_COMMAND_RECONCILIATION_LIMIT = 20;
|
|
103
|
+
export declare const CONNECTED_COMMAND_RECONCILIATION_CLAIM_TTL_MS: number;
|
|
94
104
|
export declare class SandboxProviderCaptureTimeoutError extends Error {
|
|
95
105
|
readonly sandboxGroupId: string;
|
|
96
106
|
readonly backend: string;
|
|
@@ -128,11 +138,19 @@ export declare function createSandboxLeaseActivities(services: () => Promise<Act
|
|
|
128
138
|
maintainSandboxLeaseSweep: (input: SandboxLeaseSweepMaintenanceInput) => Promise<SandboxLeaseSweepMaintenanceResult>;
|
|
129
139
|
reapSandboxLeases: () => Promise<ReapSandboxLeasesResult>;
|
|
130
140
|
};
|
|
131
|
-
export declare function
|
|
141
|
+
export declare function probeConnectedMachineBackgroundCommand(claim: ConnectedMachineBackgroundCommandClaim, controlRpc: ControlRpc, controlTimeoutMs: number, observedAt?: Date): Promise<ConnectedMachineBackgroundCommandProof | null>;
|
|
142
|
+
export declare function connectedCommandProofFromStatus(status: OpStatus, observedAt: Date): ConnectedMachineBackgroundCommandProof | null;
|
|
143
|
+
export declare function probeRetainedProcessAtProvider(settings: ActivityServices["settings"], lease: LeaseSnapshot, process: SandboxRetainedProcess, mode?: "observe" | "cancel"): Promise<RetainedProcessProbeResult>;
|
|
132
144
|
/** Classify only exact SDK control banners. Arbitrary output, malformed text,
|
|
133
145
|
* and a running marker are observations to retry; none is physical exit proof. */
|
|
134
146
|
export declare function classifyRetainedProcessPollResult(result: unknown, providerSessionId: number): RetainedProcessProbeResult;
|
|
135
147
|
export declare function modalOrphanTerminationStillEligible(latest: Awaited<ReturnType<typeof listLiveModalSandboxLeaseAttributions>>, candidate: ModalOrphanSweepTermination): boolean;
|
|
148
|
+
export type SandboxDrainReason = "idle" | "provider_deadline" | "operator" | "teardown_claim" | "rotation_requested";
|
|
149
|
+
/** The bounded drain reason carried on `sandbox.box.terminated`: the lease's
|
|
150
|
+
* rotation reason when a rotation was requested, otherwise the ordinary idle
|
|
151
|
+
* drain. A requested rotation without a recorded reason (legacy rows) is
|
|
152
|
+
* reported as `rotation_requested` rather than guessed. */
|
|
153
|
+
export declare function sandboxDrainReason(lease: Pick<LeaseSnapshot, "rotationRequestedAt" | "rotationReason">): SandboxDrainReason;
|
|
136
154
|
/**
|
|
137
155
|
* Resume/attach the box by id, PERSIST its /workspace, fold the snapshot onto the
|
|
138
156
|
* lease under the epoch fence, hand the superseded snapshot to durable GC, THEN
|
|
@@ -1,4 +1,51 @@
|
|
|
1
1
|
import type { ControlActivityServices, DispatchScheduledTaskRunInput, DispatchScheduledTaskRunResult } from "./types.js";
|
|
2
|
+
type ScheduledTemporalActivityIdentity = {
|
|
3
|
+
namespace: string;
|
|
4
|
+
workflowExecution?: {
|
|
5
|
+
workflowId: string;
|
|
6
|
+
runId: string;
|
|
7
|
+
};
|
|
8
|
+
activityId: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function scheduledTaskRunProducerKey(input: DispatchScheduledTaskRunInput, suppliedActivityIdentity?: ScheduledTemporalActivityIdentity): string;
|
|
11
|
+
/**
|
|
12
|
+
* Display title for a session the scheduler generates for a task.
|
|
13
|
+
*
|
|
14
|
+
* A scheduled session's `initialMessage` is the task prompt, byte-identical for
|
|
15
|
+
* every run, so an untitled scheduled session falls back to that prompt in the
|
|
16
|
+
* rail and reads exactly like every other run of the task. The task name is the
|
|
17
|
+
* short human-chosen label that actually identifies it, so that is the title.
|
|
18
|
+
*
|
|
19
|
+
* The title is the task name and NOTHING else. It deliberately does not name the
|
|
20
|
+
* run's fire instant, for two independent reasons:
|
|
21
|
+
*
|
|
22
|
+
* - No run mode guarantees one run per session. `reusable_session` generates
|
|
23
|
+
* its session on the first fire and then reuses it forever, and even under
|
|
24
|
+
* `new_session_per_run` alert-occurrence redelivery converges several runs
|
|
25
|
+
* onto one canonical responder session. `existing_session` never generates a
|
|
26
|
+
* session at all, so the scheduler never titles one. A run-specific fact
|
|
27
|
+
* frozen into the title is therefore right for the generating run and a lie
|
|
28
|
+
* for every run that lands in the same session afterwards.
|
|
29
|
+
* - A title is one stored string shown to every viewer, while every surface
|
|
30
|
+
* that renders a run's fire instant renders it viewer-local: the rail row
|
|
31
|
+
* prints the title beside `relativeTimeLabel(session.updatedAt)`, and the
|
|
32
|
+
* Schedules run list prints `formatTimestamp(run.firedAt)`, which is
|
|
33
|
+
* `toLocaleString()`. A wall clock stored in the title therefore disagrees
|
|
34
|
+
* with the time printed next to it for every viewer outside whichever zone
|
|
35
|
+
* it was rendered in. The task's own `timeZone` is no escape: it labels the
|
|
36
|
+
* schedule rule ("Mon Wed 09:00 Europe/Oslo"), not the rendering of a run,
|
|
37
|
+
* which stays viewer-local. No stored clock can agree with a viewer-local
|
|
38
|
+
* one, so the title carries none and the instant stays on the surfaces that
|
|
39
|
+
* already render it correctly.
|
|
40
|
+
*
|
|
41
|
+
* Dropping the clock settles the determinism constraint outright rather than
|
|
42
|
+
* working around it: the same run titled by the normal dispatch or by a later
|
|
43
|
+
* recovery in a different worker process derives one string from `task.name`
|
|
44
|
+
* alone, with no Intl call and so no host ICU or tzdata build to make the two
|
|
45
|
+
* texts differ.
|
|
46
|
+
*/
|
|
47
|
+
export declare function scheduledTaskSessionTitle(taskName: string): string;
|
|
2
48
|
export declare function createScheduledTaskActivities(services: () => Promise<ControlActivityServices>): {
|
|
3
49
|
dispatchScheduledTaskRun: (input: DispatchScheduledTaskRunInput) => Promise<DispatchScheduledTaskRunResult>;
|
|
4
50
|
};
|
|
51
|
+
export {};
|
|
@@ -72,6 +72,8 @@ export type SharedActivityServices = {
|
|
|
72
72
|
startVideoGenerationWorkflow?: StartVideoGenerationWorkflow | null;
|
|
73
73
|
entitlements?: EntitlementsPort | null;
|
|
74
74
|
connectionCredentials?: ConnectionCredentialsPort | null;
|
|
75
|
+
/** Standalone, default-off personal GitHub smart-HTTP broker consumer. */
|
|
76
|
+
personalGitHubCredentials?: ConnectionCredentialsPort["gitCredentials"] | null;
|
|
75
77
|
};
|
|
76
78
|
/** Control workers own short database and maintenance activities. Document
|
|
77
79
|
* parsing is resolved lazily by the indexing activity itself. */
|
|
@@ -225,6 +227,8 @@ export type EscapedMcpTimeoutRecoveryDetail = {
|
|
|
225
227
|
turnId: string;
|
|
226
228
|
triggerEventId: string;
|
|
227
229
|
executionGeneration: number;
|
|
230
|
+
providerRecoveryCount: number;
|
|
231
|
+
continueDelayMs: number;
|
|
228
232
|
};
|
|
229
233
|
export type RecoverEscapedMcpTimeoutInput = EscapedMcpTimeoutRecoveryDetail & {
|
|
230
234
|
accountId: string;
|
|
@@ -268,7 +272,7 @@ export type MaybeContinueGoalInput = {
|
|
|
268
272
|
workflowId: string;
|
|
269
273
|
};
|
|
270
274
|
export type MaybeContinueGoalResult = {
|
|
271
|
-
action: "none" | "queue" | "continue" | "paused";
|
|
275
|
+
action: "none" | "queue" | "continue" | "paused" | "held" | "deferred";
|
|
272
276
|
};
|
|
273
277
|
export type DispatchScheduledTaskRunInput = {
|
|
274
278
|
workspaceId: string;
|
|
@@ -289,7 +293,7 @@ export type DispatchScheduledTaskRunResult = {
|
|
|
289
293
|
action: "deleted";
|
|
290
294
|
} | {
|
|
291
295
|
action: "blocked";
|
|
292
|
-
reason: "insufficient_credits" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | "malformed_manual_trigger" | "knowledge_source_paused";
|
|
296
|
+
reason: "insufficient_credits" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | "malformed_manual_trigger" | "scheduled_task_paused" | "scheduled_authority_exhausted" | "scheduled_run_terminal" | "scheduled_execution_unrepresentable" | "knowledge_source_paused" | "incident_preflight_metadata_missing" | "incident_responder_under_capable" | "incident_data_source_unsuitable";
|
|
293
297
|
} | {
|
|
294
298
|
action: "start" | "signal";
|
|
295
299
|
accountId: string;
|
|
@@ -315,6 +319,23 @@ export type RunKnowledgeSourceSyncBatchInput = {
|
|
|
315
319
|
sourceId: string;
|
|
316
320
|
overlapPolicy: "skip" | "buffer_one";
|
|
317
321
|
};
|
|
322
|
+
export type DispatchAutomationRunInput = {
|
|
323
|
+
accountId: string;
|
|
324
|
+
workspaceId: string;
|
|
325
|
+
runId: string;
|
|
326
|
+
};
|
|
327
|
+
export type DispatchAutomationRunResult = {
|
|
328
|
+
action: "started";
|
|
329
|
+
sessionId: string;
|
|
330
|
+
} | {
|
|
331
|
+
action: "already_dispatched";
|
|
332
|
+
sessionId: string;
|
|
333
|
+
} | {
|
|
334
|
+
action: "skipped";
|
|
335
|
+
reason: string;
|
|
336
|
+
} | {
|
|
337
|
+
action: "not_found";
|
|
338
|
+
};
|
|
318
339
|
export type RunKnowledgeSourceSyncBatchResult = {
|
|
319
340
|
action: "continue";
|
|
320
341
|
} | {
|
|
@@ -26,8 +26,7 @@ export declare function downloadGeneratedVideoToVerifiedTemp(input: {
|
|
|
26
26
|
temp: VerifiedTempFile;
|
|
27
27
|
facts: GeneratedVideoFacts;
|
|
28
28
|
}>;
|
|
29
|
-
/** Stream verified bytes into an immutable content-addressed object
|
|
30
|
-
* the stored generation back through version-fenced Range reads. */
|
|
29
|
+
/** Stream verified bytes into an immutable content-addressed object. */
|
|
31
30
|
export declare function retainVerifiedGeneratedVideo(input: {
|
|
32
31
|
storage: ObjectStorage;
|
|
33
32
|
temp: VerifiedTempFile;
|
|
@@ -20,4 +20,7 @@ export declare function buildXaiTurnRequestAuthorization(input: {
|
|
|
20
20
|
hostedSearch?: XaiSubscriptionRequestContext["hostedSearch"];
|
|
21
21
|
onFinalContextUsage?: XaiSubscriptionRequestContext["onFinalContextUsage"];
|
|
22
22
|
nextRequestId?: XaiSubscriptionRequestContext["nextRequestId"];
|
|
23
|
+
streamIdleTimeoutMs?: XaiSubscriptionRequestContext["streamIdleTimeoutMs"];
|
|
24
|
+
onModelRequestDiagnostic?: XaiSubscriptionRequestContext["onModelRequestDiagnostic"];
|
|
25
|
+
onModelRequestEvent?: XaiSubscriptionRequestContext["onModelRequestEvent"];
|
|
23
26
|
}): Promise<XaiTurnRequestAuthorization>;
|