flowviant 0.115.0 → 0.116.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/bin/lib/workAgentPlans.mjs +33 -11
- package/package.json +1 -1
|
@@ -8,8 +8,9 @@ import { c, note } from './ui.mjs';
|
|
|
8
8
|
import { runTurn as defaultRunTurn } from './runTurn.mjs';
|
|
9
9
|
import { SYSTEM_PLAN, AGENT_PLAN_KICKOFF } from './prompts.mjs';
|
|
10
10
|
import { scrub as envScrub } from './uplinkScrub.mjs';
|
|
11
|
-
import { RUNTIMES } from './runtimes.mjs';
|
|
12
|
-
import { pickRuntimeFor as defaultPickRuntimeFor } from './runtimeDetection.mjs';
|
|
11
|
+
import { RUNTIMES, canRun } from './runtimes.mjs';
|
|
12
|
+
import { detectRuntimes as defaultDetectRuntimes, pickRuntimeFor as defaultPickRuntimeFor } from './runtimeDetection.mjs';
|
|
13
|
+
import { brainFor } from './workBrain.mjs';
|
|
13
14
|
import { removeProbeTranscript } from './runtimeCapabilities.mjs';
|
|
14
15
|
import { fleetEndpoint } from './fleetWire.mjs';
|
|
15
16
|
import { REPO_PLACE } from './workPlaces.mjs';
|
|
@@ -24,10 +25,11 @@ export function createWorkAgentPlans({
|
|
|
24
25
|
admit,
|
|
25
26
|
placeLocks,
|
|
26
27
|
workChildren,
|
|
27
|
-
// The real CLI driver and picker; injectable
|
|
28
|
+
// The real CLI driver, detector and picker; injectable so the lane can be driven
|
|
28
29
|
// in a test without spending a model turn (the wiki runner's shape).
|
|
29
30
|
runTurn = defaultRunTurn,
|
|
30
31
|
pickRuntimeFor = defaultPickRuntimeFor,
|
|
32
|
+
detectRuntimes = defaultDetectRuntimes,
|
|
31
33
|
}) {
|
|
32
34
|
const AGENT_PLAN_DONE_URL = fleetEndpoint('agent-plan-done', FLEET_URL);
|
|
33
35
|
const AGENT_PLAN_ACTIVITY_URL = fleetEndpoint('agent-plan-activity', FLEET_URL);
|
|
@@ -224,15 +226,34 @@ export function createWorkAgentPlans({
|
|
|
224
226
|
}
|
|
225
227
|
|
|
226
228
|
/**
|
|
227
|
-
* WHICH CLI PLANS.
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* which hold a conversation across many turns and whose value is that held
|
|
233
|
-
* context. A planner runs once and reads; it takes what the machine has.
|
|
229
|
+
* WHICH CLI PLANS. The person's pick comes first; a named CLI must be
|
|
230
|
+
* installed and able to run the read-only profile, or the press says why.
|
|
231
|
+
* A model or effort pin without a named CLI is a Claude pick. With no pick
|
|
232
|
+
* or pin, `pickRuntimeFor('consult')` is the fallback — Claude when it is
|
|
233
|
+
* here, otherwise whatever can express the profile.
|
|
234
234
|
*/
|
|
235
|
-
|
|
235
|
+
let rt;
|
|
236
|
+
const pickedRuntime = typeof job.runtime === 'string' && job.runtime.length > 0
|
|
237
|
+
? job.runtime
|
|
238
|
+
: job.model != null || job.effort != null ? 'claude' : null;
|
|
239
|
+
if (pickedRuntime) {
|
|
240
|
+
rt = pickedRuntime;
|
|
241
|
+
if (!Object.hasOwn(RUNTIMES, rt)) {
|
|
242
|
+
await postAgentPlan({ id, error: `${rt} is not a CLI this machine knows` });
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const label = RUNTIMES[rt].label;
|
|
246
|
+
if (!detectRuntimes().find((r) => r.id === rt)?.installed) {
|
|
247
|
+
await postAgentPlan({ id, error: `${label} is not installed on this machine` });
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (!canRun(RUNTIMES[rt], 'consult')) {
|
|
251
|
+
await postAgentPlan({ id, error: `${label} can't run a read-only turn on this machine` });
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
} else {
|
|
255
|
+
rt = pickRuntimeFor('consult');
|
|
256
|
+
}
|
|
236
257
|
if (!rt) {
|
|
237
258
|
await postAgentPlan({ id, error: 'no CLI on this machine can run a read-only turn' });
|
|
238
259
|
return;
|
|
@@ -342,6 +363,7 @@ export function createWorkAgentPlans({
|
|
|
342
363
|
profile: 'consult',
|
|
343
364
|
cwd: repoRoot,
|
|
344
365
|
runtime: rt,
|
|
366
|
+
...brainFor(job, rt),
|
|
345
367
|
streamJson: true,
|
|
346
368
|
answerFromResult: true,
|
|
347
369
|
label: c.cyan('[plan]'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowviant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.0",
|
|
4
4
|
"description": "Run your own coding CLIs as build agents for Flowviant — Claude Code, Codex or Antigravity, on your own credentials. Holds your sessions, keeps a worktree per tab, and ships branches on your word.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|