@spencerboucher/switchyard-client 0.17.0 → 0.18.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.
@@ -450,7 +450,7 @@ export declare const Profile: z.ZodObject<{
450
450
  }>>;
451
451
  }, z.core.$strip>;
452
452
  export type Profile = z.infer<typeof Profile>;
453
- /** A TUI client (herdr or tmux session) bound to a view. */
453
+ /** Deprecated: a TUI client bound to a view, replaced by `Surface`. */
454
454
  export declare const ViewClient: z.ZodObject<{
455
455
  id: z.ZodString;
456
456
  kind: z.ZodEnum<{
@@ -462,7 +462,7 @@ export declare const ViewClient: z.ZodObject<{
462
462
  lastSeenAt: z.ZodString;
463
463
  }, z.core.$strip>;
464
464
  export type ViewClient = z.infer<typeof ViewClient>;
465
- /** A named filter over sessions, plus pins. TUI clients bind to one. */
465
+ /** A saved filter over branches and sessions, plus pins. Surfaces bind to one. */
466
466
  export declare const View: z.ZodObject<{
467
467
  id: z.ZodString;
468
468
  name: z.ZodString;
@@ -473,7 +473,7 @@ export declare const View: z.ZodObject<{
473
473
  projectIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
474
474
  hostIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
475
475
  sessionIds: z.ZodArray<z.ZodString>;
476
- clients: z.ZodArray<z.ZodObject<{
476
+ clients: z.ZodDefault<z.ZodArray<z.ZodObject<{
477
477
  id: z.ZodString;
478
478
  kind: z.ZodEnum<{
479
479
  herdr: "herdr";
@@ -482,13 +482,37 @@ export declare const View: z.ZodObject<{
482
482
  name: z.ZodString;
483
483
  machine: z.ZodString;
484
484
  lastSeenAt: z.ZodString;
485
- }, z.core.$strip>>;
485
+ }, z.core.$strip>>>;
486
486
  trackerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
487
487
  clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
488
488
  createdAt: z.ZodString;
489
489
  updatedAt: z.ZodString;
490
490
  }, z.core.$strip>;
491
491
  export type View = z.infer<typeof View>;
492
+ export declare const SurfaceKind: z.ZodEnum<{
493
+ herdr: "herdr";
494
+ tmux: "tmux";
495
+ }>;
496
+ export type SurfaceKind = z.infer<typeof SurfaceKind>;
497
+ /**
498
+ * A terminal multiplexer session (herdr, tmux) that shows a view: owned by the signed-in device
499
+ * that reports it, optionally on a host (coordinator-owned).
500
+ */
501
+ export declare const Surface: z.ZodObject<{
502
+ id: z.ZodString;
503
+ kind: z.ZodEnum<{
504
+ herdr: "herdr";
505
+ tmux: "tmux";
506
+ }>;
507
+ name: z.ZodString;
508
+ machine: z.ZodString;
509
+ deviceId: z.ZodString;
510
+ hostId: z.ZodNullable<z.ZodString>;
511
+ viewId: z.ZodNullable<z.ZodString>;
512
+ lastSeenAt: z.ZodString;
513
+ createdAt: z.ZodString;
514
+ }, z.core.$strip>;
515
+ export type Surface = z.infer<typeof Surface>;
492
516
  export declare const RuntimeState: z.ZodEnum<{
493
517
  failed: "failed";
494
518
  idle: "idle";
@@ -644,6 +668,9 @@ export declare const Session: z.ZodObject<{
644
668
  external: z.ZodOptional<z.ZodNullable<z.ZodObject<{
645
669
  client: z.ZodNullable<z.ZodString>;
646
670
  }, z.core.$strip>>>;
671
+ parentSessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
672
+ primary: z.ZodOptional<z.ZodBoolean>;
673
+ startedIn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
647
674
  unreadSince: z.ZodOptional<z.ZodNullable<z.ZodString>>;
648
675
  adapterGeneration: z.ZodOptional<z.ZodString>;
649
676
  transcriptEpoch: z.ZodOptional<z.ZodNumber>;
@@ -820,36 +847,6 @@ export declare const Task: z.ZodObject<{
820
847
  url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
821
848
  launchPrompt: z.ZodString;
822
849
  }, z.core.$strict>>;
823
- tracker: z.ZodOptional<z.ZodObject<{
824
- trackerId: z.ZodString;
825
- itemId: z.ZodString;
826
- repository: z.ZodString;
827
- number: z.ZodNumber;
828
- assignees: z.ZodArray<z.ZodString>;
829
- branch: z.ZodNullable<z.ZodString>;
830
- workspaceId: z.ZodNullable<z.ZodString>;
831
- pullRequest: z.ZodNullable<z.ZodObject<{
832
- number: z.ZodNumber;
833
- state: z.ZodEnum<{
834
- CLOSED: "CLOSED";
835
- MERGED: "MERGED";
836
- OPEN: "OPEN";
837
- }>;
838
- url: z.ZodString;
839
- headRefName: z.ZodString;
840
- }, z.core.$strip>>;
841
- board: z.ZodNullable<z.ZodObject<{
842
- projectId: z.ZodString;
843
- projectItemId: z.ZodString;
844
- fieldId: z.ZodString;
845
- status: z.ZodNullable<z.ZodString>;
846
- statusOptionId: z.ZodNullable<z.ZodString>;
847
- options: z.ZodArray<z.ZodObject<{
848
- id: z.ZodString;
849
- name: z.ZodString;
850
- }, z.core.$strip>>;
851
- }, z.core.$strip>>;
852
- }, z.core.$strip>>;
853
850
  currentRunId: z.ZodNullable<z.ZodString>;
854
851
  sessionId: z.ZodNullable<z.ZodString>;
855
852
  review: z.ZodObject<{
@@ -281,7 +281,7 @@ export declare const EventDataSchemas: {
281
281
  projectIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
282
282
  hostIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
283
283
  sessionIds: z.ZodArray<z.ZodString>;
284
- clients: z.ZodArray<z.ZodObject<{
284
+ clients: z.ZodDefault<z.ZodArray<z.ZodObject<{
285
285
  id: z.ZodString;
286
286
  kind: z.ZodEnum<{
287
287
  herdr: "herdr";
@@ -290,7 +290,7 @@ export declare const EventDataSchemas: {
290
290
  name: z.ZodString;
291
291
  machine: z.ZodString;
292
292
  lastSeenAt: z.ZodString;
293
- }, z.core.$strip>>;
293
+ }, z.core.$strip>>>;
294
294
  trackerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
295
295
  clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
296
  createdAt: z.ZodString;
@@ -415,6 +415,9 @@ export declare const EventDataSchemas: {
415
415
  external: z.ZodOptional<z.ZodNullable<z.ZodObject<{
416
416
  client: z.ZodNullable<z.ZodString>;
417
417
  }, z.core.$strip>>>;
418
+ parentSessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
419
+ primary: z.ZodOptional<z.ZodBoolean>;
420
+ startedIn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
418
421
  unreadSince: z.ZodOptional<z.ZodNullable<z.ZodString>>;
419
422
  adapterGeneration: z.ZodOptional<z.ZodString>;
420
423
  transcriptEpoch: z.ZodOptional<z.ZodNumber>;
@@ -730,36 +733,6 @@ export declare const EventDataSchemas: {
730
733
  url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
731
734
  launchPrompt: z.ZodString;
732
735
  }, z.core.$strict>>;
733
- tracker: z.ZodOptional<z.ZodObject<{
734
- trackerId: z.ZodString;
735
- itemId: z.ZodString;
736
- repository: z.ZodString;
737
- number: z.ZodNumber;
738
- assignees: z.ZodArray<z.ZodString>;
739
- branch: z.ZodNullable<z.ZodString>;
740
- workspaceId: z.ZodNullable<z.ZodString>;
741
- pullRequest: z.ZodNullable<z.ZodObject<{
742
- number: z.ZodNumber;
743
- state: z.ZodEnum<{
744
- CLOSED: "CLOSED";
745
- MERGED: "MERGED";
746
- OPEN: "OPEN";
747
- }>;
748
- url: z.ZodString;
749
- headRefName: z.ZodString;
750
- }, z.core.$strip>>;
751
- board: z.ZodNullable<z.ZodObject<{
752
- projectId: z.ZodString;
753
- projectItemId: z.ZodString;
754
- fieldId: z.ZodString;
755
- status: z.ZodNullable<z.ZodString>;
756
- statusOptionId: z.ZodNullable<z.ZodString>;
757
- options: z.ZodArray<z.ZodObject<{
758
- id: z.ZodString;
759
- name: z.ZodString;
760
- }, z.core.$strip>>;
761
- }, z.core.$strip>>;
762
- }, z.core.$strip>>;
763
736
  currentRunId: z.ZodNullable<z.ZodString>;
764
737
  sessionId: z.ZodNullable<z.ZodString>;
765
738
  review: z.ZodObject<{
@@ -1005,6 +978,75 @@ export declare const EventDataSchemas: {
1005
978
  passkey: "passkey";
1006
979
  }>>;
1007
980
  }, z.core.$strip>;
981
+ readonly "issue.updated": z.ZodObject<{
982
+ id: z.ZodString;
983
+ trackerId: z.ZodString;
984
+ itemId: z.ZodString;
985
+ projectId: z.ZodString;
986
+ repository: z.ZodString;
987
+ number: z.ZodNumber;
988
+ title: z.ZodString;
989
+ url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
990
+ assignees: z.ZodArray<z.ZodString>;
991
+ branches: z.ZodArray<z.ZodString>;
992
+ branch: z.ZodNullable<z.ZodString>;
993
+ workspaceId: z.ZodNullable<z.ZodString>;
994
+ pullRequest: z.ZodNullable<z.ZodObject<{
995
+ number: z.ZodNumber;
996
+ state: z.ZodEnum<{
997
+ CLOSED: "CLOSED";
998
+ MERGED: "MERGED";
999
+ OPEN: "OPEN";
1000
+ }>;
1001
+ url: z.ZodString;
1002
+ headRefName: z.ZodString;
1003
+ }, z.core.$strip>>;
1004
+ board: z.ZodNullable<z.ZodObject<{
1005
+ projectId: z.ZodString;
1006
+ projectItemId: z.ZodString;
1007
+ fieldId: z.ZodString;
1008
+ status: z.ZodNullable<z.ZodString>;
1009
+ statusOptionId: z.ZodNullable<z.ZodString>;
1010
+ options: z.ZodArray<z.ZodObject<{
1011
+ id: z.ZodString;
1012
+ name: z.ZodString;
1013
+ }, z.core.$strip>>;
1014
+ priority: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1015
+ name: z.ZodString;
1016
+ rank: z.ZodNumber;
1017
+ }, z.core.$strip>>>;
1018
+ }, z.core.$strip>>;
1019
+ parent: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1020
+ number: z.ZodNumber;
1021
+ title: z.ZodString;
1022
+ url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1023
+ }, z.core.$strip>>>;
1024
+ subIssues: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1025
+ total: z.ZodNumber;
1026
+ completed: z.ZodNumber;
1027
+ }, z.core.$strip>>>;
1028
+ updatedAt: z.ZodString;
1029
+ }, z.core.$strip>;
1030
+ readonly "issue.deleted": z.ZodObject<{
1031
+ id: z.ZodString;
1032
+ }, z.core.$strip>;
1033
+ readonly "surface.updated": z.ZodObject<{
1034
+ id: z.ZodString;
1035
+ kind: z.ZodEnum<{
1036
+ herdr: "herdr";
1037
+ tmux: "tmux";
1038
+ }>;
1039
+ name: z.ZodString;
1040
+ machine: z.ZodString;
1041
+ deviceId: z.ZodString;
1042
+ hostId: z.ZodNullable<z.ZodString>;
1043
+ viewId: z.ZodNullable<z.ZodString>;
1044
+ lastSeenAt: z.ZodString;
1045
+ createdAt: z.ZodString;
1046
+ }, z.core.$strip>;
1047
+ readonly "surface.deleted": z.ZodObject<{
1048
+ id: z.ZodString;
1049
+ }, z.core.$strip>;
1008
1050
  readonly "settings.updated": z.ZodObject<{
1009
1051
  dispatchPaused: z.ZodBoolean;
1010
1052
  }, z.core.$strip>;
@@ -1024,6 +1066,8 @@ export declare const EventTypeSchema: z.ZodPreprocess<z.ZodEnum<{
1024
1066
  diagnostic: "diagnostic";
1025
1067
  "host.updated": "host.updated";
1026
1068
  "interaction.updated": "interaction.updated";
1069
+ "issue.deleted": "issue.deleted";
1070
+ "issue.updated": "issue.updated";
1027
1071
  "occurrence.created": "occurrence.created";
1028
1072
  "occurrence.updated": "occurrence.updated";
1029
1073
  "panel.updated": "panel.updated";
@@ -1034,6 +1078,8 @@ export declare const EventTypeSchema: z.ZodPreprocess<z.ZodEnum<{
1034
1078
  "run.updated": "run.updated";
1035
1079
  "session.updated": "session.updated";
1036
1080
  "settings.updated": "settings.updated";
1081
+ "surface.deleted": "surface.deleted";
1082
+ "surface.updated": "surface.updated";
1037
1083
  "task.deleted": "task.deleted";
1038
1084
  "task.updated": "task.updated";
1039
1085
  "transcript.item": "transcript.item";
@@ -1068,6 +1114,8 @@ export declare const EventEnvelope: z.ZodObject<{
1068
1114
  diagnostic: "diagnostic";
1069
1115
  "host.updated": "host.updated";
1070
1116
  "interaction.updated": "interaction.updated";
1117
+ "issue.deleted": "issue.deleted";
1118
+ "issue.updated": "issue.updated";
1071
1119
  "occurrence.created": "occurrence.created";
1072
1120
  "occurrence.updated": "occurrence.updated";
1073
1121
  "panel.updated": "panel.updated";
@@ -1078,6 +1126,8 @@ export declare const EventEnvelope: z.ZodObject<{
1078
1126
  "run.updated": "run.updated";
1079
1127
  "session.updated": "session.updated";
1080
1128
  "settings.updated": "settings.updated";
1129
+ "surface.deleted": "surface.deleted";
1130
+ "surface.updated": "surface.updated";
1081
1131
  "task.deleted": "task.deleted";
1082
1132
  "task.updated": "task.updated";
1083
1133
  "transcript.item": "transcript.item";
@@ -285,7 +285,13 @@ export declare const HostCommand: z.ZodDiscriminatedUnion<[z.ZodObject<{
285
285
  board: z.ZodNullable<z.ZodObject<{
286
286
  projectNumber: z.ZodNumber;
287
287
  statusField: z.ZodString;
288
+ priorityField: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
289
  }, z.core.$strip>>;
290
+ follow: z.ZodOptional<z.ZodEnum<{
291
+ assigned: "assigned";
292
+ board: "board";
293
+ }>>;
294
+ backlog: z.ZodOptional<z.ZodArray<z.ZodString>>;
289
295
  type: z.ZodLiteral<"tracker.sync">;
290
296
  }, z.core.$strip>, z.ZodObject<{
291
297
  checkoutPath: z.ZodString;
@@ -307,6 +313,7 @@ export declare const HostCommand: z.ZodDiscriminatedUnion<[z.ZodObject<{
307
313
  expectedOptionId: z.ZodNullable<z.ZodString>;
308
314
  login: z.ZodString;
309
315
  allowShared: z.ZodBoolean;
316
+ allowUnassigned: z.ZodOptional<z.ZodBoolean>;
310
317
  type: z.ZodLiteral<"tracker.setStatus">;
311
318
  }, z.core.$strip>, z.ZodObject<{
312
319
  type: z.ZodLiteral<"dispatch.start">;
@@ -1408,7 +1415,13 @@ export declare const CoordinatorToHost: z.ZodDiscriminatedUnion<[z.ZodObject<{
1408
1415
  board: z.ZodNullable<z.ZodObject<{
1409
1416
  projectNumber: z.ZodNumber;
1410
1417
  statusField: z.ZodString;
1418
+ priorityField: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1411
1419
  }, z.core.$strip>>;
1420
+ follow: z.ZodOptional<z.ZodEnum<{
1421
+ assigned: "assigned";
1422
+ board: "board";
1423
+ }>>;
1424
+ backlog: z.ZodOptional<z.ZodArray<z.ZodString>>;
1412
1425
  type: z.ZodLiteral<"tracker.sync">;
1413
1426
  }, z.core.$strip>, z.ZodObject<{
1414
1427
  checkoutPath: z.ZodString;
@@ -1430,6 +1443,7 @@ export declare const CoordinatorToHost: z.ZodDiscriminatedUnion<[z.ZodObject<{
1430
1443
  expectedOptionId: z.ZodNullable<z.ZodString>;
1431
1444
  login: z.ZodString;
1432
1445
  allowShared: z.ZodBoolean;
1446
+ allowUnassigned: z.ZodOptional<z.ZodBoolean>;
1433
1447
  type: z.ZodLiteral<"tracker.setStatus">;
1434
1448
  }, z.core.$strip>, z.ZodObject<{
1435
1449
  type: z.ZodLiteral<"dispatch.start">;
@@ -3,6 +3,7 @@ export * from "./adapters.js";
3
3
  export * from "./agent-wire.js";
4
4
  export * from "./api.js";
5
5
  export * from "./backoff.js";
6
+ export * from "./branches.js";
6
7
  export * from "./client-wire.js";
7
8
  export * from "./contributions.js";
8
9
  export * from "./entities.js";
@@ -19,7 +20,7 @@ export * from "./ui.js";
19
20
  export * from "./views.js";
20
21
  export * from "./web-bridge.js";
21
22
  export declare const PROTOCOL_VERSION = 1;
22
- export declare const PI_SUPPORTED_RANGE = ">=1.4.0 <1.6.0";
23
+ export declare const PI_SUPPORTED_RANGE = ">=1.4.0 <1.7.0";
23
24
  export declare const DEFAULT_PORT = 7400;
24
25
  export declare const MARKERS: {
25
26
  readonly done: "SWITCHYARD: DONE";
@@ -1,6 +1,14 @@
1
1
  import { z } from "zod";
2
2
  /** Host feature: the host answers `tracker.*` commands. */
3
3
  export declare const TRACKERS_FEATURE = "trackers.v1";
4
+ /** Host feature: tracker.sync can follow a board and skip backlog columns. */
5
+ export declare const TRACKER_BOARD_FEATURE = "trackers.board.v1";
6
+ /** Which issues a tracker follows: those assigned to you, or every open issue on its board. */
7
+ export declare const TrackerFollow: z.ZodEnum<{
8
+ assigned: "assigned";
9
+ board: "board";
10
+ }>;
11
+ export type TrackerFollow = z.infer<typeof TrackerFollow>;
4
12
  export declare const GitHubLogin: z.ZodString;
5
13
  export declare const TrackerStatusOption: z.ZodObject<{
6
14
  id: z.ZodString;
@@ -12,6 +20,8 @@ export declare const TrackerBoard: z.ZodObject<{
12
20
  statusField: z.ZodDefault<z.ZodString>;
13
21
  onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
14
22
  onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
23
+ priorityField: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ backlog: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
25
  }, z.core.$strip>;
16
26
  export type TrackerBoard = z.infer<typeof TrackerBoard>;
17
27
  export declare const Tracker: z.ZodObject<{
@@ -27,9 +37,16 @@ export declare const Tracker: z.ZodObject<{
27
37
  statusField: z.ZodDefault<z.ZodString>;
28
38
  onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
29
39
  onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
40
+ priorityField: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
+ backlog: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
42
  }, z.core.$strip>>;
43
+ follow: z.ZodOptional<z.ZodEnum<{
44
+ assigned: "assigned";
45
+ board: "board";
46
+ }>>;
31
47
  writeBack: z.ZodBoolean;
32
48
  moveShared: z.ZodBoolean;
49
+ worktrees: z.ZodOptional<z.ZodBoolean>;
33
50
  enabled: z.ZodBoolean;
34
51
  login: z.ZodNullable<z.ZodString>;
35
52
  lastSyncedAt: z.ZodNullable<z.ZodString>;
@@ -38,6 +55,10 @@ export declare const Tracker: z.ZodObject<{
38
55
  updatedAt: z.ZodString;
39
56
  }, z.core.$strip>;
40
57
  export type Tracker = z.infer<typeof Tracker>;
58
+ /** Stored trackers lack the newer fields: always read them through these. */
59
+ export declare const trackerFollow: (t: Pick<Tracker, "follow" | "board">) => TrackerFollow;
60
+ export declare const trackerMakesWorktrees: (t: Pick<Tracker, "worktrees">) => boolean;
61
+ export declare const trackerBacklog: (t: Pick<Tracker, "board">) => string[];
41
62
  export declare const TrackerInput: z.ZodObject<{
42
63
  name: z.ZodString;
43
64
  hostId: z.ZodString;
@@ -49,9 +70,16 @@ export declare const TrackerInput: z.ZodObject<{
49
70
  statusField: z.ZodDefault<z.ZodString>;
50
71
  onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
51
72
  onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
73
+ priorityField: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ backlog: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
75
  }, z.core.$strip>>>;
76
+ follow: z.ZodDefault<z.ZodEnum<{
77
+ assigned: "assigned";
78
+ board: "board";
79
+ }>>;
53
80
  writeBack: z.ZodDefault<z.ZodBoolean>;
54
81
  moveShared: z.ZodDefault<z.ZodBoolean>;
82
+ worktrees: z.ZodDefault<z.ZodBoolean>;
55
83
  enabled: z.ZodDefault<z.ZodBoolean>;
56
84
  }, z.core.$strip>;
57
85
  export type TrackerInput = z.input<typeof TrackerInput>;
@@ -66,9 +94,16 @@ export declare const TrackerPatch: z.ZodObject<{
66
94
  statusField: z.ZodDefault<z.ZodString>;
67
95
  onStart: z.ZodDefault<z.ZodNullable<z.ZodString>>;
68
96
  onReview: z.ZodDefault<z.ZodNullable<z.ZodString>>;
97
+ priorityField: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
+ backlog: z.ZodOptional<z.ZodArray<z.ZodString>>;
69
99
  }, z.core.$strip>>>;
100
+ follow: z.ZodOptional<z.ZodEnum<{
101
+ assigned: "assigned";
102
+ board: "board";
103
+ }>>;
70
104
  writeBack: z.ZodOptional<z.ZodBoolean>;
71
105
  moveShared: z.ZodOptional<z.ZodBoolean>;
106
+ worktrees: z.ZodOptional<z.ZodBoolean>;
72
107
  enabled: z.ZodOptional<z.ZodBoolean>;
73
108
  }, z.core.$strip>;
74
109
  export type TrackerPatch = z.input<typeof TrackerPatch>;
@@ -82,6 +117,10 @@ export declare const TrackerItemBoard: z.ZodObject<{
82
117
  id: z.ZodString;
83
118
  name: z.ZodString;
84
119
  }, z.core.$strip>>;
120
+ priority: z.ZodOptional<z.ZodNullable<z.ZodObject<{
121
+ name: z.ZodString;
122
+ rank: z.ZodNumber;
123
+ }, z.core.$strip>>>;
85
124
  }, z.core.$strip>;
86
125
  export type TrackerItemBoard = z.infer<typeof TrackerItemBoard>;
87
126
  export declare const TrackerPullRequest: z.ZodObject<{
@@ -95,6 +134,17 @@ export declare const TrackerPullRequest: z.ZodObject<{
95
134
  headRefName: z.ZodString;
96
135
  }, z.core.$strip>;
97
136
  export type TrackerPullRequest = z.infer<typeof TrackerPullRequest>;
137
+ export declare const TrackerParent: z.ZodObject<{
138
+ number: z.ZodNumber;
139
+ title: z.ZodString;
140
+ url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
141
+ }, z.core.$strip>;
142
+ export type TrackerParent = z.infer<typeof TrackerParent>;
143
+ export declare const TrackerSubIssues: z.ZodObject<{
144
+ total: z.ZodNumber;
145
+ completed: z.ZodNumber;
146
+ }, z.core.$strip>;
147
+ export type TrackerSubIssues = z.infer<typeof TrackerSubIssues>;
98
148
  export declare const TrackerItem: z.ZodObject<{
99
149
  itemId: z.ZodString;
100
150
  repository: z.ZodString;
@@ -123,7 +173,20 @@ export declare const TrackerItem: z.ZodObject<{
123
173
  id: z.ZodString;
124
174
  name: z.ZodString;
125
175
  }, z.core.$strip>>;
176
+ priority: z.ZodOptional<z.ZodNullable<z.ZodObject<{
177
+ name: z.ZodString;
178
+ rank: z.ZodNumber;
179
+ }, z.core.$strip>>>;
126
180
  }, z.core.$strip>>;
181
+ parent: z.ZodOptional<z.ZodNullable<z.ZodObject<{
182
+ number: z.ZodNumber;
183
+ title: z.ZodString;
184
+ url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
185
+ }, z.core.$strip>>>;
186
+ subIssues: z.ZodOptional<z.ZodNullable<z.ZodObject<{
187
+ total: z.ZodNumber;
188
+ completed: z.ZodNumber;
189
+ }, z.core.$strip>>>;
127
190
  }, z.core.$strip>;
128
191
  export type TrackerItem = z.infer<typeof TrackerItem>;
129
192
  export declare const TrackerSyncResult: z.ZodObject<{
@@ -156,18 +219,39 @@ export declare const TrackerSyncResult: z.ZodObject<{
156
219
  id: z.ZodString;
157
220
  name: z.ZodString;
158
221
  }, z.core.$strip>>;
222
+ priority: z.ZodOptional<z.ZodNullable<z.ZodObject<{
223
+ name: z.ZodString;
224
+ rank: z.ZodNumber;
225
+ }, z.core.$strip>>>;
159
226
  }, z.core.$strip>>;
227
+ parent: z.ZodOptional<z.ZodNullable<z.ZodObject<{
228
+ number: z.ZodNumber;
229
+ title: z.ZodString;
230
+ url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
231
+ }, z.core.$strip>>>;
232
+ subIssues: z.ZodOptional<z.ZodNullable<z.ZodObject<{
233
+ total: z.ZodNumber;
234
+ completed: z.ZodNumber;
235
+ }, z.core.$strip>>>;
160
236
  }, z.core.$strip>>;
161
237
  truncated: z.ZodBoolean;
162
238
  }, z.core.$strip>;
163
239
  export type TrackerSyncResult = z.infer<typeof TrackerSyncResult>;
164
- /** A task's link to its tracker item (server-owned). */
165
- export declare const TaskTracker: z.ZodObject<{
240
+ /**
241
+ * One open issue a tracker follows ("Issue" in the UI). It decorates the branch it is
242
+ * worked on, or waits as not started (coordinator-owned snapshot; GitHub is authoritative).
243
+ */
244
+ export declare const TrackedIssue: z.ZodObject<{
245
+ id: z.ZodString;
166
246
  trackerId: z.ZodString;
167
247
  itemId: z.ZodString;
248
+ projectId: z.ZodString;
168
249
  repository: z.ZodString;
169
250
  number: z.ZodNumber;
251
+ title: z.ZodString;
252
+ url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
170
253
  assignees: z.ZodArray<z.ZodString>;
254
+ branches: z.ZodArray<z.ZodString>;
171
255
  branch: z.ZodNullable<z.ZodString>;
172
256
  workspaceId: z.ZodNullable<z.ZodString>;
173
257
  pullRequest: z.ZodNullable<z.ZodObject<{
@@ -190,9 +274,31 @@ export declare const TaskTracker: z.ZodObject<{
190
274
  id: z.ZodString;
191
275
  name: z.ZodString;
192
276
  }, z.core.$strip>>;
277
+ priority: z.ZodOptional<z.ZodNullable<z.ZodObject<{
278
+ name: z.ZodString;
279
+ rank: z.ZodNumber;
280
+ }, z.core.$strip>>>;
193
281
  }, z.core.$strip>>;
282
+ parent: z.ZodOptional<z.ZodNullable<z.ZodObject<{
283
+ number: z.ZodNumber;
284
+ title: z.ZodString;
285
+ url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
286
+ }, z.core.$strip>>>;
287
+ subIssues: z.ZodOptional<z.ZodNullable<z.ZodObject<{
288
+ total: z.ZodNumber;
289
+ completed: z.ZodNumber;
290
+ }, z.core.$strip>>>;
291
+ updatedAt: z.ZodString;
194
292
  }, z.core.$strip>;
195
- export type TaskTracker = z.infer<typeof TaskTracker>;
293
+ export type TrackedIssue = z.infer<typeof TrackedIssue>;
294
+ export declare const trackedIssueId: (trackerId: string, itemId: string) => string;
295
+ export declare const OpenIssueRequest: z.ZodObject<{
296
+ hostId: z.ZodOptional<z.ZodString>;
297
+ viewId: z.ZodOptional<z.ZodString>;
298
+ prompt: z.ZodOptional<z.ZodString>;
299
+ profileId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ }, z.core.$strip>;
301
+ export type OpenIssueRequest = z.infer<typeof OpenIssueRequest>;
196
302
  export declare const TrackerSetStatusResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
197
303
  status: z.ZodLiteral<"moved">;
198
304
  }, z.core.$strip>, z.ZodObject<{
@@ -204,7 +310,12 @@ export declare const TrackerSetStatusResult: z.ZodDiscriminatedUnion<[z.ZodObjec
204
310
  }>;
205
311
  }, z.core.$strip>], "status">;
206
312
  export type TrackerSetStatusResult = z.infer<typeof TrackerSetStatusResult>;
207
- /** POST /api/tasks/:id/tracker/status */
313
+ /** POST /api/issues/:id/link */
314
+ export declare const LinkIssueRequest: z.ZodObject<{
315
+ workspaceId: z.ZodString;
316
+ }, z.core.$strip>;
317
+ export type LinkIssueRequest = z.infer<typeof LinkIssueRequest>;
318
+ /** POST /api/issues/:id/status */
208
319
  export declare const TrackerStatusRequest: z.ZodObject<{
209
320
  status: z.ZodString;
210
321
  }, z.core.$strip>;
@@ -215,7 +326,13 @@ export declare const TrackerHostSyncRequest: z.ZodObject<{
215
326
  board: z.ZodNullable<z.ZodObject<{
216
327
  projectNumber: z.ZodNumber;
217
328
  statusField: z.ZodString;
329
+ priorityField: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
330
  }, z.core.$strip>>;
331
+ follow: z.ZodOptional<z.ZodEnum<{
332
+ assigned: "assigned";
333
+ board: "board";
334
+ }>>;
335
+ backlog: z.ZodOptional<z.ZodArray<z.ZodString>>;
219
336
  }, z.core.$strip>;
220
337
  export type TrackerHostSyncRequest = z.infer<typeof TrackerHostSyncRequest>;
221
338
  export declare const TrackerHostPrepareBranchRequest: z.ZodObject<{
@@ -239,6 +356,7 @@ export declare const TrackerHostSetStatusRequest: z.ZodObject<{
239
356
  expectedOptionId: z.ZodNullable<z.ZodString>;
240
357
  login: z.ZodString;
241
358
  allowShared: z.ZodBoolean;
359
+ allowUnassigned: z.ZodOptional<z.ZodBoolean>;
242
360
  }, z.core.$strip>;
243
361
  export type TrackerHostSetStatusRequest = z.infer<typeof TrackerHostSetStatusRequest>;
244
362
  //# sourceMappingURL=trackers.d.ts.map
@@ -1,11 +1,39 @@
1
- import type { Session, Task, View, ViewClient, Workspace } from "./entities.js";
2
- /** A client counts as open in a view while its last report is younger than this. */
3
- export declare const CLIENT_OPEN_MS: number;
4
- type WorkspaceLookup = Record<string, Pick<Workspace, "projectId">> | Map<string, Pick<Workspace, "projectId">>;
5
- /** Is a session in a view? Archived sessions never are. */
6
- export declare function sessionInView(view: View, s: Pick<Session, "id" | "projectId" | "workspaceId" | "hostId" | "archivedAt">, workspaces: WorkspaceLookup): boolean;
7
- /** Clients that reported recently, sorted by kind then name. */
8
- export declare function openClients(view: View, now?: number): ViewClient[];
1
+ import type { RuntimeState, Session, Surface, Task, View, Workspace } from "./entities.js";
2
+ import type { TrackedIssue } from "./trackers.js";
3
+ /** A surface counts as open while its last report is younger than this. */
4
+ export declare const SURFACE_OPEN_MS: number;
5
+ export declare const LIVE_RUNTIMES: readonly ["starting", "idle", "running", "waiting_input"];
6
+ export declare function isLiveRuntime(r: RuntimeState): boolean;
7
+ type WorkspaceRef = Pick<Workspace, "projectId"> & {
8
+ branch?: string | null;
9
+ };
10
+ export type WorkspaceLookup = Record<string, WorkspaceRef> | Map<string, WorkspaceRef>;
11
+ /** The branches a tracker's issues are worked on: what a tracker's view holds besides live sessions. */
12
+ export interface TrackerScope {
13
+ trackerId: string;
14
+ workspaceIds: Set<string>;
15
+ /** `${projectId}\n${branch}` */
16
+ branches: Set<string>;
17
+ }
18
+ export declare function trackerScope(view: Pick<View, "trackerId">, issues: Iterable<Pick<TrackedIssue, "trackerId" | "projectId" | "workspaceId" | "branch" | "branches">>): TrackerScope | null;
19
+ /** Is this workspace one of the tracker's issue branches (by worktree or branch name)? */
20
+ export declare function scopeHasWorkspace(scope: TrackerScope, ws: {
21
+ id: string;
22
+ projectId: string;
23
+ branch?: string | null;
24
+ }): boolean;
25
+ /** Why a session is in a view: pinned, started in its source, on a tracker's issue, live, or by the filters. */
26
+ export type ViewReason = "pinned" | "client" | "issue" | "live" | "filter";
27
+ type ViewSession = Pick<Session, "id" | "projectId" | "workspaceId" | "hostId" | "archivedAt" | "startedIn" | "runtime">;
28
+ /** Why a session is in a view; null when it is not. See `sessionInView`. */
29
+ export declare function sessionViewReason(view: View, s: ViewSession, workspaces: WorkspaceLookup, scope?: TrackerScope | null): ViewReason | null;
30
+ /**
31
+ * Is a session in a view? Archived sessions never are. In a tracker's view (given its scope):
32
+ * sessions on its issues' branches, and live sessions in its projects.
33
+ */
34
+ export declare function sessionInView(view: View, s: ViewSession, workspaces: WorkspaceLookup, scope?: TrackerScope | null): boolean;
35
+ /** Surfaces showing a view that reported recently, sorted by kind then name. */
36
+ export declare function openSurfaces(surfaces: Surface[], viewId: string, now?: number): Surface[];
9
37
  /** Resolve a view by id, else by case-insensitive name; null if absent or ambiguous. */
10
38
  export declare function findView(views: View[], ref: string): View | null;
11
39
  /** Is a task in a view? By its project, or because its session is pinned. Host filters do not apply to tasks. */
@@ -1,4 +1,4 @@
1
- import type { AttentionItem, Automation, Checkout, Device, EventEnvelope, Host, Interaction, Panel, Profile, Project, Run, Session, SyncState, Task, View, Workspace } from "./protocol/index.js";
1
+ import type { AttentionItem, Automation, Checkout, Device, EventEnvelope, Host, Interaction, Panel, Profile, Project, Run, Session, Surface, SyncState, Task, TrackedIssue, View, Workspace } from "./protocol/index.js";
2
2
  /**
3
3
  * Normalized client state of coordinator entities and its pure reducers: durable events apply
4
4
  * once in `seq` order, a snapshot replaces every entity. Transcripts and stream deltas are not kept.
@@ -30,6 +30,8 @@ export interface ClientState {
30
30
  interactions: ById<Interaction>;
31
31
  panels: ById<Panel>;
32
32
  devices: ById<Device>;
33
+ surfaces: ById<Surface>;
34
+ issues: ById<TrackedIssue>;
33
35
  dispatchPaused: boolean;
34
36
  }
35
37
  export declare function emptyState(): ClientState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spencerboucher/switchyard-client",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Node.js REST and WebSocket SDK for Switchyard",
5
5
  "license": "MIT",
6
6
  "repository": {