@spencerboucher/switchyard 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -7
- package/dist/bridge/switchyard-terminal.js +2 -0
- package/dist/policies/worker.js +199 -73
- package/dist/switchyard.mjs +17974 -14444
- package/package.json +1 -1
- package/web-dist/assets/AutomationView-BiSxKpgA.js +2 -0
- package/web-dist/assets/AutomationView-BiSxKpgA.js.map +1 -0
- package/web-dist/assets/Checkbox-CneW7ZHn.js +2 -0
- package/web-dist/assets/{Checkbox-DR78wXsg.js.map → Checkbox-CneW7ZHn.js.map} +1 -1
- package/web-dist/assets/DangerZone-tpxj5S8V.js +2 -0
- package/web-dist/assets/{DangerZone-CBnW9h0p.js.map → DangerZone-tpxj5S8V.js.map} +1 -1
- package/web-dist/assets/Field-0rAadZ7B.js +2 -0
- package/web-dist/assets/Field-0rAadZ7B.js.map +1 -0
- package/web-dist/assets/NavigationEditor-DE3vVnHw.js +2 -0
- package/web-dist/assets/{NavigationEditor-C0J7vDXL.js.map → NavigationEditor-DE3vVnHw.js.map} +1 -1
- package/web-dist/assets/Overlay-kkZVSidv.js +2 -0
- package/web-dist/assets/{Overlay-DPZqU_vB.js.map → Overlay-kkZVSidv.js.map} +1 -1
- package/web-dist/assets/{Priority-0hv1Vpg7.js → Priority-VTOBYjs9.js} +2 -2
- package/web-dist/assets/{Priority-0hv1Vpg7.js.map → Priority-VTOBYjs9.js.map} +1 -1
- package/web-dist/assets/RadioCards-Oy23yrpF.js +2 -0
- package/web-dist/assets/{RadioCards-CN5xELnc.js.map → RadioCards-Oy23yrpF.js.map} +1 -1
- package/web-dist/assets/ScopeRepository-BU9I7Gs_.js +6 -0
- package/web-dist/assets/ScopeRepository-BU9I7Gs_.js.map +1 -0
- package/web-dist/assets/ScopeSelect-7ZYRzci5.js +2 -0
- package/web-dist/assets/ScopeSelect-7ZYRzci5.js.map +1 -0
- package/web-dist/assets/SegmentedControl-CCObjCnv.js +2 -0
- package/web-dist/assets/SegmentedControl-CCObjCnv.js.map +1 -0
- package/web-dist/assets/Select-CRC4mF4U.js +2 -0
- package/web-dist/assets/{Select-CN7M29ap.js.map → Select-CRC4mF4U.js.map} +1 -1
- package/web-dist/assets/StructuredValue-DdwqFsZd.js +5 -0
- package/web-dist/assets/StructuredValue-DdwqFsZd.js.map +1 -0
- package/web-dist/assets/Switch-llihKH_2.js +2 -0
- package/web-dist/assets/{Switch-CZMY83Fw.js.map → Switch-llihKH_2.js.map} +1 -1
- package/web-dist/assets/Tabs-CIolUgNo.js +184 -0
- package/web-dist/assets/Tabs-CIolUgNo.js.map +1 -0
- package/web-dist/assets/{TextLink-BpF2vLiL.js → TextLink-BJlPjvKn.js} +2 -2
- package/web-dist/assets/{TextLink-BpF2vLiL.js.map → TextLink-BJlPjvKn.js.map} +1 -1
- package/web-dist/assets/{UINodeRenderer-DqIkLhF8.js → UINodeRenderer-DwZNt-8y.js} +3 -3
- package/web-dist/assets/{UINodeRenderer-DqIkLhF8.js.map → UINodeRenderer-DwZNt-8y.js.map} +1 -1
- package/web-dist/assets/UnfilteredNote-B77oGOcW.js +2 -0
- package/web-dist/assets/{UnfilteredNote-22-Qjb-f.js.map → UnfilteredNote-B77oGOcW.js.map} +1 -1
- package/web-dist/assets/api-C7CMr6g-.js +2 -0
- package/web-dist/assets/api-C7CMr6g-.js.map +1 -0
- package/web-dist/assets/{arrow-down-CzjHSpfM.js → arrow-down-Bqx9CSB1.js} +2 -2
- package/web-dist/assets/{arrow-down-CzjHSpfM.js.map → arrow-down-Bqx9CSB1.js.map} +1 -1
- package/web-dist/assets/{arrow-up-B4YU8Bg0.js → arrow-up-D0b2fv0Q.js} +2 -2
- package/web-dist/assets/{arrow-up-B4YU8Bg0.js.map → arrow-up-D0b2fv0Q.js.map} +1 -1
- package/web-dist/assets/attention-DMhF0I-p.js +2 -0
- package/web-dist/assets/attention-DMhF0I-p.js.map +1 -0
- package/web-dist/assets/auth-vd8OFoQx.js +2 -0
- package/web-dist/assets/auth-vd8OFoQx.js.map +1 -0
- package/web-dist/assets/automations-Dz_JHvUj.js +2 -0
- package/web-dist/assets/{automations-DnydDML9.js.map → automations-Dz_JHvUj.js.map} +1 -1
- package/web-dist/assets/board-CMfIsKrb.js +6 -0
- package/web-dist/assets/board-CMfIsKrb.js.map +1 -0
- package/web-dist/assets/{calendar-clock-B3bQkNKq.js → calendar-clock-C5cMYlld.js} +2 -2
- package/web-dist/assets/{calendar-clock-B3bQkNKq.js.map → calendar-clock-C5cMYlld.js.map} +1 -1
- package/web-dist/assets/chevron-right-5ip-ZfOW.js +2 -0
- package/web-dist/assets/{chevron-right-DuAbbYQ-.js.map → chevron-right-5ip-ZfOW.js.map} +1 -1
- package/web-dist/assets/code-BpPDYwth.js +24 -0
- package/web-dist/assets/code-BpPDYwth.js.map +1 -0
- package/web-dist/assets/{core.esm-BbOnWvFK.js → core.esm-C_QgTrGe.js} +2 -2
- package/web-dist/assets/{core.esm-BbOnWvFK.js.map → core.esm-C_QgTrGe.js.map} +1 -1
- package/web-dist/assets/{describe-DWsoiUix.js → describe-Bd1JbydU.js} +3 -3
- package/web-dist/assets/describe-Bd1JbydU.js.map +1 -0
- package/web-dist/assets/enroll-B_ZjVnEj.js +2 -0
- package/web-dist/assets/{enroll-CV77Sk6h.js.map → enroll-B_ZjVnEj.js.map} +1 -1
- package/web-dist/assets/external-link-DeLk0jmb.js +2 -0
- package/web-dist/assets/external-link-DeLk0jmb.js.map +1 -0
- package/web-dist/assets/{git-branch-Dr8PvfHN.js → git-branch-DuApoZes.js} +2 -2
- package/web-dist/assets/{git-branch-Dr8PvfHN.js.map → git-branch-DuApoZes.js.map} +1 -1
- package/web-dist/assets/{grip-vertical-Bc5pJHHF.js → grip-vertical-DfKSP8jp.js} +2 -2
- package/web-dist/assets/{grip-vertical-Bc5pJHHF.js.map → grip-vertical-DfKSP8jp.js.map} +1 -1
- package/web-dist/assets/{hand-B2TrADIv.js → hand-ryhCgGbh.js} +2 -2
- package/web-dist/assets/{hand-B2TrADIv.js.map → hand-ryhCgGbh.js.map} +1 -1
- package/web-dist/assets/index-BXoBPAUR.js +17 -0
- package/web-dist/assets/index-BXoBPAUR.js.map +1 -0
- package/web-dist/assets/index-Bm6tklht.css +2 -0
- package/web-dist/assets/{link-2-M5ENDPWT.js → link-2-pHvZvxCs.js} +2 -2
- package/web-dist/assets/{link-2-M5ENDPWT.js.map → link-2-pHvZvxCs.js.map} +1 -1
- package/web-dist/assets/logic-3so3T0af.js +4 -0
- package/web-dist/assets/logic-3so3T0af.js.map +1 -0
- package/web-dist/assets/logic-uhnfzaYJ.js +2 -0
- package/web-dist/assets/{logic-CG2E-voG.js.map → logic-uhnfzaYJ.js.map} +1 -1
- package/web-dist/assets/more-C41VHBVG.js +2 -0
- package/web-dist/assets/{more-CVjg2O5h.js.map → more-C41VHBVG.js.map} +1 -1
- package/web-dist/assets/{pencil-y_4AgVa2.js → pencil-BoQa6LEV.js} +2 -2
- package/web-dist/assets/{pencil-y_4AgVa2.js.map → pencil-BoQa6LEV.js.map} +1 -1
- package/web-dist/assets/{play-CYKX2aVL.js → play-DjTVY8Ej.js} +2 -2
- package/web-dist/assets/{play-CYKX2aVL.js.map → play-DjTVY8Ej.js.map} +1 -1
- package/web-dist/assets/{plus-B6uH1yKa.js → plus-BQPgQYui.js} +2 -2
- package/web-dist/assets/{plus-B6uH1yKa.js.map → plus-BQPgQYui.js.map} +1 -1
- package/web-dist/assets/{policyLogic-CioD2rMm.js → policyLogic-cyMrhCM6.js} +2 -2
- package/web-dist/assets/{policyLogic-CioD2rMm.js.map → policyLogic-cyMrhCM6.js.map} +1 -1
- package/web-dist/assets/{prefs-V29Ms2ZL.js → prefs-CkiUftvR.js} +2 -2
- package/web-dist/assets/{prefs-V29Ms2ZL.js.map → prefs-CkiUftvR.js.map} +1 -1
- package/web-dist/assets/preload-helper-B_HW6k8N.js +9 -0
- package/web-dist/assets/preload-helper-B_HW6k8N.js.map +1 -0
- package/web-dist/assets/queue-CSCmR2Xf.js +2 -0
- package/web-dist/assets/{queue-BGK9c062.js.map → queue-CSCmR2Xf.js.map} +1 -1
- package/web-dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/web-dist/assets/{rotate-ccw-DvfmNYNE.js → rotate-ccw-C07CP9JG.js} +2 -2
- package/web-dist/assets/{rotate-ccw-DvfmNYNE.js.map → rotate-ccw-C07CP9JG.js.map} +1 -1
- package/web-dist/assets/{search-GTFKEqAS.js → search-bqDM8qB0.js} +2 -2
- package/web-dist/assets/{search-GTFKEqAS.js.map → search-bqDM8qB0.js.map} +1 -1
- package/web-dist/assets/settings-iTwK6CzQ.js +6 -0
- package/web-dist/assets/settings-iTwK6CzQ.js.map +1 -0
- package/web-dist/assets/states-goHGz_CJ.js +60 -0
- package/web-dist/assets/{states-BUWwUyu-.js.map → states-goHGz_CJ.js.map} +1 -1
- package/web-dist/assets/{terminal-DGVFZER3.js → terminal-BFJK8pLS.js} +2 -2
- package/web-dist/assets/{terminal-DGVFZER3.js.map → terminal-BFJK8pLS.js.map} +1 -1
- package/web-dist/assets/terminal-login-DwI8gUw-.js +2 -0
- package/web-dist/assets/{terminal-login-Gy6aLzgC.js.map → terminal-login-DwI8gUw-.js.map} +1 -1
- package/web-dist/assets/useBreakpoint-C7ONetzK.js +2 -0
- package/web-dist/assets/{useBreakpoint-DoLUoCMf.js.map → useBreakpoint-C7ONetzK.js.map} +1 -1
- package/web-dist/assets/useNow-BFhACgmu.js +2 -0
- package/web-dist/assets/{useNow-BS_9T7IY.js.map → useNow-BFhACgmu.js.map} +1 -1
- package/web-dist/assets/useResource-Br3v4Sui.js +2 -0
- package/web-dist/assets/useResource-Br3v4Sui.js.map +1 -0
- package/web-dist/assets/useSwipeTabs-_JvGirwa.js +2 -0
- package/web-dist/assets/useSwipeTabs-_JvGirwa.js.map +1 -0
- package/web-dist/assets/workboard-IozvaLbf.js +3 -0
- package/web-dist/assets/workboard-IozvaLbf.js.map +1 -0
- package/web-dist/index.html +9 -7
- package/web-dist/sw.js +1 -1
- package/web-dist/sw.js.map +1 -1
- package/web-dist/assets/AutomationView-DwZ_2m9J.js +0 -2
- package/web-dist/assets/AutomationView-DwZ_2m9J.js.map +0 -1
- package/web-dist/assets/Checkbox-DR78wXsg.js +0 -2
- package/web-dist/assets/DangerZone-CBnW9h0p.js +0 -2
- package/web-dist/assets/Field-DS2BMoqA.js +0 -2
- package/web-dist/assets/Field-DS2BMoqA.js.map +0 -1
- package/web-dist/assets/Markdown-BIO6MBTM.js +0 -184
- package/web-dist/assets/Markdown-BIO6MBTM.js.map +0 -1
- package/web-dist/assets/NavigationEditor-C0J7vDXL.js +0 -2
- package/web-dist/assets/Overlay-DPZqU_vB.js +0 -2
- package/web-dist/assets/RadioCards-CN5xELnc.js +0 -2
- package/web-dist/assets/ScopeSelect-BaJjip1Y.js +0 -2
- package/web-dist/assets/ScopeSelect-BaJjip1Y.js.map +0 -1
- package/web-dist/assets/SegmentedControl-CRmhE-Kn.js +0 -2
- package/web-dist/assets/SegmentedControl-CRmhE-Kn.js.map +0 -1
- package/web-dist/assets/Select-CN7M29ap.js +0 -2
- package/web-dist/assets/Switch-CZMY83Fw.js +0 -2
- package/web-dist/assets/Tabs-_1w3hoAR.js +0 -2
- package/web-dist/assets/Tabs-_1w3hoAR.js.map +0 -1
- package/web-dist/assets/UnfilteredNote-22-Qjb-f.js +0 -2
- package/web-dist/assets/api-RftVSu44.js +0 -2
- package/web-dist/assets/api-RftVSu44.js.map +0 -1
- package/web-dist/assets/attention-CEgIsUuq.js +0 -2
- package/web-dist/assets/attention-CEgIsUuq.js.map +0 -1
- package/web-dist/assets/automations-DnydDML9.js +0 -2
- package/web-dist/assets/board-BPxxc8G4.js +0 -6
- package/web-dist/assets/board-BPxxc8G4.js.map +0 -1
- package/web-dist/assets/chevron-right-DuAbbYQ-.js +0 -2
- package/web-dist/assets/code-D5IB7jTT.js +0 -28
- package/web-dist/assets/code-D5IB7jTT.js.map +0 -1
- package/web-dist/assets/describe-DWsoiUix.js.map +0 -1
- package/web-dist/assets/enroll-CV77Sk6h.js +0 -2
- package/web-dist/assets/index-BXQwol8u.css +0 -2
- package/web-dist/assets/index-cmIcNnnF.js +0 -17
- package/web-dist/assets/index-cmIcNnnF.js.map +0 -1
- package/web-dist/assets/logic-CG2E-voG.js +0 -2
- package/web-dist/assets/logic-D_vBBkcD.js +0 -4
- package/web-dist/assets/logic-D_vBBkcD.js.map +0 -1
- package/web-dist/assets/more-CVjg2O5h.js +0 -2
- package/web-dist/assets/queue-BGK9c062.js +0 -2
- package/web-dist/assets/repo-CuL_qbqU.js +0 -5
- package/web-dist/assets/repo-CuL_qbqU.js.map +0 -1
- package/web-dist/assets/selection-CAMJBh5A.js +0 -9
- package/web-dist/assets/selection-CAMJBh5A.js.map +0 -1
- package/web-dist/assets/settings-o7k_MPK7.js +0 -9
- package/web-dist/assets/settings-o7k_MPK7.js.map +0 -1
- package/web-dist/assets/states-BUWwUyu-.js +0 -60
- package/web-dist/assets/terminal-login-Gy6aLzgC.js +0 -2
- package/web-dist/assets/useBreakpoint-DoLUoCMf.js +0 -2
- package/web-dist/assets/useIndicator-BKqIsw2Q.js +0 -2
- package/web-dist/assets/useIndicator-BKqIsw2Q.js.map +0 -1
- package/web-dist/assets/useNow-BS_9T7IY.js +0 -2
- package/web-dist/assets/useResource-CPN6cDQ5.js +0 -2
- package/web-dist/assets/useResource-CPN6cDQ5.js.map +0 -1
- package/web-dist/assets/useSwipeTabs-XRK0_O6T.js +0 -2
- package/web-dist/assets/useSwipeTabs-XRK0_O6T.js.map +0 -1
- package/web-dist/assets/workboard-FE6bAMnW.js +0 -3
- package/web-dist/assets/workboard-FE6bAMnW.js.map +0 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ flowchart TB
|
|
|
37
37
|
|
|
38
38
|
There are three kinds of parts:
|
|
39
39
|
|
|
40
|
-
- **The coordinator** is the one always-on service. It keeps tasks, schedules, notifications, devices and the shared view of every session, and it decides what runs where. It never runs an agent
|
|
40
|
+
- **The coordinator** is the one always-on service. It keeps tasks, schedules, notifications, devices and the shared view of every session, and it decides what runs where. It never runs an agent or holds your model-provider credentials, so it can live anywhere: a container, a small server, or your laptop.
|
|
41
41
|
- **Hosts** are your machines. A host agent runs Pi as your OS user, with your repositories, worktrees, Pi packages and model logins, and connects *outbound* to the coordinator. A host needs no open ports, and a laptop can come and go: its sessions keep running while the coordinator is down, and the events catch up when it returns.
|
|
42
42
|
- **Clients** show scopes: a scope is a named part of your work, and a herdr or tmux client can mirror one scope, everything, or nothing. The web app works on desktop and as an installed app on a phone; in a terminal you get Pi's own TUI for any session (`switchyard tui`, or a whole herdr session mirroring Switchyard), and the scriptable CLI works over the same API. Any client can watch, answer and steer a session; none of them owns it.
|
|
43
43
|
|
|
@@ -69,7 +69,7 @@ sequenceDiagram
|
|
|
69
69
|
Coord->>Host: Archive the sessions, remove the worktree
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
1. **Work arrives or you start it.**
|
|
72
|
+
1. **Work arrives or you start it.** Browse a repository’s open GitHub issues or a [scope’s](docs/scopes.md) tracked issues in Board → Issue list or New session → From an issue. Reading an issue doesn't start it. Explicitly starting it, or opening a branch that has no worktree yet, makes a git worktree inside the repository (`<repo>/.worktrees/<branch>` by default) and a primary session. A branch that already has a session opens that session instead.
|
|
73
73
|
2. **The agent asks, you answer anywhere.** Questions and approvals from Pi and its plugins appear as cards in every client and as a notification on the device you are most likely to see. Answer once; every client shows the result.
|
|
74
74
|
3. **You can step in.** Join from any client to watch and send messages, steer the current turn or queue a follow-up, or open Pi's own terminal for the session. A second session on the same branch is possible when you ask for it; it nests under the first.
|
|
75
75
|
4. **The branch moves with its pull request.** Working, In review when the pull request opens, Merged when it merges. With write-back on, Switchyard moves the issue's card on your GitHub Projects board too.
|
|
@@ -82,11 +82,11 @@ sequenceDiagram
|
|
|
82
82
|
| Area | What you get |
|
|
83
83
|
|---|---|
|
|
84
84
|
| **Branches** | One row per branch with its primary session; extra sessions and subagents nested under it; open a new or existing branch in one step; the same branch on two hosts is one row |
|
|
85
|
-
| **Board** |
|
|
85
|
+
| **Board** | Branch columns by stage or GitHub Projects status, plus a scoped Issue list for comparing, reading and starting tracked work |
|
|
86
86
|
| **Scopes** | Named parts of your work: projects you choose and sessions you pin, or the GitHub issues assigned to you (or every open issue on a Projects board), with worktrees for their branches and card moves on your board ([scopes.md](docs/scopes.md)) |
|
|
87
87
|
| **Clients** | The web app, the phone and the CLI, and herdr and tmux sessions that mirror a scope as a tab per active branch ([clients.md](docs/clients.md)) |
|
|
88
88
|
| **Sessions** | Persistent Pi conversations on any host; the same live session in every client; steer or queue follow-ups; take over and return to automation; resume after crashes with the same conversation (never a silent new one); import existing Pi sessions; switch model and effort, see context use and compact, a slash-command picker |
|
|
89
|
-
| **Workspaces** | A git worktree per branch inside the repository, discovery of worktrees you made yourself, setup commands, `.worktreeinclude` to copy ignored files such as `.env` into new worktrees, removal that refuses to lose uncommitted or unmerged work, and
|
|
89
|
+
| **Workspaces** | A git worktree per branch inside the repository, discovery of worktrees you made yourself, setup commands, `.worktreeinclude` to copy ignored files such as `.env` into new worktrees, removal that refuses to lose uncommitted or unmerged work, and a checkout location per host, with explicit reuse or clone of provider-listed repositories |
|
|
90
90
|
| **Tasks and automations** | A task board (Backlog, Ready, In progress, Review, Done) for dispatched work; dependencies with cycle detection; priorities; per-project concurrency limits; a Queue view explaining why queued work waits |
|
|
91
91
|
| **Review** | Changed files and diffs on desktop and phone, line comments sent as one follow-up, request changes, accept |
|
|
92
92
|
| **Bounded continuation** | Optional: keep the agent working toward an objective, within a maximum number of continuations, a time limit and token or cost caps, ending in your checks and your review |
|
|
@@ -134,7 +134,7 @@ switchyard up
|
|
|
134
134
|
```sh
|
|
135
135
|
docker run -d --name switchyard -p 127.0.0.1:7400:7400 -v switchyard-data:/data \
|
|
136
136
|
-e SWITCHYARD_PUBLIC_URL=https://switchyard.example.com \
|
|
137
|
-
ghcr.io/justmytwospence/switchyard:0.
|
|
137
|
+
ghcr.io/justmytwospence/switchyard:0.24.0
|
|
138
138
|
# Single sign-on is required off localhost: see docs/auth.md
|
|
139
139
|
```
|
|
140
140
|
|
|
@@ -154,7 +154,7 @@ Settings › Hosts › Add host shows these three commands with your token fille
|
|
|
154
154
|
|
|
155
155
|
- **A server is owned before it serves anything.** Off localhost, the owner is declared in an OpenID Connect configuration (required). There is never an "unclaimed" web page.
|
|
156
156
|
- **Only you add devices.** A browser gets in by single sign-on that matches the configured owner or by a passkey; a terminal is approved from a browser that is already signed in. Each device has its own credential that you can revoke; signing out of an identity provider never breaks an installed app.
|
|
157
|
-
- **Hosts dial out** with their own revocable credentials; the coordinator
|
|
157
|
+
- **Hosts dial out** with their own revocable credentials; the coordinator needs no access to your home directory or Docker socket. Repository catalog app keys are stored separately in its data directory.
|
|
158
158
|
- **Agents run with the host user's privileges.** Running the coordinator in a container does not sandbox the agents; run hosts as a user whose access you are comfortable giving an agent.
|
|
159
159
|
|
|
160
160
|
Details: [docs/auth.md](docs/auth.md) and the [privilege model](docs/deployment.md#privilege-model).
|
|
@@ -166,6 +166,16 @@ License: [MIT](LICENSE).
|
|
|
166
166
|
|
|
167
167
|
Switchyard is young and moving quickly. It is tested against Pi `>=1.4.0 <1.7.0` (see [docs/compatibility.md](docs/compatibility.md) for supported and unsupported Pi capabilities) and runs on macOS and Linux hosts. What has and has not been verified is recorded in [docs/acceptance-report.md](docs/acceptance-report.md).
|
|
168
168
|
|
|
169
|
+
## Developing Pi plugins for Switchyard
|
|
170
|
+
|
|
171
|
+
The portable [plugin-development skill](skills/switchyard-plugin-development/SKILL.md) guides authors through compatibility assessment, adapter design and verification. See also the [adapter guide](docs/adapters.md). Install it from the public repository; for example, for both Codex and Claude Code:
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
npx skills add justmytwospence/switchyard -s switchyard-plugin-development -a codex claude-code --copy -y
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Choose the agents you use; these two are only an example and are not required to use Switchyard. The skill is also listed in the [Agent Skills Directory](https://skills.sh/justmytwospence/switchyard/switchyard-plugin-development).
|
|
178
|
+
|
|
169
179
|
## Documentation
|
|
170
180
|
|
|
171
181
|
| Guide | Covers |
|
|
@@ -181,7 +191,7 @@ Switchyard is young and moving quickly. It is tested against Pi `>=1.4.0 <1.7.0`
|
|
|
181
191
|
| [Terminal sessions](docs/terminal-sessions.md) | Pi's own TUI for every session, from any terminal; sessions you start yourself |
|
|
182
192
|
| [Operations](docs/operations.md) | Backup, restore, migrations, retention, logs, health, diagnostics |
|
|
183
193
|
| [Policies](docs/policies.md) | Agent tools, guardrails, approvals and budgets |
|
|
184
|
-
| [GitHub](docs/github.md) |
|
|
194
|
+
| [GitHub](docs/github.md) | GitHub App and Personal Access Token connections, PR review and merge, issue tasks |
|
|
185
195
|
| [Modules](docs/modules.md) | The kinds of host, client, scope and trigger, and what another project can add |
|
|
186
196
|
| [Adapters](docs/adapters.md) | Rendering a Pi plugin's UI in every client; shipping an adapter with your Pi package |
|
|
187
197
|
| [Architecture](docs/architecture.md) | Components, data ownership, the host and client protocols, packages |
|
|
@@ -383,6 +383,8 @@ export default function switchyardTerminal(pi) {
|
|
|
383
383
|
const dflt = method === "confirm" ? false : undefined;
|
|
384
384
|
if (signal?.aborted)
|
|
385
385
|
return Promise.resolve(dflt);
|
|
386
|
+
// Entries describing this dialog must reach the host before its request.
|
|
387
|
+
flushEntries();
|
|
386
388
|
const id = randomUUID();
|
|
387
389
|
const request = { type: "extension_ui_request", id, method, title, ...fields };
|
|
388
390
|
return new Promise((resolve) => {
|
package/dist/policies/worker.js
CHANGED
|
@@ -661,6 +661,31 @@ var GitHubHostMergeRequest = GitHubHostLogsRequest.extend({
|
|
|
661
661
|
import { z as z5 } from "zod";
|
|
662
662
|
var Iso = z5.string();
|
|
663
663
|
var Id3 = z5.string().min(1);
|
|
664
|
+
var RepoCursor = z5.string().min(1).max(2048).refine((v) => {
|
|
665
|
+
let bytes3 = 0;
|
|
666
|
+
for (const char of v) {
|
|
667
|
+
const code = char.codePointAt(0);
|
|
668
|
+
bytes3 += code < 128 ? 1 : code < 2048 ? 2 : code < 65536 ? 3 : 4;
|
|
669
|
+
}
|
|
670
|
+
return bytes3 <= 2048;
|
|
671
|
+
});
|
|
672
|
+
var RepoIssuesPageRequest = z5.object({
|
|
673
|
+
repository: GitHubRepository,
|
|
674
|
+
after: RepoCursor.optional()
|
|
675
|
+
}).strict();
|
|
676
|
+
var RepoIssueRequest = z5.object({
|
|
677
|
+
repository: GitHubRepository,
|
|
678
|
+
number: z5.number().int().safe().positive()
|
|
679
|
+
}).strict();
|
|
680
|
+
var ISSUE_DESCRIPTION_MAX_LENGTH = 32768;
|
|
681
|
+
var IssueDescriptionRequest = z5.object({
|
|
682
|
+
repository: GitHubRepository,
|
|
683
|
+
number: z5.number().int().safe().positive()
|
|
684
|
+
});
|
|
685
|
+
var IssueDescriptionResult = z5.object({
|
|
686
|
+
body: z5.string().max(ISSUE_DESCRIPTION_MAX_LENGTH),
|
|
687
|
+
truncated: z5.boolean()
|
|
688
|
+
});
|
|
664
689
|
var IssueFollow = z5.enum(["assigned", "board"]);
|
|
665
690
|
var GitHubLogin = z5.string().regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/);
|
|
666
691
|
var BoardStatusOption = z5.object({
|
|
@@ -681,8 +706,10 @@ var SourceBoard = z5.object({
|
|
|
681
706
|
});
|
|
682
707
|
var GitHubSource = z5.object({
|
|
683
708
|
kind: z5.literal("github"),
|
|
684
|
-
/** The
|
|
685
|
-
|
|
709
|
+
/** The GitHub catalog connection that reads issues and moves board cards. */
|
|
710
|
+
connectionId: z5.string().min(1).nullable().optional(),
|
|
711
|
+
/** Legacy host id retained only for parsing pre-upgrade scopes. */
|
|
712
|
+
hostId: Id3.nullable().optional(),
|
|
686
713
|
owner: GitHubLogin,
|
|
687
714
|
repositories: z5.array(GitHubRepository).min(1).max(50).nullable(),
|
|
688
715
|
/** Repositories outside `owner` that belong to this source too (never limited by `repositories`). */
|
|
@@ -701,7 +728,8 @@ var GitHubSource = z5.object({
|
|
|
701
728
|
lastError: z5.string().max(2e3).nullable()
|
|
702
729
|
});
|
|
703
730
|
var GitHubSourceInput = z5.object({
|
|
704
|
-
|
|
731
|
+
connectionId: z5.string().min(1),
|
|
732
|
+
hostId: Id3.nullable().optional(),
|
|
705
733
|
owner: GitHubLogin,
|
|
706
734
|
repositories: GitHubSource.shape.repositories.default(null),
|
|
707
735
|
extraRepositories: z5.array(GitHubRepository).max(20).default([]),
|
|
@@ -713,7 +741,8 @@ var GitHubSourceInput = z5.object({
|
|
|
713
741
|
enabled: z5.boolean().default(true)
|
|
714
742
|
});
|
|
715
743
|
var GitHubSourcePatch = z5.object({
|
|
716
|
-
|
|
744
|
+
connectionId: z5.string().min(1).optional(),
|
|
745
|
+
hostId: Id3.nullable().optional(),
|
|
717
746
|
owner: GitHubLogin.optional(),
|
|
718
747
|
repositories: GitHubSource.shape.repositories.optional(),
|
|
719
748
|
extraRepositories: z5.array(GitHubRepository).max(20).optional(),
|
|
@@ -762,6 +791,21 @@ var SyncedIssue = z5.object({
|
|
|
762
791
|
parent: IssueParent.nullable().optional(),
|
|
763
792
|
subIssues: IssueSubIssues.nullable().optional()
|
|
764
793
|
});
|
|
794
|
+
var RepoIssuesPageResult = z5.object({
|
|
795
|
+
items: z5.array(SyncedIssue).max(50),
|
|
796
|
+
nextCursor: RepoCursor.nullable()
|
|
797
|
+
});
|
|
798
|
+
var RepoIssueResult = z5.object({ state: z5.enum(["OPEN", "CLOSED"]), issue: SyncedIssue });
|
|
799
|
+
var RepoIssueItem = SyncedIssue.extend({
|
|
800
|
+
projectId: Id3,
|
|
801
|
+
branch: z5.string().nullable(),
|
|
802
|
+
workspaceId: Id3.nullable(),
|
|
803
|
+
sessionId: Id3.nullable()
|
|
804
|
+
});
|
|
805
|
+
var RepoIssuesPage = z5.object({
|
|
806
|
+
items: z5.array(RepoIssueItem).max(50),
|
|
807
|
+
nextCursor: RepoCursor.nullable()
|
|
808
|
+
});
|
|
765
809
|
var IssueSyncResult = z5.object({
|
|
766
810
|
login: z5.string().min(1),
|
|
767
811
|
items: z5.array(SyncedIssue).max(200),
|
|
@@ -801,6 +845,7 @@ var OpenIssueRequest = z5.object({
|
|
|
801
845
|
prompt: z5.string().optional(),
|
|
802
846
|
profileId: z5.string().nullable().optional()
|
|
803
847
|
});
|
|
848
|
+
var OpenRepoIssueRequest = OpenIssueRequest.extend({ expectedNodeId: Id3 });
|
|
804
849
|
var IssueSetStatusResult = z5.discriminatedUnion("status", [
|
|
805
850
|
z5.object({ status: z5.literal("moved") }),
|
|
806
851
|
z5.object({
|
|
@@ -823,14 +868,16 @@ var IssueHostSyncRequest = z5.object({
|
|
|
823
868
|
});
|
|
824
869
|
var IssueHostPrepareBranchRequest = z5.object({
|
|
825
870
|
checkoutPath: z5.string().min(1),
|
|
826
|
-
branch: z5.string().min(1).max(255)
|
|
871
|
+
branch: z5.string().min(1).max(255),
|
|
872
|
+
strict: z5.boolean().optional()
|
|
827
873
|
});
|
|
828
874
|
var IssueHostStartIssueRequest = z5.object({
|
|
829
875
|
checkoutPath: z5.string().min(1),
|
|
830
876
|
repository: GitHubRepository,
|
|
831
877
|
number: z5.number().int().positive(),
|
|
832
878
|
branch: z5.string().min(1).max(255),
|
|
833
|
-
base: z5.string().min(1)
|
|
879
|
+
base: z5.string().min(1),
|
|
880
|
+
strict: z5.boolean().optional()
|
|
834
881
|
});
|
|
835
882
|
var IssueHostSetStatusRequest = z5.object({
|
|
836
883
|
projectId: z5.string().min(1),
|
|
@@ -1247,6 +1294,8 @@ var Host = z8.object({
|
|
|
1247
1294
|
/** Folders on the host whose git repositories become projects (absolute or ~/...). */
|
|
1248
1295
|
projectFolders: z8.array(z8.string()).optional(),
|
|
1249
1296
|
projectScan: ProjectScan.nullable().optional(),
|
|
1297
|
+
checkoutRoot: z8.string().nullable().optional(),
|
|
1298
|
+
checkoutProvision: z8.boolean().optional(),
|
|
1250
1299
|
/** Subscription limits (host-reported, refreshed every few minutes). */
|
|
1251
1300
|
usage: z8.array(ProviderUsage).optional(),
|
|
1252
1301
|
github: HostGitHub.optional()
|
|
@@ -1256,6 +1305,12 @@ var Project = z8.object({
|
|
|
1256
1305
|
id: Id5,
|
|
1257
1306
|
name: z8.string().min(1),
|
|
1258
1307
|
repoIdentity: z8.string(),
|
|
1308
|
+
catalog: z8.object({
|
|
1309
|
+
state: z8.enum(["listed", "delisted", "legacy"]),
|
|
1310
|
+
authority: z8.string().optional(),
|
|
1311
|
+
externalId: z8.string().optional(),
|
|
1312
|
+
fullName: z8.string().optional()
|
|
1313
|
+
}).optional(),
|
|
1259
1314
|
defaultProfileId: Id5.nullable(),
|
|
1260
1315
|
defaultHostId: Id5.nullable(),
|
|
1261
1316
|
maxConcurrentRuns: z8.number().int().min(1).max(32),
|
|
@@ -2418,6 +2473,24 @@ var HostCommand = z14.discriminatedUnion("type", [
|
|
|
2418
2473
|
instructions: z14.string().nullable()
|
|
2419
2474
|
}),
|
|
2420
2475
|
z14.object({ type: z14.literal("checkout.inspect"), path: z14.string() }),
|
|
2476
|
+
z14.strictObject({
|
|
2477
|
+
type: z14.literal("checkout.preview"),
|
|
2478
|
+
root: z14.string().min(1).max(4096),
|
|
2479
|
+
folderName: z14.string().min(1).max(128)
|
|
2480
|
+
}),
|
|
2481
|
+
z14.strictObject({
|
|
2482
|
+
type: z14.literal("checkout.provision"),
|
|
2483
|
+
root: z14.string().min(1).max(4096),
|
|
2484
|
+
folderName: z14.string().min(1).max(128),
|
|
2485
|
+
expectedPath: z14.string().min(1).max(4096),
|
|
2486
|
+
cloneUrl: z14.string().min(1).max(4096),
|
|
2487
|
+
/** Only carried by a confirmed live command. Never persist or replay this payload. */
|
|
2488
|
+
grant: z14.strictObject({
|
|
2489
|
+
token: z14.string().min(1).max(4096).refine((token) => !/[^!-~]/.test(token)),
|
|
2490
|
+
expiresAt: z14.iso.datetime({ offset: true })
|
|
2491
|
+
})
|
|
2492
|
+
}),
|
|
2493
|
+
z14.strictObject({ type: z14.literal("checkout.locate"), cwd: z14.string().min(1).max(4096) }),
|
|
2421
2494
|
z14.object({ type: z14.literal("projects.scan"), folder: z14.string().min(1) }),
|
|
2422
2495
|
z14.object({
|
|
2423
2496
|
type: z14.literal("projects.suggest"),
|
|
@@ -2462,13 +2535,7 @@ var HostCommand = z14.discriminatedUnion("type", [
|
|
|
2462
2535
|
}),
|
|
2463
2536
|
z14.object({ type: z14.literal("workspace.files"), path: z14.string(), dir: z14.string() }),
|
|
2464
2537
|
z14.object({ type: z14.literal("workspace.readFile"), path: z14.string(), file: z14.string() }),
|
|
2465
|
-
GitHubHostViewRequest.extend({ type: z14.literal("workspace.prView") }),
|
|
2466
|
-
GitHubHostLogsRequest.extend({ type: z14.literal("workspace.prFailedLogs") }),
|
|
2467
|
-
GitHubHostMergeRequest.extend({ type: z14.literal("workspace.prMerge") }),
|
|
2468
|
-
IssueHostSyncRequest.extend({ type: z14.literal("tracker.sync") }),
|
|
2469
2538
|
IssueHostPrepareBranchRequest.extend({ type: z14.literal("tracker.prepareBranch") }),
|
|
2470
|
-
IssueHostStartIssueRequest.extend({ type: z14.literal("tracker.startIssue") }),
|
|
2471
|
-
IssueHostSetStatusRequest.extend({ type: z14.literal("tracker.setStatus") }),
|
|
2472
2539
|
z14.object({
|
|
2473
2540
|
type: z14.literal("dispatch.start"),
|
|
2474
2541
|
dispatchKey: z14.string(),
|
|
@@ -2530,6 +2597,13 @@ var CheckoutInfo = z14.object({
|
|
|
2530
2597
|
repoIdentity: z14.string(),
|
|
2531
2598
|
defaultBranch: z14.string()
|
|
2532
2599
|
});
|
|
2600
|
+
var CheckoutPreviewResult = z14.object({
|
|
2601
|
+
path: z14.string(),
|
|
2602
|
+
root: z14.string(),
|
|
2603
|
+
state: z14.enum(["missing", "existing", "collision"]),
|
|
2604
|
+
checkout: CheckoutInfo.optional()
|
|
2605
|
+
});
|
|
2606
|
+
var CheckoutLocateResult = z14.object({ checkout: CheckoutInfo, worktreePath: z14.string() }).nullable();
|
|
2533
2607
|
var ScannedRepository = CheckoutInfo.extend({ name: z14.string() });
|
|
2534
2608
|
var ProjectFolderScan = z14.object({
|
|
2535
2609
|
/** The folder, ~ expanded and realpath'd. */
|
|
@@ -2726,7 +2800,8 @@ function isProjectFolderPath(s) {
|
|
|
2726
2800
|
}
|
|
2727
2801
|
var ProjectFolder = z15.string().trim().min(1).max(1024).refine(isProjectFolderPath, "must be an absolute path or start with ~/");
|
|
2728
2802
|
var UpdateHostRequest = z15.object({
|
|
2729
|
-
projectFolders: z15.array(ProjectFolder).max(20).optional()
|
|
2803
|
+
projectFolders: z15.array(ProjectFolder).max(20).optional(),
|
|
2804
|
+
checkoutRoot: ProjectFolder.nullable().optional()
|
|
2730
2805
|
});
|
|
2731
2806
|
var ProjectScanResult = ProjectScan.extend({
|
|
2732
2807
|
added: z15.array(z15.object({
|
|
@@ -3170,42 +3245,93 @@ var ProjectSuggestionsResponse = z15.object({
|
|
|
3170
3245
|
// packages/protocol/dist/scopes.js
|
|
3171
3246
|
var CLIENT_OPEN_MS = 10 * 6e4;
|
|
3172
3247
|
|
|
3173
|
-
// packages/protocol/dist/
|
|
3248
|
+
// packages/protocol/dist/catalog.js
|
|
3174
3249
|
import { z as z16 } from "zod";
|
|
3175
|
-
var
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3250
|
+
var CatalogRepository = z16.strictObject({
|
|
3251
|
+
authority: z16.string().min(1),
|
|
3252
|
+
externalId: z16.string().min(1),
|
|
3253
|
+
owner: z16.string().min(1),
|
|
3254
|
+
name: z16.string().min(1),
|
|
3255
|
+
webUrl: z16.url({ protocol: /^https$/ }),
|
|
3256
|
+
cloneUrl: z16.url({ protocol: /^https$/ }),
|
|
3257
|
+
defaultBranch: z16.string().nullable()
|
|
3258
|
+
});
|
|
3259
|
+
var CatalogAccountType = z16.enum(["personal", "organization"]);
|
|
3260
|
+
var CatalogConnectionKind = z16.enum(["github_app", "pat"]);
|
|
3261
|
+
var CatalogSelection = z16.strictObject({
|
|
3262
|
+
owners: z16.array(z16.string().min(1).max(39)).max(50),
|
|
3263
|
+
repositories: z16.array(z16.string().min(1).max(140)).max(500)
|
|
3264
|
+
});
|
|
3265
|
+
var CatalogConnectionStatus = z16.object({
|
|
3266
|
+
id: z16.string(),
|
|
3267
|
+
kind: CatalogConnectionKind.default("github_app"),
|
|
3268
|
+
account: z16.string(),
|
|
3269
|
+
accountType: CatalogAccountType,
|
|
3270
|
+
state: z16.enum(["pending", "ready", "stale", "suspended", "removed", "disconnected"]),
|
|
3271
|
+
lastSyncedAt: z16.string().nullable(),
|
|
3272
|
+
lastError: z16.string().nullable(),
|
|
3273
|
+
installUrl: z16.string().nullable(),
|
|
3274
|
+
manageUrl: z16.string().nullable(),
|
|
3275
|
+
selection: CatalogSelection.nullable().optional()
|
|
3276
|
+
});
|
|
3277
|
+
var CatalogAvailableOwner = z16.object({
|
|
3278
|
+
login: z16.string(),
|
|
3279
|
+
type: CatalogAccountType
|
|
3280
|
+
});
|
|
3281
|
+
var CatalogAvailableInventory = z16.object({
|
|
3282
|
+
account: z16.string(),
|
|
3283
|
+
owners: z16.array(CatalogAvailableOwner),
|
|
3284
|
+
repositories: z16.array(CatalogRepository)
|
|
3285
|
+
});
|
|
3286
|
+
var ConnectPatRequest = z16.strictObject({
|
|
3287
|
+
token: z16.string().trim().min(10).max(512),
|
|
3288
|
+
selection: CatalogSelection.optional()
|
|
3289
|
+
});
|
|
3290
|
+
var UpdateCatalogSelectionRequest = z16.strictObject({
|
|
3291
|
+
selection: CatalogSelection
|
|
3292
|
+
});
|
|
3293
|
+
var CheckoutPreviewRequest = z16.strictObject({
|
|
3294
|
+
hostId: z16.string().min(1),
|
|
3295
|
+
folderName: z16.string().min(1).max(128).optional()
|
|
3296
|
+
});
|
|
3297
|
+
var CheckoutProvisionRequest = z16.strictObject({ previewId: z16.string().min(1).max(128) });
|
|
3298
|
+
|
|
3299
|
+
// packages/protocol/dist/client-wire.js
|
|
3300
|
+
import { z as z17 } from "zod";
|
|
3301
|
+
var SyncState = z17.object({
|
|
3302
|
+
hosts: z17.array(Host),
|
|
3303
|
+
projects: z17.array(Project),
|
|
3304
|
+
checkouts: z17.array(Checkout),
|
|
3305
|
+
workspaces: z17.array(Workspace),
|
|
3306
|
+
profiles: z17.array(Profile),
|
|
3181
3307
|
/** Scopes; absent from coordinators before 0.21. */
|
|
3182
|
-
scopes:
|
|
3183
|
-
sessions:
|
|
3184
|
-
tasks:
|
|
3185
|
-
runs:
|
|
3186
|
-
automations:
|
|
3187
|
-
attention:
|
|
3188
|
-
interactions:
|
|
3189
|
-
panels:
|
|
3190
|
-
devices:
|
|
3308
|
+
scopes: z17.array(Scope).default([]),
|
|
3309
|
+
sessions: z17.array(Session),
|
|
3310
|
+
tasks: z17.array(Task),
|
|
3311
|
+
runs: z17.array(Run),
|
|
3312
|
+
automations: z17.array(Automation),
|
|
3313
|
+
attention: z17.array(AttentionItem),
|
|
3314
|
+
interactions: z17.array(Interaction),
|
|
3315
|
+
panels: z17.array(Panel),
|
|
3316
|
+
devices: z17.array(Device),
|
|
3191
3317
|
/** Tracked issues; absent from older coordinators. */
|
|
3192
|
-
issues:
|
|
3318
|
+
issues: z17.array(TrackedIssue).default([]),
|
|
3193
3319
|
/** Clients (herdr and tmux sessions); absent from coordinators before 0.21. */
|
|
3194
|
-
clients:
|
|
3195
|
-
adapters:
|
|
3196
|
-
dispatchPaused:
|
|
3197
|
-
});
|
|
3198
|
-
var Presence =
|
|
3199
|
-
foreground:
|
|
3200
|
-
interactedAt:
|
|
3201
|
-
viewing:
|
|
3320
|
+
clients: z17.array(Client).default([]),
|
|
3321
|
+
adapters: z17.record(z17.string(), z17.array(AdapterInfo)),
|
|
3322
|
+
dispatchPaused: z17.boolean()
|
|
3323
|
+
});
|
|
3324
|
+
var Presence = z17.object({
|
|
3325
|
+
foreground: z17.boolean(),
|
|
3326
|
+
interactedAt: z17.string().nullable(),
|
|
3327
|
+
viewing: z17.object({ sessionId: z17.string() }).nullable(),
|
|
3202
3328
|
/**
|
|
3203
3329
|
* A herdr or tmux daemon reporting the session focused in its client (kept apart from the
|
|
3204
3330
|
* device's own presence).
|
|
3205
3331
|
*/
|
|
3206
|
-
clientId:
|
|
3332
|
+
clientId: z17.string().min(1).max(200).optional(),
|
|
3207
3333
|
/** COMPAT(scopes-rename): remove after 2027-03-01. The old name of clientId. */
|
|
3208
|
-
terminalId:
|
|
3334
|
+
terminalId: z17.string().min(1).max(200).optional()
|
|
3209
3335
|
});
|
|
3210
3336
|
var CLIENT_CAPABILITIES = [
|
|
3211
3337
|
"adapter.slots.v1",
|
|
@@ -3218,35 +3344,35 @@ var CLIENT_CAPABILITIES = [
|
|
|
3218
3344
|
/** The client draws `composer.tracker` and `session.badge` contributions. */
|
|
3219
3345
|
"adapter.trackers.v1"
|
|
3220
3346
|
];
|
|
3221
|
-
var ClientToServer =
|
|
3222
|
-
|
|
3223
|
-
type:
|
|
3224
|
-
cursor:
|
|
3225
|
-
capabilities:
|
|
3226
|
-
projectionId:
|
|
3347
|
+
var ClientToServer = z17.discriminatedUnion("type", [
|
|
3348
|
+
z17.object({
|
|
3349
|
+
type: z17.literal("hello"),
|
|
3350
|
+
cursor: z17.number().int().nullable(),
|
|
3351
|
+
capabilities: z17.array(z17.string().min(1).max(80)).max(32).optional(),
|
|
3352
|
+
projectionId: z17.string().max(256).nullable().optional()
|
|
3227
3353
|
}),
|
|
3228
|
-
|
|
3229
|
-
|
|
3354
|
+
z17.object({ type: z17.literal("presence"), presence: Presence }),
|
|
3355
|
+
z17.object({ type: z17.literal("ping") })
|
|
3230
3356
|
]);
|
|
3231
|
-
var ServerToClient =
|
|
3232
|
-
|
|
3233
|
-
type:
|
|
3234
|
-
seq:
|
|
3235
|
-
events:
|
|
3236
|
-
capabilities:
|
|
3237
|
-
projectionId:
|
|
3357
|
+
var ServerToClient = z17.discriminatedUnion("type", [
|
|
3358
|
+
z17.object({
|
|
3359
|
+
type: z17.literal("replay"),
|
|
3360
|
+
seq: z17.number().int(),
|
|
3361
|
+
events: z17.array(EventEnvelope),
|
|
3362
|
+
capabilities: z17.array(z17.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3363
|
+
projectionId: z17.string().optional()
|
|
3238
3364
|
}),
|
|
3239
|
-
|
|
3240
|
-
type:
|
|
3241
|
-
seq:
|
|
3365
|
+
z17.object({
|
|
3366
|
+
type: z17.literal("snapshot"),
|
|
3367
|
+
seq: z17.number().int(),
|
|
3242
3368
|
state: SyncState,
|
|
3243
|
-
capabilities:
|
|
3244
|
-
projectionId:
|
|
3369
|
+
capabilities: z17.array(z17.enum(CLIENT_CAPABILITIES)).optional(),
|
|
3370
|
+
projectionId: z17.string().optional()
|
|
3245
3371
|
}),
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3372
|
+
z17.object({ type: z17.literal("event"), event: EventEnvelope }),
|
|
3373
|
+
z17.object({ type: z17.literal("stream"), delta: StreamDelta }),
|
|
3374
|
+
z17.object({ type: z17.literal("pong") }),
|
|
3375
|
+
z17.object({ type: z17.literal("force_logout"), reason: z17.string() })
|
|
3250
3376
|
]);
|
|
3251
3377
|
|
|
3252
3378
|
// packages/protocol/dist/ids.js
|
|
@@ -3254,17 +3380,17 @@ import { monotonicFactory } from "ulid";
|
|
|
3254
3380
|
var ulid = monotonicFactory();
|
|
3255
3381
|
|
|
3256
3382
|
// packages/protocol/dist/web-bridge.js
|
|
3257
|
-
import { z as
|
|
3383
|
+
import { z as z18 } from "zod";
|
|
3258
3384
|
var FRAME_MAX_HEIGHT = 4e3;
|
|
3259
|
-
var FrameToParentMessageSchema =
|
|
3260
|
-
|
|
3261
|
-
type:
|
|
3262
|
-
actionId:
|
|
3263
|
-
payload:
|
|
3385
|
+
var FrameToParentMessageSchema = z18.discriminatedUnion("type", [
|
|
3386
|
+
z18.object({
|
|
3387
|
+
type: z18.literal("action"),
|
|
3388
|
+
actionId: z18.string().min(1).max(200),
|
|
3389
|
+
payload: z18.unknown().optional()
|
|
3264
3390
|
}),
|
|
3265
|
-
|
|
3266
|
-
type:
|
|
3267
|
-
height:
|
|
3391
|
+
z18.object({
|
|
3392
|
+
type: z18.literal("resize"),
|
|
3393
|
+
height: z18.number().finite().min(0).max(FRAME_MAX_HEIGHT)
|
|
3268
3394
|
})
|
|
3269
3395
|
]);
|
|
3270
3396
|
|