@nestos/kanban 0.0.0-stage → 0.5.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.
- package/LICENSE +674 -0
- package/README.md +165 -2
- package/dist/activity-BbC4sgKL.d.cts +258 -0
- package/dist/activity-Czlan5xW.d.ts +258 -0
- package/dist/activity-module-DaO1Rry0.d.cts +22 -0
- package/dist/activity-module-T22wliZu.d.ts +22 -0
- package/dist/activity-ports-Dqxa86zT.d.cts +12 -0
- package/dist/activity-ports-cxfrelaL.d.ts +12 -0
- package/dist/activity.cjs +16 -0
- package/dist/activity.cjs.map +1 -0
- package/dist/activity.d.cts +12 -0
- package/dist/activity.d.ts +12 -0
- package/dist/activity.js +16 -0
- package/dist/activity.js.map +1 -0
- package/dist/chunk-3JYLJPE5.js +95 -0
- package/dist/chunk-3JYLJPE5.js.map +1 -0
- package/dist/chunk-3LEIHB7Y.js +221 -0
- package/dist/chunk-3LEIHB7Y.js.map +1 -0
- package/dist/chunk-4XF6LQSU.cjs +9 -0
- package/dist/chunk-4XF6LQSU.cjs.map +1 -0
- package/dist/chunk-5Q7WB63A.cjs +282 -0
- package/dist/chunk-5Q7WB63A.cjs.map +1 -0
- package/dist/chunk-7KDOTBRX.cjs +58 -0
- package/dist/chunk-7KDOTBRX.cjs.map +1 -0
- package/dist/chunk-AHHEGTUA.js +148 -0
- package/dist/chunk-AHHEGTUA.js.map +1 -0
- package/dist/chunk-AOHQCX7K.cjs +95 -0
- package/dist/chunk-AOHQCX7K.cjs.map +1 -0
- package/dist/chunk-DINLR6E6.cjs +443 -0
- package/dist/chunk-DINLR6E6.cjs.map +1 -0
- package/dist/chunk-EYTVC2H5.cjs +1612 -0
- package/dist/chunk-EYTVC2H5.cjs.map +1 -0
- package/dist/chunk-FEE2YBZ7.js +1972 -0
- package/dist/chunk-FEE2YBZ7.js.map +1 -0
- package/dist/chunk-FNO5K3A7.js +282 -0
- package/dist/chunk-FNO5K3A7.js.map +1 -0
- package/dist/chunk-IHHDXZPZ.js +382 -0
- package/dist/chunk-IHHDXZPZ.js.map +1 -0
- package/dist/chunk-J3EAIVA3.js +280 -0
- package/dist/chunk-J3EAIVA3.js.map +1 -0
- package/dist/chunk-KH3WF3K4.js +443 -0
- package/dist/chunk-KH3WF3K4.js.map +1 -0
- package/dist/chunk-M35X5PHO.js +196 -0
- package/dist/chunk-M35X5PHO.js.map +1 -0
- package/dist/chunk-QRGZD2JU.cjs +1972 -0
- package/dist/chunk-QRGZD2JU.cjs.map +1 -0
- package/dist/chunk-RBOER6EW.cjs +221 -0
- package/dist/chunk-RBOER6EW.cjs.map +1 -0
- package/dist/chunk-RQP77ZTY.js +9 -0
- package/dist/chunk-RQP77ZTY.js.map +1 -0
- package/dist/chunk-RSH6QSEC.cjs +196 -0
- package/dist/chunk-RSH6QSEC.cjs.map +1 -0
- package/dist/chunk-VMRDXOLX.cjs +148 -0
- package/dist/chunk-VMRDXOLX.cjs.map +1 -0
- package/dist/chunk-X4UHZX6F.js +58 -0
- package/dist/chunk-X4UHZX6F.js.map +1 -0
- package/dist/chunk-XBSGUVCY.cjs +382 -0
- package/dist/chunk-XBSGUVCY.cjs.map +1 -0
- package/dist/chunk-XKDZHAUE.js +1612 -0
- package/dist/chunk-XKDZHAUE.js.map +1 -0
- package/dist/chunk-ZUZGAO6G.cjs +280 -0
- package/dist/chunk-ZUZGAO6G.cjs.map +1 -0
- package/dist/content-C5aJZFlw.d.cts +35 -0
- package/dist/content-hLH5BNud.d.ts +35 -0
- package/dist/contracts/index.cjs +31 -0
- package/dist/contracts/index.cjs.map +1 -0
- package/dist/contracts/index.d.cts +5 -0
- package/dist/contracts/index.d.ts +5 -0
- package/dist/contracts/index.js +31 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/discovery-9E-LfwIw.d.cts +61 -0
- package/dist/discovery-D60yrjej.d.ts +61 -0
- package/dist/discovery.cjs +377 -0
- package/dist/discovery.cjs.map +1 -0
- package/dist/discovery.d.cts +22 -0
- package/dist/discovery.d.ts +22 -0
- package/dist/discovery.js +377 -0
- package/dist/discovery.js.map +1 -0
- package/dist/execution-bridge-fpCnH6z5.d.cts +52 -0
- package/dist/execution-bridge-rk0uVy_n.d.ts +52 -0
- package/dist/execution.cjs +18 -0
- package/dist/execution.cjs.map +1 -0
- package/dist/execution.d.cts +42 -0
- package/dist/execution.d.ts +42 -0
- package/dist/execution.js +18 -0
- package/dist/execution.js.map +1 -0
- package/dist/index.cjs +74 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/module-CYfE7YhM.d.ts +11 -0
- package/dist/module-Ca9L3qCn.d.cts +11 -0
- package/dist/planning-CHrOqQ6b.d.cts +879 -0
- package/dist/planning-CHrOqQ6b.d.ts +879 -0
- package/dist/ports-B0McVg7B.d.ts +143 -0
- package/dist/ports-BeGO1VRI.d.cts +49 -0
- package/dist/ports-GQy0x-RI.d.cts +143 -0
- package/dist/ports-ykGiNUSx.d.ts +49 -0
- package/dist/runtime/index.cjs +205 -0
- package/dist/runtime/index.cjs.map +1 -0
- package/dist/runtime/index.d.cts +75 -0
- package/dist/runtime/index.d.ts +75 -0
- package/dist/runtime/index.js +205 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/integration.cjs +423 -0
- package/dist/runtime/integration.cjs.map +1 -0
- package/dist/runtime/integration.d.cts +658 -0
- package/dist/runtime/integration.d.ts +658 -0
- package/dist/runtime/integration.js +423 -0
- package/dist/runtime/integration.js.map +1 -0
- package/dist/storage.cjs +21 -0
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.d.cts +71 -0
- package/dist/storage.d.ts +71 -0
- package/dist/storage.js +21 -0
- package/dist/storage.js.map +1 -0
- package/dist/store-DPwHzGiz.d.cts +28 -0
- package/dist/store-DgdrPCV9.d.ts +28 -0
- package/dist/task-projection-CSorlMws.d.ts +11 -0
- package/dist/task-projection-DKKB_ueb.d.cts +11 -0
- package/examples/standalone.ts +22 -0
- package/package.json +143 -4
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { u as KanbanExternalReference, y as KanbanItemQuery, x as KanbanItemPage, z as KanbanItemSummary, r as KanbanDispatch, T as KanbanService, v as KanbanFixSession, f as KanbanAutomationCatalog, b as KanbanAnalysisStatus } from './planning-CHrOqQ6b.js';
|
|
2
|
+
|
|
3
|
+
/** Hosts resolve opaque resources and execute records; the library owns no project policy. */
|
|
4
|
+
interface KanbanRecordResource {
|
|
5
|
+
reference: KanbanExternalReference;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
interface KanbanItemResourceCatalog {
|
|
9
|
+
resources: KanbanRecordResource[];
|
|
10
|
+
selected?: KanbanExternalReference;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface KanbanRecordExecution {
|
|
15
|
+
id: string;
|
|
16
|
+
recordId: string;
|
|
17
|
+
recordRevision: number;
|
|
18
|
+
boardId: string;
|
|
19
|
+
rootItemId?: string;
|
|
20
|
+
itemIds?: string[];
|
|
21
|
+
state: 'preparing' | 'running' | 'blocked' | 'review' | 'completed' | 'failed' | 'cancelling' | 'cancelled' | 'pausing' | 'paused' | 'resuming' | 'unknown';
|
|
22
|
+
createdAt: number;
|
|
23
|
+
updatedAt: number;
|
|
24
|
+
code?: string;
|
|
25
|
+
}
|
|
26
|
+
interface KanbanRecordRunRequest {
|
|
27
|
+
operationId: string;
|
|
28
|
+
recordId: string;
|
|
29
|
+
expectedRevision: number;
|
|
30
|
+
placement?: 'current-board' | 'new-board';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Host-owned execution resources; the coordination library does not interpret their backend. */
|
|
34
|
+
interface KanbanWorkResource {
|
|
35
|
+
id: string;
|
|
36
|
+
kind: string;
|
|
37
|
+
title: string;
|
|
38
|
+
location: string;
|
|
39
|
+
version: string;
|
|
40
|
+
ownership?: 'current' | 'other' | 'unknown';
|
|
41
|
+
state: 'associated' | 'in-use' | 'retained' | 'cleanup-ready' | 'cleaned' | 'unknown';
|
|
42
|
+
reasons: string[];
|
|
43
|
+
properties: Array<{
|
|
44
|
+
label: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}>;
|
|
47
|
+
canCleanup: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface KanbanWorkResourceQuery {
|
|
50
|
+
inspect?: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface KanbanWorkResourceCleanup {
|
|
53
|
+
operationId: string;
|
|
54
|
+
itemId: string;
|
|
55
|
+
resourceId: string;
|
|
56
|
+
version: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface KanbanOperationChoice {
|
|
60
|
+
id: string;
|
|
61
|
+
label: string;
|
|
62
|
+
detail?: string;
|
|
63
|
+
}
|
|
64
|
+
interface KanbanOperationField {
|
|
65
|
+
id: string;
|
|
66
|
+
label: string;
|
|
67
|
+
choices: KanbanOperationChoice[];
|
|
68
|
+
selected?: string;
|
|
69
|
+
}
|
|
70
|
+
/** Host-owned operations; the portable view does not interpret deployment or Git policy. */
|
|
71
|
+
interface KanbanItemOperation {
|
|
72
|
+
id: string;
|
|
73
|
+
label: string;
|
|
74
|
+
state: 'unavailable' | 'ready' | 'running' | 'unknown' | 'succeeded' | 'failed' | 'waiting-confirmation';
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
code?: string;
|
|
77
|
+
reason?: string;
|
|
78
|
+
runId?: string;
|
|
79
|
+
sessionId?: string;
|
|
80
|
+
summary?: string;
|
|
81
|
+
fields?: KanbanOperationField[];
|
|
82
|
+
confirmation?: string;
|
|
83
|
+
configurable?: boolean;
|
|
84
|
+
binding?: KanbanExternalReference;
|
|
85
|
+
openSessionOnRun?: boolean;
|
|
86
|
+
}
|
|
87
|
+
interface KanbanItemOperations {
|
|
88
|
+
revision: string;
|
|
89
|
+
operations: KanbanItemOperation[];
|
|
90
|
+
targets?: Array<{
|
|
91
|
+
label: string;
|
|
92
|
+
reference: KanbanExternalReference;
|
|
93
|
+
}>;
|
|
94
|
+
}
|
|
95
|
+
interface KanbanItemOperationRequest {
|
|
96
|
+
operationId: string;
|
|
97
|
+
itemId: string;
|
|
98
|
+
action: string;
|
|
99
|
+
expectedRevision: string;
|
|
100
|
+
selections?: Record<string, string>;
|
|
101
|
+
confirmed?: boolean;
|
|
102
|
+
}
|
|
103
|
+
interface KanbanItemOperationBinding {
|
|
104
|
+
operationId: string;
|
|
105
|
+
itemId: string;
|
|
106
|
+
action: string;
|
|
107
|
+
expectedRevision: string;
|
|
108
|
+
target: KanbanExternalReference;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface KanbanDeletionPreview {
|
|
112
|
+
boardId: string;
|
|
113
|
+
title: string;
|
|
114
|
+
revision: number;
|
|
115
|
+
version: string;
|
|
116
|
+
blockers: Array<{
|
|
117
|
+
code: string;
|
|
118
|
+
itemId?: string;
|
|
119
|
+
sessionId?: string;
|
|
120
|
+
}>;
|
|
121
|
+
pendingItems: number;
|
|
122
|
+
pendingDeletion?: {
|
|
123
|
+
operationId: string;
|
|
124
|
+
mode: 'drain' | 'cancel';
|
|
125
|
+
phase: 'waiting' | 'ready' | 'blocked';
|
|
126
|
+
code?: string;
|
|
127
|
+
};
|
|
128
|
+
/** Display labels for items referenced by blockers and resources. */
|
|
129
|
+
itemTitles?: Record<string, string>;
|
|
130
|
+
resources: Array<{
|
|
131
|
+
itemId: string;
|
|
132
|
+
resource: KanbanWorkResource;
|
|
133
|
+
}>;
|
|
134
|
+
}
|
|
135
|
+
interface KanbanDeletionRequest {
|
|
136
|
+
operationId: string;
|
|
137
|
+
version: string;
|
|
138
|
+
expectedRevision: number;
|
|
139
|
+
cleanup: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
type KanbanSessionPhase = 'running' | 'queued' | 'waiting' | 'waiting-input' | 'waiting-approval' | 'paused' | 'idle' | 'completed' | 'failed' | 'cancelled' | 'unknown';
|
|
143
|
+
interface KanbanExecutionSession {
|
|
144
|
+
sessionId: string;
|
|
145
|
+
resourceId?: string;
|
|
146
|
+
title?: string;
|
|
147
|
+
state: KanbanSessionPhase;
|
|
148
|
+
createdAt?: number;
|
|
149
|
+
lastActivityAt?: number;
|
|
150
|
+
observedAt?: number;
|
|
151
|
+
stale: boolean;
|
|
152
|
+
recent: boolean;
|
|
153
|
+
code?: string;
|
|
154
|
+
}
|
|
155
|
+
interface KanbanSessionActivityQuery extends KanbanItemQuery {
|
|
156
|
+
execution?: 'all' | 'running' | 'recent' | 'active';
|
|
157
|
+
}
|
|
158
|
+
interface KanbanSessionItemSummary extends KanbanItemSummary {
|
|
159
|
+
execution?: KanbanExecutionSession;
|
|
160
|
+
}
|
|
161
|
+
interface KanbanSessionItemPage extends Omit<KanbanItemPage, 'items'> {
|
|
162
|
+
items: KanbanSessionItemSummary[];
|
|
163
|
+
}
|
|
164
|
+
type KanbanSessionPurpose = 'execution' | 'planning' | 'fix' | 'finalization' | 'discussion';
|
|
165
|
+
/** A run belongs to a Session; continuing it does not create another Session. */
|
|
166
|
+
interface KanbanSessionExecution {
|
|
167
|
+
id: string;
|
|
168
|
+
purpose: KanbanSessionPurpose;
|
|
169
|
+
dispatchId?: string;
|
|
170
|
+
attempt?: number;
|
|
171
|
+
previousDispatchId?: string;
|
|
172
|
+
roundId?: string;
|
|
173
|
+
turnId?: string;
|
|
174
|
+
state?: KanbanSessionPhase;
|
|
175
|
+
outcome?: KanbanDispatch['outcome'];
|
|
176
|
+
createdAt?: number;
|
|
177
|
+
completedAt?: number;
|
|
178
|
+
code?: string;
|
|
179
|
+
resources?: Array<{
|
|
180
|
+
label: string;
|
|
181
|
+
value: string;
|
|
182
|
+
}>;
|
|
183
|
+
}
|
|
184
|
+
interface KanbanSessionAssociation {
|
|
185
|
+
sessionId: string;
|
|
186
|
+
purpose: KanbanSessionPurpose;
|
|
187
|
+
execution?: KanbanSessionExecution;
|
|
188
|
+
}
|
|
189
|
+
interface KanbanRelatedSession extends KanbanExecutionSession {
|
|
190
|
+
current: boolean;
|
|
191
|
+
purposes: KanbanSessionPurpose[];
|
|
192
|
+
executions: KanbanSessionExecution[];
|
|
193
|
+
}
|
|
194
|
+
interface KanbanSessionDetailQuery {
|
|
195
|
+
includeRelated?: boolean;
|
|
196
|
+
}
|
|
197
|
+
interface KanbanExecutionSessionDetail {
|
|
198
|
+
continuation?: {
|
|
199
|
+
previousDispatchId: string;
|
|
200
|
+
};
|
|
201
|
+
current?: KanbanExecutionSession;
|
|
202
|
+
history: Array<{
|
|
203
|
+
sessionId: string;
|
|
204
|
+
bindingId?: string;
|
|
205
|
+
current: boolean;
|
|
206
|
+
}>;
|
|
207
|
+
/** Loaded explicitly so activity polling never enumerates historical Sessions. */
|
|
208
|
+
sessions?: KanbanRelatedSession[];
|
|
209
|
+
sessionsCode?: string;
|
|
210
|
+
}
|
|
211
|
+
/** Transport-facing service with optional authorized resource activity. */
|
|
212
|
+
interface KanbanClient extends KanbanService {
|
|
213
|
+
cancelBoard?(boardId: string, request: {
|
|
214
|
+
operationId: string;
|
|
215
|
+
expectedRevision: number;
|
|
216
|
+
}): Promise<void>;
|
|
217
|
+
requestBoardDeletion?(boardId: string, request: KanbanDeletionRequest & {
|
|
218
|
+
mode: 'drain' | 'cancel';
|
|
219
|
+
}): Promise<void>;
|
|
220
|
+
previewDeletion?(boardId: string): Promise<KanbanDeletionPreview>;
|
|
221
|
+
deleteBoard?(boardId: string, request: KanbanDeletionRequest): Promise<void>;
|
|
222
|
+
itemOperations?(boardId: string, itemId: string): Promise<KanbanItemOperations>;
|
|
223
|
+
runItemOperation?(boardId: string, request: KanbanItemOperationRequest): Promise<KanbanItemOperations>;
|
|
224
|
+
bindItemOperation?(boardId: string, request: KanbanItemOperationBinding): Promise<KanbanItemOperations>;
|
|
225
|
+
workResources?(boardId: string, itemId: string, query?: KanbanWorkResourceQuery): Promise<KanbanWorkResource[]>;
|
|
226
|
+
cleanupWorkResource?(boardId: string, request: KanbanWorkResourceCleanup): Promise<KanbanWorkResource>;
|
|
227
|
+
replyTask?(boardId: string, request: {
|
|
228
|
+
itemId: string;
|
|
229
|
+
attemptId: string;
|
|
230
|
+
replyTo: string;
|
|
231
|
+
operationId: string;
|
|
232
|
+
content: string;
|
|
233
|
+
}): Promise<void>;
|
|
234
|
+
taskFixes?(boardId: string, itemId: string): Promise<KanbanFixSession[]>;
|
|
235
|
+
cancelFix?(boardId: string, request: {
|
|
236
|
+
fixId: string;
|
|
237
|
+
operationId: string;
|
|
238
|
+
}): Promise<KanbanFixSession>;
|
|
239
|
+
controlRecord?(boardId: string, request: {
|
|
240
|
+
recordId: string;
|
|
241
|
+
operationId: string;
|
|
242
|
+
action: 'pause' | 'resume' | 'cancel';
|
|
243
|
+
}): Promise<void>;
|
|
244
|
+
fixTask?(boardId: string, request: {
|
|
245
|
+
itemId: string;
|
|
246
|
+
operationId: string;
|
|
247
|
+
}): Promise<KanbanFixSession>;
|
|
248
|
+
itemResources?(boardId: string, parentId?: string): Promise<KanbanItemResourceCatalog>;
|
|
249
|
+
recordResources?(): Promise<KanbanRecordResource[]>;
|
|
250
|
+
runRecord?(boardId: string, request: KanbanRecordRunRequest): Promise<KanbanRecordExecution>;
|
|
251
|
+
recordExecutions?(boardId: string, recordId: string): Promise<KanbanRecordExecution[]>;
|
|
252
|
+
automationCatalog?(): Promise<KanbanAutomationCatalog>;
|
|
253
|
+
analysisStatus?(boardId: string, itemId: string): Promise<KanbanAnalysisStatus | null>;
|
|
254
|
+
queryActivity?(boardId: string, query?: KanbanSessionActivityQuery): Promise<KanbanSessionItemPage>;
|
|
255
|
+
executionSession?(boardId: string, itemId: string, query?: KanbanSessionDetailQuery): Promise<KanbanExecutionSessionDetail>;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export type { KanbanClient as K, KanbanDeletionPreview as a, KanbanDeletionRequest as b, KanbanExecutionSession as c, KanbanExecutionSessionDetail as d, KanbanItemOperation as e, KanbanItemOperationBinding as f, KanbanItemOperationRequest as g, KanbanItemOperations as h, KanbanItemResourceCatalog as i, KanbanOperationChoice as j, KanbanOperationField as k, KanbanRecordExecution as l, KanbanRecordResource as m, KanbanRecordRunRequest as n, KanbanRelatedSession as o, KanbanSessionActivityQuery as p, KanbanSessionAssociation as q, KanbanSessionDetailQuery as r, KanbanSessionExecution as s, KanbanSessionItemPage as t, KanbanSessionItemSummary as u, KanbanSessionPhase as v, KanbanSessionPurpose as w, KanbanWorkResource as x, KanbanWorkResourceCleanup as y, KanbanWorkResourceQuery as z };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { p as KanbanSessionActivityQuery, t as KanbanSessionItemPage, r as KanbanSessionDetailQuery, d as KanbanExecutionSessionDetail } from './activity-BbC4sgKL.cjs';
|
|
2
|
+
import { K as KanbanModuleHandle } from './module-Ca9L3qCn.cjs';
|
|
3
|
+
import { K as KanbanModuleOptions } from './ports-GQy0x-RI.cjs';
|
|
4
|
+
import { K as KanbanSessionSource } from './activity-ports-Dqxa86zT.cjs';
|
|
5
|
+
|
|
6
|
+
interface KanbanSessionActivityOptions {
|
|
7
|
+
source: KanbanSessionSource;
|
|
8
|
+
now?: () => number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface KanbanActivityModuleOptions extends KanbanModuleOptions {
|
|
12
|
+
executionSessions?: KanbanSessionActivityOptions;
|
|
13
|
+
referenceSystem: string;
|
|
14
|
+
}
|
|
15
|
+
interface KanbanActivityHandle extends KanbanModuleHandle {
|
|
16
|
+
queryActivity: (boardId: string, query?: KanbanSessionActivityQuery) => Promise<KanbanSessionItemPage>;
|
|
17
|
+
executionSession: (boardId: string, itemId: string, query?: KanbanSessionDetailQuery) => Promise<KanbanExecutionSessionDetail>;
|
|
18
|
+
}
|
|
19
|
+
/** Application integrations stay outside the portable core. */
|
|
20
|
+
declare function createKanbanActivityModule(options: KanbanActivityModuleOptions): KanbanActivityHandle;
|
|
21
|
+
|
|
22
|
+
export { type KanbanActivityHandle as K, type KanbanActivityModuleOptions as a, type KanbanSessionActivityOptions as b, createKanbanActivityModule as c };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { p as KanbanSessionActivityQuery, t as KanbanSessionItemPage, r as KanbanSessionDetailQuery, d as KanbanExecutionSessionDetail } from './activity-Czlan5xW.js';
|
|
2
|
+
import { K as KanbanModuleHandle } from './module-CYfE7YhM.js';
|
|
3
|
+
import { K as KanbanModuleOptions } from './ports-B0McVg7B.js';
|
|
4
|
+
import { K as KanbanSessionSource } from './activity-ports-cxfrelaL.js';
|
|
5
|
+
|
|
6
|
+
interface KanbanSessionActivityOptions {
|
|
7
|
+
source: KanbanSessionSource;
|
|
8
|
+
now?: () => number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface KanbanActivityModuleOptions extends KanbanModuleOptions {
|
|
12
|
+
executionSessions?: KanbanSessionActivityOptions;
|
|
13
|
+
referenceSystem: string;
|
|
14
|
+
}
|
|
15
|
+
interface KanbanActivityHandle extends KanbanModuleHandle {
|
|
16
|
+
queryActivity: (boardId: string, query?: KanbanSessionActivityQuery) => Promise<KanbanSessionItemPage>;
|
|
17
|
+
executionSession: (boardId: string, itemId: string, query?: KanbanSessionDetailQuery) => Promise<KanbanExecutionSessionDetail>;
|
|
18
|
+
}
|
|
19
|
+
/** Application integrations stay outside the portable core. */
|
|
20
|
+
declare function createKanbanActivityModule(options: KanbanActivityModuleOptions): KanbanActivityHandle;
|
|
21
|
+
|
|
22
|
+
export { type KanbanActivityHandle as K, type KanbanActivityModuleOptions as a, type KanbanSessionActivityOptions as b, createKanbanActivityModule as c };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as KanbanBoard, w as KanbanItem, a7 as KanbanWorkflowState } from './planning-CHrOqQ6b.cjs';
|
|
2
|
+
import { q as KanbanSessionAssociation, c as KanbanExecutionSession } from './activity-BbC4sgKL.cjs';
|
|
3
|
+
|
|
4
|
+
interface KanbanSessionSource {
|
|
5
|
+
/** Cold, authorized relations only; never submit or restore execution while listing. */
|
|
6
|
+
related?(board: KanbanBoard, item: KanbanItem, workflow: KanbanWorkflowState): Promise<KanbanSessionAssociation[]>;
|
|
7
|
+
authorizeBinding?(board: KanbanBoard, sessionId: string): Promise<void>;
|
|
8
|
+
/** Must check access within the supplied board's user/project and authority. */
|
|
9
|
+
inspect(board: KanbanBoard, sessionId: string): Promise<Omit<KanbanExecutionSession, 'recent'>>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type { KanbanSessionSource as K };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as KanbanBoard, w as KanbanItem, a7 as KanbanWorkflowState } from './planning-CHrOqQ6b.js';
|
|
2
|
+
import { q as KanbanSessionAssociation, c as KanbanExecutionSession } from './activity-Czlan5xW.js';
|
|
3
|
+
|
|
4
|
+
interface KanbanSessionSource {
|
|
5
|
+
/** Cold, authorized relations only; never submit or restore execution while listing. */
|
|
6
|
+
related?(board: KanbanBoard, item: KanbanItem, workflow: KanbanWorkflowState): Promise<KanbanSessionAssociation[]>;
|
|
7
|
+
authorizeBinding?(board: KanbanBoard, sessionId: string): Promise<void>;
|
|
8
|
+
/** Must check access within the supplied board's user/project and authority. */
|
|
9
|
+
inspect(board: KanbanBoard, sessionId: string): Promise<Omit<KanbanExecutionSession, 'recent'>>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type { KanbanSessionSource as K };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk5Q7WB63Acjs = require('./chunk-5Q7WB63A.cjs');
|
|
5
|
+
require('./chunk-DINLR6E6.cjs');
|
|
6
|
+
require('./chunk-EYTVC2H5.cjs');
|
|
7
|
+
require('./chunk-4XF6LQSU.cjs');
|
|
8
|
+
require('./chunk-RBOER6EW.cjs');
|
|
9
|
+
require('./chunk-7KDOTBRX.cjs');
|
|
10
|
+
require('./chunk-RSH6QSEC.cjs');
|
|
11
|
+
require('./chunk-AOHQCX7K.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.createKanbanActivityModule = _chunk5Q7WB63Acjs.createKanbanActivityModule; exports.querySessionItems = _chunk5Q7WB63Acjs.querySessionItems;
|
|
16
|
+
//# sourceMappingURL=activity.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/li/share/prj/x1/libraries/kanban/dist/activity.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,mJAAC","file":"/home/li/share/prj/x1/libraries/kanban/dist/activity.cjs"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { K as KanbanActivityHandle, a as KanbanActivityModuleOptions, b as KanbanSessionActivityOptions, c as createKanbanActivityModule } from './activity-module-DaO1Rry0.cjs';
|
|
2
|
+
export { K as KanbanSessionSource } from './activity-ports-Dqxa86zT.cjs';
|
|
3
|
+
import { T as KanbanService } from './planning-CHrOqQ6b.cjs';
|
|
4
|
+
import { p as KanbanSessionActivityQuery, u as KanbanSessionItemSummary, t as KanbanSessionItemPage } from './activity-BbC4sgKL.cjs';
|
|
5
|
+
import './module-Ca9L3qCn.cjs';
|
|
6
|
+
import './ports-GQy0x-RI.cjs';
|
|
7
|
+
import './discovery-9E-LfwIw.cjs';
|
|
8
|
+
|
|
9
|
+
/** Filter before pagination; Session activity changes invalidate the filtered keyset. */
|
|
10
|
+
declare function querySessionItems(core: KanbanService, boardId: string, input: KanbanSessionActivityQuery, project: (rows: KanbanSessionItemSummary[]) => Promise<KanbanSessionItemSummary[]>): Promise<KanbanSessionItemPage>;
|
|
11
|
+
|
|
12
|
+
export { querySessionItems };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { K as KanbanActivityHandle, a as KanbanActivityModuleOptions, b as KanbanSessionActivityOptions, c as createKanbanActivityModule } from './activity-module-T22wliZu.js';
|
|
2
|
+
export { K as KanbanSessionSource } from './activity-ports-cxfrelaL.js';
|
|
3
|
+
import { T as KanbanService } from './planning-CHrOqQ6b.js';
|
|
4
|
+
import { p as KanbanSessionActivityQuery, u as KanbanSessionItemSummary, t as KanbanSessionItemPage } from './activity-Czlan5xW.js';
|
|
5
|
+
import './module-CYfE7YhM.js';
|
|
6
|
+
import './ports-B0McVg7B.js';
|
|
7
|
+
import './discovery-D60yrjej.js';
|
|
8
|
+
|
|
9
|
+
/** Filter before pagination; Session activity changes invalidate the filtered keyset. */
|
|
10
|
+
declare function querySessionItems(core: KanbanService, boardId: string, input: KanbanSessionActivityQuery, project: (rows: KanbanSessionItemSummary[]) => Promise<KanbanSessionItemSummary[]>): Promise<KanbanSessionItemPage>;
|
|
11
|
+
|
|
12
|
+
export { querySessionItems };
|
package/dist/activity.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createKanbanActivityModule,
|
|
3
|
+
querySessionItems
|
|
4
|
+
} from "./chunk-FNO5K3A7.js";
|
|
5
|
+
import "./chunk-KH3WF3K4.js";
|
|
6
|
+
import "./chunk-XKDZHAUE.js";
|
|
7
|
+
import "./chunk-RQP77ZTY.js";
|
|
8
|
+
import "./chunk-3LEIHB7Y.js";
|
|
9
|
+
import "./chunk-X4UHZX6F.js";
|
|
10
|
+
import "./chunk-M35X5PHO.js";
|
|
11
|
+
import "./chunk-3JYLJPE5.js";
|
|
12
|
+
export {
|
|
13
|
+
createKanbanActivityModule,
|
|
14
|
+
querySessionItems
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// src/contracts/board-control.ts
|
|
2
|
+
function boardAllowsStart(board, item) {
|
|
3
|
+
return !board.lifecycle && !board.executionControl?.paused && (board.executionControl?.mode !== "manual" || item?.launch?.requestedAt !== void 0);
|
|
4
|
+
}
|
|
5
|
+
function boardControlPhase(board) {
|
|
6
|
+
if (board.lifecycle) return board.lifecycle.intent === "delete" ? "waiting-deletion" : board.lifecycle.phase === "ready" ? "cancelled" : "cancelling";
|
|
7
|
+
const policy = board.executionControl;
|
|
8
|
+
const controls = Object.entries(policy?.controls ?? {}).flatMap(([id, controlId]) => {
|
|
9
|
+
const item = board.items.find((item2) => item2.id === id);
|
|
10
|
+
return item && !["completed", "cancelled", "review"].includes(item.status) && item.control?.id === controlId ? [item.control] : [];
|
|
11
|
+
});
|
|
12
|
+
if (controls.some((control) => control?.state === "failed" || control?.state === "unknown")) return "error";
|
|
13
|
+
if (controls.some((control) => control?.state === "requested" || control?.state === "accepted")) return policy?.paused ? "pausing" : "resuming";
|
|
14
|
+
return policy?.paused ? "paused" : policy?.mode ?? "automatic";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// src/contracts/task-projection.ts
|
|
18
|
+
var TASK_START_DELAY_MS = 3e5;
|
|
19
|
+
function taskStartAt(item) {
|
|
20
|
+
return item.launch?.startAt ?? item.createdAt + TASK_START_DELAY_MS;
|
|
21
|
+
}
|
|
22
|
+
function taskEditing(item, now) {
|
|
23
|
+
return (item.launch?.editing?.expiresAt ?? 0) > now;
|
|
24
|
+
}
|
|
25
|
+
function taskDue(item, now) {
|
|
26
|
+
return !taskEditing(item, now) && !item.blocked && (!item.control || item.control.action === "resume" && item.control.state === "resumed") && (item.launch?.requestedAt !== void 0 || item.launch?.mode !== "manual" && taskStartAt(item) <= now);
|
|
27
|
+
}
|
|
28
|
+
function projectKanbanTask(item, workflow, now = Date.now(), all = []) {
|
|
29
|
+
const dispatch = Object.values(workflow?.dispatches ?? {}).filter((d) => d.itemId === item.id).sort((a, b) => b.attempt - a.attempt)[0];
|
|
30
|
+
const fact = terminalFact(item) ?? controlFact(item) ?? issueFact(item, dispatch) ?? failureFact(item, dispatch) ?? executionFact(item, dispatch) ?? waitingFact(item, now, all);
|
|
31
|
+
const extra = [];
|
|
32
|
+
if (!["completed", "cancelled"].includes(item.status) && item.control?.action !== "cancel") {
|
|
33
|
+
if (!fact.actions?.includes("cancel")) extra.push("cancel");
|
|
34
|
+
if (item.status !== "review" && !fact.actions?.includes("pause") && !fact.actions?.includes("resume") && (dispatch?.controlCapabilities?.pause === "boundary" || !dispatch)) extra.push("pause");
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
...fact,
|
|
38
|
+
startAt: taskStartAt(item),
|
|
39
|
+
dispatchId: dispatch?.id,
|
|
40
|
+
sessionId: dispatch?.executionSessionId,
|
|
41
|
+
actions: item.deletedAt === void 0 ? [...fact.actions ?? [], ...extra, ...dispatch || item.launch?.admittedAt !== void 0 || ["claimed", "review", "completed"].includes(item.status) ? ["fix"] : [], ...dispatch?.executionSessionId ? ["open-session"] : []] : []
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function terminalFact(item) {
|
|
45
|
+
if (item.status === "completed" || item.status === "cancelled") return { phase: item.status, actions: ["delete"] };
|
|
46
|
+
if (item.control?.action === "cancel") return { phase: item.control.state === "failed" ? "error" : item.control.state === "unknown" ? "unknown" : "cancelling", reason: item.control.code, actions: item.control.state === "failed" ? ["cancel"] : [] };
|
|
47
|
+
if (item.status === "review") return { phase: "review", actions: ["review"] };
|
|
48
|
+
}
|
|
49
|
+
function issueFact(item, dispatch) {
|
|
50
|
+
const issue = item.issues?.find((i) => !i.resolvedBy && (!dispatch || i.attemptId === dispatch.id));
|
|
51
|
+
if (issue) return { phase: issue.type === "clarification" ? "waiting-input" : "error", reason: issue.id, actions: ["resolve"] };
|
|
52
|
+
}
|
|
53
|
+
function controlFact(item) {
|
|
54
|
+
const control = item.control;
|
|
55
|
+
if (!control) return;
|
|
56
|
+
const reason = control.code;
|
|
57
|
+
if (control.state === "unknown") return { phase: "unknown", reason };
|
|
58
|
+
if (control.state === "failed") return { phase: "error", reason, actions: ["resume"] };
|
|
59
|
+
if (control.action === "pause") return { phase: control.state === "paused" ? "paused" : "pausing", reason, actions: ["resume"] };
|
|
60
|
+
if (["requested", "accepted"].includes(control.state)) return { phase: "resuming", reason };
|
|
61
|
+
}
|
|
62
|
+
function failureFact(item, dispatch) {
|
|
63
|
+
if (dispatch?.outcome === "unknown" || item.analysis?.state === "unknown") return { phase: "unknown", reason: dispatch?.code ?? item.analysis?.code };
|
|
64
|
+
if (dispatch && ["failed", "cancelled", "rejected"].includes(dispatch.outcome)) return { phase: "error", reason: dispatch.code ?? dispatch.outcome };
|
|
65
|
+
if (item.analysis?.state === "failed") return { phase: "error", reason: item.analysis.code };
|
|
66
|
+
}
|
|
67
|
+
function executionFact(item, dispatch) {
|
|
68
|
+
if (item.blocked) return { phase: item.blocked.reason === "WORKSPACE_INPUT_REQUIRED" ? "waiting-input" : "error", reason: item.blocked.reason };
|
|
69
|
+
if (dispatch?.outcome === "prepared") return { phase: "preparing" };
|
|
70
|
+
if (dispatch?.outcome === "running" || item.status === "claimed") return { phase: "running", actions: dispatch?.controlCapabilities?.pause === "boundary" ? ["pause"] : [] };
|
|
71
|
+
}
|
|
72
|
+
function waitingFact(item, now, all) {
|
|
73
|
+
const analysis = analysisFact(item);
|
|
74
|
+
if (analysis) return analysis;
|
|
75
|
+
const dependency = item.planning?.dependencies.find((id) => all.find((i) => i.id === id)?.status !== "completed");
|
|
76
|
+
if (dependency) return { phase: "waiting-dependency", reason: "DEPENDENCY_UNFINISHED:" + dependency, actions: item.launch?.admittedAt === void 0 ? ["edit", "cancel"] : [] };
|
|
77
|
+
if (taskEditing(item, now)) return { phase: "waiting-start", reason: "EDIT_LEASE_ACTIVE" };
|
|
78
|
+
if (item.launch?.admittedAt !== void 0) return { phase: "queued" };
|
|
79
|
+
return { phase: "waiting-start", reason: item.launch?.mode === "manual" ? "MANUAL_START_REQUIRED" : taskDue(item, now) ? "ADMISSION_PENDING" : "START_AT_PENDING", actions: ["run", "edit", "pause", "cancel"] };
|
|
80
|
+
}
|
|
81
|
+
function analysisFact(item) {
|
|
82
|
+
if (item.analysis?.state === "clarification") return { phase: "waiting-input", reason: item.analysis.reason };
|
|
83
|
+
if (item.analysis?.state === "analyzing") return { phase: "analyzing" };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
boardAllowsStart,
|
|
88
|
+
boardControlPhase,
|
|
89
|
+
TASK_START_DELAY_MS,
|
|
90
|
+
taskStartAt,
|
|
91
|
+
taskEditing,
|
|
92
|
+
taskDue,
|
|
93
|
+
projectKanbanTask
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=chunk-3JYLJPE5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contracts/board-control.ts","../src/contracts/task-projection.ts"],"sourcesContent":["import type {KanbanBoard, KanbanItem} from './contracts';\n\nexport interface KanbanBoardControl {\n mode: 'automatic' | 'manual'; paused: boolean;\n controls: Record<string, string>;\n}\n/** Manual mode still honors an explicit per-task run request. */\nexport function boardAllowsStart(board: Pick<KanbanBoard, 'executionControl' | 'lifecycle'>, item?: Pick<KanbanItem, 'launch'>): boolean {\n return !board.lifecycle && !board.executionControl?.paused && (board.executionControl?.mode !== 'manual' || item?.launch?.requestedAt !== undefined);\n}\nexport function boardControlPhase(board: Pick<KanbanBoard, 'executionControl' | 'lifecycle'> & {items: Array<Pick<KanbanItem, 'id' | 'status' | 'control'>>}): 'automatic' | 'manual' | 'pausing' | 'paused' | 'resuming' | 'error' | 'cancelling' | 'cancelled' | 'waiting-deletion' {\n if (board.lifecycle) return board.lifecycle.intent === 'delete' ? 'waiting-deletion' : board.lifecycle.phase === 'ready' ? 'cancelled' : 'cancelling';\n const policy = board.executionControl;\n const controls = Object.entries(policy?.controls ?? {}).flatMap(([id, controlId]) => {\n const item = board.items.find(item => item.id === id);\n return item && !['completed', 'cancelled', 'review'].includes(item.status) && item.control?.id === controlId ? [item.control] : [];\n });\n if (controls.some(control => control?.state === 'failed' || control?.state === 'unknown')) return 'error';\n if (controls.some(control => control?.state === 'requested' || control?.state === 'accepted')) return policy?.paused ? 'pausing' : 'resuming';\n return policy?.paused ? 'paused' : policy?.mode ?? 'automatic';\n}\n","import type {KanbanDispatch,KanbanItem,KanbanItemSummary,KanbanWorkflowState,KanbanTaskProjection,KanbanTaskPhase} from './index';\n\ntype Item=Pick<KanbanItem,'deletedAt'|'id'|'status'|'createdAt'|'launch'|'analysis'|'control'|'issues'|'blocked'|'externalRefs'|'planning'>;\ntype Fact={phase:KanbanTaskPhase;reason?:string;actions?:KanbanTaskProjection['actions']};\nexport const TASK_START_DELAY_MS=300000;\nexport function taskStartAt(item:Pick<Item,'createdAt'|'launch'>):number {return item.launch?.startAt??item.createdAt+TASK_START_DELAY_MS;}\nexport function taskEditing(item:Pick<Item,'launch'>,now:number):boolean {return (item.launch?.editing?.expiresAt??0)>now;}\nexport function taskDue(item:Item,now:number):boolean {\n return !taskEditing(item,now)&&!item.blocked&&(!item.control || item.control.action === 'resume' && item.control.state === 'resumed')\n &&(item.launch?.requestedAt!==undefined||item.launch?.mode!=='manual'&&taskStartAt(item)<=now);\n}\n/** Ordered evidence projection shared by storage queries, CLI and UI. Session idle never proves acceptance. */\nexport function projectKanbanTask(item:Item,workflow?:KanbanWorkflowState,now=Date.now(),all:Array<Pick<KanbanItemSummary,'id'|'status'>>=[]):KanbanTaskProjection {\n const dispatch=Object.values(workflow?.dispatches??{}).filter(d=>d.itemId===item.id).sort((a,b)=>b.attempt-a.attempt)[0];\n const fact=terminalFact(item)??controlFact(item)??issueFact(item,dispatch)??failureFact(item,dispatch)??executionFact(item,dispatch)??waitingFact(item,now,all);\n const extra: KanbanTaskProjection['actions'] = [];\n if (!['completed','cancelled'].includes(item.status) && item.control?.action !== 'cancel') {\n if (!fact.actions?.includes('cancel')) extra.push('cancel');\n if (item.status !== 'review' && !fact.actions?.includes('pause') && !fact.actions?.includes('resume') && (dispatch?.controlCapabilities?.pause === 'boundary' || !dispatch)) extra.push('pause');\n }\n return {...fact,startAt:taskStartAt(item),dispatchId:dispatch?.id,sessionId:dispatch?.executionSessionId,\n actions:item.deletedAt === undefined ? [...fact.actions??[],...extra,...(dispatch||item.launch?.admittedAt!==undefined||['claimed','review','completed'].includes(item.status)?['fix' as const]:[]),...(dispatch?.executionSessionId?['open-session' as const]:[])] : []};\n}\nfunction terminalFact(item:Item):Fact|undefined {\n if(item.status==='completed'||item.status==='cancelled')return {phase:item.status,actions:['delete']};\n if(item.control?.action==='cancel')return {phase:item.control.state==='failed'?'error':item.control.state==='unknown'?'unknown':'cancelling',reason:item.control.code,actions:item.control.state==='failed'?['cancel']:[]};\n if(item.status==='review')return {phase:'review',actions:['review']};\n}\nfunction issueFact(item:Item,dispatch?:KanbanDispatch):Fact|undefined {\n const issue=item.issues?.find(i=>!i.resolvedBy&&(!dispatch||i.attemptId===dispatch.id));\n if(issue)return {phase:issue.type==='clarification'?'waiting-input':'error',reason:issue.id,actions:['resolve']};\n}\nfunction controlFact(item:Item):Fact|undefined {\n const control=item.control;if(!control)return;\n const reason=control.code;\n if(control.state==='unknown')return {phase:'unknown',reason};\n if(control.state==='failed')return {phase:'error',reason,actions:['resume']};\n if(control.action==='pause')return {phase:control.state==='paused'?'paused':'pausing',reason,actions:['resume']};\n if(['requested','accepted'].includes(control.state))return {phase:'resuming',reason};\n}\nfunction failureFact(item:Item,dispatch?:KanbanDispatch):Fact|undefined {\n if(dispatch?.outcome==='unknown'||item.analysis?.state==='unknown')return {phase:'unknown',reason:dispatch?.code??item.analysis?.code};\n if(dispatch&&['failed','cancelled','rejected'].includes(dispatch.outcome))return {phase:'error',reason:dispatch.code??dispatch.outcome};\n if(item.analysis?.state==='failed')return {phase:'error',reason:item.analysis.code};\n}\nfunction executionFact(item:Item,dispatch?:KanbanDispatch):Fact|undefined {\n if(item.blocked)return {phase:item.blocked.reason==='WORKSPACE_INPUT_REQUIRED'?'waiting-input':'error',reason:item.blocked.reason};\n if(dispatch?.outcome==='prepared')return {phase:'preparing'};\n if(dispatch?.outcome==='running'||item.status==='claimed')return {phase:'running',actions:dispatch?.controlCapabilities?.pause==='boundary'?['pause']:[]};\n}\nfunction waitingFact(item:Item,now:number,all:Array<Pick<KanbanItemSummary,'id'|'status'>>):Fact {\n const analysis=analysisFact(item);if(analysis)return analysis;\n const dependency=item.planning?.dependencies.find(id=>all.find(i=>i.id===id)?.status!=='completed');\n if(dependency)return {phase:'waiting-dependency',reason:'DEPENDENCY_UNFINISHED:'+dependency,actions:item.launch?.admittedAt===undefined?['edit','cancel']:[]};\n if(taskEditing(item,now))return {phase:'waiting-start',reason:'EDIT_LEASE_ACTIVE'};\n if(item.launch?.admittedAt!==undefined)return {phase:'queued'};\n return {phase:'waiting-start',reason:item.launch?.mode==='manual'?'MANUAL_START_REQUIRED':taskDue(item,now)?'ADMISSION_PENDING':'START_AT_PENDING',actions:['run','edit','pause','cancel']};\n}\nfunction analysisFact(item:Item):Fact|undefined {\n if(item.analysis?.state==='clarification')return {phase:'waiting-input',reason:item.analysis.reason};\n if(item.analysis?.state==='analyzing')return {phase:'analyzing'};\n}\n"],"mappings":";AAOO,SAAS,iBAAiB,OAA4D,MAA4C;AACrI,SAAO,CAAC,MAAM,aAAa,CAAC,MAAM,kBAAkB,WAAW,MAAM,kBAAkB,SAAS,YAAY,MAAM,QAAQ,gBAAgB;AAC9I;AACO,SAAS,kBAAkB,OAAoP;AAClR,MAAI,MAAM,UAAW,QAAO,MAAM,UAAU,WAAW,WAAW,qBAAqB,MAAM,UAAU,UAAU,UAAU,cAAc;AACzI,QAAM,SAAS,MAAM;AACrB,QAAM,WAAW,OAAO,QAAQ,QAAQ,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,SAAS,MAAM;AACjF,UAAM,OAAO,MAAM,MAAM,KAAK,CAAAA,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