flowviant 0.103.0 → 0.104.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/cli.mjs +87 -474
- package/bin/lib/admission.mjs +19 -3
- package/bin/lib/agentPlan.mjs +2 -2
- package/bin/lib/agentTaskKinds.mjs +93 -0
- package/bin/lib/agySessions.mjs +158 -0
- package/bin/lib/artifactPolicy.mjs +44 -0
- package/bin/lib/artifactPreview.mjs +52 -0
- package/bin/lib/artifactReporter.mjs +163 -0
- package/bin/lib/artifacts.mjs +47 -227
- package/bin/lib/authReject.mjs +16 -4
- package/bin/lib/authproxy.mjs +47 -304
- package/bin/lib/boxIdentity.mjs +245 -0
- package/bin/lib/childEnv.mjs +11 -9
- package/bin/lib/claude.mjs +14 -851
- package/bin/lib/claudeAuth.mjs +3 -3
- package/bin/lib/claudePosture.mjs +367 -0
- package/bin/lib/claudeSessions.mjs +411 -0
- package/bin/lib/claudeStream.mjs +207 -0
- package/bin/lib/cliLimit.mjs +34 -0
- package/bin/lib/commandSpecs.mjs +173 -0
- package/bin/lib/config.mjs +11 -42
- package/bin/lib/credentialDate.mjs +22 -0
- package/bin/lib/credentials.mjs +21 -26
- package/bin/lib/daemonLogging.mjs +55 -0
- package/bin/lib/daemonState.mjs +64 -0
- package/bin/lib/deploy.mjs +148 -647
- package/bin/lib/deployCheckout.mjs +265 -0
- package/bin/lib/deployConfig.mjs +142 -0
- package/bin/lib/deployRunner.mjs +311 -0
- package/bin/lib/deployWire.mjs +41 -0
- package/bin/lib/desktopContract.mjs +56 -105
- package/bin/lib/env.mjs +49 -484
- package/bin/lib/fleet.mjs +183 -2383
- package/bin/lib/fleetJobs.mjs +120 -0
- package/bin/lib/fleetPost.mjs +40 -0
- package/bin/lib/fleetReports.mjs +392 -0
- package/bin/lib/fleetRoster.mjs +470 -0
- package/bin/lib/fleetStartup.mjs +196 -0
- package/bin/lib/fleetWake.mjs +45 -0
- package/bin/lib/fleetWire.mjs +46 -0
- package/bin/lib/git.mjs +2 -2
- package/bin/lib/gitMergeIdentity.mjs +51 -0
- package/bin/lib/grant.mjs +5 -3
- package/bin/lib/help.mjs +3 -125
- package/bin/lib/holder.mjs +482 -0
- package/bin/lib/instance.mjs +124 -46
- package/bin/lib/knowledge.mjs +16 -799
- package/bin/lib/knowledgeFetch.mjs +38 -0
- package/bin/lib/knowledgeFileSync.mjs +112 -0
- package/bin/lib/knowledgeFiles.mjs +487 -0
- package/bin/lib/knowledgeLibrary.mjs +249 -0
- package/bin/lib/landed.mjs +2 -1
- package/bin/lib/listeners.mjs +99 -141
- package/bin/lib/localSessions.mjs +30 -555
- package/bin/lib/login.mjs +3 -2
- package/bin/lib/loginPath.mjs +3 -5
- package/bin/lib/machineDisconnect.mjs +203 -0
- package/bin/lib/machineEnv.mjs +22 -0
- package/bin/lib/machineLimits.mjs +61 -0
- package/bin/lib/machineListing.mjs +338 -0
- package/bin/lib/machines.mjs +78 -455
- package/bin/lib/machinesCommand.mjs +214 -0
- package/bin/lib/mcp-cli.mjs +2 -1
- package/bin/lib/patchRevert.mjs +60 -0
- package/bin/lib/prWorkflow.mjs +157 -0
- package/bin/lib/preflight.mjs +2 -1
- package/bin/lib/pressurePolicy.mjs +104 -0
- package/bin/lib/preview.mjs +2 -272
- package/bin/lib/previewFramePolicy.mjs +112 -0
- package/bin/lib/previewGatePolicy.mjs +236 -0
- package/bin/lib/previewRegistry.mjs +235 -0
- package/bin/lib/printable.mjs +2 -2
- package/bin/lib/procRegistry.mjs +28 -18
- package/bin/lib/procScan.mjs +146 -0
- package/bin/lib/processes.mjs +29 -37
- package/bin/lib/projectToolRuntimes.mjs +138 -0
- package/bin/lib/projectTools.mjs +13 -88
- package/bin/lib/prompts.mjs +28 -42
- package/bin/lib/repoPath.mjs +26 -0
- package/bin/lib/resources.mjs +7 -69
- package/bin/lib/resumeLost.mjs +107 -0
- package/bin/lib/runTurn.mjs +324 -0
- package/bin/lib/runtimeAntigravity.mjs +230 -0
- package/bin/lib/runtimeCapabilities.mjs +334 -0
- package/bin/lib/runtimeClaude.mjs +126 -0
- package/bin/lib/runtimeCodex.mjs +217 -0
- package/bin/lib/runtimeDetection.mjs +121 -0
- package/bin/lib/runtimeEvents.mjs +482 -0
- package/bin/lib/runtimeOfferings.mjs +4 -1
- package/bin/lib/runtimes.mjs +42 -1402
- package/bin/lib/safeFileName.mjs +74 -0
- package/bin/lib/standDownExit.mjs +181 -0
- package/bin/lib/standDownGate.mjs +48 -0
- package/bin/lib/startProject.mjs +279 -0
- package/bin/lib/trace.mjs +3 -3
- package/bin/lib/turnLock.mjs +68 -0
- package/bin/lib/turnProfile.mjs +77 -0
- package/bin/lib/uninstall.mjs +55 -45
- package/bin/lib/uninstallCopies.mjs +112 -0
- package/bin/lib/update.mjs +30 -17
- package/bin/lib/uplinkScrub.mjs +265 -0
- package/bin/lib/vault.mjs +22 -151
- package/bin/lib/vaultDiff.mjs +183 -0
- package/bin/lib/versionOrder.mjs +42 -0
- package/bin/lib/views.mjs +17 -17
- package/bin/lib/wikiRunner.mjs +630 -0
- package/bin/lib/work.mjs +188 -3034
- package/bin/lib/workAdoptCarry.mjs +94 -0
- package/bin/lib/workAgentCheck.mjs +278 -0
- package/bin/lib/workAgentMerges.mjs +54 -142
- package/bin/lib/workAgentPlans.mjs +14 -12
- package/bin/lib/workAgentPrecheck.mjs +393 -0
- package/bin/lib/workAgentPublish.mjs +177 -0
- package/bin/lib/workAgentReview.mjs +8 -666
- package/bin/lib/workAgentTurnBegun.mjs +109 -0
- package/bin/lib/workAgentTurnExecution.mjs +604 -0
- package/bin/lib/workAgentTurnOutcome.mjs +207 -0
- package/bin/lib/workAgentTurnReports.mjs +189 -0
- package/bin/lib/workAgentTurns.mjs +91 -898
- package/bin/lib/workAttachments.mjs +93 -0
- package/bin/lib/workBrain.mjs +53 -0
- package/bin/lib/workChildren.mjs +110 -0
- package/bin/lib/workCommandAudit.mjs +62 -0
- package/bin/lib/workDiffs.mjs +2 -1
- package/bin/lib/workNarration.mjs +152 -0
- package/bin/lib/workPlaceReports.mjs +426 -0
- package/bin/lib/workPlaces.mjs +228 -0
- package/bin/lib/workPreviews.mjs +31 -9
- package/bin/lib/workProcesses.mjs +4 -5
- package/bin/lib/workPullRequests.mjs +52 -126
- package/bin/lib/workReportQueue.mjs +254 -0
- package/bin/lib/workRetire.mjs +185 -0
- package/bin/lib/workSessionGroups.mjs +166 -0
- package/bin/lib/workSessionRuntime.mjs +164 -0
- package/bin/lib/workSessionTokens.mjs +68 -0
- package/bin/lib/workSessionTurns.mjs +892 -0
- package/bin/lib/workShip.mjs +9 -29
- package/bin/lib/workToolLog.mjs +76 -0
- package/package.json +3 -2
- package/bin/lib/patch.mjs +0 -363
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VERSION ORDER — the one parser and comparator every version decision on this
|
|
3
|
+
* box uses: the takeover downgrade guard (instance.mjs), the self-update
|
|
4
|
+
* signals (update.mjs, fleet.mjs), the behind marks in the read-only views
|
|
5
|
+
* (views.mjs) and the newest nvm Node (loginPath.mjs).
|
|
6
|
+
*
|
|
7
|
+
* Split out (SOLID F005) because four hand-written rules disagreed on a
|
|
8
|
+
* version they could not read: one called it EQUAL, one called each
|
|
9
|
+
* unreadable part ZERO, one called it "not older", one never asked. A
|
|
10
|
+
* comparison now answers UNKNOWN (`null`) out loud, and each caller states its
|
|
11
|
+
* own policy for it. Every policy so far is the house one: unknown gates
|
|
12
|
+
* nothing (the takeover guard refuses only a measured downgrade).
|
|
13
|
+
*
|
|
14
|
+
* What parses: an optional leading `v`, one to three dot-separated decimal
|
|
15
|
+
* parts (a missing minor or patch reads as zero — `0.57` is `0.57.0`, the
|
|
16
|
+
* legacy shape the update tests pin), and an optional `-prerelease`/`+build`
|
|
17
|
+
* tail, which orders nothing (every rule this replaced ignored it too).
|
|
18
|
+
* Anything else — a letter inside a part, a fourth part, an empty string — is
|
|
19
|
+
* unknown.
|
|
20
|
+
*/
|
|
21
|
+
const VERSION_RE = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:[-+][0-9A-Za-z.+-]*)?$/;
|
|
22
|
+
|
|
23
|
+
/** `[major, minor, patch]`, or null when the text is not a version. */
|
|
24
|
+
export function parseVersion(v) {
|
|
25
|
+
if (typeof v !== 'string' && typeof v !== 'number') return null;
|
|
26
|
+
const m = VERSION_RE.exec(String(v).trim());
|
|
27
|
+
if (!m) return null;
|
|
28
|
+
const parts = [m[1], m[2] ?? '0', m[3] ?? '0'].map(Number);
|
|
29
|
+
return parts.every(Number.isSafeInteger) ? parts : null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** -1 | 0 | 1, or null (UNKNOWN) when either side does not parse. */
|
|
33
|
+
export function compareVersions(a, b) {
|
|
34
|
+
const x = parseVersion(a);
|
|
35
|
+
const y = parseVersion(b);
|
|
36
|
+
if (!x || !y) return null;
|
|
37
|
+
for (let i = 0; i < 3; i++) if (x[i] !== y[i]) return x[i] > y[i] ? 1 : -1;
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** True only when BOTH parse and `a` is strictly older. Unknown is not older. */
|
|
42
|
+
export const versionBelow = (a, b) => compareVersions(a, b) === -1;
|
package/bin/lib/views.mjs
CHANGED
|
@@ -11,22 +11,19 @@ import { execFileSync, spawn } from 'node:child_process';
|
|
|
11
11
|
import { closeSync, existsSync, openSync, readSync, statSync } from 'node:fs';
|
|
12
12
|
import { FLEET_URL, USER_AGENT, VERSION } from './config.mjs';
|
|
13
13
|
import { detectRepoRoot, listStoredProjects, projectLabel, resolveStoredCredential } from './credentials.mjs';
|
|
14
|
-
import {
|
|
14
|
+
import { desktopStatusRemote, installChannel } from './desktopContract.mjs';
|
|
15
|
+
import { daemonLogPath } from './daemonState.mjs';
|
|
15
16
|
import { daemonRunningFor } from './instance.mjs';
|
|
16
|
-
import { agoFrom } from './
|
|
17
|
-
import { detectRuntimes } from './
|
|
17
|
+
import { agoFrom } from './machineListing.mjs';
|
|
18
|
+
import { detectRuntimes } from './runtimeDetection.mjs';
|
|
18
19
|
import { c } from './ui.mjs';
|
|
20
|
+
import { versionBelow } from './versionOrder.mjs';
|
|
19
21
|
|
|
20
22
|
const APP_URL = process.env.FLOWVIANT_APP_URL || 'https://app.flowviant.com';
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const b = parse(latest);
|
|
26
|
-
if (!a || !b) return false;
|
|
27
|
-
for (let i = 0; i < 3; i++) if (a[i] !== b[i]) return a[i] < b[i];
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
24
|
+
// "Behind" in these views is versionBelow (versionOrder.mjs): an unreadable
|
|
25
|
+
// version is never marked older — a read-only view states nothing it cannot
|
|
26
|
+
// measure.
|
|
30
27
|
|
|
31
28
|
function agentLine(agent, now) {
|
|
32
29
|
if (agent.asks) return `${agent.name} · ${c.yellow('asks you a question')}`;
|
|
@@ -69,7 +66,7 @@ export function renderStatus(status, { now = Date.now() } = {}) {
|
|
|
69
66
|
if (rt.parkedByLimit && rt.message) lines.push(label('limit', `${rt.id} hit its limit: “${rt.message}”`));
|
|
70
67
|
}
|
|
71
68
|
const version = remote?.daemonVersion ?? status.version;
|
|
72
|
-
if (remote?.latest &&
|
|
69
|
+
if (remote?.latest && versionBelow(version, remote.latest)) {
|
|
73
70
|
lines.push(label('update', `flowviant ${remote.latest} is out; this computer runs ${version}. It updates itself when idle.`));
|
|
74
71
|
}
|
|
75
72
|
lines.push('');
|
|
@@ -200,17 +197,20 @@ export async function runDoctor({ cwd = process.cwd(), fetchImpl = fetch } = {})
|
|
|
200
197
|
// and a global npm install that needed sudo cannot update itself.
|
|
201
198
|
try {
|
|
202
199
|
const { buildUninstallPlan } = await import('./uninstall.mjs');
|
|
200
|
+
const { copyKind } = await import('./uninstallCopies.mjs');
|
|
203
201
|
const plan = await buildUninstallPlan();
|
|
204
|
-
|
|
202
|
+
// Copies a daemon can run from; an rc file's PATH line is not one.
|
|
203
|
+
const copies = plan.copies.filter((copy) => copyKind(copy.kind).runsFrom);
|
|
205
204
|
for (const copy of copies) {
|
|
206
|
-
const
|
|
205
|
+
const kind = copyKind(copy.kind);
|
|
206
|
+
const where = kind.label;
|
|
207
207
|
const running = copy.runningPid ? `, a daemon runs from it (pid ${copy.runningPid})` : '';
|
|
208
|
-
const older = copy.version &&
|
|
208
|
+
const older = copy.version && versionBelow(copy.version, VERSION);
|
|
209
209
|
const text = `flowviant ${copy.version ?? '(unknown version)'} · ${where} · ${copy.path}${copy.current ? ' (this one)' : ''}${running}`;
|
|
210
210
|
if (older && copy.runningPid) {
|
|
211
|
-
add(false, text, `An older daemon is serving. Run \`flowviant stop\`, then \`flowviant uninstall --others\`${
|
|
211
|
+
add(false, text, `An older daemon is serving. Run \`flowviant stop\`, then \`flowviant uninstall --others\`${kind.removeHint}, then start flowviant again.`);
|
|
212
212
|
} else if (older) {
|
|
213
|
-
add(false, text, `An older copy. Remove it with \`flowviant uninstall --others\`${
|
|
213
|
+
add(false, text, `An older copy. Remove it with \`flowviant uninstall --others\`${kind.removeHint}.`);
|
|
214
214
|
} else {
|
|
215
215
|
add(true, text);
|
|
216
216
|
}
|