@hasna/loops 0.3.5 → 0.3.7
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 +60 -0
- package/dist/cli/index.js +1054 -22
- package/dist/daemon/index.js +974 -19
- package/dist/index.d.ts +3 -0
- package/dist/index.js +985 -18
- package/dist/lib/executor.d.ts +3 -0
- package/dist/lib/format.d.ts +3 -1
- package/dist/lib/goal/model-factory.d.ts +9 -0
- package/dist/lib/goal/prompts.d.ts +4 -0
- package/dist/lib/goal/runner.d.ts +3 -0
- package/dist/lib/goal/status.d.ts +9 -0
- package/dist/lib/goal/types.d.ts +120 -0
- package/dist/lib/store.d.ts +58 -1
- package/dist/lib/store.js +544 -5
- package/dist/lib/workflow-spec.d.ts +2 -1
- package/dist/sdk/index.d.ts +6 -1
- package/dist/sdk/index.js +981 -18
- package/dist/types.d.ts +10 -0
- package/docs/TRANSCRIPT_LOOP_PATTERNS.md +95 -0
- package/docs/USAGE.md +17 -0
- package/docs/workflows/transcript-feedback-to-loops.json +80 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -24,8 +24,13 @@ Update:
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npm update -g @hasna/loops
|
|
27
|
+
loops daemon stop
|
|
28
|
+
loops daemon start
|
|
29
|
+
loops daemon status
|
|
27
30
|
```
|
|
28
31
|
|
|
32
|
+
Restart the daemon on every machine that runs scheduled loops; already-running daemon processes keep using the old package until restarted.
|
|
33
|
+
|
|
29
34
|
From source:
|
|
30
35
|
|
|
31
36
|
```bash
|
|
@@ -94,6 +99,49 @@ accounts tools add codewith --label "Codewith" --env-var CODEWITH_HOME --bin cod
|
|
|
94
99
|
accounts tools add aicopilot --label "AI Copilot" --env-var AICOPILOT_CONFIG_DIR --bin aicopilot
|
|
95
100
|
```
|
|
96
101
|
|
|
102
|
+
## Goals
|
|
103
|
+
|
|
104
|
+
Add `--goal` to wrap a command, agent, or workflow loop in an AI-SDK orchestration layer. OpenLoops asks the configured model to create a flat DAG plan, executes ready nodes by calling the underlying target, then runs an adversarial achievement audit before marking the goal complete.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
export OPENROUTER_API_KEY=...
|
|
108
|
+
|
|
109
|
+
loops create agent repo-fixer \
|
|
110
|
+
--provider codex \
|
|
111
|
+
--at "$(date -u -d '+1 minute' +%Y-%m-%dT%H:%M:%SZ)" \
|
|
112
|
+
--cwd /path/to/repo \
|
|
113
|
+
--prompt "Work only on the requested repository task." \
|
|
114
|
+
--goal "Fix the failing lint check and prove it with a passing lint run." \
|
|
115
|
+
--goal-budget 2000 \
|
|
116
|
+
--goal-model openai/gpt-4o-mini \
|
|
117
|
+
--goal-max-turns 5
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Goal planning and validation use the Vercel AI SDK with `@openrouter/ai-sdk-provider`. Set `OPENROUTER_API_KEY`; optionally set `LOOPS_GOAL_BASE_URL` to point at a local gateway compatible with OpenRouter. Goal context is passed to wrapped commands and agents as `LOOPS_GOAL_ID`, `LOOPS_GOAL_OBJECTIVE`, and `LOOPS_GOAL_NODE_KEY`.
|
|
121
|
+
|
|
122
|
+
Inspect configured and runtime goal state:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
loops goal show <loop-or-goal-id>
|
|
126
|
+
loops goal status <goal-run-id-or-loop-run-id>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Workflow JSON can also embed goals at the workflow or step level:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"name": "goal-workflow",
|
|
134
|
+
"goal": { "objective": "Complete the workflow and verify the evidence.", "maxTurns": 3 },
|
|
135
|
+
"steps": [
|
|
136
|
+
{
|
|
137
|
+
"id": "fix",
|
|
138
|
+
"goal": { "objective": "Finish this step and prove it with output evidence." },
|
|
139
|
+
"target": { "type": "command", "command": "bun test", "shell": true }
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
97
145
|
## Workflows
|
|
98
146
|
|
|
99
147
|
Create a workflow JSON file:
|
|
@@ -155,6 +203,18 @@ Use `shell: true` only when you intentionally want shell parsing:
|
|
|
155
203
|
{ "type": "command", "command": "git status --short", "shell": true }
|
|
156
204
|
```
|
|
157
205
|
|
|
206
|
+
## Transcript-Driven Loops
|
|
207
|
+
|
|
208
|
+
OpenLoops can turn long-form media or meeting transcripts into recurring workflow work when paired with `iapp-transcriber`. The template at `docs/workflows/transcript-feedback-to-loops.json` transcribes an authorized media URL, asks an agent to extract recurring loop candidates, authors workflow specs, and validates generated workflows before scheduling. Copy it into the target repo, replace `/path/to/repo` with that repo's absolute path, and provide `TRANSCRIBER_SOURCE_URL` through the runner environment or a private, uncommitted workflow copy before storing or scheduling it. Do not commit private or signed media URLs.
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
loops workflows validate /path/to/repo/.openloops/transcript-feedback-to-loops.json --preflight
|
|
212
|
+
loops workflows create /path/to/repo/.openloops/transcript-feedback-to-loops.json
|
|
213
|
+
loops workflows run transcript-feedback-to-loops --show-output
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
See `docs/TRANSCRIPT_LOOP_PATTERNS.md` for transcript-to-loop guardrails and example schedules for review, maintenance, CI optimization, feedback triage, and knowledge-capture loops.
|
|
217
|
+
|
|
158
218
|
## Manage
|
|
159
219
|
|
|
160
220
|
```bash
|