@caupulican/pi-adaptative 0.86.3 → 0.86.6
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/CHANGELOG.md +44 -0
- package/dist/core/agent-paths.d.ts +13 -0
- package/dist/core/agent-paths.d.ts.map +1 -1
- package/dist/core/agent-paths.js +23 -0
- package/dist/core/agent-paths.js.map +1 -1
- package/dist/core/autonomy/bounded-completion.d.ts +7 -0
- package/dist/core/autonomy/bounded-completion.d.ts.map +1 -1
- package/dist/core/autonomy/bounded-completion.js +12 -4
- package/dist/core/autonomy/bounded-completion.js.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.d.ts +2 -0
- package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.js +6 -3
- package/dist/core/autonomy/lane-tool-surface.js.map +1 -1
- package/dist/core/autonomy/subagent-prompt.js +1 -1
- package/dist/core/autonomy/subagent-prompt.js.map +1 -1
- package/dist/core/background-lane-controller.d.ts +25 -2
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +67 -0
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/delegation/replay-safe-mailbox-bounds.d.ts +4 -0
- package/dist/core/delegation/replay-safe-mailbox-bounds.d.ts.map +1 -0
- package/dist/core/delegation/replay-safe-mailbox-bounds.js +20 -0
- package/dist/core/delegation/replay-safe-mailbox-bounds.js.map +1 -0
- package/dist/core/delegation/sanitized-context-fork.d.ts +25 -0
- package/dist/core/delegation/sanitized-context-fork.d.ts.map +1 -0
- package/dist/core/delegation/sanitized-context-fork.js +299 -0
- package/dist/core/delegation/sanitized-context-fork.js.map +1 -0
- package/dist/core/delegation/session-root-mailbox.d.ts +75 -0
- package/dist/core/delegation/session-root-mailbox.d.ts.map +1 -0
- package/dist/core/delegation/session-root-mailbox.js +627 -0
- package/dist/core/delegation/session-root-mailbox.js.map +1 -0
- package/dist/core/delegation/worker-agent-control-coordinator.d.ts +102 -9
- package/dist/core/delegation/worker-agent-control-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-agent-control-coordinator.js +1307 -125
- package/dist/core/delegation/worker-agent-control-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-agent-control.d.ts +183 -8
- package/dist/core/delegation/worker-agent-control.d.ts.map +1 -1
- package/dist/core/delegation/worker-agent-control.js +778 -48
- package/dist/core/delegation/worker-agent-control.js.map +1 -1
- package/dist/core/delegation/worker-attempt-executor.d.ts +9 -0
- package/dist/core/delegation/worker-attempt-executor.d.ts.map +1 -1
- package/dist/core/delegation/worker-attempt-executor.js +479 -214
- package/dist/core/delegation/worker-attempt-executor.js.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.d.ts +9 -0
- package/dist/core/delegation/worker-authority-resolver.d.ts.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.js +21 -2
- package/dist/core/delegation/worker-authority-resolver.js.map +1 -1
- package/dist/core/delegation/worker-context-fork-store.d.ts +71 -0
- package/dist/core/delegation/worker-context-fork-store.d.ts.map +1 -0
- package/dist/core/delegation/worker-context-fork-store.js +437 -0
- package/dist/core/delegation/worker-context-fork-store.js.map +1 -0
- package/dist/core/delegation/worker-context-inheritance-policy.d.ts +18 -0
- package/dist/core/delegation/worker-context-inheritance-policy.d.ts.map +1 -0
- package/dist/core/delegation/worker-context-inheritance-policy.js +28 -0
- package/dist/core/delegation/worker-context-inheritance-policy.js.map +1 -0
- package/dist/core/delegation/worker-conversation-revision.d.ts +31 -0
- package/dist/core/delegation/worker-conversation-revision.d.ts.map +1 -0
- package/dist/core/delegation/worker-conversation-revision.js +203 -0
- package/dist/core/delegation/worker-conversation-revision.js.map +1 -0
- package/dist/core/delegation/worker-conversation-store.d.ts +130 -18
- package/dist/core/delegation/worker-conversation-store.d.ts.map +1 -1
- package/dist/core/delegation/worker-conversation-store.js +1263 -79
- package/dist/core/delegation/worker-conversation-store.js.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.d.ts +30 -2
- package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.js +675 -111
- package/dist/core/delegation/worker-delegation-controller.js.map +1 -1
- package/dist/core/delegation/worker-delegation-request.d.ts +2 -0
- package/dist/core/delegation/worker-delegation-request.d.ts.map +1 -1
- package/dist/core/delegation/worker-delegation-request.js.map +1 -1
- package/dist/core/delegation/worker-dispatch-scheduler.d.ts +20 -1
- package/dist/core/delegation/worker-dispatch-scheduler.d.ts.map +1 -1
- package/dist/core/delegation/worker-dispatch-scheduler.js +210 -37
- package/dist/core/delegation/worker-dispatch-scheduler.js.map +1 -1
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -1
- package/dist/core/delegation/worker-execution-policy.js +14 -2
- package/dist/core/delegation/worker-execution-policy.js.map +1 -1
- package/dist/core/delegation/worker-fleet-limits.d.ts +38 -0
- package/dist/core/delegation/worker-fleet-limits.d.ts.map +1 -0
- package/dist/core/delegation/worker-fleet-limits.js +113 -0
- package/dist/core/delegation/worker-fleet-limits.js.map +1 -0
- package/dist/core/delegation/worker-lane-projection.d.ts +1 -0
- package/dist/core/delegation/worker-lane-projection.d.ts.map +1 -1
- package/dist/core/delegation/worker-lane-projection.js +6 -2
- package/dist/core/delegation/worker-lane-projection.js.map +1 -1
- package/dist/core/delegation/worker-lifecycle.d.ts +20 -3
- package/dist/core/delegation/worker-lifecycle.d.ts.map +1 -1
- package/dist/core/delegation/worker-lifecycle.js +42 -18
- package/dist/core/delegation/worker-lifecycle.js.map +1 -1
- package/dist/core/delegation/worker-notification-coordinator.d.ts +4 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-notification-coordinator.js +45 -4
- package/dist/core/delegation/worker-notification-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-provider-turn-protocol.d.ts +50 -0
- package/dist/core/delegation/worker-provider-turn-protocol.d.ts.map +1 -0
- package/dist/core/delegation/worker-provider-turn-protocol.js +185 -0
- package/dist/core/delegation/worker-provider-turn-protocol.js.map +1 -0
- package/dist/core/delegation/worker-recovery-coordinator.d.ts +45 -4
- package/dist/core/delegation/worker-recovery-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-recovery-coordinator.js +223 -17
- package/dist/core/delegation/worker-recovery-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-retry-policy.d.ts +36 -0
- package/dist/core/delegation/worker-retry-policy.d.ts.map +1 -0
- package/dist/core/delegation/worker-retry-policy.js +41 -0
- package/dist/core/delegation/worker-retry-policy.js.map +1 -0
- package/dist/core/delegation/worker-runner.d.ts +3 -1
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +4 -2
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/delegation/worker-task-view.d.ts +43 -0
- package/dist/core/delegation/worker-task-view.d.ts.map +1 -0
- package/dist/core/delegation/worker-task-view.js +194 -0
- package/dist/core/delegation/worker-task-view.js.map +1 -0
- package/dist/core/delegation/worker-terminal-handoff-coordinator.d.ts +55 -0
- package/dist/core/delegation/worker-terminal-handoff-coordinator.d.ts.map +1 -0
- package/dist/core/delegation/worker-terminal-handoff-coordinator.js +179 -0
- package/dist/core/delegation/worker-terminal-handoff-coordinator.js.map +1 -0
- package/dist/core/delegation/worker-tree-budget-coordinator.d.ts +2 -2
- package/dist/core/delegation/worker-tree-budget-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-tree-budget-coordinator.js +12 -46
- package/dist/core/delegation/worker-tree-budget-coordinator.js.map +1 -1
- package/dist/core/goals/goal-continuation-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-controller.js +15 -0
- package/dist/core/goals/goal-continuation-controller.js.map +1 -1
- package/dist/core/goals/goal-state.d.ts +6 -0
- package/dist/core/goals/goal-state.d.ts.map +1 -1
- package/dist/core/goals/goal-state.js +1 -0
- package/dist/core/goals/goal-state.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +1 -0
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +25 -3
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/keybindings.d.ts +10 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/orchestration/attempt-ordering.d.ts +9 -0
- package/dist/core/orchestration/attempt-ordering.d.ts.map +1 -0
- package/dist/core/orchestration/attempt-ordering.js +29 -0
- package/dist/core/orchestration/attempt-ordering.js.map +1 -0
- package/dist/core/orchestration/capability-gateway.d.ts +19 -0
- package/dist/core/orchestration/capability-gateway.d.ts.map +1 -1
- package/dist/core/orchestration/capability-gateway.js +19 -2
- package/dist/core/orchestration/capability-gateway.js.map +1 -1
- package/dist/core/orchestration/contracts.d.ts +43 -3
- package/dist/core/orchestration/contracts.d.ts.map +1 -1
- package/dist/core/orchestration/contracts.js +24 -0
- package/dist/core/orchestration/contracts.js.map +1 -1
- package/dist/core/orchestration/delegation-ledger.d.ts +8 -3
- package/dist/core/orchestration/delegation-ledger.d.ts.map +1 -1
- package/dist/core/orchestration/delegation-ledger.js +148 -55
- package/dist/core/orchestration/delegation-ledger.js.map +1 -1
- package/dist/core/orchestration/event-store.d.ts +6 -3
- package/dist/core/orchestration/event-store.d.ts.map +1 -1
- package/dist/core/orchestration/event-store.js +228 -30
- package/dist/core/orchestration/event-store.js.map +1 -1
- package/dist/core/orchestration/task-runtime-codecs.d.ts +31 -0
- package/dist/core/orchestration/task-runtime-codecs.d.ts.map +1 -0
- package/dist/core/orchestration/task-runtime-codecs.js +1471 -0
- package/dist/core/orchestration/task-runtime-codecs.js.map +1 -0
- package/dist/core/orchestration/task-runtime-projection.d.ts +30 -0
- package/dist/core/orchestration/task-runtime-projection.d.ts.map +1 -0
- package/dist/core/orchestration/task-runtime-projection.js +340 -0
- package/dist/core/orchestration/task-runtime-projection.js.map +1 -0
- package/dist/core/orchestration/task-runtime-reducer.d.ts +38 -0
- package/dist/core/orchestration/task-runtime-reducer.d.ts.map +1 -0
- package/dist/core/orchestration/task-runtime-reducer.js +1270 -0
- package/dist/core/orchestration/task-runtime-reducer.js.map +1 -0
- package/dist/core/orchestration/task-runtime-state.d.ts +142 -0
- package/dist/core/orchestration/task-runtime-state.d.ts.map +1 -0
- package/dist/core/orchestration/task-runtime-state.js +14 -0
- package/dist/core/orchestration/task-runtime-state.js.map +1 -0
- package/dist/core/orchestration/task-runtime.d.ts +44 -98
- package/dist/core/orchestration/task-runtime.d.ts.map +1 -1
- package/dist/core/orchestration/task-runtime.js +357 -1113
- package/dist/core/orchestration/task-runtime.js.map +1 -1
- package/dist/core/orchestration/worker-context-fork-reference.d.ts +20 -0
- package/dist/core/orchestration/worker-context-fork-reference.d.ts.map +1 -0
- package/dist/core/orchestration/worker-context-fork-reference.js +53 -0
- package/dist/core/orchestration/worker-context-fork-reference.js.map +1 -0
- package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -1
- package/dist/core/orchestration/worker-execution-contract.js +4 -2
- package/dist/core/orchestration/worker-execution-contract.js.map +1 -1
- package/dist/core/research/research-runner.d.ts +2 -0
- package/dist/core/research/research-runner.d.ts.map +1 -1
- package/dist/core/research/research-runner.js +1 -0
- package/dist/core/research/research-runner.js.map +1 -1
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +8 -0
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/secrets/credential-project.d.ts.map +1 -1
- package/dist/core/secrets/credential-project.js +24 -2
- package/dist/core/secrets/credential-project.js.map +1 -1
- package/dist/core/security/secret-text.d.ts +3 -0
- package/dist/core/security/secret-text.d.ts.map +1 -1
- package/dist/core/security/secret-text.js +15 -0
- package/dist/core/security/secret-text.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +160 -8
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +33 -15
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +763 -115
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/goal.d.ts +1 -0
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +9 -1
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/activity-lane.d.ts +5 -0
- package/dist/modes/interactive/components/activity-lane.d.ts.map +1 -1
- package/dist/modes/interactive/components/activity-lane.js +133 -49
- package/dist/modes/interactive/components/activity-lane.js.map +1 -1
- package/dist/modes/interactive/components/agents-overlay.d.ts +40 -0
- package/dist/modes/interactive/components/agents-overlay.d.ts.map +1 -0
- package/dist/modes/interactive/components/agents-overlay.js +153 -0
- package/dist/modes/interactive/components/agents-overlay.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +18 -13
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.d.ts +1 -1
- package/dist/modes/interactive/interactive-event-controller.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.js +6 -3
- package/dist/modes/interactive/interactive-event-controller.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +51 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/key-handlers.d.ts +1 -0
- package/dist/modes/interactive/key-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/key-handlers.js +1 -0
- package/dist/modes/interactive/key-handlers.js.map +1 -1
- package/docs/harness-architecture.md +61 -17
- package/docs/settings.md +17 -9
- package/docs/worker-profiles.md +6 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -1,97 +1,15 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AgentBindingContract, type ApprovalOutcome, type ApprovalRequestContract, type AttemptCheckpoint, type AttemptLease, type AttemptRetryState, type EvidenceContract, type ExecutionGrant, type ObjectiveContract, type OrchestrationDispatchRequest, type TaskContract, type WorkerResultContract } from "./contracts.ts";
|
|
2
2
|
import { type OrchestrationEventStore } from "./event-store.ts";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export interface TaskRuntimeState {
|
|
9
|
-
task: TaskContract;
|
|
10
|
-
attemptIds: readonly string[];
|
|
11
|
-
verification?: {
|
|
12
|
-
verifierTaskId: string;
|
|
13
|
-
verifierAttemptId: string;
|
|
14
|
-
verdict: "accepted" | "rejected" | "inconclusive";
|
|
15
|
-
reasonCode: string;
|
|
16
|
-
completedAt: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface AttemptRuntimeState {
|
|
20
|
-
attemptId: string;
|
|
21
|
-
taskId: string;
|
|
22
|
-
dispatch: OrchestrationDispatchRequest;
|
|
23
|
-
status: AttemptStatus;
|
|
24
|
-
reasonCode?: string;
|
|
25
|
-
grantId?: string;
|
|
26
|
-
/** Full compiled authority for new attempts; grantId alone is retained only when replaying legacy events. */
|
|
27
|
-
grant?: ExecutionGrant;
|
|
28
|
-
agentId?: string;
|
|
29
|
-
lease?: AttemptLease;
|
|
30
|
-
checkpointIds: readonly string[];
|
|
31
|
-
result?: WorkerResultContract;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
}
|
|
35
|
-
export interface NotificationRuntimeState {
|
|
36
|
-
notificationId: string;
|
|
37
|
-
objectiveId: string;
|
|
38
|
-
attemptId?: string;
|
|
39
|
-
status: "pending" | "delivered";
|
|
40
|
-
message: string;
|
|
41
|
-
createdAt: string;
|
|
42
|
-
deliveredAt?: string;
|
|
43
|
-
}
|
|
44
|
-
export interface ApprovalRuntimeState {
|
|
45
|
-
request: ApprovalRequestContract;
|
|
46
|
-
status: "pending" | ApprovalOutcome;
|
|
47
|
-
resolution?: ApprovalResolutionContract;
|
|
48
|
-
}
|
|
49
|
-
export interface TaskRuntimeProjection {
|
|
50
|
-
lastOrdinal: number;
|
|
51
|
-
agents: Readonly<Record<string, AgentBindingContract>>;
|
|
52
|
-
objectives: Readonly<Record<string, ObjectiveRuntimeState>>;
|
|
53
|
-
tasks: Readonly<Record<string, TaskRuntimeState>>;
|
|
54
|
-
attempts: Readonly<Record<string, AttemptRuntimeState>>;
|
|
55
|
-
checkpoints: Readonly<Record<string, AttemptCheckpoint>>;
|
|
56
|
-
approvals: Readonly<Record<string, ApprovalRuntimeState>>;
|
|
57
|
-
notifications: Readonly<Record<string, NotificationRuntimeState>>;
|
|
58
|
-
}
|
|
59
|
-
export interface CreateObjectiveInput {
|
|
60
|
-
objectiveId?: string;
|
|
61
|
-
title: string;
|
|
62
|
-
description: string;
|
|
63
|
-
constraints?: readonly string[];
|
|
64
|
-
acceptanceCriteria?: readonly AcceptanceCriterion[];
|
|
65
|
-
riskBudget?: RiskBudget;
|
|
66
|
-
}
|
|
67
|
-
export interface CreateTaskInput {
|
|
68
|
-
taskId?: string;
|
|
69
|
-
objectiveId: string;
|
|
70
|
-
title: string;
|
|
71
|
-
description: string;
|
|
72
|
-
role: TaskContract["role"];
|
|
73
|
-
dependsOn?: readonly string[];
|
|
74
|
-
requiredCapabilities?: TaskContract["requiredCapabilities"];
|
|
75
|
-
acceptanceCriterionIds?: readonly string[];
|
|
76
|
-
verificationOfTaskId?: string;
|
|
77
|
-
riskBudget?: RiskBudget;
|
|
78
|
-
}
|
|
3
|
+
import { type VerificationTransitionInput } from "./task-runtime-reducer.ts";
|
|
4
|
+
import { type ApprovalRuntimeState, type AttemptDispatchReadiness, type AttemptRuntimeState, type CreateObjectiveInput, type CreateTaskInput, type NotificationRuntimeState, type OrchestrationProjectionCapacity, type OrchestrationProjectionHeadroomRequest, type PreparedTaskAttempt, type RegisterAgentInput, type TaskRuntimeProjection, type TaskRuntimeState } from "./task-runtime-state.ts";
|
|
5
|
+
export { validateTaskDependencyIds } from "./task-runtime-codecs.ts";
|
|
6
|
+
export { projectOrchestrationEvents, reduceOrchestrationEvent, } from "./task-runtime-reducer.ts";
|
|
7
|
+
export { type ApprovalRuntimeState, type AttemptDispatchReadiness, type AttemptRuntimeState, type CreateObjectiveInput, type CreateTaskInput, DurableTaskRuntimeError, type NotificationRuntimeState, type ObjectiveRuntimeState, type OrchestrationProjectionCapacity, type OrchestrationProjectionHeadroomRequest, type OrchestrationProjectionSlotCounts, type PreparedTaskAttempt, type RegisterAgentInput, type TaskRuntimeProjection, type TaskRuntimeState, } from "./task-runtime-state.ts";
|
|
79
8
|
export interface DurableTaskRuntimeOptions {
|
|
80
9
|
store: OrchestrationEventStore;
|
|
81
10
|
now?: () => number;
|
|
82
11
|
createId?: () => string;
|
|
83
12
|
}
|
|
84
|
-
export interface RegisterAgentInput {
|
|
85
|
-
agentId?: string;
|
|
86
|
-
parentAgentId?: string;
|
|
87
|
-
role: AgentBindingContract["role"];
|
|
88
|
-
resumeContext: AgentResumeContext;
|
|
89
|
-
}
|
|
90
|
-
export declare class DurableTaskRuntimeError extends Error {
|
|
91
|
-
constructor(message: string);
|
|
92
|
-
}
|
|
93
|
-
export declare function reduceOrchestrationEvent(projection: TaskRuntimeProjection, event: OrchestrationEvent): TaskRuntimeProjection;
|
|
94
|
-
export declare function projectOrchestrationEvents(events: readonly OrchestrationEvent[]): TaskRuntimeProjection;
|
|
95
13
|
export declare class DurableTaskRuntime {
|
|
96
14
|
private readonly store;
|
|
97
15
|
private readonly now;
|
|
@@ -99,7 +17,32 @@ export declare class DurableTaskRuntime {
|
|
|
99
17
|
private state;
|
|
100
18
|
constructor(options: DurableTaskRuntimeOptions);
|
|
101
19
|
getSnapshot(): TaskRuntimeProjection;
|
|
20
|
+
/** Read-only retained-record counts and remaining lifetime slots for orchestration admission. */
|
|
21
|
+
getProjectionCapacity(): OrchestrationProjectionCapacity;
|
|
22
|
+
/**
|
|
23
|
+
* Preflight every record needed by a multi-event operation before its first append. Callers use
|
|
24
|
+
* this to reserve implementation and mandatory-verifier task/attempt pairs atomically.
|
|
25
|
+
*/
|
|
26
|
+
assertProjectionHeadroom(required: OrchestrationProjectionHeadroomRequest): OrchestrationProjectionCapacity;
|
|
27
|
+
/**
|
|
28
|
+
* Preflight the idempotent evidence batch for one objective before synchronizing any member.
|
|
29
|
+
* The objective may be absent when its creation is part of the same compound operation.
|
|
30
|
+
*/
|
|
31
|
+
assertObjectiveEvidenceHeadroom(objectiveId: string, evidenceIds: readonly string[]): number;
|
|
32
|
+
/**
|
|
33
|
+
* Preflight the final retained objective record for a multi-event owner synchronization. This
|
|
34
|
+
* validates the objective metadata and the complete idempotently merged evidence batch before
|
|
35
|
+
* ensureObjective can append the first event, so a later byte rejection cannot leave a prefix.
|
|
36
|
+
*/
|
|
37
|
+
assertObjectiveSynchronizationHeadroom(input: CreateObjectiveInput & {
|
|
38
|
+
objectiveId: string;
|
|
39
|
+
}, evidence: readonly EvidenceContract[]): void;
|
|
102
40
|
registerAgent(input: RegisterAgentInput): AgentBindingContract;
|
|
41
|
+
/**
|
|
42
|
+
* Retire one idle persistent identity without deleting its binding, lineage, transcript pointers,
|
|
43
|
+
* or attempt history. A repeated call is inert and returns the durable retired binding.
|
|
44
|
+
*/
|
|
45
|
+
retireAgent(agentId: string): AgentBindingContract;
|
|
103
46
|
createObjective(input: CreateObjectiveInput): ObjectiveContract;
|
|
104
47
|
/** Create or synchronize owner-authored objective metadata without disturbing lifecycle or task state. */
|
|
105
48
|
ensureObjective(input: CreateObjectiveInput & {
|
|
@@ -107,7 +50,11 @@ export declare class DurableTaskRuntime {
|
|
|
107
50
|
}): ObjectiveContract;
|
|
108
51
|
recordObjectiveEvidence(objectiveId: string, evidence: EvidenceContract): EvidenceContract;
|
|
109
52
|
createTask(input: CreateTaskInput): TaskContract;
|
|
53
|
+
/** Atomically create a new task and its first queued attempt in one durable transition. */
|
|
54
|
+
prepareTaskAttempt(input: CreateTaskInput, dispatch: OrchestrationDispatchRequest, grantId?: string): PreparedTaskAttempt;
|
|
110
55
|
queueAttempt(taskId: string, dispatch: OrchestrationDispatchRequest, grantId?: string): AttemptRuntimeState;
|
|
56
|
+
/** Read-only controller seam for deciding whether one durable queued or suspended attempt may run. */
|
|
57
|
+
getAttemptDispatchReadiness(attemptId: string): AttemptDispatchReadiness;
|
|
111
58
|
bindAttemptGrant(attemptId: string, grant: ExecutionGrant): AttemptRuntimeState;
|
|
112
59
|
leaseAttempt(attemptId: string, ownerId: string, ttlMs: number, agentId?: string): AttemptLease;
|
|
113
60
|
startAttempt(attemptId: string, leaseId: string, fencingToken: number): AttemptRuntimeState;
|
|
@@ -121,13 +68,7 @@ export declare class DurableTaskRuntime {
|
|
|
121
68
|
usage?: AttemptCheckpoint["usage"];
|
|
122
69
|
}): AttemptCheckpoint;
|
|
123
70
|
finishAttempt(result: WorkerResultContract): AttemptRuntimeState;
|
|
124
|
-
finishVerification(args:
|
|
125
|
-
taskId: string;
|
|
126
|
-
verifierTaskId: string;
|
|
127
|
-
verifierAttemptId: string;
|
|
128
|
-
verdict: "accepted" | "rejected" | "inconclusive";
|
|
129
|
-
reasonCode: string;
|
|
130
|
-
}): TaskRuntimeState;
|
|
71
|
+
finishVerification(args: VerificationTransitionInput): TaskRuntimeState;
|
|
131
72
|
cancelAttempt(attemptId: string, reasonCode: string): AttemptRuntimeState;
|
|
132
73
|
/**
|
|
133
74
|
* The only runtime suspension transition. Callers must present the exact current owner and lease
|
|
@@ -139,6 +80,7 @@ export declare class DurableTaskRuntime {
|
|
|
139
80
|
leaseId: string;
|
|
140
81
|
fencingToken: number;
|
|
141
82
|
reasonCode: string;
|
|
83
|
+
retry?: AttemptRetryState;
|
|
142
84
|
}): AttemptRuntimeState;
|
|
143
85
|
failTask(taskId: string, reasonCode: string): TaskContract;
|
|
144
86
|
/**
|
|
@@ -148,7 +90,9 @@ export declare class DurableTaskRuntime {
|
|
|
148
90
|
*/
|
|
149
91
|
recoverInterruptedUnboundAttempts(shouldRecover?: (attempt: AttemptRuntimeState) => boolean): string[];
|
|
150
92
|
expireLeases(at?: number): string[];
|
|
151
|
-
requestAgentResume(agentId: string): AgentBindingContract;
|
|
93
|
+
requestAgentResume(agentId: string, attemptId: string): AgentBindingContract;
|
|
94
|
+
/** Read-only guard used before changing agent state; resumeAttempt repeats it authoritatively. */
|
|
95
|
+
assertAttemptReadyForResume(attemptId: string): void;
|
|
152
96
|
resumeAttempt(attemptId: string, agentId: string, ttlMs: number, ownerId?: string): AttemptLease;
|
|
153
97
|
pauseObjective(objectiveId: string): void;
|
|
154
98
|
resumeObjective(objectiveId: string): void;
|
|
@@ -164,15 +108,17 @@ export declare class DurableTaskRuntime {
|
|
|
164
108
|
message: string;
|
|
165
109
|
}): NotificationRuntimeState;
|
|
166
110
|
markNotificationDelivered(notificationId: string): NotificationRuntimeState;
|
|
111
|
+
private buildTask;
|
|
112
|
+
private normalizeDispatchForTask;
|
|
113
|
+
private assertTaskAttemptBudget;
|
|
167
114
|
private transitionObjective;
|
|
168
115
|
private requireObjective;
|
|
169
116
|
private requireDispatchableTask;
|
|
170
117
|
private requireAttempt;
|
|
171
118
|
private issueLease;
|
|
172
|
-
private approvalForAttempt;
|
|
173
119
|
private pendingApprovalForTask;
|
|
174
120
|
private requireActiveObjectiveForAttempt;
|
|
175
|
-
private
|
|
121
|
+
private assertRetryBackoffElapsed;
|
|
176
122
|
private requireLiveLease;
|
|
177
123
|
private refresh;
|
|
178
124
|
private commit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-runtime.d.ts","sourceRoot":"","sources":["../../../src/core/orchestration/task-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task-runtime.d.ts","sourceRoot":"","sources":["../../../src/core/orchestration/task-runtime.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,KAAK,oBAAoB,EAGzB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE5B,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EASnB,KAAK,iBAAiB,EAGtB,KAAK,4BAA4B,EAEjC,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,uBAAuB,EAAsC,MAAM,kBAAkB,CAAC;AA6BpG,OAAO,EAsBN,KAAK,2BAA2B,EAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EAEpB,KAAK,wBAAwB,EAE7B,KAAK,+BAA+B,EACpC,KAAK,sCAAsC,EAC3C,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAErB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EACN,0BAA0B,EAC1B,wBAAwB,GACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,+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