replicas-cli 0.2.624 → 0.2.625

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 +7 -4
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -22907,7 +22907,8 @@ function upsertDisplayMessage(messages, message) {
22907
22907
  }
22908
22908
  function applyToolInputEvent(event, messages, provider, state, questionFilter) {
22909
22909
  if (event.type === "replicas-tool-input-request" && typeof event.payload.toolUseId === "string" && typeof event.payload.requestId === "string" && (Array.isArray(event.payload.options) || Array.isArray(event.payload.questions))) {
22910
- const resolved = state.resolutions.get(event.payload.toolUseId);
22910
+ const previous = state.resolutions.get(event.payload.toolUseId);
22911
+ const resolved = previous && (!previous.requestId || previous.requestId === event.payload.requestId) ? previous : void 0;
22911
22912
  const inputRequest = {
22912
22913
  requestId: event.payload.requestId,
22913
22914
  status: resolved?.selectionId === "aborted" || resolved?.selectionId === "declined" ? "aborted" : resolved ? "resolved" : "pending",
@@ -22923,12 +22924,13 @@ function applyToolInputEvent(event, messages, provider, state, questionFilter) {
22923
22924
  }
22924
22925
  if (event.type === "replicas-tool-input-resolved" && typeof event.payload.toolUseId === "string" && typeof event.payload.selectionId === "string") {
22925
22926
  const resolved = {
22927
+ ...typeof event.payload.requestId === "string" ? { requestId: event.payload.requestId } : {},
22926
22928
  selectionId: event.payload.selectionId,
22927
22929
  ...typeof event.payload.selectionSummary === "string" ? { selectionSummary: event.payload.selectionSummary } : {}
22928
22930
  };
22929
22931
  state.resolutions.set(event.payload.toolUseId, resolved);
22930
22932
  const inputRequest = state.requests.get(event.payload.toolUseId);
22931
- if (inputRequest) {
22933
+ if (inputRequest && (!resolved.requestId || resolved.requestId === inputRequest.requestId)) {
22932
22934
  inputRequest.status = resolved.selectionId === "aborted" || resolved.selectionId === "declined" ? "aborted" : "resolved";
22933
22935
  inputRequest.selectionId = resolved.selectionId;
22934
22936
  if (resolved.selectionSummary) inputRequest.selectionSummary = resolved.selectionSummary;
@@ -22977,6 +22979,7 @@ function skillNameFromToolCall(tool, input) {
22977
22979
  return parseSkillFilePath(input);
22978
22980
  }
22979
22981
  function createCallDisplayMessage(message) {
22982
+ if (message.inputRequest) return { ...message, type: "tool_call" };
22980
22983
  const skillName = message.server.toLowerCase() === "skills" ? message.tool : skillNameFromToolCall(message.tool, message.input);
22981
22984
  if (skillName === null) return { ...message, type: "tool_call" };
22982
22985
  return {
@@ -25785,12 +25788,12 @@ function parseMuseEvents(events) {
25785
25788
  id: `muse-tool-${item.itemId}`,
25786
25789
  server: "muse",
25787
25790
  tool: typeof item.tool === "string" ? item.tool : "tool",
25791
+ inputRequest: inputState.requests.get(item.itemId),
25788
25792
  input: isRecord(input) ? input : typeof input === "string" ? input : void 0,
25789
25793
  output: typeof item.visibleOutput === "string" ? item.visibleOutput : item.failureReason === void 0 ? void 0 : stringifyDisplayValue(item.failureReason),
25790
25794
  status: item.status === "failed" || item.status === "rejected" ? "failed" : terminal ? "completed" : "in_progress",
25791
25795
  timestamp: typeof item.recordedAt === "string" ? item.recordedAt : event.timestamp
25792
25796
  });
25793
- if (message.type === "tool_call") message.inputRequest = inputState.requests.get(item.itemId);
25794
25797
  upsertDisplayMessage(messages, message);
25795
25798
  }
25796
25799
  }
@@ -27225,7 +27228,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
27225
27228
  });
27226
27229
 
27227
27230
  // ../shared/src/cli-version.ts
27228
- var CLI_VERSION = "0.2.624";
27231
+ var CLI_VERSION = "0.2.625";
27229
27232
 
27230
27233
  // ../shared/src/version.ts
27231
27234
  function compareVersions(v1, v2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.624",
3
+ "version": "0.2.625",
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": {