@critical-path/client 0.12.1 → 0.13.0

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/src/index.ts CHANGED
@@ -73,6 +73,19 @@ export type {
73
73
  WorkloadMetric
74
74
  };
75
75
 
76
+ export interface UpdateStatusOptions {
77
+ taskId?: string;
78
+ projectId?: string;
79
+ details?: string;
80
+ isEngaged?: boolean;
81
+ }
82
+
83
+ export interface UpdateStatusResult {
84
+ success: boolean;
85
+ status: string;
86
+ timestamp: number;
87
+ }
88
+
76
89
  export interface ClientOptions {
77
90
  baseUrl: string; // e.g. "http://localhost:3000/api/critical-path"
78
91
  headers?: Record<string, string>;
@@ -553,6 +566,24 @@ export class CriticalPathClient {
553
566
  });
554
567
  return res.timeEntry;
555
568
  }
569
+
570
+ // Agent Status / Telemetry
571
+ async updateStatus(
572
+ status: string,
573
+ options?: UpdateStatusOptions
574
+ ): Promise<UpdateStatusResult> {
575
+ const res = await this.request<UpdateStatusResult>('/status', {
576
+ method: 'POST',
577
+ body: JSON.stringify({
578
+ status,
579
+ taskId: options?.taskId,
580
+ projectId: options?.projectId,
581
+ details: options?.details,
582
+ isEngaged: options?.isEngaged ?? true
583
+ })
584
+ });
585
+ return res;
586
+ }
556
587
  }
557
588
 
558
589
  export type { CommentReaction };
@@ -1 +1 @@
1
- {"root":["./src/index.test.ts","./src/index.ts"],"version":"5.9.3"}
1
+ {"root":["./src/cli.test.ts","./src/index.test.ts","./src/index.ts","./src/bin/cli.ts"],"version":"5.9.3"}