sliccy 6.148.6 → 6.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/node-server/_shared/transcript-redaction.d.ts +12 -1
- package/dist/node-server/_shared/transcript-redaction.d.ts.map +1 -1
- package/dist/node-server/_shared/transcript-redaction.js +5 -5
- package/dist/node-server/_shared/transcript-redaction.js.map +1 -1
- package/dist/ui/.vite/manifest.json +186 -172
- package/dist/ui/assets/CLAUDE-C2sAF3Q0.js +1 -0
- package/dist/ui/assets/DREAMING-DKcamfu0.js +74 -0
- package/dist/ui/assets/GELATIERE-BnNVlnMz.js +1 -0
- package/dist/ui/assets/{MEMORY-BEEBDXkY.js → MEMORY-1jIGxLn4.js} +12 -3
- package/dist/ui/assets/SKILL-C9vwCrkC.js +1 -0
- package/dist/ui/assets/SKILL-Cc0Ep86w.js +1 -0
- package/dist/ui/assets/{SKILL-2Mi1pQ3F.js → SKILL-DJtLE66_.js} +5 -3
- package/dist/ui/assets/SKILL-DvHAkJSI.js +117 -0
- package/dist/ui/assets/SKILL-UcxSfshP.js +66 -0
- package/dist/ui/assets/WIKI-DoBxwf2u.js +1 -0
- package/dist/ui/assets/{account-store-CxhEKTWa.js → account-store-CA1A4MNg.js} +1 -1
- package/dist/ui/assets/{account-store-CSvfMN0q.js → account-store-D5-EuwRH.js} +1 -1
- package/dist/ui/assets/{adobe-CkbPEFWB.js → adobe-DV-vFrsP.js} +1 -1
- package/dist/ui/assets/{adobe-DwR2UBAP.js → adobe-DtbhCwKF.js} +1 -1
- package/dist/ui/assets/{agent-bridge-_io6UvbS.js → agent-bridge-Bk8XJ8b8.js} +8 -8
- package/dist/ui/assets/{agent-panels-DCYDDalu.js → agent-panels-DKzja1c3.js} +1 -1
- package/dist/ui/assets/{apply-layout-CUKNJsnM.js → apply-layout-y9wx9NT9.js} +1 -1
- package/dist/ui/assets/{approver-agent-O_C8F_lu.js → approver-agent-BA3dC9Lg.js} +1 -1
- package/dist/ui/assets/{apps-DmBDvKqA.js → apps-yQbw27PS.js} +1 -1
- package/dist/ui/assets/archive-redaction-ByV7X5fs.js +1 -0
- package/dist/ui/assets/{azure-openai-BqeIibmb.js → azure-openai-DHtO2E0K.js} +1 -1
- package/dist/ui/assets/{azure-openai-hucQjFkk.js → azure-openai-yibXp_Bz.js} +1 -1
- package/dist/ui/assets/{budget-usage-source-B7HIa-K7.js → budget-usage-source-CsYOdKgf.js} +1 -1
- package/dist/ui/assets/{cdp-fnaJdghg.js → cdp-DvBgKWeM.js} +1 -1
- package/dist/ui/assets/{cerebras-Cp_tyicG.js → cerebras-CS6Db07O.js} +1 -1
- package/dist/ui/assets/{cerebras-D4eNW8Dz.js → cerebras-CaDy2asW.js} +1 -1
- package/dist/ui/assets/{composer-speech-Y9nFpucg.js → composer-speech-DPiVvFU6.js} +1 -1
- package/dist/ui/assets/cone-memory-budget-ieIsscyt.js +15 -0
- package/dist/ui/assets/{connect-surface-DE9AvQcr.js → connect-surface-DZZV0bKb.js} +1 -1
- package/dist/ui/assets/descriptor-D-6Koktu.js +1 -0
- package/dist/ui/assets/{directed-approval-B64z8WXS.js → directed-approval-zgdk1qJY.js} +1 -1
- package/dist/ui/assets/feature-flags-BX-OhLDm.js +1 -0
- package/dist/ui/assets/feature-flags-CYCRk6Dq.js +1 -0
- package/dist/ui/assets/frozen-archive-writer--a4fMghf.js +8 -0
- package/dist/ui/assets/{fs-CIkDZ_Dd.js → fs-CeHAWOzG.js} +2 -2
- package/dist/ui/assets/{fs-Bdk6lf_I.js → fs-ZsGKH6_S.js} +1 -1
- package/dist/ui/assets/gelatiere-constants-BYJlhm8R.js +1 -0
- package/dist/ui/assets/gelatiere-store-D36IMluj.js +1 -0
- package/dist/ui/assets/gelatiere-unit-7xZALH_i.js +1 -0
- package/dist/ui/assets/{github-D62L-Qj4.js → github-CaKl6IqQ.js} +1 -1
- package/dist/ui/assets/{github-7zGAPnOR.js → github-EHGL5L1f.js} +2 -2
- package/dist/ui/assets/{github-copilot-DTqmEBkZ.js → github-copilot-BHsKQLD0.js} +1 -1
- package/dist/ui/assets/{github-copilot-K4pi5pmY.js → github-copilot-Cjxeuomt.js} +1 -1
- package/dist/ui/assets/{github-install-DW9eSCWK.js → github-install-CZ0EukOV.js} +1 -1
- package/dist/ui/assets/{github-zip-D5pmGz48.js → github-zip-CS4YNRru.js} +1 -1
- package/dist/ui/assets/{hear-C_o9CbL8.js → hear-Cbevfmh3.js} +1 -1
- package/dist/ui/assets/{help-lfImwIAI.js → help-B7QDR4Te.js} +1 -1
- package/dist/ui/assets/instruction-frontmatter-Bk64dayp.js +3 -0
- package/dist/ui/assets/{js-realm-worker-CuwcQntH.js → js-realm-worker-8iSCqCPx.js} +1 -1
- package/dist/ui/assets/{kernel-worker-ESg7BZtf.js → kernel-worker-C_WWxLV9.js} +648 -662
- package/dist/ui/assets/key-DExP84Xm.js +1 -0
- package/dist/ui/assets/lick-target-env-8JxfVcIV.js +1 -0
- package/dist/ui/assets/{live-session-snapshot-BnA6Mq0G.js → live-session-snapshot-CpwRZg6K.js} +1 -1
- package/dist/ui/assets/{local-llm-BIkUvHqY.js → local-llm-0LkBgtj2.js} +1 -1
- package/dist/ui/assets/{local-llm-D_T0EnaA.js → local-llm-Dr2UbIXv.js} +1 -1
- package/dist/ui/assets/log-DEDI5t_h.js +1 -0
- package/dist/ui/assets/{main-B6EOlFVs.js → main-BAC0OCne.js} +3 -3
- package/dist/ui/assets/{main-cherry-Dn_p-eb4.js → main-cherry-CewPDwbT.js} +1 -1
- package/dist/ui/assets/manager-CstXzWYQ.js +1 -0
- package/dist/ui/assets/memory-budget-CIVoqHgl.js +1 -0
- package/dist/ui/assets/memory-curation-seam-Dhr-Lh0Q.js +1 -0
- package/dist/ui/assets/memory-health-MhSOmzAf.js +1 -0
- package/dist/ui/assets/memory-v2-flag-D50hE5F1.js +1 -0
- package/dist/ui/assets/{mount-PrIS1Sa3.js → mount-BLSZhkn-.js} +3 -3
- package/dist/ui/assets/{mount-a6GiK5eK.js → mount-C-ANRQIp.js} +1 -1
- package/dist/ui/assets/{mount-recovery-B_EuFRnE.js → mount-recovery-DUczfSWq.js} +1 -1
- package/dist/ui/assets/new-session-BoS7dRsh.js +2 -0
- package/dist/ui/assets/{oauth-bootstrap-97a5ChZn.js → oauth-bootstrap-Bxgy2Cqv.js} +2 -2
- package/dist/ui/assets/{onboarding-orchestrator-xYbh_T_5.js → onboarding-orchestrator-Dk1ohi_0.js} +1 -1
- package/dist/ui/assets/{openai-codex-C1-zR0yq.js → openai-codex-BknfgoBF.js} +1 -1
- package/dist/ui/assets/{openai-codex-BOoUGfZo.js → openai-codex-DMzQdrNm.js} +1 -1
- package/dist/ui/assets/{openrouter-DQfvvYij.js → openrouter-CQPRB3mI.js} +1 -1
- package/dist/ui/assets/{openrouter-DoxfEMdx.js → openrouter-CRaR6ORa.js} +1 -1
- package/dist/ui/assets/{openrouter-free-GMWxIUhh.js → openrouter-free-BCZac4lk.js} +1 -1
- package/dist/ui/assets/{openrouter-free-DDqDQdRp.js → openrouter-free-CKjfWow9.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-CEDhl0OZ.js → openrouter-oauth-DQ6_4qbW.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-sMAXA75w.js → openrouter-oauth-DZ-Abl0n.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-r2ejq7DG.js → panel-rpc-handlers-l_wby7rY.js} +2 -2
- package/dist/ui/assets/{panelize-shell-BgsRRYSF.js → panelize-shell-BExnoycZ.js} +1 -1
- package/dist/ui/assets/{provider-DBzel_xl.js → provider-CHJuS3Eo.js} +2 -2
- package/dist/ui/assets/{provider-C9ruriwF.js → provider-Ccwke1Gk.js} +1 -1
- package/dist/ui/assets/provider-settings-C9aYrpFT.js +1 -0
- package/dist/ui/assets/provider-store-access-Bvoy_8oD.js +1 -0
- package/dist/ui/assets/provider-store-access-C2g47uIb.js +1 -0
- package/dist/ui/assets/{providers-BecFVHcB.js → providers-BYl2eNQm.js} +1 -1
- package/dist/ui/assets/{providers-Bk7_R6-e.js → providers-Dx2Bx5aE.js} +2 -2
- package/dist/ui/assets/{quick-llm-B8jKq4iQ.js → quick-llm-DT2lt16M.js} +1 -1
- package/dist/ui/assets/{recovery-screen-C8SMqbts.js → recovery-screen-BjiUo-AL.js} +1 -1
- package/dist/ui/assets/run-BY9if0Td.js +42 -0
- package/dist/ui/assets/{run-Cu2b1qXL.js → run-BtmtVfUW.js} +1 -1
- package/dist/ui/assets/{run-DLmWyiS5.js → run-BxzwgwS3.js} +2 -2
- package/dist/ui/assets/{run-CRtbfNhS.js → run-DLgsQ07W.js} +1 -1
- package/dist/ui/assets/run-tBUQGAj8.js +50 -0
- package/dist/ui/assets/{session-command-memory-Bh_U73Lu.js → session-command-memory-BTDKlIRk.js} +4 -3
- package/dist/ui/assets/session-jsonl-BigzXvfg.js +11 -0
- package/dist/ui/assets/{session-jsonl-BxhPJRfn.js → session-jsonl-eMNv3Qki.js} +1 -1
- package/dist/ui/assets/session-search-index-D2VtAM_Q.js +3 -0
- package/dist/ui/assets/{setup-feature-flags-remote-DTWNUOEW.js → setup-feature-flags-remote-Ca2-hqlo.js} +1 -1
- package/dist/ui/assets/sidecar-repair-wcIxeWMP.js +1 -0
- package/dist/ui/assets/{silent-renew-backoff-7OJRYyhc.js → silent-renew-backoff-BHjNTQU2.js} +1 -1
- package/dist/ui/assets/{skills-59WNpYyE.js → skills-CJ8qNnZs.js} +1 -1
- package/dist/ui/assets/slicc-version-PYnMeU2R.js +1 -0
- package/dist/ui/assets/{snapshot-BNRtY2CJ.js → snapshot-DGK3m0L_.js} +1 -1
- package/dist/ui/assets/{snapshot-features-DVnp1w2e.js → snapshot-features-DluhSLEH.js} +1 -1
- package/dist/ui/assets/{soundscape-9bfPI94m.js → soundscape-BK9WmnUG.js} +1 -1
- package/dist/ui/assets/{speak-BaQH0gYp.js → speak-DZISsPxk.js} +1 -1
- package/dist/ui/assets/sprinkle-manager-BCrGJ7_g.js +1 -0
- package/dist/ui/assets/{sprinkle-renderer-BaQcBKrt.js → sprinkle-renderer-D-1PliuW.js} +1 -1
- package/dist/ui/assets/{state-XwTXvaim.js → state-KlJITKEj.js} +1 -1
- package/dist/ui/assets/{store-DR4bp0Ym.js → store-Bfm_2de6.js} +1 -1
- package/dist/ui/assets/{store-CJgEv6ac.js → store-C4pwV1r3.js} +1 -1
- package/dist/ui/assets/{sudo-XxCuOTwL.js → sudo-ClTWT5F4.js} +1 -1
- package/dist/ui/assets/suggestions-CFQTt8oo.js +329 -0
- package/dist/ui/assets/{sync-dialog-DifyU9Wz.js → sync-dialog-Dlmp9or_.js} +1 -1
- package/dist/ui/assets/{transformers-env-0DWpJU1C.js → transformers-env-CKztDfUT.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-BEYI1163.js → tray-sidecar-izQ2ZF5D.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-BDZBbbdQ.js → upgrade-detection-CNPzRkE7.js} +1 -1
- package/dist/ui/assets/{voice-reply-DToO6RTd.js → voice-reply-JlXeQN7_.js} +1 -1
- package/dist/ui/assets/{wc-attach-4VTzCaDp.js → wc-attach-Cl4Hwieg.js} +2 -2
- package/dist/ui/assets/{wc-extension-D0bVp8vB.js → wc-extension-ChMc6MeX.js} +2 -2
- package/dist/ui/assets/wc-follower-CvdBVpCG.js +17 -0
- package/dist/ui/assets/wc-follower-oauth-C83SZJty.js +5 -0
- package/dist/ui/assets/wc-gelatiere-3y6MXjH6.js +1 -0
- package/dist/ui/assets/wc-live-xtrWHFoh.js +406 -0
- package/dist/ui/assets/{wc-nav-D-p0rPR_.js → wc-nav-CDS_UeWj.js} +2 -2
- package/dist/ui/assets/wc-onboarding-DqB8019g.js +2 -0
- package/dist/ui/assets/{wc-placeholder-Db-RyktI.js → wc-placeholder-CZw2rZaI.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-BIFBoH1h.js → wc-secret-request-CP500uCX.js} +1 -1
- package/dist/ui/assets/{wc-settings-C7ARFKxx.js → wc-settings-yS0Tn1rR.js} +3 -3
- package/dist/ui/assets/wc-shell-CuK7bTlD.js +125 -0
- package/dist/ui/assets/{wc-shortcut-config-DiZwCi5M.js → wc-shortcut-config-C-lIC8ic.js} +1 -1
- package/dist/ui/assets/{wc-shortcuts--04PLpy8.js → wc-shortcuts-DsrVa-7o.js} +192 -190
- package/dist/ui/assets/wc-sprinkles-CWvQ1c_3.js +2 -0
- package/dist/ui/assets/{wc-transcript-export-BCJ5AJA8.js → wc-transcript-export-BIlHmS1O.js} +2 -2
- package/dist/ui/assets/wc-tray-PhDRuhzo.js +5 -0
- package/dist/ui/assets/{welcome-CyCMJDqG.js → welcome-BzW33ZtP.js} +10 -9
- package/dist/ui/assets/welcome-detection-DocFcHWj.js +1 -0
- package/dist/ui/assets/{whisper-session-Dl9qamsc.js → whisper-session-B0UflXuX.js} +2 -2
- package/dist/ui/assets/wiki-BXN4hgmw.js +7 -0
- package/dist/ui/assets/wiki-DA0qKUVC.js +307 -0
- package/dist/ui/assets/{xai-grok-SveZvKuJ.js → xai-grok-C_IBpHs8.js} +1 -1
- package/dist/ui/assets/{xai-grok-exJQ7ID9.js → xai-grok-k1KZairZ.js} +1 -1
- package/dist/ui/index.html +4 -4
- package/dist/ui/packages/webapp/index.html +4 -4
- package/package.json +1 -1
- package/dist/ui/assets/CLAUDE-DM1onrcU.js +0 -1
- package/dist/ui/assets/SKILL-D40-t9w0.js +0 -57
- package/dist/ui/assets/descriptor-DObnXZNI.js +0 -1
- package/dist/ui/assets/feature-flags-COdcJUhl.js +0 -1
- package/dist/ui/assets/feature-flags-a-IfHs0F.js +0 -1
- package/dist/ui/assets/frozen-archive-writer-cEYcj5un.js +0 -8
- package/dist/ui/assets/key-MwVo0KUb.js +0 -1
- package/dist/ui/assets/memory-v2-flag-C1duOEOb.js +0 -1
- package/dist/ui/assets/new-session-0QEsz4J9.js +0 -2
- package/dist/ui/assets/provider-settings-BYSP7NWc.js +0 -1
- package/dist/ui/assets/provider-store-access-Csl5Rhtr.js +0 -1
- package/dist/ui/assets/provider-store-access-bV6_bNHG.js +0 -1
- package/dist/ui/assets/session-jsonl-DvUI4M0M.js +0 -11
- package/dist/ui/assets/session-search-index-CYtd-I68.js +0 -3
- package/dist/ui/assets/sidecar-repair-WrV53KRw.js +0 -1
- package/dist/ui/assets/slicc-version-DEC4XjJk.js +0 -1
- package/dist/ui/assets/sprinkle-manager-CxTROBQi.js +0 -1
- package/dist/ui/assets/wc-follower-DUW9NJ1s.js +0 -17
- package/dist/ui/assets/wc-follower-oauth-C-tQshgH.js +0 -5
- package/dist/ui/assets/wc-live-DD50Wcz1.js +0 -399
- package/dist/ui/assets/wc-onboarding-DONgW5bd.js +0 -2
- package/dist/ui/assets/wc-shell-Q2g5GEE1.js +0 -125
- package/dist/ui/assets/wc-sprinkles-x7qO5aBO.js +0 -2
- package/dist/ui/assets/wc-tray-N6BbXJYM.js +0 -5
- package/dist/ui/assets/welcome-detection-CJv2bH67.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="# CLAUDE.md\n\nThis file covers the default virtual filesystem payload in `packages/vfs-root/`.\n\n## What This Package Contains\n\n`packages/vfs-root/` is copied into the app's virtual filesystem on init/reset. It is content, not runtime code.\n\n## Directory Structure\n\n| Path | Purpose |\n| --------------------------------------- | ------------------------------------------------------------------------------------------ |\n| `packages/vfs-root/shared/` | Shared content that becomes `/shared/` in the VFS |\n| `packages/vfs-root/workspace/` | Default workspace content that becomes `/workspace/` in the VFS |\n| `packages/vfs-root/shared/CLAUDE.md` | Agent-facing runtime instructions bundled into `/shared/CLAUDE.md` |\n| `packages/vfs-root/shared/MEMORY.md` | User-editable memory curator config bundled as `/shared/MEMORY.md` |\n| `packages/vfs-root/shared/DREAMING.md` | User-editable memory dreamer config bundled as `/shared/DREAMING.md` |\n| `packages/vfs-root/shared/GELATIERE.md` | User-editable gelatiere pass instructions + config bundled as `/shared/GELATIERE.md` |\n| `packages/vfs-root/shared/wiki/` | Shared knowledge-base scaffold (`WIKI.md` schema, empty `index.md`/`log.md`) |\n| `packages/vfs-root/shared/sprinkles/` | Built-in sprinkle UIs |\n| `packages/vfs-root/shared/sounds/` | Shared notification sounds |\n| `packages/vfs-root/workspace/skills/` | Default installable workspace skills |\n| `packages/vfs-root/etc/` | System config seeded into `/etc/` (`models`, `sudoers`, `APPROVALS.md`, `slicc/keys.json`) |\n\n## Adding Default Content\n\n### Gelatiere\n\n- `shared/GELATIERE.md` is the gelatiere's twin of `MEMORY.md`: the store's build-time fallback\n and the seeded `/shared/GELATIERE.md`, seeded only when absent, user-edited only. Same\n frontmatter dialect (`base/instruction-frontmatter.ts`); keys are `intervalHours`, `nightly`\n (5-field cron) and `maxSuggestions` (capped at 10). No placeholders: the unit `cat`s the file at\n the start of every pass, so keep it self-contained (literal paths, `date` for today).\n- The gelatiere is a persistent SCOOP under a synthetic owner (folder `gelatiere`,\n `scoops/gelatiere-unit.ts`), not a spawned agent: its charter is the record's `systemPromptAppend`, the pass recipe is this file.\n Its deliverable is `gelatiere suggest <candidates.json> && gelatiere deliver`; the command owns\n the store and the addressing. Keep the recipe's commands on `GELATIERE_ALLOWED_COMMANDS` (a child\n escalates anything else) and its cross-pass memory in `/shared/.gelatiere/notes.md`. Design:\n `docs/gelatiere.md`.\n- `shared/sprinkles/suggestions/suggestions.shtml` is the gelatiere's suggestion stream (flat\n entries read through the dip bridge's `slicc.readFile`), split from the onboarding-only\n `shared/sprinkles/welcome/welcome.shtml` so follower/extension handling of the welcome dip can\n never mask or restart the stream. The cone re-posts it as a dip on every delivery (per\n `workspace/skills/gelatiere/SKILL.md`) and it is rail-pickable under Memory v2. The card buttons\n lick `gelatiere-install` / `gelatiere-try` (settled page-side, then the cone acts per the skill)\n and `gelatiere-dismiss` (settled page-side).\n\n### Memory curator\n\n- `shared/MEMORY.md` is the single source for the runner's build-time fallback and the seeded\n `/shared/MEMORY.md` file.\n- The file is seeded only when absent, so user and skill customizations survive later boots.\n- `MEMORY.md` is user-edited only; the curator intentionally cannot rewrite its own instructions.\n- Frontmatter uses a strict YAML subset: block-array items may have `#` comment tails; inline\n entries containing commas must be quoted. A bare `/` is rejected from `writablePaths`.\n- Frontmatter `allowedCommands` entries extend the curator's built-in base set; they do not\n replace or remove base commands.\n- The curator may rewrite the entire memory file, and the hard character budget\n applies to the entire file with no protected region.\n- **The curator edits a staged draft, never the live file.** `{{MEMORY_PATH}}` resolves to\n `/sessions/.curation/<archive>/draft.md`, seeded (with a `base.md` snapshot) from the live\n memory when the pass spawns; the agent bridge three-way-merges base→draft onto the live file\n on exit 0, before the success receipt (`mergeOnSuccess`). Concurrent live edits survive;\n conflicting regions resolve to the curator. A killed or failed run leaves the live memory\n untouched. The bridge also writes `/sessions/.curation/<archive>/status.json` on both exit\n paths (`outcomeReceiptPath`) — the durable ledger of which sessions completed vs failed\n curation; the index entry mirrors it as `memoryCuratedAt` / `memoryFailed`. Per-archive\n keying means parallel per-cone curators (#1666) never share staging state.\n- Every `##`/`###` memory section ends with a `YYYY-MM-DD` last-verified date, in UTC to match\n archive timestamps. Each pass re-verifies the oldest sections first; undated sections are\n maximally stale.\n- Entries follow the provenance/supersession grammar (MEMORY.md \"Entry grammar\"): `human:` /\n `process:` actor prefixes, version pins instead of confidence scores, `stale_after: YYYY-MM-DD`\n as an absolute instant, corrections that REPLACE claims, and a `## Not true` block\n (`- not: … — why … — instead …`) for refuted claims worth keeping as traps. The dreamer\n (`DREAMING.md`) enforces the grammar on old entries and reports contradiction-pair counts\n before/after so a pass that cannot reduce them is visible.\n- The curator's write grant is `/workspace/CLAUDE.md` alone, not `/workspace/`. It can run `upskill`\n to look up a skill for a pitfall it found, and a directory-wide grant would also let it install\n into `/workspace/skills/`. Reads still cover `/workspace/`. Single-file entries in\n `writablePaths` work because `generateScoopSudoers` emits both the bare path and the `/**` form.\n- The pass is detached, so it spawns with `notifyOnComplete`. Its closing message reaches the cone\n on the `scoop-notify` channel; that is where a skill suggestion lands. Without it the report is\n discarded and the cone never learns the pass ran.\n- Turn count is what a pass costs, because every turn re-reads the whole context as a cache read.\n Two things keep it down, and both belong to the prompt rather than the runtime: `thinkingLevel`\n (default `medium`; spawned agents otherwise resolve to `off`) so the curator plans the cut\n instead of converging by trial and error, and the archive reading recipes so it never `cat`s a\n multi-megabyte archive whose `slicc:session-data` block is a single line holding half the file.\n\n### Approver agent\n\n- `etc/APPROVALS.md` is the single source for the runner's build-time fallback and\n the seeded `/etc/APPROVALS.md`, exactly like `shared/MEMORY.md` is for the curator.\n `SudoManager.ensureDefaults()` does the seeding, when absent, on the ungated\n handle — the same place `/etc/sudoers` is seeded, and for the same reason: the\n file is self-protected, so anything else that had to create it (the `upgrade\napply` merge) would prompt the owner to approve the default already in force (#2686).\n- It lives in `/etc/` because it is POLICY, next to `sudoers` — not in `/shared/`,\n which is agent-visible content. Writes to it are self-protected in\n `base/sudoers.ts` (`isSelfProtectedWrite`) for the same reason writes to\n `/etc/sudoers` are: it decides what a GUEST may do, and a cone acting on a\n guest's message must not rewrite the rules gating that guest without the owner\n seeing a prompt.\n- Re-read on EVERY decision, not cached: an owner who tightens it after a bad\n call expects the next decision to use it. Missing or unreadable falls back to\n the bundled default rather than wedging approvals shut.\n- The optional ```yaml block tunes `timeoutSeconds` (clamped — a guest, and for\n a tool gate the cone's turn, is blocked on the decision), `model`, and\n `thinkingLevel`. Unreadable values fall back rather than becoming real.\n- The approver never reads this file itself; the runtime reads it and puts it in\n the prompt. The agent holds no write grant at all.\n\n### Skills\n\n- Add new built-in workspace skills under `packages/vfs-root/workspace/skills/<skill-name>/`.\n- Include `SKILL.md` and any companion assets or `.jsh` scripts the skill needs.\n\n### Wiki\n\n- `shared/wiki/` seeds the shared knowledge base at `/shared/wiki/`: `WIKI.md` is the schema\n contract (upgrade-merged like `MEMORY.md`), `index.md` and `log.md` are user data seeded once.\n- The read-only CLI is `workspace/skills/wiki/wiki.jsh`, adapted from `ai-ecoverse/skills` →\n `skills/llm-wiki/wiki.jsh` with the wiki root pinned to `/shared/wiki`; keep the body in sync\n with upstream when refreshing, and keep the Tier-0 behavior (fs bound via `require`, zero scans\n fail loudly) — `tests/shell/wiki-jsh.test.ts` pins both.\n- The nightly dreamer (`shared/DREAMING.md`) holds the write path: over-budget reference knowledge\n moves from memory files into wiki pages, leaving a pointer line behind.\n\n### Keyboard shortcuts\n\n- `etc/slicc/keys.json` is the user's OVERRIDE file for keyboard mode, seeded on first boot by\n `ui/wc/wc-shortcut-config.ts`. It ships with `\"trigger\": \"auto\"` and `\"bindings\": {}` — the\n keymap itself is `DEFAULT_KEYMAP` in `ui/wc/wc-shortcuts.ts`, and a test asserts the file binds\n nothing. `trigger` is `auto` | `esc` | `null` (Theme settings switches it live).\n- **Never list a binding here again.** v1 wrote its whole keymap into the seed, and because the\n file is applied OVER the defaults that pinned every install to v1 forever: no later map, and no\n key for any command added since, could reach anyone who had booted once. An empty bindings object\n is what makes the shipped map — and every future change to it — inheritable.\n- The one write beyond seeding is that migration: a file still holding the v1 map exactly\n (`isUntouchedV1Document`) is replaced once. Anything else, including v1 with one line changed,\n is the user's and is left alone — an edited config must survive every later boot. Theme settings\n may also rewrite `trigger` in place.\n- The `//` comment must name every `CommandId` (a test asserts it) and carries the v1 keymap as a\n paste-back block for anyone who wants the old keys. `s` maps to `sprinkles` there, not to a\n cycle command: `p`/`s` opens the first and the step keys walk the rest.\n\n### Sprinkles\n\n- Add built-in sprinkles under `packages/vfs-root/shared/sprinkles/<name>/`.\n- Keep the main file named `<name>.shtml` to match discovery and sprinkle naming conventions.\n\n### Sounds\n\n- Add shared sounds under `packages/vfs-root/shared/sounds/`.\n- Prefer stable filenames because shell commands and docs may reference them directly.\n\n## External Handoffs\n\n- Mechanism: RFC 8288 `Link` response header carrying `https://www.sliccy.ai/rel/handoff` or `https://www.sliccy.ai/rel/upskill` on a main-frame document response → `navigate` lick → cone approval card.\n- Agent-facing flow: `packages/vfs-root/workspace/skills/handoff/SKILL.md` (bundled to `/workspace/skills/handoff/SKILL.md`); the agent reaches it through the injected skill index, not through `shared/CLAUDE.md`, which only states that handoffs are human-gated.\n- Protocol reference: `docs/slicc-handoff.md`.\n- When handoff behavior changes, keep the skill and `docs/slicc-handoff.md` aligned — do not duplicate their content here or in `shared/CLAUDE.md`.\n\n## Important Distinction\n\n`packages/vfs-root/shared/CLAUDE.md` is **agent-facing runtime content** bundled into the virtual filesystem.\n\nIt is different from the developer-facing `CLAUDE.md` files in the repository. Do not merge those roles together.\n";export{e as default};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";var t=e({default:()=>n}),n=`---
|
|
2
|
+
writablePaths:
|
|
3
|
+
- /workspace/CLAUDE.md
|
|
4
|
+
- /shared/wiki/
|
|
5
|
+
visiblePaths:
|
|
6
|
+
- /sessions/
|
|
7
|
+
- /shared/
|
|
8
|
+
- /workspace/
|
|
9
|
+
timeoutSeconds: 900
|
|
10
|
+
thinkingLevel: medium
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Memory dreaming
|
|
14
|
+
|
|
15
|
+
You are the memory dreamer: the nightly refactoring pass over one cone's durable memory. Today's date is {{TODAY}}; {{SESSION_COUNT}} sessions are archived. Unlike the per-session memory curator, you have NO new session to mine — your whole job is to make the existing memory file better: consolidated, current, and inside its budget.
|
|
16
|
+
|
|
17
|
+
**Work fast: a pass should finish in a few minutes.** The run is hard-stopped, and your rewrite only lands if the pass completes — a killed run is discarded wholesale.
|
|
18
|
+
|
|
19
|
+
Read the entire current memory at {{MEMORY_PATH}}. If the file is missing or empty, there is nothing to dream about — reply with one line saying so and stop; never invent memories.
|
|
20
|
+
|
|
21
|
+
## What a dreaming pass does
|
|
22
|
+
|
|
23
|
+
1. **Merge duplicates.** The per-session curator appends under time pressure; across weeks the same preference or project fact accumulates near-identical phrasings. Keep one — the most recent, most specific version.
|
|
24
|
+
2. **Supersede contradictions.** When two lines contradict, the newer-dated one wins; rewrite in place so only one version stands — a claim and its correction must never survive together as prose. When the refuted claim is a trap worth remembering, record it under a \`## Not true\` section as \`- not: <refuted claim> — why: <evidence> — instead: <correction> (YYYY-MM-DD)\`. A fact contradicted by the session titles in the index (a project renamed, a tool replaced) goes too. Count contradictory claim pairs before and after the rewrite and put both numbers in the closing report; if the pass could not reduce the count, say so.
|
|
25
|
+
3. **Retire stale ephemera.** An entry whose \`stale_after: YYYY-MM-DD\` date has passed is unverified — re-verify it against the index or drop it. Sections whose last-verified date is old AND whose subject no longer appears in recent session titles are candidates for deletion — check before deleting:
|
|
26
|
+
|
|
27
|
+
\`\`\`bash
|
|
28
|
+
# Recent activity, to test whether an old section still matters.
|
|
29
|
+
jq -r '.[] | "\\(.frozenAt[0:10]) \\(.cone // "cone") \\(.title)"' /sessions/index.json | tail -40
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
4. **Reorganize.** Fold orphan bullets into the per-topic section they belong to; split a section that has become two topics; order sections so the most-used topics lead. Every \`##\` and \`###\` heading keeps (or gains) its last-verified date in \`YYYY-MM-DD\` form.
|
|
33
|
+
5. **Move knowledge to the wiki.** When the file is over budget and a section is reference knowledge — facts about a domain, a system, a person — rather than working preferences or pitfalls, move it to a page under \`/shared/wiki/\` following \`/shared/wiki/WIKI.md\` (update \`index.md\`, append an \`ingest\` entry to \`log.md\`), and replace the section with one line naming the page. Move at most a couple of sections per pass; the memory file must keep working standalone.
|
|
34
|
+
6. **Land under budget.** The hard budget is {{BUDGET_CHARS}} characters for the whole file, no exempt region.
|
|
35
|
+
|
|
36
|
+
What a dreaming pass never does: add facts that are not already in the file or the wiki, install anything, or touch any file other than {{MEMORY_PATH}} and the wiki.
|
|
37
|
+
|
|
38
|
+
## Working within the budget
|
|
39
|
+
|
|
40
|
+
Measure, decide, then write once — never converge by trial and error:
|
|
41
|
+
|
|
42
|
+
1. \`wc -c {{MEMORY_PATH}}\` and subtract {{BUDGET_CHARS}} for the surplus.
|
|
43
|
+
2. \`awk '/^## /{h=$0} {c[h]+=length($0)+1} END{for(k in c) printf "%7d %s\\n", c[k], k}' {{MEMORY_PATH}} | sort -rn\` shows which sections pay for it.
|
|
44
|
+
3. Draft in \`{{SCRATCH_DIR}}/draft.md\` (private to this pass, deleted when it ends), then write the complete file to {{MEMORY_PATH}} once, already inside the budget.
|
|
45
|
+
4. \`wc -c {{MEMORY_PATH}}\` to confirm.
|
|
46
|
+
|
|
47
|
+
Rules:
|
|
48
|
+
|
|
49
|
+
- Preserve concrete identifiers — file paths, URLs, IDs, names — verbatim.
|
|
50
|
+
- Enforce the entry grammar from \`/shared/MEMORY.md\` where the information is recoverable: actor prefixes (\`human:\` / \`process:\`), version pins, \`stale_after: YYYY-MM-DD\` as an absolute instant, and no confidence scores.
|
|
51
|
+
- Re-stamp a heading with {{TODAY}} only when you actually re-verified its content against the index this pass; otherwise keep its existing date.
|
|
52
|
+
- Keep dates UTC.
|
|
53
|
+
- Write the result to {{MEMORY_PATH}}; do not merely return it in your response.
|
|
54
|
+
- Close with a two-or-three-line report of what you merged, dropped, and kept — that report is delivered to the cone.
|
|
55
|
+
|
|
56
|
+
<!-- How to customize
|
|
57
|
+
Add dreaming instructions here — for example: never drop sections mentioning a named project, or
|
|
58
|
+
also consolidate a knowledge base at /path. The frontmatter works exactly like /shared/MEMORY.md's
|
|
59
|
+
(same keys, same YAML subset, allowedCommands additive over the same built-in base set).
|
|
60
|
+
|
|
61
|
+
{{MEMORY_PATH}} resolves to a staged draft under /sessions/.curation/dream-<date>-<cone>.md/, not
|
|
62
|
+
the live memory file: the pass snapshots the live file when it spawns, the dreamer rewrites the
|
|
63
|
+
draft, and on a successful exit the runtime three-way-merges the rewrite back onto the live file.
|
|
64
|
+
Edits made to the live memory while the dreamer runs survive. A failed or killed run leaves the
|
|
65
|
+
live memory untouched, with the outcome recorded in that folder's status.json. Writes under
|
|
66
|
+
/shared/wiki/ are NOT staged — a wiki page lands immediately — which is safe because wiki moves
|
|
67
|
+
are additive; the pointer line replacing the moved section only lands if the pass completes.
|
|
68
|
+
|
|
69
|
+
The pass runs per cone under the fixed name memory-dreamer (memory-dreamer-<folder> for extra
|
|
70
|
+
cones), so parallel dreams over DIFFERENT memory files never collide and two dreams over the SAME
|
|
71
|
+
file serialize. The gelatiere's nightly starts one per cone with \`memory dream --all\`; \`memory
|
|
72
|
+
dream\` runs one by hand.
|
|
73
|
+
-->
|
|
74
|
+
`;export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e='---\nintervalHours: 24\nnightly: \'0 3 * * *\'\nmaxSuggestions: 5\n---\n\n# Gelatiere pass\n\nYou are the gelatiere, SLICC\'s resident advisor. A lick just asked you for a pass: a nightly `[Cron Event: gelatiere-nightly]`, a `[Sprinkle Event: gelatiere]` because a session ended or someone ran `gelatiere run`, or a direct request. Your job is to look at how this person actually uses SLICC and come back with a handful of concrete, well-grounded suggestions — skills to install, use cases they have not tried, habits that would make their sessions go better — then hand them to the cones.\n\n**Work fast: a pass should take a few minutes, not many.** Mine the signals below, cross them with what is available, write the candidates file, and finish with the two commands at the end. Never install anything, never edit memory files yourself (the nightly\'s `memory dream` delegates that to sandboxed dreamer scoops), never message a cone by any other means than `gelatiere deliver`.\n\n## Nightly only: start the dreaming pass\n\nWhen this pass is the nightly (`[Cron Event: gelatiere-nightly]`), start the memory-dreaming pass first, before anything else, and do not wait for it:\n\n```bash\nmemory dream --all\n```\n\nThat spawns one sandboxed memory-dreamer per cone to consolidate its memory file — merge duplicates, drop superseded facts, land under budget. It runs detached; carry on with your own pass immediately and never read or edit the memory files it is working on beyond the signal-mining below. Skip this step entirely on session-end and on-demand passes.\n\n## What the user has done\n\nRead these in order; each one is cheap. Start with `date -u +%Y-%m-%d` so your evidence carries today\'s date.\n\n1. **Profile** — who they said they are on first run: `cat /home/*/.welcome.json 2>/dev/null` (`purpose`, `role`, `tasks`, `apps`, `company`).\n2. **Durable memory** — what earlier sessions already established (preferences, projects, pitfalls): `cat /workspace/CLAUDE.md`, and `cat /cones/*/CLAUDE.md 2>/dev/null` for the other cones.\n3. **Session index** — titles, dates, cones: `jq -r \'.[] | "\\(.frozenAt[0:10]) \\(.cone // "cone") \\(.title)"\' /sessions/index.json | tail -30`.\n4. **Recent archives** — the newest few sessions: `ls -t /sessions/*.md | grep -v agent- | head -5`.\n5. **Your own notes** — what you concluded last time: `cat /shared/.gelatiere/notes.md 2>/dev/null`.\n\n**Never `cat` an archive.** They reach several megabytes and the `<!-- slicc:session-data ... -->` block is one JSON line holding the whole session. Pull the three signals separately, each on the prose half only:\n\n```bash\n# What the user asked for, in their words.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | awk \'/^## User/{p=1;next} /^## (Assistant|Summary)/{p=0} /^### Tool/{p=0} p\' | head -80\n\n# Which commands and tools the sessions lean on.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -o \'^### Tool: [a-z_]*\' | sort | uniq -c | sort -rn\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -oE \'^\\$? ?[a-z][a-z0-9-]+ \' | sort | uniq -c | sort -rn | head -20\n\n# What broke — the strongest signal for a missing skill.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -B4 \'^Result:.*\\(rror\\|not found\\|failed\\|denied\\|ENOENT\\)\' | cut -c1-160 | head -60\n```\n\n6. **What is already installed** — never suggest a duplicate: `upskill list`.\n7. **What you already suggested** — `/shared/.gelatiere/suggestions.json` holds every earlier suggestion with its `dismissedAt`. Do not repeat an id that is still open, and do not resurrect a dismissed one unless the sessions show a new, strong reason: `jq -r \'.[] | "\\(.id)\\t\\(.kind)\\t\\(.dismissedAt // "open")\\t\\(.title)"\' /shared/.gelatiere/suggestions.json 2>/dev/null`.\n\n## What is available\n\nCross the signals above with what SLICC can offer. Spend one command on each; do not browse further.\n\n```bash\n# The skill catalog: name, description, the tasks / roles / apps each skill fits, and WHERE it\n# lives (repo, path, skill, installAll) — the install command is built from those last four.\ngelatiere catalog | jq -r \'.data[] | "\\(.name)\\t\\(.description)\\ttasks=\\(.tasks) role=\\(.role) apps=\\(.apps)\\trepo=\\(.repo) path=\\(.path) skill=\\(.skill) installAll=\\(.installAll)"\'\n\n# Every shell command SLICC ships, one man page each — the use-case surface.\ngelatiere commands\n\n# The community skills repo, when the catalog looks thin for this user.\nupskill ai-ecoverse/skills\n```\n\nRead a man page only when you are about to recommend that command and need to be sure it does what you think: `gelatiere man <command> | head -60`. You have no `curl` and need none — `gelatiere catalog`, `gelatiere commands` and `gelatiere man` are your whole web surface.\n\n## What to suggest\n\nAt most the `maxSuggestions` from the config block above, best first. Fewer, sharper suggestions beat a full list; an empty list is a fine outcome when nothing is genuinely worth the user\'s attention. Every suggestion must be traceable to something you saw:\n\n| kind | when | required fields |\n| ---------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| `skill` | a catalog or repo skill matches a recurring task, app, or failure in the sessions | `skill`, and `install` — the exact `upskill` command (see below) |\n| `use-case` | a SLICC capability (shell command, scoops, sprinkles, mounts, automation) fits work the user does by hand or not at all | `prompt` — a message the user could send verbatim |\n| `tip` | a habit that would have avoided a failure or a repeated detour in the sessions | `body` explains what to do differently |\n\nThe `install` command is built from the catalog row, never from the bare name — `upskill <name>` alone searches the public registries and does not find catalog skills:\n\n| catalog row | `install` |\n| ------------------------------------------------- | -------------------------------------------- |\n| `repo=o/r skill=x` (path empty) | `upskill o/r --skill x` |\n| `repo=o/r path=skills/ skill=x` | `upskill o/r --path skills/ --skill x` |\n| `repo=o/r path=skills/migration/ installAll=true` | `upskill o/r --path skills/migration/ --all` |\n| a skill from `upskill ai-ecoverse/skills` output | `upskill ai-ecoverse/skills --skill <name>` |\n\nRules:\n\n- `id` is a stable slug (`skill-github`, `use-case-fswatch-deploy`, `tip-mount-once`) so a repeat pass recognises it.\n- Speak to the user as "you" in every field — never about them in the third person ("Lars builds…" is wrong; "You build…" is right).\n- The card shows exactly two things — WHAT to do and WHY — so write the fields that way:\n - `title` is the WHAT: a short imperative, eight words or fewer, sentence case — "Install the GitHub skill", "Script your build–serve–screenshot loop". No benefit clause bolted on ("…to manage repos and pull requests from chat" belongs in the why, if anywhere).\n - `body` is the WHY: one or two sentences, grounded in what you actually saw, that tell the story of the change — what you watched the user do by hand, and what gets better. "You ran the build–serve–screenshot loop 80+ times by hand in your bakery session; a workflow file replays it as one command." It must not restate the title, list features, or repeat `evidence` word for word.\n- `evidence` is one friendly sentence, spoken to the user, saying what you saw that led here — "You told the welcome wizard you\'re a developer who lives in GitHub". It rides the lick for the cones; the card does not render it, so do not lean on it to justify the suggestion — the why lives in `body`. Never a field dump like `role=developer, tasks=[…]`.\n- `url` is optional: the skill page or the man page.\n- Never suggest what `upskill list` already shows installed, and never invent a skill or command that is not in the catalog, the repo listing, or the sitemap.\n\n## Finish\n\nWrite the candidates as JSON — `{ "suggestions": [ { "id", "kind", "title", "body", "skill", "install", "prompt", "url", "evidence" } ] }` — to `$TMPDIR/candidates.json`, then run exactly:\n\n```bash\ngelatiere suggest "$TMPDIR/candidates.json" && gelatiere deliver\n```\n\n`suggest` validates and folds the candidates into the store (known ids are kept, dismissed ones stay dismissed); `deliver` licks every other cone with what is new. Then update `/shared/.gelatiere/notes.md` with two or three lines on what you looked at and what you decided against — that file, not your reply, is your memory across passes. Reply with one short line.\n\n<!-- How to customize\nAdd instructions above, for example: prefer skills from a company repo, or always check a team\nwiki at /mnt/kb before suggesting. The config block sets `intervalHours` (minimum hours between\nsession-end passes; the nightly pass ignores it), `nightly` (a 5-field cron expression, registered\nby `gelatiere init` as the `gelatiere-nightly` crontask) and `maxSuggestions` (capped at 10).\n\nThe gelatiere is a persistent scoop no cone owns (folder `gelatiere`); its own conversation is\ncompacted while it idles. Dismissed suggestions are kept with a dismissedAt stamp so the next pass does not\nrepeat them. `gelatiere run` from any cone\'s shell asks for a pass now.\n-->\n';export{e as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=`---
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";var t=e({default:()=>n}),n=`---
|
|
2
2
|
writablePaths:
|
|
3
3
|
- /workspace/CLAUDE.md
|
|
4
4
|
visiblePaths:
|
|
@@ -53,6 +53,15 @@ Three things carry across sessions, and each has its own place in the archive:
|
|
|
53
53
|
|
|
54
54
|
Pitfalls are the highest-value and most-often-lost category: a failure that cost half an hour is worth one line next time. Keep the error text that identifies it, not the stack trace.
|
|
55
55
|
|
|
56
|
+
## Entry grammar: provenance and supersession
|
|
57
|
+
|
|
58
|
+
Facts age. Write every entry so a later pass can tell whether it still holds:
|
|
59
|
+
|
|
60
|
+
- Prefix entries with their actor: \`human:\` for what the user said, \`process:\` for what you inferred from tool output. Example: \`- human: prefers rebase over merge (2026-09-11)\`.
|
|
61
|
+
- Version-pin claims that can rot: name the version, commit, or file the claim was verified against, e.g. \`- process: coverage floor is 83% (coverage-thresholds.json @ 6.146.2)\`. Never record a confidence score — what ages is the pin, not a probability.
|
|
62
|
+
- A claim with a known expiry carries \`stale_after: YYYY-MM-DD\`, an absolute date, never a duration. Past that date the claim counts as unverified.
|
|
63
|
+
- **Supersede, never append.** When this session proves a stored claim wrong, rewrite the claim in place — a claim and its correction must never both stand as prose. When the refuted claim is itself a trap worth remembering, record it under a \`## Not true\` section instead: \`- not: <refuted claim> — why: <evidence> — instead: <correction> (YYYY-MM-DD)\`.
|
|
64
|
+
|
|
56
65
|
## Reading the session archive
|
|
57
66
|
|
|
58
67
|
**Never \`cat\` the archive and never \`head\` it.** Archives reach several megabytes, and the machine-readable \`<!-- slicc:session-data ... -->\` block is a _single line_ holding the whole session as JSON — roughly half the file. Reading it costs a fortune and tells you nothing the prose below it does not. Whole \`### Tool\` result bodies are the other half and are equally not worth reading.
|
|
@@ -120,7 +129,7 @@ Rules:
|
|
|
120
129
|
- Write the result to {{MEMORY_PATH}}; do not merely return it in your response.
|
|
121
130
|
|
|
122
131
|
<!-- How to customize
|
|
123
|
-
Add curator instructions here, for example: also
|
|
132
|
+
Add curator instructions here, for example: also file durable topical knowledge into the shared wiki at /shared/wiki following /shared/wiki/WIKI.md (add /shared/wiki/ to writablePaths first). By default moving knowledge into the wiki is the nightly dreamer's job (/shared/DREAMING.md), not the per-session curator's. Extend visiblePaths or writablePaths above to grant access to extra stores, and adjust timeoutSeconds when needed.
|
|
124
133
|
|
|
125
134
|
{{MEMORY_PATH}} resolves to a staged per-archive draft under /sessions/.curation/, not the live memory file: the pass snapshots the live file when it spawns, the curator rewrites the draft, and on a successful exit the runtime three-way-merges the rewrite back onto the live file. Edits the cone or the user makes to the live memory while the curator runs survive; where both sides changed the same lines the curator's version wins. An entry in writablePaths naming the memory file is substituted with the draft automatically, so this file keeps working unchanged. A failed or killed run leaves the live memory untouched and its outcome recorded at /sessions/.curation/<archive>/status.json.
|
|
126
135
|
|
|
@@ -134,4 +143,4 @@ MEMORY.md is user-edited only: the curator intentionally has read-only access to
|
|
|
134
143
|
|
|
135
144
|
Frontmatter supports a strict YAML subset. Arrays may use the block form above (with optional # comment tails) or inline form such as [cat, grep]. \`allowedCommands\` is additive: listed commands extend the built-in base set without replacing it. Inline entries containing commas must be quoted, for example ["/knowledge/lars,rebecca/"].
|
|
136
145
|
-->
|
|
137
|
-
`;export{
|
|
146
|
+
`;export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="---\nname: memory\ndescription: |\n Use this when the user asks what SLICC remembers, why a remembered fact is\n missing or stale, whether memory curation ran, to re-run curation for an\n archived session, or to consolidate a bloated memory file. Covers the\n `memory` shell command (`show`, `status`, `log`, `curate`, `dream`), the\n per-cone memory files, and the curation ledger in /sessions/index.json.\n Requires the memory-v2 feature flag for everything except `memory status`.\nallowed-tools: bash\n---\n\n# memory — inspect and manage durable cone memory\n\nDurable memory is one markdown file per cone — `/workspace/CLAUDE.md` for the primary cone, `/cones/<folder>/CLAUDE.md` for extra cones. After a chat freezes, a memory-curator scoop rewrites that file from the archived session; `/sessions/index.json` is the per-archive ledger of whether that pass succeeded (`memoryCuratedAt`), failed (`memoryFailed`), is still owed (`memoryPending`), or was skipped by the user (`memorySkipped`).\n\n## Usage\n\n```bash\nmemory show [--cone <folder>] # the cone's memory file, verbatim\nmemory status [--json] [--check] # files, budget, curation tally, health\nmemory log [--limit N] # per-archive ledger, newest first\nmemory curate [--archive <file>] [--cone <folder>] # run a curator pass now\nmemory dream [--cone <folder>] [--all] [--wait] # consolidate memory (dreamer pass)\n```\n\n## When to reach for it\n\n- \"What do you remember about me / this project?\" → `memory show`.\n- A fact you expected to be remembered is missing → `memory log` to see whether the session that established it was ever curated; `memory status --check` for systemic failures.\n- After a failed curation (`memoryFailed` in the log) → fix the cause if visible (usually a missing provider or a timeout), then `memory curate --archive <that-file>`.\n- The memory file has grown duplicated, contradictory, or over budget → `memory dream` (add `--wait` to see the dreamer's report; `--all` for every cone with a memory file). The gelatiere's nightly already runs `memory dream --all`, so reach for this manually only when it cannot wait.\n- Extra cones keep separate memory: pass `--cone <folder>` to `show`, `curate`, and `dream`. The folder must exist (`cone`, or a `/cones/<folder>`); `curate` without it targets the cone the archive was frozen from.\n\n## Reading `memory status`\n\n- **Budget** grows logarithmically with the archived-session count; the curator is told to stay under it.\n- **Curation tally** counts index entries by ledger state: curated / failed / pending / skipped / unmarked (pre-ledger or freshly frozen).\n- **`--check`** exits non-zero on the two lying-memory shapes: any archive whose last curation attempt failed, or archives reporting success while the primary memory file is missing or empty. A clean run exits 0.\n- **`Scheduled:`** shows the runtime's own health check — the kernel runs the same checks ~90s after boot and daily without being asked, persisting the numbers to `/sessions/.curation/health.json`. If that line says `never ran` long after boot, or names failures, the memory system needs attention even if nobody asked about it.\n\n## Notes\n\n- `memory curate` runs the exact pass the session freezer runs (snapshot → curator scoop → three-way merge), so concurrent edits to the memory file merge instead of being clobbered. It can take several minutes; the curator's closing report is printed when it lands.\n- `memory dream` reads no session archive — the dreamer consolidates the memory file itself under `/shared/DREAMING.md`'s instructions, through the same staged draft and merge. Detached by default; the outcome lands in `/sessions/.curation/dream-<date>-<cone>.md/status.json`.\n- When consolidation cannot fit everything, the dreamer moves reference knowledge into the shared wiki at `/shared/wiki/` (schema: `/shared/wiki/WIKI.md`; browse it with the `wiki` skill) and leaves a pointer line in the memory file.\n- The command does not edit the ledger itself; a manual pass on a still-pending archive is reconciled by the boot catch-up through the bridge's receipt.\n- Everything except `status` requires the **Memory v2** flag (Settings → Experimental).\n";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e='---\nname: welcome\ndescription: |\n Use this when you receive a `[Sprinkle Event: welcome]` lick with\n `action: \'onboarding-complete-with-provider\'` — fired exactly once after the\n user finishes the first-run wizard and validates an LLM provider. Send a\n short personalized reply (greet by name, react to provider/model, three\n follow-up actions: obvious + obligatory + outrageous), then silently run\n `upskill recommendations --install`. Other welcome-flow actions\n (`first-run`, `onboarding-complete`, `connect-ready`, `connect-attempt`,\n `oauth-attempt`, `shortcut-migrate`, `request-mount`) are intercepted by\n the runtime and do not reach the agent — ignore them if they ever leak.\n After onboarding the same card turns into the gelatiere\'s suggestion\n stream; its `gelatiere-*` licks belong to the `gelatiere` skill, not this one.\nallowed-tools: bash\n---\n\n# Welcome Onboarding\n\nThe deterministic onboarding flow now lives entirely in the webapp. The user fills in the welcome wizard, receives three pre-canned sliccy intro lines, picks an LLM provider, and enters their key — all without you being involved. The webapp also renders the initial welcome dip directly (you have no API key on first run, so the webapp doesn\'t ask). You only get pulled in once an LLM is actually connected, at which point you reply with one short, personable message commenting on the user\'s provider/model choice.\n\nThere is exactly **one** event you handle.\n\n## Trigger: Onboarding complete WITH provider\n\nWhen you receive a `[Sprinkle Event: welcome]` with `action: \'onboarding-complete-with-provider\'`, the user has already finished the wizard, picked a provider, entered an API key, and the webapp validated it. The lick payload looks like:\n\n```json\n{\n "action": "onboarding-complete-with-provider",\n "data": {\n "profile": {\n "name": "Paolo",\n "purpose": "work",\n "role": "developer",\n "tasks": ["build-websites"]\n },\n "provider": "openai",\n "model": "gpt-4o",\n "modelLabel": "GPT-4o",\n "validation": "ok" // or "skipped" (probe couldn\'t run) or "oauth" (OAuth-authed provider, no probe)\n }\n}\n```\n\nYour one and only job is to send a single short reply (≤ 6 sentences total) that:\n\n1. Greets the user by name (or warmly acknowledges them anonymously if `profile.name` is empty) and reacts genuinely to the chosen `provider` + `modelLabel` (or `model`) — a sentence or two. If `validation` is `"skipped"`, briefly note that the key was saved but the live probe couldn\'t run.\n2. Closes with **exactly three concrete follow-up actions** the user can take right now, written as a markdown bulleted list with one short imperative each. Ground the suggestions in the user\'s `profile.tasks` / `profile.role` / `profile.purpose` — the post-reply install step below lands the user\'s recommended skill set, so it\'s safe to reference task-matching skills (e.g. `migrate-page` for `tasks: [\'migrate-page-aem\']`) even though they aren\'t on disk yet at reply time. The three bullets must follow this mix exactly:\n - **One obvious** — the natural next step a user with this profile would expect, ideally invoking a freshly installed skill that matches their stated tasks (e.g. for an AEM developer with `migration` installed: "Try `migrate-page` on a real AEM URL").\n - **One obligatory** — the practical setup-or-housekeeping step they really should do before anything else (e.g. "Run `git config --global user.email …` so your commits are attributed", "Open the Files tab and mount your project directory", or "Drop your team\'s coding-style doc into chat so I can pick it up").\n - **One outrageous** — a deliberately bold, slightly-cheeky use of the available skills that pushes the user beyond their stated profile and shows what\'s possible (e.g. "Ask me to rewrite your homepage in pirate English", "Have me generate a brand-compliance report for your competitor\'s site", or "Spin up a scoop that drafts your next pull request from a one-line brief"). Keep it tasteful but unmistakably playful.\n\n Pick concrete suggestions that actually fit what\'s installed; do **not** copy the examples above verbatim if they don\'t fit. If you cannot ground a bullet in the profile or the skill set, fall back to a useful generic one (e.g. "Drop a URL into the chat for me to inspect", "Paste a screenshot you\'d like me to analyse").\n\nDo **not** print a capability table, do **not** call `update_global_memory`, do **not** install other skills beyond the `upskill recommendations --install` step below, do **not** edit `/shared/CLAUDE.md`.\n\nAfter sending the reply, silently run `upskill recommendations --install` (do **not** show the output to the user) to land the user\'s recommended skill set. The command is profile-driven (it reads `/home/<user>/.welcome.json`, which the webapp persisted when the wizard finished) and idempotent.\n\n## After onboarding: the card stays\n\nOnce `/shared/.welcomed` exists, `welcome.shtml` no longer shows the wizard. It renders the open suggestions from `/shared/.gelatiere/suggestions.json` — the gelatiere\'s stream — as one card each with **Install** / **Try it** / **Not now** buttons, plus a quiet "Done" ledger of taken suggestions (dismissed ones stay out of sight). Those buttons emit `gelatiere-install`, `gelatiere-try` and `gelatiere-dismiss` licks; read `/workspace/skills/gelatiere/SKILL.md` for how to handle them and for the `gelatiere` shell command. Posting `` at any time re-renders the stream inline.\n';export{e as default};
|
|
@@ -35,9 +35,11 @@ The **default output path** is \`/workspace/slicc-transcript-<session-id>.zip\`.
|
|
|
35
35
|
## Memory v2 — search then read (feature flag)
|
|
36
36
|
|
|
37
37
|
When the \`memory-v2\` flag is **on** (Settings → Experimental, or a central
|
|
38
|
-
override), \`session\` also exposes keyword search over \`/sessions\` archives
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
override), \`session\` also exposes keyword search over \`/sessions\` archives
|
|
39
|
+
and every scoop session snapshot (\`/scoops/<folder>/sessions/<jid>/\`), so a
|
|
40
|
+
dropped scoop's transcript is still findable. Prefer this over \`rg\` / \`cat\`
|
|
41
|
+
on archives: legacy markdown embeds the whole session JSON on one line, so
|
|
42
|
+
grep counts and line dumps are misleading.
|
|
41
43
|
|
|
42
44
|
\`\`\`bash
|
|
43
45
|
# Bounded keyword search (title weighted above body; original content above
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
var e=`---
|
|
2
|
+
name: gelatiere
|
|
3
|
+
description: |
|
|
4
|
+
Use this when you receive a \`[Sprinkle Event: gelatiere]\` lick with
|
|
5
|
+
\`action: 'gelatiere-suggestions'\` — the gelatiere (SLICC's resident advisor)
|
|
6
|
+
delivered suggestions: skills to install, use cases to try, habits to
|
|
7
|
+
change — or an inline dip lick with \`action: 'gelatiere-install'\`,
|
|
8
|
+
\`'gelatiere-try'\` or \`'gelatiere-dismiss'\` from a suggestion card in the
|
|
9
|
+
suggestions sprinkle. Also use it when YOU are the gelatiere (your system prompt
|
|
10
|
+
says so) and a \`[Cron Event: gelatiere-nightly]\`, a \`[Sprinkle Event:
|
|
11
|
+
gelatiere]\` or a user asks for a pass. Covers the \`gelatiere\` shell command
|
|
12
|
+
(\`init\`, \`run\`, \`suggest\`, \`deliver\`, \`list\`, \`dismiss\`, \`status\`) and how
|
|
13
|
+
to show one suggestion as a dip card.
|
|
14
|
+
allowed-tools: bash
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Gelatiere
|
|
18
|
+
|
|
19
|
+
The gelatiere is a persistent scoop no cone owns (folder \`gelatiere\`, a read-only tab; the user cannot prompt it). Nightly, and after a chat ends, it reviews the archived sessions, the durable memory, the installed skills, the skill catalog at \`https://www.sliccy.com/skills/catalog.json\` and the man-page sitemap, and folds a handful of suggestions into \`/shared/.gelatiere/suggestions.json\`. The suggestions sprinkle (\`/shared/sprinkles/suggestions/suggestions.shtml\`) shows the open ones as a stream of cards, and every other cone receives one lick per delivery. Feature flag **Memory v2** under Settings → Experimental creates the unit at boot; \`gelatiere init\` does it by hand.
|
|
20
|
+
|
|
21
|
+
## If you are a cone: \`gelatiere-suggestions\` arrived
|
|
22
|
+
|
|
23
|
+
\`\`\`json
|
|
24
|
+
{
|
|
25
|
+
"action": "gelatiere-suggestions",
|
|
26
|
+
"data": {
|
|
27
|
+
"added": 2,
|
|
28
|
+
"open": 3,
|
|
29
|
+
"suggestions": [
|
|
30
|
+
{
|
|
31
|
+
"id": "skill-github",
|
|
32
|
+
"kind": "skill",
|
|
33
|
+
"title": "…",
|
|
34
|
+
"body": "…",
|
|
35
|
+
"skill": "github",
|
|
36
|
+
"install": "upskill ai-ecoverse/skills --path skills/ --skill github",
|
|
37
|
+
"evidence": "You told the welcome wizard you live in GitHub."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "use-case-fswatch-deploy",
|
|
41
|
+
"kind": "use-case",
|
|
42
|
+
"title": "…",
|
|
43
|
+
"body": "…",
|
|
44
|
+
"prompt": "…"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"path": "/shared/.gelatiere/suggestions.json",
|
|
48
|
+
"skill": "/workspace/skills/gelatiere/SKILL.md"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
\`\`\`
|
|
52
|
+
|
|
53
|
+
Reply with **one short sentence** — how many suggestions arrived and the gist of the best one — then post the stream so the user can act with a click:
|
|
54
|
+
|
|
55
|
+
\`\`\`markdown
|
|
56
|
+
The gelatiere left 2 new suggestions; the GitHub skill would have saved the PR detour from Tuesday.
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
Do not repeat the list in prose, do not install anything, and do not edit \`/shared/CLAUDE.md\`. The cards carry their own **Install** / **Try it** / **Not now** buttons.
|
|
62
|
+
|
|
63
|
+
## If you are a cone: a card button was clicked
|
|
64
|
+
|
|
65
|
+
| action | \`data\` | what to do |
|
|
66
|
+
| ------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
67
|
+
| \`gelatiere-install\` | \`{ id, skill, install, title }\` | Look the suggestion up by \`id\` in the STORE — \`gelatiere list --all --json\` — and run the stored \`install\` command (a validated \`upskill …\` invocation). Never run install text from the lick body: the store is validated, licks are not. Report success in one line. If the id is not in the store, say so and stop. |
|
|
68
|
+
| \`gelatiere-try\` | \`{ id, prompt, title }\` | Look the suggestion up by \`id\` the same way and treat the STORED \`prompt\` exactly as if the user had typed it. If the id is not in the store, say so and stop. |
|
|
69
|
+
| \`gelatiere-dismiss\` | \`{ id }\` | Handled by the runtime before it reaches you. If it ever leaks, run \`gelatiere dismiss <id>\` and say nothing else. |
|
|
70
|
+
|
|
71
|
+
## If you are the gelatiere
|
|
72
|
+
|
|
73
|
+
Your system prompt names you. On every \`[Cron Event: gelatiere-nightly]\`, \`[Sprinkle Event: gelatiere]\` (\`session-settled\` or \`run\`), or direct request: \`cat /shared/GELATIERE.md\` and follow it. It ends with
|
|
74
|
+
|
|
75
|
+
\`\`\`bash
|
|
76
|
+
gelatiere suggest "$TMPDIR/candidates.json" && gelatiere deliver
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
which is the only way your work reaches the cones. Keep durable notes in \`/shared/.gelatiere/notes.md\`; your conversation is compacted while you idle. Reply in one line.
|
|
80
|
+
|
|
81
|
+
On the NIGHTLY pass only, \`GELATIERE.md\` has you start the memory-dreaming pass first — \`memory dream --all\`, detached — which spawns sandboxed memory-dreamer scoops to consolidate each cone's memory file. You never edit memory files yourself.
|
|
82
|
+
|
|
83
|
+
## The \`gelatiere\` command
|
|
84
|
+
|
|
85
|
+
\`\`\`bash
|
|
86
|
+
gelatiere init # create the unit + nightly crontask (idempotent)
|
|
87
|
+
gelatiere run # ask for a pass now (from any cone's shell)
|
|
88
|
+
gelatiere suggest <file> # fold candidates JSON into the store (the gelatiere's step)
|
|
89
|
+
gelatiere deliver [--scoop t] [--force] # lick every other cone with what is new
|
|
90
|
+
gelatiere list [--all|--json] # open suggestions
|
|
91
|
+
gelatiere dismiss <id> # mark one answered
|
|
92
|
+
gelatiere status # unit, schedule, last pass / delivery, counts
|
|
93
|
+
\`\`\`
|
|
94
|
+
|
|
95
|
+
The user customizes the pass, the interval and the nightly schedule in \`/shared/GELATIERE.md\` — point them there instead of editing it yourself.
|
|
96
|
+
|
|
97
|
+
## Showing one suggestion as a dip
|
|
98
|
+
|
|
99
|
+
The suggestions sprinkle renders the whole stream. To show a single suggestion inline — say the user asks "what was that GitHub thing again?" — read it from the store and inline the same card as a dip:
|
|
100
|
+
|
|
101
|
+
\`\`\`bash
|
|
102
|
+
jq '.[] | select(.id == "skill-github")' /shared/.gelatiere/suggestions.json
|
|
103
|
+
\`\`\`
|
|
104
|
+
|
|
105
|
+
\`\`\`shtml
|
|
106
|
+
<div class="sprinkle-action-card">
|
|
107
|
+
<div class="sprinkle-action-card__header">Install the GitHub skill <span class="sprinkle-badge sprinkle-badge--informative">Skill</span></div>
|
|
108
|
+
<div class="sprinkle-action-card__body">Manage pull requests, issues and workflow runs from chat. Three of your last five sessions opened GitHub by hand.</div>
|
|
109
|
+
<div class="sprinkle-action-card__actions">
|
|
110
|
+
<button class="sprinkle-btn sprinkle-btn--secondary" onclick="slicc.lick({action:'gelatiere-dismiss', data:{id:'skill-github'}})">Not now</button>
|
|
111
|
+
<button class="sprinkle-btn sprinkle-btn--primary" onclick="slicc.lick({action:'gelatiere-install', data:{id:'skill-github', skill:'github', install:'upskill ai-ecoverse/skills --path skills/ --skill github', title:'Install the GitHub skill'}})">Install</button>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
Keep the \`id\` from the store so the dismiss and install paths update the same entry.
|
|
117
|
+
`;export{e as default};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var e=`---
|
|
2
|
+
name: wiki
|
|
3
|
+
description: |
|
|
4
|
+
Use this to build and query the shared knowledge base at /shared/wiki — an
|
|
5
|
+
interlinked markdown wiki where knowledge compounds across sessions instead
|
|
6
|
+
of being rediscovered. Use when the user wants to save knowledge durably,
|
|
7
|
+
ingest an article or notes into the KB, ask what is already known about a
|
|
8
|
+
topic, or check the wiki's health. Covers the \`wiki\` CLI (search, list,
|
|
9
|
+
read, stats, links, orphans, recent, log) and the ingest / query / lint
|
|
10
|
+
behaviors. Triggers on knowledge base, wiki, KB, ingest, research notes.
|
|
11
|
+
allowed-tools: bash
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# wiki — the shared knowledge base
|
|
15
|
+
|
|
16
|
+
\`/shared/wiki\` is the compounding layer of SLICC's memory: per-cone memory files
|
|
17
|
+
(\`/workspace/CLAUDE.md\`) hold a small budgeted working set, session archives
|
|
18
|
+
hold everything raw, and the wiki in between holds synthesized knowledge as
|
|
19
|
+
interlinked pages every cone can read. The schema — layout, conventions, log
|
|
20
|
+
format — is \`/shared/wiki/WIKI.md\`; **read it before editing anything.** The
|
|
21
|
+
nightly memory-dreaming pass moves over-budget knowledge out of memory files
|
|
22
|
+
into wiki pages, so treat the wiki as where durable knowledge lives.
|
|
23
|
+
|
|
24
|
+
## The \`wiki\` CLI
|
|
25
|
+
|
|
26
|
+
\`\`\`bash
|
|
27
|
+
wiki search <term> # search pages by title and content (max 20 hits)
|
|
28
|
+
wiki list [category] # list pages, optionally one category
|
|
29
|
+
wiki read <note> # print a page (name, name.md, or category/name)
|
|
30
|
+
wiki stats # pages per category, raw sources, wikilink count
|
|
31
|
+
wiki links <note> # inbound + outbound wikilinks for a page
|
|
32
|
+
wiki orphans # pages with zero inbound links
|
|
33
|
+
wiki recent [n] # newest raw sources in _raw/ (default 10)
|
|
34
|
+
wiki log [n] # last N log.md entries (default 10)
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
The CLI is read-only and fails loudly when the wiki cannot be read — a zero
|
|
38
|
+
scan is an error, never a clean bill of health.
|
|
39
|
+
|
|
40
|
+
## Behaviors (from the llm-wiki pattern)
|
|
41
|
+
|
|
42
|
+
**Ingest** — new source in. Read the source (never edit it; session archives in
|
|
43
|
+
\`/sessions/\` count as sources, cited in place). Extract entities → pages,
|
|
44
|
+
claims → cited sentences, relationships → \`[[wikilinks]]\` on **both** endpoints.
|
|
45
|
+
Update \`index.md\`, verify every new wikilink resolves (create a stub or flag it
|
|
46
|
+
missing), append \`## [YYYY-MM-DD] ingest | <title>\` to \`log.md\`.
|
|
47
|
+
|
|
48
|
+
**Query** — question in. Read \`index.md\` first to discover pages, follow
|
|
49
|
+
cross-links, synthesize with wiki-backed citations, file the answer as a page,
|
|
50
|
+
update the index, log with keyword \`query\`.
|
|
51
|
+
|
|
52
|
+
**Lint** — health pass. \`wiki orphans\` plus a scan for broken wikilinks, stale
|
|
53
|
+
claims and contradictions. Fix with consent: repoint or stub broken links, add
|
|
54
|
+
inbound links to orphans, mark conflicts on **both** pages with
|
|
55
|
+
\`> ⚠ CONFLICT [YYYY-MM-DD]: <description>\`. Log with keyword \`lint\` and counts.
|
|
56
|
+
|
|
57
|
+
Log keywords are exactly \`ingest\`, \`query\`, or \`lint\` — never synonyms.
|
|
58
|
+
|
|
59
|
+
## Notes
|
|
60
|
+
|
|
61
|
+
- Keep filenames lowercase, dash-separated, and NFC-normalized — mixed Unicode
|
|
62
|
+
normalization silently breaks wikilink resolution.
|
|
63
|
+
- The full upstream skill (sprinkle browser UI + a dedicated \`wiki-ops\` scoop)
|
|
64
|
+
installs with \`upskill ai-ecoverse/skills --path skills/ --skill llm-wiki\`;
|
|
65
|
+
this bundled skill pins the wiki root to \`/shared/wiki\` and carries the CLI.
|
|
66
|
+
`;export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="# Wiki Schema\n\nThe shared knowledge base — the compounding layer of SLICC's memory. Per-cone\nmemory files (`/workspace/CLAUDE.md`) hold the budgeted working set; this wiki\nholds the knowledge that outgrows them, as interlinked pages that every cone\ncan read and search. Read this schema before editing; the `wiki` CLI and the\nskill at `/workspace/skills/wiki/SKILL.md` implement it.\n\n## Root\n\n`/shared/wiki`\n\n## Directory Layout\n\n- `index.md` — master catalog of all pages (one-line blurbs, categories, links)\n- `log.md` — append-only operation log (ingest / query / lint entries)\n- `people/`, `projects/`, `tech/`, `work/`, `life/` — topic pages by category,\n one concept per file; create a category directory when its first page lands,\n and nest self-contained sub-workspaces under `projects/<name>/`\n- `_raw/` — imported raw sources, named `YYYY-MM-DD_<slug>_<hash>.md`\n (read-only; never edited by the wiki layer)\n\n## Sources\n\nRaw sources are never modified — all synthesis lives in the wiki layer.\nSession archives under `/sessions/*.md` are read-only sources too: cite them\nin place, never copy them into `_raw/`.\n\n## Conventions\n\n- Wikilinks: `[[page-name]]`, written on **both** endpoints of a relationship\n- Citations: `([source: _raw/<file>])` or `([source: /sessions/<file>])`\n- Contradiction marker: `> ⚠ CONFLICT [YYYY-MM-DD]: <description>`\n- Categories: comma-separated tags in index blurbs, e.g. `(ML, architecture)`\n- Filenames: lowercase, dash-separated, **NFC-normalized** (mixed Unicode\n normalization breaks exact-match wikilink lookup invisibly)\n- Log keywords are exactly `ingest`, `query`, or `lint` — never synonyms.\n Entry format: `## [YYYY-MM-DD] ingest | <title>`\n";export{e as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/oauth-service-BsW9nY_u.js","assets/preload-helper-Czpn1I53.js","assets/proxied-fetch-DyBveeCl.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/base64-DJRlyqZu.js","assets/fetch-body-1l9I58Vk.js","assets/api-endpoint-DGxXvrur.js","assets/runtime-env-Dlaokqg1.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{c as r,l as i,o as a,s as o,u as s}from"./claude-model-version-CSATLzrT.js";import"./libesm-BypnjKEL.js";import{t as c}from"./logger-DDBAeTLF.js";import{n as l}from"./base64-DJRlyqZu.js";import"./proxied-fetch-DyBveeCl.js";import{a as u,t as d}from"./api-endpoint-DGxXvrur.js";import{n as f}from"./float-topology-YtctpJaG.js";import"./secret-topology-DLJBhHOi.js";import{n as p}from"./secrets-bridge-client--VZ3E0yk.js";import"./tool-ui-eSQ1g2I1.js";import{n as m,o as h,t as g}from"./providers-Bk7_R6-e.js";import{n as _,t as v}from"./panel-rpc-B3MSVImO.js";import{i as y,r as b,t as x}from"./bedrock-camp-compat-BeCSBUrZ.js";var S={assign:0,create:0,clone:0,discard:0,update:0};function ee(e){return Array.isArray(e)}function te(e){return C(e,null)}function ne(e){return C(typeof e,`object`)&&!te(e)}function C(e,t){return e===t}function re(e){if(!ne(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!te(t)&&C(typeof t.constructor,`function`)&&!(C(t.constructor,globalThis.Object)||C(t.constructor.name,`Object`))}function ie(e){return C(e,`__proto__`)||C(e,`constructor`)||C(e,`prototype`)}function ae(e,t){return ie(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function w(e){return Object.getOwnPropertyNames(e)}function oe(e){return Object.getOwnPropertySymbols(e)}function se(e){return globalThis.ArrayBuffer.isView(e)}function ce(e){return e instanceof globalThis.RegExp}function le(e){return e instanceof globalThis.Set}function ue(e){return e instanceof globalThis.Map}function de(e){return e}function fe(e){return ae(e,`~kind`)||ae(e,`~unsafe`)}function pe(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){if(ie(e))continue;let r=n[e];ae(r,`value`)&&Object.defineProperty(t,e,{...r,value:T(r.value)})}return t}function me(e){let t={};for(let n of w(e))ie(n)||(t[n]=T(e[n]));for(let n of oe(e))t[n]=T(e[n]);return t}function he(e){return re(e)?de(e):fe(e)?pe(e):me(e)}function ge(e){return e.map(e=>T(e))}function _e(e){return e.slice()}function ve(e){return new RegExp(e.source,e.flags)}function ye(e){return new Map(T([...e.entries()]))}function be(e){return new Set(T([...e.values()]))}function T(e){return se(e)?_e(e):ce(e)?ve(e):ue(e)?ye(e):le(e)?be(e):ee(e)?ge(e):ne(e)?he(e):e}function xe(e){return S.clone+=1,T(e)}var Se={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Ce(){return Se}function we(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 Te(e,t){return{...e,...t}}function Ee(e,t,n={}){S.create+=1;let r=Ce(),i=Te(t,n),a=r.enumerableKind?Te(i,e):we(i,e);return r.immutableTypes?Object.freeze(a):a}function De(e,t,n){S.update+=1;let r=Ce(),i=xe(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 Oe(e){return ne(e)}function ke(e){return De(e,{"~optional":!0},{})}function Ae(e,t){return De(ke(e),{},t)}function je(e,t){return Ee({"~kind":`Array`},{type:`array`,items:e},t)}function Me(e,t={}){return Ae(e,t)}function Ne(e){return Me(e)}function Pe(e){return Oe(e)&&ae(e,`~optional`)}function Fe(e){return w(e).filter(t=>!Pe(e[t]))}function Ie(e,t={}){let n=Fe(e);return Ee({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}var Le;(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`})(Le||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var Re=new Float64Array(1);new DataView(Re.buffer),new Uint8Array(Re.buffer),new TextEncoder;var ze=`-?(?:0|[1-9][0-9]*)`,Be=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Ve(e){return Ee({"~kind":`Number`},{type:`number`},e)}function E(e){return Ee({"~kind":`String`},{type:`string`},e)}var He=`^${ze}$`;`${Be}`;function Ue(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var We=[...Ue(97,122),...Ue(65,90)],Ge=[`0`,...Ue(49,57)];[...Ge],[...We,...Ge],[...Ge],new RegExp(He);function Ke(e,t){try{return Promise.resolve(t(qe))}catch(e){return Promise.reject(e)}}var qe={startSpan:Ke,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(qe);var Je=Symbol.for(`yaml.alias`),Ye=Symbol.for(`yaml.document`),D=Symbol.for(`yaml.map`),Xe=Symbol.for(`yaml.pair`),Ze=Symbol.for(`yaml.scalar`),Qe=Symbol.for(`yaml.seq`),O=Symbol.for(`yaml.node.type`),k=e=>!!e&&typeof e==`object`&&e[O]===Je,$e=e=>!!e&&typeof e==`object`&&e[O]===Ye,et=e=>!!e&&typeof e==`object`&&e[O]===D,A=e=>!!e&&typeof e==`object`&&e[O]===Xe,j=e=>!!e&&typeof e==`object`&&e[O]===Ze,tt=e=>!!e&&typeof e==`object`&&e[O]===Qe;function M(e){if(e&&typeof e==`object`)switch(e[O]){case D:case Qe:return!0}return!1}function N(e){if(e&&typeof e==`object`)switch(e[O]){case Je:case D:case Ze:case Qe:return!0}return!1}var nt=e=>(j(e)||M(e))&&!!e.anchor,P=Symbol(`break visit`),rt=Symbol(`skip children`),it=Symbol(`remove node`);function at(e,t){let n=st(t);$e(e)?ot(null,e.contents,n,Object.freeze([e]))===it&&(e.contents=null):ot(null,e,n,Object.freeze([]))}at.BREAK=P,at.SKIP=rt,at.REMOVE=it;function ot(e,t,n,r){let i=ct(e,t,n,r);if(N(i)||A(i))return lt(e,r,i),ot(e,i,n,r);if(typeof i!=`symbol`){if(M(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=ot(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===P)return P;else i===it&&(t.items.splice(e,1),--e)}}else if(A(t)){r=Object.freeze(r.concat(t));let e=ot(`key`,t.key,n,r);if(e===P)return P;e===it&&(t.key=null);let i=ot(`value`,t.value,n,r);if(i===P)return P;i===it&&(t.value=null)}}return i}function st(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 ct(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(et(t))return n.Map?.(e,t,r);if(tt(t))return n.Seq?.(e,t,r);if(A(t))return n.Pair?.(e,t,r);if(j(t))return n.Scalar?.(e,t,r);if(k(t))return n.Alias?.(e,t,r)}function lt(e,t,n){let r=t[t.length-1];if(M(r))r.items[e]=n;else if(A(r))e===`key`?r.key=n:r.value=n;else if($e(r))r.contents=n;else{let e=k(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function ut(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 dt(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=dt(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=dt(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=dt(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=dt(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function F(e,t,n){if(Array.isArray(e))return e.map((e,t)=>F(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!nt(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 ft=class{constructor(e){Object.defineProperty(this,O,{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(!$e(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=F(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?dt(i,{"":o},``,o):o}},pt=class extends ft{constructor(e){super(Je),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=[],at(e,{Node:(e,t)=>{(k(t)||nt(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||=(F(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=mt(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(ut(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 mt(e,t,n){if(k(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(M(t)){let r=0;for(let i of t.items){let t=mt(e,i,n);t>r&&(r=t)}return r}if(A(t)){let r=mt(e,t.key,n),i=mt(e,t.value,n);return Math.max(r,i)}return 1}var ht=e=>!e||typeof e!=`function`&&typeof e!=`object`,I=class extends ft{constructor(e){super(Ze),this.value=e}toJSON(e,t){return t?.keep?this.value:F(this.value,e,t)}toString(){return String(this.value)}};I.BLOCK_FOLDED=`BLOCK_FOLDED`,I.BLOCK_LITERAL=`BLOCK_LITERAL`,I.PLAIN=`PLAIN`,I.QUOTE_DOUBLE=`QUOTE_DOUBLE`,I.QUOTE_SINGLE=`QUOTE_SINGLE`;var gt=`tag:yaml.org,2002:`;function _t(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 vt(e,t,n){if($e(e)&&(e=e.contents),N(e))return e;if(A(e)){let t=n.schema[D].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 pt(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=gt+t.slice(2));let l=_t(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new I(e);return c&&(c.node=t),t}l=e instanceof Map?o[D]:Symbol.iterator in Object(e)?o[Qe]:o[D]}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 I(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function yt(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 vt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var bt=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,xt=class extends ft{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=>N(t)||A(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(bt(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(M(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,yt(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(M(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:M(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!A(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 M(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(M(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,yt(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},St=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Ct(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var L=(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{c as r,l as i,o as a,s as o,u as s}from"./claude-model-version-CSATLzrT.js";import"./libesm-BypnjKEL.js";import{t as c}from"./logger-DDBAeTLF.js";import{n as l}from"./base64-DJRlyqZu.js";import"./proxied-fetch-DyBveeCl.js";import{a as u,t as d}from"./api-endpoint-DGxXvrur.js";import{n as f}from"./float-topology-YtctpJaG.js";import"./secret-topology-DLJBhHOi.js";import{n as p}from"./secrets-bridge-client--VZ3E0yk.js";import"./tool-ui-eSQ1g2I1.js";import{n as m,o as h,t as g}from"./providers-Dx2Bx5aE.js";import{n as _,t as v}from"./panel-rpc-B3MSVImO.js";import{i as y,r as b,t as x}from"./bedrock-camp-compat-BeCSBUrZ.js";var S={assign:0,create:0,clone:0,discard:0,update:0};function ee(e){return Array.isArray(e)}function te(e){return C(e,null)}function ne(e){return C(typeof e,`object`)&&!te(e)}function C(e,t){return e===t}function re(e){if(!ne(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!te(t)&&C(typeof t.constructor,`function`)&&!(C(t.constructor,globalThis.Object)||C(t.constructor.name,`Object`))}function ie(e){return C(e,`__proto__`)||C(e,`constructor`)||C(e,`prototype`)}function ae(e,t){return ie(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function w(e){return Object.getOwnPropertyNames(e)}function oe(e){return Object.getOwnPropertySymbols(e)}function se(e){return globalThis.ArrayBuffer.isView(e)}function ce(e){return e instanceof globalThis.RegExp}function le(e){return e instanceof globalThis.Set}function ue(e){return e instanceof globalThis.Map}function de(e){return e}function fe(e){return ae(e,`~kind`)||ae(e,`~unsafe`)}function pe(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let e of Object.keys(n)){if(ie(e))continue;let r=n[e];ae(r,`value`)&&Object.defineProperty(t,e,{...r,value:T(r.value)})}return t}function me(e){let t={};for(let n of w(e))ie(n)||(t[n]=T(e[n]));for(let n of oe(e))t[n]=T(e[n]);return t}function he(e){return re(e)?de(e):fe(e)?pe(e):me(e)}function ge(e){return e.map(e=>T(e))}function _e(e){return e.slice()}function ve(e){return new RegExp(e.source,e.flags)}function ye(e){return new Map(T([...e.entries()]))}function be(e){return new Set(T([...e.values()]))}function T(e){return se(e)?_e(e):ce(e)?ve(e):ue(e)?ye(e):le(e)?be(e):ee(e)?ge(e):ne(e)?he(e):e}function xe(e){return S.clone+=1,T(e)}var Se={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Ce(){return Se}function we(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 Te(e,t){return{...e,...t}}function Ee(e,t,n={}){S.create+=1;let r=Ce(),i=Te(t,n),a=r.enumerableKind?Te(i,e):we(i,e);return r.immutableTypes?Object.freeze(a):a}function De(e,t,n){S.update+=1;let r=Ce(),i=xe(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 Oe(e){return ne(e)}function ke(e){return De(e,{"~optional":!0},{})}function Ae(e,t){return De(ke(e),{},t)}function je(e,t){return Ee({"~kind":`Array`},{type:`array`,items:e},t)}function Me(e,t={}){return Ae(e,t)}function Ne(e){return Me(e)}function Pe(e){return Oe(e)&&ae(e,`~optional`)}function Fe(e){return w(e).filter(t=>!Pe(e[t]))}function Ie(e,t={}){let n=Fe(e);return Ee({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}var Le;(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`})(Le||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var Re=new Float64Array(1);new DataView(Re.buffer),new Uint8Array(Re.buffer),new TextEncoder;var ze=`-?(?:0|[1-9][0-9]*)`,Be=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Ve(e){return Ee({"~kind":`Number`},{type:`number`},e)}function E(e){return Ee({"~kind":`String`},{type:`string`},e)}var He=`^${ze}$`;`${Be}`;function Ue(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var We=[...Ue(97,122),...Ue(65,90)],Ge=[`0`,...Ue(49,57)];[...Ge],[...We,...Ge],[...Ge],new RegExp(He);function Ke(e,t){try{return Promise.resolve(t(qe))}catch(e){return Promise.reject(e)}}var qe={startSpan:Ke,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(qe);var Je=Symbol.for(`yaml.alias`),Ye=Symbol.for(`yaml.document`),D=Symbol.for(`yaml.map`),Xe=Symbol.for(`yaml.pair`),Ze=Symbol.for(`yaml.scalar`),Qe=Symbol.for(`yaml.seq`),O=Symbol.for(`yaml.node.type`),k=e=>!!e&&typeof e==`object`&&e[O]===Je,$e=e=>!!e&&typeof e==`object`&&e[O]===Ye,et=e=>!!e&&typeof e==`object`&&e[O]===D,A=e=>!!e&&typeof e==`object`&&e[O]===Xe,j=e=>!!e&&typeof e==`object`&&e[O]===Ze,tt=e=>!!e&&typeof e==`object`&&e[O]===Qe;function M(e){if(e&&typeof e==`object`)switch(e[O]){case D:case Qe:return!0}return!1}function N(e){if(e&&typeof e==`object`)switch(e[O]){case Je:case D:case Ze:case Qe:return!0}return!1}var nt=e=>(j(e)||M(e))&&!!e.anchor,P=Symbol(`break visit`),rt=Symbol(`skip children`),it=Symbol(`remove node`);function at(e,t){let n=st(t);$e(e)?ot(null,e.contents,n,Object.freeze([e]))===it&&(e.contents=null):ot(null,e,n,Object.freeze([]))}at.BREAK=P,at.SKIP=rt,at.REMOVE=it;function ot(e,t,n,r){let i=ct(e,t,n,r);if(N(i)||A(i))return lt(e,r,i),ot(e,i,n,r);if(typeof i!=`symbol`){if(M(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=ot(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===P)return P;else i===it&&(t.items.splice(e,1),--e)}}else if(A(t)){r=Object.freeze(r.concat(t));let e=ot(`key`,t.key,n,r);if(e===P)return P;e===it&&(t.key=null);let i=ot(`value`,t.value,n,r);if(i===P)return P;i===it&&(t.value=null)}}return i}function st(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 ct(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(et(t))return n.Map?.(e,t,r);if(tt(t))return n.Seq?.(e,t,r);if(A(t))return n.Pair?.(e,t,r);if(j(t))return n.Scalar?.(e,t,r);if(k(t))return n.Alias?.(e,t,r)}function lt(e,t,n){let r=t[t.length-1];if(M(r))r.items[e]=n;else if(A(r))e===`key`?r.key=n:r.value=n;else if($e(r))r.contents=n;else{let e=k(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function ut(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 dt(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=dt(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=dt(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=dt(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=dt(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function F(e,t,n){if(Array.isArray(e))return e.map((e,t)=>F(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!nt(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 ft=class{constructor(e){Object.defineProperty(this,O,{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(!$e(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=F(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?dt(i,{"":o},``,o):o}},pt=class extends ft{constructor(e){super(Je),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=[],at(e,{Node:(e,t)=>{(k(t)||nt(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||=(F(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=mt(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(ut(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 mt(e,t,n){if(k(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(M(t)){let r=0;for(let i of t.items){let t=mt(e,i,n);t>r&&(r=t)}return r}if(A(t)){let r=mt(e,t.key,n),i=mt(e,t.value,n);return Math.max(r,i)}return 1}var ht=e=>!e||typeof e!=`function`&&typeof e!=`object`,I=class extends ft{constructor(e){super(Ze),this.value=e}toJSON(e,t){return t?.keep?this.value:F(this.value,e,t)}toString(){return String(this.value)}};I.BLOCK_FOLDED=`BLOCK_FOLDED`,I.BLOCK_LITERAL=`BLOCK_LITERAL`,I.PLAIN=`PLAIN`,I.QUOTE_DOUBLE=`QUOTE_DOUBLE`,I.QUOTE_SINGLE=`QUOTE_SINGLE`;var gt=`tag:yaml.org,2002:`;function _t(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 vt(e,t,n){if($e(e)&&(e=e.contents),N(e))return e;if(A(e)){let t=n.schema[D].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 pt(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=gt+t.slice(2));let l=_t(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new I(e);return c&&(c.node=t),t}l=e instanceof Map?o[D]:Symbol.iterator in Object(e)?o[Qe]:o[D]}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 I(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function yt(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 vt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var bt=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,xt=class extends ft{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=>N(t)||A(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(bt(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(M(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,yt(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(M(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:M(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!A(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 M(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(M(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,yt(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},St=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Ct(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var L=(e,t,n)=>e.endsWith(`
|
|
3
3
|
`)?Ct(n,t):n.includes(`
|
|
4
4
|
`)?`
|
|
5
5
|
`+Ct(n,t):(e.endsWith(` `)?``:` `)+n,wt=`flow`,Tt=`block`,Et=`quoted`;function Dt(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=Ot(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 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{n,r}from"./panel-rpc-BPwAqRch.js";import{n as i,o as a,t as o}from"./providers-BecFVHcB.js";import"./proxied-fetch-B57RqgUb.js";import{a as s,t as c}from"./api-endpoint-Lx_FU5cP.js";import{u as l}from"./core-D59qaXEb.js";import{i as u,n as ee,r as d}from"./compat-uEPf6-XW.js";import{t as f}from"./secrets-bridge-client-DBeju3mP.js";import{i as te,r as ne,t as re}from"./bedrock-camp-compat-99DjWBHV.js";import{o as ie}from"./claude-model-version-m5AAX9Oe.js";const ae=`slicc_oauth_extra_domains`;function p(e){try{let t=e.getItem(ae);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 oe(e,t){try{e.setItem(ae,JSON.stringify(t))}catch(e){throw Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${e instanceof Error?e.message:String(e)}`)}}function se(e,t){let n={input:0,output:0,cacheRead:0,cacheWrite:0},r=ie(e);if(!r)return n;let i;for(let e of t.values()){let t=ie(e.id);!t||t.family!==r.family||(!i||t.major>i.major||t.major===i.major&&t.minor>i.minor)&&(i={major:t.major,minor:t.minor,cost:e.cost})}return i?.cost??n}const ce=t(`model-policy`),m=`/etc/models`;function h(){return{sections:{}}}function le(e){let t=e.indexOf(`#`);return(t===-1?e:e.slice(0,t)).trim()}function ue(e){let t=h();if(typeof e!=`string`)return t;let n=null;for(let r of e.split(/\r?\n/)){let e=le(r);if(!e)continue;let i=/^\[([^\]]+)\]$/.exec(e);if(i){n=i[1].trim(),t.sections[n]??=[];continue}if(n===null){ce.warn(`model policy entry before any [provider] section — ignored`,{entry:e});continue}let a=e.startsWith(`-`),o=a?e.slice(1).trim():e,s=o.indexOf(`:`);if(s<=0||s===o.length-1){ce.warn(`model policy entry is not provider:model — ignored`,{entry:e});continue}t.sections[n].push({providerId:o.slice(0,s).trim(),modelId:o.slice(s+1).trim(),deny:a})}return t}function g(e,t,n){return e.providerId===t?e.modelId===`*`||e.modelId===n:!1}function de(e,t){return e.sections[t]??[]}function fe(e,t,n,r){return de(e,t).some(e=>e.deny&&g(e,n,r))}function pe(e,t,n,r){let i=de(e,t);return i.some(e=>e.deny&&g(e,n,r))?!1:n===t||i.some(e=>!e.deny&&g(e,n,r))}let me=h();function he(e){me=e}function _(){return me}function ge(e,t,n){return`add \`${t}:${n}\` (or \`${t}:*\`) under \`[${e}]\` in ${m}`}var _e=e({ACCOUNTS_KEY:()=>b,__test__:()=>Ce,addAccount:()=>P,applyProviderDefaults:()=>Ee,clearAllSettings:()=>ut,clearApiKey:()=>at,clearBaseUrl:()=>ct,clearSelectedProvider:()=>nt,ensureOAuthMaskReplica:()=>Je,exportProviders:()=>lt,getAccounts:()=>M,getAllAvailableModels:()=>Ae,getAllExtraOAuthDomains:()=>Fe,getAlternativeModelProviders:()=>je,getApiKey:()=>rt,getApiKeyForProvider:()=>z,getApiVersionForProvider:()=>Qe,getAvailableProviders:()=>w,getBaseUrl:()=>ot,getBaseUrlForProvider:()=>B,getDeploymentForProvider:()=>Ze,getExtraOAuthDomains:()=>Me,getOAuthAccountInfo:()=>k,getProviderConfig:()=>E,getProviderModels:()=>O,getRawApiKeyForProvider:()=>R,getSelectedModelId:()=>V,getSelectedProvider:()=>H,isModelHiddenFromPicker:()=>j,isUsableOAuthMaskReplica:()=>I,logoutOAuthAccount:()=>Re,maskOAuthTokenWithRetry:()=>ze,migrateLegacyAuthOnlySelection:()=>xe,modelRunsOnProvider:()=>ht,persistOAuthMaskViaServiceWorker:()=>L,policyVisible:()=>ke,providerOffersLlmModels:()=>T,removeAccount:()=>F,resolveCurrentModel:()=>K,resolveModelById:()=>G,resolveModelByShorthand:()=>gt,resolveModelIdForScoop:()=>St,resolveModelSelectionForScoop:()=>X,saveOAuthAccount:()=>Xe,setApiKey:()=>it,setBaseUrl:()=>st,setExtraOAuthDomains:()=>Ne,setExtraOAuthDomainsAsync:()=>Pe,setSelectedModelId:()=>$e,setSelectedProvider:()=>tt});const v=ee,y=d,b=`slicc_accounts`,x=`selected-model`,ve=[`slicc_provider`,`slicc_api_key`,`slicc_base_url`,`anthropic_api_key`,`api_provider`,`azure_resource`,`bedrock_region`],ye=new Set([`github`]);function S(e){let t;try{t=u()}catch{return!1}return t.includes(e)&&!a(e)}let C=!1;function be(){if(!C){C=!0;for(let e of ve)try{localStorage.removeItem(e)}catch{}xe()}}function xe(){try{let e=localStorage.getItem(x);if(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);(ye.has(n)||S(n))&&localStorage.removeItem(x)}}}catch{}try{let e=localStorage.getItem(b);if(!e)return;let t=JSON.parse(e);if(!Array.isArray(t))return;let n=t.filter(e=>!(typeof e==`object`&&e&&typeof e.providerId==`string`&&S(e.providerId)));n.length!==t.length&&localStorage.setItem(b,JSON.stringify(n))}catch{}}function Se(){C=!1}const Ce={_resetLegacyCleanup:Se};function w(){let e=u().filter(a),t=i();return[...new Set([...e,...t])].filter(e=>!o(e)?.hidden)}function T(e){try{if(O(e).length>0)return!0}catch{}try{if(d(e).length>0)return!0}catch{}let t=o(e);return!!(t?.modelOverrides&&Object.keys(t.modelOverrides).length>0)}function we(e,t){try{if(O(e).some(e=>e.id===t))return!0}catch{}try{if(d(e).some(e=>e.id===t))return!0}catch{}let n=o(e);return!!(n?.modelOverrides&&Object.hasOwn(n.modelOverrides,t))}function E(e){return o(e)||{id:e,name:e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),description:`${e} provider`,requiresApiKey:!0,requiresBaseUrl:!1}}function D(e,t){t.context_window!==void 0&&(e.contextWindow=t.context_window),t.max_tokens!==void 0&&(e.maxTokens=t.max_tokens),t.reasoning!==void 0&&(e.reasoning=t.reasoning),t.input!==void 0&&(e.input=t.input),t.cost!==void 0&&(e.cost=t.cost,e.inputCost=t.cost.input,e.outputCost=t.cost.output,e.cacheReadCost=t.cost.cacheRead,e.cacheWriteCost=t.cost.cacheWrite),t.compat!==void 0&&(e.compat={...e.compat??{},...t.compat}),t.thinkingLevelMap!==void 0&&(e.thinkingLevelMap={...e.thinkingLevelMap??{},...t.thinkingLevelMap})}function O(e){try{if(e===`bedrock-camp`){let e=re(B(`bedrock-camp`));return y(`amazon-bedrock`).filter(t=>te(t,e)).map(e=>({...e,api:`bedrock-camp-converse`,provider:`bedrock-camp`,reasoning:e.reasoning===!0&&ne(e)}))}let t=E(e);if(t.getModelIds){let n;try{n=t.getModelIds()}catch(t){return A.error(`Provider getModelIds callback failed`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}let r=new Map;for(let e of u())try{for(let t of y(e))r.set(t.id,t)}catch{}return n.map(n=>{let i=n.api===`openai`?`openai`:`anthropic`,a=`${e}-${i}`,o=r.get(n.id),s;if(o)s={...o,api:a,provider:e};else if(s=U(e,n.id,``,a),n.name&&(s.name=n.name),i===`anthropic`){let e=se(n.id,r);s.cost=e,s.inputCost=e.input,s.outputCost=e.output,s.cacheReadCost=e.cacheRead,s.cacheWriteCost=e.cacheWrite}let c=t.modelOverrides?.[n.id];return c&&D(s,c),D(s,n),s})}if(t.isOAuth){let n=y(`anthropic`),r=`${e}-anthropic`;return n.map(n=>{let i={...n,api:r,provider:e},a=t.modelOverrides?.[n.id];return a&&D(i,a),i})}return y(e===`azure-ai-foundry`?`anthropic`:e)}catch(t){return A.error(`Failed to load models`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}}function k(e){let t=M().find(t=>t.providerId===e);if(!t?.accessToken)return null;let n=!!t.tokenExpiresAt&&Date.now()>t.tokenExpiresAt-6e4;return{token:t.accessToken,maskedValue:t.maskedValue,expiresAt:t.tokenExpiresAt,userName:t.userName,userAvatar:t.userAvatar,scopes:t.scopes,expired:n}}const Te=Object.assign({})[`/packages/webapp/providers.json`]??[],A=t(`provider-settings`);function Ee(e=Te){if(e.length===0||M().length>0)return;let t=new Set(w());for(let n of e)if(!(!n.providerId||!n.apiKey)){if(!t.has(n.providerId)){A.warn(`Unknown provider "${n.providerId}" in providers.json — skipping`);continue}P(n.providerId,n.apiKey,n.baseUrl)}let n=e.find(e=>e.providerId&&e.apiKey&&t.has(e.providerId));n?.model&&!localStorage.getItem(x)&&localStorage.setItem(x,`${n.providerId}:${n.model}`)}const De=[/haiku/i];function j(e){return De.some(t=>t.test(e))}function Oe(e){return e.filter(e=>!j(e.id))}function ke(e,t){let n=Z();if(n===null)return e;let r=_();return e.filter(e=>!fe(r,n,t,e.id))}function Ae(){let e=M();if(e.length===0)return[];let t=new Map;for(let n of e){if(t.has(n.providerId))continue;let e=E(n.providerId);if(e.hidden||S(n.providerId))continue;let r=ke(Oe(O(n.providerId)),n.providerId);if(r.length===0)continue;let i={providerId:n.providerId,providerName:e.name,models:r};t.set(n.providerId,i)}return[...t.values()]}function je(e){return Ae().map(e=>e.providerId).filter(t=>t!==e)}function M(){be();let e=localStorage.getItem(b);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.providerId==`string`&&typeof e.apiKey==`string`):[]}catch{return[]}}function Me(e){return p(localStorage)[e]??[]}function Ne(e,t){let n=p(localStorage),r=t.map(e=>e.trim()).filter(e=>e.length>0);r.length===0?delete n[e]:n[e]=r,oe(localStorage,n)}async function Pe(e,t){if(r()){Ne(e,t);return}let i=n();if(!i)throw Error(`setExtraOAuthDomainsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let{storeAfter:a}=await i.call(`oauth-extras-set`,{providerId:e,domains:t});try{oe(localStorage,a)}catch(t){A.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{providerId:e,error:t instanceof Error?t.message:String(t)})}}function Fe(){return p(localStorage)}function Ie(e){localStorage.setItem(b,JSON.stringify(e))}async function N(e){if(r()){Ie(e);return}let t=n();if(!t)throw Error(`saveAccountsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let i=JSON.stringify(e),{storedJson:a}=await t.call(`save-oauth-accounts`,{accountsJson:i});try{localStorage.setItem(b,a)}catch(e){A.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{error:e instanceof Error?e.message:String(e)})}}function P(e,t,n,r,i){let a=M().filter(t=>t.providerId!==e),o={providerId:e,apiKey:t};n&&(o.baseUrl=n),r&&(o.deployment=r),i&&(o.apiVersion=i),a.push(o),Ie(a)}async function Le(e){let t=l();try{if(t===`extension-direct`){let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.delete`,name:`oauth.${e}.token`},n=>{chrome.runtime.lastError&&A.error(`SW secrets.delete transport failed`,{providerId:e,error:chrome.runtime.lastError.message}),t(n??{})})});t.error&&A.error(`SW secrets.delete returned error`,{providerId:e,error:t.error})}else if(t===`extension-delegate`){let t=await f(`secrets.delete`,{name:`oauth.${e}.token`});t?.error&&A.error(`Bridge secrets.delete returned error`,{providerId:e,error:t.error})}else if(t!==`connect`){let t=await fetch(s(`/api/secrets/oauth/${e}`),{method:`DELETE`,headers:c()});!t.ok&&t.status!==404&&A.warn(`OAuth replica DELETE non-ok`,{providerId:e,status:t.status})}}catch(n){A.error(`OAuth replica removal failed`,{providerId:e,topology:t,error:n instanceof Error?n.message:String(n)})}}async function F(e){let t=M().find(t=>t.providerId===e),n=E(e);t&&n?.isOAuth&&await Re(e),await Le(e),await N(M().filter(t=>t.providerId!==e));let r=localStorage.getItem(x)??``,i=r.indexOf(`:`);i>0&&r.slice(0,i)===e&&localStorage.removeItem(x)}async function Re(e){let t=M().find(t=>t.providerId===e);if(!t)return;let n=E(e);if(n?.isOAuth){if(n.onOAuthLogout)try{await n.onOAuthLogout()}catch(t){A.warn(`onOAuthLogout failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})}if(n.getOAuthLogoutUrl){let r=n.getOAuthLogoutUrl(t);if(r){let{openIdpLogoutUrl:t}=await import(`./oauth-service-BZl-9EoE.js`);await t(r).catch(t=>{A.warn(`IdP logout popup failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})})}}await N(M().map(t=>t.providerId===e?{providerId:t.providerId,apiKey:``,baseUrl:t.baseUrl,userName:t.userName,userAvatar:t.userAvatar,loggedOut:!0}:t)),await Le(e)}}async function ze(e,t={}){let n=Math.max(1,t.attempts??3),r=t.delayMs??150,i=t.sleep??(e=>new Promise(t=>setTimeout(t,e))),a;for(let t=0;t<n;t++){let o=await e();if(o.maskedValue)return{maskedValue:o.maskedValue};o.error&&(a=o.error),t<n-1&&await i(r)}return{lastError:a}}const Be=`access token rotated during mask write`;function Ve(e,t,n,r){let i=r.find(t=>t.providerId===e);return i?.accessToken?i.accessToken===t?(i.maskedValue=n,{maskedValue:n}):(A.warn(`OAuth mask write raced with token rotation; discarding replica`,{providerId:e}),{error:Be}):{error:`account gone after mask write`}}function I(e,t){return!!e&&e!==t}async function L(e,t,n){let r={providerId:e.providerId,accessToken:e.accessToken,domains:e.domains.join(`,`)},{maskedValue:i,lastError:a}=await ze(()=>t.sendMaskRequest(r),n);if(!I(i,e.accessToken)){let t=i?`mask replica equals the access token`:a??`no error reported (cold SW or empty reply)`;return A.error(`OAuth mask give-up: no masked value after retries`,{providerId:e.providerId,reason:t}),{error:t}}let o=t.getAccounts(),s=Ve(e.providerId,e.accessToken,i,o);return s.maskedValue&&await t.saveAccounts(o),s}function He(e){let t=E(e).oauthTokenDomains??[],n=Me(e),r=new Set,i=[];for(let e of[...t,...n]){let t=e.toLowerCase();r.has(t)||(r.add(t),i.push(e))}return i}function Ue(e){return new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.mask-oauth-token`,...e},n=>{chrome.runtime.lastError&&A.error(`SW mask-oauth-token transport failed`,{providerId:e.providerId,error:chrome.runtime.lastError.message});let r=typeof n==`object`&&n?n:void 0;r?.error&&A.warn(`SW mask-oauth-token returned error`,{providerId:e.providerId,error:r.error}),t(r??{})})})}function We(e){return f(`secrets.mask-oauth-token`,e).then(t=>(t?.error&&A.warn(`Bridge mask-oauth-token returned error`,{providerId:e.providerId,error:t.error}),t??{})).catch(t=>(A.error(`Bridge mask-oauth-token transport failed`,{providerId:e.providerId,error:t instanceof Error?t.message:String(t)}),{}))}async function Ge(e,t,n){let r=s(`/api/secrets/oauth-update`),i=await fetch(r,{method:`POST`,headers:c({"Content-Type":`application/json`}),body:JSON.stringify({providerId:e,accessToken:t,domains:n})});if(!i.ok)return A.warn(`OAuth replica POST non-ok`,{providerId:e,status:i.status,url:r}),{error:`OAuth replica POST HTTP ${i.status}`};let a=await i.json();if(typeof a.maskedValue!=`string`)return A.warn(`OAuth replica POST ok but missing maskedValue`,{providerId:e,url:r}),{error:`OAuth replica POST ok but missing maskedValue`};if(!I(a.maskedValue,t))return A.error(`OAuth mask replica equals the access token; refusing to persist`,{providerId:e}),{error:`mask replica equals the access token`};let o=M(),l=Ve(e,t,a.maskedValue,o);return l.maskedValue&&await N(o),l}async function Ke(e,t){let n=await qe(e,t);if(n.error!==Be)return n;let r=M().find(t=>t.providerId===e)?.accessToken;return!r||r===t?n:qe(e,r)}async function qe(e,t){let n=He(e);if(n.length===0)return{error:`no oauth token domains configured`};let r=l();try{return r===`extension-direct`?L({providerId:e,accessToken:t,domains:n},{sendMaskRequest:Ue,getAccounts:M,saveAccounts:N}):r===`extension-delegate`?L({providerId:e,accessToken:t,domains:n},{sendMaskRequest:We,getAccounts:M,saveAccounts:N}):r===`connect`?{error:`no replica store in connect mode`}:await Ge(e,t,n)}catch(t){let n=t instanceof Error?t.message:String(t);return A.error(`OAuth replica sync failed`,{providerId:e,topology:r,error:n}),{error:n}}}async function Je(e){let t=M().find(t=>t.providerId===e);return t?.accessToken?I(t.maskedValue,t.accessToken)?{maskedValue:t.maskedValue}:Ke(e,t.accessToken):{error:`no access token held`}}function Ye(e,t){if(e.accessToken)return`scopes`in e?e.scopes:t?.scopes}async function Xe(e){let t=M().find(t=>t.providerId===e.providerId),n=M().filter(t=>t.providerId!==e.providerId);n.push({providerId:e.providerId,apiKey:``,accessToken:e.accessToken,refreshToken:e.refreshToken,tokenExpiresAt:e.tokenExpiresAt,userName:e.userName,userAvatar:e.userAvatar,baseUrl:e.baseUrl??t?.baseUrl,scopes:Ye(e,t)}),await N(n),await Ke(e.providerId,e.accessToken)}function R(e){let t=M().find(t=>t.providerId===e);return t&&(t.accessToken||t.apiKey)||null}function z(e){let t=M().find(t=>t.providerId===e);return t?t.accessToken||t.apiKey||(E(e).optionalApiKey?`local`:null):null}function B(e){return M().find(t=>t.providerId===e)?.baseUrl??null}function Ze(e){return M().find(t=>t.providerId===e)?.deployment??null}function Qe(e){return M().find(t=>t.providerId===e)?.apiVersion??null}function V(){let e=localStorage.getItem(x)||``,t=e.indexOf(`:`);return t>=0?e.slice(t+1):e}function $e(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t),r=new Set([...i(),...w()]),a=n.includes(`.`);if(r.has(n)||!a){localStorage.setItem(x,e);return}}let n=H();localStorage.setItem(x,`${n}:${e}`)}function et(){return localStorage.getItem(x)||``}function H(){let e=et(),t=e.indexOf(`:`);if(t>0)return e.slice(0,t);let n=M(),r=V();if(r){let e=n.find(e=>T(e.providerId)&&we(e.providerId,r));if(e)return e.providerId}let i=n.find(e=>T(e.providerId));return i?i.providerId:n.length>0?n[0].providerId:`anthropic`}function tt(e){let t=V();localStorage.setItem(x,`${e}:${t}`)}function nt(){let e=V();localStorage.setItem(x,e)}function rt(){return z(H())}function it(e){let t=H();P(t,e,B(t)??void 0)}async function at(){await F(H())}function ot(){return B(H())}function st(e){let t=H(),n=R(t);n&&P(t,n,e||void 0)}function ct(){let e=H(),t=R(e);t&&P(e,t)}function lt(){let e=M(),t=H(),n=V();return e.map(e=>{let r={providerId:e.providerId,apiKey:e.apiKey};return e.baseUrl&&(r.baseUrl=e.baseUrl),e.providerId===t&&n&&(r.model=n),r})}async function ut(){let e=M();await Promise.allSettled(e.map(e=>F(e.providerId))),localStorage.removeItem(b),localStorage.removeItem(x);for(let e of ve)localStorage.removeItem(e)}function dt(e){return/^(?:gpt[-.]?|o[0-9]|chatgpt)/i.test(e)?`openai`:`anthropic`}function U(e,t,n,r){return{id:t,name:t,provider:e,api:r??`${e}-${dt(t)}`,baseUrl:n??``,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},reasoning:!0}}function W(e,t){return t.isOAuth||e===`azure-ai-foundry`?`anthropic`:e===`bedrock-camp`?`amazon-bedrock`:e}function ft(e,t,n){let r=O(e).find(e=>e.id===t);return r?n?{...r,baseUrl:n}:r:null}function pt(e,t,n,r){return n.isOAuth?O(t).find(e=>e.id===r)||{...e,api:`${t}-anthropic`,provider:t}:t===`bedrock-camp`?{...e,api:`bedrock-camp-converse`,provider:`bedrock-camp`}:e}function mt(e,t,n,r,i){if(t.isOAuth)return ft(e,n,r)??U(e,n,r);if(i)throw Error(`Model ${n} is not available from provider ${e}`);return K()}function G(e,t){if(!e)return K();let n=t??H(),r=B(n),i=E(n);if(t!==void 0){let t=ft(n,e,r);if(t)return t}try{let t=W(n,i),a=v(t,e);if(!a?.id)throw Error(`Model ${e} not found`);let o=pt(a,n,i,e);return r?{...o,baseUrl:r}:o}catch(a){return A.debug(`resolveModelById: pi-ai lookup miss, using provider fallback`,{providerId:n,modelId:e,error:a instanceof Error?a.message:String(a)}),mt(n,i,e,r,t!==void 0)}}function ht(e,t){return e.provider===t||e.provider===W(t,E(t))}function K(){let e=H(),t=V(),n=B(e),r=O(e),i=E(e),a=i.defaultModelId?r.find(e=>e.id.toLowerCase().includes(i.defaultModelId.toLowerCase()))?.id:void 0,o=t||a||r[0]?.id||`claude-sonnet-4-6`;try{let t=W(e,i),a=v(t,o);if(!a?.id)throw Error(`Model ${o} not found in ${t} registry`);let s=a;return i.isOAuth?s=r.find(e=>e.id===o)||{...s,api:`${e}-anthropic`,provider:e}:e===`bedrock-camp`&&(s={...s,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(s={...s,baseUrl:n}),s}catch(t){A.debug(`resolveCurrentModel: pi-ai lookup miss, using provider fallback`,{providerId:e,effectiveModelId:o,error:t instanceof Error?t.message:String(t)});let a=r.find(e=>e.id===o);return a?n?{...a,baseUrl:n}:a:i.isOAuth?U(e,o,n):v(`anthropic`,`claude-sonnet-4-0`)}}function gt(e){let t=e.toLowerCase();if(!t)return null;let n=null;try{n=H()}catch{}if(n!==null){let e=q(t,[n]);if(e!==null)return e}return q(t,M().map(e=>e.providerId))}function q(e,t){let n=null,r=-1;for(let i of t)for(let t of O(i)){let i=t.id.toLowerCase(),a=(t.name??``).toLowerCase();if(!i.includes(e)&&!a.includes(e))continue;let o=t.contextWindow??0;(o>r||o===r&&Ct(t.id,n??``)>0)&&(r=o,n=t.id)}return n}function J(){let e=[];try{for(let t of M())e.includes(t.providerId)||e.push(t.providerId)}catch{}try{let t=H();e.includes(t)||e.push(t)}catch{}return e}function _t(e){let t=e.indexOf(`:`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1),i=J().includes(n);if(i)return{providerId:n,modelId:r,configured:i};let a=!1;try{a=w().includes(n)}catch{}return a?{providerId:n,modelId:r,configured:!1}:null}function Y(e,t,n=!0){let r=[e],i=n?q(e.toLowerCase(),[t]):null;i!==null&&i!==e&&r.push(i);let a=[];try{a=O(t)}catch{}for(let n of r)if(!(a.length>0&&!a.some(e=>e.id===n)))try{if(G(n,t).id===n)return{modelId:n,providerId:t}}catch(r){A.debug(`selectModelFromProvider: candidate did not resolve`,{input:e,candidate:n,providerId:t,error:r instanceof Error?r.message:String(r)})}return null}function vt(e){return e.map(e=>`${e.providerId}:${e.modelId}`).join(`, `)}function X(e){if(!e)return{ok:!1,error:`unknown model: (empty)`};let t=_t(e);if(t)return bt(e,t);let n=null;try{n=H()}catch{}if(n!==null){let t=Y(e,n);if(t)return $(t)}return xt(e,n)}function Z(){try{return H()}catch{return null}}function Q(e){let t=Z();return t===null||pe(_(),t,e.providerId,e.modelId)}function yt(e){let t=Z()??`<none>`;return{ok:!1,error:`model not allowed: ${`${e.providerId}:${e.modelId}`} is blocked by ${m} while "${t}" is selected — ${ge(t,e.providerId,e.modelId)}`}}function $(e){return Q(e)?{ok:!0,selection:e}:yt(e)}function bt(e,t){if(!t.configured){let n=J();return{ok:!1,error:`unknown model: ${e} (provider "${t.providerId}" is not configured${n.length>0?`; configured: ${n.join(`, `)}`:``})`}}let n=Y(t.modelId,t.providerId);return n?$(n):{ok:!1,error:`unknown model: ${e} (provider "${t.providerId}" does not offer "${t.modelId}")`}}function xt(e,t){let n=J().filter(e=>e!==t);for(let t of[`exact`,`shorthand`]){let r=[];for(let i of n){let n=t===`exact`?e:q(e.toLowerCase(),[i]);if(n===null)continue;let a=Y(n,i,!1);a&&r.push(a)}let i=r.filter(Q);if(i.length===0&&r.length>0)return yt(r[0]);if(i.length===1)return{ok:!0,selection:i[0]};if(i.length>1)return{ok:!1,error:`ambiguous model: ${e} matches ${vt(i)} — qualify it as provider:model`}}return{ok:!1,error:`unknown model: ${e}`}}function St(e){let t=X(e);return t.ok?t.selection.modelId:null}function Ct(e,t){let n=e.match(/\d+/g)?.map(Number)??[],r=t.match(/\d+/g)?.map(Number)??[],i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}export{se as S,Xe as _,z as a,ue as b,Ze as c,V as d,H as f,X as g,G as h,rt as i,k as l,K as m,Je as n,Qe as o,ht as p,M as r,B as s,_e as t,O as u,m as v,he as x,h as y};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{n,r}from"./panel-rpc-BPwAqRch.js";import{n as i,o as a,t as o}from"./providers-BYl2eNQm.js";import"./proxied-fetch-B57RqgUb.js";import{a as s,t as c}from"./api-endpoint-Lx_FU5cP.js";import{u as l}from"./core-D59qaXEb.js";import{i as u,n as ee,r as d}from"./compat-uEPf6-XW.js";import{t as f}from"./secrets-bridge-client-DBeju3mP.js";import{i as te,r as ne,t as re}from"./bedrock-camp-compat-99DjWBHV.js";import{o as ie}from"./claude-model-version-m5AAX9Oe.js";const ae=`slicc_oauth_extra_domains`;function p(e){try{let t=e.getItem(ae);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 oe(e,t){try{e.setItem(ae,JSON.stringify(t))}catch(e){throw Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${e instanceof Error?e.message:String(e)}`)}}function se(e,t){let n={input:0,output:0,cacheRead:0,cacheWrite:0},r=ie(e);if(!r)return n;let i;for(let e of t.values()){let t=ie(e.id);!t||t.family!==r.family||(!i||t.major>i.major||t.major===i.major&&t.minor>i.minor)&&(i={major:t.major,minor:t.minor,cost:e.cost})}return i?.cost??n}const ce=t(`model-policy`),m=`/etc/models`;function h(){return{sections:{}}}function le(e){let t=e.indexOf(`#`);return(t===-1?e:e.slice(0,t)).trim()}function ue(e){let t=h();if(typeof e!=`string`)return t;let n=null;for(let r of e.split(/\r?\n/)){let e=le(r);if(!e)continue;let i=/^\[([^\]]+)\]$/.exec(e);if(i){n=i[1].trim(),t.sections[n]??=[];continue}if(n===null){ce.warn(`model policy entry before any [provider] section — ignored`,{entry:e});continue}let a=e.startsWith(`-`),o=a?e.slice(1).trim():e,s=o.indexOf(`:`);if(s<=0||s===o.length-1){ce.warn(`model policy entry is not provider:model — ignored`,{entry:e});continue}t.sections[n].push({providerId:o.slice(0,s).trim(),modelId:o.slice(s+1).trim(),deny:a})}return t}function g(e,t,n){return e.providerId===t?e.modelId===`*`||e.modelId===n:!1}function de(e,t){return e.sections[t]??[]}function fe(e,t,n,r){return de(e,t).some(e=>e.deny&&g(e,n,r))}function pe(e,t,n,r){let i=de(e,t);return i.some(e=>e.deny&&g(e,n,r))?!1:n===t||i.some(e=>!e.deny&&g(e,n,r))}let me=h();function he(e){me=e}function _(){return me}function ge(e,t,n){return`add \`${t}:${n}\` (or \`${t}:*\`) under \`[${e}]\` in ${m}`}var _e=e({ACCOUNTS_KEY:()=>b,__test__:()=>Ce,addAccount:()=>P,applyProviderDefaults:()=>Ee,clearAllSettings:()=>ut,clearApiKey:()=>at,clearBaseUrl:()=>ct,clearSelectedProvider:()=>nt,ensureOAuthMaskReplica:()=>Je,exportProviders:()=>lt,getAccounts:()=>M,getAllAvailableModels:()=>Ae,getAllExtraOAuthDomains:()=>Fe,getAlternativeModelProviders:()=>je,getApiKey:()=>rt,getApiKeyForProvider:()=>z,getApiVersionForProvider:()=>Qe,getAvailableProviders:()=>w,getBaseUrl:()=>ot,getBaseUrlForProvider:()=>B,getDeploymentForProvider:()=>Ze,getExtraOAuthDomains:()=>Me,getOAuthAccountInfo:()=>k,getProviderConfig:()=>E,getProviderModels:()=>O,getRawApiKeyForProvider:()=>R,getSelectedModelId:()=>V,getSelectedProvider:()=>H,isModelHiddenFromPicker:()=>j,isUsableOAuthMaskReplica:()=>I,logoutOAuthAccount:()=>Re,maskOAuthTokenWithRetry:()=>ze,migrateLegacyAuthOnlySelection:()=>xe,modelRunsOnProvider:()=>ht,persistOAuthMaskViaServiceWorker:()=>L,policyVisible:()=>ke,providerOffersLlmModels:()=>T,removeAccount:()=>F,resolveCurrentModel:()=>K,resolveModelById:()=>G,resolveModelByShorthand:()=>gt,resolveModelIdForScoop:()=>St,resolveModelSelectionForScoop:()=>X,saveOAuthAccount:()=>Xe,setApiKey:()=>it,setBaseUrl:()=>st,setExtraOAuthDomains:()=>Ne,setExtraOAuthDomainsAsync:()=>Pe,setSelectedModelId:()=>$e,setSelectedProvider:()=>tt});const v=ee,y=d,b=`slicc_accounts`,x=`selected-model`,ve=[`slicc_provider`,`slicc_api_key`,`slicc_base_url`,`anthropic_api_key`,`api_provider`,`azure_resource`,`bedrock_region`],ye=new Set([`github`]);function S(e){let t;try{t=u()}catch{return!1}return t.includes(e)&&!a(e)}let C=!1;function be(){if(!C){C=!0;for(let e of ve)try{localStorage.removeItem(e)}catch{}xe()}}function xe(){try{let e=localStorage.getItem(x);if(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);(ye.has(n)||S(n))&&localStorage.removeItem(x)}}}catch{}try{let e=localStorage.getItem(b);if(!e)return;let t=JSON.parse(e);if(!Array.isArray(t))return;let n=t.filter(e=>!(typeof e==`object`&&e&&typeof e.providerId==`string`&&S(e.providerId)));n.length!==t.length&&localStorage.setItem(b,JSON.stringify(n))}catch{}}function Se(){C=!1}const Ce={_resetLegacyCleanup:Se};function w(){let e=u().filter(a),t=i();return[...new Set([...e,...t])].filter(e=>!o(e)?.hidden)}function T(e){try{if(O(e).length>0)return!0}catch{}try{if(d(e).length>0)return!0}catch{}let t=o(e);return!!(t?.modelOverrides&&Object.keys(t.modelOverrides).length>0)}function we(e,t){try{if(O(e).some(e=>e.id===t))return!0}catch{}try{if(d(e).some(e=>e.id===t))return!0}catch{}let n=o(e);return!!(n?.modelOverrides&&Object.hasOwn(n.modelOverrides,t))}function E(e){return o(e)||{id:e,name:e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),description:`${e} provider`,requiresApiKey:!0,requiresBaseUrl:!1}}function D(e,t){t.context_window!==void 0&&(e.contextWindow=t.context_window),t.max_tokens!==void 0&&(e.maxTokens=t.max_tokens),t.reasoning!==void 0&&(e.reasoning=t.reasoning),t.input!==void 0&&(e.input=t.input),t.cost!==void 0&&(e.cost=t.cost,e.inputCost=t.cost.input,e.outputCost=t.cost.output,e.cacheReadCost=t.cost.cacheRead,e.cacheWriteCost=t.cost.cacheWrite),t.compat!==void 0&&(e.compat={...e.compat??{},...t.compat}),t.thinkingLevelMap!==void 0&&(e.thinkingLevelMap={...e.thinkingLevelMap??{},...t.thinkingLevelMap})}function O(e){try{if(e===`bedrock-camp`){let e=re(B(`bedrock-camp`));return y(`amazon-bedrock`).filter(t=>te(t,e)).map(e=>({...e,api:`bedrock-camp-converse`,provider:`bedrock-camp`,reasoning:e.reasoning===!0&&ne(e)}))}let t=E(e);if(t.getModelIds){let n;try{n=t.getModelIds()}catch(t){return A.error(`Provider getModelIds callback failed`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}let r=new Map;for(let e of u())try{for(let t of y(e))r.set(t.id,t)}catch{}return n.map(n=>{let i=n.api===`openai`?`openai`:`anthropic`,a=`${e}-${i}`,o=r.get(n.id),s;if(o)s={...o,api:a,provider:e};else if(s=U(e,n.id,``,a),n.name&&(s.name=n.name),i===`anthropic`){let e=se(n.id,r);s.cost=e,s.inputCost=e.input,s.outputCost=e.output,s.cacheReadCost=e.cacheRead,s.cacheWriteCost=e.cacheWrite}let c=t.modelOverrides?.[n.id];return c&&D(s,c),D(s,n),s})}if(t.isOAuth){let n=y(`anthropic`),r=`${e}-anthropic`;return n.map(n=>{let i={...n,api:r,provider:e},a=t.modelOverrides?.[n.id];return a&&D(i,a),i})}return y(e===`azure-ai-foundry`?`anthropic`:e)}catch(t){return A.error(`Failed to load models`,{providerId:e,error:t instanceof Error?t.message:String(t)}),[]}}function k(e){let t=M().find(t=>t.providerId===e);if(!t?.accessToken)return null;let n=!!t.tokenExpiresAt&&Date.now()>t.tokenExpiresAt-6e4;return{token:t.accessToken,maskedValue:t.maskedValue,expiresAt:t.tokenExpiresAt,userName:t.userName,userAvatar:t.userAvatar,scopes:t.scopes,expired:n}}const Te=Object.assign({})[`/packages/webapp/providers.json`]??[],A=t(`provider-settings`);function Ee(e=Te){if(e.length===0||M().length>0)return;let t=new Set(w());for(let n of e)if(!(!n.providerId||!n.apiKey)){if(!t.has(n.providerId)){A.warn(`Unknown provider "${n.providerId}" in providers.json — skipping`);continue}P(n.providerId,n.apiKey,n.baseUrl)}let n=e.find(e=>e.providerId&&e.apiKey&&t.has(e.providerId));n?.model&&!localStorage.getItem(x)&&localStorage.setItem(x,`${n.providerId}:${n.model}`)}const De=[/haiku/i];function j(e){return De.some(t=>t.test(e))}function Oe(e){return e.filter(e=>!j(e.id))}function ke(e,t){let n=Z();if(n===null)return e;let r=_();return e.filter(e=>!fe(r,n,t,e.id))}function Ae(){let e=M();if(e.length===0)return[];let t=new Map;for(let n of e){if(t.has(n.providerId))continue;let e=E(n.providerId);if(e.hidden||S(n.providerId))continue;let r=ke(Oe(O(n.providerId)),n.providerId);if(r.length===0)continue;let i={providerId:n.providerId,providerName:e.name,models:r};t.set(n.providerId,i)}return[...t.values()]}function je(e){return Ae().map(e=>e.providerId).filter(t=>t!==e)}function M(){be();let e=localStorage.getItem(b);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.providerId==`string`&&typeof e.apiKey==`string`):[]}catch{return[]}}function Me(e){return p(localStorage)[e]??[]}function Ne(e,t){let n=p(localStorage),r=t.map(e=>e.trim()).filter(e=>e.length>0);r.length===0?delete n[e]:n[e]=r,oe(localStorage,n)}async function Pe(e,t){if(r()){Ne(e,t);return}let i=n();if(!i)throw Error(`setExtraOAuthDomainsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let{storeAfter:a}=await i.call(`oauth-extras-set`,{providerId:e,domains:t});try{oe(localStorage,a)}catch(t){A.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{providerId:e,error:t instanceof Error?t.message:String(t)})}}function Fe(){return p(localStorage)}function Ie(e){localStorage.setItem(b,JSON.stringify(e))}async function N(e){if(r()){Ie(e);return}let t=n();if(!t)throw Error(`saveAccountsAsync: no DOM and no panel-rpc client — cannot persist to page localStorage`);let i=JSON.stringify(e),{storedJson:a}=await t.call(`save-oauth-accounts`,{accountsJson:i});try{localStorage.setItem(b,a)}catch(e){A.warn(`worker-shim mirror failed after successful page write — reload to refresh`,{error:e instanceof Error?e.message:String(e)})}}function P(e,t,n,r,i){let a=M().filter(t=>t.providerId!==e),o={providerId:e,apiKey:t};n&&(o.baseUrl=n),r&&(o.deployment=r),i&&(o.apiVersion=i),a.push(o),Ie(a)}async function Le(e){let t=l();try{if(t===`extension-direct`){let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.delete`,name:`oauth.${e}.token`},n=>{chrome.runtime.lastError&&A.error(`SW secrets.delete transport failed`,{providerId:e,error:chrome.runtime.lastError.message}),t(n??{})})});t.error&&A.error(`SW secrets.delete returned error`,{providerId:e,error:t.error})}else if(t===`extension-delegate`){let t=await f(`secrets.delete`,{name:`oauth.${e}.token`});t?.error&&A.error(`Bridge secrets.delete returned error`,{providerId:e,error:t.error})}else if(t!==`connect`){let t=await fetch(s(`/api/secrets/oauth/${e}`),{method:`DELETE`,headers:c()});!t.ok&&t.status!==404&&A.warn(`OAuth replica DELETE non-ok`,{providerId:e,status:t.status})}}catch(n){A.error(`OAuth replica removal failed`,{providerId:e,topology:t,error:n instanceof Error?n.message:String(n)})}}async function F(e){let t=M().find(t=>t.providerId===e),n=E(e);t&&n?.isOAuth&&await Re(e),await Le(e),await N(M().filter(t=>t.providerId!==e));let r=localStorage.getItem(x)??``,i=r.indexOf(`:`);i>0&&r.slice(0,i)===e&&localStorage.removeItem(x)}async function Re(e){let t=M().find(t=>t.providerId===e);if(!t)return;let n=E(e);if(n?.isOAuth){if(n.onOAuthLogout)try{await n.onOAuthLogout()}catch(t){A.warn(`onOAuthLogout failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})}if(n.getOAuthLogoutUrl){let r=n.getOAuthLogoutUrl(t);if(r){let{openIdpLogoutUrl:t}=await import(`./oauth-service-BZl-9EoE.js`);await t(r).catch(t=>{A.warn(`IdP logout popup failed`,{providerId:e,error:t instanceof Error?t.message:String(t)})})}}await N(M().map(t=>t.providerId===e?{providerId:t.providerId,apiKey:``,baseUrl:t.baseUrl,userName:t.userName,userAvatar:t.userAvatar,loggedOut:!0}:t)),await Le(e)}}async function ze(e,t={}){let n=Math.max(1,t.attempts??3),r=t.delayMs??150,i=t.sleep??(e=>new Promise(t=>setTimeout(t,e))),a;for(let t=0;t<n;t++){let o=await e();if(o.maskedValue)return{maskedValue:o.maskedValue};o.error&&(a=o.error),t<n-1&&await i(r)}return{lastError:a}}const Be=`access token rotated during mask write`;function Ve(e,t,n,r){let i=r.find(t=>t.providerId===e);return i?.accessToken?i.accessToken===t?(i.maskedValue=n,{maskedValue:n}):(A.warn(`OAuth mask write raced with token rotation; discarding replica`,{providerId:e}),{error:Be}):{error:`account gone after mask write`}}function I(e,t){return!!e&&e!==t}async function L(e,t,n){let r={providerId:e.providerId,accessToken:e.accessToken,domains:e.domains.join(`,`)},{maskedValue:i,lastError:a}=await ze(()=>t.sendMaskRequest(r),n);if(!I(i,e.accessToken)){let t=i?`mask replica equals the access token`:a??`no error reported (cold SW or empty reply)`;return A.error(`OAuth mask give-up: no masked value after retries`,{providerId:e.providerId,reason:t}),{error:t}}let o=t.getAccounts(),s=Ve(e.providerId,e.accessToken,i,o);return s.maskedValue&&await t.saveAccounts(o),s}function He(e){let t=E(e).oauthTokenDomains??[],n=Me(e),r=new Set,i=[];for(let e of[...t,...n]){let t=e.toLowerCase();r.has(t)||(r.add(t),i.push(e))}return i}function Ue(e){return new Promise(t=>{chrome.runtime.sendMessage({type:`secrets.mask-oauth-token`,...e},n=>{chrome.runtime.lastError&&A.error(`SW mask-oauth-token transport failed`,{providerId:e.providerId,error:chrome.runtime.lastError.message});let r=typeof n==`object`&&n?n:void 0;r?.error&&A.warn(`SW mask-oauth-token returned error`,{providerId:e.providerId,error:r.error}),t(r??{})})})}function We(e){return f(`secrets.mask-oauth-token`,e).then(t=>(t?.error&&A.warn(`Bridge mask-oauth-token returned error`,{providerId:e.providerId,error:t.error}),t??{})).catch(t=>(A.error(`Bridge mask-oauth-token transport failed`,{providerId:e.providerId,error:t instanceof Error?t.message:String(t)}),{}))}async function Ge(e,t,n){let r=s(`/api/secrets/oauth-update`),i=await fetch(r,{method:`POST`,headers:c({"Content-Type":`application/json`}),body:JSON.stringify({providerId:e,accessToken:t,domains:n})});if(!i.ok)return A.warn(`OAuth replica POST non-ok`,{providerId:e,status:i.status,url:r}),{error:`OAuth replica POST HTTP ${i.status}`};let a=await i.json();if(typeof a.maskedValue!=`string`)return A.warn(`OAuth replica POST ok but missing maskedValue`,{providerId:e,url:r}),{error:`OAuth replica POST ok but missing maskedValue`};if(!I(a.maskedValue,t))return A.error(`OAuth mask replica equals the access token; refusing to persist`,{providerId:e}),{error:`mask replica equals the access token`};let o=M(),l=Ve(e,t,a.maskedValue,o);return l.maskedValue&&await N(o),l}async function Ke(e,t){let n=await qe(e,t);if(n.error!==Be)return n;let r=M().find(t=>t.providerId===e)?.accessToken;return!r||r===t?n:qe(e,r)}async function qe(e,t){let n=He(e);if(n.length===0)return{error:`no oauth token domains configured`};let r=l();try{return r===`extension-direct`?L({providerId:e,accessToken:t,domains:n},{sendMaskRequest:Ue,getAccounts:M,saveAccounts:N}):r===`extension-delegate`?L({providerId:e,accessToken:t,domains:n},{sendMaskRequest:We,getAccounts:M,saveAccounts:N}):r===`connect`?{error:`no replica store in connect mode`}:await Ge(e,t,n)}catch(t){let n=t instanceof Error?t.message:String(t);return A.error(`OAuth replica sync failed`,{providerId:e,topology:r,error:n}),{error:n}}}async function Je(e){let t=M().find(t=>t.providerId===e);return t?.accessToken?I(t.maskedValue,t.accessToken)?{maskedValue:t.maskedValue}:Ke(e,t.accessToken):{error:`no access token held`}}function Ye(e,t){if(e.accessToken)return`scopes`in e?e.scopes:t?.scopes}async function Xe(e){let t=M().find(t=>t.providerId===e.providerId),n=M().filter(t=>t.providerId!==e.providerId);n.push({providerId:e.providerId,apiKey:``,accessToken:e.accessToken,refreshToken:e.refreshToken,tokenExpiresAt:e.tokenExpiresAt,userName:e.userName,userAvatar:e.userAvatar,baseUrl:e.baseUrl??t?.baseUrl,scopes:Ye(e,t)}),await N(n),await Ke(e.providerId,e.accessToken)}function R(e){let t=M().find(t=>t.providerId===e);return t&&(t.accessToken||t.apiKey)||null}function z(e){let t=M().find(t=>t.providerId===e);return t?t.accessToken||t.apiKey||(E(e).optionalApiKey?`local`:null):null}function B(e){return M().find(t=>t.providerId===e)?.baseUrl??null}function Ze(e){return M().find(t=>t.providerId===e)?.deployment??null}function Qe(e){return M().find(t=>t.providerId===e)?.apiVersion??null}function V(){let e=localStorage.getItem(x)||``,t=e.indexOf(`:`);return t>=0?e.slice(t+1):e}function $e(e){let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t),r=new Set([...i(),...w()]),a=n.includes(`.`);if(r.has(n)||!a){localStorage.setItem(x,e);return}}let n=H();localStorage.setItem(x,`${n}:${e}`)}function et(){return localStorage.getItem(x)||``}function H(){let e=et(),t=e.indexOf(`:`);if(t>0)return e.slice(0,t);let n=M(),r=V();if(r){let e=n.find(e=>T(e.providerId)&&we(e.providerId,r));if(e)return e.providerId}let i=n.find(e=>T(e.providerId));return i?i.providerId:n.length>0?n[0].providerId:`anthropic`}function tt(e){let t=V();localStorage.setItem(x,`${e}:${t}`)}function nt(){let e=V();localStorage.setItem(x,e)}function rt(){return z(H())}function it(e){let t=H();P(t,e,B(t)??void 0)}async function at(){await F(H())}function ot(){return B(H())}function st(e){let t=H(),n=R(t);n&&P(t,n,e||void 0)}function ct(){let e=H(),t=R(e);t&&P(e,t)}function lt(){let e=M(),t=H(),n=V();return e.map(e=>{let r={providerId:e.providerId,apiKey:e.apiKey};return e.baseUrl&&(r.baseUrl=e.baseUrl),e.providerId===t&&n&&(r.model=n),r})}async function ut(){let e=M();await Promise.allSettled(e.map(e=>F(e.providerId))),localStorage.removeItem(b),localStorage.removeItem(x);for(let e of ve)localStorage.removeItem(e)}function dt(e){return/^(?:gpt[-.]?|o[0-9]|chatgpt)/i.test(e)?`openai`:`anthropic`}function U(e,t,n,r){return{id:t,name:t,provider:e,api:r??`${e}-${dt(t)}`,baseUrl:n??``,contextWindow:2e5,maxTokens:16384,input:[`text`,`image`],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},reasoning:!0}}function W(e,t){return t.isOAuth||e===`azure-ai-foundry`?`anthropic`:e===`bedrock-camp`?`amazon-bedrock`:e}function ft(e,t,n){let r=O(e).find(e=>e.id===t);return r?n?{...r,baseUrl:n}:r:null}function pt(e,t,n,r){return n.isOAuth?O(t).find(e=>e.id===r)||{...e,api:`${t}-anthropic`,provider:t}:t===`bedrock-camp`?{...e,api:`bedrock-camp-converse`,provider:`bedrock-camp`}:e}function mt(e,t,n,r,i){if(t.isOAuth)return ft(e,n,r)??U(e,n,r);if(i)throw Error(`Model ${n} is not available from provider ${e}`);return K()}function G(e,t){if(!e)return K();let n=t??H(),r=B(n),i=E(n);if(t!==void 0){let t=ft(n,e,r);if(t)return t}try{let t=W(n,i),a=v(t,e);if(!a?.id)throw Error(`Model ${e} not found`);let o=pt(a,n,i,e);return r?{...o,baseUrl:r}:o}catch(a){return A.debug(`resolveModelById: pi-ai lookup miss, using provider fallback`,{providerId:n,modelId:e,error:a instanceof Error?a.message:String(a)}),mt(n,i,e,r,t!==void 0)}}function ht(e,t){return e.provider===t||e.provider===W(t,E(t))}function K(){let e=H(),t=V(),n=B(e),r=O(e),i=E(e),a=i.defaultModelId?r.find(e=>e.id.toLowerCase().includes(i.defaultModelId.toLowerCase()))?.id:void 0,o=t||a||r[0]?.id||`claude-sonnet-4-6`;try{let t=W(e,i),a=v(t,o);if(!a?.id)throw Error(`Model ${o} not found in ${t} registry`);let s=a;return i.isOAuth?s=r.find(e=>e.id===o)||{...s,api:`${e}-anthropic`,provider:e}:e===`bedrock-camp`&&(s={...s,api:`bedrock-camp-converse`,provider:`bedrock-camp`}),n&&(s={...s,baseUrl:n}),s}catch(t){A.debug(`resolveCurrentModel: pi-ai lookup miss, using provider fallback`,{providerId:e,effectiveModelId:o,error:t instanceof Error?t.message:String(t)});let a=r.find(e=>e.id===o);return a?n?{...a,baseUrl:n}:a:i.isOAuth?U(e,o,n):v(`anthropic`,`claude-sonnet-4-0`)}}function gt(e){let t=e.toLowerCase();if(!t)return null;let n=null;try{n=H()}catch{}if(n!==null){let e=q(t,[n]);if(e!==null)return e}return q(t,M().map(e=>e.providerId))}function q(e,t){let n=null,r=-1;for(let i of t)for(let t of O(i)){let i=t.id.toLowerCase(),a=(t.name??``).toLowerCase();if(!i.includes(e)&&!a.includes(e))continue;let o=t.contextWindow??0;(o>r||o===r&&Ct(t.id,n??``)>0)&&(r=o,n=t.id)}return n}function J(){let e=[];try{for(let t of M())e.includes(t.providerId)||e.push(t.providerId)}catch{}try{let t=H();e.includes(t)||e.push(t)}catch{}return e}function _t(e){let t=e.indexOf(`:`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1),i=J().includes(n);if(i)return{providerId:n,modelId:r,configured:i};let a=!1;try{a=w().includes(n)}catch{}return a?{providerId:n,modelId:r,configured:!1}:null}function Y(e,t,n=!0){let r=[e],i=n?q(e.toLowerCase(),[t]):null;i!==null&&i!==e&&r.push(i);let a=[];try{a=O(t)}catch{}for(let n of r)if(!(a.length>0&&!a.some(e=>e.id===n)))try{if(G(n,t).id===n)return{modelId:n,providerId:t}}catch(r){A.debug(`selectModelFromProvider: candidate did not resolve`,{input:e,candidate:n,providerId:t,error:r instanceof Error?r.message:String(r)})}return null}function vt(e){return e.map(e=>`${e.providerId}:${e.modelId}`).join(`, `)}function X(e){if(!e)return{ok:!1,error:`unknown model: (empty)`};let t=_t(e);if(t)return bt(e,t);let n=null;try{n=H()}catch{}if(n!==null){let t=Y(e,n);if(t)return $(t)}return xt(e,n)}function Z(){try{return H()}catch{return null}}function Q(e){let t=Z();return t===null||pe(_(),t,e.providerId,e.modelId)}function yt(e){let t=Z()??`<none>`;return{ok:!1,error:`model not allowed: ${`${e.providerId}:${e.modelId}`} is blocked by ${m} while "${t}" is selected — ${ge(t,e.providerId,e.modelId)}`}}function $(e){return Q(e)?{ok:!0,selection:e}:yt(e)}function bt(e,t){if(!t.configured){let n=J();return{ok:!1,error:`unknown model: ${e} (provider "${t.providerId}" is not configured${n.length>0?`; configured: ${n.join(`, `)}`:``})`}}let n=Y(t.modelId,t.providerId);return n?$(n):{ok:!1,error:`unknown model: ${e} (provider "${t.providerId}" does not offer "${t.modelId}")`}}function xt(e,t){let n=J().filter(e=>e!==t);for(let t of[`exact`,`shorthand`]){let r=[];for(let i of n){let n=t===`exact`?e:q(e.toLowerCase(),[i]);if(n===null)continue;let a=Y(n,i,!1);a&&r.push(a)}let i=r.filter(Q);if(i.length===0&&r.length>0)return yt(r[0]);if(i.length===1)return{ok:!0,selection:i[0]};if(i.length>1)return{ok:!1,error:`ambiguous model: ${e} matches ${vt(i)} — qualify it as provider:model`}}return{ok:!1,error:`unknown model: ${e}`}}function St(e){let t=X(e);return t.ok?t.selection.modelId:null}function Ct(e,t){let n=e.match(/\d+/g)?.map(Number)??[],r=t.match(/\d+/g)?.map(Number)??[],i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}export{se as S,Xe as _,z as a,ue as b,Ze as c,V as d,H as f,X as g,G as h,rt as i,k as l,K as m,Je as n,Qe as o,ht as p,M as r,B as s,_e as t,O as u,m as v,he as x,h as y};
|