@spencerboucher/switchyard 0.17.0 → 0.18.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.
Files changed (129) hide show
  1. package/README.md +37 -23
  2. package/dist/policies/worker.js +884 -784
  3. package/dist/switchyard.mjs +27791 -26698
  4. package/package.json +1 -1
  5. package/web-dist/assets/AutomationView-DU4GvjqD.js +2 -0
  6. package/web-dist/assets/{AutomationView-BMQuTl3j.js.map → AutomationView-DU4GvjqD.js.map} +1 -1
  7. package/web-dist/assets/Checkbox-BmiLcC-z.js +2 -0
  8. package/web-dist/assets/Checkbox-BmiLcC-z.js.map +1 -0
  9. package/web-dist/assets/Copy-CdlOSzns.js +2 -0
  10. package/web-dist/assets/Copy-CdlOSzns.js.map +1 -0
  11. package/web-dist/assets/InteractionCard-C3H45DAY.js +4 -0
  12. package/web-dist/assets/{InteractionCard-CdBv3Sm7.js.map → InteractionCard-C3H45DAY.js.map} +1 -1
  13. package/web-dist/assets/Markdown-Bo-ScAiV.js +184 -0
  14. package/web-dist/assets/Markdown-Bo-ScAiV.js.map +1 -0
  15. package/web-dist/assets/Priority-f7KceEZQ.js +2 -0
  16. package/web-dist/assets/{Priority-aNWh1i4H.js.map → Priority-f7KceEZQ.js.map} +1 -1
  17. package/web-dist/assets/{SegmentedControl-D2kj3j7u.js → SegmentedControl-Ca8Fsw-g.js} +2 -2
  18. package/web-dist/assets/SegmentedControl-Ca8Fsw-g.js.map +1 -0
  19. package/web-dist/assets/Select-B04kPhBs.js +2 -0
  20. package/web-dist/assets/{Select-Dv-F-HZR.js.map → Select-B04kPhBs.js.map} +1 -1
  21. package/web-dist/assets/Tabs-BgpFIjqW.js +2 -0
  22. package/web-dist/assets/Tabs-BgpFIjqW.js.map +1 -0
  23. package/web-dist/assets/{UINodeRenderer-GbSP56mL.js → UINodeRenderer-CHlMHtMT.js} +3 -3
  24. package/web-dist/assets/{UINodeRenderer-GbSP56mL.js.map → UINodeRenderer-CHlMHtMT.js.map} +1 -1
  25. package/web-dist/assets/UnfilteredNote-DzKbzrjZ.js +2 -0
  26. package/web-dist/assets/UnfilteredNote-DzKbzrjZ.js.map +1 -0
  27. package/web-dist/assets/ViewSelect-Dz7vh4fq.js +2 -0
  28. package/web-dist/assets/ViewSelect-Dz7vh4fq.js.map +1 -0
  29. package/web-dist/assets/api-C9NJpI9q.js +2 -0
  30. package/web-dist/assets/api-C9NJpI9q.js.map +1 -0
  31. package/web-dist/assets/attention-BMxYQaCW.js +2 -0
  32. package/web-dist/assets/attention-BMxYQaCW.js.map +1 -0
  33. package/web-dist/assets/automations-DTTGHyoo.js +2 -0
  34. package/web-dist/assets/{automations-DQMWPvqT.js.map → automations-DTTGHyoo.js.map} +1 -1
  35. package/web-dist/assets/board-Blv0pC_z.js +6 -0
  36. package/web-dist/assets/board-Blv0pC_z.js.map +1 -0
  37. package/web-dist/assets/check-DTN2VHtE.js +2 -0
  38. package/web-dist/assets/check-DTN2VHtE.js.map +1 -0
  39. package/web-dist/assets/code-BsVbn6T3.js +25 -0
  40. package/web-dist/assets/code-BsVbn6T3.js.map +1 -0
  41. package/web-dist/assets/core.esm-DZMOHGS9.js +6 -0
  42. package/web-dist/assets/core.esm-DZMOHGS9.js.map +1 -0
  43. package/web-dist/assets/{describe-ype6dIHS.js → describe-Q2nvYHjg.js} +2 -2
  44. package/web-dist/assets/{describe-ype6dIHS.js.map → describe-Q2nvYHjg.js.map} +1 -1
  45. package/web-dist/assets/enroll-wAPt550I.js +2 -0
  46. package/web-dist/assets/{enroll-BTNVVoWB.js.map → enroll-wAPt550I.js.map} +1 -1
  47. package/web-dist/assets/index-9TW72kVM.css +2 -0
  48. package/web-dist/assets/index-Du1kfnPp.js +17 -0
  49. package/web-dist/assets/index-Du1kfnPp.js.map +1 -0
  50. package/web-dist/assets/keyboardLayers-CpCxpJ43.js +2 -0
  51. package/web-dist/assets/keyboardLayers-CpCxpJ43.js.map +1 -0
  52. package/web-dist/assets/more-D1YpQrbP.js +2 -0
  53. package/web-dist/assets/more-D1YpQrbP.js.map +1 -0
  54. package/web-dist/assets/pencil-BtK08_f_.js +2 -0
  55. package/web-dist/assets/pencil-BtK08_f_.js.map +1 -0
  56. package/web-dist/assets/{policyLogic-AZSVROoe.js → policyLogic-Dk_rwjQS.js} +2 -2
  57. package/web-dist/assets/{policyLogic-AZSVROoe.js.map → policyLogic-Dk_rwjQS.js.map} +1 -1
  58. package/web-dist/assets/queue-CdBAajey.js +2 -0
  59. package/web-dist/assets/queue-CdBAajey.js.map +1 -0
  60. package/web-dist/assets/{repo-CRmEGTNk.js → repo-CTLrFN0k.js} +2 -2
  61. package/web-dist/assets/{repo-CRmEGTNk.js.map → repo-CTLrFN0k.js.map} +1 -1
  62. package/web-dist/assets/rotate-ccw-mfO3Crkq.js +2 -0
  63. package/web-dist/assets/rotate-ccw-mfO3Crkq.js.map +1 -0
  64. package/web-dist/assets/search-DdgUAUi7.js +2 -0
  65. package/web-dist/assets/search-DdgUAUi7.js.map +1 -0
  66. package/web-dist/assets/selection-DDKGpSXL.js +7 -0
  67. package/web-dist/assets/selection-DDKGpSXL.js.map +1 -0
  68. package/web-dist/assets/settings-C3rhTyqj.js +12 -0
  69. package/web-dist/assets/settings-C3rhTyqj.js.map +1 -0
  70. package/web-dist/assets/states-f_A68-u-.js +58 -0
  71. package/web-dist/assets/states-f_A68-u-.js.map +1 -0
  72. package/web-dist/assets/terminal-login-eMNouLWh.js +2 -0
  73. package/web-dist/assets/{terminal-login-B20sSCfk.js.map → terminal-login-eMNouLWh.js.map} +1 -1
  74. package/web-dist/assets/timer-CDGYPIoD.js +2 -0
  75. package/web-dist/assets/timer-CDGYPIoD.js.map +1 -0
  76. package/web-dist/assets/trackers-BKCB5pxU.js +2 -0
  77. package/web-dist/assets/trackers-BKCB5pxU.js.map +1 -0
  78. package/web-dist/assets/useNow-CjCVyQra.js +2 -0
  79. package/web-dist/assets/useNow-CjCVyQra.js.map +1 -0
  80. package/web-dist/assets/{useResource-CFaJYaSY.js → useResource-BvhL-G6a.js} +2 -2
  81. package/web-dist/assets/{useResource-CFaJYaSY.js.map → useResource-BvhL-G6a.js.map} +1 -1
  82. package/web-dist/assets/workboard-Btp-KIzn.js +3 -0
  83. package/web-dist/assets/workboard-Btp-KIzn.js.map +1 -0
  84. package/web-dist/index.html +6 -6
  85. package/web-dist/sw.js +1 -1
  86. package/web-dist/sw.js.map +1 -1
  87. package/web-dist/assets/AutomationView-BMQuTl3j.js +0 -2
  88. package/web-dist/assets/Checkbox-D18Ch0n4.js +0 -2
  89. package/web-dist/assets/Checkbox-D18Ch0n4.js.map +0 -1
  90. package/web-dist/assets/Copy-D6U5ewFc.js +0 -2
  91. package/web-dist/assets/Copy-D6U5ewFc.js.map +0 -1
  92. package/web-dist/assets/InteractionCard-CdBv3Sm7.js +0 -4
  93. package/web-dist/assets/Overlay-Cv0SIpoa.js +0 -2
  94. package/web-dist/assets/Overlay-Cv0SIpoa.js.map +0 -1
  95. package/web-dist/assets/Priority-aNWh1i4H.js +0 -2
  96. package/web-dist/assets/SegmentedControl-D2kj3j7u.js.map +0 -1
  97. package/web-dist/assets/Select-Dv-F-HZR.js +0 -2
  98. package/web-dist/assets/Tabs-DPj-rKor.js +0 -184
  99. package/web-dist/assets/Tabs-DPj-rKor.js.map +0 -1
  100. package/web-dist/assets/ViewSelect-DTXqcHvg.js +0 -2
  101. package/web-dist/assets/ViewSelect-DTXqcHvg.js.map +0 -1
  102. package/web-dist/assets/attention-eEYmUIPZ.js +0 -2
  103. package/web-dist/assets/attention-eEYmUIPZ.js.map +0 -1
  104. package/web-dist/assets/auth-e3n8h2VO.js +0 -2
  105. package/web-dist/assets/auth-e3n8h2VO.js.map +0 -1
  106. package/web-dist/assets/automations-DQMWPvqT.js +0 -2
  107. package/web-dist/assets/board-CxPUJBjR.js +0 -10
  108. package/web-dist/assets/board-CxPUJBjR.js.map +0 -1
  109. package/web-dist/assets/code-BfD33VCt.js +0 -25
  110. package/web-dist/assets/code-BfD33VCt.js.map +0 -1
  111. package/web-dist/assets/enroll-BTNVVoWB.js +0 -2
  112. package/web-dist/assets/index-BE-Sxt6h.css +0 -2
  113. package/web-dist/assets/index-xw7YOYjs.js +0 -23
  114. package/web-dist/assets/index-xw7YOYjs.js.map +0 -1
  115. package/web-dist/assets/more-AZ4rHFG5.js +0 -2
  116. package/web-dist/assets/more-AZ4rHFG5.js.map +0 -1
  117. package/web-dist/assets/queue-LyV9HFK4.js +0 -2
  118. package/web-dist/assets/queue-LyV9HFK4.js.map +0 -1
  119. package/web-dist/assets/selection-BgO3-HZn.js +0 -2
  120. package/web-dist/assets/selection-BgO3-HZn.js.map +0 -1
  121. package/web-dist/assets/settings-CK-9B48D.js +0 -12
  122. package/web-dist/assets/settings-CK-9B48D.js.map +0 -1
  123. package/web-dist/assets/states-D7g0-4EY.js +0 -58
  124. package/web-dist/assets/states-D7g0-4EY.js.map +0 -1
  125. package/web-dist/assets/terminal-login-B20sSCfk.js +0 -2
  126. package/web-dist/assets/timer-CyFp7DQs.js +0 -2
  127. package/web-dist/assets/timer-CyFp7DQs.js.map +0 -1
  128. package/web-dist/assets/useNow-DvXAU3dJ.js +0 -2
  129. package/web-dist/assets/useNow-DvXAU3dJ.js.map +0 -1
@@ -3,7 +3,7 @@ import { parentPort } from "node:worker_threads";
3
3
  import { Environment } from "@marcbachmann/cel-js";
4
4
 
5
5
  // packages/protocol/dist/adapter-preview.js
6
- import { z as z8 } from "zod";
6
+ import { z as z7 } from "zod";
7
7
 
8
8
  // packages/protocol/dist/contributions.js
9
9
  import { z as z3 } from "zod";
@@ -353,7 +353,7 @@ function contributionSlot(id) {
353
353
  }
354
354
 
355
355
  // packages/protocol/dist/entities.js
356
- import { z as z7 } from "zod";
356
+ import { z as z6 } from "zod";
357
357
 
358
358
  // packages/protocol/dist/github.js
359
359
  import { z as z4 } from "zod";
@@ -903,346 +903,225 @@ var PolicyTestRequest = z5.object({
903
903
  request: PolicyRequestContext.nullable()
904
904
  }).strict().refine((v) => v.phase === "tool_call" ? v.tool !== null && v.request === null : v.tool === null && v.request !== null);
905
905
 
906
- // packages/protocol/dist/trackers.js
907
- import { z as z6 } from "zod";
908
- var Iso = z6.string();
909
- var Id4 = z6.string().min(1);
910
- var GitHubLogin = z6.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/);
911
- var TrackerStatusOption = z6.object({
912
- id: z6.string().min(1),
913
- name: z6.string().min(1).max(200)
914
- });
915
- var TrackerBoard = z6.object({
916
- projectNumber: z6.number().int().positive(),
917
- statusField: z6.string().min(1).max(100).default("Status"),
918
- /** Column to move a card to once its worktree exists (write-back). */
919
- onStart: z6.string().min(1).max(200).nullable().default(null),
920
- /** Column to move a card to once a pull request is open (write-back). */
921
- onReview: z6.string().min(1).max(200).nullable().default(null)
922
- });
923
- var Tracker = z6.object({
924
- id: Id4,
925
- name: z6.string().min(1).max(60),
926
- provider: z6.literal("github"),
927
- hostId: Id4,
928
- owner: GitHubLogin,
929
- repositories: z6.array(GitHubRepository).min(1).max(50).nullable(),
930
- /** Repositories outside `owner` that belong to this tracker too (never limited by `repositories`). */
931
- extraRepositories: z6.array(GitHubRepository).max(20).optional(),
932
- board: TrackerBoard.nullable(),
933
- writeBack: z6.boolean(),
934
- moveShared: z6.boolean(),
935
- enabled: z6.boolean(),
936
- /** The host's `gh` user, from the last sync. */
937
- login: z6.string().nullable(),
938
- lastSyncedAt: Iso.nullable(),
939
- lastError: z6.string().max(2e3).nullable(),
940
- createdAt: Iso,
941
- updatedAt: Iso
942
- });
943
- var TrackerInput = z6.object({
944
- name: Tracker.shape.name,
945
- hostId: Id4,
946
- owner: GitHubLogin,
947
- repositories: Tracker.shape.repositories.default(null),
948
- extraRepositories: z6.array(GitHubRepository).max(20).default([]),
949
- board: TrackerBoard.nullable().default(null),
950
- writeBack: z6.boolean().default(false),
951
- moveShared: z6.boolean().default(true),
952
- enabled: z6.boolean().default(true)
953
- });
954
- var TrackerPatch = z6.object({
955
- name: Tracker.shape.name.optional(),
956
- hostId: Id4.optional(),
957
- owner: GitHubLogin.optional(),
958
- repositories: Tracker.shape.repositories.optional(),
959
- extraRepositories: z6.array(GitHubRepository).max(20).optional(),
960
- board: TrackerBoard.nullable().optional(),
961
- writeBack: z6.boolean().optional(),
962
- moveShared: z6.boolean().optional(),
963
- enabled: z6.boolean().optional()
964
- });
965
- var TrackerItemBoard = z6.object({
966
- projectId: z6.string().min(1),
967
- projectItemId: z6.string().min(1),
968
- fieldId: z6.string().min(1),
969
- status: z6.string().nullable(),
970
- statusOptionId: z6.string().nullable(),
971
- options: z6.array(TrackerStatusOption).max(50)
972
- });
973
- var TrackerPullRequest = z6.object({
974
- number: z6.number().int().positive(),
975
- state: z6.enum(["OPEN", "CLOSED", "MERGED"]),
976
- url: z6.string().url(),
977
- headRefName: z6.string().min(1).max(255)
978
- });
979
- var TrackerItem = z6.object({
980
- itemId: z6.string().min(1),
981
- repository: GitHubRepository,
982
- number: z6.number().int().positive(),
983
- title: z6.string().min(1).max(1e3),
984
- url: GitHubIssueUrl,
985
- assignees: z6.array(z6.string()).max(20),
986
- branches: z6.array(z6.string().min(1).max(255)).max(10),
987
- pullRequest: TrackerPullRequest.nullable(),
988
- board: TrackerItemBoard.nullable()
989
- });
990
- var TrackerSyncResult = z6.object({
991
- login: z6.string().min(1),
992
- items: z6.array(TrackerItem).max(200),
993
- truncated: z6.boolean()
994
- });
995
- var TaskTracker = z6.object({
996
- trackerId: Id4,
997
- itemId: z6.string().min(1),
998
- repository: GitHubRepository,
999
- number: z6.number().int().positive(),
1000
- assignees: z6.array(z6.string()).max(20),
1001
- branch: z6.string().nullable(),
1002
- workspaceId: Id4.nullable(),
1003
- pullRequest: TrackerPullRequest.nullable(),
1004
- board: TrackerItemBoard.nullable()
1005
- });
1006
- var TrackerSetStatusResult = z6.discriminatedUnion("status", [
1007
- z6.object({ status: z6.literal("moved") }),
1008
- z6.object({
1009
- status: z6.literal("skipped"),
1010
- reason: z6.enum(["not_assigned", "shared", "stale"])
1011
- })
1012
- ]);
1013
- var TrackerStatusRequest = z6.object({ status: z6.string().min(1).max(200) });
1014
- var TrackerHostSyncRequest = z6.object({
1015
- owner: GitHubLogin,
1016
- repositories: z6.array(GitHubRepository).nullable(),
1017
- board: z6.object({ projectNumber: z6.number().int().positive(), statusField: z6.string().min(1) }).nullable()
1018
- });
1019
- var TrackerHostPrepareBranchRequest = z6.object({
1020
- checkoutPath: z6.string().min(1),
1021
- branch: z6.string().min(1).max(255)
1022
- });
1023
- var TrackerHostStartIssueRequest = z6.object({
1024
- checkoutPath: z6.string().min(1),
1025
- repository: GitHubRepository,
1026
- number: z6.number().int().positive(),
1027
- branch: z6.string().min(1).max(255),
1028
- base: z6.string().min(1)
1029
- });
1030
- var TrackerHostSetStatusRequest = z6.object({
1031
- projectId: z6.string().min(1),
1032
- projectItemId: z6.string().min(1),
1033
- fieldId: z6.string().min(1),
1034
- statusField: z6.string().min(1),
1035
- optionId: z6.string().min(1),
1036
- expectedOptionId: z6.string().nullable(),
1037
- login: z6.string().min(1),
1038
- allowShared: z6.boolean()
1039
- });
1040
-
1041
906
  // packages/protocol/dist/entities.js
1042
- var Iso2 = z7.string();
1043
- var Id5 = z7.string();
1044
- var Connectivity = z7.enum(["connected", "reconnecting", "unreachable"]);
1045
- var ControlMode = z7.enum(["automation", "human"]);
1046
- var Platform = z7.enum(["darwin", "linux"]);
1047
- var DeviceKind = z7.enum(["browser", "pwa", "terminal", "cli"]);
1048
- var DiagnosticLevel = z7.enum(["info", "warning", "error"]);
907
+ var Iso = z6.string();
908
+ var Id4 = z6.string();
909
+ var Connectivity = z6.enum(["connected", "reconnecting", "unreachable"]);
910
+ var ControlMode = z6.enum(["automation", "human"]);
911
+ var Platform = z6.enum(["darwin", "linux"]);
912
+ var DeviceKind = z6.enum(["browser", "pwa", "terminal", "cli"]);
913
+ var DiagnosticLevel = z6.enum(["info", "warning", "error"]);
1049
914
  var DEFAULT_WORKTREE_DIR = ".worktrees";
1050
- var CoreCapabilities = z7.object({
1051
- prompt: z7.boolean(),
1052
- steer: z7.boolean(),
1053
- followUp: z7.boolean(),
1054
- abort: z7.boolean(),
1055
- resume: z7.boolean(),
1056
- rename: z7.boolean(),
1057
- importInactive: z7.boolean(),
1058
- extensionDialogs: z7.boolean(),
1059
- customUi: z7.boolean(),
1060
- widgetsText: z7.boolean(),
1061
- widgetsComponent: z7.boolean(),
1062
- tokenAccounting: z7.boolean(),
1063
- costAccounting: z7.boolean()
915
+ var CoreCapabilities = z6.object({
916
+ prompt: z6.boolean(),
917
+ steer: z6.boolean(),
918
+ followUp: z6.boolean(),
919
+ abort: z6.boolean(),
920
+ resume: z6.boolean(),
921
+ rename: z6.boolean(),
922
+ importInactive: z6.boolean(),
923
+ extensionDialogs: z6.boolean(),
924
+ customUi: z6.boolean(),
925
+ widgetsText: z6.boolean(),
926
+ widgetsComponent: z6.boolean(),
927
+ tokenAccounting: z6.boolean(),
928
+ costAccounting: z6.boolean()
1064
929
  });
1065
930
  var CAPABILITY_KEYS = CoreCapabilities.keyof().options;
1066
931
  var RuntimeCapabilities = CoreCapabilities.extend({
1067
932
  /** The host runs sessions as interactive Pi in a terminal that clients can attach to. */
1068
- terminal: z7.boolean().optional(),
933
+ terminal: z6.boolean().optional(),
1069
934
  /** The host answers session.models, session.commands, session.setModel, session.setThinking and session.compact. */
1070
- sessionControls: z7.boolean().optional(),
935
+ sessionControls: z6.boolean().optional(),
1071
936
  /** The host answers session.navigate for terminal sessions. */
1072
- treeNavigation: z7.boolean().optional(),
1073
- agentRequests: z7.boolean().optional(),
1074
- messageDelivery: z7.boolean().optional(),
1075
- policies: z7.boolean().optional(),
937
+ treeNavigation: z6.boolean().optional(),
938
+ agentRequests: z6.boolean().optional(),
939
+ messageDelivery: z6.boolean().optional(),
940
+ policies: z6.boolean().optional(),
1076
941
  /** Session-scoped adapter inspection and safe reload. */
1077
- adapterDevelopment: z7.boolean().optional(),
1078
- unsupported: z7.array(z7.object({ capability: z7.string(), reason: z7.string() }))
942
+ adapterDevelopment: z6.boolean().optional(),
943
+ unsupported: z6.array(z6.object({ capability: z6.string(), reason: z6.string() }))
1079
944
  });
1080
- var ProjectScan = z7.object({
1081
- state: z7.enum(["running", "done", "failed"]),
1082
- startedAt: Iso2,
1083
- finishedAt: Iso2.nullable(),
945
+ var ProjectScan = z6.object({
946
+ state: z6.enum(["running", "done", "failed"]),
947
+ startedAt: Iso,
948
+ finishedAt: Iso.nullable(),
1084
949
  /** Repositories found across all folders. */
1085
- repositories: z7.number().int(),
950
+ repositories: z6.number().int(),
1086
951
  /** New projects created by this scan. */
1087
- projectsCreated: z7.number().int(),
952
+ projectsCreated: z6.number().int(),
1088
953
  /** New checkouts (including the ones of new projects). */
1089
- checkoutsAdded: z7.number().int(),
954
+ checkoutsAdded: z6.number().int(),
1090
955
  /** "<folder>: <message>" per folder that failed; for state "failed", the reason last. */
1091
- errors: z7.array(z7.string())
1092
- });
1093
- var UsageWindow = z7.object({
1094
- id: z7.enum(["five_hour", "weekly"]),
1095
- usedPct: z7.number(),
1096
- resetsAt: Iso2.nullable()
1097
- });
1098
- var ProviderUsage = z7.object({
1099
- provider: z7.enum(["anthropic", "openai-codex"]),
1100
- status: z7.enum(["available", "expired", "rejected", "error"]),
1101
- message: z7.string().nullable(),
1102
- windows: z7.array(UsageWindow),
1103
- fetchedAt: Iso2
1104
- });
1105
- var Host = z7.object({
1106
- id: Id5,
1107
- name: z7.string(),
956
+ errors: z6.array(z6.string())
957
+ });
958
+ var UsageWindow = z6.object({
959
+ id: z6.enum(["five_hour", "weekly"]),
960
+ usedPct: z6.number(),
961
+ resetsAt: Iso.nullable()
962
+ });
963
+ var ProviderUsage = z6.object({
964
+ provider: z6.enum(["anthropic", "openai-codex"]),
965
+ status: z6.enum(["available", "expired", "rejected", "error"]),
966
+ message: z6.string().nullable(),
967
+ windows: z6.array(UsageWindow),
968
+ fetchedAt: Iso
969
+ });
970
+ var Host = z6.object({
971
+ id: Id4,
972
+ name: z6.string(),
1108
973
  platform: Platform,
1109
- agentVersion: z7.string(),
1110
- piVersion: z7.string().nullable(),
1111
- piCompatible: z7.boolean(),
974
+ agentVersion: z6.string(),
975
+ piVersion: z6.string().nullable(),
976
+ piCompatible: z6.boolean(),
1112
977
  capabilities: RuntimeCapabilities.nullable(),
1113
978
  connectivity: Connectivity,
1114
- lastSeenAt: Iso2.nullable(),
1115
- revokedAt: Iso2.nullable(),
1116
- createdAt: Iso2,
979
+ lastSeenAt: Iso.nullable(),
980
+ revokedAt: Iso.nullable(),
981
+ createdAt: Iso,
1117
982
  /** Folders on the host whose git repositories become projects (absolute or ~/...). */
1118
- projectFolders: z7.array(z7.string()).optional(),
983
+ projectFolders: z6.array(z6.string()).optional(),
1119
984
  projectScan: ProjectScan.nullable().optional(),
1120
985
  /** Subscription limits (host-reported, refreshed every few minutes). */
1121
- usage: z7.array(ProviderUsage).optional(),
986
+ usage: z6.array(ProviderUsage).optional(),
1122
987
  github: HostGitHub.optional()
1123
988
  });
1124
- var WorktreeDir = z7.string().min(1).refine((d) => !d.startsWith("/") && !d.includes("\\"), "must be a relative path").refine((d) => !d.split("/").includes(".."), "must stay inside the repository").refine((d) => d.split("/").every((s) => s.length > 0 && s !== "."), "must be a plain relative path");
1125
- var Project = z7.object({
1126
- id: Id5,
1127
- name: z7.string().min(1),
1128
- repoIdentity: z7.string(),
1129
- defaultProfileId: Id5.nullable(),
1130
- defaultHostId: Id5.nullable(),
1131
- maxConcurrentRuns: z7.number().int().min(1).max(32),
1132
- automationEnabled: z7.boolean(),
1133
- setupCommand: z7.string().nullable(),
1134
- checks: z7.array(z7.string()),
1135
- workspaceSharing: z7.enum(["single_writer", "shared"]),
989
+ var WorktreeDir = z6.string().min(1).refine((d) => !d.startsWith("/") && !d.includes("\\"), "must be a relative path").refine((d) => !d.split("/").includes(".."), "must stay inside the repository").refine((d) => d.split("/").every((s) => s.length > 0 && s !== "."), "must be a plain relative path");
990
+ var Project = z6.object({
991
+ id: Id4,
992
+ name: z6.string().min(1),
993
+ repoIdentity: z6.string(),
994
+ defaultProfileId: Id4.nullable(),
995
+ defaultHostId: Id4.nullable(),
996
+ maxConcurrentRuns: z6.number().int().min(1).max(32),
997
+ automationEnabled: z6.boolean(),
998
+ setupCommand: z6.string().nullable(),
999
+ checks: z6.array(z6.string()),
1000
+ workspaceSharing: z6.enum(["single_writer", "shared"]),
1136
1001
  worktreeDir: WorktreeDir.default(DEFAULT_WORKTREE_DIR),
1137
1002
  /** Start one session in every non-main worktree the first time it appears without one. */
1138
- ensureSessions: z7.boolean().default(false),
1003
+ ensureSessions: z6.boolean().default(false),
1139
1004
  /** Archive sessions and remove a worktree (and its local branch) once its PR has merged. */
1140
- removeLanded: z7.boolean().default(false),
1141
- createdAt: Iso2,
1142
- updatedAt: Iso2
1005
+ removeLanded: z6.boolean().default(false),
1006
+ createdAt: Iso,
1007
+ updatedAt: Iso
1143
1008
  });
1144
- var Checkout = z7.object({
1145
- id: Id5,
1146
- projectId: Id5,
1147
- hostId: Id5,
1148
- path: z7.string(),
1149
- commonDir: z7.string(),
1150
- defaultBranch: z7.string(),
1151
- createdAt: Iso2
1152
- });
1153
- var GitState = z7.object({
1154
- dirty: z7.boolean(),
1155
- changedFiles: z7.number().int(),
1156
- ahead: z7.number().int(),
1157
- behind: z7.number().int(),
1158
- unmerged: z7.boolean(),
1009
+ var Checkout = z6.object({
1010
+ id: Id4,
1011
+ projectId: Id4,
1012
+ hostId: Id4,
1013
+ path: z6.string(),
1014
+ commonDir: z6.string(),
1015
+ defaultBranch: z6.string(),
1016
+ createdAt: Iso
1017
+ });
1018
+ var GitState = z6.object({
1019
+ dirty: z6.boolean(),
1020
+ changedFiles: z6.number().int(),
1021
+ ahead: z6.number().int(),
1022
+ behind: z6.number().int(),
1023
+ unmerged: z6.boolean(),
1159
1024
  /** HEAD commit; absent from older hosts. */
1160
- head: z7.string().regex(/^[0-9a-f]{40}$/).optional()
1161
- });
1162
- var Workspace = z7.object({
1163
- id: Id5,
1164
- checkoutId: Id5,
1165
- projectId: Id5,
1166
- hostId: Id5,
1167
- path: z7.string(),
1168
- branch: z7.string().nullable(),
1169
- baseBranch: z7.string().nullable(),
1170
- provenance: z7.enum(["managed", "discovered", "main"]),
1025
+ head: z6.string().regex(/^[0-9a-f]{40}$/).optional()
1026
+ });
1027
+ var Workspace = z6.object({
1028
+ id: Id4,
1029
+ checkoutId: Id4,
1030
+ projectId: Id4,
1031
+ hostId: Id4,
1032
+ path: z6.string(),
1033
+ branch: z6.string().nullable(),
1034
+ baseBranch: z6.string().nullable(),
1035
+ provenance: z6.enum(["managed", "discovered", "main"]),
1171
1036
  git: GitState,
1172
- setup: z7.object({
1173
- state: z7.enum(["none", "running", "succeeded", "failed"]),
1174
- log: z7.string()
1037
+ setup: z6.object({
1038
+ state: z6.enum(["none", "running", "succeeded", "failed"]),
1039
+ log: z6.string()
1175
1040
  }),
1176
- archivedAt: Iso2.nullable(),
1177
- updatedAt: Iso2,
1041
+ archivedAt: Iso.nullable(),
1042
+ updatedAt: Iso,
1178
1043
  github: WorkspaceGitHub.optional()
1179
1044
  });
1180
- var ThinkingLevel = z7.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
1181
- var SessionModel = z7.object({
1182
- provider: z7.string(),
1183
- id: z7.string(),
1184
- name: z7.string().nullable(),
1185
- contextWindow: z7.number().nullable(),
1186
- reasoning: z7.boolean(),
1045
+ var ThinkingLevel = z6.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
1046
+ var SessionModel = z6.object({
1047
+ provider: z6.string(),
1048
+ id: z6.string(),
1049
+ name: z6.string().nullable(),
1050
+ contextWindow: z6.number().nullable(),
1051
+ reasoning: z6.boolean(),
1187
1052
  /** In Pi's scoped (favorite) model list; set only when Pi has one. */
1188
- scoped: z7.boolean().optional(),
1053
+ scoped: z6.boolean().optional(),
1189
1054
  /** Effort levels this model accepts, in Pi's order; ["off"] without reasoning. */
1190
- thinkingLevels: z7.array(ThinkingLevel),
1055
+ thinkingLevels: z6.array(ThinkingLevel),
1191
1056
  /** Prompt-cache lifetimes in seconds from Pi's model metadata. */
1192
- promptCache: z7.object({ short: z7.number().optional(), long: z7.number().optional() }).nullable().optional()
1057
+ promptCache: z6.object({ short: z6.number().optional(), long: z6.number().optional() }).nullable().optional()
1193
1058
  });
1194
- var SlashCommand = z7.object({
1195
- name: z7.string().min(1),
1196
- description: z7.string().nullable(),
1197
- source: z7.enum(["extension", "prompt", "skill"]),
1198
- argumentHint: z7.string().nullable().optional()
1059
+ var SlashCommand = z6.object({
1060
+ name: z6.string().min(1),
1061
+ description: z6.string().nullable(),
1062
+ source: z6.enum(["extension", "prompt", "skill"]),
1063
+ argumentHint: z6.string().nullable().optional()
1199
1064
  });
1200
- var ContextUsage = z7.object({
1065
+ var ContextUsage = z6.object({
1201
1066
  /** Estimated tokens in context; null right after compaction until the next reply. */
1202
- tokens: z7.number().nullable(),
1203
- window: z7.number(),
1204
- percent: z7.number().nullable()
1067
+ tokens: z6.number().nullable(),
1068
+ window: z6.number(),
1069
+ percent: z6.number().nullable()
1205
1070
  });
1206
1071
  var FORBIDDEN_EXTRA_ARGS = ["--mode", "--fork", "--no-session", "-e", "--extension"];
1207
- var ExtraArg = z7.string().refine((a) => a.startsWith("--") || !a.startsWith("-"), "extra args must be long flags").refine((a) => !FORBIDDEN_EXTRA_ARGS.includes(a.split("=")[0]) && !a.startsWith("--session"), "this flag is managed by Switchyard");
1208
- var Profile = z7.object({
1209
- id: Id5,
1210
- name: z7.string().min(1),
1211
- provider: z7.string().nullable(),
1212
- model: z7.string().nullable(),
1072
+ var ExtraArg = z6.string().refine((a) => a.startsWith("--") || !a.startsWith("-"), "extra args must be long flags").refine((a) => !FORBIDDEN_EXTRA_ARGS.includes(a.split("=")[0]) && !a.startsWith("--session"), "this flag is managed by Switchyard");
1073
+ var Profile = z6.object({
1074
+ id: Id4,
1075
+ name: z6.string().min(1),
1076
+ provider: z6.string().nullable(),
1077
+ model: z6.string().nullable(),
1213
1078
  thinking: ThinkingLevel.nullable(),
1214
- projectTrust: z7.enum(["ask", "approve", "ignore"]),
1215
- extraArgs: z7.array(ExtraArg),
1079
+ projectTrust: z6.enum(["ask", "approve", "ignore"]),
1080
+ extraArgs: z6.array(ExtraArg),
1216
1081
  /** "vanilla": --no-extensions --no-skills --no-prompt-templates. Undefined means "all". */
1217
- resources: z7.enum(["all", "vanilla"]).optional()
1082
+ resources: z6.enum(["all", "vanilla"]).optional()
1218
1083
  });
1219
- var ViewClient = z7.object({
1084
+ var ViewClient = z6.object({
1220
1085
  /** `${kind}:${name}@${machine}` */
1221
- id: z7.string().min(1),
1222
- kind: z7.enum(["herdr", "tmux"]),
1223
- name: z7.string().min(1),
1224
- machine: z7.string().min(1),
1225
- lastSeenAt: Iso2
1226
- });
1227
- var View = z7.object({
1228
- id: Id5,
1229
- name: z7.string().min(1).max(60),
1230
- mode: z7.enum(["all", "pinned"]),
1231
- projectIds: z7.array(z7.string()).nullable(),
1232
- hostIds: z7.array(z7.string()).nullable(),
1233
- sessionIds: z7.array(z7.string()),
1234
- clients: z7.array(ViewClient),
1086
+ id: z6.string().min(1),
1087
+ kind: z6.enum(["herdr", "tmux"]),
1088
+ name: z6.string().min(1),
1089
+ machine: z6.string().min(1),
1090
+ lastSeenAt: Iso
1091
+ });
1092
+ var View = z6.object({
1093
+ id: Id4,
1094
+ name: z6.string().min(1).max(60),
1095
+ mode: z6.enum(["all", "pinned"]),
1096
+ projectIds: z6.array(z6.string()).nullable(),
1097
+ hostIds: z6.array(z6.string()).nullable(),
1098
+ sessionIds: z6.array(z6.string()),
1099
+ /** Deprecated: always empty; see Surface. */
1100
+ clients: z6.array(ViewClient).default([]),
1235
1101
  /** A tracker keeps this view's projects (see docs/trackers.md). */
1236
- trackerId: z7.string().nullable().optional(),
1102
+ trackerId: z6.string().nullable().optional(),
1237
1103
  /**
1238
- * A client as membership authority: sessions enrolled from this client (`ViewClient` id,
1239
- * `herdr:<session>@<machine>`) are pinned here when they first appear.
1104
+ * The source surface (`herdr:<session>@<machine>`): sessions started in it
1105
+ * (`Session.startedIn`) belong to this view.
1240
1106
  */
1241
- clientId: z7.string().min(1).max(200).nullable().optional(),
1242
- createdAt: Iso2,
1243
- updatedAt: Iso2
1107
+ clientId: z6.string().min(1).max(200).nullable().optional(),
1108
+ createdAt: Iso,
1109
+ updatedAt: Iso
1244
1110
  });
1245
- var RuntimeState = z7.enum([
1111
+ var SurfaceKind = z6.enum(["herdr", "tmux"]);
1112
+ var Surface = z6.object({
1113
+ /** `${kind}:${name}@${machine}` */
1114
+ id: z6.string().min(1).max(200),
1115
+ kind: SurfaceKind,
1116
+ name: z6.string().min(1),
1117
+ machine: z6.string().min(1),
1118
+ deviceId: Id4,
1119
+ hostId: Id4.nullable(),
1120
+ viewId: Id4.nullable(),
1121
+ lastSeenAt: Iso,
1122
+ createdAt: Iso
1123
+ });
1124
+ var RuntimeState = z6.enum([
1246
1125
  "starting",
1247
1126
  "idle",
1248
1127
  "running",
@@ -1251,150 +1130,154 @@ var RuntimeState = z7.enum([
1251
1130
  "failed",
1252
1131
  "stopped"
1253
1132
  ]);
1254
- var NativeHandle = z7.object({ sessionId: z7.string(), sessionFile: z7.string() });
1255
- var SessionStats = z7.object({
1256
- tokens: z7.number().nullable(),
1257
- costUsd: z7.number().nullable(),
1133
+ var NativeHandle = z6.object({ sessionId: z6.string(), sessionFile: z6.string() });
1134
+ var SessionStats = z6.object({
1135
+ tokens: z6.number().nullable(),
1136
+ costUsd: z6.number().nullable(),
1258
1137
  /** Completed usage, refreshed for this exact settlement; absent on older hosts or failure. */
1259
1138
  watermark: CompletedUsageWatermark.optional(),
1260
1139
  context: ContextUsage.nullable().optional()
1261
1140
  });
1262
- var PromptCacheInfo = z7.object({
1263
- at: Iso2,
1264
- provider: z7.string(),
1265
- model: z7.string(),
1266
- cacheRead: z7.number(),
1267
- cacheWrite: z7.number(),
1268
- cacheWrite1h: z7.number()
1269
- });
1270
- var Session = z7.object({
1271
- id: Id5,
1272
- title: z7.string(),
1273
- subtitle: z7.string().nullable(),
1274
- hostId: Id5,
1275
- workspaceId: Id5.nullable(),
1276
- projectId: Id5.nullable(),
1277
- cwd: z7.string(),
1141
+ var PromptCacheInfo = z6.object({
1142
+ at: Iso,
1143
+ provider: z6.string(),
1144
+ model: z6.string(),
1145
+ cacheRead: z6.number(),
1146
+ cacheWrite: z6.number(),
1147
+ cacheWrite1h: z6.number()
1148
+ });
1149
+ var Session = z6.object({
1150
+ id: Id4,
1151
+ title: z6.string(),
1152
+ subtitle: z6.string().nullable(),
1153
+ hostId: Id4,
1154
+ workspaceId: Id4.nullable(),
1155
+ projectId: Id4.nullable(),
1156
+ cwd: z6.string(),
1278
1157
  nativeHandle: NativeHandle.nullable(),
1279
1158
  profileSnapshot: Profile,
1280
1159
  runtime: RuntimeState,
1281
- runtimeDetail: z7.string().nullable(),
1160
+ runtimeDetail: z6.string().nullable(),
1282
1161
  connectivity: Connectivity,
1283
- runId: Id5.nullable(),
1284
- taskId: Id5.nullable(),
1285
- provenance: z7.enum(["created", "imported", "subagent"]),
1286
- readOnly: z7.boolean(),
1287
- lastActivityAt: Iso2,
1288
- archivedAt: Iso2.nullable(),
1289
- queue: z7.object({ steering: z7.array(z7.string()), followUp: z7.array(z7.string()) }),
1162
+ runId: Id4.nullable(),
1163
+ taskId: Id4.nullable(),
1164
+ provenance: z6.enum(["created", "imported", "subagent"]),
1165
+ readOnly: z6.boolean(),
1166
+ lastActivityAt: Iso,
1167
+ archivedAt: Iso.nullable(),
1168
+ queue: z6.object({ steering: z6.array(z6.string()), followUp: z6.array(z6.string()) }),
1290
1169
  stats: SessionStats.nullable(),
1291
1170
  /** The live model (host-owned; last known when stopped). */
1292
1171
  model: SessionModel.nullable().optional(),
1293
1172
  /** The live effort (Pi's thinking level). */
1294
1173
  thinking: ThinkingLevel.nullable().optional(),
1295
1174
  /** Pi is compacting the context. */
1296
- compacting: z7.boolean().optional(),
1297
- lastAssistantText: z7.string().nullable(),
1298
- createdAt: Iso2,
1175
+ compacting: z6.boolean().optional(),
1176
+ lastAssistantText: z6.string().nullable(),
1177
+ createdAt: Iso,
1299
1178
  /** A live terminal session: `switchyard tui` can attach to its Pi terminal. */
1300
- terminal: z7.boolean().optional(),
1179
+ terminal: z6.boolean().optional(),
1301
1180
  /**
1302
1181
  * A Pi the user started in their own terminal and enrolled (`client`: the herdr session it runs
1303
1182
  * in, when known). Switchyard never shows or closes that terminal.
1304
1183
  */
1305
- external: z7.object({ client: z7.string().min(1).max(200).nullable() }).nullable().optional(),
1184
+ external: z6.object({ client: z6.string().min(1).max(200).nullable() }).nullable().optional(),
1185
+ /** The session this subagent was started by (coordinator-owned). */
1186
+ parentSessionId: Id4.nullable().optional(),
1187
+ /** Chosen as its branch's primary session (coordinator-owned); without one the primary is derived. */
1188
+ primary: z6.boolean().optional(),
1189
+ /** The surface this Pi was started in, e.g. `herdr:default@mac` (coordinator-owned, set once). */
1190
+ startedIn: z6.string().min(1).max(200).nullable().optional(),
1306
1191
  /** Set when the session finished or failed with nobody viewing it; cleared when viewed (coordinator-owned). */
1307
- unreadSince: Iso2.nullable().optional(),
1192
+ unreadSince: Iso.nullable().optional(),
1308
1193
  /** Identity of the adapter presentation currently installed on the host. */
1309
- adapterGeneration: z7.string().uuid().optional(),
1194
+ adapterGeneration: z6.string().uuid().optional(),
1310
1195
  /** Bumped when the transcript is rebuilt (rewind); clients drop cached copies (coordinator-owned). */
1311
- transcriptEpoch: z7.number().int().min(0).optional(),
1312
- bridge: z7.object({
1313
- version: z7.literal(1),
1314
- runtimeId: Id5,
1315
- nativeSessionId: Id5,
1196
+ transcriptEpoch: z6.number().int().min(0).optional(),
1197
+ bridge: z6.object({
1198
+ version: z6.literal(1),
1199
+ runtimeId: Id4,
1200
+ nativeSessionId: Id4,
1316
1201
  /** Host-generated local-controller identity, not Pi's private binding credential. */
1317
- controllerEpoch: Id5.optional(),
1318
- agentTools: z7.boolean(),
1319
- messageDelivery: z7.boolean(),
1320
- policyState: z7.enum(["initializing", "active", "unsupported", "lost"]),
1321
- policyPhases: z7.array(PolicyPhase)
1202
+ controllerEpoch: Id4.optional(),
1203
+ agentTools: z6.boolean(),
1204
+ messageDelivery: z6.boolean(),
1205
+ policyState: z6.enum(["initializing", "active", "unsupported", "lost"]),
1206
+ policyPhases: z6.array(PolicyPhase)
1322
1207
  }).optional(),
1323
1208
  /** Last assistant message's cache usage (host-owned). */
1324
1209
  promptCache: PromptCacheInfo.nullable().optional(),
1325
1210
  /** Warn before the prompt cache expires; non-null means on (coordinator-owned). */
1326
- cacheAlert: z7.object({ ttlSec: z7.number().int().min(60).max(86400).nullable(), warnedFor: Iso2.nullable() }).nullable().optional()
1211
+ cacheAlert: z6.object({ ttlSec: z6.number().int().min(60).max(86400).nullable(), warnedFor: Iso.nullable() }).nullable().optional()
1327
1212
  });
1328
- var ContinuationPolicy = z7.discriminatedUnion("enabled", [
1329
- z7.object({ enabled: z7.literal(false) }),
1330
- z7.object({
1331
- enabled: z7.literal(true),
1332
- objective: z7.string().min(1),
1333
- maxContinuations: z7.number().int().min(1).max(50),
1334
- maxElapsedMinutes: z7.number().int().min(1).max(1440),
1335
- maxTokens: z7.number().int().positive().nullable(),
1336
- maxCostUsd: z7.number().positive().nullable()
1213
+ var ContinuationPolicy = z6.discriminatedUnion("enabled", [
1214
+ z6.object({ enabled: z6.literal(false) }),
1215
+ z6.object({
1216
+ enabled: z6.literal(true),
1217
+ objective: z6.string().min(1),
1218
+ maxContinuations: z6.number().int().min(1).max(50),
1219
+ maxElapsedMinutes: z6.number().int().min(1).max(1440),
1220
+ maxTokens: z6.number().int().positive().nullable(),
1221
+ maxCostUsd: z6.number().positive().nullable()
1337
1222
  })
1338
1223
  ]);
1339
- var CompletionPolicy = z7.object({
1340
- checks: z7.array(z7.string()).nullable(),
1341
- requireHumanReview: z7.boolean()
1224
+ var CompletionPolicy = z6.object({
1225
+ checks: z6.array(z6.string()).nullable(),
1226
+ requireHumanReview: z6.boolean()
1342
1227
  });
1343
- var WorkspacePolicy = z7.discriminatedUnion("mode", [
1344
- z7.object({
1345
- mode: z7.literal("new_worktree"),
1346
- branch: z7.string().nullable(),
1347
- base: z7.string().nullable()
1228
+ var WorkspacePolicy = z6.discriminatedUnion("mode", [
1229
+ z6.object({
1230
+ mode: z6.literal("new_worktree"),
1231
+ branch: z6.string().nullable(),
1232
+ base: z6.string().nullable()
1348
1233
  }),
1349
- z7.object({ mode: z7.literal("existing"), workspaceId: Id5 })
1234
+ z6.object({ mode: z6.literal("existing"), workspaceId: Id4 })
1350
1235
  ]);
1351
- var TaskPolicy = z7.object({
1352
- hostId: Id5.nullable(),
1353
- profileId: Id5.nullable(),
1236
+ var TaskPolicy = z6.object({
1237
+ hostId: Id4.nullable(),
1238
+ profileId: Id4.nullable(),
1354
1239
  workspace: WorkspacePolicy,
1355
1240
  continuation: ContinuationPolicy,
1356
1241
  completion: CompletionPolicy
1357
1242
  });
1358
- var TaskState = z7.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1359
- var Priority = z7.union([z7.literal(0), z7.literal(1), z7.literal(2), z7.literal(3)]);
1360
- var TaskOrigin = z7.discriminatedUnion("kind", [
1361
- z7.object({ kind: z7.literal("manual") }),
1362
- z7.object({
1363
- kind: z7.literal("automation"),
1364
- automationId: Id5,
1365
- occurrenceId: Id5,
1366
- routine: z7.boolean()
1243
+ var TaskState = z6.enum(["backlog", "ready", "in_progress", "review", "done", "canceled"]);
1244
+ var Priority = z6.union([z6.literal(0), z6.literal(1), z6.literal(2), z6.literal(3)]);
1245
+ var TaskOrigin = z6.discriminatedUnion("kind", [
1246
+ z6.object({ kind: z6.literal("manual") }),
1247
+ z6.object({
1248
+ kind: z6.literal("automation"),
1249
+ automationId: Id4,
1250
+ occurrenceId: Id4,
1251
+ routine: z6.boolean()
1367
1252
  })
1368
1253
  ]);
1369
- var Task = z7.object({
1370
- id: Id5,
1371
- projectId: Id5,
1372
- title: z7.string().min(1),
1373
- objective: z7.string(),
1374
- acceptanceCriteria: z7.array(z7.string()),
1375
- dependencies: z7.array(Id5),
1254
+ var Task = z6.object({
1255
+ id: Id4,
1256
+ projectId: Id4,
1257
+ title: z6.string().min(1),
1258
+ objective: z6.string(),
1259
+ acceptanceCriteria: z6.array(z6.string()),
1260
+ dependencies: z6.array(Id4),
1376
1261
  priority: Priority,
1377
- position: z7.number(),
1262
+ position: z6.number(),
1378
1263
  state: TaskState,
1379
- blocked: z7.object({ reason: z7.string() }).nullable(),
1380
- notBefore: Iso2.nullable(),
1264
+ blocked: z6.object({ reason: z6.string() }).nullable(),
1265
+ notBefore: Iso.nullable(),
1381
1266
  policy: TaskPolicy,
1382
1267
  origin: TaskOrigin,
1383
- groupingKey: z7.string().nullable(),
1384
- parentTaskId: Id5.nullable().optional(),
1385
- agentOrigin: z7.object({ sessionId: Id5, toolCallId: Id5 }).optional(),
1268
+ groupingKey: z6.string().nullable(),
1269
+ parentTaskId: Id4.nullable().optional(),
1270
+ agentOrigin: z6.object({ sessionId: Id4, toolCallId: Id4 }).optional(),
1386
1271
  githubIssue: GitHubIssue.optional(),
1387
- /** Set while a tracker owns this task (server-owned). */
1388
- tracker: TaskTracker.optional(),
1389
- currentRunId: Id5.nullable(),
1390
- sessionId: Id5.nullable(),
1391
- review: z7.object({ feedback: z7.array(z7.string()), changesRequested: z7.boolean() }),
1392
- hiddenFromBoard: z7.boolean(),
1393
- lastActivityAt: Iso2,
1394
- createdAt: Iso2,
1395
- updatedAt: Iso2
1272
+ currentRunId: Id4.nullable(),
1273
+ sessionId: Id4.nullable(),
1274
+ review: z6.object({ feedback: z6.array(z6.string()), changesRequested: z6.boolean() }),
1275
+ hiddenFromBoard: z6.boolean(),
1276
+ lastActivityAt: Iso,
1277
+ createdAt: Iso,
1278
+ updatedAt: Iso
1396
1279
  });
1397
- var RunState = z7.enum([
1280
+ var RunState = z6.enum([
1398
1281
  "queued",
1399
1282
  "dispatching",
1400
1283
  "uncertain",
@@ -1406,79 +1289,79 @@ var RunState = z7.enum([
1406
1289
  "interrupted",
1407
1290
  "canceled"
1408
1291
  ]);
1409
- var CheckResult = z7.object({
1410
- command: z7.string(),
1411
- exitCode: z7.number().int().nullable(),
1412
- outputTail: z7.string()
1413
- });
1414
- var Run = z7.object({
1415
- id: Id5,
1416
- taskId: Id5,
1417
- sessionId: Id5.nullable(),
1418
- hostId: Id5.nullable(),
1419
- dispatchKey: z7.string(),
1420
- attempt: z7.number().int().min(1),
1292
+ var CheckResult = z6.object({
1293
+ command: z6.string(),
1294
+ exitCode: z6.number().int().nullable(),
1295
+ outputTail: z6.string()
1296
+ });
1297
+ var Run = z6.object({
1298
+ id: Id4,
1299
+ taskId: Id4,
1300
+ sessionId: Id4.nullable(),
1301
+ hostId: Id4.nullable(),
1302
+ dispatchKey: z6.string(),
1303
+ attempt: z6.number().int().min(1),
1421
1304
  state: RunState,
1422
1305
  controlMode: ControlMode,
1423
- controlRevision: z7.number().int().min(1),
1424
- continuationsUsed: z7.number().int().min(0),
1425
- infraRetries: z7.number().int().min(0),
1426
- nextAttemptAt: Iso2.nullable(),
1427
- startedAt: Iso2.nullable(),
1428
- endedAt: Iso2.nullable(),
1429
- outcome: z7.object({
1430
- kind: z7.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1431
- summary: z7.string()
1306
+ controlRevision: z6.number().int().min(1),
1307
+ continuationsUsed: z6.number().int().min(0),
1308
+ infraRetries: z6.number().int().min(0),
1309
+ nextAttemptAt: Iso.nullable(),
1310
+ startedAt: Iso.nullable(),
1311
+ endedAt: Iso.nullable(),
1312
+ outcome: z6.object({
1313
+ kind: z6.enum(["review", "failed", "blocked", "no_change", "canceled"]),
1314
+ summary: z6.string()
1432
1315
  }).nullable(),
1433
1316
  limits: ContinuationPolicy,
1434
- usage: z7.object({
1435
- tokens: z7.number().nullable(),
1436
- costUsd: z7.number().nullable(),
1437
- accounting: z7.enum(["available", "unavailable"]),
1438
- note: z7.string().nullable()
1317
+ usage: z6.object({
1318
+ tokens: z6.number().nullable(),
1319
+ costUsd: z6.number().nullable(),
1320
+ accounting: z6.enum(["available", "unavailable"]),
1321
+ note: z6.string().nullable()
1439
1322
  }),
1440
- checks: z7.array(CheckResult),
1441
- createdAt: Iso2,
1442
- updatedAt: Iso2
1323
+ checks: z6.array(CheckResult),
1324
+ createdAt: Iso,
1325
+ updatedAt: Iso
1443
1326
  });
1444
- var Trigger = z7.discriminatedUnion("kind", [
1445
- z7.object({ kind: z7.literal("manual") }),
1446
- z7.object({ kind: z7.literal("once"), at: Iso2 }),
1447
- z7.object({ kind: z7.literal("cron"), expr: z7.string().min(1), timezone: z7.string().min(1) }),
1448
- z7.object({ kind: z7.literal("webhook") }),
1449
- z7.object({ kind: z7.literal("dependency"), taskId: Id5 })
1327
+ var Trigger = z6.discriminatedUnion("kind", [
1328
+ z6.object({ kind: z6.literal("manual") }),
1329
+ z6.object({ kind: z6.literal("once"), at: Iso }),
1330
+ z6.object({ kind: z6.literal("cron"), expr: z6.string().min(1), timezone: z6.string().min(1) }),
1331
+ z6.object({ kind: z6.literal("webhook") }),
1332
+ z6.object({ kind: z6.literal("dependency"), taskId: Id4 })
1450
1333
  ]);
1451
- var TaskTemplate = z7.object({
1452
- title: z7.string().min(1),
1453
- objective: z7.string(),
1454
- acceptanceCriteria: z7.array(z7.string()),
1334
+ var TaskTemplate = z6.object({
1335
+ title: z6.string().min(1),
1336
+ objective: z6.string(),
1337
+ acceptanceCriteria: z6.array(z6.string()),
1455
1338
  priority: Priority
1456
1339
  });
1457
- var Automation = z7.object({
1458
- id: Id5,
1459
- name: z7.string().min(1),
1460
- enabled: z7.boolean(),
1461
- projectId: Id5,
1340
+ var Automation = z6.object({
1341
+ id: Id4,
1342
+ name: z6.string().min(1),
1343
+ enabled: z6.boolean(),
1344
+ projectId: Id4,
1462
1345
  trigger: Trigger,
1463
- filters: z7.array(z7.object({ path: z7.string(), equals: z7.string() })),
1346
+ filters: z6.array(z6.object({ path: z6.string(), equals: z6.string() })),
1464
1347
  template: TaskTemplate,
1465
- hostId: Id5.nullable(),
1466
- profileId: Id5.nullable(),
1467
- mode: z7.enum(["fresh", "continue", "watch"]),
1468
- groupingKey: z7.string().nullable(),
1469
- overlap: z7.enum(["skip", "queue_one", "append"]),
1470
- missed: z7.enum(["skip", "run_once"]),
1348
+ hostId: Id4.nullable(),
1349
+ profileId: Id4.nullable(),
1350
+ mode: z6.enum(["fresh", "continue", "watch"]),
1351
+ groupingKey: z6.string().nullable(),
1352
+ overlap: z6.enum(["skip", "queue_one", "append"]),
1353
+ missed: z6.enum(["skip", "run_once"]),
1471
1354
  continuation: ContinuationPolicy,
1472
1355
  completion: CompletionPolicy,
1473
- nextAt: Iso2.nullable(),
1474
- lastEvaluatedAt: Iso2.nullable(),
1475
- lastOutcome: z7.string().nullable(),
1476
- failureCount: z7.number().int().min(0),
1477
- webhookTokenSet: z7.boolean(),
1478
- createdAt: Iso2,
1479
- updatedAt: Iso2
1356
+ nextAt: Iso.nullable(),
1357
+ lastEvaluatedAt: Iso.nullable(),
1358
+ lastOutcome: z6.string().nullable(),
1359
+ failureCount: z6.number().int().min(0),
1360
+ webhookTokenSet: z6.boolean(),
1361
+ createdAt: Iso,
1362
+ updatedAt: Iso
1480
1363
  });
1481
- var OccurrenceState = z7.enum([
1364
+ var OccurrenceState = z6.enum([
1482
1365
  "fired",
1483
1366
  "skipped_overlap",
1484
1367
  "skipped_missed",
@@ -1487,39 +1370,39 @@ var OccurrenceState = z7.enum([
1487
1370
  "failed",
1488
1371
  "filtered"
1489
1372
  ]);
1490
- var Occurrence = z7.object({
1491
- id: Id5,
1492
- automationId: Id5,
1493
- key: z7.string(),
1494
- scheduledFor: Iso2.nullable(),
1373
+ var Occurrence = z6.object({
1374
+ id: Id4,
1375
+ automationId: Id4,
1376
+ key: z6.string(),
1377
+ scheduledFor: Iso.nullable(),
1495
1378
  state: OccurrenceState,
1496
- taskId: Id5.nullable(),
1497
- reason: z7.string().nullable(),
1498
- outcome: z7.string().nullable(),
1499
- createdAt: Iso2
1500
- });
1501
- var InteractionState = z7.preprocess((v) => v === "cancelled" ? "canceled" : v, z7.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1502
- var Interaction = z7.object({
1503
- id: Id5,
1504
- sessionId: Id5,
1505
- revision: z7.number().int().min(1),
1506
- source: z7.discriminatedUnion("kind", [
1507
- z7.object({
1508
- kind: z7.literal("extension_ui"),
1509
- method: z7.enum(["select", "confirm", "input", "editor"]),
1510
- piRequestIds: z7.array(z7.string())
1379
+ taskId: Id4.nullable(),
1380
+ reason: z6.string().nullable(),
1381
+ outcome: z6.string().nullable(),
1382
+ createdAt: Iso
1383
+ });
1384
+ var InteractionState = z6.preprocess((v) => v === "cancelled" ? "canceled" : v, z6.enum(["pending", "resolved", "expired", "canceled", "unsupported"]));
1385
+ var Interaction = z6.object({
1386
+ id: Id4,
1387
+ sessionId: Id4,
1388
+ revision: z6.number().int().min(1),
1389
+ source: z6.discriminatedUnion("kind", [
1390
+ z6.object({
1391
+ kind: z6.literal("extension_ui"),
1392
+ method: z6.enum(["select", "confirm", "input", "editor"]),
1393
+ piRequestIds: z6.array(z6.string())
1511
1394
  }),
1512
- z7.object({ kind: z7.literal("unsupported_custom"), title: z7.string().nullable() })
1395
+ z6.object({ kind: z6.literal("unsupported_custom"), title: z6.string().nullable() })
1513
1396
  ]),
1514
- adapterId: z7.string().nullable(),
1397
+ adapterId: z6.string().nullable(),
1515
1398
  permission: PolicyPermission.optional(),
1516
- title: z7.string(),
1399
+ title: z6.string(),
1517
1400
  presentation: UINodeSchema,
1518
1401
  state: InteractionState,
1519
- resolution: z7.object({ by: z7.string(), summary: z7.string(), at: Iso2 }).nullable(),
1520
- createdAt: Iso2
1402
+ resolution: z6.object({ by: z6.string(), summary: z6.string(), at: Iso }).nullable(),
1403
+ createdAt: Iso
1521
1404
  });
1522
- var AttentionReason = z7.enum([
1405
+ var AttentionReason = z6.enum([
1523
1406
  "needs_input",
1524
1407
  "failed",
1525
1408
  "ready_for_review",
@@ -1527,171 +1410,171 @@ var AttentionReason = z7.enum([
1527
1410
  "host_unreachable",
1528
1411
  "cache_expiring"
1529
1412
  ]);
1530
- var AttentionItem = z7.object({
1531
- id: Id5,
1532
- sessionId: Id5.nullable(),
1533
- taskId: Id5.nullable(),
1534
- projectId: Id5.nullable(),
1413
+ var AttentionItem = z6.object({
1414
+ id: Id4,
1415
+ sessionId: Id4.nullable(),
1416
+ taskId: Id4.nullable(),
1417
+ projectId: Id4.nullable(),
1535
1418
  reason: AttentionReason,
1536
- severity: z7.enum(["info", "warning", "critical"]),
1537
- summary: z7.string(),
1538
- interactionId: Id5.nullable(),
1539
- deepLink: z7.string(),
1540
- acknowledgedAt: Iso2.nullable(),
1541
- resolvedAt: Iso2.nullable(),
1542
- createdAt: Iso2
1543
- });
1544
- var Device = z7.object({
1545
- id: Id5,
1546
- name: z7.string(),
1419
+ severity: z6.enum(["info", "warning", "critical"]),
1420
+ summary: z6.string(),
1421
+ interactionId: Id4.nullable(),
1422
+ deepLink: z6.string(),
1423
+ acknowledgedAt: Iso.nullable(),
1424
+ resolvedAt: Iso.nullable(),
1425
+ createdAt: Iso
1426
+ });
1427
+ var Device = z6.object({
1428
+ id: Id4,
1429
+ name: z6.string(),
1547
1430
  kind: DeviceKind,
1548
- createdAt: Iso2,
1549
- lastSeenAt: Iso2.nullable(),
1550
- revokedAt: Iso2.nullable(),
1551
- push: z7.object({
1552
- subscribed: z7.boolean(),
1553
- permission: z7.enum(["granted", "denied", "default", "unknown"])
1431
+ createdAt: Iso,
1432
+ lastSeenAt: Iso.nullable(),
1433
+ revokedAt: Iso.nullable(),
1434
+ push: z6.object({
1435
+ subscribed: z6.boolean(),
1436
+ permission: z6.enum(["granted", "denied", "default", "unknown"])
1554
1437
  }),
1555
- preferredMobile: z7.boolean(),
1556
- enrolledVia: z7.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1557
- });
1558
- var ToolItemData = z7.object({
1559
- toolCallId: z7.string(),
1560
- name: z7.string(),
1561
- status: z7.enum(["running", "ok", "error"]),
1562
- args: z7.unknown(),
1563
- summary: z7.string(),
1564
- output: z7.string(),
1565
- startedAt: Iso2,
1566
- durationMs: z7.number().nullable(),
1438
+ preferredMobile: z6.boolean(),
1439
+ enrolledVia: z6.enum(["enrollment", "passkey", "oidc", "admin", "approval"]).default("enrollment")
1440
+ });
1441
+ var ToolItemData = z6.object({
1442
+ toolCallId: z6.string(),
1443
+ name: z6.string(),
1444
+ status: z6.enum(["running", "ok", "error"]),
1445
+ args: z6.unknown(),
1446
+ summary: z6.string(),
1447
+ output: z6.string(),
1448
+ startedAt: Iso,
1449
+ durationMs: z6.number().nullable(),
1567
1450
  card: UINodeSchema.nullable(),
1568
- adapterId: z7.string().nullable(),
1569
- adapterGeneration: z7.string().uuid().optional()
1451
+ adapterId: z6.string().nullable(),
1452
+ adapterGeneration: z6.string().uuid().optional()
1570
1453
  });
1571
- var TranscriptItem = z7.discriminatedUnion("kind", [
1572
- z7.object({
1573
- id: Id5,
1574
- sessionId: Id5,
1575
- order: z7.number().int(),
1576
- at: Iso2,
1577
- kind: z7.literal("user"),
1578
- data: z7.object({
1579
- text: z7.string(),
1580
- images: z7.number().int().optional(),
1454
+ var TranscriptItem = z6.discriminatedUnion("kind", [
1455
+ z6.object({
1456
+ id: Id4,
1457
+ sessionId: Id4,
1458
+ order: z6.number().int(),
1459
+ at: Iso,
1460
+ kind: z6.literal("user"),
1461
+ data: z6.object({
1462
+ text: z6.string(),
1463
+ images: z6.number().int().optional(),
1581
1464
  /** Pi session entry id, for rewind and fork from this message. */
1582
- entryId: z7.string().optional()
1465
+ entryId: z6.string().optional()
1583
1466
  })
1584
1467
  }),
1585
- z7.object({
1586
- id: Id5,
1587
- sessionId: Id5,
1588
- order: z7.number().int(),
1589
- at: Iso2,
1590
- kind: z7.literal("assistant"),
1591
- data: z7.object({ text: z7.string(), streaming: z7.boolean().optional() })
1468
+ z6.object({
1469
+ id: Id4,
1470
+ sessionId: Id4,
1471
+ order: z6.number().int(),
1472
+ at: Iso,
1473
+ kind: z6.literal("assistant"),
1474
+ data: z6.object({ text: z6.string(), streaming: z6.boolean().optional() })
1592
1475
  }),
1593
- z7.object({
1594
- id: Id5,
1595
- sessionId: Id5,
1596
- order: z7.number().int(),
1597
- at: Iso2,
1598
- kind: z7.literal("thinking"),
1599
- data: z7.object({ text: z7.string() })
1476
+ z6.object({
1477
+ id: Id4,
1478
+ sessionId: Id4,
1479
+ order: z6.number().int(),
1480
+ at: Iso,
1481
+ kind: z6.literal("thinking"),
1482
+ data: z6.object({ text: z6.string() })
1600
1483
  }),
1601
- z7.object({
1602
- id: Id5,
1603
- sessionId: Id5,
1604
- order: z7.number().int(),
1605
- at: Iso2,
1606
- kind: z7.literal("tool"),
1484
+ z6.object({
1485
+ id: Id4,
1486
+ sessionId: Id4,
1487
+ order: z6.number().int(),
1488
+ at: Iso,
1489
+ kind: z6.literal("tool"),
1607
1490
  data: ToolItemData
1608
1491
  }),
1609
- z7.object({
1610
- id: Id5,
1611
- sessionId: Id5,
1612
- order: z7.number().int(),
1613
- at: Iso2,
1614
- kind: z7.literal("notice"),
1615
- data: z7.object({
1492
+ z6.object({
1493
+ id: Id4,
1494
+ sessionId: Id4,
1495
+ order: z6.number().int(),
1496
+ at: Iso,
1497
+ kind: z6.literal("notice"),
1498
+ data: z6.object({
1616
1499
  level: DiagnosticLevel,
1617
- text: z7.string(),
1618
- customType: z7.string().min(1).max(200).optional(),
1500
+ text: z6.string(),
1501
+ customType: z6.string().min(1).max(200).optional(),
1619
1502
  card: UINodeSchema.optional(),
1620
- adapterId: z7.string().optional(),
1621
- adapterGeneration: z7.string().uuid().optional()
1503
+ adapterId: z6.string().optional(),
1504
+ adapterGeneration: z6.string().uuid().optional()
1622
1505
  }).refine((data) => !data.card || !!data.adapterId, "Card requires adapterId")
1623
1506
  }),
1624
- z7.object({
1625
- id: Id5,
1626
- sessionId: Id5,
1627
- order: z7.number().int(),
1628
- at: Iso2,
1629
- kind: z7.literal("interaction"),
1630
- data: z7.object({ interactionId: Id5 })
1507
+ z6.object({
1508
+ id: Id4,
1509
+ sessionId: Id4,
1510
+ order: z6.number().int(),
1511
+ at: Iso,
1512
+ kind: z6.literal("interaction"),
1513
+ data: z6.object({ interactionId: Id4 })
1631
1514
  }),
1632
- z7.object({
1633
- id: Id5,
1634
- sessionId: Id5,
1635
- order: z7.number().int(),
1636
- at: Iso2,
1637
- kind: z7.literal("subagent"),
1638
- data: z7.object({
1639
- runId: z7.string(),
1640
- label: z7.string(),
1641
- status: z7.string(),
1642
- sessionFile: z7.string().nullable(),
1643
- linkedSessionId: Id5.nullable()
1515
+ z6.object({
1516
+ id: Id4,
1517
+ sessionId: Id4,
1518
+ order: z6.number().int(),
1519
+ at: Iso,
1520
+ kind: z6.literal("subagent"),
1521
+ data: z6.object({
1522
+ runId: z6.string(),
1523
+ label: z6.string(),
1524
+ status: z6.string(),
1525
+ sessionFile: z6.string().nullable(),
1526
+ linkedSessionId: Id4.nullable()
1644
1527
  })
1645
1528
  }),
1646
- z7.object({
1647
- id: Id5,
1648
- sessionId: Id5,
1649
- order: z7.number().int(),
1650
- at: Iso2,
1651
- kind: z7.literal("system"),
1652
- data: z7.object({ text: z7.string(), suggestion: z7.boolean().optional() })
1529
+ z6.object({
1530
+ id: Id4,
1531
+ sessionId: Id4,
1532
+ order: z6.number().int(),
1533
+ at: Iso,
1534
+ kind: z6.literal("system"),
1535
+ data: z6.object({ text: z6.string(), suggestion: z6.boolean().optional() })
1653
1536
  })
1654
1537
  ]);
1655
- var Panel = z7.object({
1656
- sessionId: Id5,
1657
- adapterId: z7.string(),
1658
- slot: z7.string(),
1659
- title: z7.string(),
1538
+ var Panel = z6.object({
1539
+ sessionId: Id4,
1540
+ adapterId: z6.string(),
1541
+ slot: z6.string(),
1542
+ title: z6.string(),
1660
1543
  node: UINodeSchema.nullable(),
1661
- webRenderer: z7.boolean(),
1662
- mobileFallback: z7.string().nullable(),
1544
+ webRenderer: z6.boolean(),
1545
+ mobileFallback: z6.string().nullable(),
1663
1546
  contribution: ContributionDescriptor.optional(),
1664
- state: z7.unknown().optional(),
1665
- adapterGeneration: z7.string().uuid().optional(),
1666
- updatedAt: Iso2
1547
+ state: z6.unknown().optional(),
1548
+ adapterGeneration: z6.string().uuid().optional(),
1549
+ updatedAt: Iso
1667
1550
  });
1668
- var Diagnostic = z7.object({
1669
- sessionId: Id5.nullable(),
1670
- adapterId: z7.string().nullable(),
1551
+ var Diagnostic = z6.object({
1552
+ sessionId: Id4.nullable(),
1553
+ adapterId: z6.string().nullable(),
1671
1554
  level: DiagnosticLevel,
1672
- message: z7.string(),
1673
- at: Iso2
1674
- });
1675
- var AdapterInfo = z7.object({
1676
- id: z7.string(),
1677
- version: z7.string(),
1678
- tier: z7.enum(["project", "owner", "plugin", "bundled"]),
1679
- target: z7.object({
1680
- extension: z7.string(),
1681
- versionRange: z7.string(),
1682
- testedVersions: z7.array(z7.string())
1555
+ message: z6.string(),
1556
+ at: Iso
1557
+ });
1558
+ var AdapterInfo = z6.object({
1559
+ id: z6.string(),
1560
+ version: z6.string(),
1561
+ tier: z6.enum(["project", "owner", "plugin", "bundled"]),
1562
+ target: z6.object({
1563
+ extension: z6.string(),
1564
+ versionRange: z6.string(),
1565
+ testedVersions: z6.array(z6.string())
1683
1566
  }),
1684
- capabilities: z7.array(z7.string()),
1685
- webRenderer: z7.boolean(),
1686
- status: z7.enum(["active", "disabled", "error"]),
1687
- detail: z7.string().nullable()
1688
- });
1689
- var Passkey = z7.object({
1690
- id: z7.string(),
1691
- name: z7.string(),
1692
- createdAt: Iso2,
1693
- lastUsedAt: Iso2.nullable(),
1694
- transports: z7.array(z7.string())
1567
+ capabilities: z6.array(z6.string()),
1568
+ webRenderer: z6.boolean(),
1569
+ status: z6.enum(["active", "disabled", "error"]),
1570
+ detail: z6.string().nullable()
1571
+ });
1572
+ var Passkey = z6.object({
1573
+ id: z6.string(),
1574
+ name: z6.string(),
1575
+ createdAt: Iso,
1576
+ lastUsedAt: Iso.nullable(),
1577
+ transports: z6.array(z6.string())
1695
1578
  });
1696
1579
 
1697
1580
  // packages/protocol/dist/adapter-preview.js
@@ -1704,92 +1587,92 @@ function bounded(input, ctx) {
1704
1587
  return input;
1705
1588
  } catch (error) {
1706
1589
  ctx.addIssue({ code: "custom", message: error.message });
1707
- return z8.NEVER;
1590
+ return z7.NEVER;
1708
1591
  }
1709
1592
  }
1710
- var Id6 = z8.string().min(1).max(200);
1711
- var Text2 = z8.string().max(64 * 1024);
1712
- var Tool = { toolCallId: Id6, name: Id6, args: z8.unknown() };
1713
- var DialogCommon = { id: Id6, title: Text2 };
1714
- var AdapterPreviewPiUiRequestSchema = z8.discriminatedUnion("method", [
1715
- z8.object({
1593
+ var Id5 = z7.string().min(1).max(200);
1594
+ var Text2 = z7.string().max(64 * 1024);
1595
+ var Tool = { toolCallId: Id5, name: Id5, args: z7.unknown() };
1596
+ var DialogCommon = { id: Id5, title: Text2 };
1597
+ var AdapterPreviewPiUiRequestSchema = z7.discriminatedUnion("method", [
1598
+ z7.object({
1716
1599
  ...DialogCommon,
1717
- method: z8.literal("select"),
1718
- options: z8.array(Text2).max(200),
1719
- timeout: z8.number().nonnegative().optional()
1600
+ method: z7.literal("select"),
1601
+ options: z7.array(Text2).max(200),
1602
+ timeout: z7.number().nonnegative().optional()
1720
1603
  }).strict(),
1721
- z8.object({
1604
+ z7.object({
1722
1605
  ...DialogCommon,
1723
- method: z8.literal("confirm"),
1606
+ method: z7.literal("confirm"),
1724
1607
  message: Text2,
1725
- timeout: z8.number().nonnegative().optional()
1608
+ timeout: z7.number().nonnegative().optional()
1726
1609
  }).strict(),
1727
- z8.object({
1610
+ z7.object({
1728
1611
  ...DialogCommon,
1729
- method: z8.literal("input"),
1612
+ method: z7.literal("input"),
1730
1613
  placeholder: Text2.optional(),
1731
- timeout: z8.number().nonnegative().optional()
1614
+ timeout: z7.number().nonnegative().optional()
1732
1615
  }).strict(),
1733
- z8.object({ ...DialogCommon, method: z8.literal("editor"), prefill: Text2.optional() }).strict()
1616
+ z7.object({ ...DialogCommon, method: z7.literal("editor"), prefill: Text2.optional() }).strict()
1734
1617
  ]);
1735
- var AdapterPreviewStepSchema = z8.discriminatedUnion("kind", [
1736
- z8.object({ kind: z8.literal("restore") }).strict(),
1737
- z8.object({ kind: z8.literal("toolStart"), data: z8.object(Tool).strict() }).strict(),
1738
- z8.object({
1739
- kind: z8.literal("toolUpdate"),
1740
- data: z8.object({ ...Tool, partialResult: z8.unknown(), details: z8.unknown().optional() }).strict()
1618
+ var AdapterPreviewStepSchema = z7.discriminatedUnion("kind", [
1619
+ z7.object({ kind: z7.literal("restore") }).strict(),
1620
+ z7.object({ kind: z7.literal("toolStart"), data: z7.object(Tool).strict() }).strict(),
1621
+ z7.object({
1622
+ kind: z7.literal("toolUpdate"),
1623
+ data: z7.object({ ...Tool, partialResult: z7.unknown(), details: z7.unknown().optional() }).strict()
1741
1624
  }).strict(),
1742
- z8.object({
1743
- kind: z8.literal("toolEnd"),
1744
- data: z8.object({
1625
+ z7.object({
1626
+ kind: z7.literal("toolEnd"),
1627
+ data: z7.object({
1745
1628
  ...Tool,
1746
- result: z8.unknown(),
1747
- isError: z8.boolean(),
1748
- details: z8.unknown().optional()
1629
+ result: z7.unknown(),
1630
+ isError: z7.boolean(),
1631
+ details: z7.unknown().optional()
1749
1632
  }).strict()
1750
1633
  }).strict(),
1751
- z8.object({
1752
- kind: z8.literal("status"),
1753
- data: z8.object({ key: Id6, text: Text2.optional() }).strict()
1634
+ z7.object({
1635
+ kind: z7.literal("status"),
1636
+ data: z7.object({ key: Id5, text: Text2.optional() }).strict()
1754
1637
  }).strict(),
1755
- z8.object({
1756
- kind: z8.literal("widget"),
1757
- data: z8.object({ key: Id6, lines: z8.array(Text2).max(200).optional() }).strict()
1638
+ z7.object({
1639
+ kind: z7.literal("widget"),
1640
+ data: z7.object({ key: Id5, lines: z7.array(Text2).max(200).optional() }).strict()
1758
1641
  }).strict(),
1759
- z8.object({ kind: z8.literal("dialog"), data: AdapterPreviewPiUiRequestSchema }).strict(),
1760
- z8.object({
1761
- kind: z8.literal("answer"),
1762
- data: z8.object({ requestId: Id6, response: InteractionResponseSchema }).strict()
1642
+ z7.object({ kind: z7.literal("dialog"), data: AdapterPreviewPiUiRequestSchema }).strict(),
1643
+ z7.object({
1644
+ kind: z7.literal("answer"),
1645
+ data: z7.object({ requestId: Id5, response: InteractionResponseSchema }).strict()
1763
1646
  }).strict(),
1764
- z8.object({
1765
- kind: z8.literal("customMessage"),
1766
- data: z8.object({
1767
- customType: Id6,
1768
- content: z8.unknown(),
1769
- display: z8.boolean().optional(),
1770
- details: z8.unknown().optional()
1647
+ z7.object({
1648
+ kind: z7.literal("customMessage"),
1649
+ data: z7.object({
1650
+ customType: Id5,
1651
+ content: z7.unknown(),
1652
+ display: z7.boolean().optional(),
1653
+ details: z7.unknown().optional()
1771
1654
  }).strict()
1772
1655
  }).strict(),
1773
- z8.object({
1774
- kind: z8.literal("action"),
1775
- data: z8.object({ actionId: Id6, payload: z8.unknown() }).strict()
1656
+ z7.object({
1657
+ kind: z7.literal("action"),
1658
+ data: z7.object({ actionId: Id5, payload: z7.unknown() }).strict()
1776
1659
  }).strict()
1777
1660
  ]);
1778
- var AdapterPreviewFixtureSchema = z8.unknown().transform(bounded).pipe(z8.object({
1779
- version: z8.literal(1),
1780
- name: z8.string().min(1).max(200),
1781
- initialState: z8.record(z8.string(), z8.record(z8.string(), z8.unknown())).optional(),
1782
- steps: z8.array(AdapterPreviewStepSchema).max(ADAPTER_PREVIEW_MAX_STEPS)
1661
+ var AdapterPreviewFixtureSchema = z7.unknown().transform(bounded).pipe(z7.object({
1662
+ version: z7.literal(1),
1663
+ name: z7.string().min(1).max(200),
1664
+ initialState: z7.record(z7.string(), z7.record(z7.string(), z7.unknown())).optional(),
1665
+ steps: z7.array(AdapterPreviewStepSchema).max(ADAPTER_PREVIEW_MAX_STEPS)
1783
1666
  }).strict());
1784
- var PortableNode = z8.unknown().transform((input, ctx) => {
1667
+ var PortableNode = z7.unknown().transform((input, ctx) => {
1785
1668
  try {
1786
1669
  return validateUINode(input);
1787
1670
  } catch (error) {
1788
1671
  ctx.addIssue({ code: "custom", message: error.message });
1789
- return z8.NEVER;
1672
+ return z7.NEVER;
1790
1673
  }
1791
1674
  });
1792
- var PreviewPanel = Panel.extend({ webRenderer: z8.literal(false) }).superRefine((panel, ctx) => {
1675
+ var PreviewPanel = Panel.extend({ webRenderer: z7.literal(false) }).superRefine((panel, ctx) => {
1793
1676
  try {
1794
1677
  if (panel.sessionId !== ADAPTER_PREVIEW_SESSION_ID)
1795
1678
  throw new Error("Preview panels must use the fake preview session");
@@ -1811,13 +1694,13 @@ var PreviewPanel = Panel.extend({ webRenderer: z8.literal(false) }).superRefine(
1811
1694
  ctx.addIssue({ code: "custom", message: error.message });
1812
1695
  }
1813
1696
  });
1814
- var AdapterPreviewSchema = z8.unknown().transform(bounded).pipe(z8.object({
1815
- version: z8.literal(1),
1816
- name: z8.string().min(1).max(200),
1817
- adapter: z8.object({ id: Id6, version: Id6 }).strict(),
1818
- steps: z8.array(z8.object({
1819
- index: z8.number().int().min(0).max(ADAPTER_PREVIEW_MAX_STEPS - 1),
1820
- kind: z8.enum([
1697
+ var AdapterPreviewSchema = z7.unknown().transform(bounded).pipe(z7.object({
1698
+ version: z7.literal(1),
1699
+ name: z7.string().min(1).max(200),
1700
+ adapter: z7.object({ id: Id5, version: Id5 }).strict(),
1701
+ steps: z7.array(z7.object({
1702
+ index: z7.number().int().min(0).max(ADAPTER_PREVIEW_MAX_STEPS - 1),
1703
+ kind: z7.enum([
1821
1704
  "restore",
1822
1705
  "toolStart",
1823
1706
  "toolUpdate",
@@ -1829,24 +1712,24 @@ var AdapterPreviewSchema = z8.unknown().transform(bounded).pipe(z8.object({
1829
1712
  "customMessage",
1830
1713
  "action"
1831
1714
  ]),
1832
- ok: z8.boolean(),
1833
- error: z8.string().max(4e3).nullable()
1715
+ ok: z7.boolean(),
1716
+ error: z7.string().max(4e3).nullable()
1834
1717
  }).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
1835
- panels: z8.array(PreviewPanel).max(256),
1836
- interactions: z8.array(z8.object({
1718
+ panels: z7.array(PreviewPanel).max(256),
1719
+ interactions: z7.array(z7.object({
1837
1720
  request: AdapterPreviewPiUiRequestSchema,
1838
1721
  presentation: PortableNode,
1839
- state: z8.enum(["pending", "resolved"])
1722
+ state: z7.enum(["pending", "resolved"])
1840
1723
  }).strict()).max(ADAPTER_PREVIEW_MAX_STEPS),
1841
- cards: z8.array(z8.unknown().transform((input, ctx) => {
1724
+ cards: z7.array(z7.unknown().transform((input, ctx) => {
1842
1725
  try {
1843
1726
  return validateContributionCard(input);
1844
1727
  } catch (error) {
1845
1728
  ctx.addIssue({ code: "custom", message: error.message });
1846
- return z8.NEVER;
1729
+ return z7.NEVER;
1847
1730
  }
1848
1731
  })).max(ADAPTER_PREVIEW_MAX_STEPS * 3),
1849
- diagnostics: z8.array(Diagnostic.extend({ message: z8.string().max(4e3) }).refine((d) => d.sessionId === null || d.sessionId === ADAPTER_PREVIEW_SESSION_ID, "Preview diagnostics must use the fake preview session")).max(200)
1732
+ diagnostics: z7.array(Diagnostic.extend({ message: z7.string().max(4e3) }).refine((d) => d.sessionId === null || d.sessionId === ADAPTER_PREVIEW_SESSION_ID, "Preview diagnostics must use the fake preview session")).max(200)
1850
1733
  }).strict().superRefine((preview, ctx) => {
1851
1734
  const slots = /* @__PURE__ */ new Set();
1852
1735
  let contributions = 0;
@@ -1875,39 +1758,39 @@ var AdapterPreviewSchema = z8.unknown().transform(bounded).pipe(z8.object({
1875
1758
  }));
1876
1759
 
1877
1760
  // packages/protocol/dist/adapters.js
1878
- import { z as z9 } from "zod";
1879
- var Path = z9.string().max(4096);
1761
+ import { z as z8 } from "zod";
1762
+ var Path = z8.string().max(4096);
1880
1763
  var SessionAdapterInfo = AdapterInfo.extend({
1881
- runtimeStatus: z9.enum(["active", "disabled", "unavailable"]),
1882
- runtimeDetail: z9.string().max(4e3).nullable(),
1883
- provenance: z9.object({
1884
- scope: z9.enum(["user", "project", "explicit"]),
1764
+ runtimeStatus: z8.enum(["active", "disabled", "unavailable"]),
1765
+ runtimeDetail: z8.string().max(4e3).nullable(),
1766
+ provenance: z8.object({
1767
+ scope: z8.enum(["user", "project", "explicit"]),
1885
1768
  source: Path.nullable(),
1886
1769
  packageDir: Path.nullable(),
1887
1770
  manifestPath: Path.nullable(),
1888
- targetVersion: z9.string().nullable(),
1889
- entrypoints: z9.array(Path).max(128),
1890
- evidence: z9.enum(["runtime-reported", "package-level", "explicit"])
1771
+ targetVersion: z8.string().nullable(),
1772
+ entrypoints: z8.array(Path).max(128),
1773
+ evidence: z8.enum(["runtime-reported", "package-level", "explicit"])
1891
1774
  })
1892
1775
  });
1893
- var SessionAdaptersResult = z9.object({
1894
- generation: z9.string().uuid().nullable(),
1895
- runtimeId: z9.string().nullable(),
1896
- reloadable: z9.boolean(),
1897
- blockedReason: z9.string().nullable(),
1898
- adapters: z9.array(SessionAdapterInfo).max(256),
1899
- diagnostics: z9.array(Diagnostic).max(100)
1776
+ var SessionAdaptersResult = z8.object({
1777
+ generation: z8.string().uuid().nullable(),
1778
+ runtimeId: z8.string().nullable(),
1779
+ reloadable: z8.boolean(),
1780
+ blockedReason: z8.string().nullable(),
1781
+ adapters: z8.array(SessionAdapterInfo).max(256),
1782
+ diagnostics: z8.array(Diagnostic).max(100)
1900
1783
  });
1901
1784
 
1902
1785
  // packages/protocol/dist/agent-wire.js
1903
- import { z as z10 } from "zod";
1904
- var Id7 = z10.string().min(1).max(200);
1905
- var Instant3 = z10.string().refine((value) => {
1786
+ import { z as z9 } from "zod";
1787
+ var Id6 = z9.string().min(1).max(200);
1788
+ var Instant3 = z9.string().refine((value) => {
1906
1789
  const date = new Date(value);
1907
1790
  return Number.isFinite(date.getTime()) && date.toISOString() === value;
1908
1791
  }, "Expected canonical UTC timestamp");
1909
1792
  var AGENT_FRAME_MAX_BYTES = 128 * 1024;
1910
- var AgentMethod = z10.enum([
1793
+ var AgentMethod = z9.enum([
1911
1794
  "session.bind",
1912
1795
  "task.create",
1913
1796
  "message.send",
@@ -1917,34 +1800,34 @@ var AgentMethod = z10.enum([
1917
1800
  "policy.status",
1918
1801
  "policy.cancel"
1919
1802
  ]);
1920
- var AgentToolMethod = z10.enum(["task.create", "message.send", "inbox.read"]);
1921
- var RequestHash = z10.string().regex(/^[a-f0-9]{64}$/);
1922
- var AgentReceiptPeekRequest = z10.object({ method: AgentToolMethod, args: z10.record(z10.string(), z10.json()) }).strict();
1923
- var AgentReceiptPeekResult = z10.discriminatedUnion("found", [
1924
- z10.object({ found: z10.literal(false) }).strict(),
1925
- z10.object({ found: z10.literal(true), requestHash: RequestHash }).strict()
1803
+ var AgentToolMethod = z9.enum(["task.create", "message.send", "inbox.read"]);
1804
+ var RequestHash = z9.string().regex(/^[a-f0-9]{64}$/);
1805
+ var AgentReceiptPeekRequest = z9.object({ method: AgentToolMethod, args: z9.record(z9.string(), z9.json()) }).strict();
1806
+ var AgentReceiptPeekResult = z9.discriminatedUnion("found", [
1807
+ z9.object({ found: z9.literal(false) }).strict(),
1808
+ z9.object({ found: z9.literal(true), requestHash: RequestHash }).strict()
1926
1809
  ]);
1927
- var AgentReceiptReplay = z10.object({ requestHash: RequestHash }).strict();
1928
- var CreateAgentTask = z10.object({
1929
- objective: z10.string().min(1).max(16e3),
1930
- acceptance: z10.array(z10.string().min(1).max(2e3)).max(100).default([]),
1931
- dependencies: z10.array(Id7).max(100).default([]),
1932
- parentTaskId: Id7.nullable().optional(),
1933
- hostId: Id7.optional(),
1934
- profileId: Id7.optional(),
1935
- notifyOnFinish: z10.boolean().default(true)
1936
- });
1937
- var SendAgentMessage = z10.object({
1938
- sessionId: Id7,
1939
- body: z10.string().min(1).max(16e3),
1940
- mode: z10.enum(["steer", "queue"]),
1941
- replyTo: Id7.optional()
1942
- });
1943
- var ReadAgentInbox = z10.object({
1944
- after: z10.number().int().nonnegative().default(0),
1945
- limit: z10.number().int().min(1).max(100).default(20)
1946
- });
1947
- var DeliveryState = z10.enum([
1810
+ var AgentReceiptReplay = z9.object({ requestHash: RequestHash }).strict();
1811
+ var CreateAgentTask = z9.object({
1812
+ objective: z9.string().min(1).max(16e3),
1813
+ acceptance: z9.array(z9.string().min(1).max(2e3)).max(100).default([]),
1814
+ dependencies: z9.array(Id6).max(100).default([]),
1815
+ parentTaskId: Id6.nullable().optional(),
1816
+ hostId: Id6.optional(),
1817
+ profileId: Id6.optional(),
1818
+ notifyOnFinish: z9.boolean().default(true)
1819
+ });
1820
+ var SendAgentMessage = z9.object({
1821
+ sessionId: Id6,
1822
+ body: z9.string().min(1).max(16e3),
1823
+ mode: z9.enum(["steer", "queue"]),
1824
+ replyTo: Id6.optional()
1825
+ });
1826
+ var ReadAgentInbox = z9.object({
1827
+ after: z9.number().int().nonnegative().default(0),
1828
+ limit: z9.number().int().min(1).max(100).default(20)
1829
+ });
1830
+ var DeliveryState = z9.enum([
1948
1831
  "pending",
1949
1832
  "held",
1950
1833
  "deferred",
@@ -1955,46 +1838,46 @@ var DeliveryState = z10.enum([
1955
1838
  "failed"
1956
1839
  ]);
1957
1840
  var AgentMessageFields = {
1958
- seq: z10.number().int().positive(),
1959
- id: Id7,
1960
- recipientSessionId: Id7,
1961
- replyTo: Id7.nullable(),
1962
- chainId: Id7,
1963
- depth: z10.number().int().min(0).max(4),
1964
- body: z10.unknown(),
1965
- requestedMode: z10.enum(["steer", "queue"]),
1841
+ seq: z9.number().int().positive(),
1842
+ id: Id6,
1843
+ recipientSessionId: Id6,
1844
+ replyTo: Id6.nullable(),
1845
+ chainId: Id6,
1846
+ depth: z9.number().int().min(0).max(4),
1847
+ body: z9.unknown(),
1848
+ requestedMode: z9.enum(["steer", "queue"]),
1966
1849
  deliveryState: DeliveryState,
1967
- holdUntil: z10.string(),
1968
- readAt: z10.string().nullable(),
1969
- createdAt: z10.string()
1850
+ holdUntil: z9.string(),
1851
+ readAt: z9.string().nullable(),
1852
+ createdAt: z9.string()
1970
1853
  };
1971
- var AgentMessage = z10.discriminatedUnion("kind", [
1972
- z10.object({ ...AgentMessageFields, kind: z10.literal("message"), senderSessionId: Id7 }),
1973
- z10.object({
1854
+ var AgentMessage = z9.discriminatedUnion("kind", [
1855
+ z9.object({ ...AgentMessageFields, kind: z9.literal("message"), senderSessionId: Id6 }),
1856
+ z9.object({
1974
1857
  ...AgentMessageFields,
1975
- kind: z10.literal("completion"),
1976
- senderSessionId: Id7.nullable()
1858
+ kind: z9.literal("completion"),
1859
+ senderSessionId: Id6.nullable()
1977
1860
  })
1978
1861
  ]);
1979
- var AgentInbox = z10.object({
1980
- messages: z10.array(AgentMessage),
1981
- nextAfter: z10.number().int().nonnegative(),
1982
- hasMore: z10.boolean()
1983
- });
1984
- var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type: z10.literal("policy.required") }).strict();
1985
- var AgentRequestFrame = z10.object({
1986
- type: z10.literal("agent.request"),
1987
- requestId: Id7,
1988
- sessionId: Id7,
1989
- nativeSessionId: Id7,
1990
- runtimeId: Id7,
1991
- context: z10.object({ humanInputId: Id7.nullable(), causalMessageId: Id7.nullable() }).strict(),
1992
- toolCallId: Id7.optional(),
1862
+ var AgentInbox = z9.object({
1863
+ messages: z9.array(AgentMessage),
1864
+ nextAfter: z9.number().int().nonnegative(),
1865
+ hasMore: z9.boolean()
1866
+ });
1867
+ var AgentToolPolicyWait = PolicyEvaluation.options[2].omit({ verdict: true }).extend({ type: z9.literal("policy.required") }).strict();
1868
+ var AgentRequestFrame = z9.object({
1869
+ type: z9.literal("agent.request"),
1870
+ requestId: Id6,
1871
+ sessionId: Id6,
1872
+ nativeSessionId: Id6,
1873
+ runtimeId: Id6,
1874
+ context: z9.object({ humanInputId: Id6.nullable(), causalMessageId: Id6.nullable() }).strict(),
1875
+ toolCallId: Id6.optional(),
1993
1876
  receiptReplay: AgentReceiptReplay.optional(),
1994
1877
  // Tool-method ingress requires this separately; legacy/non-tool frames remain compatible.
1995
1878
  deadlineAt: Instant3.optional(),
1996
1879
  method: AgentMethod,
1997
- args: z10.unknown()
1880
+ args: z9.unknown()
1998
1881
  }).strict().superRefine((frame, ctx) => {
1999
1882
  if (frame.method === "receipt.peek") {
2000
1883
  if (!frame.toolCallId) {
@@ -2013,19 +1896,19 @@ var AgentRequestFrame = z10.object({
2013
1896
  });
2014
1897
  }
2015
1898
  });
2016
- var AgentResultFrame = z10.discriminatedUnion("ok", [
2017
- z10.object({
2018
- type: z10.literal("agent.result"),
2019
- requestId: Id7,
2020
- runtimeId: Id7,
2021
- ok: z10.literal(true),
2022
- result: z10.unknown()
1899
+ var AgentResultFrame = z9.discriminatedUnion("ok", [
1900
+ z9.object({
1901
+ type: z9.literal("agent.result"),
1902
+ requestId: Id6,
1903
+ runtimeId: Id6,
1904
+ ok: z9.literal(true),
1905
+ result: z9.unknown()
2023
1906
  }),
2024
- z10.object({
2025
- type: z10.literal("agent.result"),
2026
- requestId: Id7,
2027
- runtimeId: Id7,
2028
- ok: z10.literal(false),
1907
+ z9.object({
1908
+ type: z9.literal("agent.result"),
1909
+ requestId: Id6,
1910
+ runtimeId: Id6,
1911
+ ok: z9.literal(false),
2029
1912
  error: ErrorBody
2030
1913
  })
2031
1914
  ]);
@@ -2038,6 +1921,196 @@ import { z as z13 } from "zod";
2038
1921
 
2039
1922
  // packages/protocol/dist/events.js
2040
1923
  import { z as z11 } from "zod";
1924
+
1925
+ // packages/protocol/dist/trackers.js
1926
+ import { z as z10 } from "zod";
1927
+ var Iso2 = z10.string();
1928
+ var Id7 = z10.string().min(1);
1929
+ var TrackerFollow = z10.enum(["assigned", "board"]);
1930
+ var GitHubLogin = z10.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/);
1931
+ var TrackerStatusOption = z10.object({
1932
+ id: z10.string().min(1),
1933
+ name: z10.string().min(1).max(200)
1934
+ });
1935
+ var TrackerBoard = z10.object({
1936
+ projectNumber: z10.number().int().positive(),
1937
+ statusField: z10.string().min(1).max(100).default("Status"),
1938
+ /** Column to move a card to once its worktree exists (write-back). */
1939
+ onStart: z10.string().min(1).max(200).nullable().default(null),
1940
+ /** Column to move a card to once a pull request is open (write-back). */
1941
+ onReview: z10.string().min(1).max(200).nullable().default(null),
1942
+ /** A single-select field that ranks issues: its first option is the highest. */
1943
+ priorityField: z10.string().min(1).max(100).nullable().optional(),
1944
+ /** Columns whose cards are not tracked until they have a branch or pull request. */
1945
+ backlog: z10.array(z10.string().min(1).max(200)).max(20).optional()
1946
+ });
1947
+ var Tracker = z10.object({
1948
+ id: Id7,
1949
+ name: z10.string().min(1).max(60),
1950
+ provider: z10.literal("github"),
1951
+ hostId: Id7,
1952
+ owner: GitHubLogin,
1953
+ repositories: z10.array(GitHubRepository).min(1).max(50).nullable(),
1954
+ /** Repositories outside `owner` that belong to this tracker too (never limited by `repositories`). */
1955
+ extraRepositories: z10.array(GitHubRepository).max(20).optional(),
1956
+ board: TrackerBoard.nullable(),
1957
+ /** Which issues it follows; absent means "assigned". "board": every open issue on its board. */
1958
+ follow: TrackerFollow.optional(),
1959
+ writeBack: z10.boolean(),
1960
+ moveShared: z10.boolean(),
1961
+ /** Make a worktree for an issue branch that has none; absent means true. */
1962
+ worktrees: z10.boolean().optional(),
1963
+ enabled: z10.boolean(),
1964
+ /** The host's `gh` user, from the last sync. */
1965
+ login: z10.string().nullable(),
1966
+ lastSyncedAt: Iso2.nullable(),
1967
+ lastError: z10.string().max(2e3).nullable(),
1968
+ createdAt: Iso2,
1969
+ updatedAt: Iso2
1970
+ });
1971
+ var TrackerInput = z10.object({
1972
+ name: Tracker.shape.name,
1973
+ hostId: Id7,
1974
+ owner: GitHubLogin,
1975
+ repositories: Tracker.shape.repositories.default(null),
1976
+ extraRepositories: z10.array(GitHubRepository).max(20).default([]),
1977
+ board: TrackerBoard.nullable().default(null),
1978
+ follow: TrackerFollow.default("assigned"),
1979
+ writeBack: z10.boolean().default(false),
1980
+ moveShared: z10.boolean().default(true),
1981
+ worktrees: z10.boolean().default(true),
1982
+ enabled: z10.boolean().default(true)
1983
+ });
1984
+ var TrackerPatch = z10.object({
1985
+ name: Tracker.shape.name.optional(),
1986
+ hostId: Id7.optional(),
1987
+ owner: GitHubLogin.optional(),
1988
+ repositories: Tracker.shape.repositories.optional(),
1989
+ extraRepositories: z10.array(GitHubRepository).max(20).optional(),
1990
+ board: TrackerBoard.nullable().optional(),
1991
+ follow: TrackerFollow.optional(),
1992
+ writeBack: z10.boolean().optional(),
1993
+ moveShared: z10.boolean().optional(),
1994
+ worktrees: z10.boolean().optional(),
1995
+ enabled: z10.boolean().optional()
1996
+ });
1997
+ var TrackerItemBoard = z10.object({
1998
+ projectId: z10.string().min(1),
1999
+ projectItemId: z10.string().min(1),
2000
+ fieldId: z10.string().min(1),
2001
+ status: z10.string().nullable(),
2002
+ statusOptionId: z10.string().nullable(),
2003
+ options: z10.array(TrackerStatusOption).max(50),
2004
+ /** The issue's value of the tracker's priority field; `rank` is its option's position. */
2005
+ priority: z10.object({ name: z10.string().min(1).max(200), rank: z10.number().int().min(0) }).nullable().optional()
2006
+ });
2007
+ var TrackerPullRequest = z10.object({
2008
+ number: z10.number().int().positive(),
2009
+ state: z10.enum(["OPEN", "CLOSED", "MERGED"]),
2010
+ url: z10.string().url(),
2011
+ headRefName: z10.string().min(1).max(255)
2012
+ });
2013
+ var TrackerParent = z10.object({
2014
+ number: z10.number().int().positive(),
2015
+ title: z10.string().max(300),
2016
+ url: GitHubIssueUrl
2017
+ });
2018
+ var TrackerSubIssues = z10.object({
2019
+ total: z10.number().int().min(0),
2020
+ completed: z10.number().int().min(0)
2021
+ });
2022
+ var TrackerItem = z10.object({
2023
+ itemId: z10.string().min(1),
2024
+ repository: GitHubRepository,
2025
+ number: z10.number().int().positive(),
2026
+ title: z10.string().min(1).max(1e3),
2027
+ url: GitHubIssueUrl,
2028
+ assignees: z10.array(z10.string()).max(20),
2029
+ branches: z10.array(z10.string().min(1).max(255)).max(10),
2030
+ pullRequest: TrackerPullRequest.nullable(),
2031
+ board: TrackerItemBoard.nullable(),
2032
+ parent: TrackerParent.nullable().optional(),
2033
+ subIssues: TrackerSubIssues.nullable().optional()
2034
+ });
2035
+ var TrackerSyncResult = z10.object({
2036
+ login: z10.string().min(1),
2037
+ items: z10.array(TrackerItem).max(200),
2038
+ truncated: z10.boolean()
2039
+ });
2040
+ var TrackedIssue = z10.object({
2041
+ /** `${trackerId}:${itemId}` */
2042
+ id: Id7,
2043
+ trackerId: Id7,
2044
+ itemId: z10.string().min(1),
2045
+ projectId: Id7,
2046
+ repository: GitHubRepository,
2047
+ number: z10.number().int().positive(),
2048
+ title: z10.string().min(1).max(300),
2049
+ url: GitHubIssueUrl,
2050
+ assignees: z10.array(z10.string()).max(20),
2051
+ /** Branches GitHub links to the issue. */
2052
+ branches: z10.array(z10.string()).max(10),
2053
+ /** The branch Switchyard works on. */
2054
+ branch: z10.string().nullable(),
2055
+ workspaceId: Id7.nullable(),
2056
+ pullRequest: TrackerPullRequest.nullable(),
2057
+ board: TrackerItemBoard.nullable(),
2058
+ /** The issue this one is a sub-issue of. */
2059
+ parent: TrackerParent.nullable().optional(),
2060
+ subIssues: TrackerSubIssues.nullable().optional(),
2061
+ updatedAt: Iso2
2062
+ });
2063
+ var OpenIssueRequest = z10.object({
2064
+ hostId: Id7.optional(),
2065
+ viewId: z10.string().optional(),
2066
+ /** The first prompt of a new session. */
2067
+ prompt: z10.string().optional(),
2068
+ profileId: z10.string().nullable().optional()
2069
+ });
2070
+ var TrackerSetStatusResult = z10.discriminatedUnion("status", [
2071
+ z10.object({ status: z10.literal("moved") }),
2072
+ z10.object({
2073
+ status: z10.literal("skipped"),
2074
+ reason: z10.enum(["not_assigned", "shared", "stale"])
2075
+ })
2076
+ ]);
2077
+ var LinkIssueRequest = z10.object({ workspaceId: Id7 });
2078
+ var TrackerStatusRequest = z10.object({ status: z10.string().min(1).max(200) });
2079
+ var TrackerHostSyncRequest = z10.object({
2080
+ owner: GitHubLogin,
2081
+ repositories: z10.array(GitHubRepository).nullable(),
2082
+ board: z10.object({
2083
+ projectNumber: z10.number().int().positive(),
2084
+ statusField: z10.string().min(1),
2085
+ priorityField: z10.string().min(1).nullable().optional()
2086
+ }).nullable(),
2087
+ follow: TrackerFollow.optional(),
2088
+ backlog: z10.array(z10.string().min(1)).max(20).optional()
2089
+ });
2090
+ var TrackerHostPrepareBranchRequest = z10.object({
2091
+ checkoutPath: z10.string().min(1),
2092
+ branch: z10.string().min(1).max(255)
2093
+ });
2094
+ var TrackerHostStartIssueRequest = z10.object({
2095
+ checkoutPath: z10.string().min(1),
2096
+ repository: GitHubRepository,
2097
+ number: z10.number().int().positive(),
2098
+ branch: z10.string().min(1).max(255),
2099
+ base: z10.string().min(1)
2100
+ });
2101
+ var TrackerHostSetStatusRequest = z10.object({
2102
+ projectId: z10.string().min(1),
2103
+ projectItemId: z10.string().min(1),
2104
+ fieldId: z10.string().min(1),
2105
+ statusField: z10.string().min(1),
2106
+ optionId: z10.string().min(1),
2107
+ expectedOptionId: z10.string().nullable(),
2108
+ login: z10.string().min(1),
2109
+ allowShared: z10.boolean(),
2110
+ allowUnassigned: z10.boolean().optional()
2111
+ });
2112
+
2113
+ // packages/protocol/dist/events.js
2041
2114
  var EventDataSchemas = {
2042
2115
  "host.updated": Host,
2043
2116
  "project.updated": Project,
@@ -2065,6 +2138,10 @@ var EventDataSchemas = {
2065
2138
  "occurrence.updated": Occurrence,
2066
2139
  "attention.updated": AttentionItem,
2067
2140
  "device.updated": Device,
2141
+ "issue.updated": TrackedIssue,
2142
+ "issue.deleted": z11.object({ id: z11.string() }),
2143
+ "surface.updated": Surface,
2144
+ "surface.deleted": z11.object({ id: z11.string() }),
2068
2145
  "settings.updated": z11.object({ dispatchPaused: z11.boolean() })
2069
2146
  };
2070
2147
  var EVENT_TYPES = Object.keys(EventDataSchemas);
@@ -2604,6 +2681,20 @@ var CreateSessionRequest = z14.object({
2604
2681
  title: z14.string().optional(),
2605
2682
  viewId: z14.string().optional()
2606
2683
  });
2684
+ var OpenBranchRequest = z14.object({
2685
+ projectId: z14.string(),
2686
+ branch: z14.string().min(1),
2687
+ hostId: z14.string().optional(),
2688
+ base: z14.string().nullable().optional(),
2689
+ prompt: z14.string().default(""),
2690
+ profileId: z14.string().nullable().optional(),
2691
+ title: z14.string().optional(),
2692
+ viewId: z14.string().optional(),
2693
+ /** Start another session even when the branch has one. */
2694
+ another: z14.boolean().default(false)
2695
+ });
2696
+ var OpenBranchResult = z14.object({ session: Session, created: z14.boolean() });
2697
+ var SetPrimaryRequest = z14.object({ primary: z14.boolean() });
2607
2698
  var PromptRequest = z14.object({
2608
2699
  text: z14.string().min(1),
2609
2700
  mode: z14.enum(["prompt", "steer", "followUp"]).default("prompt"),
@@ -2781,7 +2872,6 @@ var UpdateTaskRequest = z14.object({
2781
2872
  githubIssueUrl: z14.never().optional(),
2782
2873
  githubIssue: z14.never().optional(),
2783
2874
  launchPrompt: z14.never().optional(),
2784
- tracker: z14.never().optional(),
2785
2875
  title: z14.string().min(1).max(300).optional(),
2786
2876
  objective: z14.string().optional(),
2787
2877
  acceptanceCriteria: z14.array(z14.string()).optional(),
@@ -2956,6 +3046,12 @@ var MeResponse = z14.object({
2956
3046
  admin: z14.boolean(),
2957
3047
  publicUrl: z14.string()
2958
3048
  });
3049
+ var SurfaceReport = Surface.pick({
3050
+ kind: true,
3051
+ name: true,
3052
+ machine: true,
3053
+ viewId: true
3054
+ }).extend({ hostId: z14.string().nullable().optional() });
2959
3055
  var ViewInput = View.pick({
2960
3056
  name: true,
2961
3057
  mode: true,
@@ -2973,6 +3069,9 @@ var ProjectSuggestionsResponse = z14.object({
2973
3069
  suggestions: z14.array(ProjectSuggestion.extend({ name: z14.string(), preselected: z14.boolean() }))
2974
3070
  });
2975
3071
 
3072
+ // packages/protocol/dist/views.js
3073
+ var SURFACE_OPEN_MS = 10 * 6e4;
3074
+
2976
3075
  // packages/protocol/dist/client-wire.js
2977
3076
  import { z as z15 } from "zod";
2978
3077
  var SyncState = z15.object({
@@ -2990,6 +3089,10 @@ var SyncState = z15.object({
2990
3089
  interactions: z15.array(Interaction),
2991
3090
  panels: z15.array(Panel),
2992
3091
  devices: z15.array(Device),
3092
+ /** Tracked issues; absent from older coordinators. */
3093
+ issues: z15.array(TrackedIssue).default([]),
3094
+ /** Terminal surfaces; absent from older coordinators. */
3095
+ surfaces: z15.array(Surface).default([]),
2993
3096
  adapters: z15.record(z15.string(), z15.array(AdapterInfo)),
2994
3097
  dispatchPaused: z15.boolean()
2995
3098
  });
@@ -3034,9 +3137,6 @@ var ServerToClient = z15.discriminatedUnion("type", [
3034
3137
  import { monotonicFactory } from "ulid";
3035
3138
  var ulid = monotonicFactory();
3036
3139
 
3037
- // packages/protocol/dist/views.js
3038
- var CLIENT_OPEN_MS = 10 * 6e4;
3039
-
3040
3140
  // packages/protocol/dist/web-bridge.js
3041
3141
  import { z as z16 } from "zod";
3042
3142
  var FRAME_MAX_HEIGHT = 4e3;