@mirrowel/opencode-openshare 0.2.0-dev.1 → 0.2.0-dev.2
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 +36 -37
- package/ci/README.md +9 -3
- package/ci/openshare.js +379 -85
- package/dist/binding-queue.d.ts +1 -0
- package/dist/binding-queue.js +22 -0
- package/dist/commands.js +41 -285
- package/dist/core.js +524 -88
- package/dist/dialogs.js +1 -1
- package/dist/settings.js +141 -16
- package/dist/share-flow.d.ts +7 -2
- package/dist/share-flow.js +32 -17
- package/dist/sidebar.js +0 -21
- package/dist/tui.js +256 -386
- package/dist/v2-server.js +55 -0
- package/package.json +1 -1
- package/src/binding-queue.ts +26 -0
- package/src/commands.ts +41 -280
- package/src/core.ts +505 -87
- package/src/dialogs.tsx +11 -2
- package/src/settings.ts +133 -15
- package/src/share-flow.ts +33 -19
- package/src/sidebar.tsx +0 -24
- package/src/v2-server.ts +50 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ OpenCode v1 and v2, self-hosted on your own worker.
|
|
|
9
9
|
|---|---|---|
|
|
10
10
|
| `dist/server.js` | package server entry (opencode.json `plugin` array) | all, unless the TUI is registered |
|
|
11
11
|
| `dist/tui.js` | package TUI entry (tui.json `plugin` array) | its presence flips the server to manual |
|
|
12
|
-
| `ci/openshare.js` | single-file, zero-dependency bundle of the same engine (committed; rebuilt by `npm run build`) |
|
|
12
|
+
| `ci/openshare.js` | single-file, zero-dependency bundle of the same engine (committed; rebuilt by `npm run build`) | all-mode **by default** — it declares no TUI entry, but an explicit `shareMode` in config/env still wins |
|
|
13
13
|
|
|
14
14
|
All three are behavior-identical where they overlap — `npm run
|
|
15
15
|
test:regression` proves the single file and the package match the frozen
|
|
@@ -89,11 +89,14 @@ stays all-mode.
|
|
|
89
89
|
|
|
90
90
|
## TUI
|
|
91
91
|
|
|
92
|
-
- `/share` — share the session (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
- `/share` — share the session (explicit consent on EVERY creation —
|
|
93
|
+
nothing is published silently; then the URL is copied). On a child
|
|
94
|
+
session, shares the whole family. Already shared → the session menu,
|
|
95
|
+
identical to `/openshare → This session`: copy links (per server, or
|
|
96
|
+
all), stop sharing — delete or leave a snapshot, per-server stop on
|
|
97
|
+
multi-server shares —, share to another server, session TTL and read
|
|
98
|
+
auth. A credential conflict opens the collision dialog (copy debug
|
|
99
|
+
info / share on a new share / don't share).
|
|
97
100
|
- `/openshare` — grouped settings (compact root with live summaries →
|
|
98
101
|
focused submenus): This session (share/stop — delete or leave a
|
|
99
102
|
snapshot —, TTL override, session read auth), **Servers** (connection
|
|
@@ -105,11 +108,12 @@ stays all-mode.
|
|
|
105
108
|
preview), Advanced, Config files. Danger rows red, dirty rows green,
|
|
106
109
|
`[i]` panes paged (`## sections`, 1-9 jump), messages wrap in real
|
|
107
110
|
bodies (no clipped one-liners).
|
|
108
|
-
- Sidebar chip —
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
- Sidebar chip (v1 hosts — the v2 TUI context has no slot registry yet) —
|
|
112
|
+
share status next to the session title (`·N` when the session streams
|
|
113
|
+
to several servers); click copies the link. A share whose page died
|
|
114
|
+
server-side renders `⊘ gone` — clicking opens the share manager, which
|
|
115
|
+
verifies every bound server, auto-clears dead entries and offers
|
|
116
|
+
Share again (see Gone detection in the root README).
|
|
113
117
|
- Every menu row carries an `[i]` detail pane (what it does, current
|
|
114
118
|
value + source, full URLs/ids); Interface rows set menu width/height
|
|
115
119
|
(host preference store).
|
|
@@ -126,44 +130,39 @@ npm run test:quick # everyday gate (~90s): parity + manual core + TUI + v2 +
|
|
|
126
130
|
|
|
127
131
|
Suites (shared machinery in `scripts/suite-lib.mjs`; every run is
|
|
128
132
|
watchdogged, port-swept, and drives real `opencode serve` instances with
|
|
129
|
-
a mock OpenAI-compatible provider — except where noted)
|
|
133
|
+
a mock OpenAI-compatible provider — except where noted). The canonical
|
|
134
|
+
suite table — what each covers, including the big/backends scale suites —
|
|
135
|
+
lives in [`../DEVELOPMENT.md`](../DEVELOPMENT.md#test-suites); the
|
|
136
|
+
commands:
|
|
130
137
|
|
|
131
138
|
- `test:regression` — parity of legacy / single-file / package across the
|
|
132
|
-
full lifecycle
|
|
133
|
-
- `test:manual` —
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
- `test:
|
|
139
|
-
|
|
140
|
-
- `test:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- `test:
|
|
144
|
-
|
|
145
|
-
blocked path, public zero-config).
|
|
146
|
-
- `test:fanout` — multi-server: v2 bindings, content parity across
|
|
147
|
-
servers, mid-session join with full-history backfill, per-session
|
|
148
|
-
opt-outs.
|
|
149
|
-
- `test:cli` — real `opencode run` end to end (single file + package +
|
|
150
|
-
silenced outputs; mock provider, sandboxed XDG homes) — on demand.
|
|
151
|
-
- `node scripts/npm-e2e.mjs` — the **published** npm package installed
|
|
152
|
-
by registry spec, end to end — on demand.
|
|
153
|
-
- `test:server-auth` / `test:server-enroll` — the SAME auth/enroll
|
|
154
|
-
suites against the portable Bun backend (`../share-server`): the
|
|
155
|
-
two-backends-one-protocol parity guarantee.
|
|
139
|
+
full lifecycle.
|
|
140
|
+
- `test:manual` — the engine scenarios (dormancy, backfill, tombstones,
|
|
141
|
+
timers, turn sockets, all-mode gating).
|
|
142
|
+
- `test:tui-flow` — share/manager flows, config write targets, enrollment,
|
|
143
|
+
admin console, gone detection.
|
|
144
|
+
- `test:v2` — the v2 adapter against a scripted mock v2 host.
|
|
145
|
+
- `test:auth` / `test:server-auth` — the identity contract (52 checks)
|
|
146
|
+
against the Cloudflare worker and the Bun backend.
|
|
147
|
+
- `test:enroll` / `test:server-enroll`, `test:fanout`, `test:big` /
|
|
148
|
+
`test:server-big` — enrollment lifecycle, multi-server fan-out,
|
|
149
|
+
big-session scale (both backends).
|
|
150
|
+
- `test:cli`, `node scripts/npm-e2e.mjs` — real `opencode run` / the
|
|
151
|
+
published npm package — on demand only.
|
|
156
152
|
|
|
157
153
|
Layout:
|
|
158
154
|
|
|
159
155
|
```
|
|
160
156
|
src/
|
|
161
157
|
config.ts config load/save (servers group, field-level merge), shareMode, tui.json scan
|
|
158
|
+
contract.ts the OpenShare item contract (v: 2 envelope, message/diff
|
|
159
|
+
normalization, tombstone shape) — shared truth for plugin,
|
|
160
|
+
worker, Bun server, and viewer
|
|
162
161
|
core.ts the engine: fan-out remotes (socket/spool/rev per server),
|
|
163
162
|
ws handshake, chunked syncs, backfill, collisions, opt-outs
|
|
164
163
|
server.ts v1 entry {id, server, setup}
|
|
165
164
|
tui.tsx v1 TUI entry + host facade
|
|
166
|
-
commands.ts /share (
|
|
165
|
+
commands.ts /share (consent gate → session menu — the SAME menu as /openshare → This session — plus collision + gone dialogs) /openshare
|
|
167
166
|
share-flow.ts host-agnostic flows: flag, bindings v1/v2, enrollment,
|
|
168
167
|
rotate/disconnect, admin client, unshare multi-delete
|
|
169
168
|
settings.ts grouped settings tree + servers section + admin console
|
package/ci/README.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Open(code)Share — CI bundle (`openshare.js`)
|
|
2
2
|
|
|
3
|
-
The single-file, zero-dependency build of the plugin. **
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
The single-file, zero-dependency build of the plugin. **All-mode by
|
|
4
|
+
default** — it declares no TUI entry, so presence detection always
|
|
5
|
+
resolves "all" on a CI runner (an explicit `shareMode` in config/env
|
|
6
|
+
still wins). Behavior-identical to the package server
|
|
7
|
+
(`../dist/server.js`), proven by `npm run test:regression`.
|
|
8
|
+
|
|
9
|
+
If your runner executes the bundle under plain Node (outside
|
|
10
|
+
opencode's runtime), use Node 22+ — the engine relies on the
|
|
11
|
+
`WebSocket`/`fetch` globals.
|
|
6
12
|
|
|
7
13
|
This folder is deliberately separate from the package root so that loading
|
|
8
14
|
the plugin by directory (`plugin: ["file:///…/share-plugin"]`) can only
|