@xenosystem/agent-sdk 0.9.24 → 0.9.26

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 (55) hide show
  1. package/dist/artifacts/index.cjs +1 -1
  2. package/dist/artifacts/index.js +1 -1
  3. package/dist/automation/index.cjs +9 -9
  4. package/dist/automation/index.d.cts +69 -3
  5. package/dist/automation/index.d.ts +69 -3
  6. package/dist/automation/index.js +9 -9
  7. package/dist/automation/metafile-cjs.json +1 -1
  8. package/dist/automation/metafile-esm.json +1 -1
  9. package/dist/control-plane/index.cjs +1 -1
  10. package/dist/control-plane/index.js +1 -1
  11. package/dist/coordination/index.cjs +2 -2
  12. package/dist/coordination/index.d.cts +15 -3
  13. package/dist/coordination/index.d.ts +15 -3
  14. package/dist/coordination/index.js +2 -2
  15. package/dist/coordination/metafile-cjs.json +1 -1
  16. package/dist/coordination/metafile-esm.json +1 -1
  17. package/dist/electron/index.cjs +157 -153
  18. package/dist/electron/index.d.cts +22 -3
  19. package/dist/electron/index.d.ts +22 -3
  20. package/dist/electron/index.js +157 -153
  21. package/dist/electron/metafile-cjs.json +1 -1
  22. package/dist/electron/metafile-esm.json +1 -1
  23. package/dist/governance/index.d.cts +2 -0
  24. package/dist/governance/index.d.ts +2 -0
  25. package/dist/hosted/index.cjs +1 -1
  26. package/dist/hosted/index.js +1 -1
  27. package/dist/hosted/metafile-cjs.json +1 -1
  28. package/dist/hosted/metafile-esm.json +1 -1
  29. package/dist/index.cjs +473 -343
  30. package/dist/index.d.cts +314 -31
  31. package/dist/index.d.ts +314 -31
  32. package/dist/index.js +473 -343
  33. package/dist/mcp/index.d.cts +3 -0
  34. package/dist/mcp/index.d.ts +3 -0
  35. package/dist/metafile-cjs.json +1 -1
  36. package/dist/metafile-esm.json +1 -1
  37. package/dist/providers/index.cjs +10 -10
  38. package/dist/providers/index.d.cts +92 -17
  39. package/dist/providers/index.d.ts +92 -17
  40. package/dist/providers/index.js +10 -10
  41. package/dist/providers/metafile-cjs.json +1 -1
  42. package/dist/providers/metafile-esm.json +1 -1
  43. package/dist/session/index.cjs +1 -1
  44. package/dist/session/index.d.cts +2 -0
  45. package/dist/session/index.d.ts +2 -0
  46. package/dist/session/index.js +1 -1
  47. package/dist/session/metafile-cjs.json +1 -1
  48. package/dist/session/metafile-esm.json +1 -1
  49. package/dist/skills/index.d.cts +3 -0
  50. package/dist/skills/index.d.ts +3 -0
  51. package/dist/ui/index.d.cts +2 -0
  52. package/dist/ui/index.d.ts +2 -0
  53. package/dist/utils/index.d.cts +2 -0
  54. package/dist/utils/index.d.ts +2 -0
  55. package/package.json +10 -1
@@ -1,3 +1,5 @@
1
+ import { WebJobProgress } from "@xenosystem/web-context-client/progress";
2
+ import { DatabaseSync } from "node:sqlite";
1
3
  declare const XENO_ARTIFACT_SCHEMA_VERSION: 1;
2
4
  type XenoJsonPrimitive = string | number | boolean | null;
3
5
  type XenoJsonValue = XenoJsonPrimitive | XenoJsonObject | XenoJsonValue[];
@@ -532,6 +534,7 @@ interface WebContextToolResult {
532
534
  mediaType: string;
533
535
  bytes: number;
534
536
  };
537
+ jobProgress?: WebJobProgress;
535
538
  }
536
539
  interface ToolDefinition {
537
540
  name: string;
@@ -613,6 +616,7 @@ interface ToolProgressUpdate {
613
616
  bytes?: number;
614
617
  outputBytes?: number;
615
618
  nextOffset?: number;
619
+ webContextProgress?: WebJobProgress;
616
620
  }
617
621
  interface ToolAuthorizationReceipt {
618
622
  turnId: string;
@@ -971,6 +975,7 @@ interface XenoAutomationExecutionGrant {
971
975
  capabilityUse: XenoCapabilityUse;
972
976
  }
973
977
  interface XenoAutomationAdapterExecutionResult {
978
+ operationId?: string;
974
979
  status: "ok" | "denied" | "cancelled" | "error";
975
980
  startedAt: string;
976
981
  completedAt: string;
@@ -993,6 +998,7 @@ interface XenoAutomationLeaseAuthority {
993
998
  consume(leaseId: string, expectedVersion: number, use: XenoCapabilityUse): Promise<XenoCapabilityLease> | XenoCapabilityLease;
994
999
  }
995
1000
  interface XenoAutomationExecutionResult {
1001
+ replayed?: boolean;
996
1002
  operationId: string;
997
1003
  status: "ok" | "denied" | "cancelled" | "error" | "evidence-incomplete";
998
1004
  effect: XenoAutomationEffect;
@@ -1035,7 +1041,7 @@ interface XenoAutomationOperationDescriptor {
1035
1041
  declare const XENO_AUTOMATION_OPERATIONS: readonly XenoAutomationOperation[];
1036
1042
  declare function describeXenoAutomationOperation(operation: XenoAutomationOperation): XenoAutomationOperationDescriptor;
1037
1043
  declare function isXenoAutomationOperation(value: string): value is XenoAutomationOperation;
1038
- type XenoAutomationErrorCode = "AUTOMATION_REQUEST_INVALID" | "AUTOMATION_CONTRACT_INVALID" | "AUTOMATION_CONTRACT_EXPIRED" | "AUTOMATION_IDENTITY_MISMATCH" | "AUTOMATION_OPERATION_UNSUPPORTED" | "AUTOMATION_POLICY_DENIED" | "AUTOMATION_TARGET_CHANGED" | "AUTOMATION_PREFLIGHT_INVALID" | "AUTOMATION_EVIDENCE_REQUIRED" | "AUTOMATION_EVIDENCE_INVALID" | "AUTOMATION_EVIDENCE_PERSISTENCE_FAILED" | "AUTOMATION_CANCELLED" | "AUTOMATION_TRANSPORT_ERROR" | "AUTOMATION_RESPONSE_INVALID" | "AUTOMATION_OPERATION_CONFLICT";
1044
+ type XenoAutomationErrorCode = "AUTOMATION_REQUEST_INVALID" | "AUTOMATION_CONTRACT_INVALID" | "AUTOMATION_CONTRACT_EXPIRED" | "AUTOMATION_IDENTITY_MISMATCH" | "AUTOMATION_OPERATION_UNSUPPORTED" | "AUTOMATION_POLICY_DENIED" | "AUTOMATION_TARGET_CHANGED" | "AUTOMATION_PREFLIGHT_INVALID" | "AUTOMATION_EVIDENCE_REQUIRED" | "AUTOMATION_EVIDENCE_INVALID" | "AUTOMATION_EVIDENCE_PERSISTENCE_FAILED" | "AUTOMATION_CANCELLED" | "AUTOMATION_TRANSPORT_ERROR" | "AUTOMATION_RESPONSE_INVALID" | "AUTOMATION_OPERATION_CONFLICT" | "AUTOMATION_OUTCOME_PENDING";
1039
1045
  declare class XenoAutomationError extends Error {
1040
1046
  readonly code: XenoAutomationErrorCode;
1041
1047
  readonly detail?: Record<string, string | number | boolean | null> | undefined;
@@ -1084,15 +1090,75 @@ interface MaterializeXenoAutomationEvidenceOptions {
1084
1090
  declare function materializeXenoAutomationEvidence(options: MaterializeXenoAutomationEvidenceOptions): XenoArtifactEnvelope[];
1085
1091
  declare function persistXenoAutomationEvidence(repository: XenoArtifactRepository | undefined, artifacts: readonly XenoArtifactEnvelope[]): Promise<XenoArtifactEnvelope[]>;
1086
1092
  declare function assertRequiredXenoAutomationEvidence(evidence: readonly XenoAutomationEvidenceInput[], policy: XenoAutomationEvidencePolicy, phase: "before" | "after" | "recording"): void;
1093
+ interface XenoAutomationJournalIdentity {
1094
+ operationId: string;
1095
+ fingerprint: string;
1096
+ ownerToken: string;
1097
+ }
1098
+ interface XenoAutomationJournalRecord extends XenoAutomationJournalIdentity {
1099
+ schemaVersion: 1;
1100
+ outcome: {
1101
+ kind: "pending";
1102
+ } | {
1103
+ kind: "result";
1104
+ artifactId: string;
1105
+ sha256: string;
1106
+ } | {
1107
+ kind: "failed";
1108
+ code: string;
1109
+ };
1110
+ }
1111
+ interface XenoAutomationExecutionJournal {
1112
+ get(operationId: string): Promise<XenoAutomationJournalRecord | undefined>;
1113
+ begin(identity: XenoAutomationJournalIdentity): Promise<{
1114
+ claimed: boolean;
1115
+ record: XenoAutomationJournalRecord;
1116
+ }>;
1117
+ finish(identity: XenoAutomationJournalIdentity, outcome: Exclude<XenoAutomationJournalRecord["outcome"], {
1118
+ kind: "pending";
1119
+ }>): Promise<void>;
1120
+ }
1121
+ declare function openSqliteAutomationExecutionJournal(path: string): Promise<SqliteAutomationExecutionJournal>;
1122
+ declare class SqliteAutomationExecutionJournal implements XenoAutomationExecutionJournal {
1123
+ private readonly database;
1124
+ private closed;
1125
+ constructor(database: DatabaseSync);
1126
+ begin(identity: XenoAutomationJournalIdentity): Promise<{
1127
+ claimed: boolean;
1128
+ record: XenoAutomationJournalRecord;
1129
+ }>;
1130
+ get(operationId: string): Promise<XenoAutomationJournalRecord | undefined>;
1131
+ finish(identity: XenoAutomationJournalIdentity, outcome: Exclude<XenoAutomationJournalRecord["outcome"], {
1132
+ kind: "pending";
1133
+ }>): Promise<void>;
1134
+ close(): void;
1135
+ private read;
1136
+ private transaction;
1137
+ }
1138
+ interface CapabilityMutationAck {
1139
+ lease: XenoCapabilityLease;
1140
+ replayed: boolean;
1141
+ executionDisposition: "dispatch-once" | "receipt-only";
1142
+ }
1143
+ interface XenoDurableAutomationOptions {
1144
+ journal: XenoAutomationExecutionJournal;
1145
+ artifactRepository: XenoArtifactRepository;
1146
+ assertCurrent(request: Readonly<XenoAutomationRequest>): Promise<void>;
1147
+ consume(commandId: string, leaseId: string, expectedVersion: number, use: XenoCapabilityUse): Promise<CapabilityMutationAck>;
1148
+ }
1149
+ declare function runDurableAutomation(options: XenoDurableAutomationOptions, request: XenoAutomationRequest, fingerprint: string, run: (consumeCommandId: string) => Promise<XenoAutomationExecutionResult>): Promise<XenoAutomationExecutionResult>;
1150
+ declare function pending(): XenoAutomationError;
1087
1151
  interface XenoGovernedAutomationExecutorOptions {
1088
1152
  adapter: XenoAutomationAdapter;
1089
- leaseAuthority: XenoAutomationLeaseAuthority;
1153
+ leaseAuthority?: XenoAutomationLeaseAuthority;
1154
+ durable?: XenoDurableAutomationOptions;
1090
1155
  artifactRepository?: XenoArtifactRepository;
1091
1156
  now?: () => string;
1092
1157
  }
1093
1158
  declare class XenoGovernedAutomationExecutor {
1094
1159
  private readonly adapter;
1095
1160
  private readonly leaseAuthority;
1161
+ private readonly durable;
1096
1162
  private readonly artifactRepository?;
1097
1163
  private readonly now;
1098
1164
  private readonly executions;
@@ -1332,4 +1398,4 @@ type XenoHostAutomationEnvironment = CliAutomationEnvironment;
1332
1398
  type XenoHostAutomationSurfaceStatus = CliAutomationSurfaceStatus;
1333
1399
  type XenoHostAutomationStatusReport = CliAutomationStatusReport;
1334
1400
  type CreateXenoHostGovernedAutomationRuntimeOptions = CreateCliGovernedAutomationRuntimeOptions;
1335
- export { type CliAutomationAuditEvent, type CliAutomationAuditLoggerPort, type CliAutomationEnvironment, type CliAutomationStatusReport, type CliAutomationSurfaceStatus, CliGovernedAutomationRuntime, type CreateCliGovernedAutomationRuntimeOptions, type CreateXenoGovernedAutomationToolsOptions, type CreateXenoHostGovernedAutomationRuntimeOptions, type MaterializeXenoAutomationEvidenceOptions, XENO_AUTOMATION_OPERATIONS, XENO_AUTOMATION_PROTOCOL_VERSION, XENO_BROWSER_CONTROL_PLANE_OPERATIONS, type XenoAutomationAdapter, type XenoAutomationAdapterExecutionResult, type XenoAutomationAdapterManifest, type XenoAutomationConformanceCheck, type XenoAutomationConformanceReport, type XenoAutomationEffect, XenoAutomationError, type XenoAutomationErrorCode, type XenoAutomationEvidenceContent, type XenoAutomationEvidenceInput, type XenoAutomationEvidencePhase, type XenoAutomationEvidencePolicy, type XenoAutomationExecutionGrant, type XenoAutomationExecutionResult, type XenoAutomationIdentity, type XenoAutomationLeaseAuthority, type XenoAutomationOperation, type XenoAutomationOperationDescriptor, type XenoAutomationPreflight, type XenoAutomationRequest, type XenoAutomationSurface, type XenoAutomationTarget, type XenoBrowserAutomationOperation, XenoBrowserControlPlaneAdapter, type XenoBrowserControlPlaneAdapterOptions, type XenoComputerAutomationOperation, XenoGovernedAutomationExecutor, type XenoGovernedAutomationExecutorOptions, type XenoGovernedAutomationToolExecution, type XenoGovernedAutomationToolRuntime, type XenoHostAutomationAuditEvent, type XenoHostAutomationAuditLoggerPort, type XenoHostAutomationEnvironment, type XenoHostAutomationStatusReport, type XenoHostAutomationSurfaceStatus, CliGovernedAutomationRuntime as XenoHostGovernedAutomationRuntime, XenoLoopbackAutomationAdapter, type XenoLoopbackAutomationAdapterOptions, assertRequiredXenoAutomationEvidence, assertValidXenoAutomationAdapterManifest, assertValidXenoAutomationRequest, assertXenoAutomationAdapterConformant, assertXenoAutomationAuthority, buildXenoAutomationCapabilityUse, createCliAutomationAuditSink, createCliGovernedAutomationRuntime, createXenoAutomationConformanceReport, createXenoGovernedAutomationTools, createCliAutomationAuditSink as createXenoHostAutomationAuditSink, createCliGovernedAutomationRuntime as createXenoHostGovernedAutomationRuntime, describeXenoAutomationOperation, inspectCliAutomationStatus, inspectCliAutomationStatus as inspectXenoHostAutomationStatus, isXenoAutomationOperation, materializeXenoAutomationEvidence, persistXenoAutomationEvidence, readCliAutomationEnvironment, readCliAutomationEnvironment as readXenoHostAutomationEnvironment, renderCliAutomationStatus, renderCliAutomationStatus as renderXenoHostAutomationStatus, resolveXenoAutomationEvidencePolicy };
1401
+ export { type CliAutomationAuditEvent, type CliAutomationAuditLoggerPort, type CliAutomationEnvironment, type CliAutomationStatusReport, type CliAutomationSurfaceStatus, CliGovernedAutomationRuntime, type CreateCliGovernedAutomationRuntimeOptions, type CreateXenoGovernedAutomationToolsOptions, type CreateXenoHostGovernedAutomationRuntimeOptions, type MaterializeXenoAutomationEvidenceOptions, SqliteAutomationExecutionJournal, XENO_AUTOMATION_OPERATIONS, XENO_AUTOMATION_PROTOCOL_VERSION, XENO_BROWSER_CONTROL_PLANE_OPERATIONS, type XenoAutomationAdapter, type XenoAutomationAdapterExecutionResult, type XenoAutomationAdapterManifest, type XenoAutomationConformanceCheck, type XenoAutomationConformanceReport, type XenoAutomationEffect, XenoAutomationError, type XenoAutomationErrorCode, type XenoAutomationEvidenceContent, type XenoAutomationEvidenceInput, type XenoAutomationEvidencePhase, type XenoAutomationEvidencePolicy, type XenoAutomationExecutionGrant, type XenoAutomationExecutionJournal, type XenoAutomationExecutionResult, type XenoAutomationIdentity, type XenoAutomationJournalIdentity, type XenoAutomationJournalRecord, type XenoAutomationLeaseAuthority, type XenoAutomationOperation, type XenoAutomationOperationDescriptor, type XenoAutomationPreflight, type XenoAutomationRequest, type XenoAutomationSurface, type XenoAutomationTarget, type XenoBrowserAutomationOperation, XenoBrowserControlPlaneAdapter, type XenoBrowserControlPlaneAdapterOptions, type XenoComputerAutomationOperation, type XenoDurableAutomationOptions, XenoGovernedAutomationExecutor, type XenoGovernedAutomationExecutorOptions, type XenoGovernedAutomationToolExecution, type XenoGovernedAutomationToolRuntime, type XenoHostAutomationAuditEvent, type XenoHostAutomationAuditLoggerPort, type XenoHostAutomationEnvironment, type XenoHostAutomationStatusReport, type XenoHostAutomationSurfaceStatus, CliGovernedAutomationRuntime as XenoHostGovernedAutomationRuntime, XenoLoopbackAutomationAdapter, type XenoLoopbackAutomationAdapterOptions, assertRequiredXenoAutomationEvidence, assertValidXenoAutomationAdapterManifest, assertValidXenoAutomationRequest, assertXenoAutomationAdapterConformant, assertXenoAutomationAuthority, buildXenoAutomationCapabilityUse, createCliAutomationAuditSink, createCliGovernedAutomationRuntime, createXenoAutomationConformanceReport, createXenoGovernedAutomationTools, createCliAutomationAuditSink as createXenoHostAutomationAuditSink, createCliGovernedAutomationRuntime as createXenoHostGovernedAutomationRuntime, describeXenoAutomationOperation, inspectCliAutomationStatus, inspectCliAutomationStatus as inspectXenoHostAutomationStatus, isXenoAutomationOperation, materializeXenoAutomationEvidence, openSqliteAutomationExecutionJournal, pending, persistXenoAutomationEvidence, readCliAutomationEnvironment, readCliAutomationEnvironment as readXenoHostAutomationEnvironment, renderCliAutomationStatus, renderCliAutomationStatus as renderXenoHostAutomationStatus, resolveXenoAutomationEvidencePolicy, runDurableAutomation };
@@ -1,3 +1,5 @@
1
+ import { WebJobProgress } from "@xenosystem/web-context-client/progress";
2
+ import { DatabaseSync } from "node:sqlite";
1
3
  declare const XENO_ARTIFACT_SCHEMA_VERSION: 1;
2
4
  type XenoJsonPrimitive = string | number | boolean | null;
3
5
  type XenoJsonValue = XenoJsonPrimitive | XenoJsonObject | XenoJsonValue[];
@@ -532,6 +534,7 @@ interface WebContextToolResult {
532
534
  mediaType: string;
533
535
  bytes: number;
534
536
  };
537
+ jobProgress?: WebJobProgress;
535
538
  }
536
539
  interface ToolDefinition {
537
540
  name: string;
@@ -613,6 +616,7 @@ interface ToolProgressUpdate {
613
616
  bytes?: number;
614
617
  outputBytes?: number;
615
618
  nextOffset?: number;
619
+ webContextProgress?: WebJobProgress;
616
620
  }
617
621
  interface ToolAuthorizationReceipt {
618
622
  turnId: string;
@@ -971,6 +975,7 @@ interface XenoAutomationExecutionGrant {
971
975
  capabilityUse: XenoCapabilityUse;
972
976
  }
973
977
  interface XenoAutomationAdapterExecutionResult {
978
+ operationId?: string;
974
979
  status: "ok" | "denied" | "cancelled" | "error";
975
980
  startedAt: string;
976
981
  completedAt: string;
@@ -993,6 +998,7 @@ interface XenoAutomationLeaseAuthority {
993
998
  consume(leaseId: string, expectedVersion: number, use: XenoCapabilityUse): Promise<XenoCapabilityLease> | XenoCapabilityLease;
994
999
  }
995
1000
  interface XenoAutomationExecutionResult {
1001
+ replayed?: boolean;
996
1002
  operationId: string;
997
1003
  status: "ok" | "denied" | "cancelled" | "error" | "evidence-incomplete";
998
1004
  effect: XenoAutomationEffect;
@@ -1035,7 +1041,7 @@ interface XenoAutomationOperationDescriptor {
1035
1041
  declare const XENO_AUTOMATION_OPERATIONS: readonly XenoAutomationOperation[];
1036
1042
  declare function describeXenoAutomationOperation(operation: XenoAutomationOperation): XenoAutomationOperationDescriptor;
1037
1043
  declare function isXenoAutomationOperation(value: string): value is XenoAutomationOperation;
1038
- type XenoAutomationErrorCode = "AUTOMATION_REQUEST_INVALID" | "AUTOMATION_CONTRACT_INVALID" | "AUTOMATION_CONTRACT_EXPIRED" | "AUTOMATION_IDENTITY_MISMATCH" | "AUTOMATION_OPERATION_UNSUPPORTED" | "AUTOMATION_POLICY_DENIED" | "AUTOMATION_TARGET_CHANGED" | "AUTOMATION_PREFLIGHT_INVALID" | "AUTOMATION_EVIDENCE_REQUIRED" | "AUTOMATION_EVIDENCE_INVALID" | "AUTOMATION_EVIDENCE_PERSISTENCE_FAILED" | "AUTOMATION_CANCELLED" | "AUTOMATION_TRANSPORT_ERROR" | "AUTOMATION_RESPONSE_INVALID" | "AUTOMATION_OPERATION_CONFLICT";
1044
+ type XenoAutomationErrorCode = "AUTOMATION_REQUEST_INVALID" | "AUTOMATION_CONTRACT_INVALID" | "AUTOMATION_CONTRACT_EXPIRED" | "AUTOMATION_IDENTITY_MISMATCH" | "AUTOMATION_OPERATION_UNSUPPORTED" | "AUTOMATION_POLICY_DENIED" | "AUTOMATION_TARGET_CHANGED" | "AUTOMATION_PREFLIGHT_INVALID" | "AUTOMATION_EVIDENCE_REQUIRED" | "AUTOMATION_EVIDENCE_INVALID" | "AUTOMATION_EVIDENCE_PERSISTENCE_FAILED" | "AUTOMATION_CANCELLED" | "AUTOMATION_TRANSPORT_ERROR" | "AUTOMATION_RESPONSE_INVALID" | "AUTOMATION_OPERATION_CONFLICT" | "AUTOMATION_OUTCOME_PENDING";
1039
1045
  declare class XenoAutomationError extends Error {
1040
1046
  readonly code: XenoAutomationErrorCode;
1041
1047
  readonly detail?: Record<string, string | number | boolean | null> | undefined;
@@ -1084,15 +1090,75 @@ interface MaterializeXenoAutomationEvidenceOptions {
1084
1090
  declare function materializeXenoAutomationEvidence(options: MaterializeXenoAutomationEvidenceOptions): XenoArtifactEnvelope[];
1085
1091
  declare function persistXenoAutomationEvidence(repository: XenoArtifactRepository | undefined, artifacts: readonly XenoArtifactEnvelope[]): Promise<XenoArtifactEnvelope[]>;
1086
1092
  declare function assertRequiredXenoAutomationEvidence(evidence: readonly XenoAutomationEvidenceInput[], policy: XenoAutomationEvidencePolicy, phase: "before" | "after" | "recording"): void;
1093
+ interface XenoAutomationJournalIdentity {
1094
+ operationId: string;
1095
+ fingerprint: string;
1096
+ ownerToken: string;
1097
+ }
1098
+ interface XenoAutomationJournalRecord extends XenoAutomationJournalIdentity {
1099
+ schemaVersion: 1;
1100
+ outcome: {
1101
+ kind: "pending";
1102
+ } | {
1103
+ kind: "result";
1104
+ artifactId: string;
1105
+ sha256: string;
1106
+ } | {
1107
+ kind: "failed";
1108
+ code: string;
1109
+ };
1110
+ }
1111
+ interface XenoAutomationExecutionJournal {
1112
+ get(operationId: string): Promise<XenoAutomationJournalRecord | undefined>;
1113
+ begin(identity: XenoAutomationJournalIdentity): Promise<{
1114
+ claimed: boolean;
1115
+ record: XenoAutomationJournalRecord;
1116
+ }>;
1117
+ finish(identity: XenoAutomationJournalIdentity, outcome: Exclude<XenoAutomationJournalRecord["outcome"], {
1118
+ kind: "pending";
1119
+ }>): Promise<void>;
1120
+ }
1121
+ declare function openSqliteAutomationExecutionJournal(path: string): Promise<SqliteAutomationExecutionJournal>;
1122
+ declare class SqliteAutomationExecutionJournal implements XenoAutomationExecutionJournal {
1123
+ private readonly database;
1124
+ private closed;
1125
+ constructor(database: DatabaseSync);
1126
+ begin(identity: XenoAutomationJournalIdentity): Promise<{
1127
+ claimed: boolean;
1128
+ record: XenoAutomationJournalRecord;
1129
+ }>;
1130
+ get(operationId: string): Promise<XenoAutomationJournalRecord | undefined>;
1131
+ finish(identity: XenoAutomationJournalIdentity, outcome: Exclude<XenoAutomationJournalRecord["outcome"], {
1132
+ kind: "pending";
1133
+ }>): Promise<void>;
1134
+ close(): void;
1135
+ private read;
1136
+ private transaction;
1137
+ }
1138
+ interface CapabilityMutationAck {
1139
+ lease: XenoCapabilityLease;
1140
+ replayed: boolean;
1141
+ executionDisposition: "dispatch-once" | "receipt-only";
1142
+ }
1143
+ interface XenoDurableAutomationOptions {
1144
+ journal: XenoAutomationExecutionJournal;
1145
+ artifactRepository: XenoArtifactRepository;
1146
+ assertCurrent(request: Readonly<XenoAutomationRequest>): Promise<void>;
1147
+ consume(commandId: string, leaseId: string, expectedVersion: number, use: XenoCapabilityUse): Promise<CapabilityMutationAck>;
1148
+ }
1149
+ declare function runDurableAutomation(options: XenoDurableAutomationOptions, request: XenoAutomationRequest, fingerprint: string, run: (consumeCommandId: string) => Promise<XenoAutomationExecutionResult>): Promise<XenoAutomationExecutionResult>;
1150
+ declare function pending(): XenoAutomationError;
1087
1151
  interface XenoGovernedAutomationExecutorOptions {
1088
1152
  adapter: XenoAutomationAdapter;
1089
- leaseAuthority: XenoAutomationLeaseAuthority;
1153
+ leaseAuthority?: XenoAutomationLeaseAuthority;
1154
+ durable?: XenoDurableAutomationOptions;
1090
1155
  artifactRepository?: XenoArtifactRepository;
1091
1156
  now?: () => string;
1092
1157
  }
1093
1158
  declare class XenoGovernedAutomationExecutor {
1094
1159
  private readonly adapter;
1095
1160
  private readonly leaseAuthority;
1161
+ private readonly durable;
1096
1162
  private readonly artifactRepository?;
1097
1163
  private readonly now;
1098
1164
  private readonly executions;
@@ -1332,4 +1398,4 @@ type XenoHostAutomationEnvironment = CliAutomationEnvironment;
1332
1398
  type XenoHostAutomationSurfaceStatus = CliAutomationSurfaceStatus;
1333
1399
  type XenoHostAutomationStatusReport = CliAutomationStatusReport;
1334
1400
  type CreateXenoHostGovernedAutomationRuntimeOptions = CreateCliGovernedAutomationRuntimeOptions;
1335
- export { type CliAutomationAuditEvent, type CliAutomationAuditLoggerPort, type CliAutomationEnvironment, type CliAutomationStatusReport, type CliAutomationSurfaceStatus, CliGovernedAutomationRuntime, type CreateCliGovernedAutomationRuntimeOptions, type CreateXenoGovernedAutomationToolsOptions, type CreateXenoHostGovernedAutomationRuntimeOptions, type MaterializeXenoAutomationEvidenceOptions, XENO_AUTOMATION_OPERATIONS, XENO_AUTOMATION_PROTOCOL_VERSION, XENO_BROWSER_CONTROL_PLANE_OPERATIONS, type XenoAutomationAdapter, type XenoAutomationAdapterExecutionResult, type XenoAutomationAdapterManifest, type XenoAutomationConformanceCheck, type XenoAutomationConformanceReport, type XenoAutomationEffect, XenoAutomationError, type XenoAutomationErrorCode, type XenoAutomationEvidenceContent, type XenoAutomationEvidenceInput, type XenoAutomationEvidencePhase, type XenoAutomationEvidencePolicy, type XenoAutomationExecutionGrant, type XenoAutomationExecutionResult, type XenoAutomationIdentity, type XenoAutomationLeaseAuthority, type XenoAutomationOperation, type XenoAutomationOperationDescriptor, type XenoAutomationPreflight, type XenoAutomationRequest, type XenoAutomationSurface, type XenoAutomationTarget, type XenoBrowserAutomationOperation, XenoBrowserControlPlaneAdapter, type XenoBrowserControlPlaneAdapterOptions, type XenoComputerAutomationOperation, XenoGovernedAutomationExecutor, type XenoGovernedAutomationExecutorOptions, type XenoGovernedAutomationToolExecution, type XenoGovernedAutomationToolRuntime, type XenoHostAutomationAuditEvent, type XenoHostAutomationAuditLoggerPort, type XenoHostAutomationEnvironment, type XenoHostAutomationStatusReport, type XenoHostAutomationSurfaceStatus, CliGovernedAutomationRuntime as XenoHostGovernedAutomationRuntime, XenoLoopbackAutomationAdapter, type XenoLoopbackAutomationAdapterOptions, assertRequiredXenoAutomationEvidence, assertValidXenoAutomationAdapterManifest, assertValidXenoAutomationRequest, assertXenoAutomationAdapterConformant, assertXenoAutomationAuthority, buildXenoAutomationCapabilityUse, createCliAutomationAuditSink, createCliGovernedAutomationRuntime, createXenoAutomationConformanceReport, createXenoGovernedAutomationTools, createCliAutomationAuditSink as createXenoHostAutomationAuditSink, createCliGovernedAutomationRuntime as createXenoHostGovernedAutomationRuntime, describeXenoAutomationOperation, inspectCliAutomationStatus, inspectCliAutomationStatus as inspectXenoHostAutomationStatus, isXenoAutomationOperation, materializeXenoAutomationEvidence, persistXenoAutomationEvidence, readCliAutomationEnvironment, readCliAutomationEnvironment as readXenoHostAutomationEnvironment, renderCliAutomationStatus, renderCliAutomationStatus as renderXenoHostAutomationStatus, resolveXenoAutomationEvidencePolicy };
1401
+ export { type CliAutomationAuditEvent, type CliAutomationAuditLoggerPort, type CliAutomationEnvironment, type CliAutomationStatusReport, type CliAutomationSurfaceStatus, CliGovernedAutomationRuntime, type CreateCliGovernedAutomationRuntimeOptions, type CreateXenoGovernedAutomationToolsOptions, type CreateXenoHostGovernedAutomationRuntimeOptions, type MaterializeXenoAutomationEvidenceOptions, SqliteAutomationExecutionJournal, XENO_AUTOMATION_OPERATIONS, XENO_AUTOMATION_PROTOCOL_VERSION, XENO_BROWSER_CONTROL_PLANE_OPERATIONS, type XenoAutomationAdapter, type XenoAutomationAdapterExecutionResult, type XenoAutomationAdapterManifest, type XenoAutomationConformanceCheck, type XenoAutomationConformanceReport, type XenoAutomationEffect, XenoAutomationError, type XenoAutomationErrorCode, type XenoAutomationEvidenceContent, type XenoAutomationEvidenceInput, type XenoAutomationEvidencePhase, type XenoAutomationEvidencePolicy, type XenoAutomationExecutionGrant, type XenoAutomationExecutionJournal, type XenoAutomationExecutionResult, type XenoAutomationIdentity, type XenoAutomationJournalIdentity, type XenoAutomationJournalRecord, type XenoAutomationLeaseAuthority, type XenoAutomationOperation, type XenoAutomationOperationDescriptor, type XenoAutomationPreflight, type XenoAutomationRequest, type XenoAutomationSurface, type XenoAutomationTarget, type XenoBrowserAutomationOperation, XenoBrowserControlPlaneAdapter, type XenoBrowserControlPlaneAdapterOptions, type XenoComputerAutomationOperation, type XenoDurableAutomationOptions, XenoGovernedAutomationExecutor, type XenoGovernedAutomationExecutorOptions, type XenoGovernedAutomationToolExecution, type XenoGovernedAutomationToolRuntime, type XenoHostAutomationAuditEvent, type XenoHostAutomationAuditLoggerPort, type XenoHostAutomationEnvironment, type XenoHostAutomationStatusReport, type XenoHostAutomationSurfaceStatus, CliGovernedAutomationRuntime as XenoHostGovernedAutomationRuntime, XenoLoopbackAutomationAdapter, type XenoLoopbackAutomationAdapterOptions, assertRequiredXenoAutomationEvidence, assertValidXenoAutomationAdapterManifest, assertValidXenoAutomationRequest, assertXenoAutomationAdapterConformant, assertXenoAutomationAuthority, buildXenoAutomationCapabilityUse, createCliAutomationAuditSink, createCliGovernedAutomationRuntime, createXenoAutomationConformanceReport, createXenoGovernedAutomationTools, createCliAutomationAuditSink as createXenoHostAutomationAuditSink, createCliGovernedAutomationRuntime as createXenoHostGovernedAutomationRuntime, describeXenoAutomationOperation, inspectCliAutomationStatus, inspectCliAutomationStatus as inspectXenoHostAutomationStatus, isXenoAutomationOperation, materializeXenoAutomationEvidence, openSqliteAutomationExecutionJournal, pending, persistXenoAutomationEvidence, readCliAutomationEnvironment, readCliAutomationEnvironment as readXenoHostAutomationEnvironment, renderCliAutomationStatus, renderCliAutomationStatus as renderXenoHostAutomationStatus, resolveXenoAutomationEvidencePolicy, runDurableAutomation };