@cloud-cli/on 1.2.2 → 1.2.4

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 (50) hide show
  1. package/README.md +24 -20
  2. package/dist/db-client.d.ts +14 -0
  3. package/dist/drivers/index.d.ts +2 -0
  4. package/dist/drivers/standard-process.driver.d.ts +10 -0
  5. package/dist/drivers/systemd.driver.d.ts +6 -0
  6. package/dist/index.d.ts +4 -0
  7. package/dist/log-redactor.d.ts +6 -0
  8. package/dist/on.js +9240 -0
  9. package/dist/parser/include-resolver.d.ts +9 -0
  10. package/dist/parser/matrix-expander.d.ts +5 -0
  11. package/dist/parser/yaml-loader.d.ts +6 -0
  12. package/dist/plugins/github-status.plugin.d.ts +7 -0
  13. package/dist/plugins/manager.d.ts +7 -0
  14. package/dist/queue.d.ts +38 -0
  15. package/dist/reporters/html.reporter.d.ts +14 -0
  16. package/dist/reporters/json-file.reporter.d.ts +9 -0
  17. package/dist/reporters/slack.reporter.d.ts +15 -0
  18. package/dist/safe-eval.d.ts +28 -0
  19. package/dist/secrets.d.ts +15 -0
  20. package/dist/server/preprocessors/github.d.ts +5 -0
  21. package/dist/server/server.d.ts +32 -0
  22. package/dist/types.d.ts +181 -0
  23. package/dist/worker.d.ts +8 -0
  24. package/package.json +24 -20
  25. package/dist/config.js +0 -15
  26. package/dist/db-client.js +0 -38
  27. package/dist/drivers/index.js +0 -11
  28. package/dist/drivers/standard-process.driver.js +0 -156
  29. package/dist/drivers/systemd.driver.js +0 -151
  30. package/dist/evaluator/safe-eval.js +0 -213
  31. package/dist/index.js +0 -145
  32. package/dist/ingress/preprocessors/github.js +0 -30
  33. package/dist/ingress/server.js +0 -241
  34. package/dist/logging/redactor.js +0 -20
  35. package/dist/parser/include-resolver.js +0 -47
  36. package/dist/parser/matrix-expander.js +0 -43
  37. package/dist/parser/yaml-loader.js +0 -45
  38. package/dist/plugins/github-status.plugin.js +0 -19
  39. package/dist/plugins/manager.js +0 -21
  40. package/dist/plugins/types.js +0 -1
  41. package/dist/queue/dispatcher.js +0 -112
  42. package/dist/reporters/html.reporter.js +0 -108
  43. package/dist/reporters/json-file.reporter.js +0 -16
  44. package/dist/reporters/slack.reporter.js +0 -25
  45. package/dist/reporters/types.js +0 -1
  46. package/dist/runner/step-runner.js +0 -42
  47. package/dist/secrets/store.js +0 -40
  48. package/dist/types.js +0 -1
  49. package/dist/worker.js +0 -249
  50. /package/dist/{ingress/types.js → runner/step-runner.d.ts} +0 -0
package/README.md CHANGED
@@ -54,9 +54,10 @@ Secrets are automatically loaded from `.env` at the root of your project. Prefix
54
54
  SECRET_NPM_TOKEN="npm_1234567890abcdef"
55
55
  SECRET_GITHUB_TOKEN="ghp_1234567890abcdef"
56
56
  SECRET_GITHUB_WEBHOOK_SECRET="my-webhook-secret"
57
-
58
57
  ```
59
58
 
59
+ `SECRET_GITHUB_WEBHOOK_SECRET` is required to validate incoming webhooks from GitHub
60
+
60
61
  ### 3. Define a Workflow (`.on/release.yml`)
61
62
 
62
63
  ```yaml
@@ -106,23 +107,26 @@ npx @cloud-cli/on [command] [options]
106
107
 
107
108
  ### Commands
108
109
 
109
- | Command | Description |
110
- | ----------------------- | ------------------------------------------------------------------------- |
111
- | **`start`** _(default)_ | Runs both Webhook Ingress Gateway and Worker execution loops together. |
112
- | **`start-server`** | Runs Webhook Ingress Gateway only (API / Gateway mode). |
113
- | **`start-workers`** | Runs Worker Polling loops only (Scalable Worker mode). |
114
- | **`validate`** | Parses and validates all YAML workflows in `.on/` without executing jobs. |
110
+ | Command | Description |
111
+ | ----------------------- | ---------------------------------------------------------------------------------------- |
112
+ | **`start`** _(default)_ | Runs both Webhook Ingress Gateway and Worker execution loops together. |
113
+ | **`start-server`** | Runs Webhook Ingress Gateway only (API / Gateway mode). |
114
+ | **`start-workers`** | Runs Worker Polling loops only (Scalable Worker mode). |
115
+ | **`validate`** | Parses and validates all YAML workflows in your workflows folder without executing jobs. |
116
+
117
+ ### CLI and Environment Options
115
118
 
116
- ### CLI Options
119
+ | Flag | Option | Default | Env | Description |
120
+ | ---- | ------------- | --------------------- | --------------------- | ----------------------------------------- |
121
+ | `-h` | `--help` | — | - | Prints CLI help message and exits. |
122
+ | `-c` | `--config` | `./runner.config.mjs` | `RUNNER_CONFIG_FILE` | Path to JavaScript configuration file. |
123
+ | `-d` | `--database` | - | `RUNNER_DATABASE_URL` | SQLite database file path or HTTP URL. |
124
+ | `-w` | `--workflows` | `.on/` | `RUNNER_WORKFLOWS` | Directory where workflow YAML files live. |
125
+ | `-p` | `--port` | `11235` | `PORT` | Port for the Ingress HTTP server. |
126
+ | `-k` | `--workers` | `5` | `RUNNER_WORKERS` | Number of worker loop threads to spawn. |
127
+ | | | | `RUNNER_ADMIN_SECRET` | Admin token to refresh secrets via API |
117
128
 
118
- | Flag | Option | Default | Description |
119
- | ---- | ------------- | -------------------------- | ----------------------------------------- |
120
- | `-c` | `--config` | `./runner.config.mjs` | Path to JavaScript configuration file. |
121
- | `-d` | `--database` | `process.env.DATABASE_URL` | SQLite database file path or HTTP URL. |
122
- | `-w` | `--workflows` | `.on/` | Directory where workflow YAML files live. |
123
- | `-p` | `--port` | `3000` | Port for the Ingress HTTP server. |
124
- | `-k` | `--workers` | `5` | Number of worker loop threads to spawn. |
125
- | `-h` | `--help` | — | Prints CLI help message and exits. |
129
+ ### Secrets
126
130
 
127
131
  ---
128
132
 
@@ -136,10 +140,10 @@ import { HtmlReporter, SlackReporter, JsonFileReporter } from '@cloud-cli/on/rep
136
140
 
137
141
  export default {
138
142
  port: 3000,
139
- workersCount: 5,
140
- workflowsDir: '.on/',
143
+ workers: 5,
144
+ workflows: '/home/workflows/',
141
145
  storagePath: '/tmp/workspaces',
142
- sqliteUrl: 'sqlite.db',
146
+ database: 'https://remote.db.com/',
143
147
 
144
148
  // Global environment variables passed to all steps
145
149
  env: {
@@ -194,7 +198,7 @@ Within `${...}`, `if:`, and `eval:` contexts, the following object scopes are ex
194
198
 
195
199
  - **`inputs`**: Payload key-values received from incoming webhooks.
196
200
  - **`env`**: Merged environment variables from global config and workflow definitions.
197
- - **`secrets`**: Unmasked secret values loaded from `.env` (`SECRET_` prefix stripped).
201
+ - **`secrets`**: Unmasked secret values loaded from `.env` or environment variables (`SECRET_` prefix stripped).
198
202
  - **`steps`**: Execution statuses and outputs from previous steps in the workflow (`steps.<id>.status`, `steps.<id>.outputs`).
199
203
  - **`BUILTIN_HELPERS`**: JS utilities including `String`, `Number`, `Boolean`, and `JSON.parse` / `JSON.stringify`.
200
204
 
@@ -0,0 +1,14 @@
1
+ declare function query(method: 'get' | 'run' | 'all', statement: string, data?: Array<string | number | null>, pragma?: string[]): Promise<any>;
2
+ export declare const get: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
3
+ export declare const run: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
4
+ export declare const all: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
5
+ export declare function pragma(p: any): void;
6
+ declare const _default: {
7
+ query: typeof query;
8
+ get: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
9
+ run: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
10
+ all: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
11
+ pragma: typeof pragma;
12
+ };
13
+ export default _default;
14
+ export declare function setUrl(u: any): void;
@@ -0,0 +1,2 @@
1
+ import { ExecutionDriver } from '../types.js';
2
+ export declare function resolveDriver(): Promise<ExecutionDriver>;
@@ -0,0 +1,10 @@
1
+ import { ExecutionDriver, StepContext, StepExecutionHandle } from '../types.js';
2
+ export declare class StandardProcessDriver implements ExecutionDriver {
3
+ name: string;
4
+ isSupported(): Promise<boolean>;
5
+ execute(ctx: StepContext): Promise<StepExecutionHandle>;
6
+ /**
7
+ * Kills the entire process group tree (-PID) with unref escalation
8
+ */
9
+ private killProcessGroup;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { ExecutionDriver, StepContext, StepExecutionHandle } from '../types.js';
2
+ export declare class SystemdDriver implements ExecutionDriver {
3
+ name: string;
4
+ isSupported(): Promise<boolean>;
5
+ execute(ctx: StepContext): Promise<StepExecutionHandle>;
6
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ export { HtmlReporter } from './reporters/html.reporter.js';
3
+ export { JsonFileReporter } from './reporters/json-file.reporter.js';
4
+ export { SlackReporter } from './reporters/slack.reporter.js';
@@ -0,0 +1,6 @@
1
+ import { Transform, TransformCallback } from 'node:stream';
2
+ export declare class SecretRedactorStream extends Transform {
3
+ private secretValues;
4
+ constructor(secretValues: string[]);
5
+ _transform(chunk: any, _encoding: BufferEncoding, callback: TransformCallback): void;
6
+ }