@parall/claude-agent 1.55.0 → 1.55.2

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.
@@ -53,7 +53,7 @@ export declare class ClaudeCodeAdapter implements DispatchAdapter {
53
53
  enqueueDuringDispatch(sessionKey: string, body: string, inputLifecycle?: DispatchInputLifecycle): boolean;
54
54
  abortDispatch(sessionKey: string): void;
55
55
  hasPendingInjections(sessionKey: string): boolean;
56
- dispatch({ event, bodyForAgent, sessionKey, context, inputLifecycle, }: DispatchOpts): AsyncIterable<RuntimeEvent>;
56
+ dispatch({ event, bodyForAgent, sessionKey, context, inputLifecycle, noteActivity, }: DispatchOpts): AsyncIterable<RuntimeEvent>;
57
57
  getBranchPoint(_sessionKey: string): string | undefined;
58
58
  getSessionHistoryPath(sessionKey: string): string | undefined;
59
59
  forkSession({ sessionKey }: ForkOpts): import("@parall/agent-core").ForkSessionHandle | null;
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,QAAQ,EAER,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAOrD,OAAO,KAAK,EAAuB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGtF,KAAK,wBAAwB,GAAG,IAAI,CAClC,iBAAiB,EACf,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,oBAAoB,GACpB,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,OAAO,GACP,gBAAgB,GAChB,cAAc,CACjB,GAAG;IACF,cAAc,EAAE,oBAAoB,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB,CAAC,EAAE,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C,SAAS;IAwCjB,OAAO,CAAC,uBAAuB;CAmBhC"}
package/dist/dispatch.js CHANGED
@@ -171,7 +171,7 @@ export class ClaudeCodeAdapter {
171
171
  return false;
172
172
  return state.inputs.hasPendingInjections();
173
173
  }
174
- async *dispatch({ event, bodyForAgent, sessionKey, context, inputLifecycle, }) {
174
+ async *dispatch({ event, bodyForAgent, sessionKey, context, inputLifecycle, noteActivity, }) {
175
175
  const deliveryKey = inputLifecycle?.deliveryKey ?? event.dispatchEventId ?? event.messageId;
176
176
  const existingState = this.processes.get(sessionKey);
177
177
  const injected = existingState?.inputs.getByKey(deliveryKey);
@@ -185,7 +185,7 @@ export class ClaudeCodeAdapter {
185
185
  injected.drained = true;
186
186
  context.log?.info?.(`consuming steer input ${injected.commandUuid}`);
187
187
  try {
188
- yield* this.consumeDelivery(sessionKey, existingState, injected, context.log);
188
+ yield* this.consumeDelivery(sessionKey, existingState, injected, context.log, noteActivity);
189
189
  }
190
190
  finally {
191
191
  existingState.inputs.remove(injected);
@@ -216,7 +216,7 @@ export class ClaudeCodeAdapter {
216
216
  context.log?.warn?.(`failed to prepare local attachments: ${String(err)}`);
217
217
  }
218
218
  try {
219
- yield* this.runTurn(sessionKey, promptBody, deliveryKey, inputLifecycle, context.log);
219
+ yield* this.runTurn(sessionKey, promptBody, deliveryKey, inputLifecycle, context.log, noteActivity);
220
220
  }
221
221
  finally {
222
222
  releasePreparedAttachments();
@@ -258,7 +258,7 @@ export class ClaudeCodeAdapter {
258
258
  this.resetProcesses();
259
259
  await this.opts.sessionManager.shutdownAll();
260
260
  }
261
- async *runTurn(sessionKey, promptBody, deliveryKey, lifecycle, log) {
261
+ async *runTurn(sessionKey, promptBody, deliveryKey, lifecycle, log, noteActivity) {
262
262
  let state;
263
263
  try {
264
264
  await this.ensureRuntimeCapability(log);
@@ -286,7 +286,7 @@ export class ClaudeCodeAdapter {
286
286
  return;
287
287
  }
288
288
  try {
289
- yield* this.consumeDelivery(sessionKey, state, delivery, log);
289
+ yield* this.consumeDelivery(sessionKey, state, delivery, log, noteActivity);
290
290
  }
291
291
  finally {
292
292
  state.inputs.remove(delivery);
@@ -353,7 +353,7 @@ export class ClaudeCodeAdapter {
353
353
  * finish while this drain is active; their callbacks advance independently
354
354
  * and their later bookkeeping dispatch becomes a no-op.
355
355
  */
356
- async *consumeDelivery(sessionKey, state, target, log) {
356
+ async *consumeDelivery(sessionKey, state, target, log, noteActivity) {
357
357
  if (target.terminal)
358
358
  return;
359
359
  const groupKey = randomUUID();
@@ -397,6 +397,12 @@ export class ClaudeCodeAdapter {
397
397
  return;
398
398
  }
399
399
  const parsed = next.value;
400
+ // Count every parser-observed CLI progress frame as activity, including
401
+ // command lifecycle, turn boundaries, and explicit activity markers
402
+ // for nested subagent frames that must not become RuntimeEvents.
403
+ noteActivity?.();
404
+ if (parsed.type === 'runtime_activity')
405
+ continue;
400
406
  if (parsed.type === 'runtime_init') {
401
407
  state.capabilities = new Set(parsed.capabilities);
402
408
  if (parsed.sessionId) {
@@ -29,6 +29,8 @@ export type ClaudeParsedEvent = RuntimeEvent | {
29
29
  type: 'runtime_init';
30
30
  sessionId?: string;
31
31
  capabilities: string[];
32
+ } | {
33
+ type: 'runtime_activity';
32
34
  } | {
33
35
  type: 'command_lifecycle';
34
36
  commandUuid: string;
@@ -1 +1 @@
1
- {"version":3,"file":"output-parser.d.ts","sourceRoot":"","sources":["../src/output-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,UAAU,CAAC,EAAE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AAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,CAAC;AAgFN,wBAAuB,qBAAqB,CAC1C,QAAQ,EAAE,QAAQ,GACjB,cAAc,CAAC,iBAAiB,CAAC,CAkLnC"}
@@ -132,8 +132,10 @@ export async function* parseClaudeStreamJson(readable) {
132
132
  // tool_result returns through the root conversation; projecting their
133
133
  // internal assistant/tool stream here would attribute background work
134
134
  // to whichever root input currently owns stdout.
135
- if (asTrimmedString(eventRecord.parent_tool_use_id))
135
+ if (asTrimmedString(eventRecord.parent_tool_use_id)) {
136
+ yield { type: 'runtime_activity' };
136
137
  continue;
138
+ }
137
139
  const message = eventRecord.message;
138
140
  const content = message && typeof message === 'object'
139
141
  ? message.content
@@ -180,8 +182,10 @@ export async function* parseClaudeStreamJson(readable) {
180
182
  continue;
181
183
  }
182
184
  if (eventRecord.type === 'user') {
183
- if (asTrimmedString(eventRecord.parent_tool_use_id))
185
+ if (asTrimmedString(eventRecord.parent_tool_use_id)) {
186
+ yield { type: 'runtime_activity' };
184
187
  continue;
188
+ }
185
189
  const message = eventRecord.message;
186
190
  const content = message && typeof message === 'object'
187
191
  ? message.content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/claude-agent",
3
- "version": "1.55.0",
3
+ "version": "1.55.2",
4
4
  "description": "Claude Code bridge runtime for self-hosted Parall agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,9 +25,9 @@
25
25
  "src"
26
26
  ],
27
27
  "dependencies": {
28
- "@parall/agent-core": "1.55.0",
29
- "@parall/cli": "1.55.0",
30
- "@parall/sdk": "1.55.0"
28
+ "@parall/agent-core": "1.55.2",
29
+ "@parall/cli": "1.55.2",
30
+ "@parall/sdk": "1.55.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^22.0.0",
package/src/dispatch.ts CHANGED
@@ -262,6 +262,7 @@ export class ClaudeCodeAdapter implements DispatchAdapter {
262
262
  sessionKey,
263
263
  context,
264
264
  inputLifecycle,
265
+ noteActivity,
265
266
  }: DispatchOpts): AsyncIterable<RuntimeEvent> {
266
267
  const deliveryKey = inputLifecycle?.deliveryKey ?? event.dispatchEventId ?? event.messageId;
267
268
  const existingState = this.processes.get(sessionKey);
@@ -275,7 +276,13 @@ export class ClaudeCodeAdapter implements DispatchAdapter {
275
276
  injected.drained = true;
276
277
  context.log?.info?.(`consuming steer input ${injected.commandUuid}`);
277
278
  try {
278
- yield* this.consumeDelivery(sessionKey, existingState, injected, context.log);
279
+ yield* this.consumeDelivery(
280
+ sessionKey,
281
+ existingState,
282
+ injected,
283
+ context.log,
284
+ noteActivity,
285
+ );
279
286
  } finally {
280
287
  existingState.inputs.remove(injected);
281
288
  }
@@ -308,7 +315,14 @@ export class ClaudeCodeAdapter implements DispatchAdapter {
308
315
  }
309
316
 
310
317
  try {
311
- yield* this.runTurn(sessionKey, promptBody, deliveryKey, inputLifecycle, context.log);
318
+ yield* this.runTurn(
319
+ sessionKey,
320
+ promptBody,
321
+ deliveryKey,
322
+ inputLifecycle,
323
+ context.log,
324
+ noteActivity,
325
+ );
312
326
  } finally {
313
327
  releasePreparedAttachments();
314
328
  }
@@ -367,6 +381,7 @@ export class ClaudeCodeAdapter implements DispatchAdapter {
367
381
  deliveryKey: string,
368
382
  lifecycle: DispatchInputLifecycle | undefined,
369
383
  log: GatewayLogger | undefined,
384
+ noteActivity: (() => void) | undefined,
370
385
  ): AsyncGenerator<RuntimeEvent> {
371
386
  let state: ProcessState;
372
387
  try {
@@ -393,7 +408,7 @@ export class ClaudeCodeAdapter implements DispatchAdapter {
393
408
  }
394
409
 
395
410
  try {
396
- yield* this.consumeDelivery(sessionKey, state, delivery, log);
411
+ yield* this.consumeDelivery(sessionKey, state, delivery, log, noteActivity);
397
412
  } finally {
398
413
  state.inputs.remove(delivery);
399
414
  }
@@ -469,6 +484,7 @@ export class ClaudeCodeAdapter implements DispatchAdapter {
469
484
  state: ProcessState,
470
485
  target: ClaudeInputDelivery,
471
486
  log: GatewayLogger | undefined,
487
+ noteActivity: (() => void) | undefined,
472
488
  ): AsyncGenerator<RuntimeEvent> {
473
489
  if (target.terminal) return;
474
490
  const groupKey = randomUUID();
@@ -518,6 +534,12 @@ export class ClaudeCodeAdapter implements DispatchAdapter {
518
534
  }
519
535
 
520
536
  const parsed = next.value;
537
+ // Count every parser-observed CLI progress frame as activity, including
538
+ // command lifecycle, turn boundaries, and explicit activity markers
539
+ // for nested subagent frames that must not become RuntimeEvents.
540
+ noteActivity?.();
541
+
542
+ if (parsed.type === 'runtime_activity') continue;
521
543
 
522
544
  if (parsed.type === 'runtime_init') {
523
545
  state.capabilities = new Set(parsed.capabilities);
@@ -30,6 +30,11 @@ export type ClaudeResultMeta = {
30
30
  export type ClaudeParsedEvent =
31
31
  | RuntimeEvent
32
32
  | { type: 'runtime_init'; sessionId?: string; capabilities: string[] }
33
+ // Internal-only progress marker for a valid CLI frame whose content must
34
+ // not be projected into the root RuntimeEvent stream (for example, nested
35
+ // subagent output). The dispatch consumer uses it only to refresh runtime
36
+ // activity and never persists it.
37
+ | { type: 'runtime_activity' }
33
38
  | {
34
39
  type: 'command_lifecycle';
35
40
  commandUuid: string;
@@ -209,7 +214,10 @@ export async function* parseClaudeStreamJson(
209
214
  // tool_result returns through the root conversation; projecting their
210
215
  // internal assistant/tool stream here would attribute background work
211
216
  // to whichever root input currently owns stdout.
212
- if (asTrimmedString(eventRecord.parent_tool_use_id)) continue;
217
+ if (asTrimmedString(eventRecord.parent_tool_use_id)) {
218
+ yield { type: 'runtime_activity' };
219
+ continue;
220
+ }
213
221
 
214
222
  const message = eventRecord.message;
215
223
  const content =
@@ -260,7 +268,10 @@ export async function* parseClaudeStreamJson(
260
268
  }
261
269
 
262
270
  if (eventRecord.type === 'user') {
263
- if (asTrimmedString(eventRecord.parent_tool_use_id)) continue;
271
+ if (asTrimmedString(eventRecord.parent_tool_use_id)) {
272
+ yield { type: 'runtime_activity' };
273
+ continue;
274
+ }
264
275
  const message = eventRecord.message;
265
276
  const content =
266
277
  message && typeof message === 'object'