@hasna/loops 0.1.0 → 0.2.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
@@ -1,14 +1,15 @@
1
1
  # OpenLoops
2
2
 
3
- OpenLoops is a local CLI and daemon for persistent loops: scheduled or recurring work that survives process restarts and records every run.
3
+ OpenLoops is a local CLI and daemon for persistent loops and workflows: scheduled or recurring work that survives process restarts and records every run.
4
4
 
5
- It supports deterministic command loops today and guarded CLI adapters for headless coding agents:
5
+ It supports deterministic command loops, JSON-defined workflows, and guarded CLI adapters for headless coding agents:
6
6
 
7
7
  - `claude`
8
8
  - `cursor-agent`
9
9
  - `codewith exec`
10
10
  - `aicopilot run`
11
11
  - `opencode run`
12
+ - `codex exec`
12
13
 
13
14
  ## Install
14
15
 
@@ -53,6 +54,18 @@ loops create agent morning-check \
53
54
  --prompt "Check whether this repo is healthy and summarize required action."
54
55
  ```
55
56
 
57
+ Run a Claude loop with an isolated OpenAccounts profile:
58
+
59
+ ```bash
60
+ loops create agent morning-check \
61
+ --provider claude \
62
+ --account work \
63
+ --account-tool claude \
64
+ --cron "0 8 * * *" \
65
+ --cwd /path/to/repo \
66
+ --prompt "Check whether this repo is healthy and summarize required action."
67
+ ```
68
+
56
69
  Run a Codewith loop every 15 minutes:
57
70
 
58
71
  ```bash
@@ -63,6 +76,56 @@ loops create agent supply-chain-watch \
63
76
  --prompt "Check for suspicious dependency or supply-chain changes. Report only concrete findings."
64
77
  ```
65
78
 
79
+ For `codewith` and `aicopilot` account isolation, register matching OpenAccounts tools first if they are not built in on the machine:
80
+
81
+ ```bash
82
+ accounts tools add codewith --label "Codewith" --env-var CODEWITH_HOME --bin codewith
83
+ accounts tools add aicopilot --label "AI Copilot" --env-var AICOPILOT_CONFIG_DIR --bin aicopilot
84
+ ```
85
+
86
+ ## Workflows
87
+
88
+ Create a workflow JSON file:
89
+
90
+ ```json
91
+ {
92
+ "name": "repo-morning",
93
+ "steps": [
94
+ {
95
+ "id": "status",
96
+ "target": {
97
+ "type": "command",
98
+ "command": "git status --short",
99
+ "cwd": "/path/to/repo"
100
+ }
101
+ },
102
+ {
103
+ "id": "review",
104
+ "dependsOn": ["status"],
105
+ "target": {
106
+ "type": "agent",
107
+ "provider": "codex",
108
+ "account": { "profile": "work", "tool": "codex" },
109
+ "cwd": "/path/to/repo",
110
+ "prompt": "Review the repository status and summarize concrete next actions."
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ ```
116
+
117
+ Save, run, inspect, and schedule it:
118
+
119
+ ```bash
120
+ loops workflows create repo-morning.json
121
+ loops workflows run repo-morning --show-output
122
+ loops workflows runs repo-morning
123
+ loops workflows events <workflow-run-id>
124
+ loops create workflow repo-morning-loop --workflow repo-morning --cron "0 8 * * *"
125
+ ```
126
+
127
+ 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
+
66
129
  ## Manage
67
130
 
68
131
  ```bash
@@ -123,5 +186,7 @@ The adapters intentionally use provider command surfaces instead of pretending e
123
186
  - Codewith uses `codewith exec --json --ephemeral --ask-for-approval never`.
124
187
  - AI Copilot and OpenCode use `run --format json --pure`.
125
188
  - Cursor is CLI-first for now via `cursor-agent -p`; treat output as less stable until a stronger public SDK contract is selected.
189
+ - 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.
126
191
 
127
192
  For production loops that can mutate repos, prefer disposable worktrees and explicit prompts that name allowed write scope.