@hagicode/cli 0.1.0-dev.38.1.49d2c87 → 0.1.0-dev.39.1.c7a4f44
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 +39 -7
- package/dist/chunks/{main-BU7mtIsu.js → main-DZ0mAAOh.js} +104 -94
- package/dist/cli.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,11 +110,11 @@ $ echo $?
|
|
|
110
110
|
hagi
|
|
111
111
|
|-- project list | repositories | create | update | delete
|
|
112
112
|
| `-- monospecs show | init | set | validate | reload | clone | remove-checkout
|
|
113
|
-
|-- proposal list | create | optimize-description | generate | annotate | execute | archive | status | complete | send
|
|
113
|
+
|-- proposal list | create | optimize-description | generate | annotate | execute | archive | status | complete | send | get | messages
|
|
114
114
|
|-- vault list | create | update | delete
|
|
115
115
|
| `-- files list | preview
|
|
116
116
|
|-- chat list | create | archive | delete | send
|
|
117
|
-
|-- hagitask list | schema | create | send
|
|
117
|
+
|-- hagitask list | schema | create | send | get | messages
|
|
118
118
|
|-- plan list | get | create | update | enable | disable | delete | run
|
|
119
119
|
`-- skills local list | enable | disable | uninstall
|
|
120
120
|
gallery search | detail | install
|
|
@@ -260,6 +260,17 @@ hagi proposal complete --session-id "$PROPOSAL_ID"
|
|
|
260
260
|
hagi proposal archive --session-id "$PROPOSAL_ID"
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
+
### Follow a Run
|
|
264
|
+
|
|
265
|
+
`proposal get` reads one session. With `--wait` it polls until the status settles, so the next lifecycle command runs at the right time. `proposal messages` reads the session's messages, newest first.
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
hagi proposal get --session-id "$PROPOSAL_ID" --wait --json
|
|
269
|
+
hagi proposal messages --session-id "$PROPOSAL_ID" --last 1 --json
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
The options are the same as `hagitask get`. WaitingForReply counts as settled, because a person must answer. Which stage each command starts is in [references/openspec-workflow.md](skills/hagi/references/openspec-workflow.md).
|
|
273
|
+
|
|
263
274
|
### Explicit Lifecycle Sequence
|
|
264
275
|
|
|
265
276
|
The CLI keeps proposal lifecycle actions explicit and non-interactive. Each command maps to one backend action:
|
|
@@ -357,8 +368,8 @@ hagi hagitask list --json
|
|
|
357
368
|
`hagitask schema` shows one task's target scope, commands, parameters, requirements and scenes. Each required parameter is marked `yes`. The `--json` output adds the input JSON Schema and an example request body:
|
|
358
369
|
|
|
359
370
|
```bash
|
|
360
|
-
hagi hagitask schema --task-id
|
|
361
|
-
hagi hagitask schema --task-id
|
|
371
|
+
hagi hagitask schema --task-id <task-id>
|
|
372
|
+
hagi hagitask schema --task-id <task-id> --json
|
|
362
373
|
```
|
|
363
374
|
|
|
364
375
|
Write the input file. Its keys are the parameter keys the schema lists under `inputs`, plus the `targets` and `targetScopes` keys when the schema's scope lists targets. For example, `input.json` for a task with one required input:
|
|
@@ -375,17 +386,28 @@ Create the session from that task and input. The new id is read from `session.se
|
|
|
375
386
|
|
|
376
387
|
```bash
|
|
377
388
|
HAGITASK_ID=$(hagi hagitask create \
|
|
378
|
-
--title "Auto
|
|
389
|
+
--title "Auto task" \
|
|
379
390
|
--project-id "$PROJECT_ID" \
|
|
380
|
-
--task-id
|
|
391
|
+
--task-id <task-id> \
|
|
381
392
|
--input input.json \
|
|
393
|
+
--json | json_field '.session.sessionId')
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
Super Commit is a prompt, not a preset task. It has no schema and takes no `--input`. Start it with its prompt id, and pass the Git options it accepts:
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
SUPER_COMMIT_ID=$(hagi hagitask create \
|
|
400
|
+
--title "Commit the CLI changes" \
|
|
401
|
+
--project-id "$PROJECT_ID" \
|
|
402
|
+
--prompt-id auto-compose-commit.en-US \
|
|
382
403
|
--repository-path repos/cli \
|
|
383
|
-
--need-push \
|
|
384
404
|
--target-branch-mode new-custom \
|
|
385
405
|
--target-branch-name feature/cli-completion \
|
|
386
406
|
--json | json_field '.session.sessionId')
|
|
387
407
|
```
|
|
388
408
|
|
|
409
|
+
Start a Super Commit only when the user asked for it. Add `--need-push` only when the user asked for a push. See [references/super-commit.md](skills/hagi/references/super-commit.md) for the options, the branch modes, the result and the explicit-request rule.
|
|
410
|
+
|
|
389
411
|
Use `--prompt-id` instead of `--task-id` for a prompt template with no structured input. `--input` needs `--task-id`. Input is read from a file, or from stdin with `--input -`. The CLI only checks that the input is a JSON object. The backend checks the keys and values. It rejects a key that the schema does not list, and a missing required value. Its error is printed unchanged, and no session is reported as created. `--hero-selection-mode` takes `first` (the default) or `random`.
|
|
390
412
|
|
|
391
413
|
The backend must have a hero available for the task's script. Without one, `hagitask create` fails with a 400 whose error is `no-executable-hero`.
|
|
@@ -396,6 +418,15 @@ Send a follow-up message to the HagiTask session:
|
|
|
396
418
|
hagi hagitask send --session-id "$HAGITASK_ID" --content "Retry with a smaller diff"
|
|
397
419
|
```
|
|
398
420
|
|
|
421
|
+
Read one HagiTask session, or wait until its status settles, and read its messages:
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
hagi hagitask get --session-id "$SUPER_COMMIT_ID" --wait --timeout 900 --json
|
|
425
|
+
hagi hagitask messages --session-id "$SUPER_COMMIT_ID" --last 1 --json
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
`hagitask get` reads one session. With `--wait` it polls every `--interval` seconds (default 5) until the status is no longer Optimizing, Openspecing, Executing or Archiving. `--timeout` (default 900) and `--grace` (default 10, `0` disables) are seconds, and `--timeout`, `--interval` and `--grace` need `--wait`. `--interval` must be less than `--timeout`. A timeout exits `31` and prints the last status. `hagitask messages --last <n>` reads the n newest messages; `--json` prints the list unchanged.
|
|
429
|
+
|
|
399
430
|
**Migration from AutoTask:** `hagi hagitask create` and `hagi hagitask send` replace `hagi autotask create` and `hagi autotask send`. There is no `autotask` alias, so an `autotask` command now fails as an unknown command. Read the task schema with `hagitask schema` to find the input keys that replace the old flags.
|
|
400
431
|
|
|
401
432
|
## Plan Commands
|
|
@@ -624,6 +655,7 @@ Stable non-zero exits used by the CLI. The HTTP numbers are the equivalents of t
|
|
|
624
655
|
| `24` | HTTP 404 |
|
|
625
656
|
| `29` | HTTP 409 |
|
|
626
657
|
| `30` | Operation failed: the backend returned a refusal, for example `skills local enable` or `disable` on a name that is not a built-in skill, an invalid MonoSpecs configuration from `project monospecs validate`, or a failed clone from `project monospecs clone` or `set --clone` |
|
|
658
|
+
| `31` | Wait timed out: `--wait` on `proposal get` or `hagitask get` reached `--timeout` before the session settled. The last status is printed. Not a success, and not a backend error |
|
|
627
659
|
| `40` | Other HTTP 4xx |
|
|
628
660
|
| `50` | HTTP 5xx |
|
|
629
661
|
| `60` | Transport or connection failure |
|