ccqa 1.24.0 → 1.26.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.
@@ -37,6 +37,7 @@ declare const RunSchema: z.ZodObject<{
37
37
  kind: z.ZodDefault<z.ZodEnum<{
38
38
  run: "run";
39
39
  drift: "drift";
40
+ record: "record";
40
41
  }>>;
41
42
  drift: z.ZodDefault<z.ZodNullable<z.ZodObject<{
42
43
  specs: z.ZodNumber;
@@ -382,6 +383,10 @@ declare const DriftLedgerResponseSchema: z.ZodObject<{
382
383
  spec: "spec";
383
384
  generated: "generated";
384
385
  }>>;
386
+ specChangeKind: z.ZodOptional<z.ZodEnum<{
387
+ FEATURE_REMOVED: "FEATURE_REMOVED";
388
+ BEHAVIOUR_CHANGED: "BEHAVIOUR_CHANGED";
389
+ }>>;
385
390
  confidence: z.ZodOptional<z.ZodNumber>;
386
391
  headline: z.ZodOptional<z.ZodString>;
387
392
  gitHead: z.ZodString;
@@ -391,6 +396,49 @@ declare const DriftLedgerResponseSchema: z.ZodObject<{
391
396
  }, z.core.$strip>>;
392
397
  }, z.core.$strip>;
393
398
  type DriftLedgerResponse = z.infer<typeof DriftLedgerResponseSchema>;
399
+ /**
400
+ * What one batch of ccqa invocations spent on Claude, as the job that ran them
401
+ * reported it (see `SpendStore`). `label` is the consumer's name for the batch
402
+ * — its job name — and the only thing that says where the money went.
403
+ */
404
+ declare const SpendEntrySchema: z.ZodObject<{
405
+ id: z.ZodString;
406
+ at: z.ZodString;
407
+ costUsd: z.ZodNumber;
408
+ label: z.ZodString;
409
+ ciRunId: z.ZodOptional<z.ZodString>;
410
+ runUrl: z.ZodOptional<z.ZodString>;
411
+ }, z.core.$strip>;
412
+ type SpendEntry = z.infer<typeof SpendEntrySchema>;
413
+ /** Body of `POST /projects/:project/spend` — one batch's total. `at` defaults to now. */
414
+ declare const RecordSpendRequestSchema: z.ZodObject<{
415
+ costUsd: z.ZodNumber;
416
+ label: z.ZodString;
417
+ at: z.ZodOptional<z.ZodString>;
418
+ ciRunId: z.ZodOptional<z.ZodString>;
419
+ runUrl: z.ZodOptional<z.ZodString>;
420
+ }, z.core.$strip>;
421
+ type RecordSpendRequest = z.infer<typeof RecordSpendRequestSchema>;
422
+ /**
423
+ * Body of `GET /projects/:project/spend?since=&until=`, newest first. `since`
424
+ * and `until` echo the window that was asked for (null for an open end), so a
425
+ * reader of `totalUsd` can tell what it totals.
426
+ */
427
+ declare const SpendLogResponseSchema: z.ZodObject<{
428
+ project: z.ZodString;
429
+ since: z.ZodNullable<z.ZodString>;
430
+ until: z.ZodNullable<z.ZodString>;
431
+ totalUsd: z.ZodNumber;
432
+ entries: z.ZodArray<z.ZodObject<{
433
+ id: z.ZodString;
434
+ at: z.ZodString;
435
+ costUsd: z.ZodNumber;
436
+ label: z.ZodString;
437
+ ciRunId: z.ZodOptional<z.ZodString>;
438
+ runUrl: z.ZodOptional<z.ZodString>;
439
+ }, z.core.$strip>>;
440
+ }, z.core.$strip>;
441
+ type SpendLogResponse = z.infer<typeof SpendLogResponseSchema>;
394
442
  //#endregion
395
443
  //#region src/prompts/prompt-names.d.ts
396
444
  /**
@@ -479,6 +527,10 @@ declare const ReportSpecResultSchema: z.ZodObject<{
479
527
  spec: "spec";
480
528
  generated: "generated";
481
529
  }>>;
530
+ specChangeKind: z.ZodOptional<z.ZodEnum<{
531
+ FEATURE_REMOVED: "FEATURE_REMOVED";
532
+ BEHAVIOUR_CHANGED: "BEHAVIOUR_CHANGED";
533
+ }>>;
482
534
  }, z.core.$strip>>;
483
535
  analysisSkipped: z.ZodNullable<z.ZodString>;
484
536
  customPromptVersion: z.ZodOptional<z.ZodString>;
@@ -565,6 +617,7 @@ declare const RunReportDataSchema: z.ZodObject<{
565
617
  kind: z.ZodDefault<z.ZodEnum<{
566
618
  run: "run";
567
619
  drift: "drift";
620
+ record: "record";
568
621
  }>>;
569
622
  createdAt: z.ZodString;
570
623
  runId: z.ZodNullable<z.ZodString>;
@@ -652,6 +705,10 @@ declare const RunReportDataSchema: z.ZodObject<{
652
705
  spec: "spec";
653
706
  generated: "generated";
654
707
  }>>;
708
+ specChangeKind: z.ZodOptional<z.ZodEnum<{
709
+ FEATURE_REMOVED: "FEATURE_REMOVED";
710
+ BEHAVIOUR_CHANGED: "BEHAVIOUR_CHANGED";
711
+ }>>;
655
712
  }, z.core.$strip>>;
656
713
  analysisSkipped: z.ZodNullable<z.ZodString>;
657
714
  customPromptVersion: z.ZodOptional<z.ZodString>;
@@ -834,7 +891,7 @@ interface HubClient {
834
891
  project: string;
835
892
  branch?: string;
836
893
  profile?: string;
837
- kind?: "run" | "drift";
894
+ kind?: Run["kind"];
838
895
  deployedSha?: string;
839
896
  }): Promise<Run>;
840
897
  /**
@@ -852,7 +909,7 @@ interface HubClient {
852
909
  project: string;
853
910
  branch?: string;
854
911
  profile?: string;
855
- kind?: "run" | "drift";
912
+ kind?: Run["kind"];
856
913
  gitHead?: string;
857
914
  deployedSha?: string;
858
915
  /** CI run id (GITHUB_RUN_ID) and its run URL, stamped at open time so an
@@ -936,6 +993,16 @@ interface HubClient {
936
993
  profile: string;
937
994
  limit?: number;
938
995
  }): Promise<DeployLogResponse>;
996
+ /**
997
+ * Report what one batch of ccqa invocations cost (`ccqa hub cost push`).
998
+ * Read instead of a sum over runs, never alongside one (ADR-0017).
999
+ */
1000
+ recordSpend(project: string, body: RecordSpendRequest): Promise<SpendEntry>;
1001
+ /** The project's spend over `[since, until)`, newest first, with the window's total. */
1002
+ getSpend(project: string, q?: {
1003
+ since?: string;
1004
+ until?: string;
1005
+ }): Promise<SpendLogResponse>;
939
1006
  putSession(project: string, profile: string, name: string, storageState: unknown): Promise<void>;
940
1007
  getSession(project: string, profile: string, name: string): Promise<unknown>;
941
1008
  listSessions(project: string, profile: string): Promise<{
@@ -201,6 +201,19 @@ function createHubClient(opts) {
201
201
  limit: q.limit
202
202
  })}`);
203
203
  },
204
+ recordSpend(project, body) {
205
+ return json(spendPath(project), {
206
+ method: "POST",
207
+ headers: { "Content-Type": "application/json" },
208
+ body: JSON.stringify(body)
209
+ });
210
+ },
211
+ getSpend(project, q = {}) {
212
+ return json(`${spendPath(project)}?${queryString({
213
+ since: q.since,
214
+ until: q.until
215
+ })}`);
216
+ },
204
217
  async listProjects() {
205
218
  const { projects } = await json("/api/v1/projects");
206
219
  return projects;
@@ -286,6 +299,9 @@ function promptsPath(project) {
286
299
  function deploysPath(project) {
287
300
  return `/api/v1/projects/${encodeURIComponent(project)}/deploys`;
288
301
  }
302
+ function spendPath(project) {
303
+ return `/api/v1/projects/${encodeURIComponent(project)}/spend`;
304
+ }
289
305
  function locksPath(project) {
290
306
  return `/api/v1/projects/${encodeURIComponent(project)}/locks`;
291
307
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccqa",
3
- "version": "1.24.0",
3
+ "version": "1.26.0",
4
4
  "type": "module",
5
5
  "description": "Browser test recorder powered by Claude Code and agent-browser",
6
6
  "repository": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccqa",
3
- "version": "1.24.0",
3
+ "version": "1.26.0",
4
4
  "type": "module",
5
5
  "description": "Browser test recorder powered by Claude Code and agent-browser",
6
6
  "repository": {