replicas-cli 0.3.609 → 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 +21 -4
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -40760,7 +40760,7 @@ var CLI_VERSION;
40760
40760
  var init_cli_version = __esm({
40761
40761
  "../shared/src/cli-version.ts"() {
40762
40762
  "use strict";
40763
- CLI_VERSION = "0.3.609";
40763
+ CLI_VERSION = "0.3.611";
40764
40764
  }
40765
40765
  });
40766
40766
 
@@ -58975,17 +58975,34 @@ async function localControlRequestCommand(options) {
58975
58975
  method: "POST",
58976
58976
  body: { reason: options.reason, wait: options.wait !== false }
58977
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
+ }
58978
58994
  let pending = true;
58979
58995
  if (created2.wait) {
58980
58996
  const answer = await waitForUser({
58981
58997
  timeoutMs,
58982
- 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.",
58983
58999
  initial: { pending: true, computers: [] },
58984
59000
  settled: (current) => !current.pending || current.computers.length > 0,
58985
59001
  poll: async (waiting) => {
58986
59002
  const found = await connectedComputers();
58987
59003
  if (found.length > 0) return { pending: true, computers: found };
58988
- 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() };
58989
59006
  }
58990
59007
  });
58991
59008
  if (answer.computers.length > 0) return connected(answer.computers);
@@ -58999,7 +59016,7 @@ async function localControlRequestCommand(options) {
58999
59016
  console.log(import_chalk36.default.gray(options.wait === false ? `
59000
59017
  Asked above the chat composer (${created2.url}). Keep working, and run this command again when you need the computer.
59001
59018
  ` : created2.wait ? `
59002
- 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.
59003
59020
  ` : `
59004
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}
59005
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.609",
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": {