@cloud-cli/on 1.8.1 → 1.9.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/README.md CHANGED
@@ -82,6 +82,9 @@ concurrency:
82
82
  group: release-${inputs.repo}
83
83
  cancel-in-progress: true
84
84
 
85
+ # Every tag must be advertised by the worker that claims this workflow.
86
+ tags: [linux, docker]
87
+
85
88
  steps:
86
89
  - id: checkout
87
90
  name: Checkout Code Repository
@@ -147,7 +150,7 @@ npx @cloud-cli/on [command] [options]
147
150
  | Command | Description |
148
151
  | ------------------- | ---------------------------------------------------------------------------------------- |
149
152
  | **`start-server`** | Runs Webhook Ingress Gateway (the HTTP server receiving webhooks). |
150
- | **`start-workers`** | Runs Worker Polling loops (Scalable Workers). |
153
+ | **`start-workers`** | Runs the event-driven worker scheduler (Scalable Workers). |
151
154
  | **`validate`** | Parses and validates all YAML workflows in your workflows folder without executing jobs. |
152
155
 
153
156
  ### CLI and Environment Options
@@ -159,8 +162,12 @@ npx @cloud-cli/on [command] [options]
159
162
  | `-d` | `--database` | - | `RUNNER_DATABASE_URL` | SQLite database file path or HTTP URL. |
160
163
  | `-w` | `--workflows` | `on/` | `RUNNER_WORKFLOWS` | Directory where workflow YAML files live. |
161
164
  | `-p` | `--port` | `11235` | `PORT` | Port for the Ingress HTTP server. |
162
- | `-k` | `--workers` | `5` | `RUNNER_WORKERS` | Number of worker loop threads to spawn. |
165
+ | `-k` | `--workers` | `5` | `RUNNER_WORKERS` | Maximum concurrent jobs on this node. |
163
166
  | | | | `RUNNER_ADMIN_SECRET` | Admin token to refresh secrets via API |
167
+ | | | | `RUNNER_SERVER_URL` | Webhook server URL used by workers. |
168
+ | | | | `RUNNER_TAGS` | Comma-separated worker capability tags. |
169
+
170
+ Set the same non-empty `RUNNER_ADMIN_SECRET` on the server and workers to publish live job-status refresh events. Job availability and the 60-second recovery refresh continue to work without it.
164
171
 
165
172
  ### Secrets
166
173
 
@@ -172,11 +179,13 @@ You can customize engine behavior using `runner.config.mjs` in your project root
172
179
 
173
180
  ```javascript
174
181
  // runner.config.mjs
175
- import { HtmlReporter, SlackReporter, JsonFileReporter } from '@cloud-cli/on/reporters';
182
+ import { GitHubStatusPlugin } from '@cloud-cli/on';
176
183
 
177
184
  export default {
178
185
  port: 3000,
179
186
  workers: 5,
187
+ serverUrl: 'https://runner.example.com/',
188
+ tags: ['linux', 'docker'],
180
189
  workflows: '/home/workflows/',
181
190
  storagePath: '/tmp/workspaces',
182
191
  database: 'https://remote.db.com/',
@@ -186,18 +195,19 @@ export default {
186
195
  NODE_ENV: 'production',
187
196
  },
188
197
 
189
- // Custom execution reporters
190
- reporters: [
191
- new JsonFileReporter({ outputDir: './reports/json' }),
192
- new HtmlReporter({ outputDir: './reports/html' }),
193
- new SlackReporter({
194
- webhookUrl: process.env.SLACK_WEBHOOK_URL,
195
- channel: '#ci-deployments',
198
+ plugins: [
199
+ new GitHubStatusPlugin({
200
+ token: process.env.SECRET_GITHUB_TOKEN,
201
+ context: 'on',
196
202
  }),
197
203
  ],
198
204
  };
199
205
  ```
200
206
 
207
+ The GitHub status plugin publishes commit states when a workflow starts and finishes. Its token needs permission to write commit statuses for the target repository.
208
+
209
+ Run details are available as HTML at `/runs/:id` and as sanitized JSON at `/api/runs/:id`. The HTML view refreshes reactively through job-specific SSE events while a run is active. Both representations omit raw webhook bodies, sensitive input fields, execution environment values, and internal rerun state.
210
+
201
211
  ---
202
212
 
203
213
  ## 📐 Deterministic Evaluation Rules
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG5D,wBAAsB,UAAU,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAyBrE;AAED,wBAAgB,aAAa,CAAC,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,GAAG,YAAY,CAY7G;AAED,wBAAgB,SAAS,SAsBxB;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB9F"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG5D,wBAAsB,UAAU,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAyBrE;AAED,wBAAgB,aAAa,CAAC,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,GAAG,YAAY,CAgB7G;AAED,wBAAgB,SAAS,SAwBxB;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB9F"}
@@ -0,0 +1,12 @@
1
+ import type http from 'node:http';
2
+ export type RunnerEvent = 'jobs.available' | 'jobs.changed';
3
+ export declare class EventBroker {
4
+ private clients;
5
+ private nextId;
6
+ private readonly maxClients;
7
+ subscribe(req: http.IncomingMessage, res: http.ServerResponse): void;
8
+ publish(event: RunnerEvent, data?: Record<string, unknown>): void;
9
+ close(): void;
10
+ }
11
+ export declare function consumeRunnerEvents(serverUrl: string, signal: AbortSignal, onEvent: (event: RunnerEvent, data: Record<string, unknown>) => void, onOpen?: () => void): Promise<void>;
12
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAE5D,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAkD;IACjE,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IAEnC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI;IAuBpE,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,IAAI;IAUrE,KAAK,IAAI,IAAI;CAOd;AAED,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EACpE,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
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';
2
+ export { GitHubStatusPlugin } from './plugins/github-status.plugin.js';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC"}