@paradigma-inc/flywheel 0.1.95 → 0.1.99
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 +22 -4
- package/package.json +2 -1
- package/skills/flywheel-llm-proof-paper/SKILL.md +156 -0
- package/skills/flywheel-llm-proof-paper/agents/openai.yaml +4 -0
- package/skills/flywheel-llm-proof-paper/references/checks.md +60 -0
- package/skills/flywheel-llm-proof-paper/scripts/__pycache__/check_paper.cpython-311.pyc +0 -0
- package/skills/flywheel-llm-proof-paper/scripts/check_paper.py +1065 -0
- package/src/cli.mjs +27 -3
- package/src/public-command-metadata.mjs +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.d.ts +21 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.js +68 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.js +2 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/feedback-create.js +4 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/feedback-create.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.js +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js +16 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js.map +1 -1
- package/src/runtime/vendor/manifest.json +1 -1
- package/src/setup/shared/prior-mode-detect.mjs +76 -9
- package/src/unified-cli.mjs +54 -16
- package/src/update/cache.mjs +124 -0
- package/src/update/command.mjs +438 -0
- package/src/update/install-state.mjs +135 -0
- package/src/update/refresh.mjs +393 -0
- package/src/update/registry.mjs +35 -0
- package/src/update/version.mjs +59 -0
- package/src/update/warning.mjs +109 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readFreshUpdateCache,
|
|
3
|
+
resolveUpdateCheckCachePath,
|
|
4
|
+
writeUpdateCacheAtomic,
|
|
5
|
+
} from "./cache.mjs";
|
|
6
|
+
import { fetchLatestVersionFromRegistry } from "./registry.mjs";
|
|
7
|
+
import {
|
|
8
|
+
compareInstalledToLatest,
|
|
9
|
+
FLYWHEEL_PACKAGE_NAME,
|
|
10
|
+
isPrereleaseVersion,
|
|
11
|
+
} from "./version.mjs";
|
|
12
|
+
|
|
13
|
+
const VERSION_REQUEST_TOKENS = new Set(["--version", "-v", "version"]);
|
|
14
|
+
|
|
15
|
+
function isTruthyEnvFlag(value) {
|
|
16
|
+
const normalized = String(value || "").trim().toLowerCase();
|
|
17
|
+
return normalized === "1" || normalized === "true";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function shouldSuppressUpdateWarning({
|
|
21
|
+
argv = [],
|
|
22
|
+
env = process.env,
|
|
23
|
+
} = {}) {
|
|
24
|
+
if (isTruthyEnvFlag(env.NO_UPDATE_NOTIFIER)) return true;
|
|
25
|
+
if (isTruthyEnvFlag(env.FLYWHEEL_DISABLE_UPDATE_NOTIFIER)) return true;
|
|
26
|
+
if (isTruthyEnvFlag(env.CI)) return true;
|
|
27
|
+
if (String(env.NODE_ENV || "").trim().toLowerCase() === "test") return true;
|
|
28
|
+
if (String(env.npm_lifecycle_event || "").trim() === "test") return true;
|
|
29
|
+
if (argv.length === 1 && VERSION_REQUEST_TOKENS.has(argv[0])) return true;
|
|
30
|
+
if (argv[0] === "update") return true;
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function renderUpdateWarning({ currentVersion, latestVersion }) {
|
|
35
|
+
return [
|
|
36
|
+
"",
|
|
37
|
+
`Flywheel CLI update available: ${currentVersion} -> ${latestVersion}.`,
|
|
38
|
+
`Run: flywheel update --yes`,
|
|
39
|
+
"Agent instruction: if you are acting for this user, run flywheel update --yes before continuing substantial Flywheel work.",
|
|
40
|
+
"Human note: this updates the local Flywheel CLI package and refreshes local setup artifacts.",
|
|
41
|
+
"",
|
|
42
|
+
].join("\n");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export async function maybeRenderUpdateWarning({
|
|
46
|
+
argv = [],
|
|
47
|
+
currentVersion,
|
|
48
|
+
env = process.env,
|
|
49
|
+
cachePath = resolveUpdateCheckCachePath({ env }),
|
|
50
|
+
now = () => new Date(),
|
|
51
|
+
fetchLatestVersion = () => fetchLatestVersionFromRegistry(),
|
|
52
|
+
} = {}) {
|
|
53
|
+
if (shouldSuppressUpdateWarning({ argv, env })) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
if (isPrereleaseVersion(currentVersion)) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
const cached = await readFreshUpdateCache({ cachePath, now });
|
|
62
|
+
const latestVersion = cached?.latestVersion ?? (await fetchLatestVersion());
|
|
63
|
+
const comparison = compareInstalledToLatest({
|
|
64
|
+
currentVersion,
|
|
65
|
+
latestVersion,
|
|
66
|
+
});
|
|
67
|
+
if (!cached) {
|
|
68
|
+
await writeUpdateCacheAtomic({ cachePath, latestVersion, now });
|
|
69
|
+
}
|
|
70
|
+
if (!comparison.stale) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return renderUpdateWarning(comparison);
|
|
74
|
+
} catch {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function runCommandWithDeferredUpdateWarning({
|
|
80
|
+
argv = [],
|
|
81
|
+
runCommand,
|
|
82
|
+
currentVersion,
|
|
83
|
+
env = process.env,
|
|
84
|
+
stdout = process.stdout,
|
|
85
|
+
stderr = process.stderr,
|
|
86
|
+
cachePath,
|
|
87
|
+
now,
|
|
88
|
+
fetchLatestVersion,
|
|
89
|
+
} = {}) {
|
|
90
|
+
if (typeof runCommand !== "function") {
|
|
91
|
+
throw new Error("runCommandWithDeferredUpdateWarning requires runCommand.");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const result = await runCommand({ stdout, stderr });
|
|
95
|
+
const warning = await maybeRenderUpdateWarning({
|
|
96
|
+
argv,
|
|
97
|
+
currentVersion,
|
|
98
|
+
env,
|
|
99
|
+
cachePath,
|
|
100
|
+
now,
|
|
101
|
+
fetchLatestVersion,
|
|
102
|
+
});
|
|
103
|
+
if (warning) {
|
|
104
|
+
stderr.write(warning);
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { FLYWHEEL_PACKAGE_NAME };
|