@stamn/agent 0.4.0 → 0.5.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/dist/{chunk-NXQD5NVI.js → chunk-VTX4GGVR.js} +2 -2
- package/dist/commands/spend.js +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/commands/update.d.ts +8 -0
- package/dist/commands/update.js +30 -0
- package/dist/commands/update.js.map +1 -0
- package/package.json +1 -1
- /package/dist/{chunk-NXQD5NVI.js.map → chunk-VTX4GGVR.js.map} +0 -0
|
@@ -266,7 +266,7 @@ var WSClient = class {
|
|
|
266
266
|
const payload = {
|
|
267
267
|
agentId: this.options.config.agentId,
|
|
268
268
|
status,
|
|
269
|
-
version: "0.
|
|
269
|
+
version: "0.5.0",
|
|
270
270
|
platform: `${process.platform}-${process.arch}`,
|
|
271
271
|
nodeVersion: process.versions.node
|
|
272
272
|
};
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
WSClient,
|
|
374
374
|
SpendClient
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=chunk-
|
|
376
|
+
//# sourceMappingURL=chunk-VTX4GGVR.js.map
|
package/dist/commands/spend.js
CHANGED
package/dist/commands/start.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRequire } from "module"; const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/commands/update.ts
|
|
4
|
+
import { Command } from "@oclif/core";
|
|
5
|
+
import { execSync } from "child_process";
|
|
6
|
+
var Update = class extends Command {
|
|
7
|
+
static description = "Update the Stamn agent to the latest version";
|
|
8
|
+
async run() {
|
|
9
|
+
this.log(`Current version: ${"0.5.0"}`);
|
|
10
|
+
this.log("Checking for updates...");
|
|
11
|
+
try {
|
|
12
|
+
const latest = execSync("npm view @stamn/agent version", {
|
|
13
|
+
encoding: "utf-8"
|
|
14
|
+
}).trim();
|
|
15
|
+
if (latest === "0.5.0") {
|
|
16
|
+
this.log("Already on the latest version.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this.log(`Updating to ${latest}...`);
|
|
20
|
+
execSync("npm i -g @stamn/agent@latest", { stdio: "inherit" });
|
|
21
|
+
this.log(`Updated to ${latest}.`);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
this.error("Update failed. Try manually: npm i -g @stamn/agent@latest");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
Update as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/update.ts"],"sourcesContent":["import { Command } from '@oclif/core';\nimport { execSync } from 'child_process';\n\ndeclare const AGENT_VERSION: string;\n\nexport default class Update extends Command {\n static override description = 'Update the Stamn agent to the latest version';\n\n async run(): Promise<void> {\n this.log(`Current version: ${AGENT_VERSION}`);\n this.log('Checking for updates...');\n\n try {\n const latest = execSync('npm view @stamn/agent version', {\n encoding: 'utf-8',\n }).trim();\n\n if (latest === AGENT_VERSION) {\n this.log('Already on the latest version.');\n return;\n }\n\n this.log(`Updating to ${latest}...`);\n execSync('npm i -g @stamn/agent@latest', { stdio: 'inherit' });\n this.log(`Updated to ${latest}.`);\n } catch (err) {\n this.error('Update failed. Try manually: npm i -g @stamn/agent@latest');\n }\n }\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAIzB,IAAqB,SAArB,cAAoC,QAAQ;AAAA,EAC1C,OAAgB,cAAc;AAAA,EAE9B,MAAM,MAAqB;AACzB,SAAK,IAAI,oBAAoB,OAAa,EAAE;AAC5C,SAAK,IAAI,yBAAyB;AAElC,QAAI;AACF,YAAM,SAAS,SAAS,iCAAiC;AAAA,QACvD,UAAU;AAAA,MACZ,CAAC,EAAE,KAAK;AAER,UAAI,WAAW,SAAe;AAC5B,aAAK,IAAI,gCAAgC;AACzC;AAAA,MACF;AAEA,WAAK,IAAI,eAAe,MAAM,KAAK;AACnC,eAAS,gCAAgC,EAAE,OAAO,UAAU,CAAC;AAC7D,WAAK,IAAI,cAAc,MAAM,GAAG;AAAA,IAClC,SAAS,KAAK;AACZ,WAAK,MAAM,2DAA2D;AAAA,IACxE;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
File without changes
|