soltask 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +398 -2
- package/dist/cli.d.ts +15 -0
- package/dist/cli.js +344 -0
- package/dist/client.d.ts +131 -0
- package/dist/client.js +879 -0
- package/dist/commands/actions.d.ts +26 -0
- package/dist/commands/actions.js +1181 -0
- package/dist/commands/auth.d.ts +10 -0
- package/dist/commands/auth.js +489 -0
- package/dist/commands/drafts.d.ts +22 -0
- package/dist/commands/drafts.js +736 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +10 -0
- package/dist/commands/meta.d.ts +4 -0
- package/dist/commands/meta.js +195 -0
- package/dist/commands/read.d.ts +24 -0
- package/dist/commands/read.js +1106 -0
- package/dist/commands/watch.d.ts +2 -0
- package/dist/commands/watch.js +397 -0
- package/dist/config.d.ts +86 -0
- package/dist/config.js +365 -0
- package/dist/context.d.ts +70 -0
- package/dist/context.js +1 -0
- package/dist/domain.d.ts +311 -0
- package/dist/domain.js +747 -0
- package/dist/errors.d.ts +28 -0
- package/dist/errors.js +40 -0
- package/dist/fsutil.d.ts +35 -0
- package/dist/fsutil.js +243 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/dist/output.d.ts +27 -0
- package/dist/output.js +74 -0
- package/dist/types.d.ts +254 -0
- package/dist/types.js +1 -0
- package/dist/util.d.ts +32 -0
- package/dist/util.js +116 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.js +13 -0
- package/package.json +63 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dong Tran
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,399 @@
|
|
|
1
|
-
#
|
|
1
|
+
# soltask
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Zero-dependency Node.js (`>=22`) TypeScript CLI for task board management, workflow automation, and realtime Server-Sent Events (SSE) monitoring.
|
|
4
|
+
|
|
5
|
+
`soltask` provides 100% parity with the task-board web UI while staying fast, scriptable, and predictable:
|
|
6
|
+
|
|
7
|
+
- **Zero runtime dependencies** — uses only Node.js `>=22` built-ins (`fetch`, `node:util`, `node:fs`, `node:crypto`, `node:os`, `node:path`, `node:async_hooks`).
|
|
8
|
+
- **Direct, non-interactive execution** — mutating commands (`approve`, `reject`, `cancel`, `draft delete`, etc.) run immediately with no `y/n` confirmation prompts, making them safe for shell scripts and CI jobs. Pass `--dry-run` to preview any action without modifying server state.
|
|
9
|
+
- **Machine-readable output** — every command supports `--json` (and `watch` supports `--jsonl`), with deterministic exit codes (`0`..`5`) for automated workflows.
|
|
10
|
+
- **Hardened session custody** — Nostr secret keys (`nsec`) are never written to disk or printed; only the server-issued session cookie and unlock key (`X-Task-Board-Key`) are stored with strict POSIX permissions (`0600` in a `0700` directory) and origin binding.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Requirements & Installation
|
|
15
|
+
|
|
16
|
+
- **Node.js `>=22`** (uses native `fetch`, `parseArgs`, and ESM).
|
|
17
|
+
|
|
18
|
+
### Install from npm
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
# Install globally
|
|
22
|
+
npm install -g soltask
|
|
23
|
+
|
|
24
|
+
# Or run on demand without global installation
|
|
25
|
+
npx soltask --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Build from source
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
git clone https://github.com/dongitran/soltask.git
|
|
32
|
+
cd soltask
|
|
33
|
+
npm ci --ignore-scripts
|
|
34
|
+
npm run build
|
|
35
|
+
node dist/index.js --version
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Authentication & Security Model
|
|
41
|
+
|
|
42
|
+
### Signing in
|
|
43
|
+
|
|
44
|
+
`soltask login` exchanges a Nostr secret key (`nsec`) once against `POST /api/session` and stores only the server-issued session cookie and unlock key (`X-Task-Board-Key`). Prefer `--nsec-stdin` or `--nsec-file` so the key never appears in process argument listings:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
# Recommended: pipe key on stdin
|
|
48
|
+
printf '%s\n' "$SOLTASK_NSEC" | soltask login --server https://board.example.com --nsec-stdin
|
|
49
|
+
|
|
50
|
+
# Read key from a local file with restricted permissions
|
|
51
|
+
soltask login --server https://board.example.com --nsec-file ./nsec.key
|
|
52
|
+
|
|
53
|
+
# Pass directly via flag or SOLTASK_NSEC environment variable
|
|
54
|
+
soltask login --server https://board.example.com --nsec "<nsec>"
|
|
55
|
+
SOLTASK_NSEC="<nsec>" soltask login --server https://board.example.com
|
|
56
|
+
|
|
57
|
+
# Local development server on loopback
|
|
58
|
+
printf '%s\n' "$SOLTASK_NSEC" | soltask login --server http://127.0.0.1:8950 --nsec-stdin
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Checking session & sync health
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
# Verify active identity, pubkey, and community roles
|
|
65
|
+
soltask whoami
|
|
66
|
+
|
|
67
|
+
# Check Node version, config permissions, server URL, session validity, and community sync
|
|
68
|
+
soltask doctor --wait-live
|
|
69
|
+
|
|
70
|
+
# End session on the server and clear saved local credentials
|
|
71
|
+
soltask logout
|
|
72
|
+
|
|
73
|
+
# Clear only the saved local config without contacting the server
|
|
74
|
+
soltask logout --local
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Security guarantees
|
|
78
|
+
|
|
79
|
+
- **Zero `nsec` persistence:** `nsec` is read once during `login`, sent over `POST /api/session`, and never saved to config, printed to stdout/stderr, or echoed in errors.
|
|
80
|
+
- **Restricted config storage (`0600` / `0700`):** Saved sessions are written atomically with mode `0600` inside a `0700` directory (`$XDG_CONFIG_HOME/soltask/config.json` or `~/.config/soltask/config.json` on POSIX; `%APPDATA%\soltask\config.json` on Windows). Symlinks on the config file or its parent directory are refused.
|
|
81
|
+
- **Automatic cookie rotation:** When the server rotates the session cookie via `Set-Cookie`, `soltask` atomically persists the renewed cookie in place.
|
|
82
|
+
- **Origin binding:** Saved session credentials are bound to the exact `[scheme, host, port]` origin that issued them and are never sent to a different `--server` or `SOLTASK_SERVER` origin.
|
|
83
|
+
- **No-redirect policy & bounded reads:** `soltask` uses `redirect: "manual"` and refuses HTTP redirects so credentials cannot leak across origins. Browser `Origin` and `Sec-Fetch-*` headers are never sent, requests enforce timeouts, and response reads are size-capped.
|
|
84
|
+
- **Cleartext HTTP warning:** Targeting a non-loopback `http://` server emits a warning to stderr; always prefer HTTPS outside loopback (`127.0.0.1`, `localhost`, `[::1]`).
|
|
85
|
+
- **Environment credential overrides:** For CI or ephemeral runs without a config file, supply either `SOLTASK_COOKIE` (`name=value`) together with `SOLTASK_UNLOCK_KEY`, or `SOLTASK_TOKEN` (Bearer mode). Explicit environment credentials are not origin-bound and apply to whichever `--server` or `SOLTASK_SERVER` the command targets.
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
export SOLTASK_SERVER="https://board.example.com"
|
|
89
|
+
export SOLTASK_COOKIE="task_board_session=<session-id>"
|
|
90
|
+
export SOLTASK_UNLOCK_KEY="<unlock-key>"
|
|
91
|
+
soltask overview --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
See [SECURITY.md](SECURITY.md) for the complete security policy and vulnerability reporting process.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Global Options & Environment Variables
|
|
99
|
+
|
|
100
|
+
Global options are accepted either before or after the command name:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
soltask [global options] <command> [command options]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Option | Short | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `--server URL` | | Server base URL (precedence: `--server` > `SOLTASK_SERVER` > saved config). |
|
|
109
|
+
| `--config PATH` | | Config file path (precedence: `--config` > `SOLTASK_CONFIG` > platform default). |
|
|
110
|
+
| `--community ID` | `-c` | Target community ID (precedence: `--community` > `SOLTASK_COMMUNITY` > saved config). |
|
|
111
|
+
| `--json` | | Emit machine-readable JSON (or JSONL for `watch`) on stdout. |
|
|
112
|
+
| `--dry-run` | | Preview request payloads and preflight checks without modifying server state. |
|
|
113
|
+
| `--wait-live` | | Poll cold/connecting communities until they report `live` before returning status or data. |
|
|
114
|
+
| `--version` | `-V` | Print the CLI version and exit (`0`). |
|
|
115
|
+
| `--help` | `-h` | Show general or command-specific help and exit (`0`). |
|
|
116
|
+
|
|
117
|
+
### Environment variables
|
|
118
|
+
|
|
119
|
+
| Variable | Purpose |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| `SOLTASK_SERVER` | Default server base URL (e.g. `https://board.example.com`). |
|
|
122
|
+
| `SOLTASK_CONFIG` | Override config file path (defaults to `$XDG_CONFIG_HOME/soltask/config.json` or `~/.config/soltask/config.json`; `%APPDATA%\soltask\config.json` on Windows). |
|
|
123
|
+
| `SOLTASK_COMMUNITY` | Default community ID (e.g. `team` or `ops`). |
|
|
124
|
+
| `SOLTASK_COOKIE` | Explicit session cookie (`name=value`); must be paired with `SOLTASK_UNLOCK_KEY`. |
|
|
125
|
+
| `SOLTASK_UNLOCK_KEY` | Explicit `X-Task-Board-Key` unlock key paired with `SOLTASK_COOKIE`. |
|
|
126
|
+
| `SOLTASK_TOKEN` | Optional Bearer token credential override when cookie + unlock env vars are unset. |
|
|
127
|
+
| `SOLTASK_NSEC` | Fallback Nostr secret key for `login` when no `--nsec-*` flag is provided. |
|
|
128
|
+
| `SOLTASK_DEBUG` | When set to a non-empty value, prints stack traces to stderr on unexpected runtime errors. |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Command Reference
|
|
133
|
+
|
|
134
|
+
Run `soltask help [command]` or `soltask <command> --help` to inspect options for any command.
|
|
135
|
+
|
|
136
|
+
### Authentication & Diagnostics
|
|
137
|
+
|
|
138
|
+
`auth` groups all session and diagnostic subcommands, and each subcommand is also available as a top-level alias (`login`, `logout`, `whoami`, `doctor`).
|
|
139
|
+
|
|
140
|
+
| Command | Usage | Key Options |
|
|
141
|
+
| --- | --- | --- |
|
|
142
|
+
| `auth` | `soltask auth <login\|logout\|whoami\|doctor>` | Subcommand group for authentication and diagnostics. |
|
|
143
|
+
| `login` (`auth login`) | `soltask login [--nsec-stdin \| --nsec-file PATH \| --nsec VALUE]` | `--nsec-stdin`, `--nsec-file PATH`, `--nsec VALUE`; supports `--dry-run`, `--json`. |
|
|
144
|
+
| `logout` (`auth logout`) | `soltask logout [--local]` | `--local` (clear local config without calling `DELETE /api/session`); supports `--dry-run`, `--json`. |
|
|
145
|
+
| `whoami` (`auth whoami`) | `soltask whoami` | Shows signed-in name, pubkey, server, and community roles. |
|
|
146
|
+
| `doctor` (`auth doctor`) | `soltask doctor [--wait-live]` | Checks Node version, config permissions, server URL, session auth, protocol version, and community sync health. |
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
soltask auth login --server https://board.example.com --nsec-stdin < ./nsec.key
|
|
150
|
+
soltask auth whoami --json
|
|
151
|
+
soltask auth doctor --wait-live
|
|
152
|
+
soltask auth logout --local
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Discovery & Inspection
|
|
156
|
+
|
|
157
|
+
| Command | Usage | Key Options |
|
|
158
|
+
| --- | --- | --- |
|
|
159
|
+
| `communities` | `soltask communities [--channels]` | `--channels` (include per-channel visibility and startable entry agents). |
|
|
160
|
+
| `overview` | `soltask overview` | Shows backlog, queued, working, needs, for-me, shipping, done, and total counts per community (and `TOTAL` across communities). |
|
|
161
|
+
| `templates` | `soltask templates [TEMPLATE_ID] [--all] [--check]` | Offline by default. `--all` includes internal templates (`requirement`, `fixrun`, `discovery`) and blurbs/outcomes; `--check` checks availability against server channels. |
|
|
162
|
+
| `list` | `soltask list [options]` | `--col COLS` (repeatable/CSV: `backlog`, `queued`, `working`, `needs`, `shipping`, `done`, `canceled`, `open`), `--channel SELECTOR` (ID or `#slug`), `--template ID`, `--reason TYPE`, `--priority LEVEL` (`low`, `normal`, `high`, `urgent`), `--label LABEL` (all specified labels must match), `--q TEXT`, `--mine`, `--for-me`, `--compact`, `--limit N`, `--sort FIELD` (`last` default, `since`, `priority`, `key`). |
|
|
163
|
+
| `inbox` | `soltask inbox [--for-me] [--compact] [--limit N]` | Lists `needs` tasks grouped into **For you** and **Waiting on others**, sorted oldest-first with suggested next commands. `--for-me` shows only items waiting on you; `--compact` omits the `NEXT` column. |
|
|
164
|
+
| `show` | `soltask show <TASK_REF> [--tail N] [--full] [--raw]` | Resolves by task key (`TM-1`), full 64-hex root ID, or unique `>=8`-char hex prefix. `--tail N` limits to the last `N` events; `--full` disables event body truncation; `--raw` includes raw Nostr event fields (`id`, `kind`, `tags`, `sig`). |
|
|
165
|
+
| `agents` | `soltask agents [--status S] [--channel C] [--kind K] [--q TEXT]` | Lists agents with live status (`down`, `working`, `idle`, `away`, `key`), channel membership, active tasks, and last checked revision. |
|
|
166
|
+
| `activity` | `soltask activity [--limit N]` | Shows recent thread activity merged chronologically across one or all communities (`--limit` default `30`, max `200`). |
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
soltask communities --channels
|
|
170
|
+
soltask overview --wait-live
|
|
171
|
+
soltask templates brainstorm --check
|
|
172
|
+
soltask list -c team --col open --priority high,urgent --sort priority
|
|
173
|
+
soltask inbox --for-me
|
|
174
|
+
soltask show TM-1 --tail 10 --full
|
|
175
|
+
soltask agents -c team --status idle,working --channel brainstorm
|
|
176
|
+
soltask activity --limit 20
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Realtime Streaming
|
|
180
|
+
|
|
181
|
+
#### `watch`
|
|
182
|
+
|
|
183
|
+
```sh
|
|
184
|
+
soltask watch [TASK_REF] [--until CONDITIONS] [--col COLS] [--timeout SEC] [--jsonl] [--include-typing]
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Streams realtime SSE updates from `GET /api/stream` with automatic reconnect and exponential backoff on transient failures.
|
|
188
|
+
|
|
189
|
+
- `TASK_REF` (optional): Scope stream to one task (by key, root, or prefix). When combined with `--until`, `watch` checks the task's current state first and exits `0` immediately without opening a stream if the condition already holds.
|
|
190
|
+
- `--until CONDITIONS` (repeatable/CSV): Exit `0` as soon as a task matches any condition:
|
|
191
|
+
- Column name or `col:<name>` (`backlog`, `queued`, `working`, `needs`, `shipping`, `done`, `canceled`)
|
|
192
|
+
- Reason type or `reason:<type>` (`approve`, `answer`, `publish`, `decide`, `nudge`, `retry`, `unblock`)
|
|
193
|
+
- `for-me` (task is waiting on you)
|
|
194
|
+
- `stage:<id>` (e.g. `stage:card`, `stage:review`)
|
|
195
|
+
- `--col COLS` (repeatable/CSV): Filter displayed task updates by column (including `open`).
|
|
196
|
+
- `--timeout SEC`: Stop after `SEC` seconds. Exits `0` for plain streaming tails (no `--until`), or exits `5` when `--until` did not match before the deadline.
|
|
197
|
+
- `--jsonl` (or `--json`): Emit newline-delimited JSON event frames (`status`, `task`, `typing`, `stopped`, `timeout`).
|
|
198
|
+
- `--include-typing`: Include typing indicator events (omitted by default).
|
|
199
|
+
|
|
200
|
+
If a watched target task moves to `canceled` while waiting on `--until` (and `canceled` is not in `--until`), `watch` prints the update and exits `5`.
|
|
201
|
+
|
|
202
|
+
```sh
|
|
203
|
+
# Wait for a task to need approval or finish, emitting JSONL frames
|
|
204
|
+
soltask watch TM-1 --until approve,done --timeout 300 --jsonl
|
|
205
|
+
|
|
206
|
+
# Tail all open updates in the team community for 60 seconds
|
|
207
|
+
soltask watch -c team --col open --timeout 60
|
|
208
|
+
|
|
209
|
+
# Include typing indicators while debugging a live thread
|
|
210
|
+
soltask watch TM-1 --include-typing --timeout 30
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Backlog Drafts
|
|
214
|
+
|
|
215
|
+
Manage local-backlog drafts stored on the server before promoting them into live tasks.
|
|
216
|
+
|
|
217
|
+
| Subcommand | Usage | Key Options |
|
|
218
|
+
| --- | --- | --- |
|
|
219
|
+
| `draft list` | `soltask draft list [--q TEXT] [--all]` | `--q TEXT` filters ID, community, or body; `--all` ignores configured default community. |
|
|
220
|
+
| `draft show` | `soltask draft show <DRAFT_ID>` | Accepts full 16-char ID or unique `>=6`-char prefix. |
|
|
221
|
+
| `draft create` | `soltask draft create [--title TEXT] [--body TEXT \| --body-file PATH \| --body-stdin] [--id ID]` | `--id` sets an explicit 16-char base64url ID; supports `--dry-run`. |
|
|
222
|
+
| `draft update` | `soltask draft update <DRAFT_ID> [--title TEXT] [--body TEXT \| --body-file PATH \| --body-stdin] [--replace]` | `--replace` overwrites the entire markdown body verbatim; refuses drafts pending delivery (`exit 4`); supports `--dry-run`. |
|
|
223
|
+
| `draft delete` | `soltask draft delete <DRAFT_ID>` | Deletes directly without prompting; refuses drafts pending delivery (`exit 4`); supports `--dry-run`. |
|
|
224
|
+
| `draft send` | `soltask draft send <DRAFT_ID> [--kind K] [--channel C] [--entry A] [--priority P] [--labels L] [--label L] [--force]` | Runs full task preflight, creates the task (removing the draft), and optionally applies initial priority/labels. `--force` bypasses soft blockers such as an offline entry agent; supports `--dry-run`. |
|
|
225
|
+
| `draft retry` | `soltask draft retry <DRAFT_ID>` | Retries sending a draft stuck in pending-delivery state (`exit 4` if not pending delivery); supports `--dry-run`. |
|
|
226
|
+
|
|
227
|
+
```sh
|
|
228
|
+
soltask draft create -c team --title "Cache invalidation plan" --body-file ./proposal.md
|
|
229
|
+
soltask draft list -c team
|
|
230
|
+
soltask draft show draft_0000000001
|
|
231
|
+
soltask draft update draft_0000000001 --title "Cache invalidation RFC"
|
|
232
|
+
soltask draft send draft_0000000001 --kind brainstorm --priority high --label backend --label rfc
|
|
233
|
+
soltask draft retry draft_0000000002
|
|
234
|
+
soltask draft delete draft_0000000003
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Task Metadata
|
|
238
|
+
|
|
239
|
+
#### `meta`
|
|
240
|
+
|
|
241
|
+
```sh
|
|
242
|
+
soltask meta <TASK_REF> [--priority P] [--labels L | --clear-labels | --add-label L | --remove-label L]
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Reads a task's priority and labels when called with no update flags, or updates them via `PUT /api/tasks/:community/:root/meta`:
|
|
246
|
+
|
|
247
|
+
- `--priority P`: One of `low`, `normal`, `high`, `urgent`.
|
|
248
|
+
- `--labels L` (repeatable/CSV): Replace all labels (up to 10 labels, max 40 chars each).
|
|
249
|
+
- `--clear-labels`: Remove all labels.
|
|
250
|
+
- `--add-label L` (repeatable/CSV): Append labels to the existing list (cannot combine with `--labels` or `--clear-labels`).
|
|
251
|
+
- `--remove-label L` (repeatable/CSV): Remove matching labels from the existing list (cannot combine with `--labels` or `--clear-labels`).
|
|
252
|
+
|
|
253
|
+
```sh
|
|
254
|
+
# Inspect current metadata
|
|
255
|
+
soltask meta TM-1
|
|
256
|
+
|
|
257
|
+
# Set priority and add/remove labels incrementally
|
|
258
|
+
soltask meta TM-1 --priority urgent --add-label release --remove-label wip
|
|
259
|
+
|
|
260
|
+
# Replace all labels or clear them
|
|
261
|
+
soltask meta TM-1 --labels backend,security
|
|
262
|
+
soltask meta TM-1 --clear-labels
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Task Creation & Workflow Actions
|
|
266
|
+
|
|
267
|
+
All action commands support `--dry-run` and `--json`. Commands that accept body, text, or reason content support mutually exclusive inline (`--body` / `--text` / `--reason`), file (`*-file PATH`), and stdin (`*-stdin`) sources.
|
|
268
|
+
|
|
269
|
+
| Command | Usage | Key Options & Notes |
|
|
270
|
+
| --- | --- | --- |
|
|
271
|
+
| `create` | `soltask create [--title TEXT] [--body TEXT \| --body-file PATH \| --body-stdin] [--kind K] [--channel C] [--entry A] [--priority P] [--labels L] [--label L] [--draft-id ID] [--force]` | `--kind`: `brainstorm`, `canon`, `hackathons`, `implementation`, `bug`, `ask`. Runs preflight checks (channel/entry resolution, hackathon drafter mention `@BA Agent` or `@Tech Agent`, offline agent guard) before creating the task, optionally applying priority/labels and deleting `--draft-id`. |
|
|
272
|
+
| `reply` | `soltask reply <TASK_REF> (--text TEXT \| --text-file PATH \| --text-stdin) [--mention AGENT]... [--parent EVENT_ID] [--answer]` | Posts a message to a task thread. `--mention` accepts agent IDs, display names, or 64-hex pubkeys (repeatable/CSV, max 50); `--parent` sets a 64-hex parent event ID; `--answer` formats as an `@Agent` response to the task's open reason. |
|
|
273
|
+
| `answer` | `soltask answer <TASK_REF> (--text TEXT \| --text-file PATH \| --text-stdin) [--to AGENT]` | Answers an agent question (`reason=answer`), mentioning the asking agent. Pass `--to AGENT` to override when no open `answer` reason exists (otherwise exits `4`). |
|
|
274
|
+
| `approve` | `soltask approve <TASK_REF> [--card EVENT_ID]` | Approves the task's open approval card immediately (no prompt). Auto-detects `cardId` from the open `approve` reason or accepts `--card EVENT_ID` (64-hex). Exits `4` if no open card exists. |
|
|
275
|
+
| `reject` | `soltask reject <TASK_REF> (--reason TEXT \| --reason-file PATH \| --reason-stdin) [--card EVENT_ID]` | Rejects an open approval card immediately with a required reason (max 2,000 chars). |
|
|
276
|
+
| `publish` | `soltask publish <TASK_REF> [--change TEXT] [--to AGENT]` | Sends `@Agent publish` at the publish stage, or requests a revision with `--change TEXT`. Pass `--to AGENT` to override when no open `publish` reason exists. |
|
|
277
|
+
| `decide` | `soltask decide <TASK_REF> <accepted\|rejected\|done> (--reason TEXT \| --reason-file PATH \| --reason-stdin)` | Records a discovery/proposal decision (`accepted`, `rejected`, or `done`) with a required reason (max 65,000 chars). |
|
|
278
|
+
| `nudge` | `soltask nudge <TASK_REF> [--to AGENT] [--force]` | Nudges a stalled thread to continue (preserving quota-bypass wording when the open `nudge` reason includes `blocked`/`until`). Pass `--to AGENT` or `--force` (uses the template's stall nudge agent) when no open `nudge` reason exists. |
|
|
279
|
+
| `retry` | `soltask retry <TASK_REF> [--to AGENT] [--force]` | Asks an agent to retry its last turn. Refuses with exit `4` if the task is within an active quota lock window unless `--force` is passed. |
|
|
280
|
+
| `unblock` | `soltask unblock <TASK_REF> (--text TEXT \| --text-file PATH \| --text-stdin) [--to AGENT]` | Posts an unblock update mentioning the blocked agent (`reason=unblock`, or `--to AGENT`). |
|
|
281
|
+
| `resolve` | `soltask resolve <TASK_REF> [--event EVENT_ID]` | Marks a task answer event as resolved (`✅` reaction). Automatically selects the newest agent reply event when `--event` is omitted. |
|
|
282
|
+
| `cancel` | `soltask cancel <TASK_REF> [--reason TEXT \| --reason-file PATH \| --reason-stdin]` | Cancels an open task immediately (no prompt) with an optional reason. Exits `4` if the task is already `done` or `canceled`. |
|
|
283
|
+
|
|
284
|
+
```sh
|
|
285
|
+
# Create a brainstorm task directly
|
|
286
|
+
soltask create -c team --kind brainstorm --title "Explore caching strategy" --body "Compare TTL vs event-driven invalidation." --priority high --label backend
|
|
287
|
+
|
|
288
|
+
# Preview before creating
|
|
289
|
+
soltask create -c team --kind hackathons --title "Ship retry queue" --body "Draft with @Tech Agent." --dry-run
|
|
290
|
+
|
|
291
|
+
# Thread and gate actions
|
|
292
|
+
soltask reply TM-1 --text "Added benchmark numbers." --mention brainstorm-lead
|
|
293
|
+
soltask answer TM-1 --text "Use option B for regional failover."
|
|
294
|
+
soltask approve TM-1
|
|
295
|
+
soltask reject TM-1 --reason "Missing rollback plan in the diff."
|
|
296
|
+
soltask publish TM-2
|
|
297
|
+
soltask publish TM-2 --change "Update the alert threshold to 5 minutes."
|
|
298
|
+
soltask decide TM-4 accepted --reason "Clear operational win with minimal risk."
|
|
299
|
+
soltask nudge TM-1 --force
|
|
300
|
+
soltask retry TM-1 --force
|
|
301
|
+
soltask unblock TM-1 --text "Provisioned the staging credentials."
|
|
302
|
+
soltask resolve TM-1
|
|
303
|
+
soltask cancel TM-2 --reason "Superseded by TM-5."
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Exit Codes
|
|
309
|
+
|
|
310
|
+
Every command returns a deterministic exit code so scripts can branch reliably without scraping text:
|
|
311
|
+
|
|
312
|
+
| Code | Meaning | Typical Causes |
|
|
313
|
+
| --- | --- | --- |
|
|
314
|
+
| `0` | Success | Command completed, `--dry-run` preflight passed, `--help`/`--version` printed, or timed `watch` tail finished. |
|
|
315
|
+
| `1` | Runtime / network / server error | Network failure, timeout, HTTP `404`/`5xx`, config read/write/symlink refusal, or `doctor` health check failure. |
|
|
316
|
+
| `2` | Validation / usage error | Unknown command or option, invalid flag combination or choice, HTTP `400`/`422`, ambiguous reference, or task preflight blockers. |
|
|
317
|
+
| `3` | Authentication error | Missing/expired/invalid credentials (HTTP `401`/`403`), missing server URL, or origin mismatch with saved config. |
|
|
318
|
+
| `4` | Conflict / state guard | HTTP `409`/`428`, no open approval card, active quota-lock window on `retry` without `--force`, pending-delivery draft edit/delete, or task already `done`/`canceled`. |
|
|
319
|
+
| `5` | Watch stopped | `watch --until` timed out, received `SIGINT`/`SIGTERM`, or the watched target task was canceled while waiting for another condition. |
|
|
320
|
+
|
|
321
|
+
When `--json` is passed on an error, `soltask` emits a structured JSON object on stdout containing `{ "ok": false, "error": "...", "message": "...", "exit_code": <N> }`.
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Automation Recipes
|
|
326
|
+
|
|
327
|
+
### 1. Create a task, wait for approval, inspect, approve, and wait for completion
|
|
328
|
+
|
|
329
|
+
```sh
|
|
330
|
+
set -euo pipefail
|
|
331
|
+
|
|
332
|
+
# Create task and extract key
|
|
333
|
+
KEY=$(soltask create -c team --kind brainstorm \
|
|
334
|
+
--title "Evaluate session cache design" \
|
|
335
|
+
--body "Compare in-memory and shared store tradeoffs." \
|
|
336
|
+
--priority high --label backend --json | node -e 'const d = JSON.parse(require("node:fs").readFileSync(0, "utf8")); console.log(d.key);')
|
|
337
|
+
|
|
338
|
+
# Wait until the task needs attention or finishes
|
|
339
|
+
soltask watch "$KEY" --until needs,done --timeout 900 --jsonl
|
|
340
|
+
|
|
341
|
+
# Inspect the last 5 thread events
|
|
342
|
+
soltask show "$KEY" --tail 5 --json
|
|
343
|
+
|
|
344
|
+
# Approve the open card directly and wait for completion
|
|
345
|
+
soltask approve "$KEY" --json
|
|
346
|
+
soltask watch "$KEY" --until done --timeout 600 --jsonl
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### 2. Triage tasks waiting on you
|
|
350
|
+
|
|
351
|
+
```sh
|
|
352
|
+
# Print open items waiting on you as structured JSON
|
|
353
|
+
soltask inbox --for-me --wait-live --json
|
|
354
|
+
|
|
355
|
+
# Extract keys and suggested next commands
|
|
356
|
+
soltask inbox --for-me --json | node -e '
|
|
357
|
+
const data = JSON.parse(require("node:fs").readFileSync(0, "utf8"));
|
|
358
|
+
for (const item of data.for_me) {
|
|
359
|
+
console.log(`${item.key}\t${item.reason?.type ?? "-"}\t${item.next_command ?? "-"}`);
|
|
360
|
+
}
|
|
361
|
+
'
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### 3. Draft, refine, preflight, and promote from backlog
|
|
365
|
+
|
|
366
|
+
```sh
|
|
367
|
+
DRAFT_ID=$(soltask draft create -c team \
|
|
368
|
+
--title "Add health endpoint probe" \
|
|
369
|
+
--body-file ./notes.md --json | node -e 'console.log(JSON.parse(require("node:fs").readFileSync(0, "utf8")).id)')
|
|
370
|
+
|
|
371
|
+
soltask draft update "$DRAFT_ID" --title "Add readiness and liveness probes"
|
|
372
|
+
|
|
373
|
+
# Verify preflight without sending
|
|
374
|
+
soltask draft send "$DRAFT_ID" --kind brainstorm --priority high --label ops --dry-run
|
|
375
|
+
|
|
376
|
+
# Promote to a live task with priority and labels
|
|
377
|
+
soltask draft send "$DRAFT_ID" --kind brainstorm --priority high --label ops --json
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## Development, Verification & Security
|
|
383
|
+
|
|
384
|
+
Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for ground rules, wire vocabulary conventions, and pull request expectations, and [SECURITY.md](SECURITY.md) for security policy and release verification details.
|
|
385
|
+
|
|
386
|
+
Run the full local verification suite before opening a pull request:
|
|
387
|
+
|
|
388
|
+
```sh
|
|
389
|
+
npm run typecheck
|
|
390
|
+
npm run lint
|
|
391
|
+
npm run test:ci
|
|
392
|
+
npm run verify:package
|
|
393
|
+
npm run neutrality -- --structural-only --history
|
|
394
|
+
npm run neutrality -- --tarball --structural-only
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
## License
|
|
398
|
+
|
|
399
|
+
[MIT](LICENSE)
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OptionSpec, RuntimeIO } from "./context.js";
|
|
2
|
+
import { type TextSink } from "./output.js";
|
|
3
|
+
import { type JsonObject } from "./util.js";
|
|
4
|
+
export declare const GLOBAL_OPTIONS: Readonly<Record<string, OptionSpec>>;
|
|
5
|
+
export interface RunOverrides extends Partial<RuntimeIO> {
|
|
6
|
+
stdout?: TextSink;
|
|
7
|
+
stderr?: TextSink;
|
|
8
|
+
}
|
|
9
|
+
/** Builds a diagnostic hint explaining why no session credentials resolved for `serverUrl`. */
|
|
10
|
+
export declare function buildMissingAuthHint(cfg: Readonly<JsonObject>, serverUrl: string, env: NodeJS.ProcessEnv): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Runs one command line and returns the exit code; it never throws and never calls `process.exit`.
|
|
13
|
+
* `overrides` lets tests replace streams, environment, working directory, and transport seams.
|
|
14
|
+
*/
|
|
15
|
+
export declare function runCli(argv: readonly string[], overrides?: RunOverrides): Promise<number>;
|