@dsh-enhanced/assistant-work-items 0.0.0-stage → 0.1.66

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 (152) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +685 -2
  3. package/cordis.patch.yml +11 -0
  4. package/lib/acceptance-binding.d.ts +86 -0
  5. package/lib/acceptance-binding.d.ts.map +1 -0
  6. package/lib/acceptance-binding.js +250 -0
  7. package/lib/acceptance-binding.js.map +1 -0
  8. package/lib/admission.d.ts +95 -0
  9. package/lib/admission.d.ts.map +1 -0
  10. package/lib/admission.js +642 -0
  11. package/lib/admission.js.map +1 -0
  12. package/lib/authority.d.ts +92 -0
  13. package/lib/authority.d.ts.map +1 -0
  14. package/lib/authority.js +205 -0
  15. package/lib/authority.js.map +1 -0
  16. package/lib/config.d.ts +365 -0
  17. package/lib/config.d.ts.map +1 -0
  18. package/lib/config.js +672 -0
  19. package/lib/config.js.map +1 -0
  20. package/lib/continuation-contract.d.ts +126 -0
  21. package/lib/continuation-contract.d.ts.map +1 -0
  22. package/lib/continuation-contract.js +109 -0
  23. package/lib/continuation-contract.js.map +1 -0
  24. package/lib/continuation-record.d.ts +32 -0
  25. package/lib/continuation-record.d.ts.map +1 -0
  26. package/lib/continuation-record.js +57 -0
  27. package/lib/continuation-record.js.map +1 -0
  28. package/lib/continuation.d.ts +89 -0
  29. package/lib/continuation.d.ts.map +1 -0
  30. package/lib/continuation.js +607 -0
  31. package/lib/continuation.js.map +1 -0
  32. package/lib/diagnosis-contract.d.ts +95 -0
  33. package/lib/diagnosis-contract.d.ts.map +1 -0
  34. package/lib/diagnosis-contract.js +167 -0
  35. package/lib/diagnosis-contract.js.map +1 -0
  36. package/lib/diagnosis.d.ts +70 -0
  37. package/lib/diagnosis.d.ts.map +1 -0
  38. package/lib/diagnosis.js +466 -0
  39. package/lib/diagnosis.js.map +1 -0
  40. package/lib/dispatch.d.ts +100 -0
  41. package/lib/dispatch.d.ts.map +1 -0
  42. package/lib/dispatch.js +317 -0
  43. package/lib/dispatch.js.map +1 -0
  44. package/lib/engineering-context.d.ts +86 -0
  45. package/lib/engineering-context.d.ts.map +1 -0
  46. package/lib/engineering-context.js +263 -0
  47. package/lib/engineering-context.js.map +1 -0
  48. package/lib/evaluation.d.ts +125 -0
  49. package/lib/evaluation.d.ts.map +1 -0
  50. package/lib/evaluation.js +295 -0
  51. package/lib/evaluation.js.map +1 -0
  52. package/lib/event-follow.d.ts +93 -0
  53. package/lib/event-follow.d.ts.map +1 -0
  54. package/lib/event-follow.js +150 -0
  55. package/lib/event-follow.js.map +1 -0
  56. package/lib/feedback-targets.d.ts +91 -0
  57. package/lib/feedback-targets.d.ts.map +1 -0
  58. package/lib/feedback-targets.js +362 -0
  59. package/lib/feedback-targets.js.map +1 -0
  60. package/lib/index.d.ts +27 -0
  61. package/lib/index.d.ts.map +1 -0
  62. package/lib/index.js +25 -0
  63. package/lib/index.js.map +1 -0
  64. package/lib/intake-admission.d.ts +49 -0
  65. package/lib/intake-admission.d.ts.map +1 -0
  66. package/lib/intake-admission.js +100 -0
  67. package/lib/intake-admission.js.map +1 -0
  68. package/lib/intake-evaluation-runtime.d.ts +74 -0
  69. package/lib/intake-evaluation-runtime.d.ts.map +1 -0
  70. package/lib/intake-evaluation-runtime.js +343 -0
  71. package/lib/intake-evaluation-runtime.js.map +1 -0
  72. package/lib/intake-evaluation.d.ts +180 -0
  73. package/lib/intake-evaluation.d.ts.map +1 -0
  74. package/lib/intake-evaluation.js +440 -0
  75. package/lib/intake-evaluation.js.map +1 -0
  76. package/lib/intake.d.ts +118 -0
  77. package/lib/intake.d.ts.map +1 -0
  78. package/lib/intake.js +137 -0
  79. package/lib/intake.js.map +1 -0
  80. package/lib/ledger.d.ts +86 -0
  81. package/lib/ledger.d.ts.map +1 -0
  82. package/lib/ledger.js +145 -0
  83. package/lib/ledger.js.map +1 -0
  84. package/lib/mandate.d.ts +45 -0
  85. package/lib/mandate.d.ts.map +1 -0
  86. package/lib/mandate.js +168 -0
  87. package/lib/mandate.js.map +1 -0
  88. package/lib/outcome.d.ts +137 -0
  89. package/lib/outcome.d.ts.map +1 -0
  90. package/lib/outcome.js +303 -0
  91. package/lib/outcome.js.map +1 -0
  92. package/lib/owner-access.d.ts +35 -0
  93. package/lib/owner-access.d.ts.map +1 -0
  94. package/lib/owner-access.js +152 -0
  95. package/lib/owner-access.js.map +1 -0
  96. package/lib/owner-continuation.d.ts +27 -0
  97. package/lib/owner-continuation.d.ts.map +1 -0
  98. package/lib/owner-continuation.js +131 -0
  99. package/lib/owner-continuation.js.map +1 -0
  100. package/lib/owner-recall.d.ts +85 -0
  101. package/lib/owner-recall.d.ts.map +1 -0
  102. package/lib/owner-recall.js +134 -0
  103. package/lib/owner-recall.js.map +1 -0
  104. package/lib/owner-replies.d.ts +44 -0
  105. package/lib/owner-replies.d.ts.map +1 -0
  106. package/lib/owner-replies.js +232 -0
  107. package/lib/owner-replies.js.map +1 -0
  108. package/lib/peers.d.ts +622 -0
  109. package/lib/peers.d.ts.map +1 -0
  110. package/lib/peers.js +10 -0
  111. package/lib/peers.js.map +1 -0
  112. package/lib/policy-notice.d.ts +31 -0
  113. package/lib/policy-notice.d.ts.map +1 -0
  114. package/lib/policy-notice.js +137 -0
  115. package/lib/policy-notice.js.map +1 -0
  116. package/lib/reply-contract.d.ts +67 -0
  117. package/lib/reply-contract.d.ts.map +1 -0
  118. package/lib/reply-contract.js +58 -0
  119. package/lib/reply-contract.js.map +1 -0
  120. package/lib/service.d.ts +625 -0
  121. package/lib/service.d.ts.map +1 -0
  122. package/lib/service.js +2388 -0
  123. package/lib/service.js.map +1 -0
  124. package/lib/settlement.d.ts +74 -0
  125. package/lib/settlement.d.ts.map +1 -0
  126. package/lib/settlement.js +233 -0
  127. package/lib/settlement.js.map +1 -0
  128. package/lib/signals.d.ts +176 -0
  129. package/lib/signals.d.ts.map +1 -0
  130. package/lib/signals.js +497 -0
  131. package/lib/signals.js.map +1 -0
  132. package/lib/store.d.ts +789 -0
  133. package/lib/store.d.ts.map +1 -0
  134. package/lib/store.js +3266 -0
  135. package/lib/store.js.map +1 -0
  136. package/lib/tools.d.ts +7 -0
  137. package/lib/tools.d.ts.map +1 -0
  138. package/lib/tools.js +443 -0
  139. package/lib/tools.js.map +1 -0
  140. package/lib/types.d.ts +831 -0
  141. package/lib/types.d.ts.map +1 -0
  142. package/lib/types.js +29 -0
  143. package/lib/types.js.map +1 -0
  144. package/lib/version.d.ts +2 -0
  145. package/lib/version.d.ts.map +1 -0
  146. package/lib/version.js +2 -0
  147. package/lib/version.js.map +1 -0
  148. package/lib/workspace.d.ts +43 -0
  149. package/lib/workspace.d.ts.map +1 -0
  150. package/lib/workspace.js +137 -0
  151. package/lib/workspace.js.map +1 -0
  152. package/package.json +101 -3
@@ -0,0 +1,625 @@
1
+ import { type WorkItemEngineeringMaterial } from './engineering-context.js';
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import { Service } from '@deepseek-ai/cordis';
4
+ import type { WorkItemIntakeInput, WorkItemIntakeResult } from './intake.js';
5
+ import type { WorkItemIntakeEvaluationRecord } from './intake-evaluation.js';
6
+ import { type WorkItemIntakeEvaluationHealth, type WorkItemIntakeEvaluatorRegistration } from './intake-evaluation-runtime.js';
7
+ import { type WorkItemIntakeAdmissionRecord } from './intake-admission.js';
8
+ import type { Agent } from '@deepseek-ai/dsh-agent';
9
+ import type { ToolExecution } from '@deepseek-ai/dsh-tools';
10
+ import { type Config } from './config.js';
11
+ import { type WorkItemEvaluationRegistration } from './evaluation.js';
12
+ import { type OwnerWorkItemExecution, type OwnerWorkItemListInput, type OwnerWorkItemRecallInput } from './owner-recall.js';
13
+ export type { OwnerWorkItemExecution, OwnerWorkItemListInput, OwnerWorkItemRecallInput, OwnerWorkItemSummary } from './owner-recall.js';
14
+ import { type WorkItemFollowUpCursor } from './store.js';
15
+ import { type WorkItemSignalRegistration, type WorkItemSignalSweepReport } from './signals.js';
16
+ import type { WorkItemAcceptanceSettleResult, WorkItemAcceptanceVerdict, WorkItemAdmitInput, WorkItemDecisionAdmitResult, WorkItemExecuteDecision, WorkItemAdmitResult, WorkItemFollowUpOwnResult, WorkItemFollowUpRecord, WorkItemPolicyChangeResult, WorkItemPolicyNotice, WorkItemWithdrawResult, WorkItemClaimRecord, WorkItemHealth, WorkItemOutcomeEvidenceState, WorkItemOutcomeView, WorkItemRecord, WorkItemReportRecord, WorkItemReportStatus, WorkItemResumeContext, WorkItemSettlementReport, WorkItemThreadSourceRegistration, WorkItemIntakeProvenance } from './types.js';
17
+ import { type DiagnosisSourcePage } from './diagnosis.js';
18
+ import { WorkItemContinuation } from './continuation.js';
19
+ import { WorkItemOwnerReplies } from './owner-replies.js';
20
+ import { type OwnerWorkItemFeedbackProof, type OwnerWorkItemFeedbackSelector } from './feedback-targets.js';
21
+ import type { WorkItemReplyConsumerRegistration } from './peers.js';
22
+ /** Bounded, model-facing view of one successful claim. */
23
+ export interface WorkItemClaimView {
24
+ readonly itemId: string;
25
+ readonly runId: string;
26
+ readonly state: string;
27
+ readonly kind: string;
28
+ readonly externalId: string;
29
+ readonly title: string;
30
+ readonly brief: string;
31
+ readonly briefTruncated: boolean;
32
+ readonly acceptanceRef: string | null;
33
+ readonly workDir: string;
34
+ readonly attempt: number;
35
+ readonly maxAttempts: number;
36
+ readonly leaseUntil: number | null;
37
+ readonly replayed: boolean;
38
+ readonly resume: WorkItemResumeContext;
39
+ }
40
+ /** Bounded, model-facing view of one appended report. */
41
+ export interface WorkItemReportView {
42
+ readonly itemId: string;
43
+ readonly revision: number;
44
+ readonly status: WorkItemReportStatus;
45
+ readonly state: string;
46
+ readonly truncated: boolean;
47
+ readonly artifactPaths: readonly string[];
48
+ readonly delivery: string;
49
+ readonly replayed: boolean;
50
+ readonly notified: boolean;
51
+ }
52
+ /** Bounded, read-only view of the current run's item. */
53
+ export interface WorkItemStatusView {
54
+ readonly item: WorkItemRecord;
55
+ readonly claim: WorkItemClaimRecord | undefined;
56
+ readonly reports: readonly WorkItemReportRecord[];
57
+ readonly openItems: number;
58
+ /** Latest independent-outcome revision; `undefined` before any terminal move. */
59
+ readonly outcome: WorkItemOutcomeView | undefined;
60
+ }
61
+ /** One byte-bounded page of an immutable, persisted report. */
62
+ export interface WorkItemReportPage {
63
+ readonly itemId: string;
64
+ readonly revision: number;
65
+ readonly status: WorkItemReportStatus;
66
+ readonly summary: string;
67
+ /** UTF-8 byte offsets into the stored summary, never into arbitrary files. */
68
+ readonly offset: number;
69
+ readonly nextOffset: number | null;
70
+ readonly summaryBytes: number;
71
+ /** Whether the original report was truncated before it entered the ledger. */
72
+ readonly storedTruncated: boolean;
73
+ readonly artifactPaths: readonly string[];
74
+ readonly recordedAt: number;
75
+ readonly previousRevision: number | null;
76
+ readonly nextRevision: number | null;
77
+ }
78
+ export interface WorkItemReportInput {
79
+ readonly status: WorkItemReportStatus;
80
+ readonly summary: string;
81
+ readonly artifactPaths?: readonly string[];
82
+ readonly idempotencyKey: string;
83
+ }
84
+ export interface WorkItemSchedulerWakeHealth {
85
+ /** A listener is installed; this does not attest schedulerEnabled or duty. */
86
+ readonly subscribed: boolean;
87
+ readonly lastWakeAt: number | null;
88
+ readonly lastError: string | null;
89
+ }
90
+ type WorkItemToolExecution = Pick<ToolExecution, 'name' | 'agent' | 'arguments'> & {
91
+ readonly signal?: AbortSignal;
92
+ };
93
+ declare module '@deepseek-ai/cordis' {
94
+ interface Context {
95
+ assistantWorkItems: AssistantWorkItemsService;
96
+ }
97
+ }
98
+ /**
99
+ * Work-item intake kernel.
100
+ *
101
+ * This service owns configuration, the private ledger and identity resolution;
102
+ * it deliberately owns no agent loop, timer, outbox, budget or session. Every
103
+ * side effect is a call into an existing peer plugin (`assistant-automations`
104
+ * for the worker run, `assistant-delivery` for the owner notification), and the
105
+ * disabled default opens no file at all.
106
+ */
107
+ export declare class AssistantWorkItemsService extends Service {
108
+ static Config: import("@deepseek-ai/schemastery").default<Config>;
109
+ private readonly workItemsConfig;
110
+ private readonly workItemsEvaluation;
111
+ /** Host-registered followed-thread sources; empty means no follow can close. */
112
+ private readonly workItemsThreadSources;
113
+ private workItemsFollowDegraded;
114
+ private workItemsComponents;
115
+ private workItemsClosed;
116
+ private workItemsIntakeObserver;
117
+ /** Present only when `intakeLedger.evaluation` is enabled. */
118
+ private readonly workItemsIntakeEvaluation;
119
+ /** Present only when `intakeLedger.evaluation.admit` is enabled. */
120
+ private readonly workItemsIntakeAdmission;
121
+ private readonly workItemsDiagnosisKey;
122
+ private readonly workItemsContinuationKey;
123
+ private readonly workItemsReplyKey;
124
+ private readonly workItemsFeedbackKey;
125
+ private workItemsDiagnosisError;
126
+ private workItemsHasDiagnosisHistory;
127
+ private readonly workItemsSchedulerUnsubscribers;
128
+ private workItemsSchedulerWaking;
129
+ private workItemsSchedulerLastWakeAt;
130
+ private workItemsSchedulerLastError;
131
+ /** In-memory round-robin position of `acceptance.autoSettle`; a restart rescans from the start. */
132
+ private workItemsAutoSettleCursor;
133
+ /** In-memory round-robin position of `acceptance.bindWorkerRun`; a restart rescans from the start. */
134
+ private workItemsBindWorkerRunCursor;
135
+ /** In-memory round-robin position of `acceptance.holdReport`; a restart rescans from the start. */
136
+ private workItemsHeldReportCursor;
137
+ /** itemId → occurrenceId refused deterministically by `bindWorkerRun`; in memory, bounded, dropped on occurrence change. */
138
+ private readonly workItemsBindWorkerRunSkips;
139
+ /**
140
+ * itemId → consecutive `owner-route-drift` streak of `bindWorkerRun` for one
141
+ * occurrence; in memory, bounded. Any other outcome or a new occurrence
142
+ * drops it. Only for visibility: drift is re-read either way.
143
+ */
144
+ private readonly workItemsBindWorkerRunDrifts;
145
+ /** Whether the missing Delivery `inspectOwnerRouteBinding` was already warned about. */
146
+ private workItemsOwnerRouteBindingWarned;
147
+ /** `itemId:row` malformed `acceptance-bound` rows already warned about. */
148
+ private readonly workItemsMalformedBindingWarned;
149
+ private readonly workItemsOwnerReads;
150
+ private readonly workItemsOwnerContinuations;
151
+ constructor(ctx: Context, input: Config);
152
+ /** One native wake may admit at most ten already-due waiting occurrences. */
153
+ private workItemsOnSchedulerWake;
154
+ /**
155
+ * WP21 slice 6: on the same native wake, bind at most `maxPerTick`
156
+ * dispatched items to the acceptance contract their own worker run froze.
157
+ * Automations only names the handle for the exact occurrence; the contract
158
+ * itself is re-read from the verifier and checked against the live owner
159
+ * route. Items whose mandate already binds a contract are never touched.
160
+ * Round-robin like auto-settle. A deterministic refusal parks the
161
+ * (item, occurrence) pair in memory so it is not re-read until the item's
162
+ * occurrence changes; transient ones (no contract yet, peer missing or
163
+ * throwing, Delivery failing other than `missing-binding`) are simply
164
+ * tried again on a later wake. Parked pairs do not consume the per-wake budget.
165
+ */
166
+ private workItemsBindWorkerRuns;
167
+ /**
168
+ * Count consecutive `owner-route-drift` outcomes of one (item, occurrence)
169
+ * and warn once when the streak reaches `WORKER_RUN_DRIFT_WARN_AFTER`: a
170
+ * route that keeps moving between the two Delivery reads would otherwise be
171
+ * re-read silently forever. Any other outcome, including a successful bind,
172
+ * or a new occurrence restarts the streak. Never changes the re-read.
173
+ */
174
+ private workItemsTrackBindWorkerRunDrift;
175
+ /**
176
+ * Warn once per (item, row) about a malformed latest `acceptance-bound`
177
+ * row. The item stays fail-closed (never bound or settled); later reads of
178
+ * the same row stay silent. Returns whether `error` was that condition.
179
+ */
180
+ private workItemsWarnMalformedLateBinding;
181
+ private workItemsBindWorkerRun;
182
+ /**
183
+ * The exact Delivery binding id behind `owner`, read through Delivery's
184
+ * Host-only `inspectOwnerRouteBinding`. Its embedded receipt must equal
185
+ * `owner` field for field, so the id belongs to the very route state just
186
+ * validated. Fails closed without a binding id when Delivery lacks the
187
+ * method (`unsupported`), when the embedded receipt differs from `owner`
188
+ * (`drift`: the route moved between the two reads) or when the answer is
189
+ * malformed; Delivery errors propagate like `validateOwnerRoute`'s.
190
+ */
191
+ private workItemsOwnerRouteBindingId;
192
+ /**
193
+ * WP21 slice 5: on the same native wake, read back at most `maxPerTick`
194
+ * executed, acceptance-bound items without a verdict through the Host-only
195
+ * `settleAcceptance`. Round-robin over an in-memory cursor so items still
196
+ * pending at the verifier cannot starve later ones. Anything short of a
197
+ * validated receipt writes nothing and is simply read again on a later wake.
198
+ */
199
+ private workItemsAutoSettle;
200
+ /**
201
+ * WP21 slice 8 (`acceptance.holdReport`): the mandate binding, or else the
202
+ * latest late binding while it still belongs to the item's current
203
+ * occurrence. A malformed late row throws `storage`; callers decide whether
204
+ * to hold (fail closed) or treat the item as unbound.
205
+ */
206
+ private workItemsAcceptanceBinding;
207
+ /**
208
+ * Whether this report must be held instead of dispatched: `holdReport` is
209
+ * on, it is the terminal `ready` self-report of an executed item, the status
210
+ * is notifiable, and the item already has an independent acceptance binding.
211
+ * An item that has not been bound yet (for example a run that reports before
212
+ * the wake that binds it) is reported normally, exactly as today.
213
+ *
214
+ * A verdict recorded for an earlier generation can never settle this report
215
+ * (the store keeps at most one verdict per item and excludes settled items
216
+ * from auto-settle), so holding it would just wait out `holdTimeoutMs` before
217
+ * releasing it unverified. It is dispatched now, exactly like flag-off.
218
+ * An unreadable verdict row fails closed and holds, like a malformed binding.
219
+ */
220
+ private workItemsHoldsReport;
221
+ /**
222
+ * Whether this `ready` report is still held. Used to imply the verdict gate
223
+ * for held items even when `acceptance.verdictGate` itself is off: the gate
224
+ * must move the item before the held report can be replaced by the blocked
225
+ * one. A malformed binding row fails closed (treated as bound).
226
+ */
227
+ private workItemsReportIsHeld;
228
+ /**
229
+ * WP21 slice 8: on the same native wake, release at most
230
+ * `HELD_REPORT_RELEASE_LIMIT` held reports through an in-memory
231
+ * `(recordedAt, itemId)` round-robin cursor. A full page advances the cursor
232
+ * past rows that are still waiting, so they cannot starve a releasable row
233
+ * behind them; a short page resets it and the next wake restarts from the
234
+ * oldest row. Achievement sends the ordinary report; any other settled
235
+ * verdict (or a verdict-gate `blocked` item) sends a blocked report instead;
236
+ * a still-pending item stays held, and one whose `holdTimeoutMs` elapsed is
237
+ * sent marked unverified. A row with no acceptance binding any more was never
238
+ * really held and is recovered as an ordinary report instead of stranded.
239
+ * One unreadable row (a malformed binding or verdict event) is warned about
240
+ * and skipped without aborting the remaining releases; the fail-closed hold
241
+ * itself is unchanged.
242
+ */
243
+ private workItemsReleaseHeldReports;
244
+ /** Decide one held report without writing: release it, or wait for a later wake. */
245
+ private workItemsHeldRelease;
246
+ get enabled(): boolean;
247
+ get mode(): 'observe' | 'active';
248
+ get diagnosisEnabled(): boolean;
249
+ get ownerContinuationEnabled(): boolean;
250
+ /** Delivery's ownership fence for the single inbound intake observer. */
251
+ ownsInboundIntakeObserver: (observer: unknown) => boolean;
252
+ ownsWorkItemReplyRegistration: (registration: WorkItemReplyConsumerRegistration) => boolean;
253
+ issueOwnerWorkItemFeedbackTarget: (input: OwnerWorkItemFeedbackSelector) => unknown | undefined;
254
+ resolveOwnerWorkItemFeedbackTarget: (capability: unknown) => Readonly<OwnerWorkItemFeedbackProof> | undefined;
255
+ withOwnerWorkItemFeedbackTargetsFence: <T>(capabilities: readonly unknown[], callback: (proofs: readonly (Readonly<OwnerWorkItemFeedbackProof> | undefined)[]) => T) => T;
256
+ issueOwnerWorkItemEngineeringTarget: (feedbackCapability: unknown) => unknown | undefined;
257
+ resolveOwnerWorkItemEngineeringTarget: (capability: unknown) => Readonly<WorkItemEngineeringMaterial> | undefined;
258
+ withOwnerWorkItemEngineeringTargetsFence: <T>(capabilities: readonly unknown[], callback: (materials: readonly (Readonly<WorkItemEngineeringMaterial> | undefined)[]) => T) => T;
259
+ get ownerRecallEnabled(): boolean;
260
+ /** Foreground-only historical reads, independent of occurrence/worker authority. */
261
+ listForOwner: (execution: OwnerWorkItemExecution, input: OwnerWorkItemListInput) => Readonly<{
262
+ nextCursor?: string;
263
+ items: readonly Readonly<{
264
+ lastReport?: import("./types.js").WorkItemResumeReport;
265
+ continuation?: Readonly<{
266
+ parentItemId: string;
267
+ rootItemId: string;
268
+ }>;
269
+ itemId: string;
270
+ kind: string;
271
+ title: string;
272
+ state: string;
273
+ stateReason: string | null;
274
+ attempt: number;
275
+ maxAttempts: number;
276
+ lastReportStatus: string | null;
277
+ observed: boolean;
278
+ createdAt: number;
279
+ updatedAt: number;
280
+ }>[];
281
+ }>;
282
+ recallForOwner: (execution: OwnerWorkItemExecution, input: OwnerWorkItemRecallInput) => Readonly<{
283
+ item: Readonly<import("./owner-recall.js").OwnerWorkItemSummary>;
284
+ content: Readonly<{
285
+ storedTruncated: boolean;
286
+ nextOffset?: number;
287
+ text: string;
288
+ fullBytes: number;
289
+ returnedBytes: number;
290
+ offset: number;
291
+ nextRevision?: number;
292
+ previousRevision?: number;
293
+ reportRevision?: number;
294
+ status?: WorkItemReportStatus;
295
+ recordedAt?: number;
296
+ kind: "brief" | "report";
297
+ }>;
298
+ reports: readonly Readonly<{
299
+ summary: string;
300
+ summaryTruncated: boolean;
301
+ revision: number;
302
+ status: WorkItemReportStatus;
303
+ recordedAt: number;
304
+ }>[];
305
+ reportsTotal: number;
306
+ latestOutcome: import("./types.js").WorkItemResumeOutcome | null;
307
+ }>;
308
+ continueForOwner: (execution: OwnerWorkItemExecution, input: {
309
+ item_id: string;
310
+ }) => Readonly<{
311
+ itemId: string;
312
+ parentItemId: string;
313
+ rootItemId: string;
314
+ state: string;
315
+ replayed: boolean;
316
+ }>;
317
+ /** Bounded admission check; no work-item recovery, writes, dispatch or model. */
318
+ preauthorizeTool(execution: ToolExecution): boolean;
319
+ /** Approval cannot extend the live occurrence/owner mandate at execution. */
320
+ assertToolExecution(execution: WorkItemToolExecution): void;
321
+ private workItemsCheckToolExecution;
322
+ /**
323
+ * Admit one external work signal.
324
+ *
325
+ * Host-side entry point for a future external source plugin. It performs no
326
+ * dispatch work beyond the same bounded wake the ledger does on recovery, so
327
+ * observe mode stays free of external effects.
328
+ */
329
+ admit(input: WorkItemAdmitInput): WorkItemAdmitResult;
330
+ /**
331
+ * Admit one execute decision under a frozen mandate (Host-only, never a tool).
332
+ *
333
+ * Same wake semantics as `admit(...)`. A replayed decision id returns its one
334
+ * existing item; a refusal is a value, not an error, and writes nothing.
335
+ */
336
+ admitDecision(decision: WorkItemExecuteDecision): WorkItemDecisionAdmitResult;
337
+ /**
338
+ * Host-only (WP21): the Policy peer now runs under `policyVersion`.
339
+ *
340
+ * Never cancels, parks or wakes work. Each live item whose frozen mandate
341
+ * basis the current Policy no longer upholds gets one durable notice per
342
+ * version; replaying the same version (for example after a restart) writes
343
+ * nothing new. Uses Policy `evaluate`, so no audit row or budget is spent.
344
+ */
345
+ noticePolicyChange(change: unknown): WorkItemPolicyChangeResult;
346
+ /**
347
+ * Host-only (WP21 slice 4): read a bound item's verdict back from the
348
+ * independent verifier. Takes no verdict input; a worker report, the
349
+ * decision caller or this call's caller can never assert completion. Writes
350
+ * one append-only verdict event once the verifier's receipt validates
351
+ * against the frozen contract; anything short of that writes nothing.
352
+ */
353
+ settleAcceptance(itemId: string): WorkItemAcceptanceSettleResult;
354
+ /** Host-only: the verifier verdict recorded for one item, or null. */
355
+ acceptanceVerdict(itemId: string): WorkItemAcceptanceVerdict | null;
356
+ /** Host-only: every Policy-change notice recorded for one item. */
357
+ policyNotices(itemId: string): readonly WorkItemPolicyNotice[];
358
+ /**
359
+ * Host-only (WP21): a human follow-up on an item's work thread is owned by
360
+ * that item while it is live. An ended item takes nothing (`item-ended`).
361
+ */
362
+ ownFollowUp(input: unknown): WorkItemFollowUpOwnResult;
363
+ /** Host-only: the live item processed one of its owned follow-ups. */
364
+ markFollowUpProcessed(itemId: string, messageId: string): WorkItemFollowUpRecord;
365
+ /** Host-only: follow-ups owned by one item. */
366
+ followUps(itemId: string): readonly WorkItemFollowUpRecord[];
367
+ /**
368
+ * Host-only: release every unprocessed follow-up of an ended item back to
369
+ * judgment and return the newly released ones. No message is sent; the
370
+ * caller decides what judgment does with them.
371
+ */
372
+ releaseFollowUps(limit?: number): readonly WorkItemFollowUpRecord[];
373
+ /** Host-only: released follow-ups in release order (restart-safe re-read). */
374
+ listReleasedFollowUps(options?: {
375
+ limit?: number;
376
+ after?: WorkItemFollowUpCursor;
377
+ }): Readonly<{
378
+ items: readonly WorkItemFollowUpRecord[];
379
+ next: WorkItemFollowUpCursor | null;
380
+ }>;
381
+ /**
382
+ * Record one inbound item's deterministic intake decision (WP20 slice 1).
383
+ *
384
+ * Host-only and metadata-only: the input carries normalized booleans and an
385
+ * optional content digest, never a body. It works in observe mode, writes
386
+ * only the intake ledger, and never admits, wakes or delivers anything. A
387
+ * replay of the same `(source, sourceEventId)` returns the original row.
388
+ */
389
+ recordIntake(input: WorkItemIntakeInput, sourceText?: string): WorkItemIntakeResult;
390
+ /**
391
+ * Host-only: register the injectable WP20 inferred-evaluation supplier
392
+ * (Policy snapshot + model call). Requires `intakeLedger.evaluation`.
393
+ */
394
+ registerIntakeEvaluator(registration: WorkItemIntakeEvaluatorRegistration): () => void;
395
+ /** Host-only drive of one bounded evaluation run; the scheduler wake calls the same path. */
396
+ runIntakeEvaluation(): Promise<readonly WorkItemIntakeEvaluationRecord[]>;
397
+ /**
398
+ * Host-only drive of one bounded admission pass over persisted accepting
399
+ * evaluations (WP21); the scheduler wake calls it after each evaluation run.
400
+ * Requires `intakeLedger.evaluation.admit`; never throws.
401
+ */
402
+ runIntakeAdmission(): readonly WorkItemIntakeAdmissionRecord[];
403
+ /** Durable admission outcomes (`would-admit`, `admitted`, `replayed`, `refused`) for one intake row. */
404
+ intakeAdmissions(source: string, sourceEventId: string): readonly WorkItemIntakeAdmissionRecord[];
405
+ /**
406
+ * Host-only, read-only (WP22): the WP20 intake judgment that admitted one
407
+ * work item, for Evaluation's intake/attention agreement metric. Undefined
408
+ * when the item does not exist or was not admitted from intake
409
+ * (observe-mode `would-admit` never creates an item). Throws `disabled`
410
+ * when the intake ledger is off, so "cannot tell" is never read as "not
411
+ * intake". Carries the item's owner scope and no source text.
412
+ */
413
+ inspectIntakeProvenance(itemId: string): WorkItemIntakeProvenance | undefined;
414
+ /** Persisted evaluation results for one intake row; replay reads these, never re-evaluates. */
415
+ intakeEvaluations(source: string, sourceEventId: string): readonly WorkItemIntakeEvaluationRecord[];
416
+ intakeEvaluationHealth(): WorkItemIntakeEvaluationHealth | undefined;
417
+ /** Explicit Host-only reduction of a canonical work signal; never a model tool or a plan mint. */
418
+ withdraw(input: WorkItemAdmitInput): WorkItemWithdrawResult;
419
+ /**
420
+ * Claim the item bound to the calling automation occurrence.
421
+ *
422
+ * Identity comes exclusively from the frozen, production automation
423
+ * execution context installed by `assistant-automations`; a foreground
424
+ * session, a preview run and another automation all fail closed.
425
+ *
426
+ * An armed signal source is swept here (bounded by the persisted
427
+ * `sweepIntervalMs`) so ordinary use keeps producing work without a timer or
428
+ * developer orchestration. A sweep failure never fails the claim.
429
+ */
430
+ claim(agent: Agent | undefined): WorkItemClaimView;
431
+ /**
432
+ * Append one report revision under the caller's active claim.
433
+ *
434
+ * Reporting is the only worker write path. A terminal status additionally
435
+ * enqueues one owner notification through `assistant-delivery`; a delivery
436
+ * failure is recorded against the report instead of erasing report evidence.
437
+ */
438
+ report(agent: Agent | undefined, input: WorkItemReportInput): Promise<WorkItemReportView>;
439
+ /**
440
+ * Register one additional automatic source and return an idempotent disposer.
441
+ *
442
+ * This is the public extension point for an external signal producer (a
443
+ * repository watcher, a chat bridge, a scheduler): the producer supplies a
444
+ * read-only `WorkItemSignalSource`, gets the same bounded sweep, provenance,
445
+ * dedupe, cooldown and settled-item fence as the built-in adapter, and can be
446
+ * withdrawn by disposing the registration. Registration fails closed when the
447
+ * intake is disabled or already disposed, and never admits retroactively.
448
+ */
449
+ registerSignalSource(registration: WorkItemSignalRegistration): () => void;
450
+ /**
451
+ * Register the only resolver for one followed-thread source.
452
+ *
453
+ * Host-only extension point. Registration is one-per-source, validated
454
+ * synchronously and revoked by the returned disposer. A follow recorded while
455
+ * a source is registered stores that source's generation, so replacing the
456
+ * source later degrades the follow to `unresolved` instead of trusting a
457
+ * stale closure. This adds resolution capability only: it is not authority to
458
+ * end an item, and a closure never claims an objective was achieved.
459
+ */
460
+ registerThreadSource(registration: WorkItemThreadSourceRegistration): () => void;
461
+ /**
462
+ * Trusted Evaluation producer generation (fourth trusted producer).
463
+ *
464
+ * `assistant-evaluation` reads this before registering a sink; returning a
465
+ * fresh value on a new service instance is what makes a stale capability
466
+ * fail closed instead of appending to the wrong host.
467
+ */
468
+ trustedWorkItemProducerGeneration(): string;
469
+ /**
470
+ * Install the Evaluation-owned sink this plugin exports settled outcomes to.
471
+ *
472
+ * The registration is opaque: Evaluation passes its own capability and this
473
+ * plugin only validates the protocol, generation and ownership before using
474
+ * it. Exactly one sink is accepted; the returned disposer withdraws it.
475
+ */
476
+ registerTrustedWorkItemEvaluationSink(registration: Readonly<WorkItemEvaluationRegistration>): () => void;
477
+ /**
478
+ * Sweep every armed automatic source once and report what it did.
479
+ *
480
+ * Explicit host entry point; `force` ignores the persisted interval. The
481
+ * disabled default and a missing optional peer both return an empty report,
482
+ * so a caller never has to special-case activation.
483
+ */
484
+ sweepSignals(force?: boolean): WorkItemSignalSweepReport;
485
+ /**
486
+ * Run one bounded settlement pass over the pending outcome windows.
487
+ *
488
+ * Host-only by design: there is deliberately no model tool for this, so a
489
+ * worker can never settle or launder its own outcome. Returns a report instead
490
+ * of throwing, and a disabled intake returns `skipped: 'disabled'`.
491
+ */
492
+ settleOutcomes(force?: boolean): WorkItemSettlementReport;
493
+ /**
494
+ * Read the latest outcome revision per item, newest first.
495
+ *
496
+ * Host-only projection for status/health consumers; the disabled default
497
+ * returns an empty list rather than opening the ledger.
498
+ */
499
+ outcomes(options?: {
500
+ limit?: number;
501
+ evidenceState?: WorkItemOutcomeEvidenceState;
502
+ }): readonly WorkItemOutcomeView[];
503
+ /** Read-only status of the item bound to the calling occurrence. */
504
+ status(agent: Agent | undefined): WorkItemStatusView;
505
+ /**
506
+ * Recall one report belonging to the caller's exact production occurrence.
507
+ * This path performs no recovery, parking, settlement or ledger mutation.
508
+ */
509
+ readReport(agent: Agent | undefined, input: {
510
+ revision: number;
511
+ offset?: number;
512
+ maxBytes?: number;
513
+ }): WorkItemReportPage;
514
+ readContext(agent: Agent | undefined, input: {
515
+ kind: 'input' | 'parent-brief' | 'parent-report' | 'parent-outcome';
516
+ revision?: number;
517
+ offset?: number;
518
+ maxBytes?: number;
519
+ }): Readonly<{
520
+ nextRevision?: number;
521
+ previousRevision?: number;
522
+ sourceDigest?: string;
523
+ nextOffset?: number;
524
+ parentReportRevision: number | null;
525
+ parentOutcomeRevision: number | null;
526
+ text: string;
527
+ fullTextDigest: string;
528
+ fullBytes: number;
529
+ returnedBytes: number;
530
+ offset: number;
531
+ revision?: number;
532
+ itemId: string;
533
+ parentItemId: string;
534
+ rootItemId: string;
535
+ kind: "input" | "parent-brief" | "parent-report" | "parent-outcome";
536
+ }>;
537
+ private workItemsAssertRuntime;
538
+ readSource(agent: Agent | undefined, input: {
539
+ offset?: number;
540
+ maxBytes?: number;
541
+ }): DiagnosisSourcePage;
542
+ /** Pure SELECT/UTF-8 projection shared by preflight and the read tool. */
543
+ private workItemsReadReportPage;
544
+ /** Bounded health projection; never creates the ledger when disabled. */
545
+ health(): WorkItemHealth & {
546
+ readonly schedulerWake: WorkItemSchedulerWakeHealth;
547
+ readonly diagnosis?: Readonly<{
548
+ enabled: true;
549
+ ready: boolean;
550
+ running: number;
551
+ lastError: string | null;
552
+ interventionRequired: boolean;
553
+ }>;
554
+ readonly ownerContinuation?: ReturnType<WorkItemContinuation['health']>;
555
+ readonly ownerReplyContinuation?: ReturnType<WorkItemOwnerReplies['health']>;
556
+ readonly ownerReportFeedback?: Readonly<{
557
+ enabled: true;
558
+ available: boolean;
559
+ registered: boolean;
560
+ }>;
561
+ };
562
+ /** Close the ledger exactly once; safe on an intake that never opened. */
563
+ close(): void;
564
+ /** Export is possible only from an active intake with settlement armed. */
565
+ private workItemsEvaluationEnabled;
566
+ /** One bounded counts read for the export projection. */
567
+ private workItemsEvaluationHealth;
568
+ /**
569
+ * Health degradation: a settled revision can never reach the trusted lane.
570
+ *
571
+ * A missing optional sink is only a *gap* once something actually awaits
572
+ * export; a deployment that never installs Evaluation must not look degraded
573
+ * while it has nothing to export.
574
+ */
575
+ private workItemsEvaluationDegraded;
576
+ /** Fire-and-forget bounded drain; export failures must never fail a caller. */
577
+ private workItemsDrainEvaluation;
578
+ private workItemsAvailable;
579
+ /** Best-effort bounded sweep; log and continue on any failure. */
580
+ private workItemsSweepQuietly;
581
+ /** Best-effort bounded re-dispatch sweep behind ordinary claim activity. */
582
+ private workItemsWakeQuietly;
583
+ /** Best-effort settlement pass behind ordinary claim activity. */
584
+ private workItemsSettleQuietly;
585
+ /** Build the bounded settlement pass from config; never admits or wakes. */
586
+ private workItemsSettlement;
587
+ /**
588
+ * Resolve one open follow against its registered source.
589
+ *
590
+ * Synchronous and read-only: no timer, no promise, no write. Every refusal
591
+ * returns `unresolved` so the item stays parked and health can name the
592
+ * degradation, rather than a missing source or a stale generation being read
593
+ * as a closure.
594
+ */
595
+ private workItemsResolveThread;
596
+ /** Live follow counts and degradation; never resolves or writes anything. */
597
+ private workItemsFollowHealth;
598
+ /** Degradation visible in health without running a pass or touching SQLite. */
599
+ private workItemsSettlementDegraded;
600
+ private workItemsRequired;
601
+ private workItemsOpen;
602
+ /** Resolve the exact production automation occurrence for this agent. */
603
+ private workItemsOccurrenceId;
604
+ /** Re-anchor a claim against the live owner route above the stored receipt. */
605
+ private workItemsAssertOwnerRoute;
606
+ /**
607
+ * Re-validate the stored admission mandate before this claim is allowed.
608
+ *
609
+ * Policy remains the only authority: the exact admission request is replayed
610
+ * against the live policy under the same idempotency key. A denied, failing
611
+ * or malformed decision parks the item in `waiting` with a typed reason and
612
+ * fails the claim closed; the item is never claimed and never marked failed.
613
+ * A later allow resumes it through the same wake path.
614
+ */
615
+ private workItemsRevalidateAuthority;
616
+ private workItemsAuthorityHealth;
617
+ private workItemsOwnerRouteValid;
618
+ private workItemsPolicy;
619
+ /** Live owner scope for Event Triggers reads; throws when the owner route is unavailable. */
620
+ private workItemsEventFollowOwner;
621
+ private workItemsDelivery;
622
+ private workItemsVerifier;
623
+ private workItemsAutomations;
624
+ }
625
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AACvG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAE5E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAA;AAC5E,OAAO,EAA4D,KAAK,8BAA8B,EAAE,KAAK,mCAAmC,EAAE,MAAM,gCAAgC,CAAA;AACxL,OAAO,EAAiC,KAAK,6BAA6B,EAAE,MAAM,uBAAuB,CAAA;AACzG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAG3D,OAAO,EAAiD,KAAK,MAAM,EAAyB,MAAM,aAAa,CAAA;AAG/G,OAAO,EAA8B,KAAK,8BAA8B,EAAE,MAAM,iBAAiB,CAAA;AASjG,OAAO,EAAuB,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAChJ,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACvI,OAAO,EAA+C,KAAK,sBAAsB,EAAwC,MAAM,YAAY,CAAA;AAG3I,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAGV,8BAA8B,EAC9B,yBAAyB,EACzB,kBAAkB,EAClB,2BAA2B,EAC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