@opengeni/worker-bundle 2.2.0 → 2.2.1-canary.36919050519001
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 +1 -0
- package/dist/activities/agent-turn/claude-usage-observer.d.ts +13 -1
- package/dist/activities/agent-turn/compaction-prep.d.ts +20 -0
- package/dist/activities/agent-turn/final-reply.d.ts +18 -0
- package/dist/activities/agent-turn/governance-model.d.ts +6 -0
- package/dist/activities/agent-turn/model-call-admission.d.ts +15 -0
- package/dist/activities/agent-turn/run-credentials.d.ts +2 -0
- package/dist/activities/agent-turn/sandbox-establish.d.ts +1 -0
- package/dist/activities/agent-turn/session-title.d.ts +3 -1
- package/dist/activities/agent-turn/stream-attempt.d.ts +1 -0
- package/dist/activities/agent-turn/turn-context.d.ts +1 -0
- package/dist/activities/automations.d.ts +3 -1
- package/dist/activities/browser-deadline-checkpoint.d.ts +29 -0
- package/dist/activities/goals.d.ts +8 -0
- package/dist/activities/run-credentials.d.ts +4 -2
- package/dist/activities/types.d.ts +1 -1
- package/dist/{activities-control-MHNA3CYV.js → activities-control-55ECL47G.js} +403 -116
- package/dist/activities-control-55ECL47G.js.map +1 -0
- package/dist/activities-control.d.ts +30 -0
- package/dist/{activities-turn-FQ5OO2WW.js → activities-turn-T7Y3BWYO.js} +678 -246
- package/dist/activities-turn-T7Y3BWYO.js.map +1 -0
- package/dist/activities.d.ts +30 -0
- package/dist/browser-deadline-checkpoint-contract.d.ts +2 -0
- package/dist/{chunk-RZAAGRFQ.js → chunk-OWNLATJL.js} +189 -80
- package/dist/chunk-OWNLATJL.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +45 -23
- package/dist/index.js.map +1 -1
- package/dist/sandbox-resume.d.ts +4 -1
- package/dist/workflow-bundle.js +72 -10
- package/dist/workflows/browser-deadline-checkpoint.d.ts +9 -0
- package/dist/workflows.d.ts +1 -0
- package/package.json +21 -20
- package/src/activities/agent-run-admission.ts +17 -1
- package/src/activities/agent-turn/admission.ts +64 -1
- package/src/activities/agent-turn/agent-build.ts +24 -3
- package/src/activities/agent-turn/claim.ts +56 -14
- package/src/activities/agent-turn/claude-usage-observer.ts +33 -1
- package/src/activities/agent-turn/compaction-prep.ts +67 -16
- package/src/activities/agent-turn/errors.ts +55 -0
- package/src/activities/agent-turn/failure-settlement.ts +26 -6
- package/src/activities/agent-turn/final-reply.ts +46 -0
- package/src/activities/agent-turn/governance-model.ts +12 -0
- package/src/activities/agent-turn/model-call-admission.ts +94 -0
- package/src/activities/agent-turn/run-credentials.ts +15 -3
- package/src/activities/agent-turn/run.ts +43 -5
- package/src/activities/agent-turn/sandbox-establish.ts +9 -5
- package/src/activities/agent-turn/session-title.ts +8 -2
- package/src/activities/agent-turn/stream-attempt.ts +144 -38
- package/src/activities/agent-turn/tool-environment.ts +51 -39
- package/src/activities/agent-turn/turn-context.ts +1 -0
- package/src/activities/automations.ts +55 -3
- package/src/activities/browser-deadline-checkpoint.ts +279 -0
- package/src/activities/capabilities.ts +52 -14
- package/src/activities/goals.ts +67 -95
- package/src/activities/knowledge-indexing.ts +29 -0
- package/src/activities/open-suffix-resume.ts +2 -1
- package/src/activities/run-credentials.ts +22 -16
- package/src/activities/scheduled-tasks.ts +83 -13
- package/src/activities/types.ts +1 -0
- package/src/activities/workspace-credential-provider.ts +12 -0
- package/src/activities-control.ts +2 -0
- package/src/activities.ts +3 -0
- package/src/browser-deadline-checkpoint-contract.ts +5 -0
- package/src/index.ts +53 -25
- package/src/sandbox-resume.ts +23 -8
- package/src/sandbox-routing.ts +4 -2
- package/src/workflows/browser-deadline-checkpoint.ts +50 -0
- package/src/workflows.ts +4 -0
- package/dist/activities-control-MHNA3CYV.js.map +0 -1
- package/dist/activities-turn-FQ5OO2WW.js.map +0 -1
- package/dist/chunk-RZAAGRFQ.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
2
|
import type { ControlActivityServices } from "./types.js";
|
|
3
|
-
export type AgentRunAdmissionDenial = "insufficient_credits" | "monthly_model_cost_limit" | "monthly_agent_run_limit";
|
|
3
|
+
export type AgentRunAdmissionDenial = "insufficient_credits" | "allowance_exhausted" | "monthly_model_cost_limit" | "monthly_agent_run_limit";
|
|
4
4
|
/** One worker-side admission boundary for service-authored agent runs. */
|
|
5
5
|
export declare function agentRunAdmissionDenial(services: Pick<ControlActivityServices, "db" | "entitlements"> & {
|
|
6
6
|
settings: Settings;
|
|
@@ -9,4 +9,6 @@ export declare function agentRunAdmissionDenial(services: Pick<ControlActivitySe
|
|
|
9
9
|
workspaceId: string;
|
|
10
10
|
model: string;
|
|
11
11
|
requestedAgentRuns: number;
|
|
12
|
+
/** The accepted work's causal human, not the scheduler/service caller. */
|
|
13
|
+
initiatingHumanSubjectId?: string | null;
|
|
12
14
|
}): Promise<AgentRunAdmissionDenial | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveTurnExecutionPolicyV1, type Settings } from "@opengeni/config";
|
|
2
2
|
import type { TurnActivityServices as ActivityServices } from "../types.js";
|
|
3
|
-
import { type SessionEvent, type SessionTurn, type ToolAuthNeededPayload, type TurnExecutionPolicyV1, type XaiProviderAccountAuthoritySnapshotV1 } from "@opengeni/contracts";
|
|
3
|
+
import { type AllowanceExhaustedRefusal, type SessionEvent, type SessionTurn, type ToolAuthNeededPayload, type TurnExecutionPolicyV1, type XaiProviderAccountAuthoritySnapshotV1 } from "@opengeni/contracts";
|
|
4
4
|
export declare class WorkspaceHumanInputDisabledError extends Error {
|
|
5
5
|
constructor(kind: "resume" | "interruption");
|
|
6
6
|
}
|
|
@@ -62,6 +62,27 @@ export declare function stableInteractionInterventionUuid(namespace: string, ses
|
|
|
62
62
|
*/
|
|
63
63
|
export declare class BudgetExhaustedError extends Error {
|
|
64
64
|
readonly serializedRunState: string | null;
|
|
65
|
-
|
|
65
|
+
readonly allowance: AllowanceRefusal | null;
|
|
66
|
+
constructor(message: string, serializedRunState: string | null, allowance?: AllowanceRefusal | null);
|
|
66
67
|
}
|
|
67
|
-
export
|
|
68
|
+
export type AllowanceRefusal = AllowanceExhaustedRefusal;
|
|
69
|
+
/** Account allowance exhaustion is recoverable state, never a provider failure. */
|
|
70
|
+
export declare class AllowanceExhaustedError extends Error {
|
|
71
|
+
readonly refusal: AllowanceRefusal;
|
|
72
|
+
readonly code = "allowance_exhausted";
|
|
73
|
+
constructor(refusal: AllowanceRefusal);
|
|
74
|
+
}
|
|
75
|
+
/** Revalidate between paid calls without replaying provider work or reserving credits. */
|
|
76
|
+
export declare function ensureRunAllowedBetweenModelCalls(input: {
|
|
77
|
+
settings: Settings;
|
|
78
|
+
db: ActivityServices["db"];
|
|
79
|
+
accountId: string;
|
|
80
|
+
workspaceId: string;
|
|
81
|
+
isExternallyBilledTurn: boolean;
|
|
82
|
+
entitlements?: ActivityServices["entitlements"];
|
|
83
|
+
chargesOpenGeniCredits: boolean;
|
|
84
|
+
countsTowardTokenCap: boolean;
|
|
85
|
+
initiatingHumanSubjectId: string | null;
|
|
86
|
+
serializedRunState?: () => string | null;
|
|
87
|
+
}): Promise<void>;
|
|
88
|
+
export declare function ensureRunAllowed(settings: Settings, db: ActivityServices["db"], accountId: string, workspaceId: string, isExternallyBilledTurn: boolean, entitlements?: ActivityServices["entitlements"], chargesOpenGeniCredits?: boolean, countsTowardTokenCap?: boolean, initiatingHumanSubjectId?: string | null): Promise<void>;
|
|
@@ -43,6 +43,7 @@ export type BuildTurnAgentDeps = {
|
|
|
43
43
|
supportsImageInput: GovernanceModelOk["supportsImageInput"];
|
|
44
44
|
agentHumanInputEnabled: GovernanceModelOk["agentHumanInputEnabled"];
|
|
45
45
|
workspaceAgentInstructions: GovernanceModelOk["workspaceAgentInstructions"];
|
|
46
|
+
workspaceAgentIdentity: GovernanceModelOk["workspaceAgentIdentity"];
|
|
46
47
|
workspaceGovernance: GovernanceModelOk["workspaceGovernance"];
|
|
47
48
|
structuredWorkspacePolicyActive: GovernanceModelOk["structuredWorkspacePolicyActive"];
|
|
48
49
|
workspaceMemory: GovernanceModelOk["workspaceMemory"];
|
|
@@ -15,5 +15,17 @@ export declare function createClaudeUsageObserver(providers: ReturnType<typeof p
|
|
|
15
15
|
token: string;
|
|
16
16
|
connectionId: string;
|
|
17
17
|
credentialVersion: number;
|
|
18
|
-
} | null>): Promise<(providerId: string, response: Response) => void
|
|
18
|
+
} | null>): Promise<((providerId: string, response: Response) => void) & {
|
|
19
|
+
binding(providerId: string): {
|
|
20
|
+
readonly scope: Scope;
|
|
21
|
+
readonly token: string;
|
|
22
|
+
readonly expectedConnectionId: string;
|
|
23
|
+
readonly expectedCredentialVersion: number;
|
|
24
|
+
} | undefined;
|
|
25
|
+
renew(providerId: string, credential: {
|
|
26
|
+
token: string;
|
|
27
|
+
connectionId: string;
|
|
28
|
+
credentialVersion: number;
|
|
29
|
+
}): void;
|
|
30
|
+
}>;
|
|
19
31
|
export {};
|
|
@@ -37,6 +37,7 @@ export type CompactionPrepDeps = {
|
|
|
37
37
|
turnExecutionPolicy: ClaimTurnOk["turnExecutionPolicy"];
|
|
38
38
|
resolvedModel: GovernanceModelOk["resolvedModel"];
|
|
39
39
|
workspaceAgentInstructions: GovernanceModelOk["workspaceAgentInstructions"];
|
|
40
|
+
workspaceAgentIdentity: GovernanceModelOk["workspaceAgentIdentity"];
|
|
40
41
|
workspaceGovernance: GovernanceModelOk["workspaceGovernance"];
|
|
41
42
|
structuredWorkspacePolicyActive: GovernanceModelOk["structuredWorkspacePolicyActive"];
|
|
42
43
|
workspaceMemory: GovernanceModelOk["workspaceMemory"];
|
|
@@ -82,5 +83,24 @@ export type PostAgentCompactionOutcome = {
|
|
|
82
83
|
} | {
|
|
83
84
|
ok: PostAgentCompactionOk;
|
|
84
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* System instructions for the standalone (chat-provider) compaction request.
|
|
88
|
+
* A session with an agent configuration uses the same modular composer and
|
|
89
|
+
* module selection as its turns; a legacy session keeps the historical
|
|
90
|
+
* persona + CORE + governance + session + memory string byte-for-byte.
|
|
91
|
+
*/
|
|
92
|
+
export declare function standaloneCompactionInstructions(input: {
|
|
93
|
+
settings: Settings;
|
|
94
|
+
session: Pick<ClaimTurnOk["session"], "agent" | "instructions" | "resources">;
|
|
95
|
+
workspaceAgentInstructions: string | null | undefined;
|
|
96
|
+
workspaceAgentIdentity: string | null;
|
|
97
|
+
workspaceGovernance: string | null | undefined;
|
|
98
|
+
structuredWorkspacePolicyActive: boolean;
|
|
99
|
+
workspaceMemory: string | null | undefined;
|
|
100
|
+
rig: {
|
|
101
|
+
name: string;
|
|
102
|
+
version: number;
|
|
103
|
+
} | undefined;
|
|
104
|
+
}): string;
|
|
85
105
|
export declare function prepareCompaction(deps: CompactionPrepDeps): Promise<CompactionPrepOutcome>;
|
|
86
106
|
export declare function runPostAgentCompaction(deps: PostAgentCompactionDeps): Promise<PostAgentCompactionOutcome>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** One durable, same-logical-turn handoff, not a retry of model/tool effects. */
|
|
2
|
+
export declare function finalReplyNudge(turnId: string): {
|
|
3
|
+
type: "message";
|
|
4
|
+
role: "developer";
|
|
5
|
+
content: {
|
|
6
|
+
type: "input_text";
|
|
7
|
+
text: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export declare function hasFinalReplyNudge(history: readonly unknown[], turnId: string): boolean;
|
|
11
|
+
export declare function needsFinalReply(input: {
|
|
12
|
+
output: unknown;
|
|
13
|
+
inputWaitYielded: boolean;
|
|
14
|
+
interrupted: boolean;
|
|
15
|
+
maintenance: boolean;
|
|
16
|
+
toolsExecuted: boolean;
|
|
17
|
+
completedGoal: boolean;
|
|
18
|
+
}): boolean;
|
|
@@ -40,6 +40,12 @@ export type GovernanceModelOk = {
|
|
|
40
40
|
/** Deployment and workspace allow the Jev-backed code_search tool. */
|
|
41
41
|
codeSearchEnabled: boolean;
|
|
42
42
|
workspaceAgentInstructions: string | null | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Modular composer identity tier: the explicit workspace default identity,
|
|
45
|
+
* else the frozen legacy persona without `{{core}}`. Never dropped by
|
|
46
|
+
* instruction policies (only read for sessions with an agent configuration).
|
|
47
|
+
*/
|
|
48
|
+
workspaceAgentIdentity: string | null;
|
|
43
49
|
workspaceGovernance: ReturnType<typeof renderWorkspaceGovernanceContext>;
|
|
44
50
|
structuredWorkspacePolicyActive: boolean;
|
|
45
51
|
workspaceMemory: string | null | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StreamEvent } from "@openai/agents";
|
|
2
|
+
/** SDK producer/consumer rendezvous. Usage stays on the sole consumer writer. */
|
|
3
|
+
export declare function createModelCallAdmission(input: {
|
|
4
|
+
signal: AbortSignal;
|
|
5
|
+
admit: () => Promise<void>;
|
|
6
|
+
}): {
|
|
7
|
+
beforeModelRequest: () => Promise<void>;
|
|
8
|
+
onModelResponse: (event: StreamEvent) => Promise<void>;
|
|
9
|
+
settle: (event: {
|
|
10
|
+
type: string;
|
|
11
|
+
data?: unknown;
|
|
12
|
+
}) => void;
|
|
13
|
+
fail: (error: unknown) => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
};
|
|
@@ -2,6 +2,7 @@ import { type GitCredentialTokenWriterSession, type NormalizedRunCredentialMater
|
|
|
2
2
|
import { type Settings } from "@opengeni/config";
|
|
3
3
|
import { type GitHubTokenMintAuthorization, type MintedRunGitCredentials, type loadWorkspaceEnvironmentForRunWithCredentials } from "../environment.js";
|
|
4
4
|
import type { mergeResourceRefs } from "../common.js";
|
|
5
|
+
import type { withFirstPartyTools } from "../goals.js";
|
|
5
6
|
import type { TurnActivityServices as ActivityServices, RunAgentTurnInput } from "../types.js";
|
|
6
7
|
import { type ResumedTurnSandbox } from "../../sandbox-resume.js";
|
|
7
8
|
import type { ClaimTurnOk } from "./claim.js";
|
|
@@ -10,6 +11,7 @@ import type { SandboxTurnRuntime } from "./sandbox-runtime.js";
|
|
|
10
11
|
import type { AttemptIdentityState, EventingState, RenewalState, SandboxRuntimeState } from "./turn-context.js";
|
|
11
12
|
export type PrepareRunCredentialsDeps = {
|
|
12
13
|
localMcpServerIds?: readonly string[];
|
|
14
|
+
turnTools: ReturnType<typeof withFirstPartyTools>;
|
|
13
15
|
input: RunAgentTurnInput;
|
|
14
16
|
settings: Settings;
|
|
15
17
|
db: ActivityServices["db"];
|
|
@@ -35,6 +35,7 @@ export type SandboxRouteOk = {
|
|
|
35
35
|
machinePrimary: boolean;
|
|
36
36
|
groupBoxBackend: Settings["sandboxBackend"];
|
|
37
37
|
groupBoxImage: ReturnType<typeof rigProviderImageSourceImage>;
|
|
38
|
+
groupBoxImagePolicy: "new_creates_only";
|
|
38
39
|
sandboxCreationBackend: Settings["sandboxBackend"];
|
|
39
40
|
effectiveRunCredentialBackend: Settings["sandboxBackend"];
|
|
40
41
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { AttemptToolDefinition } from "@opengeni/codemode";
|
|
2
2
|
import { type ModelCapabilitiesV1 } from "@opengeni/config";
|
|
3
3
|
import type { GeneratedSessionTitle, GenerateSessionTitleOptions, OpenGeniRuntime } from "@opengeni/runtime";
|
|
4
|
-
import { ReasoningEffort, type FirstPartyMcpToolName, type Permission, type ToolRef } from "@opengeni/contracts";
|
|
4
|
+
import { ReasoningEffort, type FirstPartyMcpToolName, type Permission, type ResolvedAgentConfig, type ToolRef } from "@opengeni/contracts";
|
|
5
5
|
export declare const SESSION_TITLE_MODEL_TOOL_NAME = "opengeni__set_session_title";
|
|
6
6
|
export declare function shouldRequestMissingSessionTitle(input: {
|
|
7
7
|
title: string | null;
|
|
8
8
|
titleSource: "user" | "agent" | null;
|
|
9
|
+
agentConfig?: ResolvedAgentConfig | null;
|
|
9
10
|
firstPartyMcpTools: readonly FirstPartyMcpToolName[];
|
|
10
11
|
firstPartyMcpPermissions: readonly Permission[] | null;
|
|
11
12
|
}): boolean;
|
|
@@ -20,6 +21,7 @@ export declare function shouldRequestMissingSessionTitle(input: {
|
|
|
20
21
|
export declare function routeAllowsSessionTitleRequests(resolvedModel: ReturnType<OpenGeniRuntime["resolveTurnModel"]>): boolean;
|
|
21
22
|
export declare function sessionTitleToolPlan(input: {
|
|
22
23
|
tools: readonly ToolRef[];
|
|
24
|
+
agentConfig?: ResolvedAgentConfig | null;
|
|
23
25
|
selectedFirstPartyMcpTools: readonly FirstPartyMcpToolName[];
|
|
24
26
|
shouldRequestTitle: boolean;
|
|
25
27
|
parallelGenerationAvailable: boolean;
|
|
@@ -81,6 +81,7 @@ export type TurnStreamAttemptDeps = {
|
|
|
81
81
|
groupBoxBackend: Settings["sandboxBackend"];
|
|
82
82
|
turnExecutionPolicy: TurnExecutionPolicyV1;
|
|
83
83
|
turn: Pick<SessionTurn, "initiator" | "initiatorContext"> & {
|
|
84
|
+
initiatingHumanSubjectId: string | null;
|
|
84
85
|
id: string;
|
|
85
86
|
executionGeneration: number;
|
|
86
87
|
model: string;
|
|
@@ -25,6 +25,7 @@ export type TurnSettleFn = (input: {
|
|
|
25
25
|
sessionStatus: SessionStatus;
|
|
26
26
|
activeTurnId: string | null;
|
|
27
27
|
suppressGoalContinuation?: boolean;
|
|
28
|
+
allowanceGoalPause?: ApplySessionTurnSettlementInput["allowanceGoalPause"];
|
|
28
29
|
consumeRequestedCompactionFailure?: boolean;
|
|
29
30
|
runState?: ApplySessionTurnSettlementInput["runState"];
|
|
30
31
|
}) => Promise<boolean>;
|
|
@@ -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 {};
|
|
@@ -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,4 +1,4 @@
|
|
|
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
2
|
import type { Settings } from "@opengeni/config";
|
|
3
3
|
import { type Database } from "@opengeni/db";
|
|
4
4
|
import { type NormalizedRunCredentialMaterial } from "@opengeni/runtime";
|
|
@@ -22,6 +22,8 @@ export type RunCredentialResolutionContext = {
|
|
|
22
22
|
initiatingHumanSubjectId?: string | null;
|
|
23
23
|
/** Installed in-process API routes must never enter a product callback. */
|
|
24
24
|
localMcpServerIds?: readonly string[];
|
|
25
|
+
/** Exact execution selection, resolved once at the turn policy boundary. */
|
|
26
|
+
effectiveTools: readonly ToolRef[];
|
|
25
27
|
};
|
|
26
28
|
export type BoundRunCredentialResolver = {
|
|
27
29
|
resolve(input: {
|
|
@@ -29,7 +31,7 @@ export type BoundRunCredentialResolver = {
|
|
|
29
31
|
forceRefresh: boolean;
|
|
30
32
|
}): Promise<NormalizedRunCredentialMaterial | null>;
|
|
31
33
|
};
|
|
32
|
-
export declare function buildRunCredentialsRequest(input: Omit<RunCredentialResolutionContext, "db" | "connectionCredentials" | "settings" | "initiatingHumanSubjectId"> & {
|
|
34
|
+
export declare function buildRunCredentialsRequest(input: Omit<RunCredentialResolutionContext, "db" | "connectionCredentials" | "settings" | "initiatingHumanSubjectId" | "effectiveTools"> & {
|
|
33
35
|
rootSessionId: string;
|
|
34
36
|
purpose: "provision" | "renewal";
|
|
35
37
|
forceRefresh: boolean;
|
|
@@ -357,7 +357,7 @@ export type DispatchScheduledTaskRunResult = {
|
|
|
357
357
|
diagnostic?: import("@opengeni/contracts").ConnectionAccountSelectionDiagnostic;
|
|
358
358
|
/** Present when the occurrence was refused as a visible run receipt. */
|
|
359
359
|
refusal?: import("@opengeni/contracts").ScheduledTaskAdmissionRefusal;
|
|
360
|
-
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" | "connection_account_unavailable" | "scheduled_authority_unavailable" | "machine_target_unavailable" | "machine_enrollment_inactive" | "variable_set_unavailable" | "rig_version_unavailable" | "knowledge_source_paused" | "legacy_source_schedule_requires_migration" | "incident_preflight_metadata_missing" | "incident_responder_under_capable" | "incident_data_source_unsuitable";
|
|
360
|
+
reason: "insufficient_credits" | "allowance_exhausted" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | "malformed_manual_trigger" | "scheduled_task_paused" | "scheduled_authority_exhausted" | "scheduled_run_terminal" | "scheduled_execution_unrepresentable" | "connection_account_unavailable" | "scheduled_authority_unavailable" | "machine_target_unavailable" | "machine_enrollment_inactive" | "variable_set_unavailable" | "rig_version_unavailable" | "knowledge_source_paused" | "legacy_source_schedule_requires_migration" | "incident_preflight_metadata_missing" | "incident_responder_under_capable" | "incident_data_source_unsuitable";
|
|
361
361
|
} | {
|
|
362
362
|
action: "start" | "signal";
|
|
363
363
|
accountId: string;
|