@model-go/cli 0.1.1 → 0.1.2-rc.1

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/checksums.txt CHANGED
@@ -1,6 +1,6 @@
1
- 769fac4456815aeabc8517827df7d174b650e2d6d127eb7805aec3477179cd23 modelgo-cli-0.1.1-darwin-amd64.tar.gz
2
- 5720ad47e70b7ad5a99688f47c7c345ee8a3e6306fbea7510276398011815801 modelgo-cli-0.1.1-darwin-arm64.tar.gz
3
- f4f46f11be9a485e8e12e26bb1c8f9b67c02d67466b46c96be32a4557c951ca4 modelgo-cli-0.1.1-linux-amd64.tar.gz
4
- 7482afffe11cf8bf3c8798d77166ce5a6c0b79acdd53c030712b9b4fc69a0521 modelgo-cli-0.1.1-linux-arm64.tar.gz
5
- c86b6da335e95354b0cfe2b8bc11cd4b2fbeff5a32231c9fdef0a55440659bf1 modelgo-cli-0.1.1-windows-amd64.zip
6
- 1f101449e834ff876ccc418d246e8b06b2a21031904d8c638066e0d6e1c52eb2 modelgo-cli-0.1.1-windows-arm64.zip
1
+ 915ed381929af9346da75a8cd05cc2e07e2dffad87a2611273e62950888d3a13 modelgo-cli-0.1.2-rc.1-darwin-amd64.tar.gz
2
+ db43edac818eba5d1275c47e7a8cf6bce87d46565a54fc9db276bce92b861051 modelgo-cli-0.1.2-rc.1-darwin-arm64.tar.gz
3
+ fbc7e92c959f5d62ced3940481afbd444655f91129acbb7bc6ff5f8d9a200729 modelgo-cli-0.1.2-rc.1-linux-amd64.tar.gz
4
+ d9fb3ccf896bb4b493b3af2a095d9406c54809d01b97734929135ae6347c07ec modelgo-cli-0.1.2-rc.1-linux-arm64.tar.gz
5
+ 0cc9d8681d4be1718641ae1dfb609c4e967aa741150cff9a5b598c7a962931e2 modelgo-cli-0.1.2-rc.1-windows-amd64.zip
6
+ 608930e7904701a794f3350ca594fbc992b35eaee619c25e6c082172c05c69ac modelgo-cli-0.1.2-rc.1-windows-arm64.zip
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@model-go/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-rc.1",
4
4
  "description": "The official CLI for modelgo. Pairs with AI agent skills so AI agents can operate modelgo on your behalf.",
5
5
  "bin": {
6
6
  "modelgo-cli": "scripts/run.js"
@@ -7,6 +7,11 @@ const p = require("@clack/prompts");
7
7
  const { semverLessThan } = require("./install.js");
8
8
 
9
9
  const PKG = "@model-go/cli";
10
+ // PKG_VERSION is the version of the wizard CURRENTLY EXECUTING. The wizard
11
+ // pins step1's `npm install -g` to this exact version so that
12
+ // `npx @model-go/cli@rc install` installs the rc version globally,
13
+ // not whatever the @latest dist-tag happens to resolve to.
14
+ const PKG_VERSION = require("../package.json").version;
10
15
  const SKILLS_REPO = "modelgo/modelgo-cli";
11
16
  const isWindows = process.platform === "win32";
12
17
 
@@ -78,16 +83,6 @@ function fmt(template, ...values) {
78
83
  return template.replace(/%s/g, () => values[i++] ?? "");
79
84
  }
80
85
 
81
- function getLatestVersion() {
82
- try {
83
- const out = runSilent("npm", ["view", PKG, "version"], { timeout: 15000 });
84
- const ver = out.toString().trim();
85
- return /^\d+\.\d+\.\d+/.test(ver) ? ver : null;
86
- } catch (_) {
87
- return null;
88
- }
89
- }
90
-
91
86
  function getGloballyInstalledVersion() {
92
87
  try {
93
88
  const out = runSilent("npm", ["list", "-g", PKG], { timeout: 15000 });
@@ -162,8 +157,7 @@ function reportFail(isInteractive, spinner, message, err) {
162
157
 
163
158
  async function stepInstallGlobally(msg, isInteractive) {
164
159
  const installedVer = getGloballyInstalledVersion();
165
- const latestVer = getLatestVersion();
166
- const needsUpgrade = installedVer && latestVer && semverLessThan(installedVer, latestVer);
160
+ const needsUpgrade = installedVer && semverLessThan(installedVer, PKG_VERSION);
167
161
 
168
162
  if (installedVer && !needsUpgrade) {
169
163
  const skipMsg = fmt(msg.step1Skip, installedVer);
@@ -173,13 +167,16 @@ async function stepInstallGlobally(msg, isInteractive) {
173
167
  }
174
168
 
175
169
  const startMsg = needsUpgrade
176
- ? fmt(msg.step1Upgrade, PKG, installedVer, latestVer)
170
+ ? fmt(msg.step1Upgrade, PKG, installedVer, PKG_VERSION)
177
171
  : fmt(msg.step1, PKG);
178
- const doneMsg = needsUpgrade ? fmt(msg.step1Upgraded, latestVer) : msg.step1Done;
172
+ const doneMsg = needsUpgrade ? fmt(msg.step1Upgraded, PKG_VERSION) : msg.step1Done;
179
173
 
180
174
  const s = reportStart(isInteractive, startMsg);
181
175
  try {
182
- await runSilentAsync("npm", ["install", "-g", PKG], { timeout: 120000 });
176
+ // Pin to PKG_VERSION (the wizard's own version) so that
177
+ // `npx @model-go/cli@rc install` installs the rc version globally,
178
+ // not whatever the @latest dist-tag currently resolves to.
179
+ await runSilentAsync("npm", ["install", "-g", `${PKG}@${PKG_VERSION}`], { timeout: 120000 });
183
180
  reportStop(isInteractive, s, doneMsg);
184
181
  } catch (err) {
185
182
  reportFail(isInteractive, s, fmt(msg.step1Fail, PKG), err);