@standardagents/code 0.11.2 → 0.11.3

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.
package/dist/index.js CHANGED
@@ -7023,7 +7023,7 @@ async function pickDirectory(tui, backend, opts = {}) {
7023
7023
  return null;
7024
7024
  }
7025
7025
  spin?.stop();
7026
- const title = () => `${c2.bold}${gradientText(`Browse ${backend.label}`)}${c2.reset} ${c2.teal}${tail(listing.path, 48)}${c2.reset}` + (showHidden ? ` ${c2.dim}\xB7 hidden shown${c2.reset}` : "");
7026
+ const title = () => `${c2.bold}Browse ${backend.label}${c2.reset} ${c2.teal}${tail(listing.path, 48)}${c2.reset}` + (showHidden ? ` ${c2.dim}\xB7 hidden shown${c2.reset}` : "");
7027
7027
  const footer = (error) => error ? `${c2.yellow}${error}${c2.reset} ${c2.dim}${KEY_HINTS}${c2.reset}` : `${c2.dim}${KEY_HINTS}${c2.reset}`;
7028
7028
  const buildItems = () => {
7029
7029
  const pageSize = Math.max(5, Math.min(14, (process.stdout.rows || 24) - 9));
@@ -8625,7 +8625,7 @@ ${c4.dim}Press Control-C again to exit${c4.reset}
8625
8625
  if (result.hint) stdout.write(` ${c4.dim}${result.hint}${c4.reset}
8626
8626
  `);
8627
8627
  };
8628
- stdout.write(`${c4.bold}${gradientText("Sign in to Standard Code")}${c4.reset}
8628
+ stdout.write(`${c4.bold}Sign in to ${gradientText("Standard Code")}${c4.reset}
8629
8629
  `);
8630
8630
  if (`https://${host}` !== PRODUCTION_ENDPOINT) {
8631
8631
  stdout.write(`${c4.dim}Connecting to${c4.reset} ${c4.teal}${host}${c4.reset}
@@ -8737,7 +8737,7 @@ ${c4.dim}Press Control-C again to exit${c4.reset}
8737
8737
  flow: for (; ; ) {
8738
8738
  if (step === "machine") {
8739
8739
  const picked = await tui.select(
8740
- `${c4.bold}${gradientText("Where should this session run?")}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8740
+ `${c4.bold}Where should this session run?${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8741
8741
  [
8742
8742
  {
8743
8743
  label: `This machine \u2014 ${self ? machineDisplayName(self) : machine}`,
@@ -8821,7 +8821,7 @@ ${c4.dim}Press Control-C again to exit${c4.reset}
8821
8821
  items.push({ label: "\uFF0B Start a new session", value: null });
8822
8822
  const whereLabel = session.mode === "remote" && session.runner ? `${session.runner.name}:${shortenPath(session.remotePath ?? "")}` : shortDir;
8823
8823
  const picked = await tui.select(
8824
- `${c4.bold}${gradientText("Resume a session")}${c4.reset} ${c4.gray}${whereLabel}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8824
+ `${c4.bold}Resume a session${c4.reset} ${c4.gray}${whereLabel}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8825
8825
  items
8826
8826
  );
8827
8827
  if (picked === void 0) {
@@ -8847,7 +8847,7 @@ ${c4.dim}Press Control-C again to exit${c4.reset}
8847
8847
  } else {
8848
8848
  if (!agentOverride) {
8849
8849
  const picked = await tui.select(
8850
- `${c4.bold}${gradientText("Which agent?")}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8850
+ `${c4.bold}Which agent?${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8851
8851
  AGENT_CHOICES.map((choice) => ({
8852
8852
  label: choice.title,
8853
8853
  hint: choice.description,
@@ -8897,7 +8897,7 @@ async function ensureSamaAuth(tui, api) {
8897
8897
  checking.stop();
8898
8898
  if (already) return true;
8899
8899
  const picked = await tui.select(
8900
- `${c4.bold}${gradientText("Authenticate with ChatGPT")}${c4.reset} ${c4.dim}Sama One runs on OpenAI using your own ChatGPT Pro account${c4.reset}`,
8900
+ `${c4.bold}Authenticate with ChatGPT${c4.reset} ${c4.dim}Sama One runs on OpenAI using your own ChatGPT Pro account${c4.reset}`,
8901
8901
  [
8902
8902
  {
8903
8903
  label: "Continue with ChatGPT",
@@ -8932,7 +8932,7 @@ async function ensureSamaAuth(tui, api) {
8932
8932
  }
8933
8933
  async function runAgentSwitchMenu(tui, api, threadId) {
8934
8934
  const picked = await tui.select(
8935
- `${c4.bold}${gradientText("Switch agent")}${c4.reset} ${c4.dim}takes effect on the next message${c4.reset}`,
8935
+ `${c4.bold}Switch agent${c4.reset} ${c4.dim}takes effect on the next message${c4.reset}`,
8936
8936
  AGENT_CHOICES.map((choice) => ({
8937
8937
  label: choice.title,
8938
8938
  hint: choice.description,
@@ -8977,7 +8977,7 @@ async function pickLocalProject(tui, api, self, cwd, machineName) {
8977
8977
  { label: "\uFF0B New project", hint: "browse or create a directory", value: NEW }
8978
8978
  ];
8979
8979
  const picked = await tui.select(
8980
- `${c4.bold}${gradientText(`Project on ${label}`)}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8980
+ `${c4.bold}Project on ${label}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
8981
8981
  items,
8982
8982
  { spaced: true }
8983
8983
  );
@@ -9001,7 +9001,7 @@ async function pickRemoteProject(tui, api, runner) {
9001
9001
  );
9002
9002
  items.push({ label: "\uFF0B New project", hint: "browse or create a directory", value: ENTER_PATH });
9003
9003
  const picked = await tui.select(
9004
- `${c4.bold}${gradientText(`Project on ${runner.name}`)}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
9004
+ `${c4.bold}Project on ${runner.name}${c4.reset} ${c4.dim}\u2191\u2193 \xB7 enter \xB7 esc${c4.reset}`,
9005
9005
  items,
9006
9006
  { spaced: true }
9007
9007
  );
@@ -9080,6 +9080,7 @@ async function runInteractive(tui, api, threadId, projectDir, machine, resumed,
9080
9080
  const runnerName = session.runner?.name ?? "the remote machine";
9081
9081
  let currentOwner = null;
9082
9082
  let ownershipKnown = false;
9083
+ let ownershipWasOurs = false;
9083
9084
  const describeExecOwner = (o) => o?.client_kind === "daemon" ? "the daemon on this machine" : o?.client_name || "another client";
9084
9085
  const registry = new ProcessRegistry(api, threadId, machine);
9085
9086
  const refreshBgCount = () => {
@@ -9168,13 +9169,15 @@ async function runInteractive(tui, api, threadId, projectDir, machine, resumed,
9168
9169
  },
9169
9170
  onOwnership: (isOwner, owner2) => {
9170
9171
  const wasKnown = ownershipKnown;
9172
+ const moved = !wasKnown || ownershipWasOurs !== isOwner || (currentOwner?.client_id ?? null) !== (owner2?.client_id ?? null);
9171
9173
  ownershipKnown = true;
9174
+ ownershipWasOurs = isOwner;
9172
9175
  currentOwner = owner2;
9173
9176
  if (isOwner) {
9174
9177
  bridge?.setClaim("takeover");
9175
9178
  exec?.writeSessionInfo();
9176
- if (wasKnown) tui.print(`${c4.dim}Tool execution moved to this terminal.${c4.reset}`);
9177
- } else if (wasKnown) {
9179
+ if (wasKnown && moved) tui.print(`${c4.dim}Tool execution moved to this terminal.${c4.reset}`);
9180
+ } else if (wasKnown && moved) {
9178
9181
  tui.print(`${c4.dim}Tool execution moved to ${describeExecOwner(owner2)}.${c4.reset}`);
9179
9182
  }
9180
9183
  },
@@ -9577,7 +9580,7 @@ why: ${req.requestPermission}` : ""}`,
9577
9580
  const cost = fmtCost(q);
9578
9581
  const lines = [
9579
9582
  "",
9580
- `${c4.bold}${gradientText("\u2726 Add a parallel session")}${c4.reset}`,
9583
+ `${c4.bold}\u2726 Add a parallel session${c4.reset}`,
9581
9584
  "",
9582
9585
  `${dots.join(" ")} ${c4.dim}${q.current} of ${q.current} session${q.current === 1 ? "" : "s"} in use${c4.reset}`
9583
9586
  ];