@nestos/kanban 0.5.1 → 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.
Files changed (147) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +73 -29
  3. package/dist/{activity-C6xDM-cg.d.cts → activity-BbC4sgKL.d.cts} +28 -2
  4. package/dist/{activity-Dw8DOw0L.d.ts → activity-Czlan5xW.d.ts} +28 -2
  5. package/dist/activity-module-DaO1Rry0.d.cts +22 -0
  6. package/dist/activity-module-T22wliZu.d.ts +22 -0
  7. package/dist/activity-ports-Dqxa86zT.d.cts +12 -0
  8. package/dist/activity-ports-cxfrelaL.d.ts +12 -0
  9. package/dist/activity.cjs +10 -282
  10. package/dist/activity.cjs.map +1 -1
  11. package/dist/activity.d.cts +8 -30
  12. package/dist/activity.d.ts +8 -30
  13. package/dist/activity.js +9 -281
  14. package/dist/activity.js.map +1 -1
  15. package/dist/{chunk-O4OGAAV4.js → chunk-3JYLJPE5.js} +29 -5
  16. package/dist/chunk-3JYLJPE5.js.map +1 -0
  17. package/dist/{chunk-ATUFFNLV.js → chunk-3LEIHB7Y.js} +5 -5
  18. package/dist/chunk-4XF6LQSU.cjs.map +1 -1
  19. package/dist/chunk-5Q7WB63A.cjs +282 -0
  20. package/dist/chunk-5Q7WB63A.cjs.map +1 -0
  21. package/dist/{chunk-PSKQAFDF.cjs → chunk-7KDOTBRX.cjs} +1 -1
  22. package/dist/chunk-7KDOTBRX.cjs.map +1 -0
  23. package/dist/{chunk-5DLZWW5Y.js → chunk-AHHEGTUA.js} +3 -3
  24. package/dist/chunk-AOHQCX7K.cjs +95 -0
  25. package/dist/chunk-AOHQCX7K.cjs.map +1 -0
  26. package/dist/{chunk-IUI5CI2S.cjs → chunk-DINLR6E6.cjs} +96 -92
  27. package/dist/chunk-DINLR6E6.cjs.map +1 -0
  28. package/dist/{chunk-L44TM4EE.cjs → chunk-EYTVC2H5.cjs} +568 -454
  29. package/dist/chunk-EYTVC2H5.cjs.map +1 -0
  30. package/dist/chunk-FEE2YBZ7.js +1972 -0
  31. package/dist/chunk-FEE2YBZ7.js.map +1 -0
  32. package/dist/chunk-FNO5K3A7.js +282 -0
  33. package/dist/chunk-FNO5K3A7.js.map +1 -0
  34. package/dist/chunk-IHHDXZPZ.js +382 -0
  35. package/dist/chunk-IHHDXZPZ.js.map +1 -0
  36. package/dist/chunk-J3EAIVA3.js +280 -0
  37. package/dist/chunk-J3EAIVA3.js.map +1 -0
  38. package/dist/{chunk-DFTOTBGF.js → chunk-KH3WF3K4.js} +20 -16
  39. package/dist/chunk-KH3WF3K4.js.map +1 -0
  40. package/dist/{chunk-TB2RZGDV.js → chunk-M35X5PHO.js} +14 -1
  41. package/dist/chunk-M35X5PHO.js.map +1 -0
  42. package/dist/chunk-QRGZD2JU.cjs +1972 -0
  43. package/dist/chunk-QRGZD2JU.cjs.map +1 -0
  44. package/dist/{chunk-4KF7KUAI.cjs → chunk-RBOER6EW.cjs} +6 -6
  45. package/dist/chunk-RBOER6EW.cjs.map +1 -0
  46. package/dist/{chunk-6MN3H3YF.cjs → chunk-RSH6QSEC.cjs} +16 -3
  47. package/dist/chunk-RSH6QSEC.cjs.map +1 -0
  48. package/dist/{chunk-T7P5EIC4.cjs → chunk-VMRDXOLX.cjs} +33 -33
  49. package/dist/chunk-VMRDXOLX.cjs.map +1 -0
  50. package/dist/{chunk-5XKOCKY2.js → chunk-X4UHZX6F.js} +1 -1
  51. package/dist/chunk-XBSGUVCY.cjs +382 -0
  52. package/dist/chunk-XBSGUVCY.cjs.map +1 -0
  53. package/dist/{chunk-OHQTKGQN.js → chunk-XKDZHAUE.js} +242 -128
  54. package/dist/chunk-XKDZHAUE.js.map +1 -0
  55. package/dist/chunk-ZUZGAO6G.cjs +280 -0
  56. package/dist/chunk-ZUZGAO6G.cjs.map +1 -0
  57. package/dist/{content-CAIp1njn.d.cts → content-C5aJZFlw.d.cts} +1 -1
  58. package/dist/{content-CGMJdyH_.d.ts → content-hLH5BNud.d.ts} +1 -1
  59. package/dist/contracts/index.cjs +13 -3
  60. package/dist/contracts/index.cjs.map +1 -1
  61. package/dist/contracts/index.d.cts +5 -4
  62. package/dist/contracts/index.d.ts +5 -4
  63. package/dist/contracts/index.js +14 -4
  64. package/dist/{discovery-DxpirOz3.d.cts → discovery-9E-LfwIw.d.cts} +1 -1
  65. package/dist/{discovery-gSqWpuRm.d.ts → discovery-D60yrjej.d.ts} +1 -1
  66. package/dist/discovery.cjs +63 -65
  67. package/dist/discovery.cjs.map +1 -1
  68. package/dist/discovery.d.cts +4 -4
  69. package/dist/discovery.d.ts +4 -4
  70. package/dist/discovery.js +5 -7
  71. package/dist/discovery.js.map +1 -1
  72. package/dist/execution-bridge-fpCnH6z5.d.cts +52 -0
  73. package/dist/execution-bridge-rk0uVy_n.d.ts +52 -0
  74. package/dist/execution.cjs +6 -356
  75. package/dist/execution.cjs.map +1 -1
  76. package/dist/execution.d.cts +4 -51
  77. package/dist/execution.d.ts +4 -51
  78. package/dist/execution.js +9 -359
  79. package/dist/execution.js.map +1 -1
  80. package/dist/index.cjs +10 -12
  81. package/dist/index.cjs.map +1 -1
  82. package/dist/index.d.cts +9 -16
  83. package/dist/index.d.ts +9 -16
  84. package/dist/index.js +10 -12
  85. package/dist/index.js.map +1 -1
  86. package/dist/{module-CWNK2BMj.d.ts → module-CYfE7YhM.d.ts} +2 -2
  87. package/dist/{module-BbvwdCDF.d.cts → module-Ca9L3qCn.d.cts} +2 -2
  88. package/dist/{planning-CcFZYdIL.d.cts → planning-CHrOqQ6b.d.cts} +45 -10
  89. package/dist/{planning-CcFZYdIL.d.ts → planning-CHrOqQ6b.d.ts} +45 -10
  90. package/dist/{ports-Bn6ro2FB.d.ts → ports-B0McVg7B.d.ts} +4 -3
  91. package/dist/ports-BeGO1VRI.d.cts +49 -0
  92. package/dist/{ports-CaL6geqR.d.cts → ports-GQy0x-RI.d.cts} +4 -3
  93. package/dist/ports-ykGiNUSx.d.ts +49 -0
  94. package/dist/runtime/index.cjs +205 -0
  95. package/dist/runtime/index.cjs.map +1 -0
  96. package/dist/runtime/index.d.cts +75 -0
  97. package/dist/runtime/index.d.ts +75 -0
  98. package/dist/runtime/index.js +205 -0
  99. package/dist/runtime/index.js.map +1 -0
  100. package/dist/runtime/integration.cjs +423 -0
  101. package/dist/runtime/integration.cjs.map +1 -0
  102. package/dist/runtime/integration.d.cts +658 -0
  103. package/dist/runtime/integration.d.ts +658 -0
  104. package/dist/runtime/integration.js +423 -0
  105. package/dist/runtime/integration.js.map +1 -0
  106. package/dist/storage.cjs +9 -277
  107. package/dist/storage.cjs.map +1 -1
  108. package/dist/storage.d.cts +6 -6
  109. package/dist/storage.d.ts +6 -6
  110. package/dist/storage.js +11 -279
  111. package/dist/storage.js.map +1 -1
  112. package/dist/{store-q63eSMoT.d.cts → store-DPwHzGiz.d.cts} +2 -2
  113. package/dist/{store-Ct0gOAAg.d.ts → store-DgdrPCV9.d.ts} +2 -2
  114. package/dist/task-projection-CSorlMws.d.ts +11 -0
  115. package/dist/task-projection-DKKB_ueb.d.cts +11 -0
  116. package/examples/standalone.ts +22 -0
  117. package/package.json +117 -87
  118. package/dist/chunk-2YFPV5GF.cjs +0 -16
  119. package/dist/chunk-2YFPV5GF.cjs.map +0 -1
  120. package/dist/chunk-4KF7KUAI.cjs.map +0 -1
  121. package/dist/chunk-6MN3H3YF.cjs.map +0 -1
  122. package/dist/chunk-DFTOTBGF.js.map +0 -1
  123. package/dist/chunk-G6FCDLDF.js +0 -16
  124. package/dist/chunk-G6FCDLDF.js.map +0 -1
  125. package/dist/chunk-IUI5CI2S.cjs.map +0 -1
  126. package/dist/chunk-KYNYPKKH.cjs +0 -71
  127. package/dist/chunk-KYNYPKKH.cjs.map +0 -1
  128. package/dist/chunk-L44TM4EE.cjs.map +0 -1
  129. package/dist/chunk-LSE6JG5I.cjs +0 -20
  130. package/dist/chunk-LSE6JG5I.cjs.map +0 -1
  131. package/dist/chunk-O4OGAAV4.js.map +0 -1
  132. package/dist/chunk-OHQTKGQN.js.map +0 -1
  133. package/dist/chunk-PSKQAFDF.cjs.map +0 -1
  134. package/dist/chunk-QTMTBEBA.js +0 -20
  135. package/dist/chunk-QTMTBEBA.js.map +0 -1
  136. package/dist/chunk-T7P5EIC4.cjs.map +0 -1
  137. package/dist/chunk-TB2RZGDV.js.map +0 -1
  138. package/dist/ui/index.cjs +0 -1961
  139. package/dist/ui/index.cjs.map +0 -1
  140. package/dist/ui/index.d.cts +0 -209
  141. package/dist/ui/index.d.ts +0 -209
  142. package/dist/ui/index.js +0 -1961
  143. package/dist/ui/index.js.map +0 -1
  144. package/dist/ui/kanban.css +0 -194
  145. /package/dist/{chunk-ATUFFNLV.js.map → chunk-3LEIHB7Y.js.map} +0 -0
  146. /package/dist/{chunk-5DLZWW5Y.js.map → chunk-AHHEGTUA.js.map} +0 -0
  147. /package/dist/{chunk-5XKOCKY2.js.map → chunk-X4UHZX6F.js.map} +0 -0
@@ -0,0 +1,658 @@
1
+ import * as _nestos_vfs_core from '@nestos/vfs-core';
2
+ import { IFileSystem } from '@nestos/vfs-core';
3
+ import { b as KanbanJournalOptions, a as KanbanRuntimeDiagnostic, K as KanbanResourceCatalog, c as KanbanWorkLogOptions, d as KanbanReferencePolicy } from '../ports-ykGiNUSx.js';
4
+ export { e as defaultReferences } from '../ports-ykGiNUSx.js';
5
+ import { d as KanbanArtifactRef, T as KanbanService, o as KanbanCommand, K as KanbanActor, s as KanbanEstimate, j as KanbanBoard, w as KanbanItem, u as KanbanExternalReference, J as KanbanProjectRecord, b as KanbanAnalysisStatus, M as KanbanRecordActivity, P as KanbanRecordQuery, O as KanbanRecordPage, f as KanbanAutomationCatalog, v as KanbanFixSession, r as KanbanDispatch, a7 as KanbanWorkflowState, R as KanbanReferenceTarget, Y as KanbanSuggestionQuery, X as KanbanSuggestionPage, I as KanbanPrincipal, l as KanbanBoardInput, m as KanbanBoardSummary, S as KanbanRequest, t as KanbanEvent, y as KanbanItemQuery, x as KanbanItemPage, a1 as KanbanTaskProjection, c as KanbanArchivedItem, E as KanbanOverview } from '../planning-CHrOqQ6b.js';
6
+ import { K as KanbanClient, n as KanbanRecordRunRequest, l as KanbanRecordExecution, a as KanbanDeletionPreview, b as KanbanDeletionRequest, i as KanbanItemResourceCatalog, h as KanbanItemOperations, g as KanbanItemOperationRequest, f as KanbanItemOperationBinding, z as KanbanWorkResourceQuery, x as KanbanWorkResource, y as KanbanWorkResourceCleanup, p as KanbanSessionActivityQuery, t as KanbanSessionItemPage, r as KanbanSessionDetailQuery, d as KanbanExecutionSessionDetail } from '../activity-Czlan5xW.js';
7
+ import { b as KanbanExecutionPort, K as KanbanExecutionBridgeOptions } from '../execution-bridge-rk0uVy_n.js';
8
+ import { K as KanbanActivityHandle, a as KanbanActivityModuleOptions } from '../activity-module-T22wliZu.js';
9
+ import { e as KanbanStore } from '../ports-B0McVg7B.js';
10
+ import '../module-CYfE7YhM.js';
11
+ import '../activity-ports-cxfrelaL.js';
12
+ import '../discovery-D60yrjej.js';
13
+
14
+ declare class KanbanAutomationJournal {
15
+ private readonly fs;
16
+ private readonly options;
17
+ private readonly writes;
18
+ readonly directory: string;
19
+ readonly indexPath: string;
20
+ private readonly path;
21
+ private readonly artifactScheme;
22
+ constructor(fs: IFileSystem, options?: KanbanJournalOptions);
23
+ diagnostic(event: KanbanRuntimeDiagnostic): void;
24
+ open(): Promise<void>;
25
+ get<T>(key: string): Promise<T | undefined>;
26
+ getMany<T>(keys: string[]): Promise<Array<T | undefined>>;
27
+ findForBoard<T>(family: string, boardId: string, matches: (value: T) => boolean): Promise<Array<{
28
+ key: string;
29
+ value: T;
30
+ }>>;
31
+ find<T>(keyPrefix: string, matches: (value: T, key: string) => boolean): Promise<Array<{
32
+ key: string;
33
+ value: T;
34
+ }>>;
35
+ update<T>(key: string, change: (previous: T | undefined) => T): Promise<T>;
36
+ drain(): Promise<void>;
37
+ claim(key: string): Promise<boolean>;
38
+ private commit;
39
+ artifact(dispatchId: string, value: unknown): Promise<KanbanArtifactRef[]>;
40
+ verify(outputs: KanbanArtifactRef[], dispatchId?: string): Promise<boolean>;
41
+ }
42
+
43
+ /** Unknown responses retain the frozen request; only a definite CAS rejection can rebase. */
44
+ declare function journalCommand(journal: KanbanAutomationJournal, service: Pick<KanbanService, 'read' | 'execute'>, boardId: string, key: string, command: KanbanCommand): Promise<void>;
45
+
46
+ /** Completing a composite never starts another execution or substitutes for child acceptance. */
47
+ declare function completeCompositePlans(service: KanbanService, journal: KanbanAutomationJournal, boardId: string, serviceFor: (actor: KanbanActor) => KanbanService): Promise<void>;
48
+
49
+ interface AnalysisSubtask {
50
+ key: string;
51
+ title: string;
52
+ responsibility: string;
53
+ acceptance: string;
54
+ dependsOn: string[];
55
+ estimate?: KanbanEstimate;
56
+ }
57
+ interface Input {
58
+ id: string;
59
+ reason: string;
60
+ dependencies: string[];
61
+ subtasks: AnalysisSubtask[];
62
+ }
63
+ declare function validateSubtasks(value: unknown): AnalysisSubtask[] | undefined;
64
+ /** The model supplies local keys; the host owns stable identities, resource inheritance and publication. */
65
+ declare function adoptDecomposition(journal: KanbanAutomationJournal, board: KanbanBoard, parent: KanbanItem, input: Input, service: KanbanService, inherited?: KanbanExternalReference[]): Promise<void>;
66
+
67
+ interface Options$3 {
68
+ requiresItemResource?(board: KanbanBoard): boolean;
69
+ service: KanbanClient;
70
+ journal: KanbanAutomationJournal;
71
+ resources: KanbanResourceCatalog;
72
+ log(input: {
73
+ operationId: string;
74
+ boardId: string;
75
+ stage: string;
76
+ result: 'success' | 'failure';
77
+ code?: string;
78
+ durationMs: number;
79
+ }): void;
80
+ }
81
+ /** A restartable projection from an approved decision into work on its chosen board. */
82
+ declare function createRecordExecution(options: Options$3): {
83
+ itemResources: (boardId: string, parentId?: string) => Promise<{
84
+ resources: {
85
+ reference: KanbanExternalReference;
86
+ label: string;
87
+ }[];
88
+ selected: KanbanExternalReference | undefined;
89
+ readonly: boolean;
90
+ required: boolean;
91
+ }>;
92
+ recordResources: () => Promise<{
93
+ reference: KanbanExternalReference;
94
+ label: string;
95
+ }[]>;
96
+ runRecord: (boardId: string, request: KanbanRecordRunRequest) => Promise<KanbanRecordExecution>;
97
+ controlRecord: (boardId: string, request: {
98
+ recordId: string;
99
+ operationId: string;
100
+ action: "pause" | "resume" | "cancel";
101
+ }) => Promise<void>;
102
+ recordExecutions: (boardId: string, recordId: string) => Promise<KanbanRecordExecution[]>;
103
+ scan(): Promise<void>;
104
+ quiesce(): Promise<void>;
105
+ };
106
+ declare function validateResourceReferences(resources: KanbanResourceCatalog, record: Pick<KanbanProjectRecord, 'externalRefs'>): Promise<void>;
107
+
108
+ interface RecordControl {
109
+ boardId?: string;
110
+ recordId?: string;
111
+ operationId: string;
112
+ action: 'pause' | 'resume' | 'cancel';
113
+ controls: Record<string, string>;
114
+ settled?: boolean;
115
+ }
116
+ declare const recordControlKey: (board: string, record: string) => string;
117
+ /** Only already materialized work is controlled; cancellation never creates missing work. */
118
+ declare function advanceRecordControl(service: KanbanClient, journal: KanbanAutomationJournal, run: KanbanRecordExecution & {
119
+ sourceBoardId: string;
120
+ }, control: RecordControl): Promise<KanbanRecordExecution['state']>;
121
+ declare function requestRecordControl(service: KanbanClient, journal: KanbanAutomationJournal, boardId: string, request: {
122
+ recordId: string;
123
+ operationId: string;
124
+ action: RecordControl['action'];
125
+ }): Promise<void>;
126
+
127
+ declare function safeCode(error: unknown, fallback: string): string;
128
+
129
+ interface AnalysisJournalEntry {
130
+ id: string;
131
+ itemRevision: number;
132
+ signature: string;
133
+ phase: 'prepared' | 'submitting' | 'settled';
134
+ status: KanbanAnalysisStatus;
135
+ terminalOutcome?: 'succeeded' | 'failed' | 'cancelled';
136
+ }
137
+ /** Rebuild legacy history once; the hash proves board/item scope even when item IDs overlap. */
138
+ declare function analysisHistory<T extends AnalysisJournalEntry = AnalysisJournalEntry>(journal: KanbanAutomationJournal, boardId: string, itemId: string): Promise<T[]>;
139
+
140
+ interface Options$2 {
141
+ service: KanbanClient;
142
+ journal: KanbanAutomationJournal;
143
+ }
144
+ type Blocker = KanbanDeletionPreview['blockers'][number];
145
+ declare function boardDeletionBlockers({ service, journal }: Options$2, boardId: string, items?: Array<{
146
+ id: string;
147
+ title: string;
148
+ }>): Promise<Blocker[]>;
149
+ declare function deletionPreview(options: Options$2, boardId: string): Promise<KanbanDeletionPreview>;
150
+
151
+ /** A retained tombstone preserves audit and resource provenance without owning Sessions. */
152
+ declare function createBoardDeletion(options: Options$2): {
153
+ previewDeletion: (id: string) => Promise<KanbanDeletionPreview>;
154
+ assertSettled: (id: string) => Promise<void>;
155
+ deleteBoard: (id: string, request: KanbanDeletionRequest) => Promise<void>;
156
+ cancelBoard: (board: string, request: {
157
+ operationId: string;
158
+ expectedRevision: number;
159
+ }) => Promise<void>;
160
+ requestBoardDeletion: (board: string, request: KanbanDeletionRequest & {
161
+ mode: "drain" | "cancel";
162
+ }) => Promise<void>;
163
+ preparePending: () => Promise<void>;
164
+ resumePending: () => Promise<void>;
165
+ };
166
+ /** Concurrent admissions share an exclusive deletion barrier; queries never wait for scans. */
167
+ declare function withBoardDeletion<T extends KanbanClient & {
168
+ quiesce?(): Promise<void>;
169
+ dispose?(): Promise<void>;
170
+ }>(service: T, deletion: ReturnType<typeof createBoardDeletion>): T & Pick<typeof deletion, 'previewDeletion' | 'deleteBoard'>;
171
+
172
+ interface WorkLogFact extends KanbanRecordActivity {
173
+ references?: KanbanExternalReference[];
174
+ summary?: string;
175
+ }
176
+ /** A recoverable read projection; it never appends commands or grows coordination state. */
177
+ declare class KanbanWorkLog {
178
+ private readonly options;
179
+ private readonly store;
180
+ private readonly projection;
181
+ private readonly log;
182
+ constructor(fs: IFileSystem, options?: KanbanWorkLogOptions);
183
+ open(): Promise<void>;
184
+ synchronize(boardId: string, source: KanbanService): Promise<void>;
185
+ append(source: KanbanService, boardId: string, itemId: string, fact: WorkLogFact): Promise<void>;
186
+ record(source: KanbanService, boardId: string, id: string): Promise<KanbanProjectRecord>;
187
+ records(source: KanbanService, boardId: string, query?: KanbanRecordQuery): Promise<KanbanRecordPage>;
188
+ }
189
+
190
+ interface AnalysisResult {
191
+ ready: boolean;
192
+ dependencies: string[];
193
+ reason: string;
194
+ estimate?: KanbanEstimate;
195
+ subtasks?: AnalysisSubtask[];
196
+ }
197
+ interface KanbanAnalysisObservation {
198
+ state: 'running' | 'unknown' | 'succeeded' | 'failed' | 'cancelled';
199
+ output?: unknown;
200
+ code?: string;
201
+ }
202
+ interface KanbanAnalysisPort<Target = KanbanExternalReference, Input = unknown> {
203
+ prepare(input: {
204
+ id: string;
205
+ board: KanbanBoard;
206
+ item: KanbanItem;
207
+ target: Target;
208
+ }): Promise<Input>;
209
+ prepareExecution(id: string, input: Input): Promise<void>;
210
+ submit(input: Input): Promise<void>;
211
+ inspect(id: string, input: Input): Promise<KanbanAnalysisObservation>;
212
+ }
213
+ interface KanbanAnalysisOptions<Target = KanbanExternalReference, Input = unknown> {
214
+ journal: KanbanAutomationJournal;
215
+ port: KanbanAnalysisPort<Target, Input>;
216
+ active(): boolean;
217
+ inheritReferences?(references: readonly KanbanExternalReference[]): KanbanExternalReference[];
218
+ onSettled?(input: {
219
+ boardId: string;
220
+ id: string;
221
+ item: KanbanItem;
222
+ request: Input;
223
+ outcome: 'succeeded' | 'failed' | 'cancelled';
224
+ code?: string;
225
+ }): Promise<void>;
226
+ log(input: {
227
+ operationId: string;
228
+ stage: string;
229
+ result: 'success' | 'failure';
230
+ code?: string;
231
+ durationMs: number;
232
+ }): void;
233
+ }
234
+ declare function analysisStatus<Input = unknown>(journal: KanbanAutomationJournal, board: string, item: string): Promise<KanbanAnalysisStatus | null>;
235
+ declare function analysisSignature(board: KanbanBoard): string;
236
+ declare function analyzeItem<Target, Input>(options: KanbanAnalysisOptions<Target, Input>, board: KanbanBoard, item: KanbanItem, target: Target | undefined, service: KanbanService): Promise<void>;
237
+ declare function parseAnalysis(output: unknown): AnalysisResult;
238
+
239
+ interface KanbanExecutorContext {
240
+ boardId: string;
241
+ service: KanbanService;
242
+ dependencies(item: KanbanItem): Promise<unknown>;
243
+ }
244
+ interface KanbanAutomationOptions {
245
+ fs: IFileSystem;
246
+ directory: string;
247
+ service: KanbanService;
248
+ journal: KanbanAutomationJournal;
249
+ workLog?: KanbanWorkLog;
250
+ serviceFor(actor: KanbanActor): KanbanService;
251
+ catalog(): Promise<KanbanAutomationCatalog>;
252
+ executor(context: KanbanExecutorContext): Promise<KanbanExecutionPort>;
253
+ analyze?(board: KanbanBoard, item: KanbanItem, service: KanbanService, active: () => boolean): Promise<void>;
254
+ controls?(board: KanbanBoard, service: KanbanService): Promise<void>;
255
+ drain?(board: KanbanBoard, service: KanbanService): Promise<void>;
256
+ executionReference?: KanbanExecutionBridgeOptions['executionReference'];
257
+ log(event: KanbanRuntimeDiagnostic & {
258
+ result: 'success' | 'failure';
259
+ }): void;
260
+ }
261
+ declare function createKanbanAutomation(options: KanbanAutomationOptions): {
262
+ scan: () => Promise<void>;
263
+ quiesce(): Promise<void>;
264
+ automationCatalog: () => Promise<KanbanAutomationCatalog>;
265
+ analysisStatus: (board: string, item: string) => Promise<KanbanAnalysisStatus | null>;
266
+ verifyOutputs: (outputs: KanbanArtifactRef[]) => Promise<boolean>;
267
+ };
268
+ declare function dependencyResults(options: KanbanAutomationOptions, boardId: string, item: KanbanItem): Promise<unknown>;
269
+
270
+ type KanbanControlState = 'accepted' | 'paused' | 'resumed' | 'cancelled' | 'unknown';
271
+ interface KanbanControlRequest {
272
+ executionId: string;
273
+ operationId: string;
274
+ action: 'pause' | 'resume' | 'cancel';
275
+ attemptId?: string;
276
+ kind?: 'call' | 'submission';
277
+ prepared?: unknown;
278
+ previousKey?: string;
279
+ fallbackSubmission?: boolean;
280
+ }
281
+ interface KanbanExecutionControlPort {
282
+ control(request: KanbanControlRequest): Promise<KanbanControlState>;
283
+ inspect?(executionId: string, attemptId?: string): Promise<{
284
+ settled: boolean;
285
+ outcome?: 'succeeded' | 'failed' | 'cancelled';
286
+ } | undefined>;
287
+ }
288
+ interface KanbanTaskControlOptions {
289
+ control: KanbanExecutionControlPort;
290
+ references?: KanbanReferencePolicy;
291
+ finalizerPrefix?: string;
292
+ }
293
+
294
+ type TaskControlPorts = KanbanTaskControlOptions;
295
+ /** Controls run even with scheduling disabled and never depend on the business channel. */
296
+ declare function scanTaskControls(options: TaskControlPorts, journal: KanbanAutomationJournal, board: KanbanBoard, service: KanbanService): Promise<void>;
297
+
298
+ /** Observe accepted analyses to completion, without adopting a new plan or starting another call. */
299
+ declare function drainBoardAnalyses(ports: KanbanTaskControlOptions, journal: KanbanAutomationJournal, board: KanbanBoard, service: KanbanService): Promise<void>;
300
+
301
+ interface Options$1 {
302
+ service: KanbanClient;
303
+ journal: KanbanAutomationJournal;
304
+ ports: TaskControlPorts;
305
+ fixes?: {
306
+ cancelFix(board: string, request: {
307
+ fixId: string;
308
+ operationId: string;
309
+ }): Promise<KanbanFixSession>;
310
+ };
311
+ records?: {
312
+ controlRecord(board: string, request: {
313
+ recordId: string;
314
+ operationId: string;
315
+ action: 'cancel';
316
+ }): Promise<void>;
317
+ };
318
+ }
319
+ /** Cancellation is explicit; drain mode only freezes future admissions and retains user settlement choices. */
320
+ declare function scanBoardStopWork(options: Options$1): Promise<void>;
321
+
322
+ /** Submission claims and definite no-start cancellation compete in the original journal transaction. */
323
+ declare function cancelTaskMaintenance(options: TaskControlPorts, journal: KanbanAutomationJournal, board: string, item: string, controlId: string): Promise<'cancelled' | 'accepted' | 'unknown'>;
324
+
325
+ /** Freeze out later delivery before reconciling an already admitted reply in its original Session. */
326
+ declare function cancelTaskReplies(options: TaskControlPorts, journal: KanbanAutomationJournal, board: string, item: string, controlId: string): Promise<'cancelled' | 'accepted' | 'unknown'>;
327
+
328
+ interface Definition {
329
+ title: string;
330
+ responsibility: string;
331
+ acceptance: string;
332
+ type: string;
333
+ dependencies: string[];
334
+ }
335
+ interface Snapshot {
336
+ proposalId: string;
337
+ messageId: string;
338
+ content: string;
339
+ definition: Definition;
340
+ digest: string;
341
+ operationId: string;
342
+ }
343
+ interface SavedFix extends KanbanFixSession {
344
+ phase: 'prepared' | 'submitting' | 'settled';
345
+ cancelOperationId?: string;
346
+ dispatch: KanbanDispatch;
347
+ item: KanbanItem;
348
+ resourceId: string;
349
+ context: unknown;
350
+ request: unknown;
351
+ snapshot?: Snapshot;
352
+ code?: string;
353
+ accepted?: boolean;
354
+ }
355
+ interface KanbanFixOptions<Instruction = unknown> {
356
+ service: KanbanClient;
357
+ journal: KanbanAutomationJournal;
358
+ executor: KanbanExecutionPort;
359
+ control: KanbanExecutionControlPort;
360
+ freeze(boardId: string, request: {
361
+ itemId: string;
362
+ operationId: string;
363
+ }): Promise<SavedFix>;
364
+ confirm(fix: SavedFix, input: Instruction): Promise<boolean>;
365
+ observe(fix: SavedFix): Promise<void>;
366
+ accept(fix: SavedFix): Promise<void>;
367
+ log(event: KanbanRuntimeDiagnostic & {
368
+ result: 'success' | 'failure';
369
+ }): void;
370
+ }
371
+
372
+ interface KanbanTaskFix<Instruction> {
373
+ fixTask(board: string, request: {
374
+ itemId: string;
375
+ operationId: string;
376
+ }): Promise<KanbanFixSession>;
377
+ taskFixes(board: string, item: string): Promise<KanbanFixSession[]>;
378
+ cancelFix(board: string, request: {
379
+ fixId: string;
380
+ operationId: string;
381
+ }): Promise<KanbanFixSession>;
382
+ intercept(session: string, input: Instruction): Promise<boolean>;
383
+ scan(): Promise<void>;
384
+ quiesce(): Promise<void>;
385
+ }
386
+ declare function createTaskFix<Instruction>(options: KanbanFixOptions<Instruction>): KanbanTaskFix<Instruction>;
387
+
388
+ interface DecisionContext {
389
+ sourceBoardId: string;
390
+ recordId: string;
391
+ recordRevision: number;
392
+ runId: string;
393
+ }
394
+ /** The host resolves business identity; execution transports receive opaque structured context. */
395
+ declare function workContext(journal: KanbanAutomationJournal, board: KanbanBoard, item: KanbanItem, references?: KanbanReferencePolicy): Promise<{
396
+ board: {
397
+ id: string;
398
+ title: string;
399
+ revision: number;
400
+ };
401
+ decision: {
402
+ snapshot?: {} | undefined;
403
+ sourceBoardId: string;
404
+ recordId: string;
405
+ recordRevision: number;
406
+ runId: string;
407
+ } | null;
408
+ task: {
409
+ id: string;
410
+ revision: number;
411
+ parentId: string | null;
412
+ title: string;
413
+ responsibility: string;
414
+ acceptance: string;
415
+ dependencies: string[];
416
+ };
417
+ resources: KanbanExternalReference[];
418
+ }>;
419
+
420
+ interface KanbanTaskReply {
421
+ itemId: string;
422
+ attemptId: string;
423
+ replyTo: string;
424
+ operationId: string;
425
+ content: string;
426
+ }
427
+ type FrozenReply<T = unknown> = T & {
428
+ phase?: 'prepared' | 'submitting' | 'cancelling' | 'cancelled';
429
+ boardId: string;
430
+ request: KanbanTaskReply;
431
+ sessionId: string;
432
+ };
433
+ interface KanbanReplyPort<T> {
434
+ prepare(input: {
435
+ boardId: string;
436
+ request: KanbanTaskReply;
437
+ item: KanbanItem;
438
+ dispatch: KanbanDispatch;
439
+ }): Promise<T & {
440
+ sessionId: string;
441
+ }>;
442
+ deliver(reply: FrozenReply<T>): Promise<void>;
443
+ }
444
+ /** The durable Session queue carries correlated user input without a workspace mailbox. */
445
+ declare function taskReplies<T>(service: KanbanClient, journal: KanbanAutomationJournal, port: KanbanReplyPort<T>): ((boardId: string, request: KanbanTaskReply) => Promise<void>) & {
446
+ scan(): Promise<void>;
447
+ };
448
+
449
+ interface KanbanRuntimeContext {
450
+ fs: IFileSystem;
451
+ store: KanbanStore;
452
+ service: KanbanActivityHandle;
453
+ journal: KanbanAutomationJournal;
454
+ workLog: KanbanWorkLog;
455
+ serviceFor(actor: KanbanActor): KanbanActivityHandle;
456
+ }
457
+ /** Extensions bind host facilities; recovery and shutdown are coordinated by the runtime. */
458
+ interface KanbanRuntimeExtension {
459
+ capabilities?: Partial<KanbanClient>;
460
+ scan?(): Promise<void>;
461
+ quiesce?(): Promise<void>;
462
+ dispose?(): Promise<void>;
463
+ }
464
+ interface KanbanRuntimeOptions extends Omit<KanbanActivityModuleOptions, 'store' | 'referenceSystem'> {
465
+ fs: IFileSystem;
466
+ directory?: string;
467
+ store?: KanbanStore;
468
+ referenceSystem?: string;
469
+ journal?: KanbanJournalOptions | KanbanAutomationJournal;
470
+ workLog?: KanbanWorkLogOptions;
471
+ resources?: KanbanResourceCatalog;
472
+ requiresItemResource?: (board: KanbanBoard) => boolean;
473
+ control?: KanbanTaskControlOptions;
474
+ automation?: Omit<KanbanAutomationOptions, 'fs' | 'directory' | 'service' | 'serviceFor' | 'journal' | 'workLog' | 'log'>;
475
+ extensions?(context: KanbanRuntimeContext): KanbanRuntimeExtension[];
476
+ createService?(options: KanbanActivityModuleOptions): KanbanActivityHandle;
477
+ }
478
+
479
+ /** One entry point owns durable coordination; the host supplies I/O and authorization. */
480
+ declare function assembleKanbanRuntime(options: KanbanRuntimeOptions): Promise<{
481
+ service: {
482
+ scan: () => Promise<void>;
483
+ quiesce: () => Promise<void>;
484
+ dispose: () => Promise<void>;
485
+ records: (board: string, query?: KanbanRecordQuery) => Promise<KanbanRecordPage>;
486
+ record: (board: string, id: string) => Promise<KanbanProjectRecord>;
487
+ automationCatalog?: (() => Promise<KanbanAutomationCatalog>) | undefined;
488
+ analysisStatus?: ((board: string, item: string) => Promise<KanbanAnalysisStatus | null>) | undefined;
489
+ recordExecutions?: ((board: string, id: string) => Promise<never[] | KanbanRecordExecution[]>) | undefined;
490
+ itemResources?: ((boardId: string, parentId?: string) => Promise<KanbanItemResourceCatalog>) | undefined;
491
+ recordResources?: (() => Promise<{
492
+ reference: KanbanExternalReference;
493
+ label: string;
494
+ }[]>) | undefined;
495
+ runRecord?: ((boardId: string, request: KanbanRecordRunRequest) => Promise<KanbanRecordExecution>) | undefined;
496
+ controlRecord?: ((boardId: string, request: {
497
+ recordId: string;
498
+ operationId: string;
499
+ action: "pause" | "resume" | "cancel";
500
+ }) => Promise<void>) | undefined;
501
+ cancelBoard?: ((boardId: string, request: {
502
+ operationId: string;
503
+ expectedRevision: number;
504
+ }) => Promise<void>) | undefined;
505
+ requestBoardDeletion?: ((boardId: string, request: KanbanDeletionRequest & {
506
+ mode: "drain" | "cancel";
507
+ }) => Promise<void>) | undefined;
508
+ previewDeletion?: ((boardId: string) => Promise<KanbanDeletionPreview>) | undefined;
509
+ deleteBoard?: ((boardId: string, request: KanbanDeletionRequest) => Promise<void>) | undefined;
510
+ itemOperations?: ((boardId: string, itemId: string) => Promise<KanbanItemOperations>) | undefined;
511
+ runItemOperation?: ((boardId: string, request: KanbanItemOperationRequest) => Promise<KanbanItemOperations>) | undefined;
512
+ bindItemOperation?: ((boardId: string, request: KanbanItemOperationBinding) => Promise<KanbanItemOperations>) | undefined;
513
+ workResources?: ((boardId: string, itemId: string, query?: KanbanWorkResourceQuery) => Promise<KanbanWorkResource[]>) | undefined;
514
+ cleanupWorkResource?: ((boardId: string, request: KanbanWorkResourceCleanup) => Promise<KanbanWorkResource>) | undefined;
515
+ replyTask?: ((boardId: string, request: {
516
+ itemId: string;
517
+ attemptId: string;
518
+ replyTo: string;
519
+ operationId: string;
520
+ content: string;
521
+ }) => Promise<void>) | undefined;
522
+ taskFixes?: ((boardId: string, itemId: string) => Promise<KanbanFixSession[]>) | undefined;
523
+ cancelFix?: ((boardId: string, request: {
524
+ fixId: string;
525
+ operationId: string;
526
+ }) => Promise<KanbanFixSession>) | undefined;
527
+ fixTask?: ((boardId: string, request: {
528
+ itemId: string;
529
+ operationId: string;
530
+ }) => Promise<KanbanFixSession>) | undefined;
531
+ queryActivity: (boardId: string, query?: KanbanSessionActivityQuery) => Promise<KanbanSessionItemPage>;
532
+ executionSession: (boardId: string, itemId: string, query?: KanbanSessionDetailQuery) => Promise<KanbanExecutionSessionDetail>;
533
+ workflow: (boardId: string) => Promise<KanbanWorkflowState>;
534
+ resolve: (reference: string) => Promise<KanbanReferenceTarget>;
535
+ suggest: (boardId: string, query: KanbanSuggestionQuery) => Promise<KanbanSuggestionPage>;
536
+ currentPrincipal: () => Promise<KanbanPrincipal>;
537
+ create: (board: KanbanBoardInput) => Promise<KanbanBoard>;
538
+ read: (boardId: string) => Promise<KanbanBoard>;
539
+ list: () => Promise<KanbanBoard[]>;
540
+ catalog: () => Promise<KanbanBoardSummary[]>;
541
+ execute: (boardId: string, request: KanbanRequest) => Promise<KanbanBoard>;
542
+ events: (boardId: string, afterSequence?: number, limit?: number) => Promise<KanbanEvent[]>;
543
+ related: (sessionId: string) => Promise<KanbanBoard[]>;
544
+ query: (boardId: string, query?: KanbanItemQuery) => Promise<KanbanItemPage>;
545
+ item: (boardId: string, itemId: string) => Promise<{
546
+ item: KanbanItem;
547
+ task?: KanbanTaskProjection;
548
+ archive?: Omit<KanbanArchivedItem, "item">;
549
+ }>;
550
+ overview: (boardId: string) => Promise<KanbanOverview>;
551
+ } & Pick<{
552
+ previewDeletion: (id: string) => Promise<KanbanDeletionPreview>;
553
+ assertSettled: (id: string) => Promise<void>;
554
+ deleteBoard: (id: string, request: KanbanDeletionRequest) => Promise<void>;
555
+ cancelBoard: (board: string, request: {
556
+ operationId: string;
557
+ expectedRevision: number;
558
+ }) => Promise<void>;
559
+ requestBoardDeletion: (board: string, request: KanbanDeletionRequest & {
560
+ mode: "drain" | "cancel";
561
+ }) => Promise<void>;
562
+ preparePending: () => Promise<void>;
563
+ resumePending: () => Promise<void>;
564
+ }, "previewDeletion" | "deleteBoard">;
565
+ fs: _nestos_vfs_core.IFileSystem;
566
+ store: KanbanStore;
567
+ journal: KanbanAutomationJournal;
568
+ workLog: KanbanWorkLog;
569
+ serviceFor(actor: KanbanActor): KanbanActivityHandle;
570
+ }>;
571
+
572
+ /** Transport-neutral durable execution data. Requests and results belong to the adapter. */
573
+ interface KanbanOperationRecord {
574
+ id: string;
575
+ boardId: string;
576
+ itemId: string;
577
+ action: string;
578
+ fingerprint: string;
579
+ phase: 'prepared' | 'submitting' | 'settled';
580
+ state: 'running' | 'unknown' | 'succeeded' | 'failed';
581
+ createdAt: number;
582
+ sessionId?: string;
583
+ code?: string;
584
+ result?: unknown;
585
+ }
586
+ interface KanbanOperationObservation {
587
+ state: 'running' | 'unknown' | 'succeeded' | 'failed';
588
+ executionId?: string;
589
+ code?: string;
590
+ output?: unknown;
591
+ }
592
+ /** Only an authoritative no-start receipt permits submitting the frozen request again. */
593
+ interface KanbanOperationFailure {
594
+ code: string;
595
+ disposition: 'retry-unstarted' | 'terminal' | 'unknown';
596
+ result?: unknown;
597
+ }
598
+ interface KanbanOperationPort<T extends KanbanOperationRecord> {
599
+ start(record: T): Promise<void>;
600
+ inspect(record: T): Promise<KanbanOperationObservation>;
601
+ validate?(record: T, output: unknown): Promise<void> | void;
602
+ classify?(error: unknown): KanbanOperationFailure;
603
+ report?(record: T): Promise<void>;
604
+ }
605
+
606
+ interface Options<T extends KanbanOperationRecord> {
607
+ service: Pick<KanbanClient, 'read'>;
608
+ journal: KanbanAutomationJournal;
609
+ key: string;
610
+ record: T;
611
+ port: KanbanOperationPort<T>;
612
+ }
613
+ /** A frozen record crosses the submission boundary once; response loss only triggers inspection. */
614
+ declare function coordinateOperation<T extends KanbanOperationRecord>(options: Options<T>): Promise<T>;
615
+
616
+ interface KanbanFixPreparation {
617
+ resourceId: string;
618
+ context: unknown;
619
+ }
620
+ declare class KanbanCollaboration {
621
+ private readonly service;
622
+ private readonly journal;
623
+ constructor(service: KanbanClient, journal: KanbanAutomationJournal);
624
+ prepareFix(boardId: string, request: {
625
+ itemId: string;
626
+ operationId: string;
627
+ }, prepare: (input: {
628
+ id: string;
629
+ board: KanbanBoard;
630
+ item: KanbanItem;
631
+ }) => Promise<KanbanFixPreparation>): Promise<SavedFix>;
632
+ fix(id: string): Promise<SavedFix>;
633
+ confirmFix(id: string, snapshot: Snapshot): Promise<SavedFix>;
634
+ acceptFix(id: string, policy: {
635
+ kind: string;
636
+ inheritSystems: string[];
637
+ }, deliver: (fix: SavedFix) => Promise<void>): Promise<void>;
638
+ private publishFix;
639
+ decisionSnapshot(identity: {
640
+ sourceBoardId: string;
641
+ recordId: string;
642
+ recordRevision: number;
643
+ runId: string;
644
+ }): Promise<KanbanProjectRecord>;
645
+ }
646
+ /** Adapter requests remain opaque; relation projection does not expose journal layouts. */
647
+ declare function collaborationRelations<Input = unknown>(journal: KanbanAutomationJournal, boardId: string, itemId: string): Promise<{
648
+ planning: {
649
+ id: string;
650
+ request: Input;
651
+ }[];
652
+ replies: {
653
+ operationId: string;
654
+ executionId: string;
655
+ }[];
656
+ }>;
657
+
658
+ export { type AnalysisJournalEntry, type AnalysisResult, type AnalysisSubtask, type DecisionContext, type Definition, type FrozenReply, type KanbanAnalysisObservation, type KanbanAnalysisOptions, type KanbanAnalysisPort, KanbanAutomationJournal, type KanbanAutomationOptions, KanbanCollaboration, type KanbanControlRequest, type KanbanControlState, type KanbanExecutionControlPort, type KanbanExecutorContext, type KanbanFixOptions, type KanbanFixPreparation, KanbanJournalOptions, type KanbanOperationFailure, type KanbanOperationObservation, type KanbanOperationPort, type KanbanOperationRecord, KanbanReferencePolicy, type KanbanReplyPort, KanbanResourceCatalog, type KanbanRuntimeContext, KanbanRuntimeDiagnostic, type KanbanRuntimeExtension, type KanbanRuntimeOptions, type KanbanTaskControlOptions, type KanbanTaskFix, type KanbanTaskReply, KanbanWorkLog, KanbanWorkLogOptions, type RecordControl, type SavedFix, type Snapshot, type TaskControlPorts, type WorkLogFact, adoptDecomposition, advanceRecordControl, analysisHistory, analysisSignature, analysisStatus, analyzeItem, assembleKanbanRuntime, boardDeletionBlockers, cancelTaskMaintenance, cancelTaskReplies, collaborationRelations, completeCompositePlans, coordinateOperation, createBoardDeletion, createKanbanAutomation, createRecordExecution, createTaskFix, deletionPreview, dependencyResults, drainBoardAnalyses, journalCommand, parseAnalysis, recordControlKey, requestRecordControl, safeCode, scanBoardStopWork, scanTaskControls, taskReplies, validateResourceReferences, validateSubtasks, withBoardDeletion, workContext };