@treeseed/cli 0.6.38 → 0.6.40

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.
@@ -18,6 +18,9 @@ function wrapperScope(value) {
18
18
  }
19
19
  return "staging";
20
20
  }
21
+ function railwayEnvironmentName(scope) {
22
+ return scope === "prod" ? "production" : scope;
23
+ }
21
24
  const handleToolWrapper = (invocation, context) => {
22
25
  try {
23
26
  const toolName = wrappedToolName(invocation.commandName);
@@ -50,6 +53,37 @@ const handleToolWrapper = (invocation, context) => {
50
53
  };
51
54
  }
52
55
  const targetArgs = invocation.positionals;
56
+ if (toolName === "railway" && scope !== "local") {
57
+ const environmentResult = context.spawn(resolved.command, [
58
+ ...resolved.argsPrefix,
59
+ "environment",
60
+ railwayEnvironmentName(scope),
61
+ "--json"
62
+ ], {
63
+ cwd: context.cwd,
64
+ env: managedEnv,
65
+ stdio: "pipe"
66
+ });
67
+ if ((environmentResult.status ?? 1) !== 0) {
68
+ return {
69
+ exitCode: environmentResult.status ?? 1,
70
+ stderr: [`Failed to select Railway environment ${railwayEnvironmentName(scope)} before running ${targetArgs.join(" ") || "railway"}.`],
71
+ report: {
72
+ command: toolName,
73
+ ok: false,
74
+ scope,
75
+ executable: resolved.command,
76
+ binaryPath: resolved.binaryPath,
77
+ argsPrefix: resolved.argsPrefix,
78
+ args: targetArgs,
79
+ environmentSelection: {
80
+ environment: railwayEnvironmentName(scope),
81
+ status: environmentResult.status ?? 1
82
+ }
83
+ }
84
+ };
85
+ }
86
+ }
53
87
  const result = context.spawn(resolved.command, [...resolved.argsPrefix, ...targetArgs], {
54
88
  cwd: context.cwd,
55
89
  env: managedEnv,
@@ -336,6 +336,7 @@ const CLI_COMMAND_OVERLAYS = /* @__PURE__ */ new Map([
336
336
  { name: "worktreeMode", flags: "--worktree <mode>", description: "Control managed workflow worktrees.", kind: "enum", values: ["auto", "on", "off"] },
337
337
  { name: "ciMode", flags: "--ci <mode>", description: "Control hosted GitHub Actions waits.", kind: "enum", values: ["auto", "hosted", "off"] },
338
338
  { name: "verifyMode", flags: "--verify <mode>", description: "Control save verification depth.", kind: "enum", values: ["fast", "local", "hosted", "both", "skip"] },
339
+ { name: "verifyDeployedResources", flags: "--verify-deployed-resources", description: "Also wait for hosted deployment checks that verify provider resources.", kind: "boolean" },
339
340
  { name: "workspaceLinks", flags: "--workspace-links <mode>", description: "Control local workspace package links.", kind: "enum", values: ["auto", "off"] },
340
341
  { name: "plan", flags: "--plan", description: "Compute the recursive save plan without mutating any repo.", kind: "boolean" },
341
342
  { name: "dryRun", flags: "--dry-run", description: "Alias for --plan.", kind: "boolean" },
@@ -351,6 +352,7 @@ const CLI_COMMAND_OVERLAYS = /* @__PURE__ */ new Map([
351
352
  whenToUse: [
352
353
  "Use this after a meaningful unit of work on a task branch.",
353
354
  "Use `--preview` when the branch preview should be refreshed as part of the save operation.",
355
+ "Use `--verify-deployed-resources` on staging or production branches when the checkpoint should wait for deployed provider resources to be verified.",
354
356
  "Use `--hotfix` only when you are intentionally saving from `main` for an explicit production hotfix flow."
355
357
  ],
356
358
  beforeYouRun: [
@@ -426,6 +428,7 @@ const CLI_COMMAND_OVERLAYS = /* @__PURE__ */ new Map([
426
428
  { name: "plan", flags: "--plan", description: "Compute the recursive staging plan without mutating any repo.", kind: "boolean" },
427
429
  { name: "worktreeMode", flags: "--worktree <mode>", description: "Control managed workflow worktrees.", kind: "enum", values: ["auto", "on", "off"] },
428
430
  { name: "ciMode", flags: "--ci <mode>", description: "Control hosted GitHub Actions waits.", kind: "enum", values: ["auto", "hosted", "off"] },
431
+ { name: "verifyDeployedResources", flags: "--verify-deployed-resources", description: "Force staging deployment checks to verify provider resources before stage returns.", kind: "boolean" },
429
432
  { name: "workspaceLinks", flags: "--workspace-links <mode>", description: "Control local workspace package links.", kind: "enum", values: ["auto", "off"] },
430
433
  { name: "dryRun", flags: "--dry-run", description: "Alias for --plan.", kind: "boolean" },
431
434
  { name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
@@ -1287,17 +1290,17 @@ const CLI_ONLY_OPERATION_SPECS = [
1287
1290
  aliases: [],
1288
1291
  group: "Passthrough",
1289
1292
  summary: "Run the managed Railway CLI with Treeseed environment credentials.",
1290
- description: "Decrypt Treeseed machine configuration for the selected environment and pass it to the managed Railway CLI.",
1293
+ description: "Decrypt Treeseed machine configuration for the selected environment, select the matching Railway environment, and pass it to the managed Railway CLI.",
1291
1294
  provider: "default",
1292
1295
  related: ["tools", "install", "config"],
1293
1296
  usage: "treeseed railway [--environment staging] -- <railway-args>",
1294
1297
  arguments: [{ name: "args", description: "Arguments forwarded to Railway CLI.", required: false }],
1295
1298
  options: TOOL_WRAPPER_OPTIONS,
1296
- examples: ["treeseed railway --environment staging -- whoami", "treeseed railway --environment staging -- status"],
1299
+ examples: ["treeseed railway --environment staging -- whoami", "treeseed railway --environment staging -- status", "treeseed railway --environment prod -- status"],
1297
1300
  help: {
1298
- longSummary: ["The Railway wrapper resolves the Treeseed-managed Railway executable, decrypts scoped machine configuration, and passes the resulting Railway token only to the child process environment."],
1301
+ longSummary: ["The Railway wrapper resolves the Treeseed-managed Railway executable, decrypts scoped machine configuration, selects the requested Railway environment, and passes the resulting Railway token only to the child process environment."],
1299
1302
  whenToUse: ["Use this to debug Railway projects and service builds with the same decrypted `RAILWAY_API_TOKEN` Treeseed deploys use."],
1300
- beforeYouRun: ["Run from a Treeseed project. Use `--environment staging` when inspecting staging deployments."],
1303
+ beforeYouRun: ["Run from a Treeseed project. Use `--environment staging` when inspecting staging deployments and `--environment prod` when inspecting Railway production."],
1301
1304
  automationNotes: ["Use `--` before target CLI flags when a flag could be parsed by Treeseed itself. The wrapper does not print decrypted secrets."]
1302
1305
  },
1303
1306
  helpVisible: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/cli",
3
- "version": "0.6.38",
3
+ "version": "0.6.40",
4
4
  "description": "Operator-facing Treeseed CLI package.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "release:publish": "node ./scripts/run-ts.mjs ./scripts/publish-package.ts"
46
46
  },
47
47
  "dependencies": {
48
- "@treeseed/sdk": "0.6.42",
48
+ "@treeseed/sdk": "0.6.44",
49
49
  "ink": "^7.0.0",
50
50
  "react": "^19.2.5"
51
51
  },