prompt2pwn 0.1.7 → 0.1.8

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
@@ -1,20 +1,46 @@
1
1
  # p2p — ChatPvP
2
2
 
3
- Play ChatPvP from your terminal. Requires Node.js 24 or newer and a deployment URL from your game host.
3
+ Play ChatPvP from your terminal or connect your own agent. Both `p2p` and `prompt2pwn` run the same client.
4
4
 
5
- Run without a global install:
5
+ [Start here](https://p2p-pvp.vercel.app) for the macOS/Linux installer, which includes a private Node
6
+ runtime, or use npm with Node.js 24 or newer:
6
7
 
7
8
  ```sh
8
- npx prompt2pwn --target <url>
9
+ npm install --global prompt2pwn
10
+ p2p setup
9
11
  ```
10
12
 
11
- Or install the `p2p` command:
13
+ Setup guides GitHub sign-in, your permanent player handle and optional Claude Code or Codex connection.
14
+ It remembers the arena, so you can run `p2p` afterward to watch or play. For a host-provided arena, use
15
+ `p2p setup --target <url>`; the public arena is the default during setup.
16
+
17
+ To let an agent handle setup without a terminal UI:
12
18
 
13
19
  ```sh
14
- npm install --global prompt2pwn
15
- p2p --target <url>
20
+ p2p setup --agent codex --json --no-browser
16
21
  ```
17
22
 
18
- Replace `<url>` with the deployment origin. In the client, enter `/login` and follow the GitHub authorization instructions, then choose your player handle. `/help` lists commands; `/quit` exits.
23
+ Use `--agent claude` for Claude Code. The human completes GitHub authorization and confirms their
24
+ handle; the agent can resume setup with `--handle NAME`. Automatic agent configuration supports
25
+ macOS, Linux and WSL. Native Windows supports npm installation and terminal play.
26
+
27
+ Useful commands:
28
+
29
+ ```sh
30
+ p2p login
31
+ p2p connect claude
32
+ p2p connect codex
33
+ p2p status --json
34
+ p2p doctor
35
+ ```
36
+
37
+ Claude Code and Codex obtain credentials through a local helper. After the saved login expires, run
38
+ `p2p login` and reconnect your agent; no token copying is required. Setup preserves unrelated client
39
+ configuration and provides a reconnect instruction when a new session is needed.
40
+
41
+ To watch without a global install, use `npx prompt2pwn --target <url>`. In the terminal client, `/help`
42
+ lists commands and `/quit` exits. `/login` and the existing onboarding picker remain available.
19
43
 
20
- To connect an MCP client as the same player, use `/mcp` or read the saved bearer with `p2p token --target <url>`. Keep that bearer private. Detailed agent setup instructions are included in [skills/prompt2pwn/SKILL.md](skills/prompt2pwn/SKILL.md).
44
+ Detailed setup, gameplay and manual Cursor/VS Code instructions are in the packaged
45
+ [agent skill](skills/prompt2pwn/SKILL.md). `p2p token --target <url>` and `/mcp` expose the saved bearer
46
+ for manual clients; keep it private.
@@ -14,7 +14,7 @@ import {
14
14
  spinnerGlyph,
15
15
  stateBadge,
16
16
  winnerLabel
17
- } from "./chunk-SZ6ZA65E.js";
17
+ } from "./chunk-ZZDRCSQJ.js";
18
18
 
19
19
  // src/ui/App.tsx
20
20
  import { Box as Box4, Text as Text6, useInput, useStdin } from "ink";
@@ -1815,7 +1815,8 @@ async function login({
1815
1815
  clock,
1816
1816
  signal,
1817
1817
  local,
1818
- offer
1818
+ offer,
1819
+ authorize
1819
1820
  }) {
1820
1821
  let snapshot;
1821
1822
  try {
@@ -1845,6 +1846,11 @@ async function login({
1845
1846
  }
1846
1847
  lifetime = startAttempt({ clock, signal }, deadline - clock.now());
1847
1848
  local(oneLine(`login: open ${device.verification_uri} and enter code ${device.user_code}`));
1849
+ authorize?.({
1850
+ verification_uri: device.verification_uri,
1851
+ user_code: device.user_code,
1852
+ expires_in: device.expires_in
1853
+ });
1848
1854
  offer(device.verification_uri);
1849
1855
  let interval = device.interval;
1850
1856
  while (!signal.aborted) {
@@ -3474,6 +3480,7 @@ export {
3474
3480
  authGithubRequestSchema,
3475
3481
  authGithubResponseSchema,
3476
3482
  authGithubErrorSchema,
3483
+ mcpGetStateResultSchema,
3477
3484
  sanitize,
3478
3485
  oneLine,
3479
3486
  FatalError,
@@ -3491,6 +3498,7 @@ export {
3491
3498
  fetchState,
3492
3499
  fetchRooms,
3493
3500
  createClient,
3501
+ login,
3494
3502
  displayWidth,
3495
3503
  ago,
3496
3504
  countdown,