@solidactions/cli 1.30.0 → 1.31.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.
Files changed (44) hide show
  1. package/README.md +86 -12
  2. package/dist/commands/crew-env-delete.js +1 -1
  3. package/dist/commands/crew-env-list.js +9 -7
  4. package/dist/commands/crew-env-push.js +1 -1
  5. package/dist/commands/crew-env-set.js +1 -1
  6. package/dist/commands/docs-upload.js +1 -1
  7. package/dist/commands/env-delete.js +1 -1
  8. package/dist/commands/env-list.js +1 -1
  9. package/dist/commands/env-map.js +1 -1
  10. package/dist/commands/env-pull.js +2 -2
  11. package/dist/commands/env-push.js +2 -2
  12. package/dist/commands/env-set.js +7 -3
  13. package/dist/commands/login.js +50 -1
  14. package/dist/commands/oauth-actions-list.js +1 -1
  15. package/dist/commands/oauth-actions-platforms.js +1 -1
  16. package/dist/commands/oauth-actions-search.js +1 -1
  17. package/dist/commands/oauth-actions-show.js +1 -1
  18. package/dist/commands/project-create.js +1 -1
  19. package/dist/commands/project-list.js +1 -1
  20. package/dist/commands/project-logs.js +1 -1
  21. package/dist/commands/pull.js +1 -1
  22. package/dist/commands/run-list.js +1 -1
  23. package/dist/commands/run-start.js +1 -1
  24. package/dist/commands/run-view.js +1 -1
  25. package/dist/commands/schedule-delete.js +1 -1
  26. package/dist/commands/schedule-list.js +1 -1
  27. package/dist/commands/schedule-set.js +10 -13
  28. package/dist/commands/skill-dev.js +15 -0
  29. package/dist/commands/skill-exec.js +179 -7
  30. package/dist/commands/skill-pull.js +2 -14
  31. package/dist/commands/skill-push.js +2 -2
  32. package/dist/commands/skill-run.js +45 -22
  33. package/dist/commands/webhook-list.js +1 -1
  34. package/dist/commands/webhook-secret.js +1 -1
  35. package/dist/index.js +29 -12
  36. package/dist/utils/api.js +2 -2
  37. package/dist/utils/crew.js +48 -0
  38. package/dist/utils/github.js +7 -1
  39. package/dist/utils/mcp.js +26 -18
  40. package/dist/utils/skill-bundle.js +123 -0
  41. package/dist/utils/skill-cache-fs.js +133 -0
  42. package/dist/utils/skill-cache.js +84 -0
  43. package/dist/utils/skills.js +4 -2
  44. package/package.json +8 -5
package/README.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Deploy and manage workflow automation with SolidActions.
4
4
 
5
+ Public setup guides: [www.solidactions.com/docs](https://www.solidactions.com/docs)
6
+
7
+ ## Prerequisites
8
+
9
+ - Node.js 24 for generated workflow projects (`@solidactions/sdk` requires Node 24)
10
+ - A SolidActions account, workspace, and API key
11
+
5
12
  ## Installation
6
13
 
7
14
  ```bash
@@ -10,15 +17,66 @@ npm install -g @solidactions/cli
10
17
 
11
18
  ## Quick Start
12
19
 
20
+ Create an API key in the SolidActions app under **Settings → API Keys**, then run:
21
+
13
22
  ```bash
14
- solidactions login <api-key> # Authenticate (prompts for workspace)
15
- solidactions init my-project # Scaffold a new project (files + AI skills)
23
+ # The API key is requested in a masked prompt and is not placed in shell history.
24
+ solidactions login --global
25
+
26
+ # Choose one agent target. init creates the project and installs local skills.
27
+ solidactions init my-project --claude
28
+ # Or: solidactions init my-project --agents
29
+
16
30
  cd my-project
17
- solidactions project deploy my-project -e production # Deploy it
18
- solidactions run start my-project <workflow> # Trigger a workflow
19
- solidactions run view <run-id> # Inspect a run
31
+ npm install
32
+ solidactions project deploy my-project -e production
33
+ solidactions run start my-project hello -e production -i '{"name":"Ada"}' --wait
34
+ ```
35
+
36
+ The generated `hello` workflow requires no third-party credentials. A successful
37
+ run completes with a greeting of `Hello, Ada!`; use the run ID printed by the
38
+ command with `solidactions run view <run-id>` or open the run in the app.
39
+
40
+ For non-interactive automation, explicitly read the key from stdin instead of
41
+ placing it in argv:
42
+
43
+ ```bash
44
+ printenv SOLIDACTIONS_API_KEY | solidactions login --stdin --global
45
+ ```
46
+
47
+ Automation that does not need to write a config file can set
48
+ `SOLIDACTIONS_API_KEY` and `SOLIDACTIONS_WORKSPACE_ID` directly.
49
+
50
+ ### Verify the generated AI tooling
51
+
52
+ `solidactions init` installs all five current SolidActions skills plus the SDK
53
+ reference:
54
+
55
+ - `solidactions-getting-started`
56
+ - `solidactions-workflow-coding`
57
+ - `solidactions-deploy-and-config`
58
+ - `solidactions-oauth-actions`
59
+ - `solidactions-crew-skills`
60
+
61
+ For `--claude`, skills are written to `.claude/skills/`; for `--agents`, they
62
+ are written to `.agents/skills/`. Each skill is a flat `solidactions-*.md` file.
63
+ Both targets receive `.solidactions/sdk-reference.md` and a pointer block in
64
+ `CLAUDE.md` or `AGENTS.md`.
65
+
66
+ ```bash
67
+ # Use the directory matching the target selected above.
68
+ find .claude/skills -maxdepth 1 -name 'solidactions-*.md' -print
69
+ test -f .solidactions/sdk-reference.md
20
70
  ```
21
71
 
72
+ Restart the coding-agent session after installation so it reloads project
73
+ instructions. Then ask: “Which SolidActions skills are installed, and which
74
+ one should you use to deploy this workflow?” The answer should identify the
75
+ installed skills and select `solidactions-deploy-and-config` for deployment.
76
+
77
+ For an existing project, install or refresh the same tooling with
78
+ `solidactions ai init --claude` or `solidactions ai init --agents`.
79
+
22
80
  ## Configuration
23
81
 
24
82
  The CLI stores `host`, `apiKey`, and `workspaceId` in a JSON config file. Two locations are supported:
@@ -38,6 +96,9 @@ You can mix: e.g., set only `SOLIDACTIONS_WORKSPACE_ID` in the environment while
38
96
 
39
97
  ### `solidactions login` flags
40
98
 
99
+ - With no positional argument, `login` securely prompts for the API key using
100
+ masked input. This is the recommended interactive flow.
101
+ - `--stdin` — read the API key from stdin for explicitly non-interactive use.
41
102
  - `--local` — write config to `./.solidactions/config.json` in the current folder.
42
103
  - `--global` — write config to `~/.solidactions/config.json` (today's default).
43
104
  - `--gitignore` — with `--local`, auto-add `.solidactions/` to `.gitignore` without prompting.
@@ -60,7 +121,7 @@ Set `SOLIDACTIONS_DEBUG=1` on any command to print the resolved configuration an
60
121
 
61
122
  If you run multiple AI coding agents in different project folders simultaneously, either:
62
123
 
63
- - Run `solidactions login <key> --local` in each folder so each has its own config, or
124
+ - Run `solidactions login --local` interactively in each folder so each has its own config, or
64
125
  - Set `SOLIDACTIONS_API_KEY` / `SOLIDACTIONS_WORKSPACE_ID` in the environment each agent uses (no files to share or stomp).
65
126
 
66
127
  ### Deploy bundle exclusions (`solidactions.yaml`)
@@ -89,7 +150,7 @@ Use `solidactions <command> --help` for full flag details on any command.
89
150
 
90
151
  | Command | Description |
91
152
  |---------|-------------|
92
- | `login <api-key>` | Authenticate CLI with API key |
153
+ | `login` | Authenticate via a masked API-key prompt (`--stdin` for automation) |
93
154
  | `logout` | Remove saved credentials |
94
155
  | `whoami` | Show current configuration |
95
156
  | `init [directory]` | Scaffold a new project (files + AI skills) |
@@ -129,10 +190,14 @@ Use `solidactions <command> --help` for full flag details on any command.
129
190
 
130
191
  | Command | Key Flags | Description |
131
192
  |---------|-----------|-------------|
132
- | `schedule set <project> <cron>` | `--workflow`, `-i`, `-y` | Set cron schedule (warns if exists) |
193
+ | `schedule set <project> <cron>` | `--workflow`, `-i`, `-z`, `-y` | Set cron schedule and optional IANA timezone (warns if exists) |
133
194
  | `schedule list <project>` | | List schedules |
134
195
  | `schedule delete <project> <id>` | `-y` | Delete a schedule |
135
196
 
197
+ ```bash
198
+ solidactions schedule set my-project '0 9 * * 1-5' --workflow daily-summary --timezone America/Chicago
199
+ ```
200
+
136
201
  ### webhook
137
202
 
138
203
  | Command | Key Flags | Description |
@@ -150,10 +215,19 @@ Manage agent skills on the crews SOP surface. `push` is an idempotent upsert (cr
150
215
  | `skill view <name>` | `--json` | Show one skill |
151
216
  | `skill pull <name> [dest]` | `--json` | Fetch a skill to a local folder for editing (inverse of push); writes a `.solidactions-skill.json` provenance sidecar used by `push`'s drift guard |
152
217
  | `skill delete <name>` | `--json` | Delete a skill (Admin only) |
153
- | `skill run <dir> -- <command...>` | `--crew <nameOrId>`, `--environment <env>` (default `dev`), `--env-file <path>` | Run a skill script LOCALLY with crew variables fetched from the platform (dev loop). Secret values need a token with `env:reveal`; see `skill exec` for the remote/deployed counterpart |
154
- | `skill exec <name> -- <command...>` | `--role <name>`, `--in-crew <crew>`, `--environment <env>` (default `production`) | Run a command against the DEPLOYED skill in its real sandbox runtime (post-push smoke); see `skill run` for the local dev-loop counterpart |
218
+ | `skill exec <name> --target sandbox -- <cmd>` (`--target` required) | `--role <name>`, `--in-crew <crew>`, `--environment <env>` (default `production`) | Execute the server-stored skill in its server sandbox (post-push smoke; default env production) |
219
+ | `skill exec <name> --target host -- <cmd>` (`--target` required) | `--role <name>`, `--in-crew <crew>`, `--crew <nameOrId>`, `--environment <env>` (default `production`), `--env-file <path>` | Execute the server-stored skill on THIS machine via a transparent revision-checked cache — no pull step; crew vars fetched from the platform (default env production; secrets need `env:reveal`) |
220
+ | `skill dev <dir> -- <cmd>` | `--crew <nameOrId>`, `--environment <env>` (default `dev`), `--env-file <path>` | Run your local working copy (the folder you're editing) with platform crew vars (default env dev). Replaces `skill run` (deprecated) |
221
+
222
+ `skill exec` always executes the **server-stored** skill — `--target` only picks
223
+ where it runs (`sandbox` = server, `host` = your machine, cached under
224
+ `~/.solidactions/cache/skills/`, refreshed automatically when the skill's
225
+ published revision changes). `skill dev` always runs the **folder you're
226
+ editing**. Passing a directory to `exec` or a bare name to `dev` is an error
227
+ that points at the right command. Both `exec` targets default to `production`
228
+ variables; `dev` defaults to `dev`.
155
229
 
156
- For `skill run` / `skill exec`, pass the command as separate words after `--` (e.g. `-- python script.py --flag`); to run a single preformed shell string, wrap it explicitly with `sh -c '...'`.
230
+ For `skill dev` / `skill exec`, pass the command as separate words after `--` (e.g. `-- python script.py --flag`); to run a single preformed shell string, wrap it explicitly with `sh -c '...'`.
157
231
 
158
232
  ### role
159
233
 
@@ -204,7 +278,7 @@ You do **not** need `--overwrite` to keep an edited file whose doc was deleted o
204
278
  | `ai init` | `--claude`, `--agents` | Install AI skills and SDK reference into an **existing** project (use `init` for new projects) |
205
279
  | `ai examples [names...]` | `--all`, `--overwrite` | Install example workflows |
206
280
 
207
- `ai init` installs three auto-activating SolidActions skills and a
281
+ `ai init` installs five auto-activating SolidActions skills and a
208
282
  full SDK reference into your project:
209
283
 
210
284
  - Skills go to `.claude/skills/` (for `--claude` / Claude Code) or
@@ -33,7 +33,7 @@ async function crewEnvDelete(crewArg, key, options = {}) {
33
33
  catch (error) {
34
34
  if (error.response) {
35
35
  if (error.response.status === 401) {
36
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
36
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
37
37
  }
38
38
  else if (error.response.status === 404) {
39
39
  console.error(chalk_1.default.red(error.response.data?.message || `Variable "${key}" not found for crew "${crew.name}".`));
@@ -3,23 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.formatValue = formatValue;
6
7
  exports.crewEnvList = crewEnvList;
7
8
  const axios_1 = __importDefault(require("axios"));
8
9
  const chalk_1 = __importDefault(require("chalk"));
9
10
  const api_1 = require("../utils/api");
10
11
  const crew_1 = require("../utils/crew");
11
12
  /**
12
- * Format a value for display. Secrets are ALWAYS masked with a fixed
13
- * placeholder — regardless of what the server sent — so a server-side
14
- * masking bug can never leak a raw secret into stdout.
13
+ * Format a value for display. A null/undefined value means the env is
14
+ * unset and always renders as '-'. Otherwise, a secret's value is ALWAYS
15
+ * masked with a fixed placeholder — regardless of what the server sent —
16
+ * so a server-side masking bug can never leak a raw secret into stdout.
15
17
  */
16
18
  function formatValue(value, isSecret) {
17
- if (isSecret) {
18
- return chalk_1.default.yellow('••••••');
19
- }
20
19
  if (value === null || value === undefined) {
21
20
  return chalk_1.default.gray('-');
22
21
  }
22
+ if (isSecret) {
23
+ return chalk_1.default.yellow('••••••');
24
+ }
23
25
  return value.substring(0, 18);
24
26
  }
25
27
  async function crewEnvList(crewArg, options = {}) {
@@ -61,7 +63,7 @@ async function crewEnvList(crewArg, options = {}) {
61
63
  catch (error) {
62
64
  if (error.response) {
63
65
  if (error.response.status === 401) {
64
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
66
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
65
67
  }
66
68
  else if (error.response.status === 404) {
67
69
  console.error(chalk_1.default.red(error.response.data?.message || `Crew "${crewArg}" not found.`));
@@ -72,7 +72,7 @@ async function crewEnvPush(crewArg, filePath = '.env', options = {}) {
72
72
  }
73
73
  catch (error) {
74
74
  if (error.response?.status === 401) {
75
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
75
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
76
76
  }
77
77
  else if (error.response?.status === 404) {
78
78
  console.error(chalk_1.default.red(error.response.data?.message || `Crew "${crewArg}" not found.`));
@@ -58,7 +58,7 @@ async function crewEnvSet(crewArg, key, value, options = {}) {
58
58
  catch (error) {
59
59
  if (error.response) {
60
60
  if (error.response.status === 401) {
61
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
61
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
62
62
  }
63
63
  else if (error.response.status === 404) {
64
64
  console.error(chalk_1.default.red(error.response.data?.message || `Crew "${crewArg}" not found.`));
@@ -159,7 +159,7 @@ async function docsUpload(files, options = {}) {
159
159
  console.error(chalk_1.default.red(`✗ ${displayName} — ${data?.message || 'File exceeds the maximum upload size (20MB).'}`));
160
160
  }
161
161
  else if (status === 401) {
162
- console.error(chalk_1.default.red(`✗ ${displayName} — Authentication failed. Run "solidactions login <api-key>" to re-configure.`));
162
+ console.error(chalk_1.default.red(`✗ ${displayName} — Authentication failed. Run "solidactions login --global" to re-configure.`));
163
163
  }
164
164
  else if (status === 404 && data?.code === 'media_not_found') {
165
165
  console.error(chalk_1.default.red(`✗ ${displayName} — doc ${replaceDocId} is not a media doc`));
@@ -92,7 +92,7 @@ async function envDelete(keyOrProject, keyIfProject, options = {}) {
92
92
  catch (error) {
93
93
  if (error.response) {
94
94
  if (error.response.status === 401) {
95
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
95
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
96
96
  }
97
97
  else if (error.response.status === 404) {
98
98
  if (isProjectMode) {
@@ -187,7 +187,7 @@ async function envList(projectName, options = {}) {
187
187
  catch (error) {
188
188
  if (error.response) {
189
189
  if (error.response.status === 401) {
190
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
190
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
191
191
  }
192
192
  else if (error.response.status === 404) {
193
193
  if (projectName) {
@@ -63,7 +63,7 @@ async function envMap(projectName, projectKey, globalKey, options = {}) {
63
63
  catch (error) {
64
64
  if (error.response) {
65
65
  if (error.response.status === 401) {
66
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
66
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
67
67
  }
68
68
  else if (error.response.status === 404) {
69
69
  console.error(chalk_1.default.red(`Project "${projectName}" not found.`));
@@ -205,12 +205,12 @@ async function envPull(projectName, options = {}) {
205
205
  catch (error) {
206
206
  if (error.response) {
207
207
  if (error.response.status === 401) {
208
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
208
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
209
209
  }
210
210
  else if (error.response.status === 404) {
211
211
  console.error(chalk_1.default.red(`Project "${projectSlug}" not found.`));
212
212
  if (environment !== 'production') {
213
- console.log(chalk_1.default.gray(`Try deploying with: solidactions project deploy ${projectName} --env ${environment} --create`));
213
+ console.log(chalk_1.default.gray(`Try deploying with: solidactions project deploy ${projectName} -e ${environment} --create`));
214
214
  }
215
215
  }
216
216
  else {
@@ -96,12 +96,12 @@ async function envPush(projectName, sourcePath, options = {}) {
96
96
  }
97
97
  catch (error) {
98
98
  if (error.response?.status === 401) {
99
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
99
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
100
100
  process.exit(1);
101
101
  }
102
102
  else if (error.response?.status === 404) {
103
103
  console.error(chalk_1.default.red(`Project "${projectSlug}" not found.`));
104
- console.log(chalk_1.default.gray(`Deploy first with: solidactions project deploy ${projectName} --env ${environment}` + (environment !== 'production' ? ' --create' : '')));
104
+ console.log(chalk_1.default.gray(`Deploy first with: solidactions project deploy ${projectName} -e ${environment}` + (environment !== 'production' ? ' --create' : '')));
105
105
  process.exit(1);
106
106
  }
107
107
  throw error;
@@ -106,7 +106,7 @@ async function envSet(keyOrProject, valueOrKey, valueIfProject, options = {}) {
106
106
  catch (error) {
107
107
  if (error.response) {
108
108
  if (error.response.status === 401) {
109
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
109
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
110
110
  }
111
111
  else if (error.response.status === 404) {
112
112
  const envsList = await (0, api_1.describeProjectEnvironments)(config, projectName);
@@ -138,7 +138,11 @@ async function envSet(keyOrProject, valueOrKey, valueIfProject, options = {}) {
138
138
  process.exit(1);
139
139
  }
140
140
  console.log(chalk_1.default.yellow(exports.GLOBAL_ENV_SCOPE_NOTE));
141
- const isSecret = options.secret || false;
141
+ // Keep global and project writes consistent: names that commonly carry
142
+ // credentials are secrets unless the caller explicitly uses a plain
143
+ // name. `--secret` remains available for sensitive values whose names
144
+ // do not match this convention.
145
+ const isSecret = options.secret || /secret|key|token|password|credential/i.test(key);
142
146
  // Build the request body with per-environment values
143
147
  const body = {
144
148
  key,
@@ -224,7 +228,7 @@ async function envSet(keyOrProject, valueOrKey, valueIfProject, options = {}) {
224
228
  catch (error) {
225
229
  if (error.response) {
226
230
  if (error.response.status === 401) {
227
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
231
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
228
232
  }
229
233
  else if (error.response.status === 422) {
230
234
  console.error(chalk_1.default.red((0, api_1.formatValidationError)(error.response.data)));
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.API_KEY_PROMPT = void 0;
7
+ exports.resolveLoginApiKey = resolveLoginApiKey;
6
8
  exports.getConfig = getConfig;
7
9
  exports.saveConfig = saveConfig;
8
10
  exports.clearConfig = clearConfig;
@@ -15,9 +17,56 @@ exports.whoami = whoami;
15
17
  const fs_1 = __importDefault(require("fs"));
16
18
  const readline_1 = __importDefault(require("readline"));
17
19
  const chalk_1 = __importDefault(require("chalk"));
20
+ const prompts_1 = __importDefault(require("prompts"));
18
21
  const config_1 = require("../utils/config");
19
22
  const config_write_target_1 = require("../utils/config-write-target");
20
23
  const workspace_lookup_1 = require("../utils/workspace-lookup");
24
+ exports.API_KEY_PROMPT = {
25
+ type: 'password',
26
+ name: 'apiKey',
27
+ message: 'SolidActions API key',
28
+ };
29
+ async function readAll(input) {
30
+ let value = '';
31
+ for await (const chunk of input) {
32
+ value += chunk.toString();
33
+ }
34
+ return value;
35
+ }
36
+ /**
37
+ * Resolve a login secret without requiring it in argv. The positional key is
38
+ * retained for backwards compatibility, while new interactive documentation
39
+ * uses the masked prompt and automation can opt into stdin explicitly.
40
+ */
41
+ async function resolveLoginApiKey(apiKey, options = {}, dependencies = {}) {
42
+ if (apiKey && options.stdin) {
43
+ throw new Error('Pass the API key either as the legacy positional argument or via --stdin, not both.');
44
+ }
45
+ let resolved = apiKey;
46
+ if (options.stdin) {
47
+ resolved = await readAll(dependencies.input ?? process.stdin);
48
+ }
49
+ else if (!resolved) {
50
+ const isTTY = dependencies.isTTY ?? process.stdin.isTTY === true;
51
+ if (!isTTY) {
52
+ throw new Error('API key is required in non-interactive mode. Pipe it with --stdin, ' +
53
+ 'or set SOLIDACTIONS_API_KEY without running login.');
54
+ }
55
+ const prompt = dependencies.prompt ?? (async () => {
56
+ const response = await (0, prompts_1.default)(exports.API_KEY_PROMPT);
57
+ return response.apiKey;
58
+ });
59
+ resolved = await prompt();
60
+ if (resolved === undefined) {
61
+ throw new Error('Login cancelled.');
62
+ }
63
+ }
64
+ const trimmed = resolved?.trim();
65
+ if (!trimmed) {
66
+ throw new Error('API key is required.');
67
+ }
68
+ return trimmed;
69
+ }
21
70
  function getConfig() {
22
71
  const resolved = (0, config_1.resolveConfig)();
23
72
  return resolved ? resolved.config : null;
@@ -207,7 +256,7 @@ function whoami() {
207
256
  const resolved = (0, config_1.resolveConfig)();
208
257
  if (!resolved || !resolved.config.apiKey) {
209
258
  console.log(chalk_1.default.yellow('Not initialized.'));
210
- console.log(chalk_1.default.gray('Run "solidactions login <api-key>" to configure.'));
259
+ console.log(chalk_1.default.gray('Run "solidactions login --global" to configure.'));
211
260
  process.exit(1);
212
261
  }
213
262
  const { config, sources } = resolved;
@@ -38,7 +38,7 @@ async function oauthActionsList(platform, options) {
38
38
  console.error(chalk_1.default.red(`Unknown platform "${platform}". Run \`solidactions oauth-actions platforms\` to see available platforms.`));
39
39
  }
40
40
  else if (error.response?.status === 401) {
41
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>".'));
41
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global".'));
42
42
  }
43
43
  else if (error.response) {
44
44
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
@@ -28,7 +28,7 @@ async function oauthActionsPlatforms(options) {
28
28
  }
29
29
  catch (error) {
30
30
  if (error.response?.status === 401) {
31
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>".'));
31
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global".'));
32
32
  }
33
33
  else if (error.response) {
34
34
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
@@ -49,7 +49,7 @@ async function oauthActionsSearch(platform, query, options) {
49
49
  console.error(chalk_1.default.red(`Unknown platform "${platform}". Run \`solidactions oauth-actions platforms\` to see available platforms.`));
50
50
  }
51
51
  else if (error.response?.status === 401) {
52
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
52
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
53
53
  }
54
54
  else if (error.response) {
55
55
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
@@ -26,7 +26,7 @@ async function oauthActionsShow(platform, actionId, options) {
26
26
  console.error(chalk_1.default.red(`Action not found: ${platform}/${actionId}`));
27
27
  }
28
28
  else if (error.response?.status === 401) {
29
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>".'));
29
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global".'));
30
30
  }
31
31
  else if (error.response) {
32
32
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
@@ -45,7 +45,7 @@ async function projectCreateWithConfig(name, options, config) {
45
45
  catch (error) {
46
46
  if (error.response) {
47
47
  if (error.response.status === 401) {
48
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
48
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
49
49
  }
50
50
  else {
51
51
  console.error(chalk_1.default.red('Failed to create project:'), error.response.data?.message || error.message);
@@ -44,7 +44,7 @@ async function projectList(options = {}) {
44
44
  catch (error) {
45
45
  if (error.response) {
46
46
  if (error.response.status === 401) {
47
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
47
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
48
48
  }
49
49
  else {
50
50
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
@@ -45,7 +45,7 @@ async function logsBuild(projectName, environment) {
45
45
  catch (error) {
46
46
  if (error.response) {
47
47
  if (error.response.status === 401) {
48
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
48
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
49
49
  }
50
50
  else if (error.response.status === 404) {
51
51
  console.error(chalk_1.default.red(error.response.data?.message ?? `Project "${projectName}" not found.`));
@@ -70,7 +70,7 @@ async function pull(projectName, destPath, options = {}) {
70
70
  console.error(chalk_1.default.red(`Project "${projectName}" not found.`));
71
71
  }
72
72
  else if (error.response.status === 401) {
73
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
73
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
74
74
  }
75
75
  else {
76
76
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`));
@@ -82,7 +82,7 @@ async function runs(projectName, options = {}) {
82
82
  console.error(chalk_1.default.yellow(`Pass -e <env> to disambiguate, e.g.: solidactions run list ${projectName} -e dev`));
83
83
  }
84
84
  else if (error.response.status === 401) {
85
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
85
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
86
86
  }
87
87
  else {
88
88
  console.error(chalk_1.default.red(`Failed: ${error.response.status}`), error.response.data);
@@ -69,7 +69,7 @@ async function run(projectName, workflowName, options) {
69
69
  catch (error) {
70
70
  if (error.response) {
71
71
  if (error.response.status === 401) {
72
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
72
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
73
73
  }
74
74
  else if (error.response.status === 404) {
75
75
  const envsList = await (0, api_1.describeProjectEnvironments)(config, projectName);
@@ -110,7 +110,7 @@ async function runView(runId, options) {
110
110
  catch (error) {
111
111
  if (error.response) {
112
112
  if (error.response.status === 401) {
113
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
113
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
114
114
  }
115
115
  else if (error.response.status === 404) {
116
116
  console.error(chalk_1.default.red('Run not found.'));
@@ -46,7 +46,7 @@ async function scheduleDelete(projectName, scheduleId, options = {}) {
46
46
  catch (error) {
47
47
  if (error.response) {
48
48
  if (error.response.status === 401) {
49
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
49
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
50
50
  }
51
51
  else if (error.response.status === 404) {
52
52
  console.error(chalk_1.default.red(`Project "${projectName}" or schedule ${scheduleId} not found.`));
@@ -43,7 +43,7 @@ async function scheduleList(projectName) {
43
43
  catch (error) {
44
44
  if (error.response) {
45
45
  if (error.response.status === 401) {
46
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
46
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
47
47
  }
48
48
  else if (error.response.status === 404) {
49
49
  console.error(chalk_1.default.red(`Project "${projectName}" not found.`));
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EXISTING_SCHEDULE_CHOICES = void 0;
6
7
  exports.buildSchedulePayload = buildSchedulePayload;
7
8
  exports.timezoneMismatch = timezoneMismatch;
8
9
  exports.timezoneMismatchRemedy = timezoneMismatchRemedy;
@@ -35,6 +36,10 @@ function timezoneMismatch(requested, returned) {
35
36
  function timezoneMismatchRemedy(projectName) {
36
37
  return `Your server may not support schedule timezones yet; update the server, or run 'solidactions schedule list ${projectName}' to find the schedule ID and remove it with: solidactions schedule delete ${projectName} <schedule-id>`;
37
38
  }
39
+ exports.EXISTING_SCHEDULE_CHOICES = [
40
+ { title: 'Replace existing schedule', value: 'replace' },
41
+ { title: 'Cancel', value: 'cancel' },
42
+ ];
38
43
  async function scheduleSet(projectName, cron, options) {
39
44
  const config = await (0, api_1.requireConfigWithWorkspace)();
40
45
  // Parse input JSON if provided
@@ -68,23 +73,15 @@ async function scheduleSet(projectName, cron, options) {
68
73
  type: 'select',
69
74
  name: 'action',
70
75
  message: 'What would you like to do?',
71
- choices: [
72
- { title: 'Replace existing schedule', value: 'replace' },
73
- { title: 'Add another schedule', value: 'add' },
74
- { title: 'Cancel', value: 'cancel' },
75
- ],
76
+ choices: exports.EXISTING_SCHEDULE_CHOICES,
76
77
  });
77
78
  if (confirm.action === 'cancel' || confirm.action === undefined) {
78
79
  console.log(chalk_1.default.gray('Cancelled.'));
79
80
  return;
80
81
  }
81
- if (confirm.action === 'replace') {
82
- // Delete the existing schedule first
83
- await axios_1.default.delete(`${config.host}/api/v1/projects/${projectName}/schedules/${existing.id}`, {
84
- headers: (0, api_1.getApiHeaders)(config),
85
- });
86
- console.log(chalk_1.default.gray(`Removed old schedule (${existing.cron_expression}).`));
87
- }
82
+ // The API owns the one-schedule-per-workflow invariant and
83
+ // updates the existing row. Do not delete first: deletion
84
+ // loses YAML provenance and any persistent override state.
88
85
  }
89
86
  }
90
87
  catch {
@@ -122,7 +119,7 @@ async function scheduleSet(projectName, cron, options) {
122
119
  catch (error) {
123
120
  if (error.response) {
124
121
  if (error.response.status === 401) {
125
- console.error(chalk_1.default.red('Authentication failed. Run "solidactions login <api-key>" to re-configure.'));
122
+ console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
126
123
  }
127
124
  else if (error.response.status === 404) {
128
125
  console.error(chalk_1.default.red(`Project "${projectName}" not found.`));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.skillDev = void 0;
4
+ /**
5
+ * solidactions skill dev <dir> -- <command...>
6
+ *
7
+ * Runs YOUR WORKING COPY (the folder you're editing) locally, with crew
8
+ * variables fetched at runtime. Counterpart of `skill exec`, which always
9
+ * executes the SERVER-STORED skill (--target sandbox|host). Renamed from
10
+ * `skill run` (deprecated alias kept until v2.0.0): "run" collides with the
11
+ * workflow-runs noun (`solidactions run …`), and run-vs-exec didn't encode
12
+ * the source-of-truth split agents need.
13
+ */
14
+ var skill_run_1 = require("./skill-run");
15
+ Object.defineProperty(exports, "skillDev", { enumerable: true, get: function () { return skill_run_1.skillRun; } });