waitspin 0.1.2 → 0.1.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
@@ -5,25 +5,47 @@ wait-state ads for verified developer surfaces.
5
5
 
6
6
  ## Install
7
7
 
8
- Run this only after `npm view waitspin version` succeeds in launch evidence:
8
+ Run after `npm view waitspin version` succeeds in launch evidence:
9
9
 
10
10
  Before install, publisher registration, or Checkout, review:
11
11
 
12
12
  - Public API and agent docs: `https://waitspin.com/waitspin/docs`
13
+ - Agent markdown: `https://waitspin.com/.well-known/agents.md`
13
14
  - Terms: `https://waitspin.com/waitspin/terms`
14
15
  - Privacy: `https://waitspin.com/waitspin/privacy`
15
16
 
16
- Refund/account-credit policy: unused prepaid blocks are account credit unless a
17
- cash refund is required by law or approved through support review. Self-serve
18
- cash refund requests and credit redemption are not public launch capabilities
19
- yet.
17
+ Refund/account-credit disclosure: unused prepaid block handling is
18
+ support-reviewed. No automated account-credit balance, redemption flow, or
19
+ self-serve cash refund request flow is shipped yet.
20
20
 
21
21
  ```bash
22
22
  npm view waitspin version
23
23
  npx --yes waitspin init --email you@example.com --key-profile control
24
- export WAITSPIN_API_KEY=wts_live_...
25
- waitspin extension install --target vscode
24
+ export WAITSPIN_API_KEY=PASTE_CONTROL_KEY
25
+ waitspin bid create --line "Your ad" --url https://example.com --price-per-block 500 --blocks 1
26
+ waitspin bid checkout CAMPAIGN_ID
27
+ npx --yes waitspin init --email you@example.com --key-profile publisher-extension
28
+
29
+ # Advanced agent install for every detected supported target
30
+ waitspin install --all --dry-run --api-key PASTE_PUBLISHER_EXTENSION_KEY --compose-existing
31
+ waitspin install --all --api-key PASTE_PUBLISHER_EXTENSION_KEY --compose-existing
32
+ waitspin status --all
33
+
34
+ # Install for VS Code status-bar fallback
35
+ waitspin extension install --target vscode --api-key PASTE_PUBLISHER_EXTENSION_KEY
26
36
  waitspin extension status --target vscode
37
+
38
+ # Or install for Claude Code statusline
39
+ waitspin claude-code install --api-key PASTE_PUBLISHER_EXTENSION_KEY --compose-existing
40
+ waitspin claude-code status
41
+
42
+ # Or install for MiMo Code shell hook
43
+ waitspin mimocode install --api-key PASTE_PUBLISHER_EXTENSION_KEY
44
+ waitspin mimocode status
45
+
46
+ # Or install for OpenCode TUI plugin slot
47
+ waitspin opencode install --api-key PASTE_PUBLISHER_EXTENSION_KEY
48
+ waitspin opencode status
27
49
  ```
28
50
 
29
51
  ## Commands
@@ -31,7 +53,7 @@ waitspin extension status --target vscode
31
53
  - `waitspin init` — email OTP onboarding
32
54
  - `waitspin bid create` — create a campaign draft
33
55
  - `waitspin bids list` — list campaigns
34
- - `waitspin bid checkout <campaign-id>` — Stripe Checkout for blocks
56
+ - `waitspin bid checkout CAMPAIGN_ID` — Stripe Checkout for blocks
35
57
  - `waitspin market` — public leaderboard
36
58
  - `waitspin wallet connect` — Stripe Connect Express onboarding
37
59
  - `waitspin wallet status` — publisher balance, payout, and Connect status
@@ -40,31 +62,60 @@ waitspin extension status --target vscode
40
62
  - `waitspin extension install --target vscode` — install the VS Code status-bar fallback
41
63
  - `waitspin extension status --target vscode` — inspect managed fallback lifecycle state
42
64
  - `waitspin extension uninstall --target vscode` — remove the managed fallback runtime and local state
65
+ - `waitspin install --all --dry-run` — preview detected publisher targets without file changes
66
+ - `waitspin install --all` — install every detected supported publisher target
67
+ - `waitspin status --all` — aggregate lifecycle status for every publisher target
68
+ - `waitspin claude-code install --compose-existing` — install the Claude Code statusline command
69
+ - `waitspin claude-code status` — inspect managed Claude Code runtime state
70
+ - `waitspin claude-code uninstall` — restore Claude Code statusline settings and remove managed local state
71
+ - `waitspin mimocode install` — install the MiMo Code shell hook
72
+ - `waitspin mimocode status` — inspect managed MiMo Code runtime state
73
+ - `waitspin mimocode uninstall` — remove managed MiMo Code runtime and bash hook
74
+ - `waitspin opencode install` — install the OpenCode TUI plugin slot
75
+ - `waitspin opencode status` — inspect managed OpenCode runtime state
76
+ - `waitspin opencode uninstall` — remove managed OpenCode runtime and plugin
43
77
 
44
78
  API base: `https://api.waitspin.com`
45
79
 
46
- The public package currently installs only the verified VS Code status-bar
47
- fallback. Native Claude/Codex spinner patching is deferred until that lifecycle
48
- has its own install/status/uninstall proof.
80
+ The public package installs four verified publisher targets: the VS Code
81
+ status-bar fallback, the Claude Code statusline command, the MiMo Code shell
82
+ hook, and the OpenCode TUI plugin slot. Claude Code support uses the official
83
+ `statusLine.command` path and does not patch Claude Code internals. MiMo Code
84
+ uses a bash hook that polls the API for sponsored messages. OpenCode uses its
85
+ TUI `app_bottom` plugin slot.
86
+
87
+ `waitspin install --all` is an advanced agent command for installing every
88
+ detected supported target. It keeps explicit target commands as the canonical
89
+ debug path, supports `--dry-run`, skips unsupported local tools in
90
+ `skipped_not_detected`, reports recoverable config conflicts in
91
+ `skipped_conflict`, and reports unexpected installer failures in
92
+ `failed_rollback`.
49
93
 
50
94
  Payout execution is guarded server-side. Public launch proof uses Stripe test
51
95
  mode with `waitspin wallet payout --confirm-test-transfer`; live transfers stay
52
96
  disabled until the operator enables the explicit live payout flags.
53
97
 
54
- Native Claude Code/Codex spinner patches, account-credit redemption, cash refund
55
- self-service, and click billing are not public paid-launch capabilities yet.
98
+ Native spinner patches beyond supported status surfaces, account-credit
99
+ redemption, cash refund self-service, and click billing are not public
100
+ paid-launch capabilities yet.
56
101
 
57
- ## VS Code publisher credentials
102
+ ## Publisher credentials
58
103
 
59
- Use a publisher-extension key for extension polling/events:
104
+ Use a publisher-extension key for publisher polling/events:
60
105
 
61
106
  ```bash
62
107
  npx waitspin init --email you@example.com --key-profile publisher-extension
63
- npx waitspin extension install --target vscode --api-key wts_live_...
108
+ npx waitspin install --all --dry-run --api-key PASTE_PUBLISHER_EXTENSION_KEY --compose-existing
109
+ npx waitspin install --all --api-key PASTE_PUBLISHER_EXTENSION_KEY --compose-existing
110
+ npx waitspin status --all
111
+ npx waitspin extension install --target vscode --api-key PASTE_PUBLISHER_EXTENSION_KEY
112
+ npx waitspin claude-code install --api-key PASTE_PUBLISHER_EXTENSION_KEY --compose-existing
113
+ npx waitspin mimocode install --api-key PASTE_PUBLISHER_EXTENSION_KEY
114
+ npx waitspin opencode install --api-key PASTE_PUBLISHER_EXTENSION_KEY
64
115
  ```
65
116
 
66
117
  - `WAITSPIN_API_KEY` — temporary publisher-extension key for first activation
67
- - `WAITSPIN_INSTALL_ID` — from `waitspin extension install`
118
+ - `WAITSPIN_INSTALL_ID` — from `waitspin extension install` or `waitspin claude-code install`
68
119
 
69
120
  The VS Code extension migrates `waitspin.apiKey` from User settings into VS Code
70
121
  SecretStorage on activation. `WAITSPIN_API_KEY` is an env-only temporary
@@ -72,13 +123,28 @@ fallback and is not persisted by the extension. Store `waitspin.installId` in
72
123
  User settings; do not store broad control keys or workspace-scoped credentials
73
124
  for normal publisher operation.
74
125
 
126
+ The Claude Code installer writes a managed statusline runtime/state under
127
+ `~/.waitspin` and updates `~/.claude/settings.json` with a safe
128
+ `statusLine.command`. It fails fast when an existing unmanaged statusline is
129
+ present unless `--compose-existing` is explicitly requested and restorable.
130
+
131
+ The MiMo Code installer writes a managed runtime script under `~/.local/bin/`
132
+ and a bash hook in `~/.bashrc`. It polls the API for sponsored messages and
133
+ displays them in the terminal.
134
+
135
+ The OpenCode installer writes a managed runtime/state under `~/.waitspin`,
136
+ installs a TUI plugin under `~/.config/opencode/plugins`, and adds the managed
137
+ entry to `~/.config/opencode/tui.json` so OpenCode mounts the `app_bottom` slot.
138
+
75
139
  ## Release validation
76
140
 
77
141
  Before advertising the public `npx waitspin` path, release operators should run:
78
142
 
79
143
  ```bash
80
- npm pack --dry-run --json
144
+ npm --workspace packages/waitspin pack --dry-run --json
81
145
  npm run test:waitspin:distribution
82
146
  npm view waitspin version
83
147
  npx --yes waitspin --help
148
+ npx --yes waitspin@latest mimocode status
149
+ npx --yes waitspin@latest opencode status
84
150
  ```
@@ -0,0 +1,169 @@
1
+ # WaitSpin MiMo Code Integration
2
+
3
+ WaitSpin publisher support for MiMo Code CLI — sponsored status-line messages
4
+ in your terminal.
5
+
6
+ ## Quick Start
7
+
8
+ ```bash
9
+ # 1. Get a publisher-extension key
10
+ npx waitspin init --email you@example.com --key-profile publisher-extension
11
+
12
+ # 2. Install for MiMo Code
13
+ waitspin mimocode install --api-key wts_live_...
14
+
15
+ # 3. Check status
16
+ waitspin mimocode status
17
+
18
+ # 4. Restart your shell or run:
19
+ source ~/.bashrc
20
+ ```
21
+
22
+ ## How It Works
23
+
24
+ 1. **Install** registers your install ID with WaitSpin and adds a bash hook
25
+ 2. **Runtime** polls `POST /v1/serve/next` every 15 seconds for sponsored messages
26
+ 3. **Display** shows the ad line in your terminal: `── Sponsored message ──`
27
+ 4. **Impression** records a billable view after 5 seconds of visibility
28
+
29
+ ## Commands
30
+
31
+ ### `waitspin mimocode install`
32
+
33
+ Register publisher and configure shell integration.
34
+
35
+ ```bash
36
+ waitspin mimocode install --api-key wts_live_...
37
+ waitspin mimocode install --dry-run # preview without changes
38
+ ```
39
+
40
+ Options:
41
+ - `--api-key KEY` — publisher-extension API key (or set `WAITSPIN_API_KEY`)
42
+ - `--dry-run` — show what would be done without making changes
43
+
44
+ ### `waitspin mimocode status`
45
+
46
+ Show installation state and health.
47
+
48
+ ```bash
49
+ waitspin mimocode status
50
+ ```
51
+
52
+ Output includes:
53
+ - `install_id` — unique install identifier
54
+ - `publisher_id` — registered publisher ID
55
+ - `publisher_registered` — whether registration succeeded
56
+ - `runtime_exists` — whether runtime script is present
57
+ - `bashrc_hook` — whether shell hook is installed
58
+
59
+ ### `waitspin mimocode uninstall`
60
+
61
+ Remove all managed files and hooks.
62
+
63
+ ```bash
64
+ waitspin mimocode uninstall
65
+ waitspin mimocode uninstall --dry-run # preview without changes
66
+ ```
67
+
68
+ Removes:
69
+ - `~/.waitspin/mimocode-statusline.json`
70
+ - `~/.waitspin/mimocode-statusline-cache.json`
71
+ - Bash hook from `~/.bashrc`
72
+
73
+ ## Runtime Script
74
+
75
+ The runtime script (`waitspin-mimocode-runtime`) can be called directly:
76
+
77
+ ```bash
78
+ # Fetch and display one ad line
79
+ waitspin-mimocode-runtime
80
+
81
+ # Use in a custom prompt
82
+ PS1="$(__waitspin_statusline)\n$ "
83
+ ```
84
+
85
+ The generated runtime strips terminal control characters from sponsor text
86
+ before the bash hook renders it.
87
+
88
+ ## Configuration
89
+
90
+ ### Environment Variables
91
+
92
+ | Variable | Default | Description |
93
+ |----------|---------|-------------|
94
+ | `WAITSPIN_API_KEY` | — | Publisher-extension API key |
95
+ | `WAITSPIN_BASE_URL` | `https://api.waitspin.com` | API base URL |
96
+ | `WAITSPIN_DEV` | — | Must be `1` before dev override executables are honored |
97
+ | `WAITSPIN_CLI_JS` | — | Development-only CLI delegator override |
98
+ | `WAITSPIN_MIMOCODE_RUNTIME` | — | Development-only runtime launcher override |
99
+
100
+ ### State Files
101
+
102
+ | File | Purpose |
103
+ |------|---------|
104
+ | `~/.waitspin/mimocode-statusline.json` | Install state (API key, install ID) |
105
+ | `~/.waitspin/mimocode-statusline-cache.json` | Runtime cache (active serve) |
106
+
107
+ ## Trust and Warmup
108
+
109
+ New publishers start at trust level 1/10. The serve endpoint returns empty
110
+ inventory until trust warms up. Expected warmup: ~10 days.
111
+
112
+ During warmup, `waitspin-mimocode-runtime` exits silently (no output, no errors).
113
+
114
+ ## Security
115
+
116
+ - API key stored with `chmod 600` (owner read/write only)
117
+ - Runtime never logs or echoes credentials
118
+ - No credentials written to MiMo Code config files
119
+ - State file is isolated in `~/.waitspin/`
120
+ - `WAITSPIN_CLI_JS` and `WAITSPIN_MIMOCODE_RUNTIME` are ignored unless
121
+ `WAITSPIN_DEV=1`. They are development-only trust-boundary overrides; do not
122
+ set them in shared shells, CI, or production-like environments unless you
123
+ intentionally trust the executable.
124
+
125
+ ## Differences from VS Code Extension
126
+
127
+ | Aspect | VS Code | MiMo Code |
128
+ |--------|---------|-----------|
129
+ | Display | Status bar item | Terminal output |
130
+ | Runtime | Packaged extension | Node.js runtime invoked by bash hook |
131
+ | Auth storage | VS Code SecretStorage | `~/.waitspin/` state file |
132
+ | Polling | Extension host interval | Prompt hook/runtime interval |
133
+ | Impression | After min_visible_ms | After min_visible_ms |
134
+
135
+ ## Architecture
136
+
137
+ See [MIMOCODE_ARCHITECTURE.md](./MIMOCODE_ARCHITECTURE.md) for detailed
138
+ architecture documentation.
139
+
140
+ ## Files
141
+
142
+ ```
143
+ packages/waitspin/assets/waitspin-mimocode/
144
+ ├── README.md # This file
145
+ ├── mimocode-install.sh # CLI delegator for install
146
+ ├── mimocode-status.sh # CLI delegator for status
147
+ ├── mimocode-uninstall.sh # CLI delegator for uninstall
148
+ └── mimocode-runtime.sh # Launcher for generated runtime
149
+
150
+ docs/waitspin/
151
+ ├── MIMOCODE_ARCHITECTURE.md # Architecture document
152
+ ```
153
+
154
+ ## Development
155
+
156
+ ```bash
157
+ # Test with local API
158
+ WAITSPIN_BASE_URL=http://localhost:8787 waitspin mimocode install --dry-run
159
+
160
+ # Run runtime manually
161
+ WAITSPIN_API_KEY=wts_live_... waitspin-mimocode-runtime
162
+
163
+ # Check state
164
+ cat ~/.waitspin/mimocode-statusline.json | python3 -m json.tool
165
+ ```
166
+
167
+ ## License
168
+
169
+ MIT — same as the waitspin package.
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ # WaitSpin MiMo Code install script.
3
+ # Delegates to the canonical waitspin CLI implementation.
4
+ set -euo pipefail
5
+
6
+ usage() {
7
+ cat <<'EOF'
8
+ Usage: mimocode-install.sh [waitspin mimocode install options]
9
+
10
+ This asset intentionally does not duplicate install, registration, or JSON
11
+ logic. Use the package CLI as the single source of truth:
12
+
13
+ waitspin mimocode install --api-key KEY
14
+
15
+ For trusted development only, set WAITSPIN_DEV=1 and WAITSPIN_CLI_JS to a
16
+ local dist/cli.js path.
17
+ EOF
18
+ }
19
+
20
+ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
21
+ usage
22
+ exit 0
23
+ fi
24
+
25
+ if [ -n "${WAITSPIN_CLI_JS:-}" ]; then
26
+ if [ "${WAITSPIN_DEV:-}" != "1" ]; then
27
+ echo "WAITSPIN_CLI_JS requires WAITSPIN_DEV=1." >&2
28
+ exit 126
29
+ fi
30
+ exec node "$WAITSPIN_CLI_JS" mimocode install "$@"
31
+ fi
32
+
33
+ if command -v waitspin >/dev/null 2>&1; then
34
+ exec waitspin mimocode install "$@"
35
+ fi
36
+
37
+ cat >&2 <<'EOF'
38
+ waitspin CLI was not found.
39
+
40
+ Install the package or run from a built checkout, then retry:
41
+ npm --workspace packages/waitspin run build
42
+ node packages/waitspin/dist/cli.js mimocode install --api-key KEY
43
+ EOF
44
+ exit 127
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+ # WaitSpin MiMo Code statusline runtime launcher.
3
+ # The real runtime is generated by `waitspin mimocode install`.
4
+ set -euo pipefail
5
+
6
+ if [ -n "${WAITSPIN_MIMOCODE_RUNTIME:-}" ]; then
7
+ if [ "${WAITSPIN_DEV:-}" != "1" ]; then
8
+ exit 0
9
+ fi
10
+ runtime="$WAITSPIN_MIMOCODE_RUNTIME"
11
+ else
12
+ runtime="$HOME/.local/bin/waitspin-mimocode-runtime"
13
+ fi
14
+
15
+ if [ ! -x "$runtime" ]; then
16
+ exit 0
17
+ fi
18
+
19
+ exec "$runtime" "$@"
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ # WaitSpin MiMo Code status script.
3
+ # Delegates to the canonical waitspin CLI implementation.
4
+ set -euo pipefail
5
+
6
+ usage() {
7
+ cat <<'EOF'
8
+ Usage: mimocode-status.sh [waitspin mimocode status options]
9
+
10
+ This asset intentionally does not duplicate status, path-safety, or JSON logic.
11
+ Use the package CLI as the single source of truth:
12
+
13
+ waitspin mimocode status
14
+
15
+ For trusted development only, set WAITSPIN_DEV=1 and WAITSPIN_CLI_JS to a
16
+ local dist/cli.js path.
17
+ EOF
18
+ }
19
+
20
+ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
21
+ usage
22
+ exit 0
23
+ fi
24
+
25
+ if [ -n "${WAITSPIN_CLI_JS:-}" ]; then
26
+ if [ "${WAITSPIN_DEV:-}" != "1" ]; then
27
+ echo "WAITSPIN_CLI_JS requires WAITSPIN_DEV=1." >&2
28
+ exit 126
29
+ fi
30
+ exec node "$WAITSPIN_CLI_JS" mimocode status "$@"
31
+ fi
32
+
33
+ if command -v waitspin >/dev/null 2>&1; then
34
+ exec waitspin mimocode status "$@"
35
+ fi
36
+
37
+ cat >&2 <<'EOF'
38
+ waitspin CLI was not found.
39
+
40
+ Install the package or run from a built checkout, then retry:
41
+ npm --workspace packages/waitspin run build
42
+ node packages/waitspin/dist/cli.js mimocode status
43
+ EOF
44
+ exit 127
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ # WaitSpin MiMo Code uninstall script.
3
+ # Delegates to the canonical waitspin CLI implementation.
4
+ set -euo pipefail
5
+
6
+ usage() {
7
+ cat <<'EOF'
8
+ Usage: mimocode-uninstall.sh [waitspin mimocode uninstall options]
9
+
10
+ This asset intentionally does not duplicate uninstall, restore, path-safety, or
11
+ JSON logic. Use the package CLI as the single source of truth:
12
+
13
+ waitspin mimocode uninstall
14
+
15
+ For trusted development only, set WAITSPIN_DEV=1 and WAITSPIN_CLI_JS to a
16
+ local dist/cli.js path.
17
+ EOF
18
+ }
19
+
20
+ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
21
+ usage
22
+ exit 0
23
+ fi
24
+
25
+ if [ -n "${WAITSPIN_CLI_JS:-}" ]; then
26
+ if [ "${WAITSPIN_DEV:-}" != "1" ]; then
27
+ echo "WAITSPIN_CLI_JS requires WAITSPIN_DEV=1." >&2
28
+ exit 126
29
+ fi
30
+ exec node "$WAITSPIN_CLI_JS" mimocode uninstall "$@"
31
+ fi
32
+
33
+ if command -v waitspin >/dev/null 2>&1; then
34
+ exec waitspin mimocode uninstall "$@"
35
+ fi
36
+
37
+ cat >&2 <<'EOF'
38
+ waitspin CLI was not found.
39
+
40
+ Install the package or run from a built checkout, then retry:
41
+ npm --workspace packages/waitspin run build
42
+ node packages/waitspin/dist/cli.js mimocode uninstall
43
+ EOF
44
+ exit 127