@nbardy/oompa 0.7.1 → 0.7.2

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
@@ -104,6 +104,7 @@ This spawns:
104
104
  | `iterations` | no | Max iterations per worker (default: 10) |
105
105
  | `count` | no | Number of workers with this config (default: 1) |
106
106
  | `can_plan` | no | If `false`, worker waits for tasks before starting (default: `true`) |
107
+ | `max_wait_for_tasks` | no | Max seconds a `can_plan: false` worker waits for queue work (default: `600`) |
107
108
 
108
109
  #### Composable prompts
109
110
 
@@ -191,7 +192,10 @@ cd oompa
191
192
  echo "Build a simple todo API with CRUD endpoints" > spec.md
192
193
 
193
194
  # Run the swarm
194
- ./swarm.bb swarm
195
+ ./swarm.bb run
196
+
197
+ # Run detached with startup validation (fails fast if startup fails)
198
+ ./swarm.bb run --detach --config oompa.json
195
199
  ```
196
200
 
197
201
  ## Install (npm)
@@ -212,7 +216,12 @@ oompa swarm
212
216
  ## Commands
213
217
 
214
218
  ```bash
215
- oompa swarm [file] # Run from oompa.json (default)
219
+ oompa run [file] # Run from config (defaults: oompa.json, oompa/oompa.json)
220
+ oompa run --detach --config oompa.json
221
+ oompa swarm [file] # Direct swarm command (foreground)
222
+ oompa list # List 20 most recent swarms
223
+ oompa list --all # Full swarm history
224
+ oompa view [swarm-id] # Per-worker runtime status (default: latest swarm)
216
225
  oompa tasks # Show task status
217
226
  oompa check # Check available backends
218
227
  oompa cleanup # Remove worktrees
@@ -88,16 +88,39 @@
88
88
  attach (into ["--attach" attach])
89
89
  true (conj prompt))))
90
90
 
91
- (defmethod build-command :gemini
92
- [_ {:keys [model]} prompt cwd]
93
- (cond-> ["gemini" "--yolo"]
91
+ (defn- gemini-cmd
92
+ [agent-type model prompt]
93
+ (cond-> [(name agent-type) "--yolo"]
94
94
  model (into ["-m" model])
95
95
  true (into ["-p" prompt])))
96
96
 
97
+ (defn- gemini-alias?
98
+ [agent-type]
99
+ (and (keyword? agent-type)
100
+ (re-matches #"^gemini\\d+$" (name agent-type))))
101
+
102
+ (defmethod build-command :gemini
103
+ [_ {:keys [model]} prompt cwd]
104
+ (gemini-cmd :gemini model prompt))
105
+
106
+ (defmethod build-command :gemini1
107
+ [agent-type {:keys [model]} prompt cwd]
108
+ (gemini-cmd agent-type model prompt))
109
+
110
+ (defmethod build-command :gemini2
111
+ [agent-type {:keys [model]} prompt cwd]
112
+ (gemini-cmd agent-type model prompt))
113
+
114
+ (defmethod build-command :gemini3
115
+ [agent-type {:keys [model]} prompt cwd]
116
+ (gemini-cmd agent-type model prompt))
117
+
97
118
  (defmethod build-command :default
98
- [agent-type _ _ _]
99
- (throw (ex-info (str "Unknown agent type: " agent-type)
100
- {:agent-type agent-type})))
119
+ [agent-type {:keys [model]} prompt _]
120
+ (if (gemini-alias? agent-type)
121
+ (gemini-cmd agent-type model prompt)
122
+ (throw (ex-info (str "Unknown agent type: " agent-type)
123
+ {:agent-type agent-type}))))
101
124
 
102
125
  ;; =============================================================================
103
126
  ;; Process Execution
@@ -396,12 +419,13 @@
396
419
  (defn check-available
397
420
  "Check if agent backend is available"
398
421
  [agent-type]
399
- (let [cmd (case agent-type
400
- :codex ["codex" "--version"]
401
- :claude ["claude" "--version"]
402
- :opencode ["opencode" "--version"]
403
- :gemini ["gemini" "--version"]
404
- ["echo" "unknown"])]
422
+ (let [cmd (cond
423
+ (= :codex agent-type) ["codex" "--version"]
424
+ (= :claude agent-type) ["claude" "--version"]
425
+ (= :opencode agent-type) ["opencode" "--version"]
426
+ (= :gemini agent-type) ["gemini" "--version"]
427
+ (gemini-alias? agent-type) [(name agent-type) "--version"]
428
+ :else ["echo" "unknown"])]
405
429
  (try
406
430
  (let [{:keys [exit]} (process/sh cmd {:out :string :err :string})]
407
431
  (zero? exit))