@tryarcanist/cli 0.1.29 → 0.1.30

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 (2) hide show
  1. package/dist/index.js +20 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -433,6 +433,23 @@ function withPromptId(event, data) {
433
433
  const promptId = canonicalPromptId(event);
434
434
  return promptId && data.promptId === void 0 ? { ...data, promptId } : data;
435
435
  }
436
+ function normalizeBridgeCompatEventData(event, bridgeEventType, bridgeData) {
437
+ switch (bridgeEventType) {
438
+ case "tool_call":
439
+ return withPromptId(event, {
440
+ ...bridgeData,
441
+ ...typeof bridgeData.callId === "string" && bridgeData.callId.length > 0 && !(typeof bridgeData.id === "string" && bridgeData.id.length > 0) ? { id: bridgeData.callId } : {},
442
+ ...isRecord(bridgeData.args) && bridgeData.input === void 0 ? { input: bridgeData.args } : {}
443
+ });
444
+ case "tool_update":
445
+ return withPromptId(event, {
446
+ ...bridgeData,
447
+ ...typeof bridgeData.callId === "string" && bridgeData.callId.length > 0 && !(typeof bridgeData.id === "string" && bridgeData.id.length > 0) ? { id: bridgeData.callId } : {}
448
+ });
449
+ default:
450
+ return withPromptId(event, bridgeData);
451
+ }
452
+ }
436
453
  function getRawSessionEventPromptId(event) {
437
454
  if (isCanonicalRawSessionEvent(event)) {
438
455
  return canonicalPromptId(event);
@@ -480,6 +497,7 @@ function getRawSessionEventData(event) {
480
497
  return isRecord(event.data) ? event.data : void 0;
481
498
  }
482
499
  const payload = compatPayload(event);
500
+ const bridgeEventType = compatBridgeEventType(event);
483
501
  const base = withPromptId(event, compatBridgeData(event));
484
502
  switch (event.phase) {
485
503
  case "text.delta":
@@ -537,6 +555,8 @@ function getRawSessionEventData(event) {
537
555
  ...typeof payload.code === "string" ? { code: payload.code } : {},
538
556
  ...payload.details !== void 0 ? { errorDetails: payload.details } : {}
539
557
  });
558
+ case "bridge.event":
559
+ return normalizeBridgeCompatEventData(event, bridgeEventType, base);
540
560
  case "idle":
541
561
  return withPromptId(event, {
542
562
  ...base,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "CLI for Arcanist — create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {