@openchamber/web 2.0.2 → 2.0.4
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/bin/lib/DOCUMENTATION.md +1 -1
- package/bin/lib/commands-connect-url.js +6 -5
- package/bin/lib/commands-tunnel.js +24 -5
- package/dist/assets/{CodeMirrorCommentWidgets-CmKmyb9T.js → CodeMirrorCommentWidgets-C_zL-eri.js} +1 -1
- package/dist/assets/{DiffView-8-PFpZ2p.js → DiffView-BeN2_YYF.js} +3 -3
- package/dist/assets/FilesView-CN34wm_N.js +17 -0
- package/dist/assets/{GitView-DNUSu00w.js → GitView-DLDazOo1.js} +4 -4
- package/dist/assets/{GuestAttachDialog-Cv6QzjHC.js → GuestAttachDialog-C0xe_Lyy.js} +1 -1
- package/dist/assets/{GuestSurfacePane-Bt3jB_Ye.js → GuestSurfacePane-BdaurnDr.js} +1 -1
- package/dist/assets/{JsonTreeView-BlyHTRhM.js → JsonTreeView-B1Xq-k2t.js} +1 -1
- package/dist/assets/LinearIssuesView-BryoAHow.js +1 -0
- package/dist/assets/{MarkdownImageGallery-2UXJF-5B.js → MarkdownImageGallery-DfuEoaGq.js} +1 -1
- package/dist/assets/MarkdownRendererImpl-B_ZcWOvX.js +12 -0
- package/dist/assets/OnboardingScreen-C22bGmnP.js +1 -0
- package/dist/assets/{PatchDiff-ByvnbG5T.js → PatchDiff-0xd6UeFB.js} +1 -1
- package/dist/assets/{PierreDiffViewer-BXieg0mH.js → PierreDiffViewer-BC950e3F.js} +3 -3
- package/dist/assets/PlanView-B7Xgihqk.js +5 -0
- package/dist/assets/PluginPane-2C71F8uF.js +3 -0
- package/dist/assets/SettingsView-m_zoFiaT.js +30 -0
- package/dist/assets/{SettingsWindow-BIz224xs.js → SettingsWindow-CofS020b.js} +1 -1
- package/dist/assets/{SubmoduleDiffSummary-CXKmlps9.js → SubmoduleDiffSummary-BSA9gnIO.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BsgAK8xu.js → ToolOutputDialog-DprkVKcj.js} +7 -7
- package/dist/assets/{ToolPartDiffPreview-vdPObXOf.js → ToolPartDiffPreview-Dq0go_fX.js} +2 -2
- package/dist/assets/{VirtualizedFileDiff-BkFNKWS5.js → VirtualizedFileDiff-Kp8hKJdT.js} +1 -1
- package/dist/assets/WalkthroughView-DGnTzqIU.js +4 -0
- package/dist/assets/{appThemeRegistry-aHUNHoqP.js → appThemeRegistry-BdEHBA4s.js} +1 -1
- package/dist/assets/{commitAndPush-Bon9r94r.js → commitAndPush-LwtVa2Oc.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-DKqr_1AQ.js → computeVirtualFileMetrics-6V1xNpO9.js} +2 -2
- package/dist/assets/de-DlgBHUAI.js +10 -0
- package/dist/assets/es-BC8G41U8.js +16 -0
- package/dist/assets/fr-I0z3vVjy.js +14 -0
- package/dist/assets/index-CgR5rJq_.js +41 -0
- package/dist/assets/{index-DpFttslC.js → index-CmNPYddV.js} +1 -1
- package/dist/assets/index-adyy_sEk.css +1 -0
- package/dist/assets/{isDiffPlainText-kzAgpIgi.js → isDiffPlainText-1bXcWCrw.js} +1 -1
- package/dist/assets/{isFilePlainText-Uj6y-jzz.js → isFilePlainText-CBAppvy1.js} +1 -1
- package/dist/assets/ja-BIElEsY8.js +16 -0
- package/dist/assets/ko-DRnnHetA.js +16 -0
- package/dist/assets/{main-CbfMxn-I.js → main-CzjTMTfW.js} +2 -2
- package/dist/assets/main-DVX34beR.js +886 -0
- package/dist/assets/markdownCore-Cxbkn5NR.js +7 -0
- package/dist/assets/{miniChat-CiAKBC10.js → miniChat-CP68IL8Q.js} +2 -2
- package/dist/assets/{mobile-CsT4sJwC.js → mobile-BrlBrNfZ.js} +2 -2
- package/dist/assets/nl-DzUV-kwp.js +16 -0
- package/dist/assets/{patchFileDiff-DeaE08W0.js → patchFileDiff-pqRSHLHI.js} +2 -2
- package/dist/assets/pl-Bb-cb7k7.js +16 -0
- package/dist/assets/pt-BR-CyIWrTcE.js +16 -0
- package/dist/assets/renderElectronMiniChatApp-DKIilR7N.js +2 -0
- package/dist/assets/renderMobileApp-B0z6-x58.js +25 -0
- package/dist/assets/runtimeEndpointReset-uu1DBwLL.js +52 -0
- package/dist/assets/{scheduledTasksApi-BZCNJ588.js → scheduledTasksApi-BuzWT445.js} +1 -1
- package/dist/assets/{shikiHighlight-BSUEa3yF.js → shikiHighlight-BWGrY5YU.js} +1 -1
- package/dist/assets/{textMateThemeFromAppTheme-CsATFZIV.js → textMateThemeFromAppTheme-BSUFChBY.js} +1 -1
- package/dist/assets/tr-DXEDSoYO.js +7 -0
- package/dist/assets/uk-C8hN--q_.js +16 -0
- package/dist/assets/useAppFontEffects-Dsl_sLrj.js +7366 -0
- package/dist/assets/useInlineCommentController-d5vntsQ_.js +2 -0
- package/dist/assets/{useRootScrollLock-Cp1eFoM2.js → useRootScrollLock-2rd5Y6gR.js} +2 -2
- package/dist/assets/{vendor-base-ui-CsXYnR5c.js → vendor-base-ui-DnNniUWp.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-BwwommM0.js → vendor-codemirror-language-data-B1EetJur.js} +2 -2
- package/dist/assets/vendor-opencode-client-DSZl7jSi.js +12 -0
- package/dist/assets/{vendor-tanstack-react-virtual-ClYN8CzB.js → vendor-tanstack-react-virtual--0sBrLRh.js} +1 -1
- package/dist/assets/{vendor-tanstack-virtual-core-BewVQryB.js → vendor-tanstack-virtual-core-BoA4iGMw.js} +1 -1
- package/dist/assets/{vendor-zod-BSoePkpP.js → vendor-zod-CxRSdNoV.js} +4 -4
- package/dist/assets/{web-components-D3Yjr4Zx.js → web-components-ngpHPEDU.js} +1 -1
- package/dist/assets/zh-CN-CtzXdjMZ.js +16 -0
- package/dist/assets/zh-TW-Ds0CADSz.js +16 -0
- package/dist/index.html +5 -5
- package/dist/mini-chat.html +5 -5
- package/dist/mobile.html +5 -5
- package/package.json +5 -5
- package/server/index.js +82 -4
- package/server/lib/agent-tool/DOCUMENTATION.md +8 -1
- package/server/lib/agent-tool/runtime.js +13 -4
- package/server/lib/agent-tool/runtime.test.js +15 -0
- package/server/lib/context-obligatory/DOCUMENTATION.md +10 -7
- package/server/lib/context-obligatory/runtime.js +2 -1
- package/server/lib/context-obligatory/runtime.test.js +76 -30
- package/server/lib/dictation/DOCUMENTATION.md +4 -1
- package/server/lib/dictation/openai-compatible-session.js +7 -0
- package/server/lib/enterprise-mode.d.ts +30 -0
- package/server/lib/enterprise-mode.js +253 -0
- package/server/lib/enterprise-mode.test.js +247 -0
- package/server/lib/event-stream/translate-v2.js +6 -0
- package/server/lib/event-stream/translate-v2.test.js +6 -0
- package/server/lib/git/DOCUMENTATION.md +2 -1
- package/server/lib/git/routes.js +44 -1
- package/server/lib/git/routes.test.js +98 -1
- package/server/lib/git/service.js +146 -11
- package/server/lib/git/service.test.js +195 -0
- package/server/lib/github/routes.js +9 -19
- package/server/lib/github/routes.test.js +112 -0
- package/server/lib/guests/DOCUMENTATION.md +4 -2
- package/server/lib/guests/background.test.js +1 -1
- package/server/lib/guests/catalog.js +56 -2
- package/server/lib/guests/catalog.test.js +24 -1
- package/server/lib/guests/clone-network.test.js +52 -0
- package/server/lib/guests/clone.js +30 -4
- package/server/lib/guests/enterprise.js +68 -0
- package/server/lib/guests/enterprise.test.js +106 -0
- package/server/lib/guests/grant-scope.js +8 -2
- package/server/lib/guests/grant-scope.test.js +9 -0
- package/server/lib/guests/html-styles.js +16 -2
- package/server/lib/guests/html-styles.test.js +53 -4
- package/server/lib/guests/install.js +10 -0
- package/server/lib/guests/persist.js +1 -0
- package/server/lib/guests/routes.js +40 -5
- package/server/lib/guests/updates.js +9 -2
- package/server/lib/notifications/DOCUMENTATION.md +1 -1
- package/server/lib/notifications/runtime.js +22 -8
- package/server/lib/notifications/trigger-runtime.test.js +45 -0
- package/server/lib/openchamber-sessions/session-metadata-store.js +27 -0
- package/server/lib/openchamber-sessions/session-metadata-store.test.js +18 -0
- package/server/lib/opencode/DOCUMENTATION.md +13 -9
- package/server/lib/opencode/auth-state-runtime.js +2 -2
- package/server/lib/opencode/config-paths.test.js +1 -0
- package/server/lib/opencode/env-runtime.js +26 -3
- package/server/lib/opencode/env-runtime.test.js +57 -0
- package/server/lib/opencode/feature-routes-runtime.js +2 -0
- package/server/lib/opencode/hmr-state-runtime.js +4 -3
- package/server/lib/opencode/lifecycle.js +10 -5
- package/server/lib/opencode/lifecycle.test.js +6 -2
- package/server/lib/opencode/managed-config-file.js +2 -1
- package/server/lib/opencode/managed-config-file.test.js +18 -0
- package/server/lib/opencode/npm-registry-config.d.ts +1 -0
- package/server/lib/opencode/npm-registry-config.js +123 -0
- package/server/lib/opencode/npm-registry-config.test.js +167 -0
- package/server/lib/opencode/npm-registry.js +5 -6
- package/server/lib/opencode/npm-registry.test.js +30 -0
- package/server/lib/opencode/openchamber-routes.js +8 -0
- package/server/lib/opencode/project-icon-routes.js +2 -2
- package/server/lib/opencode/project-icon-routes.test.js +44 -0
- package/server/lib/opencode/provider-source-route.test.js +32 -0
- package/server/lib/opencode/routes.js +17 -2
- package/server/lib/opencode/settings-helpers.js +26 -3
- package/server/lib/opencode/settings-helpers.test.js +12 -5
- package/server/lib/opencode/settings-registry.json +35 -1
- package/server/lib/opencode/settings-runtime.js +1 -0
- package/server/lib/opencode/shutdown-runtime.js +2 -0
- package/server/lib/opencode/static-routes-runtime.js +9 -1
- package/server/lib/opencode/static-routes-runtime.test.js +58 -1
- package/server/lib/package-manager.js +4 -1
- package/server/lib/package-manager.test.js +24 -0
- package/server/lib/permission-auto-accept/DOCUMENTATION.md +23 -15
- package/server/lib/permission-auto-accept/modes.js +26 -0
- package/server/lib/permission-auto-accept/runtime.js +146 -40
- package/server/lib/permission-auto-accept/runtime.test.js +93 -9
- package/server/lib/quota/DOCUMENTATION.md +6 -0
- package/server/lib/quota/providers/zhipuai-coding-plan.js +74 -30
- package/server/lib/quota/providers/zhipuai-coding-plan.test.js +124 -0
- package/server/lib/relay/DOCUMENTATION.md +1 -1
- package/server/lib/relay/service.js +32 -12
- package/server/lib/relay/service.test.js +30 -0
- package/server/lib/routing/DOCUMENTATION.md +150 -41
- package/server/lib/routing/classifier.js +156 -0
- package/server/lib/routing/defaults.js +27 -0
- package/server/lib/routing/jev.js +5 -17
- package/server/lib/routing/routes.http.test.js +9 -0
- package/server/lib/routing/routes.js +27 -1
- package/server/lib/routing/runtime.js +199 -33
- package/server/lib/routing/runtime.test.js +299 -15
- package/server/lib/routing/store.js +57 -0
- package/server/lib/routing/store.test.js +37 -0
- package/server/lib/session-assist/DOCUMENTATION.md +17 -7
- package/server/lib/session-assist/context.js +42 -2
- package/server/lib/session-assist/context.test.js +38 -1
- package/server/lib/session-assist/runtime.js +57 -13
- package/server/lib/session-assist/runtime.test.js +45 -0
- package/server/lib/session-goal/DOCUMENTATION.md +47 -22
- package/server/lib/session-goal/audit.js +112 -0
- package/server/lib/session-goal/audit.test.js +58 -0
- package/server/lib/session-goal/runtime.js +113 -134
- package/server/lib/session-goal/runtime.test.js +146 -13
- package/server/lib/session-lineage.js +52 -0
- package/server/lib/session-lineage.test.js +45 -0
- package/server/lib/session-work/DOCUMENTATION.md +108 -0
- package/server/lib/session-work/questions.js +126 -0
- package/server/lib/session-work/runtime.js +278 -0
- package/server/lib/session-work/runtime.test.js +255 -0
- package/server/lib/session-work/state.js +48 -0
- package/server/lib/session-work/state.test.js +34 -0
- package/server/lib/small-model/DOCUMENTATION.md +14 -7
- package/server/lib/small-model/client.js +7 -4
- package/server/lib/small-model/index.js +11 -21
- package/server/lib/small-model/index.test.js +13 -26
- package/server/lib/spaces/DOCUMENTATION.md +79 -25
- package/server/lib/spaces/gatekeeper-channel.js +63 -11
- package/server/lib/spaces/gatekeeper-channel.test.js +34 -4
- package/server/lib/spaces/gatekeeper-program.cjs +64 -13
- package/server/lib/spaces/gatekeeper-program.test.js +115 -3
- package/server/lib/spaces/host.js +58 -13
- package/server/lib/spaces/host.test.js +34 -1
- package/server/lib/spaces/idle-stop.js +98 -0
- package/server/lib/spaces/idle-stop.test.js +130 -0
- package/server/lib/spaces/journey.js +427 -17
- package/server/lib/spaces/journey.test.js +592 -5
- package/server/lib/spaces/layout.js +27 -6
- package/server/lib/spaces/manager.test.js +1 -1
- package/server/lib/spaces/places/contract-suite.js +4 -2
- package/server/lib/spaces/places/docker-live-support.js +27 -4
- package/server/lib/spaces/places/docker.js +32 -5
- package/server/lib/spaces/places/docker.test.js +38 -8
- package/server/lib/spaces/places/escape-suite.js +32 -0
- package/server/lib/spaces/places/fake-docker.js +3 -1
- package/server/lib/spaces/places/grants.docker.live.test.js +197 -0
- package/server/lib/spaces/places/memory-place.js +3 -3
- package/server/lib/spaces/places/sessions.docker.live.test.js +4 -2
- package/server/lib/spaces/routes.js +49 -1
- package/server/lib/spaces/routes.test.js +31 -3
- package/server/lib/spaces/space-opencode.js +52 -0
- package/server/lib/spaces/space-opencode.test.js +41 -0
- package/server/lib/spaces/space-records.js +90 -2
- package/server/lib/spaces/space-records.test.js +58 -1
- package/server/lib/spaces/space-server.js +13 -1
- package/server/lib/spaces/space-server.test.js +13 -0
- package/server/lib/spaces/space-setup.js +173 -0
- package/server/lib/spaces/space-setup.test.js +174 -0
- package/server/lib/tts/DOCUMENTATION.md +3 -0
- package/server/lib/tts/base-url.js +8 -0
- package/server/lib/tts/routes.js +13 -1
- package/server/lib/tts/routes.test.js +26 -0
- package/server/lib/tunnels/DOCUMENTATION.md +2 -0
- package/server/lib/tunnels/routes.js +14 -0
- package/server/lib/tunnels/routes.test.js +26 -0
- package/server/lib/walkthrough/index.js +11 -7
- package/server/lib/walkthrough/jobs.test.js +8 -0
- package/server/lib/walkthrough/languages.js +1 -0
- package/server/lib/walkthrough/routes.js +7 -1
- package/dist/assets/FilesView-0Ie20mEk.js +0 -17
- package/dist/assets/LinearIssuesView-CSl2MUfA.js +0 -1
- package/dist/assets/MarkdownRendererImpl-DVHqZoug.js +0 -12
- package/dist/assets/OnboardingScreen-CIdXJpfc.js +0 -1
- package/dist/assets/PlanView-DEIi3Q7M.js +0 -5
- package/dist/assets/PluginPane-BEPUWVho.js +0 -3
- package/dist/assets/SettingsView-CiNh-RbW.js +0 -30
- package/dist/assets/WalkthroughView-6oE-MuDL.js +0 -4
- package/dist/assets/de-CgAJ51z7.js +0 -10
- package/dist/assets/es-zGi_ravM.js +0 -16
- package/dist/assets/fr-CPfogrWx.js +0 -14
- package/dist/assets/index-CHfphYL3.js +0 -41
- package/dist/assets/index-DvMJ3w6V.css +0 -1
- package/dist/assets/ja-DMk6wd-U.js +0 -16
- package/dist/assets/ko-BFpzJ8jc.js +0 -16
- package/dist/assets/main-anyZFMIs.js +0 -896
- package/dist/assets/markdownCore-CmM47cAE.js +0 -7
- package/dist/assets/pl-VdRPcZrB.js +0 -16
- package/dist/assets/pt-BR-BRys_lOW.js +0 -16
- package/dist/assets/renderElectronMiniChatApp-C5677jy0.js +0 -2
- package/dist/assets/renderMobileApp-D4dBBAqQ.js +0 -25
- package/dist/assets/runtimeEndpointReset-5r0hkd-2.js +0 -27
- package/dist/assets/tr-CA9ckNnm.js +0 -7
- package/dist/assets/uk-byjR-y8D.js +0 -16
- package/dist/assets/useAppFontEffects-BWQZ5DeI.js +0 -7341
- package/dist/assets/useInlineCommentController-DlFyVfBu.js +0 -2
- package/dist/assets/vendor-opencode-client-DYdsLbCM.js +0 -12
- package/dist/assets/zh-CN-DRabgxdG.js +0 -16
- package/dist/assets/zh-TW-rbY5c9UK.js +0 -16
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{f as pe,r as re,j as s,R as ue}from"./vendor-react-BUCujlKS.js";import{f as xe,h as ce,cr as Se,B as _e,I as ae,ch as je,cg as Le,bj as De,b$ as Ne,cJ as Re,z as he,ai as Ie,cf as de,iG as Te,iH as ve,t as Ee,g8 as Me}from"./useAppFontEffects-BWQZ5DeI.js";import{a as ke}from"./index-CHfphYL3.js";const Ce="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-interactive-hover hover:text-foreground";function Ve(t){const e=pe.c(61),{draft:i,onEdit:b,onDelete:f,className:E,maxWidth:H}=t,{t:n}=xe(),[N,O]=re.useState(!1),M=i.text;let J;e[0]!==M?(J=M.length>150||M.split(`
|
|
2
|
-
`).length>3,e[0]=M,e[1]=J):J=e[1];const m=J;let c;e[2]!==E?(c=ce("w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden rounded-xl border border-[var(--interactive-border)] bg-[var(--surface-elevated)] shadow-none",E),e[2]=E,e[3]=c):c=e[3];const d=H?`${Math.max(200,Math.floor(H))}px`:void 0;let k;e[4]!==d?(k={maxWidth:d},e[4]=d,e[5]=k):k=e[5];let $;e[6]===Symbol.for("react.memo_cache_sentinel")?($={backgroundColor:"color-mix(in srgb, var(--surface-muted-foreground) 8%, transparent)"},e[6]=$):$=e[6];let C;e[7]!==i.fileLabel?(C=s.jsx("span",{className:"min-w-0 max-w-[200px] truncate text-xs font-medium text-foreground",title:i.fileLabel,children:i.fileLabel}),e[7]=i.fileLabel,e[8]=C):C=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("span",{className:"text-xs text-muted-foreground",children:"•"}),e[9]=w):w=e[9];let u;e[10]!==i.endLine||e[11]!==i.startLine||e[12]!==n?(u=n("inlineComment.range.lines",{start:i.startLine,end:i.endLine}),e[10]=i.endLine,e[11]=i.startLine,e[12]=n,e[13]=u):u=e[13];const B=i.side?` (${i.side})`:"";let a;e[14]!==u||e[15]!==B?(a=s.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:[u,B]}),e[14]=u,e[15]=B,e[16]=a):a=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R={minHeight:0,minWidth:0},e[17]=R):R=e[17];let x;e[18]!==n?(x=n("inlineComment.actions.editComment"),e[18]=n,e[19]=x):x=e[19];let g;e[20]!==n?(g=n("inlineComment.actions.editComment"),e[20]=n,e[21]=g):g=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ae,{name:"pencil",className:"h-3 w-3"}),e[22]=I):I=e[22];let l;e[23]!==b||e[24]!==x||e[25]!==g?(l=s.jsx("button",{type:"button",className:Ce,style:R,onClick:b,"aria-label":x,title:g,children:I}),e[23]=b,e[24]=x,e[25]=g,e[26]=l):l=e[26];let L;e[27]===Symbol.for("react.memo_cache_sentinel")?(L={minHeight:0,minWidth:0},e[27]=L):L=e[27];let h;e[28]!==n?(h=n("inlineComment.actions.deleteComment"),e[28]=n,e[29]=h):h=e[29];let v;e[30]!==n?(v=n("inlineComment.actions.deleteComment"),e[30]=n,e[31]=v):v=e[31];let z;e[32]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(ae,{name:"close",className:"h-3 w-3"}),e[32]=z):z=e[32];let S;e[33]!==f||e[34]!==h||e[35]!==v?(S=s.jsx("button",{type:"button",className:Ce,style:L,onClick:f,"aria-label":h,title:v,children:z}),e[33]=f,e[34]=h,e[35]=v,e[36]=S):S=e[36];let D;e[37]!==a||e[38]!==l||e[39]!==S||e[40]!==C?(D=s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5",style:$,children:[C,w,a,l,S]}),e[37]=a,e[38]=l,e[39]=S,e[40]=C,e[41]=D):D=e[41];const _=N||!m,K=!N&&m&&"line-clamp-3";let p;e[42]!==K?(p=ce("whitespace-pre-wrap break-words text-sm leading-relaxed text-foreground",K),e[42]=K,e[43]=p):p=e[43];let Y;e[44]!==M||e[45]!==p?(Y=s.jsx("div",{className:p,children:M}),e[44]=M,e[45]=p,e[46]=Y):Y=e[46];let j;e[47]!==m||e[48]!==N||e[49]!==n?(j=m&&s.jsx(Se,{asChild:!0,children:s.jsx(_e,{variant:"ghost",size:"sm",className:"mt-1 h-6 w-full justify-start px-0 text-xs text-muted-foreground hover:text-foreground",children:N?s.jsxs(s.Fragment,{children:[s.jsx(ae,{name:"arrow-up-s",className:"mr-1 size-3"}),n("inlineComment.actions.showLess")]}):s.jsxs(s.Fragment,{children:[s.jsx(ae,{name:"arrow-down-s",className:"mr-1 size-3"}),n("inlineComment.actions.showMore")]})})}),e[47]=m,e[48]=N,e[49]=n,e[50]=j):j=e[50];let F;e[51]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(je,{}),e[51]=F):F=e[51];let T;e[52]!==_||e[53]!==Y||e[54]!==j?(T=s.jsx("div",{className:"px-3 py-2",children:s.jsxs(Le,{open:_,onOpenChange:O,children:[Y,j,F]})}),e[52]=_,e[53]=Y,e[54]=j,e[55]=T):T=e[55];let P;return e[56]!==c||e[57]!==D||e[58]!==T||e[59]!==k?(P=s.jsxs("div",{className:c,style:k,"data-comment-card":"true",children:[D,T]}),e[56]=c,e[57]=D,e[58]=T,e[59]=k,e[60]=P):P=e[60],P}function Xe(t){const e=pe.c(62),{initialText:i,onTextChange:b,onSave:f,onCancel:E,fileLabel:H,lineRange:n,isEditing:N,className:O,maxWidth:M}=t,J=i===void 0?"":i,{t:m}=xe(),{isMobile:c}=De(),[d,k]=ue.useState(J),$=re.useRef(null),C=Ne("enter");let w,u;e[0]!==b?(w=o=>{k(o),b?.(o),u()},u=()=>{const o=$.current;o&&(o.style.height="auto",o.style.height=`${Math.min(o.scrollHeight,120)}px`)},e[0]=b,e[1]=w,e[2]=u):(w=e[1],u=e[2]);const B=re.useRef(n);let a,R;e[3]!==n?(a=()=>{n&&(B.current=n)},R=[n],e[3]=n,e[4]=a,e[5]=R):(a=e[4],R=e[5]),re.useEffect(a,R);const x=Pe,g=x(n);let I;e[6]!==c||e[7]!==u?(I=()=>{const o=$.current;if(!o)return;u();const ie=o.closest(".overlay-scrollbar-container"),ge=ie?.scrollTop??window.scrollY,ye=ie?.scrollLeft??window.scrollX;if(c){o.scrollIntoView({behavior:"auto",block:"nearest"});try{o.focus({preventScroll:!0})}catch{o.focus()}return}try{o.focus({preventScroll:!0})}catch{o.focus()}const be=o.value.length;try{o.setSelectionRange(be,be)}catch{}requestAnimationFrame(()=>{ie?(ie.scrollTop=ge,ie.scrollLeft=ye):window.scrollTo({top:ge,left:ye})})},e[6]=c,e[7]=u,e[8]=I):I=e[8];let l;e[9]!==c?(l=[c],e[9]=c,e[10]=l):l=e[10],re.useEffect(I,l);let L;e[11]!==f||e[12]!==d?(L=()=>{d.trim()&&f(d,x(B.current))},e[11]=f,e[12]=d,e[13]=L):L=e[13];const h=L;let v;e[14]!==c||e[15]!==E||e[16]!==h?(v=o=>{Re(o)||(o.key==="Enter"&&!o.shiftKey&&(!c||o.metaKey||o.ctrlKey)?(o.preventDefault(),h()):o.key==="Escape"&&(o.preventDefault(),E()))},e[14]=c,e[15]=E,e[16]=h,e[17]=v):v=e[17];const z=v;let S;e[18]!==h?(S=o=>{o.stopPropagation(),h()},e[18]=h,e[19]=S):S=e[19];const D=S;let _;e[20]!==O?(_=ce("w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] animate-in fade-in zoom-in-95 duration-200",O),e[20]=O,e[21]=_):_=e[21];const K=M?`${Math.max(200,Math.floor(M))}px`:void 0;let p;e[22]!==K?(p={maxWidth:K},e[22]=K,e[23]=p):p=e[23];const Y="true",j=Fe,F=Ke,T="oc-glass-popover rounded-xl border border-[var(--interactive-border)] shadow-[0_4px_16px_-4px_rgb(0_0_0_/_0.12)]",P=H||g?s.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2 text-xs font-medium text-muted-foreground opacity-60",children:[H?s.jsx("span",{className:"max-w-[200px] truncate",children:H}):null,H&&g?s.jsx("span",{children:"•"}):null,g?s.jsx("span",{children:m("inlineComment.range.lines",{start:g.start,end:g.end})}):null]}):null,V="flex items-end gap-2 py-1 pl-3 pr-1",oe=1;let W;e[24]!==w?(W=o=>w(o.target.value),e[24]=w,e[25]=W):W=e[25];const r=c?m("inlineComment.input.placeholderShort"):m("inlineComment.input.placeholder",{shortcut:C}),y=c?"py-1.5 text-base leading-6":"py-1.5";let A;e[26]!==y?(A=ce("min-w-0 flex-1 resize-none bg-transparent text-sm leading-5 text-foreground outline-none placeholder:text-muted-foreground placeholder:opacity-60",y),e[26]=y,e[27]=A):A=e[27];let U;e[28]===Symbol.for("react.memo_cache_sentinel")?(U={minHeight:0,height:"auto"},e[28]=U):U=e[28];let G;e[29]!==z||e[30]!==W||e[31]!==r||e[32]!==A||e[33]!==d?(G=s.jsx("textarea",{ref:$,rows:oe,value:d,onChange:W,onKeyDown:z,placeholder:r,className:A,style:U}),e[29]=z,e[30]=W,e[31]=r,e[32]=A,e[33]=d,e[34]=G):G=e[34];let q;e[35]!==d?(q=d.trim(),e[35]=d,e[36]=q):q=e[36];const X=!q,le=c?"h-9 w-9":"h-8 w-8";let Q;e[37]!==le?(Q=ce("mb-0.5 flex shrink-0 items-center justify-center rounded-full bg-[var(--primary-base)] text-[var(--primary-foreground)] transition-opacity duration-150 hover:opacity-90 disabled:opacity-40",le),e[37]=le,e[38]=Q):Q=e[38];let Z;e[39]!==m?(Z=m("inlineComment.actions.comment"),e[39]=m,e[40]=Z):Z=e[40];let ee;e[41]!==m?(ee=m("inlineComment.actions.comment"),e[41]=m,e[42]=ee):ee=e[42];let me;e[43]===Symbol.for("react.memo_cache_sentinel")?(me=s.jsx(ae,{name:"attachment-2",className:"h-4 w-4"}),e[43]=me):me=e[43];let te;e[44]!==D||e[45]!==X||e[46]!==Q||e[47]!==Z||e[48]!==ee?(te=s.jsx("button",{type:"button",onClick:D,onPointerDown:ze,onTouchStart:$e,disabled:X,className:Q,"aria-label":Z,title:ee,children:me}),e[44]=D,e[45]=X,e[46]=Q,e[47]=Z,e[48]=ee,e[49]=te):te=e[49];let ne;e[50]!==G||e[51]!==te?(ne=s.jsxs("div",{className:V,children:[G,te]}),e[50]=G,e[51]=te,e[52]=ne):ne=e[52];let se;e[53]!==P||e[54]!==ne?(se=s.jsxs("div",{className:T,children:[P,ne]}),e[53]=P,e[54]=ne,e[55]=se):se=e[55];let fe;return e[56]!==_||e[57]!==p||e[58]!==j||e[59]!==F||e[60]!==se?(fe=s.jsx("div",{className:_,style:p,"data-comment-input":Y,onPointerDown:j,onTouchStart:F,children:se}),e[56]=_,e[57]=p,e[58]=j,e[59]=F,e[60]=se,e[61]=fe):fe=e[61],fe}function $e(t){return t.stopPropagation()}function ze(t){return t.stopPropagation()}function Ke(t){return t.stopPropagation()}function Fe(t){return t.stopPropagation()}function Pe(t){if(!t)return;const e=Math.min(t.start,t.end),i=Math.max(t.start,t.end);return{...t,start:e,end:i}}const Ae=t=>{const e=Math.min(t.startLine,t.endLine),i=Math.max(t.startLine,t.endLine);return{...t,startLine:e,endLine:i}},we=t=>{const e=Math.min(t.start,t.end),i=Math.max(t.start,t.end);return{...t,start:e,end:i}};function Qe(t){const e=pe.c(47),{t:i}=xe(),{source:b,fileLabel:f,language:E,getCodeForRange:H,toStoreRange:n,fromDraftRange:N}=t,O=he(Be),M=he(qe),J=Ie();let m;e[0]!==O?(m=r=>O?r.getDirectoryForSession(O):null,e[0]=O,e[1]=m):m=e[1];const c=he(m),d=de(We),k=de(Oe),$=de(He),[C,w]=ue.useState(null),[u,B]=ue.useState(""),[a,R]=ue.useState(null),x=O??(M?"draft":null),g=c??J;let I;e:{if(!x||!g){I=null;break e}let r;e[2]!==g||e[3]!==x?(r={directory:g,sessionKey:x},e[2]=g,e[3]=x,e[4]=r):r=e[4],I=r}const l=I;let L;e[5]!==l?(L=l?Te(ke(),l.directory,l.sessionKey):null,e[5]=l,e[6]=L):L=e[6];const h=L;let v;e[7]!==h?(v=r=>h?r.drafts[h]??ve:ve,e[7]=h,e[8]=v):v=e[8];const z=de(v);let S;e:{if(!l||!f){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[9]=y):y=e[9],S=y;break e}let r;if(e[10]!==f||e[11]!==z||e[12]!==b){let y;e[14]!==f||e[15]!==b?(y=A=>A.source===b&&A.fileLabel===f,e[14]=f,e[15]=b,e[16]=y):y=e[16],r=z.filter(y),e[10]=f,e[11]=z,e[12]=b,e[13]=r}else r=e[13];S=r}const D=S;let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{w(null),B(""),R(null)},e[17]=_):_=e[17];const K=_;let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{K()},e[18]=p):p=e[18];const Y=p;let j;e[19]!==N?(j=r=>{const y=we(N(r));w(y),B(r.text),R(r.id)},e[19]=N,e[20]=j):j=e[20];const F=j;let T;e[21]!==a||e[22]!==$||e[23]!==l?(T=r=>{l&&($(l,r.id),a===r.id&&K())},e[21]=a,e[22]=$,e[23]=l,e[24]=T):T=e[24];const P=T;let V;e[25]!==d||e[26]!==a||e[27]!==f||e[28]!==H||e[29]!==E||e[30]!==C||e[31]!==b||e[32]!==i||e[33]!==l||e[34]!==n||e[35]!==k?(V=(r,y)=>{const A=y??C,U=r.trim();if(!A||!U||!f)return;if(!l){Ee.error(i("inlineComment.toast.selectSessionToSave"));return}const G=we(A),q=Ae(n(G)),X=H(G),le=!a;a?k(l,a,{fileLabel:f,startLine:q.startLine,endLine:q.endLine,side:q.side,code:X,language:E,text:U}):d(l,{source:b,fileLabel:f,startLine:q.startLine,endLine:q.endLine,side:q.side,code:X,language:E,text:U}),K(),le&&requestAnimationFrame(Me)},e[25]=d,e[26]=a,e[27]=f,e[28]=H,e[29]=E,e[30]=C,e[31]=b,e[32]=i,e[33]=l,e[34]=n,e[35]=k,e[36]=V):V=e[36];const oe=V;let W;return e[37]!==u||e[38]!==P||e[39]!==D||e[40]!==a||e[41]!==N||e[42]!==oe||e[43]!==C||e[44]!==x||e[45]!==F?(W={sessionKey:x,drafts:D,selection:C,setSelection:w,commentText:u,setCommentText:B,editingDraftId:a,setEditingDraftId:R,reset:K,cancel:Y,startEdit:F,deleteDraft:P,saveComment:oe,fromDraftRange:N},e[37]=u,e[38]=P,e[39]=D,e[40]=a,e[41]=N,e[42]=oe,e[43]=C,e[44]=x,e[45]=F,e[46]=W):W=e[46],W}function He(t){return t.removeDraft}function Oe(t){return t.updateDraft}function We(t){return t.addDraft}function qe(t){return t.newSessionDraft?.open}function Be(t){return t.currentSessionId}export{Xe as I,Ve as a,we as n,Qe as u};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var $=Object.defineProperty,w=o=>o;function q(o,c){this[o]=w.bind(null,c)}var T=(o,c)=>{for(var r in c)$(o,r,{get:c[r],enumerable:!0,configurable:!0,set:q.bind(c,r)})},E={};T(E,{SharedEvents:()=>E,make:()=>C});function C(o){let c;function u(s){s.connected=void 0,s.controller.abort(),c===s&&(c=void 0)}async function p(s){let l,e={};try{if(s.controller.signal.aborted)return;for(l=o(s.controller.signal,()=>{s.subscribers.forEach(t=>t.activity?.())})[Symbol.asyncIterator]();!s.controller.signal.aborted;){const t=await l.next();if(t.done||s.controller.signal.aborted)break;t.value.type==="server.connected"&&(s.connected=t.value),s.subscribers.forEach(a=>a.push(t.value))}}catch(t){e={error:t}}finally{u(s);try{await l?.return?.()}catch(t){"error"in e||(e={error:t})}s.subscribers.forEach(t=>t.finish(e))}}return{subscribe(s){return{[Symbol.asyncIterator](){const l=[],e=[];let t=!1,a,n;function h(m,y=!0){a=m,y&&(e.length=0),s?.signal?.removeEventListener("abort",d),n?.subscribers.delete(i)&&!n.subscribers.size&&u(n),l.splice(0).forEach(f=>{"error"in m?f.reject(m.error):f.resolve({done:!0,value:void 0})})}function d(){h({})}const i={activity:s?.onActivity,finish(m){h(m,!1)},push(m){if(a)return;const y=l.shift();if(y){y.resolve({done:!1,value:m});return}if(e.length===4096){h({error:new Error("Event subscriber exceeded its 4096-event capacity")});return}e.push(m)}};function I(){if(a)return;const m=!c;n=c??{controller:new AbortController,subscribers:new Set},c=n,n.subscribers.add(i),n.connected&&i.push(n.connected),m&&p(n)}return{next(){const m=e.shift();if(m)return Promise.resolve({done:!1,value:m});if(a)return"error"in a?Promise.reject(a.error):Promise.resolve({done:!0,value:void 0});if(s?.signal?.aborted)return d(),Promise.resolve({done:!0,value:void 0});const y=Promise.withResolvers();return l.push(y),t||(t=!0,s?.signal?.addEventListener("abort",d,{once:!0}),I()),y.promise},return(){return h({}),Promise.resolve({done:!0,value:void 0})}}}}}}}class S extends Error{reason;name="ClientError";constructor(c,r){const u=r?.detail??(r?.cause instanceof Error?r.cause.message:void 0);super(u?`${c}: ${u}`:c,r),this.reason=c}}var x={};T(x,{make:()=>R});var P=16*1024*1024;function R(o){const c=o.fetch??globalThis.fetch,r=(e,t)=>{const a=new URL(o.baseUrl);a.pathname.endsWith("/")||(a.pathname+="/");const n=new URL(e.path.slice(1),a);for(const[d,i]of Object.entries(e.query??{}))g(n.searchParams,d,i);const h=new Headers(o.headers);for(const[d,i]of Object.entries(e.headers??{}))i!=null&&h.set(d,String(i));for(const[d,i]of new Headers(t?.headers))h.set(d,i);return e.body!==void 0&&!h.has("content-type")&&h.set("content-type",e.binaryBody?"application/octet-stream":"application/json"),{url:n,init:{method:e.method,signal:t?.signal,headers:h,body:e.body===void 0?void 0:e.binaryBody?e.body:JSON.stringify(e.body)}}},u=async(e,t)=>{try{const a=r(e,t);return await c(a.url,a.init)}catch(a){throw new S("Transport",{cause:a})}},p=async(e,t)=>{if(t.declaredStatuses.includes(e.status))throw O(await D(e));try{await e.body?.cancel()}catch{}throw new S("UnexpectedStatus",{cause:{status:e.status},detail:String(e.status)})},s=async(e,t)=>{const a=await u(e,t);if(a.status!==e.successStatus)return p(a,e);if(e.binary)return new Uint8Array(await a.arrayBuffer());if(e.empty){try{await a.body?.cancel()}catch{}return}return await D(a)},l=(e,t)=>({async*[Symbol.asyncIterator](){const a=await u(e,t);if(a.status!==e.successStatus&&await p(a,e),!U(a,"text/event-stream")){try{await a.body?.cancel()}catch{}throw new S("UnsupportedContentType",{detail:a.headers.get("content-type")})}if(a.body===null)throw new S("MalformedResponse");const n=a.body.getReader(),h=new TextDecoder;let d="";try{for(;;){let i;try{i=await n.read()}catch(y){throw new S("Transport",{cause:y})}if(i.done||t?.onActivity?.(),d+=h.decode(i.value,{stream:!i.done}),d.length>P)throw new S("SseEventTooLarge");const I=!i.done&&d.endsWith("\r");I&&(d=d.slice(0,-1)),d=d.replaceAll(`\r
|
|
2
|
-
`,`
|
|
3
|
-
`).replaceAll("\r",`
|
|
4
|
-
`),I&&(d+="\r"),i.done&&d!==""&&(d+=`
|
|
5
|
-
|
|
6
|
-
`);let m=d.indexOf(`
|
|
7
|
-
|
|
8
|
-
`);for(;m>=0;){const y=d.slice(0,m);d=d.slice(m+2);const f=y.split(`
|
|
9
|
-
`).flatMap(b=>b.startsWith("data:")?[b.slice(5).trimStart()]:[]).join(`
|
|
10
|
-
`);if(f!=="")try{yield JSON.parse(f)}catch(b){throw new S("MalformedResponse",{cause:b})}m=d.indexOf(`
|
|
11
|
-
|
|
12
|
-
`)}if(i.done)return}}finally{try{await n.cancel()}catch{}n.releaseLock()}}});return{server:{info:e=>s({method:"GET",path:"/api/info",successStatus:200,declaredStatuses:[400,401],empty:!1},e)},location:{get:(e,t)=>s({method:"GET",path:"/api/location",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),reload:e=>s({method:"POST",path:"/api/location/reload",successStatus:204,declaredStatuses:[400,401,503],empty:!0},e)},agent:{list:(e,t)=>s({method:"GET",path:"/api/agent",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),get:(e,t)=>s({method:"GET",path:`/api/agent/${encodeURIComponent(e.agentID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},plugin:{list:(e,t)=>s({method:"GET",path:"/api/plugin",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),check:(e,t)=>s({method:"POST",path:"/api/plugin/check",query:{location:e?.location},body:{target:e?.target},successStatus:200,declaredStatuses:[400,401],empty:!1},t),update:(e,t)=>s({method:"POST",path:"/api/plugin/update",query:{location:e.location},body:{targets:e.targets},successStatus:204,declaredStatuses:[400,401,503],empty:!0},t)},session:{list:(e,t)=>s({method:"GET",path:"/api/session",query:{limit:e?.limit,order:e?.order,search:e?.search,parentID:e?.parentID,directory:e?.directory,project:e?.project,subpath:e?.subpath,cursor:e?.cursor},successStatus:200,declaredStatuses:[400,401],empty:!1},t),stats:(e,t)=>s({method:"GET",path:"/api/experimental/session/stats",query:{from:e?.from,to:e?.to,project:e?.project,timezone:e?.timezone,tools:e?.tools},successStatus:200,declaredStatuses:[400,401],empty:!1},t).then(a=>a.data),create:(e,t)=>s({method:"POST",path:"/api/session",body:{id:e?.id,title:e?.title,agent:e?.agent,model:e?.model,location:e?.location,metadata:e?.metadata,permissions:e?.permissions},successStatus:200,declaredStatuses:[400,401],empty:!1},t).then(a=>a.data),import:(e,t)=>s({method:"POST",path:"/api/experimental/session/import",body:{info:e.info,messages:e.messages,location:e.location},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(a=>a.data),export:(e,t)=>s({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/export`,query:{sanitize:e.sanitize},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then(a=>a.data),active:e=>s({method:"GET",path:"/api/session/active",successStatus:200,declaredStatuses:[400,401],empty:!1},e).then(t=>t.data),get:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),remove:(e,t)=>s({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),fork:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/fork`,body:{before:e.before},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),switchAgent:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/agent`,body:{agent:e.agent},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),switchModel:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/model`,body:{model:e.model},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>s({method:"PATCH",path:`/api/session/${encodeURIComponent(e.sessionID)}`,body:{title:e.title,metadata:e.metadata,permissions:e.permissions},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),move:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/move`,body:{directory:e.directory,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),prompt:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/prompt`,body:{id:e.id,text:e.text,files:e.files,agents:e.agents,skills:e.skills,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(a=>a.data),command:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/command`,body:{name:e.name,text:e.text,files:e.files,agents:e.agents,skills:e.skills,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,500],empty:!0},t),skill:(e,t)=>s({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/skill`,body:{id:e.id,resume:e.resume},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),synthetic:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/synthetic`,body:{id:e.id,text:e.text,description:e.description,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(a=>a.data),shell:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/shell`,body:{id:e.id,command:e.command},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),compact:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/compact`,body:{id:e.id,delivery:e.delivery},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(a=>a.data),wait:(e,t)=>s({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/wait`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),revert:{stage:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/stage`,body:{messageID:e.messageID,files:e.files},successStatus:200,declaredStatuses:[400,401,404,409,500],empty:!1},t).then(a=>a.data),clear:(e,t)=>s({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert`,successStatus:204,declaredStatuses:[400,401,404,409,500],empty:!0},t),commit:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/commit`,successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},context:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/context`,successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then(a=>a.data),diff:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/diff`,query:{from:e.from,to:e.to,context:e.context},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then(a=>a.data),inbox:{list:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),cancel:(e,t)=>s({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>s({method:"PATCH",path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,body:{delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},instructions:{entry:{list:(e,t)=>s({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),put:(e,t)=>s({method:"PUT",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,body:{value:e.value},successStatus:204,declaredStatuses:[400,401,404,413],empty:!0},t),remove:(e,t)=>s({method:"DELETE",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},generate:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/generate`,body:{prompt:e.prompt},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(a=>a.data),log:(e,t)=>l({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/log`,query:{after:e.after,follow:e.follow},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),interrupt:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/interrupt`,query:{resume:e.resume},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),background:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/background`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),message:{get:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/message/${encodeURIComponent(e.messageID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data)},form:{list:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),create:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,body:{id:e.id,title:e.title,metadata:e.metadata,fields:e.fields},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(a=>a.data),get:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),reply:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}/reply`,body:{answer:e.answer},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t),cancel:(e,t)=>s({method:"DELETE",path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},environment:(e,t)=>s({method:"PUT",path:`/api/session/${encodeURIComponent(e.sessionID)}/environment`,body:{variables:e.variables},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),view:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/view`,body:{idle:e.idle},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},message:{list:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/message`,query:{limit:e.limit,order:e.order,cursor:e.cursor,type:e.type},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t)},model:{list:(e,t)=>s({method:"GET",path:"/api/model",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t),default:(e,t)=>s({method:"GET",path:"/api/model/default",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t)},generate:{text:(e,t)=>s({method:"POST",path:"/api/experimental/generate",body:{prompt:e.prompt,model:e.model},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then(a=>a.data)},provider:{list:(e,t)=>s({method:"GET",path:"/api/provider",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t),get:(e,t)=>s({method:"GET",path:`/api/provider/${encodeURIComponent(e.providerID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},integration:{list:(e,t)=>s({method:"GET",path:"/api/integration",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),get:(e,t)=>s({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),wellknown:{add:(e,t)=>s({method:"POST",path:"/api/experimental/integration/wellknown",query:{location:e.location},body:{url:e.url},successStatus:204,declaredStatuses:[400,401],empty:!0},t)},connect:{key:(e,t)=>s({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/key`,query:{location:e.location},body:{key:e.key,answer:e.answer,label:e.label},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},oauth:{connect:(e,t)=>s({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth`,query:{location:e.location},body:{methodID:e.methodID,answer:e.answer,label:e.label},successStatus:200,declaredStatuses:[400,401],empty:!1},t),status:(e,t)=>s({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),complete:(e,t)=>s({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}/complete`,query:{location:e.location},body:{code:e.code},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),cancel:(e,t)=>s({method:"DELETE",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401],empty:!0},t)},command:{connect:(e,t)=>s({method:"POST",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command`,query:{location:e.location},body:{methodID:e.methodID,label:e.label},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),status:(e,t)=>s({method:"GET",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),cancel:(e,t)=>s({method:"DELETE",path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401],empty:!0},t)}},mcp:{list:(e,t)=>s({method:"GET",path:"/api/mcp",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),add:(e,t)=>s({method:"PUT",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},body:{config:e.config},successStatus:204,declaredStatuses:[400,401],empty:!0},t),remove:(e,t)=>s({method:"DELETE",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:(e,t)=>s({method:"POST",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/connect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),disconnect:(e,t)=>s({method:"POST",path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/disconnect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),resource:{catalog:(e,t)=>s({method:"GET",path:"/api/mcp/resource",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t)}},credential:{update:(e,t)=>s({method:"PATCH",path:`/api/credential/${encodeURIComponent(e.credentialID)}`,body:{label:e.label},successStatus:204,declaredStatuses:[400,401],empty:!0},t),activate:(e,t)=>s({method:"POST",path:`/api/credential/${encodeURIComponent(e.credentialID)}/activate`,successStatus:204,declaredStatuses:[400,401],empty:!0},t),remove:(e,t)=>s({method:"DELETE",path:`/api/credential/${encodeURIComponent(e.credentialID)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},project:{list:e=>s({method:"GET",path:"/api/project",successStatus:200,declaredStatuses:[400,401],empty:!1},e),update:(e,t)=>s({method:"PATCH",path:`/api/project/${encodeURIComponent(e.projectID)}`,body:{canonical:e.canonical,name:e.name,icon:e.icon,commands:e.commands},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},form:{list:(e,t)=>s({method:"GET",path:"/api/form",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},permission:{request:{list:(e,t)=>s({method:"GET",path:"/api/permission/request",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},saved:{list:(e,t)=>s({method:"GET",path:"/api/permission/saved",query:{projectID:e?.projectID},successStatus:200,declaredStatuses:[400,401],empty:!1},t).then(a=>a.data),remove:(e,t)=>s({method:"DELETE",path:`/api/permission/saved/${encodeURIComponent(e.id)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},create:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,body:{id:e.id,action:e.action,resources:e.resources,save:e.save,metadata:e.metadata,source:e.source,agent:e.agent},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),list:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),get:(e,t)=>s({method:"GET",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(a=>a.data),reply:(e,t)=>s({method:"POST",path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}/reply`,body:{decision:e.decision,message:e.message},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},file:{read:(e,t)=>s({method:"GET",path:`/api/fs/read/${G(e.path)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t),list:(e,t)=>s({method:"GET",path:"/api/fs/list",query:{location:e?.location,path:e?.path},successStatus:200,declaredStatuses:[400,401],empty:!1},t),find:(e,t)=>s({method:"GET",path:"/api/fs/find",query:{location:e.location,query:e.query,type:e.type,limit:e.limit},successStatus:200,declaredStatuses:[400,401],empty:!1},t),write:(e,t)=>s({method:"POST",path:"/api/experimental/fs/write",query:{location:e.location,path:e.path},body:e.payload,successStatus:200,declaredStatuses:[400,401],empty:!1,binaryBody:!0},t)},command:{list:(e,t)=>s({method:"GET",path:"/api/command",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},skill:{list:(e,t)=>s({method:"GET",path:"/api/skill",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},rpc:{call:(e,t)=>s({method:"POST",path:`/api/rpc/${encodeURIComponent(e.rpcID)}/${encodeURIComponent(e.method)}`,query:{location:e.location},body:{input:e.input},successStatus:200,declaredStatuses:[400,401,500],empty:!1},t)},event:{subscribe:e=>l({method:"GET",path:"/api/event",successStatus:200,declaredStatuses:[400,401],empty:!1},e)},pty:{list:(e,t)=>s({method:"GET",path:"/api/pty",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),create:(e,t)=>s({method:"POST",path:"/api/pty",query:{location:e?.location},body:{command:e?.command,args:e?.args,cwd:e?.cwd,title:e?.title,env:e?.env},successStatus:200,declaredStatuses:[400,401],empty:!1},t),get:(e,t)=>s({method:"GET",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),update:(e,t)=>s({method:"PUT",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},body:{title:e.title,size:e.size},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>s({method:"DELETE",path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:{token:(e,t)=>s({method:"POST",path:`/api/pty/${encodeURIComponent(e.ptyID)}/connect-token`,query:{location:e.location},headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t)}},experimental:{persistentPty:{read:(e,t)=>s({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal/read`,query:{lines:e.lines},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then(a=>a.data),list:(e,t)=>s({method:"GET",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then(a=>a.data),create:(e,t)=>s({method:"POST",path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,body:{command:e.command,args:e.args,cwd:e.cwd,title:e.title,env:e.env,size:e.size},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then(a=>a.data),shutdown:e=>s({method:"POST",path:"/api/experimental/persistent-pty/shutdown",successStatus:204,declaredStatuses:[400,401,503],empty:!0},e),handoff:e=>s({method:"POST",path:"/api/experimental/persistent-pty/handoff",successStatus:200,declaredStatuses:[400,401,503],empty:!1},e),get:(e,t)=>s({method:"GET",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(a=>a.data),update:(e,t)=>s({method:"PUT",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,body:{attachmentID:e.attachmentID,size:e.size},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(a=>a.data),snapshot:(e,t)=>s({method:"GET",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/snapshot`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(a=>a.data),remove:(e,t)=>s({method:"DELETE",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),connectToken:(e,t)=>s({method:"POST",path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/connect-token`,headers:{"x-opencode-ticket":e["x-opencode-ticket"]},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t).then(a=>a.data)}},shell:{list:(e,t)=>s({method:"GET",path:"/api/shell",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),create:(e,t)=>s({method:"POST",path:"/api/shell",query:{location:e.location},body:{command:e.command,cwd:e.cwd,timeout:e.timeout,metadata:e.metadata},successStatus:200,declaredStatuses:[400,401],empty:!1},t),get:(e,t)=>s({method:"GET",path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),output:(e,t)=>s({method:"GET",path:`/api/shell/${encodeURIComponent(e.id)}/output`,query:{location:e.location,cursor:e.cursor,limit:e.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>s({method:"DELETE",path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401],empty:!0},t)},reference:{list:(e,t)=>s({method:"GET",path:"/api/reference",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},worktree:{list:(e,t)=>s({method:"GET",path:"/api/worktree",query:{projectID:e.projectID},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>s({method:"POST",path:"/api/worktree",body:{projectID:e.projectID,from:e.from,branch:e.branch,directory:e.directory,name:e.name},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>s({method:"DELETE",path:"/api/worktree",body:{projectID:e.projectID,directory:e.directory,force:e.force},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),refresh:(e,t)=>s({method:"POST",path:"/api/worktree/refresh",body:{projectID:e.projectID},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},vcs:{get:(e,t)=>s({method:"GET",path:"/api/vcs",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),base:(e,t)=>s({method:"GET",path:"/api/vcs/base",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t),status:(e,t)=>s({method:"GET",path:"/api/vcs/status",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),branch:{list:(e,t)=>s({method:"GET",path:"/api/vcs/branch",query:{location:e?.location,search:e?.search,limit:e?.limit},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},diff:(e,t)=>s({method:"GET",path:"/api/vcs/diff",query:{location:e.location,mode:e.mode,base:e.base,context:e.context},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t)},debug:{location:{list:e=>s({method:"GET",path:"/api/debug/location",successStatus:200,declaredStatuses:[400,401],empty:!1},e),evict:(e,t)=>s({method:"DELETE",path:"/api/debug/location",query:{location:e?.location},successStatus:204,declaredStatuses:[400,401],empty:!0},t)}},migration:{v1:{status:e=>s({method:"GET",path:"/api/experimental/migration/v1",successStatus:200,declaredStatuses:[400,401],empty:!1},e)}},websearch:{providers:(e,t)=>s({method:"GET",path:"/api/websearch/provider",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t),query:(e,t)=>s({method:"POST",path:"/api/websearch",query:{location:e.location},body:{query:e.query,providerID:e.providerID},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t)},config:{get:(e,t)=>s({method:"GET",path:"/api/config",query:{location:e?.location},successStatus:200,declaredStatuses:[400,401],empty:!1},t),shells:e=>s({method:"GET",path:"/api/config/shell",successStatus:200,declaredStatuses:[400,401],empty:!1},e),update:(e,t)=>s({method:"PATCH",path:"/api/experimental/config",body:{shell:e.shell},successStatus:204,declaredStatuses:[400,401],empty:!0},t)}}}function G(o){return o.split("/").map(encodeURIComponent).join("/")}function g(o,c,r){if(r!==void 0){if(r===null){o.append(c,"null");return}if(Array.isArray(r)){for(const u of r)g(o,c,u);return}if(typeof r=="object"){for(const[u,p]of Object.entries(r))g(o,`${c}[${u}]`,p);return}o.append(c,String(r))}}async function D(o){if(!U(o,"application/json")&&!o.headers.get("content-type")?.includes("+json")){try{await o.body?.cancel()}catch{}throw new S("UnsupportedContentType",{detail:o.headers.get("content-type")})}let c;try{c=await o.text()}catch(r){throw new S("Transport",{cause:r})}if(c==="")throw new S("MalformedResponse");try{return JSON.parse(c)}catch(r){throw new S("MalformedResponse",{cause:r})}}function O(o){const c=Object.assign(new Error(o.message??o.data?.message),o);return o._tag&&(c.name=o._tag),c}function U(o,c){return o.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase()===c}var k=o=>typeof o=="object"&&o!==null&&"_tag"in o&&o._tag==="RpcError",j=o=>typeof o=="object"&&o!==null&&"_tag"in o&&o._tag==="RpcInternalError";function L(o,c){return r=>{const u=(p,s)=>{if(!Object.hasOwn(r.events,p))throw new Error(`Unknown RPC event: ${r.id}.${p}`);const l=A(r,p);return{[Symbol.asyncIterator](){const e=new AbortController,t=s?.signal?AbortSignal.any([e.signal,s.signal]):e.signal,a=(async function*(){try{for await(const n of c.subscribe({signal:t})){if(t.aborted)return;n.type===l&&(yield n)}}catch(n){if(!t.aborted)throw n}finally{e.abort()}})();return{next:()=>a.next(),return:()=>(e.abort(),a.return())}}}};return Object.assign(Object.fromEntries(Object.keys(r.methods).map(p=>[p,async(s,l)=>{try{return(await o.rpc.call({rpcID:r.id,method:p,input:s,location:l?.location},{signal:l?.signal,headers:l?.headers})).output}catch(e){throw!k(e)&&!j(e)?e:e.data===void 0?{type:e.type,message:e.message}:{type:e.type,message:e.message,data:e.data}}}])),{events:{subscribe:u,on:(p,s,l)=>{const e=new AbortController,t=l?.signal?AbortSignal.any([e.signal,l.signal]):e.signal,a=u(p,{signal:t});return(async()=>{for await(const n of a)await s(n)})().catch(n=>console.error(n)),()=>e.abort()}}})}}function A(o,c){return`rpc.${o.id}.${c}`}var v={};T(v,{OpenCode:()=>v,make:()=>_});function _(o){const c=R(o),r=C((u,p)=>c.event.subscribe({signal:u,onActivity:p}));return{...c,rpc:Object.assign(L(c,r),c.rpc),event:r}}export{S as C,v as e};
|