replicas-cli 0.3.608 → 0.3.611

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 +25 -9
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -21878,11 +21878,10 @@ var init_palette_search = __esm({
21878
21878
  }
21879
21879
  });
21880
21880
 
21881
- // ../shared/src/message-search.ts
21882
- var init_message_search = __esm({
21883
- "../shared/src/message-search.ts"() {
21881
+ // ../shared/src/chat-find.ts
21882
+ var init_chat_find = __esm({
21883
+ "../shared/src/chat-find.ts"() {
21884
21884
  "use strict";
21885
- init_palette_search();
21886
21885
  }
21887
21886
  });
21888
21887
 
@@ -40761,7 +40760,7 @@ var CLI_VERSION;
40761
40760
  var init_cli_version = __esm({
40762
40761
  "../shared/src/cli-version.ts"() {
40763
40762
  "use strict";
40764
- CLI_VERSION = "0.3.608";
40763
+ CLI_VERSION = "0.3.611";
40765
40764
  }
40766
40765
  });
40767
40766
 
@@ -51833,7 +51832,7 @@ var init_src = __esm({
51833
51832
  init_access();
51834
51833
  init_saved_order();
51835
51834
  init_palette_search();
51836
- init_message_search();
51835
+ init_chat_find();
51837
51836
  init_workspace_search();
51838
51837
  init_agent();
51839
51838
  init_agent_availability();
@@ -58976,17 +58975,34 @@ async function localControlRequestCommand(options) {
58976
58975
  method: "POST",
58977
58976
  body: { reason: options.reason, wait: options.wait !== false }
58978
58977
  });
58978
+ const connectedSince = await connectedComputers();
58979
+ if (connectedSince.length > 0) return connected(connectedSince);
58980
+ if (created2.granted) {
58981
+ const found = options.wait === false ? [] : await waitForUser({
58982
+ timeoutMs: Math.min(timeoutMs, 6e4),
58983
+ asked: "This workspace may already use the user's computer, so they weren't asked. Waiting for it to connect.",
58984
+ initial: [],
58985
+ settled: (current) => current.length > 0,
58986
+ poll: connectedComputers
58987
+ });
58988
+ if (found.length > 0) return connected(found);
58989
+ output2({ status: "not_connected", computers: [], url: created2.url }, () => {
58990
+ console.log(import_chalk36.default.gray("\n This workspace may use the user's computer, but it isn't connected: the Replicas desktop app isn't open there, or isn't signed in as them. Keep working without it and tell the user. You get a message once it connects; run this command again then.\n"));
58991
+ });
58992
+ return;
58993
+ }
58979
58994
  let pending = true;
58980
58995
  if (created2.wait) {
58981
58996
  const answer = await waitForUser({
58982
58997
  timeoutMs,
58983
- asked: "Asked the user above the chat composer to let you run commands on their computer.",
58998
+ asked: "Asked the user to let you run commands on their computer.",
58984
58999
  initial: { pending: true, computers: [] },
58985
59000
  settled: (current) => !current.pending || current.computers.length > 0,
58986
59001
  poll: async (waiting) => {
58987
59002
  const found = await connectedComputers();
58988
59003
  if (found.length > 0) return { pending: true, computers: found };
58989
- return { ...await orgAuthenticatedFetch(`/v1/local-control-request${waiting ? "" : "?waiting=false"}`), computers: found };
59004
+ const { pending: pending2 } = await orgAuthenticatedFetch(`/v1/local-control-request${waiting ? "" : "?waiting=false"}`);
59005
+ return { pending: pending2, computers: pending2 ? [] : await connectedComputers() };
58990
59006
  }
58991
59007
  });
58992
59008
  if (answer.computers.length > 0) return connected(answer.computers);
@@ -59000,7 +59016,7 @@ async function localControlRequestCommand(options) {
59000
59016
  console.log(import_chalk36.default.gray(options.wait === false ? `
59001
59017
  Asked above the chat composer (${created2.url}). Keep working, and run this command again when you need the computer.
59002
59018
  ` : created2.wait ? `
59003
- The request stays open above the chat composer (${created2.url}). End your turn and say what you need the computer for. When the user answers, you get a message; run this command again then.
59019
+ The user hasn't answered yet, so stop waiting. The request stays open (${created2.url}). End your turn and say what you need the computer for. When the user answers, you get a message; run this command again then.
59004
59020
  ` : `
59005
59021
  The user may not be watching Replicas. Send them this link where you are talking with them (the Slack thread, Linear issue, or pull request) and ask them to allow local control there: ${created2.url}
59006
59022
  When they answer, you get a message; run this command again then.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.608",
3
+ "version": "0.3.611",
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": {