@knpkv/herdr-work 0.2.0 → 0.4.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 +13 -1
- package/dist/goal-family.d.ts +4 -0
- package/dist/goal-family.d.ts.map +1 -0
- package/dist/goal-family.js +32 -0
- package/dist/goal-family.js.map +1 -0
- package/dist/model.d.ts +404 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +110 -2
- package/dist/model.js.map +1 -1
- package/dist/projection.d.ts +192 -0
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +7 -2
- package/dist/projection.js.map +1 -1
- package/dist/service.d.ts +192 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/store.d.ts +48 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +20 -18
- package/dist/store.js.map +1 -1
- package/dist/view.d.ts +9 -2
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +45 -5
- package/dist/view.js.map +1 -1
- package/package.json +5 -3
- package/src/styles.css +46 -3
package/dist/model.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { AgentConnectTarget } from "@knpkv/herdr-fleet/model";
|
|
1
|
+
import { AgentConnectTarget, AgentWorkerIdentity } from "@knpkv/herdr-fleet/model";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
const Identifier = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(256));
|
|
4
|
+
// Approval hosts are bounded identifiers, not DNS names; the approvals app also
|
|
5
|
+
// accepts labels such as "PI 5".
|
|
6
|
+
const ApprovalHostName = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(256));
|
|
4
7
|
const Text = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(4_096), Schema.isPattern(/^[^\p{Cc}]+$/u));
|
|
5
8
|
const Timestamp = Schema.Number.check(Schema.isInt(), Schema.isBetween({ minimum: 0, maximum: 8_640_000_000_000_000 }));
|
|
9
|
+
/**
|
|
10
|
+
* Credential-free HTTP(S) URL persisted for an outbound handoff. Provider
|
|
11
|
+
* credentials and private locators never belong in this representation.
|
|
12
|
+
*/
|
|
13
|
+
const LinkUrl = Schema.String.check(Schema.isMaxLength(2_048), Schema.makeFilter((value) => {
|
|
14
|
+
if (!URL.canParse(value))
|
|
15
|
+
return false;
|
|
16
|
+
const url = new URL(value);
|
|
17
|
+
return (url.protocol === "http:" || url.protocol === "https:") &&
|
|
18
|
+
url.username === "" &&
|
|
19
|
+
url.password === "";
|
|
20
|
+
}, { expected: "an HTTP(S) URL without embedded credentials" }));
|
|
6
21
|
export const workHistoryMaxEvents = 16_384;
|
|
7
22
|
export const workSnapshotMaxGoals = 1_024;
|
|
8
23
|
export const WorkGoalId = Identifier;
|
|
@@ -21,6 +36,67 @@ export const WorkBlocker = Schema.Struct({
|
|
|
21
36
|
summary: Text,
|
|
22
37
|
since: Timestamp
|
|
23
38
|
});
|
|
39
|
+
export const WorkAgentHierarchy = Schema.Struct({
|
|
40
|
+
agent: AgentWorkerIdentity
|
|
41
|
+
});
|
|
42
|
+
export const WorkActivityKind = Schema.Literals([
|
|
43
|
+
"note",
|
|
44
|
+
"status",
|
|
45
|
+
"blocker",
|
|
46
|
+
"request",
|
|
47
|
+
"review",
|
|
48
|
+
"shipment"
|
|
49
|
+
]);
|
|
50
|
+
export const WorkActivity = Schema.Struct({
|
|
51
|
+
id: Identifier,
|
|
52
|
+
kind: WorkActivityKind,
|
|
53
|
+
summary: Text,
|
|
54
|
+
occurredAt: Timestamp
|
|
55
|
+
});
|
|
56
|
+
export const WorkApprovalTarget = Schema.Struct({
|
|
57
|
+
host: ApprovalHostName,
|
|
58
|
+
jobId: Identifier,
|
|
59
|
+
url: LinkUrl
|
|
60
|
+
}).check(Schema.makeFilter(({ host, jobId, url }) => {
|
|
61
|
+
const parsed = new URL(url);
|
|
62
|
+
const queryKeys = [...parsed.searchParams.keys()];
|
|
63
|
+
const approvalHosts = parsed.searchParams.getAll("approvalHost");
|
|
64
|
+
const approvalJobs = parsed.searchParams.getAll("approvalJob");
|
|
65
|
+
return parsed.pathname === "/" &&
|
|
66
|
+
parsed.hash === "" &&
|
|
67
|
+
queryKeys.length === 3 &&
|
|
68
|
+
parsed.searchParams.getAll("tab").length === 1 &&
|
|
69
|
+
parsed.searchParams.get("tab") === "approvals" &&
|
|
70
|
+
approvalHosts.length === 1 &&
|
|
71
|
+
approvalJobs.length === 1 &&
|
|
72
|
+
approvalHosts[0]?.toLowerCase() === host.toLowerCase() &&
|
|
73
|
+
approvalJobs[0] === jobId;
|
|
74
|
+
}, { expected: "an approval URL with matching host and job identity" }));
|
|
75
|
+
/**
|
|
76
|
+
* Checks a decoded approval target against the origin resolved by the
|
|
77
|
+
* configuration-aware approvals boundary before the target is persisted.
|
|
78
|
+
*/
|
|
79
|
+
export const approvalTargetMatchesOrigin = (target, authoritativeOrigin) => new URL(target.url).origin === authoritativeOrigin;
|
|
80
|
+
export const WorkRequestState = Schema.Literals(["open", "approved", "rejected", "fulfilled"]);
|
|
81
|
+
export const WorkRequest = Schema.Struct({
|
|
82
|
+
id: Identifier,
|
|
83
|
+
summary: Text,
|
|
84
|
+
state: WorkRequestState,
|
|
85
|
+
requestedAt: Timestamp,
|
|
86
|
+
approvalTarget: Schema.NullOr(WorkApprovalTarget)
|
|
87
|
+
});
|
|
88
|
+
export const WorkReviewState = Schema.Literals(["not_requested", "requested", "changes_requested", "approved"]);
|
|
89
|
+
/** Review status plus the persisted credential-free destination, when known. */
|
|
90
|
+
export const WorkReview = Schema.Struct({
|
|
91
|
+
state: WorkReviewState,
|
|
92
|
+
summary: Schema.NullOr(Text),
|
|
93
|
+
updatedAt: Timestamp,
|
|
94
|
+
url: Schema.NullOr(LinkUrl)
|
|
95
|
+
});
|
|
96
|
+
export const WorkGoalFamily = Schema.Struct({
|
|
97
|
+
canonicalGoalId: WorkGoalId,
|
|
98
|
+
role: Schema.Literals(["canonical", "superseded"])
|
|
99
|
+
});
|
|
24
100
|
export const WorkGoal = Schema.Struct({
|
|
25
101
|
id: WorkGoalId,
|
|
26
102
|
title: Text,
|
|
@@ -33,9 +109,41 @@ export const WorkGoal = Schema.Struct({
|
|
|
33
109
|
delivery: DeliveryStage,
|
|
34
110
|
blocker: Schema.NullOr(WorkBlocker),
|
|
35
111
|
connectTarget: Schema.NullOr(AgentConnectTarget),
|
|
112
|
+
goalFamily: Schema.optionalKey(WorkGoalFamily),
|
|
113
|
+
agentHierarchy: Schema.optionalKey(Schema.NullOr(WorkAgentHierarchy)),
|
|
114
|
+
activity: Schema.optionalKey(Schema.Array(WorkActivity)
|
|
115
|
+
.check(Schema.isMaxLength(128))
|
|
116
|
+
.check(Schema.makeFilter((activities) => new Set(activities.map(({ id }) => id)).size === activities.length, { expected: "unique activity ids" }))),
|
|
117
|
+
blockers: Schema.optionalKey(Schema.Array(WorkBlocker)
|
|
118
|
+
.check(Schema.isMaxLength(32))
|
|
119
|
+
.check(Schema.makeFilter((blockers) => new Set(blockers.map(({ since, summary }) => `${since}\u0000${summary}`)).size === blockers.length, { expected: "unique blocker records" }))),
|
|
120
|
+
requests: Schema.optionalKey(Schema.Array(WorkRequest)
|
|
121
|
+
.check(Schema.isMaxLength(32))
|
|
122
|
+
.check(Schema.makeFilter((requests) => new Set(requests.map(({ id }) => id)).size === requests.length, { expected: "unique request ids" }))),
|
|
123
|
+
review: Schema.optionalKey(Schema.NullOr(WorkReview)),
|
|
124
|
+
approvalTarget: Schema.optionalKey(Schema.NullOr(WorkApprovalTarget)),
|
|
36
125
|
createdAt: Timestamp,
|
|
37
126
|
updatedAt: Timestamp
|
|
38
|
-
}).check(Schema.makeFilter((goal) =>
|
|
127
|
+
}).check(Schema.makeFilter((goal) => {
|
|
128
|
+
const hasBlocker = goal.blocker !== null ||
|
|
129
|
+
(goal.blockers !== undefined && goal.blockers.length > 0);
|
|
130
|
+
const agent = goal.agentHierarchy?.agent;
|
|
131
|
+
const family = goal.goalFamily;
|
|
132
|
+
const isDetailTimestamp = (timestamp) => timestamp >= goal.createdAt && timestamp <= goal.updatedAt;
|
|
133
|
+
return goal.updatedAt >= goal.createdAt &&
|
|
134
|
+
((goal.state === "blocked") === hasBlocker) &&
|
|
135
|
+
(goal.blockers === undefined || goal.blocker === null) &&
|
|
136
|
+
(goal.blocker === null || isDetailTimestamp(goal.blocker.since)) &&
|
|
137
|
+
(goal.blockers === undefined || goal.blockers.every(({ since }) => isDetailTimestamp(since))) &&
|
|
138
|
+
(goal.activity === undefined || goal.activity.every(({ occurredAt }) => isDetailTimestamp(occurredAt))) &&
|
|
139
|
+
(goal.requests === undefined || goal.requests.every(({ requestedAt }) => isDetailTimestamp(requestedAt))) &&
|
|
140
|
+
(goal.review === undefined || goal.review === null || isDetailTimestamp(goal.review.updatedAt)) &&
|
|
141
|
+
(family === undefined || ((family.role === "canonical") === (family.canonicalGoalId === goal.id))) &&
|
|
142
|
+
(agent === undefined || agent === null || ((agent.relationship === undefined || agent.relationship.parentAgentId !== agent.agentId) &&
|
|
143
|
+
goal.connectTarget !== null &&
|
|
144
|
+
goal.connectTarget.agentId === agent.agentId &&
|
|
145
|
+
goal.connectTarget.host.toLowerCase() === agent.host.toLowerCase()));
|
|
146
|
+
}, { expected: "ordered goal timestamps, blocker state, and non-cyclic authoritative agent target" }));
|
|
39
147
|
export const WorkGoalCheckpoint = Schema.Struct({
|
|
40
148
|
version: Schema.Literal("herdr.work.event.v1"),
|
|
41
149
|
eventId: Identifier,
|
package/dist/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,QAA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C,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;CAC9E,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,SAAS;IACrB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,YAAY;CACpB,CAAC,CAAA"}
|
package/dist/projection.d.ts
CHANGED
|
@@ -35,6 +35,54 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
|
|
|
35
35
|
readonly agentId: string;
|
|
36
36
|
readonly url: string;
|
|
37
37
|
} | null;
|
|
38
|
+
readonly goalFamily?: {
|
|
39
|
+
readonly canonicalGoalId: string;
|
|
40
|
+
readonly role: "canonical" | "superseded";
|
|
41
|
+
};
|
|
42
|
+
readonly agentHierarchy?: {
|
|
43
|
+
readonly agent: {
|
|
44
|
+
readonly host: string;
|
|
45
|
+
readonly agentId: string;
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly paneId: string;
|
|
48
|
+
readonly relationship?: {
|
|
49
|
+
readonly parentAgentId: string;
|
|
50
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
} | null;
|
|
54
|
+
readonly activity?: readonly {
|
|
55
|
+
readonly id: string;
|
|
56
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
57
|
+
readonly summary: string;
|
|
58
|
+
readonly occurredAt: number;
|
|
59
|
+
}[];
|
|
60
|
+
readonly blockers?: readonly {
|
|
61
|
+
readonly summary: string;
|
|
62
|
+
readonly since: number;
|
|
63
|
+
}[];
|
|
64
|
+
readonly requests?: readonly {
|
|
65
|
+
readonly id: string;
|
|
66
|
+
readonly summary: string;
|
|
67
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
68
|
+
readonly requestedAt: number;
|
|
69
|
+
readonly approvalTarget: {
|
|
70
|
+
readonly host: string;
|
|
71
|
+
readonly jobId: string;
|
|
72
|
+
readonly url: string;
|
|
73
|
+
} | null;
|
|
74
|
+
}[];
|
|
75
|
+
readonly review?: {
|
|
76
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
77
|
+
readonly summary: string | null;
|
|
78
|
+
readonly updatedAt: number;
|
|
79
|
+
readonly url: string | null;
|
|
80
|
+
} | null;
|
|
81
|
+
readonly approvalTarget?: {
|
|
82
|
+
readonly host: string;
|
|
83
|
+
readonly jobId: string;
|
|
84
|
+
readonly url: string;
|
|
85
|
+
} | null;
|
|
38
86
|
readonly createdAt: number;
|
|
39
87
|
readonly updatedAt: number;
|
|
40
88
|
}[];
|
|
@@ -71,6 +119,54 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
|
|
|
71
119
|
readonly agentId: string;
|
|
72
120
|
readonly url: string;
|
|
73
121
|
} | null;
|
|
122
|
+
readonly goalFamily?: {
|
|
123
|
+
readonly canonicalGoalId: string;
|
|
124
|
+
readonly role: "canonical" | "superseded";
|
|
125
|
+
};
|
|
126
|
+
readonly agentHierarchy?: {
|
|
127
|
+
readonly agent: {
|
|
128
|
+
readonly host: string;
|
|
129
|
+
readonly agentId: string;
|
|
130
|
+
readonly name: string;
|
|
131
|
+
readonly paneId: string;
|
|
132
|
+
readonly relationship?: {
|
|
133
|
+
readonly parentAgentId: string;
|
|
134
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
} | null;
|
|
138
|
+
readonly activity?: readonly {
|
|
139
|
+
readonly id: string;
|
|
140
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
141
|
+
readonly summary: string;
|
|
142
|
+
readonly occurredAt: number;
|
|
143
|
+
}[];
|
|
144
|
+
readonly blockers?: readonly {
|
|
145
|
+
readonly summary: string;
|
|
146
|
+
readonly since: number;
|
|
147
|
+
}[];
|
|
148
|
+
readonly requests?: readonly {
|
|
149
|
+
readonly id: string;
|
|
150
|
+
readonly summary: string;
|
|
151
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
152
|
+
readonly requestedAt: number;
|
|
153
|
+
readonly approvalTarget: {
|
|
154
|
+
readonly host: string;
|
|
155
|
+
readonly jobId: string;
|
|
156
|
+
readonly url: string;
|
|
157
|
+
} | null;
|
|
158
|
+
}[];
|
|
159
|
+
readonly review?: {
|
|
160
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
161
|
+
readonly summary: string | null;
|
|
162
|
+
readonly updatedAt: number;
|
|
163
|
+
readonly url: string | null;
|
|
164
|
+
} | null;
|
|
165
|
+
readonly approvalTarget?: {
|
|
166
|
+
readonly host: string;
|
|
167
|
+
readonly jobId: string;
|
|
168
|
+
readonly url: string;
|
|
169
|
+
} | null;
|
|
74
170
|
readonly createdAt: number;
|
|
75
171
|
readonly updatedAt: number;
|
|
76
172
|
}[];
|
|
@@ -107,6 +203,54 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
|
|
|
107
203
|
readonly agentId: string;
|
|
108
204
|
readonly url: string;
|
|
109
205
|
} | null;
|
|
206
|
+
readonly goalFamily?: {
|
|
207
|
+
readonly canonicalGoalId: string;
|
|
208
|
+
readonly role: "canonical" | "superseded";
|
|
209
|
+
};
|
|
210
|
+
readonly agentHierarchy?: {
|
|
211
|
+
readonly agent: {
|
|
212
|
+
readonly host: string;
|
|
213
|
+
readonly agentId: string;
|
|
214
|
+
readonly name: string;
|
|
215
|
+
readonly paneId: string;
|
|
216
|
+
readonly relationship?: {
|
|
217
|
+
readonly parentAgentId: string;
|
|
218
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
} | null;
|
|
222
|
+
readonly activity?: readonly {
|
|
223
|
+
readonly id: string;
|
|
224
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
225
|
+
readonly summary: string;
|
|
226
|
+
readonly occurredAt: number;
|
|
227
|
+
}[];
|
|
228
|
+
readonly blockers?: readonly {
|
|
229
|
+
readonly summary: string;
|
|
230
|
+
readonly since: number;
|
|
231
|
+
}[];
|
|
232
|
+
readonly requests?: readonly {
|
|
233
|
+
readonly id: string;
|
|
234
|
+
readonly summary: string;
|
|
235
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
236
|
+
readonly requestedAt: number;
|
|
237
|
+
readonly approvalTarget: {
|
|
238
|
+
readonly host: string;
|
|
239
|
+
readonly jobId: string;
|
|
240
|
+
readonly url: string;
|
|
241
|
+
} | null;
|
|
242
|
+
}[];
|
|
243
|
+
readonly review?: {
|
|
244
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
245
|
+
readonly summary: string | null;
|
|
246
|
+
readonly updatedAt: number;
|
|
247
|
+
readonly url: string | null;
|
|
248
|
+
} | null;
|
|
249
|
+
readonly approvalTarget?: {
|
|
250
|
+
readonly host: string;
|
|
251
|
+
readonly jobId: string;
|
|
252
|
+
readonly url: string;
|
|
253
|
+
} | null;
|
|
110
254
|
readonly createdAt: number;
|
|
111
255
|
readonly updatedAt: number;
|
|
112
256
|
}[];
|
|
@@ -143,6 +287,54 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
|
|
|
143
287
|
readonly agentId: string;
|
|
144
288
|
readonly url: string;
|
|
145
289
|
} | null;
|
|
290
|
+
readonly goalFamily?: {
|
|
291
|
+
readonly canonicalGoalId: string;
|
|
292
|
+
readonly role: "canonical" | "superseded";
|
|
293
|
+
};
|
|
294
|
+
readonly agentHierarchy?: {
|
|
295
|
+
readonly agent: {
|
|
296
|
+
readonly host: string;
|
|
297
|
+
readonly agentId: string;
|
|
298
|
+
readonly name: string;
|
|
299
|
+
readonly paneId: string;
|
|
300
|
+
readonly relationship?: {
|
|
301
|
+
readonly parentAgentId: string;
|
|
302
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
} | null;
|
|
306
|
+
readonly activity?: readonly {
|
|
307
|
+
readonly id: string;
|
|
308
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
309
|
+
readonly summary: string;
|
|
310
|
+
readonly occurredAt: number;
|
|
311
|
+
}[];
|
|
312
|
+
readonly blockers?: readonly {
|
|
313
|
+
readonly summary: string;
|
|
314
|
+
readonly since: number;
|
|
315
|
+
}[];
|
|
316
|
+
readonly requests?: readonly {
|
|
317
|
+
readonly id: string;
|
|
318
|
+
readonly summary: string;
|
|
319
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
320
|
+
readonly requestedAt: number;
|
|
321
|
+
readonly approvalTarget: {
|
|
322
|
+
readonly host: string;
|
|
323
|
+
readonly jobId: string;
|
|
324
|
+
readonly url: string;
|
|
325
|
+
} | null;
|
|
326
|
+
}[];
|
|
327
|
+
readonly review?: {
|
|
328
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
329
|
+
readonly summary: string | null;
|
|
330
|
+
readonly updatedAt: number;
|
|
331
|
+
readonly url: string | null;
|
|
332
|
+
} | null;
|
|
333
|
+
readonly approvalTarget?: {
|
|
334
|
+
readonly host: string;
|
|
335
|
+
readonly jobId: string;
|
|
336
|
+
readonly url: string;
|
|
337
|
+
} | null;
|
|
146
338
|
readonly createdAt: number;
|
|
147
339
|
readonly updatedAt: number;
|
|
148
340
|
}[];
|
package/dist/projection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAEL,kBAAkB,EAKnB,MAAM,YAAY,CAAA;AAqFnB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAiB/B,CAAA"}
|
package/dist/projection.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { WorkProjectionError } from "./errors.js";
|
|
3
|
+
import { validateGoalFamilyHistory } from "./goal-family.js";
|
|
3
4
|
import { WorkGoalCheckpoint, workHistoryMaxEvents, WorkSnapshots } from "./model.js";
|
|
4
5
|
const windowOffset = {
|
|
5
6
|
now: 0,
|
|
@@ -13,7 +14,8 @@ const validateHistory = Effect.fn("HerdrWork.validateHistory")(function* (input)
|
|
|
13
14
|
const eventIds = new Set();
|
|
14
15
|
const goalTimes = new Set();
|
|
15
16
|
const createdAt = new Map();
|
|
16
|
-
|
|
17
|
+
const ordered = events.toSorted((left, right) => left.occurredAt - right.occurredAt);
|
|
18
|
+
for (const event of ordered) {
|
|
17
19
|
if (eventIds.has(event.eventId)) {
|
|
18
20
|
return yield* projectionError("duplicate_event", `work event ${event.eventId} occurs more than once`, event);
|
|
19
21
|
}
|
|
@@ -34,6 +36,9 @@ const validateHistory = Effect.fn("HerdrWork.validateHistory")(function* (input)
|
|
|
34
36
|
return yield* projectionError("inconsistent_history", `goal ${goalId} has no checkpoint at its creation timestamp`, { goalId, timestamp });
|
|
35
37
|
}
|
|
36
38
|
}
|
|
39
|
+
const familyError = validateGoalFamilyHistory(events);
|
|
40
|
+
if (familyError !== undefined)
|
|
41
|
+
return yield* familyError;
|
|
37
42
|
return events;
|
|
38
43
|
});
|
|
39
44
|
const snapshotAt = (events, observedAt, window) => {
|
|
@@ -47,7 +52,7 @@ const snapshotAt = (events, observedAt, window) => {
|
|
|
47
52
|
window,
|
|
48
53
|
observedAt,
|
|
49
54
|
asOf,
|
|
50
|
-
goals: [...latest.values()].toSorted((left, right) => right.updatedAt - left.updatedAt || left.title.localeCompare(right.title))
|
|
55
|
+
goals: [...latest.values()].filter((goal) => goal.goalFamily?.role !== "superseded").toSorted((left, right) => right.updatedAt - left.updatedAt || left.title.localeCompare(right.title))
|
|
51
56
|
};
|
|
52
57
|
};
|
|
53
58
|
export const projectWorkSnapshots = Effect.fn("HerdrWork.projectSnapshots")(function* (input, observedAt) {
|
package/dist/projection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAEL,kBAAkB,EAClB,oBAAoB,EAEpB,aAAa,EAEd,MAAM,YAAY,CAAA;AAEnB,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK;IACzB,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK;IAC9B,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK;CACsB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EACnF,KAAwC,EACxC,UAAkB;IAElB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CACnG,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,WAAW,EAAE,yCAAyC,EAAE,KAAK,CAAC,CAAC,CAC3G,CAAA;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;IAC5C,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QACtD,UAAU,EAAE,SAAS;QACrB,GAAG,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;QACzC,GAAG,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;QACzC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC;QAC3C,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;KAC9C,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,WAAW,EAAE,qCAAqC,EAAE,KAAK,CAAC,CAAC,CACvG,CAAA;AACH,CAAC,CAAC,CAAA"}
|
package/dist/service.d.ts
CHANGED
|
@@ -42,6 +42,54 @@ export declare const makeWorkService: (store: WorkStoreService) => Effect.Effect
|
|
|
42
42
|
readonly agentId: string;
|
|
43
43
|
readonly url: string;
|
|
44
44
|
} | null;
|
|
45
|
+
readonly goalFamily?: {
|
|
46
|
+
readonly canonicalGoalId: string;
|
|
47
|
+
readonly role: "canonical" | "superseded";
|
|
48
|
+
};
|
|
49
|
+
readonly agentHierarchy?: {
|
|
50
|
+
readonly agent: {
|
|
51
|
+
readonly host: string;
|
|
52
|
+
readonly agentId: string;
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly paneId: string;
|
|
55
|
+
readonly relationship?: {
|
|
56
|
+
readonly parentAgentId: string;
|
|
57
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
} | null;
|
|
61
|
+
readonly activity?: readonly {
|
|
62
|
+
readonly id: string;
|
|
63
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
64
|
+
readonly summary: string;
|
|
65
|
+
readonly occurredAt: number;
|
|
66
|
+
}[];
|
|
67
|
+
readonly blockers?: readonly {
|
|
68
|
+
readonly summary: string;
|
|
69
|
+
readonly since: number;
|
|
70
|
+
}[];
|
|
71
|
+
readonly requests?: readonly {
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly summary: string;
|
|
74
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
75
|
+
readonly requestedAt: number;
|
|
76
|
+
readonly approvalTarget: {
|
|
77
|
+
readonly host: string;
|
|
78
|
+
readonly jobId: string;
|
|
79
|
+
readonly url: string;
|
|
80
|
+
} | null;
|
|
81
|
+
}[];
|
|
82
|
+
readonly review?: {
|
|
83
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
84
|
+
readonly summary: string | null;
|
|
85
|
+
readonly updatedAt: number;
|
|
86
|
+
readonly url: string | null;
|
|
87
|
+
} | null;
|
|
88
|
+
readonly approvalTarget?: {
|
|
89
|
+
readonly host: string;
|
|
90
|
+
readonly jobId: string;
|
|
91
|
+
readonly url: string;
|
|
92
|
+
} | null;
|
|
45
93
|
readonly createdAt: number;
|
|
46
94
|
readonly updatedAt: number;
|
|
47
95
|
}[];
|
|
@@ -78,6 +126,54 @@ export declare const makeWorkService: (store: WorkStoreService) => Effect.Effect
|
|
|
78
126
|
readonly agentId: string;
|
|
79
127
|
readonly url: string;
|
|
80
128
|
} | null;
|
|
129
|
+
readonly goalFamily?: {
|
|
130
|
+
readonly canonicalGoalId: string;
|
|
131
|
+
readonly role: "canonical" | "superseded";
|
|
132
|
+
};
|
|
133
|
+
readonly agentHierarchy?: {
|
|
134
|
+
readonly agent: {
|
|
135
|
+
readonly host: string;
|
|
136
|
+
readonly agentId: string;
|
|
137
|
+
readonly name: string;
|
|
138
|
+
readonly paneId: string;
|
|
139
|
+
readonly relationship?: {
|
|
140
|
+
readonly parentAgentId: string;
|
|
141
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
} | null;
|
|
145
|
+
readonly activity?: readonly {
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
148
|
+
readonly summary: string;
|
|
149
|
+
readonly occurredAt: number;
|
|
150
|
+
}[];
|
|
151
|
+
readonly blockers?: readonly {
|
|
152
|
+
readonly summary: string;
|
|
153
|
+
readonly since: number;
|
|
154
|
+
}[];
|
|
155
|
+
readonly requests?: readonly {
|
|
156
|
+
readonly id: string;
|
|
157
|
+
readonly summary: string;
|
|
158
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
159
|
+
readonly requestedAt: number;
|
|
160
|
+
readonly approvalTarget: {
|
|
161
|
+
readonly host: string;
|
|
162
|
+
readonly jobId: string;
|
|
163
|
+
readonly url: string;
|
|
164
|
+
} | null;
|
|
165
|
+
}[];
|
|
166
|
+
readonly review?: {
|
|
167
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
168
|
+
readonly summary: string | null;
|
|
169
|
+
readonly updatedAt: number;
|
|
170
|
+
readonly url: string | null;
|
|
171
|
+
} | null;
|
|
172
|
+
readonly approvalTarget?: {
|
|
173
|
+
readonly host: string;
|
|
174
|
+
readonly jobId: string;
|
|
175
|
+
readonly url: string;
|
|
176
|
+
} | null;
|
|
81
177
|
readonly createdAt: number;
|
|
82
178
|
readonly updatedAt: number;
|
|
83
179
|
}[];
|
|
@@ -114,6 +210,54 @@ export declare const makeWorkService: (store: WorkStoreService) => Effect.Effect
|
|
|
114
210
|
readonly agentId: string;
|
|
115
211
|
readonly url: string;
|
|
116
212
|
} | null;
|
|
213
|
+
readonly goalFamily?: {
|
|
214
|
+
readonly canonicalGoalId: string;
|
|
215
|
+
readonly role: "canonical" | "superseded";
|
|
216
|
+
};
|
|
217
|
+
readonly agentHierarchy?: {
|
|
218
|
+
readonly agent: {
|
|
219
|
+
readonly host: string;
|
|
220
|
+
readonly agentId: string;
|
|
221
|
+
readonly name: string;
|
|
222
|
+
readonly paneId: string;
|
|
223
|
+
readonly relationship?: {
|
|
224
|
+
readonly parentAgentId: string;
|
|
225
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
} | null;
|
|
229
|
+
readonly activity?: readonly {
|
|
230
|
+
readonly id: string;
|
|
231
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
232
|
+
readonly summary: string;
|
|
233
|
+
readonly occurredAt: number;
|
|
234
|
+
}[];
|
|
235
|
+
readonly blockers?: readonly {
|
|
236
|
+
readonly summary: string;
|
|
237
|
+
readonly since: number;
|
|
238
|
+
}[];
|
|
239
|
+
readonly requests?: readonly {
|
|
240
|
+
readonly id: string;
|
|
241
|
+
readonly summary: string;
|
|
242
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
243
|
+
readonly requestedAt: number;
|
|
244
|
+
readonly approvalTarget: {
|
|
245
|
+
readonly host: string;
|
|
246
|
+
readonly jobId: string;
|
|
247
|
+
readonly url: string;
|
|
248
|
+
} | null;
|
|
249
|
+
}[];
|
|
250
|
+
readonly review?: {
|
|
251
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
252
|
+
readonly summary: string | null;
|
|
253
|
+
readonly updatedAt: number;
|
|
254
|
+
readonly url: string | null;
|
|
255
|
+
} | null;
|
|
256
|
+
readonly approvalTarget?: {
|
|
257
|
+
readonly host: string;
|
|
258
|
+
readonly jobId: string;
|
|
259
|
+
readonly url: string;
|
|
260
|
+
} | null;
|
|
117
261
|
readonly createdAt: number;
|
|
118
262
|
readonly updatedAt: number;
|
|
119
263
|
}[];
|
|
@@ -150,6 +294,54 @@ export declare const makeWorkService: (store: WorkStoreService) => Effect.Effect
|
|
|
150
294
|
readonly agentId: string;
|
|
151
295
|
readonly url: string;
|
|
152
296
|
} | null;
|
|
297
|
+
readonly goalFamily?: {
|
|
298
|
+
readonly canonicalGoalId: string;
|
|
299
|
+
readonly role: "canonical" | "superseded";
|
|
300
|
+
};
|
|
301
|
+
readonly agentHierarchy?: {
|
|
302
|
+
readonly agent: {
|
|
303
|
+
readonly host: string;
|
|
304
|
+
readonly agentId: string;
|
|
305
|
+
readonly name: string;
|
|
306
|
+
readonly paneId: string;
|
|
307
|
+
readonly relationship?: {
|
|
308
|
+
readonly parentAgentId: string;
|
|
309
|
+
readonly relation: "delegated" | "pair" | "review";
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
} | null;
|
|
313
|
+
readonly activity?: readonly {
|
|
314
|
+
readonly id: string;
|
|
315
|
+
readonly kind: "blocker" | "note" | "request" | "review" | "shipment" | "status";
|
|
316
|
+
readonly summary: string;
|
|
317
|
+
readonly occurredAt: number;
|
|
318
|
+
}[];
|
|
319
|
+
readonly blockers?: readonly {
|
|
320
|
+
readonly summary: string;
|
|
321
|
+
readonly since: number;
|
|
322
|
+
}[];
|
|
323
|
+
readonly requests?: readonly {
|
|
324
|
+
readonly id: string;
|
|
325
|
+
readonly summary: string;
|
|
326
|
+
readonly state: "approved" | "fulfilled" | "open" | "rejected";
|
|
327
|
+
readonly requestedAt: number;
|
|
328
|
+
readonly approvalTarget: {
|
|
329
|
+
readonly host: string;
|
|
330
|
+
readonly jobId: string;
|
|
331
|
+
readonly url: string;
|
|
332
|
+
} | null;
|
|
333
|
+
}[];
|
|
334
|
+
readonly review?: {
|
|
335
|
+
readonly state: "approved" | "changes_requested" | "not_requested" | "requested";
|
|
336
|
+
readonly summary: string | null;
|
|
337
|
+
readonly updatedAt: number;
|
|
338
|
+
readonly url: string | null;
|
|
339
|
+
} | null;
|
|
340
|
+
readonly approvalTarget?: {
|
|
341
|
+
readonly host: string;
|
|
342
|
+
readonly jobId: string;
|
|
343
|
+
readonly url: string;
|
|
344
|
+
} | null;
|
|
153
345
|
readonly createdAt: number;
|
|
154
346
|
readonly updatedAt: number;
|
|
155
347
|
}[];
|