@lardexx/arenacode 2.5.2 → 2.5.4

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/README.md CHANGED
@@ -16,16 +16,20 @@ you ──▶ arenacode CLI ──▶ arena-bridge ──▶ agent
16
16
  ## Install
17
17
 
18
18
  ```bash
19
- npm install -g arenacode
20
- arenacode --version # 2.5.2
19
+ npm install -g @lardexx/arenacode
20
+ arenacode --version # 2.5.2 (the bridge protocol version this client speaks)
21
21
  ```
22
22
 
23
23
  Or without installing:
24
24
 
25
25
  ```bash
26
- npx arenacode ask "list the files in my folder"
26
+ npx @lardexx/arenacode ask "list the files in my folder"
27
27
  ```
28
28
 
29
+ Published as [`@lardexx/arenacode`](https://www.npmjs.com/package/@lardexx/arenacode) — the bare name `arenacode`
30
+ is blocked by npm's similarity check against the existing `arena-code` package, so the scope is required. The
31
+ command is plain `arenacode` in every case.
32
+
29
33
  Requires Node.js 18 or newer. No runtime dependencies.
30
34
 
31
35
  ## Terminal UI
@@ -275,8 +279,14 @@ SCENARIO=approve node test/tui.js # TUI, terminal card confirmation
275
279
  SCENARIO=plan node test/tui.js # TUI, plan approval
276
280
  node test/tui.js # TUI: drives the real pty, checks the rendered frames
277
281
  node tools/frame2html.js /tmp/tui-frames.raw docs/tui-preview.html --match done # frame -> HTML snapshot
282
+ python3 tools/ansi2png.py /tmp/tui-frames.raw docs/tui-session.png --match done # frame -> PNG snapshot
283
+ BIN=arenacode tools/e2e-installed.sh # the *installed* package against a real bridge
278
284
  ```
279
285
 
286
+ `tools/e2e-installed.sh` runs whatever `arenacode` is on `PATH` (or `BIN=…`) against a fresh bridge and a fake
287
+ agent, types a request into the TUI through a pty, and prints the agent's report plus the final screen — the check
288
+ that the published tarball, not just the working tree, drives the bridge.
289
+
280
290
  The integration test spins up `bridge_server.py` from a private copy, runs a fake agent that claims the task,
281
291
  then checks that the CLI answered the `local-fs` / `local-exec` cards with the right payloads, applied the file
282
292
  write, rendered the timeline and bound the API key to the device.
@@ -1,65 +1,54 @@
1
1
  # Publishing
2
2
 
3
- The package is ready: `arenacode@2.5.2`, 23 files, ~60 kB tarball, no runtime dependencies.
3
+ **Live:** [`@lardexx/arenacode@2.5.3`](https://www.npmjs.com/package/@lardexx/arenacode) — 34 files, 226 kB tarball,
4
+ no runtime dependencies. The command stays `arenacode`.
4
5
 
5
6
  ```bash
6
- cd arenacode-cli
7
- npm publish --dry-run # + arenacode@2.5.2
7
+ npm install -g @lardexx/arenacode # then: arenacode
8
+ npx @lardexx/arenacode # or one-shot
8
9
  ```
9
10
 
10
- ## Status of the publish attempt
11
+ ## Why the scoped name
11
12
 
12
- | Attempt | Result |
13
- |---|---|
14
- | `npm whoami` with the supplied token | ✅ authenticated as `lardexx` |
15
- | `npm view arenacode version` | ✅ 404 → the name `arenacode` is free |
16
- | `npm publish` (unscoped `arenacode`) | ❌ `403 Forbidden — You may not perform that action with these credentials.` |
17
- | `npm publish` (`@lardexx/arenacode`, public) | ❌ same 403 |
13
+ The bare name is taken twice over:
18
14
 
19
- A 403 on PUT with a token that authenticates fine means the token itself is not allowed to write. Three usual
20
- causes, in order of likelihood:
15
+ 1. `arenacode-cli` already exists (an unrelated package).
16
+ 2. `npm publish arenacode` is rejected even though the name is unclaimed:
17
+ `403 Package name too similar to existing package arena-code` — npm's similarity filter, not a permission problem.
21
18
 
22
- 1. **The token is read-only.** Granular tokens have a *Permissions → Read and write* switch; the default in some
23
- flows is read-only. Create a new one with **Read and write** and package access **All packages**.
24
- 2. **The token is restricted to existing packages.** A granular token limited to a selection of packages cannot
25
- create a *new* package name: pick “All packages”.
26
- 3. **The account requires 2FA for publishing.** Then `npm publish --otp=<code>` (or an interactive
27
- `npm login` + `npm publish`) is needed; automation tokens must be created with the *bypass 2FA* option.
19
+ npm itself suggests the escape hatch in that error: publish under a scope. Hence `@lardexx/arenacode`.
28
20
 
29
- ## Commands
21
+ ## The run that worked
30
22
 
31
- ```bash
32
- # A. with a fresh token that can write
33
- npm login # or: npm config set //registry.npmjs.org/:_authToken=<token>
34
- npm publish # unscoped: arenacode
23
+ | Attempt | Result |
24
+ |---|---|
25
+ | `npm whoami` with the first token | ✅ `lardexx` |
26
+ | `npm publish` (unscoped `arenacode`) | ❌ `E403 … You may not perform that action with these credentials` (read-only token) |
27
+ | `npm publish` with the second token | ❌ `EOTP … requires a one-time password` (write token, 2FA enforced) |
28
+ | `npm publish` with the third token (2FA bypass) | ❌ `403 … Package name too similar to existing package arena-code` |
29
+ | `npm publish --access public` as `@lardexx/arenacode` | ⚠️ `202 Accepted` → a `0.0.0-stage` **placeholder** appeared (`"stub": true`), the real version was staged |
30
+ | re-publish the same version | ❌ `409 Cannot publish over previously staged version "2.5.2"` |
31
+ | `npm stage list` / `stage approve` | ❌ "No staged versions" / `stage-id must be a valid UUID` — nothing to approve from the CLI |
32
+ | **bump to 2.5.3 and publish** | ✅ `+ @lardexx/arenacode@2.5.3`, `dist-tags.latest = 2.5.3` after ~2 min of async processing |
35
33
 
36
- # B. with the tarball
37
- npm publish arenacode-2.5.2.tgz
34
+ Two lessons for next time:
38
35
 
39
- # C. under your scope (always available to your account)
40
- node -e "const p=require('./package.json');p.name='@lardexx/arenacode';p.publishConfig={access:'public'};require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"
41
- npm publish --access public
42
- ```
36
+ * a new scoped package may land asynchronously — the registry answers `202 Accepted`, shows a `0.0.0-stage` stub and
37
+ needs a couple of minutes before `https://registry.npmjs.org/<pkg>` returns 200. Poll it before assuming failure;
38
+ * a version that was ever staged cannot be republished, so bump the version instead of retrying it.
43
39
 
44
- The `bin` stays `arenacode` in all three cases, so the installed command is the same:
40
+ ## Publishing a new version
45
41
 
46
42
  ```bash
47
- npx arenacode # or npx @lardexx/arenacode
43
+ cd arenacode-cli
44
+ npm version patch --no-git-tag-version # 2.5.3 → 2.5.4
45
+ npm test && node test/tui.js # CLI + TUI suites
46
+ npm pack # inspect the tarball first
47
+ npm publish --access public # needs a Read+write, All-packages, 2FA-bypass token
48
48
  ```
49
49
 
50
- ## Checklist before publishing
51
-
52
- - [x] `npm pack --dry-run` clean, no stray files (`test/`, `tools/` are excluded by the `files` field)
53
- - [x] `npm test` green (bridge + fake agent + CLI)
54
- - [x] `node test/tui.js` green (real pty, rendered frames)
55
- - [x] `LICENSE` (MIT), `README.md`, `docs/`
56
- - [ ] version policy: `2.5.2` tracks the ArenaCode client it ports; use `2.5.3`/`2.6.0` afterwards, and keep the
57
- client number in `src/config.js` (`VERSION`) in sync
50
+ `publishConfig.access = public` is already in `package.json`, and `files` ships only `bin/`, `src/`, `docs/`,
51
+ `README.md`, `LICENSE` — 34 files, ~226 kB.
58
52
 
59
- ## After publishing
60
-
61
- ```bash
62
- npm view arenacode version dist.tarball
63
- npm install -g arenacode
64
- arenacode doctor
65
- ```
53
+ The `VERSION` shown by the CLI is the **bridge protocol version** (2.5.2) and is deliberately separate from the
54
+ package version: the client keeps speaking the same protocol as `arena-bridge` 2.5.2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lardexx/arenacode",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "Terminal client for ArenaCode: talks to an arena-bridge, streams the Agent Mode timeline, and runs local commands and file operations on your PC. Node port of the ArenaCode desktop client.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/src/cli.js CHANGED
@@ -15,6 +15,21 @@ const { c, write, ask, banner, truncate, indentLines } = require('./ui');
15
15
 
16
16
  const AGENT_PROMPT_FILE = path.join(__dirname, 'prompts', 'agent-prompt.md');
17
17
 
18
+ /**
19
+ * How this process was started, so the hints it prints are commands the user can actually paste.
20
+ * `npx @lardexx/arenacode …` never puts `arenacode` on PATH, and on Windows that reads as
21
+ * "not recognized as an internal or external command".
22
+ */
23
+ const SELF = (() => {
24
+ const agent = process.env.npm_config_user_agent || '';
25
+ const viaNpx = /\bnpm\/.*\bexec\b|\bnpx\b/.test(agent) || process.env.npm_lifecycle_event === 'npx';
26
+ if (!viaNpx) return 'arenacode';
27
+ return process.platform === 'win32' ? 'npx @lardexx/arenacode' : 'npx @lardexx/arenacode';
28
+ })();
29
+ const INSTALL_HINT = process.platform === 'win32'
30
+ ? 'npm install -g @lardexx/arenacode (then reopen the terminal)'
31
+ : 'npm install -g @lardexx/arenacode';
32
+
18
33
  const MODE_LINES = {
19
34
  agent:
20
35
  '[ArenaCode mode: agent]\n' +
@@ -103,7 +118,8 @@ function requireUrl(ctx) {
103
118
  if (ctx.url) return true;
104
119
  write('');
105
120
  write(c.red(' no bridge URL configured.'));
106
- write(` ${c.gray('run:')} arenacode init ${c.gray('or')} arenacode config set url https://your-bridge.tunnl.gg`);
121
+ write(` ${c.gray('run:')} ${SELF} init ${c.gray('or')} ${SELF} config set url https://your-bridge.tunnl.gg`);
122
+ if (SELF !== 'arenacode') write(` ${c.gray('to get the bare command:')} ${INSTALL_HINT}`);
107
123
  return false;
108
124
  }
109
125
 
@@ -113,7 +129,7 @@ async function ensureAuth(ctx) {
113
129
  const reason = (res.json && (res.json.error || res.json.hint)) || `HTTP ${res.status}`;
114
130
  write(c.red(` auth failed: ${reason}`));
115
131
  if (res.status === 403) write(c.gray(' this API key is bound to another PC: on the bridge run keys unbind <ID>'));
116
- if (res.status === 401) write(c.gray(' check the API key: arenacode config set key <API key>'));
132
+ if (res.status === 401) write(c.gray(` check the API key: ${SELF} config set key <API key>`));
117
133
  return false;
118
134
  }
119
135
 
@@ -166,7 +182,7 @@ function cmdConfig(positional, flags) {
166
182
  const name = key;
167
183
  const val = rest.join(' ');
168
184
  if (!name || val === '') {
169
- write('usage: arenacode config set <url|key|folder|lang|mode|pc_access> <value>');
185
+ write(`usage: ${SELF} config set <url|key|folder|lang|mode|pc_access> <value>`);
170
186
  return 2;
171
187
  }
172
188
  const patch = {};
@@ -186,7 +202,7 @@ function cmdConfig(positional, flags) {
186
202
  write(` ${c.green('✓')} config removed`);
187
203
  return 0;
188
204
  }
189
- write('usage: arenacode config [show|path|set <key> <value>|clear]');
205
+ write(`usage: ${SELF} config [show|path|set <key> <value>|clear]`);
190
206
  return 2;
191
207
  }
192
208
 
@@ -621,6 +637,10 @@ async function cmdHandshake(flags) {
621
637
  function help() {
622
638
  banner(VERSION);
623
639
  write(` ${c.bold('usage')} arenacode <command> [options]`);
640
+ if (SELF !== 'arenacode') {
641
+ write(` ${c.gray('you are running it through npx — every command can be prefixed the same way,')}`);
642
+ write(` ${c.gray(`or install it once: ${INSTALL_HINT}`)}`);
643
+ }
624
644
  write('');
625
645
  write(` ${c.cyan('setup')}`);
626
646
  write(` init configure URL + API key, test the connection`);