@hasna/loops 0.3.5 → 0.3.6
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 +43 -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/package.json +5 -2
package/README.md
CHANGED
|
@@ -94,6 +94,49 @@ accounts tools add codewith --label "Codewith" --env-var CODEWITH_HOME --bin cod
|
|
|
94
94
|
accounts tools add aicopilot --label "AI Copilot" --env-var AICOPILOT_CONFIG_DIR --bin aicopilot
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
## Goals
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
export OPENROUTER_API_KEY=...
|
|
103
|
+
|
|
104
|
+
loops create agent repo-fixer \
|
|
105
|
+
--provider codex \
|
|
106
|
+
--at "$(date -u -d '+1 minute' +%Y-%m-%dT%H:%M:%SZ)" \
|
|
107
|
+
--cwd /path/to/repo \
|
|
108
|
+
--prompt "Work only on the requested repository task." \
|
|
109
|
+
--goal "Fix the failing lint check and prove it with a passing lint run." \
|
|
110
|
+
--goal-budget 2000 \
|
|
111
|
+
--goal-model openai/gpt-4o-mini \
|
|
112
|
+
--goal-max-turns 5
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
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`.
|
|
116
|
+
|
|
117
|
+
Inspect configured and runtime goal state:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
loops goal show <loop-or-goal-id>
|
|
121
|
+
loops goal status <goal-run-id-or-loop-run-id>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Workflow JSON can also embed goals at the workflow or step level:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"name": "goal-workflow",
|
|
129
|
+
"goal": { "objective": "Complete the workflow and verify the evidence.", "maxTurns": 3 },
|
|
130
|
+
"steps": [
|
|
131
|
+
{
|
|
132
|
+
"id": "fix",
|
|
133
|
+
"goal": { "objective": "Finish this step and prove it with output evidence." },
|
|
134
|
+
"target": { "type": "command", "command": "bun test", "shell": true }
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
97
140
|
## Workflows
|
|
98
141
|
|
|
99
142
|
Create a workflow JSON file:
|