@tiens.nguyen/gu-cli 1.0.686

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.
Files changed (43) hide show
  1. package/README.md +52 -0
  2. package/agent-model-command.mjs +259 -0
  3. package/agent-model-label.mjs +159 -0
  4. package/clear-state.mjs +149 -0
  5. package/client-expert-api.mjs +736 -0
  6. package/client-expert-run.mjs +892 -0
  7. package/client-expert-setup.mjs +616 -0
  8. package/coding-choice-tags.mjs +69 -0
  9. package/coding-key-prompt.mjs +229 -0
  10. package/coding-provider-setup.mjs +808 -0
  11. package/completed-flush.mjs +105 -0
  12. package/daemon-control.mjs +462 -0
  13. package/device-login.mjs +212 -0
  14. package/doctor-check.mjs +239 -0
  15. package/embed-model-command.mjs +157 -0
  16. package/first-run-steps.mjs +171 -0
  17. package/gonext_agent_chat.py +12299 -0
  18. package/gonext_mlx_embed.py +155 -0
  19. package/gonext_probe_agent.py +93 -0
  20. package/gonext_transcribe.py +130 -0
  21. package/gu-cli.mjs +4930 -0
  22. package/gu-repl.mjs +10326 -0
  23. package/job-pools.mjs +89 -0
  24. package/model-doctor.mjs +1494 -0
  25. package/node-version.mjs +40 -0
  26. package/ollama-setup.mjs +832 -0
  27. package/package.json +100 -0
  28. package/platform-tools.mjs +520 -0
  29. package/poll-errors.mjs +141 -0
  30. package/proxy-command.mjs +165 -0
  31. package/proxy-config.mjs +255 -0
  32. package/proxy-dispatcher.mjs +132 -0
  33. package/proxy-selftest.mjs +234 -0
  34. package/proxy-store.mjs +69 -0
  35. package/rag-job-config.mjs +59 -0
  36. package/rag-selftest.mjs +215 -0
  37. package/s3-setup.mjs +85 -0
  38. package/terminal-copy.mjs +248 -0
  39. package/terminal-hover.mjs +153 -0
  40. package/terminal-layout.mjs +2507 -0
  41. package/terminal-viewport.mjs +602 -0
  42. package/thinking_words.txt +1003 -0
  43. package/version-check.mjs +72 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Refuse an unsupported Node version with a sentence someone can act on.
3
+ *
4
+ * package.json declares `engines: >=18`, but npm only WARNS about that and installs anyway —
5
+ * so the first sign of trouble is whatever happens to break first. Reported live on Node
6
+ * v16.13.1: the install "succeeded", then `gu` died on a module-resolution error that
7
+ * said nothing about Node at all.
8
+ *
9
+ * What actually needs 18: global `fetch` (18.0) and `AbortSignal.timeout()` (17.3). Both are
10
+ * used on the setup path, so the failure lands during a first run — the worst possible moment,
11
+ * on a machine the user has just started trusting.
12
+ *
13
+ * Checked at the TOP of both entry points, before any import that might itself fail.
14
+ */
15
+ export const MIN_NODE_MAJOR = 18;
16
+
17
+ /** The message for a too-old runtime, or "" when this one is fine. Pure, so it is testable. */
18
+ export function nodeVersionProblem(version = process.version) {
19
+ const major = Number.parseInt(String(version).replace(/^v/, "").split(".")[0], 10);
20
+ if (!Number.isFinite(major) || major >= MIN_NODE_MAJOR) return "";
21
+ return (
22
+ `gu needs Node ${MIN_NODE_MAJOR} or newer — this is ${version}.\n` +
23
+ ` Node ${major} has no global fetch, which the setup and update paths rely on.\n` +
24
+ "\n" +
25
+ " With nvm: nvm install --lts && nvm alias default lts/*\n" +
26
+ " With brew: brew install node\n" +
27
+ " Debian/Ubuntu: curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt install -y nodejs\n" +
28
+ "\n" +
29
+ " Then reinstall: npm i -g @tiens.nguyen/gu-cli"
30
+ );
31
+ }
32
+
33
+ /** Print the problem and exit, or return quietly. */
34
+ export function requireSupportedNode() {
35
+ const problem = nodeVersionProblem();
36
+ if (!problem) return;
37
+ // console.error, not the REPL's own writer: this runs before any of that exists.
38
+ console.error("\n" + problem + "\n");
39
+ process.exit(1);
40
+ }