@junejuly-lockstep/sdk 0.2.0 → 0.2.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/dist/session.d.ts DELETED
@@ -1,1092 +0,0 @@
1
- import { ApproveBaselineRequest, BoardResponse, ClientErrorBatch, CreateAnnotationRequest, CreateCardRequest, CreateProjectRequest, JourneyDetailDto, PatchAnnotationRequest, PatchProjectRequest, ProposalRequest } from '@junejuly-lockstep/model';
2
- import { z } from 'zod';
3
- import { type Conditional, type FetchLike, type RetryPolicy } from './http.js';
4
- export interface SessionClientOptions {
5
- /** API origin. In the SPA this is usually '' (same origin) or the api.<domain> origin. */
6
- baseUrl: string;
7
- fetch?: FetchLike;
8
- retry?: Partial<RetryPolicy>;
9
- }
10
- export interface ConditionalOptions {
11
- /** ETag from a previous read; the server answers 304 when unchanged. */
12
- etag?: string | null;
13
- }
14
- export type JudgmentAction = 'dispatch' | 'adopt' | 'defer' | 'acknowledge' | 'approve-baseline';
15
- /** Routes the session client uses. */
16
- export declare const SESSION_ROUTES: {
17
- readonly me: "/me";
18
- readonly logout: "/auth/logout";
19
- readonly projects: "/api/projects";
20
- readonly project: (id: string) => string;
21
- readonly projectKeys: (id: string) => string;
22
- readonly apiKey: (id: string) => string;
23
- readonly journeys: "/api/journeys";
24
- readonly journey: (id: string) => string;
25
- readonly proposals: (journeyId: string) => string;
26
- readonly board: "/api/board";
27
- readonly cards: "/api/cards";
28
- readonly card: (id: string) => string;
29
- readonly cardAction: (id: string, action: JudgmentAction) => string;
30
- readonly annotations: "/api/annotations";
31
- readonly annotation: (id: string) => string;
32
- readonly run: (id: string) => string;
33
- readonly runArtifacts: (id: string) => string;
34
- readonly errors: "/api/errors";
35
- readonly opsStatus: "/api/ops/status";
36
- readonly opsMetrics: "/api/ops/metrics";
37
- readonly opsErrors: "/api/ops/errors";
38
- readonly opsMute: (fingerprint: string) => string;
39
- };
40
- declare const RunArtifactsResponse: z.ZodObject<{
41
- runId: z.ZodString;
42
- artifacts: z.ZodArray<z.ZodObject<{
43
- key: z.ZodString;
44
- path: z.ZodString;
45
- contentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
- }, "strip", z.ZodTypeAny, {
47
- path: string;
48
- key: string;
49
- contentType?: string | null | undefined;
50
- }, {
51
- path: string;
52
- key: string;
53
- contentType?: string | null | undefined;
54
- }>, "many">;
55
- }, "strip", z.ZodTypeAny, {
56
- runId: string;
57
- artifacts: {
58
- path: string;
59
- key: string;
60
- contentType?: string | null | undefined;
61
- }[];
62
- }, {
63
- runId: string;
64
- artifacts: {
65
- path: string;
66
- key: string;
67
- contentType?: string | null | undefined;
68
- }[];
69
- }>;
70
- export type RunArtifactsResponse = z.infer<typeof RunArtifactsResponse>;
71
- export declare function createSessionClient(options: SessionClientOptions): {
72
- me: () => Promise<{
73
- id: string;
74
- name: string;
75
- email: string;
76
- role: "admin" | "member";
77
- bootstrap?: boolean | undefined;
78
- }>;
79
- logout: () => Promise<unknown>;
80
- listProjects: () => Promise<{
81
- id: string;
82
- name: string;
83
- key: string;
84
- config: {
85
- seams: string[];
86
- visualDiffThreshold: number;
87
- failOnUnresolvedNavigation: boolean;
88
- defaultScenario?: string | undefined;
89
- };
90
- createdAt: string;
91
- repoFullName: string;
92
- githubInstallationId: number | null;
93
- modelSync: {
94
- latestCommit: string | null;
95
- pendingCommit: string | null;
96
- };
97
- updatedAt: string;
98
- }[]>;
99
- getProject: (id: string) => Promise<{
100
- id: string;
101
- name: string;
102
- key: string;
103
- config: {
104
- seams: string[];
105
- visualDiffThreshold: number;
106
- failOnUnresolvedNavigation: boolean;
107
- defaultScenario?: string | undefined;
108
- };
109
- createdAt: string;
110
- repoFullName: string;
111
- githubInstallationId: number | null;
112
- modelSync: {
113
- latestCommit: string | null;
114
- pendingCommit: string | null;
115
- };
116
- updatedAt: string;
117
- }>;
118
- createProject: (req: z.input<typeof CreateProjectRequest>) => Promise<{
119
- id: string;
120
- name: string;
121
- key: string;
122
- config: {
123
- seams: string[];
124
- visualDiffThreshold: number;
125
- failOnUnresolvedNavigation: boolean;
126
- defaultScenario?: string | undefined;
127
- };
128
- createdAt: string;
129
- repoFullName: string;
130
- githubInstallationId: number | null;
131
- modelSync: {
132
- latestCommit: string | null;
133
- pendingCommit: string | null;
134
- };
135
- updatedAt: string;
136
- }>;
137
- patchProject: (id: string, req: z.input<typeof PatchProjectRequest>) => Promise<{
138
- id: string;
139
- name: string;
140
- key: string;
141
- config: {
142
- seams: string[];
143
- visualDiffThreshold: number;
144
- failOnUnresolvedNavigation: boolean;
145
- defaultScenario?: string | undefined;
146
- };
147
- createdAt: string;
148
- repoFullName: string;
149
- githubInstallationId: number | null;
150
- modelSync: {
151
- latestCommit: string | null;
152
- pendingCommit: string | null;
153
- };
154
- updatedAt: string;
155
- }>;
156
- createApiKey: (projectId: string) => Promise<{
157
- id: string;
158
- key: string;
159
- createdAt: string;
160
- projectId: string;
161
- prefix: string;
162
- createdBy: string;
163
- lastUsedAt: string | null;
164
- revokedAt: string | null;
165
- }>;
166
- revokeApiKey: (keyId: string) => Promise<unknown>;
167
- listJourneys: (projectId: string) => Promise<{
168
- status: "active" | "archived";
169
- id: string;
170
- name: string;
171
- key: string;
172
- projectId: string;
173
- verdictCounts: Record<string, number>;
174
- latestVersionCommit: string | null;
175
- }[]>;
176
- getJourney: (id: string, opts?: ConditionalOptions) => Promise<Conditional<JourneyDetailDto>>;
177
- createProposal: (journeyId: string, req: z.input<typeof ProposalRequest>) => Promise<{
178
- prNumber: number;
179
- prUrl: string;
180
- branch: string;
181
- }>;
182
- getBoard: (projectId: string, opts?: ConditionalOptions) => Promise<Conditional<BoardResponse>>;
183
- getCard: (id: string) => Promise<{
184
- status: "planned" | "declared" | "dispatched" | "needs_judgment" | "in_lockstep";
185
- id: string;
186
- journeyKey: string | null;
187
- title: string;
188
- ref: string;
189
- prNumber: number | null;
190
- createdAt: string;
191
- updatedAt: string;
192
- projectId: string;
193
- journeyId: string | null;
194
- verdicts: {
195
- value: "planned" | "matched" | "missing" | "undeclared" | "changed" | "held";
196
- journeyKey: string | null;
197
- family: "structural" | "visual" | "contract" | "executable";
198
- elementKind: "state" | "transition" | "screenshot" | "operation";
199
- elementKey: string;
200
- detail: Record<string, unknown>;
201
- }[];
202
- seq: number;
203
- grain: "journey" | "micro" | "finding" | "backend";
204
- source: "human" | "reconciler" | "canvas";
205
- payload: {
206
- rules: string[];
207
- narrative: string;
208
- kind: "intent";
209
- journeyKey: string | null;
210
- newMachine: {
211
- id: string;
212
- initial: string;
213
- states: Record<string, {
214
- type?: "atomic" | "final" | "compound" | "parallel" | "history" | undefined;
215
- description?: string | undefined;
216
- on?: Record<string, string | {
217
- target: string;
218
- guard?: string | undefined;
219
- actions?: string[] | undefined;
220
- description?: string | undefined;
221
- } | {
222
- target: string;
223
- guard?: string | undefined;
224
- actions?: string[] | undefined;
225
- description?: string | undefined;
226
- }[]> | undefined;
227
- tags?: string[] | undefined;
228
- meta?: Record<string, unknown> | undefined;
229
- }>;
230
- context?: Record<string, unknown> | undefined;
231
- } | null;
232
- delta: {
233
- addStates: Record<string, {
234
- meta: {
235
- testId: string;
236
- route: string;
237
- intent: string;
238
- rules: string[];
239
- referenceAsset?: string | undefined;
240
- };
241
- config: Record<string, unknown>;
242
- }>;
243
- removeStates: string[];
244
- addTransitions: {
245
- from: string;
246
- to: string;
247
- event: string;
248
- guard?: string | undefined;
249
- }[];
250
- removeTransitions: {
251
- from: string;
252
- to: string;
253
- event: string;
254
- }[];
255
- updateMeta: Record<string, {
256
- testId?: string | undefined;
257
- route?: string | undefined;
258
- intent?: string | undefined;
259
- rules?: string[] | undefined;
260
- referenceAsset?: string | undefined;
261
- }>;
262
- addBindings: {
263
- from: string;
264
- event: string;
265
- testId: string;
266
- label?: string | undefined;
267
- }[];
268
- } | null;
269
- scenarios: string[];
270
- referenceAssets: string[];
271
- } | {
272
- kind: "finding";
273
- journeyKey: string | null;
274
- family: "structural" | "visual" | "contract" | "reach";
275
- elementKind: string;
276
- elementKey: string;
277
- runId: string;
278
- detail: Record<string, unknown>;
279
- explanation: string | null;
280
- } | {
281
- kind: "backend";
282
- runId: string | null;
283
- changeKind: "declared" | "contract" | "dependency";
284
- title: string;
285
- summary: string;
286
- declaredReach: {
287
- states: string[];
288
- journeys: string[];
289
- transitions: string[];
290
- } | null;
291
- seams: string[];
292
- reachSummary: string | null;
293
- };
294
- prUrl: string | null;
295
- dispatchedAt: string | null;
296
- sealedAt: string | null;
297
- events: {
298
- id: string;
299
- kind: "dispatched" | "created" | "verdict" | "adopted" | "deferred" | "approved" | "acknowledged" | "sealed" | "pr_linked" | "pr_merged" | "pr_closed" | "reopened";
300
- detail: Record<string, unknown>;
301
- createdAt: string;
302
- cardId: string;
303
- actor: string;
304
- }[];
305
- workOrder: {
306
- bindings: {
307
- from: string;
308
- event: string;
309
- testId: string;
310
- label?: string | undefined;
311
- }[];
312
- cardRef: string;
313
- brief: string;
314
- briefGenerated: boolean;
315
- scenarioFixtures: {
316
- name: string;
317
- seed: number;
318
- overrides?: unknown;
319
- }[];
320
- acceptancePaths: string[][];
321
- conventions: string;
322
- compiledAt: string;
323
- machineDelta?: unknown;
324
- } | null;
325
- backendChange: {
326
- kind: "declared" | "contract" | "dependency";
327
- seams: string[];
328
- held: boolean;
329
- declaredReach?: unknown;
330
- measuredReach?: unknown;
331
- } | null;
332
- }>;
333
- createCard: (req: z.input<typeof CreateCardRequest>) => Promise<{
334
- status: "planned" | "declared" | "dispatched" | "needs_judgment" | "in_lockstep";
335
- id: string;
336
- journeyKey: string | null;
337
- title: string;
338
- ref: string;
339
- prNumber: number | null;
340
- createdAt: string;
341
- updatedAt: string;
342
- projectId: string;
343
- journeyId: string | null;
344
- seq: number;
345
- grain: "journey" | "micro" | "finding" | "backend";
346
- source: "human" | "reconciler" | "canvas";
347
- payload: {
348
- rules: string[];
349
- narrative: string;
350
- kind: "intent";
351
- journeyKey: string | null;
352
- newMachine: {
353
- id: string;
354
- initial: string;
355
- states: Record<string, {
356
- type?: "atomic" | "final" | "compound" | "parallel" | "history" | undefined;
357
- description?: string | undefined;
358
- on?: Record<string, string | {
359
- target: string;
360
- guard?: string | undefined;
361
- actions?: string[] | undefined;
362
- description?: string | undefined;
363
- } | {
364
- target: string;
365
- guard?: string | undefined;
366
- actions?: string[] | undefined;
367
- description?: string | undefined;
368
- }[]> | undefined;
369
- tags?: string[] | undefined;
370
- meta?: Record<string, unknown> | undefined;
371
- }>;
372
- context?: Record<string, unknown> | undefined;
373
- } | null;
374
- delta: {
375
- addStates: Record<string, {
376
- meta: {
377
- testId: string;
378
- route: string;
379
- intent: string;
380
- rules: string[];
381
- referenceAsset?: string | undefined;
382
- };
383
- config: Record<string, unknown>;
384
- }>;
385
- removeStates: string[];
386
- addTransitions: {
387
- from: string;
388
- to: string;
389
- event: string;
390
- guard?: string | undefined;
391
- }[];
392
- removeTransitions: {
393
- from: string;
394
- to: string;
395
- event: string;
396
- }[];
397
- updateMeta: Record<string, {
398
- testId?: string | undefined;
399
- route?: string | undefined;
400
- intent?: string | undefined;
401
- rules?: string[] | undefined;
402
- referenceAsset?: string | undefined;
403
- }>;
404
- addBindings: {
405
- from: string;
406
- event: string;
407
- testId: string;
408
- label?: string | undefined;
409
- }[];
410
- } | null;
411
- scenarios: string[];
412
- referenceAssets: string[];
413
- } | {
414
- kind: "finding";
415
- journeyKey: string | null;
416
- family: "structural" | "visual" | "contract" | "reach";
417
- elementKind: string;
418
- elementKey: string;
419
- runId: string;
420
- detail: Record<string, unknown>;
421
- explanation: string | null;
422
- } | {
423
- kind: "backend";
424
- runId: string | null;
425
- changeKind: "declared" | "contract" | "dependency";
426
- title: string;
427
- summary: string;
428
- declaredReach: {
429
- states: string[];
430
- journeys: string[];
431
- transitions: string[];
432
- } | null;
433
- seams: string[];
434
- reachSummary: string | null;
435
- };
436
- prUrl: string | null;
437
- dispatchedAt: string | null;
438
- sealedAt: string | null;
439
- }>;
440
- dispatch: (cardId: string) => Promise<{
441
- status: "planned" | "declared" | "dispatched" | "needs_judgment" | "in_lockstep";
442
- id: string;
443
- journeyKey: string | null;
444
- title: string;
445
- ref: string;
446
- prNumber: number | null;
447
- createdAt: string;
448
- updatedAt: string;
449
- projectId: string;
450
- journeyId: string | null;
451
- seq: number;
452
- grain: "journey" | "micro" | "finding" | "backend";
453
- source: "human" | "reconciler" | "canvas";
454
- payload: {
455
- rules: string[];
456
- narrative: string;
457
- kind: "intent";
458
- journeyKey: string | null;
459
- newMachine: {
460
- id: string;
461
- initial: string;
462
- states: Record<string, {
463
- type?: "atomic" | "final" | "compound" | "parallel" | "history" | undefined;
464
- description?: string | undefined;
465
- on?: Record<string, string | {
466
- target: string;
467
- guard?: string | undefined;
468
- actions?: string[] | undefined;
469
- description?: string | undefined;
470
- } | {
471
- target: string;
472
- guard?: string | undefined;
473
- actions?: string[] | undefined;
474
- description?: string | undefined;
475
- }[]> | undefined;
476
- tags?: string[] | undefined;
477
- meta?: Record<string, unknown> | undefined;
478
- }>;
479
- context?: Record<string, unknown> | undefined;
480
- } | null;
481
- delta: {
482
- addStates: Record<string, {
483
- meta: {
484
- testId: string;
485
- route: string;
486
- intent: string;
487
- rules: string[];
488
- referenceAsset?: string | undefined;
489
- };
490
- config: Record<string, unknown>;
491
- }>;
492
- removeStates: string[];
493
- addTransitions: {
494
- from: string;
495
- to: string;
496
- event: string;
497
- guard?: string | undefined;
498
- }[];
499
- removeTransitions: {
500
- from: string;
501
- to: string;
502
- event: string;
503
- }[];
504
- updateMeta: Record<string, {
505
- testId?: string | undefined;
506
- route?: string | undefined;
507
- intent?: string | undefined;
508
- rules?: string[] | undefined;
509
- referenceAsset?: string | undefined;
510
- }>;
511
- addBindings: {
512
- from: string;
513
- event: string;
514
- testId: string;
515
- label?: string | undefined;
516
- }[];
517
- } | null;
518
- scenarios: string[];
519
- referenceAssets: string[];
520
- } | {
521
- kind: "finding";
522
- journeyKey: string | null;
523
- family: "structural" | "visual" | "contract" | "reach";
524
- elementKind: string;
525
- elementKey: string;
526
- runId: string;
527
- detail: Record<string, unknown>;
528
- explanation: string | null;
529
- } | {
530
- kind: "backend";
531
- runId: string | null;
532
- changeKind: "declared" | "contract" | "dependency";
533
- title: string;
534
- summary: string;
535
- declaredReach: {
536
- states: string[];
537
- journeys: string[];
538
- transitions: string[];
539
- } | null;
540
- seams: string[];
541
- reachSummary: string | null;
542
- };
543
- prUrl: string | null;
544
- dispatchedAt: string | null;
545
- sealedAt: string | null;
546
- }>;
547
- adopt: (cardId: string, note?: string) => Promise<{
548
- status: "planned" | "declared" | "dispatched" | "needs_judgment" | "in_lockstep";
549
- id: string;
550
- journeyKey: string | null;
551
- title: string;
552
- ref: string;
553
- prNumber: number | null;
554
- createdAt: string;
555
- updatedAt: string;
556
- projectId: string;
557
- journeyId: string | null;
558
- seq: number;
559
- grain: "journey" | "micro" | "finding" | "backend";
560
- source: "human" | "reconciler" | "canvas";
561
- payload: {
562
- rules: string[];
563
- narrative: string;
564
- kind: "intent";
565
- journeyKey: string | null;
566
- newMachine: {
567
- id: string;
568
- initial: string;
569
- states: Record<string, {
570
- type?: "atomic" | "final" | "compound" | "parallel" | "history" | undefined;
571
- description?: string | undefined;
572
- on?: Record<string, string | {
573
- target: string;
574
- guard?: string | undefined;
575
- actions?: string[] | undefined;
576
- description?: string | undefined;
577
- } | {
578
- target: string;
579
- guard?: string | undefined;
580
- actions?: string[] | undefined;
581
- description?: string | undefined;
582
- }[]> | undefined;
583
- tags?: string[] | undefined;
584
- meta?: Record<string, unknown> | undefined;
585
- }>;
586
- context?: Record<string, unknown> | undefined;
587
- } | null;
588
- delta: {
589
- addStates: Record<string, {
590
- meta: {
591
- testId: string;
592
- route: string;
593
- intent: string;
594
- rules: string[];
595
- referenceAsset?: string | undefined;
596
- };
597
- config: Record<string, unknown>;
598
- }>;
599
- removeStates: string[];
600
- addTransitions: {
601
- from: string;
602
- to: string;
603
- event: string;
604
- guard?: string | undefined;
605
- }[];
606
- removeTransitions: {
607
- from: string;
608
- to: string;
609
- event: string;
610
- }[];
611
- updateMeta: Record<string, {
612
- testId?: string | undefined;
613
- route?: string | undefined;
614
- intent?: string | undefined;
615
- rules?: string[] | undefined;
616
- referenceAsset?: string | undefined;
617
- }>;
618
- addBindings: {
619
- from: string;
620
- event: string;
621
- testId: string;
622
- label?: string | undefined;
623
- }[];
624
- } | null;
625
- scenarios: string[];
626
- referenceAssets: string[];
627
- } | {
628
- kind: "finding";
629
- journeyKey: string | null;
630
- family: "structural" | "visual" | "contract" | "reach";
631
- elementKind: string;
632
- elementKey: string;
633
- runId: string;
634
- detail: Record<string, unknown>;
635
- explanation: string | null;
636
- } | {
637
- kind: "backend";
638
- runId: string | null;
639
- changeKind: "declared" | "contract" | "dependency";
640
- title: string;
641
- summary: string;
642
- declaredReach: {
643
- states: string[];
644
- journeys: string[];
645
- transitions: string[];
646
- } | null;
647
- seams: string[];
648
- reachSummary: string | null;
649
- };
650
- prUrl: string | null;
651
- dispatchedAt: string | null;
652
- sealedAt: string | null;
653
- }>;
654
- defer: (cardId: string, note?: string) => Promise<{
655
- status: "planned" | "declared" | "dispatched" | "needs_judgment" | "in_lockstep";
656
- id: string;
657
- journeyKey: string | null;
658
- title: string;
659
- ref: string;
660
- prNumber: number | null;
661
- createdAt: string;
662
- updatedAt: string;
663
- projectId: string;
664
- journeyId: string | null;
665
- seq: number;
666
- grain: "journey" | "micro" | "finding" | "backend";
667
- source: "human" | "reconciler" | "canvas";
668
- payload: {
669
- rules: string[];
670
- narrative: string;
671
- kind: "intent";
672
- journeyKey: string | null;
673
- newMachine: {
674
- id: string;
675
- initial: string;
676
- states: Record<string, {
677
- type?: "atomic" | "final" | "compound" | "parallel" | "history" | undefined;
678
- description?: string | undefined;
679
- on?: Record<string, string | {
680
- target: string;
681
- guard?: string | undefined;
682
- actions?: string[] | undefined;
683
- description?: string | undefined;
684
- } | {
685
- target: string;
686
- guard?: string | undefined;
687
- actions?: string[] | undefined;
688
- description?: string | undefined;
689
- }[]> | undefined;
690
- tags?: string[] | undefined;
691
- meta?: Record<string, unknown> | undefined;
692
- }>;
693
- context?: Record<string, unknown> | undefined;
694
- } | null;
695
- delta: {
696
- addStates: Record<string, {
697
- meta: {
698
- testId: string;
699
- route: string;
700
- intent: string;
701
- rules: string[];
702
- referenceAsset?: string | undefined;
703
- };
704
- config: Record<string, unknown>;
705
- }>;
706
- removeStates: string[];
707
- addTransitions: {
708
- from: string;
709
- to: string;
710
- event: string;
711
- guard?: string | undefined;
712
- }[];
713
- removeTransitions: {
714
- from: string;
715
- to: string;
716
- event: string;
717
- }[];
718
- updateMeta: Record<string, {
719
- testId?: string | undefined;
720
- route?: string | undefined;
721
- intent?: string | undefined;
722
- rules?: string[] | undefined;
723
- referenceAsset?: string | undefined;
724
- }>;
725
- addBindings: {
726
- from: string;
727
- event: string;
728
- testId: string;
729
- label?: string | undefined;
730
- }[];
731
- } | null;
732
- scenarios: string[];
733
- referenceAssets: string[];
734
- } | {
735
- kind: "finding";
736
- journeyKey: string | null;
737
- family: "structural" | "visual" | "contract" | "reach";
738
- elementKind: string;
739
- elementKey: string;
740
- runId: string;
741
- detail: Record<string, unknown>;
742
- explanation: string | null;
743
- } | {
744
- kind: "backend";
745
- runId: string | null;
746
- changeKind: "declared" | "contract" | "dependency";
747
- title: string;
748
- summary: string;
749
- declaredReach: {
750
- states: string[];
751
- journeys: string[];
752
- transitions: string[];
753
- } | null;
754
- seams: string[];
755
- reachSummary: string | null;
756
- };
757
- prUrl: string | null;
758
- dispatchedAt: string | null;
759
- sealedAt: string | null;
760
- }>;
761
- acknowledge: (cardId: string, note?: string) => Promise<{
762
- status: "planned" | "declared" | "dispatched" | "needs_judgment" | "in_lockstep";
763
- id: string;
764
- journeyKey: string | null;
765
- title: string;
766
- ref: string;
767
- prNumber: number | null;
768
- createdAt: string;
769
- updatedAt: string;
770
- projectId: string;
771
- journeyId: string | null;
772
- seq: number;
773
- grain: "journey" | "micro" | "finding" | "backend";
774
- source: "human" | "reconciler" | "canvas";
775
- payload: {
776
- rules: string[];
777
- narrative: string;
778
- kind: "intent";
779
- journeyKey: string | null;
780
- newMachine: {
781
- id: string;
782
- initial: string;
783
- states: Record<string, {
784
- type?: "atomic" | "final" | "compound" | "parallel" | "history" | undefined;
785
- description?: string | undefined;
786
- on?: Record<string, string | {
787
- target: string;
788
- guard?: string | undefined;
789
- actions?: string[] | undefined;
790
- description?: string | undefined;
791
- } | {
792
- target: string;
793
- guard?: string | undefined;
794
- actions?: string[] | undefined;
795
- description?: string | undefined;
796
- }[]> | undefined;
797
- tags?: string[] | undefined;
798
- meta?: Record<string, unknown> | undefined;
799
- }>;
800
- context?: Record<string, unknown> | undefined;
801
- } | null;
802
- delta: {
803
- addStates: Record<string, {
804
- meta: {
805
- testId: string;
806
- route: string;
807
- intent: string;
808
- rules: string[];
809
- referenceAsset?: string | undefined;
810
- };
811
- config: Record<string, unknown>;
812
- }>;
813
- removeStates: string[];
814
- addTransitions: {
815
- from: string;
816
- to: string;
817
- event: string;
818
- guard?: string | undefined;
819
- }[];
820
- removeTransitions: {
821
- from: string;
822
- to: string;
823
- event: string;
824
- }[];
825
- updateMeta: Record<string, {
826
- testId?: string | undefined;
827
- route?: string | undefined;
828
- intent?: string | undefined;
829
- rules?: string[] | undefined;
830
- referenceAsset?: string | undefined;
831
- }>;
832
- addBindings: {
833
- from: string;
834
- event: string;
835
- testId: string;
836
- label?: string | undefined;
837
- }[];
838
- } | null;
839
- scenarios: string[];
840
- referenceAssets: string[];
841
- } | {
842
- kind: "finding";
843
- journeyKey: string | null;
844
- family: "structural" | "visual" | "contract" | "reach";
845
- elementKind: string;
846
- elementKey: string;
847
- runId: string;
848
- detail: Record<string, unknown>;
849
- explanation: string | null;
850
- } | {
851
- kind: "backend";
852
- runId: string | null;
853
- changeKind: "declared" | "contract" | "dependency";
854
- title: string;
855
- summary: string;
856
- declaredReach: {
857
- states: string[];
858
- journeys: string[];
859
- transitions: string[];
860
- } | null;
861
- seams: string[];
862
- reachSummary: string | null;
863
- };
864
- prUrl: string | null;
865
- dispatchedAt: string | null;
866
- sealedAt: string | null;
867
- }>;
868
- approveBaseline: (cardId: string, req?: z.input<typeof ApproveBaselineRequest>) => Promise<{
869
- status: "planned" | "declared" | "dispatched" | "needs_judgment" | "in_lockstep";
870
- id: string;
871
- journeyKey: string | null;
872
- title: string;
873
- ref: string;
874
- prNumber: number | null;
875
- createdAt: string;
876
- updatedAt: string;
877
- projectId: string;
878
- journeyId: string | null;
879
- seq: number;
880
- grain: "journey" | "micro" | "finding" | "backend";
881
- source: "human" | "reconciler" | "canvas";
882
- payload: {
883
- rules: string[];
884
- narrative: string;
885
- kind: "intent";
886
- journeyKey: string | null;
887
- newMachine: {
888
- id: string;
889
- initial: string;
890
- states: Record<string, {
891
- type?: "atomic" | "final" | "compound" | "parallel" | "history" | undefined;
892
- description?: string | undefined;
893
- on?: Record<string, string | {
894
- target: string;
895
- guard?: string | undefined;
896
- actions?: string[] | undefined;
897
- description?: string | undefined;
898
- } | {
899
- target: string;
900
- guard?: string | undefined;
901
- actions?: string[] | undefined;
902
- description?: string | undefined;
903
- }[]> | undefined;
904
- tags?: string[] | undefined;
905
- meta?: Record<string, unknown> | undefined;
906
- }>;
907
- context?: Record<string, unknown> | undefined;
908
- } | null;
909
- delta: {
910
- addStates: Record<string, {
911
- meta: {
912
- testId: string;
913
- route: string;
914
- intent: string;
915
- rules: string[];
916
- referenceAsset?: string | undefined;
917
- };
918
- config: Record<string, unknown>;
919
- }>;
920
- removeStates: string[];
921
- addTransitions: {
922
- from: string;
923
- to: string;
924
- event: string;
925
- guard?: string | undefined;
926
- }[];
927
- removeTransitions: {
928
- from: string;
929
- to: string;
930
- event: string;
931
- }[];
932
- updateMeta: Record<string, {
933
- testId?: string | undefined;
934
- route?: string | undefined;
935
- intent?: string | undefined;
936
- rules?: string[] | undefined;
937
- referenceAsset?: string | undefined;
938
- }>;
939
- addBindings: {
940
- from: string;
941
- event: string;
942
- testId: string;
943
- label?: string | undefined;
944
- }[];
945
- } | null;
946
- scenarios: string[];
947
- referenceAssets: string[];
948
- } | {
949
- kind: "finding";
950
- journeyKey: string | null;
951
- family: "structural" | "visual" | "contract" | "reach";
952
- elementKind: string;
953
- elementKey: string;
954
- runId: string;
955
- detail: Record<string, unknown>;
956
- explanation: string | null;
957
- } | {
958
- kind: "backend";
959
- runId: string | null;
960
- changeKind: "declared" | "contract" | "dependency";
961
- title: string;
962
- summary: string;
963
- declaredReach: {
964
- states: string[];
965
- journeys: string[];
966
- transitions: string[];
967
- } | null;
968
- seams: string[];
969
- reachSummary: string | null;
970
- };
971
- prUrl: string | null;
972
- dispatchedAt: string | null;
973
- sealedAt: string | null;
974
- }>;
975
- createAnnotation: (req: z.input<typeof CreateAnnotationRequest>) => Promise<{
976
- id: string;
977
- stateKey: string;
978
- scenario: string;
979
- createdAt: string;
980
- journeyId: string;
981
- cardId: string;
982
- note: string;
983
- x: number;
984
- y: number;
985
- resolvedAt: string | null;
986
- }>;
987
- patchAnnotation: (id: string, req: z.input<typeof PatchAnnotationRequest>) => Promise<{
988
- id: string;
989
- stateKey: string;
990
- scenario: string;
991
- createdAt: string;
992
- journeyId: string;
993
- cardId: string;
994
- note: string;
995
- x: number;
996
- y: number;
997
- resolvedAt: string | null;
998
- }>;
999
- getRun: (id: string) => Promise<{
1000
- status: "received" | "reconciled" | "failed";
1001
- id: string;
1002
- kind: "deploy" | "pr";
1003
- ref: string;
1004
- deployLabel: string | null;
1005
- env: "staging" | "prod" | "preview";
1006
- startedAt: string;
1007
- finishedAt: string | null;
1008
- projectId: string;
1009
- verdictCounts: Record<string, number>;
1010
- }>;
1011
- getRunArtifacts: (id: string) => Promise<{
1012
- runId: string;
1013
- artifacts: {
1014
- path: string;
1015
- key: string;
1016
- contentType?: string | null | undefined;
1017
- }[];
1018
- }>;
1019
- postErrors: (batch: z.input<typeof ClientErrorBatch>) => Promise<unknown>;
1020
- getOpsStatus: () => Promise<{
1021
- release: string;
1022
- stage: string;
1023
- components: {
1024
- name: "api" | "db" | "s3" | "github" | "bedrock";
1025
- detail: string | null;
1026
- checkedAt: string;
1027
- cached: boolean;
1028
- ok: boolean;
1029
- latencyMs: number | null;
1030
- state?: "ok" | "failing" | "idle" | "off" | undefined;
1031
- }[];
1032
- alerts: {
1033
- topicArn: string | null;
1034
- confirmedSubscriptions: number;
1035
- pendingSubscriptions: number;
1036
- };
1037
- }>;
1038
- getOpsMetrics: (window?: "24h" | "7d" | "30d") => Promise<{
1039
- source: "cloudwatch" | "unavailable";
1040
- uptime: {
1041
- h24: number | null;
1042
- d7: number | null;
1043
- d30: number | null;
1044
- };
1045
- window: "24h" | "7d" | "30d";
1046
- series: {
1047
- fiveXxRate: {
1048
- values: (number | null)[];
1049
- label: string;
1050
- timestamps: string[];
1051
- };
1052
- p50: {
1053
- values: (number | null)[];
1054
- label: string;
1055
- timestamps: string[];
1056
- };
1057
- p95: {
1058
- values: (number | null)[];
1059
- label: string;
1060
- timestamps: string[];
1061
- };
1062
- canarySuccess: {
1063
- values: (number | null)[];
1064
- label: string;
1065
- timestamps: string[];
1066
- };
1067
- };
1068
- }>;
1069
- getOpsErrors: (query?: {
1070
- source?: "server" | "client";
1071
- env?: string;
1072
- window?: string;
1073
- after?: string;
1074
- }) => Promise<{
1075
- groups: {
1076
- message: string;
1077
- env: string;
1078
- source: "server" | "client";
1079
- release: string | null;
1080
- fingerprint: string;
1081
- count: number;
1082
- firstSeen: string;
1083
- lastSeen: string;
1084
- muted: boolean;
1085
- }[];
1086
- nextCursor: string | null;
1087
- }>;
1088
- muteError: (fingerprint: string, muted?: boolean) => Promise<unknown>;
1089
- };
1090
- export type SessionClient = ReturnType<typeof createSessionClient>;
1091
- export {};
1092
- //# sourceMappingURL=session.d.ts.map