@agimon-ai/po-task 0.0.0-alpha.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.
Files changed (161) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +131 -0
  3. package/dist/apiContracts.cjs +54 -0
  4. package/dist/apiContracts.cjs.map +1 -0
  5. package/dist/apiContracts.d.mts +53 -0
  6. package/dist/apiContracts.d.mts.map +1 -0
  7. package/dist/apiContracts.mjs +49 -0
  8. package/dist/apiContracts.mjs.map +1 -0
  9. package/dist/config-CFSs3iku.mjs +72 -0
  10. package/dist/config-CFSs3iku.mjs.map +1 -0
  11. package/dist/config-CdX-Bv8q.cjs +173 -0
  12. package/dist/config-CdX-Bv8q.cjs.map +1 -0
  13. package/dist/config.cjs +19 -0
  14. package/dist/config.d.mts +2 -0
  15. package/dist/config.mjs +2 -0
  16. package/dist/delegation-BiOy3_7g.mjs +7 -0
  17. package/dist/delegation-BiOy3_7g.mjs.map +1 -0
  18. package/dist/delegation-CdMqOZB4.mjs +626 -0
  19. package/dist/delegation-CdMqOZB4.mjs.map +1 -0
  20. package/dist/delegation-DsnKjMbJ.cjs +661 -0
  21. package/dist/delegation-DsnKjMbJ.cjs.map +1 -0
  22. package/dist/delegation-LDpHP2CC.cjs +12 -0
  23. package/dist/delegation-LDpHP2CC.cjs.map +1 -0
  24. package/dist/delegationManager.cjs +10 -0
  25. package/dist/delegationManager.d.mts +2 -0
  26. package/dist/delegationManager.mjs +3 -0
  27. package/dist/extensions/mcp-ui.mjs +23 -0
  28. package/dist/extensions/mcp-ui.mjs.map +1 -0
  29. package/dist/extensions/mcp.cjs +1144 -0
  30. package/dist/extensions/mcp.cjs.map +1 -0
  31. package/dist/extensions/mcp.d.mts +5 -0
  32. package/dist/extensions/mcp.d.mts.map +1 -0
  33. package/dist/extensions/mcp.mjs +1115 -0
  34. package/dist/extensions/mcp.mjs.map +1 -0
  35. package/dist/extensions/native.mjs +1175 -0
  36. package/dist/extensions/native.mjs.map +1 -0
  37. package/dist/extensions/server.cjs +569 -0
  38. package/dist/extensions/server.cjs.map +1 -0
  39. package/dist/extensions/server.d.mts +5 -0
  40. package/dist/extensions/server.d.mts.map +1 -0
  41. package/dist/extensions/server.mjs +563 -0
  42. package/dist/extensions/server.mjs.map +1 -0
  43. package/dist/extensions/web.mjs +1018 -0
  44. package/dist/extensions/web.mjs.map +1 -0
  45. package/dist/index-B-3sCF2S.d.mts +43 -0
  46. package/dist/index-B-3sCF2S.d.mts.map +1 -0
  47. package/dist/index-B1JPJdpZ.d.mts +51 -0
  48. package/dist/index-B1JPJdpZ.d.mts.map +1 -0
  49. package/dist/index-CUWCvh-E.d.mts +72 -0
  50. package/dist/index-CUWCvh-E.d.mts.map +1 -0
  51. package/dist/index-DlmXKyhQ.d.mts +34 -0
  52. package/dist/index-DlmXKyhQ.d.mts.map +1 -0
  53. package/dist/index-Dvb8X_qB.d.mts +67 -0
  54. package/dist/index-Dvb8X_qB.d.mts.map +1 -0
  55. package/dist/index-XY9VPmfm.d.mts +26 -0
  56. package/dist/index-XY9VPmfm.d.mts.map +1 -0
  57. package/dist/index-teIf67qQ.d.mts +196 -0
  58. package/dist/index-teIf67qQ.d.mts.map +1 -0
  59. package/dist/index.cjs +93 -0
  60. package/dist/index.d.mts +11 -0
  61. package/dist/index.mjs +12 -0
  62. package/dist/invariants-DhjEjBPU.cjs +79 -0
  63. package/dist/invariants-DhjEjBPU.cjs.map +1 -0
  64. package/dist/invariants-q_UamF7D.mjs +62 -0
  65. package/dist/invariants-q_UamF7D.mjs.map +1 -0
  66. package/dist/logSinkTelemetry-B23qGiP-.cjs +52 -0
  67. package/dist/logSinkTelemetry-B23qGiP-.cjs.map +1 -0
  68. package/dist/logSinkTelemetry-BMBsC54p.mjs +41 -0
  69. package/dist/logSinkTelemetry-BMBsC54p.mjs.map +1 -0
  70. package/dist/logSinkTelemetry.cjs +6 -0
  71. package/dist/logSinkTelemetry.d.mts +23 -0
  72. package/dist/logSinkTelemetry.d.mts.map +1 -0
  73. package/dist/logSinkTelemetry.mjs +3 -0
  74. package/dist/paths-CSya2l9_.cjs +308 -0
  75. package/dist/paths-CSya2l9_.cjs.map +1 -0
  76. package/dist/paths-Cah1vFGv.mjs +207 -0
  77. package/dist/paths-Cah1vFGv.mjs.map +1 -0
  78. package/dist/processLiveness-Ccd9wenT.mjs +20 -0
  79. package/dist/processLiveness-Ccd9wenT.mjs.map +1 -0
  80. package/dist/processLiveness-umpNgsPR.cjs +25 -0
  81. package/dist/processLiveness-umpNgsPR.cjs.map +1 -0
  82. package/dist/reconcile-BcD-hTbd.mjs +63 -0
  83. package/dist/reconcile-BcD-hTbd.mjs.map +1 -0
  84. package/dist/reconcile-cRL0NjDr.cjs +80 -0
  85. package/dist/reconcile-cRL0NjDr.cjs.map +1 -0
  86. package/dist/reducer-BEfJFM5L.mjs +345 -0
  87. package/dist/reducer-BEfJFM5L.mjs.map +1 -0
  88. package/dist/reducer-BV0YIZ2o.cjs +380 -0
  89. package/dist/reducer-BV0YIZ2o.cjs.map +1 -0
  90. package/dist/storeInvariants.cjs +5 -0
  91. package/dist/storeInvariants.d.mts +23 -0
  92. package/dist/storeInvariants.d.mts.map +1 -0
  93. package/dist/storeInvariants.mjs +2 -0
  94. package/dist/storePaths.cjs +14 -0
  95. package/dist/storePaths.d.mts +2 -0
  96. package/dist/storePaths.mjs +2 -0
  97. package/dist/storeProcessLiveness.cjs +3 -0
  98. package/dist/storeProcessLiveness.d.mts +11 -0
  99. package/dist/storeProcessLiveness.d.mts.map +1 -0
  100. package/dist/storeProcessLiveness.mjs +2 -0
  101. package/dist/storeReconcile.cjs +5 -0
  102. package/dist/storeReconcile.d.mts +2 -0
  103. package/dist/storeReconcile.mjs +2 -0
  104. package/dist/storeReducer.cjs +8 -0
  105. package/dist/storeReducer.d.mts +2 -0
  106. package/dist/storeReducer.mjs +2 -0
  107. package/dist/storeTaskGraph.cjs +7 -0
  108. package/dist/storeTaskGraph.d.mts +2 -0
  109. package/dist/storeTaskGraph.mjs +2 -0
  110. package/dist/storeTaskStore.cjs +3 -0
  111. package/dist/storeTaskStore.d.mts +2 -0
  112. package/dist/storeTaskStore.mjs +2 -0
  113. package/dist/storeTypes.cjs +6 -0
  114. package/dist/storeTypes.d.mts +2 -0
  115. package/dist/storeTypes.mjs +2 -0
  116. package/dist/task-CXF9VULl.cjs +49 -0
  117. package/dist/task-CXF9VULl.cjs.map +1 -0
  118. package/dist/task-DJpTteeJ.d.mts +187 -0
  119. package/dist/task-DJpTteeJ.d.mts.map +1 -0
  120. package/dist/task-DO0TwZ0z.mjs +132 -0
  121. package/dist/task-DO0TwZ0z.mjs.map +1 -0
  122. package/dist/task-Dhta7JyA.d.mts +126 -0
  123. package/dist/task-Dhta7JyA.d.mts.map +1 -0
  124. package/dist/task-UvW877Ez.cjs +227 -0
  125. package/dist/task-UvW877Ez.cjs.map +1 -0
  126. package/dist/task-giCbpKzV.mjs +26 -0
  127. package/dist/task-giCbpKzV.mjs.map +1 -0
  128. package/dist/taskGraph-BOQvT0-M.mjs +63 -0
  129. package/dist/taskGraph-BOQvT0-M.mjs.map +1 -0
  130. package/dist/taskGraph-BskRslrr.cjs +92 -0
  131. package/dist/taskGraph-BskRslrr.cjs.map +1 -0
  132. package/dist/taskGraph-D0zFHF2p.d.mts +25 -0
  133. package/dist/taskGraph-D0zFHF2p.d.mts.map +1 -0
  134. package/dist/taskResult-D2G7b4w-.cjs +224 -0
  135. package/dist/taskResult-D2G7b4w-.cjs.map +1 -0
  136. package/dist/taskResult-edBAAKSH.mjs +165 -0
  137. package/dist/taskResult-edBAAKSH.mjs.map +1 -0
  138. package/dist/taskStore-DjU60rMm.cjs +215 -0
  139. package/dist/taskStore-DjU60rMm.cjs.map +1 -0
  140. package/dist/taskStore-pAJ971Ml.mjs +208 -0
  141. package/dist/taskStore-pAJ971Ml.mjs.map +1 -0
  142. package/dist/telemetry-Ca0I3Tqo.cjs +30 -0
  143. package/dist/telemetry-Ca0I3Tqo.cjs.map +1 -0
  144. package/dist/telemetry-DyS44zAD.mjs +25 -0
  145. package/dist/telemetry-DyS44zAD.mjs.map +1 -0
  146. package/dist/telemetry-FMGRovb4.d.mts +35 -0
  147. package/dist/telemetry-FMGRovb4.d.mts.map +1 -0
  148. package/dist/toolPromptGuidelines.cjs +27 -0
  149. package/dist/toolPromptGuidelines.cjs.map +1 -0
  150. package/dist/toolPromptGuidelines.d.mts +13 -0
  151. package/dist/toolPromptGuidelines.d.mts.map +1 -0
  152. package/dist/toolPromptGuidelines.mjs +26 -0
  153. package/dist/toolPromptGuidelines.mjs.map +1 -0
  154. package/dist/toolResponseEnvelope.cjs +12 -0
  155. package/dist/toolResponseEnvelope.d.mts +2 -0
  156. package/dist/toolResponseEnvelope.mjs +2 -0
  157. package/dist/toolSchema.cjs +18 -0
  158. package/dist/toolSchema.d.mts +2 -0
  159. package/dist/toolSchema.mjs +2 -0
  160. package/package.json +223 -0
  161. package/src/types/webTasks.ts +24 -0
@@ -0,0 +1,196 @@
1
+ import { o as TaskFailureReporter } from "./telemetry-FMGRovb4.mjs";
2
+ import { s as Task } from "./task-DJpTteeJ.mjs";
3
+ import { t as TaskStore } from "./index-Dvb8X_qB.mjs";
4
+ import { DoomDelegationService, InlineAgent } from "@agimon-ai/po-core/delegation";
5
+ import { Context } from "@deepseek-ai/cordis";
6
+ //#region src/types/delegation.d.ts
7
+ /** Most context files carried in a delegation brief. */
8
+ declare const MAX_BRIEF_FILES = 12;
9
+ //#endregion
10
+ //#region src/services/delegation/index.d.ts
11
+ declare const NOTIFY_CUSTOM_TYPE = "doom-task-notify";
12
+ declare const BACKGROUND_WORK_PROVIDER = "doom-task";
13
+ declare const ERR_NO_RUNTIME = "No subagent runtime responded. Delegation needs the subagents extension — relaunch po with agents enabled.";
14
+ declare const ERR_CHILD_SESSION = "assign is only available in the main session. Update this task directly instead of re-delegating it.";
15
+ declare const ERR_CANCEL_UNACKNOWLEDGED = "Subagent did not acknowledge the cancel request";
16
+ /** Live progress from a running subagent. Kept in memory: persisting per-tool
17
+ * ticks would rewrite the store file every second for no durable benefit. */
18
+ interface DelegationProgress {
19
+ agent: string;
20
+ currentTool?: string;
21
+ toolCount?: number;
22
+ tokens?: number;
23
+ /** Latest child-runtime duration baseline, excluding assignment wait. */
24
+ durationMs?: number;
25
+ /** Wall-clock time at which durationMs was observed or rebased. */
26
+ durationObservedAt?: number;
27
+ /** Assign-time context-pack shape, carried so the completion event can be
28
+ * grouped by it without joining back to the assignment event. */
29
+ contextFileCount?: number;
30
+ contextNotesLength?: number;
31
+ }
32
+ type DelegationNotifier = (message: {
33
+ customType: string;
34
+ content: string;
35
+ display: boolean;
36
+ }, options?: {
37
+ triggerTurn?: boolean;
38
+ deliverAs?: 'steer' | 'followUp' | 'nextTurn';
39
+ }) => void;
40
+ interface DelegationPlatform {
41
+ readonly environment: Readonly<Record<string, string | undefined>>;
42
+ readonly processId: number;
43
+ readonly createRequestId: () => string;
44
+ readonly formatBriefPath: (entry: string, cwd: string) => string;
45
+ }
46
+ interface DelegationManagerOptions {
47
+ store: TaskStore;
48
+ cwd: string;
49
+ platform: DelegationPlatform;
50
+ notify?: DelegationNotifier;
51
+ getSessionId?: () => string | undefined;
52
+ onChange?: () => void;
53
+ startedTimeoutMs?: number;
54
+ /** How long a started run may go without reporting a result. */
55
+ runTimeoutMs?: number;
56
+ /** How long to wait for a cancelled run to report back before forcing it. */
57
+ cancelTimeoutMs?: number;
58
+ now?: () => string;
59
+ nowMs?: () => number;
60
+ /** Called when a completion notification could not be delivered. */
61
+ onNotifyError: (error: unknown, taskId: number) => void;
62
+ /** Where other swallowed delegation failures go. */
63
+ report?: TaskFailureReporter;
64
+ }
65
+ interface AssignOptions {
66
+ agent?: string;
67
+ inlineAgent?: InlineAgent;
68
+ instructions?: string;
69
+ /** Paths the parent already located, rendered into the brief so the child
70
+ * skips rediscovering them. */
71
+ relevantFiles?: string[];
72
+ /** Facts the parent already established, rendered into the brief so the child
73
+ * does not re-derive them. */
74
+ priorFindings?: string;
75
+ model?: string;
76
+ context?: 'fresh' | 'fork';
77
+ signal?: AbortSignal;
78
+ }
79
+ interface DelegationOutcome {
80
+ ok: boolean;
81
+ message: string;
82
+ }
83
+ /**
84
+ * Owns the lifecycle of tasks delegated to subagents.
85
+ *
86
+ * Delegation rides Team's injected Cordis service rather than spawning
87
+ * processes directly, so doom-task stays decoupled from the subagent runtime
88
+ * and degrades to a clear error when that service is not loaded.
89
+ *
90
+ * Liveness rule: every entry in `pendingTasks` has a timer armed against it, so
91
+ * a delegation always has a deadline no matter which phase it is in. Losing
92
+ * that pairing is what previously left tasks running forever.
93
+ */
94
+ declare class DelegationManager {
95
+ private readonly options;
96
+ private readonly progress;
97
+ private readonly pendingTasks;
98
+ private readonly settlingRequests;
99
+ private readonly timers;
100
+ private readonly subscriptions;
101
+ private service;
102
+ constructor(options: DelegationManagerOptions);
103
+ setCwd(cwd: string): void;
104
+ private now;
105
+ private nowMs;
106
+ private get runTimeoutMs();
107
+ private report;
108
+ /** True in a session that is itself a subagent child. */
109
+ get isChildSession(): boolean;
110
+ /** Live progress for a task, for the overlay to render. */
111
+ progressFor(task: Task): DelegationProgress | undefined;
112
+ /** Displayed runtime duration, rebased from the latest child observation. */
113
+ static elapsedMs(progress: DelegationProgress, nowMs?: number): number;
114
+ /** Rebind to the active Team service without stacking lifecycle listeners. */
115
+ bind(ctx: Context, service: DoomDelegationService): () => void;
116
+ /** Remove only the cross-package binding; task state and watchdogs remain live. */
117
+ unbind(): void;
118
+ /** Items still in flight, surfaced so auto-stop will not kill the harness. */
119
+ listActiveWork(): Array<{
120
+ id: string;
121
+ sessionId: string;
122
+ }>;
123
+ /**
124
+ * Return tasks nothing can finish to `pending`.
125
+ *
126
+ * The live request set is read inside the mutation so a delegation assigned
127
+ * while the lock was contended is not mistaken for a leftover.
128
+ */
129
+ reconcile(isCurrent?: () => boolean): Promise<Task[]>;
130
+ assign(taskId: number, options: AssignOptions): Promise<DelegationOutcome>;
131
+ cancel(taskId: number): Promise<DelegationOutcome>;
132
+ /** Settle without awaiting, reporting rather than dropping a failure. */
133
+ private settleDetached;
134
+ /**
135
+ * Fail a delegation that nobody acknowledged.
136
+ *
137
+ * Provider loss or a stalled Team runtime can still leave a dispatched
138
+ * request silent. Without this acknowledgement deadline the task would sit
139
+ * in `requested` forever.
140
+ */
141
+ private armStartedTimeout;
142
+ /**
143
+ * Bound a run that already started.
144
+ *
145
+ * The request carries the same budget, so in the normal case the runtime ends
146
+ * the run itself and reports a richer result. The grace period biases toward
147
+ * that answer; this timer only covers a runtime that goes silent, which is
148
+ * precisely the case where no response event will ever arrive.
149
+ */
150
+ private armRunTimeout;
151
+ /**
152
+ * Guarantee a cancel reaches a terminal state.
153
+ *
154
+ * Calling the service is a request, not an outcome: a runtime that has
155
+ * already forgotten the request answers nothing at all. The window still
156
+ * favours a real response, which carries the run's partial output.
157
+ */
158
+ private armCancelTimeout;
159
+ private armTimer;
160
+ private clearTimer;
161
+ /** Runtime acknowledgement moves the request off the short extension-presence watchdog while launch is in flight. */
162
+ private handleAccepted;
163
+ private handleStarted;
164
+ private handleUpdate;
165
+ private handleResponse;
166
+ /**
167
+ * Apply the terminal state of a delegation and tell the model about it.
168
+ *
169
+ * A cancelled run returns the task to `pending` (the work is still wanted,
170
+ * just not by that agent); a failure marks it `failed` so it stays visible
171
+ * rather than silently rejoining the backlog.
172
+ *
173
+ * The request is claimed in `settlingRequests` while it remains published as
174
+ * active work. It is removed only after the terminal state and model notification
175
+ * have been handed off, so an auto-stop observer cannot end the session between
176
+ * receiving the result and delivering it to the model.
177
+ */
178
+ private settle;
179
+ private notifyModel;
180
+ /**
181
+ * Rewrite the task carrying `requestId`, returning the updated task as the mutation value.
182
+ *
183
+ * Terminal delegations are left alone. The document here is the freshest one,
184
+ * read under the store lock, which is the only place the check is meaningful:
185
+ * a `started` event can land after a cancel already settled the run, and
186
+ * without this guard its write would resurrect a delegation that nothing is
187
+ * tracking any more.
188
+ */
189
+ private patchDelegation;
190
+ dispose(): void;
191
+ /** Clear one Pi session's transient delegation state without losing service injection. */
192
+ reset(): void;
193
+ }
194
+ //#endregion
195
+ export { DelegationNotifier as a, DelegationProgress as c, ERR_NO_RUNTIME as d, NOTIFY_CUSTOM_TYPE as f, DelegationManagerOptions as i, ERR_CANCEL_UNACKNOWLEDGED as l, BACKGROUND_WORK_PROVIDER as n, DelegationOutcome as o, MAX_BRIEF_FILES as p, DelegationManager as r, DelegationPlatform as s, AssignOptions as t, ERR_CHILD_SESSION as u };
196
+ //# sourceMappingURL=index-teIf67qQ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-teIf67qQ.d.mts","names":[],"sources":["../src/types/delegation.ts","../src/services/delegation/index.ts"],"mappings":";;;;;;;cACa;;;cCsBA;cACA;cAkCA;cAEA;cAEA;;;UAII;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;;EAGA;EACA;;KAGU,sBACV;EAAW;EAAoB;EAAiB;GAChD;EAAY;EAAuB;;UAGpB;WACN,aAAa,SAAS;WACtB;WACA;WACA,kBAAkB,eAAe;;UAG3B;EACf,OAAO;EACP;EACA,UAAU;EACV,SAAS;EACT;EACA;EACA;;EAEA;;EAEA;EACA;EACA;;EAEA,gBAAgB,gBAAgB;;EAEhC,SAAS;;UAGM;EACf;EACA,cAAc;EACd;;;EAGA;;;EAGA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;;;;;;;;;;;;;cAuFW;mBACM;mBACA;mBACA;mBACA;mBACA;mBACA;UACT;EAER,YAAY,SAAS;EAIrB,OAAO;UAIC;UAIA;cAII;UAIJ;;MAKJ;;EAKJ,YAAY,MAAM,OAAO;;SAMlB,UAAU,UAAU,oBAAoB;;EAO/C,KAAK,KAAK,SAAS,SAAS;;EAyB5B;;EAMA,kBAAkB;IAAQ;IAAY;;;;;;;;EAYhC,UAAU,4BAAwC,QAAQ;EAwB1D,OAAO,gBAAgB,SAAS,gBAAgB,QAAQ;EAkHxD,OAAO,iBAAiB,QAAQ;;UAiB9B;;;;;;;;UAkBA;;;;;;;;;UAcA;;;;;;;;UAuBA;UAUA;UAOA;;UAOA;UAKA;UAoCA;UAsBM;;;;;;;;;;;;;UA4BA;UAwDN;;;;;;;;;;UAmDA;EAkBR;;EAMA"}
package/dist/index.cjs ADDED
@@ -0,0 +1,93 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_paths = require("./paths-CSya2l9_.cjs");
3
+ const require_config = require("./config-CdX-Bv8q.cjs");
4
+ const require_taskGraph = require("./taskGraph-BskRslrr.cjs");
5
+ const require_delegation = require("./delegation-LDpHP2CC.cjs");
6
+ const require_task = require("./task-CXF9VULl.cjs");
7
+ const require_reconcile = require("./reconcile-cRL0NjDr.cjs");
8
+ const require_delegation$1 = require("./delegation-DsnKjMbJ.cjs");
9
+ const require_taskResult = require("./taskResult-D2G7b4w-.cjs");
10
+ const require_task$1 = require("./task-UvW877Ez.cjs");
11
+ const require_reducer = require("./reducer-BV0YIZ2o.cjs");
12
+ const require_taskStore = require("./taskStore-DjU60rMm.cjs");
13
+ exports.BACKGROUND_WORK_PROVIDER = require_delegation$1.BACKGROUND_WORK_PROVIDER;
14
+ exports.COLLAPSE_KEY_ENV = require_config.COLLAPSE_KEY_ENV;
15
+ exports.COLLAPSE_KEY_OFF = require_config.COLLAPSE_KEY_OFF;
16
+ exports.COMMAND_NAME = require_task$1.COMMAND_NAME;
17
+ exports.DEFAULT_COLLAPSE_KEY = require_config.DEFAULT_COLLAPSE_KEY;
18
+ exports.DEFAULT_DELEGATION_TIMEOUT_MS = require_config.DEFAULT_DELEGATION_TIMEOUT_MS;
19
+ exports.DEFAULT_MAX_TASKS = require_config.DEFAULT_MAX_TASKS;
20
+ exports.DEFAULT_MAX_WIDGET_LINES = require_config.DEFAULT_MAX_WIDGET_LINES;
21
+ exports.DEFAULT_STORE_TTL_MS = require_config.DEFAULT_STORE_TTL_MS;
22
+ exports.DELEGATION_TIMEOUT_MS_ENV = require_config.DELEGATION_TIMEOUT_MS_ENV;
23
+ exports.DELETED_STATUS = require_task.DELETED_STATUS;
24
+ exports.DelegationManager = require_delegation$1.DelegationManager;
25
+ exports.ERR_CANCEL_UNACKNOWLEDGED = require_delegation$1.ERR_CANCEL_UNACKNOWLEDGED;
26
+ exports.ERR_CHILD_SESSION = require_delegation$1.ERR_CHILD_SESSION;
27
+ exports.ERR_NO_RUNTIME = require_delegation$1.ERR_NO_RUNTIME;
28
+ exports.ERR_ORPHANED_BY_RESTART = require_reconcile.ERR_ORPHANED_BY_RESTART;
29
+ exports.ERR_ORPHANED_BY_SESSION = require_reconcile.ERR_ORPHANED_BY_SESSION;
30
+ exports.ERR_REQUIRES_INTERACTIVE = require_task$1.ERR_REQUIRES_INTERACTIVE;
31
+ exports.MAX_BRIEF_FILES = require_delegation.MAX_BRIEF_FILES;
32
+ exports.MAX_TASKS_ENV = require_config.MAX_TASKS_ENV;
33
+ exports.MAX_UPSERT_ITEMS = require_reducer.MAX_UPSERT_ITEMS;
34
+ exports.MAX_WIDGET_LINES_ENV = require_config.MAX_WIDGET_LINES_ENV;
35
+ exports.MSG_ALL_COMPLETE_CLEAR = require_taskResult.MSG_ALL_COMPLETE_CLEAR;
36
+ exports.MSG_ASSIGN_PARTIAL = require_taskResult.MSG_ASSIGN_PARTIAL;
37
+ exports.MSG_NO_TASKS = require_task$1.MSG_NO_TASKS;
38
+ exports.MSG_UPSERT_FIELD_MISPLACED = require_task$1.MSG_UPSERT_FIELD_MISPLACED;
39
+ exports.MSG_UPSERT_NONE_APPLIED = require_taskResult.MSG_UPSERT_NONE_APPLIED;
40
+ exports.MSG_UPSERT_PARTIAL = require_taskResult.MSG_UPSERT_PARTIAL;
41
+ exports.NOTIFY_CUSTOM_TYPE = require_delegation$1.NOTIFY_CUSTOM_TYPE;
42
+ exports.REF_PATTERN = require_reducer.REF_PATTERN;
43
+ exports.REMOTE_TASK_ACTIONS = require_task$1.REMOTE_TASK_ACTIONS;
44
+ exports.RemoteTaskParamsSchema = require_task$1.RemoteTaskParamsSchema;
45
+ exports.STORE_PATH_ENV = require_paths.STORE_PATH_ENV;
46
+ exports.STORE_SCHEMA_VERSION = require_task.STORE_SCHEMA_VERSION;
47
+ exports.STORE_TTL_MS_ENV = require_config.STORE_TTL_MS_ENV;
48
+ exports.TASK_ACTIONS = require_task$1.TASK_ACTIONS;
49
+ exports.TASK_ACTION_FIELDS = require_task$1.TASK_ACTION_FIELDS;
50
+ exports.TASK_CONTEXTS = require_task$1.TASK_CONTEXTS;
51
+ exports.TASK_STATUSES = require_task$1.TASK_STATUSES;
52
+ exports.TOOL_LABEL = require_task$1.TOOL_LABEL;
53
+ exports.TOOL_NAME = require_task$1.TOOL_NAME;
54
+ exports.TaskAssignmentSchema = require_task$1.TaskAssignmentSchema;
55
+ exports.TaskItemSchema = require_task$1.TaskItemSchema;
56
+ exports.TaskParamsSchema = require_task$1.TaskParamsSchema;
57
+ exports.TaskStore = require_taskStore.TaskStore;
58
+ exports.applyTaskMutation = require_reducer.applyTaskMutation;
59
+ exports.buildAssignmentResult = require_taskResult.buildAssignmentResult;
60
+ exports.buildTextResult = require_taskResult.buildTextResult;
61
+ exports.buildToolResult = require_taskResult.buildToolResult;
62
+ exports.deriveBlocks = require_taskGraph.deriveBlocks;
63
+ exports.detectCycle = require_taskGraph.detectCycle;
64
+ exports.emptyDocument = require_task.emptyDocument;
65
+ exports.formatAssignmentResults = require_taskResult.formatAssignmentResults;
66
+ exports.formatContent = require_taskResult.formatContent;
67
+ exports.formatUpsertFailure = require_reducer.formatUpsertFailure;
68
+ exports.formatUpsertFailureText = require_taskResult.formatUpsertFailureText;
69
+ exports.getDelegationTimeoutMs = require_config.getDelegationTimeoutMs;
70
+ exports.getMaxTasks = require_config.getMaxTasks;
71
+ exports.getMaxWidgetLines = require_config.getMaxWidgetLines;
72
+ exports.getStoreTtlMs = require_config.getStoreTtlMs;
73
+ exports.hasStorePathOverride = require_paths.hasStorePathOverride;
74
+ exports.isBlocked = require_taskGraph.isBlocked;
75
+ exports.isCommittingOp = require_reducer.isCommittingOp;
76
+ exports.isDelegationActive = require_task.isDelegationActive;
77
+ exports.isTaskListComplete = require_taskGraph.isTaskListComplete;
78
+ exports.lockPathFor = require_paths.lockPathFor;
79
+ exports.parsePiTaskConfig = require_config.parsePiTaskConfig;
80
+ exports.reconcileOrphanedDelegations = require_reconcile.reconcileOrphanedDelegations;
81
+ exports.removeLegacyStoreDirectory = require_paths.removeLegacyStoreDirectory;
82
+ exports.removeLegacyStoreDirectoryAsync = require_paths.removeLegacyStoreDirectoryAsync;
83
+ exports.resolveCollapseKey = require_config.resolveCollapseKey;
84
+ exports.resolveLegacyStoreDirectory = require_paths.resolveLegacyStoreDirectory;
85
+ exports.resolveLegacyStoreDirectoryAsync = require_paths.resolveLegacyStoreDirectoryAsync;
86
+ exports.resolveSessionKey = require_paths.resolveSessionKey;
87
+ exports.resolveStorePath = require_paths.resolveStorePath;
88
+ exports.singleItemOutcome = require_reducer.singleItemOutcome;
89
+ exports.sweepStoreFiles = require_paths.sweepStoreFiles;
90
+ exports.sweepStoreFilesAsync = require_paths.sweepStoreFilesAsync;
91
+ exports.taskActionAcceptsField = require_task$1.taskActionAcceptsField;
92
+ exports.tempPathFor = require_paths.tempPathFor;
93
+ exports.unresolvedBlockers = require_taskGraph.unresolvedBlockers;
@@ -0,0 +1,11 @@
1
+ import { _ as parsePiTaskConfig, a as DEFAULT_MAX_TASKS, c as DELEGATION_TIMEOUT_MS_ENV, d as PiTaskConfig, f as STORE_TTL_MS_ENV, g as getStoreTtlMs, h as getMaxWidgetLines, i as DEFAULT_DELEGATION_TIMEOUT_MS, l as MAX_TASKS_ENV, m as getMaxTasks, n as COLLAPSE_KEY_OFF, o as DEFAULT_MAX_WIDGET_LINES, p as getDelegationTimeoutMs, r as DEFAULT_COLLAPSE_KEY, s as DEFAULT_STORE_TTL_MS, t as COLLAPSE_KEY_ENV, u as MAX_WIDGET_LINES_ENV, v as resolveCollapseKey } from "./index-B-3sCF2S.mjs";
2
+ import { a as DelegationNotifier, c as DelegationProgress, d as ERR_NO_RUNTIME, f as NOTIFY_CUSTOM_TYPE, i as DelegationManagerOptions, l as ERR_CANCEL_UNACKNOWLEDGED, n as BACKGROUND_WORK_PROVIDER, o as DelegationOutcome, p as MAX_BRIEF_FILES, r as DelegationManager, s as DelegationPlatform, t as AssignOptions, u as ERR_CHILD_SESSION } from "./index-teIf67qQ.mjs";
3
+ import { _ as UpsertSummary, a as DepToken, c as TaskAction, d as TaskDetails, f as TaskDocument, g as UpsertItemOutcome, h as TaskStatus, i as DelegationState, l as TaskAssignment, m as TaskMutationParams, n as DELETED_STATUS, o as STORE_SCHEMA_VERSION, p as TaskItemMutation, r as DelegationResult, s as Task, t as AssignmentSummary, u as TaskDelegation, v as emptyDocument, y as isDelegationActive } from "./task-DJpTteeJ.mjs";
4
+ import { n as TaskStoreOptions, t as TaskStore } from "./index-Dvb8X_qB.mjs";
5
+ import { a as ReducerAction, c as isCommittingOp, i as REF_PATTERN, l as singleItemOutcome, n as MAX_UPSERT_ITEMS, o as applyTaskMutation, r as Op, s as formatUpsertFailure, t as ApplyResult } from "./index-CUWCvh-E.mjs";
6
+ import { a as MSG_UPSERT_PARTIAL, c as buildTextResult, d as formatContent, f as formatUpsertFailureText, i as MSG_UPSERT_NONE_APPLIED, l as buildToolResult, n as MSG_ALL_COMPLETE_CLEAR, o as ToolResult, r as MSG_ASSIGN_PARTIAL, s as buildAssignmentResult, t as AssignmentItemResult, u as formatAssignmentResults } from "./index-B1JPJdpZ.mjs";
7
+ import { _ as TaskParamsSchema, a as RemoteTaskParamsSchema, c as TASK_CONTEXTS, d as TOOL_NAME, f as TaskAssignmentParams, g as TaskParams, h as TaskItemSchema, i as REMOTE_TASK_ACTIONS, l as TASK_STATUSES, m as TaskItemParams, n as MSG_NO_TASKS, o as TASK_ACTIONS, p as TaskAssignmentSchema, r as MSG_UPSERT_FIELD_MISPLACED, s as TASK_ACTION_FIELDS, t as ERR_REQUIRES_INTERACTIVE, u as TOOL_LABEL, v as taskActionAcceptsField, y as COMMAND_NAME } from "./task-Dhta7JyA.mjs";
8
+ import { a as removeLegacyStoreDirectory, c as resolveLegacyStoreDirectoryAsync, d as sweepStoreFiles, f as sweepStoreFilesAsync, i as lockPathFor, l as resolveSessionKey, n as StoreSweepResult, o as removeLegacyStoreDirectoryAsync, p as tempPathFor, r as hasStorePathOverride, s as resolveLegacyStoreDirectory, t as STORE_PATH_ENV, u as resolveStorePath } from "./index-XY9VPmfm.mjs";
9
+ import { a as reconcileOrphanedDelegations, i as ReconcileSelf, n as ERR_ORPHANED_BY_SESSION, r as ReconcileResult, t as ERR_ORPHANED_BY_RESTART } from "./index-DlmXKyhQ.mjs";
10
+ import { a as unresolvedBlockers, i as isTaskListComplete, n as detectCycle, r as isBlocked, t as deriveBlocks } from "./taskGraph-D0zFHF2p.mjs";
11
+ export { ApplyResult, AssignOptions, AssignmentItemResult, AssignmentSummary, BACKGROUND_WORK_PROVIDER, COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, COMMAND_NAME, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, DELETED_STATUS, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, DelegationResult, DelegationState, DepToken, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, ERR_ORPHANED_BY_RESTART, ERR_ORPHANED_BY_SESSION, ERR_REQUIRES_INTERACTIVE, MAX_BRIEF_FILES, MAX_TASKS_ENV, MAX_UPSERT_ITEMS, MAX_WIDGET_LINES_ENV, MSG_ALL_COMPLETE_CLEAR, MSG_ASSIGN_PARTIAL, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, NOTIFY_CUSTOM_TYPE, Op, PiTaskConfig, REF_PATTERN, REMOTE_TASK_ACTIONS, ReconcileResult, ReconcileSelf, ReducerAction, RemoteTaskParamsSchema, STORE_PATH_ENV, STORE_SCHEMA_VERSION, STORE_TTL_MS_ENV, StoreSweepResult, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, Task, TaskAction, TaskAssignment, TaskAssignmentParams, TaskAssignmentSchema, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskItemParams, TaskItemSchema, TaskMutationParams, TaskParams, TaskParamsSchema, TaskStatus, TaskStore, TaskStoreOptions, ToolResult, UpsertItemOutcome, UpsertSummary, applyTaskMutation, buildAssignmentResult, buildTextResult, buildToolResult, deriveBlocks, detectCycle, emptyDocument, formatAssignmentResults, formatContent, formatUpsertFailure, formatUpsertFailureText, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, hasStorePathOverride, isBlocked, isCommittingOp, isDelegationActive, isTaskListComplete, lockPathFor, parsePiTaskConfig, reconcileOrphanedDelegations, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveCollapseKey, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, singleItemOutcome, sweepStoreFiles, sweepStoreFilesAsync, taskActionAcceptsField, tempPathFor, unresolvedBlockers };
package/dist/index.mjs ADDED
@@ -0,0 +1,12 @@
1
+ import { _ as resolveCollapseKey, a as DEFAULT_MAX_TASKS, c as DELEGATION_TIMEOUT_MS_ENV, d as STORE_TTL_MS_ENV, f as getDelegationTimeoutMs, g as parsePiTaskConfig, h as getStoreTtlMs, i as DEFAULT_DELEGATION_TIMEOUT_MS, l as MAX_TASKS_ENV, m as getMaxWidgetLines, n as COLLAPSE_KEY_OFF, o as DEFAULT_MAX_WIDGET_LINES, p as getMaxTasks, r as DEFAULT_COLLAPSE_KEY, s as DEFAULT_STORE_TTL_MS, t as COLLAPSE_KEY_ENV, u as MAX_WIDGET_LINES_ENV } from "./config-CFSs3iku.mjs";
2
+ import { a as unresolvedBlockers, i as isTaskListComplete, n as detectCycle, r as isBlocked, t as deriveBlocks } from "./taskGraph-BOQvT0-M.mjs";
3
+ import { t as MAX_BRIEF_FILES } from "./delegation-BiOy3_7g.mjs";
4
+ import { i as isDelegationActive, n as STORE_SCHEMA_VERSION, r as emptyDocument, t as DELETED_STATUS } from "./task-giCbpKzV.mjs";
5
+ import { n as ERR_ORPHANED_BY_SESSION, r as reconcileOrphanedDelegations, t as ERR_ORPHANED_BY_RESTART } from "./reconcile-BcD-hTbd.mjs";
6
+ import { a as ERR_NO_RUNTIME, i as ERR_CHILD_SESSION, n as DelegationManager, o as NOTIFY_CUSTOM_TYPE, r as ERR_CANCEL_UNACKNOWLEDGED, t as BACKGROUND_WORK_PROVIDER } from "./delegation-CdMqOZB4.mjs";
7
+ import { a as buildAssignmentResult, c as formatAssignmentResults, i as MSG_UPSERT_PARTIAL, l as formatContent, n as MSG_ASSIGN_PARTIAL, o as buildTextResult, r as MSG_UPSERT_NONE_APPLIED, s as buildToolResult, t as MSG_ALL_COMPLETE_CLEAR, u as formatUpsertFailureText } from "./taskResult-edBAAKSH.mjs";
8
+ import { a as RemoteTaskParamsSchema, c as TASK_CONTEXTS, d as TOOL_NAME, f as TaskAssignmentSchema, g as COMMAND_NAME, h as taskActionAcceptsField, i as REMOTE_TASK_ACTIONS, l as TASK_STATUSES, m as TaskParamsSchema, n as MSG_NO_TASKS, o as TASK_ACTIONS, p as TaskItemSchema, r as MSG_UPSERT_FIELD_MISPLACED, s as TASK_ACTION_FIELDS, t as ERR_REQUIRES_INTERACTIVE, u as TOOL_LABEL } from "./task-DO0TwZ0z.mjs";
9
+ import { a as removeLegacyStoreDirectoryAsync, c as resolveSessionKey, d as sweepStoreFilesAsync, f as tempPathFor, i as removeLegacyStoreDirectory, l as resolveStorePath, n as hasStorePathOverride, o as resolveLegacyStoreDirectory, r as lockPathFor, s as resolveLegacyStoreDirectoryAsync, t as STORE_PATH_ENV, u as sweepStoreFiles } from "./paths-Cah1vFGv.mjs";
10
+ import { a as isCommittingOp, i as formatUpsertFailure, n as REF_PATTERN, o as singleItemOutcome, r as applyTaskMutation, t as MAX_UPSERT_ITEMS } from "./reducer-BEfJFM5L.mjs";
11
+ import { t as TaskStore } from "./taskStore-pAJ971Ml.mjs";
12
+ export { BACKGROUND_WORK_PROVIDER, COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, COMMAND_NAME, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, DELETED_STATUS, DelegationManager, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, ERR_ORPHANED_BY_RESTART, ERR_ORPHANED_BY_SESSION, ERR_REQUIRES_INTERACTIVE, MAX_BRIEF_FILES, MAX_TASKS_ENV, MAX_UPSERT_ITEMS, MAX_WIDGET_LINES_ENV, MSG_ALL_COMPLETE_CLEAR, MSG_ASSIGN_PARTIAL, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, NOTIFY_CUSTOM_TYPE, REF_PATTERN, REMOTE_TASK_ACTIONS, RemoteTaskParamsSchema, STORE_PATH_ENV, STORE_SCHEMA_VERSION, STORE_TTL_MS_ENV, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, TaskAssignmentSchema, TaskItemSchema, TaskParamsSchema, TaskStore, applyTaskMutation, buildAssignmentResult, buildTextResult, buildToolResult, deriveBlocks, detectCycle, emptyDocument, formatAssignmentResults, formatContent, formatUpsertFailure, formatUpsertFailureText, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, hasStorePathOverride, isBlocked, isCommittingOp, isDelegationActive, isTaskListComplete, lockPathFor, parsePiTaskConfig, reconcileOrphanedDelegations, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveCollapseKey, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, singleItemOutcome, sweepStoreFiles, sweepStoreFilesAsync, taskActionAcceptsField, tempPathFor, unresolvedBlockers };
@@ -0,0 +1,79 @@
1
+ //#region src/services/invariants/index.ts
2
+ /**
3
+ * Collapse a malformed snapshot to one row per task id.
4
+ *
5
+ * Normal writes replace tasks in place, but older or externally edited stores
6
+ * can contain both a stale and a current copy. Prefer the copy with the newest
7
+ * ISO update timestamp; equal or missing timestamps use the later array entry.
8
+ * The winning row keeps the id's original position so repair does not reorder
9
+ * an otherwise stable task list.
10
+ */
11
+ function canonicalizeTasks(tasks) {
12
+ const canonical = [];
13
+ const indexById = /* @__PURE__ */ new Map();
14
+ for (const task of tasks) {
15
+ const existingIndex = indexById.get(task.id);
16
+ if (existingIndex === void 0) {
17
+ indexById.set(task.id, canonical.length);
18
+ canonical.push(task);
19
+ continue;
20
+ }
21
+ const existing = canonical[existingIndex];
22
+ if (!existing.updatedAt || !task.updatedAt || task.updatedAt >= existing.updatedAt) canonical[existingIndex] = task;
23
+ }
24
+ return canonical;
25
+ }
26
+ /**
27
+ * Allowed forward transitions per source status.
28
+ *
29
+ * `failed` is recoverable (a delegation can be retried) so it may return to
30
+ * pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a
31
+ * terminal tombstone.
32
+ */
33
+ const VALID_TRANSITIONS = {
34
+ pending: /* @__PURE__ */ new Set([
35
+ "in_progress",
36
+ "completed",
37
+ "failed",
38
+ "deleted"
39
+ ]),
40
+ in_progress: /* @__PURE__ */ new Set([
41
+ "pending",
42
+ "completed",
43
+ "failed",
44
+ "deleted"
45
+ ]),
46
+ failed: /* @__PURE__ */ new Set([
47
+ "pending",
48
+ "in_progress",
49
+ "completed",
50
+ "deleted"
51
+ ]),
52
+ completed: /* @__PURE__ */ new Set(["deleted"]),
53
+ deleted: /* @__PURE__ */ new Set()
54
+ };
55
+ function isTransitionValid(from, to) {
56
+ if (from === to) return true;
57
+ return VALID_TRANSITIONS[from].has(to);
58
+ }
59
+ //#endregion
60
+ Object.defineProperty(exports, "VALID_TRANSITIONS", {
61
+ enumerable: true,
62
+ get: function() {
63
+ return VALID_TRANSITIONS;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "canonicalizeTasks", {
67
+ enumerable: true,
68
+ get: function() {
69
+ return canonicalizeTasks;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "isTransitionValid", {
73
+ enumerable: true,
74
+ get: function() {
75
+ return isTransitionValid;
76
+ }
77
+ });
78
+
79
+ //# sourceMappingURL=invariants-DhjEjBPU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariants-DhjEjBPU.cjs","names":[],"sources":["../src/services/invariants/index.ts"],"sourcesContent":["import type { Task, TaskStatus } from '../../models/task';\n\n/**\n * Collapse a malformed snapshot to one row per task id.\n *\n * Normal writes replace tasks in place, but older or externally edited stores\n * can contain both a stale and a current copy. Prefer the copy with the newest\n * ISO update timestamp; equal or missing timestamps use the later array entry.\n * The winning row keeps the id's original position so repair does not reorder\n * an otherwise stable task list.\n */\nexport function canonicalizeTasks(tasks: readonly Task[]): Task[] {\n const canonical: Task[] = [];\n const indexById = new Map<number, number>();\n\n for (const task of tasks) {\n const existingIndex = indexById.get(task.id);\n if (existingIndex === undefined) {\n indexById.set(task.id, canonical.length);\n canonical.push(task);\n continue;\n }\n\n const existing = canonical[existingIndex];\n if (!existing.updatedAt || !task.updatedAt || task.updatedAt >= existing.updatedAt) {\n canonical[existingIndex] = task;\n }\n }\n\n return canonical;\n}\n\n/**\n * Allowed forward transitions per source status.\n *\n * `failed` is recoverable (a delegation can be retried) so it may return to\n * pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a\n * terminal tombstone.\n */\nexport const VALID_TRANSITIONS: Record<TaskStatus, ReadonlySet<TaskStatus>> = {\n pending: new Set<TaskStatus>(['in_progress', 'completed', 'failed', 'deleted']),\n in_progress: new Set<TaskStatus>(['pending', 'completed', 'failed', 'deleted']),\n failed: new Set<TaskStatus>(['pending', 'in_progress', 'completed', 'deleted']),\n completed: new Set<TaskStatus>(['deleted']),\n deleted: new Set<TaskStatus>(),\n};\n\nexport function isTransitionValid(from: TaskStatus, to: TaskStatus): boolean {\n if (from === to) return true;\n return VALID_TRANSITIONS[from].has(to);\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,kBAAkB,OAAgC;CAChE,MAAM,YAAoB,CAAC;CAC3B,MAAM,4BAAY,IAAI,IAAoB;CAE1C,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,gBAAgB,UAAU,IAAI,KAAK,EAAE;EAC3C,IAAI,kBAAkB,KAAA,GAAW;GAC/B,UAAU,IAAI,KAAK,IAAI,UAAU,MAAM;GACvC,UAAU,KAAK,IAAI;GACnB;EACF;EAEA,MAAM,WAAW,UAAU;EAC3B,IAAI,CAAC,SAAS,aAAa,CAAC,KAAK,aAAa,KAAK,aAAa,SAAS,WACvE,UAAU,iBAAiB;CAE/B;CAEA,OAAO;AACT;;;;;;;;AASA,MAAa,oBAAiE;CAC5E,yBAAS,IAAI,IAAgB;EAAC;EAAe;EAAa;EAAU;CAAS,CAAC;CAC9E,6BAAa,IAAI,IAAgB;EAAC;EAAW;EAAa;EAAU;CAAS,CAAC;CAC9E,wBAAQ,IAAI,IAAgB;EAAC;EAAW;EAAe;EAAa;CAAS,CAAC;CAC9E,2BAAW,IAAI,IAAgB,CAAC,SAAS,CAAC;CAC1C,yBAAS,IAAI,IAAgB;AAC/B;AAEA,SAAgB,kBAAkB,MAAkB,IAAyB;CAC3E,IAAI,SAAS,IAAI,OAAO;CACxB,OAAO,kBAAkB,KAAK,CAAC,IAAI,EAAE;AACvC"}
@@ -0,0 +1,62 @@
1
+ //#region src/services/invariants/index.ts
2
+ /**
3
+ * Collapse a malformed snapshot to one row per task id.
4
+ *
5
+ * Normal writes replace tasks in place, but older or externally edited stores
6
+ * can contain both a stale and a current copy. Prefer the copy with the newest
7
+ * ISO update timestamp; equal or missing timestamps use the later array entry.
8
+ * The winning row keeps the id's original position so repair does not reorder
9
+ * an otherwise stable task list.
10
+ */
11
+ function canonicalizeTasks(tasks) {
12
+ const canonical = [];
13
+ const indexById = /* @__PURE__ */ new Map();
14
+ for (const task of tasks) {
15
+ const existingIndex = indexById.get(task.id);
16
+ if (existingIndex === void 0) {
17
+ indexById.set(task.id, canonical.length);
18
+ canonical.push(task);
19
+ continue;
20
+ }
21
+ const existing = canonical[existingIndex];
22
+ if (!existing.updatedAt || !task.updatedAt || task.updatedAt >= existing.updatedAt) canonical[existingIndex] = task;
23
+ }
24
+ return canonical;
25
+ }
26
+ /**
27
+ * Allowed forward transitions per source status.
28
+ *
29
+ * `failed` is recoverable (a delegation can be retried) so it may return to
30
+ * pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a
31
+ * terminal tombstone.
32
+ */
33
+ const VALID_TRANSITIONS = {
34
+ pending: /* @__PURE__ */ new Set([
35
+ "in_progress",
36
+ "completed",
37
+ "failed",
38
+ "deleted"
39
+ ]),
40
+ in_progress: /* @__PURE__ */ new Set([
41
+ "pending",
42
+ "completed",
43
+ "failed",
44
+ "deleted"
45
+ ]),
46
+ failed: /* @__PURE__ */ new Set([
47
+ "pending",
48
+ "in_progress",
49
+ "completed",
50
+ "deleted"
51
+ ]),
52
+ completed: /* @__PURE__ */ new Set(["deleted"]),
53
+ deleted: /* @__PURE__ */ new Set()
54
+ };
55
+ function isTransitionValid(from, to) {
56
+ if (from === to) return true;
57
+ return VALID_TRANSITIONS[from].has(to);
58
+ }
59
+ //#endregion
60
+ export { canonicalizeTasks as n, isTransitionValid as r, VALID_TRANSITIONS as t };
61
+
62
+ //# sourceMappingURL=invariants-q_UamF7D.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariants-q_UamF7D.mjs","names":[],"sources":["../src/services/invariants/index.ts"],"sourcesContent":["import type { Task, TaskStatus } from '../../models/task';\n\n/**\n * Collapse a malformed snapshot to one row per task id.\n *\n * Normal writes replace tasks in place, but older or externally edited stores\n * can contain both a stale and a current copy. Prefer the copy with the newest\n * ISO update timestamp; equal or missing timestamps use the later array entry.\n * The winning row keeps the id's original position so repair does not reorder\n * an otherwise stable task list.\n */\nexport function canonicalizeTasks(tasks: readonly Task[]): Task[] {\n const canonical: Task[] = [];\n const indexById = new Map<number, number>();\n\n for (const task of tasks) {\n const existingIndex = indexById.get(task.id);\n if (existingIndex === undefined) {\n indexById.set(task.id, canonical.length);\n canonical.push(task);\n continue;\n }\n\n const existing = canonical[existingIndex];\n if (!existing.updatedAt || !task.updatedAt || task.updatedAt >= existing.updatedAt) {\n canonical[existingIndex] = task;\n }\n }\n\n return canonical;\n}\n\n/**\n * Allowed forward transitions per source status.\n *\n * `failed` is recoverable (a delegation can be retried) so it may return to\n * pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a\n * terminal tombstone.\n */\nexport const VALID_TRANSITIONS: Record<TaskStatus, ReadonlySet<TaskStatus>> = {\n pending: new Set<TaskStatus>(['in_progress', 'completed', 'failed', 'deleted']),\n in_progress: new Set<TaskStatus>(['pending', 'completed', 'failed', 'deleted']),\n failed: new Set<TaskStatus>(['pending', 'in_progress', 'completed', 'deleted']),\n completed: new Set<TaskStatus>(['deleted']),\n deleted: new Set<TaskStatus>(),\n};\n\nexport function isTransitionValid(from: TaskStatus, to: TaskStatus): boolean {\n if (from === to) return true;\n return VALID_TRANSITIONS[from].has(to);\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,kBAAkB,OAAgC;CAChE,MAAM,YAAoB,CAAC;CAC3B,MAAM,4BAAY,IAAI,IAAoB;CAE1C,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,gBAAgB,UAAU,IAAI,KAAK,EAAE;EAC3C,IAAI,kBAAkB,KAAA,GAAW;GAC/B,UAAU,IAAI,KAAK,IAAI,UAAU,MAAM;GACvC,UAAU,KAAK,IAAI;GACnB;EACF;EAEA,MAAM,WAAW,UAAU;EAC3B,IAAI,CAAC,SAAS,aAAa,CAAC,KAAK,aAAa,KAAK,aAAa,SAAS,WACvE,UAAU,iBAAiB;CAE/B;CAEA,OAAO;AACT;;;;;;;;AASA,MAAa,oBAAiE;CAC5E,yBAAS,IAAI,IAAgB;EAAC;EAAe;EAAa;EAAU;CAAS,CAAC;CAC9E,6BAAa,IAAI,IAAgB;EAAC;EAAW;EAAa;EAAU;CAAS,CAAC;CAC9E,wBAAQ,IAAI,IAAgB;EAAC;EAAW;EAAe;EAAa;CAAS,CAAC;CAC9E,2BAAW,IAAI,IAAgB,CAAC,SAAS,CAAC;CAC1C,yBAAS,IAAI,IAAgB;AAC/B;AAEA,SAAgB,kBAAkB,MAAkB,IAAyB;CAC3E,IAAI,SAAS,IAAI,OAAO;CACxB,OAAO,kBAAkB,KAAK,CAAC,IAAI,EAAE;AACvC"}
@@ -0,0 +1,52 @@
1
+ const require_telemetry = require("./telemetry-Ca0I3Tqo.cjs");
2
+ let _agimon_ai_po_telemetry = require("@agimon-ai/po-telemetry");
3
+ //#region src/services/logSinkTelemetry/index.ts
4
+ const SERVICE_NAME = "doom-task";
5
+ const PACKAGE_NAME = "@agimon-ai/po-task";
6
+ const NOTIFICATION_OPERATION = "completion_notification";
7
+ function createTaskErrorReporter(options = {}) {
8
+ const telemetry = (0, _agimon_ai_po_telemetry.createDoomTelemetry)({
9
+ serviceName: SERVICE_NAME,
10
+ packageName: PACKAGE_NAME,
11
+ cwd: options.cwd,
12
+ workspaceRoot: options.workspaceRoot,
13
+ env: options.env,
14
+ telemetryFactory: options.telemetryFactory,
15
+ warn: options.warn,
16
+ enableLogs: true,
17
+ enableTraces: true
18
+ });
19
+ return {
20
+ recordError: (event, error, attributes) => telemetry.recordError(event, error, attributes),
21
+ recordWarning: (event, error, attributes) => telemetry.recordWarning(event, error, attributes),
22
+ recordEvent: (event, attributes) => telemetry.recordEvent(event, attributes),
23
+ recordNotificationError: (error, taskId) => telemetry.recordError(require_telemetry.TASK_EVENT.notificationFailed, error, {
24
+ "task.id": taskId,
25
+ "task.operation": NOTIFICATION_OPERATION
26
+ }),
27
+ flush: () => telemetry.flush(),
28
+ shutdown: () => telemetry.shutdown()
29
+ };
30
+ }
31
+ function toFailureReporter(reporter) {
32
+ return {
33
+ error: (event, error, attributes) => void reporter.recordError(event, error, attributes),
34
+ warn: (event, error, attributes) => void reporter.recordWarning(event, error, attributes),
35
+ event: (event, attributes) => void reporter.recordEvent(event, attributes)
36
+ };
37
+ }
38
+ //#endregion
39
+ Object.defineProperty(exports, "createTaskErrorReporter", {
40
+ enumerable: true,
41
+ get: function() {
42
+ return createTaskErrorReporter;
43
+ }
44
+ });
45
+ Object.defineProperty(exports, "toFailureReporter", {
46
+ enumerable: true,
47
+ get: function() {
48
+ return toFailureReporter;
49
+ }
50
+ });
51
+
52
+ //# sourceMappingURL=logSinkTelemetry-B23qGiP-.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logSinkTelemetry-B23qGiP-.cjs","names":["createDoomTelemetry","TASK_EVENT"],"sources":["../src/services/logSinkTelemetry/index.ts"],"sourcesContent":["import { createDoomTelemetry, type DoomTelemetry, type DoomTelemetryOptions } from '@agimon-ai/po-telemetry';\n\nimport { TASK_EVENT, type TaskErrorAttributes, type TaskFailureReporter } from '../../types/telemetry';\n\nexport {\n TASK_EVENT,\n type TaskErrorAttributes,\n type TaskErrorSink,\n type TaskEventName,\n type TaskEventSink,\n type TaskFailureReporter,\n} from '../../types/telemetry';\n\nconst SERVICE_NAME = 'doom-task';\nconst PACKAGE_NAME = '@agimon-ai/po-task';\nconst NOTIFICATION_OPERATION = 'completion_notification';\n\nexport interface TaskErrorReporterOptions {\n cwd?: string;\n workspaceRoot?: string;\n env?: NodeJS.ProcessEnv;\n telemetryFactory?: NonNullable<DoomTelemetryOptions['telemetryFactory']>;\n warn?: (message: string) => void;\n}\n\nexport interface TaskErrorReporter {\n recordError(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordWarning(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordEvent(event: string, attributes?: TaskErrorAttributes): Promise<void>;\n recordNotificationError(error: unknown, taskId: number): Promise<void>;\n flush(): Promise<void>;\n shutdown(): Promise<void>;\n}\n\nexport function createTaskErrorReporter(options: TaskErrorReporterOptions = {}): TaskErrorReporter {\n const telemetry: DoomTelemetry = createDoomTelemetry({\n serviceName: SERVICE_NAME,\n packageName: PACKAGE_NAME,\n cwd: options.cwd,\n workspaceRoot: options.workspaceRoot,\n env: options.env,\n telemetryFactory: options.telemetryFactory,\n warn: options.warn,\n enableLogs: true,\n enableTraces: true,\n });\n return {\n recordError: (event, error, attributes) => telemetry.recordError(event, error, attributes),\n recordWarning: (event, error, attributes) => telemetry.recordWarning(event, error, attributes),\n recordEvent: (event, attributes) => telemetry.recordEvent(event, attributes),\n recordNotificationError: (error, taskId) =>\n telemetry.recordError(TASK_EVENT.notificationFailed, error, {\n 'task.id': taskId,\n 'task.operation': NOTIFICATION_OPERATION,\n }),\n flush: () => telemetry.flush(),\n shutdown: () => telemetry.shutdown(),\n };\n}\n\nexport function toFailureReporter(reporter: TaskErrorReporter): TaskFailureReporter {\n return {\n error: (event, error, attributes) => void reporter.recordError(event, error, attributes),\n warn: (event, error, attributes) => void reporter.recordWarning(event, error, attributes),\n event: (event, attributes) => void reporter.recordEvent(event, attributes),\n };\n}\n"],"mappings":";;;AAaA,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,yBAAyB;AAmB/B,SAAgB,wBAAwB,UAAoC,CAAC,GAAsB;CACjG,MAAM,aAAA,GAA2BA,wBAAAA,oBAAAA,CAAoB;EACnD,aAAa;EACb,aAAa;EACb,KAAK,QAAQ;EACb,eAAe,QAAQ;EACvB,KAAK,QAAQ;EACb,kBAAkB,QAAQ;EAC1B,MAAM,QAAQ;EACd,YAAY;EACZ,cAAc;CAChB,CAAC;CACD,OAAO;EACL,cAAc,OAAO,OAAO,eAAe,UAAU,YAAY,OAAO,OAAO,UAAU;EACzF,gBAAgB,OAAO,OAAO,eAAe,UAAU,cAAc,OAAO,OAAO,UAAU;EAC7F,cAAc,OAAO,eAAe,UAAU,YAAY,OAAO,UAAU;EAC3E,0BAA0B,OAAO,WAC/B,UAAU,YAAYC,kBAAAA,WAAW,oBAAoB,OAAO;GAC1D,WAAW;GACX,kBAAkB;EACpB,CAAC;EACH,aAAa,UAAU,MAAM;EAC7B,gBAAgB,UAAU,SAAS;CACrC;AACF;AAEA,SAAgB,kBAAkB,UAAkD;CAClF,OAAO;EACL,QAAQ,OAAO,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,OAAO,UAAU;EACvF,OAAO,OAAO,OAAO,eAAe,KAAK,SAAS,cAAc,OAAO,OAAO,UAAU;EACxF,QAAQ,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,UAAU;CAC3E;AACF"}
@@ -0,0 +1,41 @@
1
+ import { t as TASK_EVENT } from "./telemetry-DyS44zAD.mjs";
2
+ import { createDoomTelemetry } from "@agimon-ai/po-telemetry";
3
+ //#region src/services/logSinkTelemetry/index.ts
4
+ const SERVICE_NAME = "doom-task";
5
+ const PACKAGE_NAME = "@agimon-ai/po-task";
6
+ const NOTIFICATION_OPERATION = "completion_notification";
7
+ function createTaskErrorReporter(options = {}) {
8
+ const telemetry = createDoomTelemetry({
9
+ serviceName: SERVICE_NAME,
10
+ packageName: PACKAGE_NAME,
11
+ cwd: options.cwd,
12
+ workspaceRoot: options.workspaceRoot,
13
+ env: options.env,
14
+ telemetryFactory: options.telemetryFactory,
15
+ warn: options.warn,
16
+ enableLogs: true,
17
+ enableTraces: true
18
+ });
19
+ return {
20
+ recordError: (event, error, attributes) => telemetry.recordError(event, error, attributes),
21
+ recordWarning: (event, error, attributes) => telemetry.recordWarning(event, error, attributes),
22
+ recordEvent: (event, attributes) => telemetry.recordEvent(event, attributes),
23
+ recordNotificationError: (error, taskId) => telemetry.recordError(TASK_EVENT.notificationFailed, error, {
24
+ "task.id": taskId,
25
+ "task.operation": NOTIFICATION_OPERATION
26
+ }),
27
+ flush: () => telemetry.flush(),
28
+ shutdown: () => telemetry.shutdown()
29
+ };
30
+ }
31
+ function toFailureReporter(reporter) {
32
+ return {
33
+ error: (event, error, attributes) => void reporter.recordError(event, error, attributes),
34
+ warn: (event, error, attributes) => void reporter.recordWarning(event, error, attributes),
35
+ event: (event, attributes) => void reporter.recordEvent(event, attributes)
36
+ };
37
+ }
38
+ //#endregion
39
+ export { toFailureReporter as n, createTaskErrorReporter as t };
40
+
41
+ //# sourceMappingURL=logSinkTelemetry-BMBsC54p.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logSinkTelemetry-BMBsC54p.mjs","names":[],"sources":["../src/services/logSinkTelemetry/index.ts"],"sourcesContent":["import { createDoomTelemetry, type DoomTelemetry, type DoomTelemetryOptions } from '@agimon-ai/po-telemetry';\n\nimport { TASK_EVENT, type TaskErrorAttributes, type TaskFailureReporter } from '../../types/telemetry';\n\nexport {\n TASK_EVENT,\n type TaskErrorAttributes,\n type TaskErrorSink,\n type TaskEventName,\n type TaskEventSink,\n type TaskFailureReporter,\n} from '../../types/telemetry';\n\nconst SERVICE_NAME = 'doom-task';\nconst PACKAGE_NAME = '@agimon-ai/po-task';\nconst NOTIFICATION_OPERATION = 'completion_notification';\n\nexport interface TaskErrorReporterOptions {\n cwd?: string;\n workspaceRoot?: string;\n env?: NodeJS.ProcessEnv;\n telemetryFactory?: NonNullable<DoomTelemetryOptions['telemetryFactory']>;\n warn?: (message: string) => void;\n}\n\nexport interface TaskErrorReporter {\n recordError(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordWarning(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordEvent(event: string, attributes?: TaskErrorAttributes): Promise<void>;\n recordNotificationError(error: unknown, taskId: number): Promise<void>;\n flush(): Promise<void>;\n shutdown(): Promise<void>;\n}\n\nexport function createTaskErrorReporter(options: TaskErrorReporterOptions = {}): TaskErrorReporter {\n const telemetry: DoomTelemetry = createDoomTelemetry({\n serviceName: SERVICE_NAME,\n packageName: PACKAGE_NAME,\n cwd: options.cwd,\n workspaceRoot: options.workspaceRoot,\n env: options.env,\n telemetryFactory: options.telemetryFactory,\n warn: options.warn,\n enableLogs: true,\n enableTraces: true,\n });\n return {\n recordError: (event, error, attributes) => telemetry.recordError(event, error, attributes),\n recordWarning: (event, error, attributes) => telemetry.recordWarning(event, error, attributes),\n recordEvent: (event, attributes) => telemetry.recordEvent(event, attributes),\n recordNotificationError: (error, taskId) =>\n telemetry.recordError(TASK_EVENT.notificationFailed, error, {\n 'task.id': taskId,\n 'task.operation': NOTIFICATION_OPERATION,\n }),\n flush: () => telemetry.flush(),\n shutdown: () => telemetry.shutdown(),\n };\n}\n\nexport function toFailureReporter(reporter: TaskErrorReporter): TaskFailureReporter {\n return {\n error: (event, error, attributes) => void reporter.recordError(event, error, attributes),\n warn: (event, error, attributes) => void reporter.recordWarning(event, error, attributes),\n event: (event, attributes) => void reporter.recordEvent(event, attributes),\n };\n}\n"],"mappings":";;;AAaA,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,yBAAyB;AAmB/B,SAAgB,wBAAwB,UAAoC,CAAC,GAAsB;CACjG,MAAM,YAA2B,oBAAoB;EACnD,aAAa;EACb,aAAa;EACb,KAAK,QAAQ;EACb,eAAe,QAAQ;EACvB,KAAK,QAAQ;EACb,kBAAkB,QAAQ;EAC1B,MAAM,QAAQ;EACd,YAAY;EACZ,cAAc;CAChB,CAAC;CACD,OAAO;EACL,cAAc,OAAO,OAAO,eAAe,UAAU,YAAY,OAAO,OAAO,UAAU;EACzF,gBAAgB,OAAO,OAAO,eAAe,UAAU,cAAc,OAAO,OAAO,UAAU;EAC7F,cAAc,OAAO,eAAe,UAAU,YAAY,OAAO,UAAU;EAC3E,0BAA0B,OAAO,WAC/B,UAAU,YAAY,WAAW,oBAAoB,OAAO;GAC1D,WAAW;GACX,kBAAkB;EACpB,CAAC;EACH,aAAa,UAAU,MAAM;EAC7B,gBAAgB,UAAU,SAAS;CACrC;AACF;AAEA,SAAgB,kBAAkB,UAAkD;CAClF,OAAO;EACL,QAAQ,OAAO,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,OAAO,UAAU;EACvF,OAAO,OAAO,OAAO,eAAe,KAAK,SAAS,cAAc,OAAO,OAAO,UAAU;EACxF,QAAQ,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,UAAU;CAC3E;AACF"}
@@ -0,0 +1,6 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_telemetry = require("./telemetry-Ca0I3Tqo.cjs");
3
+ const require_logSinkTelemetry = require("./logSinkTelemetry-B23qGiP-.cjs");
4
+ exports.TASK_EVENT = require_telemetry.TASK_EVENT;
5
+ exports.createTaskErrorReporter = require_logSinkTelemetry.createTaskErrorReporter;
6
+ exports.toFailureReporter = require_logSinkTelemetry.toFailureReporter;
@@ -0,0 +1,23 @@
1
+ import { a as TaskEventSink, i as TaskEventName, n as TaskErrorAttributes, o as TaskFailureReporter, r as TaskErrorSink, t as TASK_EVENT } from "./telemetry-FMGRovb4.mjs";
2
+ import { DoomTelemetryOptions } from "@agimon-ai/po-telemetry";
3
+ //#region src/services/logSinkTelemetry/index.d.ts
4
+ export interface TaskErrorReporterOptions {
5
+ cwd?: string;
6
+ workspaceRoot?: string;
7
+ env?: NodeJS.ProcessEnv;
8
+ telemetryFactory?: NonNullable<DoomTelemetryOptions['telemetryFactory']>;
9
+ warn?: (message: string) => void;
10
+ }
11
+ export interface TaskErrorReporter {
12
+ recordError(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;
13
+ recordWarning(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;
14
+ recordEvent(event: string, attributes?: TaskErrorAttributes): Promise<void>;
15
+ recordNotificationError(error: unknown, taskId: number): Promise<void>;
16
+ flush(): Promise<void>;
17
+ shutdown(): Promise<void>;
18
+ }
19
+ export declare function createTaskErrorReporter(options?: TaskErrorReporterOptions): TaskErrorReporter;
20
+ export declare function toFailureReporter(reporter: TaskErrorReporter): TaskFailureReporter;
21
+ //#endregion
22
+ export { TASK_EVENT, type TaskErrorAttributes, type TaskErrorSink, type TaskEventName, type TaskEventSink, type TaskFailureReporter };
23
+ //# sourceMappingURL=logSinkTelemetry.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logSinkTelemetry.d.mts","names":[],"sources":["../src/services/logSinkTelemetry/index.ts"],"mappings":";;;iBAiBiB;EACf;EACA;EACA,MAAM,OAAO;EACb,mBAAmB,YAAY;EAC/B,QAAQ;;iBAGO;EACf,YAAY,eAAe,gBAAgB,aAAa,sBAAsB;EAC9E,cAAc,eAAe,gBAAgB,aAAa,sBAAsB;EAChF,YAAY,eAAe,aAAa,sBAAsB;EAC9D,wBAAwB,gBAAgB,iBAAiB;EACzD,SAAS;EACT,YAAY;;wBAGE,wBAAwB,UAAS,2BAAgC;wBA0BjE,kBAAkB,UAAU,oBAAoB"}
@@ -0,0 +1,3 @@
1
+ import { t as TASK_EVENT } from "./telemetry-DyS44zAD.mjs";
2
+ import { n as toFailureReporter, t as createTaskErrorReporter } from "./logSinkTelemetry-BMBsC54p.mjs";
3
+ export { TASK_EVENT, createTaskErrorReporter, toFailureReporter };