sliccy 6.99.3 → 6.99.5
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/dist/ui/.vite/manifest.json +128 -128
- package/dist/ui/assets/SKILL-C64EeuQq.js +1 -0
- package/dist/ui/assets/{SKILL-DfSluXpV.js → SKILL-Dh6a4Qu2.js} +4 -0
- package/dist/ui/assets/{account-store-Cfqazzkp.js → account-store-B6Zka-_Q.js} +1 -1
- package/dist/ui/assets/{account-store-DbDlNeNQ.js → account-store-DcTHuaYs.js} +1 -1
- package/dist/ui/assets/{adobe-DKDqIUH3.js → adobe-9_q-cwrQ.js} +1 -1
- package/dist/ui/assets/{adobe-DxpFxf_l.js → adobe-DdWNo5mh.js} +1 -1
- package/dist/ui/assets/{apply-layout-BzTuzckN.js → apply-layout-D6_JR0VB.js} +1 -1
- package/dist/ui/assets/{apps-BPfAAVj5.js → apps-B7jN2fow.js} +1 -1
- package/dist/ui/assets/{azure-openai-jjA54n3s.js → azure-openai-WG_0CGpK.js} +1 -1
- package/dist/ui/assets/{azure-openai-BAJ-Lq2D.js → azure-openai-kUjuFa-s.js} +1 -1
- package/dist/ui/assets/{cdp-BAGGi_P9.js → cdp-DijNlzAg.js} +1 -1
- package/dist/ui/assets/{cerebras-Cjlf-Zh0.js → cerebras-B3VeDTCT.js} +1 -1
- package/dist/ui/assets/{cerebras-BwBy4PR5.js → cerebras-LxZiu9By.js} +1 -1
- package/dist/ui/assets/{connect-surface-BYbmCNNy.js → connect-surface-d0IMzt6Y.js} +1 -1
- package/dist/ui/assets/{cost-command-CeGn_lnr.js → cost-command-BQWpaecs.js} +8 -8
- package/dist/ui/assets/{follower-navigate-watcher-Dz-52eZY.js → follower-navigate-watcher-Dd46El3D.js} +1 -1
- package/dist/ui/assets/{fs-Bk-01cC_.js → fs-CZIZCIGv.js} +1 -1
- package/dist/ui/assets/{fs-GYuiHu6C.js → fs-C_lEuswJ.js} +2 -2
- package/dist/ui/assets/{github-e_3e-TCe.js → github-C7Ei7lfR.js} +1 -1
- package/dist/ui/assets/{github-copilot-D5QetWwK.js → github-copilot-B2LzGewc.js} +1 -1
- package/dist/ui/assets/{github-copilot-ajghzJ87.js → github-copilot-DsY97KeB.js} +1 -1
- package/dist/ui/assets/{github-install-CCnnL2Wp.js → github-install-teuMA0AB.js} +1 -1
- package/dist/ui/assets/{github-CJ67nGkd.js → github-x1xw0KtD.js} +2 -2
- package/dist/ui/assets/{github-zip-Drk2Re2s.js → github-zip-CIvQnVWw.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-C-LRqsO8.js → js-realm-worker-BLPgQ7_q.js} +1 -1
- package/dist/ui/assets/{kernel-worker-CWYdva96.js → kernel-worker-9RL-1qbh.js} +567 -570
- package/dist/ui/assets/{local-llm-CA22cYg6.js → local-llm-BOag0PRI.js} +1 -1
- package/dist/ui/assets/{local-llm-CBOqU1to.js → local-llm-DQ_6wrrj.js} +1 -1
- package/dist/ui/assets/{main-COLsxiAo.js → main-Br-1g3a3.js} +3 -3
- package/dist/ui/assets/{main-cherry-L2scWl6W.js → main-cherry-MBr7V1Gu.js} +1 -1
- package/dist/ui/assets/{mount-B_lMQFEq.js → mount-CvUPHxlo.js} +2 -2
- package/dist/ui/assets/{mount-C90oeA3z.js → mount-Dip7rbI6.js} +1 -1
- package/dist/ui/assets/{mount-recovery-CArY_qFn.js → mount-recovery-DIFfyUcI.js} +1 -1
- package/dist/ui/assets/navigation-watcher-OPbGCby9.js +1 -0
- package/dist/ui/assets/{new-session-BXfiS8iH.js → new-session-Bq5-4Dfa.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-BFYYjEdF.js → oauth-bootstrap-BKx7I8Kv.js} +2 -2
- package/dist/ui/assets/{openai-codex-Cq6kPJUF.js → openai-codex-BXSmt2x8.js} +1 -1
- package/dist/ui/assets/{openai-codex-DY1KAwNd.js → openai-codex-Xbd7CeE3.js} +1 -1
- package/dist/ui/assets/{openrouter-u_Bjkco-.js → openrouter-CKjYOLVC.js} +1 -1
- package/dist/ui/assets/{openrouter-DbOas-y_.js → openrouter-DGYUEyKg.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-C7Jb_tR6.js → openrouter-oauth-A2rrenaX.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-B6qeqxCt.js → openrouter-oauth-ChxFnJYo.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-BmF-9xDn.js → panel-rpc-handlers-BvT9z7E6.js} +2 -2
- package/dist/ui/assets/{provider-pSxv03LD.js → provider-B7PIvKeg.js} +2 -2
- package/dist/ui/assets/{provider-BVEKOsgC.js → provider-Dh8rn79C.js} +1 -1
- package/dist/ui/assets/{provider-settings-DKsgBboU.js → provider-settings-CKCGh4DD.js} +1 -1
- package/dist/ui/assets/provider-settings-ESBXURmC.js +1 -0
- package/dist/ui/assets/provider-store-access-D0NM6sJk.js +1 -0
- package/dist/ui/assets/{provider-store-access-DANnRqOQ.js → provider-store-access-DasneuAA.js} +2 -2
- package/dist/ui/assets/{providers-DAJgVtDi.js → providers-C6ZynSII.js} +2 -2
- package/dist/ui/assets/{providers-DUQIPNmm.js → providers-rNbxX5Js.js} +1 -1
- package/dist/ui/assets/{quick-llm-_oVhG9mj.js → quick-llm-CAr1c9IB.js} +1 -1
- package/dist/ui/assets/{recovery-screen-BItl2pbn.js → recovery-screen-Bz2i4uVy.js} +1 -1
- package/dist/ui/assets/{redirect-uri-BL5lPkXB.js → redirect-uri-BYheNl-Q.js} +1 -1
- package/dist/ui/assets/{run-C1LTDuBv.js → run-DLs1-rFE.js} +3 -3
- package/dist/ui/assets/{session-freezer--oh82CL9.js → session-freezer-B6KdlOfF.js} +3 -3
- package/dist/ui/assets/{setup-feature-flags-remote--prORt-Z.js → setup-feature-flags-remote-QFy3Fsly.js} +1 -1
- package/dist/ui/assets/{setup-standalone-prelude-Bfi4EKtb.js → setup-standalone-prelude-CMgbvcqU.js} +2 -2
- package/dist/ui/assets/{setup-sudo-CaRwpxuX.js → setup-sudo-BN_-LCOr.js} +2 -2
- package/dist/ui/assets/{skills-PH64i0es.js → skills-DoL_3MkV.js} +1 -1
- package/dist/ui/assets/slicc-version-CcnO6Df2.js +1 -0
- package/dist/ui/assets/{state-DcmL4ufG.js → state-DOBL8rDV.js} +2 -2
- package/dist/ui/assets/{store-B9odpNkj.js → store-B0LOCSNJ.js} +1 -1
- package/dist/ui/assets/{store-B-egPdow.js → store-I-VVSiCJ.js} +1 -1
- package/dist/ui/assets/{sudo-BPa4XFkk.js → sudo-ckkoCMkh.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-mX4--EZZ.js → upgrade-detection-krx52_Jm.js} +1 -1
- package/dist/ui/assets/{wc-extension-CdTpLoY6.js → wc-extension-DBzo8_-8.js} +2 -2
- package/dist/ui/assets/{wc-follower-CWzpVMSb.js → wc-follower-PjL_sC10.js} +3 -3
- package/dist/ui/assets/wc-live-B2InLYR8.js +8 -0
- package/dist/ui/assets/{wc-nav-Ct0ZjY-X.js → wc-nav-FErDdNiD.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-D9XHVjJz.js → wc-onboarding-h9yLj215.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CDLCB7E9.js → wc-placeholder-DTJHVFYJ.js} +2 -2
- package/dist/ui/assets/{wc-settings-BfBrj52A.js → wc-settings-DYhwUVMt.js} +2 -2
- package/dist/ui/assets/{wc-shell-C_wnEwZE.js → wc-shell-pKA-DwAj.js} +2 -2
- package/dist/ui/assets/{wc-sprinkles-C_tqP-RZ.js → wc-sprinkles-S2V-1GSY.js} +2 -2
- package/dist/ui/assets/{wc-tray-C9zIuGq7.js → wc-tray-Bft2lesl.js} +2 -2
- package/dist/ui/assets/{xai-grok-BKunnCa9.js → xai-grok-CFp21916.js} +1 -1
- package/dist/ui/assets/{xai-grok-Br0QraM_.js → xai-grok-ep0KvdW5.js} +1 -1
- package/dist/ui/index.html +6 -6
- package/dist/ui/packages/webapp/index.html +6 -6
- package/package.json +2 -2
- package/dist/ui/assets/SKILL-DQMA6JP2.js +0 -1
- package/dist/ui/assets/navigation-watcher-CcKsLKw9.js +0 -1
- package/dist/ui/assets/provider-settings-C5dMRrvw.js +0 -1
- package/dist/ui/assets/provider-store-access-BA-PDOgh.js +0 -1
- package/dist/ui/assets/slicc-version-BiBUWjSZ.js +0 -1
- package/dist/ui/assets/wc-live-Dbu28pGJ.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="---\nname: playwright-cli\ndescription: |\n Use this whenever the user asks to browse, navigate, click, fill a form,\n scrape, take a screenshot, or otherwise interact with a web page. SLICC drives\n the browser through the `playwright-cli` shell command (also aliased as\n `playwright` and `puppeteer`). Read this BEFORE running any browser\n automation: every tab-operating command requires a `--tab` target id, and\n multi-agent tab handling has rules you must follow.\nallowed-tools: bash\n---\n\n# Browser Automation via playwright-cli\n\nUse `playwright-cli` (also aliased as `playwright` and `puppeteer`) via the bash tool for all browser automation.\n\n**Every tab-operating command requires `--tab=<targetId>`.** There is no implicit \"current tab\". Always specify which tab you're operating on.\n\n`playwright-cli <command> --help` prints that command's usage and does nothing else — safe to run before any action.\n\n## Quick Start\n\n```bash\n# 1. Open a page — note the targetId in the output\nplaywright-cli open https://example.com\n# Output: Opened https://example.com in new tab [targetId: E9A3F...]\n\n# 2. Take a snapshot to see the page structure and get element refs\nplaywright-cli snapshot --tab=E9A3F\n\n# 3. Interact using refs from the snapshot (e.g. e5, e12)\nplaywright-cli click --tab=E9A3F e5\nplaywright-cli fill --tab=E9A3F e12 \"hello world\"\n\n# 4. Re-snapshot after interactions (refs change)\nplaywright-cli snapshot --tab=E9A3F\n```\n\n## Tab IDs\n\n- `tab-list` shows all tabs with their targetIds. The user's active tab is marked `(active)`.\n- `tab-new` / `open` return the new tab's targetId — capture it for subsequent commands.\n- Use `--tab=<targetId>` on ALL commands that operate on a tab.\n\n## Frame IDs\n\n- `frames --tab=<targetId>` lists frame IDs. A frame ID is not a tab target ID; never pass it to `--tab`.\n- Use `--tab=<targetId> --frame=<frameId>` with `eval`, `eval-file`, or `snapshot` to target a child frame, including cross-origin frames.\n- A frame-scoped `snapshot` prints only that frame's accessibility subtree. Its frame-prefixed refs work with `click`, `fill`, `dblclick`, `hover`, `select`, `check`, and `uncheck`; do not pass `--frame` to those commands. Other ref commands require refs from a top-level snapshot.\n\n## Common Failure Modes\n\n- `--tab <targetId> is required` — you forgot `--tab=<id>`. Run `tab-list` to get IDs.\n- `is a frame ID, not a tab target ID` — keep the owning tab's targetId in `--tab` and pass the frame ID with `--frame`.\n- `No snapshot available` — run `snapshot --tab=<id>` before using refs.\n- `unknown flag \"--x\"` / `unexpected argument \"y\"` — every subcommand rejects arguments it does not\n support, so an exit code of 0 means everything you passed was honoured. Check `<verb> --help`.\n- For free-text payloads that start with `-` (e.g. `fill`/`type`/`eval`), put `--` before the text:\n `fill --tab=<id> e1 -- --dash-looking`.\n- `is not an element ref` — a screenshot's positional is a main-frame element ref (`e5`); the output\n path is `--filename=<path>`. Frame-prefixed refs (`f1e5`) clip only with `click`-family commands.\n- Refs are tied to **one tab + one snapshot**. They do not carry across tabs, navigations, or reloads.\n\n## Element Refs\n\nSnapshots assign short ref IDs (`e1`, `e2`, ...) to interactive elements. Use these refs with `click`, `fill`, `dblclick`, `hover`, `select`, `check`, `uncheck`, `drag`, `upload`, `drop`, and `screenshot`.\n\nRefs are invalidated after any state-changing command. Always re-snapshot to get fresh refs.\n\n## Commands\n\nAll commands below that operate on a tab require `--tab=<targetId>`.\n\n### Core\n\n```bash\nplaywright-cli open [url] [--foreground] # Open tab (background by default), returns targetId\nplaywright-cli tab-new [url] [--foreground] # Same as open\nplaywright-cli tab-close --tab=<id> # Close tab\nplaywright-cli goto --tab=<id> <url> # Navigate tab\nplaywright-cli navigate --tab=<id> <url> # Alias for goto\nplaywright-cli snapshot --tab=<id> [--frame=<frameId>] [--no-iframes] [--filename=path] # Tab tree or one frame subtree\nplaywright-cli eval --tab=<id> [--frame=<frameId>] <expression> [--filename=path] # Evaluate JS in a tab/frame, incl. top-level await/return; use `--` before an expression that starts with `-`\nplaywright-cli eval-file --tab=<id> [--frame=<frameId>] <vfs-path> # Evaluate JS from a VFS file in a tab/frame (top-level await/return supported)\nplaywright-cli frames --tab=<id> # List frame IDs for --frame (not --tab)\nplaywright-cli resize --tab=<id> <width> <height> # Resize viewport\n```\n\n`--foreground` (or `--fg`) opens the new tab **in the foreground** — it brings the\nnew tab to the front and switches the user's visible/active tab to it, instead of\nopening in the background.\n\n**Bringing a tab to the foreground (activate / focus / raise / switch to a tab):**\n\n- **New tab** → `open <url> --foreground` (or `tab-new <url> --fg`).\n- **Existing tab** → `tab-select <index>` (1-based index from `tab-list`).\n\nThese two are the ONLY ways to change which tab is in front. There is no\n`activate`, `bring-to-front`, or `focus` subcommand, and `eval`-ing\n`window.focus()` does NOT work (browsers block a page from stealing foreground).\nIf a tab didn't come to the front, re-run `tab-select` / `--foreground` — do not\nfall back to `window.focus()`.\n\n### Interaction\n\n```bash\nplaywright-cli click --tab=<id> <ref> [--modifiers=Shift,Control,Alt,Meta] # Click element\nplaywright-cli dblclick --tab=<id> <ref> [button] [--modifiers=...] # Double-click\nplaywright-cli fill --tab=<id> <ref> <text> [--submit] # Clear input + type text (--submit presses Enter); use `--` before text that starts with `-`\nplaywright-cli type --tab=<id> <text> [--submit] # Type into focused element (--submit presses Enter); use `--` before text that starts with `-`\nplaywright-cli hover --tab=<id> <ref> # Hover over element\nplaywright-cli select --tab=<id> <ref> <value> # Select dropdown value\nplaywright-cli check --tab=<id> <ref> # Check checkbox/radio\nplaywright-cli uncheck --tab=<id> <ref> # Uncheck checkbox/radio\nplaywright-cli drag --tab=<id> <startRef> <endRef> # Drag and drop\nplaywright-cli upload --tab=<id> [ref] <file> [file...] # Upload VFS files to file input (optional ref targets hidden inputs)\nplaywright-cli drop --tab=<id> <ref> [--path=<vfs-path>] [--data=<mime/type=value>] # Drop files/data onto element\nplaywright-cli dialog-accept --tab=<id> [text] # Accept JS dialog\nplaywright-cli dialog-dismiss --tab=<id> # Dismiss JS dialog\n```\n\n### Keyboard\n\n```bash\nplaywright-cli press --tab=<id> <key> # Press key (keyDown + keyUp, e.g. Enter, Tab, Escape)\nplaywright-cli keydown --tab=<id> <key> # Hold key down (no paired keyUp)\nplaywright-cli keyup --tab=<id> <key> # Release held key (no paired keyDown)\n```\n\n### Mouse\n\n```bash\nplaywright-cli mousemove --tab=<id> <x> <y> # Move mouse to coordinates (negative coords ok, e.g. -10 20)\nplaywright-cli mousedown --tab=<id> [button] # Press mouse button (left/right/middle, default: left)\nplaywright-cli mouseup --tab=<id> [button] # Release mouse button\nplaywright-cli mousewheel --tab=<id> <dx> <dy> # Scroll mouse wheel (negative deltas ok, e.g. 0 -300)\n```\n\n### Navigation\n\n```bash\nplaywright-cli go-back --tab=<id> # history.back()\nplaywright-cli go-forward --tab=<id> # history.forward()\nplaywright-cli reload --tab=<id> # Reload page\n```\n\n### Teleport\n\n```bash\nplaywright-cli teleport --tab=<id> --start=<regex> --return=<regex> [--timeout=<s>]\nplaywright-cli teleport --list # List available follower runtimes\nplaywright-cli teleport --off --tab=<id> # Cancel a teleport on this tab\nplaywright-cli open <url> --teleport-start=<regex> --teleport-return=<regex>\nplaywright-cli goto --tab=<id> <url> --teleport-start=<regex> --teleport-return=<regex>\n```\n\nTeleport is for leader/follower tray auth handoffs. Scoped to a specific tab — only commands targeting the teleporting tab are blocked; other tabs remain operational.\n\n`--runtime` is optional: without it, teleport picks the most recently active eligible follower (preferring standalone floats). Only followers that can actually serve cookies are eligible — cherry hosts, exec-only CLI followers, and any target advertising `network: false` are excluded, so a teleport fails fast instead of \"succeeding\" with zero cookies.\n\n### Screenshots\n\n```bash\nplaywright-cli screenshot --tab=<id> # Save to /tmp/screenshot-<ts>.png\nplaywright-cli screenshot --tab=<id> --filename=page.png # Save to custom path\nplaywright-cli screenshot --tab=<id> e5 # Clip to an element (positional = MAIN-FRAME ref, not a path)\nplaywright-cli screenshot --tab=<id> --fullPage # Full scrollable page (alias: --full-page)\nplaywright-cli screenshot --tab=<id> --max-width=800 # Downscale to a max width\n```\n\n### Save As\n\n```bash\nplaywright-cli pdf --tab=<id> [--filename=path] # Save page as PDF (not available in extension mode)\n```\n\n### Viewing pages and screenshots yourself\n\nThe browser displays things to the human; `open --view` is what lets _you_ see them. **But viewing screenshots is a last resort for the cone — every image you load eats a large chunk of the context window** (a single 1280×800 PNG can run 1500+ tokens, full-page screenshots much more). Reach for cheaper signals first:\n\n1. **`playwright-cli snapshot --tab=<id>`** — text accessibility tree. Use this first; it answers \"what's on the page\" for almost all verification tasks at a tiny fraction of the token cost.\n2. **`eval` against the DOM** — when you need a specific value (`document.title`, an attribute, computed style), `eval` it. Don't screenshot for facts you can extract.\n3. **Delegate visual inspection to a scoop.** If the cone genuinely needs vision (layout regression, render fidelity, \"does this look right\"), spawn a scoop to take and view the screenshot — the scoop's context absorbs the tokens, and you receive its summary back. The cone's window stays clean for orchestration.\n4. **`open --view` in the cone** — only when the cone itself must see pixels for its current decision and steps 1–3 won't do.\n\n**What you CAN see:**\n\n- `open --view <path>` — reads an image from the VFS and returns it. Works with PNG, JPEG, GIF, WebP, SVG.\n- `playwright-cli screenshot --tab=<id>` + `open --view <path>` — screenshot a tab, then view it.\n- `screencapture --view screenshot.png` — capture the user's screen via browser screen sharing.\n- `playwright-cli snapshot --tab=<id>` — accessibility tree (text). Use to verify content without vision.\n\n**What only the human sees:**\n\n- `serve <dir>` — opens an app directory in a browser tab (read-only preview).\n- `serve --ttl 30d <dir>` — uploads an immutable snapshot that works without the leader. TTL units are whole `m`, `h`, `d`, or `w`, capped at 30 days. It implies `--no-bridge`, conflicts with `--bridge`/`--max-tabs`, and is limited to 1,000 files, 25 MiB per file, and 50 MiB total. Use `serve --list` for mode/expiry and `serve --stop <token>` to revoke it early.\n- `serve --bridge <dir>` — opens a **driveable** preview whose visitors auto-connect as live synthetic-CDP targets you can navigate/click/evaluate/screenshot via playwright. **Security: opt-in only; cross-subdomain cookie risk accepted (host-only cookies isolated; `Domain=.sliccy.now` cookies readable across previews).** Flags: `--max-tabs <N>` (default 20), `--quiet` (suppress the first-visit announcement), `--no-bridge` (force read-only), `--stop <token>` (revoke + delete webhook). Use `serve --logs [<token>] [--lines <N>]` to inspect leader-memory-only connect/disconnect records without emitting a lick or waking the cone. `serve --truncate [<token>]` clears matching records **and re-arms the first-visit announcement**, so the next visit announces once. Visitor page API: `window.slicc.emit(name, detail?)` (fires webhook lick on cone), `window.slicc.on(name, cb)` (subscribes to CustomEvents you dispatch).\n- `open <path>` (no flags) — opens a file in a browser tab.\n- `imgcat <path>` — displays an image in the terminal preview.\n\n**Workflow to verify a page (when vision is actually required):**\n\n1. `serve /workspace/app` — open the app (the human sees it).\n2. `playwright-cli tab-list` — find the tab by URL, note the targetId.\n3. `playwright-cli snapshot --tab=<id>` — required before screenshot, and often answers your question on its own.\n4. `playwright-cli screenshot --tab=<id> --filename=/tmp/shot.png` — consider `--max-width` to keep the file small.\n5. `open --view /tmp/shot.png` — now you can see it. Strongly prefer doing this from a scoop, not the cone.\n\n**Don't:**\n\n- Default to screenshots when a snapshot would do.\n- `read_file` on a PNG or base64-encode to view images.\n- `imgcat` or `cat` on screenshots expecting to see them.\n- Open a screenshot then screenshot that tab.\n- Use `eval` to check the active tab — use `tab-list`.\n\n### Tab Management\n\n```bash\nplaywright-cli tab-list # List tabs with targetIds + (active) marker\nplaywright-cli tab-new [url] # New tab, returns targetId\nplaywright-cli tab-close --tab=<id> # Close specific tab\nplaywright-cli tab-select <index> # Select (bring to front) tab by 1-based index\n```\n\n### Cookies\n\n```bash\nplaywright-cli cookie-list --tab=<id> [--domain=<d>] [--path=<p>] # List cookies (filter by domain/path)\nplaywright-cli cookie-get --tab=<id> <name> # Get cookie\nplaywright-cli cookie-set --tab=<id> <name> <value> [--sameSite=Strict|Lax|None] [other flags] # Set cookie\nplaywright-cli cookie-delete --tab=<id> <name> [--domain= --path=] # Delete cookie\nplaywright-cli cookie-clear --tab=<id> # Clear all cookies\n```\n\n### Storage\n\n```bash\nplaywright-cli localstorage-list --tab=<id>\nplaywright-cli localstorage-get --tab=<id> <key>\nplaywright-cli localstorage-set --tab=<id> <key> <value>\nplaywright-cli localstorage-delete --tab=<id> <key>\nplaywright-cli localstorage-clear --tab=<id>\n# Same pattern for sessionstorage-*\nplaywright-cli state-save --tab=<id> [filename|--filename=path] # Save cookies + localStorage to JSON\nplaywright-cli state-load --tab=<id> <filename> # Restore from state file\n```\n\n### Network\n\n```bash\nplaywright-cli console --tab=<id> [min-level] [--clear] # List console messages (debug/log/info/warning/error)\nplaywright-cli requests --tab=<id> [--static] [--filter=<regex>] [--clear] # List network requests\nplaywright-cli request --tab=<id> <index> [--filename=path] # Full request details\nplaywright-cli request-headers --tab=<id> <index> # Request headers only\nplaywright-cli request-body --tab=<id> <index> # Request body only\nplaywright-cli response-headers --tab=<id> <index> # Response headers only\nplaywright-cli response-body --tab=<id> <index> [--filename=path] # Response body (saves binary to file)\nplaywright-cli network-state-set --tab=<id> <online|offline> # Toggle network state\nplaywright-cli route --tab=<id> <pattern> [--status=N] [--body=text] [--content-type=type] [--header=name:value]\nplaywright-cli route-list --tab=<id> # List active routes\nplaywright-cli unroute --tab=<id> [pattern] # Remove routes (all if no pattern)\n```\n\n### DevTools\n\n```bash\nplaywright-cli generate-locator --tab=<id> <ref> # Generate Playwright locator string for element\nplaywright-cli highlight --tab=<id> <ref> [--style=<css>] # Highlight element with visual overlay\nplaywright-cli highlight --tab=<id> --hide [ref] # Remove highlight (all if no ref)\n```\n\n### HAR Recording\n\n```bash\nplaywright-cli record [url] [--filter=<js-expr>] # Open tab with network recording\nplaywright-cli stop-recording <recordingId> # Stop and save HAR\n```\n\n## Multi-Agent Tab Behavior\n\n**All agents (cone + scoops) share the same tab namespace.** There is no tab isolation.\n\n- `tab-list` shows **every** tab from every agent — yours, the cone's, other scoops'. The list can be noisy.\n- Any agent can `eval`, `snapshot`, or `close` any tab — there are no ownership checks.\n- Tab counts fluctuate as other agents open and close tabs concurrently.\n\n**Best practices for scoops:**\n\n1. **Track your own tab IDs.** When you open a tab, capture the targetId and store it. Don't rely on `tab-list` to find your tabs later — other agents' tabs will be mixed in.\n\n ```bash\n # Open and capture the ID\n playwright-cli tab-new https://example.com\n # Output: Opened https://example.com in new tab [targetId: ABC123...]\n # Use ABC123 for all subsequent commands on this tab\n ```\n\n2. **NEVER close tabs you didn't open.** Tabs you don't recognize belong to the **user** or other agents. User tabs are off-limits unless the user explicitly asks you to close them. Only close tabs whose targetId you captured from your own `tab-new` / `open` calls.\n\n3. **Handle \"tab not found\" gracefully.** Another agent might close a tab between your `tab-list` and your command. If you get `Error: No tab with id`, the tab is gone — move on.\n\n4. **Don't depend on tab count or ordering.** Other agents are opening/closing tabs concurrently. Use targetIds, not positional logic.\n\n5. **Clean up when done.** Close all tabs you opened before finishing. Include this in every scoop brief:\n _\"Close each tab with `playwright-cli tab-close --tab=<id>` when done.\"_\n\n## Tips\n\n- **Refs change after every interaction** — always re-snapshot before clicking or filling.\n- `open` and `tab-new` open tabs in the **background** by default. Capture the targetId from the output. To open in the **foreground** add `--foreground`/`--fg`; to raise an **already-open** tab use `tab-select <index>`.\n- After `click`, `fill`, `goto`, `go-back`, `go-forward`, `reload`, `select`, `check`, `uncheck`, `drag`, or `dialog-*`, take a fresh `snapshot --tab=<id>` before using refs again.\n- Unexpected JavaScript dialogs are auto-dismissed on attached pages.\n- Use `eval --tab=<id>` for DOM operations not covered by built-in commands; save results with `--filename=path`.\n- The SLICC app tab and Chrome internal UI tabs are automatically excluded from `tab-list`.\n- `fill` clears and types into regular inputs, textareas, and `contenteditable` elements. Use `--submit` to press Enter after. If the text or an `eval` expression starts with `-`, put `--` before it so it is not parsed as a flag.\n- Negative numbers for `mousewheel` / `mousemove` are positionals (no `--` needed): `mousewheel --tab=<id> 0 -300`.\n- Screenshots default to `/tmp/screenshot-<timestamp>.png`. Use `--filename=path` to save elsewhere —\n `screenshot <path>` is an error, because that slot is the element ref.\n- Unsupported flags and extra positionals are rejected per subcommand, so a probe that exits 0 means\n the flag was honoured — nothing is silently dropped.\n- Use `keydown`/`keyup` for holding modifier keys (e.g. Shift+click: `keydown Shift`, `click`, `keyup Shift`).\n- Use `requests` + `response-body` to inspect XHR/fetch responses; `route` to mock or block them.\n- **Calling the app's own backend? Use `curlwright`, not `eval-file`.** It is curl's flags run by a `fetch()` inside the tab, so cookies, origin and session come along: `curlwright -s -X POST https://app.example.com/api/items -H 'X-CSRF-Token: abc' -d '{\"name\":\"x\"}' --tab=<id>`. `-o <file>` writes a **byte-exact** body, which `eval-file` cannot do at all — that is the only way to pull a binary response out of a page. Without `--tab` it uses the tab already on that origin. `curlwright --help` for the flag list.\n- `state-save` / `state-load` persist auth state (cookies + localStorage) across sessions.\n- `pdf` saves a print-layout PDF; not available in extension mode.\n\n## Low-level CDP escape hatch\n\nFor raw Chrome DevTools Protocol calls that `playwright-cli` doesn't wrap, send JSON-RPC directly over WebSocket with `websocat`:\n\n```bash\n# Discover the page's debug socket URL via the CDP HTTP endpoint\ncurl -s http://127.0.0.1:9222/json | jq -r '.[0].webSocketDebuggerUrl'\n\n# Send a single CDP method, receive the response, exit\necho 'Page.navigate {\"url\":\"https://example.com\"}' \\\n | websocat -1 --jsonrpc --jsonrpc-omit-jsonrpc ws://127.0.0.1:9222/devtools/page/<id>\n```\n\nRun `websocat --help` for the full flag list. Use this only when `playwright-cli` has no wrapper for the CDP method you need.\n";export{e as default};
|
|
@@ -22,6 +22,10 @@ theme reset # Reset to default theme
|
|
|
22
22
|
theme export <id> <path> # Export a preset to a VFS path
|
|
23
23
|
\`\`\`
|
|
24
24
|
|
|
25
|
+
Unrecognized flags (for example \`theme list --json\`) exit non-zero with
|
|
26
|
+
\`theme <sub>: unknown flag: …\` — do not treat exit 0 as proof a flag was
|
|
27
|
+
honoured.
|
|
28
|
+
|
|
25
29
|
### Agent workflow
|
|
26
30
|
|
|
27
31
|
1. Write a theme JSON file to the VFS
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/oauth-service-Uk8UIb05.js","assets/preload-helper-Czpn1I53.js","assets/proxied-fetch-BGeNrvQ4.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/base64-DpPqYZJF.js","assets/src-CAWTvdAa.js","assets/runtime-env-Dlaokqg1.js","assets/fetch-body-D2PwksUW.js","assets/api-endpoint-GRCyib6X.js","assets/runtime-env-CgsZ7LTp.js","assets/runtime-env-E-i2SW1s.js","assets/panel-rpc-B3MSVImO.js","assets/permissions-surface-registry-CilCRwhh.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{t as n}from"./preload-helper-Czpn1I53.js";import{a as r,c as i,l as a,o,s}from"./claude-model-version-DoVrYsKi.js";import"./libesm-BI4UHVqp.js";import{t as c}from"./logger-DDBAeTLF.js";import"./src-CAWTvdAa.js";import"./proxied-fetch-BGeNrvQ4.js";import{i as l,t as u}from"./api-endpoint-GRCyib6X.js";import{n as d}from"./float-topology-DiK91BlA.js";import"./secret-topology-0AWfFTh5.js";import{t as f}from"./secrets-bridge-client-DCQ44RyR.js";import"./image-markers-BXtVm4og.js";import"./tool-ui-DfXu6quJ.js";import{n as p,o as m,t as h}from"./providers-DAJgVtDi.js";import{n as g,t as _}from"./panel-rpc-B3MSVImO.js";import{r as v,t as y}from"./bedrock-camp-compat-CgBMwna8.js";var b={assign:0,create:0,clone:0,discard:0,update:0};function x(e){return Array.isArray(e)}function S(e){return w(e,null)}function C(e){return w(typeof e,`object`)&&!S(e)}function w(e,t){return e===t}function ee(e){if(!C(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!S(t)&&w(typeof t.constructor,`function`)&&!(w(t.constructor,globalThis.Object)||w(t.constructor.name,`Object`))}function te(e){return w(e,`__proto__`)||w(e,`constructor`)||w(e,`prototype`)}function ne(e,t){return te(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function re(e){return Object.getOwnPropertyNames(e)}function ie(e){return Object.getOwnPropertySymbols(e)}function T(e){return globalThis.ArrayBuffer.isView(e)}function ae(e){return e instanceof globalThis.RegExp}function oe(e){return e instanceof globalThis.Set}function se(e){return e instanceof globalThis.Map}function ce(e){return e}function le(e){return ne(e,`~kind`)||ne(e,`~unsafe`)}function ue(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){if(te(e))continue;let r=n[e];ne(r,`value`)&&Object.defineProperty(t,e,{...r,value:E(r.value)})}return t}function de(e){let t={};for(let n of re(e))te(n)||(t[n]=E(e[n]));for(let n of ie(e))t[n]=E(e[n]);return t}function fe(e){return ee(e)?ce(e):le(e)?ue(e):de(e)}function pe(e){return e.map(e=>E(e))}function me(e){return e.slice()}function he(e){return new RegExp(e.source,e.flags)}function ge(e){return new Map(E([...e.entries()]))}function _e(e){return new Set(E([...e.values()]))}function E(e){return T(e)?me(e):ae(e)?he(e):se(e)?ge(e):oe(e)?_e(e):x(e)?pe(e):C(e)?fe(e):e}function ve(e){return b.clone+=1,E(e)}var ye={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function be(){return ye}function xe(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Se(e,t){return{...e,...t}}function Ce(e,t,n={}){b.create+=1;let r=be(),i=Se(t,n),a=r.enumerableKind?Se(i,e):xe(i,e);return r.immutableTypes?Object.freeze(a):a}function we(e,t,n){b.update+=1;let r=be(),i=ve(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return i}function Te(e){return C(e)}function Ee(e){return we(e,{"~optional":!0},{})}function De(e,t){return we(Ee(e),{},t)}function Oe(e,t){return Ce({"~kind":`Array`},{type:`array`,items:e},t)}function ke(e,t={}){return De(e,t)}function Ae(e){return ke(e)}function je(e){return Te(e)&&ne(e,`~optional`)}function Me(e){return re(e).filter(t=>!je(e[t]))}function Ne(e,t={}){let n=Me(e);return Ce({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}var Pe;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Pe||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var Fe=new Float64Array(1);new DataView(Fe.buffer),new Uint8Array(Fe.buffer),new TextEncoder;var Ie=`-?(?:0|[1-9][0-9]*)`,Le=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Re(e){return Ce({"~kind":`Number`},{type:`number`},e)}function D(e){return Ce({"~kind":`String`},{type:`string`},e)}var ze=`^${Ie}$`;`${Le}`;function Be(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var Ve=[...Be(97,122),...Be(65,90)],He=[`0`,...Be(49,57)];[...He],[...Ve,...He],[...He],new RegExp(ze);function Ue(e,t){try{return Promise.resolve(t(We))}catch(e){return Promise.reject(e)}}var We={startSpan:Ue,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(We);var Ge=Symbol.for(`yaml.alias`),Ke=Symbol.for(`yaml.document`),O=Symbol.for(`yaml.map`),qe=Symbol.for(`yaml.pair`),Je=Symbol.for(`yaml.scalar`),Ye=Symbol.for(`yaml.seq`),k=Symbol.for(`yaml.node.type`),A=e=>!!e&&typeof e==`object`&&e[k]===Ge,Xe=e=>!!e&&typeof e==`object`&&e[k]===Ke,Ze=e=>!!e&&typeof e==`object`&&e[k]===O,j=e=>!!e&&typeof e==`object`&&e[k]===qe,M=e=>!!e&&typeof e==`object`&&e[k]===Je,Qe=e=>!!e&&typeof e==`object`&&e[k]===Ye;function N(e){if(e&&typeof e==`object`)switch(e[k]){case O:case Ye:return!0}return!1}function P(e){if(e&&typeof e==`object`)switch(e[k]){case Ge:case O:case Je:case Ye:return!0}return!1}var $e=e=>(M(e)||N(e))&&!!e.anchor,F=Symbol(`break visit`),et=Symbol(`skip children`),tt=Symbol(`remove node`);function nt(e,t){let n=rt(t);Xe(e)?I(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):I(null,e,n,Object.freeze([]))}nt.BREAK=F,nt.SKIP=et,nt.REMOVE=tt;function I(e,t,n,r){let i=it(e,t,n,r);if(P(i)||j(i))return at(e,r,i),I(e,i,n,r);if(typeof i!=`symbol`){if(N(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=I(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===F)return F;else i===tt&&(t.items.splice(e,1),--e)}}else if(j(t)){r=Object.freeze(r.concat(t));let e=I(`key`,t.key,n,r);if(e===F)return F;e===tt&&(t.key=null);let i=I(`value`,t.value,n,r);if(i===F)return F;i===tt&&(t.value=null)}}return i}function rt(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function it(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Ze(t))return n.Map?.(e,t,r);if(Qe(t))return n.Seq?.(e,t,r);if(j(t))return n.Pair?.(e,t,r);if(M(t))return n.Scalar?.(e,t,r);if(A(t))return n.Alias?.(e,t,r)}function at(e,t,n){let r=t[t.length-1];if(N(r))r.items[e]=n;else if(j(r))e===`key`?r.key=n:r.value=n;else if(Xe(r))r.contents=n;else{let e=A(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function ot(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function st(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=st(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=st(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=st(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=st(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function L(e,t,n){if(Array.isArray(e))return e.map((e,t)=>L(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!$e(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var ct=class{constructor(e){Object.defineProperty(this,k,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Xe(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=L(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?st(i,{"":o},``,o):o}},lt=class extends ct{constructor(e){super(Ge),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],nt(e,{Node:(e,t)=>{(A(t)||$e(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(L(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=ut(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ot(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ut(e,t,n){if(A(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(N(t)){let r=0;for(let i of t.items){let t=ut(e,i,n);t>r&&(r=t)}return r}if(j(t)){let r=ut(e,t.key,n),i=ut(e,t.value,n);return Math.max(r,i)}return 1}var dt=e=>!e||typeof e!=`function`&&typeof e!=`object`,R=class extends ct{constructor(e){super(Je),this.value=e}toJSON(e,t){return t?.keep?this.value:L(this.value,e,t)}toString(){return String(this.value)}};R.BLOCK_FOLDED=`BLOCK_FOLDED`,R.BLOCK_LITERAL=`BLOCK_LITERAL`,R.PLAIN=`PLAIN`,R.QUOTE_DOUBLE=`QUOTE_DOUBLE`,R.QUOTE_SINGLE=`QUOTE_SINGLE`;var ft=`tag:yaml.org,2002:`;function pt(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function mt(e,t,n){if(Xe(e)&&(e=e.contents),P(e))return e;if(j(e)){let t=n.schema[O].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new lt(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=ft+t.slice(2));let l=pt(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new R(e);return c&&(c.node=t),t}l=e instanceof Map?o[O]:Symbol.iterator in Object(e)?o[Ye]:o[O]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new R(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function ht(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return mt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var gt=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,_t=class extends ct{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>P(t)||j(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(gt(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(N(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,ht(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(N(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&M(i)?i.value:i:N(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j(t))return!1;let n=t.value;return n==null||e&&M(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return N(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(N(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,ht(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},vt=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function yt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var z=(e,t,n)=>e.endsWith(`
|
|
2
|
+
import{n as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{t as n}from"./preload-helper-Czpn1I53.js";import{a as r,c as i,l as a,o,s}from"./claude-model-version-DoVrYsKi.js";import"./libesm-BI4UHVqp.js";import{t as c}from"./logger-DDBAeTLF.js";import"./src-CAWTvdAa.js";import"./proxied-fetch-BGeNrvQ4.js";import{i as l,t as u}from"./api-endpoint-GRCyib6X.js";import{n as d}from"./float-topology-DiK91BlA.js";import"./secret-topology-0AWfFTh5.js";import{t as f}from"./secrets-bridge-client-DCQ44RyR.js";import"./image-markers-BXtVm4og.js";import"./tool-ui-DfXu6quJ.js";import{n as p,o as m,t as h}from"./providers-C6ZynSII.js";import{n as g,t as _}from"./panel-rpc-B3MSVImO.js";import{r as v,t as y}from"./bedrock-camp-compat-CgBMwna8.js";var b={assign:0,create:0,clone:0,discard:0,update:0};function x(e){return Array.isArray(e)}function S(e){return w(e,null)}function C(e){return w(typeof e,`object`)&&!S(e)}function w(e,t){return e===t}function ee(e){if(!C(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!S(t)&&w(typeof t.constructor,`function`)&&!(w(t.constructor,globalThis.Object)||w(t.constructor.name,`Object`))}function te(e){return w(e,`__proto__`)||w(e,`constructor`)||w(e,`prototype`)}function ne(e,t){return te(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function re(e){return Object.getOwnPropertyNames(e)}function ie(e){return Object.getOwnPropertySymbols(e)}function T(e){return globalThis.ArrayBuffer.isView(e)}function ae(e){return e instanceof globalThis.RegExp}function oe(e){return e instanceof globalThis.Set}function se(e){return e instanceof globalThis.Map}function ce(e){return e}function le(e){return ne(e,`~kind`)||ne(e,`~unsafe`)}function ue(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){if(te(e))continue;let r=n[e];ne(r,`value`)&&Object.defineProperty(t,e,{...r,value:E(r.value)})}return t}function de(e){let t={};for(let n of re(e))te(n)||(t[n]=E(e[n]));for(let n of ie(e))t[n]=E(e[n]);return t}function fe(e){return ee(e)?ce(e):le(e)?ue(e):de(e)}function pe(e){return e.map(e=>E(e))}function me(e){return e.slice()}function he(e){return new RegExp(e.source,e.flags)}function ge(e){return new Map(E([...e.entries()]))}function _e(e){return new Set(E([...e.values()]))}function E(e){return T(e)?me(e):ae(e)?he(e):se(e)?ge(e):oe(e)?_e(e):x(e)?pe(e):C(e)?fe(e):e}function ve(e){return b.clone+=1,E(e)}var ye={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function be(){return ye}function xe(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Se(e,t){return{...e,...t}}function Ce(e,t,n={}){b.create+=1;let r=be(),i=Se(t,n),a=r.enumerableKind?Se(i,e):xe(i,e);return r.immutableTypes?Object.freeze(a):a}function we(e,t,n){b.update+=1;let r=be(),i=ve(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return i}function Te(e){return C(e)}function Ee(e){return we(e,{"~optional":!0},{})}function De(e,t){return we(Ee(e),{},t)}function Oe(e,t){return Ce({"~kind":`Array`},{type:`array`,items:e},t)}function ke(e,t={}){return De(e,t)}function Ae(e){return ke(e)}function je(e){return Te(e)&&ne(e,`~optional`)}function Me(e){return re(e).filter(t=>!je(e[t]))}function Ne(e,t={}){let n=Me(e);return Ce({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}var Pe;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Pe||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var Fe=new Float64Array(1);new DataView(Fe.buffer),new Uint8Array(Fe.buffer),new TextEncoder;var Ie=`-?(?:0|[1-9][0-9]*)`,Le=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Re(e){return Ce({"~kind":`Number`},{type:`number`},e)}function D(e){return Ce({"~kind":`String`},{type:`string`},e)}var ze=`^${Ie}$`;`${Le}`;function Be(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var Ve=[...Be(97,122),...Be(65,90)],He=[`0`,...Be(49,57)];[...He],[...Ve,...He],[...He],new RegExp(ze);function Ue(e,t){try{return Promise.resolve(t(We))}catch(e){return Promise.reject(e)}}var We={startSpan:Ue,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(We);var Ge=Symbol.for(`yaml.alias`),Ke=Symbol.for(`yaml.document`),O=Symbol.for(`yaml.map`),qe=Symbol.for(`yaml.pair`),Je=Symbol.for(`yaml.scalar`),Ye=Symbol.for(`yaml.seq`),k=Symbol.for(`yaml.node.type`),A=e=>!!e&&typeof e==`object`&&e[k]===Ge,Xe=e=>!!e&&typeof e==`object`&&e[k]===Ke,Ze=e=>!!e&&typeof e==`object`&&e[k]===O,j=e=>!!e&&typeof e==`object`&&e[k]===qe,M=e=>!!e&&typeof e==`object`&&e[k]===Je,Qe=e=>!!e&&typeof e==`object`&&e[k]===Ye;function N(e){if(e&&typeof e==`object`)switch(e[k]){case O:case Ye:return!0}return!1}function P(e){if(e&&typeof e==`object`)switch(e[k]){case Ge:case O:case Je:case Ye:return!0}return!1}var $e=e=>(M(e)||N(e))&&!!e.anchor,F=Symbol(`break visit`),et=Symbol(`skip children`),tt=Symbol(`remove node`);function nt(e,t){let n=rt(t);Xe(e)?I(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):I(null,e,n,Object.freeze([]))}nt.BREAK=F,nt.SKIP=et,nt.REMOVE=tt;function I(e,t,n,r){let i=it(e,t,n,r);if(P(i)||j(i))return at(e,r,i),I(e,i,n,r);if(typeof i!=`symbol`){if(N(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=I(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===F)return F;else i===tt&&(t.items.splice(e,1),--e)}}else if(j(t)){r=Object.freeze(r.concat(t));let e=I(`key`,t.key,n,r);if(e===F)return F;e===tt&&(t.key=null);let i=I(`value`,t.value,n,r);if(i===F)return F;i===tt&&(t.value=null)}}return i}function rt(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function it(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Ze(t))return n.Map?.(e,t,r);if(Qe(t))return n.Seq?.(e,t,r);if(j(t))return n.Pair?.(e,t,r);if(M(t))return n.Scalar?.(e,t,r);if(A(t))return n.Alias?.(e,t,r)}function at(e,t,n){let r=t[t.length-1];if(N(r))r.items[e]=n;else if(j(r))e===`key`?r.key=n:r.value=n;else if(Xe(r))r.contents=n;else{let e=A(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function ot(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function st(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=st(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=st(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=st(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=st(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function L(e,t,n){if(Array.isArray(e))return e.map((e,t)=>L(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!$e(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var ct=class{constructor(e){Object.defineProperty(this,k,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Xe(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=L(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?st(i,{"":o},``,o):o}},lt=class extends ct{constructor(e){super(Ge),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],nt(e,{Node:(e,t)=>{(A(t)||$e(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(L(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=ut(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ot(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ut(e,t,n){if(A(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(N(t)){let r=0;for(let i of t.items){let t=ut(e,i,n);t>r&&(r=t)}return r}if(j(t)){let r=ut(e,t.key,n),i=ut(e,t.value,n);return Math.max(r,i)}return 1}var dt=e=>!e||typeof e!=`function`&&typeof e!=`object`,R=class extends ct{constructor(e){super(Je),this.value=e}toJSON(e,t){return t?.keep?this.value:L(this.value,e,t)}toString(){return String(this.value)}};R.BLOCK_FOLDED=`BLOCK_FOLDED`,R.BLOCK_LITERAL=`BLOCK_LITERAL`,R.PLAIN=`PLAIN`,R.QUOTE_DOUBLE=`QUOTE_DOUBLE`,R.QUOTE_SINGLE=`QUOTE_SINGLE`;var ft=`tag:yaml.org,2002:`;function pt(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function mt(e,t,n){if(Xe(e)&&(e=e.contents),P(e))return e;if(j(e)){let t=n.schema[O].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new lt(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=ft+t.slice(2));let l=pt(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new R(e);return c&&(c.node=t),t}l=e instanceof Map?o[O]:Symbol.iterator in Object(e)?o[Ye]:o[O]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new R(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function ht(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return mt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var gt=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,_t=class extends ct{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>P(t)||j(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(gt(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(N(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,ht(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(N(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&M(i)?i.value:i:N(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j(t))return!1;let n=t.value;return n==null||e&&M(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return N(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(N(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,ht(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},vt=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function yt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var z=(e,t,n)=>e.endsWith(`
|
|
3
3
|
`)?yt(n,t):n.includes(`
|
|
4
4
|
`)?`
|
|
5
5
|
`+yt(n,t):(e.endsWith(` `)?``:` `)+n,bt=`flow`,xt=`block`,St=`quoted`;function Ct(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=wt(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{t as n}from"./logger-LESFN7Hj.js";import{n as r,r as i}from"./panel-rpc-BPwAqRch.js";import{n as a,o,t as s}from"./providers-DUQIPNmm.js";import{a as c,o as l}from"./proxied-fetch-Co-pb0x0.js";import"./src-CcFD5QfS.js";import{t as u}from"./runtime-env-DadgceZk.js";import{i as d,n as f,t as p}from"./api-endpoint-C00IT5T9.js";import{a as m,c as h,l as g,o as ee,s as _}from"./claude-model-version-Csn7RPVg.js";import"./libesm-zfj8k-QN.js";import"./runtime-env-Dtj99aNH.js";import{t as te}from"./port-bridge-client-Bz2N1tvn.js";import{r as ne,t as re}from"./image-markers-CdcIBWOf.js";import{o as ie,s as ae}from"./tool-ui-DRnUkp2g.js";import{r as oe,t as se}from"./bedrock-camp-compat-CYnC9BQI.js";const ce=`slicc_oauth_extra_domains`;function le(e){try{let t=e.getItem(ce);if(!t)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n)){if(typeof e!=`string`||!Array.isArray(t))continue;let n=t.filter(e=>typeof e==`string`&&e.length>0);n.length>0&&(r[e]=n)}return r}catch{return{}}}function ue(e,t){try{e.setItem(ce,JSON.stringify(t))}catch(e){throw Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${e instanceof Error?e.message:String(e)}`)}}const de={assign:0,create:0,clone:0,discard:0,update:0};function v(e,t){return de.assign+=1,{...e,...t}}function fe(e,t,n){return e>=t&&e<=n}function pe(e){return e===8205}function me(e){return fe(e,55296,56319)}function he(e){return fe(e,127462,127487)}function ge(e){return fe(e,65024,65039)}function _e(e){return fe(e,768,879)||fe(e,6832,6911)||fe(e,7616,7679)||fe(e,65056,65071)}function ve(e){return e>65535?2:1}function ye(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(_e(n)||ge(n))t+=ve(n);else break}return t}function be(e,t){let n=e.codePointAt(t),r=t+ve(n);for(r=ye(e,r);r<e.length-1&&e[r]===``;){let t=e.codePointAt(r+1);r+=1+ve(t),r=ye(e,r)}return he(n)&&r<e.length&&he(e.codePointAt(r))&&(r+=ve(e.codePointAt(r))),r}function xe(e){return me(e)||_e(e)||ge(e)||pe(e)}function Se(e){let t=0,n=0;for(;n<e.length;)n=be(e,n),t++;return t}function Ce(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=be(e,r),n++,n>=t)return!0;return!1}function we(e,t){let n=0,r=0;for(;r<e.length;)if(r=be(e,r),n++,n>t)return!1;return!0}function Te(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(xe(e.charCodeAt(n)))return Ce(e,t);if(n++,n>=t)return!0}return!1}function Ee(e,t){let n=0;for(;n<e.length;){if(xe(e.charCodeAt(n)))return we(e,t);if(n++,n>t)return!1}return!0}var De=e({Entries:()=>et,EntriesRegExp:()=>$e,Every:()=>Xe,EveryAll:()=>Ze,GraphemeCount:()=>qe,HasPropertyKey:()=>S,IsArray:()=>Oe,IsBigInt:()=>ke,IsBoolean:()=>Ae,IsClassInstance:()=>Ge,IsConstructor:()=>je,IsDeepEqual:()=>at,IsEqual:()=>b,IsFunction:()=>Me,IsGreaterEqualThan:()=>Ue,IsGreaterThan:()=>Be,IsInteger:()=>Ne,IsLessEqualThan:()=>He,IsLessThan:()=>Ve,IsMaxLength:()=>Je,IsMinLength:()=>Ye,IsMultipleOf:()=>We,IsNull:()=>Pe,IsNumber:()=>Fe,IsObject:()=>y,IsObjectNotArray:()=>Ie,IsString:()=>Le,IsSymbol:()=>Re,IsUndefined:()=>ze,IsUnsafePropertyKey:()=>Qe,IsValueLike:()=>Ke,Keys:()=>C,ShiftLeft:()=>x,Symbols:()=>tt,Values:()=>nt});function Oe(e){return Array.isArray(e)}function ke(e){return b(typeof e,`bigint`)}function Ae(e){return b(typeof e,`boolean`)}function je(e){if(ze(e)||!Me(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Me(e){return b(typeof e,`function`)}function Ne(e){return Number.isInteger(e)}function Pe(e){return b(e,null)}function Fe(e){return Number.isFinite(e)}function Ie(e){return y(e)&&!Oe(e)}function y(e){return b(typeof e,`object`)&&!Pe(e)}function Le(e){return b(typeof e,`string`)}function Re(e){return b(typeof e,`symbol`)}function ze(e){return b(e,void 0)}function b(e,t){return e===t}function Be(e,t){return e>t}function Ve(e,t){return e<t}function He(e,t){return e<=t}function Ue(e,t){return e>=t}function We(e,t){if(ke(e)||ke(t))return BigInt(e)%BigInt(t)===0n;if(!Fe(e)||Ne(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<1e-10}function Ge(e){if(!y(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!Pe(t)&&b(typeof t.constructor,`function`)&&!(b(t.constructor,globalThis.Object)||b(t.constructor.name,`Object`))}function Ke(e){return ke(e)||Ae(e)||Pe(e)||Fe(e)||Le(e)||ze(e)}function qe(e){return Se(e)}function Je(e,t){return Ee(e,t)}function Ye(e,t){return Te(e,t)}function Xe(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Ze(e,t,n){let r=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(r=!1);return r}function x(e,t,n){return b(e.length,0)?n():t(e[0],e.slice(1))}function Qe(e){return b(e,`__proto__`)||b(e,`constructor`)||b(e,`prototype`)}function S(e,t){return Qe(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function $e(e){return C(e).map(t=>[RegExp(`^${t}$`),e[t]])}function et(e){return Object.entries(e)}function C(e){return Object.getOwnPropertyNames(e)}function tt(e){return Object.getOwnPropertySymbols(e)}function nt(e){return Object.values(e)}function rt(e,t){if(!y(t))return!1;let n=C(e);return b(n.length,C(t).length)&&n.every(n=>at(e[n],t[n]))}function it(e,t){return Oe(t)&&b(e.length,t.length)&&e.every((n,r)=>at(e[r],t[r]))}function at(e,t){return Oe(e)?it(e,t):y(e)?rt(e,t):b(e,t)}function ot(e){return e instanceof Boolean}function st(e){return e instanceof Number}function ct(e){return e instanceof String}function lt(e){return globalThis.ArrayBuffer.isView(e)}function ut(e){return e instanceof globalThis.RegExp}function dt(e){return e instanceof globalThis.Date}function ft(e){return e instanceof globalThis.Set}function pt(e){return e instanceof globalThis.Map}function mt(e){return e}function ht(e){return S(e,`~kind`)||S(e,`~unsafe`)}function gt(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){if(Qe(e))continue;let r=n[e];S(r,`value`)&&Object.defineProperty(t,e,{...r,value:wt(r.value)})}return t}function _t(e){let t={};for(let n of C(e))Qe(n)||(t[n]=wt(e[n]));for(let n of tt(e))t[n]=wt(e[n]);return t}function vt(e){return Ge(e)?mt(e):ht(e)?gt(e):_t(e)}function yt(e){return e.map(e=>wt(e))}function bt(e){return e.slice()}function xt(e){return new RegExp(e.source,e.flags)}function St(e){return new Map(wt([...e.entries()]))}function Ct(e){return new Set(wt([...e.values()]))}function wt(e){return lt(e)?bt(e):ut(e)?xt(e):pt(e)?St(e):ft(e)?Ct(e):Oe(e)?yt(e):y(e)?vt(e):e}function Tt(e){return de.clone+=1,wt(e)}const Et={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Dt(){return Et}function Ot(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function kt(e,t){return{...e,...t}}function w(e,t,n={}){de.create+=1;let r=Dt(),i=kt(t,n),a=r.enumerableKind?kt(i,e):Ot(i,e);return r.immutableTypes?Object.freeze(a):a}function At(e,t){de.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(Tt(e)),i=new Set(t);for(let e of Object.keys(r))i.has(e)||Object.defineProperty(n,e,r[e]);return n}function T(e,t,n){de.update+=1;let r=Dt(),i=Tt(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return i}function E(e,t){return y(e)&&S(e,`~kind`)&&b(e[`~kind`],t)}function jt(e){return y(e)}function D(e,t,n){return w({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function Mt(e){return E(e,`Deferred`)}function Nt(e){return T(e,{"~readonly":!0},{})}function Pt(e,t){return T(Nt(e),{},t)}function Ft(e,t,n,r){return Pt(K(e,t,n),r)}function It(e){return T(e,{"~optional":!0},{})}function Lt(e,t){return T(It(e),{},t)}function Rt(e,t,n,r){return Lt(K(e,t,n),r)}function zt(e,t){return w({"~kind":`Array`},{type:`array`,items:e},t)}function Bt(e){return E(e,`Array`)}function Vt(e){return At(e,[`~kind`,`type`,`items`])}function Ht(e,t,n={}){return w({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function Ut(e){return E(e,`Constructor`)}function Wt(e){return At(e,[`~kind`,`type`,`parameters`,`instanceType`])}function Gt(e,t,n={}){return w({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function Kt(e){return E(e,`Function`)}function qt(e){return At(e,[`~kind`,`type`,`parameters`,`returnType`])}function Jt(e,t){return w({"~kind":`Ref`},{$ref:e},t)}function Yt(e){return E(e,`Ref`)}function Xt(e,t){return w({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function Zt(e){return E(e,`Generic`)}function Qt(e){return w({"~kind":`Any`},{},e)}function $t(e){return E(e,`Any`)}function O(e){return w({"~kind":`Never`},{not:{}},e)}function en(e){return E(e,`Never`)}function tn(e,t={}){return Lt(e,t)}function nn(e){return tn(e)}function rn(e){return jt(e)&&S(e,`~optional`)}function an(e){return C(e).filter(t=>!rn(e[t]))}function on(e){return C(e)}function sn(e){return nt(e)}function k(e,t={}){let n=an(e);return w({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function A(e){return E(e,`Object`)}function cn(e){return At(e,[`~kind`,`type`,`properties`,`required`])}function ln(e){return w({"~kind":`Unknown`},{},e)}function un(e){return E(e,`Unknown`)}function dn(e,t,n){return w({"~kind":`Cyclic`},{$defs:C(e).reduce((t,n)=>({...t,[n]:T(e[n],{},{$id:n})}),{}),$ref:t},n)}function fn(e){return E(e,`Cyclic`)}function pn(e){return Ie(e)&&S(e,`~unsafe`)&&Pe(e[`~unsafe`])}function mn(e){return E(e,`Infer`)}function hn(e,t,n,r={}){return w({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function gn(e){return E(e,`Dependent`)}function _n(e){return At(e,[`~kind`,`if`,`then`,`else`])}function vn(e){return E(e,`Enum`)}function yn(e,t={}){return w({"~kind":`Intersect`},{allOf:e},t)}function j(e){return E(e,`Intersect`)}function bn(e){return At(e,[`~kind`,`allOf`])}function xn(){throw Error(`Unreachable`)}var Sn=e({Hash:()=>Yn,HashCode:()=>Jn});function Cn(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function wn(e){return typeof e==`number`}var M;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(M||={});let Tn=BigInt(`14695981039346656037`);const[En,Dn]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],On=Array.from({length:256}).map((e,t)=>BigInt(t)),kn=new Float64Array(1),An=new DataView(kn.buffer),jn=new Uint8Array(kn.buffer);function N(e){Tn^=On[e],Tn=Tn*En%Dn}function Mn(e){N(M.Array);for(let t of e)qn(t)}function Nn(e){N(M.BigInt),An.setBigInt64(0,e);for(let e of jn)N(e)}function Pn(e){N(M.Boolean),N(+!!e)}function Fn(e){N(M.Constructor),qn(e.toString())}function In(e){N(M.Date),qn(e.getTime())}function Ln(e){N(M.Function),qn(e.toString())}function Rn(e){N(M.Null)}function zn(e){N(M.Number),An.setFloat64(0,e,!0);for(let e of jn)N(e)}function Bn(e){N(M.Object);for(let t of Cn(e).sort())qn(t),qn(e[t])}function Vn(e){N(M.RegExp),Un(e.toString())}const Hn=new TextEncoder;function Un(e){N(M.String);for(let t of Hn.encode(e))N(t)}function Wn(e){N(M.Symbol),qn(e.toString())}function Gn(e){N(M.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)N(t[e])}function Kn(e){return N(M.Undefined)}function qn(e){return lt(e)?Gn(e):dt(e)?In(e):ut(e)?Vn(e):ot(e)?Pn(e.valueOf()):ct(e)?Un(e.valueOf()):st(e)?zn(e.valueOf()):wn(e)?zn(e):Oe(e)?Mn(e):Ae(e)?Pn(e):ke(e)?Nn(e):je(e)?Fn(e):Pe(e)?Rn(e):y(e)?Bn(e):Le(e)?Un(e):Re(e)?Wn(e):ze(e)?Kn(e):Me(e)?Ln(e):xn()}function Jn(e){return Tn=BigInt(`14695981039346656037`),qn(e),Tn}function Yn(e){return Jn(e).toString(16).padStart(16,`0`)}function Xn(e){return jt(e)&&S(e,`~codec`)&&y(e[`~codec`])&&S(e[`~codec`],`encode`)&&S(e[`~codec`],`decode`)}function Zn(e){return jt(e)&&S(e,`~immutable`)}function Qn(e,t={}){return Pt(e,t)}function $n(e){return jt(e)&&S(e,`~readonly`)}function er(e){return w({"~kind":`BigInt`},{type:`bigint`},e)}function tr(e){return E(e,`BigInt`)}function nr(e){return E(e,`Boolean`)}const rr=`-?(?:0|[1-9][0-9]*)`;function ir(e){return w({"~kind":`Integer`},{type:`integer`},e)}function ar(e){return E(e,`Integer`)}var or=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function sr(e){return ke(e)?`bigint`:Ae(e)?`boolean`:Fe(e)?`number`:Le(e)?`string`:(()=>{throw new or(e)})()}function P(e,t){return w({"~kind":`Literal`},{type:sr(e),const:e},t)}function cr(e){return ke(e)||Ae(e)||Fe(e)||Le(e)}function lr(e){return F(e)&&ke(e.const)}function ur(e){return F(e)&&Ae(e.const)}function dr(e){return F(e)&&Fe(e.const)}function fr(e){return F(e)&&Le(e.const)}function F(e){return E(e,`Literal`)}function pr(e){return w({"~kind":`Null`},{type:`null`},e)}function mr(e){return E(e,`Null`)}const hr=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function gr(e){return w({"~kind":`Number`},{type:`number`},e)}function _r(e){return E(e,`Number`)}function vr(e){return w({"~kind":`Symbol`},{type:`symbol`},e)}function yr(e){return E(e,`Symbol`)}function br(e){return w({"~kind":`String`},{type:`string`},e)}function xr(e){return E(e,`String`)}function I(e,t={}){return w({"~kind":`Union`},{anyOf:e},t)}function L(e){return E(e,`Union`)}function Sr(e){return At(e,[`~kind`,`anyOf`])}function Cr(e){let t=Ka(e);return b(t.length,2)?t[0]:[]}function wr(e){return!0}function Tr(e){return x(e,(e,t)=>Dr(e)?Tr(t):!1,()=>!0)}function Er(e){return!b(e.length,0)&&Tr(e)}function Dr(e){return L(e)?Er(e.anyOf):F(e)?wr(e.const):!1}function Or(e){return Er(e)}function kr(e){return w({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function Ar(e,t,n=[]){return x(e,(e,r)=>Ar(r,t,[...n,`${e}${t}`]),()=>n)}function jr(e,t){return b(e.length,0)?[`${t}`]:Ar(e,t)}function Mr(e,t,n=[]){return x(t,(t,r)=>Mr(e,r,[...n,...Nr(e,t)]),()=>n)}function Nr(e,t){return L(t)?Mr(e,t.anyOf):F(t)?jr(e,t.const):xn()}function Pr(e,t){return x(t,(t,n)=>Pr(Nr(e,t),n),()=>e)}function Fr(e){return e.map(e=>P(e))}function Ir(e){return I(Fr(Pr([],e)))}function Lr(e){return b(e.length,0)?xn():b(e.length,1)&&F(e[0])?e[0]:Ir(e)}function Rr(e){let t=Cr(e);return b(t.length,0)?br():Or(t)?Lr(t):kr(e)}function zr(e){let t=Rr(e);return mo(t)?br():t}function Br(e,t){return w({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function Vr(e){return Br(Wi,e)}function Hr(e){return k({true:e,false:e})}function Ur(e,t={}){let[n,r,i]=[e,e.length,!1];return w({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function R(e){return E(e,`Tuple`)}function Wr(e){return At(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function Gr(e){return At(e,[`~readonly`])}function Kr(e,t){return T(Gr(e),{},t)}function qr(e,t,n,r){return Kr(K(e,t,n),r)}function Jr(e,t={}){return Kr(e,t)}function Yr(e){return At(e,[`~optional`])}function Xr(e,t){return T(Yr(e),{},t)}function Zr(e,t,n,r){return Xr(K(e,t,n),r)}function Qr(e,t={}){return Xr(e,t)}function $r(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function ei(e){return k($r(e.items))}function ti(e,t){return $n(e)?!!$n(t):!1}function ni(e,t){return rn(e)?!!rn(t):!1}function ri(e,t){let n=ti(e,t),r=ni(e,t),i=Jr(Qr(bi([e,t])));return n&&r?Qn(tn(i)):n&&!r?Qn(i):!n&&r?tn(i):i}function ii(e,t,n){return n in e?n in t?ri(e[n],t[n]):e[n]:n in t?t[n]:O()}function ai(e,t){return[...new Set([...C(t),...C(e)])].reduce((n,r)=>({...n,[r]:ii(e,t,r)}),{})}function oi(e){return A(e)?e.properties:R(e)?$r(e.items):xn()}function si(e,t){return k(ai(oi(e),oi(t)))}function ci(e,t){let n=pc(e,t);return b(n,`left-inside`)?e:b(n,`right-inside`)||b(n,`equal`)?t:O()}function li(e){return A(e)||R(e)}function ui(e,t){let n=L(e),r=L(t);return n||r}function di(e,t){let n=Ci(e),r=Ci(t),i=ui(n,r),a=li(n),o=li(r);return i?bi([n,r]):a&&o?si(n,r):a&&!o?n:!a&&o?r:ci(n,r)}function fi(e,t,n=[]){return x(t,(t,r)=>fi(e,r,[...n,di(e,t)]),()=>b(n.length,0)?[e]:n)}function pi(e,t,n=[]){return x(e,(e,r)=>pi(r,t,[...n,...mi([e],t)]),()=>n)}function mi(e,t=[]){return x(e,(e,n)=>L(e)?mi(n,pi(e.anyOf,t)):mi(n,fi(e,t)),()=>t)}function hi(e,t){return yo(fc({},e,t))?[]:[e]}function gi(e,t){return e.reduce((e,n)=>[...e,...hi(n,t)],[])}function _i(e,t){let n=Ci(e);return Si(gi(L(n)?n.anyOf:[n],t))}function vi(e,t,n){return Si([yn([e,t]),_i(n,e)])}function yi(e){return Si(e.map(e=>P(e)))}function bi(e){return wi(vc(mi(e)))}function xi(e){return Ci(zr(e))}function Si(e){return wi(vc(e))}function Ci(e){return gn(e)?vi(e.if,e.then,e.else):vn(e)?yi(e.enum):j(e)?bi(e.allOf):mo(e)?xi(e.pattern):L(e)?Si(e.anyOf):e}function wi(e){return b(e.length,1)?e[0]:b(e.length,0)?O():I(e)}function Ti(e,t){return zi(yi(e),t)}function Ei(e,t){return Br(Hi,t)}function Di(e,t){return zi(bi(e),t)}function Oi(e,t){return Le(e)||Fe(e)?k({[e]:t}):b(e,!1)?k({false:t}):b(e,!0)?k({true:t}):k({})}function ki(e,t){return Br(Ui,t)}function Ai(e,t){return S(e,`pattern`)&&(Le(e.pattern)||e.pattern instanceof RegExp)?Br(e.pattern.toString(),t):Br(Wi,t)}function ji(e,t){return Or(Cr(e))?zi(xi(e),t):Br(e,t)}function Mi(e){return L(e)?Ni(e.anyOf):[e]}function Ni(e){return e.reduce((e,t)=>[...e,...Mi(t)],[])}function Pi(e){return e.some(e=>xr(e)||_r(e)||ar(e))}function Fi(e,t){return b(Pi(e),!0)?Br(Wi,t):void 0}function Ii(e,t){return e.reduce((e,n)=>F(n)&&(Le(n.const)||Fe(n.const))?{...e,[n.const]:t}:e,{})}function Li(e,t){return k(Ii(e,t))}function Ri(e,t){let n=Ni(e),r=Fi(n,t);return jt(r)?r:Li(n,t)}function zi(e,t){return $t(e)?Vr(t):nr(e)?Hr(t):vn(e)?Ti(e.enum,t):ar(e)?Ei(e,t):j(e)?Di(e.allOf,t):F(e)?Oi(e.const,t):_r(e)?ki(e,t):L(e)?Ri(e.anyOf,t):xr(e)?Ai(e,t):mo(e)?ji(e.pattern,t):k({})}function Bi(e,t,n){return G([e])?T(zi(e,t),{},n):Gi(e,t,n)}function Vi(e,t,n,r,i){return Bi(K(e,t,n),K(e,t,r),i)}const Hi=`^${rr}$`,Ui=`^${hr}$`,Wi=`^.*$`;function Gi(e,t,n={}){return D(`Record`,[e,t],n)}function Ki(e,t,n={}){return Bi(e,t,n)}function qi(e,t){return Br(e,t)}function Ji(e){return b(e,Wi)?br():b(e,Hi)?ir():b(e,Ui)?gr():Rr(e)}function Yi(e){return C(e.patternProperties)[0]}function Xi(e){return Ji(Yi(e))}function Zi(e){return e.patternProperties[Yi(e)]}function Qi(e){return E(e,`Record`)}function $i(e){return w({"~kind":`Rest`},{type:`rest`,items:e},{})}function ea(e){return E(e,`Rest`)}function ta(e){return E(e,`This`)}function na(e){return w({"~kind":`Undefined`},{type:`undefined`},e)}function ra(e){return E(e,`Undefined`)}function ia(e){return E(e,`Void`)}function aa(e){return er()}function oa(e){return br()}function sa(e){return gr()}function ca(e){return ir()}function la(e){return O()}function ua(e){return P(e)}function da(e){return e}function fa(e){return I(e[1])}function pa(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function ma(e){return[e[0],...e[1]]}function ha(e){return e}function ga(e){return e[1]}function _a(e){return b(e.length,2)}function va(e,t,n){return _a(e)?t(e[0],e[1]):n()}function ya(e,t){return b(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function ba(e,t){for(let n=0;n<e.length;n++){let r=ya(e[n],t);if(_a(r))return r}return[]}function xa(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}const Sa=[...xa(97,122),...xa(65,90)],Ca=[`0`,...xa(49,57)];function wa(e){let t=e.indexOf(`*/`);return b(t,-1)?``:e.slice(t+2)}function Ta(e){let t=e.indexOf(`
|
|
1
|
+
import{n as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{t as n}from"./logger-LESFN7Hj.js";import{n as r,r as i}from"./panel-rpc-BPwAqRch.js";import{n as a,o,t as s}from"./providers-rNbxX5Js.js";import{a as c,o as l}from"./proxied-fetch-Co-pb0x0.js";import"./src-CcFD5QfS.js";import{t as u}from"./runtime-env-DadgceZk.js";import{i as d,n as f,t as p}from"./api-endpoint-C00IT5T9.js";import{a as m,c as h,l as g,o as ee,s as _}from"./claude-model-version-Csn7RPVg.js";import"./libesm-zfj8k-QN.js";import"./runtime-env-Dtj99aNH.js";import{t as te}from"./port-bridge-client-Bz2N1tvn.js";import{r as ne,t as re}from"./image-markers-CdcIBWOf.js";import{o as ie,s as ae}from"./tool-ui-DRnUkp2g.js";import{r as oe,t as se}from"./bedrock-camp-compat-CYnC9BQI.js";const ce=`slicc_oauth_extra_domains`;function le(e){try{let t=e.getItem(ce);if(!t)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n)){if(typeof e!=`string`||!Array.isArray(t))continue;let n=t.filter(e=>typeof e==`string`&&e.length>0);n.length>0&&(r[e]=n)}return r}catch{return{}}}function ue(e,t){try{e.setItem(ce,JSON.stringify(t))}catch(e){throw Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${e instanceof Error?e.message:String(e)}`)}}const de={assign:0,create:0,clone:0,discard:0,update:0};function v(e,t){return de.assign+=1,{...e,...t}}function fe(e,t,n){return e>=t&&e<=n}function pe(e){return e===8205}function me(e){return fe(e,55296,56319)}function he(e){return fe(e,127462,127487)}function ge(e){return fe(e,65024,65039)}function _e(e){return fe(e,768,879)||fe(e,6832,6911)||fe(e,7616,7679)||fe(e,65056,65071)}function ve(e){return e>65535?2:1}function ye(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(_e(n)||ge(n))t+=ve(n);else break}return t}function be(e,t){let n=e.codePointAt(t),r=t+ve(n);for(r=ye(e,r);r<e.length-1&&e[r]===``;){let t=e.codePointAt(r+1);r+=1+ve(t),r=ye(e,r)}return he(n)&&r<e.length&&he(e.codePointAt(r))&&(r+=ve(e.codePointAt(r))),r}function xe(e){return me(e)||_e(e)||ge(e)||pe(e)}function Se(e){let t=0,n=0;for(;n<e.length;)n=be(e,n),t++;return t}function Ce(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=be(e,r),n++,n>=t)return!0;return!1}function we(e,t){let n=0,r=0;for(;r<e.length;)if(r=be(e,r),n++,n>t)return!1;return!0}function Te(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(xe(e.charCodeAt(n)))return Ce(e,t);if(n++,n>=t)return!0}return!1}function Ee(e,t){let n=0;for(;n<e.length;){if(xe(e.charCodeAt(n)))return we(e,t);if(n++,n>t)return!1}return!0}var De=e({Entries:()=>et,EntriesRegExp:()=>$e,Every:()=>Xe,EveryAll:()=>Ze,GraphemeCount:()=>qe,HasPropertyKey:()=>S,IsArray:()=>Oe,IsBigInt:()=>ke,IsBoolean:()=>Ae,IsClassInstance:()=>Ge,IsConstructor:()=>je,IsDeepEqual:()=>at,IsEqual:()=>b,IsFunction:()=>Me,IsGreaterEqualThan:()=>Ue,IsGreaterThan:()=>Be,IsInteger:()=>Ne,IsLessEqualThan:()=>He,IsLessThan:()=>Ve,IsMaxLength:()=>Je,IsMinLength:()=>Ye,IsMultipleOf:()=>We,IsNull:()=>Pe,IsNumber:()=>Fe,IsObject:()=>y,IsObjectNotArray:()=>Ie,IsString:()=>Le,IsSymbol:()=>Re,IsUndefined:()=>ze,IsUnsafePropertyKey:()=>Qe,IsValueLike:()=>Ke,Keys:()=>C,ShiftLeft:()=>x,Symbols:()=>tt,Values:()=>nt});function Oe(e){return Array.isArray(e)}function ke(e){return b(typeof e,`bigint`)}function Ae(e){return b(typeof e,`boolean`)}function je(e){if(ze(e)||!Me(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Me(e){return b(typeof e,`function`)}function Ne(e){return Number.isInteger(e)}function Pe(e){return b(e,null)}function Fe(e){return Number.isFinite(e)}function Ie(e){return y(e)&&!Oe(e)}function y(e){return b(typeof e,`object`)&&!Pe(e)}function Le(e){return b(typeof e,`string`)}function Re(e){return b(typeof e,`symbol`)}function ze(e){return b(e,void 0)}function b(e,t){return e===t}function Be(e,t){return e>t}function Ve(e,t){return e<t}function He(e,t){return e<=t}function Ue(e,t){return e>=t}function We(e,t){if(ke(e)||ke(t))return BigInt(e)%BigInt(t)===0n;if(!Fe(e)||Ne(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<1e-10}function Ge(e){if(!y(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!Pe(t)&&b(typeof t.constructor,`function`)&&!(b(t.constructor,globalThis.Object)||b(t.constructor.name,`Object`))}function Ke(e){return ke(e)||Ae(e)||Pe(e)||Fe(e)||Le(e)||ze(e)}function qe(e){return Se(e)}function Je(e,t){return Ee(e,t)}function Ye(e,t){return Te(e,t)}function Xe(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Ze(e,t,n){let r=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(r=!1);return r}function x(e,t,n){return b(e.length,0)?n():t(e[0],e.slice(1))}function Qe(e){return b(e,`__proto__`)||b(e,`constructor`)||b(e,`prototype`)}function S(e,t){return Qe(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function $e(e){return C(e).map(t=>[RegExp(`^${t}$`),e[t]])}function et(e){return Object.entries(e)}function C(e){return Object.getOwnPropertyNames(e)}function tt(e){return Object.getOwnPropertySymbols(e)}function nt(e){return Object.values(e)}function rt(e,t){if(!y(t))return!1;let n=C(e);return b(n.length,C(t).length)&&n.every(n=>at(e[n],t[n]))}function it(e,t){return Oe(t)&&b(e.length,t.length)&&e.every((n,r)=>at(e[r],t[r]))}function at(e,t){return Oe(e)?it(e,t):y(e)?rt(e,t):b(e,t)}function ot(e){return e instanceof Boolean}function st(e){return e instanceof Number}function ct(e){return e instanceof String}function lt(e){return globalThis.ArrayBuffer.isView(e)}function ut(e){return e instanceof globalThis.RegExp}function dt(e){return e instanceof globalThis.Date}function ft(e){return e instanceof globalThis.Set}function pt(e){return e instanceof globalThis.Map}function mt(e){return e}function ht(e){return S(e,`~kind`)||S(e,`~unsafe`)}function gt(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){if(Qe(e))continue;let r=n[e];S(r,`value`)&&Object.defineProperty(t,e,{...r,value:wt(r.value)})}return t}function _t(e){let t={};for(let n of C(e))Qe(n)||(t[n]=wt(e[n]));for(let n of tt(e))t[n]=wt(e[n]);return t}function vt(e){return Ge(e)?mt(e):ht(e)?gt(e):_t(e)}function yt(e){return e.map(e=>wt(e))}function bt(e){return e.slice()}function xt(e){return new RegExp(e.source,e.flags)}function St(e){return new Map(wt([...e.entries()]))}function Ct(e){return new Set(wt([...e.values()]))}function wt(e){return lt(e)?bt(e):ut(e)?xt(e):pt(e)?St(e):ft(e)?Ct(e):Oe(e)?yt(e):y(e)?vt(e):e}function Tt(e){return de.clone+=1,wt(e)}const Et={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Dt(){return Et}function Ot(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function kt(e,t){return{...e,...t}}function w(e,t,n={}){de.create+=1;let r=Dt(),i=kt(t,n),a=r.enumerableKind?kt(i,e):Ot(i,e);return r.immutableTypes?Object.freeze(a):a}function At(e,t){de.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(Tt(e)),i=new Set(t);for(let e of Object.keys(r))i.has(e)||Object.defineProperty(n,e,r[e]);return n}function T(e,t,n){de.update+=1;let r=Dt(),i=Tt(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return i}function E(e,t){return y(e)&&S(e,`~kind`)&&b(e[`~kind`],t)}function jt(e){return y(e)}function D(e,t,n){return w({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function Mt(e){return E(e,`Deferred`)}function Nt(e){return T(e,{"~readonly":!0},{})}function Pt(e,t){return T(Nt(e),{},t)}function Ft(e,t,n,r){return Pt(K(e,t,n),r)}function It(e){return T(e,{"~optional":!0},{})}function Lt(e,t){return T(It(e),{},t)}function Rt(e,t,n,r){return Lt(K(e,t,n),r)}function zt(e,t){return w({"~kind":`Array`},{type:`array`,items:e},t)}function Bt(e){return E(e,`Array`)}function Vt(e){return At(e,[`~kind`,`type`,`items`])}function Ht(e,t,n={}){return w({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function Ut(e){return E(e,`Constructor`)}function Wt(e){return At(e,[`~kind`,`type`,`parameters`,`instanceType`])}function Gt(e,t,n={}){return w({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function Kt(e){return E(e,`Function`)}function qt(e){return At(e,[`~kind`,`type`,`parameters`,`returnType`])}function Jt(e,t){return w({"~kind":`Ref`},{$ref:e},t)}function Yt(e){return E(e,`Ref`)}function Xt(e,t){return w({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function Zt(e){return E(e,`Generic`)}function Qt(e){return w({"~kind":`Any`},{},e)}function $t(e){return E(e,`Any`)}function O(e){return w({"~kind":`Never`},{not:{}},e)}function en(e){return E(e,`Never`)}function tn(e,t={}){return Lt(e,t)}function nn(e){return tn(e)}function rn(e){return jt(e)&&S(e,`~optional`)}function an(e){return C(e).filter(t=>!rn(e[t]))}function on(e){return C(e)}function sn(e){return nt(e)}function k(e,t={}){let n=an(e);return w({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function A(e){return E(e,`Object`)}function cn(e){return At(e,[`~kind`,`type`,`properties`,`required`])}function ln(e){return w({"~kind":`Unknown`},{},e)}function un(e){return E(e,`Unknown`)}function dn(e,t,n){return w({"~kind":`Cyclic`},{$defs:C(e).reduce((t,n)=>({...t,[n]:T(e[n],{},{$id:n})}),{}),$ref:t},n)}function fn(e){return E(e,`Cyclic`)}function pn(e){return Ie(e)&&S(e,`~unsafe`)&&Pe(e[`~unsafe`])}function mn(e){return E(e,`Infer`)}function hn(e,t,n,r={}){return w({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function gn(e){return E(e,`Dependent`)}function _n(e){return At(e,[`~kind`,`if`,`then`,`else`])}function vn(e){return E(e,`Enum`)}function yn(e,t={}){return w({"~kind":`Intersect`},{allOf:e},t)}function j(e){return E(e,`Intersect`)}function bn(e){return At(e,[`~kind`,`allOf`])}function xn(){throw Error(`Unreachable`)}var Sn=e({Hash:()=>Yn,HashCode:()=>Jn});function Cn(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function wn(e){return typeof e==`number`}var M;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(M||={});let Tn=BigInt(`14695981039346656037`);const[En,Dn]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],On=Array.from({length:256}).map((e,t)=>BigInt(t)),kn=new Float64Array(1),An=new DataView(kn.buffer),jn=new Uint8Array(kn.buffer);function N(e){Tn^=On[e],Tn=Tn*En%Dn}function Mn(e){N(M.Array);for(let t of e)qn(t)}function Nn(e){N(M.BigInt),An.setBigInt64(0,e);for(let e of jn)N(e)}function Pn(e){N(M.Boolean),N(+!!e)}function Fn(e){N(M.Constructor),qn(e.toString())}function In(e){N(M.Date),qn(e.getTime())}function Ln(e){N(M.Function),qn(e.toString())}function Rn(e){N(M.Null)}function zn(e){N(M.Number),An.setFloat64(0,e,!0);for(let e of jn)N(e)}function Bn(e){N(M.Object);for(let t of Cn(e).sort())qn(t),qn(e[t])}function Vn(e){N(M.RegExp),Un(e.toString())}const Hn=new TextEncoder;function Un(e){N(M.String);for(let t of Hn.encode(e))N(t)}function Wn(e){N(M.Symbol),qn(e.toString())}function Gn(e){N(M.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)N(t[e])}function Kn(e){return N(M.Undefined)}function qn(e){return lt(e)?Gn(e):dt(e)?In(e):ut(e)?Vn(e):ot(e)?Pn(e.valueOf()):ct(e)?Un(e.valueOf()):st(e)?zn(e.valueOf()):wn(e)?zn(e):Oe(e)?Mn(e):Ae(e)?Pn(e):ke(e)?Nn(e):je(e)?Fn(e):Pe(e)?Rn(e):y(e)?Bn(e):Le(e)?Un(e):Re(e)?Wn(e):ze(e)?Kn(e):Me(e)?Ln(e):xn()}function Jn(e){return Tn=BigInt(`14695981039346656037`),qn(e),Tn}function Yn(e){return Jn(e).toString(16).padStart(16,`0`)}function Xn(e){return jt(e)&&S(e,`~codec`)&&y(e[`~codec`])&&S(e[`~codec`],`encode`)&&S(e[`~codec`],`decode`)}function Zn(e){return jt(e)&&S(e,`~immutable`)}function Qn(e,t={}){return Pt(e,t)}function $n(e){return jt(e)&&S(e,`~readonly`)}function er(e){return w({"~kind":`BigInt`},{type:`bigint`},e)}function tr(e){return E(e,`BigInt`)}function nr(e){return E(e,`Boolean`)}const rr=`-?(?:0|[1-9][0-9]*)`;function ir(e){return w({"~kind":`Integer`},{type:`integer`},e)}function ar(e){return E(e,`Integer`)}var or=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function sr(e){return ke(e)?`bigint`:Ae(e)?`boolean`:Fe(e)?`number`:Le(e)?`string`:(()=>{throw new or(e)})()}function P(e,t){return w({"~kind":`Literal`},{type:sr(e),const:e},t)}function cr(e){return ke(e)||Ae(e)||Fe(e)||Le(e)}function lr(e){return F(e)&&ke(e.const)}function ur(e){return F(e)&&Ae(e.const)}function dr(e){return F(e)&&Fe(e.const)}function fr(e){return F(e)&&Le(e.const)}function F(e){return E(e,`Literal`)}function pr(e){return w({"~kind":`Null`},{type:`null`},e)}function mr(e){return E(e,`Null`)}const hr=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function gr(e){return w({"~kind":`Number`},{type:`number`},e)}function _r(e){return E(e,`Number`)}function vr(e){return w({"~kind":`Symbol`},{type:`symbol`},e)}function yr(e){return E(e,`Symbol`)}function br(e){return w({"~kind":`String`},{type:`string`},e)}function xr(e){return E(e,`String`)}function I(e,t={}){return w({"~kind":`Union`},{anyOf:e},t)}function L(e){return E(e,`Union`)}function Sr(e){return At(e,[`~kind`,`anyOf`])}function Cr(e){let t=Ka(e);return b(t.length,2)?t[0]:[]}function wr(e){return!0}function Tr(e){return x(e,(e,t)=>Dr(e)?Tr(t):!1,()=>!0)}function Er(e){return!b(e.length,0)&&Tr(e)}function Dr(e){return L(e)?Er(e.anyOf):F(e)?wr(e.const):!1}function Or(e){return Er(e)}function kr(e){return w({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function Ar(e,t,n=[]){return x(e,(e,r)=>Ar(r,t,[...n,`${e}${t}`]),()=>n)}function jr(e,t){return b(e.length,0)?[`${t}`]:Ar(e,t)}function Mr(e,t,n=[]){return x(t,(t,r)=>Mr(e,r,[...n,...Nr(e,t)]),()=>n)}function Nr(e,t){return L(t)?Mr(e,t.anyOf):F(t)?jr(e,t.const):xn()}function Pr(e,t){return x(t,(t,n)=>Pr(Nr(e,t),n),()=>e)}function Fr(e){return e.map(e=>P(e))}function Ir(e){return I(Fr(Pr([],e)))}function Lr(e){return b(e.length,0)?xn():b(e.length,1)&&F(e[0])?e[0]:Ir(e)}function Rr(e){let t=Cr(e);return b(t.length,0)?br():Or(t)?Lr(t):kr(e)}function zr(e){let t=Rr(e);return mo(t)?br():t}function Br(e,t){return w({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function Vr(e){return Br(Wi,e)}function Hr(e){return k({true:e,false:e})}function Ur(e,t={}){let[n,r,i]=[e,e.length,!1];return w({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function R(e){return E(e,`Tuple`)}function Wr(e){return At(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function Gr(e){return At(e,[`~readonly`])}function Kr(e,t){return T(Gr(e),{},t)}function qr(e,t,n,r){return Kr(K(e,t,n),r)}function Jr(e,t={}){return Kr(e,t)}function Yr(e){return At(e,[`~optional`])}function Xr(e,t){return T(Yr(e),{},t)}function Zr(e,t,n,r){return Xr(K(e,t,n),r)}function Qr(e,t={}){return Xr(e,t)}function $r(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function ei(e){return k($r(e.items))}function ti(e,t){return $n(e)?!!$n(t):!1}function ni(e,t){return rn(e)?!!rn(t):!1}function ri(e,t){let n=ti(e,t),r=ni(e,t),i=Jr(Qr(bi([e,t])));return n&&r?Qn(tn(i)):n&&!r?Qn(i):!n&&r?tn(i):i}function ii(e,t,n){return n in e?n in t?ri(e[n],t[n]):e[n]:n in t?t[n]:O()}function ai(e,t){return[...new Set([...C(t),...C(e)])].reduce((n,r)=>({...n,[r]:ii(e,t,r)}),{})}function oi(e){return A(e)?e.properties:R(e)?$r(e.items):xn()}function si(e,t){return k(ai(oi(e),oi(t)))}function ci(e,t){let n=pc(e,t);return b(n,`left-inside`)?e:b(n,`right-inside`)||b(n,`equal`)?t:O()}function li(e){return A(e)||R(e)}function ui(e,t){let n=L(e),r=L(t);return n||r}function di(e,t){let n=Ci(e),r=Ci(t),i=ui(n,r),a=li(n),o=li(r);return i?bi([n,r]):a&&o?si(n,r):a&&!o?n:!a&&o?r:ci(n,r)}function fi(e,t,n=[]){return x(t,(t,r)=>fi(e,r,[...n,di(e,t)]),()=>b(n.length,0)?[e]:n)}function pi(e,t,n=[]){return x(e,(e,r)=>pi(r,t,[...n,...mi([e],t)]),()=>n)}function mi(e,t=[]){return x(e,(e,n)=>L(e)?mi(n,pi(e.anyOf,t)):mi(n,fi(e,t)),()=>t)}function hi(e,t){return yo(fc({},e,t))?[]:[e]}function gi(e,t){return e.reduce((e,n)=>[...e,...hi(n,t)],[])}function _i(e,t){let n=Ci(e);return Si(gi(L(n)?n.anyOf:[n],t))}function vi(e,t,n){return Si([yn([e,t]),_i(n,e)])}function yi(e){return Si(e.map(e=>P(e)))}function bi(e){return wi(vc(mi(e)))}function xi(e){return Ci(zr(e))}function Si(e){return wi(vc(e))}function Ci(e){return gn(e)?vi(e.if,e.then,e.else):vn(e)?yi(e.enum):j(e)?bi(e.allOf):mo(e)?xi(e.pattern):L(e)?Si(e.anyOf):e}function wi(e){return b(e.length,1)?e[0]:b(e.length,0)?O():I(e)}function Ti(e,t){return zi(yi(e),t)}function Ei(e,t){return Br(Hi,t)}function Di(e,t){return zi(bi(e),t)}function Oi(e,t){return Le(e)||Fe(e)?k({[e]:t}):b(e,!1)?k({false:t}):b(e,!0)?k({true:t}):k({})}function ki(e,t){return Br(Ui,t)}function Ai(e,t){return S(e,`pattern`)&&(Le(e.pattern)||e.pattern instanceof RegExp)?Br(e.pattern.toString(),t):Br(Wi,t)}function ji(e,t){return Or(Cr(e))?zi(xi(e),t):Br(e,t)}function Mi(e){return L(e)?Ni(e.anyOf):[e]}function Ni(e){return e.reduce((e,t)=>[...e,...Mi(t)],[])}function Pi(e){return e.some(e=>xr(e)||_r(e)||ar(e))}function Fi(e,t){return b(Pi(e),!0)?Br(Wi,t):void 0}function Ii(e,t){return e.reduce((e,n)=>F(n)&&(Le(n.const)||Fe(n.const))?{...e,[n.const]:t}:e,{})}function Li(e,t){return k(Ii(e,t))}function Ri(e,t){let n=Ni(e),r=Fi(n,t);return jt(r)?r:Li(n,t)}function zi(e,t){return $t(e)?Vr(t):nr(e)?Hr(t):vn(e)?Ti(e.enum,t):ar(e)?Ei(e,t):j(e)?Di(e.allOf,t):F(e)?Oi(e.const,t):_r(e)?ki(e,t):L(e)?Ri(e.anyOf,t):xr(e)?Ai(e,t):mo(e)?ji(e.pattern,t):k({})}function Bi(e,t,n){return G([e])?T(zi(e,t),{},n):Gi(e,t,n)}function Vi(e,t,n,r,i){return Bi(K(e,t,n),K(e,t,r),i)}const Hi=`^${rr}$`,Ui=`^${hr}$`,Wi=`^.*$`;function Gi(e,t,n={}){return D(`Record`,[e,t],n)}function Ki(e,t,n={}){return Bi(e,t,n)}function qi(e,t){return Br(e,t)}function Ji(e){return b(e,Wi)?br():b(e,Hi)?ir():b(e,Ui)?gr():Rr(e)}function Yi(e){return C(e.patternProperties)[0]}function Xi(e){return Ji(Yi(e))}function Zi(e){return e.patternProperties[Yi(e)]}function Qi(e){return E(e,`Record`)}function $i(e){return w({"~kind":`Rest`},{type:`rest`,items:e},{})}function ea(e){return E(e,`Rest`)}function ta(e){return E(e,`This`)}function na(e){return w({"~kind":`Undefined`},{type:`undefined`},e)}function ra(e){return E(e,`Undefined`)}function ia(e){return E(e,`Void`)}function aa(e){return er()}function oa(e){return br()}function sa(e){return gr()}function ca(e){return ir()}function la(e){return O()}function ua(e){return P(e)}function da(e){return e}function fa(e){return I(e[1])}function pa(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function ma(e){return[e[0],...e[1]]}function ha(e){return e}function ga(e){return e[1]}function _a(e){return b(e.length,2)}function va(e,t,n){return _a(e)?t(e[0],e[1]):n()}function ya(e,t){return b(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function ba(e,t){for(let n=0;n<e.length;n++){let r=ya(e[n],t);if(_a(r))return r}return[]}function xa(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}const Sa=[...xa(97,122),...xa(65,90)],Ca=[`0`,...xa(49,57)];function wa(e){let t=e.indexOf(`*/`);return b(t,-1)?``:e.slice(t+2)}function Ta(e){let t=e.indexOf(`
|
|
2
2
|
`);return b(t,-1)?``:e.slice(t)}function Ea(e){return e.replace(/^[ \t\r\f\v]+/,``)}function Da(e){let t=Ea(e);return t.startsWith(`/*`)?Da(wa(t.slice(2))):t.startsWith(`//`)?Da(Ta(t.slice(2))):t}function Oa(e){let t=e.trimStart();return t.startsWith(`/*`)?Oa(wa(t.slice(2))):t.startsWith(`//`)?Oa(Ta(t.slice(2))):t}[...Ca];function ka(e,t){return ba([e],t)}function Aa(e,t){return b(e,``)?[``,t]:e.startsWith(`
|
|
3
3
|
`)?ka(e,Da(t)):e.startsWith(` `)?ka(e,t):ka(e,Oa(t))}[...Sa,...Ca],[...Ca];function ja(e){return b(e,``)?[]:[e.slice(0,1),e.slice(1)]}function Ma(e,t){return x(e,(e,n)=>t.startsWith(e)?!0:Ma(n,t),()=>!1)}function Na(e,t,n=``){return va(ja(t),(r,i)=>Ma(e,t)?[n,t]:Na(e,i,`${n}${r}`),()=>[])}function Pa(e,t){return va(Na(e,t),(e,t)=>b(e,``)?[]:[e,t],()=>[])}const z=(e,t,n=()=>[])=>e.length===2?t(e):n(),Fa=e=>z(Aa(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[aa(e),t]),Ia=e=>z(Aa(`.*`,e),([e,t])=>[oa(e),t]),La=e=>z(Aa(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[sa(e),t]),Ra=e=>z(Aa(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[ca(e),t]),za=e=>z(Aa(`(?!)`,e),([e,t])=>[la(e),t]),Ba=e=>z(Pa([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[ua(e),t]),Va=e=>z(z(Fa(e),([e,t])=>[e,t],()=>z(Ia(e),([e,t])=>[e,t],()=>z(La(e),([e,t])=>[e,t],()=>z(Ra(e),([e,t])=>[e,t],()=>z(za(e),([e,t])=>[e,t],()=>z(Ha(e),([e,t])=>[e,t],()=>z(Ba(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[da(e),t]),Ha=e=>z(z(Aa(`(`,e),([e,t])=>z(Ga(t),([t,n])=>z(Aa(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[fa(e),t]),Ua=e=>z(z(z(Wa(e),([e,t])=>z(Aa(`|`,t),([t,n])=>z(Ua(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>z(z(Wa(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>z([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[pa(e),t]),Wa=e=>z(z(Va(e),([e,t])=>z(Ga(t),([t,n])=>[[e,t],n])),([e,t])=>[ma(e),t]),Ga=e=>z(z(Ua(e),([e,t])=>[e,t],()=>z(Wa(e),([e,t])=>[e,t],()=>[])),([e,t])=>[ha(e),t]),Ka=e=>z(z(Aa(`^`,e),([e,t])=>z(Ga(t),([t,n])=>z(Aa(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[ga(e),t]);function qa(e){return e.join(`|`)}function Ja(e){return e.slice(1,e.length-1)}function Ya(e,t,n){return oo(t,`${n}${e}`)}function Xa(e,t){return oo(e,`${t}-?(?:0|[1-9][0-9]*)n`)}function Za(e,t){return oo(e,`${t}${rr}`)}function Qa(e,t){return oo(e,`${t}${hr}`)}function $a(e,t){return ao(I([P(`false`),P(`true`)]),e,t)}function eo(e,t){return oo(e,`${t}.*`)}function to(e,t,n){return oo(t,`${n}${Ja(e)}`)}function no(e,t,n){return ao(lo(e,{}),t,n)}function ro(e,t,n){return ao(yi(e),t,n)}function io(e,t,n,r=[]){return x(e,(e,i)=>io(i,t,n,[...r,ao(e,[],``)]),()=>oo(t,`${n}(${qa(r)})`))}function ao(e,t,n){return vn(e)?ro(e.enum,t,n):ar(e)?Za(t,n):F(e)?Ya(e.const,t,n):tr(e)?Xa(t,n):nr(e)?$a(t,n):_r(e)?Qa(t,n):xr(e)?eo(t,n):mo(e)?to(e.pattern,t,n):po(e)?no(e.parameters[0],t,n):L(e)?io(e.anyOf,t,n):`(?!)`}function oo(e,t){return x(e,(e,n)=>ao(e,n,t),()=>t)}function so(e){return`^${oo(e,``)}$`}function co(e){return kr(so(e))}function lo(e,t){return G(e)?T(co(e),{},t):fo(e,t)}function uo(e,t,n,r){return lo(_f(e,t,n),r)}function fo(e,t={}){return D(`TemplateLiteral`,[e],t)}function po(e){return jt(e)&&S(e,`action`)&&b(e.action,`TemplateLiteral`)}function mo(e){return E(e,`TemplateLiteral`)}function ho(e){return w({"~kind":`ExtendsUnion`},{inferred:e})}function go(e){return y(e)&&S(e,`~kind`)&&S(e,`inferred`)&&b(e[`~kind`],`ExtendsUnion`)&&y(e.inferred)}function B(e){return w({"~kind":`ExtendsTrue`},{inferred:e})}function _o(e){return y(e)&&S(e,`~kind`)&&S(e,`inferred`)&&b(e[`~kind`],`ExtendsTrue`)&&y(e.inferred)}function V(){return w({"~kind":`ExtendsFalse`},{})}function vo(e){return y(e)&&S(e,`~kind`)&&b(e[`~kind`],`ExtendsFalse`)}function yo(e){return go(e)||_o(e)}function H(e,t,n){return yo(e)?t(e.inferred):n()}function bo(e,t,n,r){return H(W(e,n,r),r=>B(v(v(e,r),{[t]:n})),()=>V())}function xo(e,t){return B(e)}function So(e,t,n,r,i){return H(W(e,t,n),e=>H(W(e,t,r),e=>B(e),()=>V()),()=>H(W(e,t,i),e=>B(e),()=>V()))}function Co(e,t,n){return W(e,t,yi(n))}function wo(e,t,n){return x(n,(n,r)=>H(W(e,t,n),e=>wo(e,t,r),()=>V()),()=>B(e))}function To(e,t,n){return W(e,t,xi(n))}function Eo(e,t,n){return x(n,(n,r)=>H(W(e,t,n),e=>B(e),()=>Eo(e,t,r)),()=>V())}function U(e,t,n){return $t(n)?xo(e,t):gn(n)?So(e,t,n.if,n.then,n.else):vn(n)?Co(e,t,n.enum):mn(n)?bo(e,n.name,t,n.extends):j(n)?wo(e,t,n.allOf):mo(n)?To(e,t,n.pattern):L(n)?Eo(e,t,n.anyOf):un(n)?B(e):V()}function Do(e,t,n){return mn(n)?U(e,t,n):$t(n)||un(n)?B(e):ho(e)}function Oo(e,t){let n=Zn(e),r=Zn(t);return n&&r||!n&&r?!0:!(n&&!r)}function ko(e,t,n,r){return Bt(r)?Oo(t,r)?W(e,n,r.items):V():U(e,t,r)}function Ao(e,t,n){return tr(n)?B(e):U(e,t,n)}function jo(e,t,n){return nr(n)?B(e):U(e,t,n)}function Mo(e,t,n,r,i){let a=mn(r)?t:r,o=mn(r)?r:t,s=rn(t),c=rn(r);return!s&&c?V():H(W(e,a,o),e=>Fo(e,n,i),()=>V())}function No(e,t,n,r){return x(r,(r,i)=>Mo(e,t,n,r,i),()=>rn(t)?B(e):V())}function Po(e,t,n){return x(t,(t,r)=>No(e,t,r,n),()=>B(e))}function Fo(e,t,n){return Po(e,t,n)}function Io(e,t,n){return ia(n)?B(e):W(e,t,n)}function Lo(e,t,n,r){return $t(r)||un(r)?B(e):Ut(r)?H(Fo(e,t,r.parameters),e=>Io(e,n,r.instanceType),()=>V()):V()}function Ro(e,t,n,r,i){return H(W(e,t,i),()=>W(e,n,i),()=>W(e,r,i))}function zo(e,t,n){return W(e,yi(t),n)}function Bo(e,t,n,r){return $t(r)||un(r)?B(e):Kt(r)?H(Fo(e,t,r.parameters),e=>Io(e,n,r.returnType),()=>V()):V()}function Vo(e,t,n){return ar(n)||_r(n)?B(e):U(e,t,n)}function Ho(e,t,n){return W(e,bi(t),n)}function Uo(e,t,n){return t===n?B(e):V()}function Wo(e,t,n){return F(n)?Uo(e,t,n.const):tr(n)?B(e):U(e,P(t),n)}function Go(e,t,n){return F(n)?Uo(e,t,n.const):nr(n)?B(e):U(e,P(t),n)}function Ko(e,t,n){return F(n)?Uo(e,t,n.const):_r(n)?B(e):U(e,P(t),n)}function qo(e,t,n){return F(n)?Uo(e,t,n.const):xr(n)?B(e):U(e,P(t),n)}function Jo(e,t,n){return ke(t.const)?Wo(e,t.const,n):Ae(t.const)?Go(e,t.const,n):Fe(t.const)?Ko(e,t.const,n):Le(t.const)?qo(e,t.const,n):xn()}function Yo(e,t,n){return mn(n)?U(e,t,n):B(e)}function Xo(e,t,n){return mr(n)?B(e):U(e,t,n)}function Zo(e,t,n){return _r(n)?B(e):U(e,t,n)}function Qo(e,t,n){return rn(t)?rn(n)?B(e):V():B(e)}function $o(e,t,n){return mn(n)&&en(n.extends)?V():H(W(e,t,n),e=>Qo(e,t,n),()=>V())}function es(e,t){return e.reduce((e,n)=>n in t&&yo(t[n])?{...e,...t[n].inferred}:xn(),{})}function ts(e,t,n){let r={};for(let i of C(n))r[i]=i in t?$o({},t[i],n[i]):rn(n[i])?mn(n[i])?B(v(e,{[n[i].name]:n[i].extends})):B(e):V();let i=nt(r).every(e=>yo(e)),a=i?es(C(r),r):{};return i?B(a):V()}function ns(e,t,n){let r=ts(e,t,n);return yo(r)?B(v(e,r.inferred)):V()}function rs(e,t,n){return ns(e,t,n)}function is(e,t){return C(t).reduce((n,r)=>({...n,[r]:S(e,r)?L(n[r])?I([...n[r].anyOf,t[r]]):I([e[r],t[r]]):t[r]}),e)}function as(e,t,n,r){return x(t,(t,i)=>H(W({},e[t],n),t=>as(e,i,n,is(r,t)),()=>V()),()=>B(r))}function os(e,t,n,r){return as(t,C(t),r,e)}function ss(e,t,n){return Qi(n)?os(e,t,Yi(n),Zi(n)):A(n)?rs(e,t,n.properties):U(e,k(t),n)}function cs(e,t){return b(C(t).length,0)?B(e):V()}function ls(e,t,n,r,i){return W(e,n,i)}function us(e,t,n,r){return Qi(r)?ls(e,Ji(t),n,Ji(Yi(r)),Zi(r)):A(r)?cs(e,r.properties):$t(r)||un(r)?B(e):V()}function ds(e,t,n){return xr(n)?B(e):U(e,t,n)}function fs(e,t,n){return yr(n)?B(e):U(e,t,n)}function ps(e,t,n){return W(e,xi(t),n)}function ms(e,t){return w({"~kind":`Inferrable`},{name:e,type:t},{})}function hs(e){return y(e)&&S(e,`~kind`)&&S(e,`name`)&&S(e,`type`)&&b(e[`~kind`],`Inferrable`)&&Le(e.name)&&y(e.type)}function gs(e){return ea(e)?mn(e.items)?Bt(e.items.extends)?ms(e.items.name,e.items.extends.items):un(e.items.extends)?ms(e.items.name,e.items.extends):void 0:xn():void 0}function _s(e){return mn(e)?ms(e.name,e.extends):void 0}function vs(e,t,n=[]){return x(e,(e,r)=>H(W({},e,t),()=>vs(r,t,[...n,e]),()=>void 0),()=>n)}function ys(e,t,n,r){let i=vs(n,r);return Oe(i)?B(v(e,{[t]:Ur(i)})):V()}function bs(e,t,n,r){let i=vs(n,r);return Oe(i)?B(v(e,{[t]:I(i)})):V()}function xs(e){return[...e].reverse()}function Ss(e,t){return t?xs(e):e}function Cs(e){let t=e.length>0?e[0]:void 0;return jt(jt(t)?gs(t):void 0)}function ws(e,t,n,r,i,a){return H(W(e,n,i),e=>Ds(e,t,r,a),()=>V())}function Ts(e,t,n,r,i){let a=gs(r);return hs(a)?ys(e,a.name,Ss(n,t),a.type):x(n,(n,a)=>ws(e,t,n,a,r,i),()=>V())}function Es(e,t,n,r){return x(r,(r,i)=>Ts(e,t,n,r,i),()=>b(n.length,0)?B(e):V())}function Ds(e,t,n,r){return Es(e,t,n,r)}function Os(e,t,n){let r=gf(e,mf([],[]),n),i=Cs(r);return Ds(e,i,Ss(t,i),Ss(r,i))}function ks(e,t,n){let r=_s(n);return hs(r)?bs(e,r.name,t,r.type):x(t,(t,r)=>H(W(e,t,n),e=>ks(e,r,n),()=>V()),()=>B(e))}function As(e,t,n){let r=gf(e,mf([],[]),t);return R(n)?Os(e,r,n.items):Bt(n)?ks(e,r,n.items):U(e,Ur(r),n)}function js(e,t,n){return ia(n)||ra(n)?B(e):U(e,t,n)}function Ms(e,t,n){return x(n,(n,r)=>H(W(e,t,n),e=>B(e),()=>Ms(e,t,r)),()=>V())}function Ns(e,t,n){return x(t,(t,r)=>H(Ms(e,t,n),e=>Ns(e,r,n),()=>V()),()=>B(e))}function Ps(e,t,n){let r=_s(n);return hs(r)?bs(e,r.name,t,r.type):L(n)?Ns(e,t,n.anyOf):Ns(e,t,[n])}function Fs(e,t,n){return mn(n)?U(e,t,n):$t(n)||un(n)?B(e):V()}function Is(e,t,n){return ia(n)?B(e):U(e,t,n)}function W(e,t,n){return $t(t)?Do(e,t,n):Bt(t)?ko(e,t,t.items,n):tr(t)?Ao(e,t,n):nr(t)?jo(e,t,n):Ut(t)?Lo(e,t.parameters,t.instanceType,n):gn(t)?Ro(e,t.if,t.then,t.else,n):vn(t)?zo(e,t.enum,n):Kt(t)?Bo(e,t.parameters,t.returnType,n):ar(t)?Vo(e,t,n):j(t)?Ho(e,t.allOf,n):F(t)?Jo(e,t,n):en(t)?Yo(e,t,n):mr(t)?Xo(e,t,n):_r(t)?Zo(e,t,n):A(t)?ss(e,t.properties,n):Qi(t)?us(e,Yi(t),Zi(t),n):xr(t)?ds(e,t,n):yr(t)?fs(e,t,n):mo(t)?ps(e,t.pattern,n):R(t)?As(e,t.items,n):ra(t)?js(e,t,n):L(t)?Ps(e,t.anyOf,n):un(t)?Fs(e,t,n):ia(t)?Is(e,t,n):V()}function Ls(e,t){return bi([...e,k(t)])}function Rs(e,t,n){return G(e)?T(Ls(e,t),{},n):Bs(e,t,n)}function zs(e,t,n,r,i){return Rs(_f(e,t,n),hf(e,t,r),i)}function Bs(e,t,n={}){return D(`Interface`,[e,t],n)}function Vs(e){return jt(e)&&S(e,`action`)&&b(e.action,`Interface`)}function Hs(e,t,n){return e.includes(n)?!0:Gs([...e,n],t,t[n])}function Us(e,t,n){return Ws(e,t,sn(n))}function Ws(e,t,n){return x(n,(n,r)=>Gs(e,t,n)?!0:Ws(e,t,r),()=>!1)}function Gs(e,t,n){return Yt(n)?Hs(e,t,n.$ref):Bt(n)?Gs(e,t,n.items):Ut(n)?Ws(e,t,[...n.parameters,n.instanceType]):Kt(n)?Ws(e,t,[...n.parameters,n.returnType]):Vs(n)?Us(e,t,n.parameters[1]):j(n)?Ws(e,t,n.allOf):A(n)?Us(e,t,n.properties):L(n)?Ws(e,t,n.anyOf):R(n)?Ws(e,t,n.items):Qi(n)?Gs(e,t,Zi(n)):!1}function Ks(e,t,n){return Gs(e,t,n)}function qs(e,t){return t.reduce((t,n)=>Ks([n],e,e[n])?[...t,n]:t,[])}function Js(e){return qs(e,on(e))}function Ys(e,t,n){return n.includes(t)?n:t in e?Qs(e,e[t],[...n,t]):xn()}function Xs(e,t,n){return Zs(e,sn(t),n)}function Zs(e,t,n){return t.reduce((t,n)=>Qs(e,n,t),n)}function Qs(e,t,n){return Yt(t)?Ys(e,t.$ref,n):Bt(t)?Qs(e,t.items,n):Ut(t)?Zs(e,[...t.parameters,t.instanceType],n):Kt(t)?Zs(e,[...t.parameters,t.returnType],n):Vs(t)?Xs(e,t.parameters[1],n):j(t)?Zs(e,t.allOf,n):A(t)?Xs(e,t.properties,n):L(t)?Zs(e,t.anyOf,n):R(t)?Zs(e,t.items,n):Qi(t)?Qs(e,Zi(t),n):n}function $s(e,t,n){return Qs(e,n,[t])}function ec(e){return Qt()}function tc(e){return C(e).reduce((t,n)=>({...t,[n]:rc(e[n])}),{})}function nc(e){return e.reduce((e,t)=>[...e,rc(t)],[])}function rc(e){return Yt(e)?ec(e.$ref):Bt(e)?zt(rc(e.items),Vt(e)):Ut(e)?Ht(nc(e.parameters),rc(e.instanceType)):Kt(e)?Gt(nc(e.parameters),rc(e.returnType)):j(e)?yn(nc(e.allOf)):A(e)?k(tc(e.properties)):Qi(e)?Ki(Xi(e),rc(Zi(e))):L(e)?I(nc(e.anyOf)):R(e)?Ur(nc(e.items)):e}function ic(e,t){return t in e?rc(e[t]):ln()}function ac(e){return ic(e.$defs,e.$ref)}function oc(e,t,n){let r=_f(e,mf([],[]),t),i=hf({},mf([],[]),n);return bi([...r,k(i)])}function sc(e,t){return C(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=Vs(r)?oc(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function cc(e,t,n){return dn(sc(e,$s(e,t,n)),t)}function lc(e,t){return t in e?Yt(e[t])?lc(e,e[t].$ref):e[t]:O()}function uc(e,t){return lc(e,t)}function dc(e){return fn(e)?ac(e):pn(e)?ln():e}function fc(e,t,n){return W(e,dc(t),dc(n))}function pc(e,t){let n=[un(e)?V():fc({},e,t),un(e)?B({}):fc({},t,e)];return yo(n[0])&&yo(n[1])?`equal`:yo(n[0])&&vo(n[1])?`left-inside`:vo(n[0])&&yo(n[1])?`right-inside`:`disjoint`}function mc(e,t){return t.filter(t=>pc(e,t)!==`right-inside`)}function hc(e,t){return b(t.some(t=>{let n=pc(e,t);return b(n,`left-inside`)||b(n,`equal`)}),!1)}function gc(e,t){let n=Ci(e);return $t(n)?[n]:hc(n,t)?[...mc(n,t),n]:t}function _c(e){return e.reduce((e,t)=>A(t)?[...e,t]:en(t)?e:gc(t,e),[])}function vc(e){return Ni(_c(e))}function yc(e,t){return T(Ci(e),{},t)}function bc(e,t,n,r){return yc(K(e,t,n),r)}function xc(e,t=[]){return Mt(e)&&b(e.action,`Conditional`)?Yt(e.parameters[0])?xc(e.parameters[2],xc(e.parameters[3],[...t,e.parameters[0].$ref])):xc(e.parameters[2],xc(e.parameters[3],t)):Mt(e)&&b(e.action,`Mapped`)&&Mt(e.parameters[1])&&b(e.parameters[1].action,`KeyOf`)&&Yt(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Sc(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function Cc(e,t,n=[]){return x(e,(e,r)=>x(t,(t,i)=>Cc(r,i,[...n,[t,e]]),()=>n),()=>n)}function wc(e){return L(e)?[...e.anyOf]:[e]}function Tc(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Ec(e,t){return t.reduce((t,n)=>[...t,...Tc(e,n)],[])}function Dc(e){return e.reduce((e,t)=>b(t[0],!0)?Ec(e,wc(t[1])):Ec(e,[t[1]]),[[]])}function Oc(e,t,n){let r=Cc(t,Sc(e,xc(n)));return Mt(n)&&b(n.action,`Conditional`)||Mt(n)&&b(n.action,`Mapped`)?Dc(r):[t]}function kc(){return[`(not-resolvable)`,O()]}function Ac(){return[`(not-generic)`,O()]}function jc(e,t,n){return[e,Xt(t,n)]}function Mc(e,t,n){return t in e?Nc(e,t,e[t],n):kc()}function Nc(e,t,n,r){return Zt(n)?jc(t,n.parameters,n.expression):Yt(n)?Mc(e,n.$ref,r):Ac()}function Pc(e,t,n){return Nc(e,`(anonymous)`,t,n)}function Fc(e,t,n){if(mn(t)||qc(t)||yo(fc({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Ic(e,t,n,r,i){let a=K(e,t,i);return Fc(n,a,r),v(e,{[n]:a})}function Lc(e,t,n,r,i){let a=K(e,t,n.extends),o=K(e,t,n.equals);return x(i,(i,o)=>Rc(Ic(e,t,n.name,a,i),t,r,o),()=>Rc(Ic(e,t,n.name,a,o),t,r,[]))}function Rc(e,t,n,r){return x(n,(n,i)=>Lc(e,t,n,i,r),()=>e)}function zc(e,t,n,r){return Rc(e,t,n,r)}function Bc(e){return Be(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function Vc(e,t){return b(Bc(e),t)}function Hc(e,t,n,r,i,a){let o=zc(e,t,r,a),s=K(o,mf([...t.callstack,n.$ref],t.visited),i);return K(o,mf([],[]),s)}function Uc(e,t,n,r,i,a){return a.reduce((a,o)=>[...a,Hc(e,t,n,r,i,o)],[])}function Wc(e,t,n,r,i,a){let o=Uc(e,t,n,r,i,Oc(r,a,i));return b(o.length,1)?o[0]:Si(o)}function Gc(e,t,n,r){let i=_f(e,t,r),a=Pc(e,n,r),o=a[0],s=a[1];return Zt(s)?Vc(t,o)?Kc(Jt(o),i):Wc(e,t,Jt(o),s.parameters,s.expression,i):Kc(n,i)}function Kc(e,t){return w({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function qc(e){return E(e,`Call`)}function Jc(e){return At(e,[`~immutable`])}function Yc(e,t){return T(Jc(e),{},t)}function Xc(e,t,n,r){return Yc(K(e,t,n),r)}function Zc(e,t){return e(t)}function Qc(e,t){return Le(t)?P(Zc(e,t)):P(t)}function $c(e,t){return tl(e,xi(t))}function el(e,t){return I(t.map(t=>tl(e,t)))}function tl(e,t){return F(t)?Qc(e,t.const):mo(t)?$c(e,t.pattern):L(t)?el(e,t.anyOf):t}function nl(e,t={}){return D(`Capitalize`,[e],t)}function rl(e,t={}){return D(`Lowercase`,[e],t)}function il(e,t={}){return D(`Uncapitalize`,[e],t)}function al(e,t={}){return D(`Uppercase`,[e],t)}const ol=e=>e[0].toUpperCase()+e.slice(1),sl=e=>e.toLowerCase(),cl=e=>e[0].toLowerCase()+e.slice(1),ll=e=>e.toUpperCase();function ul(e,t){return G([e])?T(tl(ol,e),{},t):nl(e,t)}function dl(e,t){return G([e])?T(tl(sl,e),{},t):rl(e,t)}function fl(e,t){return G([e])?T(tl(cl,e),{},t):il(e,t)}function pl(e,t){return G([e])?T(tl(ll,e),{},t):al(e,t)}function ml(e,t,n,r){return ul(K(e,t,n),r)}function hl(e,t,n,r){return dl(K(e,t,n),r)}function gl(e,t,n,r){return fl(K(e,t,n),r)}function _l(e,t,n,r){return pl(K(e,t,n),r)}function vl(e,t,n,r,i={}){return D(`Conditional`,[e,t,n,r],i)}function yl(e,t,n,r,i,a){let o=fc(e,n,r);return go(o)?I([K(o.inferred,t,i),K(e,t,a)]):_o(o)?K(o.inferred,t,i):K(e,t,a)}function bl(e,t,n,r,i,a,o){return G([n,r])?T(yl(e,t,n,r,i,a),{},o):vl(n,r,i,a,o)}function xl(e,t,n,r,i,a,o){return bl(e,t,K(e,t,n),K(e,t,r),i,a,o)}function Sl(e,t={}){return D(`ConstructorParameters`,[e],t)}function Cl(e){let t=Ut(e)?e.parameters:[];return Ur(gf({},mf([],[]),t))}function wl(e,t){return G([e])?T(Cl(e),{},t):Sl(e,t)}function Tl(e,t,n,r){return wl(K(e,t,n),r)}function El(e,t,n={}){return D(`Exclude`,[e,t],n)}function Dl(e,t,n){return G([e,t])?T(_i(e,t),{},n):El(e,t,n)}function Ol(e,t,n,r,i){return Dl(K(e,t,n),K(e,t,r),i)}function kl(e,t,n={}){return D(`Extract`,[e,t],n)}function Al(e,t){return yo(fc({},e,t))?[e]:[]}function jl(e,t){return e.reduce((e,n)=>[...e,...Al(n,t)],[])}function Ml(e,t){let n=Ci(e);return Si(jl(L(n)?n.anyOf:[n],t))}function Nl(e,t,n){return G([e,t])?T(Ml(e,t),{},n):kl(e,t,n)}function Pl(e,t,n,r,i){return Nl(K(e,t,n),K(e,t,r),i)}function Fl(e,t,n={}){return D(`Index`,[e,t],n)}function Il(e,t){return Gl(uc(e,t))}function Ll(e,t,n){return Gl(vi(e,t,n))}function Rl(e,t){let n=C(e).filter(e=>!S(t,e)),r=C(t).filter(t=>!S(e,t)),i=C(e).filter(e=>S(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:bi([e[r],t[r]])}),{});return v(v(a,o),s)}function zl(e){return e.reduce((e,t)=>Rl(e,Gl(t)),{})}function Bl(e){return e}function Vl(e){return Gl(ei(Ur(e)))}function Hl(e,t){return C(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:Si([e[r],t[r]])}),{})}function Ul(e,t){return x(e,(e,n)=>Ul(n,Hl(t,Gl(e))),()=>t)}function Wl(e){return x(e,(e,t)=>Ul(t,Gl(e)),()=>xn())}function Gl(e){return fn(e)?Il(e.$defs,e.$ref):gn(e)?Ll(e.if,e.then,e.else):j(e)?zl(e.allOf):L(e)?Wl(e.anyOf):R(e)?Vl(e.items):A(e)?Bl(e.properties):{}}function Kl(e){return k(Gl(e))}const ql=RegExp(`^(?:0|[1-9][0-9]*)$`);function Jl(e){let t=`${e}`;return ql.test(t)?parseInt(t):e}function Yl(e){return P(Jl(e))}function Xl(e){return e.map(e=>Zl(e))}function Zl(e){return j(e)?yn(Xl(e.allOf)):L(e)?I(Xl(e.anyOf)):F(e)?Yl(e.const):e}function Ql(e,t){return yo(fc({},Zl(t),gr()))?e:F(t)&&b(t.const,`length`)?gr():O()}function $l(e,t){return ou(uc(e,t))}function eu(e,t,n){return ou(vi(e,t,n))}function tu(e){return ou(yi(e))}function nu(e){return ou(bi(e))}function ru(e){return[`${e}`]}function iu(e){return ou(xi(e))}function au(e){return e.reduce((e,t)=>[...e,...ou(t)],[])}function ou(e){return fn(e)?$l(e.$defs,e.$ref):gn(e)?eu(e.if,e.then,e.else):vn(e)?tu(e.enum):j(e)?nu(e.allOf):F(e)?ru(e.const):mo(e)?iu(e.pattern):L(e)?au(e.anyOf):[]}function su(e){return ou(e)}function cu(e,t){return t.map(t=>lu(e,t))}function lu(e,t){return Bt(t)?zt(lu(e,t.items)):Ut(t)?Ht(cu(e,t.parameters),lu(e,t.instanceType)):Kt(t)?Gt(cu(e,t.parameters),lu(e,t.returnType)):R(t)?Ur(cu(e,t.items)):L(t)?I(cu(e,t.anyOf)):j(t)?yn(cu(e,t.allOf)):ta(t)?k(e):t}function uu(e,t){return lu(e,t)}function du(e,t){return uu(e,t in e?e[t]:O())}function fu(e,t){return t.reduce((t,n)=>[...t,du(e,n)],[])}function pu(e,t){return Si(fu(e,su(t)))}const mu=new RegExp(Hi);function hu(e){return e.filter(e=>mu.test(e))}function gu(e){return Si(fu(e,hu(on(e))))}function _u(e,t){return _r(t)?gu(e):pu(e,t)}function vu(e){return P(Jl(e))}function yu(e){return e.map(e=>bu(e))}function bu(e){return j(e)?yn(yu(e.allOf)):L(e)?I(yu(e.anyOf)):F(e)?vu(e.const):e}function xu(e,t){return e.reduceRight((e,n,r)=>yo(fc({},P(r),t))?[n,...e]:e,[])}function Su(e,t){return wi(xu(e,bu(t)))}function Cu(e){return wi(e)}function wu(e,t){return F(t)&&b(t.const,`length`)?P(e.length):_r(t)||ar(t)?Cu(e):Su(e,t)}function Tu(e,t){return Bt(e)?Ql(e.items,t):A(e)?_u(e.properties,t):R(e)?wu(e.items,t):O()}function Eu(e){return fn(e)||gn(e)||j(e)||L(e)?Kl(e):e}function Du(e,t,n){return G([e,t])?T(Tu(Eu(e),t),{},n):Fl(e,t,n)}function Ou(e,t,n,r,i){return Du(K(e,t,n),K(e,t,r),i)}function ku(e,t={}){return D(`InstanceType`,[e],t)}function Au(e){return Ut(e)?e.instanceType:O()}function ju(e,t){return G([e])?T(Au(e),{},t):ku(e,t)}function Mu(e,t,n,r={}){return ju(K(e,t,n),r)}function Nu(e,t={}){return D(`KeyOf`,[e],t)}function Pu(){return I([gr(),br(),vr()])}function Fu(e){return gr()}function Iu(e){return e.reduce((e,t)=>cr(t)?[...e,P(Jl(t))]:xn(),[])}function Lu(e){return wi(Iu(C(e)))}function Ru(e){return Xi(e)}function zu(e){return wi(e.map((e,t)=>P(t)))}function Bu(e){return $t(e)?Pu():Bt(e)?Fu(e.items):A(e)?Lu(e.properties):Qi(e)?Ru(e):R(e)?zu(e.items):O()}function Vu(e){return fn(e)||gn(e)||j(e)||L(e)?Kl(e):e}function Hu(e,t){return G([e])?T(Bu(Vu(e)),{},t):Nu(e,t)}function Uu(e,t,n,r){return Hu(K(e,t,n),r)}function Wu(e,t,n,r,i={}){return D(`Mapped`,[e,t,n,r],i)}function Gu(e){return Yu(xi(e))}function Ku(e){return e.reduce((e,t)=>[...e,...Yu(t)],[])}function qu(e){return Yu(yi(e))}function Ju(e){return Fe(e)?[P(`${e}`)]:[P(e)]}function Yu(e){return vn(e)?qu(e.enum):F(e)?Ju(e.const):mo(e)?Gu(e.pattern):L(e)?Ku(e.anyOf):[e]}function Xu(e){return Yu(e)}function Zu(e){return mo(e)?xi(e.pattern):e}function Qu(e,t,n,r,i,a){let o=v(e,{[n.name]:r}),s=Zu(K(o,t,i)),c=K(o,t,a);return dr(s)||fr(s)?{[s.const]:c}:{}}function $u(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,Qu(e,t,n,o,i,a)],[])}function ed(e){return e.reduce((e,t)=>[...e,k(t)],[])}function td(e,t,n,r,i,a){return bi(ed($u(e,t,n,Xu(r),i,a)))}function nd(e,t,n,r,i,a,o){return G([r])?T(td(e,t,n,r,i,a),{},o):Wu(n,r,i,a,o)}function rd(e,t,n,r,i,a,o){return nd(e,t,n,K(e,t,r),i,a,o)}function id(e,t,n){let r=v(e,t);return C(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:cc(r,n,t[n])}),{})}function ad(e,t,n){let r=v(e,t);return C(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:K(r,mf([],[]),t[n])}),{})}function od(e,t,n){let r=Js(t),i=id(e,t,r),a=ad(e,t,r);return T({...i,...a},{},n)}function sd(e,t,n,r){return od(e,n,r)}function cd(e,t={}){return D(`NonNullable`,[e],t)}function ld(e){return Dl(e,I([pr(),na()]),{})}function ud(e,t){return G([e])?T(ld(e),{},t):cd(e,t)}function dd(e,t,n,r){return ud(K(e,t,n),r)}function fd(e,t,n={}){return D(`Omit`,[e,t],n)}function pd(e){let t=Kl(e);return A(t)?t.properties:xn()}function md(e,t){return C(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function hd(e,t){return k(md(pd(e),su(t)))}function gd(e,t,n){return G([e,t])?T(hd(e,t),{},n):fd(e,t,n)}function _d(e,t,n,r,i){return gd(K(e,t,n),K(e,t,r),i)}function vd(e,t={}){return D(`Parameters`,[e],t)}function yd(e){let t=Kt(e)?e.parameters:[];return Ur(gf({},mf([],[]),t))}function bd(e,t){return G([e])?T(yd(e),{},t):vd(e,t)}function xd(e,t,n,r){return bd(K(e,t,n),r)}function Sd(e,t={}){return D(`Partial`,[e],t)}function Cd(e,t){let n=Od(uc(e,t));return dn(v(e,{[t]:n}),t)}function wd(e,t,n){return Od(vi(e,t,n))}function Td(e){return Od(bi(e))}function Ed(e){return I(e.map(e=>Od(e)))}function Dd(e){return k(C(e).reduce((t,n)=>({...t,[n]:tn(e[n])}),{}))}function Od(e){return fn(e)?Cd(e.$defs,e.$ref):gn(e)?wd(e.if,e.then,e.else):j(e)?Td(e.allOf):L(e)?Ed(e.anyOf):A(e)?Dd(e.properties):k({})}function kd(e,t){return G([e])?T(Od(e),{},t):Sd(e,t)}function Ad(e,t,n,r){return kd(K(e,t,n),r)}function jd(e,t,n={}){return D(`Pick`,[e,t],n)}function Md(e,t){return C(e).reduce((n,r)=>t.includes(r)?v(n,{[r]:e[r]}):n,{})}function Nd(e,t){return k(Md(pd(e),su(t)))}function Pd(e,t,n){return G([e,t])?T(Nd(e,t),{},n):jd(e,t,n)}function Fd(e,t,n,r,i){return Pd(K(e,t,n),K(e,t,r),i)}function Id(e,t={}){return D(`ReadonlyObject`,[e],t)}function Ld(e){return Tf(zt(e))}function Rd(e,t){let n=Wd(uc(e,t));return dn(v(e,{[t]:n}),t)}function zd(e,t,n){return Wd(vi(e,t,n))}function Bd(e){return Wd(bi(e))}function Vd(e){return k(C(e).reduce((t,n)=>({...t,[n]:Qn(e[n])}),{}))}function Hd(e){return Tf(Ur(e))}function Ud(e){return I(e.map(e=>Wd(e)))}function Wd(e){return Bt(e)?Ld(e.items):fn(e)?Rd(e.$defs,e.$ref):gn(e)?zd(e.if,e.then,e.else):j(e)?Bd(e.allOf):A(e)?Vd(e.properties):R(e)?Hd(e.items):L(e)?Ud(e.anyOf):e}function Gd(e,t){return G([e])?T(Wd(e),{},t):Id(e)}function Kd(e,t,n,r){return Gd(K(e,t,n),r)}function qd(e,t,n,r){return t.visited.includes(r)?n:r in e?K(e,mf(t.callstack,[...t.visited,r]),e[r]):n}function Jd(e,t){let n=$d(uc(e,t));return dn(v(e,{[t]:n}),t)}function Yd(e,t,n){return $d(vi(e,t,n))}function Xd(e){return $d(bi(e))}function Zd(e){return I(e.map(e=>$d(e)))}function Qd(e){return k(C(e).reduce((t,n)=>({...t,[n]:Qr(e[n])}),{}))}function $d(e){return fn(e)?Jd(e.$defs,e.$ref):gn(e)?Yd(e.if,e.then,e.else):j(e)?Xd(e.allOf):L(e)?Zd(e.anyOf):A(e)?Qd(e.properties):k({})}function ef(e,t={}){return D(`Required`,[e],t)}function tf(e,t){return G([e])?T($d(e),{},t):ef(e,t)}function nf(e,t,n,r){return tf(K(e,t,n),r)}function rf(e,t={}){return D(`ReturnType`,[e],t)}function af(e){return Kt(e)?e.returnType:O()}function of(e,t){return G([e])?T(af(e),{},t):rf(e,t)}function sf(e,t,n,r={}){return of(K(e,t,n),r)}function cf(e,t){return D(`With`,[e,t],{})}function lf(e,t){return uf(e,t)}function uf(e,t){return G([e])?T(e,{},t):cf(e,t)}function df(e,t,n,r){return uf(K(e,t,n),r)}function ff(e){return ea(e)?R(e.items)?pf(e.items.items):mn(e.items)||Yt(e.items)?[e]:[O()]:[e]}function pf(e){return e.reduce((e,t)=>[...e,...ff(t)],[])}function mf(e,t){return{callstack:e,visited:t}}function G(e){return x(e,(e,t)=>!Yt(e)&&G(t),()=>!0)}function hf(e,t,n){return C(n).reduce((r,i)=>({...r,[i]:K(e,t,n[i])}),{})}function gf(e,t,n){return pf(_f(e,t,n))}function _f(e,t,n){return n.map(n=>K(e,t,n))}function vf(e,t){let n=rn(e)?Lt(t,{}):t,r=$n(e)?Pt(n,{}):n;return Zn(e)?Cf(r,{}):r}function yf(e,t,n,r,i){return b(n,`AddImmutable`)?wf(e,t,r[0],i):b(n,`RemoveImmutable`)?Xc(e,t,r[0],i):b(n,`AddReadonly`)?Ft(e,t,r[0],i):b(n,`RemoveReadonly`)?qr(e,t,r[0],i):b(n,`AddOptional`)?Rt(e,t,r[0],i):b(n,`RemoveOptional`)?Zr(e,t,r[0],i):b(n,`Capitalize`)?ml(e,t,r[0],i):b(n,`Conditional`)?xl(e,t,r[0],r[1],r[2],r[3],i):b(n,`ConstructorParameters`)?Tl(e,t,r[0],i):b(n,`Evaluate`)?bc(e,t,r[0],i):b(n,`Exclude`)?Ol(e,t,r[0],r[1],i):b(n,`Extract`)?Pl(e,t,r[0],r[1],i):b(n,`Index`)?Ou(e,t,r[0],r[1],i):b(n,`InstanceType`)?Mu(e,t,r[0],i):b(n,`Interface`)?zs(e,t,r[0],r[1],i):b(n,`KeyOf`)?Uu(e,t,r[0],i):b(n,`Lowercase`)?hl(e,t,r[0],i):b(n,`Mapped`)?rd(e,t,r[0],r[1],r[2],r[3],i):b(n,`Module`)?sd(e,t,r[0],i):b(n,`NonNullable`)?dd(e,t,r[0],i):b(n,`Pick`)?Fd(e,t,r[0],r[1],i):b(n,`Parameters`)?xd(e,t,r[0],i):b(n,`Partial`)?Ad(e,t,r[0],i):b(n,`Omit`)?_d(e,t,r[0],r[1],i):b(n,`ReadonlyObject`)?Kd(e,t,r[0],i):b(n,`Record`)?Vi(e,t,r[0],r[1],i):b(n,`Required`)?nf(e,t,r[0],i):b(n,`ReturnType`)?sf(e,t,r[0],i):b(n,`TemplateLiteral`)?uo(e,t,r[0],i):b(n,`Uncapitalize`)?gl(e,t,r[0],i):b(n,`Uppercase`)?_l(e,t,r[0],i):b(n,`With`)?df(e,t,r[0],r[1]):D(n,r,i)}function bf(e,t,n){return vf(n,Yt(n)?qd(e,t,n,n.$ref):Bt(n)?zt(K(e,t,n.items),Vt(n)):qc(n)?Gc(e,t,n.target,n.arguments):Ut(n)?Ht(_f(e,t,n.parameters),K(e,t,n.instanceType),Wt(n)):Kt(n)?Gt(_f(e,t,n.parameters),K(e,t,n.returnType),qt(n)):gn(n)?hn(K(e,t,n.if),K(e,t,n.then),K(e,t,n.else),_n(n)):j(n)?yn(_f(e,t,n.allOf),bn(n)):A(n)?k(hf(e,t,n.properties),cn(n)):Qi(n)?qi(Yi(n),K(e,t,Zi(n))):ea(n)?$i(K(e,t,n.items)):R(n)?Ur(gf(e,t,n.items),Wr(n)):L(n)?I(_f(e,t,n.anyOf),Sr(n)):n)}function K(e,t,n){return Mt(n)?yf(e,t,n.action,n.parameters,n.options):bf(e,t,n)}function xf(e,t){return K(e,mf([],[]),t)}function Sf(e){return T(e,{"~immutable":!0},{})}function Cf(e,t){return T(Sf(e),{},t)}function wf(e,t,n,r){return Cf(K(e,t,n),r)}function Tf(e,t={}){return Cf(e,t)}function Ef(e,t={}){return yc(e,t)}function Df(e,t){let n=pc(e,t);return b(n,`right-inside`)?1:+!!b(n,`disjoint`)}function Of(e,t,n=[]){return x(t,(r,i)=>b(Df(e,r),1)?Of(e,i,[...n,r]):[...n,e,...t],()=>[...n,e])}function kf(e,t=[]){return x(e,(e,n)=>kf(n,Of(e,t)),()=>t)}function Af(e){return kf(e)}function jf(e,t){try{return Promise.resolve(t(Mf))}catch(e){return Promise.reject(e)}}const Mf={startSpan:jf,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(Mf);const Nf=Symbol.for(`yaml.alias`),Pf=Symbol.for(`yaml.document`),Ff=Symbol.for(`yaml.map`),If=Symbol.for(`yaml.pair`),Lf=Symbol.for(`yaml.scalar`),Rf=Symbol.for(`yaml.seq`),zf=Symbol.for(`yaml.node.type`),Bf=e=>!!e&&typeof e==`object`&&e[zf]===Nf,Vf=e=>!!e&&typeof e==`object`&&e[zf]===Pf,Hf=e=>!!e&&typeof e==`object`&&e[zf]===Ff,q=e=>!!e&&typeof e==`object`&&e[zf]===If,J=e=>!!e&&typeof e==`object`&&e[zf]===Lf,Uf=e=>!!e&&typeof e==`object`&&e[zf]===Rf;function Wf(e){if(e&&typeof e==`object`)switch(e[zf]){case Ff:case Rf:return!0}return!1}function Y(e){if(e&&typeof e==`object`)switch(e[zf]){case Nf:case Ff:case Lf:case Rf:return!0}return!1}const Gf=e=>(J(e)||Wf(e))&&!!e.anchor,Kf=Symbol(`break visit`),qf=Symbol(`skip children`),Jf=Symbol(`remove node`);function Yf(e,t){let n=Zf(t);Vf(e)?Xf(null,e.contents,n,Object.freeze([e]))===Jf&&(e.contents=null):Xf(null,e,n,Object.freeze([]))}Yf.BREAK=Kf,Yf.SKIP=qf,Yf.REMOVE=Jf;function Xf(e,t,n,r){let i=Qf(e,t,n,r);if(Y(i)||q(i))return $f(e,r,i),Xf(e,i,n,r);if(typeof i!=`symbol`){if(Wf(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=Xf(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Kf)return Kf;else i===Jf&&(t.items.splice(e,1),--e)}}else if(q(t)){r=Object.freeze(r.concat(t));let e=Xf(`key`,t.key,n,r);if(e===Kf)return Kf;e===Jf&&(t.key=null);let i=Xf(`value`,t.value,n,r);if(i===Kf)return Kf;i===Jf&&(t.value=null)}}return i}function Zf(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Qf(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Hf(t))return n.Map?.(e,t,r);if(Uf(t))return n.Seq?.(e,t,r);if(q(t))return n.Pair?.(e,t,r);if(J(t))return n.Scalar?.(e,t,r);if(Bf(t))return n.Alias?.(e,t,r)}function $f(e,t,n){let r=t[t.length-1];if(Wf(r))r.items[e]=n;else if(q(r))e===`key`?r.key=n:r.value=n;else if(Vf(r))r.contents=n;else{let e=Bf(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function ep(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function tp(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=tp(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=tp(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=tp(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=tp(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function np(e,t,n){if(Array.isArray(e))return e.map((e,t)=>np(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Gf(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var rp=class{constructor(e){Object.defineProperty(this,zf,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Vf(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=np(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?tp(i,{"":o},``,o):o}},ip=class extends rp{constructor(e){super(Nf),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Yf(e,{Node:(e,t)=>{(Bf(t)||Gf(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(np(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=ap(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ep(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ap(e,t,n){if(Bf(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Wf(t)){let r=0;for(let i of t.items){let t=ap(e,i,n);t>r&&(r=t)}return r}if(q(t)){let r=ap(e,t.key,n),i=ap(e,t.value,n);return Math.max(r,i)}return 1}const op=e=>!e||typeof e!=`function`&&typeof e!=`object`;var X=class extends rp{constructor(e){super(Lf),this.value=e}toJSON(e,t){return t?.keep?this.value:np(this.value,e,t)}toString(){return String(this.value)}};X.BLOCK_FOLDED=`BLOCK_FOLDED`,X.BLOCK_LITERAL=`BLOCK_LITERAL`,X.PLAIN=`PLAIN`,X.QUOTE_DOUBLE=`QUOTE_DOUBLE`,X.QUOTE_SINGLE=`QUOTE_SINGLE`;function sp(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function cp(e,t,n){if(Vf(e)&&(e=e.contents),Y(e))return e;if(q(e)){let t=n.schema[Ff].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new ip(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=`tag:yaml.org,2002:`+t.slice(2));let l=sp(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new X(e);return c&&(c.node=t),t}l=e instanceof Map?o[Ff]:Symbol.iterator in Object(e)?o[Rf]:o[Ff]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new X(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function lp(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return cp(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}const up=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;var dp=class extends rp{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Y(t)||q(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(up(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Wf(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,lp(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Wf(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&J(i)?i.value:i:Wf(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!q(t))return!1;let n=t.value;return n==null||e&&J(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Wf(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Wf(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,lp(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};const fp=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function pp(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const mp=(e,t,n)=>e.endsWith(`
|
|
4
4
|
`)?pp(n,t):n.includes(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/oauth-service-Uk8UIb05.js","assets/preload-helper-Czpn1I53.js","assets/proxied-fetch-BGeNrvQ4.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/base64-DpPqYZJF.js","assets/src-CAWTvdAa.js","assets/runtime-env-Dlaokqg1.js","assets/fetch-body-D2PwksUW.js","assets/api-endpoint-GRCyib6X.js","assets/runtime-env-CgsZ7LTp.js","assets/runtime-env-E-i2SW1s.js","assets/panel-rpc-B3MSVImO.js","assets/permissions-surface-registry-CilCRwhh.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{H as e,Y as t,d as n,y as r}from"./account-store-Cfqazzkp.js";import{a as i}from"./diagnostics-DN_idNHx.js";import{t as a}from"./preload-helper-Czpn1I53.js";import{c as o,i as s,l as c,n as l,r as u,u as d}from"./claude-model-version-DoVrYsKi.js";import{a as f,r as p,s as m,t as h}from"./legacy-api-aliases-BnRqMAef.js";import{n as g,t as _}from"./silent-renew-backoff-t_Cd4Zw7.js";import{t as v}from"./panel-rpc-B3MSVImO.js";import"./provider-settings-DKsgBboU.js";import{getOAuthPageOrigin as ee}from"./oauth-service-Uk8UIb05.js";import{n as y}from"./temperature-support-Cpml9LfI.js";import{t as b}from"./llm-session-id-bZQs6gBN.js";var te={proxyEndpoint:`https://adobe-llm-proxy.paolo-moz.workers.dev`,redirectUri:`https://www.sliccy.ai/auth/callback`,extensionRedirectUri:`https://akjjllgokmbgpbdbmafpiefnhidlmbgf.chromiumapp.org/adobe`};function ne(e,t){return l(e,t)}function x(e,t,n){return e!==`xhigh`||!t?e:s(t,n)?`xhigh`:u(t,n)?`max`:`high`}function re(e,t){let n=e?t?.thinkingLevelMap?.[e]:void 0;return x((()=>{if(typeof n==`string`)return n;switch(e){case`minimal`:case`low`:return`low`;case`medium`:return`medium`;case`xhigh`:return`xhigh`;default:return`high`}})(),t?.id,t?.name)}function ie(e,t){return async(n,r)=>{let i=t?await t(n,r)??n:n,a=i.thinking;return a&&a.type===`enabled`&&(i.thinking={type:`adaptive`,...a.display===void 0?{}:{display:a.display}},i.output_config={...i.output_config??{},effort:e}),i}}function S(e,t){if(!ne(e.id,e.name))return t;let n=t,r=x(n.effort??re(n.reasoning,e),e.id,e.name);return{...t,onPayload:ie(r,n.onPayload)}}function ae(e,t){let n={id:e.id,name:e.name??e.id},r=t?.api??e.api,i=t?.context_window??e.context_window,a=t?.max_tokens??e.max_tokens,o=t?.reasoning??e.reasoning,s=t?.input??e.input;r&&(n.api=r),i!==void 0&&(n.context_window=i),a!==void 0&&(n.max_tokens=a),o!==void 0&&(n.reasoning=o),s&&(n.input=s);let c=t?.cost??e.cost;return c&&(n.cost=c),/haiku/i.test(e.id)&&(n.compat={supportsEagerToolInputStreaming:!1}),/sonnet-5\b/i.test(e.id)&&!n.thinkingLevelMap&&(n.thinkingLevelMap={xhigh:`xhigh`}),n}var C=Object.assign({"/packages/webapp/providers/adobe-config.json":te})[`/packages/webapp/providers/adobe-config.json`]??{clientId:``,proxyEndpoint:``,scopes:`openid,profile,email`};function w(){let e=r(`adobe`);if(e)return e.replace(/\/$/,``);if(C.proxyEndpoint)return C.proxyEndpoint.replace(/\/$/,``);throw Error(`Adobe proxy endpoint not configured — set it in Settings or adobe-config.json`)}var T=new Map,E=new Map,D=`slicc-adobe-models`;function O(e){try{localStorage.setItem(D,JSON.stringify(e))}catch{}}async function k(e){let t=T.get(e);if(t)return t;try{let t=await fetch(`${e}/v1/config`,{headers:{[G]:`6.99.3`}});if(t.ok){let n=await t.json();return T.set(e,n),n}console.warn(`[adobe] Proxy /v1/config returned ${t.status}, falling back to build-time config`)}catch(e){console.warn(`[adobe] Failed to fetch proxy config:`,e instanceof Error?e.message:String(e))}return{}}function A(e){let t=e.clientId||C.clientId;if(!t)throw Error(`Could not determine IMS client ID — proxy /v1/config did not return one and adobe-config.json is empty`);return t}function j(e){return e.scopes||C.scopes}function M(e){return e.imsEnvironment||C.imsEnvironment||`prod`}var N={prod:`https://ims-na1.adobelogin.com`,stg1:`https://ims-na1-stg1.adobelogin.com`};function P(e){return N[e??C.imsEnvironment??`prod`]??N.prod}var F=typeof chrome<`u`&&!!chrome?.runtime?.id;function I(){return n().find(e=>e.providerId===`adobe`)}async function oe(e,t){try{let n=await fetch(`${P(t)}/ims/userinfo/v2`,{headers:{Authorization:`Bearer ${e}`}});if(n.ok){let e=await n.json();return{name:e.displayName||e.name||e.email,avatar:e.picture||e.avatar_url}}console.warn(`[adobe] User profile fetch returned ${n.status}, account will have no display name`)}catch(e){console.warn(`[adobe] Failed to fetch user profile:`,e instanceof Error?e.message:String(e))}return{}}function L(e){let t=e.indexOf(`#`);if(t<0)return null;let n=new URLSearchParams(e.slice(t+1)),r=n.get(`access_token`);return r?{accessToken:r,expiresIn:parseInt(n.get(`expires_in`)??`86400`,10),scope:n.get(`scope`)??void 0}:null}var R={id:`adobe`,name:`Adobe`,description:`Claude via Adobe — login with your Adobe ID`,requiresApiKey:!1,requiresBaseUrl:!C.proxyEndpoint,baseUrlPlaceholder:`https://your-proxy.example.com`,baseUrlDescription:`Anthropic-compatible proxy endpoint`,isOAuth:!0,defaultModelId:`sonnet`,oauthTokenDomains:[`ims-na1.adobelogin.com`,`ims-na1-stg1.adobelogin.com`,`*.adobelogin.com`,`*.adobe.io`,`firefall.adobe.io`,`admin.hlx.page`,`admin.hlx.live`,`admin.aem.page`,`admin.aem.live`],getModelIds:()=>{let e=e=>ae(e,E.get(e.id));for(let t of Q.values())if(t.length){let n=t.map(t=>e({id:t.id,name:t.name??t.id,reasoning:t.reasoning,input:t.input,cost:t.cost}));return O(n),n}for(let t of T.values())if(t.models?.length)return t.models.map(t=>e(t));try{let e=localStorage.getItem(D);if(e){let t=JSON.parse(e);if(t.length)return t}}catch{}return[{id:`claude-sonnet-4-6`,name:`Claude Sonnet 4.6`}]},onOAuthLogin:async(t,n,r)=>{let i=w(),a=await k(i),o=A(a),s=j(a),c=M(a),l=F?null:await ee(),u=F?null:g({pageHref:l.href,pageOrigin:l.origin,configuredRedirectUri:C.redirectUri},()=>crypto.randomUUID()),d=F?C.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:u.redirectUri,f=u?.oauthState,p=u?.expectedNonce??null,m=new URLSearchParams({client_id:o,scope:s,response_type:`token`,redirect_uri:d});f&&m.set(`state`,f),r?.forceReauth&&m.set(`prompt`,`login`);let h=await t(`${P(c)}/ims/authorize/v2?${m}`);if(!h)return;if(p&&h)try{if(new URL(h).searchParams.get(`nonce`)!==p){console.error(`[adobe] OAuth nonce mismatch — possible CSRF`);return}}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}let _=L(h);if(!_){console.error(`[adobe] Could not extract token from redirect URL`);return}let v=await oe(_.accessToken,c);await e({providerId:`adobe`,accessToken:_.accessToken,tokenExpiresAt:Date.now()+_.expiresIn*1e3,userName:v.name,userAvatar:v.avatar,scopes:_.scope,baseUrl:C.proxyEndpoint?void 0:i}),await $().catch(e=>console.warn(`[adobe] Failed to fetch models after login:`,e instanceof Error?e.message:String(e))),n()},onOAuthLogout:async()=>{let t=I();if(t?.accessToken)try{let e=T.values().next().value??{},n=e.clientId||C.clientId,r=M(e);if(n){let e=await fetch(`${P(r)}/ims/revoke`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:t.accessToken,token_type_hint:`access_token`,client_id:n})});e.ok||console.warn(`[adobe] Token revocation returned ${e.status}, token may still be valid server-side`)}}catch(e){console.warn(`[adobe] Failed to revoke token:`,e instanceof Error?e.message:String(e))}await e({providerId:`adobe`,accessToken:``})},onSilentRenew:async()=>I()?.accessToken?V():null,refreshModels:async e=>{await $(e);let t=R.getModelIds?.();t?.length&&O(t)}},z=null,se=_();async function B(){let e=I();if(!e?.accessToken)throw Error(`Not logged in to Adobe — please log in first`);if((e.tokenExpiresAt??0)-Date.now()>6e4)return e.accessToken;console.log(`[adobe] Token expired or expiring soon, attempting silent renewal...`);let t=await se.run(()=>V());if(t)return t;let n=I();if((n?.tokenExpiresAt??0)-Date.now()>0&&n?.accessToken)return n.accessToken;throw Error(`Adobe session expired — please log in again`)}function ce(){let e=I();return!e?.tokenExpiresAt||Date.now()>e.tokenExpiresAt-6e4}async function V(){if(typeof window>`u`){let e=v();if(!e)return null;try{let{accessToken:t}=await e.call(`silent-renew`,{providerId:`adobe`},{timeoutMs:13e4});return t}catch(e){return console.warn(`[adobe] worker→page silent-renew bridge failed:`,e instanceof Error?e.message:String(e)),null}}return z||(z=le().finally(()=>{z=null}),z)}function H(e,t){let n=A(t),r=j(t),i=M(t),a=F?null:g({pageHref:window.location.href,pageOrigin:window.location.origin,configuredRedirectUri:C.redirectUri},()=>crypto.randomUUID()),o=F?C.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:a.redirectUri,s=a?.oauthState,c=a?.expectedNonce??null,l=new URLSearchParams({client_id:n,scope:r,response_type:`token`,redirect_uri:o,prompt:`none`});return s&&l.set(`state`,s),{authorizeUrl:`${P(i)}/ims/authorize/v2?${l}`,expectedNonce:c,proxyEndpoint:e}}function U(e,t){if(!t)return!0;try{if(new URL(e).searchParams.get(`nonce`)!==t)return console.error(`[adobe] OAuth nonce mismatch — possible CSRF`),!1}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}return!0}async function W(t,n){let r=I();await e({providerId:`adobe`,accessToken:t.accessToken,tokenExpiresAt:Date.now()+t.expiresIn*1e3,userName:r?.userName,userAvatar:r?.userAvatar,scopes:t.scope,baseUrl:C.proxyEndpoint?void 0:n})}async function le(){try{let e=w(),{authorizeUrl:t,expectedNonce:n}=H(e,await k(e)),{createOAuthLauncher:r}=await a(async()=>{let{createOAuthLauncher:e}=await import(`./oauth-service-Uk8UIb05.js`);return{createOAuthLauncher:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),i=await r()(t,{interactive:!1});if(!i||!U(i,n))return null;let o=L(i);return o?(await W(o,e),console.log(`[adobe] Token renewed silently`),await $().catch(e=>console.warn(`[adobe] Failed to refresh models after silent renewal:`,e instanceof Error?e.message:String(e))),o.accessToken):null}catch(e){return console.warn(`[adobe] Silent renewal error:`,e instanceof Error?e.message:String(e)),null}}var G=`X-Slicc-Version`;function K(e){let t={},n=G.toLowerCase();if(e.headers)for(let[r,i]of Object.entries(e.headers))r.toLowerCase()!==n&&(t[r]=i);return t[G]=`6.99.3`,{...e,headers:t}}var ue=`adobe-provider-fallback`,q=new Set;function J(e,t){if(e.headers){for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()===`x-session-id`&&n!=null)return e}return q.has(t)||(q.add(t),console.warn(`[adobe] Missing X-Session-Id from ${t} — using daily fallback. Attach an X-Session-Id header at the call site (see scoop-context.ts streamWithSessionId or docs/pitfalls.md).`)),{...e,headers:{...e.headers??{},"X-Session-Id":b(ue)}}}function de(){q.clear()}function Y(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:`adobe-anthropic`,provider:`adobe`,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}var X=(e,t,n={})=>{let r=i();return(async()=>{try{let i=await B();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${w()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=p(a,t,K(J({...n,apiKey:i},`streamAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:w(),api:`anthropic-messages`},o=h(a,t,K(J(S(e,y(e.id,e.name,{...n,apiKey:i})),`streamAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(Y(e,t)),r.end()}})(),r},Z=(e,t,n)=>{let r=i();return(async()=>{try{let i=await B();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${w()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=m(a,t,K(J({...n,apiKey:i},`streamSimpleAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:w(),api:`anthropic-messages`},o=f(a,t,K(J(S(e,y(e.id,e.name,{...n,apiKey:i})),`streamSimpleAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(Y(e,t)),r.end()}})(),r};function fe(e){let t={id:e.id,name:e.name};return e.api!==void 0&&(t.api=e.api),e.context_window!==void 0&&(t.context_window=e.context_window),e.max_tokens!==void 0&&(t.max_tokens=e.max_tokens),e.reasoning!==void 0&&(t.reasoning=e.reasoning),e.input!==void 0&&(t.input=e.input),t}function pe(){let e=new Map;for(let t of c())try{for(let n of o(t))e.set(n.id,n)}catch{}return e}function me(e,n,r){let i=`adobe-${e.api===`openai`?`openai`:`anthropic`}`,a=r.get(e.id);if(a)return{...a,provider:`adobe`,api:i};let o=t(e.id,r);return{id:e.id,name:e.name??e.id,provider:`adobe`,api:i,baseUrl:n,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:o,inputCost:o.input,outputCost:o.output,cacheReadCost:o.cacheRead,cacheWriteCost:o.cacheWrite,reasoning:!0}}function he(e,t){for(let t of e)E.set(t.id,fe(t));let n=pe();return e.map(e=>me(e,t,n))}async function ge(e){try{let t=e??await B(),n=w(),r=await fetch(`${n}/v1/models`,{headers:{Authorization:`Bearer ${t}`,[G]:`6.99.3`}});if(!r.ok)console.warn(`[adobe] Proxy /v1/models returned ${r.status}, falling back to Anthropic models`);else{let e=await r.json();if(e.data?.length)return he(e.data,n)}}catch(e){console.warn(`[adobe] Failed to fetch proxy models:`,e instanceof Error?e.message:String(e))}return null}var Q=new Map;function _e(){return o(`anthropic`).map(e=>({...e,provider:`adobe`,api:`adobe-anthropic`}))}async function $(e){let t=w(),n=Q.get(t);if(n)return n;let r=await ge(e);return r?(Q.set(t,r),r):_e()}function ve(){d({api:`adobe-anthropic`,stream:X,streamSimple:Z}),d({api:`adobe-openai`,stream:X,streamSimple:Z})}export{de as __resetAdobeSessionIdWarningCacheForTests,R as config,L as extractTokenFromUrl,$ as getAdobeModels,B as getValidAccessToken,ce as isTokenExpired,ve as register};
|
|
2
|
+
import{H as e,Y as t,d as n,y as r}from"./account-store-B6Zka-_Q.js";import{a as i}from"./diagnostics-DN_idNHx.js";import{t as a}from"./preload-helper-Czpn1I53.js";import{c as o,i as s,l as c,n as l,r as u,u as d}from"./claude-model-version-DoVrYsKi.js";import{a as f,r as p,s as m,t as h}from"./legacy-api-aliases-BnRqMAef.js";import{n as g,t as _}from"./silent-renew-backoff-t_Cd4Zw7.js";import{t as v}from"./panel-rpc-B3MSVImO.js";import"./provider-settings-CKCGh4DD.js";import{getOAuthPageOrigin as ee}from"./oauth-service-Uk8UIb05.js";import{n as y}from"./temperature-support-Cpml9LfI.js";import{t as b}from"./llm-session-id-bZQs6gBN.js";var te={proxyEndpoint:`https://adobe-llm-proxy.paolo-moz.workers.dev`,redirectUri:`https://www.sliccy.ai/auth/callback`,extensionRedirectUri:`https://akjjllgokmbgpbdbmafpiefnhidlmbgf.chromiumapp.org/adobe`};function ne(e,t){return l(e,t)}function x(e,t,n){return e!==`xhigh`||!t?e:s(t,n)?`xhigh`:u(t,n)?`max`:`high`}function re(e,t){let n=e?t?.thinkingLevelMap?.[e]:void 0;return x((()=>{if(typeof n==`string`)return n;switch(e){case`minimal`:case`low`:return`low`;case`medium`:return`medium`;case`xhigh`:return`xhigh`;default:return`high`}})(),t?.id,t?.name)}function ie(e,t){return async(n,r)=>{let i=t?await t(n,r)??n:n,a=i.thinking;return a&&a.type===`enabled`&&(i.thinking={type:`adaptive`,...a.display===void 0?{}:{display:a.display}},i.output_config={...i.output_config??{},effort:e}),i}}function S(e,t){if(!ne(e.id,e.name))return t;let n=t,r=x(n.effort??re(n.reasoning,e),e.id,e.name);return{...t,onPayload:ie(r,n.onPayload)}}function ae(e,t){let n={id:e.id,name:e.name??e.id},r=t?.api??e.api,i=t?.context_window??e.context_window,a=t?.max_tokens??e.max_tokens,o=t?.reasoning??e.reasoning,s=t?.input??e.input;r&&(n.api=r),i!==void 0&&(n.context_window=i),a!==void 0&&(n.max_tokens=a),o!==void 0&&(n.reasoning=o),s&&(n.input=s);let c=t?.cost??e.cost;return c&&(n.cost=c),/haiku/i.test(e.id)&&(n.compat={supportsEagerToolInputStreaming:!1}),/sonnet-5\b/i.test(e.id)&&!n.thinkingLevelMap&&(n.thinkingLevelMap={xhigh:`xhigh`}),n}var C=Object.assign({"/packages/webapp/providers/adobe-config.json":te})[`/packages/webapp/providers/adobe-config.json`]??{clientId:``,proxyEndpoint:``,scopes:`openid,profile,email`};function w(){let e=r(`adobe`);if(e)return e.replace(/\/$/,``);if(C.proxyEndpoint)return C.proxyEndpoint.replace(/\/$/,``);throw Error(`Adobe proxy endpoint not configured — set it in Settings or adobe-config.json`)}var T=new Map,E=new Map,D=`slicc-adobe-models`;function O(e){try{localStorage.setItem(D,JSON.stringify(e))}catch{}}async function k(e){let t=T.get(e);if(t)return t;try{let t=await fetch(`${e}/v1/config`,{headers:{[G]:`6.99.5`}});if(t.ok){let n=await t.json();return T.set(e,n),n}console.warn(`[adobe] Proxy /v1/config returned ${t.status}, falling back to build-time config`)}catch(e){console.warn(`[adobe] Failed to fetch proxy config:`,e instanceof Error?e.message:String(e))}return{}}function A(e){let t=e.clientId||C.clientId;if(!t)throw Error(`Could not determine IMS client ID — proxy /v1/config did not return one and adobe-config.json is empty`);return t}function j(e){return e.scopes||C.scopes}function M(e){return e.imsEnvironment||C.imsEnvironment||`prod`}var N={prod:`https://ims-na1.adobelogin.com`,stg1:`https://ims-na1-stg1.adobelogin.com`};function P(e){return N[e??C.imsEnvironment??`prod`]??N.prod}var F=typeof chrome<`u`&&!!chrome?.runtime?.id;function I(){return n().find(e=>e.providerId===`adobe`)}async function oe(e,t){try{let n=await fetch(`${P(t)}/ims/userinfo/v2`,{headers:{Authorization:`Bearer ${e}`}});if(n.ok){let e=await n.json();return{name:e.displayName||e.name||e.email,avatar:e.picture||e.avatar_url}}console.warn(`[adobe] User profile fetch returned ${n.status}, account will have no display name`)}catch(e){console.warn(`[adobe] Failed to fetch user profile:`,e instanceof Error?e.message:String(e))}return{}}function L(e){let t=e.indexOf(`#`);if(t<0)return null;let n=new URLSearchParams(e.slice(t+1)),r=n.get(`access_token`);return r?{accessToken:r,expiresIn:parseInt(n.get(`expires_in`)??`86400`,10),scope:n.get(`scope`)??void 0}:null}var R={id:`adobe`,name:`Adobe`,description:`Claude via Adobe — login with your Adobe ID`,requiresApiKey:!1,requiresBaseUrl:!C.proxyEndpoint,baseUrlPlaceholder:`https://your-proxy.example.com`,baseUrlDescription:`Anthropic-compatible proxy endpoint`,isOAuth:!0,defaultModelId:`sonnet`,oauthTokenDomains:[`ims-na1.adobelogin.com`,`ims-na1-stg1.adobelogin.com`,`*.adobelogin.com`,`*.adobe.io`,`firefall.adobe.io`,`admin.hlx.page`,`admin.hlx.live`,`admin.aem.page`,`admin.aem.live`],getModelIds:()=>{let e=e=>ae(e,E.get(e.id));for(let t of Q.values())if(t.length){let n=t.map(t=>e({id:t.id,name:t.name??t.id,reasoning:t.reasoning,input:t.input,cost:t.cost}));return O(n),n}for(let t of T.values())if(t.models?.length)return t.models.map(t=>e(t));try{let e=localStorage.getItem(D);if(e){let t=JSON.parse(e);if(t.length)return t}}catch{}return[{id:`claude-sonnet-4-6`,name:`Claude Sonnet 4.6`}]},onOAuthLogin:async(t,n,r)=>{let i=w(),a=await k(i),o=A(a),s=j(a),c=M(a),l=F?null:await ee(),u=F?null:g({pageHref:l.href,pageOrigin:l.origin,configuredRedirectUri:C.redirectUri},()=>crypto.randomUUID()),d=F?C.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:u.redirectUri,f=u?.oauthState,p=u?.expectedNonce??null,m=new URLSearchParams({client_id:o,scope:s,response_type:`token`,redirect_uri:d});f&&m.set(`state`,f),r?.forceReauth&&m.set(`prompt`,`login`);let h=await t(`${P(c)}/ims/authorize/v2?${m}`);if(!h)return;if(p&&h)try{if(new URL(h).searchParams.get(`nonce`)!==p){console.error(`[adobe] OAuth nonce mismatch — possible CSRF`);return}}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}let _=L(h);if(!_){console.error(`[adobe] Could not extract token from redirect URL`);return}let v=await oe(_.accessToken,c);await e({providerId:`adobe`,accessToken:_.accessToken,tokenExpiresAt:Date.now()+_.expiresIn*1e3,userName:v.name,userAvatar:v.avatar,scopes:_.scope,baseUrl:C.proxyEndpoint?void 0:i}),await $().catch(e=>console.warn(`[adobe] Failed to fetch models after login:`,e instanceof Error?e.message:String(e))),n()},onOAuthLogout:async()=>{let t=I();if(t?.accessToken)try{let e=T.values().next().value??{},n=e.clientId||C.clientId,r=M(e);if(n){let e=await fetch(`${P(r)}/ims/revoke`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:t.accessToken,token_type_hint:`access_token`,client_id:n})});e.ok||console.warn(`[adobe] Token revocation returned ${e.status}, token may still be valid server-side`)}}catch(e){console.warn(`[adobe] Failed to revoke token:`,e instanceof Error?e.message:String(e))}await e({providerId:`adobe`,accessToken:``})},onSilentRenew:async()=>I()?.accessToken?V():null,refreshModels:async e=>{await $(e);let t=R.getModelIds?.();t?.length&&O(t)}},z=null,se=_();async function B(){let e=I();if(!e?.accessToken)throw Error(`Not logged in to Adobe — please log in first`);if((e.tokenExpiresAt??0)-Date.now()>6e4)return e.accessToken;console.log(`[adobe] Token expired or expiring soon, attempting silent renewal...`);let t=await se.run(()=>V());if(t)return t;let n=I();if((n?.tokenExpiresAt??0)-Date.now()>0&&n?.accessToken)return n.accessToken;throw Error(`Adobe session expired — please log in again`)}function ce(){let e=I();return!e?.tokenExpiresAt||Date.now()>e.tokenExpiresAt-6e4}async function V(){if(typeof window>`u`){let e=v();if(!e)return null;try{let{accessToken:t}=await e.call(`silent-renew`,{providerId:`adobe`},{timeoutMs:13e4});return t}catch(e){return console.warn(`[adobe] worker→page silent-renew bridge failed:`,e instanceof Error?e.message:String(e)),null}}return z||(z=le().finally(()=>{z=null}),z)}function H(e,t){let n=A(t),r=j(t),i=M(t),a=F?null:g({pageHref:window.location.href,pageOrigin:window.location.origin,configuredRedirectUri:C.redirectUri},()=>crypto.randomUUID()),o=F?C.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:a.redirectUri,s=a?.oauthState,c=a?.expectedNonce??null,l=new URLSearchParams({client_id:n,scope:r,response_type:`token`,redirect_uri:o,prompt:`none`});return s&&l.set(`state`,s),{authorizeUrl:`${P(i)}/ims/authorize/v2?${l}`,expectedNonce:c,proxyEndpoint:e}}function U(e,t){if(!t)return!0;try{if(new URL(e).searchParams.get(`nonce`)!==t)return console.error(`[adobe] OAuth nonce mismatch — possible CSRF`),!1}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}return!0}async function W(t,n){let r=I();await e({providerId:`adobe`,accessToken:t.accessToken,tokenExpiresAt:Date.now()+t.expiresIn*1e3,userName:r?.userName,userAvatar:r?.userAvatar,scopes:t.scope,baseUrl:C.proxyEndpoint?void 0:n})}async function le(){try{let e=w(),{authorizeUrl:t,expectedNonce:n}=H(e,await k(e)),{createOAuthLauncher:r}=await a(async()=>{let{createOAuthLauncher:e}=await import(`./oauth-service-Uk8UIb05.js`);return{createOAuthLauncher:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),i=await r()(t,{interactive:!1});if(!i||!U(i,n))return null;let o=L(i);return o?(await W(o,e),console.log(`[adobe] Token renewed silently`),await $().catch(e=>console.warn(`[adobe] Failed to refresh models after silent renewal:`,e instanceof Error?e.message:String(e))),o.accessToken):null}catch(e){return console.warn(`[adobe] Silent renewal error:`,e instanceof Error?e.message:String(e)),null}}var G=`X-Slicc-Version`;function K(e){let t={},n=G.toLowerCase();if(e.headers)for(let[r,i]of Object.entries(e.headers))r.toLowerCase()!==n&&(t[r]=i);return t[G]=`6.99.5`,{...e,headers:t}}var ue=`adobe-provider-fallback`,q=new Set;function J(e,t){if(e.headers){for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()===`x-session-id`&&n!=null)return e}return q.has(t)||(q.add(t),console.warn(`[adobe] Missing X-Session-Id from ${t} — using daily fallback. Attach an X-Session-Id header at the call site (see scoop-context.ts streamWithSessionId or docs/pitfalls.md).`)),{...e,headers:{...e.headers??{},"X-Session-Id":b(ue)}}}function de(){q.clear()}function Y(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:`adobe-anthropic`,provider:`adobe`,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}var X=(e,t,n={})=>{let r=i();return(async()=>{try{let i=await B();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${w()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=p(a,t,K(J({...n,apiKey:i},`streamAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:w(),api:`anthropic-messages`},o=h(a,t,K(J(S(e,y(e.id,e.name,{...n,apiKey:i})),`streamAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(Y(e,t)),r.end()}})(),r},Z=(e,t,n)=>{let r=i();return(async()=>{try{let i=await B();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${w()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=m(a,t,K(J({...n,apiKey:i},`streamSimpleAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:w(),api:`anthropic-messages`},o=f(a,t,K(J(S(e,y(e.id,e.name,{...n,apiKey:i})),`streamSimpleAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(Y(e,t)),r.end()}})(),r};function fe(e){let t={id:e.id,name:e.name};return e.api!==void 0&&(t.api=e.api),e.context_window!==void 0&&(t.context_window=e.context_window),e.max_tokens!==void 0&&(t.max_tokens=e.max_tokens),e.reasoning!==void 0&&(t.reasoning=e.reasoning),e.input!==void 0&&(t.input=e.input),t}function pe(){let e=new Map;for(let t of c())try{for(let n of o(t))e.set(n.id,n)}catch{}return e}function me(e,n,r){let i=`adobe-${e.api===`openai`?`openai`:`anthropic`}`,a=r.get(e.id);if(a)return{...a,provider:`adobe`,api:i};let o=t(e.id,r);return{id:e.id,name:e.name??e.id,provider:`adobe`,api:i,baseUrl:n,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:o,inputCost:o.input,outputCost:o.output,cacheReadCost:o.cacheRead,cacheWriteCost:o.cacheWrite,reasoning:!0}}function he(e,t){for(let t of e)E.set(t.id,fe(t));let n=pe();return e.map(e=>me(e,t,n))}async function ge(e){try{let t=e??await B(),n=w(),r=await fetch(`${n}/v1/models`,{headers:{Authorization:`Bearer ${t}`,[G]:`6.99.5`}});if(!r.ok)console.warn(`[adobe] Proxy /v1/models returned ${r.status}, falling back to Anthropic models`);else{let e=await r.json();if(e.data?.length)return he(e.data,n)}}catch(e){console.warn(`[adobe] Failed to fetch proxy models:`,e instanceof Error?e.message:String(e))}return null}var Q=new Map;function _e(){return o(`anthropic`).map(e=>({...e,provider:`adobe`,api:`adobe-anthropic`}))}async function $(e){let t=w(),n=Q.get(t);if(n)return n;let r=await ge(e);return r?(Q.set(t,r),r):_e()}function ve(){d({api:`adobe-anthropic`,stream:X,streamSimple:Z}),d({api:`adobe-openai`,stream:X,streamSimple:Z})}export{de as __resetAdobeSessionIdWarningCacheForTests,R as config,L as extractTokenFromUrl,$ as getAdobeModels,B as getValidAccessToken,ce as isTokenExpired,ve as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./panel-rpc-BPwAqRch.js";import{$ as t,H as n,d as r,y as i}from"./account-store-DbDlNeNQ.js";import{a}from"./diagnostics-DN_idNHx.js";import{c as o,i as s,l as c,n as l,r as u,u as d}from"./claude-model-version-Csn7RPVg.js";import{a as f,r as p,s as m,t as h}from"./legacy-api-aliases-oJPAvhVV.js";import{n as g}from"./llm-session-id-BZyXP_j2.js";import{n as _,t as v}from"./silent-renew-backoff-C_Iv54ZG.js";import{getOAuthPageOrigin as ee}from"./oauth-service-CTntqv0R.js";import{n as y}from"./temperature-support-B4x2xaWY.js";import"./provider-settings-C5dMRrvw.js";var te={proxyEndpoint:`https://adobe-llm-proxy.paolo-moz.workers.dev`,redirectUri:`https://www.sliccy.ai/auth/callback`,extensionRedirectUri:`https://akjjllgokmbgpbdbmafpiefnhidlmbgf.chromiumapp.org/adobe`};function ne(e,t){return l(e,t)}function b(e,t,n){return e!==`xhigh`||!t?e:s(t,n)?`xhigh`:u(t,n)?`max`:`high`}function re(e,t){let n=e?t?.thinkingLevelMap?.[e]:void 0;return b((()=>{if(typeof n==`string`)return n;switch(e){case`minimal`:case`low`:return`low`;case`medium`:return`medium`;case`xhigh`:return`xhigh`;default:return`high`}})(),t?.id,t?.name)}function ie(e,t){return async(n,r)=>{let i=t?await t(n,r)??n:n,a=i.thinking;return a&&a.type===`enabled`&&(i.thinking={type:`adaptive`,...a.display===void 0?{}:{display:a.display}},i.output_config={...i.output_config??{},effort:e}),i}}function x(e,t){if(!ne(e.id,e.name))return t;let n=t,r=b(n.effort??re(n.reasoning,e),e.id,e.name);return{...t,onPayload:ie(r,n.onPayload)}}function ae(e,t){let n={id:e.id,name:e.name??e.id},r=t?.api??e.api,i=t?.context_window??e.context_window,a=t?.max_tokens??e.max_tokens,o=t?.reasoning??e.reasoning,s=t?.input??e.input;r&&(n.api=r),i!==void 0&&(n.context_window=i),a!==void 0&&(n.max_tokens=a),o!==void 0&&(n.reasoning=o),s&&(n.input=s);let c=t?.cost??e.cost;return c&&(n.cost=c),/haiku/i.test(e.id)&&(n.compat={supportsEagerToolInputStreaming:!1}),/sonnet-5\b/i.test(e.id)&&!n.thinkingLevelMap&&(n.thinkingLevelMap={xhigh:`xhigh`}),n}const S=Object.assign({"/packages/webapp/providers/adobe-config.json":te})[`/packages/webapp/providers/adobe-config.json`]??{clientId:``,proxyEndpoint:``,scopes:`openid,profile,email`};function C(){let e=i(`adobe`);if(e)return e.replace(/\/$/,``);if(S.proxyEndpoint)return S.proxyEndpoint.replace(/\/$/,``);throw Error(`Adobe proxy endpoint not configured — set it in Settings or adobe-config.json`)}const w=new Map,T=new Map,E=`slicc-adobe-models`;function D(e){try{localStorage.setItem(E,JSON.stringify(e))}catch{}}async function O(e){let t=w.get(e);if(t)return t;try{let t=await fetch(`${e}/v1/config`,{headers:{[W]:`6.99.3`}});if(t.ok){let n=await t.json();return w.set(e,n),n}console.warn(`[adobe] Proxy /v1/config returned ${t.status}, falling back to build-time config`)}catch(e){console.warn(`[adobe] Failed to fetch proxy config:`,e instanceof Error?e.message:String(e))}return{}}function k(e){let t=e.clientId||S.clientId;if(!t)throw Error(`Could not determine IMS client ID — proxy /v1/config did not return one and adobe-config.json is empty`);return t}function A(e){return e.scopes||S.scopes}function j(e){return e.imsEnvironment||S.imsEnvironment||`prod`}const M={prod:`https://ims-na1.adobelogin.com`,stg1:`https://ims-na1-stg1.adobelogin.com`};function N(e){return M[e??S.imsEnvironment??`prod`]??M.prod}const P=typeof chrome<`u`&&!!chrome?.runtime?.id;function F(){return r().find(e=>e.providerId===`adobe`)}async function oe(e,t){try{let n=await fetch(`${N(t)}/ims/userinfo/v2`,{headers:{Authorization:`Bearer ${e}`}});if(n.ok){let e=await n.json();return{name:e.displayName||e.name||e.email,avatar:e.picture||e.avatar_url}}console.warn(`[adobe] User profile fetch returned ${n.status}, account will have no display name`)}catch(e){console.warn(`[adobe] Failed to fetch user profile:`,e instanceof Error?e.message:String(e))}return{}}function I(e){let t=e.indexOf(`#`);if(t<0)return null;let n=new URLSearchParams(e.slice(t+1)),r=n.get(`access_token`);return r?{accessToken:r,expiresIn:parseInt(n.get(`expires_in`)??`86400`,10),scope:n.get(`scope`)??void 0}:null}const L={id:`adobe`,name:`Adobe`,description:`Claude via Adobe — login with your Adobe ID`,requiresApiKey:!1,requiresBaseUrl:!S.proxyEndpoint,baseUrlPlaceholder:`https://your-proxy.example.com`,baseUrlDescription:`Anthropic-compatible proxy endpoint`,isOAuth:!0,defaultModelId:`sonnet`,oauthTokenDomains:[`ims-na1.adobelogin.com`,`ims-na1-stg1.adobelogin.com`,`*.adobelogin.com`,`*.adobe.io`,`firefall.adobe.io`,`admin.hlx.page`,`admin.hlx.live`,`admin.aem.page`,`admin.aem.live`],getModelIds:()=>{let e=e=>ae(e,T.get(e.id));for(let t of Q.values())if(t.length){let n=t.map(t=>e({id:t.id,name:t.name??t.id,reasoning:t.reasoning,input:t.input,cost:t.cost}));return D(n),n}for(let t of w.values())if(t.models?.length)return t.models.map(t=>e(t));try{let e=localStorage.getItem(E);if(e){let t=JSON.parse(e);if(t.length)return t}}catch{}return[{id:`claude-sonnet-4-6`,name:`Claude Sonnet 4.6`}]},onOAuthLogin:async(e,t,r)=>{let i=C(),a=await O(i),o=k(a),s=A(a),c=j(a),l=P?null:await ee(),u=P?null:_({pageHref:l.href,pageOrigin:l.origin,configuredRedirectUri:S.redirectUri},()=>crypto.randomUUID()),d=P?S.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:u.redirectUri,f=u?.oauthState,p=u?.expectedNonce??null,m=new URLSearchParams({client_id:o,scope:s,response_type:`token`,redirect_uri:d});f&&m.set(`state`,f),r?.forceReauth&&m.set(`prompt`,`login`);let h=await e(`${N(c)}/ims/authorize/v2?${m}`);if(!h)return;if(p&&h)try{if(new URL(h).searchParams.get(`nonce`)!==p){console.error(`[adobe] OAuth nonce mismatch — possible CSRF`);return}}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}let g=I(h);if(!g){console.error(`[adobe] Could not extract token from redirect URL`);return}let v=await oe(g.accessToken,c);await n({providerId:`adobe`,accessToken:g.accessToken,tokenExpiresAt:Date.now()+g.expiresIn*1e3,userName:v.name,userAvatar:v.avatar,scopes:g.scope,baseUrl:S.proxyEndpoint?void 0:i}),await $().catch(e=>console.warn(`[adobe] Failed to fetch models after login:`,e instanceof Error?e.message:String(e))),t()},onOAuthLogout:async()=>{let e=F();if(e?.accessToken)try{let t=w.values().next().value??{},n=t.clientId||S.clientId,r=j(t);if(n){let t=await fetch(`${N(r)}/ims/revoke`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:e.accessToken,token_type_hint:`access_token`,client_id:n})});t.ok||console.warn(`[adobe] Token revocation returned ${t.status}, token may still be valid server-side`)}}catch(e){console.warn(`[adobe] Failed to revoke token:`,e instanceof Error?e.message:String(e))}await n({providerId:`adobe`,accessToken:``})},onSilentRenew:async()=>F()?.accessToken?B():null,refreshModels:async e=>{await $(e);let t=L.getModelIds?.();t?.length&&D(t)}};let R=null;const se=v();async function z(){let e=F();if(!e?.accessToken)throw Error(`Not logged in to Adobe — please log in first`);if((e.tokenExpiresAt??0)-Date.now()>6e4)return e.accessToken;console.log(`[adobe] Token expired or expiring soon, attempting silent renewal...`);let t=await se.run(()=>B());if(t)return t;let n=F();if((n?.tokenExpiresAt??0)-Date.now()>0&&n?.accessToken)return n.accessToken;throw Error(`Adobe session expired — please log in again`)}function ce(){let e=F();return!e?.tokenExpiresAt||Date.now()>e.tokenExpiresAt-6e4}async function B(){if(typeof window>`u`){let t=e();if(!t)return null;try{let{accessToken:e}=await t.call(`silent-renew`,{providerId:`adobe`},{timeoutMs:13e4});return e}catch(e){return console.warn(`[adobe] worker→page silent-renew bridge failed:`,e instanceof Error?e.message:String(e)),null}}return R||(R=U().finally(()=>{R=null}),R)}function le(e,t){let n=k(t),r=A(t),i=j(t),a=P?null:_({pageHref:window.location.href,pageOrigin:window.location.origin,configuredRedirectUri:S.redirectUri},()=>crypto.randomUUID()),o=P?S.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:a.redirectUri,s=a?.oauthState,c=a?.expectedNonce??null,l=new URLSearchParams({client_id:n,scope:r,response_type:`token`,redirect_uri:o,prompt:`none`});return s&&l.set(`state`,s),{authorizeUrl:`${N(i)}/ims/authorize/v2?${l}`,expectedNonce:c,proxyEndpoint:e}}function V(e,t){if(!t)return!0;try{if(new URL(e).searchParams.get(`nonce`)!==t)return console.error(`[adobe] OAuth nonce mismatch — possible CSRF`),!1}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}return!0}async function H(e,t){let r=F();await n({providerId:`adobe`,accessToken:e.accessToken,tokenExpiresAt:Date.now()+e.expiresIn*1e3,userName:r?.userName,userAvatar:r?.userAvatar,scopes:e.scope,baseUrl:S.proxyEndpoint?void 0:t})}async function U(){try{let e=C(),{authorizeUrl:t,expectedNonce:n}=le(e,await O(e)),{createOAuthLauncher:r}=await import(`./oauth-service-CTntqv0R.js`),i=await r()(t,{interactive:!1});if(!i||!V(i,n))return null;let a=I(i);return a?(await H(a,e),console.log(`[adobe] Token renewed silently`),await $().catch(e=>console.warn(`[adobe] Failed to refresh models after silent renewal:`,e instanceof Error?e.message:String(e))),a.accessToken):null}catch(e){return console.warn(`[adobe] Silent renewal error:`,e instanceof Error?e.message:String(e)),null}}const W=`X-Slicc-Version`;function G(e){let t={};if(e.headers)for(let[n,r]of Object.entries(e.headers))n.toLowerCase()!==`x-slicc-version`&&(t[n]=r);return t[W]=`6.99.3`,{...e,headers:t}}const K=new Set;function q(e,t){if(e.headers){for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()===`x-session-id`&&n!=null)return e}return K.has(t)||(K.add(t),console.warn(`[adobe] Missing X-Session-Id from ${t} — using daily fallback. Attach an X-Session-Id header at the call site (see scoop-context.ts streamWithSessionId or docs/pitfalls.md).`)),{...e,headers:{...e.headers??{},"X-Session-Id":g(`adobe-provider-fallback`)}}}function ue(){K.clear()}function J(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:`adobe-anthropic`,provider:`adobe`,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}const Y=(e,t,n={})=>{let r=a();return(async()=>{try{let i=await z();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${C()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=p(a,t,G(q({...n,apiKey:i},`streamAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:C(),api:`anthropic-messages`},o=h(a,t,G(q(x(e,y(e.id,e.name,{...n,apiKey:i})),`streamAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(J(e,t)),r.end()}})(),r},X=(e,t,n)=>{let r=a();return(async()=>{try{let i=await z();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${C()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=m(a,t,G(q({...n,apiKey:i},`streamSimpleAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:C(),api:`anthropic-messages`},o=f(a,t,G(q(x(e,y(e.id,e.name,{...n,apiKey:i})),`streamSimpleAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(J(e,t)),r.end()}})(),r};function de(e){let t={id:e.id,name:e.name};return e.api!==void 0&&(t.api=e.api),e.context_window!==void 0&&(t.context_window=e.context_window),e.max_tokens!==void 0&&(t.max_tokens=e.max_tokens),e.reasoning!==void 0&&(t.reasoning=e.reasoning),e.input!==void 0&&(t.input=e.input),t}function Z(){let e=new Map;for(let t of c())try{for(let n of o(t))e.set(n.id,n)}catch{}return e}function fe(e,n,r){let i=`adobe-${e.api===`openai`?`openai`:`anthropic`}`,a=r.get(e.id);if(a)return{...a,provider:`adobe`,api:i};let o=t(e.id,r);return{id:e.id,name:e.name??e.id,provider:`adobe`,api:i,baseUrl:n,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:o,inputCost:o.input,outputCost:o.output,cacheReadCost:o.cacheRead,cacheWriteCost:o.cacheWrite,reasoning:!0}}function pe(e,t){for(let t of e)T.set(t.id,de(t));let n=Z();return e.map(e=>fe(e,t,n))}async function me(e){try{let t=e??await z(),n=C(),r=await fetch(`${n}/v1/models`,{headers:{Authorization:`Bearer ${t}`,[W]:`6.99.3`}});if(!r.ok)console.warn(`[adobe] Proxy /v1/models returned ${r.status}, falling back to Anthropic models`);else{let e=await r.json();if(e.data?.length)return pe(e.data,n)}}catch(e){console.warn(`[adobe] Failed to fetch proxy models:`,e instanceof Error?e.message:String(e))}return null}const Q=new Map;function he(){return o(`anthropic`).map(e=>({...e,provider:`adobe`,api:`adobe-anthropic`}))}async function $(e){let t=C(),n=Q.get(t);if(n)return n;let r=await me(e);return r?(Q.set(t,r),r):he()}function ge(){d({api:`adobe-anthropic`,stream:Y,streamSimple:X}),d({api:`adobe-openai`,stream:Y,streamSimple:X})}export{ue as __resetAdobeSessionIdWarningCacheForTests,L as config,I as extractTokenFromUrl,$ as getAdobeModels,z as getValidAccessToken,ce as isTokenExpired,ge as register};
|
|
1
|
+
import{n as e}from"./panel-rpc-BPwAqRch.js";import{$ as t,H as n,d as r,y as i}from"./account-store-DcTHuaYs.js";import{a}from"./diagnostics-DN_idNHx.js";import{c as o,i as s,l as c,n as l,r as u,u as d}from"./claude-model-version-Csn7RPVg.js";import{a as f,r as p,s as m,t as h}from"./legacy-api-aliases-oJPAvhVV.js";import{n as g}from"./llm-session-id-BZyXP_j2.js";import{n as _,t as v}from"./silent-renew-backoff-C_Iv54ZG.js";import{getOAuthPageOrigin as ee}from"./oauth-service-CTntqv0R.js";import{n as y}from"./temperature-support-B4x2xaWY.js";import"./provider-settings-ESBXURmC.js";var te={proxyEndpoint:`https://adobe-llm-proxy.paolo-moz.workers.dev`,redirectUri:`https://www.sliccy.ai/auth/callback`,extensionRedirectUri:`https://akjjllgokmbgpbdbmafpiefnhidlmbgf.chromiumapp.org/adobe`};function ne(e,t){return l(e,t)}function b(e,t,n){return e!==`xhigh`||!t?e:s(t,n)?`xhigh`:u(t,n)?`max`:`high`}function re(e,t){let n=e?t?.thinkingLevelMap?.[e]:void 0;return b((()=>{if(typeof n==`string`)return n;switch(e){case`minimal`:case`low`:return`low`;case`medium`:return`medium`;case`xhigh`:return`xhigh`;default:return`high`}})(),t?.id,t?.name)}function ie(e,t){return async(n,r)=>{let i=t?await t(n,r)??n:n,a=i.thinking;return a&&a.type===`enabled`&&(i.thinking={type:`adaptive`,...a.display===void 0?{}:{display:a.display}},i.output_config={...i.output_config??{},effort:e}),i}}function x(e,t){if(!ne(e.id,e.name))return t;let n=t,r=b(n.effort??re(n.reasoning,e),e.id,e.name);return{...t,onPayload:ie(r,n.onPayload)}}function ae(e,t){let n={id:e.id,name:e.name??e.id},r=t?.api??e.api,i=t?.context_window??e.context_window,a=t?.max_tokens??e.max_tokens,o=t?.reasoning??e.reasoning,s=t?.input??e.input;r&&(n.api=r),i!==void 0&&(n.context_window=i),a!==void 0&&(n.max_tokens=a),o!==void 0&&(n.reasoning=o),s&&(n.input=s);let c=t?.cost??e.cost;return c&&(n.cost=c),/haiku/i.test(e.id)&&(n.compat={supportsEagerToolInputStreaming:!1}),/sonnet-5\b/i.test(e.id)&&!n.thinkingLevelMap&&(n.thinkingLevelMap={xhigh:`xhigh`}),n}const S=Object.assign({"/packages/webapp/providers/adobe-config.json":te})[`/packages/webapp/providers/adobe-config.json`]??{clientId:``,proxyEndpoint:``,scopes:`openid,profile,email`};function C(){let e=i(`adobe`);if(e)return e.replace(/\/$/,``);if(S.proxyEndpoint)return S.proxyEndpoint.replace(/\/$/,``);throw Error(`Adobe proxy endpoint not configured — set it in Settings or adobe-config.json`)}const w=new Map,T=new Map,E=`slicc-adobe-models`;function D(e){try{localStorage.setItem(E,JSON.stringify(e))}catch{}}async function O(e){let t=w.get(e);if(t)return t;try{let t=await fetch(`${e}/v1/config`,{headers:{[W]:`6.99.5`}});if(t.ok){let n=await t.json();return w.set(e,n),n}console.warn(`[adobe] Proxy /v1/config returned ${t.status}, falling back to build-time config`)}catch(e){console.warn(`[adobe] Failed to fetch proxy config:`,e instanceof Error?e.message:String(e))}return{}}function k(e){let t=e.clientId||S.clientId;if(!t)throw Error(`Could not determine IMS client ID — proxy /v1/config did not return one and adobe-config.json is empty`);return t}function A(e){return e.scopes||S.scopes}function j(e){return e.imsEnvironment||S.imsEnvironment||`prod`}const M={prod:`https://ims-na1.adobelogin.com`,stg1:`https://ims-na1-stg1.adobelogin.com`};function N(e){return M[e??S.imsEnvironment??`prod`]??M.prod}const P=typeof chrome<`u`&&!!chrome?.runtime?.id;function F(){return r().find(e=>e.providerId===`adobe`)}async function oe(e,t){try{let n=await fetch(`${N(t)}/ims/userinfo/v2`,{headers:{Authorization:`Bearer ${e}`}});if(n.ok){let e=await n.json();return{name:e.displayName||e.name||e.email,avatar:e.picture||e.avatar_url}}console.warn(`[adobe] User profile fetch returned ${n.status}, account will have no display name`)}catch(e){console.warn(`[adobe] Failed to fetch user profile:`,e instanceof Error?e.message:String(e))}return{}}function I(e){let t=e.indexOf(`#`);if(t<0)return null;let n=new URLSearchParams(e.slice(t+1)),r=n.get(`access_token`);return r?{accessToken:r,expiresIn:parseInt(n.get(`expires_in`)??`86400`,10),scope:n.get(`scope`)??void 0}:null}const L={id:`adobe`,name:`Adobe`,description:`Claude via Adobe — login with your Adobe ID`,requiresApiKey:!1,requiresBaseUrl:!S.proxyEndpoint,baseUrlPlaceholder:`https://your-proxy.example.com`,baseUrlDescription:`Anthropic-compatible proxy endpoint`,isOAuth:!0,defaultModelId:`sonnet`,oauthTokenDomains:[`ims-na1.adobelogin.com`,`ims-na1-stg1.adobelogin.com`,`*.adobelogin.com`,`*.adobe.io`,`firefall.adobe.io`,`admin.hlx.page`,`admin.hlx.live`,`admin.aem.page`,`admin.aem.live`],getModelIds:()=>{let e=e=>ae(e,T.get(e.id));for(let t of Q.values())if(t.length){let n=t.map(t=>e({id:t.id,name:t.name??t.id,reasoning:t.reasoning,input:t.input,cost:t.cost}));return D(n),n}for(let t of w.values())if(t.models?.length)return t.models.map(t=>e(t));try{let e=localStorage.getItem(E);if(e){let t=JSON.parse(e);if(t.length)return t}}catch{}return[{id:`claude-sonnet-4-6`,name:`Claude Sonnet 4.6`}]},onOAuthLogin:async(e,t,r)=>{let i=C(),a=await O(i),o=k(a),s=A(a),c=j(a),l=P?null:await ee(),u=P?null:_({pageHref:l.href,pageOrigin:l.origin,configuredRedirectUri:S.redirectUri},()=>crypto.randomUUID()),d=P?S.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:u.redirectUri,f=u?.oauthState,p=u?.expectedNonce??null,m=new URLSearchParams({client_id:o,scope:s,response_type:`token`,redirect_uri:d});f&&m.set(`state`,f),r?.forceReauth&&m.set(`prompt`,`login`);let h=await e(`${N(c)}/ims/authorize/v2?${m}`);if(!h)return;if(p&&h)try{if(new URL(h).searchParams.get(`nonce`)!==p){console.error(`[adobe] OAuth nonce mismatch — possible CSRF`);return}}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}let g=I(h);if(!g){console.error(`[adobe] Could not extract token from redirect URL`);return}let v=await oe(g.accessToken,c);await n({providerId:`adobe`,accessToken:g.accessToken,tokenExpiresAt:Date.now()+g.expiresIn*1e3,userName:v.name,userAvatar:v.avatar,scopes:g.scope,baseUrl:S.proxyEndpoint?void 0:i}),await $().catch(e=>console.warn(`[adobe] Failed to fetch models after login:`,e instanceof Error?e.message:String(e))),t()},onOAuthLogout:async()=>{let e=F();if(e?.accessToken)try{let t=w.values().next().value??{},n=t.clientId||S.clientId,r=j(t);if(n){let t=await fetch(`${N(r)}/ims/revoke`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({token:e.accessToken,token_type_hint:`access_token`,client_id:n})});t.ok||console.warn(`[adobe] Token revocation returned ${t.status}, token may still be valid server-side`)}}catch(e){console.warn(`[adobe] Failed to revoke token:`,e instanceof Error?e.message:String(e))}await n({providerId:`adobe`,accessToken:``})},onSilentRenew:async()=>F()?.accessToken?B():null,refreshModels:async e=>{await $(e);let t=L.getModelIds?.();t?.length&&D(t)}};let R=null;const se=v();async function z(){let e=F();if(!e?.accessToken)throw Error(`Not logged in to Adobe — please log in first`);if((e.tokenExpiresAt??0)-Date.now()>6e4)return e.accessToken;console.log(`[adobe] Token expired or expiring soon, attempting silent renewal...`);let t=await se.run(()=>B());if(t)return t;let n=F();if((n?.tokenExpiresAt??0)-Date.now()>0&&n?.accessToken)return n.accessToken;throw Error(`Adobe session expired — please log in again`)}function ce(){let e=F();return!e?.tokenExpiresAt||Date.now()>e.tokenExpiresAt-6e4}async function B(){if(typeof window>`u`){let t=e();if(!t)return null;try{let{accessToken:e}=await t.call(`silent-renew`,{providerId:`adobe`},{timeoutMs:13e4});return e}catch(e){return console.warn(`[adobe] worker→page silent-renew bridge failed:`,e instanceof Error?e.message:String(e)),null}}return R||(R=U().finally(()=>{R=null}),R)}function le(e,t){let n=k(t),r=A(t),i=j(t),a=P?null:_({pageHref:window.location.href,pageOrigin:window.location.origin,configuredRedirectUri:S.redirectUri},()=>crypto.randomUUID()),o=P?S.extensionRedirectUri??`https://${chrome.runtime.id}.chromiumapp.org/`:a.redirectUri,s=a?.oauthState,c=a?.expectedNonce??null,l=new URLSearchParams({client_id:n,scope:r,response_type:`token`,redirect_uri:o,prompt:`none`});return s&&l.set(`state`,s),{authorizeUrl:`${N(i)}/ims/authorize/v2?${l}`,expectedNonce:c,proxyEndpoint:e}}function V(e,t){if(!t)return!0;try{if(new URL(e).searchParams.get(`nonce`)!==t)return console.error(`[adobe] OAuth nonce mismatch — possible CSRF`),!1}catch(e){console.warn(`[adobe] Nonce check skipped (URL parse failed):`,e instanceof Error?e.message:String(e))}return!0}async function H(e,t){let r=F();await n({providerId:`adobe`,accessToken:e.accessToken,tokenExpiresAt:Date.now()+e.expiresIn*1e3,userName:r?.userName,userAvatar:r?.userAvatar,scopes:e.scope,baseUrl:S.proxyEndpoint?void 0:t})}async function U(){try{let e=C(),{authorizeUrl:t,expectedNonce:n}=le(e,await O(e)),{createOAuthLauncher:r}=await import(`./oauth-service-CTntqv0R.js`),i=await r()(t,{interactive:!1});if(!i||!V(i,n))return null;let a=I(i);return a?(await H(a,e),console.log(`[adobe] Token renewed silently`),await $().catch(e=>console.warn(`[adobe] Failed to refresh models after silent renewal:`,e instanceof Error?e.message:String(e))),a.accessToken):null}catch(e){return console.warn(`[adobe] Silent renewal error:`,e instanceof Error?e.message:String(e)),null}}const W=`X-Slicc-Version`;function G(e){let t={};if(e.headers)for(let[n,r]of Object.entries(e.headers))n.toLowerCase()!==`x-slicc-version`&&(t[n]=r);return t[W]=`6.99.5`,{...e,headers:t}}const K=new Set;function q(e,t){if(e.headers){for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()===`x-session-id`&&n!=null)return e}return K.has(t)||(K.add(t),console.warn(`[adobe] Missing X-Session-Id from ${t} — using daily fallback. Attach an X-Session-Id header at the call site (see scoop-context.ts streamWithSessionId or docs/pitfalls.md).`)),{...e,headers:{...e.headers??{},"X-Session-Id":g(`adobe-provider-fallback`)}}}function ue(){K.clear()}function J(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:`adobe-anthropic`,provider:`adobe`,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}const Y=(e,t,n={})=>{let r=a();return(async()=>{try{let i=await z();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${C()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=p(a,t,G(q({...n,apiKey:i},`streamAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:C(),api:`anthropic-messages`},o=h(a,t,G(q(x(e,y(e.id,e.name,{...n,apiKey:i})),`streamAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(J(e,t)),r.end()}})(),r},X=(e,t,n)=>{let r=a();return(async()=>{try{let i=await z();if(String(e.api).includes(`openai`)){let a={...e,baseUrl:`${C()}/v1`,api:`openai-completions`,compat:{...e.compat,supportsStore:!1,supportsDeveloperRole:!1}},o=m(a,t,G(q({...n,apiKey:i},`streamSimpleAdobe[openai]`)));for await(let e of o)r.push(e)}else{let a={...e,baseUrl:C(),api:`anthropic-messages`},o=f(a,t,G(q(x(e,y(e.id,e.name,{...n,apiKey:i})),`streamSimpleAdobe[anthropic]`)));for await(let e of o)r.push(e)}r.end()}catch(t){console.error(`[adobe] Stream error:`,t instanceof Error?t.message:String(t)),r.push(J(e,t)),r.end()}})(),r};function de(e){let t={id:e.id,name:e.name};return e.api!==void 0&&(t.api=e.api),e.context_window!==void 0&&(t.context_window=e.context_window),e.max_tokens!==void 0&&(t.max_tokens=e.max_tokens),e.reasoning!==void 0&&(t.reasoning=e.reasoning),e.input!==void 0&&(t.input=e.input),t}function Z(){let e=new Map;for(let t of c())try{for(let n of o(t))e.set(n.id,n)}catch{}return e}function fe(e,n,r){let i=`adobe-${e.api===`openai`?`openai`:`anthropic`}`,a=r.get(e.id);if(a)return{...a,provider:`adobe`,api:i};let o=t(e.id,r);return{id:e.id,name:e.name??e.id,provider:`adobe`,api:i,baseUrl:n,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:o,inputCost:o.input,outputCost:o.output,cacheReadCost:o.cacheRead,cacheWriteCost:o.cacheWrite,reasoning:!0}}function pe(e,t){for(let t of e)T.set(t.id,de(t));let n=Z();return e.map(e=>fe(e,t,n))}async function me(e){try{let t=e??await z(),n=C(),r=await fetch(`${n}/v1/models`,{headers:{Authorization:`Bearer ${t}`,[W]:`6.99.5`}});if(!r.ok)console.warn(`[adobe] Proxy /v1/models returned ${r.status}, falling back to Anthropic models`);else{let e=await r.json();if(e.data?.length)return pe(e.data,n)}}catch(e){console.warn(`[adobe] Failed to fetch proxy models:`,e instanceof Error?e.message:String(e))}return null}const Q=new Map;function he(){return o(`anthropic`).map(e=>({...e,provider:`adobe`,api:`adobe-anthropic`}))}async function $(e){let t=C(),n=Q.get(t);if(n)return n;let r=await me(e);return r?(Q.set(t,r),r):he()}function ge(){d({api:`adobe-anthropic`,stream:Y,streamSimple:X}),d({api:`adobe-openai`,stream:Y,streamSimple:X})}export{ue as __resetAdobeSessionIdWarningCacheForTests,L as config,I as extractTokenFromUrl,$ as getAdobeModels,z as getValidAccessToken,ce as isTokenExpired,ge as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CHAT_SURFACE_ID as e}from"./wc-sprinkles-
|
|
1
|
+
import{CHAT_SURFACE_ID as e}from"./wc-sprinkles-S2V-1GSY.js";var t=`focus`,n={type:`leaf`,surfaceId:`chat`};function r(e,t={},n={}){return{zones:{top:null,left:null,middle:null,right:null,bottom:null,...e},rowFr:{top:1,center:1,bottom:1,...n},colFr:{left:1,middle:1,right:1,...t}}}var i={focus:{name:`focus`,tree:r({left:n},{left:3,middle:1})}};function a(e){return i[e]??null}function o(n,r){switch(r.kind){case`set`:n.applyLayout(r.tree);break;case`reset`:{let e=a(t);e&&n.applyLayout(e.tree);break}case`chat`:n.moveSurfaceToZone(e,r.zone);break;case`open`:n.placeSurface(r.zone,r.surfaceId);break;case`close`:n.removeSurface(r.surfaceId);break;case`move`:n.moveSurfaceToZone(r.surfaceId,r.zone);break;case`size`:n.setSurfaceSize(r.surfaceId,r.size)}}export{o as applyLayout};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";import{t}from"./html-B_Hg2WOy.js";import{t as n}from"./types-idfTVsM8.js";import{t as r}from"./global-db-DJXlpNui.js";const i=e(`mcp-apps`),a=`/workspace/.mcp/sprinkles`;async function o(e){if(e)return e;let{VirtualFS:t}=await import(`./fs-
|
|
1
|
+
import{t as e}from"./logger-LESFN7Hj.js";import{t}from"./html-B_Hg2WOy.js";import{t as n}from"./types-idfTVsM8.js";import{t as r}from"./global-db-DJXlpNui.js";const i=e(`mcp-apps`),a=`/workspace/.mcp/sprinkles`;async function o(e){if(e)return e;let{VirtualFS:t}=await import(`./fs-CZIZCIGv.js`).then(e=>e.t);return await t.create({dbName:r})}function s(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,64)||`app`}function c(e,n){let r=t(n.title??n.name),i=n.description?t(n.description):``,a=t(n.templateUri??`about:blank`),o=JSON.stringify(e),s=JSON.stringify(n.name);return`<div class="mcp-app" data-sprinkle-title="${r}" style="display:flex;flex-direction:column;height:100%;min-height:0;">
|
|
2
2
|
<header class="mcp-app__header" style="padding:8px 12px;border-bottom:1px solid var(--s2-border-subtle,#3a3a3a);">
|
|
3
3
|
<h2 style="font-size:14px;font-weight:600;margin:0;">${r}</h2>${i?`\n <p style="font-size:12px;margin:4px 0 0;color:var(--s2-content-secondary,#a0a0a0);">${i}</p>`:``}
|
|
4
4
|
</header>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as e,g as t}from"./account-store-
|
|
1
|
+
import{b as e,g as t}from"./account-store-B6Zka-_Q.js";import{a as n}from"./diagnostics-DN_idNHx.js";import{t as r}from"./models-BSkXF4T6.js";import{u as i}from"./claude-model-version-DoVrYsKi.js";import{i as a,t as o}from"./transform-messages-XkZ1QnTb.js";function s(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function c(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var l=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return l=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^n()&15>>e/4).toString(16))};function u(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var d=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},f=class extends Error{},p=class e extends f{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new h({message:r,cause:d(n)});let a=n?.error;return t===400?new _(t,a,r,i):t===401?new v(t,a,r,i):t===403?new y(t,a,r,i):t===404?new b(t,a,r,i):t===409?new x(t,a,r,i):t===422?new ee(t,a,r,i):t===429?new te(t,a,r,i):t>=500?new ne(t,a,r,i):new e(t,a,r,i)}},m=class extends p{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},h=class extends p{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},g=class extends h{constructor({message:e}={}){super({message:e??`Request timed out.`})}},_=class extends p{},v=class extends p{},y=class extends p{},b=class extends p{},x=class extends p{},ee=class extends p{},te=class extends p{},ne=class extends p{},re=class extends f{constructor(){super(`Could not parse response content as the length limit was reached`)}},ie=class extends f{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},ae=class extends Error{constructor(e){super(e)}},oe=class extends p{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},se=class extends f{constructor(e,t,n){super(e),this.provider=t,this.cause=n}},ce=/^[a-z][a-z0-9+.-]*:/i,le=e=>ce.test(e),S=e=>(S=Array.isArray,S(e)),ue=S;function de(e){return typeof e==`object`?e??{}:{}}function fe(e){if(!e)return!0;for(let t in e)return!1;return!0}function pe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var me=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new f(`${e} must be an integer`);if(t<0)throw new f(`${e} must be a positive integer`);return t},he=e=>{try{return JSON.parse(e)}catch{return}},ge=e=>new Promise(t=>setTimeout(t,e));function _e(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ve(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ye(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ve({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function be(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function xe(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Se;function w(e){let t;return(Se??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var Ce;function we(e){let t;return(Ce??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var Te,T,E,D,O,Ee,De,Oe=65536,ke=class{constructor(){Te.add(this),T.set(this,void 0),E.set(this,void 0),D.set(this,void 0),O.set(this,void 0),Ee.set(this,void 0),s(this,T,new Uint8Array,`f`),s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),s(this,Ee,!1,`f`)}decode(e){if(e==null)return[];let t;if(t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?w(e):e,t.length===0||c(this,Ee,`f`)&&(s(this,Ee,!1,`f`),t[0]===10&&(t=t.subarray(1)),t.length===0))return[];c(this,Te,`m`,De).call(this,t);let n=[],r;for(;(r=Ae(c(this,T,`f`),c(this,O,`f`),c(this,D,`f`)))!=null;){let e=we(c(this,T,`f`).subarray(c(this,E,`f`),r.preceding));n.push(e),s(this,E,r.index,`f`),r.carriage&&(c(this,E,`f`)<c(this,D,`f`)&&c(this,T,`f`)[c(this,E,`f`)]===10?s(this,E,c(this,E,`f`)+1,`f`):c(this,E,`f`)===c(this,D,`f`)&&s(this,Ee,!0,`f`)),s(this,O,c(this,E,`f`),`f`)}if(s(this,O,c(this,D,`f`),`f`),c(this,E,`f`)===c(this,D,`f`))s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),c(this,T,`f`).length>Oe&&s(this,T,new Uint8Array,`f`);else if(n.length>0&&c(this,T,`f`).length>Oe){let e=c(this,D,`f`)-c(this,E,`f`);if(e<=Oe||c(this,T,`f`).length>e*4){let t=e<=Oe?Math.min(Math.max(e*2,256),Oe):e*2,n=new Uint8Array(t);n.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,n,`f`),s(this,E,0,`f`),s(this,D,e,`f`),s(this,O,e,`f`)}}return n}flush(){return s(this,Ee,!1,`f`),c(this,E,`f`)===c(this,D,`f`)?[]:this.decode(`
|
|
2
2
|
`)}};T=new WeakMap,E=new WeakMap,D=new WeakMap,O=new WeakMap,Ee=new WeakMap,Te=new WeakSet,De=function(e){if(c(this,D,`f`)+e.length>c(this,T,`f`).length){let t=c(this,D,`f`)-c(this,E,`f`);if(c(this,E,`f`)>=c(this,T,`f`).length/2&&t+e.length<=c(this,T,`f`).length)c(this,T,`f`).copyWithin(0,c(this,E,`f`),c(this,D,`f`));else{let n=Math.max(c(this,T,`f`).length*2,t+e.length,256),r=new Uint8Array(n);r.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,r,`f`)}s(this,O,c(this,O,`f`)-c(this,E,`f`),`f`),s(this,D,t,`f`),s(this,E,0,`f`)}c(this,T,`f`).set(e,c(this,D,`f`)),s(this,D,c(this,D,`f`)+e.length,`f`)},ke.NEWLINE_CHARS=new Set([`
|
|
3
3
|
`,`\r`]),ke.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Ae(e,t,n){for(let r=t;r<n;r++){if(e[r]===10)return{preceding:r,index:r+1,carriage:!1};if(e[r]===13)return{preceding:r,index:r+1,carriage:!0}}return null}function je(e){for(let t=0;t<e.length-1;t++){let n=Me(e,t);if(n>0){let r=t+n,i=Me(e,r);if(i>0)return r+i}}return-1}function Me(e,t){return e[t]===10?1:e[t]===13?e[t+1]===10?2:1:0}var Ne={off:0,error:200,warn:300,info:400,debug:500},Pe=(e,t,n)=>{if(e){if(pe(Ne,e))return e;k(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Ne))}`)}};function Fe(){}function Ie(e,t,n){return!t||Ne[e]>Ne[n]?Fe:t[e].bind(t)}var Le={error:Fe,warn:Fe,info:Fe,debug:Fe},Re=new WeakMap;function k(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return Le;let r=Re.get(t);if(r&&r[0]===n)return r[1];let i={error:Ie(`error`,t,n),warn:Ie(`warn`,t,n),info:Ie(`info`,t,n),debug:Ie(`debug`,t,n)};return Re.set(t,[n,i]),i}var ze=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`authorization`||e.toLowerCase()===`api-key`||e.toLowerCase()===`x-api-key`||e.toLowerCase()===`x-amz-security-token`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t])),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),Be,Ve=class e{constructor(e,t,n){Be.set(this,void 0),this.iterator=e,this.controller=t,s(this,Be,n,`f`)}static fromSSEResponse(t,n,r,i){let a=!1,o=r?k(r):console;async function*s(){if(a)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let e=!1,r=!1;try{for await(let e of He(t,n)){if(e.data.startsWith(`[DONE]`)){r=!0;break}if(e.event===null||!e.event.startsWith(`thread.`)){let n;try{n=JSON.parse(e.data)}catch(t){throw o.error(`Could not parse message into JSON:`,e.data),o.error(`From chunk:`,e.raw),t}if(n&&n.error)throw new p(void 0,n.error,void 0,t.headers);yield i?{event:e.event,data:n}:n}else{let t;try{t=JSON.parse(e.data)}catch(t){throw console.error(`Could not parse message into JSON:`,e.data),console.error(`From chunk:`,e.raw),t}if(e.event===`error`)throw new p(void 0,t.error,t.message,void 0);yield{event:e.event,data:t}}}e=!0}catch(e){if(r||u(e)||n.signal.aborted&&e===n.signal.reason)return;throw e}finally{e||n.abort()}}return new e(s,n,r)}static fromReadableStream(t,n,r){let i=!1;async function*a(){let e=new ke,r=t.getReader(),i=!1,a,o=()=>{a??=r.cancel(),a.catch(()=>void 0)};n.signal.addEventListener(`abort`,o,{once:!0});try{if(n.signal.aborted){o();return}for(;;){let{value:t,done:a}=await r.read();if(a){i=!0;break}if(n.signal.aborted)return;for(let r of e.decode(t)){if(n.signal.aborted)return;yield r}}if(n.signal.aborted)return;for(let t of e.flush()){if(n.signal.aborted)return;yield t}}finally{n.signal.removeEventListener(`abort`,o),i||o(),r.releaseLock()}}async function*o(){if(i)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let e=!1;try{for await(let t of a())e||t&&(yield JSON.parse(t));e=!0}catch(e){if(n.signal.aborted||u(e))return;throw e}finally{e||n.abort()}}return new e(o,n,r)}[(Be=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],r=this.iterator(),i=e=>({next:()=>{if(e.length===0){let e=r.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>i(t),this.controller,c(this,Be,`f`)),new e(()=>i(n),this.controller,c(this,Be,`f`))]}toReadableStream(){let e;return ve({start:async()=>{e=this[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let i=w(JSON.stringify(n)+`
|
|
4
4
|
`);t.enqueue(i)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}};async function*He(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new f(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new f(`Attempted to iterate over a response with no body`);let n=new Ge,r=new ke,i=be(e.body);for await(let e of We(i))for(let t of r.decode(e)){let e=n.decode(t);e&&(yield e)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}var Ue=3;async function*We(e){let t=new Uint8Array,n=0,r=0,i=0;for await(let a of e){if(a==null)continue;let e;if(e=a instanceof ArrayBuffer?new Uint8Array(a):typeof a==`string`?w(a):a,r+e.length>t.length){let a=r-n;if(n>=t.length/2&&a+e.length<=t.length)t.copyWithin(0,n,r);else{let i=new Uint8Array(Math.max(t.length*2,a+e.length));i.set(t.subarray(n,r)),t=i}i-=n,n=0,r=a}t.set(e,r),r+=e.length;let o;for(;(o=je(t.subarray(i,r)))!==-1;)o+=i,yield t.slice(n,o),n=o,i=n;i=Math.max(n,r-Ue)}r>n&&(yield t.slice(n,r))}var Ge=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.slice(0,-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
|