@linzumi/cli 0.0.30-beta → 0.0.31-beta

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 (3) hide show
  1. package/README.md +10 -10
  2. package/dist/index.js +18 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -46,8 +46,8 @@ Terms:
46
46
  - **Bootstrapper Codex**: the outer Codex started by the pasted command. It
47
47
  sets up Linzumi and local processes, but does not edit the demo app.
48
48
  - **Linzumi Commander**: the long-running local bridge started with
49
- `linzumi commander`; it owns the secure tunnel, trusted folder, browser
50
- editor, and inner Codex launch.
49
+ `linzumi commander`; it runs as the claimed human's Commander and owns the
50
+ secure tunnel, trusted folder, browser editor, and inner Codex launch.
51
51
  - **Linzumi Codex session**: the inner agent running inside the Linzumi thread;
52
52
  it edits `/tmp/hello_linzumi` and posts progress.
53
53
  - **Human**: the workspace owner who opens the one-time login link and watches
@@ -152,12 +152,12 @@ npx -y @linzumi/cli@latest commander daemon \
152
152
  npx -y @linzumi/cli@latest commander wait --runner-id "$commander_id" --timeout-ms 30000
153
153
  ```
154
154
 
155
- The agent-owned Commander reads `~/.linzumi/agent-token.json`, uses the
156
- workspace/channel scope from the approval flow, reads trusted folders from
157
- `~/.linzumi/config.json`, marks approved project directories trusted in
158
- Codex's normal project config so Codex does not stop for an interactive trust
159
- prompt, advertises the explicit preview port, and listens only to the
160
- approving human unless `--listen-user` is explicitly passed. Use a unique
155
+ The human-owned Commander reads `~/.linzumi/agent-token.json`, uses the
156
+ claimed human Commander token and workspace/channel scope from the approval
157
+ flow, reads trusted folders from `~/.linzumi/config.json`, marks approved
158
+ project directories trusted in Codex's normal project config so Codex does not
159
+ stop for an interactive trust prompt, advertises the explicit preview port, and
160
+ listens only to the approving human unless `--listen-user` is explicitly passed. Use a unique
161
161
  Commander id per launch. `linzumi commander daemon` writes a status record and
162
162
  log under `~/.linzumi/commanders`, and `linzumi commander wait` returns only
163
163
  after the Commander is connected.
@@ -293,7 +293,7 @@ intentionally. Every action is auditable from the thread.
293
293
  ## Pinning a version
294
294
 
295
295
  ```bash
296
- npm install -g @linzumi/cli@0.0.30-beta
296
+ npm install -g @linzumi/cli@0.0.31-beta
297
297
  linzumi --version
298
298
  ```
299
299
 
@@ -316,7 +316,7 @@ linzumi connect \
316
316
  ### All the flags
317
317
 
318
318
  ```text
319
- --agent-token-file <path> Agent token cache for `linzumi commander`
319
+ --agent-token-file <path> Bootstrap token cache for `linzumi commander`
320
320
  --oauth-callback-host <ip> Sign-in callback host your browser can reach
321
321
  --codex-bin <path> Codex executable, default `codex`
322
322
  --model <name> Model requested for Codex sessions and labelled in Linzumi
package/dist/index.js CHANGED
@@ -7759,6 +7759,8 @@ async function runClaim(command, deps) {
7759
7759
  const tokenFile = {
7760
7760
  apiUrl: command.apiUrl,
7761
7761
  agentToken: requiredString(response, "agent_token"),
7762
+ commanderToken: requiredString(response, "commander_token"),
7763
+ commanderTokenExpiresInSeconds: numberValue2(response.commander_token_expires_in_seconds),
7762
7764
  agentId: requiredString(response, "agent_id"),
7763
7765
  workspaceId: requiredString(response, "workspace_id"),
7764
7766
  workspaceName: stringValue(response.workspace_name),
@@ -7772,7 +7774,7 @@ async function runClaim(command, deps) {
7772
7774
  cursors: {}
7773
7775
  };
7774
7776
  writeTokenFile(command.tokenFile, tokenFile, deps.writeTextFile);
7775
- deps.stdout.write(`Logged in as agent ${tokenFile.agentId}
7777
+ deps.stdout.write(`Logged in as ${tokenFile.ownerUsername ?? "claimed user"}
7776
7778
  `);
7777
7779
  if (tokenFile.workspaceName !== undefined) {
7778
7780
  deps.stdout.write(`workspace_name: ${tokenFile.workspaceName}
@@ -8014,6 +8016,8 @@ function readStoredAgentTokenFile(path, readTextFile = readOptionalTextFile) {
8014
8016
  return {
8015
8017
  apiUrl: requiredString(parsed, "apiUrl"),
8016
8018
  agentToken: requiredString(parsed, "agentToken"),
8019
+ commanderToken: requiredString(parsed, "commanderToken"),
8020
+ commanderTokenExpiresInSeconds: numberValue2(parsed.commanderTokenExpiresInSeconds),
8017
8021
  agentId: requiredString(parsed, "agentId"),
8018
8022
  workspaceId: requiredString(parsed, "workspaceId"),
8019
8023
  workspaceName: stringValue(parsed.workspaceName),
@@ -8912,7 +8916,7 @@ async function main(args) {
8912
8916
  process.stdout.write(connectGuideText());
8913
8917
  return;
8914
8918
  case "version":
8915
- process.stdout.write(`linzumi 0.0.30-beta
8919
+ process.stdout.write(`linzumi 0.0.31-beta
8916
8920
  `);
8917
8921
  return;
8918
8922
  case "auth":
@@ -9308,7 +9312,7 @@ async function parseAgentRunnerArgs(args, deps = {
9308
9312
  assertStartDependencies(initialDependencyStatus);
9309
9313
  const editorRuntime = await deps.resolveEditorRuntime({
9310
9314
  kandanUrl,
9311
- token: tokenFile.agentToken,
9315
+ token: tokenFile.commanderToken,
9312
9316
  customCodeServerBin,
9313
9317
  fetchImpl: trustedFetch(kandanTlsTrustFromEnv())
9314
9318
  });
@@ -9321,7 +9325,7 @@ async function parseAgentRunnerArgs(args, deps = {
9321
9325
  assertStartDependencies(dependencyStatus);
9322
9326
  return {
9323
9327
  kandanUrl,
9324
- token: tokenFile.agentToken,
9328
+ token: tokenFile.commanderToken,
9325
9329
  runnerId: stringValue3(values, "runner-id") ?? `agent-runner-${randomUUID3()}`,
9326
9330
  cwd,
9327
9331
  codexBin,
@@ -9352,9 +9356,15 @@ function readAgentTokenTextFile(path) {
9352
9356
  return existsSync10(path) ? readFileSync9(path, "utf8") : undefined;
9353
9357
  }
9354
9358
  function rejectAgentRunnerTargetingFlags(values) {
9355
- const unsupportedFlags = ["workspace", "channel", "token", "auth-file", "oauth-callback-host"].filter((flag) => values.has(flag));
9359
+ const unsupportedFlags = [
9360
+ "workspace",
9361
+ "channel",
9362
+ "token",
9363
+ "auth-file",
9364
+ "oauth-callback-host"
9365
+ ].filter((flag) => values.has(flag));
9356
9366
  if (unsupportedFlags.length > 0) {
9357
- throw new Error(`linzumi commander uses the claimed agent token scope; remove ${unsupportedFlags.map((flag) => `--${flag}`).join(", ")}.`);
9367
+ throw new Error(`linzumi commander uses the claimed human Commander token scope; remove ${unsupportedFlags.map((flag) => `--${flag}`).join(", ")}.`);
9358
9368
  }
9359
9369
  }
9360
9370
  function requiredStoredAgentChannel(channelId) {
@@ -9419,7 +9429,7 @@ async function parseRunnerArgs(args, deps = {
9419
9429
  process.exit(0);
9420
9430
  }
9421
9431
  if (values.get("version") === true) {
9422
- process.stdout.write(`linzumi 0.0.30-beta
9432
+ process.stdout.write(`linzumi 0.0.31-beta
9423
9433
  `);
9424
9434
  process.exit(0);
9425
9435
  }
@@ -9846,7 +9856,7 @@ Usage:
9846
9856
  linzumi agent runner <folder> [options]
9847
9857
 
9848
9858
  What it does:
9849
- Starts this computer as the claimed agent's scoped Linzumi Commander. The command
9859
+ Starts this computer as the claimed human's scoped Linzumi Commander. The command
9850
9860
  reads ~/.linzumi/agent-token.json, uses its workspace/channel scope, reads
9851
9861
  trusted folders from ~/.linzumi/config.json when no folder is passed, and
9852
9862
  listens only to the owning human recorded during claim unless --listen-user is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linzumi/cli",
3
- "version": "0.0.30-beta",
3
+ "version": "0.0.31-beta",
4
4
  "description": "Linzumi CLI — point a Codex agent at the real code on your laptop, with your team watching and steering from shared threads.",
5
5
  "type": "module",
6
6
  "bin": {