@hagicode/cli 0.1.0-dev.54.1.372ef38 → 0.1.0-dev.57.1.8f2a93b

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-BrAlo52u.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-Ces0eCr0.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-BrAlo52u.js");exports.createCliApp=e.createCliApp;exports.runCli=e.runCli;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/main-Ces0eCr0.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.54.1.372ef38",
3
+ "version": "0.1.0-dev.57.1.8f2a93b",
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": {
@@ -108,9 +108,19 @@ and `updatedAt`. `items <saga-id> --json` returns `{ "sagaId": "...", "items": [
108
108
  canonical `id`, `title`, `state`, `cmd`, and `note`.
109
109
 
110
110
  `status <saga-id> --json` returns the `saga-status/2` projection directly, with `schema`, `sagaId`, `revision`, `state`,
111
- `updatedAt`, `note`, `artifacts`, `nextArtifact`, `counts`, `openAmendments`, and `items`. It derives this view from the
112
- Saga files; `updatedAt` is the time of this observation, not the execution heartbeat in `runtime/status.json`. The query
113
- does not refresh or rewrite that stored status, and its default `note` is empty rather than a cached execution note.
111
+ `updatedAt`, `note`, `artifacts`, `nextArtifact`, `counts`, `openAmendments`, and `items`. Counts, artifacts, `nextArtifact`,
112
+ `openAmendments`, and `items` are derived from the Saga files at read time.
113
+
114
+ `state` and `note` come from the stored snapshot in `runtime/status.json` when it is valid: a `state` of `draft`,
115
+ `planned`, `running`, `paused`, or `done`. The reported `state` and `note` are the stored values as written, so a stored
116
+ `paused` or `done` is reported even when the files derive another state. A stored `running` is the one exception: it is
117
+ honored, with its note, only when the derived state (from the contract revision, artifacts, and item counts) is also
118
+ `running`. Otherwise the derived state applies with an empty `note`, because `running` is the state that goes stale when
119
+ an orchestrator exits. A missing file, unparsable JSON, a non-object document, or any other `state` value falls back to
120
+ the derived state with an empty `note`.
121
+
122
+ `updatedAt` is the time of this observation, not the execution heartbeat in `runtime/status.json`. The query
123
+ does not refresh or rewrite that stored status, never repairs it, and creates no `runtime/` file or directory.
114
124
 
115
125
  All three queries are strictly read-only: they do not initialize or repair resources, create runtime files, run the Saga
116
126
  tool, or execute acceptance commands. Missing optional draft files use canonical empty-data behavior; malformed or
@@ -129,6 +139,13 @@ hagi saga release demo --path "./My Project" --token "$SAGA_EXECUTION_TOKEN" --w
129
139
  - `claim --session <id>` creates the lock exclusively and returns the token once, in the human output and as `token` in
130
140
  JSON. A second claim is refused with code `1` and names the owning session. A lock is never taken over because of its
131
141
  age, and a refused claim changes no file.
142
+ - After the lock is taken, `claim` marks the owner session as the Saga's orchestrator: it adds `saga.id` (the Saga) and
143
+ `saga.role=master` to that session's `userMetadata` through the backend, so the session lists show the orchestrator
144
+ inside the Saga's group with its Workers. The mark is best effort and never fails the claim: an owner ID that is not a
145
+ HagiCode session, an unreachable backend, or a session that already carries another `saga.id` is reported as
146
+ `master: { "marked": false, "reason": "..." }` in JSON and as `master mark not set: <reason>` in the human output. A
147
+ successful mark is `master: { "sessionId": "<id>", "marked": true }`. Stored entries are never changed. Pass
148
+ `--no-mark-session` to skip the mark.
132
149
  - While a lock exists, a mutating command needs the holder's token. A missing or different token is refused with exit
133
150
  code `1` and changes no file. Without a lock, mutating commands run under their own gates, so a Saga created before ownership stays runnable.
134
151
  - `assert-owner` exits `0` when no lock exists or the token matches, and `1` otherwise.
@@ -107,8 +107,9 @@ hagi saga items <saga-id> --project-id <project-id> --json
107
107
  ```
108
108
 
109
109
  These queries read the selected project's Saga files without initializing or repairing them, refreshing runtime status,
110
- or executing acceptance commands. Status is a fresh `saga-status/2` observation; its `updatedAt` is not the stored
111
- execution heartbeat in `runtime/status.json`. `init` installs resources and `new` creates a Saga, so run either only
110
+ or executing acceptance commands. Status is a fresh `saga-status/2` observation: its counts and items come from the Saga
111
+ files, and its `state` and `note` may come from a valid stored state in `runtime/status.json` (a stored `running` only
112
+ when the files also derive `running`). Its `updatedAt` is not the stored execution heartbeat in `runtime/status.json`. `init` installs resources and `new` creates a Saga, so run either only
112
113
  when the user explicitly asks for that change. Contract and lifecycle operations run through `hagi saga` with the execution token rules in `references/saga.md`.
113
114
 
114
115
  ### Skills