@cloud-cli/on 1.2.5 → 1.2.7

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.
@@ -1,4 +1,4 @@
1
- import type { PreprocessedWebhook, WebhookPreprocessor } from '../../types.js';
1
+ import type { PreprocessedWebhook, WebhookPreprocessor } from '../types.js';
2
2
  export declare class GitHubPreprocessor implements WebhookPreprocessor {
3
3
  name: string;
4
4
  parse(headers: Record<string, string>, rawBodyBuffer: Buffer, secret?: string): PreprocessedWebhook;
package/dist/queue.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WorkflowExecutionReport, JobPayload, JobRecord, JobStatus } from './types.js';
1
+ import { JobPayload, JobRecord, JobStatus } from './types.js';
2
2
  export declare class QueueManager {
3
3
  private workerId;
4
4
  constructor(workerId: string);
@@ -20,13 +20,9 @@ export declare class QueueManager {
20
20
  /**
21
21
  * Checks if the current job has been marked for cancellation by another event
22
22
  */
23
- isCancelled(jobId: number): Promise<boolean>;
23
+ isCancelled(jobId: string | number): Promise<boolean>;
24
24
  clearStaleJobs(): Promise<any>;
25
- createTables(): Promise<any>;
26
- /**
27
- * Save complete execution report JSON to DB
28
- */
29
- saveReport(jobId: string | number, report: WorkflowExecutionReport): Promise<void>;
25
+ createTables(): Promise<void>;
30
26
  /**
31
27
  * Fetch job details + report by ID
32
28
  */
@@ -35,4 +31,16 @@ export declare class QueueManager {
35
31
  * List recent jobs for dashboard status monitoring
36
32
  */
37
33
  listJobs(limit?: number): Promise<any[]>;
34
+ /**
35
+ * Save lightweight summary report (NO heavy logs in this JSON!)
36
+ */
37
+ saveReport(jobId: string | number, report: any): Promise<void>;
38
+ /**
39
+ * Save terminal log output for a specific step
40
+ */
41
+ saveStepLog(jobId: string | number, stepId: string, logContent: string): Promise<void>;
42
+ /**
43
+ * Retrieve all step logs for a specific job (called ON-DEMAND by /runs/:jobId)
44
+ */
45
+ getJobLogs(jobId: string | number): Promise<Record<string, string>>;
38
46
  }
@@ -1,4 +1,4 @@
1
- import { WebhookPreprocessor, WebhookServerOptions } from '../types.js';
1
+ import { WebhookPreprocessor, WebhookServerOptions } from './types.js';
2
2
  export declare class WebhookServer {
3
3
  private server;
4
4
  private preprocessors;
@@ -8,7 +8,7 @@ export declare class WebhookServer {
8
8
  private adminToken;
9
9
  static withPort(options: WebhookServerOptions & {
10
10
  port: number;
11
- }): Promise<void>;
11
+ }): Promise<WebhookServer>;
12
12
  constructor(options: WebhookServerOptions);
13
13
  registerPreprocessor(preprocessor: WebhookPreprocessor): void;
14
14
  private handleRequest;
@@ -28,5 +28,6 @@ export declare class WebhookServer {
28
28
  * Serves single job HTML report
29
29
  */
30
30
  private renderRunDetails;
31
- listen(port: number): Promise<void>;
31
+ listen(port: number): Promise<WebhookServer>;
32
+ stop(): Promise<void>;
32
33
  }
package/dist/worker.d.ts CHANGED
@@ -1,8 +1,18 @@
1
1
  import { QueueManager } from './queue.js';
2
2
  import { SecretStore } from './secrets.js';
3
- import type { RunnerConfig } from './types.js';
3
+ import { RunnerConfig } from './types.js';
4
+ export declare const shutdownState: {
5
+ isStopping: boolean;
6
+ };
7
+ /**
8
+ * Called by signal handlers in index.ts during graceful shutdown
9
+ */
10
+ export declare function abortActiveWorkerTask(): Promise<void>;
11
+ /**
12
+ * Spawns worker loops as requested by configuration
13
+ */
4
14
  export declare function startWorkers(count: number, queue: QueueManager, secrets: SecretStore, config: RunnerConfig): Promise<void>[];
5
15
  /**
6
- * Main worker loop: continuously polls the SQLite queue for pending jobs.
16
+ * Main worker polling loop
7
17
  */
8
18
  export declare function startWorkerLoop(workerId: string, queue: QueueManager, secrets: SecretStore, config: RunnerConfig): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/on",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "CLI entry point for the on plugin ecosystem.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.30.3",
@@ -1 +0,0 @@
1
- export {};