staygreen 0.1.0 → 0.1.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/CLI.md CHANGED
@@ -17,8 +17,8 @@ Requires Node 22 or later:
17
17
  npx -y staygreen mcp
18
18
  ```
19
19
 
20
- The package is prepared for publication; until the owner publishes it, build this
21
- source and use `node /absolute/path/to/dist/cli.js mcp` in place of `npx`.
20
+ To run a checkout of this source instead, build it (below) and use
21
+ `node /absolute/path/to/dist/cli.js mcp` in place of `npx`.
22
22
 
23
23
  Create a workspace API token at [Agents and API](https://staygreen.io/app/agents)
24
24
  and provide it as `STAYGREEN_API_TOKEN` in the server process's environment.
package/README.md CHANGED
@@ -31,6 +31,16 @@ claude mcp add --transport http staygreen https://staygreen.io/mcp \
31
31
  --header "Authorization: Bearer $STAYGREEN_API_TOKEN"
32
32
  ```
33
33
 
34
+ ### Local server (npm)
35
+
36
+ The [`staygreen`](https://www.npmjs.com/package/staygreen) package runs the same tools as a local stdio server and calls the REST API with a workspace API token. Node 22 or later.
37
+
38
+ ```sh
39
+ claude mcp add staygreen -e STAYGREEN_API_TOKEN=… -- npx -y staygreen mcp
40
+ ```
41
+
42
+ Without a token only `scan_app` works. Configuration for Claude Desktop, Cursor and VS Code, and the package's `scan` and `provision` commands, are in [CLI.md](CLI.md).
43
+
34
44
  ### Tools
35
45
 
36
46
  | Tool | What it does |
package/dist/cli.js CHANGED
@@ -8,9 +8,10 @@ var __export = (target, all) => {
8
8
  // src/cli.ts
9
9
  import { parseArgs } from "node:util";
10
10
  import { randomUUID } from "node:crypto";
11
+ import { realpathSync } from "node:fs";
11
12
  import { writeFile, mkdir } from "node:fs/promises";
12
13
  import { dirname, resolve } from "node:path";
13
- import { pathToFileURL } from "node:url";
14
+ import { fileURLToPath } from "node:url";
14
15
 
15
16
  // node_modules/zod/v4/classic/external.js
16
17
  var external_exports = {};
@@ -22142,7 +22143,15 @@ async function main(args = process.argv.slice(2), env = process.env) {
22142
22143
  await writeFile(output2, JSON.stringify(result, null, 2) + "\n", { mode: 384 });
22143
22144
  console.log("Monitoring provisioned. Private setup and heartbeat URLs saved to the output file.");
22144
22145
  }
22145
- if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href)
22146
+ var real = (path) => {
22147
+ try {
22148
+ return realpathSync(path);
22149
+ } catch {
22150
+ return null;
22151
+ }
22152
+ };
22153
+ var invoked = process.argv[1] ? real(resolve(process.argv[1])) : null;
22154
+ if (invoked && invoked === real(fileURLToPath(import.meta.url)))
22146
22155
  main().catch(() => {
22147
22156
  console.error("Staygreen command failed. Check --help, inputs, credentials and plan limits. Retry provisioning with the same output file and unchanged inputs.");
22148
22157
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "staygreen",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "mcpName": "io.github.phuryn/staygreen",
5
5
  "description": "Staygreen MCP server and CLI: scan apps and manage monitoring through the Staygreen API.",
6
6
  "type": "module",