@hasna/loops 0.2.0 → 0.3.0

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
@@ -95,7 +95,8 @@ Create a workflow JSON file:
95
95
  "id": "status",
96
96
  "target": {
97
97
  "type": "command",
98
- "command": "git status --short",
98
+ "command": "git",
99
+ "args": ["status", "--short"],
99
100
  "cwd": "/path/to/repo"
100
101
  }
101
102
  },
@@ -117,15 +118,32 @@ Create a workflow JSON file:
117
118
  Save, run, inspect, and schedule it:
118
119
 
119
120
  ```bash
121
+ loops workflows validate repo-morning.json
122
+ loops workflows validate repo-morning.json --preflight
120
123
  loops workflows create repo-morning.json
121
124
  loops workflows run repo-morning --show-output
122
125
  loops workflows runs repo-morning
126
+ loops workflows inspect <workflow-run-id>
123
127
  loops workflows events <workflow-run-id>
128
+ loops workflows cancel <workflow-run-id> --reason "no longer needed"
129
+ loops workflows recover <workflow-run-id>
124
130
  loops create workflow repo-morning-loop --workflow repo-morning --cron "0 8 * * *"
125
131
  ```
126
132
 
127
133
  Workflow specs are stored separately from loops. A loop can schedule a workflow, but workflow runs and step runs have their own durable rows and events. Steps run in dependency order and a scheduled workflow run is idempotent per loop slot.
128
134
 
135
+ For command steps, `command` is the executable when `shell` is not true. Put flags in `args`:
136
+
137
+ ```json
138
+ { "type": "command", "command": "git", "args": ["status", "--short"] }
139
+ ```
140
+
141
+ Use `shell: true` only when you intentionally want shell parsing:
142
+
143
+ ```json
144
+ { "type": "command", "command": "git status --short", "shell": true }
145
+ ```
146
+
129
147
  ## Manage
130
148
 
131
149
  ```bash
@@ -148,6 +166,7 @@ loops daemon start
148
166
  loops daemon status
149
167
  loops daemon logs
150
168
  loops daemon stop
169
+ loops doctor
151
170
  ```
152
171
 
153
172
  Run in the foreground for supervised environments:
@@ -160,9 +179,10 @@ Install startup integration:
160
179
 
161
180
  ```bash
162
181
  loops daemon install
182
+ loops daemon install --enable
163
183
  ```
164
184
 
165
- On Linux this writes a user systemd service. On macOS it writes a LaunchAgent plist. The command prints the exact enable/load commands to run.
185
+ On Linux this writes a user systemd service. On macOS it writes a LaunchAgent plist. The command prints the exact enable/load commands to run. `--enable` runs the user-service enable/start command when supported.
166
186
 
167
187
  ## Scheduling Contract
168
188
 
@@ -187,6 +207,6 @@ The adapters intentionally use provider command surfaces instead of pretending e
187
207
  - AI Copilot and OpenCode use `run --format json --pure`.
188
208
  - Cursor is CLI-first for now via `cursor-agent -p`; treat output as less stable until a stronger public SDK contract is selected.
189
209
  - Codex uses `codex exec --json --ephemeral --ask-for-approval never`.
190
- - When `--account` or a step `account` is set, OpenLoops resolves `accounts env <profile> --tool <tool>` before spawning the target, strips inherited tool home/API-key variables, and applies the selected profile only to that process.
210
+ - When `--account` or a step `account` is set, OpenLoops resolves `accounts env <profile> --tool <tool>` before spawning the target, strips inherited tool home/API-key variables, and applies the selected profile only to that process. Missing account profiles fail before the provider binary receives the prompt.
191
211
 
192
212
  For production loops that can mutate repos, prefer disposable worktrees and explicit prompts that name allowed write scope.