@tryarcanist/cli 0.1.58 → 0.1.59

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 +30 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -586,6 +586,7 @@ function getRawSessionEventKind(event) {
586
586
  if (!isCanonicalRawSessionEvent(event)) return event.type;
587
587
  const payload = compatPayload(event);
588
588
  const bridgeEventType = compatBridgeEventType(event);
589
+ if (bridgeEventType === "prompt_activity") return "prompt_activity";
589
590
  switch (event.phase) {
590
591
  case "text.delta":
591
592
  return payload.channel === "reasoning" ? "reasoning" : "text";
@@ -814,6 +815,7 @@ function createFlattenState() {
814
815
  merged: [],
815
816
  streams: createStreamCoalescerState(),
816
817
  toolCallIndexById: /* @__PURE__ */ new Map(),
818
+ promptActivityIndexByKey: /* @__PURE__ */ new Map(),
817
819
  questionIndexById: /* @__PURE__ */ new Map()
818
820
  };
819
821
  }
@@ -893,6 +895,28 @@ function projectAgentTimeline(data, index) {
893
895
  ...resolvePromptId(data) ? { promptId: resolvePromptId(data) } : {}
894
896
  };
895
897
  }
898
+ function projectPromptActivity(data, index) {
899
+ const promptId = resolvePromptId(data);
900
+ return {
901
+ type: "prompt_activity",
902
+ id: resolveEventId(data, "pa", index),
903
+ phase: typeof data?.phase === "string" ? data.phase : "unknown",
904
+ ...typeof data?.detail === "string" ? { detail: data.detail } : {},
905
+ ...promptId ? { promptId } : {}
906
+ };
907
+ }
908
+ function projectPromptActivityEvent(data, state) {
909
+ const event = projectPromptActivity(data, state.merged.length);
910
+ const key = `${event.promptId ?? ""}\0${event.phase}\0${event.detail ?? ""}`;
911
+ const existingIdx = state.promptActivityIndexByKey.get(key);
912
+ if (existingIdx !== void 0) {
913
+ const existing = state.merged[existingIdx];
914
+ state.merged[existingIdx] = existing.type === "prompt_activity" ? { ...event, id: existing.id } : event;
915
+ return;
916
+ }
917
+ state.promptActivityIndexByKey.set(key, state.merged.length);
918
+ state.merged.push(event);
919
+ }
896
920
  function projectSessionError(data, index) {
897
921
  return {
898
922
  type: "session_error",
@@ -1060,6 +1084,9 @@ function flattenSessionEvents(raw) {
1060
1084
  case "agent_timeline":
1061
1085
  pushEvent(state, projectAgentTimeline(data, state.merged.length));
1062
1086
  break;
1087
+ case "prompt_activity":
1088
+ projectPromptActivityEvent(data, state);
1089
+ break;
1063
1090
  case "session_error":
1064
1091
  pushEvent(state, projectSessionError(data, state.merged.length));
1065
1092
  break;
@@ -1141,7 +1168,6 @@ var ERROR_CODES = [
1141
1168
  "api_error",
1142
1169
  "config_error",
1143
1170
  "doom_loop",
1144
- "tool_limit",
1145
1171
  "failed_edits",
1146
1172
  "empty_completion",
1147
1173
  "followup_not_started",
@@ -1175,7 +1201,6 @@ var ERROR_CODE_LABELS = {
1175
1201
  api_error: "Provider API error",
1176
1202
  config_error: "Configuration error",
1177
1203
  doom_loop: "Repeated failure loop",
1178
- tool_limit: "Tool limit reached",
1179
1204
  failed_edits: "Edit failure",
1180
1205
  empty_completion: "Empty completion",
1181
1206
  followup_not_started: "Follow-up did not start",
@@ -1273,6 +1298,9 @@ ${event.answer ? `**Answer:** ${event.answer}
1273
1298
  `;
1274
1299
  case "customer_activity":
1275
1300
  return `**${event.title}:** ${event.summary}
1301
+ `;
1302
+ case "prompt_activity":
1303
+ return `*[${event.detail ?? event.phase}]*
1276
1304
  `;
1277
1305
  case "raw_codex":
1278
1306
  return "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "description": "CLI for Arcanist — create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {