@knpkv/herdr-work 0.5.3 → 0.6.0
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/README.md +86 -0
- package/dist/display-state.d.ts +10 -0
- package/dist/display-state.d.ts.map +1 -0
- package/dist/display-state.js +5 -0
- package/dist/display-state.js.map +1 -0
- package/dist/errors.d.ts +21 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/legacy-lane-claim.d.ts +74 -0
- package/dist/internal/legacy-lane-claim.d.ts.map +1 -0
- package/dist/internal/legacy-lane-claim.js +81 -0
- package/dist/internal/legacy-lane-claim.js.map +1 -0
- package/dist/internal/session-index.d.ts +18 -0
- package/dist/internal/session-index.d.ts.map +1 -0
- package/dist/internal/session-index.js +23 -0
- package/dist/internal/session-index.js.map +1 -0
- package/dist/internal/terminal-reconcile.d.ts +29 -0
- package/dist/internal/terminal-reconcile.d.ts.map +1 -0
- package/dist/internal/terminal-reconcile.js +79 -0
- package/dist/internal/terminal-reconcile.js.map +1 -0
- package/dist/model.d.ts +909 -29
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +236 -7
- package/dist/model.js.map +1 -1
- package/dist/observed.d.ts +77 -0
- package/dist/observed.d.ts.map +1 -0
- package/dist/observed.js +240 -0
- package/dist/observed.js.map +1 -0
- package/dist/projection.d.ts +192 -12
- package/dist/projection.d.ts.map +1 -1
- package/dist/service.d.ts +121 -992
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +13 -3
- package/dist/service.js.map +1 -1
- package/dist/sql.d.ts.map +1 -1
- package/dist/sql.js +76 -3
- package/dist/sql.js.map +1 -1
- package/dist/store.d.ts +193 -11
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +687 -37
- package/dist/store.js.map +1 -1
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +169 -103
- package/dist/view.js.map +1 -1
- package/dist/work-triage.d.ts +72 -0
- package/dist/work-triage.d.ts.map +1 -0
- package/dist/work-triage.js +114 -0
- package/dist/work-triage.js.map +1 -0
- package/package.json +3 -3
- package/src/styles.css +229 -237
package/dist/store.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Crypto, Effect, Option, Schema } from "effect";
|
|
2
|
-
import { WorkAdmissionConflictError, WorkAgentBindingAuthorityError, WorkAgentBindingConflictError, WorkCheckpointConflictError, WorkCoordinatorHandoffConflictError, WorkDecisionAuthorityConflictError, WorkDecisionHandoffConflictError, WorkDecisionRevisionConflictError, WorkGoalAgentTargetConflictError, WorkGoalBindingRequiresAgentError, WorkGoalOwnerMismatchError, WorkGoalReassignmentConflictError, WorkGoalRevisionConflictError, WorkLaneClaimConflictError, WorkLaneGoalConflictError, WorkLaneOperationConflictError, WorkProjectionError, WorkPullRequestLinkError, WorkStoreError, WorkTransactionConflictError } from "./errors.js";
|
|
2
|
+
import { WorkAdmissionConflictError, WorkAgentBindingAuthorityError, WorkAgentBindingConflictError, WorkCheckpointConflictError, WorkCoordinatorHandoffConflictError, WorkDecisionAuthorityConflictError, WorkDecisionHandoffConflictError, WorkDecisionRevisionConflictError, WorkGoalAbandonmentConflictError, WorkGoalAgentTargetConflictError, WorkGoalBindingRequiresAgentError, WorkGoalLaneActiveError, WorkGoalOwnerMismatchError, WorkGoalReassignmentConflictError, WorkGoalRevisionConflictError, WorkGoalTerminalError, WorkLaneClaimConflictError, WorkLaneGoalConflictError, WorkLaneOperationConflictError, WorkProjectionError, WorkPullRequestLinkError, WorkStoreError, WorkTransactionConflictError } from "./errors.js";
|
|
3
3
|
import { workAgentBindingMaximumSnapshotBytes } from "./internal/agent-binding-admission.js";
|
|
4
|
-
import { WorkAdmissionTarget, WorkAgentBinding, WorkAgentBindingRequest, WorkDecisionHandoff, WorkGoalCheckpoint, WorkGoalReassigned, WorkLaneClaim, WorkLaneClaimed, WorkPullRequestLink, WorkRecoveryTarget } from "./model.js";
|
|
5
|
-
import type { WorkAdmissionPreflight as WorkAdmissionPreflightType, WorkAdmissionTarget as WorkAdmissionTargetType, WorkAgentBinding as WorkAgentBindingType, WorkAgentBindingRequest as WorkAgentBindingRequestType, WorkExistingGoalRecovery as WorkExistingGoalRecoveryType, WorkGoalCheckpoint as WorkGoalCheckpointType, WorkGoalReassigned as WorkGoalReassignedType, WorkGoalReassignment as WorkGoalReassignmentType, WorkProspectiveAdmission as WorkProspectiveAdmissionType, WorkPullRequestLink as WorkPullRequestLinkType, WorkRecoveryPreflight as WorkRecoveryPreflightType, WorkRecoveryTarget as WorkRecoveryTargetType } from "./model.js";
|
|
4
|
+
import { WorkAdmissionTarget, WorkAgentBinding, WorkAgentBindingRequest, WorkDecisionHandoff, WorkGoalAbandoned, WorkGoalCheckpoint, WorkGoalReassigned, WorkLaneClaim, WorkLaneClaimed, WorkObservationEnvelope, WorkPullRequestLink, WorkRecoveryTarget } from "./model.js";
|
|
5
|
+
import type { WorkActivity as WorkActivityType, WorkAdmissionPreflight as WorkAdmissionPreflightType, WorkAdmissionTarget as WorkAdmissionTargetType, WorkAgentBinding as WorkAgentBindingType, WorkAgentBindingRequest as WorkAgentBindingRequestType, WorkExistingGoalRecovery as WorkExistingGoalRecoveryType, WorkGoalAbandoned as WorkGoalAbandonedType, WorkGoalAbandonment as WorkGoalAbandonmentType, WorkGoalCheckpoint as WorkGoalCheckpointType, WorkGoalReassigned as WorkGoalReassignedType, WorkGoalReassignment as WorkGoalReassignmentType, WorkObservationEnvelope as WorkObservationEnvelopeType, WorkObservedAdmission as WorkObservedAdmissionType, WorkObservedFact as WorkObservedFactType, WorkObservedFailure as WorkObservedFailureType, WorkObserveReport, WorkProspectiveAdmission as WorkProspectiveAdmissionType, WorkPullRequestLink as WorkPullRequestLinkType, WorkReconcileOutcome, WorkRecoveryPreflight as WorkRecoveryPreflightType, WorkRecoveryTarget as WorkRecoveryTargetType } from "./model.js";
|
|
6
|
+
import { type WorkApprovedActivity } from "./observed.js";
|
|
6
7
|
type ReassignRejection = WorkGoalAgentTargetConflictError | WorkGoalBindingRequiresAgentError | WorkGoalOwnerMismatchError | WorkGoalReassignmentConflictError | WorkGoalRevisionConflictError | WorkProjectionError | WorkStoreError;
|
|
8
|
+
type AbandonRejection = WorkGoalAbandonmentConflictError | WorkGoalLaneActiveError | WorkGoalOwnerMismatchError | WorkGoalRevisionConflictError | WorkGoalTerminalError | WorkProjectionError | WorkStoreError;
|
|
7
9
|
declare const encodedBytes: (value: typeof Schema.Json.Type) => number;
|
|
8
10
|
export declare const __herdrWorkMaximumSnapshotBytesForTest: typeof workAgentBindingMaximumSnapshotBytes;
|
|
9
11
|
export declare const __herdrWorkEncodedBytesForTest: typeof encodedBytes;
|
|
@@ -14,8 +16,10 @@ export interface WorkStoreService {
|
|
|
14
16
|
readonly recoverExistingGoal: (request: WorkExistingGoalRecoveryType) => Effect.Effect<WorkPullRequestLinkType, WorkAdmissionConflictError | WorkProjectionError | WorkStoreError>;
|
|
15
17
|
/** Moves one goal, and its active lane, from the exact current owner under an approved Fleet job. */
|
|
16
18
|
readonly reassign: (request: WorkGoalReassignmentType) => Effect.Effect<WorkGoalReassignedType, ReassignRejection>;
|
|
19
|
+
readonly abandon: (request: WorkGoalAbandonmentType) => Effect.Effect<WorkGoalAbandonedType, AbandonRejection>;
|
|
17
20
|
readonly admissionPreflight: (target: WorkAdmissionTargetType) => Effect.Effect<WorkAdmissionPreflightType, WorkProjectionError | WorkStoreError>;
|
|
18
21
|
readonly admitExistingOwner: (request: WorkProspectiveAdmissionType) => Effect.Effect<WorkPullRequestLinkType, WorkAdmissionConflictError | WorkProjectionError | WorkStoreError>;
|
|
22
|
+
readonly admitObserved: (request: WorkObservedAdmissionType) => Effect.Effect<WorkPullRequestLinkType, WorkAdmissionConflictError | WorkProjectionError | WorkStoreError>;
|
|
19
23
|
readonly bindAgent: (request: WorkAgentBindingRequestType) => Effect.Effect<WorkAgentBindingType, WorkAgentBindingAuthorityError | WorkAgentBindingConflictError | WorkProjectionError | WorkStoreError>;
|
|
20
24
|
readonly agentBinding: (dispatchRequestId: string) => Effect.Effect<Option.Option<WorkAgentBindingType>, WorkStoreError>;
|
|
21
25
|
readonly bindingDispatchesForLane: (laneId: string) => Effect.Effect<ReadonlyArray<string>, WorkStoreError>;
|
|
@@ -28,9 +32,44 @@ export interface WorkStoreService {
|
|
|
28
32
|
readonly coordinatorHandoff: (sessionId: string) => Effect.Effect<Option.Option<WorkDecisionHandoff>, WorkStoreError>;
|
|
29
33
|
readonly decisions: (laneId: string) => Effect.Effect<ReadonlyArray<WorkDecisionHandoff>, WorkStoreError>;
|
|
30
34
|
readonly list: () => Effect.Effect<ReadonlyArray<WorkGoalCheckpointType>, WorkStoreError>;
|
|
31
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Stores the latest observed facts per subject. Facts are never goal history
|
|
37
|
+
* and never input to an approval token, so observing cannot invalidate a
|
|
38
|
+
* pending approval or fill the goal history.
|
|
39
|
+
*/
|
|
40
|
+
readonly observe: (envelopes: ReadonlyArray<WorkObservationEnvelopeType>) => Effect.Effect<WorkObserveReport, WorkStoreError>;
|
|
41
|
+
/**
|
|
42
|
+
* Records each goal whose pull request is observed merged or closed as
|
|
43
|
+
* completed or abandoned, stamped with the close time. Only these terminal
|
|
44
|
+
* facts are ever written to goal history; everything else stays an overlay.
|
|
45
|
+
*/
|
|
46
|
+
readonly reconcile: () => Effect.Effect<ReadonlyArray<WorkReconcileOutcome>, WorkCheckpointConflictError | WorkProjectionError | WorkStoreError>;
|
|
47
|
+
/** Atomically reads projection history, observed facts, and the coordinator-owned logical-time boundary. */
|
|
32
48
|
readonly snapshotInput: () => Effect.Effect<{
|
|
33
49
|
readonly events: ReadonlyArray<WorkGoalCheckpointType>;
|
|
50
|
+
readonly facts: ReadonlyArray<WorkObservedFactType>;
|
|
51
|
+
readonly failures: ReadonlyArray<WorkObservedFailureType>;
|
|
52
|
+
/** Each activity an approved Fleet job wrote, with that job's id. */
|
|
53
|
+
readonly approvals: ReadonlyArray<WorkApprovedActivity>;
|
|
54
|
+
/** The checkpoints the reconciler wrote, from its own record of them. */
|
|
55
|
+
readonly reconcilerEvents: ReadonlyArray<{
|
|
56
|
+
readonly goalId: string;
|
|
57
|
+
readonly eventId: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* The admission checkpoints the reconciler wrote for observed workers, from
|
|
61
|
+
* their bindings. Kept apart from `reconcilerEvents`, which also marks a goal
|
|
62
|
+
* as already given its terminal checkpoint.
|
|
63
|
+
*/
|
|
64
|
+
readonly observedAdmissions: ReadonlyArray<{
|
|
65
|
+
readonly goalId: string;
|
|
66
|
+
readonly eventId: string;
|
|
67
|
+
}>;
|
|
68
|
+
/** The checkpoint that started each current activity's unchanged run, and its content, keyed by goal id and activity id. */
|
|
69
|
+
readonly activityOrigins: ReadonlyMap<string, {
|
|
70
|
+
readonly eventId: string;
|
|
71
|
+
readonly activity: WorkActivityType;
|
|
72
|
+
}>;
|
|
34
73
|
readonly logicalObservedAt: number | null;
|
|
35
74
|
}, WorkStoreError>;
|
|
36
75
|
}
|
|
@@ -115,7 +154,7 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
115
154
|
readonly title: string;
|
|
116
155
|
readonly summary: string;
|
|
117
156
|
readonly detail: string;
|
|
118
|
-
readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
157
|
+
readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
119
158
|
readonly owner: {
|
|
120
159
|
readonly id: string;
|
|
121
160
|
readonly name: string;
|
|
@@ -252,6 +291,14 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
252
291
|
readonly approvalJobId: string;
|
|
253
292
|
readonly approvalActor: string;
|
|
254
293
|
};
|
|
294
|
+
readonly observedAdmission?: {
|
|
295
|
+
readonly sessionId: string;
|
|
296
|
+
readonly workAssignment: string;
|
|
297
|
+
readonly baseHead: string;
|
|
298
|
+
readonly expectedAbsenceToken: string;
|
|
299
|
+
readonly actor: "reconciler";
|
|
300
|
+
readonly observationId: string;
|
|
301
|
+
};
|
|
255
302
|
readonly existingGoalRecovery?: {
|
|
256
303
|
readonly sessionId: string;
|
|
257
304
|
readonly workAssignment: string;
|
|
@@ -321,7 +368,7 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
321
368
|
readonly title: string;
|
|
322
369
|
readonly summary: string;
|
|
323
370
|
readonly detail: string;
|
|
324
|
-
readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
371
|
+
readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
325
372
|
readonly owner: {
|
|
326
373
|
readonly id: string;
|
|
327
374
|
readonly name: string;
|
|
@@ -505,6 +552,29 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
505
552
|
readonly approvalApprovedAt: number;
|
|
506
553
|
readonly approvalHash: string;
|
|
507
554
|
}) => Effect.Effect<WorkGoalReassigned, WorkGoalAgentTargetConflictError | WorkGoalBindingRequiresAgentError | WorkGoalOwnerMismatchError | WorkGoalReassignmentConflictError | WorkGoalRevisionConflictError | WorkProjectionError | WorkStoreError, never>;
|
|
555
|
+
/**
|
|
556
|
+
* Applies an approved `work.abandon` job: the goal, owned by exactly the
|
|
557
|
+
* approved owner and still at the approved head, becomes `abandoned` with its
|
|
558
|
+
* blocker cleared and a status activity naming the job. A goal with an
|
|
559
|
+
* active lane, or already finished, is refused; nothing else is written. An
|
|
560
|
+
* exact replay of the job returns the stored result.
|
|
561
|
+
*/
|
|
562
|
+
readonly abandon: (this: WorkStore, request: {
|
|
563
|
+
readonly kind: "work.abandon";
|
|
564
|
+
readonly goalId: string;
|
|
565
|
+
readonly owner: {
|
|
566
|
+
readonly id: string;
|
|
567
|
+
readonly name: string;
|
|
568
|
+
};
|
|
569
|
+
readonly reason: string;
|
|
570
|
+
readonly expectedGoalEventId: string;
|
|
571
|
+
readonly expectedGoalUpdatedAt: number;
|
|
572
|
+
readonly approvalJobId: string;
|
|
573
|
+
readonly approvalActor: string;
|
|
574
|
+
readonly approvalApprovedBy: string;
|
|
575
|
+
readonly approvalApprovedAt: number;
|
|
576
|
+
readonly approvalHash: string;
|
|
577
|
+
}) => Effect.Effect<WorkGoalAbandoned, WorkGoalAbandonmentConflictError | WorkGoalLaneActiveError | WorkGoalOwnerMismatchError | WorkGoalRevisionConflictError | WorkGoalTerminalError | WorkProjectionError | WorkStoreError, never>;
|
|
508
578
|
readonly admissionPreflight: (this: WorkStore, target: WorkAdmissionTarget) => Effect.Effect<{
|
|
509
579
|
readonly _tag: "conflict";
|
|
510
580
|
readonly target: {
|
|
@@ -577,7 +647,7 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
577
647
|
readonly title: string;
|
|
578
648
|
readonly summary: string;
|
|
579
649
|
readonly detail: string;
|
|
580
|
-
readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
650
|
+
readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
581
651
|
readonly owner: {
|
|
582
652
|
readonly id: string;
|
|
583
653
|
readonly name: string;
|
|
@@ -714,6 +784,14 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
714
784
|
readonly approvalJobId: string;
|
|
715
785
|
readonly approvalActor: string;
|
|
716
786
|
};
|
|
787
|
+
readonly observedAdmission?: {
|
|
788
|
+
readonly sessionId: string;
|
|
789
|
+
readonly workAssignment: string;
|
|
790
|
+
readonly baseHead: string;
|
|
791
|
+
readonly expectedAbsenceToken: string;
|
|
792
|
+
readonly actor: "reconciler";
|
|
793
|
+
readonly observationId: string;
|
|
794
|
+
};
|
|
717
795
|
readonly existingGoalRecovery?: {
|
|
718
796
|
readonly sessionId: string;
|
|
719
797
|
readonly workAssignment: string;
|
|
@@ -783,7 +861,7 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
783
861
|
readonly title: string;
|
|
784
862
|
readonly summary: string;
|
|
785
863
|
readonly detail: string;
|
|
786
|
-
readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
864
|
+
readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
787
865
|
readonly owner: {
|
|
788
866
|
readonly id: string;
|
|
789
867
|
readonly name: string;
|
|
@@ -891,6 +969,10 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
891
969
|
};
|
|
892
970
|
readonly absenceToken: string;
|
|
893
971
|
}, WorkStoreError, never>;
|
|
972
|
+
/**
|
|
973
|
+
* Admits an existing owner after an approved Fleet job. Its absence token is
|
|
974
|
+
* re-checked inside the write; an exact replay returns the stored link.
|
|
975
|
+
*/
|
|
894
976
|
readonly admitExistingOwner: (this: WorkStore, request: {
|
|
895
977
|
readonly kind: "work.admit";
|
|
896
978
|
readonly repository: string;
|
|
@@ -926,10 +1008,54 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
926
1008
|
readonly approvalJobId: string;
|
|
927
1009
|
readonly approvalActor: string;
|
|
928
1010
|
}) => Effect.Effect<WorkPullRequestLink, WorkAdmissionConflictError | WorkProjectionError | WorkStoreError, never>;
|
|
1011
|
+
/**
|
|
1012
|
+
* Admits a worker the reconciler observed, without an approval: the same
|
|
1013
|
+
* write and checks as `admitExistingOwner`, credited to the observation.
|
|
1014
|
+
*/
|
|
1015
|
+
readonly admitObserved: (this: WorkStore, request: {
|
|
1016
|
+
readonly repository: string;
|
|
1017
|
+
readonly pullRequest: number;
|
|
1018
|
+
readonly reviewUrl: string;
|
|
1019
|
+
readonly goalId: string;
|
|
1020
|
+
readonly laneId: string;
|
|
1021
|
+
readonly operationId: string;
|
|
1022
|
+
readonly expectedAbsenceToken: string;
|
|
1023
|
+
readonly head: string;
|
|
1024
|
+
readonly baseHead: string;
|
|
1025
|
+
readonly owner: {
|
|
1026
|
+
readonly id: string;
|
|
1027
|
+
readonly name: string;
|
|
1028
|
+
};
|
|
1029
|
+
readonly sessionId: string;
|
|
1030
|
+
readonly expectedWork: string;
|
|
1031
|
+
readonly worker: {
|
|
1032
|
+
readonly host: string;
|
|
1033
|
+
readonly agentId: string;
|
|
1034
|
+
readonly name: string;
|
|
1035
|
+
readonly paneId: string;
|
|
1036
|
+
readonly relationship?: {
|
|
1037
|
+
readonly parentAgentId: string;
|
|
1038
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
readonly worktree: string;
|
|
1042
|
+
readonly branch: string;
|
|
1043
|
+
readonly title: string;
|
|
1044
|
+
readonly summary: string;
|
|
1045
|
+
readonly detail: string;
|
|
1046
|
+
readonly observationId: string;
|
|
1047
|
+
}) => Effect.Effect<WorkPullRequestLink, WorkAdmissionConflictError | WorkProjectionError | WorkStoreError, never>;
|
|
929
1048
|
readonly bindAgent: (this: WorkStore, request: WorkAgentBindingRequest) => Effect.Effect<WorkAgentBinding, WorkAgentBindingAuthorityError | WorkAgentBindingConflictError | WorkProjectionError | WorkStoreError, never>;
|
|
930
1049
|
readonly agentBinding: (this: WorkStore, dispatchRequestId: string) => Effect.Effect<Option.None<WorkAgentBinding> | Option.Some<WorkAgentBinding>, WorkStoreError, never>;
|
|
931
1050
|
readonly bindingDispatchesForLane: (this: WorkStore, laneId: string) => Effect.Effect<string[], WorkStoreError, never>;
|
|
932
|
-
readonly append: (
|
|
1051
|
+
readonly append: (event: WorkGoalCheckpointType) => Effect.Effect<WorkGoalCheckpoint, WorkCheckpointConflictError | WorkProjectionError | WorkStoreError, never>;
|
|
1052
|
+
/**
|
|
1053
|
+
* Appends one checkpoint. With `expectedHead`, the goal's latest checkpoint
|
|
1054
|
+
* must still be that one when the write commits (an exact replay always
|
|
1055
|
+
* succeeds), so a writer that planned from the head cannot bury a newer
|
|
1056
|
+
* owner checkpoint.
|
|
1057
|
+
*/
|
|
1058
|
+
private readonly appendAt;
|
|
933
1059
|
readonly appendMany: (this: WorkStore, transactionId: string, events: readonly WorkGoalCheckpoint[]) => Effect.Effect<{
|
|
934
1060
|
readonly version: "herdr.work.event.v1";
|
|
935
1061
|
readonly eventId: string;
|
|
@@ -939,7 +1065,7 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
939
1065
|
readonly title: string;
|
|
940
1066
|
readonly summary: string;
|
|
941
1067
|
readonly detail: string;
|
|
942
|
-
readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
1068
|
+
readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
943
1069
|
readonly owner: {
|
|
944
1070
|
readonly id: string;
|
|
945
1071
|
readonly name: string;
|
|
@@ -1079,7 +1205,7 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
1079
1205
|
readonly title: string;
|
|
1080
1206
|
readonly summary: string;
|
|
1081
1207
|
readonly detail: string;
|
|
1082
|
-
readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
1208
|
+
readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
|
|
1083
1209
|
readonly owner: {
|
|
1084
1210
|
readonly id: string;
|
|
1085
1211
|
readonly name: string;
|
|
@@ -1155,9 +1281,65 @@ export declare class WorkStore implements WorkStoreService {
|
|
|
1155
1281
|
};
|
|
1156
1282
|
}[], WorkStoreError, never>;
|
|
1157
1283
|
readonly snapshotInput: (this: WorkStore) => Effect.Effect<{
|
|
1284
|
+
activityOrigins: Map<string, {
|
|
1285
|
+
readonly eventId: string;
|
|
1286
|
+
readonly activity: WorkActivityType;
|
|
1287
|
+
}>;
|
|
1288
|
+
approvals: WorkApprovedActivity[];
|
|
1158
1289
|
events: WorkGoalCheckpoint[];
|
|
1290
|
+
facts: {
|
|
1291
|
+
readonly subject: string;
|
|
1292
|
+
readonly observationId: string;
|
|
1293
|
+
readonly observedAt: number;
|
|
1294
|
+
readonly confirmedAt: number;
|
|
1295
|
+
readonly observation: {
|
|
1296
|
+
readonly _tag: "pull_request";
|
|
1297
|
+
readonly repository: string;
|
|
1298
|
+
readonly pullRequest: number;
|
|
1299
|
+
readonly state: "closed" | "merged" | "open";
|
|
1300
|
+
readonly branch: string;
|
|
1301
|
+
readonly head: string;
|
|
1302
|
+
readonly review: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
1303
|
+
readonly checks: "failing" | "none" | "passing" | "pending";
|
|
1304
|
+
readonly closedAt: number | null;
|
|
1305
|
+
} | {
|
|
1306
|
+
readonly _tag: "agent";
|
|
1307
|
+
readonly host: string;
|
|
1308
|
+
readonly agentId: string;
|
|
1309
|
+
readonly status: "blocked" | "done" | "gone" | "idle" | "working";
|
|
1310
|
+
};
|
|
1311
|
+
}[];
|
|
1312
|
+
failures: readonly {
|
|
1313
|
+
readonly subject: string;
|
|
1314
|
+
readonly source: "git" | "github" | "herdr";
|
|
1315
|
+
readonly reason: string;
|
|
1316
|
+
readonly since: number;
|
|
1317
|
+
readonly lastAt: number;
|
|
1318
|
+
}[];
|
|
1159
1319
|
logicalObservedAt: number | null;
|
|
1320
|
+
observedAdmissions: {
|
|
1321
|
+
readonly goalId: string;
|
|
1322
|
+
readonly eventId: string;
|
|
1323
|
+
}[];
|
|
1324
|
+
reconcilerEvents: readonly {
|
|
1325
|
+
readonly eventId: string;
|
|
1326
|
+
readonly goalId: string;
|
|
1327
|
+
}[];
|
|
1160
1328
|
}, WorkStoreError, never>;
|
|
1329
|
+
readonly reconcile: (this: WorkStore) => Effect.Effect<({
|
|
1330
|
+
readonly _tag: "applied";
|
|
1331
|
+
readonly goalId: string;
|
|
1332
|
+
readonly eventId: string;
|
|
1333
|
+
readonly state: "abandoned" | "completed";
|
|
1334
|
+
} | {
|
|
1335
|
+
readonly _tag: "conflict";
|
|
1336
|
+
readonly goalId: string;
|
|
1337
|
+
} | {
|
|
1338
|
+
readonly _tag: "recorded";
|
|
1339
|
+
readonly goalId: string;
|
|
1340
|
+
readonly eventId: string;
|
|
1341
|
+
})[], WorkCheckpointConflictError | WorkProjectionError | WorkStoreError, never>;
|
|
1342
|
+
readonly observe: (this: WorkStore, envelopes: readonly WorkObservationEnvelope[]) => Effect.Effect<WorkObserveReport, WorkStoreError, never>;
|
|
1161
1343
|
private secureFiles;
|
|
1162
1344
|
close(): void;
|
|
1163
1345
|
}
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAOA,OAAO,EAAS,MAAM,EAAE,MAAM,EAAS,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAI7E,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,mCAAmC,EACnC,kCAAkC,EAClC,gCAAgC,EAChC,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,0BAA0B,EAC1B,iCAAiC,EACjC,6BAA6B,EAC7B,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,8BAA8B,EAC9B,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,4BAA4B,EAC7B,MAAM,aAAa,CAAA;AAEpB,OAAO,EAIL,oCAAoC,EAGrC,MAAM,uCAAuC,CAAA;AAmD9C,OAAO,EAGL,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EAEvB,mBAAmB,EAInB,iBAAiB,EAEjB,kBAAkB,EAElB,kBAAkB,EAGlB,aAAa,EACb,eAAe,EACf,uBAAuB,EASvB,mBAAmB,EAEnB,kBAAkB,EAEnB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,sBAAsB,IAAI,0BAA0B,EACpD,mBAAmB,IAAI,uBAAuB,EAC9C,gBAAgB,IAAI,oBAAoB,EACxC,uBAA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