@knpkv/jira-clockify 1.2.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/README.md +254 -3
  2. package/dist/package.json +36 -12
  3. package/dist/src/agent/agentSettings.d.ts +18 -0
  4. package/dist/src/agent/agentSettings.d.ts.map +1 -0
  5. package/dist/src/agent/agentSettings.js +23 -0
  6. package/dist/src/agent/agentSettings.js.map +1 -0
  7. package/dist/src/agent/schedule.d.ts +20 -0
  8. package/dist/src/agent/schedule.d.ts.map +1 -0
  9. package/dist/src/agent/schedule.js +189 -0
  10. package/dist/src/agent/schedule.js.map +1 -0
  11. package/dist/src/agent/sessions.d.ts +427 -0
  12. package/dist/src/agent/sessions.d.ts.map +1 -0
  13. package/dist/src/agent/sessions.js +868 -0
  14. package/dist/src/agent/sessions.js.map +1 -0
  15. package/dist/src/agent/sourceConsumption.d.ts +79 -0
  16. package/dist/src/agent/sourceConsumption.d.ts.map +1 -0
  17. package/dist/src/agent/sourceConsumption.js +191 -0
  18. package/dist/src/agent/sourceConsumption.js.map +1 -0
  19. package/dist/src/agent/watch.d.ts +76 -0
  20. package/dist/src/agent/watch.d.ts.map +1 -0
  21. package/dist/src/agent/watch.js +45 -0
  22. package/dist/src/agent/watch.js.map +1 -0
  23. package/dist/src/agent/writePlanning.d.ts +154 -0
  24. package/dist/src/agent/writePlanning.d.ts.map +1 -0
  25. package/dist/src/agent/writePlanning.js +210 -0
  26. package/dist/src/agent/writePlanning.js.map +1 -0
  27. package/dist/src/bin.d.ts +3 -0
  28. package/dist/src/bin.d.ts.map +1 -0
  29. package/dist/src/bin.js +9 -3
  30. package/dist/src/bin.js.map +1 -1
  31. package/dist/src/cli/agentWrite.d.ts +164 -0
  32. package/dist/src/cli/agentWrite.d.ts.map +1 -0
  33. package/dist/src/cli/agentWrite.js +362 -0
  34. package/dist/src/cli/agentWrite.js.map +1 -0
  35. package/dist/src/cli/auth.d.ts +8 -0
  36. package/dist/src/cli/auth.d.ts.map +1 -0
  37. package/dist/src/cli/auth.js +10 -10
  38. package/dist/src/cli/auth.js.map +1 -1
  39. package/dist/src/cli/calendar.d.ts +42 -0
  40. package/dist/src/cli/calendar.d.ts.map +1 -0
  41. package/dist/src/cli/calendar.js +189 -0
  42. package/dist/src/cli/calendar.js.map +1 -0
  43. package/dist/src/cli/config.d.ts +12 -0
  44. package/dist/src/cli/config.d.ts.map +1 -0
  45. package/dist/src/cli/config.js +163 -21
  46. package/dist/src/cli/config.js.map +1 -1
  47. package/dist/src/cli/fetchTicket.d.ts +51 -0
  48. package/dist/src/cli/fetchTicket.d.ts.map +1 -0
  49. package/dist/src/cli/fetchTicket.js +18 -2
  50. package/dist/src/cli/fetchTicket.js.map +1 -1
  51. package/dist/src/cli/fuzzySelect.d.ts +24 -0
  52. package/dist/src/cli/fuzzySelect.d.ts.map +1 -0
  53. package/dist/src/cli/layers.d.ts +40 -0
  54. package/dist/src/cli/layers.d.ts.map +1 -0
  55. package/dist/src/cli/layers.js +56 -12
  56. package/dist/src/cli/layers.js.map +1 -1
  57. package/dist/src/cli/list.d.ts +8 -0
  58. package/dist/src/cli/list.d.ts.map +1 -0
  59. package/dist/src/cli/list.js +2 -2
  60. package/dist/src/cli/list.js.map +1 -1
  61. package/dist/src/cli/reconcile.d.ts +129 -0
  62. package/dist/src/cli/reconcile.d.ts.map +1 -0
  63. package/dist/src/cli/reconcile.js +635 -46
  64. package/dist/src/cli/reconcile.js.map +1 -1
  65. package/dist/src/cli/root.d.ts +15 -0
  66. package/dist/src/cli/root.d.ts.map +1 -0
  67. package/dist/src/cli/root.js +4 -3
  68. package/dist/src/cli/root.js.map +1 -1
  69. package/dist/src/cli/runtimeFailure.d.ts +10 -0
  70. package/dist/src/cli/runtimeFailure.d.ts.map +1 -0
  71. package/dist/src/cli/runtimeFailure.js +17 -0
  72. package/dist/src/cli/runtimeFailure.js.map +1 -0
  73. package/dist/src/cli/setup.d.ts +10 -0
  74. package/dist/src/cli/setup.d.ts.map +1 -0
  75. package/dist/src/cli/setup.js +7 -7
  76. package/dist/src/cli/setup.js.map +1 -1
  77. package/dist/src/cli/timer/discard.d.ts +4 -0
  78. package/dist/src/cli/timer/discard.d.ts.map +1 -0
  79. package/dist/src/cli/timer/discard.js +2 -2
  80. package/dist/src/cli/timer/discard.js.map +1 -1
  81. package/dist/src/cli/timer/edit.d.ts +22 -0
  82. package/dist/src/cli/timer/edit.d.ts.map +1 -0
  83. package/dist/src/cli/timer/edit.js +62 -42
  84. package/dist/src/cli/timer/edit.js.map +1 -1
  85. package/dist/src/cli/timer/index.d.ts +12 -0
  86. package/dist/src/cli/timer/index.d.ts.map +1 -0
  87. package/dist/src/cli/timer/log.d.ts +16 -0
  88. package/dist/src/cli/timer/log.d.ts.map +1 -0
  89. package/dist/src/cli/timer/log.js +6 -6
  90. package/dist/src/cli/timer/log.js.map +1 -1
  91. package/dist/src/cli/timer/start.d.ts +21 -0
  92. package/dist/src/cli/timer/start.d.ts.map +1 -0
  93. package/dist/src/cli/timer/start.js +9 -9
  94. package/dist/src/cli/timer/start.js.map +1 -1
  95. package/dist/src/cli/timer/status.d.ts +22 -0
  96. package/dist/src/cli/timer/status.d.ts.map +1 -0
  97. package/dist/src/cli/timer/status.js +110 -71
  98. package/dist/src/cli/timer/status.js.map +1 -1
  99. package/dist/src/cli/timer/stop.d.ts +48 -0
  100. package/dist/src/cli/timer/stop.d.ts.map +1 -0
  101. package/dist/src/cli/timer/stop.js +19 -19
  102. package/dist/src/cli/timer/stop.js.map +1 -1
  103. package/dist/src/cli/timer.d.ts +11 -0
  104. package/dist/src/cli/timer.d.ts.map +1 -0
  105. package/dist/src/cli/timer.js +1 -1
  106. package/dist/src/cli/timer.js.map +1 -1
  107. package/dist/src/cli/watch.d.ts +54 -0
  108. package/dist/src/cli/watch.d.ts.map +1 -0
  109. package/dist/src/cli/watch.js +412 -0
  110. package/dist/src/cli/watch.js.map +1 -0
  111. package/dist/src/cli/watchLease.d.ts +99 -0
  112. package/dist/src/cli/watchLease.d.ts.map +1 -0
  113. package/dist/src/cli/watchLease.js +204 -0
  114. package/dist/src/cli/watchLease.js.map +1 -0
  115. package/dist/src/cli/writerGuard.d.ts +37 -0
  116. package/dist/src/cli/writerGuard.d.ts.map +1 -0
  117. package/dist/src/cli/writerGuard.js +92 -0
  118. package/dist/src/cli/writerGuard.js.map +1 -0
  119. package/dist/src/index.d.ts +46 -0
  120. package/dist/src/index.d.ts.map +1 -0
  121. package/dist/src/index.js +46 -0
  122. package/dist/src/index.js.map +1 -0
  123. package/dist/src/main.d.ts +4 -0
  124. package/dist/src/main.d.ts.map +1 -0
  125. package/dist/src/services/AgentSessionReader.d.ts +121 -0
  126. package/dist/src/services/AgentSessionReader.d.ts.map +1 -0
  127. package/dist/src/services/AgentSessionReader.js +392 -0
  128. package/dist/src/services/AgentSessionReader.js.map +1 -0
  129. package/dist/src/services/ClockifyAuth.d.ts +47 -0
  130. package/dist/src/services/ClockifyAuth.d.ts.map +1 -0
  131. package/dist/src/services/ClockifyAuth.js +2 -2
  132. package/dist/src/services/ClockifyAuth.js.map +1 -1
  133. package/dist/src/services/CodexTranscript.d.ts +112 -0
  134. package/dist/src/services/CodexTranscript.d.ts.map +1 -0
  135. package/dist/src/services/CodexTranscript.js +96 -0
  136. package/dist/src/services/CodexTranscript.js.map +1 -0
  137. package/dist/src/services/ConfigService.d.ts +99 -0
  138. package/dist/src/services/ConfigService.d.ts.map +1 -0
  139. package/dist/src/services/ConfigService.js +79 -7
  140. package/dist/src/services/ConfigService.js.map +1 -1
  141. package/dist/src/services/HomeDirectory.d.ts +17 -0
  142. package/dist/src/services/HomeDirectory.d.ts.map +1 -0
  143. package/dist/src/services/HomeDirectory.js +1 -1
  144. package/dist/src/services/IssueFacts.d.ts +127 -0
  145. package/dist/src/services/IssueFacts.d.ts.map +1 -0
  146. package/dist/src/services/IssueFacts.js +277 -0
  147. package/dist/src/services/IssueFacts.js.map +1 -0
  148. package/dist/src/services/ProviderDeletion.d.ts +19 -0
  149. package/dist/src/services/ProviderDeletion.d.ts.map +1 -0
  150. package/dist/src/services/ProviderDeletion.js +37 -0
  151. package/dist/src/services/ProviderDeletion.js.map +1 -0
  152. package/dist/src/services/ReconcileService.d.ts +378 -0
  153. package/dist/src/services/ReconcileService.d.ts.map +1 -0
  154. package/dist/src/services/ReconcileService.js +1270 -79
  155. package/dist/src/services/ReconcileService.js.map +1 -1
  156. package/dist/src/services/SavedEntries.d.ts +40 -0
  157. package/dist/src/services/SavedEntries.d.ts.map +1 -0
  158. package/dist/src/services/SavedEntries.js +209 -0
  159. package/dist/src/services/SavedEntries.js.map +1 -0
  160. package/dist/src/services/SessionAttributor.d.ts +114 -0
  161. package/dist/src/services/SessionAttributor.d.ts.map +1 -0
  162. package/dist/src/services/SessionAttributor.js +240 -0
  163. package/dist/src/services/SessionAttributor.js.map +1 -0
  164. package/dist/src/services/SourceLedger.d.ts +104 -0
  165. package/dist/src/services/SourceLedger.d.ts.map +1 -0
  166. package/dist/src/services/SourceLedger.js +302 -0
  167. package/dist/src/services/SourceLedger.js.map +1 -0
  168. package/dist/src/services/StateWriter.d.ts +39 -0
  169. package/dist/src/services/StateWriter.d.ts.map +1 -0
  170. package/dist/src/services/TicketService.d.ts +63 -0
  171. package/dist/src/services/TicketService.d.ts.map +1 -0
  172. package/dist/src/services/TimerService.d.ts +145 -0
  173. package/dist/src/services/TimerService.d.ts.map +1 -0
  174. package/dist/src/services/TimerService.js +113 -80
  175. package/dist/src/services/TimerService.js.map +1 -1
  176. package/dist/src/services/internal/JiraWorklogPost.d.ts +7 -0
  177. package/dist/src/services/internal/JiraWorklogPost.d.ts.map +1 -0
  178. package/dist/src/services/internal/JiraWorklogPost.js +32 -0
  179. package/dist/src/services/internal/JiraWorklogPost.js.map +1 -0
  180. package/dist/src/testing/fakeHeadless.d.ts +318 -0
  181. package/dist/src/testing/fakeHeadless.d.ts.map +1 -0
  182. package/dist/src/testing/fakeHeadless.js +1149 -0
  183. package/dist/src/testing/fakeHeadless.js.map +1 -0
  184. package/dist/src/tui/App.d.ts +6 -0
  185. package/dist/src/tui/App.d.ts.map +1 -0
  186. package/dist/src/tui/App.js +1 -1
  187. package/dist/src/tui/App.js.map +1 -1
  188. package/dist/src/tui/atoms/runtime.d.ts +8 -0
  189. package/dist/src/tui/atoms/runtime.d.ts.map +1 -0
  190. package/dist/src/tui/atoms/runtime.js +1 -1
  191. package/dist/src/tui/atoms/runtime.js.map +1 -1
  192. package/dist/src/tui/atoms/tickets.d.ts +3 -0
  193. package/dist/src/tui/atoms/tickets.d.ts.map +1 -0
  194. package/dist/src/tui/atoms/timer.d.ts +11 -0
  195. package/dist/src/tui/atoms/timer.d.ts.map +1 -0
  196. package/dist/src/tui/atoms/timer.js +1 -1
  197. package/dist/src/tui/atoms/timer.js.map +1 -1
  198. package/dist/src/tui/atoms/ui.d.ts +11 -0
  199. package/dist/src/tui/atoms/ui.d.ts.map +1 -0
  200. package/dist/src/tui/atoms/ui.js +1 -1
  201. package/dist/src/tui/atoms/ui.js.map +1 -1
  202. package/dist/src/tui/components/BigTimer.d.ts +2 -0
  203. package/dist/src/tui/components/BigTimer.d.ts.map +1 -0
  204. package/dist/src/tui/components/Footer.d.ts +2 -0
  205. package/dist/src/tui/components/Footer.d.ts.map +1 -0
  206. package/dist/src/tui/components/Header.d.ts +2 -0
  207. package/dist/src/tui/components/Header.d.ts.map +1 -0
  208. package/dist/src/tui/components/Header.js +1 -1
  209. package/dist/src/tui/components/Header.js.map +1 -1
  210. package/dist/src/tui/components/PopupInput.d.ts +18 -0
  211. package/dist/src/tui/components/PopupInput.d.ts.map +1 -0
  212. package/dist/src/tui/components/PopupMessage.d.ts +20 -0
  213. package/dist/src/tui/components/PopupMessage.d.ts.map +1 -0
  214. package/dist/src/tui/components/TicketList.d.ts +2 -0
  215. package/dist/src/tui/components/TicketList.d.ts.map +1 -0
  216. package/dist/src/tui/components/TicketList.js +1 -1
  217. package/dist/src/tui/components/TicketList.js.map +1 -1
  218. package/dist/src/tui/components/TicketRow.d.ts +8 -0
  219. package/dist/src/tui/components/TicketRow.d.ts.map +1 -0
  220. package/dist/src/tui/components/TimerDisplay.d.ts +2 -0
  221. package/dist/src/tui/components/TimerDisplay.d.ts.map +1 -0
  222. package/dist/src/tui/components/index.d.ts +12 -0
  223. package/dist/src/tui/components/index.d.ts.map +1 -0
  224. package/dist/src/tui/context/theme.d.ts +15 -0
  225. package/dist/src/tui/context/theme.d.ts.map +1 -0
  226. package/dist/src/tui/hooks/useElapsedTimer.d.ts +6 -0
  227. package/dist/src/tui/hooks/useElapsedTimer.d.ts.map +1 -0
  228. package/dist/src/tui/hooks/useElapsedTimer.js +1 -1
  229. package/dist/src/tui/hooks/useElapsedTimer.js.map +1 -1
  230. package/dist/src/tui/hooks/useTerminalSize.d.ts +5 -0
  231. package/dist/src/tui/hooks/useTerminalSize.d.ts.map +1 -0
  232. package/dist/src/utils/hints.d.ts +12 -0
  233. package/dist/src/utils/hints.d.ts.map +1 -0
  234. package/dist/src/utils/hints.js +12 -0
  235. package/dist/src/utils/hints.js.map +1 -0
  236. package/dist/src/utils/time.d.ts +104 -0
  237. package/dist/src/utils/time.d.ts.map +1 -0
  238. package/dist/src/utils/time.js +74 -8
  239. package/dist/src/utils/time.js.map +1 -1
  240. package/dist/tsconfig.tsbuildinfo +1 -1
  241. package/nvim/lua/jcf/state.lua +191 -13
  242. package/package.json +36 -18
  243. package/skills/jcf/SKILL.md +93 -1
@@ -0,0 +1,378 @@
1
+ import { JiraApiClient } from "@knpkv/jira-api-client";
2
+ import { JiraAuth } from "@knpkv/jira-cli/JiraAuth";
3
+ import * as Context from "effect/Context";
4
+ import * as Effect from "effect/Effect";
5
+ import * as FileSystem from "effect/FileSystem";
6
+ import * as HttpClient from "effect/http/HttpClient";
7
+ import * as Layer from "effect/Layer";
8
+ import * as Path from "effect/Path";
9
+ import { type ReconcileSides, type SessionProposal, type TicketDayCredit, type UnattributedDayCredit } from "../agent/sessions.js";
10
+ import * as SourceConsumption from "../agent/sourceConsumption.js";
11
+ import { localDay } from "../utils/time.js";
12
+ import { AgentSessionReader } from "./AgentSessionReader.js";
13
+ import { ClockifyAuth } from "./ClockifyAuth.js";
14
+ import { ConfigService } from "./ConfigService.js";
15
+ import { HomeDirectory } from "./HomeDirectory.js";
16
+ import { type RecordedEntry } from "./SavedEntries.js";
17
+ import { SessionAttributor } from "./SessionAttributor.js";
18
+ import { SourceLedger } from "./SourceLedger.js";
19
+ import { type JiraWorklogOutcome, TimerService } from "./TimerService.js";
20
+ export type { RecordedEntry } from "./SavedEntries.js";
21
+ /** Server-private source evidence supplied only by the confirmed agent planner. */
22
+ export interface SourceSegment {
23
+ readonly rowId: string;
24
+ readonly sourceStartMs: number;
25
+ readonly startMs: number;
26
+ readonly endMs: number;
27
+ readonly seconds: number;
28
+ /** Server-held identity expected by a retained confirmation, never a browser field. */
29
+ readonly expectedScope?: string | undefined;
30
+ /** Provider identity that supplied this source evidence, checked again before the target write. */
31
+ readonly expectedSource?: {
32
+ readonly provider: "clockify" | "jira";
33
+ readonly scope: string;
34
+ } | undefined;
35
+ }
36
+ /** Private provider/account identity for a retained read. Never serialize it to the week DTO. */
37
+ export interface ProviderScopes {
38
+ readonly clockify: string | null;
39
+ readonly jira: string | null;
40
+ }
41
+ /** Server-private reason Jira cannot currently authorize source-backed writes. */
42
+ export type JiraAvailability = "verified" | "not-logged-in" | "unverified";
43
+ /** A durable source write can be refused before Jira is called when its account cannot be verified. */
44
+ export type JiraWriteOutcome = JiraWorklogOutcome | {
45
+ readonly _tag: "VerificationUnavailable";
46
+ };
47
+ /** Which side is the source of truth when filling a gap. */
48
+ export type ReconcileDirection = "clockify-to-jira" | "jira-to-clockify";
49
+ /** Re-exported so a caller of {@link ReconcileServiceContract} needs one import, not two. */
50
+ export type { ReconcileSides } from "../agent/sessions.js";
51
+ export { bothSides } from "../agent/sessions.js";
52
+ /** A half-open period [from, to). */
53
+ export interface ReconcilePeriod {
54
+ readonly from: Date;
55
+ readonly to: Date;
56
+ }
57
+ /** When one recorded entry says the work happened, and which system says so. */
58
+ export interface RecordedInterval {
59
+ readonly entry?: RecordedEntry;
60
+ readonly startMs: number;
61
+ readonly endMs: number;
62
+ readonly source: "clockify" | "jira";
63
+ }
64
+ /** One `(ticket, day)` bucket with the time logged on each side. */
65
+ export interface ReconcileRow {
66
+ readonly ticketKey: string;
67
+ /** Local calendar day, `YYYY-MM-DD`. */
68
+ readonly day: string;
69
+ readonly clockifySeconds: number;
70
+ readonly jiraSeconds: number;
71
+ /**
72
+ * When the recorded time happened, ascending — the entries behind the totals rather than a
73
+ * replacement for them. The totals stay authoritative on *how much*: a Jira worklog states a
74
+ * duration from its start, so its interval is derived rather than observed, and an entry crossing
75
+ * local midnight contributes one interval to each day it touches.
76
+ *
77
+ * Carried because a week drawn as a calendar needs to know *when*, and the tally that answers
78
+ * "how much" reads these anyway before summing them away.
79
+ */
80
+ readonly intervals: ReadonlyArray<RecordedInterval>;
81
+ /**
82
+ * The Clockify entry description(s) for this bucket, ticket-prefix stripped and combined.
83
+ * Used as the Jira worklog comment when filling clockify→jira. null when nothing meaningful.
84
+ */
85
+ readonly clockifyDescription: string | null;
86
+ }
87
+ /** Private write provenance for one direction row. Never serialized to an HTTP client. */
88
+ export type DirectionSourceDecision = {
89
+ readonly _tag: "Ordinary";
90
+ } | {
91
+ readonly _tag: "Bound";
92
+ readonly source: SourceSegment;
93
+ readonly startedAt: Date;
94
+ } | {
95
+ readonly _tag: "Refused";
96
+ readonly message: string;
97
+ };
98
+ /** One complete direction read whose private provider evidence remains attached to its resolver. */
99
+ export interface DirectionComparison {
100
+ readonly rows: ReadonlyArray<ReconcileRow>;
101
+ readonly resolveSource: (row: ReconcileRow, direction: ReconcileDirection, seconds: number) => Effect.Effect<DirectionSourceDecision, ReconcileError>;
102
+ }
103
+ declare const ReconcileError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
104
+ readonly _tag: "ReconcileError";
105
+ } & Readonly<A>;
106
+ export declare class ReconcileError extends ReconcileError_base<{
107
+ readonly message: string;
108
+ readonly cause?: unknown;
109
+ }> {
110
+ }
111
+ /** A day withheld from proposals, with the reason stated so it never reads as "nothing to log". */
112
+ export interface ExcludedDay {
113
+ readonly day: string;
114
+ readonly reason: string;
115
+ }
116
+ /**
117
+ * How far attribution may go. `"deterministic"` stops at branch, path, and Standing Attribution;
118
+ * `"full"` also wakes a Coding Agent for whatever those leave unplaced.
119
+ */
120
+ export type AttributionMode = "full" | "deterministic";
121
+ /** What a Coding Agent decided about one session, as reported to a progress listener. */
122
+ export type AttributionOutcome = {
123
+ readonly _tag: "Placed";
124
+ readonly ticketKey: string;
125
+ readonly confidence: number;
126
+ } | {
127
+ readonly _tag: "Declined";
128
+ } | {
129
+ readonly _tag: "Unavailable";
130
+ readonly message: string;
131
+ };
132
+ /**
133
+ * Progress a caller can report while a run is working, including live visible agent output.
134
+ * `AgentActivity` carries batch identity while a call is pending; it never advances completion counts.
135
+ *
136
+ * `SessionAttributed` fires per completed call rather than only at the end: the calls take tens of
137
+ * seconds each, so a start-and-finish pair leaves minutes of silence in between — which is
138
+ * indistinguishable from a hang, and was in fact reported as one.
139
+ */
140
+ export type SessionProposalProgress = {
141
+ readonly _tag: "AgentActivity";
142
+ readonly batch: number;
143
+ readonly batches: number;
144
+ readonly kind: "status" | "text" | "request" | "response";
145
+ readonly text: string;
146
+ } | {
147
+ readonly _tag: "ReadingRecordedTime";
148
+ readonly sides: ReconcileSides;
149
+ } | {
150
+ readonly _tag: "SessionsRead";
151
+ readonly count: number;
152
+ } | {
153
+ readonly _tag: "AttributingSessions";
154
+ readonly count: number;
155
+ /** Calls this will take. Fewer than `count`, because sessions are batched into each call. */
156
+ readonly calls: number;
157
+ } | {
158
+ readonly _tag: "SessionAttributed";
159
+ readonly done: number;
160
+ readonly total: number;
161
+ /** Where the session ran, so the line names something recognisable rather than a UUID. */
162
+ readonly gitBranch: string | null;
163
+ readonly cwd: string;
164
+ readonly outcome: AttributionOutcome;
165
+ } | {
166
+ readonly _tag: "SessionsAttributed";
167
+ readonly placed: number;
168
+ readonly declined: number;
169
+ readonly unavailable: number;
170
+ };
171
+ /**
172
+ * Everything one `--agent` run derived. Deliberately reports more than it proposes: hours that
173
+ * could not be placed, or were placed with too little confidence, stay visible instead of being
174
+ * dropped.
175
+ */
176
+ /** Closed Clockify time without a Jira key. Visible, but never a reconciliation candidate. */
177
+ export interface UnlinkedClockifyEntry {
178
+ readonly entry?: RecordedEntry;
179
+ readonly day: string;
180
+ readonly seconds: number;
181
+ readonly description: string | null;
182
+ readonly startMs: number;
183
+ readonly endMs: number;
184
+ }
185
+ export interface SessionProposalReport {
186
+ /** Original per-session activity windows, before ticket/day merging; retained for saved-entry correlation. */
187
+ readonly sessionEvidence?: ReadonlyArray<{
188
+ readonly sessionId: string;
189
+ readonly ticketKey: string | null;
190
+ readonly spans: ReadonlyArray<{
191
+ readonly startMs: number;
192
+ readonly endMs: number;
193
+ }>;
194
+ }>;
195
+ /** Credited session evidence before subtracting logged time or excluding running-timer days. */
196
+ readonly attributed: ReadonlyArray<TicketDayCredit>;
197
+ /** Proposed Worklogs, ready for row-by-row confirmation. */
198
+ readonly proposals: ReadonlyArray<SessionProposal>;
199
+ /**
200
+ * What Clockify and Jira already hold over the period, bucketed by Issue Key and day — the same
201
+ * rows {@link ReconcileServiceContract.compare} returns, including buckets no session evidences.
202
+ *
203
+ * On the report because a run already reads both sides to size its proposals: a surface that shows
204
+ * allocated time beside proposable time would otherwise tally two remote services a second time to
205
+ * learn what this one already knows.
206
+ */
207
+ readonly recorded: ReadonlyArray<ReconcileRow>;
208
+ readonly unlinkedClockify: ReadonlyArray<UnlinkedClockifyEntry>;
209
+ /** Server-private ID-verified source links, projected without provider/account identifiers. */
210
+ readonly sourceEntries?: ReadonlyArray<SourceConsumption.ResolvedEntry> | undefined;
211
+ /** Provider identities used by this read, held only on the server. */
212
+ readonly sourceScopes?: ProviderScopes | undefined;
213
+ /** Jira write authority for this read. Compatibility totals never upgrade this value. */
214
+ readonly jiraAvailability?: JiraAvailability | undefined;
215
+ /** Which systems this run read. A side that is out reports zero because it was never asked. */
216
+ readonly sides: ReconcileSides;
217
+ /** Attributed below the confidence floor — reported, never offered. */
218
+ readonly withheld: ReadonlyArray<TicketDayCredit>;
219
+ /** Hours no Attribution Signal could place. */
220
+ readonly unattributed: ReadonlyArray<UnattributedDayCredit>;
221
+ readonly excludedDays: ReadonlyArray<ExcludedDay>;
222
+ /** False when a Coding Agent was needed for at least one session but could not be reached. */
223
+ readonly attributorAvailable: boolean;
224
+ /** In-scope Agent Sessions read for this window. */
225
+ readonly sessionCount: number;
226
+ /** Configured Session Roots. Zero means nothing is opted in, which is the usual reason for an empty run. */
227
+ readonly sessionRootCount: number;
228
+ /**
229
+ * Coding Agent *calls* this run made — not sessions asked. Sessions are batched, so a week that
230
+ * needs seven attributions costs one or two calls. Zero on a day of ticket-branch work.
231
+ */
232
+ readonly attributorCalls: number;
233
+ /**
234
+ * Digest by session id, for the sessions behind these rows.
235
+ *
236
+ * Carried on the report because describing a row's work needs its prompts, and by the time a user
237
+ * has confirmed a row the transcripts have long since been read. Reading them twice to answer a
238
+ * question the first pass could already answer would be the only alternative.
239
+ */
240
+ readonly digests: ReadonlyMap<string, string>;
241
+ }
242
+ /**
243
+ * Provider totals that may size a write. Compatibility Jira rows remain visible, but cannot settle
244
+ * an executable gap until the same credential and account have been verified.
245
+ *
246
+ * @internal
247
+ */
248
+ export declare const recordedForExecution: (recorded: ReadonlyArray<ReconcileRow>, jiraAvailability: JiraAvailability | undefined) => ReadonlyArray<ReconcileRow>;
249
+ export interface RefreshRecordedOptions {
250
+ /** Jira issues that must be read directly even when its eventually consistent JQL omits them. */
251
+ readonly jiraIssueKeys?: ReadonlyArray<string> | undefined;
252
+ }
253
+ export interface ReconcileServiceContract {
254
+ /** Recheck provider totals and running timers using already attributed session evidence. */
255
+ readonly refreshRecordedTime: (period: ReconcilePeriod, previous: SessionProposalReport, options?: RefreshRecordedOptions | undefined) => Effect.Effect<SessionProposalReport, ReconcileError>;
256
+ /**
257
+ * Compare Clockify entries and Jira worklogs over the period, bucketed by ticket+day.
258
+ *
259
+ * `sides` narrows which systems are read. A side that is out is never called, and reports zero
260
+ * — which is why every caller that subtracts these totals must know the sides it asked for.
261
+ */
262
+ readonly compare: (period: ReconcilePeriod, options?: {
263
+ readonly sides?: ReconcileSides | undefined;
264
+ }) => Effect.Effect<ReadonlyArray<ReconcileRow>, ReconcileError>;
265
+ /** Read direction rows and retain their private provider evidence for provenance resolution. */
266
+ readonly compareDirection: (period: ReconcilePeriod) => Effect.Effect<DirectionComparison, ReconcileError>;
267
+ /**
268
+ * Post `seconds` of work to Jira for `(ticketKey, day)`, with an optional worklog comment.
269
+ *
270
+ * `startedAt` anchors the worklog to when the work actually began. Without it the entry lands at
271
+ * local noon, which is all a direction-mode row knows — it has a day and a duration and no
272
+ * interval. Agent mode does know, so it says so rather than inventing a midday block.
273
+ */
274
+ readonly applyToJira: (ticketKey: string, day: string, seconds: number, comment?: string, startedAt?: Date, source?: SourceSegment) => Effect.Effect<JiraWriteOutcome>;
275
+ /**
276
+ * Create a closed Clockify entry of `seconds` for `(ticketKey, day)`. Resolves true on success.
277
+ *
278
+ * `note` records where the time came from. It is provenance for a human reading the entry months
279
+ * later, never load-bearing: editing it in Clockify's web UI must not re-enable double-logging,
280
+ * because the tally keys on the `[KEY]` prefix and the day, not on this text.
281
+ */
282
+ readonly applyToClockify: (ticketKey: string, day: string, seconds: number, note?: string, startedAt?: Date, source?: SourceSegment) => Effect.Effect<boolean, ReconcileError>;
283
+ /**
284
+ * One sentence per proposal saying what was worked on, read off the sessions behind it.
285
+ *
286
+ * Asked *after* rows are confirmed, so nothing is spent describing a row nobody writes. Total: a
287
+ * failure, a timeout or an unreachable Coding Agent yields nulls rather than an error — a missing
288
+ * sentence must never cost a write that is otherwise correct.
289
+ */
290
+ readonly describeProposals: (options: {
291
+ readonly proposals: ReadonlyArray<SessionProposal>;
292
+ readonly digests: ReadonlyMap<string, string>;
293
+ readonly summaries?: ReadonlyMap<string, string> | undefined;
294
+ /** Called when a degraded null came from provider failure rather than a valid empty answer. */
295
+ readonly onUnavailable?: ((message: string) => Effect.Effect<void>) | undefined;
296
+ }) => Effect.Effect<ReadonlyArray<string | null>>;
297
+ /**
298
+ * Derive Proposed Worklogs from local Agent Sessions over the period. Reads only — writing a
299
+ * confirmed proposal goes back through {@link applyToJira} and {@link applyToClockify}, so no
300
+ * second write path exists.
301
+ */
302
+ readonly proposeFromSessions: (period: ReconcilePeriod, options?: {
303
+ /** Reported as the run progresses. Consulting a Coding Agent is slow enough to need this. */
304
+ readonly onProgress?: (progress: SessionProposalProgress) => Effect.Effect<void>;
305
+ /**
306
+ * Which Attribution Signals may be spent on. `"deterministic"` never wakes a Coding Agent, so
307
+ * a session no branch, path, or Standing Attribution places is reported as unattributed rather
308
+ * than guessed at. Default `"full"`.
309
+ *
310
+ * This is the knob a *repeating* caller needs: a session's Issue Key does not change, so
311
+ * re-asking a model for it on every tick spends a call a minute to be told the same thing.
312
+ */
313
+ readonly attribution?: AttributionMode;
314
+ /**
315
+ * Which systems this run is about. Both by default.
316
+ *
317
+ * A side that is out is not read, proposed for, or written to. For someone who tracks in one
318
+ * system that is the difference between a working run and a run that fails on a service they
319
+ * do not use.
320
+ */
321
+ readonly sides?: ReconcileSides | undefined;
322
+ }) => Effect.Effect<SessionProposalReport, ReconcileError>;
323
+ }
324
+ declare const ReconcileService_base: Context.ServiceClass<ReconcileService, "jcf/ReconcileService", ReconcileServiceContract>;
325
+ export declare class ReconcileService extends ReconcileService_base {
326
+ }
327
+ /**
328
+ * One digest per proposal: the sessions behind it, joined and bounded.
329
+ *
330
+ * Bounded twice over — each session's digest is already capped when the transcript is read, and a
331
+ * bucket that ran across several sessions is truncated again here, because a prompt that grows with
332
+ * the number of sessions in a day is a prompt that eventually times out.
333
+ */
334
+ export declare const bucketDigest: (proposal: Pick<SessionProposal, "sessionIds">, digests: ReadonlyMap<string, string>) => string;
335
+ /**
336
+ * Standing Attributions with `~` resolved, so the form the config command stores actually matches.
337
+ *
338
+ * `jcf config set session-ticket ~/dev/docs PROJ-42` deliberately keeps the `~` — a config file that
339
+ * reads back the way it was typed is the point — but attribution compares against an absolute
340
+ * working directory, where `~/dev/docs` can never match anything. Session Roots have always been
341
+ * expanded on read for exactly this reason; this is the same treatment for the other prefix.
342
+ */
343
+ export declare const expandedStandingMap: (map: Readonly<Record<string, string>>, home: string) => Record<string, string>;
344
+ /** Parse a ticket key from a Clockify description (`[KEY] summary` or `KEY: summary`). */
345
+ export declare const parseTicketKey: (description: string | null | undefined) => string | null;
346
+ /**
347
+ * Local calendar day (`YYYY-MM-DD`) of an instant — matches how a timesheet reads.
348
+ * Re-exported from the shared time utilities so every day bucket in jcf (reconcile rows,
349
+ * Attributed Intervals, Proposed Worklogs) is keyed by one definition.
350
+ */
351
+ export { localDay };
352
+ /** Strip the leading ticket marker (`[KEY] ` or `KEY: `) so the remainder reads as a plain note. */
353
+ export declare const stripTicketPrefix: (description: string) => string;
354
+ /**
355
+ * Combine the Clockify descriptions in a bucket into one Jira worklog comment.
356
+ * Strips the redundant ticket prefix, drops blanks, dedupes, and joins with `; `.
357
+ * Returns null when nothing meaningful remains (so no empty comment is posted).
358
+ */
359
+ export declare const combineDescriptions: (descriptions: ReadonlyArray<string | null | undefined>) => string | null;
360
+ /** A `(ticketKey, day) → seconds` tally accumulated from one side's entries. */
361
+ export type DayTally = ReadonlyArray<{
362
+ readonly entry?: RecordedEntry;
363
+ readonly ticketKey: string;
364
+ readonly day: string;
365
+ readonly seconds: number;
366
+ /** Original entry description (Clockify side) — combined into the worklog comment. */
367
+ readonly description?: string | null;
368
+ /** When this slice of the entry ran. Absent when the side reported no usable interval. */
369
+ readonly startMs?: number | undefined;
370
+ readonly endMs?: number | undefined;
371
+ }>;
372
+ /**
373
+ * Merge two per-`(ticket, day)` tallies into a sorted row list. Pure — the testable core.
374
+ * Buckets present on either side appear; rows are sorted by day then ticket for stable output.
375
+ */
376
+ export declare const buildReconcileRows: (clockify: DayTally, jira: DayTally) => ReadonlyArray<ReconcileRow>;
377
+ export declare const layer: Layer.Layer<ReconcileService, never, AgentSessionReader | ClockifyAuth | ConfigService | FileSystem.FileSystem | HomeDirectory | HttpClient.HttpClient | JiraApiClient | JiraAuth | Path.Path | SessionAttributor | SourceLedger | TimerService>;
378
+ //# sourceMappingURL=ReconcileService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReconcileService.d.ts","sourceRoot":"","sources":["../../../src/services/ReconcileService.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,aAAa,EAAuB,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AAGpD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AAInC,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAA;AAElE,OAAO,EAAE,QAAQ,EAA8C,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,aAAa,EA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