@everywheredev/cli 0.0.2-3.1 → 0.0.3-2.1

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 +21 -30
  2. package/dist/index.js +145 -147
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  A **Claude-Code-style TypeScript terminal client** for the PocketDev host. It is a *thin client to the
4
4
  Go host* — it never owns the filesystem, git, PTY, or AI agent. It browses/edits the project, streams
5
- the terminal and activity feed, drives the HTTP proxy, and runs AI prompts, working **identically**
6
- against a **LOCAL** host (loopback + Personal Access Token over Tailscale) or a **FULL-REMOTE** host
7
- (cloud + Ory Hydra OAuth2), selected by a per-host **connection profile**.
5
+ the terminal and activity feed, drives the HTTP proxy, and runs AI prompts, connecting to a
6
+ **FULL-REMOTE** host (cloud + Ory Hydra OAuth2).
8
7
 
9
8
  > Full design: [`docs/architecture/cli.md`](../docs/architecture/cli.md).
10
9
 
@@ -48,16 +47,11 @@ Remove the dev link with `make cli-unlink` (or `npm unlink -g @everywheredev/cli
48
47
  ## Quick start
49
48
 
50
49
  ```sh
51
- # LOCAL-ONLY (free): point at the host on 127.0.0.1:4317 with a Personal Access Token.
52
- export POCKETDEV_MODE=local
53
- export POCKETDEV_TOKEN=<pat>
54
- pocketdev tree
55
- pocketdev open src/index.ts
56
- pocketdev agent "refactor the parser and run tests"
57
-
58
- # FULL-REMOTE (premium): device-grant login against Ory Hydra, then the same commands.
50
+ # Device-grant login against Ory Hydra, then run commands.
59
51
  pocketdev --profile cloud login
60
52
  pocketdev --profile cloud agents
53
+ pocketdev open src/index.ts
54
+ pocketdev agent "refactor the parser and run tests"
61
55
  ```
62
56
 
63
57
  ## Architecture (foundation)
@@ -67,17 +61,16 @@ agent + tool loop (approval gate) → transport → renderer**, with a session/t
67
61
  layered settings underneath.
68
62
 
69
63
  Every external dependency is an injected **interface (port)**; concretes are wired **once** at the DI
70
- composition root (`src/di/container.ts`, [tsyringe](https://github.com/microsoft/tsyringe)). That root
71
- is the *only* place that branches on `POCKETDEV_MODE` (`local` | `remote`) nothing downstream
72
- branches on mode, so the command/tool/agent layer is byte-identical across both.
73
-
74
- | Seam (port) | LOCAL concrete | REMOTE concrete |
75
- | --- | --- | --- |
76
- | `AuthProvider` | `SharedTokenAuthProvider` (PAT / `POCKETDEV_TOKEN`) | `HydraOAuthAuthProvider` (device grant + PKCE) |
77
- | `HttpPort` | `HttpTransport` → `http://127.0.0.1:4317` | `HttpTransport` → `https://…` |
78
- | `StreamPort` | `WsStreamTransport` `ws://…/ws` | `WsStreamTransport` → `wss://…/ws` |
79
- | `TerminalPort` | `TerminalTransport` over the stream | same |
80
- | `SessionStore` | `FileSessionStore` (JSONL + `/api/sessions`) | same |
64
+ composition root (`src/di/container.ts`, [tsyringe](https://github.com/microsoft/tsyringe)). Nothing
65
+ downstream branches on environment, so the command/tool/agent layer is uniform.
66
+
67
+ | Seam (port) | Concrete |
68
+ | --- | --- |
69
+ | `AuthProvider` | `HydraOAuthAuthProvider` (device grant + PKCE) |
70
+ | `HttpPort` | `HttpTransport` `https://…` |
71
+ | `StreamPort` | `WsStreamTransport` → `wss://…/ws` |
72
+ | `TerminalPort` | `TerminalTransport` over the stream |
73
+ | `SessionStore` | `FileSessionStore` (JSONL + `/api/sessions`) |
81
74
 
82
75
  ### Layout
83
76
 
@@ -86,11 +79,11 @@ cli/
86
79
  ├─ bin/pocketdev.js # shebang shim → dist/index.js
87
80
  └─ src/
88
81
  ├─ index.ts # bootstrap: reflect-metadata, buildContainer, route
89
- ├─ di/{container,tokens}.ts # composition root (ONLY local/remote wiring) + injection tokens
82
+ ├─ di/{container,tokens}.ts # composition root + injection tokens
90
83
  ├─ core/{app,command-router,errors}.ts
91
84
  ├─ config/{ports,config-store,profile,defaults}.ts # precedence flags>env>project>user>defaults
92
85
  ├─ transport/{ports,http-transport,ws-stream-transport,terminal-transport,composite-transport,reconnect}.ts
93
- ├─ auth/{ports,shared-token-auth-provider,hydra-oauth-auth-provider,device-flow,pkce,keychain}.ts
86
+ ├─ auth/{ports,hydra-oauth-auth-provider,device-flow,pkce,keychain}.ts
94
87
  ├─ session/{ports,file-session-store}.ts
95
88
  └─ contract/index.ts # thin re-export of @pocketdev/contract types (no drift)
96
89
  ```
@@ -100,8 +93,8 @@ cli/
100
93
  Highest wins:
101
94
 
102
95
  ```
103
- 1. CLI flags --host, --mode, --profile, --token, --print/-p, --json, --no-tty
104
- 2. Environment POCKETDEV_MODE, POCKETDEV_HOST, POCKETDEV_PORT (4317), POCKETDEV_TOKEN,
96
+ 1. CLI flags --host, --profile, --print/-p, --json, --no-tty
97
+ 2. Environment POCKETDEV_HOST, POCKETDEV_PORT (4317),
105
98
  POCKETDEV_PROJECT_ROOT, POCKETDEV_MAX_FILE_BYTES,
106
99
  KRATOS_PUBLIC_URL, HYDRA_PUBLIC_URL, OIDC_ISSUER
107
100
  3. Project config ./.pocketdev/config.json
@@ -114,10 +107,8 @@ Server-only variables (`DATABASE_URL`, `REDIS_URL`, `CASBIN_WATCHER_CHANNEL`, `S
114
107
 
115
108
  ## Authentication
116
109
 
117
- - **LOCAL** — `Authorization: Bearer $POCKETDEV_TOKEN`; the host validates with a constant-time
118
- compare. `pocketdev login` is a verify round-trip. No keychain, no browser.
119
- - **REMOTE** — OAuth2 **Device Authorization Grant + PKCE** (RFC 8628 + 7636) against Ory Hydra;
120
- access JWT used as the same Bearer header for REST and the WS handshake; tokens stored in the OS
110
+ - OAuth2 **Device Authorization Grant + PKCE** (RFC 8628 + 7636) against Ory Hydra;
111
+ access JWT used as the Bearer header for REST and the WS handshake; tokens stored in the OS
121
112
  keychain with a chmod-0600 file fallback for headless/CI.
122
113
 
123
114
  ## Scripts