@juspay/shooter 1.21.0 → 1.22.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 +94 -1
- package/build/client/_app/immutable/assets/2.JWRrnR-w.css +1 -0
- package/build/client/_app/immutable/assets/2.JWRrnR-w.css.br +0 -0
- package/build/client/_app/immutable/assets/2.JWRrnR-w.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BfbPKMXz.js +3 -0
- package/build/client/_app/immutable/chunks/BfbPKMXz.js.br +0 -0
- package/build/client/_app/immutable/chunks/BfbPKMXz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C4Hns_Wl.js +1 -0
- package/build/client/_app/immutable/chunks/C4Hns_Wl.js.br +0 -0
- package/build/client/_app/immutable/chunks/C4Hns_Wl.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BmfLecb1.js → CZg4kn4E.js} +1 -1
- package/build/client/_app/immutable/chunks/CZg4kn4E.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZg4kn4E.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{EqMAkEha.js → DhK7PwI_.js} +1 -1
- package/build/client/_app/immutable/chunks/DhK7PwI_.js.br +0 -0
- package/build/client/_app/immutable/chunks/DhK7PwI_.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.CeSxgGat.js → app.CTqz33nP.js} +2 -2
- package/build/client/_app/immutable/entry/app.CTqz33nP.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CTqz33nP.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Dj-Kvgwo.js +1 -0
- package/build/client/_app/immutable/entry/start.Dj-Kvgwo.js.br +2 -0
- package/build/client/_app/immutable/entry/start.Dj-Kvgwo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.oaPwxh1O.js → 0.Qn7Ktiht.js} +1 -1
- package/build/client/_app/immutable/nodes/0.Qn7Ktiht.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.Qn7Ktiht.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.DMPyoM-M.js → 1.BxWOfNlo.js} +1 -1
- package/build/client/_app/immutable/nodes/1.BxWOfNlo.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.BxWOfNlo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{10.Cbm7nQKK.js → 10.BGPYD1s1.js} +1 -1
- package/build/client/_app/immutable/nodes/10.BGPYD1s1.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.BGPYD1s1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.CKmZjP_a.js → 11.BxY1PUjC.js} +1 -1
- package/build/client/_app/immutable/nodes/11.BxY1PUjC.js.br +0 -0
- package/build/client/_app/immutable/nodes/{11.CKmZjP_a.js.gz → 11.BxY1PUjC.js.gz} +0 -0
- package/build/client/_app/immutable/nodes/2.Bc2qALkX.js +23 -0
- package/build/client/_app/immutable/nodes/2.Bc2qALkX.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.Bc2qALkX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.BgLpGnzb.js → 3.N2-A8noI.js} +1 -1
- package/build/client/_app/immutable/nodes/3.N2-A8noI.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.N2-A8noI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.Avc1-gVb.js → 5.DziEu9rx.js} +1 -1
- package/build/client/_app/immutable/nodes/5.DziEu9rx.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.DziEu9rx.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.Dw2wEssJ.js → 6.BWF9Qx6F.js} +1 -1
- package/build/client/_app/immutable/nodes/6.BWF9Qx6F.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BWF9Qx6F.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.DwKZjoBg.js → 7.DHuDIdpz.js} +1 -1
- package/build/client/_app/immutable/nodes/7.DHuDIdpz.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DHuDIdpz.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.ZUAI6g5E.js → 8.D0Ijt9Vv.js} +1 -1
- package/build/client/_app/immutable/nodes/8.D0Ijt9Vv.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.D0Ijt9Vv.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.I_KGXPwB.js → 9.2Piwo35J.js} +1 -1
- package/build/client/_app/immutable/nodes/9.2Piwo35J.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.2Piwo35J.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/pty-holder.cjs +6 -0
- package/build/server/chunks/{0-vrTNAfZB.js → 0-CVGsyVKN.js} +2 -2
- package/build/server/chunks/{0-vrTNAfZB.js.map → 0-CVGsyVKN.js.map} +1 -1
- package/build/server/chunks/{1-nbr-bOoF.js → 1-BAlAsKdp.js} +2 -2
- package/build/server/chunks/{1-nbr-bOoF.js.map → 1-BAlAsKdp.js.map} +1 -1
- package/build/server/chunks/{10-ChyvvJ6w.js → 10-BUCX7Aqz.js} +2 -2
- package/build/server/chunks/{10-ChyvvJ6w.js.map → 10-BUCX7Aqz.js.map} +1 -1
- package/build/server/chunks/{11-6ZAjL3uU.js → 11-DHPvc2yA.js} +2 -2
- package/build/server/chunks/{11-6ZAjL3uU.js.map → 11-DHPvc2yA.js.map} +1 -1
- package/build/server/chunks/{2-DWFRVDWJ.js → 2-DLOMdCHW.js} +4 -4
- package/build/server/chunks/{2-DWFRVDWJ.js.map → 2-DLOMdCHW.js.map} +1 -1
- package/build/server/chunks/{3-CKANM_WM.js → 3-DCf69LYo.js} +2 -2
- package/build/server/chunks/{3-CKANM_WM.js.map → 3-DCf69LYo.js.map} +1 -1
- package/build/server/chunks/{5-BxVjs2qi.js → 5-D-Uv1voC.js} +2 -2
- package/build/server/chunks/{5-BxVjs2qi.js.map → 5-D-Uv1voC.js.map} +1 -1
- package/build/server/chunks/{6-Cbf1AAMQ.js → 6-DUrC2Naz.js} +2 -2
- package/build/server/chunks/{6-Cbf1AAMQ.js.map → 6-DUrC2Naz.js.map} +1 -1
- package/build/server/chunks/{7-CMK2quEf.js → 7-TXwjMHt2.js} +2 -2
- package/build/server/chunks/{7-CMK2quEf.js.map → 7-TXwjMHt2.js.map} +1 -1
- package/build/server/chunks/{8-DhdfkfDM.js → 8-D2X_jBsT.js} +2 -2
- package/build/server/chunks/{8-DhdfkfDM.js.map → 8-D2X_jBsT.js.map} +1 -1
- package/build/server/chunks/{9-CPpxtRM5.js → 9-DK0hH5Xa.js} +2 -2
- package/build/server/chunks/{9-CPpxtRM5.js.map → 9-DK0hH5Xa.js.map} +1 -1
- package/build/server/chunks/_page.svelte-8OFzwdNA.js +758 -0
- package/build/server/chunks/_page.svelte-8OFzwdNA.js.map +1 -0
- package/build/server/chunks/{_server.ts-BWVlO8iV.js → _server.ts-05JJOdcX.js} +15 -12
- package/build/server/chunks/_server.ts-05JJOdcX.js.map +1 -0
- package/build/server/chunks/{_server.ts-CC2K8-L2.js → _server.ts-B54Pvhgc.js} +3 -2
- package/build/server/chunks/_server.ts-B54Pvhgc.js.map +1 -0
- package/build/server/chunks/{_server.ts-BevnuePu.js → _server.ts-BCljU9Sg.js} +7 -3
- package/build/server/chunks/_server.ts-BCljU9Sg.js.map +1 -0
- package/build/server/chunks/{_server.ts-D-vgx5UZ.js → _server.ts-BTmknWpO.js} +2 -2
- package/build/server/chunks/{_server.ts-D-vgx5UZ.js.map → _server.ts-BTmknWpO.js.map} +1 -1
- package/build/server/chunks/{_server.ts-tChyh9FX.js → _server.ts-BXhmLZwN.js} +4 -2
- package/build/server/chunks/{_server.ts-tChyh9FX.js.map → _server.ts-BXhmLZwN.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CvJKTS3Z.js → _server.ts-BbRSpB74.js} +4 -2
- package/build/server/chunks/{_server.ts-CvJKTS3Z.js.map → _server.ts-BbRSpB74.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Dp-hXW_I.js → _server.ts-Bol54_Qo.js} +3 -2
- package/build/server/chunks/_server.ts-Bol54_Qo.js.map +1 -0
- package/build/server/chunks/{_server.ts-X1R7L_QI.js → _server.ts-C0PO_cAu.js} +3 -2
- package/build/server/chunks/{_server.ts-X1R7L_QI.js.map → _server.ts-C0PO_cAu.js.map} +1 -1
- package/build/server/chunks/_server.ts-C6NRpe7e.js +33 -0
- package/build/server/chunks/_server.ts-C6NRpe7e.js.map +1 -0
- package/build/server/chunks/_server.ts-CGqCOCdK.js +53 -0
- package/build/server/chunks/_server.ts-CGqCOCdK.js.map +1 -0
- package/build/server/chunks/{_server.ts-CA5KUENM.js → _server.ts-CZb-BI5H.js} +3 -2
- package/build/server/chunks/_server.ts-CZb-BI5H.js.map +1 -0
- package/build/server/chunks/{_server.ts-VzDcFFgy.js → _server.ts-DPHRUFYS.js} +4 -2
- package/build/server/chunks/_server.ts-DPHRUFYS.js.map +1 -0
- package/build/server/chunks/{_server.ts-D0zRDSx0.js → _server.ts-D_WRex0k.js} +4 -2
- package/build/server/chunks/_server.ts-D_WRex0k.js.map +1 -0
- package/build/server/chunks/{_server.ts-CD7JP3fz.js → _server.ts-DiBMY7Ho.js} +3 -2
- package/build/server/chunks/_server.ts-DiBMY7Ho.js.map +1 -0
- package/build/server/chunks/{library-apns-Dl3iRE2h.js → library-apns-D8RPINlv.js} +62 -7
- package/build/server/chunks/library-apns-D8RPINlv.js.map +1 -0
- package/build/server/chunks/{pending-requests-C9p57WoU.js → pending-requests-8rWjrF6d.js} +3 -2
- package/build/server/chunks/pending-requests-8rWjrF6d.js.map +1 -0
- package/build/server/chunks/presence-store-Bx_g0-Gd.js +23 -0
- package/build/server/chunks/presence-store-Bx_g0-Gd.js.map +1 -0
- package/build/server/chunks/{pty-manager-ZqXqa-6A.js → pty-manager-CoWVT56F.js} +26 -5
- package/build/server/chunks/pty-manager-CoWVT56F.js.map +1 -0
- package/build/server/chunks/shooter-home-4f_HkdGI.js +10 -0
- package/build/server/chunks/shooter-home-4f_HkdGI.js.map +1 -0
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +38 -24
- package/build/server/manifest.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/modules/client/common/index.ts +1 -0
- package/src/lib/modules/client/common/presence.ts +47 -0
- package/src/lib/modules/client/dashboard/AutopilotPanel.svelte +188 -4
- package/src/lib/modules/client/dashboard/autopilot-driver.svelte.ts +681 -0
- package/src/lib/modules/client/dashboard/decide-injection.ts +127 -0
- package/src/lib/modules/client/dashboard/store.svelte.ts +65 -24
- package/src/lib/modules/client/neurolink/fetch-proxy.ts +38 -1
- package/src/lib/modules/server/apn/apns-payload.ts +50 -0
- package/src/lib/modules/server/apn/library-apns.ts +50 -8
- package/src/lib/modules/server/apn/pending-requests.ts +3 -1
- package/src/lib/modules/server/sessions/autopilot-context.ts +57 -0
- package/src/lib/modules/server/sessions/autopilot-engine.ts +148 -43
- package/src/lib/modules/server/sessions/litellm-client.ts +90 -34
- package/src/lib/modules/server/sessions/next-step-consensus.ts +27 -2
- package/src/lib/modules/server/sessions/summary-store.ts +3 -1
- package/src/lib/modules/server/terminal/agent-launch.ts +26 -0
- package/src/lib/modules/server/terminal/pty-holder.cjs +6 -0
- package/src/lib/modules/server/terminal/pty-manager.ts +13 -3
- package/src/lib/modules/server/terminal/session-watcher.ts +12 -2
- package/src/lib/modules/server/terminal/terminal-store.ts +3 -1
- package/src/lib/modules/server/utils/shooter-home.ts +16 -0
- package/src/lib/modules/server/ws/presence-store.ts +50 -0
- package/src/lib/types/autopilot.ts +65 -0
- package/src/routes/api/autopilot/goal/+server.ts +72 -0
- package/src/routes/api/neurolink-proxy/+server.ts +8 -2
- package/src/routes/api/notify/+server.ts +22 -15
- package/src/routes/api/presence/+server.ts +39 -0
- package/src/routes/api/ws-status/+server.ts +8 -5
- package/build/client/_app/immutable/assets/2.BHi6pjT2.css +0 -1
- package/build/client/_app/immutable/assets/2.BHi6pjT2.css.br +0 -0
- package/build/client/_app/immutable/assets/2.BHi6pjT2.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BmfLecb1.js.br +0 -0
- package/build/client/_app/immutable/chunks/BmfLecb1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CRkG7oE4.js +0 -1
- package/build/client/_app/immutable/chunks/CRkG7oE4.js.br +0 -0
- package/build/client/_app/immutable/chunks/CRkG7oE4.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DOEXXmsh.js +0 -3
- package/build/client/_app/immutable/chunks/DOEXXmsh.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOEXXmsh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/EqMAkEha.js.br +0 -0
- package/build/client/_app/immutable/chunks/EqMAkEha.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.CeSxgGat.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CeSxgGat.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DrnJFwxA.js +0 -1
- package/build/client/_app/immutable/entry/start.DrnJFwxA.js.br +0 -2
- package/build/client/_app/immutable/entry/start.DrnJFwxA.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.oaPwxh1O.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.oaPwxh1O.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.DMPyoM-M.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DMPyoM-M.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.Cbm7nQKK.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.Cbm7nQKK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.CKmZjP_a.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.zlrdNFtH.js +0 -13
- package/build/client/_app/immutable/nodes/2.zlrdNFtH.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.zlrdNFtH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.BgLpGnzb.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.BgLpGnzb.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.Avc1-gVb.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.Avc1-gVb.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.Dw2wEssJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.Dw2wEssJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.DwKZjoBg.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DwKZjoBg.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.ZUAI6g5E.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.ZUAI6g5E.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.I_KGXPwB.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.I_KGXPwB.js.gz +0 -0
- package/build/server/chunks/_page.svelte-tBuIq8Pg.js +0 -159
- package/build/server/chunks/_page.svelte-tBuIq8Pg.js.map +0 -1
- package/build/server/chunks/_server.ts-BWVlO8iV.js.map +0 -1
- package/build/server/chunks/_server.ts-BevnuePu.js.map +0 -1
- package/build/server/chunks/_server.ts-CA5KUENM.js.map +0 -1
- package/build/server/chunks/_server.ts-CC2K8-L2.js.map +0 -1
- package/build/server/chunks/_server.ts-CD7JP3fz.js.map +0 -1
- package/build/server/chunks/_server.ts-D0zRDSx0.js.map +0 -1
- package/build/server/chunks/_server.ts-Dp-hXW_I.js.map +0 -1
- package/build/server/chunks/_server.ts-VzDcFFgy.js.map +0 -1
- package/build/server/chunks/library-apns-Dl3iRE2h.js.map +0 -1
- package/build/server/chunks/pending-requests-C9p57WoU.js.map +0 -1
- package/build/server/chunks/pty-manager-ZqXqa-6A.js.map +0 -1
|
@@ -13,9 +13,11 @@ import Database from 'better-sqlite3';
|
|
|
13
13
|
import * as fs from 'fs';
|
|
14
14
|
import * as path from 'path';
|
|
15
15
|
|
|
16
|
+
import { shooterDataDir } from '../utils/shooter-home.js';
|
|
17
|
+
|
|
16
18
|
// ── Constants ────────────────────────────────────────────────────────
|
|
17
19
|
|
|
18
|
-
const DB_DIR =
|
|
20
|
+
const DB_DIR = shooterDataDir();
|
|
19
21
|
const DB_PATH = path.join(DB_DIR, 'shooter.db');
|
|
20
22
|
|
|
21
23
|
// ── Snake/Camel Conversion ───────────────────────────────────────────
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { homedir } from 'os';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The Shooter data directory — the SQLite DB and engine/permission state live here.
|
|
6
|
+
*
|
|
7
|
+
* Honors `SHOOTER_HOME` so an isolated instance (a test server, or a second server run alongside
|
|
8
|
+
* the user's daemon) keeps its DB/state separate from the default `~/.shooter` instead of sharing
|
|
9
|
+
* it (which would let one server's `reconnectAll()` adopt the other's live terminals). This matches
|
|
10
|
+
* the CLI (`bin/shooter.cjs`) and the env loader (`env.ts`), which already treat `SHOOTER_HOME` as
|
|
11
|
+
* the data dir. When unset, falls back to `~/.shooter`.
|
|
12
|
+
*/
|
|
13
|
+
export function shooterDataDir(): string {
|
|
14
|
+
const override = process.env.SHOOTER_HOME?.trim();
|
|
15
|
+
return override && override.length > 0 ? override : join(homedir(), '.shooter');
|
|
16
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Viewer-presence store: "is someone actually watching" (foreground) vs "away".
|
|
2
|
+
//
|
|
3
|
+
// Why this exists: the phone-resident autonomous loop holds a PERSISTENT /ws/events
|
|
4
|
+
// connection to run. So raw WebSocket-connection count no longer means "the user is
|
|
5
|
+
// watching" — it's always > 0. The autopilot push decision must instead key on whether a
|
|
6
|
+
// viewer is FOREGROUNDED (heartbeat within TTL), reported via POST /api/presence.
|
|
7
|
+
//
|
|
8
|
+
// globalThis singleton so the SvelteKit route (which writes it) and the server.ts engine
|
|
9
|
+
// (which reads it) share one instance across the dual module graph — same pattern as the
|
|
10
|
+
// ws ticket store and the event-listener registry.
|
|
11
|
+
|
|
12
|
+
const PRESENCE_TTL_MS = 45_000;
|
|
13
|
+
const KEY = '__shooter_presence';
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line no-restricted-syntax -- internal singleton shape, never exported
|
|
16
|
+
interface PresenceRecord {
|
|
17
|
+
everReported: boolean;
|
|
18
|
+
lastForegroundAt: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** True once any client has ever reported presence (used for backward-compatible fallback). */
|
|
22
|
+
export function hasEverReported(): boolean {
|
|
23
|
+
return store().everReported;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** True when a viewer reported `foreground` within the TTL window. */
|
|
27
|
+
export function isViewerPresent(
|
|
28
|
+
now: number = Date.now(),
|
|
29
|
+
ttlMs: number = PRESENCE_TTL_MS
|
|
30
|
+
): boolean {
|
|
31
|
+
return now - store().lastForegroundAt < ttlMs;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Record a presence heartbeat. `foreground` marks the viewer as actively watching (now);
|
|
36
|
+
* `background` marks them away immediately (so push resumes without waiting out the TTL).
|
|
37
|
+
*/
|
|
38
|
+
export function reportPresence(state: 'background' | 'foreground', now: number = Date.now()): void {
|
|
39
|
+
const s = store();
|
|
40
|
+
s.everReported = true;
|
|
41
|
+
s.lastForegroundAt = state === 'foreground' ? now : 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function store(): PresenceRecord {
|
|
45
|
+
const g = globalThis as Record<string, unknown>;
|
|
46
|
+
if (!g[KEY]) {
|
|
47
|
+
g[KEY] = { everReported: false, lastForegroundAt: 0 };
|
|
48
|
+
}
|
|
49
|
+
return g[KEY] as PresenceRecord;
|
|
50
|
+
}
|
|
@@ -15,6 +15,16 @@ export interface AutopilotState {
|
|
|
15
15
|
/** Per-session autopilot lifecycle state. */
|
|
16
16
|
export type AutopilotStatus = 'error' | 'idle' | 'running';
|
|
17
17
|
|
|
18
|
+
/** Verdict from guardCommand() — whether a concrete command is safe to write to the PTY. */
|
|
19
|
+
export interface CommandVerdict {
|
|
20
|
+
/** The trimmed command (echoed back for convenience). */
|
|
21
|
+
command: string;
|
|
22
|
+
/** Human-readable reason for the verdict. */
|
|
23
|
+
reason: string;
|
|
24
|
+
/** True when the command passed all guards and may be injected. */
|
|
25
|
+
safe: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
/** Result from mergeNextStepConsensus(). */
|
|
19
29
|
export interface ConsensusResult {
|
|
20
30
|
/** Number of agent lists passed in. */
|
|
@@ -25,6 +35,61 @@ export interface ConsensusResult {
|
|
|
25
35
|
steps: NextStep[];
|
|
26
36
|
}
|
|
27
37
|
|
|
38
|
+
/** A record of one autonomous-loop decision, surfaced in the dashboard panel. */
|
|
39
|
+
export interface DriverAction {
|
|
40
|
+
/** ms timestamp of the action. */
|
|
41
|
+
at: number;
|
|
42
|
+
/** The command injected, or a short reason it was skipped / failed. */
|
|
43
|
+
detail: string;
|
|
44
|
+
/** What happened. */
|
|
45
|
+
kind: DriverActionKind;
|
|
46
|
+
/** The terminal acted on. */
|
|
47
|
+
terminalId: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Outcome of one driver evaluation. */
|
|
51
|
+
export type DriverActionKind = 'error' | 'injected' | 'skipped';
|
|
52
|
+
|
|
53
|
+
/** Decision from decideInjection() — the gate deciding whether to auto-act. */
|
|
54
|
+
export interface GateDecision {
|
|
55
|
+
/** True when all safety gates pass and the loop should produce + inject a command. */
|
|
56
|
+
act: boolean;
|
|
57
|
+
/** Human-readable reason (always set, for logging + the phone UI). */
|
|
58
|
+
reason: string;
|
|
59
|
+
/** The consensus step being acted on (present when act is true). */
|
|
60
|
+
step?: NextStep;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Tunable thresholds for the auto-inject safety gate. */
|
|
64
|
+
export interface InjectionPolicy {
|
|
65
|
+
/** Suppress injection within this many ms of observed human / output activity. */
|
|
66
|
+
humanGraceMs: number;
|
|
67
|
+
/** Minimum confidence of the top consensus step required to inject. */
|
|
68
|
+
injectConfidence: number;
|
|
69
|
+
/** Stop auto-injecting a terminal after this many consecutive actions without progress. */
|
|
70
|
+
maxAutoActions: number;
|
|
71
|
+
/** Minimum gap in ms between injections into the same terminal. */
|
|
72
|
+
minIntervalMs: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Per-terminal snapshot the driver passes to decideInjection(). */
|
|
76
|
+
export interface InjectionState {
|
|
77
|
+
/** Consecutive auto-injections without a human touch or successful tool completion. */
|
|
78
|
+
autoActionCount: number;
|
|
79
|
+
/** True only for terminals Shooter created (POST /api/terminals); external sessions are read-only. */
|
|
80
|
+
isManaged: boolean;
|
|
81
|
+
/** Normalized text of the last consensus step acted on (dedup guard). */
|
|
82
|
+
lastActedStep: null | string;
|
|
83
|
+
/** ms timestamp of the last observed human input / terminal output activity. */
|
|
84
|
+
lastActivityAt: number;
|
|
85
|
+
/** The most recent WireShooterEvent type seen for this terminal. */
|
|
86
|
+
lastEventType: string;
|
|
87
|
+
/** ms timestamp of the last command injection into this terminal. */
|
|
88
|
+
lastInjectedAt: number;
|
|
89
|
+
/** The terminal id. */
|
|
90
|
+
terminalId: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
28
93
|
/** Options for mergeNextStepConsensus(). */
|
|
29
94
|
export interface MergeOptions {
|
|
30
95
|
/** Max steps taken from each agent list (default 3). */
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Set/read the per-terminal autopilot GOAL that anchors the engine's context every cycle.
|
|
2
|
+
//
|
|
3
|
+
// POST { terminalId, goal } pins the goal; GET ?terminalId=… reads it back. Like
|
|
4
|
+
// /api/autopilot, this reaches the engine via globalThis.__shooter_autopilot rather than
|
|
5
|
+
// importing it (importing would start a second event subscriber). Goals live in-memory in the
|
|
6
|
+
// engine (no file fallback): if the engine is not running there is nothing to set, so we 503.
|
|
7
|
+
|
|
8
|
+
import { validateAuth } from '$lib/modules/server/auth';
|
|
9
|
+
import { json } from '@sveltejs/kit';
|
|
10
|
+
|
|
11
|
+
import type { RequestHandler } from './$types';
|
|
12
|
+
|
|
13
|
+
function control():
|
|
14
|
+
| undefined
|
|
15
|
+
| {
|
|
16
|
+
getGoal?: (terminalId: string) => string | undefined;
|
|
17
|
+
setGoal?: (terminalId: string, goal: string) => void;
|
|
18
|
+
} {
|
|
19
|
+
return (globalThis as Record<string, unknown>).__shooter_autopilot as
|
|
20
|
+
| undefined
|
|
21
|
+
| {
|
|
22
|
+
getGoal?: (terminalId: string) => string | undefined;
|
|
23
|
+
setGoal?: (terminalId: string, goal: string) => void;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const GET: RequestHandler = ({ request, url }) => {
|
|
28
|
+
const authError = validateAuth(request);
|
|
29
|
+
if (authError) {
|
|
30
|
+
return authError;
|
|
31
|
+
}
|
|
32
|
+
const terminalId = url.searchParams.get('terminalId') ?? '';
|
|
33
|
+
if (!terminalId) {
|
|
34
|
+
return json({ error: 'terminalId query param is required' }, { status: 400 });
|
|
35
|
+
}
|
|
36
|
+
const ctrl = control();
|
|
37
|
+
if (!ctrl?.getGoal) {
|
|
38
|
+
return json({ error: 'autopilot engine not running', running: false }, { status: 503 });
|
|
39
|
+
}
|
|
40
|
+
return json({ goal: ctrl.getGoal(terminalId) ?? null, running: true });
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const POST: RequestHandler = async ({ request }) => {
|
|
44
|
+
const authError = validateAuth(request);
|
|
45
|
+
if (authError) {
|
|
46
|
+
return authError;
|
|
47
|
+
}
|
|
48
|
+
let body: { goal?: unknown; terminalId?: unknown };
|
|
49
|
+
try {
|
|
50
|
+
body = (await request.json()) as { goal?: unknown; terminalId?: unknown };
|
|
51
|
+
} catch {
|
|
52
|
+
return json({ error: 'Invalid JSON body' }, { status: 400 });
|
|
53
|
+
}
|
|
54
|
+
if (typeof body.terminalId !== 'string' || body.terminalId.length === 0) {
|
|
55
|
+
return json({ error: 'terminalId must be a non-empty string' }, { status: 400 });
|
|
56
|
+
}
|
|
57
|
+
if (typeof body.goal !== 'string') {
|
|
58
|
+
return json({ error: 'goal must be a string' }, { status: 400 });
|
|
59
|
+
}
|
|
60
|
+
if (body.goal.length > 500) {
|
|
61
|
+
// The goal is prepended to EVERY engine LLM context, so an unbounded string would permanently
|
|
62
|
+
// bloat (and could dominate) the prompt. Cap it like the summaries route caps its fields.
|
|
63
|
+
return json({ error: 'goal must be 500 characters or fewer' }, { status: 400 });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const ctrl = control();
|
|
67
|
+
if (!ctrl?.setGoal) {
|
|
68
|
+
return json({ error: 'autopilot engine not running', running: false }, { status: 503 });
|
|
69
|
+
}
|
|
70
|
+
ctrl.setGoal(body.terminalId, body.goal);
|
|
71
|
+
return json({ goal: body.goal.trim() || null, running: true, terminalId: body.terminalId });
|
|
72
|
+
};
|
|
@@ -112,10 +112,16 @@ export const POST: RequestHandler = async ({ request }) => {
|
|
|
112
112
|
// For Bearer-token providers, only inject the header when the key is non-empty
|
|
113
113
|
// to avoid sending a malformed `Authorization: Bearer ` to the upstream.
|
|
114
114
|
if (provider === 'anthropic') {
|
|
115
|
-
|
|
115
|
+
// Only inject the key header when non-empty — sending `x-api-key: ` (empty) is a malformed
|
|
116
|
+
// header that the upstream rejects with a confusing error instead of a clean 401.
|
|
117
|
+
if (apiKeyEnv.anthropic) {
|
|
118
|
+
forwardHeaders['x-api-key'] = apiKeyEnv.anthropic;
|
|
119
|
+
}
|
|
116
120
|
forwardHeaders['anthropic-version'] = forwardHeaders['anthropic-version'] ?? '2023-06-01';
|
|
117
121
|
} else if (provider === 'google-ai') {
|
|
118
|
-
|
|
122
|
+
if (apiKeyEnv['google-ai']) {
|
|
123
|
+
forwardHeaders['x-goog-api-key'] = apiKeyEnv['google-ai'];
|
|
124
|
+
}
|
|
119
125
|
} else if (provider === 'openai') {
|
|
120
126
|
if (apiKeyEnv.openai) {
|
|
121
127
|
forwardHeaders.Authorization = `Bearer ${apiKeyEnv.openai}`;
|
|
@@ -173,13 +173,8 @@ function intelligentNotificationFilter(
|
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
return {
|
|
179
|
-
reason: 'Stop hook completion notification - session finished',
|
|
180
|
-
send: true,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
176
|
+
// (Removed a dead `source === 'stop-hook'` branch: the notifier emits
|
|
177
|
+
// 'shooter-completion-detector', never 'stop-hook', and the default below already allows it.)
|
|
183
178
|
|
|
184
179
|
// Filter out only very specific spam patterns to be less restrictive
|
|
185
180
|
const spamPatterns = [
|
|
@@ -263,18 +258,28 @@ function isDuplicateNotification(
|
|
|
263
258
|
}
|
|
264
259
|
}
|
|
265
260
|
|
|
266
|
-
//
|
|
267
|
-
//
|
|
261
|
+
// RESERVE the slot atomically (check-and-set): a second concurrent request with the same key now
|
|
262
|
+
// sees it as a duplicate before either has delivered, closing the TOCTOU window that let two
|
|
263
|
+
// identical pushes through. The delivery path RELEASES the slot (releaseNotification) if the send
|
|
264
|
+
// fails, so a legitimate retry is not blocked — this replaces the old record-only-on-success
|
|
265
|
+
// scheme while still avoiding cache poisoning on failure.
|
|
266
|
+
notificationCache.set(key, now);
|
|
268
267
|
return false;
|
|
269
268
|
}
|
|
270
269
|
|
|
271
|
-
|
|
272
|
-
function recordNotification(title: string, message: string, data?: NotificationData): void {
|
|
270
|
+
function notificationKey(title: string, message: string, data?: NotificationData): string {
|
|
273
271
|
const dataRecord = data as (NotificationData & { dedupKey?: string }) | undefined;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
return dataRecord?.dedupKey ?? `${title}|${message}|${data?.category || 'unknown'}`;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** Refresh a reserved dedup key after successful delivery (keeps the window measured from send). */
|
|
276
|
+
function recordNotification(title: string, message: string, data?: NotificationData): void {
|
|
277
|
+
notificationCache.set(notificationKey(title, message, data), Date.now());
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** Release a reserved dedup key when delivery failed, so a legitimate retry is not blocked. */
|
|
281
|
+
function releaseNotification(title: string, message: string, data?: NotificationData): void {
|
|
282
|
+
notificationCache.delete(notificationKey(title, message, data));
|
|
278
283
|
}
|
|
279
284
|
|
|
280
285
|
// TODO(refactor): extract body parsing, filtering, and platform routing into
|
|
@@ -501,6 +506,7 @@ export const POST: RequestHandler = async ({ request }) => {
|
|
|
501
506
|
});
|
|
502
507
|
} else {
|
|
503
508
|
console.error(`[notify] FCM delivery failed: ${fcmResult.error}`);
|
|
509
|
+
releaseNotification(title, message, data); // free the reserved dedup slot for a retry
|
|
504
510
|
|
|
505
511
|
addNotification(
|
|
506
512
|
buildNotificationRecord(
|
|
@@ -581,6 +587,7 @@ export const POST: RequestHandler = async ({ request }) => {
|
|
|
581
587
|
} catch (notificationError) {
|
|
582
588
|
const notifErrMsg = toErrorMessage(notificationError);
|
|
583
589
|
console.error(`[notify] APNs delivery failed: ${notifErrMsg}`);
|
|
590
|
+
releaseNotification(title, message, data); // free the reserved dedup slot for a retry
|
|
584
591
|
|
|
585
592
|
addNotification(
|
|
586
593
|
buildNotificationRecord(canonicalRequestId, title, message, 'failed', data, notifErrMsg)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Viewer-presence endpoint. The dashboard / phone posts a heartbeat so the autopilot
|
|
2
|
+
// engine can push only when the user is AWAY (not foregrounded) — see presence-store.ts.
|
|
3
|
+
// Distinct from raw WebSocket connection count, which the autonomous loop keeps open.
|
|
4
|
+
|
|
5
|
+
import { validateAuth } from '$lib/modules/server/auth';
|
|
6
|
+
import {
|
|
7
|
+
hasEverReported,
|
|
8
|
+
isViewerPresent,
|
|
9
|
+
reportPresence,
|
|
10
|
+
} from '$lib/modules/server/ws/presence-store';
|
|
11
|
+
import { json } from '@sveltejs/kit';
|
|
12
|
+
|
|
13
|
+
import type { RequestHandler } from './$types';
|
|
14
|
+
|
|
15
|
+
export const GET: RequestHandler = ({ request }) => {
|
|
16
|
+
const authError = validateAuth(request);
|
|
17
|
+
if (authError) {
|
|
18
|
+
return authError;
|
|
19
|
+
}
|
|
20
|
+
return json({ everReported: hasEverReported(), present: isViewerPresent() });
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const POST: RequestHandler = async ({ request }) => {
|
|
24
|
+
const authError = validateAuth(request);
|
|
25
|
+
if (authError) {
|
|
26
|
+
return authError;
|
|
27
|
+
}
|
|
28
|
+
let body: { state?: unknown };
|
|
29
|
+
try {
|
|
30
|
+
body = (await request.json()) as { state?: unknown };
|
|
31
|
+
} catch {
|
|
32
|
+
return json({ error: 'Invalid JSON body' }, { status: 400 });
|
|
33
|
+
}
|
|
34
|
+
if (body.state !== 'foreground' && body.state !== 'background') {
|
|
35
|
+
return json({ error: "state must be 'foreground' or 'background'" }, { status: 400 });
|
|
36
|
+
}
|
|
37
|
+
reportPresence(body.state);
|
|
38
|
+
return json({ everReported: hasEverReported(), present: isViewerPresent(), state: body.state });
|
|
39
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
// GET /api/ws-status —
|
|
1
|
+
// GET /api/ws-status — WebSocket presence for the notifier's push decision.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
3
|
+
// `connectedClients` counts ALL /ws/events clients — but the phone-resident autonomous loop holds
|
|
4
|
+
// a PERSISTENT events connection, so that count is ~always > 0 and is NO LONGER a valid "someone is
|
|
5
|
+
// watching" signal (using it suppressed every phone push while autopilot ran). `viewerPresent` is
|
|
6
|
+
// the correct signal: a viewer reported `foreground` within the heartbeat TTL (POST /api/presence) —
|
|
7
|
+
// the same signal the autopilot engine uses to gate its pushes. The notifier prefers viewerPresent.
|
|
7
8
|
|
|
8
9
|
import { validateAuth } from '$lib/modules/server/auth';
|
|
10
|
+
import { isViewerPresent } from '$lib/modules/server/ws/presence-store';
|
|
9
11
|
import { getConnectedClientCount } from '$lib/modules/server/ws/server';
|
|
10
12
|
import { json } from '@sveltejs/kit';
|
|
11
13
|
|
|
@@ -21,5 +23,6 @@ export const GET: RequestHandler = ({ request }) => {
|
|
|
21
23
|
|
|
22
24
|
return json({
|
|
23
25
|
connectedClients: getConnectedClientCount(),
|
|
26
|
+
viewerPresent: isViewerPresent(),
|
|
24
27
|
});
|
|
25
28
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.autopilot-panel.svelte-ziwu2n{background:var(--component-bg, #1a1a1a);border:1px solid var(--border, #2e2e2e);border-radius:var(--radius-lg, 8px);padding:var(--space-4, 16px);margin-bottom:var(--space-4, 16px)}.panel-header.svelte-ziwu2n{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-3, 12px)}.panel-title-row.svelte-ziwu2n{display:flex;align-items:center;gap:var(--space-2, 8px)}.panel-title.svelte-ziwu2n{color:var(--text-primary, #ededed);font-size:var(--text-sm, 13px);font-weight:600;letter-spacing:.04em;text-transform:uppercase}@keyframes svelte-ziwu2n-pulse{0%,to{opacity:1}50%{opacity:.4}}.status-dot-active.svelte-ziwu2n{animation:svelte-ziwu2n-pulse 2s ease-in-out infinite;background:var(--ds-green-700, #16a34a);border-radius:50%;display:inline-block;flex-shrink:0;height:7px;width:7px}.toggle-btn.svelte-ziwu2n{border:1px solid transparent;border-radius:var(--radius-full, 9999px);cursor:pointer;font-size:var(--text-xs, 12px);font-weight:600;padding:4px 14px;transition:background var(--transition-fast, .15s ease),color var(--transition-fast, .15s ease)}.toggle-btn--off.svelte-ziwu2n{background:var(--ds-green-alpha-200, rgba(22, 163, 74, .12));border-color:var(--ds-green-alpha-400, rgba(22, 163, 74, .3));color:var(--ds-green-700, #16a34a)}.toggle-btn--off.svelte-ziwu2n:hover{background:var(--ds-green-alpha-400, rgba(22, 163, 74, .2))}.toggle-btn--on.svelte-ziwu2n{background:var(--ds-gray-alpha-200, rgba(255, 255, 255, .06));border-color:var(--border, #2e2e2e);color:var(--text-secondary, #a1a1a1)}.toggle-btn--on.svelte-ziwu2n:hover{background:var(--ds-gray-alpha-300, rgba(255, 255, 255, .1));color:var(--text-primary, #ededed)}.toggle-btn.svelte-ziwu2n:focus-visible{outline:2px solid var(--ds-blue-700, #0070f3);outline-offset:2px}.panel-empty.svelte-ziwu2n{color:var(--text-tertiary, #7d7d7d);font-size:var(--text-xs, 12px);font-style:italic;margin:0}.sessions-list.svelte-ziwu2n{display:flex;flex-direction:column;gap:var(--space-3, 12px)}.session-card.svelte-ziwu2n{background:var(--bg-subtle, rgba(255, 255, 255, .02));border:1px solid var(--border-subtle, rgba(255, 255, 255, .06));border-radius:var(--radius-md, 6px);display:flex;flex-direction:column;gap:var(--space-2, 8px);padding:var(--space-3, 12px)}.session-header.svelte-ziwu2n{align-items:center;display:flex;gap:var(--space-2, 8px);justify-content:space-between}.session-name.svelte-ziwu2n{color:var(--text-primary, #ededed);flex:1;font-size:var(--text-sm, 13px);font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-status.svelte-ziwu2n{flex-shrink:0;font-size:var(--text-xs, 12px);font-weight:500}.session-status--idle.svelte-ziwu2n{color:var(--text-tertiary, #7d7d7d)}.session-summary.svelte-ziwu2n{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:var(--text-secondary, #a1a1a1);display:-webkit-box;font-size:var(--text-xs, 12px);line-clamp:2;line-height:var(--leading-normal, 1.5);margin:0;overflow:hidden}.next-steps.svelte-ziwu2n{display:flex;flex-direction:column;gap:6px}.next-steps-label.svelte-ziwu2n{color:var(--text-tertiary, #7d7d7d);font-size:var(--text-xs, 12px);font-weight:600;letter-spacing:.06em;text-transform:uppercase}.steps-list.svelte-ziwu2n{display:flex;flex-direction:column;gap:5px;list-style:none;margin:0;padding:0}.step-item.svelte-ziwu2n{align-items:baseline;display:flex;gap:8px}.step-badge.svelte-ziwu2n{align-items:center;border-radius:var(--radius-full, 9999px);cursor:default;display:inline-flex;flex-shrink:0;font-size:10px;font-weight:700;height:18px;justify-content:center;min-width:20px;padding:0 5px}.step-badge--strong.svelte-ziwu2n{background:var(--ds-green-alpha-200, rgba(22, 163, 74, .12));color:var(--ds-green-700, #16a34a)}.step-badge--medium.svelte-ziwu2n{background:var(--ds-blue-alpha-200, rgba(0, 112, 243, .12));color:var(--ds-blue-700, #0070f3)}.step-badge--weak.svelte-ziwu2n{background:var(--ds-gray-alpha-200, rgba(255, 255, 255, .06));color:var(--text-tertiary, #7d7d7d)}.step-badge--tentative.svelte-ziwu2n{background:var(--ds-amber-alpha-200, rgba(217, 119, 6, .12));color:var(--ds-amber-700, #d97706);font-style:italic}.step-text.svelte-ziwu2n{color:var(--text-secondary, #a1a1a1);font-size:var(--text-xs, 12px);line-height:var(--leading-normal, 1.5)}.last-updated.svelte-ziwu2n{color:var(--text-tertiary, #7d7d7d);font-size:10px;margin-top:2px}@keyframes svelte-1qbe2oo-pulse{0%,to{opacity:1}50%{opacity:.4}}@keyframes svelte-1qbe2oo-activity-pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.5);opacity:.7}}.card.svelte-1qbe2oo{background:var(--component-bg, #1a1a1a);border:1px solid var(--border, #2e2e2e);border-left:4px solid var(--status-color, #6b7280);border-radius:var(--radius-lg, 8px);padding:var(--space-4, 16px);display:flex;flex-direction:column;gap:var(--space-3, 12px);cursor:pointer;transition:border-color var(--transition-fast, .15s ease),background var(--transition-fast, .15s ease);color:inherit;text-align:left;width:100%}.card.svelte-1qbe2oo:hover{background:var(--component-bg-hover, #1f1f1f);border-color:var(--border-hover, #454545);border-left-color:var(--status-color, #6b7280)}.card.svelte-1qbe2oo:focus-visible{outline:2px solid var(--ds-blue-700, #0070f3);outline-offset:2px}.card-header.svelte-1qbe2oo{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2, 8px);min-width:0}.project-name.svelte-1qbe2oo{font-size:var(--text-base, 14px);font-weight:600;color:var(--text-primary, #ededed);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.status-pill{--pill-font-size: var(--text-xs, 12px);--pill-font-weight: 500;--pill-padding: 3px 10px;--pill-border-radius: var(--radius-full, 9999px);--pill-cursor: default;flex-shrink:0}.status-pill--running-active{--pill-background: var(--ds-green-100);--pill-color: var(--ds-green-700);--pill-hover-background: var(--ds-green-100);--pill-hover-color: var(--ds-green-700);animation:svelte-1qbe2oo-pulse 2s ease-in-out infinite}.status-pill--running{--pill-background: var(--ds-blue-100);--pill-color: var(--ds-blue-700);--pill-hover-background: var(--ds-blue-100);--pill-hover-color: var(--ds-blue-700)}.status-pill--idle{--pill-background: var(--ds-amber-100);--pill-color: var(--ds-amber-700);--pill-hover-background: var(--ds-amber-100);--pill-hover-color: var(--ds-amber-700)}.status-pill--exited{--pill-background: var(--ds-gray-alpha-200);--pill-color: var(--ds-gray-600);--pill-hover-background: var(--ds-gray-alpha-200);--pill-hover-color: var(--ds-gray-600)}.status-pill--error{--pill-background: var(--ds-red-100);--pill-color: var(--ds-red-700);--pill-hover-background: var(--ds-red-100);--pill-hover-color: var(--ds-red-700)}.goal-text.svelte-1qbe2oo{font-size:var(--text-sm, 13px);color:var(--text-secondary, #a1a1a1);font-style:italic;margin:0;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:var(--leading-normal, 1.5)}.summary-row.svelte-1qbe2oo{min-height:18px}.summary-text.svelte-1qbe2oo{font-size:var(--text-sm, 13px);color:var(--text-primary, #ededed);line-height:var(--leading-normal, 1.5);display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.summarizing.svelte-1qbe2oo{font-size:var(--text-xs, 12px);color:var(--ds-amber-700);font-style:italic}.summary-fallback.svelte-1qbe2oo{font-size:var(--text-xs, 12px);color:var(--text-tertiary, #7d7d7d);font-style:italic}.stats-row.svelte-1qbe2oo{display:flex;align-items:center;gap:var(--space-3, 12px);flex-wrap:wrap;min-width:0}.stat.svelte-1qbe2oo{display:inline-flex;align-items:center;gap:var(--space-1, 4px);font-size:var(--text-xs, 12px);color:var(--text-tertiary, #7d7d7d);white-space:nowrap}.stat-error.svelte-1qbe2oo{color:var(--ds-red-700)}.stat-path.svelte-1qbe2oo{font-family:var(--font-mono, monospace);overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1;text-align:right}.status-dot-active.svelte-1qbe2oo{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ds-green-700);animation:svelte-1qbe2oo-activity-pulse .6s ease-in-out infinite;flex-shrink:0}.status-dot-static.svelte-1qbe2oo{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ds-gray-600, #878787);flex-shrink:0}@media(max-width:768px){.card.svelte-1qbe2oo{padding:10px 12px}.stats-row.svelte-1qbe2oo{flex-wrap:wrap;gap:4px}}@media(max-width:480px){.card.svelte-1qbe2oo{padding:8px 10px}.goal-text.svelte-1qbe2oo{-webkit-line-clamp:1;line-clamp:1}}.section.svelte-14sxgtb{display:flex;flex-direction:column;gap:var(--space-3, 12px);margin-bottom:var(--space-6, 24px)}.section-label.svelte-14sxgtb{font-size:var(--text-xs, 12px);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--text-secondary, #a1a1a1);margin:0 0 var(--space-1, 4px) 0}.stats-bar.svelte-1uha8ag{display:flex;gap:10px;margin-top:var(--space-4)}.stat-chip.svelte-1uha8ag{display:flex;align-items:center;gap:6px;background:#ffffff0a;border:1px solid rgba(255,255,255,.06);border-radius:20px;padding:6px 14px}.stat-chip-active.svelte-1uha8ag{background:var(--ds-green-alpha-200);border-color:var(--ds-green-alpha-400)}.stat-value.svelte-1uha8ag{font-weight:700;font-size:.9rem;color:#f0f0f0}.stat-chip-active.svelte-1uha8ag .stat-value:where(.svelte-1uha8ag){color:var(--ds-green-500)}.stat-label.svelte-1uha8ag{font-size:.78rem;color:#a3a3a3cc}.dashboard-section.svelte-1uha8ag{margin-bottom:var(--space-6)}.section-label.svelte-1uha8ag{font-size:var(--text-xs, 12px);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--text-secondary);margin-bottom:var(--space-3)}.projects-container.svelte-1uha8ag{display:flex;flex-direction:column;gap:var(--space-3);animation:fadeIn .2s ease}@media(max-width:768px){.stats-bar.svelte-1uha8ag{flex-wrap:wrap}}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as y}from"./gQJcRhou.js";import"./BDcFu3l7.js";const k="https://unpkg.com/@juspay/neurolink@9.61.1/dist/browser/neurolink.min.js",b={"https://api.anthropic.com/":"anthropic","https://api.mistral.ai/":"mistral","https://api.openai.com/":"openai","https://generativelanguage.googleapis.com/":"google-ai"};let f=!1;function O(){if(f||typeof globalThis>"u")return;f=!0;const r=globalThis.fetch.bind(globalThis);globalThis.fetch=async(e,o)=>{const i=typeof e=="string"?e:e instanceof URL?e.href:e.url,n=Object.entries(b).find(([t])=>i.startsWith(t))?.[1];if(!n)return r(e,o);const c={},s=o?.headers??(e instanceof Request?e.headers:{}),d=s instanceof Headers?s:Object.entries(s);for(const[t,g]of d){const p=t.toLowerCase();p!=="x-api-key"&&p!=="authorization"&&(c[t]=g)}let a;try{a=JSON.parse(o?.body??(e instanceof Request?await e.text():"{}"))}catch{a={}}const l=y(),h={"Content-Type":"application/json"};return l&&(h.Authorization=`Bearer ${l}`),r("/api/neurolink-proxy",{body:JSON.stringify({body:a,headers:c,provider:n,url:i}),headers:h,method:"POST"})}}export{k as N,O as i};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{bv as Te,v as Ve,s as j,g as P,b as N,P as oe,bw as At}from"./DWmC0QM7.js";class pe{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Le{constructor(t,n){this.status=t,this.location=n}}class je extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Et(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function kt(e){return e.split("%25").map(decodeURI).join("%25")}function Rt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ye({href:e}){return e.split("#")[0]}function St(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const It=new TextDecoder;function Ut(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Tt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&z.delete(Pe(e)),Tt(e,t));const z=new Map;function Lt(e,t){const n=Pe(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&z.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=Ut(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function jt(e,t,n){if(z.size>0){const r=Pe(e,n),a=z.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);z.delete(r)}}return window.fetch(t,n)}function Pe(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${St(...a)}"]`}return r}const Pt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Nt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${xt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((i,l)=>{if(l%2){if(i.startsWith("x+"))return ve(String.fromCharCode(parseInt(i.slice(2),16)));if(i.startsWith("u+"))return ve(String.fromCharCode(...i.slice(2).split("-").map(g=>parseInt(g,16))));const u=Pt.exec(i),[,d,p,h,f]=u;return t.push({name:h,matcher:f,optional:!!d,rest:!!p,chained:p?l===1&&o[0]==="":!1}),p?"([^]*?)":d?"([^/]*)?":"([^/]+?)"}return ve(i)}).join("")}).join("")}/?$`),params:t}}function Ot(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function xt(e){return e.slice(1).split("/").filter(Ot)}function Ct(e,t,n){const r={},a=e.slice(1),s=a.filter(c=>c!==void 0);let o=0;for(let c=0;c<t.length;c+=1){const i=t[c];let l=a[c-o];if(i.chained&&i.rest&&o&&(l=a.slice(c-o,c+1).filter(u=>u).join("/"),o=0),l===void 0)if(i.rest)l="";else continue;if(!i.matcher||n[i.matcher](l)){r[i.name]=l;const u=t[c+1],d=a[c+1];u&&!u.rest&&u.optional&&d&&i.chained&&(o=0),!u&&!d&&Object.keys(r).length===s.length&&(o=0);continue}if(i.optional&&i.chained){o++;continue}return}if(!o)return r}function ve(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Dt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([c,[i,l,u]])=>{const{pattern:d,params:p}=Nt(c),h={id:c,exec:f=>{const g=d.exec(f);if(g)return Ct(g,p,r)},errors:[1,...u||[]].map(f=>e[f]),layouts:[0,...l||[]].map(o),leaf:s(i)};return h.errors.length=h.layouts.length=Math.max(h.errors.length,h.layouts.length),h});function s(c){const i=c<0;return i&&(c=~c),[i,e[c]]}function o(c){return c===void 0?c:[a.has(c),e[c]]}}function Qe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function qe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const U=globalThis.__sveltekit_mj96ev?.base??"",$t=globalThis.__sveltekit_mj96ev?.assets??U??"",Bt="1781366107899",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",Ft="sveltekit:pageurl",q="sveltekit:history",Q="sveltekit:navigation",B={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},re=location.origin;function Ne(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function M(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ye={...B,"":B.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function at(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Ee(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const c=location.hash.split("#")[1]||"/";r.hash=`#${c}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||_e(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=r?.origin===re&&e.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function se(e){let t=null,n=null,r=null,a=null,s=null,o=null,c=e;for(;c&&c!==document.documentElement;)r===null&&(r=V(c,"preload-code")),a===null&&(a=V(c,"preload-data")),t===null&&(t=V(c,"keepfocus")),n===null&&(n=V(c,"noscroll")),s===null&&(s=V(c,"reload")),o===null&&(o=V(c,"replacestate")),c=rt(c);function i(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ye[r??"off"],preload_data:Ye[a??"off"],keepfocus:i(t),noscroll:i(n),reload:i(s),replace_state:i(o)}}function Ge(e){const t=Te(e);let n=!0;function r(){n=!0,t.update(o=>o)}function a(o){n=!1,t.set(o)}function s(o){let c;return t.subscribe(i=>{(c===void 0||n&&i!==c)&&o(c=i)})}return{notify:r,set:a,subscribe:s}}const ot={v:()=>{}};function Mt(){const{set:e,subscribe:t}=Te(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${$t}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Bt;return o&&(e(!0),ot.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:r}}function _e(e,t,n){return e.origin!==re||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Pn(e){}const Vt=-1,qt=-2,Yt=-3,Gt=-4,Kt=-5,Wt=-6,Ht=-7,st=2**32-1,ke=st-1;function Xt(e){return!(!Number.isInteger(e)||e<0||e>ke)}function zt(e){return!(!Number.isInteger(e)||e<0||e>st)}function Jt(e){return Uint8Array.fromBase64(e).buffer}function Zt(e){return Uint8Array.from(Buffer.from(e,"base64")).buffer}function Qt(e){const t=atob(e),n=t.length,r=new Uint8Array(n);for(let a=0;a<n;a++)r[a]=t.charCodeAt(a);return r.buffer}const en=typeof Uint8Array.fromBase64=="function",tn=typeof process=="object"&&process.versions?.node!==void 0,nn=en?Jt:tn?Zt:Qt;function rn(e,t){if(typeof e=="number")return s(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);let a=null;function s(o,c=!1){if(o===Vt)return;if(o===Yt)return NaN;if(o===Gt)return 1/0;if(o===Kt)return-1/0;if(o===Wt)return-0;if(c||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const i=n[o];if(!i||typeof i!="object")r[o]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const l=i[0],u=t&&Object.hasOwn(t,l)?t[l]:void 0;if(u){let d=i[1];if(typeof d!="number"&&(d=n.push(i[1])-1),a??=new Set,a.has(d))throw new Error("Invalid circular reference");return a.add(d),r[o]=u(s(d)),a.delete(d),r[o]}switch(l){case"Date":r[o]=new Date(i[1]);break;case"Set":const d=new Set;r[o]=d;for(let f=1;f<i.length;f+=1)d.add(s(i[f]));break;case"Map":const p=new Map;r[o]=p;for(let f=1;f<i.length;f+=2)p.set(s(i[f]),s(i[f+1]));break;case"RegExp":r[o]=new RegExp(i[1],i[2]);break;case"Object":{const f=i[1];if(typeof n[f]=="object"&&n[f][0]!=="BigInt")throw new Error("Invalid input");r[o]=Object(s(f));break}case"BigInt":r[o]=BigInt(i[1]);break;case"null":const h=Object.create(null);r[o]=h;for(let f=1;f<i.length;f+=2){if(i[f]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");h[i[f]]=s(i[f+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(n[i[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const f=globalThis[l],g=s(i[1]);r[o]=i[2]!==void 0?new f(g,i[2],i[3]):new f(g);break}case"ArrayBuffer":{const f=i[1];if(typeof f!="string")throw new Error("Invalid ArrayBuffer encoding");const g=nn(f);r[o]=g;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const f=l.slice(9);r[o]=Temporal[f].from(i[1]);break}case"URL":{const f=new URL(i[1]);r[o]=f;break}case"URLSearchParams":{const f=new URLSearchParams(i[1]);r[o]=f;break}default:throw new Error(`Unknown type ${l}`)}}else if(i[0]===Ht){const l=i[1];if(!zt(l))throw new Error("Invalid input");const u=[];r[o]=u,u[ke]=void 0,delete u[ke];for(let d=2;d<i.length;d+=2){const p=i[d];if(!Xt(p)||p>=l)throw new Error("Invalid input");u[p]=s(i[d+1])}u.length=l}else{const l=new Array(i.length);r[o]=l;for(let u=0;u<i.length;u+=1){const d=i[u];d!==qt&&(l[u]=s(d))}}else{const l={};r[o]=l;for(const u of Object.keys(i)){if(u==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=i[u];l[u]=s(d)}}return r[o]}return s(0)}const it=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...it];const an=new Set([...it]);[...an];function on(e){return e.filter(t=>t!=null)}const sn="x-sveltekit-invalidated",cn="x-sveltekit-trailing-slash";function ie(e){return e instanceof pe||e instanceof je?e.status:500}function ln(e){return e instanceof je?e.text:"Internal Error"}let S,ee,be;const fn=Ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ve.toString()),Ke="a:";fn?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ke)},ee={current:null},be={current:!1}):(S=new class{#e=j({});get data(){return P(this.#e)}set data(t){N(this.#e,t)}#t=j(null);get form(){return P(this.#t)}set form(t){N(this.#t,t)}#n=j(null);get error(){return P(this.#n)}set error(t){N(this.#n,t)}#r=j({});get params(){return P(this.#r)}set params(t){N(this.#r,t)}#a=j({id:null});get route(){return P(this.#a)}set route(t){N(this.#a,t)}#o=j({});get state(){return P(this.#o)}set state(t){N(this.#o,t)}#s=j(-1);get status(){return P(this.#s)}set status(t){N(this.#s,t)}#i=j(new URL(Ke));get url(){return P(this.#i)}set url(t){N(this.#i,t)}},ee=new class{#e=j(null);get current(){return P(this.#e)}set current(t){N(this.#e,t)}},be=new class{#e=j(!1);get current(){return P(this.#e)}set current(t){N(this.#e,t)}},ot.v=()=>be.current=!0);function un(e){Object.assign(S,e)}const dn="/__data.json",hn=".html__data.json";function pn(e){return e.endsWith(".html")?e.replace(/\.html$/,hn):e.replace(/\/$/,"")+dn}const _n=new Set(["icon","shortcut icon","apple-touch-icon"]);let H=null;const D=Qe(tt)??{},te=Qe(et)??{},C={url:Ge({}),page:Ge({}),navigating:Te(null),updated:Mt()};function Oe(e){D[e]=M()}function gn(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;te[n];)delete te[n],n+=1}function K(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ct(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(U||"/");e&&await e.update()}}function We(){}let xe,Re,ce,x,Se,A;const le=[],fe=[];let L=null;function Ie(){L?.fork?.then(e=>e?.discard()),L=null}const ae=new Map,lt=new Set,mn=new Set,J=new Set;let w={branch:[],error:null,url:null},Ce=!1,ue=!1,He=!0,ne=!1,X=!1,ft=!1,De=!1,ut,R,I,F;const Z=new Set,Xe=new Map;async function Cn(e,t,n){globalThis.__sveltekit_mj96ev?.data&&globalThis.__sveltekit_mj96ev.data,document.URL!==location.href&&(location.href=location.href),A=e,await e.hooks.init?.(),xe=Dt(e),x=document.documentElement,Se=t,Re=e.nodes[0],ce=e.nodes[1],Re(),ce(),R=history.state?.[q],I=history.state?.[Q],R||(R=I=Date.now(),history.replaceState({...history.state,[q]:R,[Q]:I},""));const r=D[R];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await Un(Se,n)):(await Y({type:"enter",url:Ne(A.hash?Ln(new URL(location.href)):location.href),replace_state:!0}),a()),In()}function wn(){le.length=0,De=!1}function dt(e){fe.some(t=>t?.snapshot)&&(te[e]=fe.map(t=>t?.snapshot?.capture()))}function ht(e){te[e]?.forEach((t,n)=>{fe[n]?.snapshot?.restore(t)})}function ze(){Oe(R),qe(tt,D),dt(I),qe(et,te)}async function pt(e,t,n,r){let a;t.invalidateAll&&Ie(),await Y({type:"goto",url:Ne(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(De=!0,a=[...Xe.keys()]),t.invalidate&&t.invalidate.forEach(Sn)}}),t.invalidateAll&&oe().then(oe).then(()=>{Xe.forEach(({resource:s},o)=>{a?.includes(o)&&s.refresh?.()})})}async function yn(e){if(e.id!==L?.id){Ie();const t={};Z.add(t),L={id:e.id,token:t,promise:gt({...e,preload:t}).then(n=>(Z.delete(t),n.type==="loaded"&&n.state.error&&Ie(),n)),fork:null}}return L.promise}async function Ae(e){const t=(await me(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function _t(e,t,n){const r={params:w.params,route:{id:w.route?.id??null},url:new URL(location.href)};w={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(S,e.props.page),ut=new A.root({target:t,props:{...e.props,stores:C,components:fe},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),ht(I),n){const s={from:null,to:{...r,scroll:D[R]??M()},willUnload:!1,type:"enter",complete:Promise.resolve()};J.forEach(o=>o(s))}ue=!0}async function de({url:e,params:t,branch:n,errors:r,status:a,error:s,route:o,form:c}){let i="never";if(U&&(e.pathname===U||e.pathname===U+"/"))i="always";else for(const f of n)f?.slash!==void 0&&(i=f.slash);e.pathname=Et(e.pathname,i),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:s,route:o},props:{constructors:on(n).map(f=>f.node.component),page:Me(S)}};c!==void 0&&(l.props.form=c);let u={},d=!S,p=0;for(let f=0;f<Math.max(n.length,w.branch.length);f+=1){const g=n[f],b=w.branch[f];g?.data!==b?.data&&(d=!0),g&&(u={...u,...g.data},d&&(l.props[`data_${p}`]=u),p+=1)}return(!w.url||e.href!==w.url.href||w.error!==s||c!==void 0&&c!==S.form||d)&&(l.props.page={error:s,params:t,route:{id:o?.id??null},state:{},status:a,url:new URL(e),form:c??null,data:d?u:S.data}),l}async function $e({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){let o=null;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},i=await e();return{node:i,loader:e,server:s,universal:i.universal?.load?{type:"data",data:o,uses:c}:null,data:o??s?.data??null,slash:i.universal?.trailingSlash??s?.slash}}function vn(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=ue?jt(r,a.href,t):Lt(r,t);return{resolved:a,promise:s}}function Je(e,t,n,r,a,s){if(De)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==w.params[o])return!0;for(const o of a.dependencies)if(le.some(c=>c(new URL(o))))return!0;return!1}function Be(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function bn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function Ze({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Me(S),constructors:[]}}}async function gt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(L?.id===e)return Z.delete(L.token),L.promise;const{errors:o,layouts:c,leaf:i}=a,l=[...c,i];o.forEach(m=>m?.().catch(()=>{})),l.forEach(m=>m?.[1]().catch(()=>{}));let u=null;const d=w.url?e!==he(w.url):!1,p=w.route?a.id!==w.route.id:!1,h=bn(w.url,n);let f=!1;{const m=l.map((y,E)=>{const k=w.branch[E],v=!!y?.[0]&&(k?.loader!==y[1]||Je(f,p,d,h,k.server?.uses,r));return v&&(f=!0),v});if(m.some(Boolean)){try{u=await yt(n,m)}catch(y){const E=await G(y,{url:n,params:r,route:{id:e}});return Z.has(s)?Ze({error:E,url:n,params:r,route:a}):ge({status:ie(y),error:E,url:n,route:a})}if(u.type==="redirect")return u}}const g=u?.nodes;let b=!1;const _=l.map(async(m,y)=>{if(!m)return;const E=w.branch[y],k=g?.[y];if((!k||k.type==="skip")&&m[1]===E?.loader&&!Je(b,p,d,h,E.universal?.uses,r))return E;if(b=!0,k?.type==="error")throw k;return $e({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<y;$+=1)Object.assign(O,(await _[$])?.data);return O},server_data_node:Be(k===void 0&&m[0]?{type:"skip"}:k??null,m[0]?E?.server:void 0)})});for(const m of _)m.catch(()=>{});const T=[];for(let m=0;m<l.length;m+=1)if(l[m])try{T.push(await _[m])}catch(y){if(y instanceof Le)return{type:"redirect",location:y.location};if(Z.has(s))return Ze({error:await G(y,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=ie(y),k;if(g?.includes(y))E=y.status??E,k=y.error;else if(y instanceof pe)k=y.body;else{if(await C.updated.check())return await ct(),await K(n);k=await G(y,{params:r,url:n,route:{id:a.id}})}const v=await An(m,T,o);return v?de({url:n,params:r,branch:T.slice(0,v.idx).concat(v.node),errors:o,status:E,error:k,route:a}):await wt(n,{id:a.id},k,E)}else T.push(void 0);return de({url:n,params:r,branch:T,errors:o,status:200,error:null,route:a,form:t?void 0:null})}async function An(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ge({status:e,error:t,url:n,route:r}){const a={};let s=null;if(A.server_loads[0]===0)try{const c=await yt(n,[!0]);if(c.type!=="data"||c.nodes[0]&&c.nodes[0].type!=="data")throw 0;s=c.nodes[0]??null}catch{(n.origin!==re||n.pathname!==location.pathname||Ce)&&await K(n)}try{const o=await $e({loader:Re,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Be(s)}),c={node:await ce(),loader:ce,universal:null,server:null,data:null};return de({url:n,params:a,branch:[o,c],status:e,error:t,errors:[],route:null})}catch(o){if(o instanceof Le)return pt(new URL(o.location,location.href),{},0);throw o}}async function En(e){const t=e.href;if(ae.has(t))return ae.get(t);let n;try{const r=(async()=>{let a=await A.hooks.reroute({url:new URL(e),fetch:async(s,o)=>vn(s,o,e).promise})??e;if(typeof a=="string"){const s=new URL(e);A.hash?s.hash=a:s.pathname=a,a=s}return a})();ae.set(t,r),n=await r}catch{ae.delete(t);return}return n}async function me(e,t){if(e&&!_e(e,U,A.hash)){const n=await En(e);if(!n)return;const r=kn(n);for(const a of xe){const s=a.exec(r);if(s)return{id:he(e),invalidating:t,route:a,params:Rt(s),url:e}}}}function kn(e){return kt(A.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(U.length))||"/"}function he(e){return(A.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function mt({url:e,type:t,intent:n,delta:r,event:a,scroll:s}){let o=!1;const c=Fe(w,n,e,t,s??null);r!==void 0&&(c.navigation.delta=r),a!==void 0&&(c.navigation.event=a);const i={...c.navigation,cancel:()=>{o=!0,c.reject(new Error("navigation cancelled"))}};return ne||lt.forEach(l=>l(i)),o?null:c}async function Y({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:c=0,nav_token:i={},accept:l=We,block:u=We,event:d}){const p=F;F=i;const h=await me(t,!1),f=e==="enter"?Fe(w,h,t,e):mt({url:t,type:e,delta:n?.delta,intent:h,scroll:n?.scroll,event:d});if(!f){u(),F===i&&(F=p);return}const g=R,b=I;l(),ne=!0,ue&&f.navigation.type!=="enter"&&C.navigating.set(ee.current=f.navigation);let _=h&&await gt(h);if(!_){if(_e(t,U,A.hash))return await K(t,s);_=await wt(t,{id:null},await G(new je(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=h?.url||t,F!==i)return f.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(c<20){await Y({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:c+1,nav_token:i}),f.fulfil(void 0);return}_=await ge({status:500,error:await G(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await C.updated.check()&&(await ct(),await K(t,s));if(wn(),Oe(g),dt(b),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),o=n?n.state:o,!n){const v=s?0:1,O={[q]:R+=v,[Q]:I+=v,[nt]:o};(s?history.replaceState:history.pushState).call(history,O,"",t),s||gn(R,I)}const T=h&&L?.id===h.id?L.fork:null;L=null,_.props.page.state=o;let m;if(ue){const v=(await Promise.all(Array.from(mn,W=>W(f.navigation)))).filter(W=>typeof W=="function");if(v.length>0){let W=function(){v.forEach(we=>{J.delete(we)})};v.push(W),v.forEach(we=>{J.add(we)})}const O=f.navigation.to;w={..._.state,nav:{params:O.params,route:O.route,url:O.url}},_.props.page&&(_.props.page.url=t);const $=T&&await T;$?m=$.commit():(H=null,ut.$set(_.props),H&&Object.assign(_.props.page,H),un(_.props.page),m=At?.()),ft=!0}else await _t(_,Se,!1);const{activeElement:y}=document;await m,await oe(),await oe();let E=null;if(He){const v=n?n.scroll:a?M():null;v?scrollTo(v.x,v.y):(E=t.hash&&document.getElementById(bt(t)))?E.scrollIntoView():scrollTo(0,0)}const k=document.activeElement!==y&&document.activeElement!==document.body;!r&&!k&&Tn(t,!E),He=!0,_.props.page&&(H&&Object.assign(_.props.page,H),Object.assign(S,_.props.page)),ne=!1,e==="popstate"&&ht(I),f.fulfil(void 0),f.navigation.to&&(f.navigation.to.scroll=M()),J.forEach(v=>v(f.navigation)),C.navigating.set(ee.current=null)}async function wt(e,t,n,r,a){return e.origin===re&&e.pathname===location.pathname&&!Ce?await ge({status:r,error:n,url:e,route:t}):await K(e,a)}function Rn(){let e,t={element:void 0,href:void 0},n;x.addEventListener("mousemove",c=>{const i=c.target;clearTimeout(e),e=setTimeout(()=>{s(i,B.hover)},20)});function r(c){c.defaultPrevented||s(c.composedPath()[0],B.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(c=>{for(const i of c)i.isIntersecting&&(Ae(new URL(i.target.href)),a.unobserve(i.target))},{threshold:0});async function s(c,i){const l=at(c,x),u=l===t.element&&l?.href===t.href&&i>=n;if(!l||u)return;const{url:d,external:p,download:h}=Ee(l,U,A.hash);if(p||h)return;const f=se(l),g=d&&he(w.url)===he(d);if(!(f.reload||g))if(i<=f.preload_data){t={element:l,href:l.href},n=B.tap;const b=await me(d,!1);if(!b)return;yn(b)}else i<=f.preload_code&&(t={element:l,href:l.href},n=i,Ae(d))}function o(){a.disconnect();for(const c of x.querySelectorAll("a")){const{url:i,external:l,download:u}=Ee(c,U,A.hash);if(l||u)continue;const d=se(c);d.reload||(d.preload_code===B.viewport&&a.observe(c),d.preload_code===B.eager&&Ae(i))}}J.add(o),o()}function G(e,t){if(e instanceof pe)return e.body;const n=ie(e),r=ln(e);return A.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Dn(e,t={}){return e=new URL(Ne(e)),e.origin!==re?Promise.reject(new Error("goto: invalid URL")):pt(e,t,0)}function Sn(e){if(typeof e=="function")le.push(e);else{const{href:t}=new URL(e,location.href);le.push(n=>n.href===t)}}function In(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!ne){const r=Fe(w,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};lt.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||Rn(),x.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=at(t.composedPath()[0],x);if(!n)return;const{url:r,external:a,target:s,download:o}=Ee(n,U,A.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const c=se(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[l,u]=(A.hash?r.hash.replace(/^#/,""):r.href).split("#"),d=l===ye(location);if(a||c.reload&&(!d||!u)){mt({url:r,type:"link",event:t})?ne=!0:t.preventDefault();return}if(u!==void 0&&d){const[,p]=w.url.href.split("#");if(p===u){if(t.preventDefault(),u===""||u==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=n.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(X=!0,Oe(R),e(r),!c.replace_state)return;X=!1}t.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),await Y({type:"link",url:r,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??r.href===location.href,event:t})}),x.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const o=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(_e(o,U,!1))return;const c=t.target,i=se(c);if(i.reload)return;t.preventDefault(),t.stopPropagation();const l=new FormData(c,r);o.search=new URLSearchParams(l).toString(),Y({type:"form",url:o,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??o.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ue){if(t.state?.[q]){const n=t.state[q];if(F={},n===R)return;const r=D[n],a=t.state[nt]??{},s=new URL(t.state[Ft]??location.href),o=t.state[Q],c=w.url?ye(location)===ye(w.url):!1;if(o===I&&(ft||c)){a!==S.state&&(S.state=a),e(s),D[R]=M(),r&&scrollTo(r.x,r.y),R=n;return}const l=n-R;await Y({type:"popstate",url:s,popped:{state:a,scroll:r,delta:l},accept:()=>{R=n,I=o},block:()=>{history.go(-l)},nav_token:F,event:t})}else if(!X){const n=new URL(location.href);e(n),A.hash&&location.reload()}}}),addEventListener("hashchange",()=>{X&&(X=!1,history.replaceState({...history.state,[q]:++R,[Q]:I},"",location.href))});for(const t of document.querySelectorAll("link"))_n.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(ee.current=null)});function e(t){w.url=S.url=t,C.page.set(Me(S)),C.page.notify()}}async function Un(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:c,form:i}){Ce=!0;const l=new URL(location.href);let u;({params:a={},route:s={id:null}}=await me(l,!1)||{}),u=xe.find(({id:h})=>h===s.id);let d,p=!0;try{const h=r.map(async(g,b)=>{const _=c[b];return _?.uses&&(_.uses=vt(_.uses)),$e({loader:A.nodes[g],url:l,params:a,route:s,parent:async()=>{const T={};for(let m=0;m<b;m+=1)Object.assign(T,(await h[m]).data);return T},server_data_node:Be(_)})}),f=await Promise.all(h);if(u){const g=u.layouts;for(let b=0;b<g.length;b++)g[b]||f.splice(b,0,void 0)}d=await de({url:l,params:a,branch:f,status:t,error:n,errors:u?.errors,form:i,route:u??null})}catch(h){if(h instanceof Le){await K(new URL(h.location,location.href));return}d=await ge({status:ie(h),error:await G(h,{url:l,params:a,route:s}),url:l,route:s}),e.textContent="",p=!1}d.props.page&&(d.props.page.state={}),await _t(d,e,p)}async function yt(e,t){const n=new URL(e);n.pathname=pn(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(cn,"1"),n.searchParams.append(sn,t.map(s=>s?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new pe(a.status,s)}return new Promise(async s=>{const o=new Map,c=a.body.getReader();function i(u){return rn(u,{...A.decoders,Promise:d=>new Promise((p,h)=>{o.set(d,{fulfil:p,reject:h})})})}let l="";for(;;){const{done:u,value:d}=await c.read();if(u&&!l)break;for(l+=!d&&l?`
|
|
2
|
-
`:It.decode(d,{stream:!0});;){const p=l.indexOf(`
|
|
3
|
-
`);if(p===-1)break;const h=JSON.parse(l.slice(0,p));if(l=l.slice(p+1),h.type==="redirect")return s(h);if(h.type==="data")h.nodes?.forEach(f=>{f?.type==="data"&&(f.uses=vt(f.uses),f.data=i(f.data))}),s(h);else if(h.type==="chunk"){const{id:f,data:g,error:b}=h,_=o.get(f);o.delete(f),b?_.reject(i(b)):_.fulfil(i(g))}}}})}function vt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ue=!1;function Tn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=bt(e);if(r&&document.getElementById(r)){const{x:s,y:o}=M();setTimeout(()=>{const c=history.state;Ue=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(c,"",e),t&&scrollTo(s,o),Ue=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o<a.rangeCount;o+=1)s.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===s.length){for(let o=0;o<a.rangeCount;o+=1){const c=s[o],i=a.getRangeAt(o);if(c.commonAncestorContainer!==i.commonAncestorContainer||c.startContainer!==i.startContainer||c.endContainer!==i.endContainer||c.startOffset!==i.startOffset||c.endOffset!==i.endOffset)return}a.removeAllRanges()}})}}}function Fe(e,t,n,r,a=null){let s,o;const c=new Promise((l,u)=>{s=l,o=u});return c.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:M()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:c},fulfil:s,reject:o}}function Me(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Ln(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function bt(e){let t;if(A.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Cn as a,Dn as g,Pn as l,S as p,C as s};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/DOEXXmsh.js";export{o as load_css,r as start};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|