replicas-cli 0.3.199 → 0.3.200

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.cjs +54 -3
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -351,6 +351,18 @@ var init_saved_order = __esm({
351
351
  }
352
352
  });
353
353
 
354
+ // ../shared/src/palette-search.ts
355
+ var DAY_MS, RECENCY_HALF_LIFE_MS, SEARCH_OPEN_DEDUPE_MS, PICK_WINDOW_MS;
356
+ var init_palette_search = __esm({
357
+ "../shared/src/palette-search.ts"() {
358
+ "use strict";
359
+ DAY_MS = 24 * 60 * 60 * 1e3;
360
+ RECENCY_HALF_LIFE_MS = 14 * DAY_MS;
361
+ SEARCH_OPEN_DEDUPE_MS = 10 * 60 * 1e3;
362
+ PICK_WINDOW_MS = 21 * DAY_MS;
363
+ }
364
+ });
365
+
354
366
  // ../shared/src/agent.ts
355
367
  function isValidAgentProvider(value) {
356
368
  return VALID_AGENT_PROVIDERS.some((p) => p === value);
@@ -16651,7 +16663,7 @@ function parseCodexTurnRetryPayload(payload) {
16651
16663
  const { attempt, maxAttempts, [CODEX_ASP_ITEM_ID_PAYLOAD_KEY]: turnId } = payload;
16652
16664
  return typeof attempt === "number" && typeof maxAttempts === "number" && typeof turnId === "string" ? { attempt, maxAttempts, [CODEX_ASP_ITEM_ID_PAYLOAD_KEY]: turnId } : void 0;
16653
16665
  }
16654
- var CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE, ACCEPTED_USER_MESSAGE_SOURCE, QUEUED_MESSAGE_REMOVED_EVENT_TYPE, REMOVED_MESSAGE_IDS_PAYLOAD_KEY, USER_MESSAGE_ID_PAYLOAD_KEY, REPLACED_MESSAGE_ID_PAYLOAD_KEY, CODEX_ASP_ITEM_ID_PAYLOAD_KEY, CODEX_ITEM_EVENT_TYPE, CODEX_ITEM_PARTIAL_EVENT_TYPE, CODEX_TURN_EVENT_TYPE, CODEX_TURN_RETRY_EVENT_TYPE, CODEX_QUOTA_STATUS_EVENT_TYPE, CHAT_INTERRUPTED_EVENT_TYPE, CHAT_MESSAGE_REJECTED_EVENT_TYPE, CHAT_TURN_LOST_EVENT_TYPE, AUTH_FALLBACK_EVENT_TYPE;
16666
+ var CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE, ACCEPTED_USER_MESSAGE_SOURCE, QUEUED_MESSAGE_REMOVED_EVENT_TYPE, REMOVED_MESSAGE_IDS_PAYLOAD_KEY, USER_MESSAGE_ID_PAYLOAD_KEY, REPLACED_MESSAGE_ID_PAYLOAD_KEY, CODEX_ASP_ITEM_ID_PAYLOAD_KEY, CODEX_ITEM_EVENT_TYPE, CODEX_ITEM_PARTIAL_EVENT_TYPE, CODEX_TURN_EVENT_TYPE, CODEX_TURN_RETRY_EVENT_TYPE, CODEX_QUOTA_STATUS_EVENT_TYPE, CHAT_INTERRUPTED_EVENT_TYPE, CHAT_MESSAGE_REJECTED_EVENT_TYPE, CHAT_TURN_LOST_EVENT_TYPE, CLAUDE_PEER_MESSAGE_EVENT_TYPE, AUTH_FALLBACK_EVENT_TYPE;
16655
16667
  var init_event = __esm({
16656
16668
  "../shared/src/event.ts"() {
16657
16669
  "use strict";
@@ -16674,6 +16686,7 @@ var init_event = __esm({
16674
16686
  CHAT_INTERRUPTED_EVENT_TYPE = "replicas-interrupted";
16675
16687
  CHAT_MESSAGE_REJECTED_EVENT_TYPE = "replicas-message-rejected";
16676
16688
  CHAT_TURN_LOST_EVENT_TYPE = "replicas-turn-lost";
16689
+ CLAUDE_PEER_MESSAGE_EVENT_TYPE = "claude-peer-message";
16677
16690
  AUTH_FALLBACK_EVENT_TYPE = "auth-fallback";
16678
16691
  }
16679
16692
  });
@@ -29899,6 +29912,8 @@ function parseClaudeEvents(events, parentToolUseId) {
29899
29912
  });
29900
29913
  const toolCallMap = /* @__PURE__ */ new Map();
29901
29914
  const taskMessageMap = /* @__PURE__ */ new Map();
29915
+ const peerNames = /* @__PURE__ */ new Map();
29916
+ const peerTimestamps = /* @__PURE__ */ new Map();
29902
29917
  const workflowAgentMessageMap = /* @__PURE__ */ new Map();
29903
29918
  const ambientTaskIds = /* @__PURE__ */ new Set();
29904
29919
  const partialIndexes = /* @__PURE__ */ new Map();
@@ -29996,6 +30011,22 @@ function parseClaudeEvents(events, parentToolUseId) {
29996
30011
  partialIndexes.set(payload.streamId, existing);
29997
30012
  return;
29998
30013
  }
30014
+ if (event.type === CLAUDE_PEER_MESSAGE_EVENT_TYPE) {
30015
+ const { name, from, body } = event.payload;
30016
+ if (typeof body !== "string") return;
30017
+ if (typeof name === "string" && typeof from === "string") peerNames.set(from, name);
30018
+ const sameTime = peerTimestamps.get(event.timestamp) ?? 0;
30019
+ peerTimestamps.set(event.timestamp, sameTime + 1);
30020
+ messages.push({
30021
+ id: `peer-${event.timestamp}-${sameTime}`,
30022
+ type: "peer_message",
30023
+ direction: "received",
30024
+ ...typeof name === "string" ? { chat: name } : {},
30025
+ content: body,
30026
+ timestamp: event.timestamp
30027
+ });
30028
+ return;
30029
+ }
29999
30030
  if (event.type === "claude-user") {
30000
30031
  const content = normalizeContentBlocks(event.payload.message?.content);
30001
30032
  const toolResult = content.find((c) => c.type === "tool_result");
@@ -30136,6 +30167,20 @@ function parseClaudeEvents(events, parentToolUseId) {
30136
30167
  timestamp: event.timestamp
30137
30168
  });
30138
30169
  }
30170
+ } else if (toolName === "SendMessage") {
30171
+ const parsed = typeof toolInput === "string" ? safeJsonParse(toolInput, {}) : toolInput;
30172
+ const input = isRecord(parsed) ? parsed : {};
30173
+ const to = typeof input.to === "string" ? input.to.replace(/\s+\[[0-9a-f]+\]$/, "") : "";
30174
+ const chat2 = peerNames.get(to) ?? (to.startsWith("uds:") ? void 0 : to || void 0);
30175
+ messages.push({
30176
+ id: `peer-${toolUseId}`,
30177
+ type: "peer_message",
30178
+ direction: "sent",
30179
+ ...chat2 ? { chat: chat2 } : {},
30180
+ content: typeof input.message === "string" ? input.message : "",
30181
+ status: "in_progress",
30182
+ timestamp: event.timestamp
30183
+ });
30139
30184
  } else if (toolName === "WebSearch") {
30140
30185
  const inputObj = typeof toolInput === "string" ? safeJsonParse(toolInput, {}) : toolInput;
30141
30186
  const query = inputObj.query || "";
@@ -30306,6 +30351,9 @@ function parseClaudeEvents(events, parentToolUseId) {
30306
30351
  message2.status = status;
30307
30352
  } else if (message2.type === "web_search") {
30308
30353
  message2.status = status;
30354
+ } else if (message2.type === "peer_message") {
30355
+ const result2 = safeJsonParse(resultContent, {});
30356
+ message2.status = isError || isRecord(result2) && result2.success === false ? "failed" : "completed";
30309
30357
  } else if (message2.type === "tool_call") {
30310
30358
  message2.output = resultContent;
30311
30359
  message2.outputOmitted = outputOmitted;
@@ -31239,7 +31287,7 @@ var CLI_VERSION;
31239
31287
  var init_cli_version = __esm({
31240
31288
  "../shared/src/cli-version.ts"() {
31241
31289
  "use strict";
31242
- CLI_VERSION = "0.3.199";
31290
+ CLI_VERSION = "0.3.200";
31243
31291
  }
31244
31292
  });
31245
31293
 
@@ -32009,7 +32057,7 @@ var init_user = __esm({
32009
32057
  });
32010
32058
 
32011
32059
  // ../shared/src/routes/client-state.ts
32012
- var MAX_CLIENT_STATE_REQUEST_BYTES, MAX_CLIENT_STATE_BYTES_PER_USER, WORKSPACE_LAST_VIEWED_AT_CLIENT_STATE_KEY_PREFIX, WORKSPACE_ATTENTION_DONE_CLIENT_STATE_KEY_PREFIX, WORKSPACE_SECTION_ORDER_CLIENT_STATE_KEY_PREFIX, WORKSPACE_STAGES_CLIENT_STATE_KEY_PREFIX, WORKSPACE_MARKED_UNREAD_CLIENT_STATE_KEY_PREFIX, PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX, orgUserClientStateKey, workspaceLastViewedAtClientStateKey, workspaceAttentionDoneClientStateKey, workspaceStagesClientStateKey, workspaceSectionOrderClientStateKey, workspaceMarkedUnreadClientStateKey, promptHistoryClientStateKey;
32060
+ var MAX_CLIENT_STATE_REQUEST_BYTES, MAX_CLIENT_STATE_BYTES_PER_USER, WORKSPACE_LAST_VIEWED_AT_CLIENT_STATE_KEY_PREFIX, WORKSPACE_ATTENTION_DONE_CLIENT_STATE_KEY_PREFIX, WORKSPACE_SECTION_ORDER_CLIENT_STATE_KEY_PREFIX, WORKSPACE_STAGES_CLIENT_STATE_KEY_PREFIX, WORKSPACE_MARKED_UNREAD_CLIENT_STATE_KEY_PREFIX, PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX, WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX, orgUserClientStateKey, workspaceLastViewedAtClientStateKey, workspaceAttentionDoneClientStateKey, workspaceStagesClientStateKey, workspaceSectionOrderClientStateKey, workspaceMarkedUnreadClientStateKey, promptHistoryClientStateKey, workspaceSearchOpensClientStateKey;
32013
32061
  var init_client_state = __esm({
32014
32062
  "../shared/src/routes/client-state.ts"() {
32015
32063
  "use strict";
@@ -32021,6 +32069,7 @@ var init_client_state = __esm({
32021
32069
  WORKSPACE_STAGES_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-stages-";
32022
32070
  WORKSPACE_MARKED_UNREAD_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-marked-unread-";
32023
32071
  PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX = "replicas-prompt-history-";
32072
+ WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-search-opens-";
32024
32073
  orgUserClientStateKey = (prefix) => (organizationId, userId) => `${prefix}${organizationId}-${userId}`;
32025
32074
  workspaceLastViewedAtClientStateKey = orgUserClientStateKey(WORKSPACE_LAST_VIEWED_AT_CLIENT_STATE_KEY_PREFIX);
32026
32075
  workspaceAttentionDoneClientStateKey = orgUserClientStateKey(WORKSPACE_ATTENTION_DONE_CLIENT_STATE_KEY_PREFIX);
@@ -32028,6 +32077,7 @@ var init_client_state = __esm({
32028
32077
  workspaceSectionOrderClientStateKey = orgUserClientStateKey(WORKSPACE_SECTION_ORDER_CLIENT_STATE_KEY_PREFIX);
32029
32078
  workspaceMarkedUnreadClientStateKey = orgUserClientStateKey(WORKSPACE_MARKED_UNREAD_CLIENT_STATE_KEY_PREFIX);
32030
32079
  promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX);
32080
+ workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
32031
32081
  }
32032
32082
  });
32033
32083
 
@@ -32741,6 +32791,7 @@ var init_src = __esm({
32741
32791
  init_result();
32742
32792
  init_access();
32743
32793
  init_saved_order();
32794
+ init_palette_search();
32744
32795
  init_agent();
32745
32796
  init_agent_availability();
32746
32797
  init_agent_quota();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.199",
3
+ "version": "0.3.200",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {