@hagicode/cli 0.1.0-dev.41.1.8543fd3 → 0.1.0-dev.42.1.b13f8d2

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/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./chunks/main-C3T3Iu-a.js");s.runCli().then(e=>{e!==0&&(process.exitCode=e)}).catch(e=>{const n=e instanceof Error?e.stack??e.message:String(e);process.stderr.write(`${n}
2
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./chunks/main-CGAPe6tb.js");s.runCli().then(e=>{e!==0&&(process.exitCode=e)}).catch(e=>{const n=e instanceof Error?e.stack??e.message:String(e);process.stderr.write(`${n}
3
3
  `),process.exitCode=s.EXIT_CODES.UNKNOWN});
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/main-C3T3Iu-a.js");exports.createCliApp=e.createCliApp;exports.runCli=e.runCli;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/main-CGAPe6tb.js");exports.createCliApp=e.createCliApp;exports.runCli=e.runCli;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hagicode/cli",
3
- "version": "0.1.0-dev.41.1.8543fd3",
3
+ "version": "0.1.0-dev.42.1.b13f8d2",
4
4
  "description": "HagiCode CLI for project, proposal, vault, chat, and AutoTask management.",
5
5
  "homepage": "https://github.com/HagiCode-org/cli#readme",
6
6
  "bugs": {
@@ -140,6 +140,24 @@ hagi proposal messages --session-id <session-id> --last 1 --json
140
140
  - `--timeout`, `--interval` and `--grace` are seconds and need `--wait`. `--interval` must be less than `--timeout`. A timeout exits `31`.
141
141
  - Which stage each command starts, and how to follow a run, is in [openspec-workflow.md](openspec-workflow.md).
142
142
 
143
+ ## Session metadata
144
+
145
+ `chat create` and `proposal create` take write-once metadata entries. An orchestrator marks the sessions it starts with them, for example a master marker and worker markers, and finds them again through `userMetadata`.
146
+
147
+ ```bash
148
+ hagi chat create --title "Master" --project-id <project-id> --metadata role=master --metadata batch=2026-11-07 --json
149
+ hagi chat create --title "Worker 1" --project-id <project-id> --metadata role=worker --metadata master=<master-session-id> --json
150
+ printf '{"role":"worker","master":"<master-session-id>"}' | hagi chat create --title "Worker 2" --project-id <project-id> --metadata-json - --json
151
+ hagi proposal create --project-id <project-id> --chief-complaint "<text>" --default-title --metadata role=worker --metadata master=<master-session-id> --json
152
+ ```
153
+
154
+ - `--metadata key=value` is repeatable. The text is split at the first `=`, so a value may contain `=`.
155
+ - `--metadata-json <file|->` reads a JSON object of string values from a file, or from stdin with `-`. It is repeatable.
156
+ - A key may appear once across both options. A missing `=`, an empty key, a repeated key, or JSON that is not an object of string values exits `2` before any request is sent.
157
+ - Backend limits: at most 16 entries; a key of 1 to 64 characters matching `^[a-z][a-z0-9._-]{0,63}$`; a value of 1 to 512 characters with no control characters. The backend's message is printed as it is, and the session is not created.
158
+ - Write-once: the entries are set at creation and cannot be changed later. Do not put secrets in them: every reader of the session can see them.
159
+ - Output: `--json` of `chat create`, `chat list`, `proposal create` and `proposal get` carries `userMetadata` (an object of string values) when the session has entries. The human output adds one `userMetadata` line, keys sorted. A session without entries has no `userMetadata` field.
160
+
143
161
  ## HagiTask commands
144
162
 
145
163
  A HagiTask is a preset task with a structured input. Use the schema-first flow: list the tasks, read one task's schema, write the input file from the schema, then create the session.
@@ -173,6 +173,33 @@ npx @hagicode/cli proposal complete --session-id <session-id>
173
173
  npx @hagicode/cli proposal send --session-id <session-id> --content "Please continue"
174
174
  ```
175
175
 
176
+ ## Session metadata
177
+
178
+ `proposal create` accepts `--metadata key=value` (repeatable) and `--metadata-json <file|->` (a JSON object of string values; `-` reads stdin). Use them to mark the sessions of one orchestrated run: a master marker on the orchestrator and worker markers on each proposal, so the run can find its sessions again.
179
+
180
+ ```bash
181
+ MASTER_ID=$(hagi chat create --title "Batch master" --project-id <project-id> --metadata role=master --metadata batch=2026-11-07 --json | json_field '.session.sessionId')
182
+
183
+ hagi proposal create \
184
+ --project-id <project-id> \
185
+ --chief-complaint "Repository scope
186
+ Writable repositories:
187
+ - repos/web
188
+ Read-only repositories:
189
+ - none
190
+
191
+ Tighten the settings page copy" \
192
+ --default-title \
193
+ --metadata role=worker \
194
+ --metadata master="$MASTER_ID" \
195
+ --json
196
+ ```
197
+
198
+ - Keys: 1 to 64 characters matching `^[a-z][a-z0-9._-]{0,63}$`. Values: 1 to 512 characters with no control characters. At most 16 entries. The backend checks these and its message is shown as it is.
199
+ - Each key appears once across both options. A repeat, a missing `=`, or a non-string JSON value exits `2` with no request sent.
200
+ - Metadata is write-once and visible to every reader of the session. Do not put secrets in it.
201
+ - The output `session` object carries `userMetadata` when the session has entries. Read it to confirm the markers were stored.
202
+
176
203
  ## Validation focus
177
204
 
178
205
  After each lifecycle step: