@knpkv/jira-clockify 1.4.1 → 1.6.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 (147) hide show
  1. package/README.md +105 -22
  2. package/dist/package.json +1 -1
  3. package/dist/src/agent/schedule.d.ts +6 -5
  4. package/dist/src/agent/schedule.d.ts.map +1 -1
  5. package/dist/src/agent/schedule.js +117 -102
  6. package/dist/src/agent/schedule.js.map +1 -1
  7. package/dist/src/agent/sessions.d.ts +27 -33
  8. package/dist/src/agent/sessions.d.ts.map +1 -1
  9. package/dist/src/agent/sessions.js +121 -83
  10. package/dist/src/agent/sessions.js.map +1 -1
  11. package/dist/src/agent/writePlanning.d.ts +2 -0
  12. package/dist/src/agent/writePlanning.d.ts.map +1 -1
  13. package/dist/src/agent/writePlanning.js +4 -1
  14. package/dist/src/agent/writePlanning.js.map +1 -1
  15. package/dist/src/bin.js +16 -5
  16. package/dist/src/bin.js.map +1 -1
  17. package/dist/src/cli/CommandFailed.d.ts +27 -0
  18. package/dist/src/cli/CommandFailed.d.ts.map +1 -0
  19. package/dist/src/cli/CommandFailed.js +25 -0
  20. package/dist/src/cli/CommandFailed.js.map +1 -0
  21. package/dist/src/cli/agentWrite.d.ts.map +1 -1
  22. package/dist/src/cli/agentWrite.js +12 -5
  23. package/dist/src/cli/agentWrite.js.map +1 -1
  24. package/dist/src/cli/auth.d.ts +59 -2
  25. package/dist/src/cli/auth.d.ts.map +1 -1
  26. package/dist/src/cli/auth.js +151 -106
  27. package/dist/src/cli/auth.js.map +1 -1
  28. package/dist/src/cli/config.d.ts +4 -3
  29. package/dist/src/cli/config.d.ts.map +1 -1
  30. package/dist/src/cli/config.js +73 -31
  31. package/dist/src/cli/config.js.map +1 -1
  32. package/dist/src/cli/fetchTicket.d.ts +3 -3
  33. package/dist/src/cli/fetchTicket.d.ts.map +1 -1
  34. package/dist/src/cli/fetchTicket.js +7 -7
  35. package/dist/src/cli/fetchTicket.js.map +1 -1
  36. package/dist/src/cli/layers.d.ts +6 -5
  37. package/dist/src/cli/layers.d.ts.map +1 -1
  38. package/dist/src/cli/layers.js +16 -15
  39. package/dist/src/cli/layers.js.map +1 -1
  40. package/dist/src/cli/list.d.ts +3 -2
  41. package/dist/src/cli/list.d.ts.map +1 -1
  42. package/dist/src/cli/list.js +11 -5
  43. package/dist/src/cli/list.js.map +1 -1
  44. package/dist/src/cli/reconcile.d.ts +18 -3
  45. package/dist/src/cli/reconcile.d.ts.map +1 -1
  46. package/dist/src/cli/reconcile.js +73 -23
  47. package/dist/src/cli/reconcile.js.map +1 -1
  48. package/dist/src/cli/root.d.ts.map +1 -1
  49. package/dist/src/cli/root.js +3 -3
  50. package/dist/src/cli/root.js.map +1 -1
  51. package/dist/src/cli/setup.d.ts +14 -4
  52. package/dist/src/cli/setup.d.ts.map +1 -1
  53. package/dist/src/cli/setup.js +45 -94
  54. package/dist/src/cli/setup.js.map +1 -1
  55. package/dist/src/cli/timer/discard.d.ts +1 -1
  56. package/dist/src/cli/timer/discard.d.ts.map +1 -1
  57. package/dist/src/cli/timer/discard.js +2 -1
  58. package/dist/src/cli/timer/discard.js.map +1 -1
  59. package/dist/src/cli/timer/log.d.ts +1 -1
  60. package/dist/src/cli/timer/log.d.ts.map +1 -1
  61. package/dist/src/cli/timer/log.js +2 -1
  62. package/dist/src/cli/timer/log.js.map +1 -1
  63. package/dist/src/cli/timer/start.d.ts +2 -1
  64. package/dist/src/cli/timer/start.d.ts.map +1 -1
  65. package/dist/src/cli/timer/start.js +6 -8
  66. package/dist/src/cli/timer/start.js.map +1 -1
  67. package/dist/src/cli/timer/stop.d.ts +1 -1
  68. package/dist/src/cli/timer/stop.d.ts.map +1 -1
  69. package/dist/src/cli/timer.d.ts.map +1 -1
  70. package/dist/src/cli/timer.js +8 -1
  71. package/dist/src/cli/timer.js.map +1 -1
  72. package/dist/src/cli/unknownCommand.d.ts +24 -0
  73. package/dist/src/cli/unknownCommand.d.ts.map +1 -0
  74. package/dist/src/cli/unknownCommand.js +84 -0
  75. package/dist/src/cli/unknownCommand.js.map +1 -0
  76. package/dist/src/cli/watch.d.ts +2 -2
  77. package/dist/src/cli/watch.d.ts.map +1 -1
  78. package/dist/src/services/AgentSessionReader.d.ts +26 -12
  79. package/dist/src/services/AgentSessionReader.d.ts.map +1 -1
  80. package/dist/src/services/AgentSessionReader.js +163 -69
  81. package/dist/src/services/AgentSessionReader.js.map +1 -1
  82. package/dist/src/services/CodexTranscript.d.ts +50 -13
  83. package/dist/src/services/CodexTranscript.d.ts.map +1 -1
  84. package/dist/src/services/CodexTranscript.js +49 -13
  85. package/dist/src/services/CodexTranscript.js.map +1 -1
  86. package/dist/src/services/ConfigService.d.ts +4 -0
  87. package/dist/src/services/ConfigService.d.ts.map +1 -1
  88. package/dist/src/services/ConfigService.js +6 -2
  89. package/dist/src/services/ConfigService.js.map +1 -1
  90. package/dist/src/services/IssueFacts.d.ts +2 -2
  91. package/dist/src/services/IssueFacts.d.ts.map +1 -1
  92. package/dist/src/services/IssueFacts.js +5 -5
  93. package/dist/src/services/IssueFacts.js.map +1 -1
  94. package/dist/src/services/JiraAccess.d.ts +140 -0
  95. package/dist/src/services/JiraAccess.d.ts.map +1 -0
  96. package/dist/src/services/JiraAccess.js +204 -0
  97. package/dist/src/services/JiraAccess.js.map +1 -0
  98. package/dist/src/services/ProviderSnapshots.d.ts +41 -0
  99. package/dist/src/services/ProviderSnapshots.d.ts.map +1 -0
  100. package/dist/src/services/ProviderSnapshots.js +71 -0
  101. package/dist/src/services/ProviderSnapshots.js.map +1 -0
  102. package/dist/src/services/ReconcileService.d.ts +12 -4
  103. package/dist/src/services/ReconcileService.d.ts.map +1 -1
  104. package/dist/src/services/ReconcileService.js +223 -113
  105. package/dist/src/services/ReconcileService.js.map +1 -1
  106. package/dist/src/services/SavedEntries.d.ts +24 -4
  107. package/dist/src/services/SavedEntries.d.ts.map +1 -1
  108. package/dist/src/services/SavedEntries.js +335 -19
  109. package/dist/src/services/SavedEntries.js.map +1 -1
  110. package/dist/src/services/SessionAttributor.d.ts +12 -0
  111. package/dist/src/services/SessionAttributor.d.ts.map +1 -1
  112. package/dist/src/services/SessionAttributor.js +13 -1
  113. package/dist/src/services/SessionAttributor.js.map +1 -1
  114. package/dist/src/services/SessionLine.d.ts +29 -0
  115. package/dist/src/services/SessionLine.d.ts.map +1 -0
  116. package/dist/src/services/SessionLine.js +8 -0
  117. package/dist/src/services/SessionLine.js.map +1 -0
  118. package/dist/src/services/SourceLedger.d.ts +84 -1
  119. package/dist/src/services/SourceLedger.d.ts.map +1 -1
  120. package/dist/src/services/SourceLedger.js +178 -12
  121. package/dist/src/services/SourceLedger.js.map +1 -1
  122. package/dist/src/services/TicketRanking.d.ts +39 -0
  123. package/dist/src/services/TicketRanking.d.ts.map +1 -0
  124. package/dist/src/services/TicketRanking.js +87 -0
  125. package/dist/src/services/TicketRanking.js.map +1 -0
  126. package/dist/src/services/TimerService.d.ts +3 -3
  127. package/dist/src/services/TimerService.d.ts.map +1 -1
  128. package/dist/src/services/TimerService.js +6 -17
  129. package/dist/src/services/TimerService.js.map +1 -1
  130. package/dist/src/services/internal/retryTransport.d.ts +9 -0
  131. package/dist/src/services/internal/retryTransport.d.ts.map +1 -0
  132. package/dist/src/services/internal/retryTransport.js +15 -0
  133. package/dist/src/services/internal/retryTransport.js.map +1 -0
  134. package/dist/src/testing/fakeHeadless.d.ts +12 -1
  135. package/dist/src/testing/fakeHeadless.d.ts.map +1 -1
  136. package/dist/src/testing/fakeHeadless.js +83 -10
  137. package/dist/src/testing/fakeHeadless.js.map +1 -1
  138. package/dist/src/tui/App.js +1 -1
  139. package/dist/src/tui/atoms/runtime.d.ts +1 -1
  140. package/dist/src/tui/atoms/runtime.d.ts.map +1 -1
  141. package/dist/src/utils/hints.d.ts +4 -2
  142. package/dist/src/utils/hints.d.ts.map +1 -1
  143. package/dist/src/utils/hints.js +4 -2
  144. package/dist/src/utils/hints.js.map +1 -1
  145. package/dist/tsconfig.tsbuildinfo +1 -1
  146. package/package.json +8 -8
  147. package/skills/jcf/SKILL.md +9 -6
@@ -12,18 +12,21 @@
12
12
  * - **Tolerant decoding**: the transcript layout is an external contract that changes without
13
13
  * notice. Unrecognised and malformed lines are skipped; a session survives on the lines it can
14
14
  * decode rather than failing the whole run.
15
- * - **Presence, not busy-ness**: only messages the *person* typed count as Session Activity. A
16
- * transcript is overwhelmingly the agent's own output — measured on one real day, 1641 events of
17
- * which 66 were human — so counting every event measures how long the agent was busy, which is
18
- * not the same as how long anyone was working.
15
+ * - **Supervised turns, not busy-ness**: a message the *person* typed opens a supervised turn, and
16
+ * the agent's work counts as Session Activity only inside one — until the agent ends the turn, a
17
+ * turn nobody typed takes over, or the agent falls silent for longer than the Idle Cap. Agent
18
+ * output outside a turn the person started measures how long the agent was busy, not how long
19
+ * anyone was working, so it never counts. See ADR-0006's 2026-10-03 amendment.
19
20
  *
20
21
  * **Gotchas**
21
22
  *
22
23
  * - A `user` line is not necessarily a person. Tool results come back as `user` messages whose
23
- * content is `tool_result` blocks, and they outnumber real prompts roughly ten to one. Only text
24
- * content counts.
24
+ * content is `tool_result` blocks; task notifications and auto-continuations carry a machine
25
+ * `origin`; `isMeta` lines are expanded skills and command caveats. None of them opens a turn.
26
+ * - A message typed while the agent is busy is not a `user` line at all: it is a `queued_command`
27
+ * attachment, timestamped when it was typed. It opens a turn like any other prompt.
25
28
  * - Assistant output, sidechain turns, and tool results still feed the candidate Issue Keys and the
26
- * digest: they say nothing about presence, but plenty about *what* the session was for.
29
+ * digest whether or not they count as presence: they say plenty about *what* the session was for.
27
30
  * - The working directory and branch are taken from the session's last in-window line of any kind —
28
31
  * the state the credited work actually ran under.
29
32
  *
@@ -39,7 +42,7 @@ import * as Path from "effect/Path";
39
42
  import * as Predicate from "effect/Predicate";
40
43
  import * as Schema from "effect/Schema";
41
44
  import * as Stream from "effect/Stream";
42
- import { buildSessionDigest, expandHomePath, isWithinSessionRoots, mineTicketKeys } from "../agent/sessions.js";
45
+ import { buildSessionDigest, expandHomePath, isWithinSessionRoots, mineTicketKeys, ticketMentionCounts } from "../agent/sessions.js";
43
46
  import { codexTranscriptLines, decodeCodexLine } from "./CodexTranscript.js";
44
47
  import { ConfigService } from "./ConfigService.js";
45
48
  import { HomeDirectory } from "./HomeDirectory.js";
@@ -61,7 +64,10 @@ const TranscriptLine = Schema.Struct({
61
64
  cwd: Schema.optional(Schema.String),
62
65
  gitBranch: Schema.optional(Schema.NullOr(Schema.String)),
63
66
  isSidechain: Schema.optional(Schema.NullOr(Schema.Boolean)),
64
- message: Schema.optional(Schema.Unknown)
67
+ isMeta: Schema.optional(Schema.NullOr(Schema.Boolean)),
68
+ origin: Schema.optional(Schema.Unknown),
69
+ message: Schema.optional(Schema.Unknown),
70
+ attachment: Schema.optional(Schema.Unknown)
65
71
  });
66
72
  const TextBlock = Schema.Struct({
67
73
  type: Schema.optional(Schema.String),
@@ -81,14 +87,34 @@ const decodeToolOutput = Schema.decodeUnknownOption(Schema.Union([Schema.String,
81
87
  const MessageContent = Schema.Struct({
82
88
  content: Schema.optional(Schema.Union([Schema.String, Schema.Array(ContentBlock)]))
83
89
  });
90
+ /** Why a turn started. Absent on older transcripts, where the content prefix is the only hint. */
91
+ const Origin = Schema.Struct({ kind: Schema.optional(Schema.String) });
92
+ /** A message typed while the agent was busy, recorded when it was typed rather than delivered. */
93
+ const QueuedCommand = Schema.Struct({
94
+ type: Schema.Literal("queued_command"),
95
+ commandMode: Schema.optional(Schema.String),
96
+ origin: Schema.optional(Schema.Unknown),
97
+ prompt: Schema.optional(Schema.Union([Schema.String, Schema.Array(ContentBlock)]))
98
+ });
99
+ const AssistantStop = Schema.Struct({ stop_reason: Schema.optional(Schema.NullOr(Schema.String)) });
84
100
  const JsonValue = Schema.fromJsonString(Schema.Json);
85
101
  const decodeJson = Schema.decodeUnknownOption(JsonValue);
86
102
  const decodeLine = Schema.decodeUnknownOption(TranscriptLine);
87
103
  const decodeContent = Schema.decodeUnknownOption(MessageContent);
88
- /** Line types that carry a timestamp and a message. Everything else is session metadata. */
89
- const ACTIVITY_TYPES = ["user", "assistant"];
104
+ const decodeOrigin = Schema.decodeUnknownOption(Origin);
105
+ const decodeQueuedCommand = Schema.decodeUnknownOption(QueuedCommand);
106
+ const decodeAssistantStop = Schema.decodeUnknownOption(AssistantStop);
90
107
  /** Block types that are the agent's own machinery rather than anything a person wrote. */
91
108
  const MACHINE_BLOCK_TYPES = ["tool_result", "tool_use", "thinking"];
109
+ /** Turn origins nobody typed. */
110
+ const MACHINE_ORIGINS = ["task-notification", "auto-continuation"];
111
+ /** Stop reasons that end the agent's turn rather than pausing it for a tool. */
112
+ const TURN_END_STOPS = ["end_turn", "stop_sequence"];
113
+ /**
114
+ * Prefixes of `user` lines that echo a local command's output or announce a notification. Older
115
+ * transcripts carry no `origin`, so the content is the only evidence that nobody typed them.
116
+ */
117
+ const MACHINE_TEXT = /^\s*<(task-notification|local-command-stdout|local-command-stderr|bash-stdout|bash-stderr)\b/;
92
118
  /**
93
119
  * How much of one tool result is kept as evidence. Command output can be megabytes; an Issue Key a
94
120
  * command printed sits near the top, and the digest only needs a hint of what the output was.
@@ -106,16 +132,12 @@ const toolResultText = (output) => {
106
132
  return text.length === 0 ? [] : [text.slice(0, TOOL_RESULT_TEXT_LIMIT)];
107
133
  };
108
134
  /**
109
- * The readable text of a message, or `""` when it carries none we understand.
135
+ * The readable text of message content, or `""` when it carries none we understand.
110
136
  *
111
137
  * Includes tool-result output: it is attribution and description evidence, never presence, which
112
- * {@link isHumanPrompt} decides separately.
138
+ * {@link claudePresence} decides separately.
113
139
  */
114
- const messageText = (message) => {
115
- const decoded = decodeContent(message);
116
- if (Option.isNone(decoded))
117
- return "";
118
- const content = decoded.value.content;
140
+ const contentText = (content) => {
119
141
  if (content === undefined)
120
142
  return "";
121
143
  if (Predicate.isString(content))
@@ -126,33 +148,60 @@ const messageText = (message) => {
126
148
  ? []
127
149
  : [block.text]).join("\n");
128
150
  };
129
- /**
130
- * True when a line is a message the person typed — the only thing that evidences their presence.
131
- *
132
- * A bare string is a person only on the main thread. A block list is a person only if it contains
133
- * none of the agent's machinery: tool results in particular arrive as `user` messages and are far
134
- * more numerous than real prompts, so counting them would measure the agent's throughput as if it
135
- * were attention.
136
- *
137
- * A sidechain line is the agent talking to its own subagent. It has the exact shape of a typed
138
- * prompt — `type: "user"`, plain string content — so nothing else here would exclude it, and a run
139
- * that fans out to many subagents would manufacture a stream of "prompts" dense enough to bridge
140
- * every Idle Cap gap. That is the one thing the Idle Cap exists to stop, and under `jcf watch` the
141
- * result would be written unattended.
142
- */
143
- const isHumanPrompt = (line, message) => {
144
- if (line.type !== "user" || line.isSidechain === true)
145
- return false;
146
- const decoded = decodeContent(message);
147
- if (Option.isNone(decoded))
148
- return false;
149
- const content = decoded.value.content;
151
+ /** True when content is something a person could have typed: text with none of the agent's machinery. */
152
+ const isTypedContent = (content) => {
150
153
  if (content === undefined)
151
154
  return false;
152
155
  if (Predicate.isString(content))
153
156
  return content.trim().length > 0;
154
- return (content.length > 0 &&
155
- content.every((block) => block.type === undefined || !MACHINE_BLOCK_TYPES.includes(block.type)));
157
+ return content.length > 0 &&
158
+ content.every((block) => block.type === undefined || !MACHINE_BLOCK_TYPES.includes(block.type));
159
+ };
160
+ const isMachineOrigin = (origin) => {
161
+ const decoded = decodeOrigin(origin);
162
+ return Option.isSome(decoded) && decoded.value.kind !== undefined && MACHINE_ORIGINS.includes(decoded.value.kind);
163
+ };
164
+ /**
165
+ * What one Claude line says about presence, with its readable text; `undefined` for lines that are
166
+ * neither messages nor queued prompts.
167
+ *
168
+ * A sidechain line is the agent talking to its own subagent. It has the exact shape of a typed
169
+ * prompt — `type: "user"`, plain string content — so it is classified as the agent's work before the
170
+ * content is looked at: it may continue a turn the person started, never open one.
171
+ */
172
+ const claudePresence = (line) => {
173
+ if (line.type === "assistant") {
174
+ const content = decodeContent(line.message);
175
+ const text = Option.isSome(content) ? contentText(content.value.content) : "";
176
+ const stop = decodeAssistantStop(line.message);
177
+ const stopReason = Option.isSome(stop) ? stop.value.stop_reason : undefined;
178
+ // A subagent finishing its own turn does not end the person's turn on the main thread.
179
+ const ends = line.isSidechain !== true && stopReason !== undefined && stopReason !== null &&
180
+ TURN_END_STOPS.includes(stopReason);
181
+ return { presence: ends ? "turn-end" : "work", text };
182
+ }
183
+ if (line.type === "attachment") {
184
+ const queued = decodeQueuedCommand(line.attachment);
185
+ if (Option.isNone(queued))
186
+ return undefined;
187
+ const text = contentText(queued.value.prompt);
188
+ const typed = queued.value.commandMode === "prompt" && !isMachineOrigin(queued.value.origin);
189
+ return { presence: typed ? "prompt" : "machine", text };
190
+ }
191
+ if (line.type !== "user")
192
+ return undefined;
193
+ const decoded = decodeContent(line.message);
194
+ const content = Option.isSome(decoded) ? decoded.value.content : undefined;
195
+ const text = contentText(content);
196
+ if (isMachineOrigin(line.origin))
197
+ return { presence: "machine", text };
198
+ if (line.isSidechain === true || line.isMeta === true)
199
+ return { presence: "work", text };
200
+ if (/^\s*<task-notification\b/.test(text))
201
+ return { presence: "machine", text };
202
+ if (MACHINE_TEXT.test(text) || !isTypedContent(content))
203
+ return { presence: "work", text };
204
+ return { presence: "prompt", text };
156
205
  };
157
206
  /**
158
207
  * Decode one transcript into the evidence it holds, keeping only activity inside `[from, to)`.
@@ -172,7 +221,7 @@ const isHumanPrompt = (line, message) => {
172
221
  * Pure and total: a malformed line, an unparseable timestamp, or a file of pure noise yields no
173
222
  * segments rather than an error.
174
223
  */
175
- export const decodeTranscript = (content, period) => decodeTranscriptLines(claudeTranscriptLines(content), period);
224
+ export const decodeTranscript = (content, options) => decodeSessionLines(claudeTranscriptLines(content), options);
176
225
  /** Skip malformed external lines before the common segmenter sees them. */
177
226
  function* claudeTranscriptLines(content) {
178
227
  for (const rawLine of content.split("\n")) {
@@ -180,69 +229,112 @@ function* claudeTranscriptLines(content) {
180
229
  if (Option.isNone(json))
181
230
  continue;
182
231
  const decoded = decodeLine(json.value);
183
- if (Option.isSome(decoded))
184
- yield decoded.value;
232
+ if (Option.isNone(decoded))
233
+ continue;
234
+ const line = decoded.value;
235
+ if (line.sessionId === undefined || line.timestamp === undefined || line.cwd === undefined)
236
+ continue;
237
+ const classified = claudePresence(line);
238
+ if (classified === undefined)
239
+ continue;
240
+ yield {
241
+ sessionId: line.sessionId,
242
+ cwd: line.cwd,
243
+ gitBranch: line.gitBranch ?? null,
244
+ atMs: Date.parse(line.timestamp),
245
+ ...classified
246
+ };
185
247
  }
186
248
  }
187
- /** Both providers share presence accounting and per-directory evidence boundaries. */
188
- const decodeTranscriptLines = (lines, period) => {
249
+ /**
250
+ * Both providers share supervised-turn accounting and per-directory evidence boundaries.
251
+ *
252
+ * Turn state is tracked across the whole file, including lines outside the window, so a prompt
253
+ * typed just before the window opens still supervises the work that runs into it.
254
+ */
255
+ export const decodeSessionLines = (lines, options) => {
189
256
  const segments = [];
190
- let promptTimes = [];
257
+ let activityTimes = [];
258
+ // Latest counted instant of the open segment. A queued prompt is stamped when typed, so input order
259
+ // is not time order and `activityTimes.at(-1)` can be stale.
260
+ let latestActivityMs = null;
191
261
  let texts = [];
192
262
  let sessionId = null;
193
263
  let cwd = null;
194
264
  let gitBranch = null;
265
+ let afterIdle = false;
266
+ // Last counted instant of the open supervised turn, or null when no turn is open.
267
+ let turnAtMs = null;
195
268
  // One segment per `(cwd, branch)`. The id carries the segment index so windows, attributions and
196
269
  // digests all key on the same thing — they are looked up from three different places.
197
270
  const closeSegment = (endedAtMs) => {
198
- if (sessionId !== null && cwd !== null && promptTimes.length > 0) {
199
- const id = segments.length === 0 ? sessionId : `${sessionId}#${String(segments.length)}`;
271
+ if (sessionId !== null && cwd !== null && activityTimes.length > 0) {
272
+ const id = afterIdle
273
+ ? `${sessionId}@${String(activityTimes[0])}`
274
+ : segments.length === 0
275
+ ? sessionId
276
+ : `${sessionId}#${String(segments.length)}`;
200
277
  segments.push({
201
278
  sessionId: id,
202
279
  cwd,
203
280
  gitBranch,
204
- // Where the segment gives way to the next. Presence after its final prompt ends there, not
281
+ // Where the segment gives way to the next. Presence after its final activity ends there, not
205
282
  // one whole Idle Cap later: the same person carried straight on under a different branch, so
206
283
  // crediting the tail to both would put the switch's minutes on two tickets at once.
207
284
  boundedAtMs: endedAtMs,
208
- activity: promptTimes.map((atMs) => ({ sessionId: id, atMs })),
285
+ activity: [...activityTimes].sort((a, b) => a - b).map((atMs) => ({ sessionId: id, atMs })),
209
286
  texts
210
287
  });
211
288
  }
212
- // Reset unconditionally. A stretch with no typed prompt still has text, and leaving it behind
289
+ // Reset unconditionally. A stretch with no activity still has text, and leaving it behind
213
290
  // leaks it into the next segment — including text from a directory that was never opted in.
214
- promptTimes = [];
291
+ activityTimes = [];
292
+ latestActivityMs = null;
215
293
  texts = [];
216
294
  };
217
295
  for (const line of lines) {
218
- if (line.type === undefined || !ACTIVITY_TYPES.includes(line.type))
219
- continue;
220
- if (line.sessionId === undefined || line.timestamp === undefined || line.cwd === undefined)
221
- continue;
222
- const atMs = Date.parse(line.timestamp);
296
+ const atMs = line.atMs;
223
297
  if (Number.isNaN(atMs))
224
298
  continue;
225
- if (atMs < period.fromMs || atMs >= period.toMs)
299
+ // The turn advances on every line, inside the window or not.
300
+ const supervised = turnAtMs !== null && atMs - turnAtMs <= options.idleCapMs;
301
+ const counts = line.presence === "prompt" ||
302
+ ((line.presence === "work" || line.presence === "turn-end") && supervised);
303
+ if (line.presence === "prompt")
304
+ turnAtMs = Math.max(turnAtMs ?? atMs, atMs);
305
+ else if (line.presence === "work")
306
+ turnAtMs = supervised ? Math.max(turnAtMs ?? atMs, atMs) : null;
307
+ else if (line.presence === "turn-end" || line.presence === "machine")
308
+ turnAtMs = null;
309
+ if (atMs < options.fromMs || atMs >= options.toMs)
226
310
  continue;
311
+ // Later mentions must not rebalance an already settled group. An idle barrier closes its text
312
+ // and activity together; the next group has a timestamp identity stable under later appends.
313
+ if (latestActivityMs !== null && atMs - latestActivityMs > options.idleCapMs) {
314
+ closeSegment(latestActivityMs + options.idleCapMs);
315
+ afterIdle = true;
316
+ }
227
317
  // Closed *before* this line contributes anything: the first line under the new branch is
228
318
  // evidence about the new segment, and appending it first put it in the old segment's digest and
229
319
  // left it out of the new one's.
230
- const branch = line.gitBranch ?? null;
231
- if (cwd !== null && (cwd !== line.cwd || gitBranch !== branch))
320
+ if (cwd !== null && (cwd !== line.cwd || gitBranch !== line.gitBranch)) {
232
321
  closeSegment(atMs);
322
+ afterIdle = false;
323
+ }
233
324
  sessionId = line.sessionId;
234
325
  cwd = line.cwd;
235
- gitBranch = branch;
326
+ gitBranch = line.gitBranch;
236
327
  // Inside the window only, and every kind of line: a key mentioned solely in the agent's own
237
328
  // output is still a candidate, but a prompt written after the window is not evidence about it.
238
329
  // A resumed session that moved on to something else would otherwise attribute — and describe —
239
330
  // yesterday's hours from today's work, and could carry text from a directory that was never
240
331
  // opted in to a Coding Agent.
241
- const text = messageText(line.message);
242
- if (text !== "")
243
- texts.push(text);
244
- if (isHumanPrompt(line, line.message))
245
- promptTimes.push(atMs);
332
+ if (line.text !== "")
333
+ texts.push(line.text);
334
+ if (counts) {
335
+ activityTimes.push(atMs);
336
+ latestActivityMs = Math.max(latestActivityMs ?? atMs, atMs);
337
+ }
246
338
  }
247
339
  closeSegment(null);
248
340
  return segments;
@@ -334,6 +426,7 @@ export const layer = Layer.effect(AgentSessionReader, Effect.gen(function* () {
334
426
  return [];
335
427
  const fromMs = period.from.getTime();
336
428
  const toMs = period.to.getTime();
429
+ const idleCapMs = Math.max(0, cfg.sessionIdleCapSeconds) * 1000;
337
430
  const paths = yield* transcriptPaths(roots);
338
431
  const records = [];
339
432
  const addSegments = (segments) => {
@@ -346,6 +439,7 @@ export const layer = Layer.effect(AgentSessionReader, Effect.gen(function* () {
346
439
  cwd: segment.cwd,
347
440
  gitBranch: segment.gitBranch,
348
441
  candidateKeys: mineTicketKeys(segment.texts.join("\n")),
442
+ mentionCounts: ticketMentionCounts(segment.texts.join("\n")),
349
443
  digest: buildSessionDigest(segment.texts),
350
444
  activity: segment.activity,
351
445
  boundedAtMs: segment.boundedAtMs
@@ -364,7 +458,7 @@ export const layer = Layer.effect(AgentSessionReader, Effect.gen(function* () {
364
458
  message: `Could not read the session transcript ${filePath}: ${error.message}`,
365
459
  cause: error
366
460
  })));
367
- addSegments(decodeTranscript(content, { fromMs, toMs }));
461
+ addSegments(decodeTranscript(content, { fromMs, toMs, idleCapMs }));
368
462
  }
369
463
  const hasCodex = yield* fs
370
464
  .exists(codexRoot)
@@ -382,7 +476,7 @@ export const layer = Layer.effect(AgentSessionReader, Effect.gen(function* () {
382
476
  continue;
383
477
  // Rollouts can be hundreds of MB; discard tool data before retaining decoded messages.
384
478
  const lines = yield* fs.stream(filePath).pipe(Stream.decodeText(), Stream.splitLines, Stream.map((line) => decodeCodexLine(line)), Stream.filter(Option.isSome), Stream.map((decoded) => decoded.value), Stream.runCollect, Effect.catch(asAgentSessionError("Reading Codex session failed")));
385
- addSegments(decodeTranscriptLines(codexTranscriptLines(lines), { fromMs, toMs }));
479
+ addSegments(decodeSessionLines(codexTranscriptLines(lines), { fromMs, toMs, idleCapMs }));
386
480
  }
387
481
  }
388
482
  return records;
@@ -1 +1 @@
1
- {"version":3,"file":"AgentSessionReader.js","sourceRoot":"","sources":["../../../src/services/AgentSessionReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,MAAM,MAA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AC,CAAC;oBAAE,SAAQ;gBACzD,uFAAuF;gBACvF,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC3C,MAAM,CAAC,UAAU,EAAE,EACnB,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAC3C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAC5B,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EACtC,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,8BAA8B,CAAC,CAAC,CAClE,CAAA;gBACD,WAAW,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;YAC3F,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;IAEJ,OAAO,EAAE,IAAI,EAAE,CAAA;AACjB,CAAC,CAAC,CACH,CAAA"}
@@ -1,9 +1,11 @@
1
1
  /**
2
- * Normalize Codex rollouts into session messages. Only authoritative user events count as
3
- * presence: response-item copies also contain injected instructions and replayed compacted history.
4
- * Metadata and turn contexts supply the directory; native subagent rollouts supply no human time.
2
+ * Normalize Codex rollouts into session lines. Only authoritative user events open a supervised
3
+ * turn: response-item copies also contain injected instructions and replayed compacted history.
4
+ * Completed items continue the turn, `task_complete` and `turn_aborted` end it. Metadata and turn
5
+ * contexts supply the directory; native subagent rollouts supply no human time.
5
6
  */
6
7
  import * as Schema from "effect/Schema";
8
+ import type { SessionLine } from "./SessionLine.js";
7
9
  declare const CodexLine: Schema.Union<readonly [Schema.Struct<{
8
10
  readonly type: Schema.Literal<"session_meta">;
9
11
  readonly payload: Schema.Struct<{
@@ -38,6 +40,21 @@ declare const CodexLine: Schema.Union<readonly [Schema.Struct<{
38
40
  }>>;
39
41
  }>;
40
42
  }>]>;
43
+ }>, Schema.Struct<{
44
+ readonly type: Schema.Literal<"event_msg">;
45
+ readonly timestamp: Schema.String;
46
+ readonly payload: Schema.Struct<{
47
+ readonly type: Schema.Literal<"item_completed">;
48
+ readonly item: Schema.Struct<{
49
+ readonly type: Schema.String;
50
+ }>;
51
+ }>;
52
+ }>, Schema.Struct<{
53
+ readonly type: Schema.Literal<"event_msg">;
54
+ readonly timestamp: Schema.String;
55
+ readonly payload: Schema.Struct<{
56
+ readonly type: Schema.Literals<readonly ["task_complete", "turn_aborted"]>;
57
+ }>;
41
58
  }>, Schema.Struct<{
42
59
  readonly type: Schema.Literal<"response_item">;
43
60
  readonly timestamp: Schema.String;
@@ -49,6 +66,13 @@ declare const CodexLine: Schema.Union<readonly [Schema.Struct<{
49
66
  readonly text: Schema.optional<Schema.String>;
50
67
  }>>;
51
68
  }>;
69
+ }>, Schema.Struct<{
70
+ readonly type: Schema.Literal<"response_item">;
71
+ readonly timestamp: Schema.String;
72
+ readonly payload: Schema.Struct<{
73
+ readonly type: Schema.String;
74
+ readonly role: Schema.optional<Schema.String>;
75
+ }>;
52
76
  }>]>;
53
77
  /** Discard tool payloads and malformed lines before retaining a rollout in memory. */
54
78
  export declare const decodeCodexLine: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Option").Option<{
@@ -85,6 +109,21 @@ export declare const decodeCodexLine: (input: unknown, options?: import("effect/
85
109
  }[];
86
110
  };
87
111
  };
112
+ } | {
113
+ readonly type: "event_msg";
114
+ readonly timestamp: string;
115
+ readonly payload: {
116
+ readonly type: "item_completed";
117
+ readonly item: {
118
+ readonly type: string;
119
+ };
120
+ };
121
+ } | {
122
+ readonly type: "event_msg";
123
+ readonly timestamp: string;
124
+ readonly payload: {
125
+ readonly type: "task_complete" | "turn_aborted";
126
+ };
88
127
  } | {
89
128
  readonly type: "response_item";
90
129
  readonly timestamp: string;
@@ -96,17 +135,15 @@ export declare const decodeCodexLine: (input: unknown, options?: import("effect/
96
135
  readonly text?: string | undefined;
97
136
  }[];
98
137
  };
138
+ } | {
139
+ readonly type: "response_item";
140
+ readonly timestamp: string;
141
+ readonly payload: {
142
+ readonly type: string;
143
+ readonly role?: string | undefined;
144
+ };
99
145
  }>;
100
146
  /** The shared transcript segmenter handles time windows, branch changes and directory isolation. */
101
- export declare function codexTranscriptLines(lines: Iterable<typeof CodexLine.Type>): Generator<{
102
- type: string;
103
- sessionId: string;
104
- cwd: string;
105
- gitBranch: string | null;
106
- timestamp: string;
107
- message: {
108
- content: string;
109
- };
110
- }, void, unknown>;
147
+ export declare function codexTranscriptLines(lines: Iterable<typeof CodexLine.Type>): Generator<SessionLine>;
111
148
  export {};
112
149
  //# sourceMappingURL=CodexTranscript.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodexTranscript.d.ts","sourceRoot":"","sources":["../../../src/services/CodexTranscript.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAoBvC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBb,CAAA;AAEF,sFAAsF;AACtF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+D,CAAA;AAE3F,oGAAoG;AACpG,wBAAiB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC;;;;;;;QAmBsB,OAAO;;kBAyBxG"}
1
+ {"version":3,"file":"CodexTranscript.d.ts","sourceRoot":"","sources":["../../../src/services/CodexTranscript.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAiCnD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoBb,CAAA;AAMF,sFAAsF;AACtF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+D,CAAA;AAE3F,oGAAoG;AACpG,wBAAiB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,WAAW,CAAC,CA2DpG"}