@hwip/cli 0.1.18 → 0.1.19
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.
- package/dist/listener.d.ts +5 -0
- package/dist/listener.js +6 -2
- package/package.json +1 -1
package/dist/listener.d.ts
CHANGED
|
@@ -224,6 +224,11 @@ export type StaleConnectionAction =
|
|
|
224
224
|
export declare const staleConnectionAction: (message: unknown, drops: number) => StaleConnectionAction;
|
|
225
225
|
/** Each live run's first seq, for the report (Q24). A run that has recorded nothing yet has none. */
|
|
226
226
|
export declare const withRunSeqs: (sessions: AgentSession[], seqs?: Map<string, RunSeqs>) => AgentSession[];
|
|
227
|
+
/** What makes a cycle's inventory a change worth sending. lastActivityAt and
|
|
228
|
+
* stateChangedAt are left out: they move on every terminal output, and the
|
|
229
|
+
* server does not compare them either (REPORTED_SESSION_FIELDS). They reach
|
|
230
|
+
* the server with the next report that changes something else, or the
|
|
231
|
+
* heartbeat. */
|
|
227
232
|
export declare const sessionsFingerprint: (sessions: AgentSession[]) => string;
|
|
228
233
|
/** True when this cycle's inventory must be sent: it changed, or the
|
|
229
234
|
* idle heartbeat is due. */
|
package/dist/listener.js
CHANGED
|
@@ -302,12 +302,16 @@ const withRunSeqs = (sessions, seqs = (0, run_seqs_js_1.runSeqsByRun)()) => sess
|
|
|
302
302
|
return block ? { ...s, firstSeq: block.firstSeq } : s;
|
|
303
303
|
});
|
|
304
304
|
exports.withRunSeqs = withRunSeqs;
|
|
305
|
+
/** What makes a cycle's inventory a change worth sending. lastActivityAt and
|
|
306
|
+
* stateChangedAt are left out: they move on every terminal output, and the
|
|
307
|
+
* server does not compare them either (REPORTED_SESSION_FIELDS). They reach
|
|
308
|
+
* the server with the next report that changes something else, or the
|
|
309
|
+
* heartbeat. */
|
|
305
310
|
const sessionsFingerprint = (sessions) => sessions
|
|
306
311
|
.map((s) => JSON.stringify([
|
|
307
312
|
s.name, s.attached, s.agentKind, s.agentSessionId ?? null,
|
|
308
313
|
s.project, s.label ?? null, s.providerSessionName ?? null, s.providerSessionNameSource ?? null, s.providerSessionHandle ?? null, s.createdAt ?? null, s.runId ?? null, s.firstSeq ?? null,
|
|
309
|
-
s.
|
|
310
|
-
s.stateChangedAt ?? null, s.stateRuleId ?? null,
|
|
314
|
+
s.state ?? null, s.stateRuleId ?? null,
|
|
311
315
|
s.blockedPrompt?.id ?? null, s.blockedPrompt?.at ?? null,
|
|
312
316
|
]))
|
|
313
317
|
.sort()
|