@puddle-code/cli 0.0.49 → 0.0.51

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.
Files changed (25) hide show
  1. package/CHANGELOG.md +3 -4
  2. package/dist/index.js +7 -4
  3. package/dist/public/assets/{Dashboard-zsMap8E4.js → Dashboard-BVhpOZWL.js} +1 -1
  4. package/dist/public/assets/{EditorTabClose-BKd4KqeO.js → EditorTabClose-BBeGhcin.js} +1 -1
  5. package/dist/public/assets/{LazyTerminal-BCKBws3s.js → LazyTerminal-dobHNDnL.js} +2 -2
  6. package/dist/public/assets/{ModelRefcount-DPfahuWS.js → ModelRefcount-Bh-Gx_um.js} +1 -1
  7. package/dist/public/assets/{PaneEditorBody-BBt1St2c.js → PaneEditorBody-DeInskNr.js} +2 -2
  8. package/dist/public/assets/{SettingsDialog-CfKUNhDh.js → SettingsDialog-B-y1ZE4i.js} +1 -1
  9. package/dist/public/assets/{Terminal-BvUtshI0.js → Terminal-ChnHAaOZ.js} +2 -2
  10. package/dist/public/assets/{Workspace-BSAsXMOL.js → Workspace-DdkhBJEw.js} +3 -3
  11. package/dist/public/assets/{buffer-store-CQmyMib2.js → buffer-store-CtR80J8K.js} +2 -2
  12. package/dist/public/assets/{context-menu-D7fxOw4-.js → context-menu-D2IgAJf3.js} +1 -1
  13. package/dist/public/assets/{cssMode-Ckycpstb.js → cssMode-D0_hzalo.js} +1 -1
  14. package/dist/public/assets/{editor-context-B4vRC3Ax.js → editor-context-ZCl2hgXk.js} +1 -1
  15. package/dist/public/assets/{editor-sync-BDCiPHdG.js → editor-sync-DoqKyrPU.js} +1 -1
  16. package/dist/public/assets/{file-links-C3V-zpk_.js → file-links-Cv4u-85W.js} +1 -1
  17. package/dist/public/assets/{hotkeys-C1l8zghv.js → hotkeys-uS50-PkH.js} +1 -1
  18. package/dist/public/assets/{htmlMode-HGYiSeRc.js → htmlMode-CfxGDG5X.js} +1 -1
  19. package/dist/public/assets/{index-DmwsGjw6.js → index-V87RMkBD.js} +3 -3
  20. package/dist/public/assets/{jsonMode-C-fCnP51.js → jsonMode-BJ8glT_6.js} +1 -1
  21. package/dist/public/assets/{session-seed-BEWxqj6q.js → session-seed-BXfZcX7t.js} +1 -1
  22. package/dist/public/assets/{tsMode-DW4qJ6Fk.js → tsMode-QThqdAds.js} +1 -1
  23. package/dist/public/assets/{use-find-controls-Dqu5qm6L.js → use-find-controls-XCU2T3Mk.js} +1 -1
  24. package/dist/public/index.html +3 -3
  25. package/package.json +1 -1
@@ -70,4 +70,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
70
70
  3. Apply what the rules above settle without asking. Ask the user about anything they leave open, stating trade-offs where relevant (e.g. a symlinked .venv saves gigabytes per worktree, but parallel sessions then share mutable dependency state).
71
71
  4. If the user states a standing rule for all future worktrees ("always…", "never…", "from now on…"), write the complete updated rules to \`.puddle/onboarding-notes.md\` in this worktree — full replacement, user-owned prose; record their decision, don't invent policy.
72
72
 
73
- Then proceed with the task below (or await instructions if none is given).`,_c=`[puddle] You are joining an existing branch and worktree that other agents may be working in concurrently. Files can change underneath you, so re-check the working tree before you act, and avoid disruptive git operations (resetting, force-pushing, or deleting the branch) that would disrupt work already in progress by others.`,vc=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,yc=[[`name`,`the resolved display name: user rename, else agent name, else sequence, else id`],[`title`,`the user rename override only (empty when unset)`],[`agentName`,`the agent's own session name (empty when the agent has not named it)`],[`sequence`,`the terminal-title name the process set (empty when it set none)`],[`branch`,`the git branch`],[`cwd`,`the worktree directory's name`],[`id`,`the first 8 characters of the session id`],[`status`,`the session status (running, waiting_input, …)`],[`agent`,`the agent type (empty for terminal sessions)`],[`separator`,`an em dash that appears only between two non-empty neighbours`]],bc="${name}",xc=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];q({id:fc,name:mc,branch_prefix:H(),icon:H().nullable().default(null),icon_colour:H().nullable().default(null),created_at:X}),q({name:mc,branch_prefix:H().max(64).optional()}),q({name:mc.optional(),branch_prefix:H().max(64).optional(),icon:H().max(64).nullable().optional(),icon_colour:H().max(32).nullable().optional()});var Sc=Os({baseBranch:H().optional(),separateBranch:G().optional(),separateWorktree:G().optional()}),Cc=Os({agent:Sc.optional(),terminal:Sc.optional()});Os({allowSkipPermissions:G().default(!1),captureSessionEnv:G().default(!0),terminalAppShortcuts:G().default(!0),onboardingTemplate:H().optional(),concurrentTemplate:H().optional(),restartTemplate:H().optional(),tabTitleTemplate:H().optional(),projectOrder:K(H()).optional(),sessionDefaults:Cc.optional(),hotkeys:Is(H(),H()).optional()}),Is(H(),Cs());var wc=H().regex(/^untitled-\d+\.md$/);q({name:wc}),q({name:wc,content:H(),mtime_ms:W()}),q({content:H()}),q({mtime_ms:W()}),q({id:Z,profile_id:fc,agent_type:H(),label:H(),config_dir:H(),skip_permissions_default:G(),logged_in:G(),created_at:X}),q({profile_id:fc,agent_type:H().min(1),label:mc,skip_permissions_default:G().optional(),import_dir:H().min(1).optional()}),q({label:mc.optional(),skip_permissions_default:G().optional()}),q({stream:H(),term:H(),hint:H().optional()}),Os({account_id:Z,logged_in:G(),session_count:W().int().nonnegative(),active_session_count:W().int().nonnegative(),last_activity_at:X.nullable(),agent_usage:q({input_tokens:W().int().nonnegative(),output_tokens:W().int().nonnegative(),cache_read_input_tokens:W().int().nonnegative(),cache_creation_input_tokens:W().int().nonnegative(),message_count:W().int().nonnegative()}).nullable(),live_usage:q({captured_at:X,context_used_percentage:W().nullable(),total_cost_usd:W().nullable(),model:H().nullable()}).nullable(),subscription:q({windows:K(q({key:H(),label:H(),used_percentage:W(),resets:H().nullable()}))}).nullable()}),q({id:H(),display_name:H(),capabilities:q({resume:G(),skip_permissions:G()}),binary:H().optional(),available:G().optional()}),q({id:Z,path:H(),default_base_branch:H(),onboarding_notes:H().nullable(),fetch_enabled:G(),last_fetched_at:X.nullable()}).extend({orphan_worktrees:K(H())}),q({path:H().min(1),default_base_branch:H().min(1).optional(),onboarding_notes:H().nullable().optional(),fetch_enabled:G().optional()}),q({branches:K(q({name:H(),is_session:G(),session_title:H().nullable()}))});var Tc=q({path:H(),branch:H().nullable(),is_primary:G(),dirty:G().optional(),local_only:G().optional()}),Ec=q({name:H(),local_only:G()});q({worktrees:K(Tc),orphan_branches:K(Ec)}),q({default_base_branch:H().min(1).optional(),onboarding_notes:H().nullable().optional(),fetch_enabled:G().optional()});var Dc=J([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),Oc=J([`agent`,`terminal`]),kc=q({id:Q,project_id:dc,account_id:Z.nullable(),worktree_path:H(),base_branch:H(),branch:H(),separate_branch:G(),kind:Oc,agent_type:H().nullable(),agent_session_ref:H().nullable(),title:H().nullable(),agent_title:H().nullable().optional(),osc_title:H().nullable().optional(),status:Dc,cwd:H().nullable().optional(),skip_permissions:G(),created_at:X,updated_at:X,last_activity_at:X.nullable(),worktree_missing:G().optional(),stale_running:G().optional(),git_summary:q({ahead:W().int().nonnegative(),behind:W().int().nonnegative(),dirty_files:W().int().nonnegative()}).nullable().optional()});q({project_id:dc,account_id:Z.optional(),kind:Oc.optional(),base_branch:H().min(1).optional(),branch:H().min(1).max(200).optional(),separate_branch:G().optional(),separate_worktree:G().optional(),join_worktree:H().optional(),cwd:H().optional(),title:H().min(1).max(200).optional(),prompt:H().optional(),skip_permissions:G().optional()}),q({title:H().max(200)}),q({account_id:Z}),q({account_id:Z}),q({vars:K(q({name:H(),bytes:W().int().nonnegative()}))}),q({cleared:W().int().nonnegative()}),q({force:G().default(!1),delete_branch:G().default(!1)});var Ac=H().min(1).max(5),jc=q({id:dc,profile_id:fc,repo_id:Z,name:H(),abbrev:Ac.nullable().default(null),archived:G().default(!1),created_at:X,updated_at:X});q({profile_id:fc,repo_id:Z,name:H().min(1).max(100),abbrev:Ac.optional()}),q({name:H().min(1).max(100).optional(),abbrev:Ac.optional(),archived:G().optional()}),q({project:jc,sessions:K(kc)});var Mc=J([`project`,`profile`]);q({id:Z,profile_id:fc,scope:Mc,project_id:dc.nullable(),title:H().nullable(),body:H(),tags:K(H()),agent_type:H().nullable(),position:W(),created_at:X,updated_at:X}),q({profile_id:fc,scope:Mc,project_id:dc.optional(),title:H().max(200).optional(),body:H().min(1),tags:K(H()).optional(),agent_type:H().optional()}),q({scope:Mc.optional(),project_id:dc.nullable().optional(),title:H().max(200).nullable().optional(),body:H().min(1).optional(),tags:K(H()).optional(),agent_type:H().nullable().optional(),position:W().optional()});var Nc=`00000000-0000-0000-0000-000000000000`,Pc=q({session:Q,path:H(),kind:J([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:H().optional(),git_area:J([`staged`,`unstaged`]).optional(),root:H().optional(),view:J([`source`,`preview`,`linked`,`locked`]).optional()}),Fc=Ms(`type`,[q({type:Y(`editor`),tab:Pc}),q({type:Y(`terminal`),session:Q})]),Ic=q({kind:Y(`leaf`),id:H(),tabs:K(Fc).default([]),activeKey:H().nullable().default(null),previewKey:H().nullable().default(null)}),Lc=oc(()=>Ms(`kind`,[Ic,q({kind:Y(`split`),id:H(),direction:J([`row`,`col`]),children:K(Lc),sizes:K(W())})])),Rc=Os({layout_tree:Lc.nullable().default(null),active_session:Q.nullable().default(null),layout_ref:Z.nullable().default(null)}),zc=Os({session_tabs:K(Q).default([]),active_session:Q.nullable().default(null),editor_tabs:K(Pc).default([]),layout:Os({}).default({}),explorer_pin:Q.nullable().default(null),active_editor_tab:Pc.nullable().default(null),explorer_open:G().default(!0),sidebar_mode:J([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:G().default(!1),sessions_collapsed:G().default(!1),right_panel:J([`sessions`,`scratchpad`]).optional(),session_order:K(Q).default([]),layout_tree:Lc.nullable().default(null),layout_mode:J([`profile`,`project`]).optional(),project_layouts:Is(H(),Rc).default({}),layout_ref:Z.nullable().default(null)});q({ui_state:zc}),q({ui_state:zc,updated_at:X});var Bc=J([`project`,`profile`]);q({id:Z,profile_id:fc,scope:Bc,project_id:dc.nullable(),name:H(),layout_tree:Lc.nullable(),active_session:Q.nullable(),created_at:X,updated_at:X}),q({profile_id:fc,scope:Bc,project_id:dc.optional(),name:H().min(1).max(200),layout_tree:Lc.nullable(),active_session:Q.nullable().optional()}),q({name:H().min(1).max(200).optional(),layout_tree:Lc.nullable().optional(),active_session:Q.nullable().optional()});var Vc=J([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);q({mime:Vc,data:H().min(1)}),q({path:H()}),q({path:H(),line:W().int().nullable(),kind:J([`file`,`dir`]).optional(),relative_path:H().optional(),root:H().optional()});var Hc=q({name:H(),type:J([`file`,`dir`,`symlink`]),size:W().int().nonnegative().nullable(),symlink:G().default(!1)});q({path:H(),entries:K(Hc)}),q({path:H(),content:H().nullable(),binary:G(),size:W().int().nonnegative(),mtime_ms:W()}),q({content:H(),expected_mtime_ms:W().optional()}),q({path:H(),mtime_ms:W(),size:W().int().nonnegative()}),q({files:K(q({path:H(),size:W().int().nonnegative()}))}),q({path:H().min(1),kind:J([`file`,`dir`])}),q({from:H().min(1),to:H().min(1)}),q({from:H().min(1),to:H().min(1)}),q({path:H().min(1)}),q({ok:Y(!0),path:H()});var Uc=J([`added`,`modified`,`deleted`,`renamed`]),Wc=J([`staged`,`unstaged`]),Gc=q({path:H(),status:Uc,old_path:H().nullable()});q({against:H(),base_ref:H().nullable(),entries:K(Gc),area:Wc.optional()});var Kc=J([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),qc=q({path:H(),status:Kc});q({entries:K(qc)});var Jc=q({path:H(),status:Kc.exclude([`ignored`]),old_path:H().nullable()});q({repositories:K(q({root:H(),relative_path:H(),name:H(),owning:G(),submodule:G(),initialised:G(),head:H().nullable(),branch:H().nullable(),detached:G(),upstream:H().nullable(),ahead:W().int().nonnegative(),behind:W().int().nonnegative(),has_remote:G(),staged:K(Jc),unstaged:K(Jc),conflicts:K(Jc)})),entries:K(qc)});var Yc=q({repository:H().min(1)});Yc.extend({paths:K(H().min(1)).min(1)}),Yc.extend({message:H().trim().min(1),stage_all:G().optional()}),Yc.extend({set_upstream:G().optional()}),q({ok:Y(!0),sha:H().optional()}),q({path:H(),content:H().nullable(),binary:G(),exists:G()}),q({path:H(),repository:H().nullable(),repository_path:H().nullable(),head:H().nullable(),content:H().nullable(),binary:G(),exists:G(),tracked:G(),ignored:G()}),q({path:H(),ref:H(),content:H().nullable(),binary:G()});var Xc=q({sha:H(),subject:H(),author_name:H(),author_email:H(),authored_at:X,parents:K(H()).optional()});q({commits:K(Xc),has_more:G()}),q({commit:Xc.extend({body:H()}),parents:K(H()),files:K(Gc)});var Zc=q({line:W().int().positive(),text:H()}),Qc=q({path:H(),matches:K(Zc)});q({query:H(),files:K(H()),content:K(Qc),truncated:G()}),q({ports:K(q({port:W().int().min(1).max(65535),pid:W().int(),command:H(),address:H()})),scanned_at:X});var $c=q({status:Y(`refreshing`)}),el=H().regex(/^(agent|shell-[0-9]+)$/),tl=`home`,nl={cols:W().int().min(2).max(1e3),rows:W().int().min(2).max(500)};Ms(`t`,[q({t:Y(`auth`),token:H()}),q({t:Y(`attach`),session:H(),term:el,...nl}),q({t:Y(`stdin`),session:H(),term:el,data:H()}),q({t:Y(`resize`),session:H(),term:el,...nl}),q({t:Y(`detach`),session:H(),term:el}),q({t:Y(`spawn-shell`),session:H()}),q({t:Y(`kill-shell`),session:H(),term:el}),q({t:Y(`subscribe-status`)}),q({t:Y(`theme`),fg:H().regex(/^#[0-9a-fA-F]{6}$/),bg:H().regex(/^#[0-9a-fA-F]{6}$/)})]);var rl=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t,this.name=`ApiError`}};async function $(e,t,n){let r=jt.get(),i=await fetch(t,{method:e,headers:{...r?{authorization:`Bearer ${r}`}:{},...n===void 0?{}:{"content-type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n)});if(i.status===401)throw Nt(),new rl(401,`unauthorised`,`invalid or expired token`);if(i.status!==204){if(!i.ok){let n=uc.safeParse(await i.json().catch(()=>null));throw n.success?new rl(i.status,n.data.error.code,n.data.error.message):new rl(i.status,`unknown`,`${e} ${t} failed with ${i.status}`)}return await i.json()}}function il(){let e=jt.get();return e?{authorization:`Bearer ${e}`}:{}}async function al(e,t,n){let r=await fetch(t,{...n,method:e,headers:{...il(),...n?.headers}});if(r.status===401)throw Nt(),new rl(401,`unauthorised`,`invalid or expired token`);if(!r.ok){let n=uc.safeParse(await r.json().catch(()=>null));throw n.success?new rl(r.status,n.data.error.code,n.data.error.message):new rl(r.status,`unknown`,`${e} ${t} failed with ${r.status}`)}return r}var ol=12,sl=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{sl=!0}),window.addEventListener(`blur`,()=>{sl=!1}),a.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function cl(e){return()=>sl?e:e*ol}function ll(){return O({queryKey:[`profiles`],queryFn:()=>$(`GET`,`/api/profiles`)})}function ul(e){return O({queryKey:[`profile-settings`,e],queryFn:()=>$(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function dl(e){return O({queryKey:[`accounts`,e],queryFn:()=>$(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function fl(e){return O({queryKey:[`account-usage`,e],queryFn:()=>$(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function pl(){return O({queryKey:[`repos`],queryFn:()=>$(`GET`,`/api/repos`)})}function ml(e,t=!0){return O({queryKey:[`projects`,e??`all`],queryFn:()=>$(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function hl(e){return O({queryKey:[`project`,e],queryFn:()=>$(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function gl(e){return O({queryKey:[`sessions`,e],queryFn:()=>$(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var _l={queryKey:[`sessions`,`all`],queryFn:()=>$(`GET`,`/api/sessions`)};function vl(e=!0){return O({..._l,enabled:e})}function yl(e){return e.fetchQuery(_l)}function bl(){return O({queryKey:[`config`],queryFn:()=>$(`GET`,`/api/config`)})}function xl(e){return O({queryKey:[`repo-branches`,e],queryFn:()=>$(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function Sl(e){return O({queryKey:[`repo-worktrees`,e],queryFn:()=>$(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:1e4})}function Cl(e,t){let n=D();return k({mutationFn:t=>$(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function wl(e,t){let n=D();return k({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),$(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function Tl(e){return O({queryKey:[`fs-dirs`,e],queryFn:()=>$(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function El(){return O({queryKey:[`version`],queryFn:()=>$(`GET`,`/api/version`),staleTime:1/0})}function Dl(){return O({queryKey:[`host`],queryFn:()=>$(`GET`,`/api/host`),staleTime:1/0})}function Ol(e){return e?e.displayName||e.hostname:void 0}function kl(){return O({queryKey:[`agents`],queryFn:()=>$(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function Al(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function jl(e){let t=D();return k({mutationFn:t=>$(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function Ml(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function Nl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function Pl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function Fl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function Il(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function Ll(){return k({mutationFn:e=>$(`POST`,`/api/accounts/${e}/login`)})}function Rl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function zl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Bl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Vl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Hl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/projects/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Ul(e,t){return O({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>$(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Wl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Gl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Kl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function ql(e,t){return O({queryKey:[`layouts`,e,t??`none`],queryFn:()=>$(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Jl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Yl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Xl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Zl(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Ql(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/sessions`,e),onSuccess:t=>Zl(e,t)})}function $l(e){let t=D();return k({mutationFn:t=>$(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>Zl(t,e)})}function eu(){let e=D();return k({mutationFn:({sessionId:e,accountId:t})=>$(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>Zl(e,t)})}function tu(){let e=D();return k({mutationFn:({sessionId:e,accountId:t})=>$(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{Zl(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function nu(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>Zl(e,t)})}function ru(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>Zl(e,t)})}function iu(){let e=D();return k({mutationFn:({sessionId:e,title:t})=>$(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>Zl(e,t)})}function au(){let e=D();return k({mutationFn:e=>$(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function ou(e){try{return await $(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function su(e,t){return $(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function cu(e,t){return O({queryKey:[`ports`,e],queryFn:()=>$(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:cl(5e3),refetchIntervalInBackground:!1})}function lu(e,t){return O({queryKey:[`session-env`,e],queryFn:()=>$(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:cl(5e3),refetchIntervalInBackground:!1})}function uu(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var du=At(`puddle.profile-id`);function fu(){let e=(0,T.useSyncExternalStore)(du.subscribe,du.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function pu(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),du.set(e)}function mu(){return window.puddleDesktop}function hu(){let[e,t]=(0,T.useState)({fullScreen:!1,animate:!1});return(0,T.useEffect)(()=>{let e=mu();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var gu=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],_u=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],vu=new Map(_u.map(e=>[e.id,e])),yu=typeof window<`u`&&mu()!==void 0;function bu(e,t=yu){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function xu(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var Su={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},Cu={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function wu(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):Cu[e]??e}function Tu(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>Su[e]??e).join(``)+wu(n)}var Eu=new Map;function Du(e,t){return Eu.set(e,t),()=>{Eu.get(e)===t&&Eu.delete(e)}}var Ou=e=>Eu.get(e),ku=e=>vu.get(e);function Au(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var ju={},Mu=new Set,Nu=Pu();function Pu(){let e={};for(let t of _u)e[t.id]=ju[t.id]||bu(t);return e}function Fu(e){ju=e??{},Nu=Pu(),Mu.forEach(e=>e())}var Iu=e=>Nu[e]??``;function Lu(e){for(let[t,n]of Object.entries(Nu))if(n===e)return t}function Ru(e){return Tu(zu()[e]??``)}function zu(){return(0,T.useSyncExternalStore)(e=>(Mu.add(e),()=>Mu.delete(e)),()=>Nu)}export{Ml as $,he as $t,Il as A,hc as At,Xl as B,kt as Bt,fl as C,il as Ct,nu as D,Nc as Dt,vl as E,Vc as Et,Wl as F,xc as Ft,tu as G,Ve as Gt,Kl as H,k as Ht,Ql as I,yc as It,Ll as J,Ae as Jt,Dl as K,D as Kt,El as L,Mt as Lt,Al as M,gc as Mt,Vl as N,vc as Nt,uu as O,Fc as Ot,Rl as P,bc as Pt,Yl as Q,ge as Qt,Fl as R,jt as Rt,su as S,al as St,kl as T,$c as Tt,Tl as U,O as Ut,Pl as V,ht as Vt,Bl as W,et as Wt,Nl as X,w as Xt,eu as Y,Ee as Yt,au as Z,Te as Zt,pu as _,gl as _t,Tu as a,u as an,ll as at,ou as b,rl as bt,Iu as c,le as cn,Cl as ct,Fu as d,Sl as dt,d as en,jl as et,bu as f,pl as ft,du as g,cu as gt,hu as h,lu as ht,xu as i,g as in,ul as it,Jl as j,_c as jt,bl as k,zc as kt,Au as l,a as ln,iu as lt,mu as m,$l as mt,gu as n,te as nn,zl as nt,ku as o,ne as on,hl as ot,Ru as p,Ul as pt,ql as q,Le as qt,Lu as r,ee as rn,Gl as rt,Ou as s,m as sn,ml as st,_u as t,_ as tn,Hl as tt,Du as u,i as un,xl as ut,fu as v,ru as vt,dl as w,tl as wt,Ol as x,$ as xt,yl as y,cl as yt,wl as z,At as zt};
73
+ Then proceed with the task below (or await instructions if none is given).`,_c=`[puddle] You are joining an existing branch and worktree that other agents may be working in concurrently. Files can change underneath you, so re-check the working tree before you act, and avoid disruptive git operations (resetting, force-pushing, or deleting the branch) that would disrupt work already in progress by others.`,vc=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,yc=[[`name`,`the resolved display name: user rename, else agent name, else sequence, else id`],[`title`,`the user rename override only (empty when unset)`],[`agentName`,`the agent's own session name (empty when the agent has not named it)`],[`sequence`,`the terminal-title name the process set (empty when it set none)`],[`branch`,`the git branch`],[`cwd`,`the worktree directory's name`],[`id`,`the first 8 characters of the session id`],[`status`,`the session status (running, waiting_input, …)`],[`agent`,`the agent type (empty for terminal sessions)`],[`separator`,`an em dash that appears only between two non-empty neighbours`]],bc="${name}",xc=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];q({id:fc,name:mc,branch_prefix:H(),icon:H().nullable().default(null),icon_colour:H().nullable().default(null),created_at:X}),q({name:mc,branch_prefix:H().max(64).optional()}),q({name:mc.optional(),branch_prefix:H().max(64).optional(),icon:H().max(64).nullable().optional(),icon_colour:H().max(32).nullable().optional()});var Sc=Os({baseBranch:H().optional(),separateBranch:G().optional(),separateWorktree:G().optional()}),Cc=Os({agent:Sc.optional(),terminal:Sc.optional()});Os({allowSkipPermissions:G().default(!1),captureSessionEnv:G().default(!0),terminalAppShortcuts:G().default(!0),onboardingTemplate:H().optional(),concurrentTemplate:H().optional(),restartTemplate:H().optional(),tabTitleTemplate:H().optional(),projectOrder:K(H()).optional(),sessionDefaults:Cc.optional(),hotkeys:Is(H(),H()).optional()}),Is(H(),Cs());var wc=H().regex(/^untitled-\d+\.md$/);q({name:wc}),q({name:wc,content:H(),mtime_ms:W()}),q({content:H()}),q({mtime_ms:W()}),q({id:Z,profile_id:fc,agent_type:H(),label:H(),config_dir:H(),skip_permissions_default:G(),logged_in:G(),created_at:X}),q({profile_id:fc,agent_type:H().min(1),label:mc,skip_permissions_default:G().optional(),import_dir:H().min(1).optional()}),q({label:mc.optional(),skip_permissions_default:G().optional()}),q({stream:H(),term:H(),hint:H().optional()}),Os({account_id:Z,logged_in:G(),session_count:W().int().nonnegative(),active_session_count:W().int().nonnegative(),last_activity_at:X.nullable(),agent_usage:q({input_tokens:W().int().nonnegative(),output_tokens:W().int().nonnegative(),cache_read_input_tokens:W().int().nonnegative(),cache_creation_input_tokens:W().int().nonnegative(),message_count:W().int().nonnegative()}).nullable(),live_usage:q({captured_at:X,context_used_percentage:W().nullable(),total_cost_usd:W().nullable(),model:H().nullable()}).nullable(),subscription:q({windows:K(q({key:H(),label:H(),used_percentage:W(),resets:H().nullable()}))}).nullable()}),q({id:H(),display_name:H(),capabilities:q({resume:G(),skip_permissions:G()}),binary:H().optional(),available:G().optional()}),q({id:Z,path:H(),default_base_branch:H(),onboarding_notes:H().nullable(),fetch_enabled:G(),last_fetched_at:X.nullable()}).extend({orphan_worktrees:K(H())}),q({path:H().min(1),default_base_branch:H().min(1).optional(),onboarding_notes:H().nullable().optional(),fetch_enabled:G().optional()}),q({branches:K(q({name:H(),is_session:G(),session_title:H().nullable()}))});var Tc=q({path:H(),branch:H().nullable(),is_primary:G(),dirty:G().optional(),local_only:G().optional()}),Ec=q({name:H(),local_only:G()});q({worktrees:K(Tc),orphan_branches:K(Ec)}),q({default_base_branch:H().min(1).optional(),onboarding_notes:H().nullable().optional(),fetch_enabled:G().optional()});var Dc=J([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),Oc=J([`agent`,`terminal`]),kc=q({id:Q,project_id:dc,account_id:Z.nullable(),worktree_path:H(),base_branch:H(),branch:H(),separate_branch:G(),kind:Oc,agent_type:H().nullable(),agent_session_ref:H().nullable(),title:H().nullable(),agent_title:H().nullable().optional(),osc_title:H().nullable().optional(),status:Dc,cwd:H().nullable().optional(),skip_permissions:G(),created_at:X,updated_at:X,last_activity_at:X.nullable(),worktree_missing:G().optional(),stale_running:G().optional(),git_summary:q({ahead:W().int().nonnegative(),behind:W().int().nonnegative(),dirty_files:W().int().nonnegative()}).nullable().optional()});q({project_id:dc,account_id:Z.optional(),kind:Oc.optional(),base_branch:H().min(1).optional(),branch:H().min(1).max(200).optional(),separate_branch:G().optional(),separate_worktree:G().optional(),join_worktree:H().optional(),cwd:H().optional(),title:H().min(1).max(200).optional(),prompt:H().optional(),skip_permissions:G().optional()}),q({title:H().max(200)}),q({account_id:Z}),q({account_id:Z}),q({vars:K(q({name:H(),bytes:W().int().nonnegative(),value:H().optional()}))}),q({cleared:W().int().nonnegative()}),q({force:G().default(!1),delete_branch:G().default(!1)});var Ac=H().min(1).max(5),jc=q({id:dc,profile_id:fc,repo_id:Z,name:H(),abbrev:Ac.nullable().default(null),archived:G().default(!1),created_at:X,updated_at:X});q({profile_id:fc,repo_id:Z,name:H().min(1).max(100),abbrev:Ac.optional()}),q({name:H().min(1).max(100).optional(),abbrev:Ac.optional(),archived:G().optional()}),q({project:jc,sessions:K(kc)});var Mc=J([`project`,`profile`]);q({id:Z,profile_id:fc,scope:Mc,project_id:dc.nullable(),title:H().nullable(),body:H(),tags:K(H()),agent_type:H().nullable(),position:W(),created_at:X,updated_at:X}),q({profile_id:fc,scope:Mc,project_id:dc.optional(),title:H().max(200).optional(),body:H().min(1),tags:K(H()).optional(),agent_type:H().optional()}),q({scope:Mc.optional(),project_id:dc.nullable().optional(),title:H().max(200).nullable().optional(),body:H().min(1).optional(),tags:K(H()).optional(),agent_type:H().nullable().optional(),position:W().optional()});var Nc=`00000000-0000-0000-0000-000000000000`,Pc=q({session:Q,path:H(),kind:J([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:H().optional(),git_area:J([`staged`,`unstaged`]).optional(),root:H().optional(),view:J([`source`,`preview`,`linked`,`locked`]).optional()}),Fc=Ms(`type`,[q({type:Y(`editor`),tab:Pc}),q({type:Y(`terminal`),session:Q})]),Ic=q({kind:Y(`leaf`),id:H(),tabs:K(Fc).default([]),activeKey:H().nullable().default(null),previewKey:H().nullable().default(null)}),Lc=oc(()=>Ms(`kind`,[Ic,q({kind:Y(`split`),id:H(),direction:J([`row`,`col`]),children:K(Lc),sizes:K(W())})])),Rc=Os({layout_tree:Lc.nullable().default(null),active_session:Q.nullable().default(null),layout_ref:Z.nullable().default(null)}),zc=Os({session_tabs:K(Q).default([]),active_session:Q.nullable().default(null),editor_tabs:K(Pc).default([]),layout:Os({}).default({}),explorer_pin:Q.nullable().default(null),active_editor_tab:Pc.nullable().default(null),explorer_open:G().default(!0),sidebar_mode:J([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:G().default(!1),sessions_collapsed:G().default(!1),right_panel:J([`sessions`,`scratchpad`]).optional(),session_order:K(Q).default([]),layout_tree:Lc.nullable().default(null),layout_mode:J([`profile`,`project`]).optional(),project_layouts:Is(H(),Rc).default({}),layout_ref:Z.nullable().default(null)});q({ui_state:zc}),q({ui_state:zc,updated_at:X});var Bc=J([`project`,`profile`]);q({id:Z,profile_id:fc,scope:Bc,project_id:dc.nullable(),name:H(),layout_tree:Lc.nullable(),active_session:Q.nullable(),created_at:X,updated_at:X}),q({profile_id:fc,scope:Bc,project_id:dc.optional(),name:H().min(1).max(200),layout_tree:Lc.nullable(),active_session:Q.nullable().optional()}),q({name:H().min(1).max(200).optional(),layout_tree:Lc.nullable().optional(),active_session:Q.nullable().optional()});var Vc=J([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);q({mime:Vc,data:H().min(1)}),q({path:H()}),q({path:H(),line:W().int().nullable(),kind:J([`file`,`dir`]).optional(),relative_path:H().optional(),root:H().optional()});var Hc=q({name:H(),type:J([`file`,`dir`,`symlink`]),size:W().int().nonnegative().nullable(),symlink:G().default(!1)});q({path:H(),entries:K(Hc)}),q({path:H(),content:H().nullable(),binary:G(),size:W().int().nonnegative(),mtime_ms:W()}),q({content:H(),expected_mtime_ms:W().optional()}),q({path:H(),mtime_ms:W(),size:W().int().nonnegative()}),q({files:K(q({path:H(),size:W().int().nonnegative()}))}),q({path:H().min(1),kind:J([`file`,`dir`])}),q({from:H().min(1),to:H().min(1)}),q({from:H().min(1),to:H().min(1)}),q({path:H().min(1)}),q({ok:Y(!0),path:H()});var Uc=J([`added`,`modified`,`deleted`,`renamed`]),Wc=J([`staged`,`unstaged`]),Gc=q({path:H(),status:Uc,old_path:H().nullable()});q({against:H(),base_ref:H().nullable(),entries:K(Gc),area:Wc.optional()});var Kc=J([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),qc=q({path:H(),status:Kc});q({entries:K(qc)});var Jc=q({path:H(),status:Kc.exclude([`ignored`]),old_path:H().nullable()});q({repositories:K(q({root:H(),relative_path:H(),name:H(),owning:G(),submodule:G(),initialised:G(),head:H().nullable(),branch:H().nullable(),detached:G(),upstream:H().nullable(),ahead:W().int().nonnegative(),behind:W().int().nonnegative(),has_remote:G(),staged:K(Jc),unstaged:K(Jc),conflicts:K(Jc)})),entries:K(qc)});var Yc=q({repository:H().min(1)});Yc.extend({paths:K(H().min(1)).min(1)}),Yc.extend({message:H().trim().min(1),stage_all:G().optional()}),Yc.extend({set_upstream:G().optional()}),q({ok:Y(!0),sha:H().optional()}),q({path:H(),content:H().nullable(),binary:G(),exists:G()}),q({path:H(),repository:H().nullable(),repository_path:H().nullable(),head:H().nullable(),content:H().nullable(),binary:G(),exists:G(),tracked:G(),ignored:G()}),q({path:H(),ref:H(),content:H().nullable(),binary:G()});var Xc=q({sha:H(),subject:H(),author_name:H(),author_email:H(),authored_at:X,parents:K(H()).optional()});q({commits:K(Xc),has_more:G()}),q({commit:Xc.extend({body:H()}),parents:K(H()),files:K(Gc)});var Zc=q({line:W().int().positive(),text:H()}),Qc=q({path:H(),matches:K(Zc)});q({query:H(),files:K(H()),content:K(Qc),truncated:G()}),q({ports:K(q({port:W().int().min(1).max(65535),pid:W().int(),command:H(),address:H()})),scanned_at:X});var $c=q({status:Y(`refreshing`)}),el=H().regex(/^(agent|shell-[0-9]+)$/),tl=`home`,nl={cols:W().int().min(2).max(1e3),rows:W().int().min(2).max(500)};Ms(`t`,[q({t:Y(`auth`),token:H()}),q({t:Y(`attach`),session:H(),term:el,...nl}),q({t:Y(`stdin`),session:H(),term:el,data:H()}),q({t:Y(`resize`),session:H(),term:el,...nl}),q({t:Y(`detach`),session:H(),term:el}),q({t:Y(`spawn-shell`),session:H()}),q({t:Y(`kill-shell`),session:H(),term:el}),q({t:Y(`subscribe-status`)}),q({t:Y(`theme`),fg:H().regex(/^#[0-9a-fA-F]{6}$/),bg:H().regex(/^#[0-9a-fA-F]{6}$/)})]);var rl=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t,this.name=`ApiError`}};async function $(e,t,n){let r=jt.get(),i=await fetch(t,{method:e,headers:{...r?{authorization:`Bearer ${r}`}:{},...n===void 0?{}:{"content-type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n)});if(i.status===401)throw Nt(),new rl(401,`unauthorised`,`invalid or expired token`);if(i.status!==204){if(!i.ok){let n=uc.safeParse(await i.json().catch(()=>null));throw n.success?new rl(i.status,n.data.error.code,n.data.error.message):new rl(i.status,`unknown`,`${e} ${t} failed with ${i.status}`)}return await i.json()}}function il(){let e=jt.get();return e?{authorization:`Bearer ${e}`}:{}}async function al(e,t,n){let r=await fetch(t,{...n,method:e,headers:{...il(),...n?.headers}});if(r.status===401)throw Nt(),new rl(401,`unauthorised`,`invalid or expired token`);if(!r.ok){let n=uc.safeParse(await r.json().catch(()=>null));throw n.success?new rl(r.status,n.data.error.code,n.data.error.message):new rl(r.status,`unknown`,`${e} ${t} failed with ${r.status}`)}return r}var ol=12,sl=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{sl=!0}),window.addEventListener(`blur`,()=>{sl=!1}),a.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function cl(e){return()=>sl?e:e*ol}function ll(){return O({queryKey:[`profiles`],queryFn:()=>$(`GET`,`/api/profiles`)})}function ul(e){return O({queryKey:[`profile-settings`,e],queryFn:()=>$(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function dl(e){return O({queryKey:[`accounts`,e],queryFn:()=>$(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function fl(e){return O({queryKey:[`account-usage`,e],queryFn:()=>$(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function pl(){return O({queryKey:[`repos`],queryFn:()=>$(`GET`,`/api/repos`)})}function ml(e,t=!0){return O({queryKey:[`projects`,e??`all`],queryFn:()=>$(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function hl(e){return O({queryKey:[`project`,e],queryFn:()=>$(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function gl(e){return O({queryKey:[`sessions`,e],queryFn:()=>$(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var _l={queryKey:[`sessions`,`all`],queryFn:()=>$(`GET`,`/api/sessions`)};function vl(e=!0){return O({..._l,enabled:e})}function yl(e){return e.fetchQuery(_l)}function bl(){return O({queryKey:[`config`],queryFn:()=>$(`GET`,`/api/config`)})}function xl(e){return O({queryKey:[`repo-branches`,e],queryFn:()=>$(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function Sl(e){return O({queryKey:[`repo-worktrees`,e],queryFn:()=>$(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:1e4})}function Cl(e,t){let n=D();return k({mutationFn:t=>$(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function wl(e,t){let n=D();return k({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),$(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function Tl(e){return O({queryKey:[`fs-dirs`,e],queryFn:()=>$(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function El(){return O({queryKey:[`version`],queryFn:()=>$(`GET`,`/api/version`),staleTime:1/0})}function Dl(){return O({queryKey:[`host`],queryFn:()=>$(`GET`,`/api/host`),staleTime:1/0})}function Ol(e){return e?e.displayName||e.hostname:void 0}function kl(){return O({queryKey:[`agents`],queryFn:()=>$(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function Al(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function jl(e){let t=D();return k({mutationFn:t=>$(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function Ml(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function Nl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function Pl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function Fl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function Il(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function Ll(){return k({mutationFn:e=>$(`POST`,`/api/accounts/${e}/login`)})}function Rl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function zl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Bl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Vl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Hl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/projects/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Ul(e,t){return O({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>$(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Wl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Gl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Kl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function ql(e,t){return O({queryKey:[`layouts`,e,t??`none`],queryFn:()=>$(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Jl(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Yl(){let e=D();return k({mutationFn:({id:e,...t})=>$(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Xl(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Zl(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Ql(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/sessions`,e),onSuccess:t=>Zl(e,t)})}function $l(e){let t=D();return k({mutationFn:t=>$(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>Zl(t,e)})}function eu(){let e=D();return k({mutationFn:({sessionId:e,accountId:t})=>$(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>Zl(e,t)})}function tu(){let e=D();return k({mutationFn:({sessionId:e,accountId:t})=>$(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{Zl(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function nu(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>Zl(e,t)})}function ru(){let e=D();return k({mutationFn:e=>$(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>Zl(e,t)})}function iu(){let e=D();return k({mutationFn:({sessionId:e,title:t})=>$(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>Zl(e,t)})}function au(){let e=D();return k({mutationFn:e=>$(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function ou(e){try{return await $(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function su(e,t){return $(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function cu(e,t){return O({queryKey:[`ports`,e],queryFn:()=>$(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:cl(5e3),refetchIntervalInBackground:!1})}function lu(e,t){return O({queryKey:[`session-env`,e],queryFn:()=>$(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:cl(5e3),refetchIntervalInBackground:!1})}function uu(){let e=D();return k({mutationFn:e=>$(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var du=At(`puddle.profile-id`);function fu(){let e=(0,T.useSyncExternalStore)(du.subscribe,du.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function pu(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),du.set(e)}function mu(){return window.puddleDesktop}function hu(){let[e,t]=(0,T.useState)({fullScreen:!1,animate:!1});return(0,T.useEffect)(()=>{let e=mu();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var gu=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],_u=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],vu=new Map(_u.map(e=>[e.id,e])),yu=typeof window<`u`&&mu()!==void 0;function bu(e,t=yu){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function xu(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var Su={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},Cu={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function wu(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):Cu[e]??e}function Tu(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>Su[e]??e).join(``)+wu(n)}var Eu=new Map;function Du(e,t){return Eu.set(e,t),()=>{Eu.get(e)===t&&Eu.delete(e)}}var Ou=e=>Eu.get(e),ku=e=>vu.get(e);function Au(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var ju={},Mu=new Set,Nu=Pu();function Pu(){let e={};for(let t of _u)e[t.id]=ju[t.id]||bu(t);return e}function Fu(e){ju=e??{},Nu=Pu(),Mu.forEach(e=>e())}var Iu=e=>Nu[e]??``;function Lu(e){for(let[t,n]of Object.entries(Nu))if(n===e)return t}function Ru(e){return Tu(zu()[e]??``)}function zu(){return(0,T.useSyncExternalStore)(e=>(Mu.add(e),()=>Mu.delete(e)),()=>Nu)}export{Ml as $,he as $t,Il as A,hc as At,Xl as B,kt as Bt,fl as C,il as Ct,nu as D,Nc as Dt,vl as E,Vc as Et,Wl as F,xc as Ft,tu as G,Ve as Gt,Kl as H,k as Ht,Ql as I,yc as It,Ll as J,Ae as Jt,Dl as K,D as Kt,El as L,Mt as Lt,Al as M,gc as Mt,Vl as N,vc as Nt,uu as O,Fc as Ot,Rl as P,bc as Pt,Yl as Q,ge as Qt,Fl as R,jt as Rt,su as S,al as St,kl as T,$c as Tt,Tl as U,O as Ut,Pl as V,ht as Vt,Bl as W,et as Wt,Nl as X,w as Xt,eu as Y,Ee as Yt,au as Z,Te as Zt,pu as _,gl as _t,Tu as a,u as an,ll as at,ou as b,rl as bt,Iu as c,le as cn,Cl as ct,Fu as d,Sl as dt,d as en,jl as et,bu as f,pl as ft,du as g,cu as gt,hu as h,lu as ht,xu as i,g as in,ul as it,Jl as j,_c as jt,bl as k,zc as kt,Au as l,a as ln,iu as lt,mu as m,$l as mt,gu as n,te as nn,zl as nt,ku as o,ne as on,hl as ot,Ru as p,Ul as pt,ql as q,Le as qt,Lu as r,ee as rn,Gl as rt,Ou as s,m as sn,ml as st,_u as t,_ as tn,Hl as tt,Du as u,i as un,xl as ut,fu as v,ru as vt,dl as w,tl as wt,Ol as x,$ as xt,yl as y,cl as yt,wl as z,At as zt};
@@ -1 +1 @@
1
- import{h as e}from"./editor.api2-4X9Vh9Zw.js";import{m as t}from"./buffer-store-CQmyMib2.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-x2nWJpem.js";var b=120*1e3,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/html/htmlWorker`,createWorker:()=>new Worker(new URL(`/assets/html.worker-DSJ9zmd7.js`,``+import.meta.url),{type:`module`}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}},S=class extends _{constructor(e){super(e,[`.`,`:`,`<`,`"`,`=`,`/`])}};function C(t){let n=new x(t),o=(...e)=>n.getLanguageServiceWorker(...e),s=t.languageId;e.registerCompletionItemProvider(s,new S(o)),e.registerHoverProvider(s,new a(o)),e.registerDocumentHighlightProvider(s,new p(o)),e.registerLinkProvider(s,new g(o)),e.registerFoldingRangeProvider(s,new v(o)),e.registerDocumentSymbolProvider(s,new u(o)),e.registerSelectionRangeProvider(s,new d(o)),e.registerRenameProvider(s,new m(o)),s===`html`&&(e.registerDocumentFormattingEditProvider(s,new r(o)),e.registerDocumentRangeFormattingEditProvider(s,new i(o)))}function w(t){let n=[],o=[],s=new x(t);n.push(s);let c=(...e)=>s.getLanguageServiceWorker(...e);function l(){let{languageId:n,modeConfiguration:s}=t;E(o),s.completionItems&&o.push(e.registerCompletionItemProvider(n,new S(c))),s.hovers&&o.push(e.registerHoverProvider(n,new a(c))),s.documentHighlights&&o.push(e.registerDocumentHighlightProvider(n,new p(c))),s.links&&o.push(e.registerLinkProvider(n,new g(c))),s.documentSymbols&&o.push(e.registerDocumentSymbolProvider(n,new u(c))),s.rename&&o.push(e.registerRenameProvider(n,new m(c))),s.foldingRanges&&o.push(e.registerFoldingRangeProvider(n,new v(c))),s.selectionRanges&&o.push(e.registerSelectionRangeProvider(n,new d(c))),s.documentFormattingEdits&&o.push(e.registerDocumentFormattingEditProvider(n,new r(c))),s.documentRangeFormattingEdits&&o.push(e.registerDocumentRangeFormattingEditProvider(n,new i(c)))}return l(),n.push(T(o)),T(n)}function T(e){return{dispose:()=>E(e)}}function E(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,w as setupMode,C as setupMode1,n as toRange,y as toTextEdit};
1
+ import{h as e}from"./editor.api2-4X9Vh9Zw.js";import{m as t}from"./buffer-store-CtR80J8K.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-x2nWJpem.js";var b=120*1e3,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/html/htmlWorker`,createWorker:()=>new Worker(new URL(`/assets/html.worker-DSJ9zmd7.js`,``+import.meta.url),{type:`module`}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}},S=class extends _{constructor(e){super(e,[`.`,`:`,`<`,`"`,`=`,`/`])}};function C(t){let n=new x(t),o=(...e)=>n.getLanguageServiceWorker(...e),s=t.languageId;e.registerCompletionItemProvider(s,new S(o)),e.registerHoverProvider(s,new a(o)),e.registerDocumentHighlightProvider(s,new p(o)),e.registerLinkProvider(s,new g(o)),e.registerFoldingRangeProvider(s,new v(o)),e.registerDocumentSymbolProvider(s,new u(o)),e.registerSelectionRangeProvider(s,new d(o)),e.registerRenameProvider(s,new m(o)),s===`html`&&(e.registerDocumentFormattingEditProvider(s,new r(o)),e.registerDocumentRangeFormattingEditProvider(s,new i(o)))}function w(t){let n=[],o=[],s=new x(t);n.push(s);let c=(...e)=>s.getLanguageServiceWorker(...e);function l(){let{languageId:n,modeConfiguration:s}=t;E(o),s.completionItems&&o.push(e.registerCompletionItemProvider(n,new S(c))),s.hovers&&o.push(e.registerHoverProvider(n,new a(c))),s.documentHighlights&&o.push(e.registerDocumentHighlightProvider(n,new p(c))),s.links&&o.push(e.registerLinkProvider(n,new g(c))),s.documentSymbols&&o.push(e.registerDocumentSymbolProvider(n,new u(c))),s.rename&&o.push(e.registerRenameProvider(n,new m(c))),s.foldingRanges&&o.push(e.registerFoldingRangeProvider(n,new v(c))),s.selectionRanges&&o.push(e.registerSelectionRangeProvider(n,new d(c))),s.documentFormattingEdits&&o.push(e.registerDocumentFormattingEditProvider(n,new r(c))),s.documentRangeFormattingEdits&&o.push(e.registerDocumentRangeFormattingEditProvider(n,new i(c)))}return l(),n.push(T(o)),T(n)}function T(e){return{dispose:()=>E(e)}}function E(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,w as setupMode,C as setupMode1,n as toRange,y as toTextEdit};