@juspay/shooter 1.0.0 → 1.2.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/.claude/hooks/notifier.cjs +117 -33
- package/.claude/settings.json +14 -14
- package/README.md +116 -84
- package/bin/shooter.cjs +471 -102
- package/build/client/_app/immutable/assets/{0.CM9Hl6d-.css → 0.BhZOCxO4.css} +1 -1
- package/build/client/_app/immutable/assets/0.BhZOCxO4.css.br +0 -0
- package/build/client/_app/immutable/assets/0.BhZOCxO4.css.gz +0 -0
- package/build/client/_app/immutable/assets/1.BYutk3aU.css +1 -0
- package/build/client/_app/immutable/assets/1.BYutk3aU.css.br +0 -0
- package/build/client/_app/immutable/assets/1.BYutk3aU.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.CAShZ7lQ.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.DGDHCVnW.css +1 -0
- package/build/client/_app/immutable/assets/3.DGDHCVnW.css.br +0 -0
- package/build/client/_app/immutable/assets/3.DGDHCVnW.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.BFUut--w.css +1 -0
- package/build/client/_app/immutable/assets/4.BFUut--w.css.br +0 -0
- package/build/client/_app/immutable/assets/4.BFUut--w.css.gz +0 -0
- package/build/client/_app/immutable/assets/5.BTOx7yt7.css +1 -0
- package/build/client/_app/immutable/assets/5.BTOx7yt7.css.br +0 -0
- package/build/client/_app/immutable/assets/5.BTOx7yt7.css.gz +0 -0
- package/build/client/_app/immutable/assets/6.eZGZN-BF.css +1 -0
- package/build/client/_app/immutable/assets/6.eZGZN-BF.css.br +0 -0
- package/build/client/_app/immutable/assets/6.eZGZN-BF.css.gz +0 -0
- package/build/client/_app/immutable/assets/7.DwS5ZHBh.css +1 -0
- package/build/client/_app/immutable/assets/7.DwS5ZHBh.css.br +0 -0
- package/build/client/_app/immutable/assets/7.DwS5ZHBh.css.gz +0 -0
- package/build/client/_app/immutable/assets/ChatView.CwWbzIL-.css +1 -0
- package/build/client/_app/immutable/assets/ChatView.CwWbzIL-.css.br +0 -0
- package/build/client/_app/immutable/assets/ChatView.CwWbzIL-.css.gz +0 -0
- package/build/client/_app/immutable/assets/Phone.FQEfwCX2.css +1 -0
- package/build/client/_app/immutable/assets/Phone.FQEfwCX2.css.br +0 -0
- package/build/client/_app/immutable/assets/Phone.FQEfwCX2.css.gz +0 -0
- package/build/client/_app/immutable/assets/markdown.Dc-OSJWY.css +1 -0
- package/build/client/_app/immutable/assets/markdown.Dc-OSJWY.css.br +0 -0
- package/build/client/_app/immutable/assets/markdown.Dc-OSJWY.css.gz +0 -0
- package/build/client/_app/immutable/assets/xterm.DFuMZ0ql.css.gz +0 -0
- package/build/client/_app/immutable/chunks/B-K5Sh65.js +1 -0
- package/build/client/_app/immutable/chunks/B-K5Sh65.js.br +0 -0
- package/build/client/_app/immutable/chunks/B-K5Sh65.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B5NAKyil.js +20 -0
- package/build/client/_app/immutable/chunks/B5NAKyil.js.br +0 -0
- package/build/client/_app/immutable/chunks/B5NAKyil.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B8XegpSE.js +1 -0
- package/build/client/_app/immutable/chunks/B8XegpSE.js.br +0 -0
- package/build/client/_app/immutable/chunks/B8XegpSE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B8zoBsv3.js +6 -0
- package/build/client/_app/immutable/chunks/B8zoBsv3.js.br +0 -0
- package/build/client/_app/immutable/chunks/B8zoBsv3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BLszSzTT.js +1 -0
- package/build/client/_app/immutable/chunks/BLszSzTT.js.br +0 -0
- package/build/client/_app/immutable/chunks/BLszSzTT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BOYo8yTr.js +1 -0
- package/build/client/_app/immutable/chunks/BOYo8yTr.js.br +0 -0
- package/build/client/_app/immutable/chunks/BOYo8yTr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BTGVxaYV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BYqGCrTe.js +1 -0
- package/build/client/_app/immutable/chunks/BYqGCrTe.js.br +0 -0
- package/build/client/_app/immutable/chunks/BYqGCrTe.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BlxrFPDK.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bu1aqm5j.js +1 -0
- package/build/client/_app/immutable/chunks/Bu1aqm5j.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bu1aqm5j.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C4mLaWWx.js +1 -0
- package/build/client/_app/immutable/chunks/C4mLaWWx.js.br +0 -0
- package/build/client/_app/immutable/chunks/C4mLaWWx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CQjSATpv.js +61 -0
- package/build/client/_app/immutable/chunks/CQjSATpv.js.br +0 -0
- package/build/client/_app/immutable/chunks/CQjSATpv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CSoRdFvv.js +1 -0
- package/build/client/_app/immutable/chunks/CSoRdFvv.js.br +0 -0
- package/build/client/_app/immutable/chunks/CSoRdFvv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZHsSL_X.js +1 -0
- package/build/client/_app/immutable/chunks/CZHsSL_X.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZHsSL_X.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DLu6yJIZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DSU1n5N_.js +1 -0
- package/build/client/_app/immutable/chunks/DSU1n5N_.js.br +0 -0
- package/build/client/_app/immutable/chunks/DSU1n5N_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DVkn4r72.js +1 -0
- package/build/client/_app/immutable/chunks/DVkn4r72.js.br +0 -0
- package/build/client/_app/immutable/chunks/DVkn4r72.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DjsDGxCa.js +41 -0
- package/build/client/_app/immutable/chunks/DjsDGxCa.js.br +0 -0
- package/build/client/_app/immutable/chunks/DjsDGxCa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/PPVm8Dsz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/UJOiqIYE.js +1 -0
- package/build/client/_app/immutable/chunks/UJOiqIYE.js.br +0 -0
- package/build/client/_app/immutable/chunks/UJOiqIYE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/r0JawsZc.js +2 -0
- package/build/client/_app/immutable/chunks/r0JawsZc.js.br +0 -0
- package/build/client/_app/immutable/chunks/r0JawsZc.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.Z3zMnuSx.js +2 -0
- package/build/client/_app/immutable/entry/app.Z3zMnuSx.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Z3zMnuSx.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Dd-gIP4y.js +1 -0
- package/build/client/_app/immutable/entry/start.Dd-gIP4y.js.br +2 -0
- package/build/client/_app/immutable/entry/start.Dd-gIP4y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.D2YR8tTD.js +1 -0
- package/build/client/_app/immutable/nodes/0.D2YR8tTD.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.D2YR8tTD.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.B3m6rO4C.js +1 -0
- package/build/client/_app/immutable/nodes/1.B3m6rO4C.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B3m6rO4C.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CyRB2euU.js +1 -0
- package/build/client/_app/immutable/nodes/2.CyRB2euU.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CyRB2euU.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.3yohCM25.js +3 -0
- package/build/client/_app/immutable/nodes/3.3yohCM25.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.3yohCM25.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.DEAcwl7l.js +1 -0
- package/build/client/_app/immutable/nodes/4.DEAcwl7l.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.DEAcwl7l.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.C6bLGWQR.js +4 -0
- package/build/client/_app/immutable/nodes/5.C6bLGWQR.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.C6bLGWQR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.ByTzlA2D.js +2 -0
- package/build/client/_app/immutable/nodes/6.ByTzlA2D.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.ByTzlA2D.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.BPMfwzd2.js +2 -0
- package/build/client/_app/immutable/nodes/7.BPMfwzd2.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.BPMfwzd2.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/client/favicon.svg.gz +0 -0
- package/build/client/manifest.json +13 -0
- package/build/client/manifest.json.br +0 -0
- package/build/client/manifest.json.gz +0 -0
- package/build/pty-holder.cjs +37 -8
- package/build/server/chunks/0-Vk38tI2J.js +9 -0
- package/build/server/chunks/0-Vk38tI2J.js.map +1 -0
- package/build/server/chunks/1-BvYQX5MR.js +9 -0
- package/build/server/chunks/1-BvYQX5MR.js.map +1 -0
- package/build/server/chunks/2-Cl7R4Qk2.js +9 -0
- package/build/server/chunks/2-Cl7R4Qk2.js.map +1 -0
- package/build/server/chunks/3-Ck7ewhOX.js +9 -0
- package/build/server/chunks/3-Ck7ewhOX.js.map +1 -0
- package/build/server/chunks/4-CnDeRm2Z.js +9 -0
- package/build/server/chunks/4-CnDeRm2Z.js.map +1 -0
- package/build/server/chunks/5-IxitzEvN.js +9 -0
- package/build/server/chunks/5-IxitzEvN.js.map +1 -0
- package/build/server/chunks/6-CyZ3r1iS.js +9 -0
- package/build/server/chunks/6-CyZ3r1iS.js.map +1 -0
- package/build/server/chunks/7-BmI7du46.js +9 -0
- package/build/server/chunks/7-BmI7du46.js.map +1 -0
- package/build/server/chunks/Button-Cs1aE6ka.js +80 -0
- package/build/server/chunks/Button-Cs1aE6ka.js.map +1 -0
- package/build/server/chunks/EmptyState-DDFH1K8g.js +26 -0
- package/build/server/chunks/EmptyState-DDFH1K8g.js.map +1 -0
- package/build/server/chunks/Icon-CEUrotA6.js +36 -0
- package/build/server/chunks/Icon-CEUrotA6.js.map +1 -0
- package/build/server/chunks/Shimmer-DB8W1zt6.js +10 -0
- package/build/server/chunks/Shimmer-DB8W1zt6.js.map +1 -0
- package/build/server/chunks/_error.svelte-uCOJNxvr.js +39 -0
- package/build/server/chunks/_error.svelte-uCOJNxvr.js.map +1 -0
- package/build/server/chunks/_layout.svelte-CtWmEJwe.js +56 -0
- package/build/server/chunks/_layout.svelte-CtWmEJwe.js.map +1 -0
- package/build/server/chunks/_page.svelte-BcZaKdX9.js +45 -0
- package/build/server/chunks/_page.svelte-BcZaKdX9.js.map +1 -0
- package/build/server/chunks/_page.svelte-BdYynOck.js +85 -0
- package/build/server/chunks/_page.svelte-BdYynOck.js.map +1 -0
- package/build/server/chunks/_page.svelte-BgevQjq1.js +101 -0
- package/build/server/chunks/_page.svelte-BgevQjq1.js.map +1 -0
- package/build/server/chunks/_page.svelte-CVq6tRb3.js +550 -0
- package/build/server/chunks/_page.svelte-CVq6tRb3.js.map +1 -0
- package/build/server/chunks/_page.svelte-CxWcQ0Am.js +651 -0
- package/build/server/chunks/_page.svelte-CxWcQ0Am.js.map +1 -0
- package/build/server/chunks/_page.svelte-DO4oa_LY.js +44 -0
- package/build/server/chunks/_page.svelte-DO4oa_LY.js.map +1 -0
- package/build/server/chunks/{_server.ts-CbDRDIoP.js → _server.ts-BStnNIcq.js} +9 -11
- package/build/server/chunks/_server.ts-BStnNIcq.js.map +1 -0
- package/build/server/chunks/{_server.ts-DRVbgm6k.js → _server.ts-CAxsWKvS.js} +22 -25
- package/build/server/chunks/_server.ts-CAxsWKvS.js.map +1 -0
- package/build/server/chunks/{_server.ts-CPa6DgIt.js → _server.ts-COu0vNpd.js} +6 -6
- package/build/server/chunks/_server.ts-COu0vNpd.js.map +1 -0
- package/build/server/chunks/{_server.ts-C29xzfaw.js → _server.ts-CTpcLUH8.js} +10 -10
- package/build/server/chunks/_server.ts-CTpcLUH8.js.map +1 -0
- package/build/server/chunks/{_server.ts-D4MNi4cD.js → _server.ts-Cf84YIaW.js} +3 -3
- package/build/server/chunks/{_server.ts-D4MNi4cD.js.map → _server.ts-Cf84YIaW.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BL2FGb5Z.js → _server.ts-Ch-6iOHp.js} +99 -53
- package/build/server/chunks/_server.ts-Ch-6iOHp.js.map +1 -0
- package/build/server/chunks/_server.ts-CtH0dhUp.js +71 -0
- package/build/server/chunks/_server.ts-CtH0dhUp.js.map +1 -0
- package/build/server/chunks/_server.ts-DB_Kg97c.js +73 -0
- package/build/server/chunks/_server.ts-DB_Kg97c.js.map +1 -0
- package/build/server/chunks/{_server.ts-DfajWaqh.js → _server.ts-DV8zTCF9.js} +7 -9
- package/build/server/chunks/_server.ts-DV8zTCF9.js.map +1 -0
- package/build/server/chunks/_server.ts-DYpJImqd.js +99 -0
- package/build/server/chunks/_server.ts-DYpJImqd.js.map +1 -0
- package/build/server/chunks/{_server.ts-ColfDHW8.js → _server.ts-DYvb9ijZ.js} +21 -10
- package/build/server/chunks/_server.ts-DYvb9ijZ.js.map +1 -0
- package/build/server/chunks/{_server.ts-Cv_OrRuL.js → _server.ts-Deok2y88.js} +209 -34
- package/build/server/chunks/_server.ts-Deok2y88.js.map +1 -0
- package/build/server/chunks/{_server.ts-y9-WYDMa.js → _server.ts-WhTJBEJy.js} +5 -4
- package/build/server/chunks/{_server.ts-y9-WYDMa.js.map → _server.ts-WhTJBEJy.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BjOJsoy4.js → _server.ts-XzT2UHM1.js} +6 -5
- package/build/server/chunks/_server.ts-XzT2UHM1.js.map +1 -0
- package/build/server/chunks/{_server.ts-BgdjBZco.js → _server.ts-tSpgyl1D.js} +7 -5
- package/build/server/chunks/_server.ts-tSpgyl1D.js.map +1 -0
- package/build/server/chunks/{_server.ts-BihKSdj_.js → _server.ts-vekTmWAx.js} +8 -8
- package/build/server/chunks/_server.ts-vekTmWAx.js.map +1 -0
- package/build/server/chunks/{auth-CEgFis71.js → auth-DeCdZ83n.js} +2 -2
- package/build/server/chunks/{auth-CEgFis71.js.map → auth-DeCdZ83n.js.map} +1 -1
- package/build/server/chunks/client-BdGHe_hY.js +25 -0
- package/build/server/chunks/client-BdGHe_hY.js.map +1 -0
- package/build/server/chunks/client2-CCBGA-2V.js +7 -0
- package/build/server/chunks/client2-CCBGA-2V.js.map +1 -0
- package/build/server/chunks/error-DDXB3duW.js +12 -0
- package/build/server/chunks/error-DDXB3duW.js.map +1 -0
- package/build/server/chunks/{exports-CJ0Q5XmL.js → index-DwaY1cAm.js} +1111 -1634
- package/build/server/chunks/index-DwaY1cAm.js.map +1 -0
- package/build/server/chunks/index-server-CrDaL06Y.js +9 -0
- package/build/server/chunks/index-server-CrDaL06Y.js.map +1 -0
- package/build/server/chunks/index2-CgclKpUj.js +58 -0
- package/build/server/chunks/index2-CgclKpUj.js.map +1 -0
- package/build/server/chunks/{library-apns-BHxLmuIx.js → library-apns-BqJbvSKh.js} +4 -4
- package/build/server/chunks/library-apns-BqJbvSKh.js.map +1 -0
- package/build/server/chunks/markdown-W_mTBct0.js +8 -0
- package/build/server/chunks/markdown-W_mTBct0.js.map +1 -0
- package/build/server/chunks/opencode-db-path-DcfhJtJy.js +15 -0
- package/build/server/chunks/opencode-db-path-DcfhJtJy.js.map +1 -0
- package/build/server/chunks/{pty-manager-C0FhBiVq.js → pty-manager-BQVB7IVj.js} +155 -326
- package/build/server/chunks/pty-manager-BQVB7IVj.js.map +1 -0
- package/build/server/chunks/root-DDSnEAZv.js +1171 -0
- package/build/server/chunks/root-DDSnEAZv.js.map +1 -0
- package/build/server/chunks/{shared-server-BDY8jh20.js → shared-server-sSGG17Df.js} +2 -3
- package/build/server/chunks/{shared-server-BDY8jh20.js.map → shared-server-sSGG17Df.js.map} +1 -1
- package/build/server/chunks/state.svelte-hBbXlUak.js +11 -0
- package/build/server/chunks/state.svelte-hBbXlUak.js.map +1 -0
- package/build/server/chunks/stores-DHNzYNpX.js +28 -0
- package/build/server/chunks/stores-DHNzYNpX.js.map +1 -0
- package/build/server/index.js +1085 -2242
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +39 -25
- package/build/server/manifest.js.map +1 -1
- package/package.json +32 -9
- package/scripts/fix-generated-types.sh +37 -0
- package/scripts/homebrew/shooter.rb +51 -0
- package/scripts/install.sh +348 -186
- package/scripts/setup.cjs +215 -45
- package/server.ts +114 -71
- package/src/app.css +12 -3
- package/src/app.d.ts +13 -20
- package/src/app.html +3 -2
- package/src/generated/types/API.ts +280 -0
- package/src/generated/types/APN.ts +186 -203
- package/src/generated/types/CLI.ts +18 -25
- package/src/generated/types/Client.ts +589 -0
- package/src/generated/types/Config.ts +53 -0
- package/src/generated/types/Holder.ts +638 -0
- package/src/generated/types/JWT.ts +39 -50
- package/src/generated/types/Notification.ts +426 -0
- package/src/generated/types/OpenCode.ts +356 -0
- package/src/generated/types/Sessions.ts +570 -0
- package/src/generated/types/Terminal.ts +2184 -2071
- package/src/generated/types/WsProtocol.ts +2004 -0
- package/src/generated/types/index.ts +9 -3
- package/src/lib/env.ts +29 -0
- package/src/lib/modules/client/common/cache.ts +10 -2
- package/src/lib/modules/client/common/config-guard.ts +37 -5
- package/src/lib/modules/client/common/error.ts +10 -0
- package/src/lib/modules/client/common/index.ts +6 -5
- package/src/lib/modules/client/common/markdown.ts +22 -1
- package/src/lib/modules/client/common/native-bridge.ts +28 -20
- package/src/lib/modules/client/common/time.ts +13 -11
- package/src/lib/modules/client/terminal/ChatView.svelte +354 -74
- package/src/lib/modules/client/terminal/CommandPalette.svelte +3 -2
- package/src/lib/modules/client/terminal/ConnectionStatus.svelte +7 -1
- package/src/lib/modules/client/terminal/LaunchSheet.svelte +147 -84
- package/src/lib/modules/client/terminal/QuickKeys.svelte +3 -1
- package/src/lib/modules/client/terminal/ShortcutsHelp.svelte +2 -5
- package/src/lib/modules/client/terminal/keyboard-shortcuts.ts +27 -24
- package/src/lib/modules/client/terminal/xterm-wrapper.ts +74 -45
- package/src/lib/modules/server/apn/library-apns.ts +3 -2
- package/src/lib/modules/server/apn/notification-history.ts +2 -13
- package/src/lib/modules/server/apn/notification-sessions.ts +3 -13
- package/src/lib/modules/server/apn/pending-requests.ts +3 -8
- package/src/lib/modules/server/apn/types.ts +5 -4
- package/src/lib/modules/server/cli/index.ts +3 -2
- package/src/lib/modules/server/fcm/fcm-service.ts +8 -6
- package/src/lib/modules/server/sessions/jsonl-parser.ts +3 -3
- package/src/lib/modules/server/sessions/jsonl-reader.ts +86 -26
- package/src/lib/modules/server/sessions/opencode-db-path.ts +26 -0
- package/src/lib/modules/server/sessions/opencode-reader.ts +13 -15
- package/src/lib/modules/server/sessions/process-detector.ts +103 -0
- package/src/lib/modules/server/sessions/types.ts +11 -22
- package/src/lib/modules/server/terminal/holder-client.ts +272 -248
- package/src/lib/modules/server/terminal/opencode-watcher.ts +547 -556
- package/src/lib/modules/server/terminal/pty-holder.cjs +37 -8
- package/src/lib/modules/server/terminal/pty-manager.ts +157 -115
- package/src/lib/modules/server/terminal/session-watcher.ts +6 -4
- package/src/lib/modules/server/terminal/terminal-store.ts +131 -128
- package/src/lib/modules/server/utils/error.ts +9 -0
- package/src/lib/modules/server/ws/events-handler.ts +12 -6
- package/src/lib/modules/server/ws/keepalive.ts +86 -69
- package/src/lib/modules/server/ws/server.ts +43 -37
- package/src/lib/modules/server/ws/session-handler.ts +332 -147
- package/src/lib/modules/server/ws/terminal-handler.ts +29 -17
- package/src/lib/modules/server/ws/ticket-store.ts +29 -26
- package/src/lib/theme.css +30 -0
- package/src/lib/types/config.ts +1 -6
- package/src/routes/+error.svelte +94 -0
- package/src/routes/+layout.svelte +66 -31
- package/src/routes/+page.svelte +25 -22
- package/src/routes/api/debug/+server.ts +3 -1
- package/src/routes/api/device-token/+server.ts +60 -60
- package/src/routes/api/health/+server.ts +81 -73
- package/src/routes/api/notify/+server.ts +115 -68
- package/src/routes/api/qr-config/+server.ts +30 -32
- package/src/routes/api/response/+server.ts +9 -4
- package/src/routes/api/sessions/+server.ts +15 -5
- package/src/routes/api/sessions/connect/+server.ts +125 -0
- package/src/routes/api/sessions/detect/+server.ts +27 -0
- package/src/routes/api/terminals/+server.ts +26 -24
- package/src/routes/api/terminals/[id]/+server.ts +13 -7
- package/src/routes/api/terminals/[id]/paste-image/+server.ts +54 -52
- package/src/routes/api/terminals/[id]/resize/+server.ts +6 -3
- package/src/routes/api/webhook/+server.ts +8 -10
- package/src/routes/api/ws-status/+server.ts +7 -5
- package/src/routes/api/ws-ticket/+server.ts +42 -41
- package/src/routes/config/+page.svelte +149 -75
- package/src/routes/project/+page.svelte +165 -35
- package/src/routes/session/[id]/+page.svelte +479 -283
- package/src/routes/terminals/+page.svelte +58 -45
- package/src/routes/terminals/[id]/+page.svelte +223 -91
- package/build/client/_app/immutable/assets/0.CM9Hl6d-.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CM9Hl6d-.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.C0uFg0IS.css +0 -1
- package/build/client/_app/immutable/assets/3.C0uFg0IS.css.br +0 -0
- package/build/client/_app/immutable/assets/3.C0uFg0IS.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.cJuCkJKZ.css +0 -1
- package/build/client/_app/immutable/assets/4.cJuCkJKZ.css.br +0 -0
- package/build/client/_app/immutable/assets/4.cJuCkJKZ.css.gz +0 -0
- package/build/client/_app/immutable/assets/5.DRjApZQW.css +0 -1
- package/build/client/_app/immutable/assets/5.DRjApZQW.css.br +0 -0
- package/build/client/_app/immutable/assets/5.DRjApZQW.css.gz +0 -0
- package/build/client/_app/immutable/assets/6.AraZrY8I.css +0 -1
- package/build/client/_app/immutable/assets/6.AraZrY8I.css.br +0 -0
- package/build/client/_app/immutable/assets/6.AraZrY8I.css.gz +0 -0
- package/build/client/_app/immutable/assets/7.BCJ1IuMx.css +0 -1
- package/build/client/_app/immutable/assets/7.BCJ1IuMx.css.br +0 -0
- package/build/client/_app/immutable/assets/7.BCJ1IuMx.css.gz +0 -0
- package/build/client/_app/immutable/assets/ChatView.CsdBAOKx.css +0 -1
- package/build/client/_app/immutable/assets/ChatView.CsdBAOKx.css.br +0 -0
- package/build/client/_app/immutable/assets/ChatView.CsdBAOKx.css.gz +0 -0
- package/build/client/_app/immutable/assets/markdown.B0b5w2tq.css +0 -1
- package/build/client/_app/immutable/assets/markdown.B0b5w2tq.css.br +0 -0
- package/build/client/_app/immutable/assets/markdown.B0b5w2tq.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BNJphC1q.js +0 -56
- package/build/client/_app/immutable/chunks/BNJphC1q.js.br +0 -0
- package/build/client/_app/immutable/chunks/BNJphC1q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bvk7mfPM.js +0 -1
- package/build/client/_app/immutable/chunks/Bvk7mfPM.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bvk7mfPM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CAokzuPQ.js +0 -1
- package/build/client/_app/immutable/chunks/CAokzuPQ.js.br +0 -0
- package/build/client/_app/immutable/chunks/CAokzuPQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CGLrx-H5.js +0 -1
- package/build/client/_app/immutable/chunks/CGLrx-H5.js.br +0 -0
- package/build/client/_app/immutable/chunks/CGLrx-H5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CgCpWzEA.js +0 -1
- package/build/client/_app/immutable/chunks/CgCpWzEA.js.br +0 -0
- package/build/client/_app/immutable/chunks/CgCpWzEA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cjwk_cGO.js +0 -6
- package/build/client/_app/immutable/chunks/Cjwk_cGO.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cjwk_cGO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CtQ8EED1.js +0 -11
- package/build/client/_app/immutable/chunks/CtQ8EED1.js.br +0 -0
- package/build/client/_app/immutable/chunks/CtQ8EED1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DERQCisl.js +0 -1
- package/build/client/_app/immutable/chunks/DERQCisl.js.br +0 -0
- package/build/client/_app/immutable/chunks/DERQCisl.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DKrg8TQs.js +0 -1
- package/build/client/_app/immutable/chunks/DKrg8TQs.js.br +0 -0
- package/build/client/_app/immutable/chunks/DKrg8TQs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dkkpz_4D.js +0 -126
- package/build/client/_app/immutable/chunks/Dkkpz_4D.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dkkpz_4D.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DoczjQhA.js +0 -1
- package/build/client/_app/immutable/chunks/DoczjQhA.js.br +0 -0
- package/build/client/_app/immutable/chunks/DoczjQhA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/RpcNruLP.js +0 -2
- package/build/client/_app/immutable/chunks/RpcNruLP.js.br +0 -0
- package/build/client/_app/immutable/chunks/RpcNruLP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/a-St0Zwo.js +0 -1
- package/build/client/_app/immutable/chunks/a-St0Zwo.js.br +0 -0
- package/build/client/_app/immutable/chunks/a-St0Zwo.js.gz +0 -0
- package/build/client/_app/immutable/chunks/bo70OQUZ.js +0 -1
- package/build/client/_app/immutable/chunks/bo70OQUZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/bo70OQUZ.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.QvGgdvTI.js +0 -2
- package/build/client/_app/immutable/entry/app.QvGgdvTI.js.br +0 -0
- package/build/client/_app/immutable/entry/app.QvGgdvTI.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BntDNRMC.js +0 -1
- package/build/client/_app/immutable/entry/start.BntDNRMC.js.br +0 -0
- package/build/client/_app/immutable/entry/start.BntDNRMC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CzkdvJ7j.js +0 -1
- package/build/client/_app/immutable/nodes/0.CzkdvJ7j.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CzkdvJ7j.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.MG1QhfrI.js +0 -1
- package/build/client/_app/immutable/nodes/1.MG1QhfrI.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.MG1QhfrI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.B4MlOSh6.js +0 -1
- package/build/client/_app/immutable/nodes/2.B4MlOSh6.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.B4MlOSh6.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.DIwYkjDn.js +0 -3
- package/build/client/_app/immutable/nodes/3.DIwYkjDn.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.DIwYkjDn.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.D-cIe70D.js +0 -1
- package/build/client/_app/immutable/nodes/4.D-cIe70D.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.D-cIe70D.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.D7zPRe3L.js +0 -1
- package/build/client/_app/immutable/nodes/5.D7zPRe3L.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.D7zPRe3L.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.BB7QE48r.js +0 -2
- package/build/client/_app/immutable/nodes/6.BB7QE48r.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BB7QE48r.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.D8mqsrZG.js +0 -2
- package/build/client/_app/immutable/nodes/7.D8mqsrZG.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.D8mqsrZG.js.gz +0 -0
- package/build/client/manifest.webmanifest +0 -1
- package/build/client/registerSW.js +0 -1
- package/build/client/registerSW.js.br +0 -0
- package/build/client/registerSW.js.gz +0 -0
- package/build/client/sw.js +0 -222
- package/build/client/sw.js.br +0 -0
- package/build/client/sw.js.gz +0 -0
- package/build/client/workbox-5119daf5.js +0 -3395
- package/build/client/workbox-5119daf5.js.br +0 -0
- package/build/client/workbox-5119daf5.js.gz +0 -0
- package/build/server/chunks/0-q2IUp76Y.js +0 -9
- package/build/server/chunks/0-q2IUp76Y.js.map +0 -1
- package/build/server/chunks/1-CU50G5wZ.js +0 -9
- package/build/server/chunks/1-CU50G5wZ.js.map +0 -1
- package/build/server/chunks/2-D01t9s8T.js +0 -9
- package/build/server/chunks/2-D01t9s8T.js.map +0 -1
- package/build/server/chunks/3-5PUQ04wC.js +0 -9
- package/build/server/chunks/3-5PUQ04wC.js.map +0 -1
- package/build/server/chunks/4-e7gywnSG.js +0 -9
- package/build/server/chunks/4-e7gywnSG.js.map +0 -1
- package/build/server/chunks/5-CA1SA6KZ.js +0 -9
- package/build/server/chunks/5-CA1SA6KZ.js.map +0 -1
- package/build/server/chunks/6-71H221sV.js +0 -9
- package/build/server/chunks/6-71H221sV.js.map +0 -1
- package/build/server/chunks/7-Bo-vmdyz.js +0 -9
- package/build/server/chunks/7-Bo-vmdyz.js.map +0 -1
- package/build/server/chunks/_layout.svelte-SFHOxs74.js +0 -132
- package/build/server/chunks/_layout.svelte-SFHOxs74.js.map +0 -1
- package/build/server/chunks/_page.svelte-B4w-2wD-.js +0 -120
- package/build/server/chunks/_page.svelte-B4w-2wD-.js.map +0 -1
- package/build/server/chunks/_page.svelte-B_qAXjkh.js +0 -213
- package/build/server/chunks/_page.svelte-B_qAXjkh.js.map +0 -1
- package/build/server/chunks/_page.svelte-CsF1_TRG.js +0 -50
- package/build/server/chunks/_page.svelte-CsF1_TRG.js.map +0 -1
- package/build/server/chunks/_page.svelte-DJC6U-P0.js +0 -68
- package/build/server/chunks/_page.svelte-DJC6U-P0.js.map +0 -1
- package/build/server/chunks/_page.svelte-DQ6HBtsz.js +0 -407
- package/build/server/chunks/_page.svelte-DQ6HBtsz.js.map +0 -1
- package/build/server/chunks/_page.svelte-LbhhjP21.js +0 -148
- package/build/server/chunks/_page.svelte-LbhhjP21.js.map +0 -1
- package/build/server/chunks/_server.ts-BL2FGb5Z.js.map +0 -1
- package/build/server/chunks/_server.ts-BgdjBZco.js.map +0 -1
- package/build/server/chunks/_server.ts-BihKSdj_.js.map +0 -1
- package/build/server/chunks/_server.ts-BjOJsoy4.js.map +0 -1
- package/build/server/chunks/_server.ts-C29xzfaw.js.map +0 -1
- package/build/server/chunks/_server.ts-CPa6DgIt.js.map +0 -1
- package/build/server/chunks/_server.ts-CbDRDIoP.js.map +0 -1
- package/build/server/chunks/_server.ts-Cl1OEWL4.js +0 -54
- package/build/server/chunks/_server.ts-Cl1OEWL4.js.map +0 -1
- package/build/server/chunks/_server.ts-ColfDHW8.js.map +0 -1
- package/build/server/chunks/_server.ts-Cv_OrRuL.js.map +0 -1
- package/build/server/chunks/_server.ts-DRVbgm6k.js.map +0 -1
- package/build/server/chunks/_server.ts-DfajWaqh.js.map +0 -1
- package/build/server/chunks/client-CxCatAKr.js +0 -255
- package/build/server/chunks/client-CxCatAKr.js.map +0 -1
- package/build/server/chunks/error.svelte-BqdwMWdK.js +0 -26
- package/build/server/chunks/error.svelte-BqdwMWdK.js.map +0 -1
- package/build/server/chunks/exports-CJ0Q5XmL.js.map +0 -1
- package/build/server/chunks/index2-DAxIoAO-.js +0 -36
- package/build/server/chunks/index2-DAxIoAO-.js.map +0 -1
- package/build/server/chunks/jsonl-parser-dmZU_Hyu.js +0 -137
- package/build/server/chunks/jsonl-parser-dmZU_Hyu.js.map +0 -1
- package/build/server/chunks/library-apns-BHxLmuIx.js.map +0 -1
- package/build/server/chunks/markdown-Bxrl3cCF.js +0 -1241
- package/build/server/chunks/markdown-Bxrl3cCF.js.map +0 -1
- package/build/server/chunks/pty-manager-C0FhBiVq.js.map +0 -1
- package/build/server/chunks/stores-D0HorpgL.js +0 -36
- package/build/server/chunks/stores-D0HorpgL.js.map +0 -1
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
import { type SessionSource, decodeSessionSource } from './index';
|
|
2
|
+
import {
|
|
3
|
+
isJSON,
|
|
4
|
+
decodeString,
|
|
5
|
+
_decodeString,
|
|
6
|
+
decodeArray,
|
|
7
|
+
_decodeArray,
|
|
8
|
+
decodeNumber,
|
|
9
|
+
_decodeNumber,
|
|
10
|
+
decodeBoolean,
|
|
11
|
+
_decodeBoolean,
|
|
12
|
+
} from 'type-decoder';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @type { ClientTerminalStatus }
|
|
16
|
+
* @description Whether a client-side terminal view is running or has exited
|
|
17
|
+
*/
|
|
18
|
+
export type ClientTerminalStatus = 'running' | 'exited';
|
|
19
|
+
|
|
20
|
+
export function decodeClientTerminalStatus(rawInput: unknown): ClientTerminalStatus | null {
|
|
21
|
+
switch (rawInput) {
|
|
22
|
+
case 'running':
|
|
23
|
+
case 'exited':
|
|
24
|
+
return rawInput;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function _decodeClientTerminalStatus(rawInput: unknown): ClientTerminalStatus | undefined {
|
|
30
|
+
switch (rawInput) {
|
|
31
|
+
case 'running':
|
|
32
|
+
case 'exited':
|
|
33
|
+
return rawInput;
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @type { SessionMessage }
|
|
40
|
+
* @description A conversation message entry
|
|
41
|
+
*/
|
|
42
|
+
export type SessionMessage = {
|
|
43
|
+
/**
|
|
44
|
+
* @description Unique message identifier
|
|
45
|
+
* @type { string }
|
|
46
|
+
* @memberof SessionMessage
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* @description Message type discriminator (e.g. "user", "assistant", "tool-use", "tool-result")
|
|
51
|
+
* @type { string }
|
|
52
|
+
* @memberof SessionMessage
|
|
53
|
+
*/
|
|
54
|
+
type: string;
|
|
55
|
+
/**
|
|
56
|
+
* @description Primary text content of the message
|
|
57
|
+
* @type { string }
|
|
58
|
+
* @memberof SessionMessage
|
|
59
|
+
*/
|
|
60
|
+
content: string;
|
|
61
|
+
/**
|
|
62
|
+
* @description ISO 8601 timestamp of the message
|
|
63
|
+
* @type { string }
|
|
64
|
+
* @memberof SessionMessage
|
|
65
|
+
*/
|
|
66
|
+
timestamp: string;
|
|
67
|
+
[keys: string]: unknown;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export function decodeSessionMessage(rawInput: unknown): SessionMessage | null {
|
|
71
|
+
if (isJSON(rawInput)) {
|
|
72
|
+
const decodedId = decodeString(rawInput['id']);
|
|
73
|
+
const decodedType = decodeString(rawInput['type']);
|
|
74
|
+
const decodedContent = decodeString(rawInput['content']);
|
|
75
|
+
const decodedTimestamp = decodeString(rawInput['timestamp']);
|
|
76
|
+
|
|
77
|
+
if (
|
|
78
|
+
decodedId === null ||
|
|
79
|
+
decodedType === null ||
|
|
80
|
+
decodedContent === null ||
|
|
81
|
+
decodedTimestamp === null
|
|
82
|
+
) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
...rawInput,
|
|
88
|
+
id: decodedId,
|
|
89
|
+
type: decodedType,
|
|
90
|
+
content: decodedContent,
|
|
91
|
+
timestamp: decodedTimestamp,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @type { TerminalListItem }
|
|
99
|
+
* @description Terminal entry displayed in the /terminals list page
|
|
100
|
+
*/
|
|
101
|
+
export type TerminalListItem = {
|
|
102
|
+
/**
|
|
103
|
+
* @description Unique terminal identifier
|
|
104
|
+
* @type { string }
|
|
105
|
+
* @memberof TerminalListItem
|
|
106
|
+
*/
|
|
107
|
+
id: string;
|
|
108
|
+
/**
|
|
109
|
+
* @description The command that was launched (e.g. "zsh", "claude")
|
|
110
|
+
* @type { string }
|
|
111
|
+
* @memberof TerminalListItem
|
|
112
|
+
*/
|
|
113
|
+
command: string;
|
|
114
|
+
/**
|
|
115
|
+
* @description Command arguments passed at launch
|
|
116
|
+
* @type { string[] }
|
|
117
|
+
* @memberof TerminalListItem
|
|
118
|
+
*/
|
|
119
|
+
args: string[];
|
|
120
|
+
/**
|
|
121
|
+
* @description Working directory the terminal was launched in
|
|
122
|
+
* @type { string }
|
|
123
|
+
* @memberof TerminalListItem
|
|
124
|
+
*/
|
|
125
|
+
cwd: string;
|
|
126
|
+
/**
|
|
127
|
+
* @description Current working directory detected via OSC 7, or null if not yet detected
|
|
128
|
+
* @type { string }
|
|
129
|
+
* @memberof TerminalListItem
|
|
130
|
+
*/
|
|
131
|
+
currentCwd: string | null;
|
|
132
|
+
/**
|
|
133
|
+
* @description OS process ID of the terminal process
|
|
134
|
+
* @type { number }
|
|
135
|
+
* @memberof TerminalListItem
|
|
136
|
+
*/
|
|
137
|
+
pid: number;
|
|
138
|
+
/**
|
|
139
|
+
* @description ISO 8601 timestamp when the terminal was created
|
|
140
|
+
* @type { string }
|
|
141
|
+
* @memberof TerminalListItem
|
|
142
|
+
*/
|
|
143
|
+
createdAt: string;
|
|
144
|
+
/**
|
|
145
|
+
* @description ISO 8601 timestamp when the process exited, or null if still running
|
|
146
|
+
* @type { string }
|
|
147
|
+
* @memberof TerminalListItem
|
|
148
|
+
*/
|
|
149
|
+
exitedAt: string | null;
|
|
150
|
+
/**
|
|
151
|
+
* @description Whether the terminal is running or has exited
|
|
152
|
+
* @type { ClientTerminalStatus }
|
|
153
|
+
* @memberof TerminalListItem
|
|
154
|
+
*/
|
|
155
|
+
status: ClientTerminalStatus;
|
|
156
|
+
/**
|
|
157
|
+
* @description Process exit code, or null if still running
|
|
158
|
+
* @type { number }
|
|
159
|
+
* @memberof TerminalListItem
|
|
160
|
+
*/
|
|
161
|
+
exitCode: number | null;
|
|
162
|
+
/**
|
|
163
|
+
* @description Whether the terminal is currently producing output
|
|
164
|
+
* @type { boolean }
|
|
165
|
+
* @memberof TerminalListItem
|
|
166
|
+
*/
|
|
167
|
+
isActive: boolean | null;
|
|
168
|
+
/**
|
|
169
|
+
* @description Most recent output line for preview display, or null if none
|
|
170
|
+
* @type { string }
|
|
171
|
+
* @memberof TerminalListItem
|
|
172
|
+
*/
|
|
173
|
+
lastOutput: string | null;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export function decodeTerminalListItem(rawInput: unknown): TerminalListItem | null {
|
|
177
|
+
if (isJSON(rawInput)) {
|
|
178
|
+
const decodedId = decodeString(rawInput['id']);
|
|
179
|
+
const decodedCommand = decodeString(rawInput['command']);
|
|
180
|
+
const decodedArgs = decodeArray(rawInput['args'], decodeString);
|
|
181
|
+
const decodedCwd = decodeString(rawInput['cwd']);
|
|
182
|
+
const decodedCurrentCwd = decodeString(rawInput['currentCwd']);
|
|
183
|
+
const decodedPid = decodeNumber(rawInput['pid']);
|
|
184
|
+
const decodedCreatedAt = decodeString(rawInput['createdAt']);
|
|
185
|
+
const decodedExitedAt = decodeString(rawInput['exitedAt']);
|
|
186
|
+
const decodedStatus = decodeClientTerminalStatus(rawInput['status']);
|
|
187
|
+
const decodedExitCode = decodeNumber(rawInput['exitCode']);
|
|
188
|
+
const decodedIsActive = decodeBoolean(rawInput['isActive']);
|
|
189
|
+
const decodedLastOutput = decodeString(rawInput['lastOutput']);
|
|
190
|
+
|
|
191
|
+
if (
|
|
192
|
+
decodedId === null ||
|
|
193
|
+
decodedCommand === null ||
|
|
194
|
+
decodedArgs === null ||
|
|
195
|
+
decodedCwd === null ||
|
|
196
|
+
decodedPid === null ||
|
|
197
|
+
decodedCreatedAt === null ||
|
|
198
|
+
decodedStatus === null
|
|
199
|
+
) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
id: decodedId,
|
|
205
|
+
command: decodedCommand,
|
|
206
|
+
args: decodedArgs,
|
|
207
|
+
cwd: decodedCwd,
|
|
208
|
+
currentCwd: decodedCurrentCwd,
|
|
209
|
+
pid: decodedPid,
|
|
210
|
+
createdAt: decodedCreatedAt,
|
|
211
|
+
exitedAt: decodedExitedAt,
|
|
212
|
+
status: decodedStatus,
|
|
213
|
+
exitCode: decodedExitCode,
|
|
214
|
+
isActive: decodedIsActive,
|
|
215
|
+
lastOutput: decodedLastOutput,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @type { TerminalDetailView }
|
|
223
|
+
* @description Terminal data used by the /terminals/[id] detail page
|
|
224
|
+
*/
|
|
225
|
+
export type TerminalDetailView = {
|
|
226
|
+
/**
|
|
227
|
+
* @description Unique terminal identifier
|
|
228
|
+
* @type { string }
|
|
229
|
+
* @memberof TerminalDetailView
|
|
230
|
+
*/
|
|
231
|
+
id: string;
|
|
232
|
+
/**
|
|
233
|
+
* @description The command that was launched
|
|
234
|
+
* @type { string }
|
|
235
|
+
* @memberof TerminalDetailView
|
|
236
|
+
*/
|
|
237
|
+
command: string;
|
|
238
|
+
/**
|
|
239
|
+
* @description Command arguments passed at launch
|
|
240
|
+
* @type { string[] }
|
|
241
|
+
* @memberof TerminalDetailView
|
|
242
|
+
*/
|
|
243
|
+
args: string[];
|
|
244
|
+
/**
|
|
245
|
+
* @description Working directory the terminal was launched in
|
|
246
|
+
* @type { string }
|
|
247
|
+
* @memberof TerminalDetailView
|
|
248
|
+
*/
|
|
249
|
+
cwd: string;
|
|
250
|
+
/**
|
|
251
|
+
* @description OS process ID of the terminal process
|
|
252
|
+
* @type { number }
|
|
253
|
+
* @memberof TerminalDetailView
|
|
254
|
+
*/
|
|
255
|
+
pid: number;
|
|
256
|
+
/**
|
|
257
|
+
* @description ISO 8601 timestamp when the terminal was created
|
|
258
|
+
* @type { string }
|
|
259
|
+
* @memberof TerminalDetailView
|
|
260
|
+
*/
|
|
261
|
+
createdAt: string;
|
|
262
|
+
/**
|
|
263
|
+
* @description ISO 8601 timestamp when the process exited, or null if still running
|
|
264
|
+
* @type { string }
|
|
265
|
+
* @memberof TerminalDetailView
|
|
266
|
+
*/
|
|
267
|
+
exitedAt: string | null;
|
|
268
|
+
/**
|
|
269
|
+
* @description Whether the terminal is running or has exited
|
|
270
|
+
* @type { ClientTerminalStatus }
|
|
271
|
+
* @memberof TerminalDetailView
|
|
272
|
+
*/
|
|
273
|
+
status: ClientTerminalStatus;
|
|
274
|
+
/**
|
|
275
|
+
* @description Process exit code, or null if still running
|
|
276
|
+
* @type { number }
|
|
277
|
+
* @memberof TerminalDetailView
|
|
278
|
+
*/
|
|
279
|
+
exitCode: number | null;
|
|
280
|
+
/**
|
|
281
|
+
* @description Number of WebSocket clients currently attached to this terminal
|
|
282
|
+
* @type { number }
|
|
283
|
+
* @memberof TerminalDetailView
|
|
284
|
+
*/
|
|
285
|
+
clientCount: number | null;
|
|
286
|
+
/**
|
|
287
|
+
* @description Most recent scrollback line for preview display, or null if empty
|
|
288
|
+
* @type { string }
|
|
289
|
+
* @memberof TerminalDetailView
|
|
290
|
+
*/
|
|
291
|
+
lastOutput: string | null;
|
|
292
|
+
/**
|
|
293
|
+
* @description ISO 8601 timestamp when this response was generated
|
|
294
|
+
* @type { string }
|
|
295
|
+
* @memberof TerminalDetailView
|
|
296
|
+
*/
|
|
297
|
+
timestamp: string | null;
|
|
298
|
+
/**
|
|
299
|
+
* @description WebSocket path for raw terminal I/O
|
|
300
|
+
* @type { string }
|
|
301
|
+
* @memberof TerminalDetailView
|
|
302
|
+
*/
|
|
303
|
+
ws: string;
|
|
304
|
+
/**
|
|
305
|
+
* @description WebSocket path for structured session stream
|
|
306
|
+
* @type { string }
|
|
307
|
+
* @memberof TerminalDetailView
|
|
308
|
+
*/
|
|
309
|
+
sessionWs: string;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export function decodeTerminalDetailView(rawInput: unknown): TerminalDetailView | null {
|
|
313
|
+
if (isJSON(rawInput)) {
|
|
314
|
+
const decodedId = decodeString(rawInput['id']);
|
|
315
|
+
const decodedCommand = decodeString(rawInput['command']);
|
|
316
|
+
const decodedArgs = decodeArray(rawInput['args'], decodeString);
|
|
317
|
+
const decodedCwd = decodeString(rawInput['cwd']);
|
|
318
|
+
const decodedPid = decodeNumber(rawInput['pid']);
|
|
319
|
+
const decodedCreatedAt = decodeString(rawInput['createdAt']);
|
|
320
|
+
const decodedExitedAt = decodeString(rawInput['exitedAt']);
|
|
321
|
+
const decodedStatus = decodeClientTerminalStatus(rawInput['status']);
|
|
322
|
+
const decodedExitCode = decodeNumber(rawInput['exitCode']);
|
|
323
|
+
const decodedClientCount = decodeNumber(rawInput['clientCount']);
|
|
324
|
+
const decodedLastOutput = decodeString(rawInput['lastOutput']);
|
|
325
|
+
const decodedTimestamp = decodeString(rawInput['timestamp']);
|
|
326
|
+
const decodedWs = decodeString(rawInput['ws']);
|
|
327
|
+
const decodedSessionWs = decodeString(rawInput['sessionWs']);
|
|
328
|
+
|
|
329
|
+
if (
|
|
330
|
+
decodedId === null ||
|
|
331
|
+
decodedCommand === null ||
|
|
332
|
+
decodedArgs === null ||
|
|
333
|
+
decodedCwd === null ||
|
|
334
|
+
decodedPid === null ||
|
|
335
|
+
decodedCreatedAt === null ||
|
|
336
|
+
decodedStatus === null ||
|
|
337
|
+
decodedWs === null ||
|
|
338
|
+
decodedSessionWs === null
|
|
339
|
+
) {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return {
|
|
344
|
+
id: decodedId,
|
|
345
|
+
command: decodedCommand,
|
|
346
|
+
args: decodedArgs,
|
|
347
|
+
cwd: decodedCwd,
|
|
348
|
+
pid: decodedPid,
|
|
349
|
+
createdAt: decodedCreatedAt,
|
|
350
|
+
exitedAt: decodedExitedAt,
|
|
351
|
+
status: decodedStatus,
|
|
352
|
+
exitCode: decodedExitCode,
|
|
353
|
+
clientCount: decodedClientCount,
|
|
354
|
+
lastOutput: decodedLastOutput,
|
|
355
|
+
timestamp: decodedTimestamp,
|
|
356
|
+
ws: decodedWs,
|
|
357
|
+
sessionWs: decodedSessionWs,
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* @type { SessionViewResponse }
|
|
365
|
+
* @description API response shape for fetching a single session with its conversation messages
|
|
366
|
+
*/
|
|
367
|
+
export type SessionViewResponse = {
|
|
368
|
+
/**
|
|
369
|
+
* @description Session metadata
|
|
370
|
+
* @type { SessionViewResponseSession }
|
|
371
|
+
* @memberof SessionViewResponse
|
|
372
|
+
*/
|
|
373
|
+
session: SessionViewResponseSession;
|
|
374
|
+
/**
|
|
375
|
+
* @description Conversation messages in the session
|
|
376
|
+
* @type { SessionMessage[] }
|
|
377
|
+
* @memberof SessionViewResponse
|
|
378
|
+
*/
|
|
379
|
+
messages: SessionMessage[];
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export function decodeSessionViewResponse(rawInput: unknown): SessionViewResponse | null {
|
|
383
|
+
if (isJSON(rawInput)) {
|
|
384
|
+
const decodedSession = decodeSessionViewResponseSession(rawInput['session']);
|
|
385
|
+
const decodedMessages = decodeArray(rawInput['messages'], decodeSessionMessage);
|
|
386
|
+
|
|
387
|
+
if (decodedSession === null || decodedMessages === null) {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return {
|
|
392
|
+
session: decodedSession,
|
|
393
|
+
messages: decodedMessages,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @type { SessionViewResponseSession }
|
|
401
|
+
* @description Session metadata
|
|
402
|
+
*/
|
|
403
|
+
export type SessionViewResponseSession = {
|
|
404
|
+
/**
|
|
405
|
+
* @description Unique session identifier
|
|
406
|
+
* @type { string }
|
|
407
|
+
* @memberof SessionViewResponseSession
|
|
408
|
+
*/
|
|
409
|
+
id: string;
|
|
410
|
+
/**
|
|
411
|
+
* @description Human-readable session title
|
|
412
|
+
* @type { string }
|
|
413
|
+
* @memberof SessionViewResponseSession
|
|
414
|
+
*/
|
|
415
|
+
title: string;
|
|
416
|
+
/**
|
|
417
|
+
* @description Absolute path to the project directory
|
|
418
|
+
* @type { string }
|
|
419
|
+
* @memberof SessionViewResponseSession
|
|
420
|
+
*/
|
|
421
|
+
projectPath: string;
|
|
422
|
+
/**
|
|
423
|
+
* @description Git branch active during the session
|
|
424
|
+
* @type { string }
|
|
425
|
+
* @memberof SessionViewResponseSession
|
|
426
|
+
*/
|
|
427
|
+
gitBranch: string;
|
|
428
|
+
/**
|
|
429
|
+
* @description Total number of messages in the session
|
|
430
|
+
* @type { number }
|
|
431
|
+
* @memberof SessionViewResponseSession
|
|
432
|
+
*/
|
|
433
|
+
messageCount: number;
|
|
434
|
+
/**
|
|
435
|
+
* @description ISO 8601 timestamp when the session started
|
|
436
|
+
* @type { string }
|
|
437
|
+
* @memberof SessionViewResponseSession
|
|
438
|
+
*/
|
|
439
|
+
created: string;
|
|
440
|
+
/**
|
|
441
|
+
* @description ISO 8601 timestamp of the last session update
|
|
442
|
+
* @type { string }
|
|
443
|
+
* @memberof SessionViewResponseSession
|
|
444
|
+
*/
|
|
445
|
+
modified: string;
|
|
446
|
+
/**
|
|
447
|
+
* @description Brief summary of the session content
|
|
448
|
+
* @type { string }
|
|
449
|
+
* @memberof SessionViewResponseSession
|
|
450
|
+
*/
|
|
451
|
+
summary: string;
|
|
452
|
+
/**
|
|
453
|
+
* @description Source tool that created the session
|
|
454
|
+
* @type { SessionSource }
|
|
455
|
+
* @memberof SessionViewResponseSession
|
|
456
|
+
*/
|
|
457
|
+
source: SessionSource;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
export function decodeSessionViewResponseSession(
|
|
461
|
+
rawInput: unknown
|
|
462
|
+
): SessionViewResponseSession | null {
|
|
463
|
+
if (isJSON(rawInput)) {
|
|
464
|
+
const decodedId = decodeString(rawInput['id']);
|
|
465
|
+
const decodedTitle = decodeString(rawInput['title']);
|
|
466
|
+
const decodedProjectPath = decodeString(rawInput['projectPath']);
|
|
467
|
+
const decodedGitBranch = decodeString(rawInput['gitBranch']);
|
|
468
|
+
const decodedMessageCount = decodeNumber(rawInput['messageCount']);
|
|
469
|
+
const decodedCreated = decodeString(rawInput['created']);
|
|
470
|
+
const decodedModified = decodeString(rawInput['modified']);
|
|
471
|
+
const decodedSummary = decodeString(rawInput['summary']);
|
|
472
|
+
const decodedSource = decodeSessionSource(rawInput['source']);
|
|
473
|
+
|
|
474
|
+
if (
|
|
475
|
+
decodedId === null ||
|
|
476
|
+
decodedTitle === null ||
|
|
477
|
+
decodedProjectPath === null ||
|
|
478
|
+
decodedGitBranch === null ||
|
|
479
|
+
decodedMessageCount === null ||
|
|
480
|
+
decodedCreated === null ||
|
|
481
|
+
decodedModified === null ||
|
|
482
|
+
decodedSummary === null ||
|
|
483
|
+
decodedSource === null
|
|
484
|
+
) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return {
|
|
489
|
+
id: decodedId,
|
|
490
|
+
title: decodedTitle,
|
|
491
|
+
projectPath: decodedProjectPath,
|
|
492
|
+
gitBranch: decodedGitBranch,
|
|
493
|
+
messageCount: decodedMessageCount,
|
|
494
|
+
created: decodedCreated,
|
|
495
|
+
modified: decodedModified,
|
|
496
|
+
summary: decodedSummary,
|
|
497
|
+
source: decodedSource,
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* @type { ShortcutAction }
|
|
505
|
+
* @description A keyboard shortcut definition for the terminal help overlay
|
|
506
|
+
*/
|
|
507
|
+
export type ShortcutAction = {
|
|
508
|
+
/**
|
|
509
|
+
* @description Key character that triggers the shortcut (e.g. "/", "k")
|
|
510
|
+
* @type { string }
|
|
511
|
+
* @memberof ShortcutAction
|
|
512
|
+
*/
|
|
513
|
+
key: string;
|
|
514
|
+
/**
|
|
515
|
+
* @description Human-readable key combo label shown in the UI (e.g. "Cmd+/")
|
|
516
|
+
* @type { string }
|
|
517
|
+
* @memberof ShortcutAction
|
|
518
|
+
*/
|
|
519
|
+
label: string;
|
|
520
|
+
/**
|
|
521
|
+
* @description What the shortcut does
|
|
522
|
+
* @type { string }
|
|
523
|
+
* @memberof ShortcutAction
|
|
524
|
+
*/
|
|
525
|
+
description: string;
|
|
526
|
+
/**
|
|
527
|
+
* @description Whether the shift modifier is also required
|
|
528
|
+
* @type { boolean }
|
|
529
|
+
* @memberof ShortcutAction
|
|
530
|
+
*/
|
|
531
|
+
shift: boolean | null;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
export function decodeShortcutAction(rawInput: unknown): ShortcutAction | null {
|
|
535
|
+
if (isJSON(rawInput)) {
|
|
536
|
+
const decodedKey = decodeString(rawInput['key']);
|
|
537
|
+
const decodedLabel = decodeString(rawInput['label']);
|
|
538
|
+
const decodedDescription = decodeString(rawInput['description']);
|
|
539
|
+
const decodedShift = decodeBoolean(rawInput['shift']);
|
|
540
|
+
|
|
541
|
+
if (decodedKey === null || decodedLabel === null || decodedDescription === null) {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return {
|
|
546
|
+
key: decodedKey,
|
|
547
|
+
label: decodedLabel,
|
|
548
|
+
description: decodedDescription,
|
|
549
|
+
shift: decodedShift,
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* @type { NativeBridgeConfig }
|
|
557
|
+
* @description Configuration returned by ShooterBridge.getConfig() in the native app WebView
|
|
558
|
+
*/
|
|
559
|
+
export type NativeBridgeConfig = {
|
|
560
|
+
/**
|
|
561
|
+
* @description Base URL of the Shooter server
|
|
562
|
+
* @type { string }
|
|
563
|
+
* @memberof NativeBridgeConfig
|
|
564
|
+
*/
|
|
565
|
+
serverUrl: string;
|
|
566
|
+
/**
|
|
567
|
+
* @description API key for authenticating with the server
|
|
568
|
+
* @type { string }
|
|
569
|
+
* @memberof NativeBridgeConfig
|
|
570
|
+
*/
|
|
571
|
+
apiKey: string;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
export function decodeNativeBridgeConfig(rawInput: unknown): NativeBridgeConfig | null {
|
|
575
|
+
if (isJSON(rawInput)) {
|
|
576
|
+
const decodedServerUrl = decodeString(rawInput['serverUrl']);
|
|
577
|
+
const decodedApiKey = decodeString(rawInput['apiKey']);
|
|
578
|
+
|
|
579
|
+
if (decodedServerUrl === null || decodedApiKey === null) {
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return {
|
|
584
|
+
serverUrl: decodedServerUrl,
|
|
585
|
+
apiKey: decodedApiKey,
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
return null;
|
|
589
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { isJSON, decodeString, _decodeString, decodeNumber, _decodeNumber } from 'type-decoder';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @type { ShooterConfig }
|
|
5
|
+
* @description Client-side configuration stored in localStorage for API authentication and device registration
|
|
6
|
+
*/
|
|
7
|
+
export type ShooterConfig = {
|
|
8
|
+
/**
|
|
9
|
+
* @description API key for authenticating requests to the Shooter server
|
|
10
|
+
* @type { string }
|
|
11
|
+
* @memberof ShooterConfig
|
|
12
|
+
*/
|
|
13
|
+
apiKey: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description Device token for push notification delivery (APNs or FCM)
|
|
16
|
+
* @type { string }
|
|
17
|
+
* @memberof ShooterConfig
|
|
18
|
+
*/
|
|
19
|
+
deviceToken: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* @description Base URL of the Shooter server, or null to use the current origin
|
|
22
|
+
* @type { string }
|
|
23
|
+
* @memberof ShooterConfig
|
|
24
|
+
*/
|
|
25
|
+
serverUrl: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* @description Unix timestamp (milliseconds) of the last configuration update
|
|
28
|
+
* @type { number }
|
|
29
|
+
* @memberof ShooterConfig
|
|
30
|
+
*/
|
|
31
|
+
lastUpdated: number | null;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function decodeShooterConfig(rawInput: unknown): ShooterConfig | null {
|
|
35
|
+
if (isJSON(rawInput)) {
|
|
36
|
+
const decodedApiKey = decodeString(rawInput['apiKey']);
|
|
37
|
+
const decodedDeviceToken = decodeString(rawInput['deviceToken']);
|
|
38
|
+
const decodedServerUrl = decodeString(rawInput['serverUrl']);
|
|
39
|
+
const decodedLastUpdated = decodeNumber(rawInput['lastUpdated']);
|
|
40
|
+
|
|
41
|
+
if (decodedApiKey === null) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
apiKey: decodedApiKey,
|
|
47
|
+
deviceToken: decodedDeviceToken,
|
|
48
|
+
serverUrl: decodedServerUrl,
|
|
49
|
+
lastUpdated: decodedLastUpdated,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|