intentdna 1.9.0 → 1.9.3

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.
Files changed (131) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +227 -87
  4. package/dist/cli/commands/run-lifecycle.d.ts +61 -11
  5. package/dist/cli/commands/run-lifecycle.js +184 -50
  6. package/dist/cli/commands/run-observer.d.ts +15 -0
  7. package/dist/cli/commands/run-observer.js +210 -0
  8. package/dist/cli/commands/run.d.ts +16 -20
  9. package/dist/cli/commands/run.js +461 -659
  10. package/dist/cli/commands/sync.js +16 -12
  11. package/dist/cli/index.js +14 -5
  12. package/dist/compiler/compile.d.ts +1 -0
  13. package/dist/compiler/compile.js +1 -1
  14. package/dist/compiler/controller.d.ts +16 -0
  15. package/dist/compiler/controller.js +693 -0
  16. package/dist/compiler/input-resolver.d.ts +2 -0
  17. package/dist/compiler/input-resolver.js +22 -6
  18. package/dist/hooks/cli.d.ts +45 -0
  19. package/dist/hooks/cli.js +263 -31
  20. package/dist/hooks/host-event.d.ts +57 -0
  21. package/dist/hooks/host-event.js +187 -0
  22. package/dist/hooks/index.d.ts +1 -0
  23. package/dist/hooks/index.js +1 -0
  24. package/dist/hooks/protocol.d.ts +7 -0
  25. package/dist/hooks/schema.d.ts +1 -0
  26. package/dist/hooks/schema.js +89 -1
  27. package/dist/hooks/state.d.ts +23 -1
  28. package/dist/hooks/state.js +9 -0
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +1 -0
  31. package/dist/mcp/index.js +2 -0
  32. package/dist/mcp/tools-run.d.ts +4 -0
  33. package/dist/mcp/tools-run.js +419 -0
  34. package/dist/mcp/tools-state.d.ts +1 -1
  35. package/dist/mcp/tools-state.js +13 -241
  36. package/dist/runtime/artifact-store.d.ts +146 -0
  37. package/dist/runtime/artifact-store.js +1436 -0
  38. package/dist/runtime/canonical-attempt-outcome.d.ts +12 -0
  39. package/dist/runtime/canonical-attempt-outcome.js +195 -0
  40. package/dist/runtime/canonical-json.d.ts +10 -0
  41. package/dist/runtime/canonical-json.js +105 -0
  42. package/dist/runtime/canonical-run-application.d.ts +93 -0
  43. package/dist/runtime/canonical-run-application.js +229 -0
  44. package/dist/runtime/canonical-run-service.d.ts +454 -0
  45. package/dist/runtime/canonical-run-service.js +4760 -0
  46. package/dist/runtime/canonical-runtime-composition.d.ts +22 -0
  47. package/dist/runtime/canonical-runtime-composition.js +34 -0
  48. package/dist/runtime/canonical-runtime-projection.d.ts +3 -0
  49. package/dist/runtime/canonical-runtime-projection.js +4 -0
  50. package/dist/runtime/canonical-target-compiler.d.ts +46 -0
  51. package/dist/runtime/canonical-target-compiler.js +514 -0
  52. package/dist/runtime/claude-agent-identity.d.ts +2 -0
  53. package/dist/runtime/claude-agent-identity.js +21 -0
  54. package/dist/runtime/executable-run-plan.d.ts +328 -0
  55. package/dist/runtime/executable-run-plan.js +1485 -0
  56. package/dist/runtime/execution-authority.d.ts +83 -0
  57. package/dist/runtime/execution-authority.js +98 -0
  58. package/dist/runtime/handoff-resolver.js +4 -1
  59. package/dist/runtime/harness-pull-adapter.d.ts +146 -0
  60. package/dist/runtime/harness-pull-adapter.js +315 -0
  61. package/dist/runtime/index.d.ts +39 -14
  62. package/dist/runtime/index.js +29 -7
  63. package/dist/runtime/local-execution-authority.d.ts +194 -0
  64. package/dist/runtime/local-execution-authority.js +2897 -0
  65. package/dist/runtime/local-execution-reconciliation.d.ts +20 -0
  66. package/dist/runtime/local-execution-reconciliation.js +107 -0
  67. package/dist/runtime/local-execution-supervisor-script.d.ts +7 -0
  68. package/dist/runtime/local-execution-supervisor-script.js +793 -0
  69. package/dist/runtime/local-provider-sandbox.d.ts +42 -0
  70. package/dist/runtime/local-provider-sandbox.js +154 -0
  71. package/dist/runtime/local-verifier-execution.d.ts +24 -0
  72. package/dist/runtime/local-verifier-execution.js +290 -0
  73. package/dist/runtime/local-windows-execution-supervisor-script.d.ts +6 -0
  74. package/dist/runtime/local-windows-execution-supervisor-script.js +788 -0
  75. package/dist/runtime/plan-store.d.ts +30 -0
  76. package/dist/runtime/plan-store.js +231 -0
  77. package/dist/runtime/process-tree.d.ts +9 -0
  78. package/dist/runtime/process-tree.js +97 -24
  79. package/dist/runtime/providers/codex.js +2 -2
  80. package/dist/runtime/push-driver.d.ts +184 -0
  81. package/dist/runtime/push-driver.js +1002 -0
  82. package/dist/runtime/result-store.d.ts +34 -3
  83. package/dist/runtime/result-store.js +1073 -2
  84. package/dist/runtime/run-binding.d.ts +68 -0
  85. package/dist/runtime/run-binding.js +278 -0
  86. package/dist/runtime/run-contracts.d.ts +575 -0
  87. package/dist/runtime/run-contracts.js +58 -7
  88. package/dist/runtime/run-controller.d.ts +1 -6
  89. package/dist/runtime/run-controller.js +0 -41
  90. package/dist/runtime/run-store.d.ts +85 -7
  91. package/dist/runtime/run-store.js +2528 -186
  92. package/dist/runtime/skill-adapter.d.ts +18 -7
  93. package/dist/runtime/skill-adapter.js +100 -742
  94. package/dist/runtime/structured-output-validator.d.ts +44 -0
  95. package/dist/runtime/structured-output-validator.js +171 -0
  96. package/dist/runtime/verifier-command-binding.d.ts +22 -0
  97. package/dist/runtime/verifier-command-binding.js +162 -0
  98. package/dist/runtime/verifier.d.ts +46 -6
  99. package/dist/runtime/verifier.js +355 -53
  100. package/dist/runtime/windows-job-keeper.d.ts +47 -0
  101. package/dist/runtime/windows-job-keeper.js +231 -0
  102. package/dist/runtime/worker-executor.d.ts +17 -1
  103. package/dist/runtime/worker-executor.js +26 -5
  104. package/dist/runtime/workflow-plan-adapter.d.ts +19 -0
  105. package/dist/runtime/workflow-plan-adapter.js +502 -6
  106. package/dist/runtime/workflow-runtime-manifest.d.ts +1 -0
  107. package/dist/runtime/workflow-runtime-manifest.js +5 -0
  108. package/dist/runtime/workspace-isolation.d.ts +29 -2
  109. package/dist/runtime/workspace-isolation.js +488 -11
  110. package/dist/runtime/workspace-observation.d.ts +44 -0
  111. package/dist/runtime/workspace-observation.js +216 -0
  112. package/dist/schema/controller-registry.d.ts +0 -7
  113. package/dist/schema/controller-registry.js +0 -8
  114. package/dist/schema/types.d.ts +84 -10
  115. package/dist/schema/types.js +2 -0
  116. package/dist/schema/validate.js +151 -1
  117. package/dist/schema/validators/controllers.d.ts +1 -1
  118. package/dist/schema/validators/controllers.js +126 -41
  119. package/dist/schema/workflow-authoring-contract.js +2 -0
  120. package/dist/schema/yaml-parser.js +1 -1
  121. package/dist/templates/flutter-rewrite-new.dna.yaml +1 -0
  122. package/dist/templates/flutter-rewrite.dna.yaml +87 -60
  123. package/dist/templates/safe-refactoring.dna.yaml +1 -0
  124. package/native/windows-job-keeper/README.md +80 -0
  125. package/native/windows-job-keeper/bin/aarch64/intentdna-windows-job-keeper.exe +0 -0
  126. package/native/windows-job-keeper/bin/x86_64/intentdna-windows-job-keeper.exe +0 -0
  127. package/native/windows-job-keeper/keeper.c +979 -0
  128. package/native/windows-job-keeper/manifest.json +33 -0
  129. package/package.json +6 -2
  130. package/scripts/build-windows-job-keeper.mjs +172 -0
  131. package/scripts/verify-windows-job-keeper.mjs +184 -0
@@ -15,12 +15,14 @@ export { createClaudeCoreSyncTargetPlan, executeClaudeCoreSyncTargetPlan, format
15
15
  export type { ClaudeCoreAdapterCapabilityReport, ClaudeCoreCapabilityReportEntry, ClaudeCorePlannedArtifact, ClaudeCoreSyncTargetPlan, ClaudeCoreSyncTargetPlanOptions, ClaudeSettingsHookRegistration, ClaudeSyncMode, ExecuteClaudeCoreSyncTargetPlanResult, } from "./claude-sync-target.js";
16
16
  export type { AdapterCapabilityReport, CapabilityReportEntry, CapabilitySupportStatus, EvidenceClassification, EvidencePlan, PlannedArtifact, SyncTarget, SyncTargetMode, SyncTargetPlan, } from "./sync-target-plan.js";
17
17
  export { formatSyncTargetPlanDiagnostics, trackedOutputsForSyncTargetPlan, } from "./sync-target-plan.js";
18
- export { TASK_STATE_VALUES, TASK_STATE_TRANSITIONS, RETRY_BACKOFF_VALUES as RUNTIME_RETRY_BACKOFF_VALUES, TERMINAL_OUTCOME_KIND_VALUES, RUNTIME_EVENT_TYPE_VALUES, } from "./run-contracts.js";
19
- export type { RuntimeId, RunId, StepId, AttemptId, WorkerSessionId, ResultId, EventId, ClaimToken, JsonValue, TaskKey, AttemptIdentity, TaskState, TerminalTaskState, TaskRecord, TaskLease, TaskClaim, RetryBackoff as RuntimeRetryBackoff, RetryPolicy as RuntimeRetryPolicy, RetryDecision, AttemptPhase, AttemptRecord, HandoffSource, ReferenceHandoffBinding, QuoteHandoffBinding, StructuredHandoffBinding, NoHandoffBinding, HandoffBinding, StepOutputKind, DeclaredStepOutput, StepOutput, StepPacket, TerminalOutcomeKind, TerminalOutcome, ProviderEvent, ProviderExecutionResult, CommittedStepResult, RuntimeEventType, RuntimeEvent, } from "./run-contracts.js";
20
- export { RUN_STORE_SCHEMA_VERSION, RUN_STATUS_VALUES, RunStoreError, DurableRunStore, } from "./run-store.js";
21
- export type { RunStatus, TerminalRunStatus, RunCancellationIntent, RunTerminalRecord, RunRecord, StoredTaskClaim, RunStoreSnapshot, CreateRunStoreRecord, RunStoreUpdate, RunStoreUpdateResult, DurableRunStoreOptions, RunStoreErrorCode, } from "./run-store.js";
22
- export { ResultStoreError, ImmutableResultStore, } from "./result-store.js";
23
- export type { ResultStoreErrorCode, CommitStepResultRequest, CommitStepResultResponse, } from "./result-store.js";
18
+ export { TASK_STATE_VALUES, TASK_STATE_TRANSITIONS, CANONICAL_ACTIVATION_STATE_VALUES, CANONICAL_ACTIVATION_STATE_TRANSITIONS, RETRY_BACKOFF_VALUES as RUNTIME_RETRY_BACKOFF_VALUES, TERMINAL_OUTCOME_KIND_VALUES, RUNTIME_EVENT_TYPE_VALUES, CANONICAL_RUNTIME_EVENT_TYPE_VALUES, CANONICAL_RESULT_SCHEMA_VERSION, CANONICAL_WORKER_STOP_RECEIPT_SCHEMA_VERSION, CANONICAL_WORKSPACE_OBSERVATION_SCHEMA_VERSION, CANONICAL_VERIFIER_EXECUTION_RECEIPT_SCHEMA_VERSION, } from "./run-contracts.js";
19
+ export type { RuntimeId, RunId, StepId, ActivationId, AttemptId, WorkerSessionId, ResultId, EventId, ClaimToken, JsonValue, TaskKey, ActivationKey, CanonicalActivationState, CanonicalActivationRecord, AttemptExecutor, CanonicalAttemptRecord, CanonicalAttemptClaim, AttemptIdentity, TaskState, TerminalTaskState, TaskRecord, TaskLease, TaskClaim, RetryBackoff as RuntimeRetryBackoff, RetryPolicy as RuntimeRetryPolicy, RetryDecision, AttemptPhase, AttemptRecord, HandoffSource, ReferenceHandoffBinding, QuoteHandoffBinding, StructuredHandoffBinding, NoHandoffBinding, HandoffBinding, StepOutputKind, DeclaredStepOutput, StepOutput, StepPacket, TerminalOutcomeKind, TerminalOutcome, ProviderEvent, ProviderExecutionResult, CommittedStepResult, RuntimeEventType, RuntimeEvent, CanonicalRuntimeEventType, CanonicalRuntimeEventPayloadMap, CanonicalSemanticEventEnvelope, GateEvaluatedEvent, DecisionEvaluatedEvent, RouteSelectedEvent, ResultCommittedEvent, RunTerminalEvent, CanonicalRuntimeEvent, CanonicalResultOutput, CanonicalAttemptOutcome, CanonicalResultOutcome, CanonicalVerifierEvidenceRef, CanonicalVerificationResult, CanonicalEvidenceRef, CanonicalCommittedResult, CanonicalResultDigest, CanonicalResultRef, CanonicalWorkspacePlan, CanonicalWorkspaceAllocation, CanonicalWorkspaceObservation, CanonicalWorkerStopReceiptPayload, CanonicalWorkerStopReceipt, CanonicalWorkerNonlaunchAttestationPayload, CanonicalWorkerNonlaunchAttestation, CanonicalVerifierExecutionReceipt, } from "./run-contracts.js";
20
+ export { RUN_STORE_SCHEMA_VERSION, LEGACY_RUN_STORE_SCHEMA_VERSION, CANONICAL_RUN_STORE_SCHEMA_VERSION, RUN_STATUS_VALUES, RunStoreError, DurableRunStore, } from "./run-store.js";
21
+ export type { RunStatus, TerminalRunStatus, RunCancellationIntent, RunTerminalRecord, CanonicalRunTerminalRecord, RunRecord, StoredTaskClaim, RunStoreSnapshot, CanonicalRunTarget, CanonicalRunRecord, CanonicalRunStoreSnapshot, AnyRunStoreSnapshot, CreateRunStoreRecord, CreateCanonicalRunStoreRecord, RunStoreUpdate, RunStoreUpdateResult, CanonicalRunStoreUpdate, CanonicalRunStoreUpdateResult, DurableRunStoreOptions, RunStoreErrorCode, } from "./run-store.js";
22
+ export { ResultStoreError, ImmutableResultStore, ImmutableCanonicalResultStore, } from "./result-store.js";
23
+ export type { ResultStoreErrorCode, CommitStepResultRequest, CommitStepResultResponse, ImmutableCanonicalResultStoreOptions, PublishCanonicalResultResponse, } from "./result-store.js";
24
+ export { CanonicalAttemptOutcomeValidationError, canonicalAttemptOutcomeStatus, validateCanonicalAttemptOutcome, } from "./canonical-attempt-outcome.js";
25
+ export type { CanonicalAttemptOutcomeStatus, ValidatedCanonicalAttemptOutcome, } from "./canonical-attempt-outcome.js";
24
26
  export { HandoffResolutionError, HandoffResolver, } from "./handoff-resolver.js";
25
27
  export type { ReferenceHandoffRequest, QuoteHandoffRequest, StructuredHandoffRequest, NoHandoffRequest, HandoffRequest, StructuredValueValidator, HandoffResolverOptions, HandoffResolutionErrorCode, } from "./handoff-resolver.js";
26
28
  export { MalformedProviderResultError, decodeDeclaredOutputs, } from "./execution-provider.js";
@@ -33,13 +35,36 @@ export { runProcessTree, runProcessTreeWithTimeout, } from "./process-tree.js";
33
35
  export type { ProcessTerminationReason, ProcessTreeRunOptions, ProcessTreeRunResult, } from "./process-tree.js";
34
36
  export { executeWorkerAttempt } from "./worker-executor.js";
35
37
  export type { WorkerExecutorOptions, WorkerExecutionWithEvents, } from "./worker-executor.js";
36
- export { RunControllerError, RunController, } from "./run-controller.js";
37
- export type { ControllerReferenceHandoff, ControllerQuoteHandoff, ControllerStructuredHandoff, ControllerNoHandoff, ControllerHandoffDeclaration, MaterializeStepPacketInput, ControllerStepDefinition, WorkflowRetryLoopPolicy, ReconciledAttemptState, AttemptReconciler, RunControllerOptions, CreateControllerRunInput, ClaimedStep, RunControllerErrorCode, } from "./run-controller.js";
38
- export { WorkflowPlanAdapterError, adaptWorkflowPlan, adaptWorkflowRetryLoop, } from "./workflow-plan-adapter.js";
39
- export type { WorkflowPlanAdapterErrorCode, WorkflowPlanAdapterOptions, } from "./workflow-plan-adapter.js";
40
- export { WorkspaceIsolationError, planAttemptWorkspace, allocateAttemptWorkspace, inspectAttemptWorkspace, applyWorkspaceLifecycleDecision, defaultWorktreeRoot, describeWorkspace, } from "./workspace-isolation.js";
41
- export type { WorkspaceIsolation, WorkspaceIsolationErrorCode, AttemptWorkspaceRequest, SharedWorkspacePlan, IsolatedWorkspacePlan, AttemptWorkspacePlan, SharedWorkspaceAllocation, IsolatedWorkspaceAllocation, AttemptWorkspaceAllocation, WorkspaceInspection, WorkspacePreservationReason, WorkspaceLifecycleDecision, WorkspaceLifecycleResult, } from "./workspace-isolation.js";
38
+ export type { ControllerReferenceHandoff, ControllerQuoteHandoff, ControllerStructuredHandoff, ControllerNoHandoff, ControllerHandoffDeclaration, MaterializeStepPacketInput, ControllerStepDefinition, WorkflowRetryLoopPolicy, ReconciledAttemptState, AttemptReconciler, } from "./run-controller.js";
39
+ export { WorkflowPlanAdapterError, adaptWorkflowPlan, adaptWorkflowRetryLoop, adaptWorkflowPlanToExecutableRunPlan, } from "./workflow-plan-adapter.js";
40
+ export type { WorkflowPlanAdapterErrorCode, WorkflowPlanAdapterOptions, WorkflowExecutablePlanAdapterOptions, } from "./workflow-plan-adapter.js";
41
+ export * from "./canonical-json.js";
42
+ export * from "./executable-run-plan.js";
43
+ export * from "./run-binding.js";
44
+ export * from "./plan-store.js";
45
+ export * from "./artifact-store.js";
46
+ export * from "./canonical-target-compiler.js";
47
+ export * from "./canonical-run-application.js";
48
+ export * from "./canonical-run-service.js";
49
+ export * from "./canonical-runtime-composition.js";
50
+ export * from "./canonical-runtime-projection.js";
51
+ export * from "./harness-pull-adapter.js";
52
+ export * from "./push-driver.js";
53
+ export * from "./local-verifier-execution.js";
54
+ export * from "./local-provider-sandbox.js";
55
+ export * from "./execution-authority.js";
56
+ export { LocalExecutionAuthorityError, LocalAttemptExecutionAuthority, } from "./local-execution-authority.js";
57
+ export type { LocalExecutionIdentity, LocalAttemptExecutionAuthorityOptions, LocalExecutionPreparationRequest, LocalPreparedExecutionHandle, LocalPreparedExecutionInspection, LocalExecutionBindRequest, LocalExecutionAuthorityErrorCode, LocalExecutionAuthorityBinding, LocalExecutionProcessTreeRunResult, LocalExecutionRecoveryBinding, } from "./local-execution-authority.js";
58
+ export * from "./local-execution-reconciliation.js";
59
+ export * from "./windows-job-keeper.js";
60
+ export * from "./workspace-observation.js";
61
+ export * from "./structured-output-validator.js";
62
+ export * from "./verifier-command-binding.js";
63
+ export { WorkspaceIsolationError, LocalAttemptWorkspaceAuthority, planAttemptWorkspace, allocateAttemptWorkspace, inspectAttemptWorkspace, applyWorkspaceLifecycleDecision, defaultWorktreeRoot, describeWorkspace, } from "./workspace-isolation.js";
64
+ export type { WorkspaceIsolation, WorkspaceIsolationErrorCode, AttemptWorkspaceRequest, SharedWorkspacePlan, IsolatedWorkspacePlan, AttemptWorkspacePlan, SharedWorkspaceAllocation, IsolatedWorkspaceAllocation, AttemptWorkspaceAllocation, WorkspaceInspection, WorkspacePreservationReason, WorkspaceLifecycleDecision, WorkspaceLifecycleResult, LocalAttemptWorkspaceAuthorityOptions, } from "./workspace-isolation.js";
42
65
  export { MAX_EVALUATOR_RESULT_BYTES, EvaluatorResultError, parseEvaluatorResult, } from "./evaluator.js";
43
66
  export type { EvaluatorResult, ParseEvaluatorResultOptions, } from "./evaluator.js";
44
- export { runCompletionVerifier, runCheckpointVerifier, } from "./verifier.js";
45
- export type { VerifierRuntimeContext, VerifierCheckResult, } from "./verifier.js";
67
+ export { LocalVerifierExecutionPort, } from "./canonical-run-service.js";
68
+ export type { CanonicalVerifierExecutionPort, CanonicalVerifierExecutionRequest, CanonicalVerifierExecutionAuthorityReceipt, } from "./canonical-run-service.js";
69
+ export { execVerifierCommand, runCompletionVerifier, runCheckpointVerifier, } from "./verifier.js";
70
+ export type { VerifierRuntimeContext, VerifierCheckResult, VerifierCommandExecutionResult, } from "./verifier.js";
@@ -8,17 +8,39 @@ export { codexSyncDispatcherCommand, createCodexSyncTargetPlan, executeCodexSync
8
8
  export { createClaudeCoreSyncTargetPlan, executeClaudeCoreSyncTargetPlan, formatClaudeCoreSyncTargetPlanDryRun, removeLegacyBashHooks, } from "./claude-sync-target.js";
9
9
  export { formatSyncTargetPlanDiagnostics, trackedOutputsForSyncTargetPlan, } from "./sync-target-plan.js";
10
10
  // Foundation Runtime canonical execution surface.
11
- export { TASK_STATE_VALUES, TASK_STATE_TRANSITIONS, RETRY_BACKOFF_VALUES as RUNTIME_RETRY_BACKOFF_VALUES, TERMINAL_OUTCOME_KIND_VALUES, RUNTIME_EVENT_TYPE_VALUES, } from "./run-contracts.js";
12
- export { RUN_STORE_SCHEMA_VERSION, RUN_STATUS_VALUES, RunStoreError, DurableRunStore, } from "./run-store.js";
13
- export { ResultStoreError, ImmutableResultStore, } from "./result-store.js";
11
+ export { TASK_STATE_VALUES, TASK_STATE_TRANSITIONS, CANONICAL_ACTIVATION_STATE_VALUES, CANONICAL_ACTIVATION_STATE_TRANSITIONS, RETRY_BACKOFF_VALUES as RUNTIME_RETRY_BACKOFF_VALUES, TERMINAL_OUTCOME_KIND_VALUES, RUNTIME_EVENT_TYPE_VALUES, CANONICAL_RUNTIME_EVENT_TYPE_VALUES, CANONICAL_RESULT_SCHEMA_VERSION, CANONICAL_WORKER_STOP_RECEIPT_SCHEMA_VERSION, CANONICAL_WORKSPACE_OBSERVATION_SCHEMA_VERSION, CANONICAL_VERIFIER_EXECUTION_RECEIPT_SCHEMA_VERSION, } from "./run-contracts.js";
12
+ export { RUN_STORE_SCHEMA_VERSION, LEGACY_RUN_STORE_SCHEMA_VERSION, CANONICAL_RUN_STORE_SCHEMA_VERSION, RUN_STATUS_VALUES, RunStoreError, DurableRunStore, } from "./run-store.js";
13
+ export { ResultStoreError, ImmutableResultStore, ImmutableCanonicalResultStore, } from "./result-store.js";
14
+ export { CanonicalAttemptOutcomeValidationError, canonicalAttemptOutcomeStatus, validateCanonicalAttemptOutcome, } from "./canonical-attempt-outcome.js";
14
15
  export { HandoffResolutionError, HandoffResolver, } from "./handoff-resolver.js";
15
16
  export { MalformedProviderResultError, decodeDeclaredOutputs, } from "./execution-provider.js";
16
17
  export { createClaudeExecutionProvider } from "./providers/claude.js";
17
18
  export { createCodexExecutionProvider } from "./providers/codex.js";
18
19
  export { runProcessTree, runProcessTreeWithTimeout, } from "./process-tree.js";
19
20
  export { executeWorkerAttempt } from "./worker-executor.js";
20
- export { RunControllerError, RunController, } from "./run-controller.js";
21
- export { WorkflowPlanAdapterError, adaptWorkflowPlan, adaptWorkflowRetryLoop, } from "./workflow-plan-adapter.js";
22
- export { WorkspaceIsolationError, planAttemptWorkspace, allocateAttemptWorkspace, inspectAttemptWorkspace, applyWorkspaceLifecycleDecision, defaultWorktreeRoot, describeWorkspace, } from "./workspace-isolation.js";
21
+ export { WorkflowPlanAdapterError, adaptWorkflowPlan, adaptWorkflowRetryLoop, adaptWorkflowPlanToExecutableRunPlan, } from "./workflow-plan-adapter.js";
22
+ export * from "./canonical-json.js";
23
+ export * from "./executable-run-plan.js";
24
+ export * from "./run-binding.js";
25
+ export * from "./plan-store.js";
26
+ export * from "./artifact-store.js";
27
+ export * from "./canonical-target-compiler.js";
28
+ export * from "./canonical-run-application.js";
29
+ export * from "./canonical-run-service.js";
30
+ export * from "./canonical-runtime-composition.js";
31
+ export * from "./canonical-runtime-projection.js";
32
+ export * from "./harness-pull-adapter.js";
33
+ export * from "./push-driver.js";
34
+ export * from "./local-verifier-execution.js";
35
+ export * from "./local-provider-sandbox.js";
36
+ export * from "./execution-authority.js";
37
+ export { LocalExecutionAuthorityError, LocalAttemptExecutionAuthority, } from "./local-execution-authority.js";
38
+ export * from "./local-execution-reconciliation.js";
39
+ export * from "./windows-job-keeper.js";
40
+ export * from "./workspace-observation.js";
41
+ export * from "./structured-output-validator.js";
42
+ export * from "./verifier-command-binding.js";
43
+ export { WorkspaceIsolationError, LocalAttemptWorkspaceAuthority, planAttemptWorkspace, allocateAttemptWorkspace, inspectAttemptWorkspace, applyWorkspaceLifecycleDecision, defaultWorktreeRoot, describeWorkspace, } from "./workspace-isolation.js";
23
44
  export { MAX_EVALUATOR_RESULT_BYTES, EvaluatorResultError, parseEvaluatorResult, } from "./evaluator.js";
24
- export { runCompletionVerifier, runCheckpointVerifier, } from "./verifier.js";
45
+ export { LocalVerifierExecutionPort, } from "./canonical-run-service.js";
46
+ export { execVerifierCommand, runCompletionVerifier, runCheckpointVerifier, } from "./verifier.js";
@@ -0,0 +1,194 @@
1
+ import { type AttemptExecutionAuthorityPort, type AttemptExecutionAuthorityRequest, type ExecutionRecoveryProbeRequest, type ExecutionRecoveryState, type NeverLaunchedAttestationRequest, type StopExecutionRequest, type StopExecutionResolution, type StoppedExecutionAuthority } from "./execution-authority.js";
2
+ import { LOCAL_EXECUTION_SUPERVISOR_DIGEST } from "./local-execution-supervisor-script.js";
3
+ import { LOCAL_WINDOWS_EXECUTION_SUPERVISOR_DIGEST } from "./local-windows-execution-supervisor-script.js";
4
+ import { type ProcessTreeRunOptions, type ProcessTreeRunResult } from "./process-tree.js";
5
+ import { type WindowsJobKeeperArtifact } from "./windows-job-keeper.js";
6
+ import type { ActivationId, AttemptId, CanonicalResultDigest, CanonicalWorkerNonlaunchAttestation, RunId, StepId, WorkerSessionId } from "./run-contracts.js";
7
+ import type { WorkerExecutionAuthorityBinding } from "./worker-executor.js";
8
+ declare const PREPARATION_SCHEMA_VERSION: "intentdna.local_execution_preparation.v1";
9
+ declare const PREPARATION_HANDLE_SCHEMA_VERSION: "intentdna.local_execution_preparation_handle.v1";
10
+ export interface LocalExecutionIdentity {
11
+ readonly run_id: RunId;
12
+ readonly step_id: StepId;
13
+ readonly activation_id: ActivationId;
14
+ readonly attempt_id: AttemptId;
15
+ readonly claim_epoch: number;
16
+ readonly worker_session_id: WorkerSessionId;
17
+ readonly started_at: string;
18
+ readonly execution_instance_id?: string;
19
+ }
20
+ export interface LocalAttemptExecutionAuthorityOptions {
21
+ readonly root_directory?: string;
22
+ readonly authority_instance_id?: string;
23
+ readonly control_timeout_ms?: number;
24
+ readonly poll_interval_ms?: number;
25
+ readonly platform?: NodeJS.Platform;
26
+ readonly architecture?: NodeJS.Architecture;
27
+ readonly helper_path?: string;
28
+ readonly expected_digest?: CanonicalResultDigest;
29
+ }
30
+ export interface LocalExecutionPreparationRequest {
31
+ readonly run_id: RunId;
32
+ readonly step_id: StepId;
33
+ readonly activation_id: ActivationId;
34
+ readonly attempt_id: AttemptId;
35
+ readonly execution_claim_epoch: number;
36
+ readonly worker_session_id: WorkerSessionId;
37
+ readonly execution_instance_id?: string;
38
+ }
39
+ export interface LocalPreparedExecutionHandle {
40
+ readonly schema_version: typeof PREPARATION_HANDLE_SCHEMA_VERSION;
41
+ readonly run_id: RunId;
42
+ readonly step_id: StepId;
43
+ readonly activation_id: ActivationId;
44
+ readonly attempt_id: AttemptId;
45
+ readonly execution_claim_epoch: number;
46
+ readonly worker_session_id: WorkerSessionId;
47
+ readonly execution_instance_id: string;
48
+ readonly preparation_digest: CanonicalResultDigest;
49
+ }
50
+ export interface LocalPreparedExecutionInspection {
51
+ readonly handle: LocalPreparedExecutionHandle;
52
+ readonly created_at: string;
53
+ }
54
+ export interface LocalExecutionBindRequest {
55
+ readonly started_at: string;
56
+ }
57
+ export type LocalExecutionAuthorityErrorCode = "invalid_configuration" | "identity_conflict" | "unsupported" | "corrupt_state";
58
+ export declare class LocalExecutionAuthorityError extends Error {
59
+ readonly code: LocalExecutionAuthorityErrorCode;
60
+ constructor(code: LocalExecutionAuthorityErrorCode, message: string, options?: ErrorOptions);
61
+ }
62
+ export interface LocalExecutionAuthorityBinding extends WorkerExecutionAuthorityBinding {
63
+ readonly process_started: Promise<number>;
64
+ executeProcessTree(command: string, args: readonly string[], options: ProcessTreeRunOptions): Promise<LocalExecutionProcessTreeRunResult>;
65
+ }
66
+ export interface LocalExecutionProcessTreeRunResult extends ProcessTreeRunResult {
67
+ readonly startedAt: string;
68
+ readonly completedAt: string;
69
+ readonly stdoutDigest: CanonicalResultDigest;
70
+ readonly stdoutBytes: number;
71
+ readonly stderrDigest: CanonicalResultDigest;
72
+ readonly stderrBytes: number;
73
+ }
74
+ export type LocalExecutionRecoveryBinding = {
75
+ readonly kind: "launch";
76
+ readonly binding: LocalExecutionAuthorityBinding;
77
+ } | {
78
+ readonly kind: "observe";
79
+ readonly binding: LocalExecutionAuthorityBinding;
80
+ };
81
+ interface DurableExecutionPreparation {
82
+ readonly schema_version: typeof PREPARATION_SCHEMA_VERSION;
83
+ readonly identity: LocalExecutionPreparationRequest;
84
+ readonly preparation_digest: CanonicalResultDigest;
85
+ readonly execution_instance_id: string;
86
+ readonly challenge: string;
87
+ readonly authority_instance_id: string;
88
+ readonly backend: DurableExecutionBackend;
89
+ readonly supervisor: DurableExecutionSupervisor;
90
+ readonly created_at: string;
91
+ }
92
+ interface DurablePosixBackend {
93
+ readonly kind: "posix_process_group";
94
+ }
95
+ interface DurableWindowsBackend {
96
+ readonly kind: "windows_job";
97
+ readonly architecture: WindowsJobKeeperArtifact["architecture"];
98
+ readonly helper_path: string;
99
+ readonly helper_digest: CanonicalResultDigest;
100
+ readonly helper_source_digest: CanonicalResultDigest;
101
+ readonly helper_protocol_version: WindowsJobKeeperArtifact["protocol_version"];
102
+ readonly containment_nonce: string;
103
+ }
104
+ type DurableExecutionBackend = DurablePosixBackend | DurableWindowsBackend;
105
+ interface DurableExecutionSupervisor {
106
+ readonly kind: "posix" | "windows";
107
+ readonly socket_path: string;
108
+ readonly script_digest: typeof LOCAL_EXECUTION_SUPERVISOR_DIGEST | typeof LOCAL_WINDOWS_EXECUTION_SUPERVISOR_DIGEST;
109
+ readonly pid: number | null;
110
+ readonly ready_at: string | null;
111
+ }
112
+ export interface DurableLockOwner {
113
+ readonly schema_version: "intentdna.execution_lock_owner.v1";
114
+ readonly pid: number;
115
+ readonly process_birth_id: string;
116
+ readonly generation: string;
117
+ readonly acquired_at: number;
118
+ }
119
+ /**
120
+ * Retires one observed stale generation without exposing a later generation to
121
+ * delayed contenders. The non-empty, generation-specific tombstone is retained
122
+ * so a contender that observed the same owner can never rename a successor over it.
123
+ * This is exported only for lock-protocol regression tests, not from the runtime barrel.
124
+ */
125
+ export declare function retireObservedStaleDurableLock(lockPath: string, observed: DurableLockOwner): boolean;
126
+ export declare class LocalAttemptExecutionAuthority implements AttemptExecutionAuthorityPort {
127
+ private readonly rootDirectory;
128
+ private readonly preparationsDirectory;
129
+ private readonly transitionsDirectory;
130
+ private readonly recordsDirectory;
131
+ private readonly socketsDirectory;
132
+ private readonly streamsDirectory;
133
+ private readonly controlNamespace;
134
+ private readonly authorityInstanceId;
135
+ private readonly controlTimeoutMs;
136
+ private readonly pollIntervalMs;
137
+ private readonly platform;
138
+ private readonly architecture;
139
+ private readonly windowsResolverOptions;
140
+ private readonly registrations;
141
+ constructor(options?: LocalAttemptExecutionAuthorityOptions);
142
+ get authority_instance_id(): string;
143
+ private resolveWindowsArtifact;
144
+ private ensureSupported;
145
+ assertExecutionSupported(): void;
146
+ private supervisorScriptPath;
147
+ private ensureSupervisorScript;
148
+ private loadOrCreateMetadata;
149
+ private recordPath;
150
+ private hasOtherAttemptRecord;
151
+ private preparationPath;
152
+ private transitionPath;
153
+ private controlEndpoint;
154
+ private backend;
155
+ private supervisor;
156
+ private resolveAbsoluteWindowsExecutable;
157
+ private readRecord;
158
+ private readPreparation;
159
+ private readVerifiedStream;
160
+ private rawCompletionResult;
161
+ private windowsArtifactMatchesBackend;
162
+ private markUnsupported;
163
+ private failWindowsAuthentication;
164
+ private ensureWindowsBackendTrusted;
165
+ private authenticateWindowsSupervisor;
166
+ private readRecoveryRecord;
167
+ private requireRequestRecord;
168
+ private withLock;
169
+ private withLockSync;
170
+ private updateRecord;
171
+ private nextFencingEpoch;
172
+ private nextFencingEpochSync;
173
+ private createLaunchBinding;
174
+ private bindingForRegistration;
175
+ prepareExecution(request: LocalExecutionPreparationRequest): LocalPreparedExecutionHandle;
176
+ recoverPreparedExecution(request: LocalExecutionPreparationRequest): LocalPreparedExecutionHandle | null;
177
+ recoverExecutionForPreparation(request: LocalExecutionPreparationRequest): LocalExecutionRecoveryBinding | null;
178
+ listPreparedExecutions(): readonly LocalPreparedExecutionInspection[];
179
+ abandonPreparedExecution(handle: LocalPreparedExecutionHandle): void;
180
+ bindExecution(handle: LocalPreparedExecutionHandle, request: LocalExecutionBindRequest): LocalExecutionAuthorityBinding;
181
+ registerExecution(identity: LocalExecutionIdentity, prepared?: DurableExecutionPreparation): LocalExecutionAuthorityBinding;
182
+ probeRecovery(request: ExecutionRecoveryProbeRequest): Promise<ExecutionRecoveryState>;
183
+ attestNeverLaunched(request: NeverLaunchedAttestationRequest): Promise<CanonicalWorkerNonlaunchAttestation>;
184
+ recoverExecution(request: ExecutionRecoveryProbeRequest): LocalExecutionRecoveryBinding;
185
+ private executeSupervised;
186
+ private observeRecoveredExecution;
187
+ private recordNormalizedCompletion;
188
+ private sendControl;
189
+ private issueReceipt;
190
+ private issueAlreadyStoppedEvidence;
191
+ withStoppedExecution<T>(request: AttemptExecutionAuthorityRequest, operation: (authority: StoppedExecutionAuthority) => Promise<T>): Promise<T>;
192
+ requestStop(request: StopExecutionRequest): Promise<StopExecutionResolution>;
193
+ }
194
+ export {};