@knpkv/jira-clockify 1.3.0 → 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 (242) hide show
  1. package/README.md +245 -1
  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 +3 -3
  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/package.json +36 -18
  242. package/skills/jcf/SKILL.md +93 -1
@@ -0,0 +1,427 @@
1
+ import * as SourceConsumption from "./sourceConsumption.js";
2
+ /**
3
+ * Which evidence placed a session on an Issue Key. `none` means no signal did — the session is
4
+ * an Unattributed Session and is reported with its hours rather than guessed at.
5
+ */
6
+ export type AttributionSignal = "branch" | "path" | "standing" | "agent" | "none";
7
+ /**
8
+ * Attribution Signals in precedence order — the first to yield an Issue Key wins. Also the
9
+ * trust order: a bucket built from several sessions reports its *weakest* signal, because a row
10
+ * is only as trustworthy as its least trustworthy evidence.
11
+ */
12
+ export declare const ATTRIBUTION_PRECEDENCE: ReadonlyArray<AttributionSignal>;
13
+ /** Everything the attribution rules need to know about one Agent Session. */
14
+ export interface AttributableSession {
15
+ readonly sessionId: string;
16
+ /** Session Root-relative working directory the session ran in. */
17
+ readonly cwd: string;
18
+ /** Git branch recorded on the session, or null when the session recorded none. */
19
+ readonly gitBranch: string | null;
20
+ /** Issue Keys mined from the transcript — the closed choice set for a Coding Agent. */
21
+ readonly candidateKeys: ReadonlyArray<string>;
22
+ }
23
+ /** How one Agent Session was placed (or not placed) on an Issue Key. */
24
+ export interface SessionAttribution {
25
+ readonly sessionId: string;
26
+ readonly ticketKey: string | null;
27
+ readonly signal: AttributionSignal;
28
+ /** Coding Agent confidence in `[0, 1]`. null for every deterministic signal. */
29
+ readonly confidence: number | null;
30
+ /**
31
+ * True when a Coding Agent named an Issue Key but its confidence fell below the floor.
32
+ * Such credit is reported so the hours stay visible, but is never offered for confirmation.
33
+ */
34
+ readonly belowConfidenceFloor: boolean;
35
+ }
36
+ /**
37
+ * True when a string is an Issue Key and nothing else.
38
+ *
39
+ * A Standing Attribution is the one Issue Key nobody mines — it is typed into a config file — so it
40
+ * is also the one that can be empty or malformed. An empty key writes a Clockify description of
41
+ * `[] …`, which {@link parseTicketKey} then refuses to read back, so the next tally cannot see the
42
+ * entry and a watch writes the same time again on every settled tick, forever.
43
+ */
44
+ export declare const isTicketKey: (value: string) => boolean;
45
+ /**
46
+ * True for Issue Keys whose number reads as documentation filler rather than a real ticket:
47
+ * an ascending run from 1 (`123`, `1234`) or a repeated digit (`333`, `4444`), both at least
48
+ * three digits long. Short numbers are left alone so a young project's `PROJ-12` still counts.
49
+ *
50
+ * Only ever applied to keys mined from prose. `PROJ-XXXX` needs no rule — it has no digits and
51
+ * so never matches {@link TICKET_KEY} in the first place.
52
+ */
53
+ export declare const isPlaceholderTicketKey: (key: string) => boolean;
54
+ /**
55
+ * Issue Keys mentioned anywhere in a transcript, deduped and in order of first appearance,
56
+ * with placeholders dropped and the list capped so a Coding Agent prompt stays bounded.
57
+ *
58
+ * Deliberately *unordered by frequency*: a known-issues document mentions the tickets it
59
+ * describes dozens of times, so frequency is anti-correlated with what should be billed.
60
+ */
61
+ export declare const mineTicketKeys: (text: string, options?: {
62
+ readonly limit?: number | undefined;
63
+ }) => ReadonlyArray<string>;
64
+ /**
65
+ * The Issue Key a git branch names, or null. Takes the first match so `PROJ-1/PROJ-2` resolves
66
+ * predictably, and applies no placeholder filter — naming a branch is a deliberate act.
67
+ */
68
+ export declare const ticketKeyFromBranch: (branch: string | null | undefined) => string | null;
69
+ /**
70
+ * The Issue Key a working directory path names, or null. Takes the *last* match so the deepest
71
+ * segment wins — a worktree at `~/dev/repo/worktrees/PROJ-1/PROJ-2` is working on `PROJ-2`.
72
+ *
73
+ * This is what makes detached worktrees (whose branch reads `HEAD`) attributable.
74
+ */
75
+ export declare const ticketKeyFromPath: (cwd: string) => string | null;
76
+ /** Expand a leading `~` against `home`. Paths without one are returned unchanged. */
77
+ export declare const expandHomePath: (path: string, home: string) => string;
78
+ /**
79
+ * True when `path` is `prefix` or sits beneath it. Compares on a path *separator boundary*, so
80
+ * `/a/bc` is not inside `/a/b` — the bug a bare `startsWith` would introduce.
81
+ */
82
+ export declare const isWithinPrefix: (path: string, prefix: string) => boolean;
83
+ /**
84
+ * True when a session's working directory sits inside any Session Root. Sessions outside every
85
+ * root are never read, so scratch directories and side projects cannot generate proposals.
86
+ */
87
+ export declare const isWithinSessionRoots: (cwd: string, roots: ReadonlyArray<string>) => boolean;
88
+ /**
89
+ * The Standing Attribution for a working directory: the Issue Key mapped to the *longest*
90
+ * matching directory prefix, so `~/dev/docs/releases` and `~/dev/docs/interviews` can differ.
91
+ */
92
+ export declare const standingAttribution: (cwd: string, map: Readonly<Record<string, string>>) => string | null;
93
+ /** A deterministic placement — reached without consulting a Coding Agent. */
94
+ export interface DeterministicAttribution {
95
+ readonly ticketKey: string;
96
+ readonly signal: "branch" | "path" | "standing";
97
+ }
98
+ /**
99
+ * Place a session using the deterministic signals only, or null when none apply.
100
+ *
101
+ * Kept separate from {@link attributeSession} because the *absence* of a result here is exactly
102
+ * the condition for spending a Coding Agent call — which is why a run where every session is
103
+ * branch-attributed costs nothing.
104
+ */
105
+ export declare const deterministicAttribution: (session: AttributableSession, options: {
106
+ readonly standingMap: Readonly<Record<string, string>>;
107
+ }) => DeterministicAttribution | null;
108
+ /** What a Coding Agent decided about one session. `null` is a valid, expected answer. */
109
+ export interface AgentChoice {
110
+ readonly ticketKey: string;
111
+ readonly confidence: number;
112
+ }
113
+ /**
114
+ * Resolve one session's final attribution, applying the full precedence and both guards on a
115
+ * Coding Agent's answer: the chosen key must appear in the session's own candidate set, and a
116
+ * choice below `confidenceFloor` is marked so it can be reported without being offered.
117
+ */
118
+ export declare const attributeSession: (session: AttributableSession, options: {
119
+ readonly standingMap: Readonly<Record<string, string>>;
120
+ /** Only consulted when no deterministic signal placed the session. */
121
+ readonly agentChoice?: AgentChoice | null | undefined;
122
+ readonly confidenceFloor: number;
123
+ }) => SessionAttribution;
124
+ /** One recorded moment of work inside an Agent Session. */
125
+ export interface SessionActivity {
126
+ readonly sessionId: string;
127
+ /** Epoch milliseconds. */
128
+ readonly atMs: number;
129
+ }
130
+ /** A half-open span of credited time, `[startMs, endMs)`, never crossing a local midnight. */
131
+ export interface CreditedSpan {
132
+ readonly startMs: number;
133
+ readonly endMs: number;
134
+ }
135
+ /**
136
+ * A span of credited time that carries the seconds it contributes to its bucket.
137
+ *
138
+ * The unit a person can accept on its own. A row is exactly the sum of its blocks, so accepting four
139
+ * blocks one at a time and accepting the whole row put the same total in both systems — which is
140
+ * what makes writing a morning now and an afternoon later safe rather than a way to double-log.
141
+ *
142
+ * `seconds` is credit, not wall clock: time worked on several Issue Keys at once is divided between
143
+ * them, so a block's seconds can be shorter than the interval it spans. That gap is the sharing
144
+ * doing its job, and hiding it by reporting the wall clock would overstate the day.
145
+ */
146
+ export interface CreditedBlock {
147
+ readonly startMs: number;
148
+ readonly endMs: number;
149
+ readonly seconds: number;
150
+ /** Stable start of the source cluster, even when scheduling moves this rendered block. */
151
+ readonly sourceStartMs?: number | undefined;
152
+ /** Position within one source cluster, for server-held allocation accounting only. */
153
+ readonly allocationIndex?: number | undefined;
154
+ /** Provider seconds already written under a corrected ticket for this source block. */
155
+ readonly clockifyConsumedSeconds?: number | undefined;
156
+ /** Ordinary unlinked provider time intersects this block; its source is not known. */
157
+ readonly clockifyRefusal?: "unlinked-overlap" | undefined;
158
+ /** Provider seconds already written under a corrected ticket for this source block. */
159
+ readonly jiraConsumedSeconds?: number | undefined;
160
+ }
161
+ /**
162
+ * Merge spans that touch or overlap, so a hundred one-minute credits read as one block of work.
163
+ */
164
+ export declare const mergeSpans: (spans: ReadonlyArray<CreditedSpan>) => ReadonlyArray<CreditedSpan>;
165
+ /**
166
+ * Merge overlapping spans, then cut the result at every local midnight.
167
+ *
168
+ * Merging alone is not enough anywhere spans are day-bucketed afterwards: two windows that meet at
169
+ * midnight touch, so a plain merge welds them into one span whose start decides the day — putting a
170
+ * whole morning's work onto the previous day. Every merge in this module goes through here.
171
+ */
172
+ export declare const mergeSpansWithinDays: (spans: ReadonlyArray<CreditedSpan>) => ReadonlyArray<CreditedSpan>;
173
+ /** A session's active windows, day-bounded and merged. */
174
+ export interface SessionWindows {
175
+ readonly sessionId: string;
176
+ readonly spans: ReadonlyArray<CreditedSpan>;
177
+ }
178
+ /**
179
+ * When each session was working: the gaps between its own adjacent events, cut off at the Idle Cap.
180
+ *
181
+ * Deliberately stops short of dividing anything. Sharing has to happen between *Issue Keys*, and
182
+ * which key a session belongs to is not known until it has been attributed — two sessions on the
183
+ * same ticket must not halve each other's time. See {@link splitCredits}.
184
+ */
185
+ export declare const activeWindows: (activity: ReadonlyArray<SessionActivity>, options: {
186
+ readonly idleCapSeconds: number;
187
+ /**
188
+ * How far presence may be credited past a session's last prompt — the end of the window being
189
+ * reconciled, or now for a watch. Bounds the trailing window so a period never credits time
190
+ * beyond what it can actually see.
191
+ */
192
+ readonly observedAtMs: number;
193
+ /**
194
+ * Per-session upper bound on the trailing window, for a stretch that gave way to another under a
195
+ * different branch or directory. Presence after its final prompt ends where the next stretch
196
+ * begins: the same person carried straight on, so crediting the tail to both would put the
197
+ * minutes around a switch on two Issue Keys at once.
198
+ */
199
+ readonly boundsBySession?: ReadonlyMap<string, number> | undefined;
200
+ }) => ReadonlyArray<SessionWindows>;
201
+ /**
202
+ * The shortest stretch that may own time on its own, in seconds.
203
+ *
204
+ * Fifteen minutes, because a timeline that changes ticket every three minutes is not a record of how
205
+ * anyone works — it is an artefact of reading several concurrent transcripts at once. A day of that
206
+ * is unreadable on a calendar and indefensible on a timesheet.
207
+ */
208
+ export declare const DEFAULT_DWELL_SECONDS = 900;
209
+ /** One stretch of the day and the buckets that own it. */
210
+ export interface OwnedRun {
211
+ readonly startMs: number;
212
+ readonly endMs: number;
213
+ readonly bucketIds: ReadonlyArray<string>;
214
+ }
215
+ /**
216
+ * Coalesce ownership so it changes no more often than the Dwell Floor.
217
+ *
218
+ * **What this is for.** Three concurrent sessions on three Issue Keys interleave their prompts, and
219
+ * read literally that says the work changed ticket every few minutes. It did not — that is an
220
+ * artefact of reading several transcripts at once. A day of it is two dozen slivers on a calendar and
221
+ * indefensible on a timesheet.
222
+ *
223
+ * **Two rules, in order.**
224
+ *
225
+ * 1. *A ticket present for less than the floor inside one connected source cluster, interrupting work
226
+ * that resumes after it, was not a ticket that was worked on.* It was a keystroke inside other work — a branch
227
+ * checked, a file opened, a question asked — so its time goes to the work around it. This is what
228
+ * actually removes the slivers: they rarely touch anything, because a transcript goes quiet
229
+ * between prompts, and they are as often overlapping as adjacent, because concurrent sessions
230
+ * overlap by definition. Adjacency and overlap were both tried as the test and both left the
231
+ * interleaving as they found it. The requirement for work on *both* sides is what keeps a genuine
232
+ * short piece of work — eight minutes on another ticket, and then the day moves on — from being
233
+ * swallowed by what came before it.
234
+ * 2. *Tenancy, not adjacency.* Between tickets that were genuinely worked on, whoever takes the
235
+ * timeline holds it for at least the floor: a stretch beginning inside that tenure and owned by
236
+ * someone else is credited to the incumbent. This catches two real tickets alternating quickly.
237
+ *
238
+ * **What it never does.** It reassigns time and never creates or drops any — idle gaps are not swept
239
+ * into a tenure — so the inequality that makes a proposal safe to accept survives intact. Nothing is
240
+ * ever welded across a local midnight, because runs are bucketed by the day they start in.
241
+ *
242
+ * **Unplaced hours take no part.** A stretch nothing placed neither holds a tenure nor loses its time
243
+ * to one: promoting it would bill work no transcript placed on that ticket, and demoting an
244
+ * attributed sliver into it would quietly discard billable work. An attributed tenure simply
245
+ * continues across it.
246
+ *
247
+ * **A minor ticket with nothing to belong to keeps its own time.** Four minutes alone in an otherwise
248
+ * empty day has no surrounding work to join, and dropping it would lose work that happened.
249
+ */
250
+ export declare const applyDwellFloor: (slices: ReadonlyArray<OwnedRun>, options: {
251
+ readonly dwellSeconds: number;
252
+ /** True when a bucket's time is eligible to be proposed for an Issue Key. */
253
+ readonly attributed: (bucketId: string) => boolean;
254
+ }) => ReadonlyArray<OwnedRun>;
255
+ /** Seconds one Issue Key accounts for on one local calendar day, with the evidence behind it. */
256
+ export interface TicketDayCredit {
257
+ readonly ticketKey: string;
258
+ readonly day: string;
259
+ readonly seconds: number;
260
+ readonly signal: AttributionSignal;
261
+ /**
262
+ * Coding Agent confidence behind this bucket, or null when no Coding Agent was involved.
263
+ * The *lowest* of the contributing sessions, for the same reason the signal is the weakest one.
264
+ */
265
+ readonly confidence: number | null;
266
+ /** Wall-clock seconds spent on this Issue Key before sharing overlaps with other keys. */
267
+ readonly activeSeconds: number;
268
+ /**
269
+ * When the work happened and what each stretch is worth, ascending. Sums to `seconds` exactly, so
270
+ * a surface can offer one block at a time without the parts and the whole disagreeing.
271
+ */
272
+ readonly blocks: ReadonlyArray<CreditedBlock>;
273
+ /** Earliest source instant needed to reconstruct these scheduled blocks. */
274
+ readonly sourceStartMs: number;
275
+ /** Last source instant that can still redistribute the scheduled blocks. */
276
+ readonly settlementEndMs: number;
277
+ /**
278
+ * The sessions that contributed to this bucket, in id order.
279
+ *
280
+ * Carried so a caller can find the transcripts behind a row — describing what was worked on needs
281
+ * the prompts, and by this point the spans have been merged past the point of knowing whose they
282
+ * were.
283
+ */
284
+ readonly sessionIds: ReadonlyArray<string>;
285
+ }
286
+ /** Hours that happened on a day but could not be placed on any Issue Key. */
287
+ export interface UnattributedDayCredit {
288
+ readonly day: string;
289
+ readonly seconds: number;
290
+ readonly sessionCount: number;
291
+ /**
292
+ * The distinct working directories the unplaced sessions ran in, sorted.
293
+ *
294
+ * Carried because the repair for unplaced hours is a Standing Attribution, and a Standing
295
+ * Attribution is a *directory* prefix — a report that says only "3h40m unattributed" tells a
296
+ * reader nothing they can act on. Deliberately no per-directory seconds: the share of a day
297
+ * belonging to one directory is not something this split computes, and inventing it would be a
298
+ * number nobody could check. Empty when the caller supplied no working directories.
299
+ */
300
+ readonly cwds: ReadonlyArray<string>;
301
+ }
302
+ /** Session credit sorted into what can be proposed, what is only reported, and what is unplaced. */
303
+ export interface CreditSplit {
304
+ /** Attributed and trusted — eligible to become a Proposed Worklog. */
305
+ readonly attributed: ReadonlyArray<TicketDayCredit>;
306
+ /** Attributed by a Coding Agent below the confidence floor — reported, never offered. */
307
+ readonly withheld: ReadonlyArray<TicketDayCredit>;
308
+ /** No signal placed these hours. Reported so they stay visible. */
309
+ readonly unattributed: ReadonlyArray<UnattributedDayCredit>;
310
+ }
311
+ /**
312
+ * Fold per-session active windows onto Issue Keys, dividing every overlap between *distinct* keys.
313
+ *
314
+ * Bucketing happens before sharing, which is the whole point: two sessions on the same Issue Key
315
+ * union their windows and lose nothing, while two sessions on different keys split the instants they
316
+ * share. Below-floor and unplaced time gets its own buckets so neither can be silently dropped nor
317
+ * silently proposed — and both still take part in the split, because they occupied real time.
318
+ */
319
+ export declare const splitCredits: (windows: ReadonlyArray<SessionWindows>, attributions: ReadonlyArray<SessionAttribution>, options?: {
320
+ /** Where each session ran, so unplaced hours can name the directories behind them. */
321
+ readonly cwdBySession?: ReadonlyMap<string, string> | undefined;
322
+ /**
323
+ * The Dwell Floor in seconds: how long a stretch must be to own time on its own. Defaults to
324
+ * {@link DEFAULT_DWELL_SECONDS}; zero turns the rule off and reports the raw interleaving.
325
+ */
326
+ readonly dwellSeconds?: number | undefined;
327
+ }) => CreditSplit;
328
+ /** What Clockify and Jira already hold for one `(Issue Key, day)` bucket. */
329
+ export interface RecordedBucket {
330
+ readonly ticketKey: string;
331
+ readonly day: string;
332
+ readonly clockifySeconds: number;
333
+ readonly jiraSeconds: number;
334
+ readonly intervals?: ReadonlyArray<{
335
+ readonly source?: SourceConsumption.Source | undefined;
336
+ readonly startMs?: number | undefined;
337
+ readonly endMs?: number | undefined;
338
+ readonly entry?: {
339
+ readonly source: SourceConsumption.Source;
340
+ readonly id: string;
341
+ readonly startMs: number;
342
+ readonly endMs: number;
343
+ readonly description: string | null;
344
+ } | undefined;
345
+ }> | undefined;
346
+ }
347
+ /** A Proposed Worklog: the gap between what a session accounts for and what is already recorded. */
348
+ export interface SessionProposal {
349
+ readonly ticketKey: string;
350
+ readonly day: string;
351
+ readonly signal: AttributionSignal;
352
+ /** Coding Agent confidence, or null when the attribution needed no Coding Agent. */
353
+ readonly confidence: number | null;
354
+ /**
355
+ * When the session's work happened and what each stretch is worth — the evidence behind
356
+ * `sessionSeconds`, which is their sum. Also the unit of acceptance: a surface may offer these one
357
+ * at a time, so long as it never writes more for the bucket than `sessionSeconds` in total.
358
+ */
359
+ readonly blocks: ReadonlyArray<CreditedBlock>;
360
+ /** Earliest source instant needed to reconstruct these scheduled blocks. */
361
+ readonly sourceStartMs: number;
362
+ /** Last source instant that can still redistribute the scheduled blocks. */
363
+ readonly settlementEndMs: number;
364
+ /**
365
+ * Credited seconds: this Issue Key's share of the time worked. Where several keys were worked on
366
+ * at once, that time is divided equally, so no instant is ever counted twice.
367
+ */
368
+ readonly sessionSeconds: number;
369
+ /** Wall-clock seconds active, before sharing. Exceeds `sessionSeconds` on parallel work. */
370
+ readonly activeSeconds: number;
371
+ readonly clockifySeconds: number;
372
+ readonly jiraSeconds: number;
373
+ /** Seconds Clockify is short. 0 when it is not short. */
374
+ readonly clockifyDelta: number;
375
+ /** Seconds Jira is short. 0 when it is not short. */
376
+ readonly jiraDelta: number;
377
+ /** The sessions behind this row, for a caller that needs to read what they were about. */
378
+ readonly sessionIds: ReadonlyArray<string>;
379
+ /** Fresh provider intervals used to place later CLI/watch top-ups in their uncovered source ranges. */
380
+ readonly recordedIntervals?: ReadonlyArray<{
381
+ readonly source: SourceConsumption.Source;
382
+ readonly startMs: number;
383
+ readonly endMs: number;
384
+ }> | undefined;
385
+ }
386
+ /**
387
+ * Turn Attributed Intervals into Proposed Worklogs by subtracting what each side already holds.
388
+ *
389
+ * Each side is sized to *its own* gap, so a day where Clockify has nothing but Jira already has
390
+ * an hour proposes the right amount to each rather than the same number twice. Live provider
391
+ * durations and private provider-ID source bindings jointly protect corrected-ticket writes;
392
+ * a complete read of a genuinely deleted entry may correctly reopen its time.
393
+ */
394
+ /**
395
+ * Which systems a reconciliation is about.
396
+ *
397
+ * A side that is out is not read, not proposed for, and not written to. That is stronger than
398
+ * skipping its write: a side nobody read holds an unknown amount, and treating unknown as zero would
399
+ * propose the whole day for it — which is precisely the double-log this arithmetic exists to prevent.
400
+ */
401
+ export interface ReconcileSides {
402
+ readonly clockify: boolean;
403
+ readonly jira: boolean;
404
+ }
405
+ /** Both systems: what reconciliation means unless someone says otherwise. */
406
+ export declare const bothSides: ReconcileSides;
407
+ export declare const buildSessionProposals: (credits: ReadonlyArray<TicketDayCredit>, recorded: ReadonlyArray<RecordedBucket>, options: {
408
+ /** Jira's minimum worklog duration; Clockify accepts exact positive seconds. */
409
+ readonly minimumSeconds: number;
410
+ /** Days withheld from proposals entirely — e.g. a day with a Timer still running. */
411
+ readonly excludedDays: ReadonlyArray<string>;
412
+ /** Which systems this run is about. Both by default. */
413
+ readonly sides?: ReconcileSides | undefined;
414
+ /** Marker-bearing entries that remain outside ordinary ticket/day totals. */
415
+ readonly consumptionRows?: ReadonlyArray<SourceConsumption.RecordedRow> | undefined;
416
+ /** Provider-ID-verified consumption from the server-private durable ledger. */
417
+ readonly sourceEntries?: ReadonlyArray<SourceConsumption.ResolvedEntry> | undefined;
418
+ }) => ReadonlyArray<SessionProposal>;
419
+ /**
420
+ * A compact, bounded digest of a session's prompts for a Coding Agent to read. Takes text from
421
+ * the start of the session — where the task is stated — and stops at the character budget, so
422
+ * one very long transcript cannot dominate the prompt.
423
+ */
424
+ export declare const buildSessionDigest: (texts: ReadonlyArray<string>, options?: {
425
+ readonly maxChars?: number | undefined;
426
+ }) => string;
427
+ //# sourceMappingURL=sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/agent/sessions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAuC3D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAA;AAEjF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,iBAAiB,CAMnE,CAAA;AAOD,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,uFAAuF;IACvF,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAC9C;AAED,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IA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