@sift-wiki/conductor 0.2.0-beta.1 → 0.2.0-beta.2

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 (94) hide show
  1. package/dist/adapters/claudeAgent.js +1 -0
  2. package/dist/adapters/claudeAgent.js.map +1 -1
  3. package/dist/adapters/codexAgent.js +1 -0
  4. package/dist/adapters/codexAgent.js.map +1 -1
  5. package/dist/adapters/fakeAgent.js +1 -0
  6. package/dist/adapters/fakeAgent.js.map +1 -1
  7. package/dist/adapters/httpAgent.js +1 -0
  8. package/dist/adapters/httpAgent.js.map +1 -1
  9. package/dist/adapters/processAgent.js +4 -0
  10. package/dist/adapters/processAgent.js.map +1 -1
  11. package/dist/adapters/provider/runProvider.js +4 -0
  12. package/dist/adapters/provider/runProvider.js.map +1 -1
  13. package/dist/adapters/provider/store.js +3 -4
  14. package/dist/adapters/provider/store.js.map +1 -1
  15. package/dist/adapters/types.d.ts +9 -0
  16. package/dist/cli.d.ts +6 -0
  17. package/dist/cli.js +16 -4
  18. package/dist/cli.js.map +1 -1
  19. package/dist/conductorClient.d.ts +56 -19
  20. package/dist/conductorClient.js +91 -40
  21. package/dist/conductorClient.js.map +1 -1
  22. package/dist/config.js +4 -5
  23. package/dist/config.js.map +1 -1
  24. package/dist/daemon.d.ts +19 -6
  25. package/dist/daemon.js +160 -122
  26. package/dist/daemon.js.map +1 -1
  27. package/dist/desktop/app/controller.d.ts +1 -1
  28. package/dist/desktop/app/runtimeController.d.ts +7 -0
  29. package/dist/desktop/app/runtimeController.js +12 -1
  30. package/dist/desktop/app/runtimeController.js.map +1 -1
  31. package/dist/localApi/contracts.d.ts +15 -4
  32. package/dist/localApi/contracts.js +19 -1
  33. package/dist/localApi/contracts.js.map +1 -1
  34. package/dist/localApi/recovery.d.ts +66 -0
  35. package/dist/localApi/recovery.js +115 -0
  36. package/dist/localApi/recovery.js.map +1 -0
  37. package/dist/localApi/server.js +3 -1
  38. package/dist/localApi/server.js.map +1 -1
  39. package/dist/localApp/service.js +16 -4
  40. package/dist/localApp/service.js.map +1 -1
  41. package/dist/protocol/fenced.d.ts +135 -0
  42. package/dist/protocol/fenced.js +142 -0
  43. package/dist/protocol/fenced.js.map +1 -0
  44. package/dist/redaction.js +2 -0
  45. package/dist/redaction.js.map +1 -1
  46. package/dist/runtime/atomicFile.d.ts +6 -0
  47. package/dist/runtime/atomicFile.js +78 -0
  48. package/dist/runtime/atomicFile.js.map +1 -0
  49. package/dist/runtime/daemonCapabilities.d.ts +7 -0
  50. package/dist/runtime/daemonCapabilities.js +24 -0
  51. package/dist/runtime/daemonCapabilities.js.map +1 -0
  52. package/dist/runtime/eventOutbox.d.ts +100 -0
  53. package/dist/runtime/eventOutbox.js +206 -0
  54. package/dist/runtime/eventOutbox.js.map +1 -0
  55. package/dist/runtime/executionJournal.d.ts +102 -0
  56. package/dist/runtime/executionJournal.js +209 -0
  57. package/dist/runtime/executionJournal.js.map +1 -0
  58. package/dist/runtime/executionSafety.d.ts +76 -0
  59. package/dist/runtime/executionSafety.js +207 -0
  60. package/dist/runtime/executionSafety.js.map +1 -0
  61. package/dist/runtime/fencedExecutionState.d.ts +43 -0
  62. package/dist/runtime/fencedExecutionState.js +158 -0
  63. package/dist/runtime/fencedExecutionState.js.map +1 -0
  64. package/dist/runtime/leaseManager.d.ts +38 -0
  65. package/dist/runtime/leaseManager.js +102 -0
  66. package/dist/runtime/leaseManager.js.map +1 -0
  67. package/dist/runtime/localRunQueue.d.ts +1 -1
  68. package/dist/runtime/localRunQueue.js +8 -0
  69. package/dist/runtime/localRunQueue.js.map +1 -1
  70. package/dist/runtime/localSessionCache.d.ts +1 -1
  71. package/dist/runtime/localSessionCache.js.map +1 -1
  72. package/dist/runtime/process.d.ts +13 -1
  73. package/dist/runtime/process.js +39 -9
  74. package/dist/runtime/process.js.map +1 -1
  75. package/dist/runtime/recoveryCoordinator.d.ts +19 -0
  76. package/dist/runtime/recoveryCoordinator.js +183 -0
  77. package/dist/runtime/recoveryCoordinator.js.map +1 -0
  78. package/dist/runtime/runtimeLock.d.ts +33 -0
  79. package/dist/runtime/runtimeLock.js +140 -0
  80. package/dist/runtime/runtimeLock.js.map +1 -0
  81. package/dist/runtime/runtimeService.d.ts +6 -1
  82. package/dist/runtime/runtimeService.js +54 -20
  83. package/dist/runtime/runtimeService.js.map +1 -1
  84. package/dist/runtime/taskExecution.d.ts +2 -0
  85. package/dist/runtime/taskExecution.js +18 -12
  86. package/dist/runtime/taskExecution.js.map +1 -1
  87. package/dist/types.d.ts +28 -13
  88. package/dist/version.d.ts +1 -1
  89. package/dist/version.js +1 -1
  90. package/dist/workTypes.d.ts +5 -5
  91. package/dist-web/assets/index-CWAdDb9V.js +72 -0
  92. package/dist-web/index.html +2 -2
  93. package/package.json +1 -1
  94. package/dist-web/assets/index-D5X9InfE.js +0 -72
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { SiftWakeEnvelope } from "./runtime/wakeEnvelope.js";
2
+ import type { AttemptAuthority, AttemptAuthorityFence, AttemptMutationOptions, ClientEventIdentity, EventAcknowledgement, LateResultRequest, LateResultResponse, ReconcileAttemptRequest, ReconcileAttemptResponse } from "./protocol/fenced.js";
2
3
  import type { WorkApproval, WorkArtifact, WorkArtifactInput, WorkChildTaskInput, WorkDisposition, WorkDispositionResponse, WorkTask, WorkTaskComment, WorkUsageDecision } from "./workTypes.js";
3
4
  export type JsonObject = Record<string, unknown>;
4
5
  export type ConductorConfig = {
@@ -59,8 +60,11 @@ export type ClaimedJob = {
59
60
  limits: JsonObject;
60
61
  status: string;
61
62
  attempts: number;
63
+ maxAttempts?: number | undefined;
62
64
  leaseExpiresAt?: string | undefined;
63
65
  wakeEnvelope?: SiftWakeEnvelope | undefined;
66
+ authorityMode?: "legacy-v1" | "fenced-attempts-v1" | undefined;
67
+ authority?: AttemptAuthority | undefined;
64
68
  };
65
69
  export type LeaseRefresh = {
66
70
  job: {
@@ -70,6 +74,7 @@ export type LeaseRefresh = {
70
74
  leaseExpiresAt?: string | undefined;
71
75
  };
72
76
  cancelRequested: boolean;
77
+ authority?: AttemptAuthority | undefined;
73
78
  };
74
79
  export type RunEventType = "health" | "progress" | "log" | "artifact" | "approval_requested" | "completed" | "failed" | "cancelled";
75
80
  export type RunEventInput = {
@@ -77,6 +82,9 @@ export type RunEventInput = {
77
82
  payload?: JsonObject;
78
83
  occurredAt?: string;
79
84
  };
85
+ export type RunEventDeliveryInput = RunEventInput & Partial<ClientEventIdentity> & {
86
+ authority?: AttemptAuthorityFence | undefined;
87
+ };
80
88
  export type RunEvent = {
81
89
  id: string;
82
90
  runId: string;
@@ -84,7 +92,12 @@ export type RunEvent = {
84
92
  eventType: RunEventType;
85
93
  payload: JsonObject;
86
94
  occurredAt: string;
95
+ attemptId?: string | undefined;
96
+ clientEventId?: string | undefined;
97
+ clientSequence?: number | undefined;
98
+ acknowledgedClientSequence?: number | undefined;
87
99
  };
100
+ export type RunEventAppendResult = RunEvent | EventAcknowledgement;
88
101
  export type ConductorClient = PairConductorClient & {
89
102
  heartbeat(credential: string, request: {
90
103
  version?: string;
@@ -93,29 +106,31 @@ export type ConductorClient = PairConductorClient & {
93
106
  }): Promise<unknown>;
94
107
  advertiseAgents(credential: string, agents: ConductorAgentAdvertisement[]): Promise<ConductorAgent[]>;
95
108
  claimJob(credential: string): Promise<ClaimedJob | undefined>;
96
- refreshLease(credential: string, jobId: string): Promise<LeaseRefresh>;
97
- appendRunEvent(credential: string, runId: string, event: RunEventInput): Promise<RunEvent>;
98
- completeRun(credential: string, runId: string, resultSummary: JsonObject): Promise<unknown>;
99
- failRun(credential: string, runId: string, errorSummary: JsonObject): Promise<unknown>;
100
- acknowledgeCancellation(credential: string, runId: string, resultSummary: JsonObject): Promise<unknown>;
109
+ refreshLease(credential: string, jobId: string, authority?: AttemptAuthorityFence): Promise<LeaseRefresh>;
110
+ appendRunEvent(credential: string, runId: string, event: RunEventDeliveryInput): Promise<RunEventAppendResult>;
111
+ completeRun(credential: string, runId: string, resultSummary: JsonObject, options?: AttemptMutationOptions): Promise<unknown>;
112
+ failRun(credential: string, runId: string, errorSummary: JsonObject, options?: AttemptMutationOptions): Promise<unknown>;
113
+ acknowledgeCancellation(credential: string, runId: string, resultSummary: JsonObject, options?: AttemptMutationOptions): Promise<unknown>;
114
+ reconcileAttempt?(credential: string, request: ReconcileAttemptRequest): Promise<ReconcileAttemptResponse>;
115
+ registerLateResult?(credential: string, attemptId: string, request: LateResultRequest): Promise<LateResultResponse>;
101
116
  };
102
117
  export type ConductorWorkClient = {
103
- readWorkContext(credential: string, runId: string, taskId: string): Promise<SiftWakeEnvelope>;
104
- checkoutTask(credential: string, runId: string, taskId: string): Promise<WorkTask>;
105
- createChildTasks(credential: string, runId: string, taskId: string, children: WorkChildTaskInput[]): Promise<WorkTask[]>;
106
- addTaskComment(credential: string, runId: string, taskId: string, bodyMarkdown: string): Promise<WorkTaskComment>;
107
- registerArtifact(credential: string, runId: string, taskId: string, artifact: WorkArtifactInput): Promise<WorkArtifact>;
118
+ readWorkContext(credential: string, runId: string, taskId: string, options?: AttemptMutationOptions): Promise<SiftWakeEnvelope>;
119
+ checkoutTask(credential: string, runId: string, taskId: string, options?: AttemptMutationOptions): Promise<WorkTask>;
120
+ createChildTasks(credential: string, runId: string, taskId: string, children: WorkChildTaskInput[], options?: AttemptMutationOptions): Promise<WorkTask[]>;
121
+ addTaskComment(credential: string, runId: string, taskId: string, bodyMarkdown: string, options?: AttemptMutationOptions): Promise<WorkTaskComment>;
122
+ registerArtifact(credential: string, runId: string, taskId: string, artifact: WorkArtifactInput, options?: AttemptMutationOptions): Promise<WorkArtifact>;
108
123
  requestApproval(credential: string, runId: string, taskId: string, request: {
109
124
  type: string;
110
125
  payload?: JsonObject;
111
126
  idempotencyKey?: string;
112
- }): Promise<WorkApproval>;
127
+ }, options?: AttemptMutationOptions): Promise<WorkApproval>;
113
128
  reportUsage(credential: string, runId: string, taskId: string, usage: {
114
129
  eventKey: string;
115
130
  costMicros: number;
116
131
  durationMs: number;
117
- }): Promise<WorkUsageDecision>;
118
- setTaskDisposition(credential: string, runId: string, taskId: string, disposition: WorkDisposition, resultSummary?: JsonObject): Promise<WorkDispositionResponse>;
132
+ }, options?: AttemptMutationOptions): Promise<WorkUsageDecision>;
133
+ setTaskDisposition(credential: string, runId: string, taskId: string, disposition: WorkDisposition, resultSummary?: JsonObject, options?: AttemptMutationOptions): Promise<WorkDispositionResponse>;
119
134
  listTasks(userCredential: string, projectId?: string): Promise<WorkTask[]>;
120
135
  listRuns(userCredential: string, taskId?: string): Promise<ClaimedJob[]>;
121
136
  };
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const CONDUCTOR_VERSION = "0.2.0-beta.1";
1
+ export declare const CONDUCTOR_VERSION = "0.2.0-beta.2";
2
2
  export declare const PROTOCOL_VERSION = "v1";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const CONDUCTOR_VERSION = "0.2.0-beta.1";
1
+ export const CONDUCTOR_VERSION = "0.2.0-beta.2";
2
2
  export const PROTOCOL_VERSION = "v1";
3
3
  //# sourceMappingURL=version.js.map
@@ -56,10 +56,10 @@ export declare const workArtifactSchema: z.ZodObject<{
56
56
  url: z.ZodOptional<z.ZodString>;
57
57
  brainRecordId: z.ZodOptional<z.ZodString>;
58
58
  status: z.ZodEnum<{
59
+ superseded: "superseded";
60
+ failed: "failed";
59
61
  pending: "pending";
60
62
  ready: "ready";
61
- failed: "failed";
62
- superseded: "superseded";
63
63
  }>;
64
64
  reviewState: z.ZodEnum<{
65
65
  pending: "pending";
@@ -106,9 +106,9 @@ export declare const workProjectSchema: z.ZodObject<{
106
106
  description: z.ZodOptional<z.ZodString>;
107
107
  status: z.ZodEnum<{
108
108
  cancelled: "cancelled";
109
+ completed: "completed";
109
110
  planned: "planned";
110
111
  active: "active";
111
- completed: "completed";
112
112
  }>;
113
113
  leadPrincipalId: z.ZodOptional<z.ZodString>;
114
114
  contextRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -181,10 +181,10 @@ export declare const workTaskDetailSchema: z.ZodObject<{
181
181
  url: z.ZodOptional<z.ZodString>;
182
182
  brainRecordId: z.ZodOptional<z.ZodString>;
183
183
  status: z.ZodEnum<{
184
+ superseded: "superseded";
185
+ failed: "failed";
184
186
  pending: "pending";
185
187
  ready: "ready";
186
- failed: "failed";
187
- superseded: "superseded";
188
188
  }>;
189
189
  reviewState: z.ZodEnum<{
190
190
  pending: "pending";