@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.
@@ -266,7 +266,7 @@ var WSClient = class {
266
266
  const payload = {
267
267
  agentId: this.options.config.agentId,
268
268
  status,
269
- version: "0.4.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-NXQD5NVI.js.map
376
+ //# sourceMappingURL=chunk-VTX4GGVR.js.map
@@ -3,7 +3,7 @@ import {
3
3
  SpendClient,
4
4
  WSClient,
5
5
  createLogger
6
- } from "../chunk-NXQD5NVI.js";
6
+ } from "../chunk-VTX4GGVR.js";
7
7
  import {
8
8
  ConfigStore
9
9
  } from "../chunk-5UI5E6YF.js";
@@ -6,7 +6,7 @@ import {
6
6
  SpendClient,
7
7
  WSClient,
8
8
  createLogger
9
- } from "../chunk-NXQD5NVI.js";
9
+ } from "../chunk-VTX4GGVR.js";
10
10
  import {
11
11
  ConfigStore,
12
12
  SERVER_URL
@@ -0,0 +1,8 @@
1
+ import { Command } from '@oclif/core';
2
+
3
+ declare class Update extends Command {
4
+ static description: string;
5
+ run(): Promise<void>;
6
+ }
7
+
8
+ export { Update as default };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamn/agent",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Stamn Agent Daemon CLI",
5
5
  "type": "module",
6
6
  "license": "MIT",